This file implements an example for an FDB (Forwarding DataBase)
◆ bridgeif_fdb_age_one_second()
static void bridgeif_fdb_age_one_second |
( |
void * |
fdb_ptr | ) |
|
|
static |
Aging implementation of our simple fdb
Definition at line 153 of file bridgeif_fdb.c.
154{
158
161
164 if (
e->used &&
e->ts) {
166
167 if (
e->used &&
e->ts) {
170 }
171 }
173 }
174 }
176}
#define BRIDGEIF_READ_UNPROTECT(lev)
#define BRIDGEIF_DECL_PROTECT(lev)
#define BRIDGEIF_READ_PROTECT(lev)
#define BRIDGEIF_WRITE_UNPROTECT(lev)
#define BRIDGEIF_WRITE_PROTECT(lev)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
bridgeif_dfdb_entry_t * fdb
Referenced by bridgeif_age_tmr().
◆ bridgeif_fdb_get_dst_ports()
Walk our list of auto-learnt fdb entries and return a port to forward or BR_FLOOD if unknown
Definition at line 128 of file bridgeif_fdb.c.
129{
136 if (
e->used &&
e->ts) {
141 }
142 }
143 }
146}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
◆ bridgeif_fdb_init()
void * bridgeif_fdb_init |
( |
u16_t |
max_fdb_entries | ) |
|
Init our simple fdb list
Definition at line 195 of file bridgeif_fdb.c.
196{
200 LWIP_ASSERT(
"alloc_len == alloc_len_sizet", alloc_len == alloc_len_sizet);
205 }
208
210
211 return fdb;
212}
struct bridgeif_dfdb_s bridgeif_dfdb_t
#define BRIDGEIF_AGE_TIMER_MS
static void bridgeif_age_tmr(void *arg)
void * mem_calloc(mem_size_t count, mem_size_t size)
#define LWIP_DEBUGF(debug, message)
#define LWIP_ASSERT(message, assertion)
◆ bridgeif_fdb_update_src()
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 mac address.
ATTENTION: This is meant as an example only, in real-world use, you should provide a better implementation :-)
Definition at line 76 of file bridgeif_fdb.c.
77{
84 if (
e->used &&
e->ts) {
87 src_addr->addr[0], src_addr->addr[1], src_addr->addr[2], src_addr->addr[3], src_addr->addr[4], src_addr->addr[5],
94 return;
95 }
96 }
97 }
98
101 if (!
e->used || !
e->ts) {
103
104 if (!
e->used || !
e->ts) {
106 src_addr->addr[0], src_addr->addr[1], src_addr->addr[2], src_addr->addr[3], src_addr->addr[4], src_addr->addr[5],
114 return;
115 }
117 }
118 }
120
121}
#define BR_FDB_TIMEOUT_SEC
#define BRIDGEIF_FDB_DEBUG
#define memcpy(s1, s2, n)