]> git.puffer.fish Git - mirror/frr.git/commitdiff
pim6d: Add 'debug pimv6 zebra'
authorSai Gomathi N <nsaigomathi@vmware.com>
Mon, 28 Mar 2022 06:44:08 +0000 (23:44 -0700)
committerSai Gomathi N <nsaigomathi@vmware.com>
Wed, 18 May 2022 10:31:33 +0000 (03:31 -0700)
Implementing debug pimv6 zebra command for debugging about
the events from zebra that come up through the ZAPI.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
pimd/pim6_cmd.c
pimd/pim6_cmd.h
pimd/pim_cmd.c

index 9327b42f52a78e3799e4cfffa0f8d075e97d69de..74fcad628bb2fb374e4b9c179f762784a9476c79 100644 (file)
@@ -2145,6 +2145,21 @@ DEFPY (debug_pimv6_trace_detail,
        return CMD_SUCCESS;
 }
 
+DEFPY (debug_pimv6_zebra,
+       debug_pimv6_zebra_cmd,
+       "[no] debug pimv6 zebra",
+       NO_STR
+       DEBUG_STR
+       DEBUG_PIMV6_STR
+       DEBUG_PIMV6_ZEBRA_STR)
+{
+       if (!no)
+               PIM_DO_DEBUG_ZEBRA;
+       else
+               PIM_DONT_DEBUG_ZEBRA;
+       return CMD_SUCCESS;
+}
+
 void pim_cmd_init(void)
 {
        if_cmd_init(pim_interface_config_write);
@@ -2265,6 +2280,7 @@ void pim_cmd_init(void)
        install_element(ENABLE_NODE, &debug_pimv6_packetdump_recv_cmd);
        install_element(ENABLE_NODE, &debug_pimv6_trace_cmd);
        install_element(ENABLE_NODE, &debug_pimv6_trace_detail_cmd);
+       install_element(ENABLE_NODE, &debug_pimv6_zebra_cmd);
 
        install_element(CONFIG_NODE, &debug_pimv6_cmd);
        install_element(CONFIG_NODE, &debug_pimv6_nht_cmd);
@@ -2275,4 +2291,5 @@ void pim_cmd_init(void)
        install_element(CONFIG_NODE, &debug_pimv6_packetdump_recv_cmd);
        install_element(CONFIG_NODE, &debug_pimv6_trace_cmd);
        install_element(CONFIG_NODE, &debug_pimv6_trace_detail_cmd);
+       install_element(CONFIG_NODE, &debug_pimv6_zebra_cmd);
 }
index 1615bc01be5d46b02f84591104c0901d66366e17..8fb82d9f2677d3493004728c368e3f189ac3d700 100644 (file)
@@ -56,6 +56,7 @@
 #define DEBUG_PIMV6_PACKETDUMP_SEND_STR "Dump sent packets\n"
 #define DEBUG_PIMV6_PACKETDUMP_RECV_STR "Dump received packets\n"
 #define DEBUG_PIMV6_TRACE_STR "PIMv6 internal daemon activity\n"
+#define DEBUG_PIMV6_ZEBRA_STR "ZEBRA protocol activity\n"
 
 void pim_cmd_init(void);
 
index 778dd92ed0928e990b9240979c89633335cea2ed..2d6ce24381af2f9703148bf9c61488fb3fd6ebcb 100644 (file)
@@ -5707,26 +5707,18 @@ DEFUN (no_debug_ssmpingd,
        return CMD_SUCCESS;
 }
 
-DEFUN (debug_pim_zebra,
+DEFPY (debug_pim_zebra,
        debug_pim_zebra_cmd,
-       "debug pim zebra",
-       DEBUG_STR
-       DEBUG_PIM_STR
-       DEBUG_PIM_ZEBRA_STR)
-{
-       PIM_DO_DEBUG_ZEBRA;
-       return CMD_SUCCESS;
-}
-
-DEFUN (no_debug_pim_zebra,
-       no_debug_pim_zebra_cmd,
-       "no debug pim zebra",
+       "[no] debug pim zebra",
        NO_STR
        DEBUG_STR
        DEBUG_PIM_STR
        DEBUG_PIM_ZEBRA_STR)
 {
-       PIM_DONT_DEBUG_ZEBRA;
+       if (!no)
+               PIM_DO_DEBUG_ZEBRA;
+       else
+               PIM_DONT_DEBUG_ZEBRA;
        return CMD_SUCCESS;
 }
 
@@ -7763,7 +7755,6 @@ void pim_cmd_init(void)
        install_element(ENABLE_NODE, &debug_ssmpingd_cmd);
        install_element(ENABLE_NODE, &no_debug_ssmpingd_cmd);
        install_element(ENABLE_NODE, &debug_pim_zebra_cmd);
-       install_element(ENABLE_NODE, &no_debug_pim_zebra_cmd);
        install_element(ENABLE_NODE, &debug_pim_mlag_cmd);
        install_element(ENABLE_NODE, &no_debug_pim_mlag_cmd);
        install_element(ENABLE_NODE, &debug_pim_vxlan_cmd);
@@ -7809,7 +7800,6 @@ void pim_cmd_init(void)
        install_element(CONFIG_NODE, &debug_ssmpingd_cmd);
        install_element(CONFIG_NODE, &no_debug_ssmpingd_cmd);
        install_element(CONFIG_NODE, &debug_pim_zebra_cmd);
-       install_element(CONFIG_NODE, &no_debug_pim_zebra_cmd);
        install_element(CONFIG_NODE, &debug_pim_mlag_cmd);
        install_element(CONFIG_NODE, &no_debug_pim_mlag_cmd);
        install_element(CONFIG_NODE, &debug_pim_vxlan_cmd);