summaryrefslogtreecommitdiff
path: root/cesar/cp/cp.h
blob: 32fff78cc266c0cc057c71275665530021a23a39 (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
#ifndef cp_cp_h
#define cp_cp_h
/* Cesar project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cp/cp.h
 * \brief   Control plane public API's.
 * \ingroup cp
 *
 */
#include "cp/types.h"

#include "mac/common/config.h"
#include "mac/pbproc/pbproc.h"
#include "mac/sar/sar.h"
#include "interface/forward.h"
#include "hal/timer/timer.h"
#include "cl/cl.h"
#include "ce/rx/forward.h"
#include "bsu/beacon/beacon.h"
#include "bsu/aclf/aclf.h"
#include "bsu/bsu.h"

BEGIN_DECLS

/**
 * Initialise the Control plane.
 * \param  bsu  the bsu context.
 * \param  aclf  the bsu aclf context.
 * \param  mac_config  Mac configuration context.
 * \param  interface  Interface context.
 * \param  hal_timer  the HAL timer context.
 * \param  pbproc  the PBProcessing context.
 * \param  mac_store  the mac store context.
 * \param  sar  the SAR context.
 * \param  cl  the CL context.
 * \param  seed  the seed to initialise the random generator.
 * \return  The control plane context.
 *
 */
cp_t *
cp_init (bsu_t *bsu, bsu_aclf_t* aclf, mac_config_t * mac_config,
         interface_t * interface, hal_timer_t *hal_timer, pbproc_t *pbproc,
         mac_store_t *mac_store, sar_t *sar, cl_t *cl, ce_rx_t *ce_rx,
         bufmgr_t *bufmgr, u32 seed);

/**
 * Initialise the control plane context.
 * \param  ctx  the module context.
 *
 */
void
cp_uninit (cp_t *ctx);

/**
 * Compute the NID and the NMK from the network password.
 * \param  ctx  the CP context.
 * \param  npw  the network password.
 * \param  sl the security level of the station.
 *
 * This function will generate the NID and the NMK from the NPW and store it
 * in the station own data.
 */
void
cp_compute_nmk_and_nid_from_npw (cp_t *ctx, const char *npw,
                                 cp_security_level_t sl);

END_DECLS

#endif /* cp_h */