Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
|
LLDP definitions and helpers . More...
Data Structures | |
struct | net_lldp_chassis_tlv |
Chassis ID TLV, see chapter 8.5.2 in IEEE 802.1AB. More... | |
struct | net_lldp_port_tlv |
Port ID TLV, see chapter 8.5.3 in IEEE 802.1AB. More... | |
struct | net_lldp_time_to_live_tlv |
Time To Live TLV, see chapter 8.5.4 in IEEE 802.1AB. More... | |
struct | net_lldpdu |
LLDP Data Unit (LLDPDU) shall contain the following ordered TLVs as stated in "8.2 LLDPDU format" from the IEEE 802.1AB. More... | |
Macros | |
#define | net_lldp_set_lldpdu(iface) |
Set LLDP protocol data unit (LLDPDU) for the network interface. | |
#define | net_lldp_unset_lldpdu(iface) |
Unset LLDP protocol data unit (LLDPDU) for the network interface. | |
Typedefs | |
typedef enum net_verdict(* | net_lldp_recv_cb_t) (struct net_if *iface, struct net_pkt *pkt) |
LLDP Receive packet callback. | |
Enumerations | |
enum | net_lldp_tlv_type { LLDP_TLV_END_LLDPDU = 0 , LLDP_TLV_CHASSIS_ID = 1 , LLDP_TLV_PORT_ID = 2 , LLDP_TLV_TTL = 3 , LLDP_TLV_PORT_DESC = 4 , LLDP_TLV_SYSTEM_NAME = 5 , LLDP_TLV_SYSTEM_DESC = 6 , LLDP_TLV_SYSTEM_CAPABILITIES = 7 , LLDP_TLV_MANAGEMENT_ADDR = 8 , LLDP_TLV_ORG_SPECIFIC = 127 } |
TLV Types. More... | |
Functions | |
int | net_lldp_config (struct net_if *iface, const struct net_lldpdu *lldpdu) |
Set the LLDP data unit for a network interface. | |
int | net_lldp_config_optional (struct net_if *iface, const uint8_t *tlv, size_t len) |
Set the Optional LLDP TLVs for a network interface. | |
void | net_lldp_init (void) |
Initialize LLDP engine. | |
int | net_lldp_register_callback (struct net_if *iface, net_lldp_recv_cb_t cb) |
Register LLDP Rx callback function. | |
enum net_verdict | net_lldp_recv (struct net_if *iface, struct net_pkt *pkt) |
Parse LLDP packet. | |
LLDP definitions and helpers .
#define net_lldp_set_lldpdu | ( | iface | ) |
#include <zephyr/net/lldp.h>
Set LLDP protocol data unit (LLDPDU) for the network interface.
iface | Network interface |
#define net_lldp_unset_lldpdu | ( | iface | ) |
#include <zephyr/net/lldp.h>
Unset LLDP protocol data unit (LLDPDU) for the network interface.
iface | Network interface |
typedef enum net_verdict(* net_lldp_recv_cb_t) (struct net_if *iface, struct net_pkt *pkt) |
#include <zephyr/net/lldp.h>
LLDP Receive packet callback.
Callback gets called upon receiving packet. It is responsible for freeing packet or indicating to the stack that it needs to free packet by returning correct net_verdict.
Returns:
enum net_lldp_tlv_type |
#include <zephyr/net/lldp.h>
TLV Types.
Please refer to table 8-1 from IEEE 802.1AB standard.
int net_lldp_config | ( | struct net_if * | iface, |
const struct net_lldpdu * | lldpdu ) |
#include <zephyr/net/lldp.h>
Set the LLDP data unit for a network interface.
iface | Network interface |
lldpdu | LLDP data unit struct |
#include <zephyr/net/lldp.h>
Set the Optional LLDP TLVs for a network interface.
iface | Network interface |
tlv | LLDP optional TLVs following mandatory part |
len | Length of the optional TLVs |
void net_lldp_init | ( | void | ) |
#include <zephyr/net/lldp.h>
Initialize LLDP engine.
enum net_verdict net_lldp_recv | ( | struct net_if * | iface, |
struct net_pkt * | pkt ) |
#include <zephyr/net/lldp.h>
Parse LLDP packet.
iface | Network interface |
pkt | Network packet |
int net_lldp_register_callback | ( | struct net_if * | iface, |
net_lldp_recv_cb_t | cb ) |
#include <zephyr/net/lldp.h>
Register LLDP Rx callback function.
iface | Network interface |
cb | Callback function |