]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ether.c
Add CAP_FCNTL and use cap_fcntls_limit().
[tcpdump] / print-ether.c
index efbb8cfdbb591aac5eab40135eb734b90ae561ef..e57d993b965e846ffc5670d470d198a08ce8e604 100644 (file)
@@ -76,11 +76,13 @@ const struct tok ethertype_values[] = {
     { ETHERTYPE_GRE_ISO,        "GRE-OSI" },
     { ETHERTYPE_CFM_OLD,        "CFM (old)" },
     { ETHERTYPE_CFM,            "CFM" },
+    { ETHERTYPE_IEEE1905_1,     "IEEE1905.1" },
     { ETHERTYPE_LLDP,           "LLDP" },
     { ETHERTYPE_TIPC,           "TIPC"},
     { ETHERTYPE_GEONET_OLD,     "GeoNet (old)"},
     { ETHERTYPE_GEONET,         "GeoNet"},
     { ETHERTYPE_CALM_FAST,      "CALM FAST"},
+    { ETHERTYPE_AOE,            "AoE" },
     { 0, NULL}
 };
 
@@ -89,13 +91,13 @@ ether_hdr_print(netdissect_options *ndo,
                 const u_char *bp, u_int length)
 {
        register const struct ether_header *ep;
-       u_int16_t ether_type;
+       uint16_t ether_type;
 
        ep = (const struct ether_header *)bp;
 
        ND_PRINT((ndo, "%s > %s",
-                    etheraddr_string(ESRC(ep)),
-                    etheraddr_string(EDST(ep))));
+                    etheraddr_string(ndo, ESRC(ep)),
+                    etheraddr_string(ndo, EDST(ep))));
 
        ether_type = EXTRACT_16BITS(&ep->ether_type);
        if (!ndo->ndo_qflag) {
@@ -181,12 +183,9 @@ recurse:
                        return;
                }
                if (ndo->ndo_eflag) {
-                       u_int16_t tag = EXTRACT_16BITS(p);
+                       uint16_t tag = EXTRACT_16BITS(p);
 
-                       ND_PRINT((ndo, "vlan %u, p %u%s, ",
-                           tag & 0xfff,
-                           tag >> 13,
-                           (tag & 0x1000) ? ", CFI" : ""));
+                       ND_PRINT((ndo, "%s, ", ieee8021q_tci_string(tag)));
                }
 
                ether_type = EXTRACT_16BITS(p + 2);
@@ -324,11 +323,9 @@ ethertype_print(netdissect_options *ndo,
                ip_print(ndo, p, length);
                return (1);
 
-#ifdef INET6
        case ETHERTYPE_IPV6:
                ip6_print(ndo, p, length);
                return (1);
-#endif /*INET6*/
 
        case ETHERTYPE_ARP:
        case ETHERTYPE_REVARP:
@@ -336,17 +333,17 @@ ethertype_print(netdissect_options *ndo,
                return (1);
 
        case ETHERTYPE_DN:
-               decnet_print(/*ndo,*/p, length, caplen);
+               decnet_print(ndo, p, length, caplen);
                return (1);
 
        case ETHERTYPE_ATALK:
                if (ndo->ndo_vflag)
                        ND_PRINT((ndo, "et1 "));
-               atalk_print(/*ndo,*/p, length);
+               atalk_print(ndo, p, length);
                return (1);
 
        case ETHERTYPE_AARP:
-               aarp_print(/*ndo,*/p, length);
+               aarp_print(ndo, p, length);
                return (1);
 
        case ETHERTYPE_IPX:
@@ -354,9 +351,9 @@ ethertype_print(netdissect_options *ndo,
                ipx_print(ndo, p, length);
                return (1);
 
-        case ETHERTYPE_ISO:
-                isoclns_print(/*ndo,*/p+1, length-1, length-1);
-                return(1);
+       case ETHERTYPE_ISO:
+               isoclns_print(ndo, p + 1, length - 1, length - 1);
+               return(1);
 
        case ETHERTYPE_PPPOED:
        case ETHERTYPE_PPPOES:
@@ -376,7 +373,7 @@ ethertype_print(netdissect_options *ndo,
        case ETHERTYPE_PPP:
                if (length) {
                        ND_PRINT((ndo, ": "));
-                       ppp_print(/*ndo,*/p, length);
+                       ppp_print(ndo, p, length);
                }
                return (1);
 
@@ -390,11 +387,11 @@ ethertype_print(netdissect_options *ndo,
 
        case ETHERTYPE_CFM:
        case ETHERTYPE_CFM_OLD:
-               cfm_print(/*ndo,*/p, length);
+               cfm_print(ndo, p, length);
                return (1);
 
        case ETHERTYPE_LLDP:
-               lldp_print(/*ndo,*/p, length);
+               lldp_print(ndo, p, length);
                return (1);
 
         case ETHERTYPE_LOOPBACK:
@@ -423,10 +420,15 @@ ethertype_print(netdissect_options *ndo,
                 calm_fast_print(ndo, p-14, p, length);
                 return (1);
 
+       case ETHERTYPE_AOE:
+               aoe_print(ndo, p, length);
+               return (1);
+
        case ETHERTYPE_LAT:
        case ETHERTYPE_SCA:
        case ETHERTYPE_MOPRC:
        case ETHERTYPE_MOPDL:
+       case ETHERTYPE_IEEE1905_1:
                /* default_print for now */
        default:
                return (0);