39#define LLDP_OUI_SIZE 3
42#define LLDP_MAX_TLV_INFO_LEN 511
44#define LLDP_MAX_ORG_SPECIFIC_INFO_LEN 507
47#define LLDP_MIN_CHASSIS_ID_LEN 1
49#define LLDP_MAX_CHASSIS_ID_LEN 255
52#define LLDP_MIN_PORT_ID_LEN 1
54#define LLDP_MAX_PORT_ID_LEN 255
57#define LLDP_MIN_PORT_DESC_LEN 1
59#define LLDP_MAX_PORT_DESC_LEN 255
62#define LLDP_MIN_SYS_NAME_LEN 1
64#define LLDP_MAX_SYS_NAME_LEN 255
67#define LLDP_MIN_SYS_DESC_LEN 1
69#define LLDP_MAX_SYS_DESC_LEN 255
72#define LLDP_MIN_MGMT_ADDR_LEN 1
74#define LLDP_MAX_MGMT_ADDR_LEN 31
77#define LLDP_MIN_OID_LEN 0
79#define LLDP_MAX_OID_LEN 128
209#if defined(__CWCC__) || defined(_WIN32)
210 #pragma pack(push, 1)
220#if defined(_CPU_BIG_ENDIAN) && !defined(__ICCRX__)
240 uint8_t chassisIdSubtype;
251 uint8_t portIdSubtype;
272 uint16_t supportedCap;
284 uint8_t mgmtAddrSubtype;
295 uint8_t ifNumSubtype;
308 uint8_t oui[LLDP_OUI_SIZE];
315#if defined(__CWCC__) || defined(_WIN32)
320error_t lldpSetTlv(LldpDataUnit *lldpdu, uint8_t type, uint_t index,
321 const uint8_t *value,
size_t length, bool_t replace);
323error_t lldpGetTlv(LldpDataUnit *lldpdu, uint8_t type, uint_t index,
324 const uint8_t **value,
size_t *length);
329error_t lldpDeleteTlv(LldpDataUnit *lldpdu, uint8_t type, uint_t index);
331error_t lldpDecodeMgmtAddrTlv(
const uint8_t *value,
size_t length,
332 const LldpMgmtAddrTlv1 **mgmtAddr1,
const LldpMgmtAddrTlv2 **mgmtAddr2);
334error_t lldpSetOrgDefTlv(LldpDataUnit *lldpdu, uint32_t oui, uint8_t subtype,
335 uint_t index,
const uint8_t *value,
size_t length, bool_t replace);
337error_t lldpGetOrgDefTlv(LldpDataUnit *lldpdu, uint32_t oui, uint8_t subtype,
338 uint_t index,
const uint8_t **value,
size_t *length);
340error_t lldpDeleteOrgDefTlv(LldpDataUnit *lldpdu, uint32_t oui, uint8_t subtype,
error_t
Error codes.
Definition error.h:43
LLDP (Link Layer Discovery Protocol)
LldpMgmtAddrSubtype
Management address subtypes.
Definition lldp_tlv.h:162
@ LLDP_MGMT_ADDR_SUBTYPE_OTHER
Other.
Definition lldp_tlv.h:163
@ LLDP_MGMT_ADDR_SUBTYPE_IPV6
IPv6 address.
Definition lldp_tlv.h:165
@ LLDP_MGMT_ADDR_SUBTYPE_IPV4
IPv4 address.
Definition lldp_tlv.h:164
@ LLDP_MGMT_ADDR_SUBTYPE_ALL_802
MAC address.
Definition lldp_tlv.h:166
LldpPortIdSubtype
Port ID subtypes.
Definition lldp_tlv.h:128
@ LLDP_PORT_ID_SUBTYPE_INTERFACE_NAME
Interface name.
Definition lldp_tlv.h:134
@ LLDP_PORT_ID_SUBTYPE_PORT_COMPONENT
Port component.
Definition lldp_tlv.h:131
@ LLDP_PORT_ID_SUBTYPE_MAC_ADDR
MAC address.
Definition lldp_tlv.h:132
@ LLDP_PORT_ID_SUBTYPE_AGENT_CIRCUIT_ID
Agent circuit ID.
Definition lldp_tlv.h:135
@ LLDP_PORT_ID_SUBTYPE_NETWORK_ADDR
Network address.
Definition lldp_tlv.h:133
@ LLDP_PORT_ID_SUBTYPE_INTERFACE_ALIAS
Interface alias.
Definition lldp_tlv.h:130
@ LLDP_PORT_ID_SUBTYPE_RESERVED
Reserved.
Definition lldp_tlv.h:129
@ LLDP_PORT_ID_SUBTYPE_LOCALLY_ASSIGNED
Locally assigned.
Definition lldp_tlv.h:136
LldpOui
Organizationally unique identifiers.
Definition lldp_tlv.h:187
@ LLDP_DOT3_OUI
IEEE 802.3.
Definition lldp_tlv.h:189
@ LLDP_PNO_OUI
PROFIBUS.
Definition lldp_tlv.h:191
@ LLDP_DOT1_OUI
IEEE 802.1.
Definition lldp_tlv.h:188
@ LLDP_MED_OUI
LLDP-MED.
Definition lldp_tlv.h:190
LldpChassisIdSubtype
Chassis ID subtypes.
Definition lldp_tlv.h:111
@ LLDP_CHASSIS_ID_SUBTYPE_PORT_COMPONENT
Port component.
Definition lldp_tlv.h:115
@ LLDP_CHASSIS_ID_SUBTYPE_RESERVED
Reserved.
Definition lldp_tlv.h:112
@ LLDP_CHASSIS_ID_SUBTYPE_INTERFACE_ALIAS
Interface alias.
Definition lldp_tlv.h:114
@ LLDP_CHASSIS_ID_SUBTYPE_INTERFACE_NAME
Interface name.
Definition lldp_tlv.h:118
@ LLDP_CHASSIS_ID_SUBTYPE_MAC_ADDR
MAC address.
Definition lldp_tlv.h:116
@ LLDP_CHASSIS_ID_SUBTYPE_LOCALLY_ASSIGNED
Locally assigned.
Definition lldp_tlv.h:119
@ LLDP_CHASSIS_ID_SUBTYPE_CHASSIS_COMPONENT
Chassis component.
Definition lldp_tlv.h:113
@ LLDP_CHASSIS_ID_SUBTYPE_NETWORK_ADDR
Network address.
Definition lldp_tlv.h:117
LldpIfNumSubtype
Interface numbering subtypes.
Definition lldp_tlv.h:175
@ LLDP_IF_NUM_SUBTYPE_UNKNOWN
Unknown.
Definition lldp_tlv.h:176
@ LLDP_IF_NUM_SUBTYPE_IF_INDEX
Interface index.
Definition lldp_tlv.h:177
@ LLDP_IF_NUM_SUBTYPE_SYS_PORT_NUM
System port number.
Definition lldp_tlv.h:178
typedef __packed_struct
TLV header.
Definition lldp_tlv.h:219
LldpSysCap
System capabilities.
Definition lldp_tlv.h:145
@ LLDP_SYS_CAP_REPEATER
Repeater.
Definition lldp_tlv.h:147
@ LLDP_SYS_CAP_DOCSIS_CABLE_DEVICE
DOCSIS cable device.
Definition lldp_tlv.h:152
@ LLDP_SYS_CAP_OTHER
Other.
Definition lldp_tlv.h:146
@ LLDP_SYS_CAP_BRIDGE
Bridge.
Definition lldp_tlv.h:148
@ LLDP_SYS_CAP_WLAN_ACCESS_POINT
WLAN Access Point.
Definition lldp_tlv.h:149
@ LLDP_SYS_CAP_STATION_ONLY
Station Only.
Definition lldp_tlv.h:153
@ LLDP_SYS_CAP_TELEPHONE
Telephone.
Definition lldp_tlv.h:151
@ LLDP_SYS_CAP_ROUTER
Router.
Definition lldp_tlv.h:150
LldpTlvType
TLV type values.
Definition lldp_tlv.h:92
@ LLDP_TLV_TYPE_CHASSIS_ID
Chassis ID.
Definition lldp_tlv.h:94
@ LLDP_TLV_TYPE_MGMT_ADDR
Management Address.
Definition lldp_tlv.h:101
@ LLDP_TLV_TYPE_SYS_NAME
System Name.
Definition lldp_tlv.h:98
@ LLDP_TLV_TYPE_SYS_CAP
System Capabilities.
Definition lldp_tlv.h:100
@ LLDP_TLV_TYPE_END_OF_LLDPDU
End Of LLDPDU.
Definition lldp_tlv.h:93
@ LLDP_TLV_TYPE_SYS_DESC
System Description.
Definition lldp_tlv.h:99
@ LLDP_TLV_TYPE_TIME_TO_LIVE
Time To Live.
Definition lldp_tlv.h:96
@ LLDP_TLV_TYPE_PORT_ID
Port ID.
Definition lldp_tlv.h:95
@ LLDP_TLV_TYPE_PORT_DESC
Port Description.
Definition lldp_tlv.h:97
@ LLDP_TLV_TYPE_ORG_DEFINED
Organizationally Specific TLVs.
Definition lldp_tlv.h:102
TLV structure.
Definition lldp_tlv.h:200