]> git.proxmox.com Git - mirror_frr.git/blobdiff - babeld/babeld.c
babeld: justify "running-config" meaning in CLI
[mirror_frr.git] / babeld / babeld.c
index f42a81b6b4aeca3ee305088d9651a1ff95477904..9fea2e1012511e61f25b2b104adb4dfdc7964b5b 100644 (file)
@@ -59,6 +59,7 @@ THE SOFTWARE.
 #include "message.h"
 #include "resend.h"
 #include "babel_filter.h"
+#include "babel_zebra.h"
 
 
 static int babel_init_routing_process(struct thread *thread);
@@ -92,7 +93,26 @@ static struct cmd_node cmd_babel_node =
 static int
 babel_config_write (struct vty *vty)
 {
-    return 0;
+    int lines = 0;
+    int i;
+
+    /* list enabled debug modes */
+    lines += debug_babel_config_write (vty);
+
+    if (!babel_routing_process)
+        return lines;
+    vty_out (vty, "router babel%s", VTY_NEWLINE);
+    /* list enabled interfaces */
+    lines = 1 + babel_enable_if_config_write (vty);
+    /* list redistributed protocols */
+    for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
+        if (i != zclient->redist_default && zclient->redist[i])
+        {
+            vty_out (vty, " redistribute %s%s", zebra_route_string (i), VTY_NEWLINE);
+            lines++;
+        }
+
+    return lines;
 }
 
 
@@ -629,6 +649,22 @@ DEFUN (no_router_babel,
     return CMD_SUCCESS;
 }
 
+/* [Babel Command] */
+DEFUN (babel_set_resend_delay,
+       babel_set_resend_delay_cmd,
+       "babel resend-delay <20-655340>",
+       "Babel commands\n"
+       "Time before resending a message\n"
+       "Milliseconds\n")
+{
+    int interval;
+
+    VTY_GET_INTEGER_RANGE("milliseconds", interval, argv[0], 20, 10 * 0xFFFE);
+
+    resend_delay = interval;
+    return CMD_SUCCESS;
+}
+
 void
 babeld_quagga_init(void)
 {
@@ -639,6 +675,7 @@ babeld_quagga_init(void)
     install_element(CONFIG_NODE, &no_router_babel_cmd);
 
     install_default(BABEL_NODE);
+    install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
 
     babel_if_init();
 
@@ -684,9 +721,3 @@ redistribute_filter(const unsigned char *prefix, unsigned short plen,
     return 0;
 }
 
-void
-show_babeld_configuration (struct vty *vty)
-{
-    vty_out(vty, "babeld running process %s.%s",
-            babel_routing_process ? "enable" : "disable", VTY_NEWLINE);
-}