#ifndef cl_brg_rx_h #define cl_brg_rx_h /* Cesar project {{{ * * Copyright (C) 2011 Spidcom * * <<>> * * }}} */ /** * \file cl/brg_rx.h * \brief RX bridge Table for data only. * \ingroup cl * * Allow the CL to learn the source mac address of the packets received and * associate it with the TEI of the MFS. Those entries should be added in the * mac to TEI table by a non real time process. * An entry is invalid if it is not present in the CM_BRG_TABLE sent by * the associated station. */ /** Number of entries for the temporary RX bridge table. */ #define CL_BRG_RX_ENTRY_NB 10 struct cl_brg_rx_entry_t { /** Mac address. */ mac_t mac; /** TEI associated with the mac address bridged. */ uint tei; }; typedef struct cl_brg_rx_entry_t cl_brg_rx_entry_t; struct cl_brg_rx_t { /** Number of entries. */ uint nb_entry; /** Table of entries. */ cl_brg_rx_entry_t entry[CL_BRG_RX_ENTRY_NB]; }; typedef struct cl_brg_rx_t cl_brg_rx_t; BEGIN_DECLS /** * Add an entry to the table. * \param ctx the module context. * \param mac the source mac address. * \param tei the TEI associated. */ void cl_brg_rx_add (cl_t *ctx, mac_t smac, uint tei); /** * Get the table. * \param ctx the module context. * \return the table. * * This function will return the temporary table stored in a dynamic blk, the * client is responsible for releasing the block. Once the table is returned, * the CL will not use it anymore, if it receives a new Mac address bridged it * will create a new table. */ cl_brg_rx_t * cl_brg_rx_get (cl_t *ctx); /** * Release the Bridge RX table. * \param ctx the module context. * * The bridge table is destroyed and the CL will create another one to add new * bridged entries. */ void cl_brg_rx_release (cl_t *ctx); END_DECLS #endif /* cl_brg_rx_h */