]> The Tcpdump Group git mirrors - tcpdump/commitdiff
add NSH ethertype
authorSteven H. Wang <[email protected]>
Mon, 20 Mar 2017 20:07:02 +0000 (13:07 -0700)
committerDenis Ovsienko <[email protected]>
Sun, 2 Apr 2017 08:08:17 +0000 (09:08 +0100)
https://tools.ietf.org/html/draft-ietf-sfc-nsh-12#section-12.1

ethertype.h
print-ether.c
tests/TESTLIST
tests/nsh-vvv.out [new file with mode: 0644]
tests/nsh.out [new file with mode: 0644]
tests/nsh.pcap [new file with mode: 0644]

index 2aa53a08823dd6d755b80a33632a03013a7eb566..f38ec8e4f7881f377353fb7740bf1fb69a7a0b42 100644 (file)
 #ifndef ETHERTYPE_PPPOES
 #define ETHERTYPE_PPPOES       0x8864
 #endif
+#ifndef ETHERTYPE_NSH
+#define ETHERTYPE_NSH          0x894F
+#endif
 #ifndef ETHERTYPE_PPPOED2
 #define ETHERTYPE_PPPOED2      0x3c12
 #endif
index bbfd7e96991daf4d9cc8a3a80b4e785c164b263c..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" },
@@ -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);
index ba29da404680fcb80a31cfb93e3071f8fa5da459..38e3e64f4e9f8c0c22f265e7e4c72d5b871962fc 100644 (file)
@@ -361,7 +361,9 @@ pcap-invalid-version-2 pcap-invalid-version-2.pcap pcap-invalid-version-2.out -t
 pcap-ng-invalid-vers-1 pcap-ng-invalid-vers-1.pcap pcap-ng-invalid-vers-1.out -t
 pcap-ng-invalid-vers-2 pcap-ng-invalid-vers-2.pcap pcap-ng-invalid-vers-2.out -t
 
-# NSH over VxLAN-GPE
+# NSH tests
+nsh                    nsh.pcap                nsh.out                    -t
+nsh-vvv                nsh.pcap                nsh-vvv.out                -t -vvv
 nsh-over-vxlan-gpe     nsh-over-vxlan-gpe.pcap nsh-over-vxlan-gpe.out     -t
 nsh-over-vxlan-gpe-v   nsh-over-vxlan-gpe.pcap nsh-over-vxlan-gpe-v.out   -t -v
 nsh-over-vxlan-gpe-vv  nsh-over-vxlan-gpe.pcap nsh-over-vxlan-gpe-vv.out  -t -vv
diff --git a/tests/nsh-vvv.out b/tests/nsh-vvv.out
new file mode 100644 (file)
index 0000000..4396711
--- /dev/null
@@ -0,0 +1,7 @@
+NSH, ver 0, flags [none], length 6, md type 0x1, next-protocol 0x1, service-path-id 0x000309, service-index 0x7
+        Context[00]: 0x00000001
+        Context[01]: 0x00000002
+        Context[02]: 0x00000003
+        Context[03]: 0x00000004
+    IP (tos 0x0, ttl 64, id 10308, offset 0, flags [DF], proto UDP (17), length 34)
+    10.0.8.3.52229 > 10.13.13.13.8000: [no cksum] UDP, length 6
diff --git a/tests/nsh.out b/tests/nsh.out
new file mode 100644 (file)
index 0000000..1c6a4cd
--- /dev/null
@@ -0,0 +1 @@
+NSH, flags [none], service-path-id 0x000309, service-index 0x7: IP 10.0.8.3.52229 > 10.13.13.13.8000: UDP, length 6
diff --git a/tests/nsh.pcap b/tests/nsh.pcap
new file mode 100644 (file)
index 0000000..c919ee2
Binary files /dev/null and b/tests/nsh.pcap differ