DEFUN (debug_pim_packets_filter,
debug_pim_packets_filter_cmd,
- "debug pim packets <hello|joins>",
+ "debug pim packets <hello|joins|register>",
DEBUG_STR
DEBUG_PIM_STR
DEBUG_PIM_PACKETS_STR
DEBUG_PIM_HELLO_PACKETS_STR
- DEBUG_PIM_J_P_PACKETS_STR)
+ DEBUG_PIM_J_P_PACKETS_STR
+ DEBUG_PIM_PIM_REG_PACKETS_STR)
{
int idx_hello_join = 3;
- if (strncmp(argv[idx_hello_join]->arg,"h",1) == 0)
+ if (strncmp(argv[idx_hello_join]->arg,"h",1) == 0)
{
PIM_DO_DEBUG_PIM_HELLO;
- vty_out (vty, "PIM Hello debugging is on %s", VTY_NEWLINE);
+ vty_out (vty, "PIM Hello debugging is on%s", VTY_NEWLINE);
}
- else if (strncmp(argv[idx_hello_join]->arg,"j",1) == 0)
+ else if (strncmp(argv[idx_hello_join]->arg,"j",1) == 0)
{
PIM_DO_DEBUG_PIM_J_P;
- vty_out (vty, "PIM Join/Prune debugging is on %s", VTY_NEWLINE);
+ vty_out (vty, "PIM Join/Prune debugging is on%s", VTY_NEWLINE);
+ }
+ else if (strncmp(argv[idx_hello_join]->arg,"r",1) == 0)
+ {
+ PIM_DO_DEBUG_PIM_REG;
+ vty_out (vty, "PIM Register debugging is on%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 debug pim packets <hello|joins|register>",
NO_STR
DEBUG_STR
DEBUG_PIM_STR
DEBUG_PIM_J_P_PACKETS_STR)
{
int idx_hello_join = 4;
- if (strncmp(argv[idx_hello_join]->arg,"h",1) == 0)
+ if (strncmp(argv[idx_hello_join]->arg,"h",1) == 0)
{
PIM_DONT_DEBUG_PIM_HELLO;
vty_out (vty, "PIM Hello debugging is off %s", VTY_NEWLINE);
}
- else if (strncmp(argv[idx_hello_join]->arg,"j",1) == 0)
+ else if (strncmp(argv[idx_hello_join]->arg,"j",1) == 0)
{
PIM_DONT_DEBUG_PIM_J_P;
vty_out (vty, "PIM Join/Prune debugging is off %s", VTY_NEWLINE);
}
- return CMD_SUCCESS;
+ else if (strncmp (argv[idx_hello_join]->arg, "r", 1) == 0)
+ {
+ PIM_DONT_DEBUG_PIM_REG;
+ vty_out (vty, "PIM Register debugging is off%s", VTY_NEWLINE);
+ }
+ return CMD_SUCCESS;
}
#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_PIM_REG_PACKETS_STR "PIM Register/Reg-Stop 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"
uint8_t *b1;
struct prefix p;
+ if (PIM_DEBUG_PIM_REG)
+ {
+ zlog_debug ("Sending Register stop for %s to %s on %s",
+ pim_str_sg_dump (sg), inet_ntoa(originator), ifp->name);
+ }
+
memset (buffer, 0, 3000);
b1 = (uint8_t *)buffer + PIM_MSG_REGISTER_STOP_LEN;
struct prefix sg;
int l;
- if (PIM_DEBUG_PIM_PACKETDUMP_RECV)
- pim_pkt_dump ("Received Register Stop", buf, buf_size);
-
l = pim_parse_addr_group (&group, buf, buf_size);
buf += l;
buf_size -= l;
memset (&sg, 0, sizeof (struct prefix));
sg.u.sg.src = source.u.prefix4;
sg.u.sg.grp = group.u.prefix4;
+
+ if (PIM_DEBUG_PIM_REG)
+ {
+ zlog_debug ("Received Register stop for %s",
+ pim_str_sg_dump (&sg));
+ }
+
upstream = pim_upstream_find (&sg);
if (!upstream)
{
struct pim_interface *pinfo;
struct interface *ifp;
+ if (PIM_DEBUG_PIM_REG)
+ {
+ char rp_str[100];
+ strcpy (rp_str, inet_ntoa (rpg->rpf_addr));
+ zlog_debug ("Sending %sRegister Packet to %s", null_register ? "NULL " : "", rp_str);
+ }
+
ifp = rpg->source_nexthop.interface;
pinfo = (struct pim_interface *)ifp->info;
if (!pinfo) {
return 0;
}
+ if (PIM_DEBUG_PIM_REG)
+ {
+ char src_str[100];
+
+ pim_inet4_dump ("<src?>", src_addr, src_str, sizeof (src_str));
+ zlog_debug ("Received Register message from %s on %s", src_str, ifp->name);
+ }
+
/*
* Please note this is not drawn to get the correct bit/data size
*
++writes;
}
+ if (PIM_DEBUG_PIM_REG) {
+ vty_out (vty, "debug pim packets register%s", VTY_NEWLINE);
+ ++writes;
+ }
+
if (PIM_DEBUG_STATIC) {
vty_out (vty, "debug pim static%s", VTY_NEWLINE);
++writes;
#define PIM_MASK_PIM_HELLO (1 << 14)
#define PIM_MASK_PIM_J_P (1 << 15)
#define PIM_MASK_STATIC (1 << 16)
+#define PIM_MASK_PIM_REG (1 << 17)
const char *const PIM_ALL_SYSTEMS;
const char *const PIM_ALL_ROUTERS;
#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_PIM_REG (qpim_debugs & PIM_MASK_PIM_REG)
#define PIM_DEBUG_STATIC (qpim_debugs & PIM_MASK_STATIC)
#define PIM_DEBUG_EVENTS (qpim_debugs & (PIM_MASK_PIM_EVENTS | PIM_MASK_IGMP_EVENTS))
#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_DO_DEBUG_PIM_REG (qpim_debugs |= PIM_MASK_PIM_REG)
#define PIM_DO_DEBUG_STATIC (qpim_debugs |= PIM_MASK_STATIC)
#define PIM_DONT_DEBUG_PIM_EVENTS (qpim_debugs &= ~PIM_MASK_PIM_EVENTS)
#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)
+#define PIM_DONT_DEBUG_PIM_REG (qpim_debugs &= ~PIM_MASK_PIM_REG)
#define PIM_DONT_DEBUG_STATIC (qpim_debugs &= ~PIM_MASK_STATIC)
void pim_init(void);