]> The Tcpdump Group git mirrors - tcpdump/commitdiff
print IPv6 packets (PPP_IPV6 == 0x0057)
authoritojun <itojun>
Tue, 23 May 2000 16:56:07 +0000 (16:56 +0000)
committeritojun <itojun>
Tue, 23 May 2000 16:56:07 +0000 (16:56 +0000)
ppp.h
print-ppp.c

diff --git a/ppp.h b/ppp.h
index 71f459d1bcc1afe9808334dda637e0f2d7231238..5f3dd362d47eb98d2747aa3bc5dce17535ac67a2 100644 (file)
--- a/ppp.h
+++ b/ppp.h
@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/ppp.h,v 1.8 1999-11-21 03:43:56 assar Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ppp.h,v 1.9 2000-05-23 16:56:07 itojun Exp $ (LBL) */
 /*
  * Point to Point Protocol (PPP) RFC1331
  *
@@ -30,6 +30,7 @@
 #define PPP_BRPDU      0x0031  /* Bridging PDU */
 #define PPP_STII       0x0033  /* Stream Protocol (ST-II) */
 #define PPP_VINES      0x0035  /* Banyan Vines */
+#define PPP_IPV6       0x0057  /* IPv6 */
 
 #define PPP_HELLO      0x0201  /* 802.1d Hello Packets */
 #define PPP_LUXCOM     0x0231  /* Luxcom */
@@ -43,6 +44,7 @@
 #define PPP_IPXCP      0x802b  /* Novell IPX Control Protocol */
 #define PPP_STIICP     0x8033  /* Strean Protocol Control Protocol */
 #define PPP_VINESCP    0x8035  /* Banyan Vines Control Protocol */
+#define PPP_IPV6CP     0x8057  /* IPv6 Control Protocol */
 
 #define PPP_LCP                0xc021  /* Link Control Protocol */
 #define PPP_PAP                0xc023  /* Password Authentication Protocol */
index 931cfec1ea824d09569afa38c05b607193d45978..e3c5462c5ed7c88dd8deee9b9409e810fe22b0e5 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.36 2000-04-28 11:14:48 itojun Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.37 2000-05-23 16:56:08 itojun Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -499,9 +499,7 @@ ppp_if_print(u_char *user, const struct pcap_pkthdr *h,
                break;
 #ifdef INET6
        case ETHERTYPE_IPV6:    /*XXX*/
-#ifdef PPP_IPV6
        case PPP_IPV6:
-#endif
                ip6_print((const u_char *)ip, length);
                break;
 #endif
@@ -639,15 +637,31 @@ ppp_bsdos_if_print(u_char *user, const struct pcap_pkthdr *h,
                        ptype = vjc_print(q, length - (q - p), ptype);
                        hdrlength = PPP_BSDI_HDRLEN;
                        p += hdrlength;
-                       if (ptype == PPP_IP)
+                       switch (ptype) {
+                       case PPP_IP:
                                ip_print(p, length);
+                               break;
+#ifdef INET6
+                       case PPP_IPV6:
+                               ip6_print(p, length);
+                               break;
+#endif
+                       }
                        goto printx;
                case PPP_VJNC:
                        ptype = vjc_print(q, length - (q - p), ptype);
                        hdrlength = PPP_BSDI_HDRLEN;
                        p += hdrlength;
-                       if (ptype == PPP_IP)
+                       switch (ptype) {
+                       case PPP_IP:
                                ip_print(p, length);
+                               break;
+#ifdef INET6
+                       case PPP_IPV6:
+                               ip6_print(p, length);
+                               break;
+#endif
+                       }
                        goto printx;
                default:
                        if (eflag) {
@@ -666,10 +680,18 @@ ppp_bsdos_if_print(u_char *user, const struct pcap_pkthdr *h,
        length -= hdrlength;
        p += hdrlength;
 
-       if (ptype == PPP_IP)
+       switch (ptype) {
+       case PPP_IP:
                ip_print(p, length);
-       else
+               break;
+#ifdef INET6
+       case PPP_IPV6:
+               ip6_print(p, length);
+               break;
+#endif
+       default:
                printf("%s ", tok2str(ppptype2str, "proto-#%d", ptype));
+       }
 
 printx:
        if (xflag)