]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ether.c
ether_encap_print() is a utility for use by printers for protocols that
[tcpdump] / print-ether.c
index ecd5ba873a4800391fd85eedcfbed6a4d238eaa9..20a2a65fb868eff1acb5c563bd89c8629983062d 100644 (file)
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.101 2006-02-10 04:52:25 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.106 2008-02-06 10:47:53 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -56,6 +56,7 @@ const struct tok ethertype_values[] = {
     { ETHERTYPE_DN,             "DN" },
     { ETHERTYPE_LAT,            "LAT" },
     { ETHERTYPE_SCA,            "SCA" },
+    { ETHERTYPE_TEB,            "TEB" },
     { ETHERTYPE_LANBRIDGE,      "Lanbridge" },
     { ETHERTYPE_DECDNS,         "DEC DNS" },
     { ETHERTYPE_DECDTS,         "DEC DTS" },
@@ -70,10 +71,14 @@ const struct tok ethertype_values[] = {
     { ETHERTYPE_PPPOED,         "PPPoE D" },
     { ETHERTYPE_PPPOES,         "PPPoE S" },
     { ETHERTYPE_EAPOL,          "EAPOL" },
+    { ETHERTYPE_RRCP,           "RRCP" },
     { ETHERTYPE_JUMBO,          "Jumbo" },
     { ETHERTYPE_LOOPBACK,       "Loopback" },
     { ETHERTYPE_ISO,            "OSI" },
     { ETHERTYPE_GRE_ISO,        "GRE-OSI" },
+    { ETHERTYPE_CFM_OLD,        "CFM (old)" },
+    { ETHERTYPE_CFM,            "CFM" },
+    { ETHERTYPE_LLDP,           "LLDP" },
     { 0, NULL}
 };
 
@@ -243,11 +248,13 @@ ether_encap_print(u_short ether_type, const u_char *p,
 
                if (llc_print(p, length, caplen, p - 18, p - 12,
                    extracted_ether_type) == 0) {
-                               ether_hdr_print(p - 18, length + 4);
+                        ether_hdr_print(p - 18, length + 4);
+
+                        if (!suppress_default_print) {
+                                default_print(p - 18, caplen + 4);
+                        }
                }
 
-               if (!suppress_default_print)
-                       default_print(p - 18, caplen + 4);
 
                return (1);
 
@@ -269,10 +276,11 @@ ether_encap_print(u_short ether_type, const u_char *p,
                 if (llc_print(p, length, caplen, p - 16, p - 10,
                               extracted_ether_type) == 0) {
                     ether_hdr_print(p - 16, length + 2);
-                }
 
-                if (!suppress_default_print)
-                    default_print(p - 16, caplen + 2);
+                    if (!suppress_default_print) {
+                            default_print(p - 16, caplen + 2);
+                    }
+                }
 
                 return (1);
 
@@ -282,6 +290,8 @@ ether_encap_print(u_short ether_type, const u_char *p,
 
        case ETHERTYPE_PPPOED:
        case ETHERTYPE_PPPOES:
+       case ETHERTYPE_PPPOED2:
+       case ETHERTYPE_PPPOES2:
                pppoe_print(p, length);
                return (1);
 
@@ -289,6 +299,10 @@ ether_encap_print(u_short ether_type, const u_char *p,
                eap_print(gndo, p, length);
                return (1);
 
+       case ETHERTYPE_RRCP:
+               rrcp_print(gndo, p - 14 , length + 14);
+               return (1);
+
        case ETHERTYPE_PPP:
                if (length) {
                        printf(": ");
@@ -304,6 +318,15 @@ ether_encap_print(u_short ether_type, const u_char *p,
                slow_print(p, length);
                return (1);
 
+       case ETHERTYPE_CFM:
+       case ETHERTYPE_CFM_OLD:
+               cfm_print(p, length);
+               return (1);
+
+       case ETHERTYPE_LLDP:
+               lldp_print(p, length);
+               return (1);
+
         case ETHERTYPE_LOOPBACK:
                 return (1);