summaryrefslogtreecommitdiff
path: root/cesar/cl/inc/cl.h
blob: 1b3cdbd2ce2061ecbc50bb99a1efd2c4325f1dfe (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
#ifndef CL_INC_CL_H_
#define CL_INC_CL_H_

/* Cesar project {{{
 *
 * Copyright (C) 2007 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cl/inc/cl.h
 * \brief   private function for the CL
 * \ingroup cl/inc
 * 
 */

#include "cl/cl_mactotei.h"
#include "cl/inc/context.h"

/**
 * Init the MME module of the CL.
 * 
 * \param  ctx  the mme context.
 */
void cl_mme_init (cl_mme_t *ctx);

/**
 * Swith the old mactotei table with the new one.
 * 
 * \param  cl  the convergence layer context
 * \param  table  the table to switch
 */
void cl_mactotei_switch_table (cl_t *cl, cl_mactotei_table_t *table);

/**
 * Find a mac address in the table using a dichotomy search
 * 
 * \param  cl  the convergence layer context.
 * \param  mac  the mac address to find
 * \return  the tei corresponding to the mac address if known otherwise it 
 * returns 0xff a broadcast tei (see HPAV section 5.3.1.2)
 */
uint cl_mactotei_table_find_tei_from_mac (cl_t *cl, mac_t mac);

/**
 * Search for the lid in the classifier
 * 
 * \param  cl  CL context
 * \param  bcast  put true if the link is a bcast one, false otherwise.
 * \param  tei  the tei found previously by the mactotei table.
 * \param  acs  put true if the link should be process by the acs
 * \param  drop put true if the data should be drop.
 */
uint cl_classifer_get_lid (cl_t *cl, uint tei, bool *bcast, bool *acs,
        bool *drop);



/**
 * Send a data once the TEI has been find.
 *
 * \param  ctx  the cl context.
 * \param  buffer  the buffer containing the data to send.
 * \param  length  the buffer data length.
 * \param  tei  the tei found from the cl_mactotei list.
 */
void
cl_data_send_with_tei (cl_t *cl, u8 *buffer, uint length, uint tei);
 
#endif /*CL_INC_CL_H_*/