summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/lldp-tlv.h
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2015-07-27 23:37:07 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2015-10-02 17:39:22 +0200
commitd8c89d6198651e34786bc78df26f313eede9918b (patch)
tree3b4bceb42a2fc5fb1825ddaa6747c011e7b718e1 /src/libsystemd-network/lldp-tlv.h
parent11e8357164694d8307dea5bcae017c98c5f125ab (diff)
lldp: add support for organizationally specific TLVs
LLDP TLVs of type 127 are used to carry organizationally specific information and include additional fields to specify the OUI and subtype. Add support for parsing such fields and functions to access the most common IEEE 802.1 specific TLVs.
Diffstat (limited to 'src/libsystemd-network/lldp-tlv.h')
-rw-r--r--src/libsystemd-network/lldp-tlv.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libsystemd-network/lldp-tlv.h b/src/libsystemd-network/lldp-tlv.h
index 5af06b40ca..2d2c776be6 100644
--- a/src/libsystemd-network/lldp-tlv.h
+++ b/src/libsystemd-network/lldp-tlv.h
@@ -33,9 +33,13 @@
typedef struct tlv_packet tlv_packet;
typedef struct tlv_section tlv_section;
+#define LLDP_OUI_LEN 3
+
struct tlv_section {
uint16_t type;
uint16_t length;
+ uint8_t *oui;
+ uint8_t subtype;
uint8_t *read_pos;
uint8_t *data;
@@ -83,6 +87,7 @@ int tlv_packet_append_u32(tlv_packet *m, uint32_t data);
int tlv_packet_append_string(tlv_packet *m, char *data, uint16_t size);
int lldp_tlv_packet_enter_container(tlv_packet *m, uint16_t type);
+int lldp_tlv_packet_enter_container_oui(tlv_packet *m, const uint8_t *oui, uint8_t subtype);
int lldp_tlv_packet_exit_container(tlv_packet *m);
int tlv_packet_read_bytes(tlv_packet *m, uint8_t **data, uint16_t *data_length);