]> git.proxmox.com Git - mirror_frr.git/blobdiff - ripngd/ripng_cli.c
zebra: Allow ns delete to happen after under/over flow checks
[mirror_frr.git] / ripngd / ripng_cli.c
index e6daa62980e9909e3104afe217e8dbdb3eb7508f..a187e80fd7a4691a79e507ad6ada5a1c6900f766 100644 (file)
@@ -358,6 +358,112 @@ void cli_show_ripng_aggregate_address(struct vty *vty, struct lyd_node *dnode,
                yang_dnode_get_string(dnode, NULL));
 }
 
+/*
+ * XPath: /frr-ripngd:ripngd/instance/timers
+ */
+DEFPY (ripng_timers,
+       ripng_timers_cmd,
+       "timers basic (1-65535)$update (1-65535)$timeout (1-65535)$garbage",
+       "RIPng timers setup\n"
+       "Basic timer\n"
+       "Routing table update timer value in second. Default is 30.\n"
+       "Routing information timeout timer. Default is 180.\n"
+       "Garbage collection timer. Default is 120.\n")
+{
+       nb_cli_enqueue_change(vty, "./update-interval", NB_OP_MODIFY,
+                             update_str);
+       nb_cli_enqueue_change(vty, "./holddown-interval", NB_OP_MODIFY,
+                             timeout_str);
+       nb_cli_enqueue_change(vty, "./flush-interval", NB_OP_MODIFY,
+                             garbage_str);
+
+       return nb_cli_apply_changes(vty, "./timers");
+}
+
+DEFPY (no_ripng_timers,
+       no_ripng_timers_cmd,
+       "no timers basic [(1-65535) (1-65535) (1-65535)]",
+       NO_STR
+       "RIPng timers setup\n"
+       "Basic timer\n"
+       "Routing table update timer value in second. Default is 30.\n"
+       "Routing information timeout timer. Default is 180.\n"
+       "Garbage collection timer. Default is 120.\n")
+{
+       nb_cli_enqueue_change(vty, "./update-interval", NB_OP_MODIFY, NULL);
+       nb_cli_enqueue_change(vty, "./holddown-interval", NB_OP_MODIFY, NULL);
+       nb_cli_enqueue_change(vty, "./flush-interval", NB_OP_MODIFY, NULL);
+
+       return nb_cli_apply_changes(vty, "./timers");
+}
+
+void cli_show_ripng_timers(struct vty *vty, struct lyd_node *dnode,
+                          bool show_defaults)
+{
+       vty_out(vty, " timers basic %s %s %s\n",
+               yang_dnode_get_string(dnode, "./update-interval"),
+               yang_dnode_get_string(dnode, "./holddown-interval"),
+               yang_dnode_get_string(dnode, "./flush-interval"));
+}
+
+/*
+ * XPath: /frr-interface:lib/interface/frr-ripngd:ripng/split-horizon
+ */
+DEFPY (ipv6_ripng_split_horizon,
+       ipv6_ripng_split_horizon_cmd,
+       "[no] ipv6 ripng split-horizon [poisoned-reverse$poisoned_reverse]",
+       NO_STR
+       IPV6_STR
+       "Routing Information Protocol\n"
+       "Perform split horizon\n"
+       "With poisoned-reverse\n")
+{
+       const char *value;
+
+       if (no)
+               value = "disabled";
+       else if (poisoned_reverse)
+               value = "poison-reverse";
+       else
+               value = "simple";
+
+       nb_cli_enqueue_change(vty, "./split-horizon", NB_OP_MODIFY, value);
+
+       return nb_cli_apply_changes(vty, "./frr-ripngd:ripng");
+}
+
+void cli_show_ipv6_ripng_split_horizon(struct vty *vty, struct lyd_node *dnode,
+                                      bool show_defaults)
+{
+       int value;
+
+       value = yang_dnode_get_enum(dnode, NULL);
+       switch (value) {
+       case RIPNG_NO_SPLIT_HORIZON:
+               vty_out(vty, " no ipv6 ripng split-horizon\n");
+               break;
+       case RIPNG_SPLIT_HORIZON:
+               vty_out(vty, " ipv6 ripng split-horizon\n");
+               break;
+       case RIPNG_SPLIT_HORIZON_POISONED_REVERSE:
+               vty_out(vty, " ipv6 ripng split-horizon poisoned-reverse\n");
+               break;
+       }
+}
+
+/*
+ * XPath: /frr-ripngd:clear-ripng-route
+ */
+DEFPY (clear_ipv6_rip,
+       clear_ipv6_rip_cmd,
+       "clear ipv6 ripng",
+       CLEAR_STR
+       IPV6_STR
+       "Clear IPv6 RIP database\n")
+{
+       return nb_cli_rpc("/frr-ripngd:clear-ripng-route", NULL, NULL);
+}
+
 void ripng_cli_init(void)
 {
        install_element(CONFIG_NODE, &router_ripng_cmd);
@@ -374,4 +480,10 @@ void ripng_cli_init(void)
        install_element(RIPNG_NODE, &ripng_redistribute_cmd);
        install_element(RIPNG_NODE, &ripng_route_cmd);
        install_element(RIPNG_NODE, &ripng_aggregate_address_cmd);
+       install_element(RIPNG_NODE, &ripng_timers_cmd);
+       install_element(RIPNG_NODE, &no_ripng_timers_cmd);
+
+       install_element(INTERFACE_NODE, &ipv6_ripng_split_horizon_cmd);
+
+       install_element(ENABLE_NODE, &clear_ipv6_rip_cmd);
 }