mikroSDK Reference Manual
lldp_ext_dot1.h
Go to the documentation of this file.
1
31#ifndef _LLDP_EXT_DOT1_H
32#define _LLDP_EXT_DOT1_H
33
34//Dependencies
35#include "core/net.h"
36#include "lldp/lldp.h"
37
38//Minimum length of VLAN name
39#define LLDP_DOT1_MIN_VLAN_NAME_LEN 1
40//Maximum length of VLAN name
41#define LLDP_DOT1_MAX_VLAN_NAME_LEN 31
42
43//Minimum length of protocol identity
44#define LLDP_DOT1_MIN_PROTOCOL_ID_LEN 1
45//Maximum length of protocol identity
46#define LLDP_DOT1_MAX_PROTOCOL_ID_LEN 255
47
48//C++ guard
49#ifdef __cplusplus
50extern "C" {
51#endif
52
53
66
67
78
79
80//CodeWarrior or Win32 compiler?
81#if defined(__CWCC__) || defined(_WIN32)
82 #pragma pack(push, 1)
83#endif
84
85
91{
92 uint16_t pvid; //0-2
93} LldpDot1PortVlanIdTlv;
94
95
100typedef __packed_struct
101{
102 uint8_t flags; //0
103 uint16_t ppvid; //1-2
104} LldpDot1PortProtoVlanIdTlv;
105
106
111typedef __packed_struct
112{
113 uint16_t vlanId; //0
114 uint8_t vlanNameLen; //1
115 char_t vlanName[]; //2
116} LldpDot1VlanNameTlv;
117
118
123typedef __packed_struct
124{
125 uint8_t protocolIdLen; //0
126 uint8_t protocolId[]; //1
127} LldpDot1ProtocolIdTlv;
128
129
130//CodeWarrior or Win32 compiler?
131#if defined(__CWCC__) || defined(_WIN32)
132 #pragma pack(pop)
133#endif
134
135//IEEE 802.1 related functions
136error_t lldpDot1SetLocalPortVlanId(LldpAgentContext *context,
137 uint_t portIndex, uint16_t pvid);
138
139error_t lldpDot1SetLocalPortProtoVlanId(LldpAgentContext *context,
140 uint_t portIndex, uint8_t flags, uint16_t ppvid);
141
142error_t lldpDot1SetLocalVlanName(LldpAgentContext *context,
143 uint_t portIndex, uint16_t vlanId, const char_t *vlanName);
144
145error_t lldpDot1SetLocalProtocolId(LldpAgentContext *context,
146 uint_t portIndex, const uint8_t *protocolId, size_t protocolIdLen);
147
148error_t lldpDot1DeleteLocalTlv(LldpAgentContext *context,
149 LldpDot1Subtype subtype);
150
151//C++ guard
152#ifdef __cplusplus
153}
154#endif
155
156#endif
error_t
Error codes.
Definition error.h:43
LLDP (Link Layer Discovery Protocol)
LldpDot1PortProtoFlags
Port and protocol capability/status flags.
Definition lldp_ext_dot1.h:73
@ LLDP_DOT1_PORT_PROTO_FLAG_RESERVED
Reserved.
Definition lldp_ext_dot1.h:74
@ LLDP_DOT1_PORT_PROTO_FLAG_ENABLED
Port and protocol VLAN enabled.
Definition lldp_ext_dot1.h:76
@ LLDP_DOT1_PORT_PROTO_FLAG_SUPPORTED
Port and protocol VLAN supported.
Definition lldp_ext_dot1.h:75
LldpDot1Subtype
IEEE 802.1 subtypes.
Definition lldp_ext_dot1.h:59
@ LLDP_DOT1_SUBTYPE_PROTOCOL_ID
Protocol Identity.
Definition lldp_ext_dot1.h:64
@ LLDP_DOT1_SUBTYPE_VLAN_NAME
VLAN Name.
Definition lldp_ext_dot1.h:63
@ LLDP_DOT1_SUBTYPE_RESERVED
Reserved.
Definition lldp_ext_dot1.h:60
@ LLDP_DOT1_SUBTYPE_PORT_PROTO_VLAN_ID
Port And Protocol VLAN ID.
Definition lldp_ext_dot1.h:62
@ LLDP_DOT1_SUBTYPE_PORT_VLAN_ID
Port VLAN ID.
Definition lldp_ext_dot1.h:61
typedef __packed_struct
Port VLAN ID TLV.
Definition lldp_ext_dot1.h:91
TCP/IP stack core.