Merge pull request #11241 from bengal/lldp-802-3-subtypes

lldp: add 802.3 OUI subtype definitions
This commit is contained in:
Lennart Poettering
2019-01-06 18:15:51 +01:00
committed by GitHub
2 changed files with 17 additions and 3 deletions
+4
View File
@@ -192,6 +192,8 @@ static void test_receive_oui_packet(sd_event *e) {
0x01, 0x02,
0xfe, 0x09, 0x00, 0x80, 0xc2, 0x07, /* Link aggregation: status 1, ID 0x00140012 */
0x01, 0x00, 0x14, 0x00, 0x12,
0xfe, 0x07, 0x00, 0x12, 0x0f, 0x02, /* 802.3 Power via MDI: PSE, MDI enabled */
0x07, 0x01, 0x00,
0x00, 0x00 /* End of LLDPDU */
};
@@ -220,6 +222,8 @@ static void test_receive_oui_packet(sd_event *e) {
assert_se(sd_lldp_neighbor_tlv_next(neighbors[0]) > 0);
assert_se(sd_lldp_neighbor_tlv_is_oui(neighbors[0], SD_LLDP_OUI_802_1, SD_LLDP_OUI_802_1_SUBTYPE_LINK_AGGREGATION) > 0);
assert_se(sd_lldp_neighbor_tlv_next(neighbors[0]) > 0);
assert_se(sd_lldp_neighbor_tlv_is_oui(neighbors[0], SD_LLDP_OUI_802_3, SD_LLDP_OUI_802_3_SUBTYPE_POWER_VIA_MDI) > 0);
assert_se(sd_lldp_neighbor_tlv_next(neighbors[0]) > 0);
assert_se(sd_lldp_neighbor_tlv_is_type(neighbors[0], SD_LLDP_TYPE_END) > 0);
assert_se(sd_lldp_neighbor_tlv_next(neighbors[0]) == 0);