]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ether.c
Fix mkdep invocations.
[tcpdump] / print-ether.c
index 241c5070c9596896f9c02d835e5ad383089fb293..8d8341bae107b77352c88b3d79f7c655401dbea6 100644 (file)
@@ -72,6 +72,7 @@ const struct tok ethertype_values[] = {
     { ETHERTYPE_RRCP,           "RRCP" },
     { ETHERTYPE_MS_NLB_HB,      "MS NLB heartbeat" },
     { ETHERTYPE_JUMBO,          "Jumbo" },
+    { ETHERTYPE_NSH,            "NSH" },
     { ETHERTYPE_LOOPBACK,       "Loopback" },
     { ETHERTYPE_ISO,            "OSI" },
     { ETHERTYPE_GRE_ISO,        "GRE-OSI" },
@@ -101,7 +102,7 @@ ether_hdr_print(netdissect_options *ndo,
                     etheraddr_string(ndo, ESRC(ep)),
                     etheraddr_string(ndo, EDST(ep))));
 
-       length_type = EXTRACT_16BITS(&ep->ether_length_type);
+       length_type = EXTRACT_BE_U_2(&ep->ether_length_type);
        if (!ndo->ndo_qflag) {
                if (length_type <= ETHERMTU) {
                        ND_PRINT((ndo, ", 802.3"));
@@ -167,7 +168,7 @@ ether_print(netdissect_options *ndo,
        src.addr_string = etheraddr_string;
        dst.addr = EDST(ep);
        dst.addr_string = etheraddr_string;
-       length_type = EXTRACT_16BITS(&ep->ether_length_type);
+       length_type = EXTRACT_BE_U_2(&ep->ether_length_type);
 
 recurse:
        /*
@@ -200,12 +201,12 @@ recurse:
                        return (hdrlen + length);
                }
                if (ndo->ndo_eflag) {
-                       uint16_t tag = EXTRACT_16BITS(p);
+                       uint16_t tag = EXTRACT_BE_U_2(p);
 
                        ND_PRINT((ndo, "%s, ", ieee8021q_tci_string(tag)));
                }
 
-               length_type = EXTRACT_16BITS(p + 2);
+               length_type = EXTRACT_BE_U_2(p + 2);
                if (ndo->ndo_eflag && length_type > ETHERMTU)
                        ND_PRINT((ndo, "ethertype %s, ", tok2str(ethertype_values,"0x%04x", length_type)));
                p += 4;
@@ -366,7 +367,7 @@ ethertype_print(netdissect_options *ndo,
                        ND_PRINT((ndo, " [|osi]"));
                        return (1);
                }
-               isoclns_print(ndo, p + 1, length - 1, caplen - 1);
+               isoclns_print(ndo, p + 1, length - 1);
                return(1);
 
        case ETHERTYPE_PPPOED:
@@ -408,6 +409,10 @@ ethertype_print(netdissect_options *ndo,
                lldp_print(ndo, p, length);
                return (1);
 
+        case ETHERTYPE_NSH:
+                nsh_print(ndo, p, length);
+                return (1);
+
         case ETHERTYPE_LOOPBACK:
                loopback_print(ndo, p, length);
                 return (1);
@@ -439,7 +444,7 @@ ethertype_print(netdissect_options *ndo,
                return (1);
 
        case ETHERTYPE_MEDSA:
-               medsa_print(ndo, p, length, caplen);
+               medsa_print(ndo, p, length, caplen, src, dst);
                return (1);
 
        case ETHERTYPE_LAT: