Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
net_l2 Struct Reference

Network L2 structure. More...

#include <net_l2.h>

Data Fields

enum net_verdict(* recv )(struct net_if *iface, struct net_pkt *pkt)
 
int(* send )(struct net_if *iface, struct net_pkt *pkt)
 
int(* enable )(struct net_if *iface, bool state)
 
enum net_l2_flags(* get_flags )(struct net_if *iface)
 

Detailed Description

Network L2 structure.

Used to provide an interface to lower network stack.

Field Documentation

◆ enable

int(* net_l2::enable) (struct net_if *iface, bool state)

This function is used to enable/disable traffic over a network interface. The function returns <0 if error and >=0 if no error.

◆ get_flags

enum net_l2_flags(* net_l2::get_flags) (struct net_if *iface)

Return L2 flags for the network interface.

◆ recv

enum net_verdict(* net_l2::recv) (struct net_if *iface, struct net_pkt *pkt)

This function is used by net core to get iface's L2 layer parsing what's relevant to itself.

◆ send

int(* net_l2::send) (struct net_if *iface, struct net_pkt *pkt)

This function is used by net core to push a packet to lower layer (interface's L2), which in turn might work on the packet relevantly. (adding proper header etc...) Returns a negative error code, or the number of bytes sent otherwise.


The documentation for this struct was generated from the following file: