pim6d: Add debug mroute6 and detail commands

Adding below debug CLIs:
debug mroute6
debug mroute6 detail

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
This commit is contained in:
Mobashshera Rasool 2022-08-16 00:42:26 -07:00
parent 261e70c66a
commit ca8cbecd5c
4 changed files with 40 additions and 2 deletions

View File

@ -1516,6 +1516,37 @@ DEFPY (debug_pimv6_zebra,
return CMD_SUCCESS;
}
DEFPY (debug_mroute6,
debug_mroute6_cmd,
"[no] debug mroute6",
NO_STR
DEBUG_STR
DEBUG_MROUTE6_STR)
{
if (!no)
PIM_DO_DEBUG_MROUTE;
else
PIM_DONT_DEBUG_MROUTE;
return CMD_SUCCESS;
}
DEFPY (debug_mroute6_detail,
debug_mroute6_detail_cmd,
"[no] debug mroute6 detail",
NO_STR
DEBUG_STR
DEBUG_MROUTE6_STR
"detailed\n")
{
if (!no)
PIM_DO_DEBUG_MROUTE_DETAIL;
else
PIM_DONT_DEBUG_MROUTE_DETAIL;
return CMD_SUCCESS;
}
DEFUN_NOSH (show_debugging_pimv6,
show_debugging_pimv6_cmd,
"show debugging [pimv6]",
@ -1660,6 +1691,8 @@ void pim_cmd_init(void)
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(ENABLE_NODE, &debug_mroute6_cmd);
install_element(ENABLE_NODE, &debug_mroute6_detail_cmd);
install_element(CONFIG_NODE, &debug_pimv6_cmd);
install_element(CONFIG_NODE, &debug_pimv6_nht_cmd);
@ -1671,4 +1704,6 @@ void pim_cmd_init(void)
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);
install_element(CONFIG_NODE, &debug_mroute6_cmd);
install_element(CONFIG_NODE, &debug_mroute6_detail_cmd);
}

View File

@ -57,6 +57,7 @@
#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"
#define DEBUG_MROUTE6_STR "PIMv6 interaction with kernel MFC cache\n"
void pim_cmd_init(void);

View File

@ -36,6 +36,7 @@ typedef struct in_addr pim_addr;
#define PIM_MAX_BITLEN IPV4_MAX_BITLEN
#define PIM_AF_NAME "ip"
#define PIM_AF_DBG "pim"
#define PIM_MROUTE_DBG "mroute"
#define PIMREG "pimreg"
#define PIM_ADDR_FUNCNAME(name) ipv4_##name
@ -61,6 +62,7 @@ typedef struct in6_addr pim_addr;
#define PIM_MAX_BITLEN IPV6_MAX_BITLEN
#define PIM_AF_NAME "ipv6"
#define PIM_AF_DBG "pimv6"
#define PIM_MROUTE_DBG "mroute6"
#define PIMREG "pim6reg"
#define PIM_ADDR_FUNCNAME(name) ipv6_##name

View File

@ -78,11 +78,11 @@ int pim_debug_config_write(struct vty *vty)
/* PIM_DEBUG_MROUTE catches _DETAIL too */
if (router->debugs & PIM_MASK_MROUTE) {
vty_out(vty, "debug mroute\n");
vty_out(vty, "debug " PIM_MROUTE_DBG "\n");
++writes;
}
if (PIM_DEBUG_MROUTE_DETAIL) {
vty_out(vty, "debug mroute detail\n");
vty_out(vty, "debug " PIM_MROUTE_DBG " detail\n");
++writes;
}