From 73695730f55a25cae086cec02c29482f8d296739 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Mon, 22 Mar 2021 23:25:28 +0300 Subject: lib: sort prefix-list commands by sequence-number in running-config Signed-off-by: Igor Ryzhov --- lib/filter_cli.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/filter_cli.c') diff --git a/lib/filter_cli.c b/lib/filter_cli.c index fd20ffc36e..893981ffab 100644 --- a/lib/filter_cli.c +++ b/lib/filter_cli.c @@ -1701,6 +1701,14 @@ ALIAS( ACCESS_LIST_REMARK_STR ACCESS_LIST_REMARK_LINE_STR) +int prefix_list_cmp(struct lyd_node *dnode1, struct lyd_node *dnode2) +{ + uint32_t seq1 = yang_dnode_get_uint32(dnode1, "./sequence"); + uint32_t seq2 = yang_dnode_get_uint32(dnode2, "./sequence"); + + return seq1 - seq2; +} + void prefix_list_show(struct vty *vty, struct lyd_node *dnode, bool show_defaults) { -- cgit v1.2.3