pim6d: Add 'debug pimv6 nht' and 'debug pimv6 nht detial'

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>
This commit is contained in:
Sai Gomathi N 2022-03-24 01:53:59 -07:00
parent bf385e2653
commit dcfd5abed7
2 changed files with 48 additions and 33 deletions

View File

@ -43,6 +43,7 @@
#include "pim_bsm.h" #include "pim_bsm.h"
#include "pim_iface.h" #include "pim_iface.h"
#include "pim_zebra.h" #include "pim_zebra.h"
#include "pim_instance.h"
#ifndef VTYSH_EXTRACT_PL #ifndef VTYSH_EXTRACT_PL
#include "pimd/pim6_cmd_clippy.c" #include "pimd/pim6_cmd_clippy.c"
@ -2017,6 +2018,37 @@ DEFPY (debug_pimv6,
return pim_no_debug_pim_cmd(); 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) void pim_cmd_init(void)
{ {
if_cmd_init(pim_interface_config_write); 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_pim_oil_cmd);
install_element(ENABLE_NODE, &clear_ipv6_mroute_count_cmd); install_element(ENABLE_NODE, &clear_ipv6_mroute_count_cmd);
install_element(ENABLE_NODE, &debug_pimv6_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_cmd);
install_element(CONFIG_NODE, &debug_pimv6_nht_cmd);
install_element(CONFIG_NODE, &debug_pimv6_nht_det_cmd);
} }

View File

@ -5535,50 +5535,33 @@ DEFPY (debug_pim,
return pim_no_debug_pim_cmd(); return pim_no_debug_pim_cmd();
} }
DEFUN (debug_pim_nht, DEFPY (debug_pim_nht,
debug_pim_nht_cmd, debug_pim_nht_cmd,
"debug pim nht", "[no] 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_STR NO_STR
DEBUG_STR DEBUG_STR
DEBUG_PIM_STR DEBUG_PIM_STR
"Nexthop Tracking\n") "Nexthop Tracking\n")
{ {
if (!no)
PIM_DO_DEBUG_PIM_NHT;
else
PIM_DONT_DEBUG_PIM_NHT; PIM_DONT_DEBUG_PIM_NHT;
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFUN (debug_pim_nht_det, DEFPY (debug_pim_nht_det,
debug_pim_nht_det_cmd, debug_pim_nht_det_cmd,
"debug pim nht detail", "[no] 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_STR NO_STR
DEBUG_STR DEBUG_STR
DEBUG_PIM_STR DEBUG_PIM_STR
"Nexthop Tracking\n" "Nexthop Tracking\n"
"Detailed Information\n") "Detailed Information\n")
{ {
if (!no)
PIM_DO_DEBUG_PIM_NHT_DETAIL;
else
PIM_DONT_DEBUG_PIM_NHT_DETAIL; PIM_DONT_DEBUG_PIM_NHT_DETAIL;
return CMD_SUCCESS; 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, &no_debug_pim_static_cmd);
install_element(ENABLE_NODE, &debug_pim_cmd); install_element(ENABLE_NODE, &debug_pim_cmd);
install_element(ENABLE_NODE, &debug_pim_nht_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, &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, &debug_pim_nht_rp_cmd);
install_element(ENABLE_NODE, &no_debug_pim_nht_rp_cmd); install_element(ENABLE_NODE, &no_debug_pim_nht_rp_cmd);
install_element(ENABLE_NODE, &debug_pim_events_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, &no_debug_pim_static_cmd);
install_element(CONFIG_NODE, &debug_pim_cmd); install_element(CONFIG_NODE, &debug_pim_cmd);
install_element(CONFIG_NODE, &debug_pim_nht_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, &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, &debug_pim_nht_rp_cmd);
install_element(CONFIG_NODE, &no_debug_pim_nht_rp_cmd); install_element(CONFIG_NODE, &no_debug_pim_nht_rp_cmd);
install_element(CONFIG_NODE, &debug_pim_events_cmd); install_element(CONFIG_NODE, &debug_pim_events_cmd);