]> The Tcpdump Group git mirrors - tcpdump/commitdiff
LLDP 8021 link aggregation TLV support
authorMoses Devadason <[email protected]>
Sun, 28 Jun 2020 05:37:54 +0000 (11:07 +0530)
committerfxlb <[email protected]>
Tue, 30 Jun 2020 20:12:31 +0000 (20:12 +0000)
As per IEEE std 802.1-AB-2009, 802.3 link aggregation TLV has been
deprecated and link aggregation TLV has been added as an 802.1
TLV. Support for this is given.

print-lldp.c
tests/TESTLIST
tests/lldp_8021_linkagg-v.out [new file with mode: 0644]
tests/lldp_8021_linkagg-vv.out [new file with mode: 0644]
tests/lldp_8021_linkagg.pcap [new file with mode: 0644]

index 54745e5b7b1161cfeb74b56ddb36bd3e1169903b..358a31e15183eb3477c6f7ba7c912181d6643b30 100644 (file)
@@ -136,6 +136,7 @@ static const struct tok lldp_cap_values[] = {
 #define LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_VLAN_ID     2
 #define LLDP_PRIVATE_8021_SUBTYPE_VLAN_NAME            3
 #define LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_IDENTITY    4
+#define LLDP_PRIVATE_8021_SUBTYPE_LINKAGGR             7
 #define LLDP_PRIVATE_8021_SUBTYPE_CONGESTION_NOTIFICATION 8
 #define LLDP_PRIVATE_8021_SUBTYPE_ETS_CONFIGURATION       9
 #define LLDP_PRIVATE_8021_SUBTYPE_ETS_RECOMMENDATION     10
@@ -149,6 +150,7 @@ static const struct tok lldp_8021_subtype_values[] = {
     { LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_VLAN_ID, "Port and Protocol VLAN ID"},
     { LLDP_PRIVATE_8021_SUBTYPE_VLAN_NAME, "VLAN name"},
     { LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_IDENTITY, "Protocol Identity"},
+    { LLDP_PRIVATE_8021_SUBTYPE_LINKAGGR, "Link aggregation"},
     { LLDP_PRIVATE_8021_SUBTYPE_CONGESTION_NOTIFICATION, "Congestion Notification"},
     { LLDP_PRIVATE_8021_SUBTYPE_ETS_CONFIGURATION, "ETS Configuration"},
     { LLDP_PRIVATE_8021_SUBTYPE_ETS_RECOMMENDATION, "ETS Recommendation"},
@@ -712,6 +714,16 @@ lldp_private_8021_print(netdissect_options *ndo,
         ND_PRINT("\n\t    protocol identity: ");
         (void)nd_printzp(ndo, tptr + 5, sublen, NULL);
         break;
+
+    case LLDP_PRIVATE_8021_SUBTYPE_LINKAGGR:
+        if (tlv_len < 9) {
+            return hexdump;
+        }
+        ND_PRINT("\n\t    aggregation status [%s], aggregation port ID %u",
+               bittok2str(lldp_aggregation_values, "none", GET_U_1((tptr + 4))),
+               GET_BE_U_4(tptr + 5));
+        break;
+
     case LLDP_PRIVATE_8021_SUBTYPE_CONGESTION_NOTIFICATION:
         if(tlv_len<LLDP_PRIVATE_8021_SUBTYPE_CONGESTION_NOTIFICATION_LENGTH){
                return hexdump;
index fb157144c05b6d34b587d4b17008d1d36f303af7..921bffac1aaa3bb4a4dfa15b5e4c1a7b93aca55c 100644 (file)
@@ -363,6 +363,8 @@ cdp-v               3560_CDP.pcap           cdp-v.out               -v
 udld-v         UDLD.pcap               udld-v.out              -v
 lldp_mud-v     lldp_mudurl.pcap        lldp_mudurl-v.out       -e -v
 lldp_mud-vv    lldp_mudurl.pcap        lldp_mudurl-vv.out      -e -vv
+lldp_8021_linkagg-v  lldp_8021_linkagg.pcap lldp_8021_linkagg-v.out  -v
+lldp_8021_linkagg-vv lldp_8021_linkagg.pcap lldp_8021_linkagg-vv.out -vv
 # fuzzed pcap
 udld-inf-loop-1-v  udld-inf-loop-1.pcapng  udld-inf-loop-1-v.out  -v
 
diff --git a/tests/lldp_8021_linkagg-v.out b/tests/lldp_8021_linkagg-v.out
new file mode 100644 (file)
index 0000000..d6827c5
--- /dev/null
@@ -0,0 +1,8 @@
+    1  05:27:44.860864 LLDP, length 11
+       Organization specific TLV (127), length 9: OUI Ethernet bridged (0x0080c2)
+         Link aggregation Subtype (7)
+           aggregation status [supported, enabled], aggregation port ID 100
+    2  05:27:46.902307 LLDP, length 11
+       Organization specific TLV (127), length 9: OUI Ethernet bridged (0x0080c2)
+         Link aggregation Subtype (7)
+           aggregation status [supported], aggregation port ID 0
diff --git a/tests/lldp_8021_linkagg-vv.out b/tests/lldp_8021_linkagg-vv.out
new file mode 100644 (file)
index 0000000..a717006
--- /dev/null
@@ -0,0 +1,10 @@
+    1  05:27:44.860864 LLDP, length 11
+       Organization specific TLV (127), length 9: OUI Ethernet bridged (0x0080c2)
+         Link aggregation Subtype (7)
+           aggregation status [supported, enabled], aggregation port ID 100
+         0x0000:  0080 c207 0300 0000 64
+    2  05:27:46.902307 LLDP, length 11
+       Organization specific TLV (127), length 9: OUI Ethernet bridged (0x0080c2)
+         Link aggregation Subtype (7)
+           aggregation status [supported], aggregation port ID 0
+         0x0000:  0080 c207 0100 0000 00
diff --git a/tests/lldp_8021_linkagg.pcap b/tests/lldp_8021_linkagg.pcap
new file mode 100644 (file)
index 0000000..4446457
Binary files /dev/null and b/tests/lldp_8021_linkagg.pcap differ