summaryrefslogtreecommitdiff
path: root/cl/cl_mactotei.h
blob: 4f74b62bf510f769f30a9ecf1a97d876229b9fc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef CL_MACTOTEI_H_
#define CL_MACTOTEI_H_

/* Cesar project {{{
 *
 * Copyright (C) 2007 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cl/cl_mactotei.h
 * \brief   mac to tei table interface between the CL and the CP
 * \ingroup cl
 * 
 */ 

#include "cl/cl.h"

typedef struct cl_mactotei_table_t cl_mactotei_table_t;
typedef struct cl_mactotei_blk_t cl_mactotei_blk_t;
typedef struct cl_mactotei_t cl_mactotei_t;

/**
 * Create a new table to be filled by the CP.
 * 
 * \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);

/**
 * Request the CL to copy all the data without the coresponding one provide in
 * this function paramater.
 * 
 * \param  table_old  the table actually use by the CL
 * \param  table  the mactotei new table to fill
 * \param  tag  the tag to exclude from the copy
 */
void cl_mactotei_copy (cl_mactotei_table_t *table_old,
        cl_mactotei_blk_t *table, u8 tag);

/**
 * Add a new tupple of data to the 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.
 */
void cl_mactotei_addr_add (cl_mactotei_blk_t *table, mac_t mac_addr,
        uint tei, uint tag);

/**
 * Copy all the lines of the CL mactotei table to the table provided in 
 * paramter without all the lines which the tag corresponds to the parameter
 * tag.
 * 
 * Sample : cl_mactotei_copy_table_excluding_tag (cl, table, 2), will copy all 
 * the mac to tei lines of the CL table without those where the tag value is 2.
 * 
 * \param  ctx  the convergence layer context
 * \param  table  the mactotei new table to fill
 * \param  tag  the tag to exclude from the copy
 */
void cl_mactotei_copy_table_excluding_tag (cl_t *ctx,
        cl_mactotei_blk_t *table, u8 tag);

/**
 * Request the CL to use the new table and remove the old one.
 * 
 * \param  ctx  the CL context
 * \param  table  the new table to use.  
 */
void cl_mactotei_use_table (cl_t *ctx, cl_mactotei_blk_t *table);

/**
 * Release the complete table from the memory.
 * 
 * \param  ctx  the convergence layer context
 */
void cl_mactotei_release_table (cl_t *ctx);

#endif /*CL_MACTOTEI_H_*/