Link Layer Discovery Protocol(LLDP, IEEE 802.1AB) http://standards.ieee.org/getieee802/download/802.1AB-2009.pdf
basic TLV format:
octets | 1 | 2 | 3 ... n + 2 |
--------------------------------------------------------
| TLV type | TLV information | TLV information string |
| (7bits) | string length | (0-507 octets) |
| | (9bits) | |
--------------------------------------------------------
bits |8 2|1|8 1|
Organizationally specific TLV format:
octets | 1 | 2 | 3 ... 5 | 6 | 7 ... n + 6 |
---------------------------------------------------------------
| TLV type | Length | OUI | Subtype | Infomation |
| (7bits) | (9bits) | (24bits) | (8bits) | (0-507 octets) |
---------------------------------------------------------------
bits |8 2|1|8 1|
LLDPDU format:
------------------------------------------------------------------------
| Chassis ID | Port ID | TTL | optional TLV | ... | optional TLV | End |
------------------------------------------------------------------------
Chasis ID, Port ID, TTL, End are mandatory optional TLV may be inserted in any order
Chassis ID TLV encoder/decoder class
Attribute |
Description |
---|---|
buf |
Binary data to parse. |
subtype |
Subtype. |
chassis_id |
Chassis id corresponding to subtype. |
End TLV encoder/decoder class
Attribute |
Description |
---|---|
buf |
Binary data to parse. |
Management Address TLV encoder/decoder class
Attribute |
Description |
---|---|
buf |
Binary data to parse. |
addr_subtype |
Address type. |
addr |
Device address. |
intf_subtype |
Interface type. |
intf_num |
Interface number. |
oid |
Object ID. |
Organizationally Specific TLV encoder/decoder class
Attribute |
Description |
---|---|
buf |
Binary data to parse. |
oui |
Organizationally unique ID. |
subtype |
Organizationally defined subtype. |
info |
Organizationally defined information string. |
Port description TLV encoder/decoder class
Attribute |
Description |
---|---|
buf |
Binary data to parse. |
port_description |
Port description. |
Port ID TLV encoder/decoder class
Attribute |
Description |
---|---|
buf |
Binary data to parse. |
subtype |
Subtype. |
port_id |
Port ID corresponding to subtype. |
System Capabilities TLV encoder/decoder class
Attribute |
Description |
---|---|
buf |
Binary data to parse. |
system_cap |
System Capabilities. |
enabled_cap |
Enabled Capabilities. |
System description TLV encoder/decoder class
Attribute |
Description |
---|---|
buf |
Binary data to parse. |
system_description |
System description. |
System name TLV encoder/decoder class
Attribute |
Description |
---|---|
buf |
Binary data to parse. |
system_name |
System name. |
Time To Live TLV encoder/decoder class
Attribute |
Description |
---|---|
buf |
Binary data to parse. |
ttl |
Time To Live. |
LLDPDU encoder/decoder class.
An instance has the following attributes at least.
Attribute |
Description |
---|---|
tlvs |
List of TLV instance. |
Decode a protocol header.
This method is used only when decoding a packet.
Decode a protocol header at offset 0 in bytearray buf. Returns the following three objects.
An object to describe the decoded header.
A packet_base.PacketBase subclass appropriate for the rest of the packet. None when the rest of the packet should be considered as raw payload.
The rest of packet.
Encode a protocol header.
This method is used only when encoding a packet.
Encode a protocol header. Returns a bytearray which contains the header.
payload is the rest of the packet which will immediately follow this header.
prev is a packet_base.PacketBase subclass for the outer protocol header. prev is None if the current header is the outer-most. For example, prev is ipv4 or ipv6 for tcp.serialize.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.