pimd: Addition of Hello & Join-Prune message debug commands
Separate "debug pim packets hello and Join-Prune" added to enable hello
and Join-Prune debugs specifically
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index eae7dc3..6176fe5 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -3302,7 +3302,30 @@
DEBUG_PIM_STR
DEBUG_PIM_PACKETS_STR)
{
- PIM_DO_DEBUG_PIM_PACKETS;
+ PIM_DO_DEBUG_PIM_PACKETS;
+ vty_out (vty, "PIM Packet debugging is on %s", VTY_NEWLINE);
+ return CMD_SUCCESS;
+}
+
+DEFUN (debug_pim_packets_filter,
+ debug_pim_packets_filter_cmd,
+ "debug pim packets (hello|joins)",
+ DEBUG_STR
+ DEBUG_PIM_STR
+ DEBUG_PIM_PACKETS_STR
+ DEBUG_PIM_HELLO_PACKETS_STR
+ DEBUG_PIM_J_P_PACKETS_STR)
+{
+ if (strncmp(argv[0],"h",1) == 0)
+ {
+ PIM_DO_DEBUG_PIM_HELLO;
+ vty_out (vty, "PIM Hello debugging is on %s", VTY_NEWLINE);
+ }
+ else if (strncmp(argv[0],"j",1) == 0)
+ {
+ PIM_DO_DEBUG_PIM_J_P;
+ vty_out (vty, "PIM Join/Prune debugging is on %s", VTY_NEWLINE);
+ }
return CMD_SUCCESS;
}
@@ -3312,12 +3335,38 @@
NO_STR
DEBUG_STR
DEBUG_PIM_STR
- DEBUG_PIM_PACKETS_STR)
+ DEBUG_PIM_PACKETS_STR
+ DEBUG_PIM_HELLO_PACKETS_STR
+ DEBUG_PIM_J_P_PACKETS_STR)
{
PIM_DONT_DEBUG_PIM_PACKETS;
+ vty_out (vty, "PIM Packet debugging is off %s", VTY_NEWLINE);
return CMD_SUCCESS;
}
+DEFUN (no_debug_pim_packets_filter,
+ no_debug_pim_packets_filter_cmd,
+ "no debug pim packets (hello|joins)",
+ NO_STR
+ DEBUG_STR
+ DEBUG_PIM_STR
+ DEBUG_PIM_PACKETS_STR
+ DEBUG_PIM_HELLO_PACKETS_STR
+ DEBUG_PIM_J_P_PACKETS_STR)
+{
+ if (strncmp(argv[0],"h",1) == 0)
+ {
+ PIM_DONT_DEBUG_PIM_HELLO;
+ vty_out (vty, "PIM Hello debugging is off %s", VTY_NEWLINE);
+ }
+ else if (strncmp(argv[0],"j",1) == 0)
+ {
+ PIM_DONT_DEBUG_PIM_J_P;
+ vty_out (vty, "PIM Join/Prune debugging is off %s", VTY_NEWLINE);
+ }
+ return CMD_SUCCESS;
+}
+
ALIAS (no_debug_pim_packets,
undebug_pim_packets_cmd,
"undebug pim packets",
@@ -4406,7 +4455,9 @@
install_element (ENABLE_NODE, &no_debug_pim_events_cmd);
install_element (ENABLE_NODE, &undebug_pim_events_cmd);
install_element (ENABLE_NODE, &debug_pim_packets_cmd);
+ install_element (ENABLE_NODE, &debug_pim_packets_filter_cmd);
install_element (ENABLE_NODE, &no_debug_pim_packets_cmd);
+ install_element (ENABLE_NODE, &no_debug_pim_packets_filter_cmd);
install_element (ENABLE_NODE, &undebug_pim_packets_cmd);
install_element (ENABLE_NODE, &debug_pim_packetdump_send_cmd);
install_element (ENABLE_NODE, &no_debug_pim_packetdump_send_cmd);
@@ -4445,7 +4496,9 @@
install_element (CONFIG_NODE, &no_debug_pim_events_cmd);
install_element (CONFIG_NODE, &undebug_pim_events_cmd);
install_element (CONFIG_NODE, &debug_pim_packets_cmd);
+ install_element (CONFIG_NODE, &debug_pim_packets_filter_cmd);
install_element (CONFIG_NODE, &no_debug_pim_packets_cmd);
+ install_element (CONFIG_NODE, &no_debug_pim_packets_filter_cmd);
install_element (CONFIG_NODE, &undebug_pim_packets_cmd);
install_element (CONFIG_NODE, &debug_pim_trace_cmd);
install_element (CONFIG_NODE, &no_debug_pim_trace_cmd);
diff --git a/pimd/pim_cmd.h b/pimd/pim_cmd.h
index 391046a..c503740 100644
--- a/pimd/pim_cmd.h
+++ b/pimd/pim_cmd.h
@@ -42,6 +42,8 @@
#define DEBUG_PIM_STR "PIM protocol activity\n"
#define DEBUG_PIM_EVENTS_STR "PIM protocol events\n"
#define DEBUG_PIM_PACKETS_STR "PIM protocol packets\n"
+#define DEBUG_PIM_HELLO_PACKETS_STR "PIM Hello protocol packets\n"
+#define DEBUG_PIM_J_P_PACKETS_STR "PIM Join/Prune protocol packets\n"
#define DEBUG_PIM_PACKETDUMP_STR "PIM packet dump\n"
#define DEBUG_PIM_PACKETDUMP_SEND_STR "Dump sent packets\n"
#define DEBUG_PIM_PACKETDUMP_RECV_STR "Dump received packets\n"
diff --git a/pimd/pim_hello.c b/pimd/pim_hello.c
index 94e7c94..1285783 100644
--- a/pimd/pim_hello.c
+++ b/pimd/pim_hello.c
@@ -204,7 +204,7 @@
FREE_ADDR_LIST_THEN_RETURN(-2);
}
- if (PIM_DEBUG_PIM_TRACE) {
+ if (PIM_DEBUG_PIM_TRACE || PIM_DEBUG_PIM_HELLO) {
char src_str[100];
pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
zlog_debug("%s: parse left_size=%d: PIM hello TLV type=%d length=%d from %s on %s",
@@ -262,7 +262,7 @@
}
break;
case PIM_MSG_OPTION_TYPE_DM_STATE_REFRESH:
- if (PIM_DEBUG_PIM_TRACE) {
+ if (PIM_DEBUG_PIM_TRACE || PIM_DEBUG_PIM_HELLO) {
char src_str[100];
pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
zlog_debug("%s: ignoring PIM hello dense-mode state refresh TLV option type=%d length=%d from %s on interface %s",
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c
index fb6c3ac..04823c2 100644
--- a/pimd/pim_pim.c
+++ b/pimd/pim_pim.c
@@ -509,7 +509,7 @@
pim_ifp = ifp->info;
- if (PIM_DEBUG_PIM_PACKETS) {
+ if (PIM_DEBUG_PIM_PACKETS || PIM_DEBUG_PIM_HELLO) {
char dst_str[100];
pim_inet4_dump("<dst?>", qpim_all_pim_routers_addr, dst_str, sizeof(dst_str));
zlog_debug("%s: to %s on %s: holdt=%u prop_d=%u overr_i=%u dis_join_supp=%d dr_prio=%u gen_id=%08x addrs=%d",
diff --git a/pimd/pimd.h b/pimd/pimd.h
index b0a1b64..22a2922 100644
--- a/pimd/pimd.h
+++ b/pimd/pimd.h
@@ -64,6 +64,8 @@
#define PIM_MASK_ZEBRA (1 << 8)
#define PIM_MASK_SSMPINGD (1 << 9)
#define PIM_MASK_MROUTE (1 << 10)
+#define PIM_MASK_PIM_HELLO (1 << 11)
+#define PIM_MASK_PIM_J_P (1 << 12)
const char *const PIM_ALL_SYSTEMS;
const char *const PIM_ALL_ROUTERS;
@@ -114,6 +116,8 @@
#define PIM_DEBUG_ZEBRA (qpim_debugs & PIM_MASK_ZEBRA)
#define PIM_DEBUG_SSMPINGD (qpim_debugs & PIM_MASK_SSMPINGD)
#define PIM_DEBUG_MROUTE (qpim_debugs & PIM_MASK_MROUTE)
+#define PIM_DEBUG_PIM_HELLO (qpim_debugs & PIM_MASK_PIM_HELLO)
+#define PIM_DEBUG_PIM_J_P (qpim_debugs & PIM_MASK_PIM_J_P)
#define PIM_DEBUG_EVENTS (qpim_debugs & (PIM_MASK_PIM_EVENTS | PIM_MASK_IGMP_EVENTS))
#define PIM_DEBUG_PACKETS (qpim_debugs & (PIM_MASK_PIM_PACKETS | PIM_MASK_IGMP_PACKETS))
@@ -130,6 +134,8 @@
#define PIM_DO_DEBUG_ZEBRA (qpim_debugs |= PIM_MASK_ZEBRA)
#define PIM_DO_DEBUG_SSMPINGD (qpim_debugs |= PIM_MASK_SSMPINGD)
#define PIM_DO_DEBUG_MROUTE (qpim_debugs |= PIM_MASK_MROUTE)
+#define PIM_DO_DEBUG_PIM_HELLO (qpim_debugs |= PIM_MASK_PIM_HELLO)
+#define PIM_DO_DEBUG_PIM_J_P (qpim_debugs |= PIM_MASK_PIM_J_P)
#define PIM_DONT_DEBUG_PIM_EVENTS (qpim_debugs &= ~PIM_MASK_PIM_EVENTS)
#define PIM_DONT_DEBUG_PIM_PACKETS (qpim_debugs &= ~PIM_MASK_PIM_PACKETS)
@@ -142,6 +148,8 @@
#define PIM_DONT_DEBUG_ZEBRA (qpim_debugs &= ~PIM_MASK_ZEBRA)
#define PIM_DONT_DEBUG_SSMPINGD (qpim_debugs &= ~PIM_MASK_SSMPINGD)
#define PIM_DONT_DEBUG_MROUTE (qpim_debugs &= ~PIM_MASK_MROUTE)
+#define PIM_DONT_DEBUG_PIM_HELLO (qpim_debugs &= ~PIM_MASK_PIM_HELLO)
+#define PIM_DONT_DEBUG_PIM_J_P (qpim_debugs &= ~PIM_MASK_PIM_J_P)
void pim_init(void);
void pim_terminate(void);