#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.24 2001-01-28 08:27:28 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.31 2002-06-11 17:08:53 itojun Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
}
TCHECK2(bp[0], 4);
- (void)printf("\n Upstream Nbr: %s", ipaddr_string(bp));
+ if (vflag > 1)
+ (void)printf("\n");
+ (void)printf(" Upstream Nbr: %s", ipaddr_string(bp));
TCHECK2(bp[6], 2);
- (void)printf("\n Hold time: ");
+ if (vflag > 1)
+ (void)printf("\n");
+ (void)printf(" Hold time: ");
relts_print(EXTRACT_16BITS(&bp[6]));
+ if (vflag < 2)
+ return;
bp += 8;
len -= 8;
/*
* auto-RP is a cisco protocol, documented at
- * ftp://ftpeng.cisco.com/ipmulticast/pim-autorp-spec01.txt
+ * ftp://ftpeng.cisco.com/ipmulticast/specs/pim-autorp-spec01.txt
+ *
+ * This implements version 1+, dated Sept 9, 1998.
*/
void
cisco_autorp_print(register const u_char *bp, register u_int len)
case 3: printf(" PIMv1+2");
break;
}
+ if (bp[4] & 0xfc)
+ (void)printf(" [rsvd=0x%02x]", bp[4] & 0xfc);
TCHECK(bp[5]);
nentries = bp[5];
bp += 6; len -= 6;
TCHECK2(bp[0], 6);
(void)printf("%c%s%s/%d", s, bp[0] & 1 ? "!" : "",
ipaddr_string(&bp[2]), bp[1]);
+ if (bp[0] & 0xfe)
+ (void)printf("[rsvd=0x%02x]", bp[0] & 0xfe);
s = ',';
bp += 6; len -= 6;
}
enum pimv2_addrtype {
pimv2_unicast, pimv2_group, pimv2_source
};
-#if 0
-static char *addrtypestr[] = {
- "unicast", "group", "source"
-};
-#endif
/* 0 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
(void)printf(")");
break;
- /* XXX
- * draft-ietf-idmr-pimv2-dr-priority-00.txt
- * says that DR-Priority is option 19.
- * draft-ietf-pim-v2-sm-00.txt says it's 18.
- */
- case 18: /* DR-Priority */
- (void)printf(" (DR-Priority: %d)", EXTRACT_32BITS(&bp[4]));
- break;
-
- case 19: /* Bidir-Capable */
+ case 18: /* Old DR-Priority */
if (olen == 4)
- (void)printf(" (OLD-DR-Priority: %d)", EXTRACT_32BITS(&bp[4]));
+ (void)printf(" (OLD-DR-Priority: %d)",
+ EXTRACT_32BITS(&bp[4]));
else
- (void)printf(" (bidir-capable)");
+ goto unknown;
+ break;
+
+
+ case 19: /* DR-Priority */
+ if (olen == 0) {
+ (void)printf(" (OLD-bidir-capable)");
+ break;
+ }
+ (void)printf(" (DR-Priority: ");
+ if (olen != 4) {
+ (void)printf("!olen=%d!)", olen);
+ } else {
+ (void)printf("%d)", EXTRACT_32BITS(&bp[4]));
+ }
break;
case 20:
break;
case 21:
- (void)printf(" (State Refresh Capable");
- if (EXTRACT_32BITS(&bp[4]) != 1) {
- (void)printf(" ?0x%x?", EXTRACT_32BITS(&bp[4]));
+ (void)printf(" (State Refresh Capable; v%d", bp[4]);
+ if (bp[5] != 0) {
+ (void)printf(" interval ");
+ relts_print(bp[5]);
+ }
+ if (EXTRACT_16BITS(&bp[6]) != 0) {
+ (void)printf(" ?0x%04x?", EXTRACT_16BITS(&bp[6]));
}
(void)printf(")");
break;
+ case 22: /* Bidir-Capable */
+ (void)printf(" (bidir-capable)");
+ break;
+
default:
+ unknown:
if (vflag)
(void)printf(" [Hello option %d]", otype);
}