Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
 4.1.99
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

Network Interface Device structure. More...

#include <net_if.h>

Data Fields

const struct devicedev
 The actually device driver instance the net_if is related to.
 
const struct net_l2 *const l2
 Interface's L2 layer.
 
void * l2_data
 Interface's private L2 data pointer.
 
atomic_t flags [ATOMIC_BITMAP_SIZE(NET_IF_NUM_FLAGS)]
 For internal use.
 
struct net_linkaddr link_addr
 The hardware link address.
 
uint16_t mtu
 The hardware MTU.
 
enum net_if_oper_state oper_state
 RFC 2863 operational status.
 
int64_t oper_state_change_time
 Last time the operational state was changed.
 

Detailed Description

Network Interface Device structure.

Used to handle a network interface on top of a device driver instance. There can be many net_if_dev instance against the same device.

Such interface is mainly to be used by the link layer, but is also tight to a network context: it then makes the relation with a network context and the network device.

Because of the strong relationship between a device driver and such network interface, each net_if_dev should be instantiated by one of the network device init macros found in net_if.h.

Field Documentation

◆ dev

const struct device* net_if_dev::dev

The actually device driver instance the net_if is related to.

◆ flags

atomic_t net_if_dev::flags[ATOMIC_BITMAP_SIZE(NET_IF_NUM_FLAGS)]

For internal use.

◆ l2

const struct net_l2* const net_if_dev::l2

Interface's L2 layer.

◆ l2_data

void* net_if_dev::l2_data

Interface's private L2 data pointer.

◆ link_addr

struct net_linkaddr net_if_dev::link_addr

The hardware link address.

◆ mtu

uint16_t net_if_dev::mtu

The hardware MTU.

◆ oper_state

enum net_if_oper_state net_if_dev::oper_state

RFC 2863 operational status.

◆ oper_state_change_time

int64_t net_if_dev::oper_state_change_time

Last time the operational state was changed.

This is used to determine how long the interface has been in the current operational state.

This value is set to 0 when the interface is created, and then updated whenever the operational state changes.

The value is in milliseconds since boot.


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