*/
#ifndef lint
-static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.28 2001-06-15 22:17:34 fenner Exp $ (LBL)";
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.37.2.4 2004-03-24 02:52:37 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
+#include <tcpdump-stdinc.h>
/*
* XXX: We consider a case where IPv6 is not ready yet for portability,
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
#include "interface.h"
#include "addrtoname.h"
while (ngroups--) {
TCHECK2(bp[0], 4);
(void)printf("\n\tGroup: %s", ipaddr_string(bp));
+ TCHECK2(bp[4], 4);
if (EXTRACT_32BITS(&bp[4]) != 0xffffffff)
(void)printf("/%s", ipaddr_string(&bp[4]));
TCHECK2(bp[8], 4);
bp += 12;
len -= 12;
for (njp = 0; njp < (njoin + nprune); njp++) {
- char *type;
+ const char *type;
if (njp < njoin)
type = "Join ";
if (bp >= ep)
return;
+ TCHECK(bp[1]);
type = bp[1];
switch (type) {
/*
* 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;
}
pimv2_addr_print(const u_char *bp, enum pimv2_addrtype at, int silent)
{
int af;
- char *afstr;
+ const char *afstr;
int len, hdrlen;
TCHECK(bp[0]);
(void)printf(")");
break;
+ case 2: /* LAN Prune Delay */
+ (void)printf(" (LAN-Prune-Delay: ");
+ if (olen != 4) {
+ (void)printf("!olen=%d!)", olen);
+ } else {
+ char t_bit;
+ u_int16_t lan_delay, override_interval;
+ lan_delay = EXTRACT_16BITS(&bp[4]);
+ override_interval = EXTRACT_16BITS(&bp[6]);
+ t_bit = (lan_delay & 0x8000)? 1 : 0;
+ lan_delay &= ~0x8000;
+ (void)printf("T-bit=%d lan-delay=%dms override-interval=%dms)",
+ t_bit, lan_delay, override_interval);
+ }
+ break;
+
+ case 18: /* Old DR-Priority */
+ if (olen == 4)
+ (void)printf(" (OLD-DR-Priority: %d)",
+ EXTRACT_32BITS(&bp[4]));
+ else
+ 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);
(void)printf(" (bidir-capable)");
break;
+ case 24: /* Address List */
+ case 65001: /* Address List (old implementations) */
+ (void)printf(" (%saddr-list",
+ otype == 65001 ? "old" : "");
+ if (vflag > 1) {
+ const u_char *ptr = &bp[4];
+ while (ptr < &bp[4 + olen]) {
+ int advance;
+
+ printf(" ");
+ advance = pimv2_addr_print(ptr, pimv2_unicast, 0);
+ if (advance < 0) {
+ printf("...");
+ break;
+ }
+ ptr += advance;
+ }
+ }
+ (void)printf(")");
+ break;
default:
+ unknown:
if (vflag)
(void)printf(" [Hello option %d]", otype);
}