mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 18:14:53 +00:00
Improve documentation on bridgeif_fdb
This commit is contained in:
parent
b3a379c239
commit
4f2dc05c7c
@ -35,6 +35,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup bridgeif_fdb FDB example code
|
||||||
|
* @ingroup bridgeif
|
||||||
|
* This file implements an example for an FDB (Forwarding DataBase)
|
||||||
|
*/
|
||||||
|
|
||||||
#include "netif/bridgeif.h"
|
#include "netif/bridgeif.h"
|
||||||
#include "lwip/sys.h"
|
#include "lwip/sys.h"
|
||||||
#include "lwip/timeouts.h"
|
#include "lwip/timeouts.h"
|
||||||
@ -56,7 +62,9 @@ typedef struct bridgeif_dfdb_s {
|
|||||||
bridgeif_dfdb_entry_t *fdb;
|
bridgeif_dfdb_entry_t *fdb;
|
||||||
} bridgeif_dfdb_t;
|
} bridgeif_dfdb_t;
|
||||||
|
|
||||||
/** A real simple and slow implementation of an auto-learning forwarding database that
|
/**
|
||||||
|
* @ingroup bridgeif_fdb
|
||||||
|
* A real simple and slow implementation of an auto-learning forwarding database that
|
||||||
* remembers known src mac addresses to know which port to send frames destined for that
|
* remembers known src mac addresses to know which port to send frames destined for that
|
||||||
* mac address.
|
* mac address.
|
||||||
*
|
*
|
||||||
@ -111,7 +119,10 @@ bridgeif_fdb_update_src(void *fdb_ptr, struct eth_addr *src_addr, u8_t port_idx)
|
|||||||
/* not found, no free entry -> flood */
|
/* not found, no free entry -> flood */
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Walk our list of auto-learnt fdb entries and return a port to forward or BR_FLOOD if unknown */
|
/**
|
||||||
|
* @ingroup bridgeif_fdb
|
||||||
|
* Walk our list of auto-learnt fdb entries and return a port to forward or BR_FLOOD if unknown
|
||||||
|
*/
|
||||||
bridgeif_portmask_t
|
bridgeif_portmask_t
|
||||||
bridgeif_fdb_get_dst_ports(void *fdb_ptr, struct eth_addr *dst_addr)
|
bridgeif_fdb_get_dst_ports(void *fdb_ptr, struct eth_addr *dst_addr)
|
||||||
{
|
{
|
||||||
@ -133,7 +144,10 @@ bridgeif_fdb_get_dst_ports(void *fdb_ptr, struct eth_addr *dst_addr)
|
|||||||
return BR_FLOOD;
|
return BR_FLOOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Aging implementation of our simple fdb */
|
/**
|
||||||
|
* @ingroup bridgeif_fdb
|
||||||
|
* Aging implementation of our simple fdb
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
bridgeif_fdb_age_one_second(void *fdb_ptr)
|
bridgeif_fdb_age_one_second(void *fdb_ptr)
|
||||||
{
|
{
|
||||||
@ -172,7 +186,10 @@ bridgeif_age_tmr(void *arg)
|
|||||||
sys_timeout(BRIDGEIF_AGE_TIMER_MS, bridgeif_age_tmr, arg);
|
sys_timeout(BRIDGEIF_AGE_TIMER_MS, bridgeif_age_tmr, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Init our simple fdb list */
|
/**
|
||||||
|
* @ingroup bridgeif_fdb
|
||||||
|
* Init our simple fdb list
|
||||||
|
*/
|
||||||
void *
|
void *
|
||||||
bridgeif_fdb_init(u16_t max_fdb_entries)
|
bridgeif_fdb_init(u16_t max_fdb_entries)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user