sd-lldp-rx: add VLAN ID parsing (#37725)
While the `port_vlan_id` field was already present in the `sd_lldp_neighbor`, it wasn't currently parsed from the LLDP packet. Added support for that as well as a small parsing test. Closes #28354.
This commit is contained in:
@@ -44,6 +44,7 @@ typedef struct LLDPNeighborInfo {
|
||||
const char *system_name;
|
||||
const char *system_description;
|
||||
uint16_t capabilities;
|
||||
uint16_t vlan_id;
|
||||
} LLDPNeighborInfo;
|
||||
|
||||
static const sd_json_dispatch_field lldp_neighbor_dispatch_table[] = {
|
||||
@@ -53,6 +54,7 @@ static const sd_json_dispatch_field lldp_neighbor_dispatch_table[] = {
|
||||
{ "SystemName", SD_JSON_VARIANT_STRING, sd_json_dispatch_const_string, offsetof(LLDPNeighborInfo, system_name), 0 },
|
||||
{ "SystemDescription", SD_JSON_VARIANT_STRING, sd_json_dispatch_const_string, offsetof(LLDPNeighborInfo, system_description), 0 },
|
||||
{ "EnabledCapabilities", _SD_JSON_VARIANT_TYPE_INVALID, sd_json_dispatch_uint16, offsetof(LLDPNeighborInfo, capabilities), 0 },
|
||||
{ "VlanID", _SD_JSON_VARIANT_TYPE_INVALID, sd_json_dispatch_uint16, offsetof(LLDPNeighborInfo, vlan_id), 0 },
|
||||
{},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user