Merge pull request #11814 from mobash-rasool/fixes2

pim6d: Add debug mroute6 commands
This commit is contained in:
Donatas Abraitis 2022-08-16 16:39:18 +03:00 committed by GitHub
commit 250afa433c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 48 additions and 2 deletions

View File

@ -445,3 +445,11 @@ the config was written out.
.. clicmd:: debug pimv6 zebra .. clicmd:: debug pimv6 zebra
This gathers data about events from zebra that come up through the ZAPI. This gathers data about events from zebra that come up through the ZAPI.
.. clicmd:: debug mroute6
This turns on debugging for PIMv6 interaction with kernel MFC cache.
.. clicmd:: debug mroute6 detail
This turns on detailed debugging for PIMv6 interaction with kernel MFC cache.

View File

@ -1516,6 +1516,37 @@ DEFPY (debug_pimv6_zebra,
return CMD_SUCCESS; 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, DEFUN_NOSH (show_debugging_pimv6,
show_debugging_pimv6_cmd, show_debugging_pimv6_cmd,
"show debugging [pimv6]", "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_cmd);
install_element(ENABLE_NODE, &debug_pimv6_trace_detail_cmd); install_element(ENABLE_NODE, &debug_pimv6_trace_detail_cmd);
install_element(ENABLE_NODE, &debug_pimv6_zebra_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_cmd);
install_element(CONFIG_NODE, &debug_pimv6_nht_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_cmd);
install_element(CONFIG_NODE, &debug_pimv6_trace_detail_cmd); install_element(CONFIG_NODE, &debug_pimv6_trace_detail_cmd);
install_element(CONFIG_NODE, &debug_pimv6_zebra_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_PACKETDUMP_RECV_STR "Dump received packets\n"
#define DEBUG_PIMV6_TRACE_STR "PIMv6 internal daemon activity\n" #define DEBUG_PIMV6_TRACE_STR "PIMv6 internal daemon activity\n"
#define DEBUG_PIMV6_ZEBRA_STR "ZEBRA protocol 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); 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_MAX_BITLEN IPV4_MAX_BITLEN
#define PIM_AF_NAME "ip" #define PIM_AF_NAME "ip"
#define PIM_AF_DBG "pim" #define PIM_AF_DBG "pim"
#define PIM_MROUTE_DBG "mroute"
#define PIMREG "pimreg" #define PIMREG "pimreg"
#define PIM_ADDR_FUNCNAME(name) ipv4_##name #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_MAX_BITLEN IPV6_MAX_BITLEN
#define PIM_AF_NAME "ipv6" #define PIM_AF_NAME "ipv6"
#define PIM_AF_DBG "pimv6" #define PIM_AF_DBG "pimv6"
#define PIM_MROUTE_DBG "mroute6"
#define PIMREG "pim6reg" #define PIMREG "pim6reg"
#define PIM_ADDR_FUNCNAME(name) ipv6_##name #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 */ /* PIM_DEBUG_MROUTE catches _DETAIL too */
if (router->debugs & PIM_MASK_MROUTE) { if (router->debugs & PIM_MASK_MROUTE) {
vty_out(vty, "debug mroute\n"); vty_out(vty, "debug " PIM_MROUTE_DBG "\n");
++writes; ++writes;
} }
if (PIM_DEBUG_MROUTE_DETAIL) { if (PIM_DEBUG_MROUTE_DETAIL) {
vty_out(vty, "debug mroute detail\n"); vty_out(vty, "debug " PIM_MROUTE_DBG " detail\n");
++writes; ++writes;
} }