]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-pim.c
Making "extracted_ethertype" static to "print-ether.c" broke other
[tcpdump] / print-pim.c
index d9126e861a8ea5eaf176ff644f8da6b5e26fa7fc..ca88623934fa1dfe0ee295f833b976a3b1ceab27 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.19 2000-04-24 12:59:39 itojun 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
@@ -33,8 +33,6 @@ static const char rcsid[] =
 #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,
@@ -64,6 +62,8 @@ struct pim {
 #include "addrtoname.h"
 #include "extract.h"
 
+#include "ip.h"
+
 static void pimv2_print(register const u_char *bp, register u_int len);
 
 static void
@@ -634,7 +634,7 @@ pimv2_print(register const u_char *bp, register u_int 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);
@@ -646,7 +646,7 @@ pimv2_print(register const u_char *bp, register u_int len)
                        break;
 #endif
                 default:
-                       (void)printf(" IP ver %d", ip->ip_v);
+                       (void)printf(" IP ver %d", IP_V(ip));
                        break;
                }
                break;
@@ -799,12 +799,12 @@ pimv2_print(register const u_char *bp, register u_int len)
                                (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++) {