diff options
author | Everton Marques <everton.marques@gmail.com> | 2010-02-23 12:11:11 -0300 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2015-02-04 06:07:53 +0100 |
commit | 67faabc18026bf3f8ae6d7ee1df9f2b1729ea06b (patch) | |
tree | a8408f073596e83cc4d761f942095252d5b7b4b0 | |
parent | 9986fb3a25a0432dbd89aa1e319c89691db05bc0 (diff) | |
download | quagga-67faabc18026bf3f8ae6d7ee1df9f2b1729ea06b.tar.bz2 quagga-67faabc18026bf3f8ae6d7ee1df9f2b1729ea06b.tar.xz |
[pim] debug mroute
-rw-r--r-- | pimd/pim_cmd.c | 31 | ||||
-rw-r--r-- | pimd/pim_cmd.h | 1 | ||||
-rw-r--r-- | pimd/pim_vty.c | 5 | ||||
-rw-r--r-- | pimd/pim_zebra.c | 44 | ||||
-rw-r--r-- | pimd/pimd.h | 4 |
5 files changed, 85 insertions, 0 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 9553361a..2b418cd4 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -3131,6 +3131,33 @@ ALIAS (no_debug_igmp_trace, DEBUG_IGMP_STR DEBUG_IGMP_TRACE_STR) +DEFUN (debug_mroute, + debug_mroute_cmd, + "debug mroute", + DEBUG_STR + DEBUG_MROUTE_STR) +{ + PIM_DO_DEBUG_MROUTE; + return CMD_SUCCESS; +} + +DEFUN (no_debug_mroute, + no_debug_mroute_cmd, + "no debug mroute", + NO_STR + DEBUG_STR + DEBUG_MROUTE_STR) +{ + PIM_DONT_DEBUG_MROUTE; + return CMD_SUCCESS; +} + +ALIAS (no_debug_mroute, + undebug_mroute_cmd, + "undebug mroute", + UNDEBUG_STR + DEBUG_MROUTE_STR) + DEFUN (debug_pim, debug_pim_cmd, "debug pim", @@ -4295,6 +4322,8 @@ void pim_cmd_init() install_element (ENABLE_NODE, &debug_igmp_trace_cmd); install_element (ENABLE_NODE, &no_debug_igmp_trace_cmd); install_element (ENABLE_NODE, &undebug_igmp_trace_cmd); + install_element (ENABLE_NODE, &debug_mroute_cmd); + install_element (ENABLE_NODE, &no_debug_mroute_cmd); install_element (ENABLE_NODE, &debug_pim_cmd); install_element (ENABLE_NODE, &no_debug_pim_cmd); install_element (ENABLE_NODE, &undebug_pim_cmd); @@ -4332,6 +4361,8 @@ void pim_cmd_init() install_element (CONFIG_NODE, &debug_igmp_trace_cmd); install_element (CONFIG_NODE, &no_debug_igmp_trace_cmd); install_element (CONFIG_NODE, &undebug_igmp_trace_cmd); + install_element (CONFIG_NODE, &debug_mroute_cmd); + install_element (CONFIG_NODE, &no_debug_mroute_cmd); install_element (CONFIG_NODE, &debug_pim_cmd); install_element (CONFIG_NODE, &no_debug_pim_cmd); install_element (CONFIG_NODE, &undebug_pim_cmd); diff --git a/pimd/pim_cmd.h b/pimd/pim_cmd.h index fd1a62fa..d83cbc09 100644 --- a/pimd/pim_cmd.h +++ b/pimd/pim_cmd.h @@ -38,6 +38,7 @@ #define DEBUG_IGMP_EVENTS_STR "IGMP protocol events\n" #define DEBUG_IGMP_PACKETS_STR "IGMP protocol packets\n" #define DEBUG_IGMP_TRACE_STR "IGMP internal daemon activity\n" +#define DEBUG_MROUTE_STR "PIM interaction with kernel MFC cache\n" #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" diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index 3a1abf13..bcace95c 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -49,6 +49,11 @@ int pim_debug_config_write(struct vty *vty) ++writes; } + if (PIM_DEBUG_MROUTE) { + vty_out(vty, "debug mroute%s", VTY_NEWLINE); + ++writes; + } + if (PIM_DEBUG_PIM_EVENTS) { vty_out(vty, "debug pim events%s", VTY_NEWLINE); ++writes; diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index 3530434d..e18b7ac9 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -754,6 +754,17 @@ static int add_oif(struct channel_oil *channel_oil, pim_ifp = oif->info; + if (PIM_DEBUG_MROUTE) { + char group_str[100]; + char source_str[100]; + pim_inet4_dump("<group?>", channel_oil->oil.mfcc_mcastgrp, group_str, sizeof(group_str)); + pim_inet4_dump("<source?>", channel_oil->oil.mfcc_origin, source_str, sizeof(source_str)); + zlog_debug("%s %s: (S,G)=(%s,%s): proto_mask=%u OIF=%s vif_index=%d", + __FILE__, __PRETTY_FUNCTION__, + source_str, group_str, + proto_mask, oif->name, pim_ifp->mroute_vif_index); + } + if (pim_ifp->mroute_vif_index < 1) { zlog_warn("%s %s: interface %s vif_index=%d < 1", __FILE__, __PRETTY_FUNCTION__, @@ -860,6 +871,17 @@ static int add_oif(struct channel_oil *channel_oil, ++channel_oil->oil_size; channel_oil->oif_flags[pim_ifp->mroute_vif_index] |= proto_mask; + if (PIM_DEBUG_MROUTE) { + char group_str[100]; + char source_str[100]; + pim_inet4_dump("<group?>", channel_oil->oil.mfcc_mcastgrp, group_str, sizeof(group_str)); + pim_inet4_dump("<source?>", channel_oil->oil.mfcc_origin, source_str, sizeof(source_str)); + zlog_debug("%s %s: (S,G)=(%s,%s): proto_mask=%u OIF=%s vif_index=%d: DONE", + __FILE__, __PRETTY_FUNCTION__, + source_str, group_str, + proto_mask, oif->name, pim_ifp->mroute_vif_index); + } + return 0; } @@ -878,6 +900,17 @@ static int del_oif(struct channel_oil *channel_oil, zassert(qpim_mroute_oif_highest_vif_index < MAXVIFS); zassert(pim_ifp->mroute_vif_index <= qpim_mroute_oif_highest_vif_index); + if (PIM_DEBUG_MROUTE) { + char group_str[100]; + char source_str[100]; + pim_inet4_dump("<group?>", channel_oil->oil.mfcc_mcastgrp, group_str, sizeof(group_str)); + pim_inet4_dump("<source?>", channel_oil->oil.mfcc_origin, source_str, sizeof(source_str)); + zlog_debug("%s %s: (S,G)=(%s,%s): proto_mask=%u OIF=%s vif_index=%d", + __FILE__, __PRETTY_FUNCTION__, + source_str, group_str, + proto_mask, oif->name, pim_ifp->mroute_vif_index); + } + /* Prevent single protocol from unsubscribing same interface from channel (S,G) multiple times */ if (!(channel_oil->oif_flags[pim_ifp->mroute_vif_index] & proto_mask)) { @@ -963,6 +996,17 @@ static int del_oif(struct channel_oil *channel_oil, } } + if (PIM_DEBUG_MROUTE) { + char group_str[100]; + char source_str[100]; + pim_inet4_dump("<group?>", channel_oil->oil.mfcc_mcastgrp, group_str, sizeof(group_str)); + pim_inet4_dump("<source?>", channel_oil->oil.mfcc_origin, source_str, sizeof(source_str)); + zlog_debug("%s %s: (S,G)=(%s,%s): proto_mask=%u OIF=%s vif_index=%d: DONE", + __FILE__, __PRETTY_FUNCTION__, + source_str, group_str, + proto_mask, oif->name, pim_ifp->mroute_vif_index); + } + return 0; } diff --git a/pimd/pimd.h b/pimd/pimd.h index 1dcd8654..e11d5bad 100644 --- a/pimd/pimd.h +++ b/pimd/pimd.h @@ -63,6 +63,7 @@ #define PIM_MASK_IGMP_TRACE (1 << 7) #define PIM_MASK_ZEBRA (1 << 8) #define PIM_MASK_SSMPINGD (1 << 9) +#define PIM_MASK_MROUTE (1 << 10) const char *const PIM_ALL_SYSTEMS; const char *const PIM_ALL_ROUTERS; @@ -105,6 +106,7 @@ struct in_addr qpim_ssmpingd_group_addr; #define PIM_DEBUG_IGMP_TRACE (qpim_debugs & PIM_MASK_IGMP_TRACE) #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_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)) @@ -120,6 +122,7 @@ struct in_addr qpim_ssmpingd_group_addr; #define PIM_DO_DEBUG_IGMP_TRACE (qpim_debugs |= PIM_MASK_IGMP_TRACE) #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_DONT_DEBUG_PIM_EVENTS (qpim_debugs &= ~PIM_MASK_PIM_EVENTS) #define PIM_DONT_DEBUG_PIM_PACKETS (qpim_debugs &= ~PIM_MASK_PIM_PACKETS) @@ -131,6 +134,7 @@ struct in_addr qpim_ssmpingd_group_addr; #define PIM_DONT_DEBUG_IGMP_TRACE (qpim_debugs &= ~PIM_MASK_IGMP_TRACE) #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) void pim_init(void); void pim_terminate(void); |