diff options
| author | Russ White <russ@riw.us> | 2021-03-30 10:37:31 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-30 10:37:31 -0400 |
| commit | fb7c845e0d94dba9341dbefdddb3b592a4221e45 (patch) | |
| tree | 2f63b1ab1d2ec003f01a70e18a3e9506a1ec1e67 /lib/filter_cli.c | |
| parent | 1bed7a6fef0bb50c9f7e5b42ae59578336620102 (diff) | |
| parent | 73695730f55a25cae086cec02c29482f8d296739 (diff) | |
Merge pull request #8311 from idryzhov/nb-sorting
Sort route-maps/access-lists/prefix-lists by sequence number in running-config
Diffstat (limited to 'lib/filter_cli.c')
| -rw-r--r-- | lib/filter_cli.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/filter_cli.c b/lib/filter_cli.c index 24980f7858..96444ac970 100644 --- a/lib/filter_cli.c +++ b/lib/filter_cli.c @@ -1077,6 +1077,14 @@ ALIAS( ACCESS_LIST_REMARK_STR ACCESS_LIST_REMARK_LINE_STR) +int access_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 access_list_show(struct vty *vty, struct lyd_node *dnode, bool show_defaults) { @@ -1700,6 +1708,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) { |
