diff options
Diffstat (limited to '')
-rw-r--r-- | ripngd/ripng_cli.c | 19 | ||||
-rw-r--r-- | ripngd/ripng_nb_rpcs.c | 9 | ||||
-rw-r--r-- | ripngd/ripngd.c | 33 | ||||
-rw-r--r-- | ripngd/subdir.am | 1 |
4 files changed, 23 insertions, 39 deletions
diff --git a/ripngd/ripng_cli.c b/ripngd/ripng_cli.c index 4806861..99cb68e 100644 --- a/ripngd/ripng_cli.c +++ b/ripngd/ripng_cli.c @@ -624,6 +624,23 @@ DEFPY_YANG(no_ripng_ipv6_distribute_list_prefix, return nb_cli_apply_changes(vty, NULL); } +/* + * XPath: /frr-ripngd:clear-ripng-route + */ +DEFPY_YANG (clear_ipv6_rip, + clear_ipv6_rip_cmd, + "clear ipv6 ripng [vrf WORD]", + CLEAR_STR + IPV6_STR + "Clear IPv6 RIP database\n" + VRF_CMD_HELP_STR) +{ + if (vrf) + nb_cli_rpc_enqueue(vty, "vrf", vrf); + + return nb_cli_rpc(vty, "/frr-ripngd:clear-ripng-route", NULL); +} + /* RIPng node structure. */ static struct cmd_node cmd_ripng_node = { .name = "ripng", @@ -663,6 +680,8 @@ void ripng_cli_init(void) install_element(INTERFACE_NODE, &ipv6_ripng_split_horizon_cmd); + install_element(ENABLE_NODE, &clear_ipv6_rip_cmd); + if_rmap_init(RIPNG_NODE); } diff --git a/ripngd/ripng_nb_rpcs.c b/ripngd/ripng_nb_rpcs.c index b23572d..5498bbf 100644 --- a/ripngd/ripng_nb_rpcs.c +++ b/ripngd/ripng_nb_rpcs.c @@ -70,12 +70,11 @@ static void clear_ripng_route(struct ripng *ripng) int clear_ripng_route_rpc(struct nb_cb_rpc_args *args) { struct ripng *ripng; - struct yang_data *yang_vrf; - yang_vrf = yang_data_list_find(args->input, "%s/%s", args->xpath, - "input/vrf"); - if (yang_vrf) { - ripng = ripng_lookup_by_vrf_name(yang_vrf->value); + if (args->input && yang_dnode_exists(args->input, "vrf")) { + const char *name = yang_dnode_get_string(args->input, "vrf"); + + ripng = ripng_lookup_by_vrf_name(name); if (ripng) clear_ripng_route(ripng); } else { diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index 80b9013..f4dadf3 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -2231,38 +2231,6 @@ DEFUN (show_ipv6_ripng_status, return CMD_SUCCESS; } -#include "ripngd/ripngd_clippy.c" - -/* - * XPath: /frr-ripngd:clear-ripng-route - */ -DEFPY_YANG (clear_ipv6_rip, - clear_ipv6_rip_cmd, - "clear ipv6 ripng [vrf WORD]", - CLEAR_STR - IPV6_STR - "Clear IPv6 RIP database\n" - VRF_CMD_HELP_STR) -{ - struct list *input; - int ret; - - input = list_new(); - if (vrf) { - struct yang_data *yang_vrf; - - yang_vrf = yang_data_new( - "/frr-ripngd:clear-ripng-route/input/vrf", vrf); - listnode_add(input, yang_vrf); - } - - ret = nb_cli_rpc(vty, "/frr-ripngd:clear-ripng-route", input, NULL); - - list_delete(&input); - - return ret; -} - /* Update ECMP routes to zebra when ECMP is disabled. */ void ripng_ecmp_disable(struct ripng *ripng) { @@ -2680,7 +2648,6 @@ void ripng_init(void) /* Install ripng commands. */ install_element(VIEW_NODE, &show_ipv6_ripng_cmd); install_element(VIEW_NODE, &show_ipv6_ripng_status_cmd); - install_element(ENABLE_NODE, &clear_ipv6_rip_cmd); ripng_if_init(); ripng_debug_init(); diff --git a/ripngd/subdir.am b/ripngd/subdir.am index a881144..83e376b 100644 --- a/ripngd/subdir.am +++ b/ripngd/subdir.am @@ -27,7 +27,6 @@ ripngd_ripngd_SOURCES = \ clippy_scan += \ ripngd/ripng_cli.c \ - ripngd/ripngd.c \ # end noinst_HEADERS += \ |