nas_messages_types.h 10.8 KB
Newer Older
gauthier's avatar
Licence    
gauthier committed
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
/*******************************************************************************
    OpenAirInterface
    Copyright(c) 1999 - 2014 Eurecom

    OpenAirInterface is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.


    OpenAirInterface is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with OpenAirInterface.The full GNU General Public License is
   included in this distribution in the file called "COPYING". If not,
   see <http://www.gnu.org/licenses/>.

  Contact Information
  OpenAirInterface Admin: openair_admin@eurecom.fr
  OpenAirInterface Tech : openair_tech@eurecom.fr
  OpenAirInterface Dev  : openair4g-devel@eurecom.fr

  Address      : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.

 *******************************************************************************/
Cedric Roux's avatar
   
Cedric Roux committed
29
#include "as_message.h"
winckel's avatar
winckel committed
30
#include "nas_message.h"
Cedric Roux's avatar
   
Cedric Roux committed
31
32
33
34

#ifndef NAS_MESSAGES_TYPES_H_
#define NAS_MESSAGES_TYPES_H_

35
36
#define NAS_DL_EMM_RAW_MSG(mSGpTR)                  (mSGpTR)->ittiMsg.nas_dl_emm_raw_msg
#define NAS_UL_EMM_RAW_MSG(mSGpTR)                  (mSGpTR)->ittiMsg.nas_ul_emm_raw_msg
winckel's avatar
winckel committed
37

38
39
40
41
#define NAS_DL_EMM_PROTECTED_MSG(mSGpTR)            (mSGpTR)->ittiMsg.nas_dl_emm_protected_msg
#define NAS_UL_EMM_PROTECTED_MSG(mSGpTR)            (mSGpTR)->ittiMsg.nas_ul_emm_protected_msg
#define NAS_DL_EMM_PLAIN_MSG(mSGpTR)                (mSGpTR)->ittiMsg.nas_dl_emm_plain_msg
#define NAS_UL_EMM_PLAIN_MSG(mSGpTR)                (mSGpTR)->ittiMsg.nas_ul_emm_plain_msg
winckel's avatar
winckel committed
42

43
44
45
#define NAS_DL_ESM_RAW_MSG(mSGpTR)                  (mSGpTR)->ittiMsg.nas_dl_esm_raw_msg
#define NAS_UL_ESM_RAW_MSG(mSGpTR)                  (mSGpTR)->ittiMsg.nas_ul_esm_raw_msg

46
47
48
49
#define NAS_DL_ESM_PROTECTED_MSG(mSGpTR)            (mSGpTR)->ittiMsg.nas_dl_esm_protected_msg
#define NAS_UL_ESM_PROTECTED_MSG(mSGpTR)            (mSGpTR)->ittiMsg.nas_ul_esm_protected_msg
#define NAS_DL_ESM_PLAIN_MSG(mSGpTR)                (mSGpTR)->ittiMsg.nas_dl_esm_plain_msg
#define NAS_UL_ESM_PLAIN_MSG(mSGpTR)                (mSGpTR)->ittiMsg.nas_ul_esm_plain_msg
winckel's avatar
winckel committed
50
51
52
53

#define NAS_UL_DATA_IND(mSGpTR)                     (mSGpTR)->ittiMsg.nas_ul_data_ind
#define NAS_DL_DATA_REQ(mSGpTR)                     (mSGpTR)->ittiMsg.nas_dl_data_req
#define NAS_DL_DATA_CNF(mSGpTR)                     (mSGpTR)->ittiMsg.nas_dl_data_cnf
gauthier's avatar
gauthier committed
54
#define NAS_PDN_CONNECTIVITY_REQ(mSGpTR)            (mSGpTR)->ittiMsg.nas_pdn_connectivity_req
55
56
#define NAS_PDN_CONNECTIVITY_RSP(mSGpTR)            (mSGpTR)->ittiMsg.nas_pdn_connectivity_rsp
#define NAS_PDN_CONNECTIVITY_FAIL(mSGpTR)           (mSGpTR)->ittiMsg.nas_pdn_connectivity_fail
winckel's avatar
winckel committed
57
58
59
60
61
62
63
64
65
66
#define NAS_CONN_EST_IND(mSGpTR)                    (mSGpTR)->ittiMsg.nas_conn_est_ind
#define NAS_CONNECTION_ESTABLISHMENT_CNF(mSGpTR)    (mSGpTR)->ittiMsg.nas_conn_est_cnf
#define NAS_BEARER_PARAM(mSGpTR)                    (mSGpTR)->ittiMsg.nas_bearer_param
#define NAS_AUTHENTICATION_REQ(mSGpTR)              (mSGpTR)->ittiMsg.nas_auth_req
#define NAS_AUTHENTICATION_PARAM_REQ(mSGpTR)        (mSGpTR)->ittiMsg.nas_auth_param_req
#define NAS_AUTHENTICATION_PARAM_RSP(mSGpTR)        (mSGpTR)->ittiMsg.nas_auth_param_rsp
#define NAS_AUTHENTICATION_PARAM_FAIL(mSGpTR)       (mSGpTR)->ittiMsg.nas_auth_param_fail

#define NAS_DATA_LENGHT_MAX     256

67
68


winckel's avatar
winckel committed
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
typedef enum {
    EMM_MSG_HEADER = 1,
    EMM_MSG_ATTACH_REQUEST,
    EMM_MSG_ATTACH_ACCEPT,
    EMM_MSG_ATTACH_COMPLETE,
    EMM_MSG_ATTACH_REJECT,
    EMM_MSG_DETACH_REQUEST,
    EMM_MSG_DETACH_ACCEPT,
    EMM_MSG_TRACKING_AREA_UPDATE_REQUEST,
    EMM_MSG_TRACKING_AREA_UPDATE_ACCEPT,
    EMM_MSG_TRACKING_AREA_UPDATE_COMPLETE,
    EMM_MSG_TRACKING_AREA_UPDATE_REJECT,
    EMM_MSG_EXTENDED_SERVICE_REQUEST,
    EMM_MSG_SERVICE_REQUEST,
    EMM_MSG_SERVICE_REJECT,
    EMM_MSG_GUTI_REALLOCATION_COMMAND,
    EMM_MSG_GUTI_REALLOCATION_COMPLETE,
    EMM_MSG_AUTHENTICATION_REQUEST,
    EMM_MSG_AUTHENTICATION_RESPONSE,
    EMM_MSG_AUTHENTICATION_REJECT,
    EMM_MSG_AUTHENTICATION_FAILURE,
    EMM_MSG_IDENTITY_REQUEST,
    EMM_MSG_IDENTITY_RESPONSE,
    EMM_MSG_SECURITY_MODE_COMMAND,
    EMM_MSG_SECURITY_MODE_COMPLETE,
    EMM_MSG_SECURITY_MODE_REJECT,
    EMM_MSG_EMM_STATUS,
    EMM_MSG_EMM_INFORMATION,
    EMM_MSG_DOWNLINK_NAS_TRANSPORT,
    EMM_MSG_UPLINK_NAS_TRANSPORT,
    EMM_MSG_CS_SERVICE_NOTIFICATION,
} emm_message_ids_t;

102
103


winckel's avatar
winckel committed
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
typedef enum {
    ESM_MSG_HEADER = 1,
    ESM_MSG_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST,
    ESM_MSG_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT,
    ESM_MSG_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT,
    ESM_MSG_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST,
    ESM_MSG_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT,
    ESM_MSG_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT,
    ESM_MSG_MODIFY_EPS_BEARER_CONTEXT_REQUEST,
    ESM_MSG_MODIFY_EPS_BEARER_CONTEXT_ACCEPT,
    ESM_MSG_MODIFY_EPS_BEARER_CONTEXT_REJECT,
    ESM_MSG_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST,
    ESM_MSG_DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT,
    ESM_MSG_PDN_CONNECTIVITY_REQUEST,
    ESM_MSG_PDN_CONNECTIVITY_REJECT,
    ESM_MSG_PDN_DISCONNECT_REQUEST,
    ESM_MSG_PDN_DISCONNECT_REJECT,
    ESM_MSG_BEARER_RESOURCE_ALLOCATION_REQUEST,
    ESM_MSG_BEARER_RESOURCE_ALLOCATION_REJECT,
    ESM_MSG_BEARER_RESOURCE_MODIFICATION_REQUEST,
    ESM_MSG_BEARER_RESOURCE_MODIFICATION_REJECT,
    ESM_MSG_ESM_INFORMATION_REQUEST,
    ESM_MSG_ESM_INFORMATION_RESPONSE,
    ESM_MSG_ESM_STATUS,
} esm_message_ids_t;

130
131


winckel's avatar
winckel committed
132
133
134
135
136
typedef struct nas_raw_msg_s {
    uint32_t                        lenght;
    uint8_t                         data[NAS_DATA_LENGHT_MAX];
} nas_raw_msg_t;

137
138


winckel's avatar
winckel committed
139
140
141
142
143
144
typedef struct nas_emm_plain_msg_s {
    emm_message_ids_t               present;
    EMM_msg                         choice;

} nas_emm_plain_msg_t;

145
146


winckel's avatar
winckel committed
147
148
149
150
151
152
typedef struct nas_emm_protected_msg_s {
    nas_message_security_header_t   header;
    emm_message_ids_t               present;
    EMM_msg                         choice;
} nas_emm_protected_msg_t;

153

winckel's avatar
winckel committed
154
155
156
157
158
159
typedef struct nas_esm_plain_msg_s {
    esm_message_ids_t               present;
    ESM_msg                         choice;

} nas_esm_plain_msg_t;

160

winckel's avatar
winckel committed
161
162
163
164
165
typedef struct nas_esm_protected_msg_s {
    nas_message_security_header_t   header;
    esm_message_ids_t               present;
    ESM_msg                         choice;
} nas_esm_protected_msg_t;
166

167

winckel's avatar
winckel committed
168
typedef struct nas_paging_ind_s {
winckel's avatar
winckel committed
169

Cedric Roux's avatar
   
Cedric Roux committed
170
171
} nas_paging_ind_t;

172

gauthier's avatar
gauthier committed
173
typedef struct nas_pdn_connectivity_req_s {
174
175
176
177
178
179
180
181
182
183
    int                    pti;   // nas ref  Identity of the procedure transaction executed to activate the PDN connection entry
    unsigned               ue_id; // nas ref
    char                   imsi[16];
    uint8_t                imsi_length;
    network_qos_t          qos;
    OctetString            apn;
    OctetString            pdn_addr;
    int                    pdn_type;
    void                  *proc_data;
    int                    request_type;
gauthier's avatar
gauthier committed
184
185
186
} nas_pdn_connectivity_req_t;


187
188
189
190
191
192
193
194
195
196
197
198
199
200
typedef struct nas_pdn_connectivity_rsp_s {
    int                     pti;   // nas ref  Identity of the procedure transaction executed to activate the PDN connection entry
    unsigned                ue_id; // nas ref
    network_qos_t           qos;
    OctetString             apn;
    OctetString             pdn_addr;
    int                     pdn_type;
    void                   *proc_data;
    int                     request_type;

    unsigned                eNB_ue_s1ap_id:24;
    uint32_t                mme_ue_s1ap_id;

    /* Key eNB */
201
    //uint8_t                 keNB[32];
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226

    ambr_t                  ambr;
    ambr_t                  apn_ambr;

    /* EPS bearer ID */
    unsigned                ebi:4;

    /* QoS */
    qci_t                   qci;
    priority_level_t        prio_level;
    pre_emp_vulnerability_t pre_emp_vulnerability;
    pre_emp_capability_t    pre_emp_capability;

    /* S-GW TEID for user-plane */
    Teid_t                  sgw_s1u_teid;
    /* S-GW IP address for User-Plane */
    ip_address_t            sgw_s1u_address;
} nas_pdn_connectivity_rsp_t;


typedef struct nas_pdn_connectivity_fail_s {
    unsigned                ue_id; // nas ref
} nas_pdn_connectivity_fail_t;


winckel's avatar
winckel committed
227
typedef struct nas_conn_est_ind_s {
Cedric Roux's avatar
   
Cedric Roux committed
228
229
230
231
232
233
234
235
    nas_establish_ind_t nas;

    /* Transparent message from s1ap to be forwarded to MME_APP or
     * to S1AP if connection establishment is rejected by NAS.
     */
    s1ap_initial_ue_message_t transparent;
} nas_conn_est_ind_t;

236

237
238
typedef nas_establish_rsp_t nas_conn_est_rej_t;

239

240
#if defined(DISABLE_USE_NAS)
241
242
243
244
245
246
247
typedef struct nas_conn_est_cnf_s {
    uint32_t ue_id;

    nas_establish_cnf_t nas_establish_cnf;
    /* Transparent message from MME_APP to S1AP */
    s1ap_initial_ctxt_setup_req_t transparent;
} nas_conn_est_cnf_t;
248
249
250
#else
typedef nas_establish_cnf_t nas_conn_est_cnf_t;
#endif
251

Cedric Roux's avatar
   
Cedric Roux committed
252

winckel's avatar
winckel committed
253
typedef struct nas_conn_rel_ind_s {
254

Cedric Roux's avatar
   
Cedric Roux committed
255
256
} nas_conn_rel_ind_t;

257
258
259
typedef ul_info_transfer_ind_t nas_ul_data_ind_t;
typedef dl_info_transfer_req_t nas_dl_data_req_t;
typedef dl_info_transfer_cnf_t nas_dl_data_cnf_t;
Cedric Roux's avatar
   
Cedric Roux committed
260

261

winckel's avatar
winckel committed
262
typedef struct nas_non_del_ind_s {
263

Cedric Roux's avatar
   
Cedric Roux committed
264
265
} nas_non_del_ind_t;

winckel's avatar
winckel committed
266
typedef struct nas_rab_est_req_s {
267

Cedric Roux's avatar
   
Cedric Roux committed
268
269
} nas_rab_est_req_t;

270

winckel's avatar
winckel committed
271
typedef struct nas_rab_est_rsp_s {
272

Cedric Roux's avatar
   
Cedric Roux committed
273
274
} nas_rab_est_rsp_t;

275

winckel's avatar
winckel committed
276
typedef struct nas_rab_rel_req_s {
277

Cedric Roux's avatar
   
Cedric Roux committed
278
279
} nas_rab_rel_req_t;

280

winckel's avatar
winckel committed
281
typedef struct nas_attach_req_s {
Cedric Roux's avatar
   
Cedric Roux committed
282
283
284
285
286
287
288
289
    /* TODO: Set the correct size */
    char apn[100];
    char imsi[16];
#define INITIAL_REQUEST (0x1)
    unsigned initial:1;
    s1ap_initial_ue_message_t transparent;
} nas_attach_req_t;

290

winckel's avatar
winckel committed
291
typedef struct nas_auth_req_s {
Cedric Roux's avatar
Cedric Roux committed
292
    /* UE imsi */
Cedric Roux's avatar
   
Cedric Roux committed
293
294
295
296
297
298
299
300
    char imsi[16];

#define NAS_FAILURE_OK  0x0
#define NAS_FAILURE_IND 0x1
    unsigned failure:1;
    int cause;
} nas_auth_req_t;

301

winckel's avatar
winckel committed
302
typedef struct nas_auth_resp_s {
Cedric Roux's avatar
   
Cedric Roux committed
303
304
305
    char imsi[16];
} nas_auth_resp_t;

Cedric Roux's avatar
Cedric Roux committed
306
typedef struct nas_auth_param_req_s {
307
308
309
310
311
312
    /* UE identifier */
    uint32_t ue_id;

    /* Imsi of the UE (In case of initial request) */
    char     imsi[16];
    uint8_t  imsi_length;
Cedric Roux's avatar
Cedric Roux committed
313

314
315
    /* Indicates whether the procedure corresponds to a new connection or not */
    uint8_t  initial_req:1;
316

317
318
    uint8_t  re_synchronization:1;
    uint8_t  auts[14];
Cedric Roux's avatar
Cedric Roux committed
319
320
} nas_auth_param_req_t;

321

322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
typedef struct nas_auth_param_rsp_s {
    /* UE identifier */
    uint32_t ue_id;

    /* For future use: nb of vectors provided */
    uint8_t nb_vectors;

    /* Consider only one E-UTRAN vector for the moment... */
    eutran_vector_t vector;
} nas_auth_param_rsp_t;

typedef struct nas_auth_param_fail_s {
    /* UE identifier */
    uint32_t    ue_id;

    /* S6A mapped to NAS cause */
    nas_cause_t cause;
} nas_auth_param_fail_t;

341

342
#if defined(DISABLE_USE_NAS)
Cedric Roux's avatar
Cedric Roux committed
343
typedef struct nas_attach_accept_s {
344
    s1ap_initial_ctxt_setup_req_t transparent;
Cedric Roux's avatar
Cedric Roux committed
345
} nas_attach_accept_t;
346
#endif
Cedric Roux's avatar
Cedric Roux committed
347

Cedric Roux's avatar
   
Cedric Roux committed
348
#endif /* NAS_MESSAGES_TYPES_H_ */