From de8936be5e298103160ce6862e5a94d108c80ec7 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Mon, 22 Mar 2021 23:24:23 +0300 Subject: lib: sort route-map commands by sequence number in running-config Signed-off-by: Igor Ryzhov --- lib/routemap_cli.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/routemap_cli.c') diff --git a/lib/routemap_cli.c b/lib/routemap_cli.c index 339d025124..bf61e10fe4 100644 --- a/lib/routemap_cli.c +++ b/lib/routemap_cli.c @@ -113,6 +113,14 @@ DEFPY_YANG( return nb_cli_apply_changes(vty, NULL); } +int route_map_instance_cmp(struct lyd_node *dnode1, struct lyd_node *dnode2) +{ + uint16_t seq1 = yang_dnode_get_uint16(dnode1, "./sequence"); + uint16_t seq2 = yang_dnode_get_uint16(dnode2, "./sequence"); + + return seq1 - seq2; +} + void route_map_instance_show(struct vty *vty, struct lyd_node *dnode, bool show_defaults) { -- cgit v1.2.3