#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.18 2000-02-16 21:49:23 fenner Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.23 2000-10-03 02:55:00 itojun Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <sys/socket.h>
#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
/*
* XXX: We consider a case where IPv6 is not ready yet for portability,
#include "addrtoname.h"
#include "extract.h"
+#include "ip.h"
+
static void pimv2_print(register const u_char *bp, register u_int len);
static void
TCHECK2(bp[0], 4);
(void)printf(" RP %s", ipaddr_string(bp));
TCHECK(bp[4]);
- switch(bp[4] & 0x3) {
+ switch (bp[4] & 0x3) {
case 0: printf(" PIMv?");
break;
case 1: printf(" PIMv1");
TCHECK(pim->pim_rsv);
#endif
- switch(PIM_VER(pim->pim_typever)) {
+ switch (PIM_VER(pim->pim_typever)) {
case 2: /* avoid hardcoding? */
(void)printf("pim v2");
pimv2_print(bp, len);
if (bp >= ep)
break;
ip = (struct ip *)bp;
- switch(ip->ip_v) {
+ switch (IP_V(ip)) {
case 4: /* IPv4 */
printf(" ");
ip_print(bp, len);
break;
#endif
default:
- (void)printf(" IP ver %d", ip->ip_v);
+ (void)printf(" IP ver %d", IP_V(ip));
break;
}
break;
(void)printf("...)");
goto bs_done;
}
- (void)printf(" RPcnt=%d", frpcnt = bp[0]);
+ (void)printf(" RPcnt=%d", bp[0]);
if (bp + 1 >= ep) {
(void)printf("...)");
goto bs_done;
}
- (void)printf(" FRPcnt=%d", bp[1]);
+ (void)printf(" FRPcnt=%d", frpcnt = bp[1]);
bp += 4;
for (j = 0; j < frpcnt && bp < ep; j++) {