]> The Tcpdump Group git mirrors - tcpdump/commitdiff
add support for Jumbo Ethertype 0x8870 and embedded OSI traffic
authorhannes <hannes>
Wed, 18 Feb 2004 14:23:27 +0000 (14:23 +0000)
committerhannes <hannes>
Wed, 18 Feb 2004 14:23:27 +0000 (14:23 +0000)
ethertype.h
print-ether.c

index a00d82a3cca9bae07921f27ddfa14d6a20cd8e60..c9aa30e2900bcf0c8f051555f66d0484c3d1c6fb 100644 (file)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * @(#) $Header: /tcpdump/master/tcpdump/ethertype.h,v 1.20 2003-07-01 19:10:26 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/ethertype.h,v 1.21 2004-02-18 14:23:27 hannes Exp $ (LBL)
  */
 
 /*
 #ifndef ETHERTYPE_PPPOES
 #define ETHERTYPE_PPPOES       0x8864
 #endif
+#ifndef ETHERTYPE_JUMBO
+#define ETHERTYPE_JUMBO         0x8870
+#endif
 #ifndef        ETHERTYPE_LOOPBACK
 #define        ETHERTYPE_LOOPBACK      0x9000
 #endif
index e6f759b56bee00cd6e909647f38f92994f1303b0..71c28a5f1a8d15c9826bbf9996b04da370870db9 100644 (file)
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.87 2003-12-29 19:05:37 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.88 2004-02-18 14:23:27 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -69,7 +69,9 @@ const struct tok ethertype_values[] = {
     { ETHERTYPE_PPP,            "PPP" },
     { ETHERTYPE_PPPOED,         "PPPoE D" },
     { ETHERTYPE_PPPOES,         "PPPoE S" },
+    { ETHERTYPE_JUMBO,          "Jumbo" },
     { ETHERTYPE_LOOPBACK,       "Loopback" },
+    { ETHERTYPE_ISO,            "OSI" },
     { 0, NULL}
 };
 
@@ -248,6 +250,35 @@ ether_encap_print(u_short ether_type, const u_char *p,
 
                return (1);
 
+        case ETHERTYPE_JUMBO:
+                ether_type = ntohs(*(u_int16_t *)(p));
+                p += 2;
+                length -= 2;      
+                caplen -= 2;
+
+                if (ether_type > ETHERMTU) {
+                    if (eflag)
+                        printf("ethertype %s, ",
+                               tok2str(ethertype_values,"0x%04x", ether_type));
+                    goto recurse;
+                }
+
+                *extracted_ether_type = 0;
+
+                if (llc_print(p, length, caplen, p - 16, p - 10,
+                              extracted_ether_type) == 0) {
+                    ether_hdr_print(p - 16, length + 2);
+                }
+
+                if (!xflag && !qflag)
+                    default_print(p - 16, caplen + 2);
+
+                return (1);
+
+        case ETHERTYPE_ISO:
+                isoclns_print(p+1, length-1, length-1);
+                return(1);
+
        case ETHERTYPE_PPPOED:
        case ETHERTYPE_PPPOES:
                pppoe_print(p, length);