Helper functions for LLDP. More...
#include "core/net.h"
#include "lldp/lldp.h"
#include "lldp/lldp_fsm.h"
#include "lldp/lldp_misc.h"
#include "lldp/lldp_debug.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL LLDP_TRACE_LEVEL |
Functions | |
void | lldpTick (LldpAgentContext *context) |
LLDP agent timer handler. More... | |
void | lldpProcessFrame (LldpAgentContext *context) |
Process incoming LLDP frame. More... | |
error_t | lldpCheckDataUnit (LldpPortEntry *port, LldpDataUnit *lldpdu) |
LLDP data unit validation. More... | |
LldpNeighborEntry * | lldpCreateNeighborEntry (LldpAgentContext *context) |
Create a new entry in the remote systems MIB. More... | |
LldpNeighborEntry * | lldpFindNeighborEntry (LldpAgentContext *context, LldpDataUnit *lldpdu) |
Search the remote systems MIB for a matching MSAP identifier. More... | |
void | lldpDeleteNeighborEntry (LldpNeighborEntry *entry) |
Remove an entry from the remote systems MIB. More... | |
bool_t | lldpGetLinkState (LldpAgentContext *context, uint_t portIndex) |
Get link state. More... | |
error_t | lldpAcceptMulticastAddr (LldpAgentContext *context) |
Add the LLDP multicast address to the static MAC table. More... | |
error_t | lldpDropMulticastAddr (LldpAgentContext *context) |
Remove the LLDP multicast address from the static MAC table. More... | |
void | lldpGeneratePortAddr (LldpPortEntry *port) |
Port's MAC address generation. More... | |
error_t | lldpGetMsapId (LldpDataUnit *lldpdu, LldpMsapId *msapId) |
Extract MSAP identifier. More... | |
bool_t | lldpCompareMsapId (const LldpMsapId *msapId1, const LldpMsapId *msapId2) |
Compare MSAP identifiers. More... | |
void | lldpSomethingChangedLocal (LldpAgentContext *context) |
Notify LLDP that an object in the LLDP local system MIB has changed. More... | |
void | lldpDecrementTimer (uint_t *x) |
Decrement timer value. More... | |
Variables | |
const MacAddr | LLDP_MULTICAST_ADDR = {{{0x01, 0x80, 0xC2, 0x00, 0x00, 0x0E}}} |
Detailed Description
Helper functions for LLDP.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 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.4.4
Definition in file lldp_misc.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL LLDP_TRACE_LEVEL |
Definition at line 32 of file lldp_misc.c.
Function Documentation
◆ lldpAcceptMulticastAddr()
error_t lldpAcceptMulticastAddr | ( | LldpAgentContext * | context | ) |
Add the LLDP multicast address to the static MAC table.
- Parameters
-
[in] context Pointer to the LLDP agent context
- Returns
- Error code
Definition at line 580 of file lldp_misc.c.
◆ lldpCheckDataUnit()
error_t lldpCheckDataUnit | ( | LldpPortEntry * | port, |
LldpDataUnit * | lldpdu | ||
) |
LLDP data unit validation.
- Parameters
-
[in] port Pointer to the port context [in] lldpdu Pointer to the received LLDP data unit
- Returns
- Error code
Definition at line 242 of file lldp_misc.c.
◆ lldpCompareMsapId()
bool_t lldpCompareMsapId | ( | const LldpMsapId * | msapId1, |
const LldpMsapId * | msapId2 | ||
) |
Compare MSAP identifiers.
- Parameters
-
[in] msapId1 Pointer to the first MSAP identifier [in] msapId2 Pointer to the second MSAP identifier
- Returns
- TRUE if the MSAP identifiers match, else FALSE
Definition at line 768 of file lldp_misc.c.
◆ lldpCreateNeighborEntry()
LldpNeighborEntry* lldpCreateNeighborEntry | ( | LldpAgentContext * | context | ) |
Create a new entry in the remote systems MIB.
- Parameters
-
[in] context Pointer to the LLDP agent context
- Returns
- Pointer to the newly created entry
Definition at line 444 of file lldp_misc.c.
◆ lldpDecrementTimer()
void lldpDecrementTimer | ( | uint_t * | x | ) |
Decrement timer value.
- Parameters
-
[in,out] x Actual timer value
Definition at line 825 of file lldp_misc.c.
◆ lldpDeleteNeighborEntry()
void lldpDeleteNeighborEntry | ( | LldpNeighborEntry * | entry | ) |
Remove an entry from the remote systems MIB.
- Parameters
-
[in] entry Pointer to a given entry
Definition at line 528 of file lldp_misc.c.
◆ lldpDropMulticastAddr()
error_t lldpDropMulticastAddr | ( | LldpAgentContext * | context | ) |
Remove the LLDP multicast address from the static MAC table.
- Parameters
-
[in] context Pointer to the LLDP agent context
- Returns
- Error code
Definition at line 635 of file lldp_misc.c.
◆ lldpFindNeighborEntry()
LldpNeighborEntry* lldpFindNeighborEntry | ( | LldpAgentContext * | context, |
LldpDataUnit * | lldpdu | ||
) |
Search the remote systems MIB for a matching MSAP identifier.
- Parameters
-
[in] context Pointer to the LLDP agent context [in] lldpdu Pointer to the received LLDP data unit
- Returns
- Pointer to the matching entry, if any
Definition at line 476 of file lldp_misc.c.
◆ lldpGeneratePortAddr()
void lldpGeneratePortAddr | ( | LldpPortEntry * | port | ) |
Port's MAC address generation.
- Parameters
-
[in] port Pointer to the port context
Definition at line 689 of file lldp_misc.c.
◆ lldpGetLinkState()
bool_t lldpGetLinkState | ( | LldpAgentContext * | context, |
uint_t | portIndex | ||
) |
Get link state.
- Parameters
-
[in] context Pointer to the LLDP agent context [in] portIndex Port index
- Returns
- Error code
Definition at line 544 of file lldp_misc.c.
◆ lldpGetMsapId()
error_t lldpGetMsapId | ( | LldpDataUnit * | lldpdu, |
LldpMsapId * | msapId | ||
) |
Extract MSAP identifier.
- Parameters
-
[in] lldpdu Pointer to the LLDP data unit [out] msapId MSAP identifier
- Returns
- Error code
Definition at line 740 of file lldp_misc.c.
◆ lldpProcessFrame()
void lldpProcessFrame | ( | LldpAgentContext * | context | ) |
Process incoming LLDP frame.
- Parameters
-
[in] context Pointer to the LLDP agent context
Definition at line 170 of file lldp_misc.c.
◆ lldpSomethingChangedLocal()
void lldpSomethingChangedLocal | ( | LldpAgentContext * | context | ) |
Notify LLDP that an object in the LLDP local system MIB has changed.
- Parameters
-
[in] context Pointer to the LLDP agent context
Definition at line 806 of file lldp_misc.c.
◆ lldpTick()
void lldpTick | ( | LldpAgentContext * | context | ) |
LLDP agent timer handler.
This routine must be periodically called by the TCP/IP stack to manage LLDP agent operation
- Parameters
-
[in] context Pointer to the LLDP agent context
Definition at line 58 of file lldp_misc.c.
Variable Documentation
◆ LLDP_MULTICAST_ADDR
const MacAddr LLDP_MULTICAST_ADDR = {{{0x01, 0x80, 0xC2, 0x00, 0x00, 0x0E}}} |
Definition at line 46 of file lldp_misc.c.