summaryrefslogtreecommitdiffstats
path: root/lib/routemap_cli.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-03-22 21:24:23 +0100
committerIgor Ryzhov <iryzhov@nfware.com>2021-03-23 14:24:40 +0100
commitde8936be5e298103160ce6862e5a94d108c80ec7 (patch)
tree836ce074152a592a84c1687fb3132fc80b4e346c /lib/routemap_cli.c
parentlib: add ability to sort CLI commands printed by NB layer (diff)
downloadfrr-de8936be5e298103160ce6862e5a94d108c80ec7.tar.xz
frr-de8936be5e298103160ce6862e5a94d108c80ec7.zip
lib: sort route-map commands by sequence number in running-config
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/routemap_cli.c')
-rw-r--r--lib/routemap_cli.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/routemap_cli.c b/lib/routemap_cli.c
index 339d02512..bf61e10fe 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)
{