]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ether.c
add NSH ethertype
[tcpdump] / print-ether.c
index 59d15c24481a509f5c27fb9682fded67fca65a11..57c07ce935182931692fc98f62a40386159c0b37 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" },
@@ -126,6 +127,8 @@ ether_hdr_print(netdissect_options *ndo,
  * This might be encapsulated within another frame; we might be passed
  * a pointer to a function that can print header information for that
  * frame's protocol, and an argument to pass to that function.
+ *
+ * FIXME: caplen can and should be derived from ndo->ndo_snapend and p.
  */
 u_int
 ether_print(netdissect_options *ndo,
@@ -360,7 +363,11 @@ ethertype_print(netdissect_options *ndo,
                return (1);
 
        case ETHERTYPE_ISO:
-               isoclns_print(ndo, p + 1, length - 1, length - 1);
+               if (length == 0 || caplen == 0) {
+                       ND_PRINT((ndo, " [|osi]"));
+                       return (1);
+               }
+               isoclns_print(ndo, p + 1, length - 1, caplen - 1);
                return(1);
 
        case ETHERTYPE_PPPOED:
@@ -402,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);
@@ -433,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: