diff options
-rw-r--r-- | pimd/pim_cmd.c | 57 | ||||
-rw-r--r-- | pimd/pim_cmd.h | 2 | ||||
-rw-r--r-- | pimd/pim_hello.c | 4 | ||||
-rw-r--r-- | pimd/pim_pim.c | 2 | ||||
-rw-r--r-- | pimd/pimd.h | 8 |
5 files changed, 68 insertions, 5 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index eae7dc31..6176fe55 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -3302,7 +3302,30 @@ DEFUN (debug_pim_packets, 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 @@ DEFUN (no_debug_pim_packets, 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 @@ void pim_cmd_init() 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 @@ void pim_cmd_init() 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 391046a4..c5037400 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 94e7c945..12857831 100644 --- a/pimd/pim_hello.c +++ b/pimd/pim_hello.c @@ -204,7 +204,7 @@ int pim_hello_recv(struct interface *ifp, 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 @@ int pim_hello_recv(struct interface *ifp, } 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 fb6c3acb..04823c21 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -509,7 +509,7 @@ static int hello_send(struct interface *ifp, 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 b0a1b648..22a29220 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 @@ int64_t qpim_mroute_del_last; #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 @@ int64_t qpim_mroute_del_last; #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 @@ int64_t qpim_mroute_del_last; #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); |