Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Network L2 structure. More...

#include <net_l2.h>

Data Fields

enum net_verdict(* 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.
 
int(* 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.
 
int(* enable )(struct net_if *iface, bool state)
 This function is used to enable/disable traffic over a network interface.
 
enum net_l2_flags(* get_flags )(struct net_if *iface)
 Return L2 flags for the network interface.
 

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: