]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pim6d: Add 'debug pimv6 nht' and 'debug pimv6 nht detial'
authorSai Gomathi N <nsaigomathi@vmware.com>
Thu, 24 Mar 2022 08:53:59 +0000 (01:53 -0700)
committerSai Gomathi N <nsaigomathi@vmware.com>
Wed, 18 May 2022 10:31:21 +0000 (03:31 -0700)
Implementing debug pimv6 nht command for PIMv6 nexthop tracking.
It will display information about RPF lookups and information about when a nexthop changes.

debug pimv6 nht detial for for PIMv6 nexthop in detail.This is not enabled by default.

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

index 7c7445c2a09a4a9f6b6acac25d7df0920e5450f1..e16e24f3239b9d2f9a89e74feb9a4c86f79ab9cf 100644 (file)
@@ -43,6 +43,7 @@
 #include "pim_bsm.h"
 #include "pim_iface.h"
 #include "pim_zebra.h"
+#include "pim_instance.h"
 
 #ifndef VTYSH_EXTRACT_PL
 #include "pimd/pim6_cmd_clippy.c"
@@ -2017,6 +2018,37 @@ DEFPY (debug_pimv6,
                return pim_no_debug_pim_cmd();
 }
 
+DEFPY (debug_pimv6_nht,
+       debug_pimv6_nht_cmd,
+       "[no] debug pimv6 nht",
+       NO_STR
+       DEBUG_STR
+       DEBUG_PIMV6_STR
+       "Nexthop Tracking\n")
+{
+       if (!no)
+               PIM_DO_DEBUG_PIM_NHT;
+       else
+               PIM_DONT_DEBUG_PIM_NHT;
+       return CMD_SUCCESS;
+}
+
+DEFPY (debug_pimv6_nht_det,
+       debug_pimv6_nht_det_cmd,
+       "[no] debug pimv6 nht detail",
+       NO_STR
+       DEBUG_STR
+       DEBUG_PIMV6_STR
+       "Nexthop Tracking\n"
+       "Detailed Information\n")
+{
+       if (!no)
+               PIM_DO_DEBUG_PIM_NHT_DETAIL;
+       else
+               PIM_DONT_DEBUG_PIM_NHT_DETAIL;
+       return CMD_SUCCESS;
+}
+
 void pim_cmd_init(void)
 {
        if_cmd_init(pim_interface_config_write);
@@ -2129,6 +2161,10 @@ void pim_cmd_init(void)
        install_element(ENABLE_NODE, &clear_ipv6_pim_oil_cmd);
        install_element(ENABLE_NODE, &clear_ipv6_mroute_count_cmd);
        install_element(ENABLE_NODE, &debug_pimv6_cmd);
+       install_element(ENABLE_NODE, &debug_pimv6_nht_cmd);
+       install_element(ENABLE_NODE, &debug_pimv6_nht_det_cmd);
 
        install_element(CONFIG_NODE, &debug_pimv6_cmd);
+       install_element(CONFIG_NODE, &debug_pimv6_nht_cmd);
+       install_element(CONFIG_NODE, &debug_pimv6_nht_det_cmd);
 }
index 43463ce74de2b678af79853b602991458f28f441..00913aab9939c78eeff2f00e4c5e40318785c0d3 100644 (file)
@@ -5535,51 +5535,34 @@ DEFPY (debug_pim,
                return pim_no_debug_pim_cmd();
 }
 
-DEFUN (debug_pim_nht,
+DEFPY (debug_pim_nht,
        debug_pim_nht_cmd,
-       "debug pim nht",
-       DEBUG_STR
-       DEBUG_PIM_STR
-       "Nexthop Tracking\n")
-{
-       PIM_DO_DEBUG_PIM_NHT;
-       return CMD_SUCCESS;
-}
-
-DEFUN (no_debug_pim_nht,
-       no_debug_pim_nht_cmd,
-       "no debug pim nht",
+       "[no] debug pim nht",
        NO_STR
        DEBUG_STR
        DEBUG_PIM_STR
        "Nexthop Tracking\n")
 {
-       PIM_DONT_DEBUG_PIM_NHT;
+       if (!no)
+               PIM_DO_DEBUG_PIM_NHT;
+       else
+               PIM_DONT_DEBUG_PIM_NHT;
        return CMD_SUCCESS;
 }
 
-DEFUN (debug_pim_nht_det,
+DEFPY (debug_pim_nht_det,
        debug_pim_nht_det_cmd,
-       "debug pim nht detail",
-       DEBUG_STR
-       DEBUG_PIM_STR
-       "Nexthop Tracking\n"
-       "Detailed Information\n")
-{
-       PIM_DO_DEBUG_PIM_NHT_DETAIL;
-       return CMD_SUCCESS;
-}
-
-DEFUN (no_debug_pim_nht_det,
-       no_debug_pim_nht_det_cmd,
-       "no debug pim nht detail",
+       "[no] debug pim nht detail",
        NO_STR
        DEBUG_STR
        DEBUG_PIM_STR
        "Nexthop Tracking\n"
        "Detailed Information\n")
 {
-       PIM_DONT_DEBUG_PIM_NHT_DETAIL;
+       if (!no)
+               PIM_DO_DEBUG_PIM_NHT_DETAIL;
+       else
+               PIM_DONT_DEBUG_PIM_NHT_DETAIL;
        return CMD_SUCCESS;
 }
 
@@ -7849,9 +7832,7 @@ void pim_cmd_init(void)
        install_element(ENABLE_NODE, &no_debug_pim_static_cmd);
        install_element(ENABLE_NODE, &debug_pim_cmd);
        install_element(ENABLE_NODE, &debug_pim_nht_cmd);
-       install_element(ENABLE_NODE, &no_debug_pim_nht_cmd);
        install_element(ENABLE_NODE, &debug_pim_nht_det_cmd);
-       install_element(ENABLE_NODE, &no_debug_pim_nht_det_cmd);
        install_element(ENABLE_NODE, &debug_pim_nht_rp_cmd);
        install_element(ENABLE_NODE, &no_debug_pim_nht_rp_cmd);
        install_element(ENABLE_NODE, &debug_pim_events_cmd);
@@ -7903,9 +7884,7 @@ void pim_cmd_init(void)
        install_element(CONFIG_NODE, &no_debug_pim_static_cmd);
        install_element(CONFIG_NODE, &debug_pim_cmd);
        install_element(CONFIG_NODE, &debug_pim_nht_cmd);
-       install_element(CONFIG_NODE, &no_debug_pim_nht_cmd);
        install_element(CONFIG_NODE, &debug_pim_nht_det_cmd);
-       install_element(CONFIG_NODE, &no_debug_pim_nht_det_cmd);
        install_element(CONFIG_NODE, &debug_pim_nht_rp_cmd);
        install_element(CONFIG_NODE, &no_debug_pim_nht_rp_cmd);
        install_element(CONFIG_NODE, &debug_pim_events_cmd);