summaryrefslogtreecommitdiff
path: root/cp2/sta/data/own_data.h
blob: 2865cd13462df20cbfea4c9200ec45a038c45a0b (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#ifndef cp2_sta_data_own_data_h
#define cp2_sta_data_own_data_h
/* Cesar project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cp2/sta/data/own_data.h
 * \brief   Station own data.
 * \ingroup cp_sta_data 
 *
 * Structure containing the station own data.
 */

#include "cp2/defs.h"
#include "cp2/sta/data/inc/own_data.h"

/** Waning When storing data bigger than one word, think about the access. */

struct cp_sta_own_data
{
    /** Private part only usable with the accessor defined below. */
    cp_sta_own_data_private private;

    /** NID. */
    u64 nid;
    /** NMK. */
    u8 nmk[NMK_SIZE];
    /** Network password. */
    u8 npw[MAX_NPW_SIZE];
    /** Devide password. */
    u8 dpw[MAX_DPW_SIZE];


    /** CCo prefered status. */
    bool cco_prefered;
    /** Was CCo status. */
    bool was_cco;


    /** Manufacturer Human identifier. */
    u8 hfid_manu[HFID_SIZE];
    /** User HFID. */
    u8 hfid_user[HFID_SIZE];
    /** Avln HFID. */
    u8 hfid_avln[HFID_SIZE];
};
typedef struct cp_sta_own_data cp_sta_own_data;

/** Initialise the sta own data 
 * \param  ctx  the CP context.
 */
void
cp_sta_data_own_init (cp_t *ctx);

/** Uninitialise the sta own data.
 * \param  ctx  the cp context.
 */
void
cp_sta_data_own_uninit (cp_t *ctx);

/** Set the Mac address of the sta.
 * \param  ctx  the CP context.
 * \param  mac  the mac address of the station.
 *
 * This function will update the mac config to update the mac address in it.
 */
void
cp_sta_data_own_set_mac_address (cp_t *ctx);

/** Get the Mac address of the sta.
 * \param  ctx  the CP context.
 * \return  the station's mac address.
 */
mac_t
cp_sta_data_own_get_mac_address (cp_t *ctx);

/** Set the TEI of the station.
 * \param  ctx  the cp context.
 * \param  tei  the station's tei.
 *
 * This function will update the mac config.
 */
void
cp_sta_data_own_set_tei (cp_t *ctx, u8 tei);

/** Get the station's tei.
 * \param  ctx  the CP context.
 * \return  the station's tei.
 */
u8
cp_sta_data_own_get_tei (cp_t *ctx);

/** Set the station Security level.
 * \param  ctx  the CP context.
 * \param  sl  the security level policy.
 */
void
cp_sta_data_own_set_security_level (cp_t *ctx, u8 sl);

/** Get the security level.
 * \param  ctx  the CP context.
 * \return  the station's security level.
 */
u8
cp_sta_data_own_get_security_level (cp_t *ctx);

#endif /* cp2_sta_data_own_data_h */