summaryrefslogtreecommitdiffstats
path: root/ripngd/ripngd.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2024-03-08 23:01:01 +0100
committerIgor Ryzhov <iryzhov@nfware.com>2024-03-08 23:01:01 +0100
commitc544b9e8e72c3b77cca9d3d0ceaeae427b761f2c (patch)
tree8fc4774ff7bb5e138feaade2daf26a62bc2f27d0 /ripngd/ripngd.c
parentripd: fix "clear ip rip" command (diff)
downloadfrr-c544b9e8e72c3b77cca9d3d0ceaeae427b761f2c.tar.xz
frr-c544b9e8e72c3b77cca9d3d0ceaeae427b761f2c.zip
ripngd: fix "clear ipv6 ripng" command
mgmtd doesn't support YANG RPCs yet, so this command must go directly to ripngd. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'ripngd/ripngd.c')
-rw-r--r--ripngd/ripngd.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index f4dadf377..80b9013e0 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -2231,6 +2231,38 @@ 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)
{
@@ -2648,6 +2680,7 @@ 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();