diff --git a/src/1905_tlvs.h b/src/1905_tlvs.h index 605e0817e7e3699a96fa5d94c61beb600750b8a2..5d652a3066f5bbd7d8023d66127bbf404e2b815f 100644 --- a/src/1905_tlvs.h +++ b/src/1905_tlvs.h @@ -503,4 +503,56 @@ struct tlv_l2_neighbor { } __attribute__((packed)); +/* LLDP tlvs definition */ +/* Tlv types */ +#define LLDP_TLV_EOL 0 +#define LLDP_TLV_CHASSIS_ID 1 +#define LLDP_TLV_PORT_ID 2 +#define LLDP_TLV_TTL 3 + + +/* TLV: end of LLDPPDU */ +struct tlv_eol { +} __attribute__((packed)); + + +#define LLDP_CHASSIS_ID_SUBTYPE_CHASSIS_COMPONENT 1 +#define LLDP_CHASSIS_ID_SUBTYPE_INTERFACE_ALIAS 2 +#define LLDP_CHASSIS_ID_SUBTYPE_PORT_COMPONENT 3 +#define LLDP_CHASSIS_ID_SUBTYPE_MAC_ADDRESS 4 +#define LLDP_CHASSIS_ID_SUBTYPE_NETWORK_ADDRESS 5 +#define LLDP_CHASSIS_ID_SUBTYPE_INTERFACE_NAME 6 +#define LLDP_CHASSIS_ID_SUBTYPE_LOGICALLY_ASSIGNED 7 + +/* TLV: chassis-id */ +struct tlv_chassis_id { + uint8_t subtype; + uint8_t id[256]; +} __attribute__((packed)); + + + +#define LLDP_PORT_ID_SUBTYPE_INTERFACE_ALIAS 1 +#define LLDP_PORT_ID_SUBTYPE_PORT_COMPONENT 2 +#define LLDP_PORT_ID_SUBTYPE_MAC_ADDRESS 3 +#define LLDP_PORT_ID_SUBTYPE_NETWORK_ADDRESS 4 +#define LLDP_PORT_ID_SUBTYPE_INTERFACE_NAME 5 +#define LLDP_PORT_ID_SUBTYPE_AGENT_CIRCUIT_ID 6 +#define LLDP_PORT_ID_SUBTYPE_LOGICALLY_ASSIGNED 7 + +/* TLV: port-id */ +struct tlv_port_id { + uint8_t subtype; + uint8_t id[256]; +} __attribute__((packed)); + + + +#define LLDP_TTL_1905_DEFAULT_VALUE 180 /* in secs */ + +/* TLV: ttl */ +struct tlv_ttl { + uint16_t ttl; /* in secs */ +} __attribute__((packed)); + #endif /* _1905_TLVS_H_ */ diff --git a/src/cmdu_input.c b/src/cmdu_input.c index 561e6d075a111b966683a6d4f3a74a9f60d3a4ae..88d7743ee0a9bdcb595f0b5b23c74ffe9deca490 100644 --- a/src/cmdu_input.c +++ b/src/cmdu_input.c @@ -49,9 +49,7 @@ #include "i1905.h" -// TODO: combine following headers into one #include "1905_tlvs.h" -#include "lldp_tlvs.h" #include "i1905_extension.h" diff --git a/src/cmdu_output.c b/src/cmdu_output.c index 429d7d214cfd85738d745ab8611d0e845c56193f..56c4c66298c510f25d53b4ed1f73ad70a982e3bd 100644 --- a/src/cmdu_output.c +++ b/src/cmdu_output.c @@ -50,9 +50,7 @@ #include "i1905.h" -// TODO: combine following headers into one #include "1905_tlvs.h" -#include "lldp_tlvs.h" #include "i1905_extension.h" diff --git a/src/i1905.c b/src/i1905.c index 6f226ac434c225df69c53d67898567bf40c1232b..511a29d7d56f48b29fd57617f8f96fcc9535c7c0 100644 --- a/src/i1905.c +++ b/src/i1905.c @@ -48,9 +48,7 @@ #include "i1905_extension.h" -// TODO: combine following headers into one #include "1905_tlvs.h" -#include "lldp_tlvs.h" diff --git a/src/i1905_al.c b/src/i1905_al.c index 04d82026999b82e9db930f44f0aedf5b51425286..41b55fb8d537033ce044d4ec8edad611957f51f6 100644 --- a/src/i1905_al.c +++ b/src/i1905_al.c @@ -48,7 +48,6 @@ #include "1905_tlvs.h" -#include "lldp_tlvs.h" #if 0 static struct i1905_ipv4 *alloc_ipv4(void) diff --git a/src/i1905_dm.c b/src/i1905_dm.c index d969fc90f1b7db8346415f9bb4c754178e26d786..bdd0de9eb9c5ad239c691853f2b3119d30ba8b5a 100644 --- a/src/i1905_dm.c +++ b/src/i1905_dm.c @@ -44,7 +44,6 @@ #include "i1905_dm.h" #include "1905_tlvs.h" -#include "lldp_tlvs.h" static void i1905_dm_neighbor_agetimer_cb(atimer_t *t) diff --git a/src/lldp_tlvs.h b/src/lldp_tlvs.h deleted file mode 100644 index d5f048a0b8b162f4c83e6acb9c177fcadaa2957e..0000000000000000000000000000000000000000 --- a/src/lldp_tlvs.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * lldp_tlvs.h: LLDP tlvs definition - */ - -#ifndef LLDP_TLVS_H -#define LLDP_TLVS_H - - -/* Tlv types */ -#define LLDP_TLV_EOL 0 -#define LLDP_TLV_CHASSIS_ID 1 -#define LLDP_TLV_PORT_ID 2 -#define LLDP_TLV_TTL 3 - - -/* TLV: end of LLDPPDU */ -struct tlv_eol { -} __attribute__((packed)); - - -#define LLDP_CHASSIS_ID_SUBTYPE_CHASSIS_COMPONENT 1 -#define LLDP_CHASSIS_ID_SUBTYPE_INTERFACE_ALIAS 2 -#define LLDP_CHASSIS_ID_SUBTYPE_PORT_COMPONENT 3 -#define LLDP_CHASSIS_ID_SUBTYPE_MAC_ADDRESS 4 -#define LLDP_CHASSIS_ID_SUBTYPE_NETWORK_ADDRESS 5 -#define LLDP_CHASSIS_ID_SUBTYPE_INTERFACE_NAME 6 -#define LLDP_CHASSIS_ID_SUBTYPE_LOGICALLY_ASSIGNED 7 - -/* TLV: chassis-id */ -struct tlv_chassis_id { - uint8_t subtype; - uint8_t id[256]; -} __attribute__((packed)); - - - -#define LLDP_PORT_ID_SUBTYPE_INTERFACE_ALIAS 1 -#define LLDP_PORT_ID_SUBTYPE_PORT_COMPONENT 2 -#define LLDP_PORT_ID_SUBTYPE_MAC_ADDRESS 3 -#define LLDP_PORT_ID_SUBTYPE_NETWORK_ADDRESS 4 -#define LLDP_PORT_ID_SUBTYPE_INTERFACE_NAME 5 -#define LLDP_PORT_ID_SUBTYPE_AGENT_CIRCUIT_ID 6 -#define LLDP_PORT_ID_SUBTYPE_LOGICALLY_ASSIGNED 7 - -/* TLV: port-id */ -struct tlv_port_id { - uint8_t subtype; - uint8_t id[256]; -} __attribute__((packed)); - - - -#define LLDP_TTL_1905_DEFAULT_VALUE 180 /* in secs */ - -/* TLV: ttl */ -struct tlv_ttl { - uint16_t ttl; /* in secs */ -} __attribute__((packed)); - - -#endif /* LLDP_TLVS_H */