Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
|
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_if * | eth_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. | |
Ethernet Bridging API .
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.
br | Pointer to bridge context instance |
user_data | User supplied data |
struct net_if * eth_bridge_get_by_index | ( | int | index | ) |
#include <zephyr/net/ethernet_bridge.h>
Get bridge instance according to index.
index | Bridge instance index |
int eth_bridge_get_index | ( | struct net_if * | br | ) |
#include <zephyr/net/ethernet_bridge.h>
Get bridge index according to pointer.
br | Pointer to bridge instance |
#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.
br | A pointer to a bridge interface |
iface | Interface to add |
#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.
br | A pointer to a bridge interface |
iface | Interface to remove |
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.
cb | Callback to call for each bridge instance |
user_data | User supplied data |