]> git.proxmox.com Git - mirror_frr.git/blobdiff - ripngd/ripng_debug.c
Merge pull request #12196 from opensourcerouting/xref-vtysh
[mirror_frr.git] / ripngd / ripng_debug.c
index 9ebc302b1b32e9be2d72edda4ca0923828535c3e..d36327cb7680f567dc01248606677019445ece58 100644 (file)
@@ -56,6 +56,8 @@ DEFUN_NOSH (show_debugging_ripng,
        if (IS_RIPNG_DEBUG_ZEBRA)
                vty_out(vty, "  RIPng zebra debugging is on\n");
 
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }
 
@@ -94,13 +96,9 @@ DEFUN (debug_ripng_packet_direct,
 {
        int idx_recv_send = 3;
        ripng_debug_packet |= RIPNG_DEBUG_PACKET;
-       if (strncmp("send", argv[idx_recv_send]->arg,
-                   strlen(argv[idx_recv_send]->arg))
-           == 0)
+       if (strcmp("send", argv[idx_recv_send]->text) == 0)
                ripng_debug_packet |= RIPNG_DEBUG_SEND;
-       if (strncmp("recv", argv[idx_recv_send]->arg,
-                   strlen(argv[idx_recv_send]->arg))
-           == 0)
+       if (strcmp("recv", argv[idx_recv_send]->text) == 0)
                ripng_debug_packet |= RIPNG_DEBUG_RECV;
 
        return CMD_SUCCESS;
@@ -152,16 +150,12 @@ DEFUN (no_debug_ripng_packet_direct,
        "Debug option set for send packet\n")
 {
        int idx_recv_send = 4;
-       if (strncmp("send", argv[idx_recv_send]->arg,
-                   strlen(argv[idx_recv_send]->arg))
-           == 0) {
+       if (strcmp("send", argv[idx_recv_send]->text) == 0) {
                if (IS_RIPNG_DEBUG_RECV)
                        ripng_debug_packet &= ~RIPNG_DEBUG_SEND;
                else
                        ripng_debug_packet = 0;
-       } else if (strncmp("recv", argv[idx_recv_send]->arg,
-                          strlen(argv[idx_recv_send]->arg))
-                  == 0) {
+       } else if (strcmp("recv", argv[idx_recv_send]->text) == 0) {
                if (IS_RIPNG_DEBUG_SEND)
                        ripng_debug_packet &= ~RIPNG_DEBUG_RECV;
                else
@@ -182,10 +176,13 @@ DEFUN (no_debug_ripng_zebra,
        return CMD_SUCCESS;
 }
 
+static int config_write_debug(struct vty *vty);
 /* Debug node. */
 static struct cmd_node debug_node = {
-       DEBUG_NODE, "", /* Debug node has no interface. */
-       1               /* VTYSH */
+       .name = "debug",
+       .node = DEBUG_NODE,
+       .prompt = "",
+       .config_write = config_write_debug,
 };
 
 static int config_write_debug(struct vty *vty)
@@ -215,22 +212,15 @@ static int config_write_debug(struct vty *vty)
        return write;
 }
 
-void ripng_debug_reset()
-{
-       ripng_debug_event = 0;
-       ripng_debug_packet = 0;
-       ripng_debug_zebra = 0;
-}
-
-void ripng_debug_init()
+void ripng_debug_init(void)
 {
        ripng_debug_event = 0;
        ripng_debug_packet = 0;
        ripng_debug_zebra = 0;
 
-       install_node(&debug_node, config_write_debug);
+       install_node(&debug_node);
 
-       install_element(VIEW_NODE, &show_debugging_ripng_cmd);
+       install_element(ENABLE_NODE, &show_debugging_ripng_cmd);
 
        install_element(ENABLE_NODE, &debug_ripng_events_cmd);
        install_element(ENABLE_NODE, &debug_ripng_packet_cmd);