lib: sort prefix-list commands by sequence-number in running-config

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
Igor Ryzhov 2021-03-22 23:25:28 +03:00
parent ae253f502e
commit 73695730f5
3 changed files with 10 additions and 0 deletions

View File

@ -239,6 +239,7 @@ extern void access_list_show(struct vty *vty, struct lyd_node *dnode,
bool show_defaults); bool show_defaults);
extern void access_list_remark_show(struct vty *vty, struct lyd_node *dnode, extern void access_list_remark_show(struct vty *vty, struct lyd_node *dnode,
bool show_defaults); bool show_defaults);
extern int prefix_list_cmp(struct lyd_node *dnode1, struct lyd_node *dnode2);
extern void prefix_list_show(struct vty *vty, struct lyd_node *dnode, extern void prefix_list_show(struct vty *vty, struct lyd_node *dnode,
bool show_defaults); bool show_defaults);
extern void prefix_list_remark_show(struct vty *vty, struct lyd_node *dnode, extern void prefix_list_remark_show(struct vty *vty, struct lyd_node *dnode,

View File

@ -1701,6 +1701,14 @@ ALIAS(
ACCESS_LIST_REMARK_STR ACCESS_LIST_REMARK_STR
ACCESS_LIST_REMARK_LINE_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, void prefix_list_show(struct vty *vty, struct lyd_node *dnode,
bool show_defaults) bool show_defaults)
{ {

View File

@ -1691,6 +1691,7 @@ const struct frr_yang_module_info frr_filter_info = {
.cbs = { .cbs = {
.create = lib_prefix_list_entry_create, .create = lib_prefix_list_entry_create,
.destroy = lib_prefix_list_entry_destroy, .destroy = lib_prefix_list_entry_destroy,
.cli_cmp = prefix_list_cmp,
.cli_show = prefix_list_show, .cli_show = prefix_list_show,
} }
}, },