lwIP
2.1.0
Lightweight IP stack
|
Modules | |
Options | |
FDB example code | |
Data Structures | |
struct | bridgeif_initdata_s |
Macros | |
#define | BRIDGEIF_INITDATA1(max_ports, max_fdb_dynamic_entries, max_fdb_static_entries, ethaddr) {ethaddr, max_ports, max_fdb_dynamic_entries, max_fdb_static_entries} |
#define | BRIDGEIF_INITDATA2(max_ports, max_fdb_dynamic_entries, max_fdb_static_entries, e0, e1, e2, e3, e4, e5) {{e0, e1, e2, e3, e4, e5}, max_ports, max_fdb_dynamic_entries, max_fdb_static_entries} |
Typedefs | |
typedef struct bridgeif_initdata_s | bridgeif_initdata_t |
Functions | |
err_t | bridgeif_fdb_add (struct netif *bridgeif, const struct eth_addr *addr, bridgeif_portmask_t ports) |
err_t | bridgeif_fdb_remove (struct netif *bridgeif, const struct eth_addr *addr) |
err_t | bridgeif_init (struct netif *netif) |
err_t | bridgeif_add_port (struct netif *bridgeif, struct netif *portif) |
This file implements an IEEE 802.1D bridge by using a multilayer netif approach (one hardware-independent netif for the bridge that uses hardware netifs for its ports). On transmit, the bridge selects the outgoing port(s). On receive, the port netif calls into the bridge (via its netif->input function) and the bridge selects the port(s) (and/or its netif->input function) to pass the received pbuf to.
Usage:
#define BRIDGEIF_INITDATA1 | ( | max_ports, | |
max_fdb_dynamic_entries, | |||
max_fdb_static_entries, | |||
ethaddr | |||
) | {ethaddr, max_ports, max_fdb_dynamic_entries, max_fdb_static_entries} |
Use this for constant initialization of a bridgeif_initdat_t (ethaddr must be passed as ETH_ADDR())
#define BRIDGEIF_INITDATA2 | ( | max_ports, | |
max_fdb_dynamic_entries, | |||
max_fdb_static_entries, | |||
e0, | |||
e1, | |||
e2, | |||
e3, | |||
e4, | |||
e5 | |||
) | {{e0, e1, e2, e3, e4, e5}, max_ports, max_fdb_dynamic_entries, max_fdb_static_entries} |
Use this for constant initialization of a bridgeif_initdat_t (each byte of ethaddr must be passed)
typedef struct bridgeif_initdata_s bridgeif_initdata_t |
Initialisation data for bridgeif_init. An instance of this type must be passed as parameter 'state' to netif_add when the bridge is added.
err_t bridgeif_fdb_add | ( | struct netif * | bridgeif, |
const struct eth_addr * | addr, | ||
bridgeif_portmask_t | ports | ||
) |
Add a static entry to the forwarding database. A static entry marks where frames to a specific eth address (unicast or group address) are forwarded. bits [0..(BRIDGEIF_MAX_PORTS-1)]: hw ports bit [BRIDGEIF_MAX_PORTS]: cpu port 0: drop
Remove a static entry from the forwarding database
Initialization function passed to netif_add().
ATTENTION: A pointer to a bridgeif_initdata_t must be passed as 'state' to netif_add when adding the bridge. I supplies MAC address and controls memory allocation (number of ports, FDB size).
netif | the lwip network interface structure for this ethernetif |