]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Print Protocol ID correctly in Application Priority Table 747/head
authorBill Fenner <[email protected]>
Thu, 11 Apr 2019 23:49:33 +0000 (16:49 -0700)
committerBill Fenner <[email protected]>
Fri, 12 Apr 2019 11:18:12 +0000 (04:18 -0700)
Closes #511

print-lldp.c
tests/TESTLIST
tests/lldp-app-priority.out [new file with mode: 0644]
tests/lldp-app-priority.pcap [new file with mode: 0644]
tests/lldp-infinite-loop-1.out

index e728bae682a93e19aa421e805db8b36ae7aaeb80..054a961782ddf8d35a3a41c1d77b17d581fd4d71 100644 (file)
@@ -796,7 +796,7 @@ lldp_private_8021_print(netdissect_options *ndo,
                tval=GET_U_1(tptr + i + 5);
                ND_PRINT("\n\t      Priority: %u, RES: %u, Sel: %u, Protocol ID: %u",
                         tval >> 5, (tval >> 3) & 0x03, (tval & 0x07),
                tval=GET_U_1(tptr + i + 5);
                ND_PRINT("\n\t      Priority: %u, RES: %u, Sel: %u, Protocol ID: %u",
                         tval >> 5, (tval >> 3) & 0x03, (tval & 0x07),
-                        GET_BE_U_2(tptr + i + 5));
+                        GET_BE_U_2(tptr + i + 6));
                i=i+3;
         }
         break;
                i=i+3;
         }
         break;
index 9b69b271f163956099e428da30216cb56c24f4ab..35786eec8ee1bac95eccbda3d3ff8c449ac49c76 100644 (file)
@@ -666,3 +666,6 @@ empty-pcapng        empty.pcapng    empty.out
 # DNS Extended rcode tests
 dns-badcookie  dns-badcookie.pcap      dns-badcookie.out
 dns-badvers    dns-badvers.pcap        dns-badvers.out
 # DNS Extended rcode tests
 dns-badcookie  dns-badcookie.pcap      dns-badcookie.out
 dns-badvers    dns-badvers.pcap        dns-badvers.out
+
+# LLDP
+lldp-app-priority      lldp-app-priority.pcap  lldp-app-priority.out   -v
diff --git a/tests/lldp-app-priority.out b/tests/lldp-app-priority.out
new file mode 100644 (file)
index 0000000..08b0173
--- /dev/null
@@ -0,0 +1,30 @@
+    1  23:41:11.292336 LLDP, length 161
+       Chassis ID TLV (1), length 7
+         Subtype MAC address (4): 00:00:00:02:00:02
+       Port ID TLV (2), length 13
+         Subtype Interface Name (5): leaf0b-eth10
+       Time to Live TLV (3), length 2: TTL 120s
+       Port Description TLV (4), length 41: Big Cloud Fabric Switch Port leaf0b-eth10
+       System Name TLV (5), length 6: leaf0b
+       System Description TLV (6), length 17
+         5c:16:c7:00:00:01
+       Organization specific TLV (127), length 5: OUI Unknown (0x0026e1)
+         0x0000:  0026 e101 01
+       Organization specific TLV (127), length 9: OUI Unknown (0x0026e1)
+         0x0000:  0026 e102 6c65 6166 30
+       Organization specific TLV (127), length 5: OUI Unknown (0x0026e1)
+         0x0000:  0026 e103 01
+       Organization specific TLV (127), length 16: OUI Unknown (0x0026e1)
+         0x0000:  0026 e104 0000 5c16 c70b ba1b 0000 0000
+       Organization specific TLV (127), length 6: OUI Ethernet bridged (0x0080c2)
+         Priority Flow Control Configuration Subtype (11)
+           Willing: 0, MBC: 0, RES: 0, PFC cap:1 
+           PFC Enable
+            Priority : 0  1  2  3  4  5  6  7
+            Value    : 0  0  0  0  1  0  0  0  
+       Organization specific TLV (127), length 8: OUI Ethernet bridged (0x0080c2)
+         Application Priority Subtype (12)
+           RES: 0
+           Application Priority Table
+             Priority: 4, RES: 0, Sel: 4, Protocol ID: 3260
+       End TLV (0), length 0
diff --git a/tests/lldp-app-priority.pcap b/tests/lldp-app-priority.pcap
new file mode 100644 (file)
index 0000000..cbe89ca
Binary files /dev/null and b/tests/lldp-app-priority.pcap differ
index b1eede8e2fa93bc79b481a0db8bdaa24974eb11c..cf4d7843fd3e665e58be814645a5fdec6b62d88c 100644 (file)
            Application Priority Table
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
            Application Priority Table
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 0, RES: 0, Sel: 0, Protocol ID: 128
-             Priority: 0, RES: 1, Sel: 4, Protocol ID: 3072
-             Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 4, RES: 0, Sel: 0, Protocol ID: 32962
+             Priority: 0, RES: 0, Sel: 0, Protocol ID: 32962
+             Priority: 0, RES: 1, Sel: 4, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 6, RES: 0, Sel: 2, Protocol ID: 49676
+             Priority: 4, RES: 0, Sel: 0, Protocol ID: 49676
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 128
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 128
-             Priority: 0, RES: 1, Sel: 4, Protocol ID: 3072
-             Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
+             Priority: 6, RES: 0, Sel: 2, Protocol ID: 3072
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 4, RES: 0, Sel: 0, Protocol ID: 32962
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
+             Priority: 0, RES: 0, Sel: 0, Protocol ID: 32962
+             Priority: 0, RES: 1, Sel: 4, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 6, RES: 0, Sel: 2, Protocol ID: 49676
+             Priority: 4, RES: 0, Sel: 0, Protocol ID: 49676
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 128
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 128
-             Priority: 0, RES: 1, Sel: 4, Protocol ID: 3072
-             Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
+             Priority: 6, RES: 0, Sel: 2, Protocol ID: 3072
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 4, RES: 0, Sel: 0, Protocol ID: 32962
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
+             Priority: 0, RES: 0, Sel: 0, Protocol ID: 32962
+             Priority: 0, RES: 1, Sel: 4, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 6, RES: 0, Sel: 2, Protocol ID: 49676
+             Priority: 4, RES: 0, Sel: 0, Protocol ID: 49676
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 128
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 128
-             Priority: 0, RES: 1, Sel: 4, Protocol ID: 3072
+             Priority: 6, RES: 0, Sel: 2, Protocol ID: 3072
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 4, RES: 0, Sel: 0, Protocol ID: 32962
+             Priority: 0, RES: 0, Sel: 0, Protocol ID: 32962
+             Priority: 0, RES: 1, Sel: 4, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 6, RES: 0, Sel: 2, Protocol ID: 49676
+             Priority: 4, RES: 0, Sel: 0, Protocol ID: 49676
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 128
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 128
-             Priority: 0, RES: 1, Sel: 4, Protocol ID: 3072
-             Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
+             Priority: 6, RES: 0, Sel: 2, Protocol ID: 3072
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 4, RES: 0, Sel: 0, Protocol ID: 32962
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
+             Priority: 0, RES: 0, Sel: 0, Protocol ID: 32962
+             Priority: 0, RES: 1, Sel: 4, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 6, RES: 0, Sel: 2, Protocol ID: 49676
+             Priority: 4, RES: 0, Sel: 0, Protocol ID: 49676
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 128
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 128
-             Priority: 0, RES: 1, Sel: 4, Protocol ID: 3072
-             Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
+             Priority: 6, RES: 0, Sel: 2, Protocol ID: 3072
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 4, RES: 0, Sel: 0, Protocol ID: 32962
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
+             Priority: 0, RES: 0, Sel: 0, Protocol ID: 32962
+             Priority: 0, RES: 1, Sel: 4, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 6, RES: 0, Sel: 2, Protocol ID: 49676
+             Priority: 4, RES: 0, Sel: 0, Protocol ID: 49676
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 128
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 128
-             Priority: 0, RES: 1, Sel: 4, Protocol ID: 3072
+             Priority: 6, RES: 0, Sel: 2, Protocol ID: 3072
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 4, RES: 0, Sel: 0, Protocol ID: 32962
+             Priority: 0, RES: 0, Sel: 0, Protocol ID: 32962
+             Priority: 0, RES: 1, Sel: 4, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 6, RES: 0, Sel: 2, Protocol ID: 49676
+             Priority: 4, RES: 0, Sel: 0, Protocol ID: 49676
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 128
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 128
-             Priority: 0, RES: 1, Sel: 4, Protocol ID: 3072
+             Priority: 6, RES: 0, Sel: 2, Protocol ID: 3072
+             Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
+             Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
+             Priority: 0, RES: 0, Sel: 0, Protocol ID: 32962
+             Priority: 0, RES: 1, Sel: 4, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
-             Priority: 4, RES: 0, Sel: 0, Protocol ID: 32962
+             Priority: 4, RES: 0, Sel: 0, Protocol ID: 49676
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
          0x0000:  0080 c20c 0000 0000 0000 0000 80c2 0c00
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
              Priority: 0, RES: 0, Sel: 0, Protocol ID: 0
          0x0000:  0080 c20c 0000 0000 0000 0000 80c2 0c00