Skip to content

Commit

Permalink
pim6d: debug mroute6 PR
Browse files Browse the repository at this point in the history
Signed-off-by: Mobashshera Rasool <[email protected]>
  • Loading branch information
mobash-rasool committed Aug 16, 2022
1 parent 0844fdc commit 1c0cffa
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 2 deletions.
8 changes: 8 additions & 0 deletions doc/user/pimv6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -448,3 +448,11 @@ the config was written out.
.. clicmd:: debug pimv6 zebra

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.
35 changes: 35 additions & 0 deletions pimd/pim6_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
1 change: 1 addition & 0 deletions pimd/pim6_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions pimd/pim_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pimd/pim_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 1c0cffa

Please sign in to comment.