summaryrefslogtreecommitdiff
path: root/cesar/cl/cl_mactotei.h
diff options
context:
space:
mode:
authordufour2009-10-07 13:11:06 +0000
committerdufour2009-10-07 13:11:06 +0000
commitc6bc0e9140f76a3d5e240bd869ce41c5d26b67c9 (patch)
treec54eecb349518487531d14a0b2fcdb73befd9bd1 /cesar/cl/cl_mactotei.h
parent6fc2cee78fa5f2ead6a39d34da4bef457e740b75 (diff)
cesar/cl/mactotei: clean mac to tei table module
Clean comments to remove mistakes. Fix parameters checks. Move trace where it should be to correctly log what is happening. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@5992 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cl/cl_mactotei.h')
-rw-r--r--cesar/cl/cl_mactotei.h77
1 files changed, 46 insertions, 31 deletions
diff --git a/cesar/cl/cl_mactotei.h b/cesar/cl/cl_mactotei.h
index b6f0c6e227..6c043e6cf0 100644
--- a/cesar/cl/cl_mactotei.h
+++ b/cesar/cl/cl_mactotei.h
@@ -10,16 +10,26 @@
* }}} */
/**
* \file cl/cl_mactotei.h
- * \brief MAC to TEI table interface between the CL and the CP
+ * \brief MAC to TEI table interface between the CL and the CP.
* \ingroup cl
*
- * The MAC to TEI table associate a MAC address to a TEI and a tag. The tag is
- * used to know if the entry is bridged entry or not (in case of a bridge
- * entry, the tag will correspond to the entry acting as a bridge for this MAC
- * address).
+ * The MAC to TEI table associates a MAC address with a TEI and a tag.
+ * Basically, the first purpose of the table is to know the TEI corresponding
+ * to a MAC address. As this table also handle the MAC addresses that are
+ * bridged, the tag inform you what kind of entry it is.
+ *
+ * They are three tags:
+ * - TEI MAP: the entry has been added from the successful decoding of a TEI
+ * MAP MME,
+ * - BRIDGE INFO: the entry has been added from the successful decoding of a
+ * BRIDGE INFO MME,
+ * - discover: the entry has been added from a received bridged traffic that
+ * we have discovered. In this case, the tag contains the expiration date of
+ * the entry.
*/
#include "cl/cl.h"
+#include "lib/mac_lookup_table.h"
/**
* Sorted MAC to TEI table.
@@ -41,38 +51,41 @@ BEGIN_DECLS
* \return a pointer to the new block to be fill with the mac to tei table
* data
*/
-cl_mactotei_blk_t *cl_mactotei_new (void);
+cl_mactotei_blk_t *
+cl_mactotei_new (void);
/**
- * Add a new tupple of data to the table.
+ * Add a new tupple (Mac address, TEI) to the MAC to TEI table.
*
- * \param table the table pointer to add a new mac to tei correspondance.
- * \param mac_addr the mac addr to add
- * \param tei the tei corresponding to the STA.
- * \param tag the CP tag provide to indentifier a network.
+ * \param table the non-sorted MAC to TEI table.
+ * \param mac_addr the mac addr to add.
+ * \param tei the TEI corresponding to the MAC address.
+ * \param tag a tag provided by the CP.
*/
-void cl_mactotei_addr_add (cl_mactotei_blk_t *table, mac_t mac_addr,
- uint tei, uint tag);
+void
+cl_mactotei_addr_add (cl_mactotei_blk_t *table, mac_t mac_addr,
+ uint tei, uint tag);
/**
- * Request the CL to copy all the data corresponding to the tag and the tei.
+ * Request the CL to copy all the entries from the actual MAC to TEI table
+ * corresponding to a TEI and a tag to the new one.
*
- * \param ctx the cl context.
- * \param table the mactotei new table to fill
- * \param tei the tei to copy.
- * \param tag the tag to copy
+ * \param ctx the CL context.
+ * \param table the new MAC to TEI table to fill.
+ * \param tei the corresponding TEI entries to copy.
+ * \param tag the corresponding tag entries to copy.
*/
void
-cl_mactotei_copy_tei_and_tag (cl_t *ctx,
- cl_mactotei_blk_t *table, u8 tei, u8 tag);
+cl_mactotei_copy_tei_and_tag (cl_t *ctx, cl_mactotei_blk_t *table,
+ uint tei, uint tag);
/**
- * Find a mac address in the table using a dichotomy search
+ * Find a mac address in the table using a dichotomy search.
*
- * \param ctx the convergence layer context.
- * \param mac the mac address to find
- * \return the tei corresponding to the mac address if known otherwise it
- * returns 0x0 if tei not found
+ * \param ctx the CL context.
+ * \param mac the mac address to look for.
+ * \return the TEI corresponding to the mac address if the entry exists.
+ * Otherwise, it returns MAC_TEI_UNASSOCIATED.
*/
uint
cl_mactotei_table_find_tei_from_mac (cl_t *ctx, mac_t mac);
@@ -80,7 +93,7 @@ cl_mactotei_table_find_tei_from_mac (cl_t *ctx, mac_t mac);
/**
* Request the CL to use the new table and remove the old one.
*
- * \param ctx the CL context
+ * \param ctx the CL context.
* \param table the new table to use.
*/
void
@@ -91,11 +104,13 @@ cl_mactotei_use_table (cl_t *ctx, cl_mactotei_blk_t *table);
*
* \param ctx the convergence layer context
*/
-void cl_mactotei_release_table (cl_t *ctx);
+void
+cl_mactotei_release_table (cl_t *ctx);
/**
- * Copy all the entries in the table except the ones with a specific tag.
- * \param ctx the convergence layer context
+ * Copy all the entries from the current MAC to TEI table except the ones with
+ * a specific tag.
+ * \param ctx the CL context.
* \param table the table where to add copied entries.
* \param tag the matching tag.
*
@@ -103,11 +118,11 @@ void cl_mactotei_release_table (cl_t *ctx);
* MAC lookup table by removing all the "old" one.
*/
void
-cl_mactotei_copy_except_tag (cl_t *ctx, cl_mactotei_blk_t *table, u8 tag);
+cl_mactotei_copy_except_tag (cl_t *ctx, cl_mactotei_blk_t *table, uint tag);
/**
* Cancel the creation of a table.
- * \param table the table to cancel the creation.
+ * \param table the table to cancel.
*
* This function is quite like \see cl_mactotei_release_table. The difference,
* is that it takes a block as argument and not a table. You should use this