LLDP (Link Layer Discovery Protocol) More...
#include "core/net.h"#include "lldp/lldp_rx_fsm.h"#include "lldp/lldp_tx_fsm.h"#include "lldp/lldp_tlv.h"Go to the source code of this file.
Data Structures | |
| struct | _LldpDataUnit |
| LLDP data unit. More... | |
| struct | LldpMsapId |
| MSAP identifier. More... | |
| struct | LldpNeighborEntry |
| LLDP neighbor entry. More... | |
| struct | _LldpPortEntry |
| LLDP port entry. More... | |
| struct | LldpAgentSettings |
| LLDP agent settings. More... | |
| struct | _LldpAgentContext |
| LLDP agent context. More... | |
Typedefs | |
| typedef void(* | LldpSendCallback) (LldpPortEntry *port, LldpDataUnit *lldpdu) |
| LLDP frame transmission callback function. More... | |
| typedef void(* | LldpReceiveCallback) (LldpPortEntry *port, LldpDataUnit *lldpdu) |
| LLDP frame reception callback function. More... | |
| typedef void(* | LldpTickCallback) (LldpAgentContext *context) |
| Tick callback function. More... | |
Enumerations | |
| enum | LldpAdminStatus { LLDP_ADMIN_STATUS_DISABLED = 0, LLDP_ADMIN_STATUS_ENABLED_TX_ONLY = 1, LLDP_ADMIN_STATUS_ENABLED_RX_ONLY = 2, LLDP_ADMIN_STATUS_ENABLED_TX_RX = 3 } |
| Administrative status. More... | |
| enum | LldpBasicTlvFilter { LLDP_BASIC_TLV_FILTER_PORT_DESC = 0x01, LLDP_BASIC_TLV_FILTER_SYS_NAME = 0x02, LLDP_BASIC_TLV_FILTER_SYS_DESC = 0x04, LLDP_BASIC_TLV_FILTER_SYS_CAP = 0x08, LLDP_BASIC_TLV_FILTER_ALL = 0x0F } |
| Basic TLV filter. More... | |
Functions | |
| void | lldpGetDefaultSettings (LldpAgentSettings *settings) |
| Initialize settings with default values. More... | |
| error_t | lldpInit (LldpAgentContext *context, const LldpAgentSettings *settings) |
| LLDP agent initialization. More... | |
| error_t | lldpStart (LldpAgentContext *context) |
| Start LLDP agent. More... | |
| error_t | lldpStop (LldpAgentContext *context) |
| Stop LLDP agent. More... | |
| error_t | lldpSetPortAddr (LldpAgentContext *context, uint_t portIndex, const MacAddr *macAddr) |
| Set port address. More... | |
| error_t | lldpSetAdminStatus (LldpAgentContext *context, uint_t portIndex, LldpAdminStatus adminStatus) |
| Set administrative status. More... | |
| error_t | lldpSetBasicTlvFilter (LldpAgentContext *context, uint_t portIndex, uint8_t mask) |
| Set the list of TLVs enabled for transmission. More... | |
| error_t | lldpSetMgmtAddrFilter (LldpAgentContext *context, uint_t portIndex, uint32_t mask) |
| Set the list of management addresses enabled for transmission. More... | |
| error_t | lldpSetMsgTxInterval (LldpAgentContext *context, uint_t msgTxInterval) |
| Set transmit interval. More... | |
| error_t | lldpSetMsgTxHold (LldpAgentContext *context, uint_t msgTxHold) |
| Set transmit hold multiplier. More... | |
| error_t | lldpSetReinitDelay (LldpAgentContext *context, uint_t reinitDelay) |
| Set re-initialization delay. More... | |
| error_t | lldpSetTxDelay (LldpAgentContext *context, uint_t txDelay) |
| Set transmit delay. More... | |
| error_t | lldpSetLocalChassisId (LldpAgentContext *context, LldpChassisIdSubtype chassisIdSubtype, const void *chassisId, size_t chassisIdLen) |
| Set chassis ID. More... | |
| error_t | lldpSetLocalPortId (LldpAgentContext *context, uint_t portIndex, LldpPortIdSubtype portIdSubtype, const void *portId, size_t portIdLen) |
| Set port ID. More... | |
| error_t | lldpSetLocalPortDesc (LldpAgentContext *context, uint_t portIndex, const char_t *portDesc) |
| Set port description. More... | |
| error_t | lldpSetLocalSysName (LldpAgentContext *context, const char_t *sysName) |
| Set system name. More... | |
| error_t | lldpSetLocalSysDesc (LldpAgentContext *context, const char_t *sysDesc) |
| Set system description. More... | |
| error_t | lldpSetLocalSysCap (LldpAgentContext *context, uint16_t supportedCap, uint16_t enabledCap) |
| Set system capabilities. More... | |
| error_t | lldpSetLocalMgmtAddr (LldpAgentContext *context, uint_t index, LldpMgmtAddrSubtype mgmtAddrSubtype, const void *mgmtAddr, size_t mgmtAddrLen, LldpIfNumSubtype ifNumSubtype, uint32_t ifNum, const uint8_t *oid, size_t oidLen) |
| Set management address. More... | |
| error_t | lldpDeleteLocalTlv (LldpAgentContext *context, LldpTlvType type) |
| Remove all TLVs with specified type. More... | |
| void | lldpTask (LldpAgentContext *context) |
| LLDP agent task. More... | |
| void | lldpDeinit (LldpAgentContext *context) |
| Release LLDP agent context. More... | |
Detailed Description
LLDP (Link Layer Discovery Protocol)
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.5.4
Definition in file lldp.h.
Macro Definition Documentation
◆ LLDP_DEFAULT_MSG_TX_HOLD
◆ LLDP_DEFAULT_MSG_TX_INTERVAL
◆ LLDP_DEFAULT_NOTIFICATION_INTERVAL
◆ LLDP_DEFAULT_REINIT_DELAY
◆ LLDP_DEFAULT_TX_DELAY
◆ LLDP_MAX_LLDPDU_SIZE
◆ LLDP_MAX_MGMT_ADDRS
◆ LLDP_MAX_MSG_TX_HOLD
◆ LLDP_MAX_MSG_TX_INTERVAL
◆ LLDP_MAX_NOTIFICATION_INTERVAL
◆ LLDP_MAX_REINIT_DELAY
◆ LLDP_MAX_TX_DELAY
◆ LLDP_MGMT_ADDR_FILTER_0
◆ LLDP_MGMT_ADDR_FILTER_1
◆ LLDP_MGMT_ADDR_FILTER_10
◆ LLDP_MGMT_ADDR_FILTER_11
◆ LLDP_MGMT_ADDR_FILTER_12
◆ LLDP_MGMT_ADDR_FILTER_13
◆ LLDP_MGMT_ADDR_FILTER_14
◆ LLDP_MGMT_ADDR_FILTER_15
◆ LLDP_MGMT_ADDR_FILTER_16
◆ LLDP_MGMT_ADDR_FILTER_17
◆ LLDP_MGMT_ADDR_FILTER_18
◆ LLDP_MGMT_ADDR_FILTER_19
◆ LLDP_MGMT_ADDR_FILTER_2
◆ LLDP_MGMT_ADDR_FILTER_20
◆ LLDP_MGMT_ADDR_FILTER_21
◆ LLDP_MGMT_ADDR_FILTER_22
◆ LLDP_MGMT_ADDR_FILTER_23
◆ LLDP_MGMT_ADDR_FILTER_24
◆ LLDP_MGMT_ADDR_FILTER_25
◆ LLDP_MGMT_ADDR_FILTER_26
◆ LLDP_MGMT_ADDR_FILTER_27
◆ LLDP_MGMT_ADDR_FILTER_28
◆ LLDP_MGMT_ADDR_FILTER_29
◆ LLDP_MGMT_ADDR_FILTER_3
◆ LLDP_MGMT_ADDR_FILTER_30
◆ LLDP_MGMT_ADDR_FILTER_31
◆ LLDP_MGMT_ADDR_FILTER_4
◆ LLDP_MGMT_ADDR_FILTER_5
◆ LLDP_MGMT_ADDR_FILTER_6
◆ LLDP_MGMT_ADDR_FILTER_7
◆ LLDP_MGMT_ADDR_FILTER_8
◆ LLDP_MGMT_ADDR_FILTER_9
◆ LLDP_MGMT_ADDR_FILTER_ALL
◆ LLDP_MIN_MSG_TX_HOLD
◆ LLDP_MIN_MSG_TX_INTERVAL
◆ LLDP_MIN_NOTIFICATION_INTERVAL
◆ LLDP_MIN_REINIT_DELAY
◆ LLDP_MIN_TX_DELAY
◆ LLDP_RX_MODE_SUPPORT
◆ LLDP_SUPPORT
◆ LLDP_TASK_PRIORITY
| #define LLDP_TASK_PRIORITY OS_TASK_PRIORITY_NORMAL |
◆ LLDP_TASK_STACK_SIZE
◆ LLDP_TICK_INTERVAL
◆ LLDP_TX_MODE_SUPPORT
◆ LldpAgentContext
| #define LldpAgentContext struct _LldpAgentContext |
◆ LldpDataUnit
| #define LldpDataUnit struct _LldpDataUnit |
◆ LldpPortEntry
| #define LldpPortEntry struct _LldpPortEntry |
Typedef Documentation
◆ LldpReceiveCallback
| typedef void(* LldpReceiveCallback) (LldpPortEntry *port, LldpDataUnit *lldpdu) |
◆ LldpSendCallback
| typedef void(* LldpSendCallback) (LldpPortEntry *port, LldpDataUnit *lldpdu) |
◆ LldpTickCallback
| typedef void(* LldpTickCallback) (LldpAgentContext *context) |
Enumeration Type Documentation
◆ LldpAdminStatus
| enum LldpAdminStatus |
Administrative status.
◆ LldpBasicTlvFilter
| enum LldpBasicTlvFilter |
Function Documentation
◆ lldpDeinit()
| void lldpDeinit | ( | LldpAgentContext * | context | ) |
◆ lldpDeleteLocalTlv()
| error_t lldpDeleteLocalTlv | ( | LldpAgentContext * | context, |
| LldpTlvType | type | ||
| ) |
◆ lldpGetDefaultSettings()
| void lldpGetDefaultSettings | ( | LldpAgentSettings * | settings | ) |
◆ lldpInit()
| error_t lldpInit | ( | LldpAgentContext * | context, |
| const LldpAgentSettings * | settings | ||
| ) |
◆ lldpSetAdminStatus()
| error_t lldpSetAdminStatus | ( | LldpAgentContext * | context, |
| uint_t | portIndex, | ||
| LldpAdminStatus | adminStatus | ||
| ) |
◆ lldpSetBasicTlvFilter()
| error_t lldpSetBasicTlvFilter | ( | LldpAgentContext * | context, |
| uint_t | portIndex, | ||
| uint8_t | mask | ||
| ) |
◆ lldpSetLocalChassisId()
| error_t lldpSetLocalChassisId | ( | LldpAgentContext * | context, |
| LldpChassisIdSubtype | chassisIdSubtype, | ||
| const void * | chassisId, | ||
| size_t | chassisIdLen | ||
| ) |
Set chassis ID.
- Parameters
-
[in] context Pointer to the LLDP agent context [in] chassisIdSubtype Type of identifier used for the chassis [in] chassisId Administratively assigned name that identifies the chassis [in] chassisIdLen Length of the chassis ID, in bytes
- Returns
- Error code
◆ lldpSetLocalMgmtAddr()
| error_t lldpSetLocalMgmtAddr | ( | LldpAgentContext * | context, |
| uint_t | index, | ||
| LldpMgmtAddrSubtype | mgmtAddrSubtype, | ||
| const void * | mgmtAddr, | ||
| size_t | mgmtAddrLen, | ||
| LldpIfNumSubtype | ifNumSubtype, | ||
| uint32_t | ifNum, | ||
| const uint8_t * | oid, | ||
| size_t | oidLen | ||
| ) |
Set management address.
- Parameters
-
[in] context Pointer to the LLDP agent context [in] index Zero-based index identifying a management address [in] mgmtAddrSubtype Type of management address [in] mgmtAddr Octet string indicating a particular management address [in] mgmtAddrLen Length of the management address, in bytes [in] ifNumSubtype Numbering method used for defining the interface number [in] ifNum Number within the system that identifies the specific interface associated with this management address [in] oid OID that identifies the type of hardware component or protocol entity associated with the indicated management address [in] oidLen Length of the OID, in bytes
- Returns
- Error code
◆ lldpSetLocalPortDesc()
| error_t lldpSetLocalPortDesc | ( | LldpAgentContext * | context, |
| uint_t | portIndex, | ||
| const char_t * | portDesc | ||
| ) |
◆ lldpSetLocalPortId()
| error_t lldpSetLocalPortId | ( | LldpAgentContext * | context, |
| uint_t | portIndex, | ||
| LldpPortIdSubtype | portIdSubtype, | ||
| const void * | portId, | ||
| size_t | portIdLen | ||
| ) |
Set port ID.
- Parameters
-
[in] context Pointer to the LLDP agent context [in] portIndex Port index [in] portIdSubtype Type of identifier used for the port [in] portId Administratively assigned name that identifies the port [in] portIdLen Length of the port ID, in bytes
- Returns
- Error code
◆ lldpSetLocalSysCap()
| error_t lldpSetLocalSysCap | ( | LldpAgentContext * | context, |
| uint16_t | supportedCap, | ||
| uint16_t | enabledCap | ||
| ) |
◆ lldpSetLocalSysDesc()
| error_t lldpSetLocalSysDesc | ( | LldpAgentContext * | context, |
| const char_t * | sysDesc | ||
| ) |
◆ lldpSetLocalSysName()
| error_t lldpSetLocalSysName | ( | LldpAgentContext * | context, |
| const char_t * | sysName | ||
| ) |
◆ lldpSetMgmtAddrFilter()
| error_t lldpSetMgmtAddrFilter | ( | LldpAgentContext * | context, |
| uint_t | portIndex, | ||
| uint32_t | mask | ||
| ) |
◆ lldpSetMsgTxHold()
| error_t lldpSetMsgTxHold | ( | LldpAgentContext * | context, |
| uint_t | msgTxHold | ||
| ) |
◆ lldpSetMsgTxInterval()
| error_t lldpSetMsgTxInterval | ( | LldpAgentContext * | context, |
| uint_t | msgTxInterval | ||
| ) |
◆ lldpSetPortAddr()
| error_t lldpSetPortAddr | ( | LldpAgentContext * | context, |
| uint_t | portIndex, | ||
| const MacAddr * | macAddr | ||
| ) |
◆ lldpSetReinitDelay()
| error_t lldpSetReinitDelay | ( | LldpAgentContext * | context, |
| uint_t | reinitDelay | ||
| ) |
◆ lldpSetTxDelay()
| error_t lldpSetTxDelay | ( | LldpAgentContext * | context, |
| uint_t | txDelay | ||
| ) |
◆ lldpStart()
| error_t lldpStart | ( | LldpAgentContext * | context | ) |
◆ lldpStop()
| error_t lldpStop | ( | LldpAgentContext * | context | ) |
◆ lldpTask()
| void lldpTask | ( | LldpAgentContext * | context | ) |
