summaryrefslogtreecommitdiff
path: root/ripd/rip_cli.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2018-05-09 01:35:04 -0300
committerRenato Westphal <renato@opensourcerouting.org>2018-10-27 16:16:12 -0200
commit1137aef48fee571e51a1445e76647359d5701922 (patch)
tree2f8e98b4d4057f9717fe8e176675ac84d1ef2c4b /ripd/rip_cli.c
parent6270ce38adf705ad07e5d341a8ff049751e365e5 (diff)
ripd: implement the 'clear-rip-route' YANG RPC
This command deletes all received routes from the RIP routing table. It should be used with caution as it can create black holes in the network until RIP reconverges. Very useful to make automated testing (e.g. ANVL) more predictable, since the internal state of ripd can be cleared after each test. Implement the command using a YANG RPC so that it can be executed by other northbound clients in addition to the CLI. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripd/rip_cli.c')
-rw-r--r--ripd/rip_cli.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ripd/rip_cli.c b/ripd/rip_cli.c
index fda258ae88..510aa66155 100644
--- a/ripd/rip_cli.c
+++ b/ripd/rip_cli.c
@@ -1227,6 +1227,19 @@ void cli_show_ip_rip_authentication_key_chain(struct vty *vty,
yang_dnode_get_string(dnode, NULL));
}
+/*
+ * XPath: /frr-ripd:clear-rip-route
+ */
+DEFPY (clear_ip_rip,
+ clear_ip_rip_cmd,
+ "clear ip rip",
+ CLEAR_STR
+ IP_STR
+ "Clear IP RIP database\n")
+{
+ return nb_cli_rpc("/frr-ripd:clear-rip-route", NULL, NULL);
+}
+
void rip_cli_init(void)
{
install_element(CONFIG_NODE, &router_rip_cmd);
@@ -1269,4 +1282,5 @@ void rip_cli_init(void)
install_element(INTERFACE_NODE,
&no_ip_rip_authentication_key_chain_cmd);
+ install_element(ENABLE_NODE, &clear_ip_rip_cmd);
}