mikroSDK Reference Manual
lldp_ext_dot3.h
Go to the documentation of this file.
1
31#ifndef _LLDP_EXT_DOT3_H
32#define _LLDP_EXT_DOT3_H
33
34//Dependencies
35#include "core/net.h"
36#include "lldp/lldp.h"
37
38//C++ guard
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43
57
58
68
69
93
94
116
117
131
132
144
145
158
159
171
172
188
189
201
202
207typedef enum
208{
209 LLDP_DOT3_POWER_STATUS_POWER_CLASS_EXT = 0x000F,
210 LLDP_DOT3_POWER_STATUS_POWER_CLASS_EXT_CLASS_1 = 0x0001,
211 LLDP_DOT3_POWER_STATUS_POWER_CLASS_EXT_CLASS_2 = 0x0002,
212 LLDP_DOT3_POWER_STATUS_POWER_CLASS_EXT_CLASS_3 = 0x0003,
213 LLDP_DOT3_POWER_STATUS_POWER_CLASS_EXT_CLASS_4 = 0x0004,
214 LLDP_DOT3_POWER_STATUS_POWER_CLASS_EXT_CLASS_5 = 0x0005,
215 LLDP_DOT3_POWER_STATUS_POWER_CLASS_EXT_CLASS_6 = 0x0006,
216 LLDP_DOT3_POWER_STATUS_POWER_CLASS_EXT_CLASS_7 = 0x0007,
217 LLDP_DOT3_POWER_STATUS_POWER_CLASS_EXT_CLASS_8 = 0x0008,
218 LLDP_DOT3_POWER_STATUS_POWER_CLASS_EXT_DUAL_SIGN_PD = 0x000F,
219 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_B = 0x0070,
220 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_B_CLASS_1 = 0x0010,
221 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_B_CLASS_2 = 0x0020,
222 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_B_CLASS_3 = 0x0030,
223 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_B_CLASS_4 = 0x0040,
224 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_B_CLASS_5 = 0x0050,
225 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_B_SINGLE_SIGN_PD = 0x0070,
226 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_B_2_PAIR_ONLY_PSE = 0x0070,
227 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_A = 0x0380,
228 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_A_CLASS_1 = 0x0080,
229 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_A_CLASS_2 = 0x0100,
230 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_A_CLASS_3 = 0x0180,
231 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_A_CLASS_4 = 0x0200,
232 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_A_CLASS_5 = 0x0280,
233 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_A_SINGLE_SIGN_PD = 0x0380,
234 LLDP_DOT3_POWER_STATUS_DUAL_SIGN_POWER_CLASS_EXT_A_2_PAIR_ONLY_PSE = 0x0380,
235 LLDP_DOT3_POWER_STATUS_PSE_POWER_PAIRS_EXT = 0x0C00,
236 LLDP_DOT3_POWER_STATUS_PSE_POWER_PAIRS_EXT_ALT_A = 0x0400,
237 LLDP_DOT3_POWER_STATUS_PSE_POWER_PAIRS_EXT_ALT_B = 0x0800,
238 LLDP_DOT3_POWER_STATUS_PSE_POWER_PAIRS_EXT_BOTH = 0x0C00,
239 LLDP_DOT3_POWER_STATUS_PD_POWERED_STATUS = 0x3000,
240 LLDP_DOT3_POWER_STATUS_PD_POWERED_STATUS_SINGLE_SIGN_PD = 0x1000,
241 LLDP_DOT3_POWER_STATUS_PD_POWERED_STATUS_2_PAIR_DUAL_SIGN_PD = 0x2000,
242 LLDP_DOT3_POWER_STATUS_PD_POWERED_STATUS_4_PAIR_DUAL_SIGN_PD = 0x3000,
243 LLDP_DOT3_POWER_STATUS_PSE_POWERING_STATUS = 0xC000,
244 LLDP_DOT3_POWER_STATUS_PSE_POWERING_STATUS_2_PAIR = 0x4000,
245 LLDP_DOT3_POWER_STATUS_PSE_POWERING_STATUS_4_PAIR_SINGLE_SIGN_PD = 0x8000,
246 LLDP_DOT3_POWER_STATUS_PSE_POWERING_STATUS_4_PAIR_DUAL_SIGN_PD = 0xC000
248
249
254typedef enum
255{
256 LLDP_DOT3_SYSTEM_SETUP_PD_LOAD = 0x01,
257 LLDP_DOT3_SYSTEM_SETUP_POWER_TYPE_EXT = 0x0E,
258 LLDP_DOT3_SYSTEM_SETUP_POWER_TYPE_EXT_TYPE_3_PSE = 0x00,
259 LLDP_DOT3_SYSTEM_SETUP_POWER_TYPE_EXT_TYPE_4_PSE = 0x02,
260 LLDP_DOT3_SYSTEM_SETUP_POWER_TYPE_EXT_TYPE_3_SINGLE_SIGN_PD = 0x04,
261 LLDP_DOT3_SYSTEM_SETUP_POWER_TYPE_EXT_TYPE_3_DUAL_SIGN_PD = 0x06,
262 LLDP_DOT3_SYSTEM_SETUP_POWER_TYPE_EXT_TYPE_4_SINGLE_SIGN_PD = 0x08,
263 LLDP_DOT3_SYSTEM_SETUP_POWER_TYPE_EXT_TYPE_4_DUAL_SIGN_PD = 0x0A,
264 LLDP_DOT3_SYSTEM_SETUP_POWER_TYPE_RESERVED = 0xF0
266
267
272typedef enum
273{
274 LLDP_DOT3_AUTOCLASS_REQUEST = 0x01,
275 LLDP_DOT3_AUTOCLASS_COMPLETED = 0x02,
276 LLDP_DOT3_AUTOCLASS_PSE_SUPPORT = 0x04,
277 LLDP_DOT3_AUTOCLASS_RESERVED = 0xF8
279
280
285typedef enum
286{
287 LLDP_DOT3_POWER_DOWN_REQUEST = 0x740000,
288 LLDP_DOT3_POWER_DOWN_TIME = 0x03FFFF
290
291
301
302
303//CodeWarrior or Win32 compiler?
304#if defined(__CWCC__) || defined(_WIN32)
305 #pragma pack(push, 1)
306#endif
307
308
314{
315 uint8_t autoNegSupportStatus; //0
316 uint16_t pmdAutoNegAdvCap; //1-2
317 uint16_t operationalMauType; //3-4
318} LldpDot3MacPhyConfigStatusTlv;
319
320
325typedef __packed_struct
326{
327 uint8_t mdiPowerSupport; //0
328 uint8_t psePowerPair; //1
329 uint8_t powerClass; //2
330} LldpDot3PowerViaMdiTlv;
331
332
337typedef __packed_struct
338{
339 uint8_t aggregationStatus; //0
340 uint32_t aggregatedPortId; //2-5
341} LldpDot3LinkAggregationTlv;
342
343
348typedef __packed_struct
349{
350 uint16_t maxFrameSize; //0-1
351} LldpDot3MaxFrameSizeTlv;
352
353
358typedef __packed_struct
359{
360 uint8_t measurements[20]; //0-19
361 uint16_t psePowerPriceIndex; //20-21
362} LldpDot3PowerViaMdiMeasTlv;
363
364
369typedef __packed_struct
370{
371#if defined(_CPU_BIG_ENDIAN) && !defined(__ICCRX__)
372 uint8_t powerType : 2; //0
373 uint8_t powerSource : 2;
374 uint8_t reserved : 1;
375 uint8_t pd4pid : 1;
376 uint8_t powerPriority : 2;
377#else
378 uint8_t powerPriority : 2; //0
379 uint8_t pd4pid : 1;
380 uint8_t reserved : 1;
381 uint8_t powerSource : 2;
382 uint8_t powerType : 2;
383#endif
384 uint16_t pdRequestedPower; //1-2
385 uint16_t pseAllocatedPower; //3-4
386} LldpDot3DllClassExt;
387
388
393typedef __packed_struct
394{
395 uint16_t pdRequestedPowerA; //0-1
396 uint16_t pdRequestedPowerB; //2-3
397 uint16_t pseAllocatedPowerA; //4-5
398 uint16_t pseAllocatedPowerB; //6-7
399 uint16_t powerStatus; //8-9
400 uint8_t systemSetup; //10
401 uint16_t pseMaxAvailablePower; //11-12
402 uint8_t autoclass; //13
403 uint8_t powerDown[3]; //14-16
404} LldpDot3Type34Ext;
405
406
407//CodeWarrior or Win32 compiler?
408#if defined(__CWCC__) || defined(_WIN32)
409 #pragma pack(pop)
410#endif
411
412//IEEE 802.3 related functions
413error_t lldpDot3SetLocalMacPhyConfigStatus(LldpAgentContext *context,
414 uint_t portIndex, uint8_t autoNegSupportStatus, uint16_t pmdAutoNegAdvCap,
415 uint16_t operationalMauType);
416
417error_t lldpDot3SetLocalPowerViaMdi(LldpAgentContext *context,
418 uint_t portIndex, uint8_t mdiPowerSupport,
419 LldpDot3PsePowerPair psePowerPair, LldpDot3PowerClass powerClass,
420 const LldpDot3DllClassExt *dllClassExt, const LldpDot3Type34Ext *type34Ext);
421
422error_t lldpDot3SetLocalLinkAggregation(LldpAgentContext *context,
423 uint_t portIndex, uint8_t aggregationStatus, uint32_t aggregatedPortId);
424
425error_t lldpDot3SetLocalMaxFrameSize(LldpAgentContext *context,
426 uint_t portIndex, uint16_t maxFrameSize);
427
428error_t lldpDot3SetLocalPowerViaMdiMeas(LldpAgentContext *context,
429 uint_t portIndex, uint8_t measurements[20], uint16_t psePowerPriceIndex);
430
431error_t lldpDot3DeleteLocalTlv(LldpAgentContext *context,
432 LldpDot3Subtype subtype);
433
434//C++ guard
435#ifdef __cplusplus
436}
437#endif
438
439#endif
error_t
Error codes.
Definition error.h:43
LLDP (Link Layer Discovery Protocol)
LldpDot3MauType
Operational MAU types.
Definition lldp_ext_dot3.h:100
@ LLDP_DOT3_MAU_TYPE_100BTX_HD
dot3MauType100BaseTXHD
Definition lldp_ext_dot3.h:105
@ LLDP_DOT3_MAU_TYPE_100BT1
dot3MauType100baseT1
Definition lldp_ext_dot3.h:113
@ LLDP_DOT3_MAU_TYPE_100BT4
dot3MauType100BaseT4
Definition lldp_ext_dot3.h:104
@ LLDP_DOT3_MAU_TYPE_100BTX_FD
dot3MauType100BaseTXFD
Definition lldp_ext_dot3.h:106
@ LLDP_DOT3_MAU_TYPE_1000BX_HD
dot3MauType1000BaseXHD
Definition lldp_ext_dot3.h:109
@ LLDP_DOT3_MAU_TYPE_100BT2_FD
dot3MauType100BaseT2FD
Definition lldp_ext_dot3.h:108
@ LLDP_DOT3_MAU_TYPE_INVALID
Invalid.
Definition lldp_ext_dot3.h:101
@ LLDP_DOT3_MAU_TYPE_10BT1L
dot3MauType10baseT1L
Definition lldp_ext_dot3.h:114
@ LLDP_DOT3_MAU_TYPE_100BT2_HD
dot3MauType100BaseT2HD
Definition lldp_ext_dot3.h:107
@ LLDP_DOT3_MAU_TYPE_10BT_HD
dot3MauType10BaseTHD
Definition lldp_ext_dot3.h:102
@ LLDP_DOT3_MAU_TYPE_1000BX_FD
dot3MauType1000BaseXFD
Definition lldp_ext_dot3.h:110
@ LLDP_DOT3_MAU_TYPE_1000BT_HD
dot3MauType1000BaseTHD
Definition lldp_ext_dot3.h:111
@ LLDP_DOT3_MAU_TYPE_1000BT_FD
dot3MauType1000BaseTFD
Definition lldp_ext_dot3.h:112
@ LLDP_DOT3_MAU_TYPE_10BT_FD
dot3MauType10BaseTFD
Definition lldp_ext_dot3.h:103
LldpDot3PowerDown
Power down field.
Definition lldp_ext_dot3.h:286
LldpDot3Autoclass
Autoclass field.
Definition lldp_ext_dot3.h:273
LldpDot3PsePowerPair
PSE power pair.
Definition lldp_ext_dot3.h:138
@ LLDP_DOT3_PSE_POWER_PAIR_ALT_A
Alternative A.
Definition lldp_ext_dot3.h:141
@ LLDP_DOT3_PSE_POWER_PAIR_SPARE
Spare.
Definition lldp_ext_dot3.h:140
@ LLDP_DOT3_PSE_POWER_PAIR_SIGNAL
Signal.
Definition lldp_ext_dot3.h:139
@ LLDP_DOT3_PSE_POWER_PAIR_ALT_B
Alternative B.
Definition lldp_ext_dot3.h:142
LldpDot3PowerStatus
Power status.
Definition lldp_ext_dot3.h:208
LldpDot3LinkAggregationFlag
Link aggregation capability/status flags.
Definition lldp_ext_dot3.h:297
@ LLDP_DOT3_LINK_AGGREGATION_FLAG_CAP
Aggregation capability.
Definition lldp_ext_dot3.h:298
@ LLDP_DOT3_LINK_AGGREGATION_FLAG_STATUS
Aggregation status.
Definition lldp_ext_dot3.h:299
LldpDot3SystemSetup
System setup.
Definition lldp_ext_dot3.h:255
LldpDot3PowerType
power type
Definition lldp_ext_dot3.h:165
@ LLDP_DOT3_POWER_TYPE_1_PD
Type 1 PD.
Definition lldp_ext_dot3.h:169
@ LLDP_DOT3_POWER_TYPE_2_PD
Type 2 PD.
Definition lldp_ext_dot3.h:167
@ LLDP_DOT3_POWER_TYPE_1_PSE
Type 1 PSE.
Definition lldp_ext_dot3.h:168
@ LLDP_DOT3_POWER_TYPE_2_PSE
Type 2 PSE.
Definition lldp_ext_dot3.h:166
LldpDot3AnFlags
Auto-negotiation support/status flags.
Definition lldp_ext_dot3.h:64
@ LLDP_DOT3_AN_FLAG_STATUS
Auto-negotiation status.
Definition lldp_ext_dot3.h:66
@ LLDP_DOT3_AN_FLAG_SUPPORT
Auto-negotiation support.
Definition lldp_ext_dot3.h:65
LldpDot3MdiPowerFlags
MDI power capability/status flags.
Definition lldp_ext_dot3.h:123
@ LLDP_DOT3_MDI_POWER_FLAG_PSE_MDI_POWER_STATE
PSE MDI power state.
Definition lldp_ext_dot3.h:128
@ LLDP_DOT3_MDI_POWER_FLAG_PSE_MDI_POWER_SUPPORT
PSE MDI power support.
Definition lldp_ext_dot3.h:127
@ LLDP_DOT3_MDI_POWER_FLAG_PSE_PAIRS_CTRL_ABILITY
PSE pairs control ability.
Definition lldp_ext_dot3.h:129
@ LLDP_DOT3_MDI_POWER_FLAG_PORT_CLASS
Port class.
Definition lldp_ext_dot3.h:124
@ LLDP_DOT3_MDI_POWER_FLAG_PORT_CLASS_PD
Port class - PD.
Definition lldp_ext_dot3.h:125
@ LLDP_DOT3_MDI_POWER_FLAG_PORT_CLASS_PSE
Port class - PSE.
Definition lldp_ext_dot3.h:126
LldpDot3PowerSource
power source
Definition lldp_ext_dot3.h:178
@ LLDP_DOT3_PD_POWER_SOURCE_RESERVED
Reserved (PD device type)
Definition lldp_ext_dot3.h:181
@ LLDP_DOT3_PD_POWER_SOURCE_PSE_AND_LOCAL
PSE and local (PD device type)
Definition lldp_ext_dot3.h:182
@ LLDP_DOT3_PD_POWER_SOURCE_PSE
PSE (PD device type)
Definition lldp_ext_dot3.h:180
@ LLDP_DOT3_PSE_POWER_SOURCE_PRIMARY
Primary power source (PSE device type)
Definition lldp_ext_dot3.h:184
@ LLDP_DOT3_PD_POWER_SOURCE_UNKNOWN
Unknown (PD device type)
Definition lldp_ext_dot3.h:179
@ LLDP_DOT3_PSE_POWER_SOURCE_UNKNOWN
Unknown (PSE device type)
Definition lldp_ext_dot3.h:183
@ LLDP_DOT3_PSE_POWER_SOURCE_RESERVED
Reserved (PSE device type)
Definition lldp_ext_dot3.h:186
@ LLDP_DOT3_PSE_POWER_SOURCE_BACKUP
Backup source (PSE device type)
Definition lldp_ext_dot3.h:185
LldpDot3PmdAnAdvCapability
PMD auto-negotiation advertised capability.
Definition lldp_ext_dot3.h:75
@ LLDP_DOT3_PMD_AN_ADV_CAP_ASYM_PAUSE
Asymmetric PAUSE for full-duplex links.
Definition lldp_ext_dot3.h:85
@ LLDP_DOT3_PMD_AN_ADV_CAP_1000BT_FD
1000BASE-T full-duplex mode
Definition lldp_ext_dot3.h:91
@ LLDP_DOT3_PMD_AN_ADV_CAP_100BT2_FD
100BASE-T2 full-duplex mode
Definition lldp_ext_dot3.h:83
@ LLDP_DOT3_PMD_AN_ADV_CAP_OTHER
Other or unknown.
Definition lldp_ext_dot3.h:76
@ LLDP_DOT3_PMD_AN_ADV_CAP_10BT_FD
10BASE-T full-duplex mode
Definition lldp_ext_dot3.h:78
@ LLDP_DOT3_PMD_AN_ADV_CAP_100BT_HD
100BASE-TX half-duplex mode
Definition lldp_ext_dot3.h:80
@ LLDP_DOT3_PMD_AN_ADV_CAP_100BT_FD
100BASE-TX full-duplex mode
Definition lldp_ext_dot3.h:81
@ LLDP_DOT3_PMD_AN_ADV_CAP_1000BX_HD
1000BASE-X, -LX, -SX, -CX half-duplex mode
Definition lldp_ext_dot3.h:88
@ LLDP_DOT3_PMD_AN_ADV_CAP_10BT_HD
10BASE-T half-duplex mode
Definition lldp_ext_dot3.h:77
@ LLDP_DOT3_PMD_AN_ADV_CAP_100BT2_HD
100BASE-T2 half-duplex mode
Definition lldp_ext_dot3.h:82
@ LLDP_DOT3_PMD_AN_ADV_CAP_100BT4
100BASE-T4
Definition lldp_ext_dot3.h:79
@ LLDP_DOT3_PMD_AN_ADV_CAP_SYM_PAUSE
Symmetric PAUSE for full-duplex links.
Definition lldp_ext_dot3.h:86
@ LLDP_DOT3_PMD_AN_ADV_CAP_1000BT_HD
1000BASE-T half-duplex mode
Definition lldp_ext_dot3.h:90
@ LLDP_DOT3_PMD_AN_ADV_CAP_PAUSE
PAUSE for full-duplex links.
Definition lldp_ext_dot3.h:84
@ LLDP_DOT3_PMD_AN_ADV_CAP_ASYM_SYM_PAUSE
Asymmetric and Symmetric PAUSE for full-duplex links.
Definition lldp_ext_dot3.h:87
@ LLDP_DOT3_PMD_AN_ADV_CAP_1000BX_FD
1000BASE-X, -LX, -SX, -CX full-duplex mode
Definition lldp_ext_dot3.h:89
typedef __packed_struct
MAC/PHY Configuration/Status TLV.
Definition lldp_ext_dot3.h:314
LldpDot3PowerPriority
Power priority.
Definition lldp_ext_dot3.h:195
@ LLDP_DOT3_POWER_PRIORITY_HIGH
High.
Definition lldp_ext_dot3.h:198
@ LLDP_DOT3_POWER_PRIORITY_LOW
Low.
Definition lldp_ext_dot3.h:199
@ LLDP_DOT3_POWER_PRIORITY_UNKNOWN
Unknown.
Definition lldp_ext_dot3.h:196
@ LLDP_DOT3_POWER_PRIORITY_CRITICAL
Critical.
Definition lldp_ext_dot3.h:197
LldpDot3PowerClass
power class
Definition lldp_ext_dot3.h:151
@ LLDP_DOT3_POWER_CLASS_4
Class 4 and above PD.
Definition lldp_ext_dot3.h:156
@ LLDP_DOT3_POWER_CLASS_0
Class 0 PD.
Definition lldp_ext_dot3.h:152
@ LLDP_DOT3_POWER_CLASS_3
Class 3 PD.
Definition lldp_ext_dot3.h:155
@ LLDP_DOT3_POWER_CLASS_2
Class 2 PD.
Definition lldp_ext_dot3.h:154
@ LLDP_DOT3_POWER_CLASS_1
Class 1 PD.
Definition lldp_ext_dot3.h:153
LldpDot3Subtype
IEEE 802.3 subtypes.
Definition lldp_ext_dot3.h:49
@ LLDP_DOT3_SUBTYPE_POWER_VIA_MDI
Power Via MDI.
Definition lldp_ext_dot3.h:52
@ LLDP_DOT3_SUBTYPE_LINK_AGGREGATION
Link Aggregation.
Definition lldp_ext_dot3.h:53
@ LLDP_DOT3_SUBTYPE_POWER_VIA_MDI_MEAS
Power Via MDI Measurements.
Definition lldp_ext_dot3.h:55
@ LLDP_DOT3_SUBTYPE_MAX_FRAME_SIZE
Maximum Frame Size.
Definition lldp_ext_dot3.h:54
@ LLDP_DOT3_SUBTYPE_MAC_PHY_CONFIG_STATUS
MAC/PHY Configuration/Status.
Definition lldp_ext_dot3.h:51
@ LLDP_DOT3_SUBTYPE_RESERVED
Reserved.
Definition lldp_ext_dot3.h:50
TCP/IP stack core.