summaryrefslogtreecommitdiff
path: root/cesar/cp2/msg/inc/msg_drv.h
blob: 31bc00dd98db271a7572dd7ff143a50cec0bcb2d (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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#ifndef cp2_msg_inc_msg_drv_h
#define cp2_msg_inc_msg_drv_h
/* Cesar project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cp2/msg/inc/msg_drv.h
 * \brief   DRV family MME.
 * \ingroup cp2_msg
 */

/** Result of a DRV family request. */
enum cp_msg_drv_result_t
{
    CP_MSG_DRV_RESULT_SUCCESS,
    CP_MSG_DRV_RESULT_FAILURE,
    CP_MSG_DRV_RESULT_NB,
};
typedef enum cp_msg_drv_result_t cp_msg_drv_result_t;

BEGIN_DECLS

/**
 * Receive a DRV_STA_SET_MAC_ADDR.REQ.
 * \param  ctx  control plane context
 * \param  mme  MME handle
 * \param  mac  received mac address
 * \return  true on success
 */
bool
cp_msg_drv_sta_set_mac_addr_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
                                         mac_t *mac);

/**
 * Receive a DRV_STA_SET_CCO_PREF.REQ.
 * \param  ctx  control plane context
 * \param  mme  MME handle
 * \param  cco_pref  received CCo preferred flag
 * \return  true on success
 */
bool
cp_msg_drv_sta_set_cco_pref_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
                                         bool *cco_pref);

/**
 * Receive a DRV_STA_SET_WAS_CCO.REQ.
 * \param  ctx  control plane context
 * \param  mme  MME handle
 * \param  was_cco  received was CCo flag
 * \return  true on success
 */
bool
cp_msg_drv_sta_set_was_cco_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
                                        bool *was_cco);

/**
 * Receive a DRV_STA_SET_NPW.REQ.
 * \param  ctx  control plane context
 * \param  mme  MME handle
 * \param  npw  received NPW
 * \return  true on success
 */
bool
cp_msg_drv_sta_set_npw_req_receive (cp_t *ctx, cp_mme_rx_t *mme, char *npw);

/**
 * Receive a DRV_STA_SET_DPW.REQ.
 * \param  ctx  control plane context
 * \param  mme  MME handle
 * \param  dpw  received device password
 * \return  true on success
 */
bool
cp_msg_drv_sta_set_dpw_req_receive (cp_t *ctx, cp_mme_rx_t *mme, char *dpw);

/**
 * Receive a DRV_STA_SET_SL.REQ.
 * \param  ctx  control plane context
 * \param  mme  MME handle
 * \param  sl  received SL
 * \return  true on success
 */
bool
cp_msg_drv_sta_set_sl_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
                                   cp_security_level_t *sl);

/**
 * Receive a DRV_STA_SET_NID.REQ.
 * \param  ctx  control plane context
 * \param  mme  MME handle
 * \param  nid  received NID
 * \return  true on success
 */
bool
cp_msg_drv_sta_set_nid_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
                                    cp_nid_t *nid);

/**
 * Receive a DRV_STA_SET_M_STA_HFID.REQ.
 * \param  ctx  control plane context
 * \param  mme  MME handle
 * \param  m_sta_hfid  received manufacturer STA HFID
 * \return  true on success
 */
bool
cp_msg_drv_sta_set_m_sta_hfid_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
                                           char *m_sta_hfid);

/**
 * Receive a DRV_STA_SET_U_STA_HFID.REQ.
 * \param  ctx  control plane context
 * \param  mme  MME handle
 * \param  u_sta_hfid  received user STA HFID
 * \return  true on success
 */
bool
cp_msg_drv_sta_set_u_sta_hfid_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
                                           char *u_sta_hfid);

/**
 * Receive a DRV_STA_SET_AVLN_HFID.REQ.
 * \param  ctx  control plane context
 * \param  mme  MME handle
 * \param  avln_hfid  received AVLN HFID
 * \return  true on success
 */
bool
cp_msg_drv_sta_set_avln_hfid_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
                                          char *avln_hfid);

/**
 * Receive a DRV_STA_SET_TONEMASK.REQ.
 * \param  ctx  control plane context
 * \param  mme  MME handle
 * \param  tonemask  received tonemask
 * \return  true on success
 */
bool
cp_msg_drv_sta_set_tonemask_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
                                         u8 *tonemask);

/**
 * Receive a DRV_STA_MAC_START.REQ.
 * \param  ctx  control plane context
 * \param  mme  MME handle
 * \return  true on success
 */
bool
cp_msg_drv_sta_mac_start_req_receive (cp_t *ctx, cp_mme_rx_t *mme);

/**
 * Receive a DRV_STA_MAC_STOP.REQ.
 * \param  ctx  control plane context
 * \param  mme  MME handle
 * \return  true on success
 */
bool
cp_msg_drv_sta_mac_stop_req_receive (cp_t *ctx, cp_mme_rx_t *mme);

/**
 * Send a DRV_....CNF, works for any DRV messages.
 * \param  ctx  control plane context
 * \param  peer  peer information
 * \param  mmtype  MMTYPE to respond to
 * \param  result  result code
 */
void
cp_msg_drv_any_cnf_send (cp_t *ctx, cp_mme_peer_t *peer, cp_mmtype_t mmtype,
                         cp_msg_drv_result_t result);

END_DECLS

#endif /* cp2_msg_inc_msg_drv_h */