Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Ethernet Bridging API

Ethernet Bridging API . More...

Typedefs

typedef void(* eth_bridge_cb_t) (struct eth_bridge_iface_context *br, void *user_data)
 Callback used while iterating over bridge instances.
 

Functions

int eth_bridge_iface_add (struct net_if *br, struct net_if *iface)
 Add an Ethernet network interface to a bridge.
 
int eth_bridge_iface_remove (struct net_if *br, struct net_if *iface)
 Remove an Ethernet network interface from a bridge.
 
int eth_bridge_get_index (struct net_if *br)
 Get bridge index according to pointer.
 
struct net_ifeth_bridge_get_by_index (int index)
 Get bridge instance according to index.
 
void net_eth_bridge_foreach (eth_bridge_cb_t cb, void *user_data)
 Go through all the bridge context instances in order to get information about them.
 

Detailed Description

Ethernet Bridging API .

Since
2.7
Version
0.8.0

Typedef Documentation

◆ eth_bridge_cb_t

typedef void(* eth_bridge_cb_t) (struct eth_bridge_iface_context *br, void *user_data)

#include <zephyr/net/ethernet_bridge.h>

Callback used while iterating over bridge instances.

Parameters
brPointer to bridge context instance
user_dataUser supplied data

Function Documentation

◆ eth_bridge_get_by_index()

struct net_if * eth_bridge_get_by_index ( int index)

#include <zephyr/net/ethernet_bridge.h>

Get bridge instance according to index.

Parameters
indexBridge instance index
Returns
Pointer to bridge interface or NULL if not found.

◆ eth_bridge_get_index()

int eth_bridge_get_index ( struct net_if * br)

#include <zephyr/net/ethernet_bridge.h>

Get bridge index according to pointer.

Parameters
brPointer to bridge instance
Returns
Bridge index

◆ eth_bridge_iface_add()

int eth_bridge_iface_add ( struct net_if * br,
struct net_if * iface )

#include <zephyr/net/ethernet_bridge.h>

Add an Ethernet network interface to a bridge.

This adds a network interface to a bridge. The interface is then put into promiscuous mode. After more than one Ethernet interfaces are added to the bridge interface, the bridge interface is setup. After the setup is done, the bridge interface can be brought up so that it can start bridging L2 traffic.

Parameters
brA pointer to a bridge interface
ifaceInterface to add
Returns
0 if OK, negative error code otherwise.

◆ eth_bridge_iface_remove()

int eth_bridge_iface_remove ( struct net_if * br,
struct net_if * iface )

#include <zephyr/net/ethernet_bridge.h>

Remove an Ethernet network interface from a bridge.

If the bridge interface setup has only one Ethernet interface left after this function call, the bridge is disabled as it cannot bridge the L2 traffic any more. The bridge interface is left in UP state if this case.

Parameters
brA pointer to a bridge interface
ifaceInterface to remove
Returns
0 if OK, negative error code otherwise.

◆ net_eth_bridge_foreach()

void net_eth_bridge_foreach ( eth_bridge_cb_t cb,
void * user_data )

#include <zephyr/net/ethernet_bridge.h>

Go through all the bridge context instances in order to get information about them.

This is mainly useful in net-shell to print data about currently active bridges.

Parameters
cbCallback to call for each bridge instance
user_dataUser supplied data