Merge pull request #15497 from idryzhov/show-run-fixes

a couple of fixes for "show running-config"
This commit is contained in:
Donald Sharp 2024-03-08 08:11:14 -05:00 committed by GitHub
commit 0d31f63dba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 25 additions and 0 deletions

View File

@ -1340,6 +1340,15 @@ static void cli_show_interface_end(struct vty *vty,
vty_out(vty, "exit\n"); vty_out(vty, "exit\n");
} }
static int cli_cmp_interface(const struct lyd_node *dnode1,
const struct lyd_node *dnode2)
{
const char *ifname1 = yang_dnode_get_string(dnode1, "name");
const char *ifname2 = yang_dnode_get_string(dnode2, "name");
return if_cmp_name_func(ifname1, ifname2);
}
void if_vty_config_start(struct vty *vty, struct interface *ifp) void if_vty_config_start(struct vty *vty, struct interface *ifp)
{ {
vty_frame(vty, "!\n"); vty_frame(vty, "!\n");
@ -1760,6 +1769,7 @@ const struct frr_yang_module_info frr_interface_info = {
.destroy = lib_interface_destroy, .destroy = lib_interface_destroy,
.cli_show = cli_show_interface, .cli_show = cli_show_interface,
.cli_show_end = cli_show_interface_end, .cli_show_end = cli_show_interface_end,
.cli_cmp = cli_cmp_interface,
.get_next = lib_interface_get_next, .get_next = lib_interface_get_next,
.get_keys = lib_interface_get_keys, .get_keys = lib_interface_get_keys,
.lookup_entry = lib_interface_lookup_entry, .lookup_entry = lib_interface_lookup_entry,
@ -1842,6 +1852,7 @@ const struct frr_yang_module_info frr_interface_cli_info = {
.cbs = { .cbs = {
.cli_show = cli_show_interface, .cli_show = cli_show_interface,
.cli_show_end = cli_show_interface_end, .cli_show_end = cli_show_interface_end,
.cli_cmp = cli_cmp_interface,
}, },
}, },
{ {

View File

@ -83,6 +83,11 @@ void cli_show_router_rip(struct vty *vty, const struct lyd_node *dnode,
vty_out(vty, "\n"); vty_out(vty, "\n");
} }
void cli_show_end_router_rip(struct vty *vty, const struct lyd_node *dnode)
{
vty_out(vty, "exit\n");
}
/* /*
* XPath: /frr-ripd:ripd/instance/allow-ecmp * XPath: /frr-ripd:ripd/instance/allow-ecmp
*/ */
@ -1332,6 +1337,7 @@ const struct frr_yang_module_info frr_ripd_cli_info = {
{ {
.xpath = "/frr-ripd:ripd/instance", .xpath = "/frr-ripd:ripd/instance",
.cbs.cli_show = cli_show_router_rip, .cbs.cli_show = cli_show_router_rip,
.cbs.cli_show_end = cli_show_end_router_rip,
}, },
{ {
.xpath = "/frr-ripd:ripd/instance/allow-ecmp", .xpath = "/frr-ripd:ripd/instance/allow-ecmp",

View File

@ -173,6 +173,7 @@ void ripd_instance_timers_apply_finish(struct nb_cb_apply_finish_args *args);
/* Optional 'cli_show' callbacks. */ /* Optional 'cli_show' callbacks. */
void cli_show_router_rip(struct vty *vty, const struct lyd_node *dnode, void cli_show_router_rip(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults); bool show_defaults);
void cli_show_end_router_rip(struct vty *vty, const struct lyd_node *dnode);
void cli_show_rip_allow_ecmp(struct vty *vty, const struct lyd_node *dnode, void cli_show_rip_allow_ecmp(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults); bool show_defaults);
void cli_show_rip_default_information_originate(struct vty *vty, void cli_show_rip_default_information_originate(struct vty *vty,

View File

@ -83,6 +83,11 @@ void cli_show_router_ripng(struct vty *vty, const struct lyd_node *dnode,
vty_out(vty, "\n"); vty_out(vty, "\n");
} }
void cli_show_end_router_ripng(struct vty *vty, const struct lyd_node *dnode)
{
vty_out(vty, "exit\n");
}
/* /*
* XPath: /frr-ripngd:ripngd/instance/allow-ecmp * XPath: /frr-ripngd:ripngd/instance/allow-ecmp
*/ */
@ -701,6 +706,7 @@ const struct frr_yang_module_info frr_ripngd_cli_info = {
{ {
.xpath = "/frr-ripngd:ripngd/instance", .xpath = "/frr-ripngd:ripngd/instance",
.cbs.cli_show = cli_show_router_ripng, .cbs.cli_show = cli_show_router_ripng,
.cbs.cli_show_end = cli_show_end_router_ripng,
}, },
{ {
.xpath = "/frr-ripngd:ripngd/instance/allow-ecmp", .xpath = "/frr-ripngd:ripngd/instance/allow-ecmp",

View File

@ -107,6 +107,7 @@ void ripngd_instance_timers_apply_finish(struct nb_cb_apply_finish_args *args);
/* Optional 'cli_show' callbacks. */ /* Optional 'cli_show' callbacks. */
void cli_show_router_ripng(struct vty *vty, const struct lyd_node *dnode, void cli_show_router_ripng(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults); bool show_defaults);
void cli_show_end_router_ripng(struct vty *vty, const struct lyd_node *dnode);
void cli_show_ripng_allow_ecmp(struct vty *vty, const struct lyd_node *dnode, void cli_show_ripng_allow_ecmp(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults); bool show_defaults);
void cli_show_ripng_default_information_originate(struct vty *vty, void cli_show_ripng_default_information_originate(struct vty *vty,