summaryrefslogtreecommitdiff
path: root/ripd/rip_cli.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2018-05-09 01:35:01 -0300
committerRenato Westphal <renato@opensourcerouting.org>2018-10-27 16:16:12 -0200
commit4068787842709160f0ba68ed71b94f9b61c8c21a (patch)
tree2407e3ce4933c86d5241ba1b49b3d0382e86b563 /ripd/rip_cli.c
parent908f0020923f77545ae467837d78b7eaa91f048e (diff)
ripd: retrofit the 'route' command to the new northbound model
Trivial conversion. Remove the rip->route routing table and associated code because this variable was used only to show the running configuration. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripd/rip_cli.c')
-rw-r--r--ripd/rip_cli.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/ripd/rip_cli.c b/ripd/rip_cli.c
index 4bbec64f17..00608b0266 100644
--- a/ripd/rip_cli.c
+++ b/ripd/rip_cli.c
@@ -612,6 +612,33 @@ void cli_show_rip_redistribute(struct vty *vty, struct lyd_node *dnode,
vty_out(vty, "\n");
}
+/*
+ * XPath: /frr-ripd:ripd/instance/static-route
+ */
+DEFPY (rip_route,
+ rip_route_cmd,
+ "[no] route A.B.C.D/M",
+ NO_STR
+ "RIP static route configuration\n"
+ "IP prefix <network>/<length>\n")
+{
+ struct cli_config_change changes[] = {
+ {
+ .xpath = "./static-route",
+ .operation = no ? NB_OP_DELETE : NB_OP_CREATE,
+ .value = route_str,
+ },
+ };
+
+ return nb_cli_cfg_change(vty, NULL, changes, array_size(changes));
+}
+
+void cli_show_rip_route(struct vty *vty, struct lyd_node *dnode,
+ bool show_defaults)
+{
+ vty_out(vty, " route %s\n", yang_dnode_get_string(dnode, NULL));
+}
+
void rip_cli_init(void)
{
install_element(CONFIG_NODE, &router_rip_cmd);
@@ -634,4 +661,5 @@ void rip_cli_init(void)
install_element(RIP_NODE, &rip_passive_interface_cmd);
install_element(RIP_NODE, &rip_redistribute_cmd);
install_element(RIP_NODE, &no_rip_redistribute_cmd);
+ install_element(RIP_NODE, &rip_route_cmd);
}