diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2021-03-22 23:24:23 +0300 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-03-23 16:24:40 +0300 |
| commit | de8936be5e298103160ce6862e5a94d108c80ec7 (patch) | |
| tree | 836ce074152a592a84c1687fb3132fc80b4e346c /lib/routemap_cli.c | |
| parent | c6f1f711bf885a6d110d22ebe8c647c5ff95c688 (diff) | |
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.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) { |
