epan/dissectors/pidl/samr/samr.cnf cnf_dissect_lsa_BinaryString => lsarpc_dissect_str...
[wireshark-sm.git] / epan / dissectors / packet-nas_eps.c
blobb1f1e38e725663de0cd7b37f453746a973d7f75f
1 /* packet-nas_eps.c
2 * Routines for Non-Access-Stratum (NAS) protocol for Evolved Packet System (EPS) dissection
4 * Copyright 2008 - 2020, Anders Broman <anders.broman@ericsson.com>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
12 * References: 3GPP TS 24.301 V18.7.0 (2024-06)
15 #include "config.h"
17 #include <epan/packet.h>
18 #include <epan/tfs.h>
19 #include <epan/unit_strings.h>
20 #include <epan/asn1.h>
21 #include <epan/prefs.h>
22 #include <epan/expert.h>
23 #include <epan/exceptions.h>
24 #include <epan/show_exception.h>
25 #include <epan/to_str.h>
26 #include <epan/proto_data.h>
27 #include <wsutil/array.h>
28 #include <wsutil/pow2.h>
29 #include <wsutil/pint.h>
30 #include "packet-gsm_map.h"
31 #include "packet-gsm_a_common.h"
32 #include "packet-lcsap.h"
33 #include "packet-lpp.h"
35 void proto_register_nas_eps(void);
36 void proto_reg_handoff_nas_eps(void);
38 #define PNAME "Non-Access-Stratum (NAS)PDU"
39 #define PSNAME "NAS-EPS"
40 #define PFNAME "nas-eps"
42 /* Initialize the protocol and registered fields */
43 static int proto_nas_eps;
45 /* Dissector handles */
46 static dissector_handle_t gsm_a_dtap_handle;
47 static dissector_handle_t lpp_handle;
48 static dissector_handle_t nbifom_handle;
49 static dissector_handle_t ipv4_handle;
50 static dissector_handle_t ipv6_handle;
51 static dissector_handle_t non_ip_data_handle;
52 static dissector_handle_t ethernet_handle;
54 /* Forward declaration */
55 static void dissect_nas_eps_esm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset);
56 static void dissect_nas_eps_emm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, bool second_header);
58 static int hf_nas_eps_msg_emm_type;
59 int hf_nas_eps_common_elem_id;
60 int hf_nas_eps_emm_elem_id;
61 static int hf_nas_eps_bearer_id;
62 static int hf_nas_eps_spare_bits;
63 static int hf_nas_eps_spare_b7;
64 static int hf_nas_eps_security_header_type;
65 static int hf_nas_eps_msg_auth_code;
66 static int hf_nas_eps_seq_no;
67 static int hf_nas_eps_ciphered_msg;
68 static int hf_nas_eps_msg_elems;
69 static int hf_nas_eps_seq_no_short;
70 static int hf_nas_eps_emm_ebi0;
71 static int hf_nas_eps_emm_ebi1;
72 static int hf_nas_eps_emm_ebi2;
73 static int hf_nas_eps_emm_ebi3;
74 static int hf_nas_eps_emm_ebi4;
75 static int hf_nas_eps_emm_ebi5;
76 static int hf_nas_eps_emm_ebi6;
77 static int hf_nas_eps_emm_ebi7;
78 static int hf_nas_eps_emm_ebi8;
79 static int hf_nas_eps_emm_ebi9;
80 static int hf_nas_eps_emm_ebi10;
81 static int hf_nas_eps_emm_ebi11;
82 static int hf_nas_eps_emm_ebi12;
83 static int hf_nas_eps_emm_ebi13;
84 static int hf_nas_eps_emm_ebi14;
85 static int hf_nas_eps_emm_ebi15;
86 static int hf_nas_eps_emm_dl_nas_cnt;
87 static int hf_nas_eps_emm_nonce_mme;
88 static int hf_nas_eps_emm_nonce;
89 static int hf_nas_eps_emm_paging_id;
90 static int hf_nas_eps_emm_nbiot_allowed_value;
91 static int hf_nas_eps_emm_eps_optim_info;
92 static int hf_nas_eps_emm_eutran_allowed_value;
93 static int hf_nas_eps_emm_eps_att_type;
94 static int hf_nas_eps_emm_cp_ciot;
95 static int hf_nas_eps_emm_er_wo_pdn;
96 static int hf_nas_eps_emm_esr_ps;
97 static int hf_nas_eps_emm_cs_lcs;
98 static int hf_nas_eps_emm_epc_lcs;
99 static int hf_nas_eps_emm_emc_bs;
100 static int hf_nas_eps_emm_ims_vops;
101 static int hf_nas_eps_emm_15_bearers;
102 static int hf_nas_eps_emm_iwkn26;
103 static int hf_nas_eps_emm_restrict_dcnr;
104 static int hf_nas_eps_emm_restrict_ec;
105 static int hf_nas_eps_emm_epco;
106 static int hf_nas_eps_emm_hc_cp_ciot;
107 static int hf_nas_eps_emm_s1_u_data;
108 static int hf_nas_eps_emm_up_ciot;
109 static int hf_nas_eps_emm_edc;
110 static int hf_nas_eps_emm_ptcc;
111 static int hf_nas_eps_emm_pr;
112 static int hf_nas_eps_emm_rpr;
113 static int hf_nas_eps_emm_piv;
114 static int hf_nas_eps_emm_ncr;
115 static int hf_nas_eps_emm_nas_key_set_id;
116 static int hf_nas_eps_tsc;
117 static int hf_nas_eps_emm_odd_even;
118 static int hf_nas_eps_emm_type_of_id;
119 static int hf_nas_eps_emm_mme_grp_id;
120 static int hf_nas_eps_emm_imei;
121 static int hf_nas_eps_emm_mme_code;
122 static int hf_nas_eps_emm_m_tmsi;
123 static int hf_nas_eps_esm_msg_cont;
124 static int hf_nas_eps_esm_imeisv_req;
125 static int hf_nas_eps_emm_toi;
126 static int hf_nas_eps_emm_toc;
127 static int hf_nas_eps_emm_EPS_attach_result;
128 static int hf_nas_eps_emm_spare_half_octet;
129 static int hf_nas_eps_emm_add_upd_res;
130 static int hf_nas_eps_emm_pnb_ciot;
131 static int hf_nas_eps_emm_saf;
132 static int hf_nas_eps_emm_add_upd_type;
133 static int hf_nas_eps_emm_res;
134 static int hf_nas_eps_emm_sms_services_status;
135 static int hf_nas_eps_emm_csfb_resp;
136 static int hf_nas_eps_emm_cause;
137 static int hf_nas_eps_emm_id_type2;
138 static int hf_nas_eps_emm_short_mac;
139 static int hf_nas_eps_emm_tai_tol;
140 static int hf_nas_eps_emm_tai_n_elem;
141 static int hf_nas_eps_emm_tai_tac;
142 static int hf_nas_eps_emm_eea0;
143 static int hf_nas_eps_emm_128eea1;
144 static int hf_nas_eps_emm_128eea2;
145 static int hf_nas_eps_emm_eea3;
146 static int hf_nas_eps_emm_eea4;
147 static int hf_nas_eps_emm_eea5;
148 static int hf_nas_eps_emm_eea6;
149 static int hf_nas_eps_emm_eea7;
150 static int hf_nas_eps_emm_eia0;
151 static int hf_nas_eps_emm_128eia1;
152 static int hf_nas_eps_emm_128eia2;
153 static int hf_nas_eps_emm_eia3;
154 static int hf_nas_eps_emm_eia4;
155 static int hf_nas_eps_emm_eia5;
156 static int hf_nas_eps_emm_eia6;
157 static int hf_nas_eps_emm_eps_upip;
158 static int hf_nas_eps_emm_uea0;
159 static int hf_nas_eps_emm_uea1;
160 static int hf_nas_eps_emm_uea2;
161 static int hf_nas_eps_emm_uea3;
162 static int hf_nas_eps_emm_uea4;
163 static int hf_nas_eps_emm_uea5;
164 static int hf_nas_eps_emm_uea6;
165 static int hf_nas_eps_emm_uea7;
166 static int hf_nas_eps_emm_ucs2_supp;
167 static int hf_nas_eps_emm_uia1;
168 static int hf_nas_eps_emm_uia2;
169 static int hf_nas_eps_emm_uia3;
170 static int hf_nas_eps_emm_uia4;
171 static int hf_nas_eps_emm_uia5;
172 static int hf_nas_eps_emm_uia6;
173 static int hf_nas_eps_emm_uia7;
174 static int hf_nas_eps_emm_gea1;
175 static int hf_nas_eps_emm_gea2;
176 static int hf_nas_eps_emm_gea3;
177 static int hf_nas_eps_emm_gea4;
178 static int hf_nas_eps_emm_gea5;
179 static int hf_nas_eps_emm_gea6;
180 static int hf_nas_eps_emm_gea7;
181 static int hf_eps_emm_ext_emerg_num_list_eenlv;
182 static int hf_eps_emm_ext_emerg_num_list_emerg_num_len;
183 static int hf_eps_emm_ext_emerg_num_list_emerg_num;
184 static int hf_eps_emm_ext_emerg_num_list_sub_serv_field_len;
185 static int hf_eps_emm_ext_emerg_num_list_sub_serv_field;
186 static int hf_nas_eps_emm_prose_dd_cap;
187 static int hf_nas_eps_emm_prose_cap;
188 static int hf_nas_eps_emm_h245_ash_cap;
189 static int hf_nas_eps_emm_acc_csfb_cap;
190 static int hf_nas_eps_emm_lpp_cap;
191 static int hf_nas_eps_emm_lcs_cap;
192 static int hf_nas_eps_emm_1xsrvcc_cap;
193 static int hf_nas_eps_emm_nf_cap;
194 static int hf_nas_eps_emm_epco_cap;
195 static int hf_nas_eps_emm_hc_cp_ciot_cap;
196 static int hf_nas_eps_emm_er_wo_pdn_cap;
197 static int hf_nas_eps_emm_s1u_data_cap;
198 static int hf_nas_eps_emm_up_ciot_cap;
199 static int hf_nas_eps_emm_cp_ciot_cap;
200 static int hf_nas_eps_emm_prose_relay_cap;
201 static int hf_nas_eps_emm_prose_dc_cap;
202 static int hf_nas_eps_15_bearers_cap;
203 static int hf_nas_eps_sgc_cap;
204 static int hf_nas_eps_n1mode_cap;
205 static int hf_nas_eps_dcnr_cap;
206 static int hf_nas_eps_cp_backoff_cap;
207 static int hf_nas_eps_restrict_ec_cap;
208 static int hf_nas_eps_v2x_pc5_cap;
209 static int hf_nas_eps_multiple_drb_cap;
210 static int hf_nas_eps_rpr_cap;
211 static int hf_nas_eps_piv_cap;
212 static int hf_nas_eps_ncr_cap;
213 static int hf_nas_eps_v2x_nr_pc5_cap;
214 static int hf_nas_eps_up_mt_edt_cap;
215 static int hf_nas_eps_cp_mt_edt_cap;
216 static int hf_nas_eps_wsua_cap;
217 static int hf_nas_eps_racs_cap;
218 static int hf_nas_eps_rclin_cap;
219 static int hf_nas_eps_edc_cap;
220 static int hf_nas_eps_ptcc_cap;
221 static int hf_nas_eps_pr_cap;
222 static int hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg;
223 static int hf_nas_eps_emm_ss_code;
224 static int hf_nas_eps_emm_lcs_ind;
225 static int hf_nas_eps_emm_gen_msg_cont_type;
226 static int hf_nas_eps_esm_apn_ambr_ul;
227 static int hf_nas_eps_esm_apn_ambr_dl;
228 static int hf_nas_eps_esm_apn_ambr_ul_ext;
229 static int hf_nas_eps_esm_apn_ambr_dl_ext;
230 static int hf_nas_eps_esm_apn_ambr_ul_ext2;
231 static int hf_nas_eps_esm_apn_ambr_dl_ext2;
232 static int hf_nas_eps_esm_apn_ambr_ul_total;
233 static int hf_nas_eps_esm_apn_ambr_dl_total;
234 static int hf_nas_eps_emm_guti_type;
235 static int hf_nas_eps_hash_mme;
236 static int hf_nas_eps_replayed_nas_msg_cont;
237 static int hf_nas_eps_redir_policy;
238 static int hf_nas_eps_emm_5g_ea0;
239 static int hf_nas_eps_emm_128_5g_ea1;
240 static int hf_nas_eps_emm_128_5g_ea2;
241 static int hf_nas_eps_emm_128_5g_ea3;
242 static int hf_nas_eps_emm_5g_ea4;
243 static int hf_nas_eps_emm_5g_ea5;
244 static int hf_nas_eps_emm_5g_ea6;
245 static int hf_nas_eps_emm_5g_ea7;
246 static int hf_nas_eps_emm_5g_ea8;
247 static int hf_nas_eps_emm_5g_ea9;
248 static int hf_nas_eps_emm_5g_ea10;
249 static int hf_nas_eps_emm_5g_ea11;
250 static int hf_nas_eps_emm_5g_ea12;
251 static int hf_nas_eps_emm_5g_ea13;
252 static int hf_nas_eps_emm_5g_ea14;
253 static int hf_nas_eps_emm_5g_ea15;
254 static int hf_nas_eps_emm_5g_ia0;
255 static int hf_nas_eps_emm_128_5g_ia1;
256 static int hf_nas_eps_emm_128_5g_ia2;
257 static int hf_nas_eps_emm_128_5g_ia3;
258 static int hf_nas_eps_emm_5g_ia4;
259 static int hf_nas_eps_emm_5g_ia5;
260 static int hf_nas_eps_emm_5g_ia6;
261 static int hf_nas_eps_emm_5g_ia7;
262 static int hf_nas_eps_emm_5g_ia8;
263 static int hf_nas_eps_emm_5g_ia9;
264 static int hf_nas_eps_emm_5g_ia10;
265 static int hf_nas_eps_emm_5g_ia11;
266 static int hf_nas_eps_emm_5g_ia12;
267 static int hf_nas_eps_emm_5g_ia13;
268 static int hf_nas_eps_emm_5g_ia14;
269 static int hf_nas_eps_emm_5g_ia15;
270 static int hf_nas_eps_emm_cipher_key;
271 static int hf_nas_eps_emm_ciph_key_data_ciphering_set_id;
272 static int hf_nas_eps_emm_ciph_key_data_ciphering_key;
273 static int hf_nas_eps_emm_ciph_key_data_c0_len;
274 static int hf_nas_eps_emm_ciph_key_data_c0;
275 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_1;
276 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_2;
277 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_3;
278 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_4;
279 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_5;
280 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_6;
281 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_7;
282 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_1;
283 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_2;
284 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_3;
285 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_4;
286 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_5;
287 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_6;
288 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_7;
289 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_8;
290 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_9;
291 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_10;
292 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_11;
293 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_12;
294 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_13;
295 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_14;
296 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_15;
297 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_16;
298 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_17;
299 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_18;
300 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_19;
301 static int hf_nas_eps_emm_ciph_key_data_pos_sib_type_3_1;
302 static int hf_nas_eps_emm_ciph_key_data_validity_start_time;
303 static int hf_nas_eps_emm_ciph_key_data_validity_duration;
304 static int hf_nas_eps_emm_ciph_key_data_tais_list_len;
305 static int hf_nas_eps_emm_detach_req_UL;
306 static int hf_nas_eps_emm_detach_req_DL;
307 static int hf_nas_eps_emm_switch_off;
308 static int hf_nas_eps_emm_detach_type_UL;
309 static int hf_nas_eps_emm_detach_type_DL;
310 static int hf_nas_eps_emm_5g_ehc_cp_ciot;
311 static int hf_nas_eps_emm_5gs_pnb_ciot;
312 static int hf_nas_eps_emm_5g_up_ciot;
313 static int hf_nas_eps_emm_5g_hc_cp_ciot;
314 static int hf_nas_eps_emm_n3_data;
315 static int hf_nas_eps_emm_5g_cp_ciot;
316 static int hf_nas_eps_emm_ue_radio_cap_id_available;
317 static int hf_nas_eps_emm_ue_radio_cap_id_request;
318 static int hf_nas_eps_emm_wus_assist_info_type;
319 static int hf_nas_eps_emm_wus_assist_info_ue_paging_prob;
320 static int hf_nas_eps_emm_nb_s1_drx_param;
321 static int hf_nas_eps_emm_imsi_offset;
322 static int hf_nas_eps_emm_ue_request_type;
323 static int hf_nas_eps_emm_paging_restriction_type;
324 static int hf_nas_eps_emm_paging_restriction_ebi7;
325 static int hf_nas_eps_emm_paging_restriction_ebi6;
326 static int hf_nas_eps_emm_paging_restriction_ebi5;
327 static int hf_nas_eps_emm_paging_restriction_ebi4;
328 static int hf_nas_eps_emm_paging_restriction_ebi3;
329 static int hf_nas_eps_emm_paging_restriction_ebi2;
330 static int hf_nas_eps_emm_paging_restriction_ebi1;
331 static int hf_nas_eps_emm_paging_restriction_ebi0;
332 static int hf_nas_eps_emm_paging_restriction_ebi15;
333 static int hf_nas_eps_emm_paging_restriction_ebi14;
334 static int hf_nas_eps_emm_paging_restriction_ebi13;
335 static int hf_nas_eps_emm_paging_restriction_ebi12;
336 static int hf_nas_eps_emm_paging_restriction_ebi11;
337 static int hf_nas_eps_emm_paging_restriction_ebi10;
338 static int hf_nas_eps_emm_paging_restriction_ebi9;
339 static int hf_nas_eps_emm_paging_restriction_ebi8;
340 static int hf_nas_eps_emm_paging_restriction_decision;
341 static int hf_nas_eps_emm_unavail_info_suppi;
342 static int hf_nas_eps_emm_unavail_info_updpi;
343 static int hf_nas_eps_emm_unavail_info_type;
344 static int hf_nas_eps_emm_unavail_info_unavail_period_duration;
345 static int hf_nas_eps_emm_unavail_info_start_unavail_period;
346 static int hf_nas_eps_emm_unavail_config_suppi;
347 static int hf_nas_eps_emm_unavail_config_updpi;
348 static int hf_nas_eps_emm_unavail_config_eupr;
349 static int hf_nas_eps_emm_unavail_config_unavail_period_duration;
350 static int hf_nas_eps_emm_unavail_config_start_unavail_period;
351 static int hf_nas_eps_emm_ue_info_req_uclir;
353 static int hf_nas_eps_esm_qci;
354 static int hf_nas_eps_esm_mbr_ul;
355 static int hf_nas_eps_esm_mbr_dl;
356 static int hf_nas_eps_esm_gbr_ul;
357 static int hf_nas_eps_esm_gbr_dl;
358 static int hf_nas_eps_esm_embr_ul;
359 static int hf_nas_eps_esm_embr_dl;
360 static int hf_nas_eps_esm_egbr_ul;
361 static int hf_nas_eps_esm_egbr_dl;
362 static int hf_nas_eps_esm_cause;
363 static int hf_nas_eps_esm_eit;
364 static int hf_nas_eps_esm_notif_ind;
365 static int hf_nas_eps_esm_pdn_type;
366 static int hf_nas_eps_esm_pdn_ipv4;
367 static int hf_nas_eps_esm_pdn_ipv6_if_id;
368 static int hf_nas_eps_esm_eplmnc;
369 static int hf_nas_eps_esm_ratc;
370 static int hf_nas_eps_esm_linked_bearer_id;
371 static int hf_nas_eps_esm_nbifom_cont;
372 static int hf_nas_eps_esm_remote_ue_context_list_nb_ue_contexts;
373 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_len;
374 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_nb_user_id;
375 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_user_id_len;
376 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_odd_even_indic;
377 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_user_id_type;
378 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_encr_imsi;
379 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_msisdn;
380 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_imei;
381 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_imeisv;
382 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_upri4;
383 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_tpri4i;
384 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_address_type;
385 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv4;
386 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_port_number;
387 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv6_prefix;
388 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv4_udp_port_low;
389 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv4_udp_port_high;
390 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv4_tcp_port_low;
391 static int hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv4_tcp_port_high;
392 static int hf_nas_eps_esm_pkmf_address_type;
393 static int hf_nas_eps_esm_pkmf_ipv4;
394 static int hf_nas_eps_esm_pkmf_ipv6;
395 static int hf_nas_eps_esm_hdr_comp_config_prof_0104;
396 static int hf_nas_eps_esm_hdr_comp_config_prof_0103;
397 static int hf_nas_eps_esm_hdr_comp_config_prof_0102;
398 static int hf_nas_eps_esm_hdr_comp_config_prof_0006;
399 static int hf_nas_eps_esm_hdr_comp_config_prof_0004;
400 static int hf_nas_eps_esm_hdr_comp_config_prof_0003;
401 static int hf_nas_eps_esm_hdr_comp_config_prof_0002;
402 static int hf_nas_eps_esm_hdr_compr_config_max_cid;
403 static int hf_nas_eps_esm_hdr_compr_config_add_hdr_compr_cxt_setup_params_type;
404 static int hf_nas_eps_esm_hdr_compr_config_add_hdr_compr_cxt_setup_params_cont;
405 static int hf_nas_eps_esm_ctrl_plane_only_ind_cpoi;
406 static int hf_nas_eps_esm_user_data_cont;
407 static int hf_nas_eps_esm_rel_assist_ind_ddx;
408 static int hf_nas_eps_esm_hdr_compr_config_status_ebi7;
409 static int hf_nas_eps_esm_hdr_compr_config_status_ebi6;
410 static int hf_nas_eps_esm_hdr_compr_config_status_ebi5;
411 static int hf_nas_eps_esm_hdr_compr_config_status_ebi4;
412 static int hf_nas_eps_esm_hdr_compr_config_status_ebi3;
413 static int hf_nas_eps_esm_hdr_compr_config_status_ebi2;
414 static int hf_nas_eps_esm_hdr_compr_config_status_ebi1;
415 static int hf_nas_eps_esm_spare_bits0x0100;
416 static int hf_nas_eps_esm_hdr_compr_config_status_ebi15;
417 static int hf_nas_eps_esm_hdr_compr_config_status_ebi14;
418 static int hf_nas_eps_esm_hdr_compr_config_status_ebi13;
419 static int hf_nas_eps_esm_hdr_compr_config_status_ebi12;
420 static int hf_nas_eps_esm_hdr_compr_config_status_ebi11;
421 static int hf_nas_eps_esm_hdr_compr_config_status_ebi10;
422 static int hf_nas_eps_esm_hdr_compr_config_status_ebi9;
423 static int hf_nas_eps_esm_hdr_compr_config_status_ebi8;
424 static int hf_nas_eps_esm_serv_plmn_rate_ctrl_val;
425 static int hf_nas_eps_esm_ext_apn_ambr_dl_unit;
426 static int hf_nas_eps_esm_ext_apn_ambr_dl;
427 static int hf_nas_eps_esm_ext_apn_ambr_ul_unit;
428 static int hf_nas_eps_esm_ext_apn_ambr_ul;
429 static int hf_nas_eps_esm_ext_mbr_unit;
430 static int hf_nas_eps_esm_ext_mbr_ul;
431 static int hf_nas_eps_esm_ext_mbr_dl;
432 static int hf_nas_eps_esm_ext_gbr_unit;
433 static int hf_nas_eps_esm_ext_gbr_ul;
434 static int hf_nas_eps_esm_ext_gbr_dl;
436 static int hf_nas_eps_active_flg;
437 static int hf_nas_eps_ctrl_plane_serv_type;
438 static int hf_nas_eps_eps_update_result_value;
439 static int hf_nas_eps_eps_update_type_value;
440 static int hf_nas_eps_service_type;
442 static int hf_nas_eps_nas_msg_cont;
443 static int hf_nas_eps_gen_msg_cont;
445 static int hf_nas_eps_cmn_add_info;
446 static int hf_nas_eps_esm_request_type;
448 /* ESM */
449 static int hf_nas_eps_msg_esm_type;
450 int hf_nas_eps_esm_elem_id;
451 static int hf_nas_eps_esm_proc_trans_id;
453 /* Initialize the subtree pointers */
454 static int ett_nas_eps;
455 static int ett_nas_eps_esm_msg_cont;
456 static int ett_nas_eps_nas_msg_cont;
457 static int ett_nas_eps_gen_msg_cont;
458 static int ett_nas_eps_cmn_add_info;
459 static int ett_nas_eps_remote_ue_context;
460 static int ett_nas_eps_esm_user_data_cont;
461 static int ett_nas_eps_replayed_nas_msg_cont;
462 static int ett_nas_eps_ext_emerg_num;
463 static int ett_nas_eps_ciph_data_set;
464 static int ett_nas_eps_wus_assist_info_type;
466 static expert_field ei_nas_eps_extraneous_data;
467 static expert_field ei_nas_eps_unknown_identity;
468 static expert_field ei_nas_eps_unknown_type_of_list;
469 static expert_field ei_nas_eps_wrong_nb_of_elems;
470 static expert_field ei_nas_eps_unknown_msg_type;
471 static expert_field ei_nas_eps_unknown_pd;
472 static expert_field ei_nas_eps_esm_tp_not_integ_prot;
473 static expert_field ei_nas_eps_sec_hdr_wrong_pd;
474 static expert_field ei_nas_eps_missing_mandatory_elemen;
476 /* Global variables */
477 static bool g_nas_eps_dissect_plain;
478 static bool g_nas_eps_null_decipher = true;
479 enum {
480 DECODE_USER_DATA_AS_NONE,
481 DECODE_USER_DATA_AS_IP,
482 DECODE_USER_DATA_AS_NON_IP,
483 DECODE_USER_DATA_AS_ETHERNET
485 static const enum_val_t nas_eps_user_data_container_as_vals[] = {
486 {"none", "None", DECODE_USER_DATA_AS_NONE},
487 {"ip", "IP", DECODE_USER_DATA_AS_IP},
488 {"non_ip","Non IP", DECODE_USER_DATA_AS_NON_IP},
489 {"ethernet","Ethernet", DECODE_USER_DATA_AS_ETHERNET},
490 {NULL, NULL, -1}
492 static int g_nas_eps_decode_user_data_container_as = DECODE_USER_DATA_AS_NONE;
493 static const char *g_nas_eps_non_ip_data_dissector = "";
495 /* Table 9.8.1: Message types for EPS mobility management
496 * 0 1 - - - - - - EPS mobility management messages
498 static const value_string nas_msg_emm_strings[] = {
499 { 0x41, "Attach request"},
500 { 0x42, "Attach accept"},
501 { 0x43, "Attach complete"},
502 { 0x44, "Attach reject"},
503 { 0x45, "Detach request"},
504 { 0x46, "Detach accept"},
506 { 0x48, "Tracking area update request"},
507 { 0x49, "Tracking area update accept"},
508 { 0x4a, "Tracking area update complete"},
509 { 0x4b, "Tracking area update reject"},
511 { 0x4c, "Extended service request"},
512 { 0x4d, "Control plane service request"},
513 { 0x4e, "Service reject"},
514 { 0x4f, "Service accept"},
516 { 0x50, "GUTI reallocation command"},
517 { 0x51, "GUTI reallocation complete"},
518 { 0x52, "Authentication request"},
519 { 0x53, "Authentication response"},
520 { 0x54, "Authentication reject"},
521 { 0x55, "Identity request"},
522 { 0x56, "Identity response"},
523 { 0x5c, "Authentication failure"},
524 { 0x5d, "Security mode command"},
525 { 0x5e, "Security mode complete"},
526 { 0x5f, "Security mode reject"},
528 { 0x60, "EMM status"},
529 { 0x61, "EMM information"},
530 { 0x62, "Downlink NAS transport"},
531 { 0x63, "Uplink NAS transport"},
532 { 0x64, "CS service notification"},
533 { 0x68, "Downlink generic NAS transport"},
534 { 0x69, "Uplink generic NAS transport"},
535 { 0, NULL }
537 static value_string_ext nas_msg_emm_strings_ext = VALUE_STRING_EXT_INIT(nas_msg_emm_strings);
539 /* Table 9.8.2: Message types for EPS session management */
541 static const value_string nas_msg_esm_strings[] = {
542 { 0xc1, "Activate default EPS bearer context request"},
543 { 0xc2, "Activate default EPS bearer context accept"},
544 { 0xc3, "Activate default EPS bearer context reject"},
545 { 0xc5, "Activate dedicated EPS bearer context request"},
546 { 0xc6, "Activate dedicated EPS bearer context accept"},
547 { 0xc7, "Activate dedicated EPS bearer context reject"},
548 { 0xc9, "Modify EPS bearer context request"},
549 { 0xca, "Modify EPS bearer context accept"},
550 { 0xcb, "Modify EPS bearer context reject"},
551 { 0xcd, "Deactivate EPS bearer context request"},
552 { 0xce, "Deactivate EPS bearer context accept"},
553 { 0xd0, "PDN connectivity request"},
554 { 0xd1, "PDN connectivity reject"},
555 { 0xd2, "PDN disconnect request"},
556 { 0xd3, "PDN disconnect reject"},
557 { 0xd4, "Bearer resource allocation request"},
558 { 0xd5, "Bearer resource allocation reject"},
559 { 0xd6, "Bearer resource modification request"},
560 { 0xd7, "Bearer resource modification reject"},
561 { 0xd9, "ESM information request"},
562 { 0xda, "ESM information response"},
563 { 0xdb, "Notification"},
564 { 0xdc, "ESM dummy message"},
565 { 0xe8, "ESM status"},
566 { 0xe9, "Remote UE report"},
567 { 0xea, "Remote UE report response"},
568 { 0xeb, "ESM data transport"},
569 { 0, NULL }
571 static value_string_ext nas_msg_esm_strings_ext = VALUE_STRING_EXT_INIT(nas_msg_esm_strings);
573 static const value_string security_header_type_vals[] = {
574 { 0, "Plain NAS message, not security protected"},
575 { 1, "Integrity protected"},
576 { 2, "Integrity protected and ciphered"},
577 { 3, "Integrity protected with new EPS security context"},
578 { 4, "Integrity protected and ciphered with new EPS security context"},
579 { 5, "Integrity protected and partially ciphered NAS message"},
580 { 6, "Reserved"},
581 { 7, "Reserved"},
582 { 8, "Reserved"},
583 { 9, "Reserved"},
584 { 10, "Reserved"},
585 { 11, "Reserved"},
586 { 12, "Security header for the SERVICE REQUEST message"},
587 { 13, "These values are not used in this version of the protocol."
588 " If received they shall be interpreted as security header for the SERVICE REQUEST message"},
589 { 14, "These values are not used in this version of the protocol."
590 " If received they shall be interpreted as Security header for the SERVICE REQUEST message"},
591 { 15, "These values are not used in this version of the protocol."
592 " If received they shall be interpreted as Security header for the SERVICE REQUEST message"},
593 { 0, NULL }
595 static value_string_ext security_header_type_vals_ext = VALUE_STRING_EXT_INIT(security_header_type_vals);
598 typedef enum
600 DE_EPS_CMN_ADD_INFO, 9.9.2.0 Additional information
601 DE_EPS_CMN_DEVICE_PROPERTIES, 9.9.2.0A Device properties
602 DE_EPS_CMN_EPS_BE_CTX_STATUS, 9.9.2.1 EPS bearer context status
603 DE_EPS_CMN_LOC_AREA_ID, 9.9.2.2 Location area identification
604 DE_EPS_CMN_MOB_ID, 9.9.2.3 Mobile identity
605 DE_EPS_MS_CM_2, 9.9.2.4 Mobile station classmark 2
606 DE_EPS_MS_CM_3, 9.9.2.5 Mobile station classmark 3
607 DE_EPS_NAS_SEC_PAR_FROM_EUTRA, 9.9.2.6 NAS security parameters from E-UTRA
608 DE_EPS_NAS_SEC_PAR_TO_EUTRA, 9.9.2.7 NAS security parameters to E-UTRA
610 DE_EPS_CMN_PLM_LST, 9.9.2.8 PLMN list
611 DE_EPS_CMN_SUP_CODEC_LST, 9.9.2.6 9.9.2.10 Supported codec list
612 DE_EPS_COMMON_NONE NONE
614 nas_eps_common_elem_idx_t;
617 static const value_string nas_eps_common_elem_strings[] = {
618 { DE_EPS_CMN_ADD_INFO, "Additional information" }, /* 9.9.2.0 Additional information */
619 { DE_EPS_CMN_DEVICE_PROPERTIES, "Device properties" }, /* 9.9.2.0A Device properties */
620 { DE_EPS_CMN_EPS_BE_CTX_STATUS, "EPS bearer context status" }, /* 9.9.2.1 EPS bearer context status */
621 { DE_EPS_CMN_LOC_AREA_ID, "Location area identification" }, /* 9.9.2.2 Location area identification */
622 { DE_EPS_CMN_MOB_ID, "Mobile identity" }, /* 9.9.2.3 Mobile identity */
623 { DE_EPS_MS_CM_2, "Mobile station classmark 2" }, /* 9.9.2.4 Mobile station classmark 2 */
624 { DE_EPS_MS_CM_3, "Mobile station classmark 3" }, /* 9.9.2.5 Mobile station classmark 3 */
625 { DE_EPS_NAS_SEC_PAR_FROM_EUTRA, "NAS security parameters from E-UTRA" },/* 9.9.2.6 NAS security parameters from E-UTRA */
626 { DE_EPS_NAS_SEC_PAR_TO_EUTRA, "NAS security parameters to E-UTRA" }, /* 9.9.2.7 NAS security parameters to E-UTRA */
627 { DE_EPS_CMN_PLM_LST, "PLMN list" }, /* 9.9.2.8 PLMN list */
628 /* 9.9.2.9 Spare half octet */
629 { DE_EPS_CMN_SUP_CODEC_LST, "Supported codec list" }, /* 9.9.2.10 Supported codec list */
630 { 0, NULL }
632 value_string_ext nas_eps_common_elem_strings_ext = VALUE_STRING_EXT_INIT(nas_eps_common_elem_strings);
634 /* Utility functions */
635 static uint16_t
636 calc_bitrate(uint8_t value) {
637 uint16_t return_value = value;
639 if ((value > 63) && (value <= 127)) {
640 return_value = 64 + (value - 64) * 8;
642 else if ((value > 127) && (value <= 254)) {
643 return_value = 576 + (value - 128) * 64;
645 else if (value == 0xff) {
646 return_value = 0;
648 return return_value;
650 static uint32_t
651 calc_bitrate_ext(uint8_t value) {
652 uint32_t return_value = 0;
654 if ((value > 0) && (value <= 0x4a)) {
655 return_value = 8600 + value * 100;
657 else if ((value > 0x4a) && (value <= 0xba)) {
658 return_value = 16 + (value-0x4a);
660 else if ((value > 0xba) && (value <= 0xfa)) {
661 return_value = 128 + (value-0xba)*2;
663 else {
664 return_value = 256;
667 return return_value;
669 static uint32_t
670 calc_bitrate_ext2(uint8_t value) {
671 uint32_t return_value = 0;
673 if ((value > 0) && (value <= 0x3d)) {
674 return_value = 256 + value * 4;
676 else if ((value > 0x3d) && (value <= 0xa1)) {
677 return_value = 500 + (value-0x3d) * 10;
679 else if ((value > 0xa1) && (value <= 0xf6)) {
680 return_value = 1500 + (value-0xa1) * 100;
682 else {
683 return_value = 10000;
686 return return_value;
689 #define NUM_NAS_EPS_COMMON_ELEM array_length(nas_eps_common_elem_strings)
690 int ett_nas_eps_common_elem[NUM_NAS_EPS_COMMON_ELEM];
693 * 9.9.2 Common information elements
696 /* 9.9.2.0 Additional information */
697 static uint16_t
698 de_eps_cmn_add_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
699 uint32_t offset, unsigned len,
700 char *add_string _U_, int string_len _U_)
702 proto_item *item;
703 proto_tree *sub_tree;
704 tvbuff_t *new_tvb;
706 item = proto_tree_add_item(tree, hf_nas_eps_cmn_add_info, tvb, offset, len, ENC_NA);
707 sub_tree = proto_item_add_subtree(item, ett_nas_eps_cmn_add_info);
709 new_tvb = tvb_new_subset_length(tvb, offset, len);
711 switch (GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_nas_eps, 0))) {
712 case 1:
713 /* LPP */
714 dissect_lcsap_Correlation_ID_PDU(new_tvb, pinfo, sub_tree, NULL);
715 break;
716 default:
717 break;
720 return len;
724 * 9.9.2.1 EPS bearer context status
726 static const true_false_string nas_eps_emm_ebi_vals = {
727 "BEARER CONTEXT-ACTIVE",
728 "BEARER CONTEXT-INACTIVE"
731 static uint16_t
732 de_eps_cmn_eps_be_ctx_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
733 uint32_t offset, unsigned len _U_,
734 char *add_string _U_, int string_len _U_)
736 uint32_t curr_offset;
738 curr_offset = offset;
740 /* EBI(7) EBI(6) EBI(5) EBI(4) EBI(3) EBI(2) EBI(1) EBI(0) octet 3 */
741 proto_tree_add_item(tree, hf_nas_eps_emm_ebi7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
742 proto_tree_add_item(tree, hf_nas_eps_emm_ebi6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
743 proto_tree_add_item(tree, hf_nas_eps_emm_ebi5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
744 proto_tree_add_item(tree, hf_nas_eps_emm_ebi4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
745 proto_tree_add_item(tree, hf_nas_eps_emm_ebi3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
746 proto_tree_add_item(tree, hf_nas_eps_emm_ebi2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
747 proto_tree_add_item(tree, hf_nas_eps_emm_ebi1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
748 /* EBI(0): Bit 1 of octet 3 is spare and shall be coded as zero. */
749 proto_tree_add_item(tree, hf_nas_eps_emm_ebi0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
750 curr_offset++;
751 /* EBI(15) EBI(14) EBI(13) EBI(12) EBI(11) EBI(10) EBI(9) EBI(8) octet 4 */
752 proto_tree_add_item(tree, hf_nas_eps_emm_ebi15, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
753 proto_tree_add_item(tree, hf_nas_eps_emm_ebi14, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
754 proto_tree_add_item(tree, hf_nas_eps_emm_ebi13, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
755 proto_tree_add_item(tree, hf_nas_eps_emm_ebi12, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
756 proto_tree_add_item(tree, hf_nas_eps_emm_ebi11, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
757 proto_tree_add_item(tree, hf_nas_eps_emm_ebi10, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
758 proto_tree_add_item(tree, hf_nas_eps_emm_ebi9, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
759 proto_tree_add_item(tree, hf_nas_eps_emm_ebi8, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
761 return len;
764 * 9.9.2.2 Location area identification
765 * See subclause 10.5.1.3 in 3GPP TS 24.008 [6].
768 * 9.9.2.3 Mobile identity
769 * See subclause 10.5.1.4 in 3GPP TS 24.008 [6].
770 * exported from gsm_a_common
774 * 9.9.2.4 Mobile station classmark 2
775 * See subclause 10.5.1.6 in 3GPP TS 24.008 [13].
778 * 9.9.2.5 Mobile station classmark 3
779 * See subclause 10.5.1.7 in 3GPP TS 24.008 [13].
783 * 9.9.2.6 NAS security parameters from E-UTRA
785 uint16_t
786 de_emm_sec_par_from_eutra(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
787 uint32_t offset, unsigned len _U_,
788 char *add_string _U_, int string_len _U_)
790 uint32_t curr_offset;
792 curr_offset = offset;
794 /* DL NAS COUNT value (short) (octet 2, bit 1 to 4)
795 * This field contains the 4 least significant bits of the binary representation of the downlink
796 * NAS COUNT value applicable when this information element is sent.
798 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
799 proto_tree_add_item(tree, hf_nas_eps_emm_dl_nas_cnt, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
801 return len;
805 * 9.9.2.7 NAS security parameters to E-UTRA
807 uint16_t
808 de_emm_sec_par_to_eutra(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
809 uint32_t offset, unsigned len _U_,
810 char *add_string _U_, int string_len _U_)
812 uint32_t curr_offset;
814 curr_offset = offset;
815 /* NonceMME value (octet 1 to 5)
816 * This field is coded as the nonce value in the Nonce information element (see subclause 9.9.3.25).
818 proto_tree_add_item(tree, hf_nas_eps_emm_nonce_mme, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
819 curr_offset+=4;
820 /* type of ciphering algorithm (octet 6, bit 5 to 7)
821 * These fields are coded as the type of integrity protection algorithm and type of ciphering algorithm
822 * in the NAS security algorithms information element (see subclause 9.9.3.23).
823 * Bit 4 and 8 of octet 6 are spare and shall be coded as zero.
825 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN);
826 proto_tree_add_item(tree, hf_nas_eps_emm_toc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
827 /* Type of integrity protection algorithm (octet 6, bit 1 to 3)*/
828 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+4, 1, ENC_BIG_ENDIAN);
829 proto_tree_add_item(tree, hf_nas_eps_emm_toi, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
830 curr_offset++;
832 * NAS key set identifier (octet 7, bit 1 to 3) and
833 * type of security context flag (TSC) (octet 7, bit 4)
834 * These fields are coded as the NAS key set identifier and type of security context flag in the
835 * NAS key set identifier information element (see subclause 9.9.3.21).
836 * Bit 5 to 8 of octet 7 are spare and shall be coded as zero.
838 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
839 /* Type of security context flag (TSC) V 1/2 */
840 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, (curr_offset<<3)+4, 1, ENC_BIG_ENDIAN);
841 /* NAS key set identifier */
842 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, (curr_offset<<3)+5, 3, ENC_BIG_ENDIAN);
843 curr_offset++;
844 return len;
848 * 9.9.2.8 PLMN list
849 * See subclause 10.5.1.13 in 3GPP TS 24.008 [6].
852 * 9.9.2.9 Spare half octet
853 * This element is used in the description of EMM and ESM messages when an odd number of
854 * half octet type 1 information elements are used. This element is filled with spare bits
855 * set to zero and is placed in bits 5 to 8 of the octet unless otherwise specified.
856 * Coded Inline
860 * 9.9.2.10 Supported codec list
861 * See subclause 10.5.4.32 in 3GPP TS 24.008 [13].
862 * Dissected in packet-gsm_a_dtap.c
865 uint16_t (*nas_eps_common_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
866 uint32_t offset, unsigned len,
867 char *add_string, int string_len) = {
868 /* 9.9.2 Common information elements */
869 de_eps_cmn_add_info, /* 9.9.2.0 Additional information */
870 NULL, /* 9.9.2.0A Device properties */
871 de_eps_cmn_eps_be_ctx_status, /* 9.9.2.1 EPS bearer context status */
872 de_lai, /* 9.9.2.2 Location area identification */
873 de_mid, /* 9.9.2.3 Mobile identity See subclause 10.5.1.4 in 3GPP TS 24.008*/
874 de_ms_cm_2, /* 9.9.2.4 Mobile station classmark 2 */
875 de_ms_cm_3, /* 9.9.2.5 Mobile station classmark 3 */
876 de_emm_sec_par_from_eutra, /* 9.9.2.6 NAS security parameters from E-UTRA */
877 de_emm_sec_par_to_eutra, /* 9.9.2.7 NAS security parameters to E-UTRA */
879 de_plmn_list, /* 9.9.2.8 PLMN list */
880 NULL, /* 9.9.2.10 Supported codec list (packet-gsm_a_dtap.c) */
881 NULL, /* NONE */
884 static const value_string nas_emm_elem_strings[] = {
885 /* 9.9.3 EPS Mobility Management (EMM) information elements */
886 { DE_EMM_ADD_UPD_RES, "Additional update result" }, /* 9.9.3.0A Additional update result */
887 { DE_EMM_ADD_UPD_TYPE, "Additional update type" }, /* 9.9.3.0B Additional update type */
888 { DE_EMM_AUTH_FAIL_PAR, "Authentication failure parameter" }, /* 9.9.3.1 Authentication failure parameter */
889 { DE_EMM_AUTN, "Authentication parameter AUTN" }, /* 9.9.3.2 Authentication parameter AUTN */
890 { DE_EMM_AUTH_PAR_RAND, "Authentication parameter RAND" }, /* 9.9.3.3 Authentication parameter RAND */
891 { DE_EMM_AUTH_RESP_PAR, "Authentication response parameter" }, /* 9.9.3.4 Authentication response parameter */
892 { DE_EMM_SMS_SERVICES_STATUS, "SMS services status" }, /* 9.9.3.4B SMS services status */
893 { DE_EMM_CSFB_RESP, "CSFB response" }, /* 9.9.3.5 CSFB response */
894 { DE_EMM_DAYL_SAV_T, "Daylight saving time" }, /* 9.9.3.6 Daylight saving time */
895 { DE_EMM_DET_TYPE, "Detach type" }, /* 9.9.3.7 Detach type */
896 { DE_EMM_DRX_PAR, "DRX parameter" }, /* 9.9.3.8 DRX parameter */
897 { DE_EMM_CAUSE, "EMM cause" }, /* 9.9.3.9 EMM cause */
898 { DE_EMM_ATT_RES, "EPS attach result" }, /* 9.9.3.10 EPS attach result */
899 { DE_EMM_ATT_TYPE, "EPS attach type" }, /* 9.9.3.11 EPS attach type */
900 { DE_EMM_EPS_MID, "EPS mobile identity" }, /* 9.9.3.12 EPS mobile identity */
901 { DE_EMM_EPS_NET_FEATURE_SUP, "EPS network feature support" }, /* 9.9.3.12A EPS network feature support */
902 { DE_EMM_EPS_UPD_RES, "EPS update result" }, /* 9.9.3.13 EPS update result */
903 { DE_EMM_EPS_UPD_TYPE, "EPS update type" }, /* 9.9.3.14 EPS update type */
904 { DE_EMM_ESM_MSG_CONT, "ESM message container" }, /* 9.9.3.15 ESM message conta */
905 { DE_EMM_GPRS_TIMER, "GPRS timer" }, /* 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. */
906 { DE_EMM_GPRS_TIMER_2, "GPRS timer 2" }, /* 9.9.3.16A GPRS timer 2, See subclause 10.5.7.4 in 3GPP TS 24.008. */
907 { DE_EMM_GPRS_TIMER_3, "GPRS timer 3" }, /* 9.9.3.16B GPRS timer 3, See subclause 10.5.7.4a in 3GPP TS 24.008. */
908 { DE_EMM_ID_TYPE_2, "Identity type 2" }, /* 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. */
909 { DE_EMM_IMEISV_REQ, "IMEISV request" }, /* 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. */
910 { DE_EMM_KSI_AND_SEQ_NO, "KSI and sequence number" }, /* 9.9.3.19 KSI and sequence number */
911 { DE_EMM_MS_NET_CAP, "MS network capability" }, /* 9.9.3.20 MS network capability ,See subclause 10.5.5.12 in 3GPP TS 24.008 [6]. */
912 { DE_EMM_MS_NET_FEAT_SUP, "MS network feature support" }, /* 9.9.3.20A MS network feature support, See subclause 10.5.1.15 in 3GPP TS 24.008. */
913 { DE_EMM_NAS_KEY_SET_ID, "NAS key set identifier" }, /* 9.9.3.21 NAS key set identifier */
914 { DE_EMM_NAS_MSG_CONT, "NAS message container" }, /* 9.9.3.22 NAS message container */
915 { DE_EMM_NAS_SEC_ALGS, "NAS security algorithms" }, /* 9.9.3.23 NAS security algorithms */
916 { DE_EMM_NET_NAME, "Network name" }, /* 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. */
917 { DE_EMM_NONCE, "Nonce" }, /* 9.9.3.25 Nonce */
918 { DE_EMM_PAGING_ID, "Paging identity" }, /* 9.9.3.25A Paging identity */
919 { DE_EMM_P_TMSI_SIGN, "P-TMSI signature" }, /* 9.9.3.26 P-TMSI signature, See subclause 10.5.5.8 in 3GPP TS 24.008 [6]. */
920 { DE_EMM_EXT_CAUSE, " Extended EMM cause" }, /* 9.9.3.26A Extended EMM cause */
921 { DE_EMM_SERV_TYPE, "Service type" }, /* 9.9.3.27 Service type ,See subclause 10.5.5.15 in 3GPP TS 24.008 [6]. */
922 { DE_EMM_SHORT_MAC, "Short MAC" }, /* 9.9.3.28 Short MAC */
923 { DE_EMM_TZ, "Time zone" }, /* 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. */
924 { DE_EMM_TZ_AND_T, "Time zone and time" }, /* 9.9.3.30 Time zone and time, See subclause 10.5.3.9 in 3GPP TS 24.008 [6]. */
925 { DE_EMM_TMSI_STAT, "TMSI status" }, /* 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. */
926 { DE_EMM_TRAC_AREA_ID, "Tracking area identity" }, /* 9.9.3.32 Tracking area identity */
927 { DE_EMM_TRAC_AREA_ID_LST, "Tracking area identity list" }, /* 9.9.3.33 Tracking area identity list */
928 { DE_EMM_UE_NET_CAP, "UE network capability" }, /* 9.9.3.34 UE network capability */
929 { DE_EMM_UE_RA_CAP_INF_UPD_NEED, "UE radio capability information update needed" },/* 9.9.3.35 UE radio capability information update needed */
930 { DE_EMM_UE_SEC_CAP, "UE security capability" }, /* 9.9.3.36 UE security capability */
931 { DE_EMM_EMERG_NUM_LIST, "Emergency Number List" }, /* 9.9.3.37 Emergency Number List */
932 { DE_EMM_EXT_EMERG_NUM_LIST, "Extended Emergency Number List" }, /* 9.9.3.37a Extended Emergency Number List */
933 { DE_EMM_CLI, "CLI" }, /* 9.9.3.38 CLI */
934 { DE_EMM_SS_CODE, "SS Code" }, /* 9.9.3.39 SS Code */
935 { DE_EMM_LCS_IND, "LCS indicator" }, /* 9.9.3.40 LCS indicator */
936 { DE_EMM_LCS_CLIENT_ID, "LCS client identity" }, /* 9.9.3.41 LCS client identity */
937 { DE_EMM_GEN_MSG_CONT_TYPE, "Generic message container type" }, /* 9.9.3.42 Generic message container type */
938 { DE_EMM_GEN_MSG_CONT, "Generic message container" }, /* 9.9.3.43 Generic message container */
939 { DE_EMM_VOICE_DMN_PREF, "Voice domain preference and UEs usage setting" },/* 9.9.3.44 Voice domain preference and UEs usage setting */
940 { DE_EMM_GUTI_TYPE, "GUTI type" }, /* 9.9.3.45 GUTI type */
941 { DE_EMM_EXT_DRX_PARAMS, "Extended DRX parameters" }, /* 9.9.3.46 Extended DRX parameters */
942 { DE_EMM_DATA_SERV_TYPE, "Data service type" }, /* 9.9.3.47 Data service type */
943 { DE_EMM_DCN_ID, "DCN-ID" }, /* 9.9.3.48 DCN-ID */
944 { DE_EMM_NON_3GPP_NW_PROV_POL, "Non-3GPP NW provided policies" }, /* 9.9.3.49 Non-3GPP NW provided policies */
945 { DE_EMM_HASH_MME, "HashMME" }, /* 9.9.3.50 HashMME */
946 { DE_EMM_REPLAYED_NAS_MSG_CONT, "Replayed NAS message container" }, /* 9.9.3.51 Replayed NAS message container */
947 { DE_EMM_NETWORK_POLICY, "Network policy" }, /* 9.9.3.52 Network policy */
948 { DE_EMM_UE_ADD_SEC_CAP, "UE additional security capability" }, /* 9.9.3.53 UE additional security capability */
949 { DE_EMM_UE_STATUS, "UE status" }, /* 9.9.3.54 UE status */
950 { DE_EMM_ADD_INFO_REQ, "Additional information requested" }, /* 9.9.3.55 Additional information requested */
951 { DE_EMM_CIPH_KEY_DATA, "Ciphering key data" }, /* 9.9.3.56 Ciphering key data */
952 { DE_EMM_N1_UE_NETWORK_CAP, "N1 UE network capability" }, /* 9.9.3.57 N1 UE network capability */
953 { DE_EMM_UE_RADIO_CAP_ID_AVAIL, "UE radio capability ID availability" }, /* 9.9.3.58 UE radio capability ID availability */
954 { DE_EMM_UE_RADIO_CAP_ID_REQ, "UE radio capability ID request" }, /* 9.9.3.59 UE radio capability ID request */
955 { DE_EMM_UE_RADIO_CAP_ID, "UE radio capability ID" }, /* 9.9.3.60 UE radio capability ID */
956 { DE_EMM_UE_RADIO_CAP_ID_DEL_IND, "UE radio capability ID deletion indication" }, /* 9.9.3.61 UE radio capability ID deletion indication */
957 { DE_EMM_WUS_ASSIST_INFO, "WUS assistance information" }, /* 9.9.3.62 WUS assistance information */
958 { DE_EMM_NB_S1_DRX_PARAM, "NB-S1 DRX parameter" }, /* 9.9.3.63 NB-S1 DRX parameter */
959 { DE_EMM_IMSI_OFFSET, "IMSI offset" }, /* 9.9.3.64 IMSI offset */
960 { DE_EMM_UE_REQUEST_TYPE, "UE request type" }, /* 9.9.3.65 UE request type */
961 { DE_EMM_PAGING_RESTRICTION, "Paging restriction" }, /* 9.9.3.66 Paging restriction */
962 { DE_EMM_EPS_ADD_REQ_RESULT, "EPS additional request result" }, /* 9.9.3.67 EPS additional request result */
963 { DE_EMM_UNAVAIL_INFO, "Unavailability information" }, /* 9.9.3.69 Unavailability information */
964 { DE_EMM_UNAVAIL_CONFIG, "Unavailability configuration" }, /* 9.9.3.70 Unavailability configuration */
965 { DE_EMM_UE_INFO_REQ, "UE information request" }, /* 9.9.3.71 UE information request */
966 { DE_EMM_UE_COARSE_LOC_INFO, "UE coarse location information" }, /* 9.9.3.72 UE coarse location information */
968 { 0, NULL }
970 value_string_ext nas_emm_elem_strings_ext = VALUE_STRING_EXT_INIT(nas_emm_elem_strings);
972 #define NUM_NAS_EMM_ELEM array_length(nas_emm_elem_strings)
973 int ett_nas_eps_emm_elem[NUM_NAS_EMM_ELEM];
975 #if 0
976 /* This enum has been moved to packet-gsm_a_common to
977 make it possible to use element dissection from this dissector
978 in other dissectors.
979 It is left here as a comment for easier reference.
982 Note this enum must be of the same size as the element decoding list
984 typedef enum
986 /* 9.9.3 EPS Mobility Management (EMM) information elements */
987 DE_EMM_ADD_UPD_RES, /* 9.9.3.0A Additional update result */
988 DE_EMM_ADD_UPD_TYPE, /* 9.9.3.0B Additional update type */
989 DE_EMM_AUTH_FAIL_PAR, /* 9.9.3.1 Authentication failure parameter (dissected in packet-gsm_a_dtap.c)*/
990 DE_EMM_AUTN, /* 9.9.3.2 Authentication parameter AUTN */
991 DE_EMM_AUTH_PAR_RAND, /* 9.9.3.3 Authentication parameter RAND */
992 DE_EMM_AUTH_RESP_PAR, /* 9.9.3.4 Authentication response parameter */
993 DE_EMM_SMS_SERVICES_STATUS, /* 9.9.3.4B SMS services status */
994 DE_EMM_CSFB_RESP, /* 9.9.3.5 CSFB response */
995 DE_EMM_DAYL_SAV_T, /* 9.9.3.6 Daylight saving time */
996 DE_EMM_DET_TYPE, /* 9.9.3.7 Detach type */
997 DE_EMM_DRX_PAR, /* 9.9.3.8 DRX parameter (dissected in packet-gsm_a_gm.c)*/
998 DE_EMM_CAUSE, /* 9.9.3.9 EMM cause */
999 DE_EMM_ATT_RES, /* 9.9.3.10 EPS attach result (Coded inline */
1000 DE_EMM_ATT_TYPE, /* 9.9.3.11 EPS attach type (Coded Inline)*/
1001 DE_EMM_EPS_MID, /* 9.9.3.12 EPS mobile identity */
1002 DE_EMM_EPS_NET_FEATURE_SUP, /* 9.9.3.12A EPS network feature support */
1003 DE_EMM_EPS_UPD_RES, /* 9.9.3.13 EPS update result ( Coded inline)*/
1004 DE_EMM_EPS_UPD_TYPE, /* 9.9.3.14 EPS update type */
1005 DE_EMM_ESM_MSG_CONT, /* 9.9.3.15 ESM message conta */
1006 DE_EMM_GPRS_TIMER, /* 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. */
1007 DE_EMM_GPRS_TIMER_2, /* 9.9.3.16A GPRS timer 2, See subclause 10.5.7.4 in 3GPP TS 24.008. */
1008 DE_EMM_GPRS_TIMER_3, /* 9.9.3.16B GPRS timer 3, See subclause 10.5.7.4a in 3GPP TS 24.008. */
1009 DE_EMM_ID_TYPE_2, /* 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. */
1010 DE_EMM_IMEISV_REQ, /* 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. */
1011 DE_EMM_KSI_AND_SEQ_NO, /* 9.9.3.19 KSI and sequence number */
1012 DE_EMM_MS_NET_CAP, /* 9.9.3.20 MS network capability ,See subclause 10.5.5.12 in 3GPP TS 24.008 [6]. */
1013 DE_EMM_MS_NET_FEAT_SUP, /* 9.9.3.20A MS network feature support, See subclause 10.5.1.15 in 3GPP TS 24.008. */
1014 DE_EMM_NAS_KEY_SET_ID, /* 9.9.3.21 NAS key set identifier (coded inline)*/
1015 DE_EMM_NAS_MSG_CONT, /* 9.9.3.22 NAS message container */
1016 DE_EMM_NAS_SEC_ALGS, /* 9.9.3.23 NAS security algorithms */
1017 DE_EMM_NET_NAME, /* 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. */
1018 DE_EMM_NONCE, /* 9.9.3.25 Nonce */
1019 DE_EMM_PAGING_ID, /* 9.9.3.25A Paging identity */
1020 DE_EMM_P_TMSI_SIGN, /* 9.9.3.26 P-TMSI signature, See subclause 10.5.5.8 in 3GPP TS 24.008 [6]. */
1021 DE_EMM_EXT_CAUSE, /* 9.9.3.26A Extended EMM cause */
1022 DE_EMM_SERV_TYPE, /* 9.9.3.27 Service type */
1023 DE_EMM_SHORT_MAC, /* 9.9.3.28 Short MAC */
1024 DE_EMM_TZ, /* 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. */
1025 DE_EMM_TZ_AND_T, /* 9.9.3.30 Time zone and time, See subclause 10.5.3.9 in 3GPP TS 24.008 [6]. */
1026 DE_EMM_TMSI_STAT, /* 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. */
1027 DE_EMM_TRAC_AREA_ID, /* 9.9.3.32 Tracking area identity */
1028 DE_EMM_TRAC_AREA_ID_LST, /* 9.9.3.33 Tracking area identity list */
1029 DE_EMM_UE_NET_CAP, /* 9.9.3.34 UE network capability */
1030 DE_EMM_UE_RA_CAP_INF_UPD_NEED, /* 9.9.3.35 UE radio capability information update needed */
1031 DE_EMM_UE_SEC_CAP, /* 9.9.3.36 UE security capability */
1032 DE_EMM_EMERG_NUM_LIST, /* 9.9.3.37 Emergency Number List */
1033 DE_EMM_EXT_EMERG_NUM_LIST, /* 9.9.3.37a Extended Emergency Number List */
1034 DE_EMM_CLI, /* 9.9.3.38 CLI */
1035 DE_EMM_SS_CODE, /* 9.9.3.39 SS Code */
1036 DE_EMM_LCS_IND, /* 9.9.3.40 LCS indicator */
1037 DE_EMM_LCS_CLIENT_ID, /* 9.9.3.41 LCS client identity */
1038 DE_EMM_GEN_MSG_CONT_TYPE, /* 9.9.3.42 Generic message container type */
1039 DE_EMM_GEN_MSG_CONT, /* 9.9.3.43 Generic message container */
1040 DE_EMM_VOICE_DMN_PREF, /* 9.9.3.44 Voice domain preference and UEs usage setting */
1041 DE_EMM_GUTI_TYPE, /* 9.9.3.45 GUTI type */
1042 DE_EMM_EXT_DRX_PARAMS, /* 9.9.3.46 Extended DRX parameters */
1043 DE_EMM_DATA_SERV_TYPE, /* 9.9.3.47 Data service type */
1044 DE_EMM_DCN_ID, /* 9.9.3.48 DCN-ID */
1045 DE_EMM_NON_3GPP_NW_PROV_POL /* 9.9.3.49 Non-3GPP NW provided policies */
1046 DE_EMM_HASH_MME, /* 9.9.3.50 HashMME */
1047 DE_EMM_REPLAYED_NAS_MSG_CONT, /* 9.9.3.51 Replayed NAS message container */
1048 DE_EMM_NETWORK_POLICY, /* 9.9.3.52 Network policy */
1049 DE_EMM_UE_ADD_SEC_CAP, /* 9.9.3.53 UE additional security capability */
1050 DE_EMM_UE_STATUS, /* 9.9.3.54 UE status */
1051 DE_EMM_ADD_INFO_REQ /* 9.9.3.55 Additional information requested */
1052 DE_EMM_CIPH_KEY_DATA, /* 9.9.3.56 Ciphering key data */
1053 DE_EMM_N1_UE_NETWORK_CAP, /* 9.9.3.57 N1 UE network capability */
1054 DE_EMM_UE_RADIO_CAP_ID_AVAIL, /* 9.9.3.58 UE radio capability ID availability */
1055 DE_EMM_UE_RADIO_CAP_ID_REQ, /* 9.9.3.59 UE radio capability ID request */
1056 DE_EMM_UE_RADIO_CAP_ID, /* 9.9.3.60 UE radio capability ID */
1057 DE_EMM_UE_RADIO_CAP_ID_DEL_IND, /* 9.9.3.61 UE radio capability ID deletion indication */
1058 DE_EMM_WUS_ASSIST_INFO, /* 9.9.3.62 WUS assistance information */
1059 DE_EMM_NB_S1_DRX_PARAM, /* 9.9.3.63 NB-S1 DRX parameter */
1060 DE_EMM_IMSI_OFFSET, /* 9.9.3.64 IMSI offset */
1061 DE_EMM_UE_REQUEST_TYPE, /* 9.9.3.65 UE request type */
1062 DE_EMM_PAGING_RESTRICTION, /* 9.9.3.66 Paging restriction */
1063 DE_EMM_EPS_ADD_REQ_RESULT, /* 9.9.3.67 EPS additional request result */
1064 DE_EMM_UNAVAIL_INFO, /* 9.9.3.69 Unavailability information */
1065 DE_EMM_UNAVAIL_CONFIG, /* 9.9.3.70 Unavailability configuration */
1066 DE_EMM_UE_INFO_REQ, /* 9.9.3.71 UE information request */
1067 DE_EMM_UE_COARSE_LOC_INFO, /* 9.9.3.72 UE coarse location information */
1068 DE_EMM_NONE /* NONE */
1070 nas_emm_elem_idx_t;
1071 #endif
1073 /* TODO: Update to latest spec */
1074 /* 9.9.3 EPS Mobility Management (EMM) information elements
1077 * 9.9.3.0A Additional update result
1079 static const value_string nas_eps_emm_add_upd_res_vals[] = {
1080 { 0x0, "No additional information"},
1081 { 0x1, "CS Fallback not preferred"},
1082 { 0x2, "SMS only"},
1083 { 0x3, "Reserved"},
1084 { 0, NULL }
1086 static uint16_t
1087 de_emm_add_upd_res(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
1088 uint32_t offset, unsigned len _U_,
1089 char *add_string _U_, int string_len _U_)
1091 uint32_t curr_offset, bit_offset;
1093 curr_offset = offset;
1094 bit_offset = (curr_offset<<3)+4;
1096 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
1097 bit_offset += 2;
1098 proto_tree_add_bits_item(tree, hf_nas_eps_emm_add_upd_res, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
1099 curr_offset++;
1101 return (curr_offset - offset);
1104 * 9.9.3.0B Additional update type
1106 static const value_string nas_eps_emm_pnb_ciot_vals[] = {
1107 { 0x0, "No additional information"},
1108 { 0x1, "Control plane CIoT EPS optimization"},
1109 { 0x2, "User plane CIoT EPS optimization"},
1110 { 0x3, "Reserved"},
1111 { 0, NULL }
1113 static const true_false_string nas_eps_emm_saf_value = {
1114 "Keeping the NAS signalling connection is required after the completion of the"
1115 " tracking area updating procedure",
1116 "Keeping the NAS signalling connection is not required after the completion of the"
1117 " tracking area updating procedure"
1119 static const true_false_string nas_eps_emm_add_upd_type_value = {
1120 "SMS only",
1121 "No additional information (shall be interpreted as request for"
1122 " combined attach or combined tracking area updating)"
1124 static uint16_t
1125 de_emm_add_upd_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
1126 uint32_t offset, unsigned len _U_,
1127 char *add_string _U_, int string_len _U_)
1129 uint32_t curr_offset, bit_offset;
1131 curr_offset = offset;
1132 bit_offset = (curr_offset<<3)+4;
1134 proto_tree_add_bits_item(tree, hf_nas_eps_emm_pnb_ciot, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
1135 bit_offset += 2;
1136 proto_tree_add_bits_item(tree, hf_nas_eps_emm_saf, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1137 bit_offset += 1;
1138 proto_tree_add_bits_item(tree, hf_nas_eps_emm_add_upd_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1139 curr_offset++;
1141 return (curr_offset - offset);
1144 * 9.9.3.1 Authentication failure parameter
1145 * See subclause 10.5.3.2.2 in 3GPP TS 24.008 [6].
1146 * (dissected in packet-gsm_a_dtap.c)
1149 * 9.9.3.2 Authentication parameter AUTN
1150 * See subclause 10.5.3.1.1 in 3GPP TS 24.008 [6].
1153 * 9.9.3.3 Authentication parameter RAND
1154 * See subclause 10.5.3.1 in 3GPP TS 24.008 [6].
1157 * 9.9.3.4 Authentication response parameter
1159 static uint16_t
1160 de_emm_auth_resp_par(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
1161 uint32_t offset, unsigned len _U_,
1162 char *add_string _U_, int string_len _U_)
1164 uint32_t curr_offset;
1166 curr_offset = offset;
1168 proto_tree_add_item(tree, hf_nas_eps_emm_res, tvb, curr_offset, len, ENC_NA);
1170 return len;
1173 * 9.9.3.4A Ciphering key sequence number
1174 * See subclause 9.9.3.19 in 3GPP TS 24.008 [13].
1178 * 9.9.3.4B SMS services status
1180 static const value_string nas_eps_emm_sms_services_status_vals[] = {
1181 { 0x0, "SMS services not available"},
1182 { 0x1, "SMS services not available in this PLMN"},
1183 { 0x2, "Network failure"},
1184 { 0x3, "Congestion"},
1185 { 0, NULL}
1188 static uint16_t
1189 de_emm_sms_services_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
1190 uint32_t offset, unsigned len _U_,
1191 char *add_string _U_, int string_len _U_)
1193 uint32_t curr_offset, bit_offset;
1195 curr_offset = offset;
1196 bit_offset = (curr_offset<<3)+4;
1198 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1199 bit_offset++;
1200 proto_tree_add_bits_item(tree, hf_nas_eps_emm_sms_services_status, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1201 curr_offset++;
1203 return (curr_offset - offset);
1207 * 9.9.3.5 CSFB response
1211 * CSFB response value (octet 1)
1214 static const value_string nas_eps_emm_csfb_resp_vals[] = {
1215 { 0x0, "CS fallback rejected by the UE"},
1216 { 0x1, "CS fallback accepted by the UE"},
1217 { 0, NULL }
1220 static uint16_t
1221 de_emm_csfb_resp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
1222 uint32_t offset, unsigned len _U_,
1223 char *add_string _U_, int string_len _U_)
1225 uint32_t curr_offset, bit_offset;
1227 curr_offset = offset;
1229 /* bit 4 Spare */
1230 bit_offset = curr_offset<<3;
1231 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset+4, 1, ENC_BIG_ENDIAN);
1233 proto_tree_add_item(tree, hf_nas_eps_emm_csfb_resp, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1234 curr_offset++;
1236 return curr_offset-offset;
1239 * 9.9.3.6 Daylight saving time
1240 * See subclause 10.5.3.12 in 3GPP TS 24.008 [6].
1243 * 9.9.3.7 Detach type
1244 * Coded inline
1246 static const value_string nas_eps_emm_switch_off_vals[] = {
1247 { 0x0, "Normal detach"},
1248 { 0x1, "Switch off"},
1249 { 0x2, "Reserved"},
1250 { 0x3, "Reserved"},
1251 { 0x4, "Reserved"},
1252 { 0x5, "Reserved"},
1253 { 0x6, "Reserved"},
1254 { 0x7, "Reserved"},
1255 { 0, NULL }
1257 /* Type of detach (octet 1)
1258 * In the UE to network direction:
1260 static const value_string nas_eps_emm_type_of_detach_UL_vals[] = {
1261 { 0x1, "EPS detach"},
1262 { 0x2, "IMSI detach"},
1263 { 0x3, "Combined EPS/IMSI detach"},
1264 { 0x4, "Combined EPS/IMSI detach"}, /* All other values are interpreted as
1265 "combined EPS/IMSI detach" in this version of the protocol.*/
1266 { 0x5, "Combined EPS/IMSI detach"}, /* -"- */
1267 { 0x6, "Reserved"},
1268 { 0x7, "Reserved"},
1269 { 0, NULL }
1273 * In the network to UE direction:
1276 static const value_string nas_eps_emm_type_of_detach_DL_vals[] = {
1277 { 0x1, "Re-attach required"},
1278 { 0x2, "Re-attach not required"},
1279 { 0x3, "IMSI detach"},
1280 { 0x4, "Re-attach not required"}, /* All other values are interpreted as
1281 "re-attach not required" in this version of the protocol.*/
1282 { 0x5, "Re-attach not required"}, /* -"- */
1283 { 0x6, "Reserved"},
1284 { 0x7, "Reserved"},
1285 { 0, NULL }
1289 * 9.9.3.8 DRX parameter
1290 * See subclause 10.5.5.6 in 3GPP TS 24.008 [13].
1293 * 9.9.3.9 EMM cause
1295 const value_string nas_eps_emm_cause_values[] = {
1296 { 0x2, "IMSI unknown in HSS"},
1297 { 0x3, "Illegal UE"},
1298 { 0x5, "IMEI not accepted"},
1299 { 0x6, "Illegal ME"},
1300 { 0x7, "EPS services not allowed"},
1301 { 0x8, "EPS services and non-EPS services not allowed"},
1302 { 0x9, "UE identity cannot be derived by the network"},
1303 { 0xa, "Implicitly detached"},
1304 { 0xb, "PLMN not allowed"},
1305 { 0xc, "Tracking Area not allowed"},
1306 { 0xd, "Roaming not allowed in this tracking area"},
1307 { 0xe, "EPS services not allowed in this PLMN"},
1308 { 0xf, "No Suitable Cells In tracking area"},
1309 { 0x10, "MSC temporarily not reachable"},
1310 { 0x11, "Network failure"},
1311 { 0x12, "CS domain not available"},
1312 { 0x13, "ESM failure"},
1313 { 0x14, "MAC failure"},
1314 { 0x15, "Synch failure"},
1315 { 0x16, "Congestion"},
1316 { 0x17, "UE security capabilities mismatch"},
1317 { 0x18, "Security mode rejected, unspecified"},
1318 { 0x19, "Not authorized for this CSG"},
1319 { 0x1a, "Non-EPS authentication unacceptable"},
1320 { 0x1f, "Redirection to 5GCN required"},
1321 { 0x23, "Requested service option not authorized in this PLMN"},
1322 { 0x24, "IAB-node operation not authorized" },
1323 { 0x27, "CS service temporarily not available"},
1324 { 0x28, "No EPS bearer context activated"},
1325 { 0x2a, "Severe network failure"},
1326 { 0x4e, "PLMN not allowed to operate at the present UE location"},
1327 { 0x5f, "Semantically incorrect message"},
1328 { 0x60, "Invalid mandatory information"},
1329 { 0x61, "Message type non-existent or not implemented"},
1330 { 0x62, "Message type not compatible with the protocol state"},
1331 { 0x63, "Information element non-existent or not implemented"},
1332 { 0x64, "Conditional IE error"},
1333 { 0x65, "Message not compatible with the protocol state"},
1334 { 0x6f, "Protocol error, unspecified"},
1335 { 0, NULL }
1337 value_string_ext nas_eps_emm_cause_values_ext = VALUE_STRING_EXT_INIT(nas_eps_emm_cause_values);
1339 static uint16_t
1340 de_emm_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
1341 uint32_t offset, unsigned len _U_,
1342 char *add_string _U_, int string_len _U_)
1344 uint32_t curr_offset;
1345 uint8_t cause;
1347 curr_offset = offset;
1349 cause = tvb_get_uint8(tvb, curr_offset);
1350 proto_tree_add_item(tree, hf_nas_eps_emm_cause, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1351 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
1352 val_to_str_ext_const(cause, &nas_eps_emm_cause_values_ext, "Unknown"));
1354 curr_offset++;
1356 return curr_offset-offset;
1360 * 9.9.3.10 EPS attach result
1363 static const value_string nas_eps_emm_EPS_attach_result_values[] = {
1364 { 0, "reserved"},
1365 { 1, "EPS only"},
1366 { 2, "Combined EPS/IMSI attach"},
1367 { 3, "reserved"},
1368 { 4, "reserved"},
1369 { 5, "reserved"},
1370 { 6, "reserved"},
1371 { 7, "reserved"},
1372 { 0, NULL }
1374 /* Coded inline */
1377 * 9.9.3.11 EPS attach type
1380 static const value_string nas_eps_emm_eps_att_type_vals[] = {
1381 { 0, "EPS attach(unused)"},
1382 { 1, "EPS attach"},
1383 { 2, "Combined EPS/IMSI attach"},
1384 { 3, "EPS RLOS attach"},
1385 { 4, "EPS attach(unused)"},
1386 { 5, "EPS attach(unused)"},
1387 { 6, "EPS emergency attach"},
1388 { 7, "Reserved"},
1389 { 0, NULL }
1391 /* Coded inline */
1394 * 9.9.3.12 EPS mobile identity
1397 static true_false_string nas_eps_odd_even_value = {
1398 "Odd number of identity digits",
1399 "Even number of identity digits"
1401 static const value_string nas_eps_emm_type_of_id_vals[] = {
1402 { 0, "reserved"},
1403 { 1, "IMSI"},
1404 { 2, "reserved"},
1405 { 3, "IMEI"},
1406 { 4, "reserved"},
1407 { 5, "reserved"},
1408 { 6, "GUTI"},
1409 { 7, "reserved"},
1410 { 0, NULL }
1412 static uint16_t
1413 de_emm_eps_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
1414 uint32_t offset, unsigned len _U_,
1415 char *add_string _U_, int string_len _U_)
1417 uint32_t curr_offset;
1418 uint8_t octet;
1419 proto_item* ti;
1421 curr_offset = offset;
1423 octet = tvb_get_uint8(tvb,offset);
1424 /* Type of identity (octet 3) */
1425 proto_tree_add_item(tree, hf_nas_eps_emm_odd_even, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1426 proto_tree_add_item(tree, hf_nas_eps_emm_type_of_id, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1427 switch (octet&0x7) {
1428 case 1:
1429 /* IMSI */
1430 dissect_e212_imsi(tvb, pinfo, tree, curr_offset, len, true);
1431 break;
1432 case 3:
1433 /* IMEI */
1434 proto_tree_add_item(tree, hf_nas_eps_emm_imei, tvb, curr_offset, len, ENC_BCD_DIGITS_0_9 | ENC_LITTLE_ENDIAN | ENC_BCD_SKIP_FIRST);
1435 break;
1436 case 6:
1437 /* GUTI */
1438 curr_offset++;
1439 curr_offset = dissect_e212_mcc_mnc(tvb, pinfo, tree, curr_offset, E212_GUMMEI, true);
1440 /* MME Group ID octet 7 - 8 */
1441 proto_tree_add_item(tree, hf_nas_eps_emm_mme_grp_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1442 curr_offset+=2;
1443 /* MME Code Octet 9 */
1444 proto_tree_add_item(tree, hf_nas_eps_emm_mme_code, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1445 curr_offset++;
1446 /* M-TMSI Octet 10 - 13 */
1447 proto_tree_add_item(tree, hf_nas_eps_emm_m_tmsi, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
1448 ti = proto_tree_add_item(tree, hf_3gpp_tmsi, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
1449 proto_item_set_hidden(ti);
1450 /*curr_offset+=4;*/
1451 break;
1452 default:
1453 proto_tree_add_expert(tree, pinfo, &ei_nas_eps_unknown_identity, tvb, curr_offset, len - 1);
1454 break;
1457 return len;
1461 * 9.9.3.12A EPS network feature support
1463 static const value_string nas_eps_emm_cs_lcs_vals[] = {
1464 { 0, "no information about support of location services via CS domain is available"},
1465 { 1, "location services via CS domain supported"},
1466 { 2, "location services via CS domain not supported"},
1467 { 3, "reserved"},
1468 { 0, NULL }
1471 static uint16_t
1472 de_emm_eps_net_feature_sup(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_,
1473 uint32_t offset, unsigned len _U_,
1474 char* add_string _U_, int string_len _U_)
1476 uint32_t curr_offset;
1478 static int* const oct3_flags[] = {
1479 &hf_nas_eps_emm_cp_ciot,
1480 &hf_nas_eps_emm_er_wo_pdn,
1481 &hf_nas_eps_emm_esr_ps,
1482 &hf_nas_eps_emm_cs_lcs,
1483 &hf_nas_eps_emm_epc_lcs,
1484 &hf_nas_eps_emm_emc_bs,
1485 &hf_nas_eps_emm_ims_vops,
1486 NULL
1489 static int* const oct4_flags[] = {
1490 &hf_nas_eps_emm_15_bearers,
1491 &hf_nas_eps_emm_iwkn26,
1492 &hf_nas_eps_emm_restrict_dcnr,
1493 &hf_nas_eps_emm_restrict_ec,
1494 &hf_nas_eps_emm_epco,
1495 &hf_nas_eps_emm_hc_cp_ciot,
1496 &hf_nas_eps_emm_s1_u_data,
1497 &hf_nas_eps_emm_up_ciot,
1498 NULL
1501 static int* const oct5_flags[] = {
1502 &hf_nas_eps_emm_edc,
1503 &hf_nas_eps_emm_ptcc,
1504 &hf_nas_eps_emm_pr,
1505 &hf_nas_eps_emm_rpr,
1506 &hf_nas_eps_emm_piv,
1507 &hf_nas_eps_emm_ncr,
1508 NULL
1511 curr_offset = offset;
1513 /* CP CIoT ERw/oPDN ESR PS CS-LCS EPC-LCS EMC BS IMS VoPS */
1514 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct3_flags, ENC_NA);
1515 curr_offset++;
1517 /* Following octets are optional */
1518 if ((curr_offset - offset) >= len)
1519 return (len);
1521 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct4_flags, ENC_NA);
1522 curr_offset++;
1524 if ((curr_offset - offset) >= len)
1525 return (len);
1527 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 2, ENC_BIG_ENDIAN);
1528 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct5_flags, ENC_NA);
1529 curr_offset++;
1531 return len;
1534 * 9.9.3.13 EPS update result
1536 static const value_string nas_eps_emm_eps_update_result_vals[] = {
1537 { 0, "TA updated"},
1538 { 1, "Combined TA/LA updated"},
1539 { 2, "Reserved"},
1540 { 3, "Reserved"},
1541 { 4, "TA updated and ISR activated"},
1542 { 5, "Combined TA/LA updated and ISR activated"},
1543 { 6, "Reserved"},
1544 { 7, "Reserved"},
1545 { 0, NULL }
1549 * 9.9.3.14 EPS update type
1551 static const true_false_string nas_eps_emm_active_flg_value = {
1552 "Bearer establishment requested",
1553 "No bearer establishment requested"
1556 static const value_string nas_eps_emm_eps_update_type_vals[] = {
1557 { 0, "TA updating"},
1558 { 1, "Combined TA/LA updating"},
1559 { 2, "Combined TA/LA updating with IMSI attach"},
1560 { 3, "Periodic updating"},
1561 { 4, "Unused; shall be interpreted as 'TA updating', if received by the network"},
1562 { 5, "Unused; shall be interpreted as 'TA updating', if received by the network"},
1563 { 6, "Reserved"},
1564 { 7, "Reserved"},
1565 { 0, NULL }
1569 * 9.9.3.15 ESM message container
1571 static uint16_t
1572 de_emm_esm_msg_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
1573 uint32_t offset, unsigned len,
1574 char *add_string _U_, int string_len _U_)
1576 proto_item *item;
1577 proto_tree *sub_tree;
1578 tvbuff_t *new_tvb;
1579 uint32_t curr_offset;
1580 uint8_t init_sec_hdr_type = tvb_get_bits8(tvb, 0, 4);
1582 curr_offset = offset;
1585 item = proto_tree_add_item(tree, hf_nas_eps_esm_msg_cont, tvb, curr_offset, len, ENC_NA);
1586 sub_tree = proto_item_add_subtree(item, ett_nas_eps_esm_msg_cont);
1588 /* This IE can contain any ESM PDU as defined in subclause 8.3. */
1589 new_tvb = tvb_new_subset_length(tvb, curr_offset, len);
1590 if (init_sec_hdr_type == 5) {
1591 /* Integrity protected and partially ciphered NAS message */
1592 uint8_t pd = tvb_get_uint8(new_tvb, 0);
1593 /* If pd is in plaintext this message probably isn't ciphered */
1594 if (((pd&0x0f) != 2) || (((pd&0x0f) == 2) && ((pd&0xf0) > 0) && ((pd&0xf0) < 0x50))) {
1595 proto_tree_add_item(sub_tree, hf_nas_eps_ciphered_msg, new_tvb, 0, len, ENC_NA);
1596 } else {
1597 TRY {
1598 /* Potential plain NAS message: let's try to decode it and catch exceptions */
1599 dissect_nas_eps_esm_msg(new_tvb, pinfo, sub_tree, 0/* offset */);
1600 } CATCH_BOUNDS_ERRORS {
1601 /* Dissection exception: message was probably ciphered and heuristic was too weak */
1602 show_exception(new_tvb, pinfo, sub_tree, EXCEPT_CODE, GET_MESSAGE);
1603 } ENDTRY
1605 } else {
1606 /* Plain NAS message */
1607 dissect_nas_eps_esm_msg(new_tvb, pinfo, sub_tree, 0/* offset */);
1610 return len;
1613 * 9.9.3.16 GPRS timer
1614 * See subclause 10.5.7.3 in 3GPP TS 24.008 [6].
1615 * packet-gsm_a_gm.c
1618 * 9.9.3.16A GPRS timer 2
1619 * See subclause 10.5.7.4 in 3GPP TS 24.008.
1620 * packet-gsm_a_gm.c
1623 * 9.9.3.16B GPRS timer 3
1624 * See subclause 10.5.7.4a in 3GPP TS 24.008.
1625 * packet-gsm_a_gm.c
1628 * 9.9.3.17 Identity type 2
1629 * See subclause 10.5.5.9 in 3GPP TS 24.008 [6].
1631 static const value_string nas_eps_emm_id_type2_vals[] = {
1632 { 1, "IMSI"},
1633 { 2, "IMEI"},
1634 { 3, "IMEISV"},
1635 { 4, "TMSI"},
1636 { 0, NULL }
1640 * 9.9.3.18 IMEISV request
1641 * See subclause 10.5.5.10 in 3GPP TS 24.008 [6].
1643 /* IMEISV request value (octet 1) */
1644 static const value_string nas_eps_emm_imeisv_req_vals[] = {
1645 { 0, "IMEISV not requested"},
1646 { 1, "IMEISV requested"},
1647 { 2, "IMEISV not requested"},
1648 { 3, "IMEISV not requested"},
1649 { 4, "IMEISV not requested"},
1650 { 5, "IMEISV not requested"},
1651 { 6, "IMEISV not requested"},
1652 { 7, "IMEISV not requested"},
1653 { 0, NULL }
1655 static uint16_t
1656 de_emm_nas_imeisv_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
1657 uint32_t offset, unsigned len _U_,
1658 char *add_string _U_, int string_len _U_)
1660 uint32_t curr_offset;
1661 int bit_offset;
1663 curr_offset = offset;
1665 bit_offset = curr_offset<<3;
1666 bit_offset+=4;
1667 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1668 proto_tree_add_item(tree, hf_nas_eps_esm_imeisv_req, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1669 curr_offset++;
1671 return curr_offset - offset;
1674 * 9.9.3.19 KSI and sequence number
1676 static uint16_t
1677 de_emm_nas_ksi_and_seq_no(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
1678 uint32_t offset, unsigned len _U_,
1679 char *add_string _U_, int string_len _U_)
1681 uint32_t curr_offset;
1682 int bit_offset;
1684 curr_offset = offset;
1685 bit_offset = curr_offset<<3;
1687 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1688 bit_offset += 3;
1689 proto_tree_add_bits_item(tree, hf_nas_eps_seq_no_short, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
1690 curr_offset++;
1692 return curr_offset - offset;
1696 * 9.9.3.20 MS network capability
1697 * See subclause 10.5.5.12 in 3GPP TS 24.008 [6].
1698 * packet-gsm_a_gm.c
1701 * 9.9.3.20A MS network feature support
1702 * See subclause 10.5.1.15 in 3GPP TS 24.008.
1703 * packet-gsm_a_gm.c
1706 * 9.9.3.21 NAS key set identifier
1709 * Type of security context flag (TSC) (octet 1)
1711 static const true_false_string nas_eps_tsc_value = {
1712 "Mapped security context (for KSIsgsn or KSIamf)",
1713 "Native security context (for KSIasme or KSIamf)"
1716 /* NAS key set identifier (octet 1) Bits 3 2 1 */
1718 static const value_string nas_eps_emm_NAS_key_set_identifier_vals[] = {
1719 { 0, ""},
1720 { 1, ""},
1721 { 2, ""},
1722 { 3, ""},
1723 { 4, ""},
1724 { 5, ""},
1725 { 6, ""},
1726 { 7, "No key is available"},
1727 { 0, NULL }
1730 /* Takes bit offset as input and consumes 4 bits */
1731 static void
1732 de_emm_nas_key_set_id_bits(tvbuff_t *tvb, proto_tree *tree, uint32_t bit_offset, const char *add_string)
1734 proto_item *item;
1736 /* Type of security context flag (TSC) (octet 1) V 1/2 */
1737 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1738 bit_offset++;
1739 /* NAS key set identifier (octet 1) */
1740 item = proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1741 if (add_string) {
1742 proto_item_append_text(item, "%s", add_string);
1744 /*bit_offset+=3;*/
1747 * Note used for TV Short
1749 static uint16_t
1750 de_emm_nas_key_set_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
1751 uint32_t offset, unsigned len _U_,
1752 char *add_string _U_, int string_len _U_)
1754 uint32_t curr_offset, bit_offset;
1756 curr_offset = offset;
1758 /* Get the bit offset of the lover half of the octet bits 4 - 1 */
1759 bit_offset = curr_offset<<3;
1760 bit_offset+=4;
1762 /* Type of security context flag (TSC) (octet 1) V 1/2 */
1763 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1764 bit_offset++;
1765 /* NAS key set identifier (octet 1) */
1766 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1767 /*bit_offset+=3;*/
1768 curr_offset++;
1770 return curr_offset - offset;
1774 * 9.9.3.22 NAS message container
1776 static uint16_t
1777 de_emm_nas_msg_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
1778 uint32_t offset, unsigned len _U_,
1779 char *add_string _U_, int string_len _U_)
1781 proto_item *item;
1782 proto_tree *sub_tree;
1783 tvbuff_t *new_tvb;
1784 uint32_t curr_offset;
1786 curr_offset = offset;
1788 /* NAS message container contents (octet 3 to octet n)
1789 * This IE can contain an SMS message (i.e. CP-DATA, CP-ACK or CP-ERROR)
1790 * as defined in subclause 7.2 in 3GPP TS 24.011 [13A].
1793 item = proto_tree_add_item(tree, hf_nas_eps_nas_msg_cont, tvb, curr_offset, len, ENC_NA);
1794 sub_tree = proto_item_add_subtree(item, ett_nas_eps_nas_msg_cont);
1796 new_tvb = tvb_new_subset_length(tvb, curr_offset, len);
1798 if (gsm_a_dtap_handle) {
1799 if (tvb_get_bits8(tvb, 0, 4) == 5) {
1800 /* Integrity protected and partially ciphered NAS message */
1801 /* If pd is in plaintext this message probably isn't ciphered */
1802 if (tvb_get_bits8(new_tvb, 4, 4) != 9) {
1803 proto_tree_add_item(sub_tree, hf_nas_eps_ciphered_msg, new_tvb, 0, len, ENC_NA);
1804 } else {
1805 TRY {
1806 /* Potential plain NAS message: let's try to decode it and catch exceptions */
1807 call_dissector(gsm_a_dtap_handle, new_tvb, pinfo, sub_tree);
1808 } CATCH_BOUNDS_ERRORS {
1809 /* Dissection exception: message was probably ciphered and heuristic was too weak */
1810 show_exception(new_tvb, pinfo, sub_tree, EXCEPT_CODE, GET_MESSAGE);
1811 } ENDTRY
1813 } else {
1814 /* Plain NAS message */
1815 call_dissector(gsm_a_dtap_handle, new_tvb, pinfo, sub_tree);
1819 return len;
1822 * 9.9.3.23 NAS security algorithms
1824 /* Type of integrity protection algorithm (octet 2, bit 1 to 3) */
1825 static const value_string nas_eps_emm_toi_vals[] = {
1826 { 0, "EPS integrity algorithm EIA0 (null integrity protection algorithm)"},
1827 { 1, "EPS integrity algorithm 128-EIA1"},
1828 { 2, "EPS integrity algorithm 128-EIA2"},
1829 { 3, "EPS integrity algorithm 128-EIA3"},
1830 { 4, "EPS integrity algorithm EIA4"},
1831 { 5, "EPS integrity algorithm EIA5"},
1832 { 6, "EPS integrity algorithm EIA6"},
1833 { 7, "EPS integrity algorithm EIA7"},
1834 { 0, NULL }
1837 /* Type of ciphering algorithm (octet 2, bit 5 to 7) */
1839 static const value_string nas_eps_emm_toc_vals[] = {
1840 { 0, "EPS encryption algorithm EEA0 (null ciphering algorithm)"},
1841 { 1, "EPS encryption algorithm 128-EEA1"},
1842 { 2, "EPS encryption algorithm 128-EEA2"},
1843 { 3, "EPS encryption algorithm 128-EEA3"},
1844 { 4, "EPS encryption algorithm EEA4"},
1845 { 5, "EPS encryption algorithm EEA5"},
1846 { 6, "EPS encryption algorithm EEA6"},
1847 { 7, "EPS encryption algorithm EEA7"},
1848 { 0, NULL }
1850 static uint16_t
1851 de_emm_nas_sec_alsgs(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
1852 uint32_t offset, unsigned len _U_,
1853 char *add_string _U_, int string_len _U_)
1855 int bit_offset;
1856 uint32_t curr_offset;
1858 curr_offset = offset;
1860 bit_offset = offset<<3;
1861 /* Bit 4 and 8 of octet 2 are spare and shall be coded as zero. */
1862 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1863 /* Type of ciphering algorithm (octet 2, bit 5 to 7) */
1864 proto_tree_add_item(tree, hf_nas_eps_emm_toc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1865 bit_offset+=4;
1866 /* Bit 4 and 8 of octet 2 are spare and shall be coded as zero. */
1867 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1868 /* Type of integrity protection algorithm (octet 2, bit 1 to 3) */
1869 proto_tree_add_item(tree, hf_nas_eps_emm_toi, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1871 curr_offset++;
1873 return curr_offset-offset;
1876 * 9.9.3.24 Network name
1877 * See subclause 10.5.3.5a in 3GPP TS 24.008 [6].
1880 * 9.9.3.25 Nonce
1882 static uint16_t
1883 de_emm_nonce(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
1884 uint32_t offset, unsigned len _U_,
1885 char *add_string _U_, int string_len _U_)
1887 uint32_t curr_offset;
1889 curr_offset = offset;
1891 proto_tree_add_item(tree, hf_nas_eps_emm_nonce, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
1892 curr_offset+=4;
1894 return curr_offset-offset;
1897 * 9.9.3.25A Paging identity
1899 static const true_false_string nas_eps_emm_paging_id_vals = {
1900 "TMSI",
1901 "IMSI"
1904 static uint16_t
1905 de_emm_paging_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
1906 uint32_t offset, unsigned len _U_,
1907 char *add_string _U_, int string_len _U_)
1909 uint32_t curr_offset;
1911 curr_offset = offset;
1913 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 7, ENC_BIG_ENDIAN);
1914 proto_tree_add_bits_item(tree, hf_nas_eps_emm_paging_id, tvb, (curr_offset<<3)+7, 1, ENC_BIG_ENDIAN);
1915 /*curr_offset+=1;*/
1917 return 1;
1920 * 9.9.3.26 P-TMSI signature
1921 * See subclause 10.5.5.8 in 3GPP TS 24.008 [6].
1925 * 9.9.3.26A Extended EMM cause
1927 static const true_false_string nas_eps_emm_eps_optim_info = {
1928 "Requested EPS optimization not supported",
1929 "No EPS optimization information"
1932 static uint16_t
1933 de_emm_ext_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
1934 uint32_t offset, unsigned len _U_,
1935 char *add_string _U_, int string_len _U_)
1937 uint32_t curr_offset, bit_offset;
1939 curr_offset = offset;
1940 bit_offset = (curr_offset<<3)+4;
1942 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1943 bit_offset++;
1944 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nbiot_allowed_value, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1945 bit_offset++;
1946 proto_tree_add_bits_item(tree, hf_nas_eps_emm_eps_optim_info, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1947 bit_offset++;
1948 proto_tree_add_bits_item(tree, hf_nas_eps_emm_eutran_allowed_value, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1949 curr_offset++;
1951 return (curr_offset - offset);
1955 * 9.9.3.27 Service type
1957 static const range_string nas_eps_service_type_vals[] = {
1958 { 0, 0, "Mobile originating CS fallback or 1xCS fallback"},
1959 { 1, 1, "Mobile terminating CS fallback or 1xCS fallback"},
1960 { 2, 2, "Mobile originating CS fallback emergency call or 1xCS fallback emergency call"},
1961 { 3, 4, "Mobile originating CS fallback or 1xCS fallback"},
1962 { 8, 11, "Packet services via S1"},
1963 { 0, 0, NULL }
1967 * 9.9.3.28 Short MAC
1969 static uint16_t
1970 de_emm_nas_short_mac(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
1971 uint32_t offset, unsigned len _U_,
1972 char *add_string _U_, int string_len _U_)
1974 uint32_t curr_offset;
1976 curr_offset = offset;
1979 proto_tree_add_item(tree, hf_nas_eps_emm_short_mac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1980 curr_offset+=2;
1982 return curr_offset-offset;
1985 * 9.9.3.29 Time zone
1986 * See subclause 10.5.3.8 in 3GPP TS 24.008 [6].
1989 * 9.9.3.30 Time zone and time
1990 * See subclause 10.5.3.9 in 3GPP TS 24.008 [6].
1993 * 9.9.3.31 TMSI status
1994 * See subclause 10.5.5.4 in 3GPP TS 24.008 [6].
1997 * 9.9.3.32 Tracking area identity
2000 uint16_t
2001 de_emm_trac_area_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
2002 uint32_t offset, unsigned len _U_,
2003 char *add_string _U_, int string_len _U_)
2005 uint32_t curr_offset;
2007 curr_offset = offset;
2009 curr_offset = dissect_e212_mcc_mnc(tvb, pinfo, tree, curr_offset, E212_TAI, true);
2010 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
2011 curr_offset+=2;
2013 return curr_offset-offset;
2016 * 9.9.3.33 Tracking area identity list
2018 /* Type of list (octet 1)
2019 * Bits 7 6
2021 static const value_string nas_eps_emm_tai_tol_vals[] = {
2022 { 0, "list of TACs belonging to one PLMN, with non-consecutive TAC values"},
2023 { 1, "list of TACs belonging to one PLMN, with consecutive TAC values"},
2024 { 2, "list of TAIs belonging to different PLMNs"},
2025 { 0, NULL }
2028 static uint16_t
2029 de_emm_trac_area_id_lst(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
2030 uint32_t offset, unsigned len,
2031 char *add_string _U_, int string_len _U_)
2033 proto_item *item;
2034 uint32_t curr_offset, tac;
2035 uint8_t octet, tol, n_elem;
2036 int i;
2037 proto_item *it;
2039 curr_offset = offset;
2041 while ((curr_offset - offset) < len) {
2042 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN);
2043 /* Type of list (octet 1) Bits 7 6 */
2044 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tol, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2045 /* Number of elements (octet 1) Bits 5 4 3 2 1 */
2046 octet = tvb_get_uint8(tvb,curr_offset)& 0x7f;
2047 tol = octet >> 5;
2048 n_elem = (octet & 0x1f)+1;
2049 item = proto_tree_add_item(tree, hf_nas_eps_emm_tai_n_elem, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2050 if (n_elem<16) {
2051 proto_item_append_text(item, " [+1 = %u element(s)]", n_elem);
2052 } else {
2053 n_elem = 16;
2056 curr_offset++;
2057 if (tol>2) {
2058 proto_tree_add_expert(tree, pinfo, &ei_nas_eps_unknown_type_of_list, tvb, curr_offset, len-(curr_offset-offset));
2059 return len;
2062 switch (tol) {
2063 case 0:
2064 /* MCC digit 2 MCC digit 1 octet 2
2065 * MNC digit 3 MCC digit 3 octet 3
2066 * MNC digit 2 MNC digit 1 octet 4
2068 curr_offset = dissect_e212_mcc_mnc(tvb, pinfo, tree, curr_offset, E212_TAI, true);
2069 /* type of list = "000" */
2070 /* TAC 1 octet 5
2071 * TAC 1 (continued) octet 6
2072 * ...
2073 * ...
2074 * TAC k octet 2k+3*
2075 * TAC k (continued) octet 2k+4*
2077 if (len < (unsigned)(4+(n_elem*2))) {
2078 proto_tree_add_expert(tree, pinfo, &ei_nas_eps_wrong_nb_of_elems, tvb, curr_offset, len-(curr_offset-offset));
2079 return len;
2081 for (i=0; i < n_elem; i++, curr_offset+=2)
2082 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
2083 break;
2084 case 1:
2085 /* type of list = "001" */
2086 /* MCC digit 2 MCC digit 1 octet 2
2087 * MNC digit 3 MCC digit 3 octet 3
2088 * MNC digit 2 MNC digit 1 octet 4
2090 curr_offset = dissect_e212_mcc_mnc(tvb, pinfo, tree, curr_offset, E212_TAI, true);
2091 proto_tree_add_item_ret_uint(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN, &tac);
2092 curr_offset+=2;
2093 for (i = 1; i < n_elem; i++) {
2094 it = proto_tree_add_uint(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 0, tac+i);
2095 proto_item_set_generated(it);
2097 break;
2098 case 2:
2099 if (len< (unsigned)(1+(n_elem*5))) {
2100 proto_tree_add_expert(tree, pinfo, &ei_nas_eps_wrong_nb_of_elems, tvb, curr_offset, len-(curr_offset-offset));
2101 return len;
2103 for (i=0; i < n_elem; i++) {
2104 /* type of list = "010" */
2105 /* MCC digit 2 MCC digit 1 octet 2
2106 * MNC digit 3 MCC digit 3 octet 3
2107 * MNC digit 2 MNC digit 1 octet 4
2109 curr_offset = dissect_e212_mcc_mnc(tvb, pinfo, tree, curr_offset, E212_TAI, true);
2110 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
2111 curr_offset+=2;
2113 break;
2114 default:
2115 /* Unknown ( Not in 3GPP TS 24.301 version 8.1.0 Release 8 ) */
2116 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_nas_eps_extraneous_data);
2117 curr_offset = offset + len;
2118 break;
2122 return curr_offset-offset;
2125 * 9.9.3.34 UE network capability
2128 static const true_false_string nas_eps_emm_ucs2_supp_flg_value = {
2129 "The UE has no preference between the use of the default alphabet and the use of UCS2",
2130 "The UE has a preference for the default alphabet"
2132 uint16_t
2133 de_emm_ue_net_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
2134 uint32_t offset, unsigned len,
2135 char *add_string _U_, int string_len _U_)
2137 uint32_t curr_offset;
2139 static int * const oct3_flags[] = {
2140 &hf_nas_eps_emm_eea0,
2141 &hf_nas_eps_emm_128eea1,
2142 &hf_nas_eps_emm_128eea2,
2143 &hf_nas_eps_emm_eea3,
2144 &hf_nas_eps_emm_eea4,
2145 &hf_nas_eps_emm_eea5,
2146 &hf_nas_eps_emm_eea6,
2147 &hf_nas_eps_emm_eea7,
2148 NULL
2151 static int * const oct4_flags[] = {
2152 &hf_nas_eps_emm_eia0,
2153 &hf_nas_eps_emm_128eia1,
2154 &hf_nas_eps_emm_128eia2,
2155 &hf_nas_eps_emm_eia3,
2156 &hf_nas_eps_emm_eia4,
2157 &hf_nas_eps_emm_eia5,
2158 &hf_nas_eps_emm_eia6,
2159 &hf_nas_eps_emm_eps_upip,
2160 NULL
2163 static int * const oct5_flags[] = {
2164 &hf_nas_eps_emm_uea0,
2165 &hf_nas_eps_emm_uea1,
2166 &hf_nas_eps_emm_uea2,
2167 &hf_nas_eps_emm_uea3,
2168 &hf_nas_eps_emm_uea4,
2169 &hf_nas_eps_emm_uea5,
2170 &hf_nas_eps_emm_uea6,
2171 &hf_nas_eps_emm_uea7,
2172 NULL
2175 static int * const oct6_flags[] = {
2176 &hf_nas_eps_emm_ucs2_supp,
2177 &hf_nas_eps_emm_uia1,
2178 &hf_nas_eps_emm_uia2,
2179 &hf_nas_eps_emm_uia3,
2180 &hf_nas_eps_emm_uia4,
2181 &hf_nas_eps_emm_uia5,
2182 &hf_nas_eps_emm_uia6,
2183 &hf_nas_eps_emm_uia7,
2184 NULL
2187 static int * const oct7_flags[] = {
2188 &hf_nas_eps_emm_prose_dd_cap,
2189 &hf_nas_eps_emm_prose_cap,
2190 &hf_nas_eps_emm_h245_ash_cap,
2191 &hf_nas_eps_emm_acc_csfb_cap,
2192 &hf_nas_eps_emm_lpp_cap,
2193 &hf_nas_eps_emm_lcs_cap,
2194 &hf_nas_eps_emm_1xsrvcc_cap,
2195 &hf_nas_eps_emm_nf_cap,
2196 NULL
2199 static int * const oct8_flags[] = {
2200 &hf_nas_eps_emm_epco_cap,
2201 &hf_nas_eps_emm_hc_cp_ciot_cap,
2202 &hf_nas_eps_emm_er_wo_pdn_cap,
2203 &hf_nas_eps_emm_s1u_data_cap,
2204 &hf_nas_eps_emm_up_ciot_cap,
2205 &hf_nas_eps_emm_cp_ciot_cap,
2206 &hf_nas_eps_emm_prose_relay_cap,
2207 &hf_nas_eps_emm_prose_dc_cap,
2208 NULL
2211 static int * const oct9_flags[] = {
2212 &hf_nas_eps_15_bearers_cap,
2213 &hf_nas_eps_sgc_cap,
2214 &hf_nas_eps_n1mode_cap,
2215 &hf_nas_eps_dcnr_cap,
2216 &hf_nas_eps_cp_backoff_cap,
2217 &hf_nas_eps_restrict_ec_cap,
2218 &hf_nas_eps_v2x_pc5_cap,
2219 &hf_nas_eps_multiple_drb_cap,
2220 NULL
2223 static int * const oct10_flags[] = {
2224 &hf_nas_eps_rpr_cap,
2225 &hf_nas_eps_piv_cap,
2226 &hf_nas_eps_ncr_cap,
2227 &hf_nas_eps_v2x_nr_pc5_cap,
2228 &hf_nas_eps_up_mt_edt_cap,
2229 &hf_nas_eps_cp_mt_edt_cap,
2230 &hf_nas_eps_wsua_cap,
2231 &hf_nas_eps_racs_cap,
2232 NULL
2235 static int * const oct11_flags[] = {
2236 &hf_nas_eps_rclin_cap,
2237 &hf_nas_eps_edc_cap,
2238 &hf_nas_eps_ptcc_cap,
2239 &hf_nas_eps_pr_cap,
2240 NULL
2243 curr_offset = offset;
2246 /* EPS encryption algorithms supported (octet 3) */
2247 /* EEA0 128-EEA1 128-EEA2 128-EEA3 EEA4 EEA5 EEA6 EEA7 */
2248 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct3_flags, ENC_NA);
2249 curr_offset++;
2251 /* EPS integrity algorithms supported (octet 4) */
2252 /* EIA0 128-EIA1 128-EIA2 128-EIA3 EIA4 EIA5 EIA6 EPS-UPIP */
2253 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct4_flags, ENC_NA);
2254 curr_offset++;
2257 /* Following octets are optional */
2258 if ((curr_offset - offset) >= len)
2259 return (len);
2261 /* UMTS encryption algorithms supported (octet 5)
2262 * UEA0 UEA1 UEA2 UEA3 UEA4 UEA5 UEA6 UEA7 */
2263 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct5_flags, ENC_NA);
2264 curr_offset++;
2266 if ((curr_offset - offset) >= len)
2267 return (len);
2269 /* Octet 6 */
2270 /* UCS2 UIA1 UIA2 UIA3 UIA4 UIA5 UIA6 UIA7 */
2271 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct6_flags, ENC_NA);
2272 curr_offset++;
2274 if ((curr_offset - offset) >= len)
2275 return (len);
2277 /* Octet 7
2278 * ProSe-dd ProSe H.245-ASH ACC-CSFB LPP LCS 1xSR VCC NF
2280 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct7_flags, ENC_NA);
2281 curr_offset++;
2283 if ((curr_offset - offset) >= len)
2284 return (len);
2286 /* Octet 8
2287 * ePCO HC-CP CIoT ERw/oPDN S1-U data UP CIoT CP CIoT Prose-relay ProSe-dc
2289 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct8_flags, ENC_NA);
2290 curr_offset++;
2292 if ((curr_offset - offset) >= len)
2293 return (len);
2295 /* Octet 9
2296 * 15 bearers SGC N1mode DCNR CP backoff RestrictEC V2X PC5 multipleDRB
2298 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct9_flags, ENC_NA);
2299 curr_offset++;
2301 if ((curr_offset - offset) >= len)
2302 return (len);
2304 /* Octet 10
2305 * RPR PIV NCR V2X NR-PC5 UP-MT-EDT CP-MT-EDT WSUA RACS
2307 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct10_flags, ENC_NA);
2308 curr_offset++;
2310 if ((curr_offset - offset) >= len)
2311 return (len);
2313 /* Octet 11
2314 * 0 0 0 0 RCLIN EDC PTCC PR
2316 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 4, ENC_BIG_ENDIAN);
2317 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct11_flags, ENC_NA);
2318 curr_offset++;
2320 while ((curr_offset - offset) < len) {
2321 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 8, ENC_BIG_ENDIAN);
2322 curr_offset++;
2325 return len;
2327 /* UE radio capability information update needed flag (URC upd) (octet 1) */
2328 static const true_false_string nas_eps_emm_ue_ra_cap_inf_upd_need_flg = {
2329 "UE radio capability information update needed",
2330 "UE radio capability information update not needed"
2334 * 9.9.3.35 UE radio capability information update needed
2337 static uint16_t
2338 de_emm_ue_ra_cap_inf_upd_need(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
2339 uint32_t offset, unsigned len _U_,
2340 char *add_string _U_, int string_len _U_)
2342 uint32_t curr_offset;
2344 curr_offset = offset;
2346 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+4, 3, ENC_BIG_ENDIAN);
2347 proto_tree_add_item(tree, hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2349 return len;
2352 * 9.9.3.36 UE security capability
2355 static uint16_t
2356 de_emm_ue_sec_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
2357 uint32_t offset, unsigned len _U_,
2358 char *add_string _U_, int string_len _U_)
2360 uint32_t curr_offset;
2362 static int * const oct3_flags[] = {
2363 &hf_nas_eps_emm_eea0,
2364 &hf_nas_eps_emm_128eea1,
2365 &hf_nas_eps_emm_128eea2,
2366 &hf_nas_eps_emm_eea3,
2367 &hf_nas_eps_emm_eea4,
2368 &hf_nas_eps_emm_eea5,
2369 &hf_nas_eps_emm_eea6,
2370 &hf_nas_eps_emm_eea7,
2371 NULL
2374 static int * const oct4_flags[] = {
2375 &hf_nas_eps_emm_eia0,
2376 &hf_nas_eps_emm_128eia1,
2377 &hf_nas_eps_emm_128eia2,
2378 &hf_nas_eps_emm_eia3,
2379 &hf_nas_eps_emm_eia4,
2380 &hf_nas_eps_emm_eia5,
2381 &hf_nas_eps_emm_eia6,
2382 &hf_nas_eps_emm_eps_upip,
2383 NULL
2386 static int * const oct5_flags[] = {
2387 &hf_nas_eps_emm_uea0,
2388 &hf_nas_eps_emm_uea1,
2389 &hf_nas_eps_emm_uea2,
2390 &hf_nas_eps_emm_uea3,
2391 &hf_nas_eps_emm_uea4,
2392 &hf_nas_eps_emm_uea5,
2393 &hf_nas_eps_emm_uea6,
2394 &hf_nas_eps_emm_uea7,
2395 NULL
2398 static int * const oct6_flags[] = {
2399 &hf_nas_eps_spare_b7,
2400 &hf_nas_eps_emm_uia1,
2401 &hf_nas_eps_emm_uia2,
2402 &hf_nas_eps_emm_uia3,
2403 &hf_nas_eps_emm_uia4,
2404 &hf_nas_eps_emm_uia5,
2405 &hf_nas_eps_emm_uia6,
2406 &hf_nas_eps_emm_uia7,
2407 NULL
2410 static int * const oct7_flags[] = {
2411 &hf_nas_eps_spare_b7,
2412 &hf_nas_eps_emm_gea1,
2413 &hf_nas_eps_emm_gea2,
2414 &hf_nas_eps_emm_gea3,
2415 &hf_nas_eps_emm_gea4,
2416 &hf_nas_eps_emm_gea5,
2417 &hf_nas_eps_emm_gea6,
2418 &hf_nas_eps_emm_gea7,
2419 NULL
2422 curr_offset = offset;
2424 /* EPS encryption algorithms supported (octet 3) */
2425 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct3_flags, ENC_NA);
2426 curr_offset++;
2428 /* EPS integrity algorithms supported (octet 4) */
2429 /* EIA0 128-EIA1 128-EIA2 128-EIA3 EIA4 EIA5 EIA6 EPS-UPIP */
2430 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct4_flags, ENC_NA);
2431 curr_offset++;
2433 /* Octets 5, 6, and 7 are optional. If octet 5 is included,
2434 * then also octet 6 shall be included and octet 7 may be included.
2436 if (len == 2)
2437 return len;
2439 /* UMTS encryption algorithms supported (octet 5)
2440 * UEA0 UEA1 UEA2 UEA3 UEA4 UEA5 UEA6 UEA7
2442 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct5_flags, ENC_NA);
2443 curr_offset++;
2445 /* UMTS integrity algorithms supported (octet 6) */
2446 /* Spare UIA1 UIA2 UIA3 UIA4 UIA5 UIA6 UIA7 */
2447 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct6_flags, ENC_NA);
2448 curr_offset++;
2450 if (len == 4)
2451 return len;
2453 /* GPRS encryption algorithms supported (octet 7) */
2454 /* 0 spare GEA1 GEA2 GEA3 GEA4 GEA5 GEA6 GEA7*/
2455 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct7_flags, ENC_NA);
2456 curr_offset++;
2458 return len;
2461 * 9.9.3.37 Emergency Number List
2462 * See subclause 10.5.3.13 in 3GPP TS 24.008 [13].
2463 * packet-gsm_a_dtap.c
2467 * 9.9.3.37a Extended Emergency Number List
2469 static true_false_string tfs_eenlv_value = {
2470 "Valid only in the PLMN from which this IE is received",
2471 "Valid in the country of the PLMN from which this IE is received"
2474 static uint16_t
2475 de_emm_ext_emerg_num_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
2476 uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
2478 uint32_t saved_offset, curr_offset = offset;
2479 uint32_t length, i = 1;
2480 proto_item *pi;
2481 proto_tree *sub_tree;
2483 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 7, ENC_BIG_ENDIAN);
2484 proto_tree_add_item(tree, hf_eps_emm_ext_emerg_num_list_eenlv, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2485 curr_offset++;
2486 while ((curr_offset - offset) < len) {
2487 saved_offset = curr_offset;
2488 sub_tree = proto_tree_add_subtree_format(tree, tvb, curr_offset, -1, ett_nas_eps_ext_emerg_num,
2489 &pi, "Extended emergency number #%u", i++);
2490 proto_tree_add_item_ret_uint(sub_tree, hf_eps_emm_ext_emerg_num_list_emerg_num_len,
2491 tvb, curr_offset, 1, ENC_NA, &length);
2492 curr_offset++;
2493 if (length > 0) {
2494 proto_tree_add_item(sub_tree, hf_eps_emm_ext_emerg_num_list_emerg_num, tvb, curr_offset, length, ENC_BCD_DIGITS_0_9|ENC_LITTLE_ENDIAN);
2495 curr_offset += length;
2497 proto_tree_add_item_ret_uint(sub_tree, hf_eps_emm_ext_emerg_num_list_sub_serv_field_len,
2498 tvb, curr_offset, 1, ENC_NA, &length);
2499 curr_offset++;
2500 if (length > 0) {
2501 proto_tree_add_ts_23_038_7bits_packed_item(sub_tree, hf_eps_emm_ext_emerg_num_list_sub_serv_field,
2502 tvb, curr_offset<<3, (length<<3)/7);
2503 curr_offset += length;
2505 proto_item_set_len(pi, curr_offset - saved_offset);
2508 return len;
2512 * 9.9.3.38 CLI
2516 * The coding of the CLI value part is the same as for octets 3 to 14
2517 * of the Calling party BCD number information element defined in
2518 * subclause 10.5.4.9 of 3GPP TS 24.008
2522 * 9.9.3.39 SS Code
2524 static uint16_t
2525 de_emm_ss_code(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
2526 uint32_t offset, unsigned len,
2527 char *add_string _U_, int string_len _U_)
2529 uint32_t curr_offset;
2531 curr_offset = offset;
2534 * SS Code value
2535 * The coding of the SS Code value is given in subclause 17.7.5 of 3GPP TS 29.002 [15B].
2536 * value string imported from gsm map
2538 proto_tree_add_item(tree, hf_nas_eps_emm_ss_code, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2540 return len;
2544 * 9.9.3.40 LCS indicator
2546 /* LCS indicator value */
2547 static const value_string nas_eps_emm_lcs_ind_vals[] = {
2548 { 0, "Normal, unspecified"},
2549 { 1, "MT-LR"},
2550 { 0, NULL }
2554 static uint16_t
2555 de_emm_lcs_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
2556 uint32_t offset, unsigned len _U_,
2557 char *add_string _U_, int string_len _U_)
2559 uint32_t curr_offset;
2561 curr_offset = offset;
2564 proto_tree_add_item(tree, hf_nas_eps_emm_lcs_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2566 return len;
2569 * 9.9.3.41 LCS client identity
2571 static uint16_t
2572 de_emm_lcs_client_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
2573 uint32_t offset, unsigned len _U_,
2574 char *add_string _U_, int string_len _U_)
2576 uint32_t curr_offset;
2577 tvbuff_t *new_tvb;
2579 curr_offset = offset;
2581 /* LCS client identity (value part)
2582 * The coding of the value part of the LCS client identity is given
2583 * in subclause 17.7.13 of 3GPP TS 29.002 [15B](GSM MAP).
2585 new_tvb = tvb_new_subset_length(tvb, curr_offset, len);
2586 dissect_gsm_map_lcs_LCS_ClientID_PDU( new_tvb, pinfo, tree, NULL );
2588 return len;
2592 * 9.9.3.42 Generic message container type
2594 static const range_string nas_eps_emm_gen_msg_cont_type_vals[] = {
2595 { 0, 0, "Reserved"},
2596 { 1, 1, "LTE Positioning Protocol (LPP) message container"},
2597 { 2, 2, "Location services message container"},
2598 { 3, 127, "Unused"},
2599 { 128, 255, "Reserved"},
2600 { 0, 0, NULL }
2603 static uint16_t
2604 de_emm_gen_msg_cont_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
2605 uint32_t offset, unsigned len _U_,
2606 char *add_string _U_, int string_len _U_)
2608 uint32_t curr_offset, msg_cont_type;
2610 curr_offset = offset;
2612 proto_tree_add_item_ret_uint(tree, hf_nas_eps_emm_gen_msg_cont_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &msg_cont_type);
2613 p_add_proto_data(pinfo->pool, pinfo, proto_nas_eps, 0, GUINT_TO_POINTER(msg_cont_type));
2614 curr_offset++;
2616 return curr_offset - offset;
2619 * 9.9.3.43 Generic message container
2621 static uint16_t
2622 de_emm_gen_msg_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
2623 uint32_t offset, unsigned len,
2624 char *add_string _U_, int string_len _U_)
2626 proto_item *item;
2627 proto_tree *sub_tree;
2628 tvbuff_t *new_tvb;
2630 item = proto_tree_add_item(tree, hf_nas_eps_gen_msg_cont, tvb, offset, len, ENC_NA);
2631 sub_tree = proto_item_add_subtree(item, ett_nas_eps_gen_msg_cont);
2633 new_tvb = tvb_new_subset_length(tvb, offset, len);
2635 switch (GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_nas_eps, 0))) {
2636 case 1:
2637 /* LPP */
2638 if (lpp_handle) {
2639 call_dissector(lpp_handle, new_tvb, pinfo, sub_tree);
2641 break;
2642 case 2:
2643 /* Location services */
2644 if (gsm_a_dtap_handle) {
2645 call_dissector(gsm_a_dtap_handle, new_tvb, pinfo, sub_tree);
2647 break;
2648 default:
2649 break;
2652 return len;
2655 * 9.9.3.44 Voice domain preference and UE's usage setting
2656 * See subclause 10.5.5.28 in 3GPP TS 24.008 [13].
2657 * packet-gsm_a_dtap.c
2660 * 9.9.3.45 GUTI type
2662 static const true_false_string nas_eps_emm_guti_type_value = {
2663 "Mapped GUTI",
2664 "Native GUTI"
2667 static uint16_t
2668 de_emm_guti_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
2669 uint32_t offset, unsigned len _U_,
2670 char *add_string _U_, int string_len _U_)
2672 uint32_t curr_offset, bit_offset;
2674 curr_offset = offset;
2675 bit_offset = (curr_offset<<3)+4;
2677 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2678 bit_offset += 3;
2679 proto_tree_add_bits_item(tree, hf_nas_eps_emm_guti_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2680 curr_offset++;
2682 return (curr_offset - offset);
2686 * 9.9.3.46 Extended DRX parameters
2687 * See subclause 10.5.5.32 in 3GPP TS 24.008
2691 * 9.9.3.47 Data service type
2692 * Coded inline 1/2 octet
2696 * 9.9.3.48 DCN-ID
2697 * See subclause 10.5.5.35 in 3GPP TS 24.008
2701 * 9.9.3.49 Non-3GPP NW provided policies
2702 * See subclause 10.5.5.37 in 3GPP TS 24.008
2706 * 9.9.3.50 HashMME
2708 static uint16_t
2709 de_emm_hash_mme(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
2711 proto_tree_add_item(tree, hf_nas_eps_hash_mme, tvb, offset, 8, ENC_NA);
2713 return len;
2717 * 9.9.3.51 Replayed NAS message container
2719 static uint16_t
2720 de_emm_replayed_nas_msg_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
2722 proto_item *item;
2723 proto_tree *sub_tree;
2725 item = proto_tree_add_item(tree, hf_nas_eps_replayed_nas_msg_cont, tvb, offset, len, ENC_NA);
2726 sub_tree = proto_item_add_subtree(item, ett_nas_eps_replayed_nas_msg_cont);
2728 tvbuff_t *replayed_tvb = tvb_new_subset_length(tvb, offset, len);
2729 TRY {
2730 dissect_nas_eps_emm_msg(replayed_tvb, pinfo, sub_tree, 0, true);
2731 } CATCH_BOUNDS_ERRORS {
2732 show_exception(replayed_tvb, pinfo, sub_tree, EXCEPT_CODE, GET_MESSAGE);
2733 } ENDTRY
2735 return len;
2739 * 9.9.3.52 Network policy
2741 static const true_false_string nas_eps_redir_policy_vals = {
2742 "Unsecured redirection to GERAN or UTRAN not allowed",
2743 "Unsecured redirection to GERAN or UTRAN allowed"
2746 static uint16_t
2747 de_emm_network_policy(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
2749 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (offset<<3)+4, 3, ENC_NA);
2750 proto_tree_add_item(tree, hf_nas_eps_redir_policy, tvb, offset, 1, ENC_NA);
2752 return 1;
2756 * 9.9.3.53 UE additional security capability
2758 uint16_t
2759 de_emm_ue_add_sec_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
2761 uint32_t curr_offset;
2763 static int * const oct3_flags[] = {
2764 &hf_nas_eps_emm_5g_ea0,
2765 &hf_nas_eps_emm_128_5g_ea1,
2766 &hf_nas_eps_emm_128_5g_ea2,
2767 &hf_nas_eps_emm_128_5g_ea3,
2768 &hf_nas_eps_emm_5g_ea4,
2769 &hf_nas_eps_emm_5g_ea5,
2770 &hf_nas_eps_emm_5g_ea6,
2771 &hf_nas_eps_emm_5g_ea7,
2772 NULL
2775 static int * const oct4_flags[] = {
2776 &hf_nas_eps_emm_5g_ea8,
2777 &hf_nas_eps_emm_5g_ea9,
2778 &hf_nas_eps_emm_5g_ea10,
2779 &hf_nas_eps_emm_5g_ea11,
2780 &hf_nas_eps_emm_5g_ea12,
2781 &hf_nas_eps_emm_5g_ea13,
2782 &hf_nas_eps_emm_5g_ea14,
2783 &hf_nas_eps_emm_5g_ea15,
2784 NULL
2787 static int * const oct5_flags[] = {
2788 &hf_nas_eps_emm_5g_ia0,
2789 &hf_nas_eps_emm_128_5g_ia1,
2790 &hf_nas_eps_emm_128_5g_ia2,
2791 &hf_nas_eps_emm_128_5g_ia3,
2792 &hf_nas_eps_emm_5g_ia4,
2793 &hf_nas_eps_emm_5g_ia5,
2794 &hf_nas_eps_emm_5g_ia6,
2795 &hf_nas_eps_emm_5g_ia7,
2796 NULL
2799 static int * const oct6_flags[] = {
2800 &hf_nas_eps_emm_5g_ia8,
2801 &hf_nas_eps_emm_5g_ia9,
2802 &hf_nas_eps_emm_5g_ia10,
2803 &hf_nas_eps_emm_5g_ia11,
2804 &hf_nas_eps_emm_5g_ia12,
2805 &hf_nas_eps_emm_5g_ia13,
2806 &hf_nas_eps_emm_5g_ia14,
2807 &hf_nas_eps_emm_5g_ia15,
2808 NULL
2811 curr_offset = offset;
2813 /* 5GS encryption algorithms supported (octet 3) */
2814 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct3_flags, ENC_NA);
2815 curr_offset++;
2817 /* 5GS encryption algorithms supported (octet 4) */
2818 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct4_flags, ENC_NA);
2819 curr_offset++;
2821 /* 5GS integrity algorithms supported (octet 5) */
2822 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct5_flags, ENC_NA);
2823 curr_offset++;
2825 /* 5GS integrity algorithms supported (octet 6) */
2826 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, oct6_flags, ENC_NA);
2827 curr_offset++;
2829 return 4;
2833 * 9.9.3.54 UE status
2834 * see packet-nas_5gs.c
2838 * 9.9.3.55 Additional information requested
2840 static uint16_t
2841 de_emm_add_info_req(tvbuff_t *tvb , proto_tree *tree, packet_info *pinfo _U_,
2842 uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
2844 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, offset<<3, 7, ENC_BIG_ENDIAN);
2845 proto_tree_add_item(tree, hf_nas_eps_emm_cipher_key, tvb, offset, 1, ENC_BIG_ENDIAN);
2847 return 1;
2851 * 9.9.3.56 Ciphering key data
2854 static uint16_t
2855 de_emm_ciph_key_data(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset,
2856 unsigned len, char *add_string _U_, int string_len _U_)
2858 uint32_t saved_offset, curr_offset = offset, c0_len, tai_len, i = 1;
2859 uint8_t oct;
2860 struct tm tm;
2861 nstime_t tv;
2862 proto_item *pi;
2863 proto_tree *sub_tree;
2865 while ((curr_offset - offset) < len) {
2866 static int * const flags1[] = {
2867 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_1,
2868 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_2,
2869 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_3,
2870 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_4,
2871 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_5,
2872 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_6,
2873 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_7,
2874 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_1,
2875 NULL
2877 static int * const flags2[] = {
2878 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_2,
2879 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_3,
2880 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_4,
2881 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_5,
2882 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_6,
2883 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_7,
2884 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_8,
2885 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_9,
2886 NULL
2888 static int * const flags3[] = {
2889 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_10,
2890 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_11,
2891 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_12,
2892 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_13,
2893 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_14,
2894 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_15,
2895 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_16,
2896 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_17,
2897 NULL
2899 static int * const flags4[] = {
2900 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_18,
2901 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_19,
2902 &hf_nas_eps_emm_ciph_key_data_pos_sib_type_3_1,
2903 NULL
2905 saved_offset = curr_offset;
2906 sub_tree = proto_tree_add_subtree_format(tree, tvb, curr_offset, -1, ett_nas_eps_ciph_data_set,
2907 &pi, "Ciphering data set #%u", i++);
2908 proto_tree_add_item(sub_tree, hf_nas_eps_emm_ciph_key_data_ciphering_set_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
2909 curr_offset += 2;
2910 proto_tree_add_item(sub_tree, hf_nas_eps_emm_ciph_key_data_ciphering_key, tvb, curr_offset, 16, ENC_NA);
2911 curr_offset += 16;
2912 proto_tree_add_bits_item(sub_tree, hf_nas_eps_spare_bits, tvb, offset<<3, 3, ENC_BIG_ENDIAN);
2913 proto_tree_add_item_ret_uint(sub_tree, hf_nas_eps_emm_ciph_key_data_c0_len, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &c0_len);
2914 curr_offset++;
2915 if (c0_len) {
2916 proto_tree_add_item(sub_tree, hf_nas_eps_emm_ciph_key_data_c0, tvb, curr_offset, c0_len, ENC_NA);
2917 curr_offset += c0_len;
2919 proto_tree_add_bitmask_list(sub_tree, tvb, curr_offset, 1, flags1, ENC_NA);
2920 curr_offset++;
2921 proto_tree_add_bitmask_list(sub_tree, tvb, curr_offset, 1, flags2, ENC_NA);
2922 curr_offset++;
2923 proto_tree_add_bitmask_list(sub_tree, tvb, curr_offset, 1, flags3, ENC_NA);
2924 curr_offset++;
2925 proto_tree_add_bitmask_list(sub_tree, tvb, curr_offset, 1, flags4, ENC_NA);
2926 curr_offset++;
2927 tm.tm_wday = 0;
2928 tm.tm_yday = 0;
2929 tm.tm_isdst = -1;
2930 oct = tvb_get_uint8(tvb, curr_offset);
2931 tm.tm_year = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4) + 100;
2932 oct = tvb_get_uint8(tvb, curr_offset+1);
2933 tm.tm_mon = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4) - 1;
2934 oct = tvb_get_uint8(tvb, curr_offset+2);
2935 tm.tm_mday = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
2936 oct = tvb_get_uint8(tvb, curr_offset+3);
2937 tm.tm_hour = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
2938 oct = tvb_get_uint8(tvb, curr_offset+4);
2939 tm.tm_min = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
2940 tm.tm_sec = 0;
2941 tv.secs = mktime(&tm);
2942 tv.nsecs = 0;
2943 proto_tree_add_time_format_value(sub_tree, hf_nas_eps_emm_ciph_key_data_validity_start_time, tvb, curr_offset, 5, &tv,
2944 "%s", abs_time_to_str(pinfo->pool, &tv, ABSOLUTE_TIME_LOCAL, false));
2945 curr_offset += 5;
2946 proto_tree_add_item(sub_tree, hf_nas_eps_emm_ciph_key_data_validity_duration, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
2947 curr_offset += 2;
2948 proto_tree_add_item_ret_uint(sub_tree, hf_nas_eps_emm_ciph_key_data_tais_list_len, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &tai_len);
2949 curr_offset++;
2950 if (tai_len) {
2951 de_emm_trac_area_id_lst(tvb, sub_tree, pinfo, curr_offset, tai_len, NULL, 0);
2952 curr_offset += tai_len;
2954 proto_item_set_len(pi, curr_offset - saved_offset);
2957 return len;
2961 * 9.9.3.57 N1 UE network capability
2963 static const value_string nas_eps_emm_5gs_pnb_ciot_vals[] = {
2964 { 0x0, "No additional information"},
2965 { 0x1, "Control plane CIoT 5GS optimization"},
2966 { 0x2, "User plane CIoT 5GS optimization"},
2967 { 0x3, "Reserved"},
2968 { 0, NULL }
2971 static uint16_t
2972 de_emm_n1_ue_network_cap(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_,
2973 uint32_t offset, unsigned len _U_, char* add_string _U_, int string_len _U_)
2975 static int* const flags_oct1[] = {
2976 &hf_nas_eps_emm_5g_ehc_cp_ciot,
2977 &hf_nas_eps_emm_5gs_pnb_ciot,
2978 &hf_nas_eps_emm_5g_up_ciot,
2979 &hf_nas_eps_emm_5g_hc_cp_ciot,
2980 &hf_nas_eps_emm_n3_data,
2981 &hf_nas_eps_emm_5g_cp_ciot,
2982 NULL
2985 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (offset<<3), 1, ENC_BIG_ENDIAN);
2986 proto_tree_add_bitmask_list(tree, tvb, offset, 1, flags_oct1, ENC_NA);
2988 return 1;
2992 * 9.9.3.58 UE radio capability ID availability
2994 static const value_string nas_eps_emm_ue_radio_cap_id_avail_vals[] = {
2995 { 0x0, "Not available"},
2996 { 0x1, "Available"},
2997 { 0, NULL }
3000 static uint16_t
3001 de_emm_ue_radio_cap_id_avail(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_,
3002 uint32_t offset, unsigned len, char* add_string _U_, int string_len _U_)
3004 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (offset<<3), 5, ENC_BIG_ENDIAN);
3005 proto_tree_add_item(tree, hf_nas_eps_emm_ue_radio_cap_id_available, tvb, offset, 1, ENC_BIG_ENDIAN);
3007 return len;
3011 * 9.9.3.59 UE radio capability ID request
3013 static uint16_t
3014 de_emm_ue_radio_cap_id_req(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_,
3015 uint32_t offset, unsigned len, char* add_string _U_, int string_len _U_)
3017 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (offset<<3), 7, ENC_BIG_ENDIAN);
3018 proto_tree_add_item(tree, hf_nas_eps_emm_ue_radio_cap_id_request, tvb, offset, 1, ENC_BIG_ENDIAN);
3020 return len;
3023 /* 9.9.3.60 UE radio capability ID
3024 * See subclause 9.11.3.68 in 3GPP TS 24.501
3027 /* 9.9.3.61 UE radio capability ID deletion indication
3028 * See subclause 9.11.3.69 in 3GPP TS 24.501
3032 * 9.9.3.62 WUS assistance information
3034 static const value_string nas_eps_emm_wus_assist_info_type_vals[] = {
3035 { 0x0, "UE paging probability information"},
3036 { 0, NULL }
3039 static void
3040 de_emm_wus_assist_info_ue_paging_prob_fmt(char *s, uint32_t val)
3042 if (val < 20) {
3043 snprintf(s, ITEM_LABEL_LENGTH, "p%u (%u)", val*5, val);
3044 } else {
3045 snprintf(s, ITEM_LABEL_LENGTH, "p100 (%u)", val);
3049 static uint16_t
3050 de_emm_wus_assist_info(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_,
3051 uint32_t offset, unsigned len, char* add_string _U_, int string_len _U_)
3053 uint32_t curr_offset = offset;
3054 unsigned count = 1;
3056 while ((curr_offset - offset) < len) {
3057 uint32_t type;
3058 proto_tree *subtree;
3060 subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, 1, ett_nas_eps_wus_assist_info_type,
3061 NULL, "WUS assistance information type %u", count);
3062 proto_tree_add_item_ret_uint(subtree, hf_nas_eps_emm_wus_assist_info_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &type);
3063 if (type == 0) {
3064 proto_tree_add_item(subtree, hf_nas_eps_emm_wus_assist_info_ue_paging_prob, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3066 curr_offset++;
3067 count++;
3070 return len;
3074 * 9.9.3.63 NB-S1 DRX parameter
3076 static const value_string nas_eps_emm_nb_s1_drx_params_vals[] = {
3077 { 0x0, "DRX value not specified and use cell specific DRX value"},
3078 { 0x1, "DRX cycle parameter T = 32"},
3079 { 0x2, "DRX cycle parameter T = 64"},
3080 { 0x3, "DRX cycle parameter T = 128"},
3081 { 0x4, "DRX cycle parameter T = 256"},
3082 { 0x5, "DRX cycle parameter T = 512"},
3083 { 0x6, "DRX cycle parameter T = 1024"},
3084 { 0, NULL }
3087 static uint16_t
3088 de_emm_nb_s1_drx_param(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_,
3089 uint32_t offset, unsigned len, char* add_string _U_, int string_len _U_)
3091 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (offset<<3), 4, ENC_BIG_ENDIAN);
3092 proto_tree_add_item(tree, hf_nas_eps_emm_nb_s1_drx_param, tvb, offset, 1, ENC_BIG_ENDIAN);
3094 return len;
3098 * 9.9.3.64 IMSI offset
3100 static uint16_t
3101 de_emm_imsi_offset(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_,
3102 uint32_t offset, unsigned len, char* add_string _U_, int string_len _U_)
3104 proto_tree_add_item(tree, hf_nas_eps_emm_imsi_offset, tvb, offset, 2, ENC_BIG_ENDIAN);
3106 return len;
3110 * 9.9.3.65 UE request type
3112 static const value_string nas_eps_emm_ue_request_type_vals[] = {
3113 { 0x1, "NAS signalling connection release"},
3114 { 0x2, "Rejection of paging"},
3115 { 0, NULL }
3118 static uint16_t
3119 de_emm_ue_request_type(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_,
3120 uint32_t offset, unsigned len, char* add_string _U_, int string_len _U_)
3122 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, offset<<3, 4, ENC_BIG_ENDIAN);
3123 proto_tree_add_bits_item(tree, hf_nas_eps_emm_ue_request_type, tvb, (offset<<3) + 4, 4, ENC_BIG_ENDIAN);
3125 return len;
3129 * 9.9.3.66 Paging restriction
3131 static const value_string nas_eps_emm_paging_restriction_type_vals[] = {
3132 { 0x1, "All paging is restricted"},
3133 { 0x2, "All paging is restricted except for voice service"},
3134 { 0x3, "All paging is restricted except for specified PDN connection(s)"},
3135 { 0x4, "All paging is restricted except for voice service and specified PDN connection(s)"},
3136 { 0, NULL }
3139 static uint16_t
3140 de_emm_paging_restriction(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_,
3141 uint32_t offset, unsigned len _U_, char* add_string _U_, int string_len _U_)
3143 uint64_t type;
3144 uint32_t curr_offset = offset;
3146 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
3147 proto_tree_add_bits_ret_val(tree, hf_nas_eps_emm_paging_restriction_type,
3148 tvb, (curr_offset<<3)+4, 4, &type, ENC_BIG_ENDIAN);
3149 curr_offset++;
3150 if (type == 3 || type == 4) {
3151 static int* const flags[] = {
3152 &hf_nas_eps_emm_paging_restriction_ebi7,
3153 &hf_nas_eps_emm_paging_restriction_ebi6,
3154 &hf_nas_eps_emm_paging_restriction_ebi5,
3155 &hf_nas_eps_emm_paging_restriction_ebi4,
3156 &hf_nas_eps_emm_paging_restriction_ebi3,
3157 &hf_nas_eps_emm_paging_restriction_ebi2,
3158 &hf_nas_eps_emm_paging_restriction_ebi1,
3159 &hf_nas_eps_emm_paging_restriction_ebi0,
3160 &hf_nas_eps_emm_paging_restriction_ebi15,
3161 &hf_nas_eps_emm_paging_restriction_ebi14,
3162 &hf_nas_eps_emm_paging_restriction_ebi13,
3163 &hf_nas_eps_emm_paging_restriction_ebi12,
3164 &hf_nas_eps_emm_paging_restriction_ebi11,
3165 &hf_nas_eps_emm_paging_restriction_ebi10,
3166 &hf_nas_eps_emm_paging_restriction_ebi9,
3167 &hf_nas_eps_emm_paging_restriction_ebi8,
3168 NULL
3171 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 2, flags, ENC_BIG_ENDIAN);
3172 curr_offset += 2;
3175 return (curr_offset - offset);
3179 * 9.9.3.67 EPS additional request result
3181 static const value_string nas_eps_emm_eps_add_req_result_vals[] = {
3182 { 0x0, "no additional information"},
3183 { 0x1, "paging restriction is accepted"},
3184 { 0x2, "paging restriction is rejected"},
3185 { 0, NULL }
3188 static uint16_t
3189 de_emm_eps_add_req_result(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_,
3190 uint32_t offset, unsigned len, char* add_string _U_, int string_len _U_)
3192 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, offset<<3, 6, ENC_BIG_ENDIAN);
3193 proto_tree_add_bits_item(tree, hf_nas_eps_emm_paging_restriction_decision, tvb, (offset<<3) + 6, 2, ENC_BIG_ENDIAN);
3195 return len;
3199 * 9.9.3.69 Unavailability information
3201 static const value_string nas_eps_emm_unavail_info_type[] = {
3202 { 0x0, "unavailability due to UE reasons"},
3203 { 0x1, "unavailability due to discontinuous coverage"},
3204 { 0, NULL }
3207 static uint16_t
3208 de_emm_unavail_info(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_,
3209 uint32_t offset, unsigned len, char* add_string _U_, int string_len _U_)
3211 static int * const oct3[] = {
3212 &hf_nas_eps_emm_unavail_info_suppi,
3213 &hf_nas_eps_emm_unavail_info_updpi,
3214 &hf_nas_eps_emm_unavail_info_type,
3215 NULL
3217 uint64_t flags;
3219 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, offset<<3, 3, ENC_NA);
3220 proto_tree_add_bitmask_list_ret_uint64(tree, tvb, offset, 1, oct3, ENC_NA, &flags);
3221 offset++;
3222 if (flags & 0x08) {
3223 proto_tree_add_item(tree, hf_nas_eps_emm_unavail_info_unavail_period_duration, tvb, offset, 3, ENC_BIG_ENDIAN);
3224 offset += 3;
3226 if (flags & 0x10) {
3227 proto_tree_add_item(tree, hf_nas_eps_emm_unavail_info_start_unavail_period, tvb, offset, 3, ENC_BIG_ENDIAN);
3228 /* offset += 3; */
3231 return len;
3235 * 9.9.3.70 Unavailability configuration
3237 static const true_false_string nas_eps_emm_unavail_config_eupr_flg = {
3238 "UE does not need to report end of unavailability period",
3239 "UE needs to report end of unavailability period"
3242 static uint16_t
3243 de_emm_unavail_config(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_,
3244 uint32_t offset, unsigned len, char* add_string _U_, int string_len _U_)
3246 static int * const oct3[] = {
3247 &hf_nas_eps_emm_unavail_config_suppi,
3248 &hf_nas_eps_emm_unavail_config_updpi,
3249 &hf_nas_eps_emm_unavail_config_eupr,
3250 NULL
3252 uint64_t flags;
3254 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, offset<<3, 5, ENC_NA);
3255 proto_tree_add_bitmask_list_ret_uint64(tree, tvb, offset, 1, oct3, ENC_NA, &flags);
3256 offset++;
3257 if (flags & 0x02) {
3258 proto_tree_add_item(tree, hf_nas_eps_emm_unavail_config_unavail_period_duration, tvb, offset, 3, ENC_BIG_ENDIAN);
3259 offset += 3;
3261 if (flags & 0x04) {
3262 proto_tree_add_item(tree, hf_nas_eps_emm_unavail_config_start_unavail_period, tvb, offset, 3, ENC_BIG_ENDIAN);
3263 /* offset += 3; */
3266 return len;
3270 * 9.9.3.71 UE information request
3272 static uint16_t
3273 de_emm_ue_info_req(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_,
3274 uint32_t offset, unsigned len _U_, char* add_string _U_, int string_len _U_)
3276 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (offset<<3) + 4, 3, ENC_NA);
3277 proto_tree_add_item(tree, hf_nas_eps_emm_ue_info_req_uclir, tvb, offset, 1, ENC_NA);
3279 return len;
3283 * 9.9.3.72 UE coarse location information
3285 static uint16_t
3286 de_emm_ue_coarse_loc_info(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_,
3287 uint32_t offset, unsigned len, char* add_string _U_, int string_len _U_)
3289 dissect_lpp_Ellipsoid_Point_PDU(tvb_new_subset_length(tvb, offset, len), pinfo, tree, NULL);
3291 return len;
3295 * 9.9.4 EPS Session Management (ESM) information elements
3299 * 9.9.4.1 Access point name
3300 * See subclause 10.5.6.1 in 3GPP TS 24.008 [6].
3303 * 9.9.4.2 APN aggregate maximum bit rate
3306 uint16_t
3307 de_esm_apn_aggr_max_br(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
3308 uint32_t offset, unsigned len _U_,
3309 char *add_string _U_, int string_len _U_)
3311 uint32_t curr_offset;
3312 uint8_t octet;
3313 uint32_t dl_total = 0;
3314 uint32_t ul_total = 0;
3315 uint32_t bitrate = 0;
3317 curr_offset = offset;
3318 /* APN-AMBR for downlink octet 3 */
3319 octet = tvb_get_uint8(tvb,curr_offset);
3320 if (octet == 0) {
3321 proto_tree_add_uint_format(tree, hf_nas_eps_esm_apn_ambr_dl, tvb, curr_offset, 1, octet,
3322 "Reserved");
3323 } else {
3324 bitrate = calc_bitrate(octet);
3325 dl_total = bitrate;
3326 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_apn_ambr_dl, tvb, curr_offset, 1, octet,
3327 "%u kbps", bitrate);
3329 curr_offset++;
3331 /* APN-AMBR for uplink octet 4 */
3332 octet = tvb_get_uint8(tvb,curr_offset);
3333 if (octet == 0) {
3334 proto_tree_add_uint_format(tree, hf_nas_eps_esm_apn_ambr_ul, tvb, curr_offset, 1, octet,
3335 "Reserved");
3336 } else {
3337 bitrate = calc_bitrate(octet);
3338 ul_total = bitrate;
3339 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_apn_ambr_ul, tvb, curr_offset, 1, octet,
3340 "%u kbps", bitrate);
3342 curr_offset++;
3343 if ((curr_offset - offset) >= len)
3344 return len;
3345 /* APN-AMBR for downlink (extended) octet 5 */
3346 octet = tvb_get_uint8(tvb,curr_offset);
3347 if (octet == 0) {
3348 proto_tree_add_uint_format(tree, hf_nas_eps_esm_apn_ambr_dl_ext, tvb, curr_offset, 1, octet,
3349 "Use the value indicated by the APN-AMBR for downlink");
3350 } else {
3351 bitrate = calc_bitrate_ext(octet);
3352 dl_total = (octet > 0x4a) ? bitrate*1000 : bitrate;
3353 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_apn_ambr_dl_ext, tvb, curr_offset, 1, octet,
3354 "%u %s", bitrate, (octet > 0x4a) ? "Mbps" : "kbps");
3356 if (len < 5) {
3357 /* APN-AMBR for downlink (extended-2) is not present; display total now */
3358 if (dl_total >= 1000) {
3359 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_apn_ambr_dl_total, tvb, curr_offset, 1, dl_total, "%.3f Mbps", (float)dl_total / 1000);
3360 } else {
3361 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_apn_ambr_dl_total, tvb, curr_offset, 1, dl_total, "%u kbps", dl_total);
3364 curr_offset++;
3365 if ((curr_offset - offset) >= len)
3366 return len;
3367 /* APN-AMBR for uplink (extended) octet 6 */
3368 octet = tvb_get_uint8(tvb,curr_offset);
3369 if (octet == 0) {
3370 proto_tree_add_uint_format(tree, hf_nas_eps_esm_apn_ambr_ul_ext, tvb, curr_offset, 1, octet,
3371 "Use the value indicated by the APN-AMBR for uplink");
3372 } else {
3373 bitrate = calc_bitrate_ext(octet);
3374 ul_total = (octet > 0x4a) ? bitrate*1000 : bitrate;
3375 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_apn_ambr_ul_ext, tvb, curr_offset, 1, octet,
3376 "%u %s", bitrate, (octet > 0x4a) ? "Mbps" : "kbps");
3378 if (len < 6) {
3379 /* APN-AMBR for uplink (extended-2) is not present; display total now */
3380 if (ul_total >= 1000) {
3381 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_apn_ambr_ul_total, tvb, curr_offset, 1, ul_total, "%.3f Mbps", (float)ul_total / 1000);
3382 } else {
3383 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_apn_ambr_ul_total, tvb, curr_offset, 1, ul_total, "%u kbps", ul_total);
3386 curr_offset++;
3387 if ((curr_offset - offset) >= len)
3388 return len;
3389 /* APN-AMBR for downlink (extended-2) octet 7 */
3390 octet = tvb_get_uint8(tvb,curr_offset);
3391 if ((octet == 0)||(octet == 0xff)) {
3392 proto_tree_add_uint_format(tree, hf_nas_eps_esm_apn_ambr_dl_ext2, tvb, curr_offset, 1, octet,
3393 "Use the value indicated by the APN-AMBR for downlink and APN-AMBR for downlink (extended)");
3394 } else {
3395 dl_total += octet*256*1000;
3396 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_apn_ambr_dl_ext2, tvb, curr_offset, 1, octet,
3397 "%u Mbps", (octet* 256));
3399 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_apn_ambr_dl_total, tvb, curr_offset, 1, dl_total, "%.3f Mbps", (float)dl_total / 1000);
3400 curr_offset++;
3401 if ((curr_offset - offset) >= len)
3402 return len;
3403 /* APN-AMBR for uplink (extended-2) octet 8 */
3404 octet = tvb_get_uint8(tvb,curr_offset);
3405 if ((octet == 0)||(octet == 0xff)) {
3406 proto_tree_add_uint_format(tree, hf_nas_eps_esm_apn_ambr_ul_ext2, tvb, curr_offset, 1, octet,
3407 "Use the value indicated by the APN-AMBR for uplink and APN-AMBR for uplink (extended)");
3408 } else {
3409 ul_total += octet*256*1000;
3410 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_apn_ambr_ul_ext2, tvb, curr_offset, 1, octet,
3411 "%u Mbps", (octet* 256));
3413 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_apn_ambr_ul_total, tvb, curr_offset, 1, ul_total, "%.3f Mbps", (float)ul_total / 1000);
3414 curr_offset++;
3416 return len;
3419 * 9.9.4.2A Connectivity type
3420 * See subclause 10.5.6.19 in 3GPP TS 24.008.
3421 * packet-gsm_a_gm.c
3424 * 9.9.4.3 EPS quality of service
3427 /* Quality of Service Class Identifier (QCI), octet 3 (see 3GPP TS 23.203 [7]) */
3428 static const range_string nas_eps_qci_vals[] = {
3429 { 0x00, 0x00, "Reserved"},
3430 { 0x01, 0x01, "QCI 1"},
3431 { 0x02, 0x02, "QCI 2"},
3432 { 0x03, 0x03, "QCI 3"},
3433 { 0x04, 0x04, "QCI 4"},
3434 { 0x05, 0x05, "QCI 5"},
3435 { 0x06, 0x06, "QCI 6"},
3436 { 0x07, 0x07, "QCI 7"},
3437 { 0x08, 0x08, "QCI 8"},
3438 { 0x09, 0x09, "QCI 9"},
3439 { 0x0A, 0x40, "Spare"},
3440 { 0x41, 0x41, "QCI 65"},
3441 { 0x42, 0x42, "QCI 66"},
3442 { 0x43, 0x43, "QCI 67"},
3443 { 0x44, 0x44, "Spare"},
3444 { 0x45, 0x45, "QCI 69"},
3445 { 0x46, 0x46, "QCI 70"},
3446 { 0x47, 0x4A, "Spare"},
3447 { 0x4B, 0x4B, "QCI 75"},
3448 { 0x4C, 0x4E, "Spare"},
3449 { 0x4F, 0x4F, "QCI 79"},
3450 { 0x50, 0x50, "QCI 80"},
3451 { 0x51, 0x51, "Spare"},
3452 { 0x52, 0x52, "QCI 82"},
3453 { 0x53, 0x53, "QCI 83"},
3454 { 0x54, 0x54, "QCI 84"},
3455 { 0x55, 0x55, "QCI 85"},
3456 { 0x56, 0x7F, "Spare"},
3457 { 0x80, 0xFE, "Operator-specific QCI"},
3458 { 0xFF, 0xFF, "Reserved"},
3459 { 0, 0, NULL }
3464 uint16_t
3465 de_esm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
3466 uint32_t offset, unsigned len,
3467 char *add_string _U_, int string_len _U_)
3469 uint32_t curr_offset;
3470 uint8_t octet;
3472 curr_offset = offset;
3474 /* QCI octet 3 */
3475 proto_tree_add_item(tree, hf_nas_eps_esm_qci, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3476 curr_offset++;
3477 if ((curr_offset - offset) >= len)
3478 return len;
3479 /* Maximum bit rate for uplink octet 4 */
3480 octet = tvb_get_uint8(tvb,curr_offset);
3481 if (octet == 0) {
3482 proto_tree_add_uint_format(tree, hf_nas_eps_esm_mbr_ul, tvb, curr_offset, 1, octet,
3483 "UE->NW Subscribed maximum bit rate for uplink/ NW->UE Reserved");
3484 } else {
3485 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_mbr_ul, tvb, curr_offset, 1, octet,
3486 "%u kbps", calc_bitrate(octet));
3488 curr_offset++;
3489 if ((curr_offset - offset) >= len)
3490 return len;
3491 /* Maximum bit rate for downlink octet 5 */
3492 octet = tvb_get_uint8(tvb,curr_offset);
3493 if (octet == 0) {
3494 proto_tree_add_uint_format(tree, hf_nas_eps_esm_mbr_dl, tvb, curr_offset, 1, octet,
3495 "UE->NW Subscribed maximum bit rate for downlink/ NW->UE Reserved");
3496 } else {
3497 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_mbr_dl, tvb, curr_offset, 1, octet,
3498 "%u kbps", calc_bitrate(octet));
3500 curr_offset++;
3501 if ((curr_offset - offset) >= len)
3502 return len;
3503 /* Guaranteed bit rate for uplink octet 6 */
3504 octet = tvb_get_uint8(tvb,curr_offset);
3505 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_gbr_ul, tvb, curr_offset, 1, octet,
3506 "%u kbps", calc_bitrate(octet));
3508 curr_offset++;
3509 if ((curr_offset - offset) >= len)
3510 return len;
3511 /* Guaranteed bit rate for downlink octet 7 */
3512 octet = tvb_get_uint8(tvb,curr_offset);
3513 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_gbr_dl, tvb, curr_offset, 1, octet,
3514 "%u kbps", calc_bitrate(octet));
3516 curr_offset++;
3517 if ((curr_offset - offset) >= len)
3518 return len;
3519 /* Maximum bit rate for uplink (extended) octet 8 */
3520 octet = tvb_get_uint8(tvb,curr_offset);
3521 if (octet == 0) {
3522 proto_tree_add_uint_format(tree, hf_nas_eps_esm_embr_ul, tvb, curr_offset, 1, octet,
3523 "Use the value indicated by the maximum bit rate for uplink in octet 4");
3524 } else {
3525 proto_tree_add_uint_format(tree, hf_nas_eps_esm_embr_ul, tvb, curr_offset, 1, octet,
3526 "Maximum bit rate for uplink (extended) : %u %s",
3527 calc_bitrate_ext(octet),
3528 (octet > 0x4a) ? "Mbps" : "kbps");
3530 curr_offset++;
3531 if ((curr_offset - offset) >= len)
3532 return len;
3533 /* Maximum bit rate for downlink (extended) octet 9 */
3534 octet = tvb_get_uint8(tvb,curr_offset);
3535 if (octet == 0) {
3536 proto_tree_add_uint_format(tree, hf_nas_eps_esm_embr_dl, tvb, curr_offset, 1, octet,
3537 "Use the value indicated by the maximum bit rate for downlink in octet 5");
3538 } else {
3539 proto_tree_add_uint_format(tree, hf_nas_eps_esm_embr_dl, tvb, curr_offset, 1, octet,
3540 "Maximum bit rate for downlink (extended) : %u %s",
3541 calc_bitrate_ext(octet),
3542 (octet > 0x4a) ? "Mbps" : "kbps");
3544 curr_offset++;
3545 if ((curr_offset - offset) >= len)
3546 return len;
3547 /* Guaranteed bit rate for uplink (extended) octet 10 */
3548 octet = tvb_get_uint8(tvb,curr_offset);
3549 if (octet == 0) {
3550 proto_tree_add_uint_format(tree, hf_nas_eps_esm_egbr_ul, tvb, curr_offset, 1, octet,
3551 "Use the value indicated by the guaranteed bit rate for uplink in octet 6");
3552 } else {
3553 proto_tree_add_uint_format(tree, hf_nas_eps_esm_egbr_ul, tvb, curr_offset, 1, octet,
3554 "Guaranteed bit rate for uplink (extended) : %u %s",
3555 calc_bitrate_ext(octet),
3556 (octet > 0x4a) ? "Mbps" : "kbps");
3558 curr_offset++;
3559 if ((curr_offset - offset) >= len)
3560 return len;
3561 /* Guaranteed bit rate for downlink (extended) octet 11 */
3562 octet = tvb_get_uint8(tvb,curr_offset);
3563 if (octet == 0) {
3564 proto_tree_add_uint_format(tree, hf_nas_eps_esm_egbr_dl, tvb, curr_offset, 1, octet,
3565 "Use the value indicated by the guaranteed bit rate for downlink in octet 7");
3566 } else {
3567 proto_tree_add_uint_format(tree, hf_nas_eps_esm_egbr_dl, tvb, curr_offset, 1, octet,
3568 "Guaranteed bit rate for downlink (extended) : %u %s",
3569 calc_bitrate_ext(octet),
3570 (octet > 0x4a) ? "Mbps" : "kbps");
3572 curr_offset++;
3573 if ((curr_offset - offset) >= len)
3574 return len;
3575 /* Maximum bit rate for uplink (extended-2) octet 12 */
3576 octet = tvb_get_uint8(tvb,curr_offset);
3577 if (octet == 0) {
3578 proto_tree_add_uint_format(tree, hf_nas_eps_esm_embr_ul, tvb, curr_offset, 1, octet,
3579 "Use the value indicated by the maximum bit rate for uplink in octet 4 and octet 8");
3580 } else {
3581 proto_tree_add_uint_format(tree, hf_nas_eps_esm_embr_ul, tvb, curr_offset, 1, octet,
3582 "Maximum bit rate for uplink (extended-2) : %u Mbps",
3583 calc_bitrate_ext2(octet));
3585 curr_offset++;
3586 /* Maximum bit rate for downlink (extended-2) octet 13 */
3587 octet = tvb_get_uint8(tvb,curr_offset);
3588 if (octet == 0) {
3589 proto_tree_add_uint_format(tree, hf_nas_eps_esm_embr_dl, tvb, curr_offset, 1, octet,
3590 "Use the value indicated by the maximum bit rate for downlink in octet 5 and octet 9");
3591 } else {
3592 proto_tree_add_uint_format(tree, hf_nas_eps_esm_embr_dl, tvb, curr_offset, 1, octet,
3593 "Maximum bit rate for downlink (extended-2) : %u Mbps",
3594 calc_bitrate_ext2(octet));
3596 curr_offset++;
3597 /* Guaranteed bit rate for uplink (extended-2) octet 14 */
3598 octet = tvb_get_uint8(tvb,curr_offset);
3599 if (octet == 0) {
3600 proto_tree_add_uint_format(tree, hf_nas_eps_esm_egbr_ul, tvb, curr_offset, 1, octet,
3601 "Use the value indicated by the guaranteed bit rate for uplink in octet 6 and octet 10");
3602 } else {
3603 proto_tree_add_uint_format(tree, hf_nas_eps_esm_egbr_ul, tvb, curr_offset, 1, octet,
3604 "Guaranteed bit rate for uplink (extended-2) : %u Mbps",
3605 calc_bitrate_ext2(octet));
3607 curr_offset++;
3608 /* Guaranteed bit rate for downlink (extended-2) octet 15 */
3609 octet = tvb_get_uint8(tvb,curr_offset);
3610 if (octet == 0) {
3611 proto_tree_add_uint_format(tree, hf_nas_eps_esm_egbr_dl, tvb, curr_offset, 1, octet,
3612 "Use the value indicated by the guaranteed bit rate for downlink in octet 7 and octet 11");
3613 } else {
3614 proto_tree_add_uint_format(tree, hf_nas_eps_esm_egbr_dl, tvb, curr_offset, 1, octet,
3615 "Guaranteed bit rate for downlink (extended-2) : %u Mbps",
3616 calc_bitrate_ext2(octet));
3619 return len;
3622 * 9.9.4.4 ESM cause
3625 const value_string nas_eps_esm_cause_vals[] = {
3626 { 0x08, "Operator Determined Barring"},
3627 { 0x1a, "Insufficient resources"},
3628 { 0x1b, "Missing or unknown APN"},
3629 { 0x1c, "Unknown PDN type"},
3630 { 0x1d, "User authentication or authorization failed"},
3631 { 0x1e, "Request rejected by Serving GW or PDN GW"},
3632 { 0x1f, "Request rejected, unspecified"},
3633 { 0x20, "Service option not supported"},
3634 { 0x21, "Requested service option not subscribed"},
3635 { 0x22, "Service option temporarily out of order"},
3636 { 0x23, "PTI already in use"},
3637 { 0x24, "Regular deactivation"},
3638 { 0x25, "EPS QoS not accepted"},
3639 { 0x26, "Network failure"},
3640 { 0x27, "Reactivation requested"},
3641 { 0x29, "Semantic error in the TFT operation"},
3642 { 0x2a, "Syntactical error in the TFT operation"},
3643 { 0x2b, "Invalid EPS bearer identity"},
3644 { 0x2c, "Semantic errors in packet filter(s)"},
3645 { 0x2d, "Syntactical errors in packet filter(s)"},
3646 { 0x2e, "Unused"},
3647 { 0x2f, "PTI mismatch"},
3648 { 0x31, "Last PDN disconnection not allowed"},
3649 { 0x32, "PDN type IPv4 only allowed"},
3650 { 0x33, "PDN type IPv6 only allowed"},
3651 { 0x34, "Single address bearers only allowed"},
3652 { 0x35, "ESM information not received"},
3653 { 0x36, "PDN connection does not exist"},
3654 { 0x37, "Multiple PDN connections for a given APN not allowed"},
3655 { 0x38, "Collision with network initiated request"},
3656 { 0x39, "PDN type IPv4v6 only allowed"},
3657 { 0x3a, "PDN type non IP only allowed"},
3658 { 0x3b, "Unsupported QCI value"},
3659 { 0x3c, "Bearer handling not supported"},
3660 { 0x3d, "PDN type Ethernet only allowed"},
3661 { 0x41, "Maximum number of EPS bearers reached"},
3662 { 0x42, "Requested APN not supported in current RAT and PLMN combination"},
3663 { 0x51, "Invalid PTI value"},
3664 { 0x5f, "Semantically incorrect message"},
3665 { 0x60, "Invalid mandatory information"},
3666 { 0x61, "Message type non-existent or not implemented"},
3667 { 0x62, "Message type not compatible with the protocol state"},
3668 { 0x63, "Information element non-existent or not implemented"},
3669 { 0x64, "Conditional IE error"},
3670 { 0x65, "Message not compatible with the protocol state"},
3671 { 0x6f, "Protocol error, unspecified"},
3672 { 0x70, "APN restriction value incompatible with active EPS bearer context"},
3673 { 0x71, "Multiple accesses to a PDN connection not allowed"},
3674 { 0, NULL }
3676 static value_string_ext nas_eps_esm_cause_vals_ext = VALUE_STRING_EXT_INIT(nas_eps_esm_cause_vals);
3678 static uint16_t
3679 de_esm_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
3680 uint32_t offset, unsigned len _U_,
3681 char *add_string _U_, int string_len _U_)
3683 uint32_t curr_offset;
3684 uint8_t cause;
3686 curr_offset = offset;
3688 cause = tvb_get_uint8(tvb, curr_offset);
3689 proto_tree_add_item(tree, hf_nas_eps_esm_cause, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3690 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
3691 val_to_str_ext_const(cause, &nas_eps_esm_cause_vals_ext, "Unknown"));
3693 curr_offset++;
3695 return curr_offset - offset;
3698 * 9.9.4.5 ESM information transfer flag
3700 /* EIT (ESM information transfer) */
3701 static const true_false_string nas_eps_emm_eit_vals = {
3702 "Security protected ESM information transfer required",
3703 "Security protected ESM information transfer not required"
3705 static uint16_t
3706 de_esm_inf_trf_flg(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
3707 uint32_t offset, unsigned len _U_,
3708 char *add_string _U_, int string_len _U_)
3710 uint32_t curr_offset;
3712 curr_offset = offset;
3714 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+4, 3, ENC_BIG_ENDIAN);
3715 proto_tree_add_item(tree, hf_nas_eps_esm_eit, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3716 curr_offset++;
3717 return curr_offset-offset;
3720 * 9.9.4.6 Linked EPS bearer identity
3723 * Linked EPS bearer identity (bits 1-4)
3726 static const value_string nas_eps_esm_linked_bearer_id_vals[] = {
3727 { 0x0, "Reserved"},
3728 { 0x1, "EPS bearer identity value 1"},
3729 { 0x2, "EPS bearer identity value 2"},
3730 { 0x3, "EPS bearer identity value 3"},
3731 { 0x4, "EPS bearer identity value 4"},
3732 { 0x5, "EPS bearer identity value 5"},
3733 { 0x6, "EPS bearer identity value 6"},
3734 { 0x7, "EPS bearer identity value 7"},
3735 { 0x8, "EPS bearer identity value 8"},
3736 { 0x9, "EPS bearer identity value 9"},
3737 { 0xa, "EPS bearer identity value 10"},
3738 { 0xb, "EPS bearer identity value 11"},
3739 { 0xc, "EPS bearer identity value 12"},
3740 { 0xd, "EPS bearer identity value 13"},
3741 { 0xe, "EPS bearer identity value 14"},
3742 { 0xf, "EPS bearer identity value 15"},
3743 { 0, NULL }
3747 * 9.9.4.7 LLC service access point identifier
3748 * See subclause 10.5.6.9 in 3GPP TS 24.008
3752 * 9.9.4.7a Notification indicator
3754 static const value_string nas_eps_esm_notif_ind_vals[] = {
3755 { 0x0, "Reserved"},
3756 { 0x1, "SRVCC handover cancelled, IMS session re-establishment required"},
3757 { 0, NULL }
3760 static uint16_t
3761 de_esm_notif_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
3762 uint32_t offset, unsigned len _U_,
3763 char *add_string _U_, int string_len _U_)
3765 uint32_t curr_offset;
3767 curr_offset = offset;
3769 proto_tree_add_item(tree, hf_nas_eps_esm_notif_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3771 return len;
3775 * 9.9.4.8 Packet flow identifier
3776 * See subclause 10.5.6.11 in 3GPP TS 24.008
3779 * 9.9.4.9 PDN address
3781 static uint16_t
3782 de_esm_pdn_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
3783 uint32_t offset, unsigned len _U_,
3784 char *add_string _U_, int string_len _U_)
3786 uint32_t curr_offset;
3787 uint8_t pdn_type;
3788 uint8_t interface_id[8];
3790 curr_offset = offset;
3792 pdn_type = tvb_get_uint8(tvb, offset) & 0x7;
3793 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 5, ENC_BIG_ENDIAN);
3794 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3795 curr_offset++;
3797 switch (pdn_type) {
3798 case 1:
3799 /* IPv4 */
3800 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv4, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
3801 curr_offset+=4;
3802 break;
3803 case 2:
3804 /* IPv6 3GPP TS 24.301 version 9.4.0 Release 9
3805 * If PDN type value indicates IPv6, the PDN address information in octet 4 to octet 11
3806 * contains an IPv6 interface identifier. Bit 8 of octet 4 represents the most significant bit
3807 * of the IPv6 interface identifier and bit 1 of octet 11 the least significant bit.
3809 tvb_memcpy(tvb, interface_id, curr_offset, 8);
3810 proto_tree_add_bytes_format_value(tree, hf_nas_eps_esm_pdn_ipv6_if_id, tvb, curr_offset, 8, NULL,
3811 "::%x:%x:%x:%x", pntoh16(&interface_id[0]), pntoh16(&interface_id[2]),
3812 pntoh16(&interface_id[4]), pntoh16(&interface_id[6]));
3813 curr_offset+=8;
3814 break;
3815 case 3:
3816 /* IPv4/IPv6 3GPP TS 24.301 version 9.4.0 Release 9
3817 * If PDN type value indicates IPv4v6, the PDN address information in octet 4 to octet 15
3818 * contains an IPv6 interface identifier and an IPv4 address. Bit 8 of octet 4 represents
3819 * the most significant bit of the IPv6 interface identifier and bit 1 of octet 11 the least
3820 * significant bit. Bit 8 of octet 12 represents the most significant bit of the IPv4 address
3821 * and bit 1 of octet 15 the least significant bit.
3823 tvb_memcpy(tvb, interface_id, curr_offset, 8);
3824 proto_tree_add_bytes_format_value(tree, hf_nas_eps_esm_pdn_ipv6_if_id, tvb, curr_offset, 8, NULL,
3825 "::%x:%x:%x:%x", pntoh16(&interface_id[0]), pntoh16(&interface_id[2]),
3826 pntoh16(&interface_id[4]), pntoh16(&interface_id[6]));
3827 curr_offset+=8;
3828 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv4, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
3829 curr_offset+=4;
3830 break;
3831 case 5:
3832 case 6:
3833 curr_offset+=4;
3834 break;
3835 default:
3836 break;
3839 return curr_offset-offset;
3843 * 9.9.4.10 PDN type
3844 * Coded inline 1/2 octet
3846 static const value_string nas_eps_esm_pdn_type_values[] = {
3847 { 0x1, "IPv4" },
3848 { 0x2, "IPv6" },
3849 { 0x3, "IPv4v6" },
3850 { 0x4, "Unused; shall be interpreted as IPv6 if received by the network" },
3851 { 0x5, "Non IP" },
3852 { 0x6, "Ethernet" },
3853 { 0, NULL }
3857 * 9.9.4.11 Protocol configuration options
3858 * See subclause 10.5.6.3 in 3GPP TS 24.008
3861 * 9.9.4.12 Quality of service
3862 * See subclause 10.5.6.5 in 3GPP TS 24.008
3863 * Coded inline 1/2 octet
3866 * 9.9.4.13 Radio priority
3867 * See subclause 10.5.7.2 in 3GPP TS 24.008
3870 * 9.9.4.13a Re-attempt indicator
3872 static const true_false_string nas_eps_esm_eplmnc_value = {
3873 "UE is not allowed to re-attempt the procedure in an equivalent PLMN",
3874 "UE is allowed to re-attempt the procedure in an equivalent PLMN"
3877 static const true_false_string nas_eps_esm_ratc_value = {
3878 "UE is not allowed to re-attempt the procedure in A/Gb mode or Iu mode or N1 mode",
3879 "UE is allowed to re-attempt the procedure in A/Gb mode or Iu mode or N1 mode"
3882 static uint16_t
3883 de_esm_re_attempt_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset,
3884 unsigned len, char *add_string _U_, int string_len _U_)
3886 uint32_t curr_offset;
3888 curr_offset = offset;
3890 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, offset << 3, 6, ENC_BIG_ENDIAN);
3891 proto_tree_add_item(tree, hf_nas_eps_esm_eplmnc, tvb, offset, 1, ENC_BIG_ENDIAN);
3892 proto_tree_add_item(tree, hf_nas_eps_esm_ratc, tvb, offset, 1, ENC_BIG_ENDIAN);
3893 curr_offset++;
3895 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_nas_eps_extraneous_data);
3897 return len;
3901 * 9.9.4.14 Request type
3902 * See subclause 10.5.6.17 in 3GPP TS 24.008
3904 static const value_string nas_eps_esm_request_type_values[] = {
3905 { 0x1, "Initial request" },
3906 { 0x2, "Handover" },
3907 { 0x3, "Unused. If received, the network shall interpret this as 'initial request'" },
3908 { 0x4, "Emergency" },
3909 { 0x6, "Handover of emergency bearer services" },
3910 { 0, NULL }
3914 * 9.9.4.15 Traffic flow aggregate description
3915 * The Traffic flow aggregate description information element is encoded using the same format as the Traffic flow
3916 * template information element (see subclause 10.5.6.12 in 3GPP TS 24.008 [13]). When sending this IE, the UE shall
3917 * assign the packet filter identifier values so that they are unique across all packet filters for the PDN connection.
3920 * 9.9.4.16 Traffic flow template
3921 * See subclause 10.5.6.12 in 3GPP TS 24.008
3922 * packet-gsm_a_gm.c
3925 * 9.9.4.17 Transaction identifier
3926 * The Transaction identifier information element is coded as the Linked TI information element in 3GPP TS 24.008 [13],
3927 * subclause 10.5.6.7.
3928 * The coding of the TI flag, the TI value and the EXT bit is defined in 3GPP TS 24.007[20].
3931 * 9.9.4.18 WLAN offload acceptability
3932 * See subclause 10.5.6.20 in 3GPP TS 24.008
3933 * packet-gsm_a_gm.c
3936 * 9.9.4.19 NBIFOM container
3938 static uint16_t
3939 de_esm_nbifom_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3941 if (nbifom_handle) {
3942 tvbuff_t *nbifom_tvb = tvb_new_subset_length(tvb, offset, len);
3944 call_dissector(nbifom_handle, nbifom_tvb, pinfo, tree);
3945 } else {
3946 proto_tree_add_item(tree, hf_nas_eps_esm_nbifom_cont, tvb, offset, len, ENC_NA);
3949 return len;
3953 * 9.9.4.20 Remote UE context list
3955 static const value_string nas_eps_esm_user_info_type_values[] = {
3956 { 0x1, "Encrypted IMSI" },
3957 { 0x2, "IMSI" },
3958 { 0x3, "MSISDN" },
3959 { 0x4, "IMEI" },
3960 { 0x5, "IMEISV" },
3961 { 0, NULL }
3963 static const value_string nas_eps_esm_address_type_values[] = {
3964 { 0x0, "No IP Info" },
3965 { 0x1, "IPv4" },
3966 { 0x2, "IPv6" },
3967 { 0, NULL }
3969 static uint16_t
3970 de_esm_remote_ue_context_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
3971 uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3973 uint32_t curr_offset = offset;
3974 uint32_t nb_ue_contexts, ue_context_len, nb_user_id, user_id_len, user_id_type, remote_address_type, i, j;
3975 bool upri4, tpri4i;
3976 proto_tree *subtree;
3977 proto_item *subtree_item;
3979 proto_tree_add_item_ret_uint(tree, hf_nas_eps_esm_remote_ue_context_list_nb_ue_contexts, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &nb_ue_contexts);
3980 curr_offset ++;
3981 for (i = 1; i <= nb_ue_contexts; i++) {
3982 subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, len - (curr_offset - offset), ett_nas_eps_remote_ue_context,
3983 &subtree_item, "Remote UE context %u", i);
3984 proto_tree_add_item_ret_uint(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_len, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &ue_context_len);
3985 proto_item_set_len(subtree_item, ue_context_len+1);
3986 curr_offset ++;
3987 proto_tree_add_item_ret_uint(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_nb_user_id, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &nb_user_id);
3988 curr_offset ++;
3989 for (j = 0; j < nb_user_id; j++) {
3990 proto_tree_add_item_ret_uint(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_user_id_len, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &user_id_len);
3991 curr_offset ++;
3992 proto_tree_add_item(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_odd_even_indic, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3993 proto_tree_add_item_ret_uint(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_user_id_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &user_id_type);
3994 switch (user_id_type) {
3995 case 1:
3996 proto_tree_add_bits_item(subtree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
3997 curr_offset++;
3998 proto_tree_add_item(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_encr_imsi, tvb, curr_offset, 16, ENC_NA);
3999 curr_offset += 16;
4000 break;
4001 case 2:
4002 dissect_e212_imsi(tvb, pinfo, subtree, curr_offset, user_id_len, true);
4003 curr_offset += user_id_len;
4004 break;
4005 case 3:
4007 proto_tree_add_item(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_msisdn, tvb, curr_offset, user_id_len, ENC_BCD_DIGITS_0_9 | ENC_LITTLE_ENDIAN | ENC_BCD_SKIP_FIRST);
4008 curr_offset += user_id_len;
4010 break;
4011 case 4:
4013 proto_tree_add_item(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_imei, tvb, curr_offset, user_id_len, ENC_BCD_DIGITS_0_9 | ENC_LITTLE_ENDIAN | ENC_BCD_SKIP_FIRST);
4014 curr_offset += user_id_len;
4016 break;
4017 case 5:
4019 proto_tree_add_item(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_imeisv, tvb, curr_offset, user_id_len, ENC_BCD_DIGITS_0_9 | ENC_LITTLE_ENDIAN | ENC_BCD_SKIP_FIRST);
4020 curr_offset += user_id_len;
4022 break;
4023 default:
4024 curr_offset += user_id_len;
4025 break;
4028 proto_tree_add_bits_item(subtree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 3, ENC_BIG_ENDIAN);
4029 proto_tree_add_item_ret_boolean(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_upri4, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &upri4);
4030 proto_tree_add_item_ret_boolean(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_tpri4i, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &tpri4i);
4031 proto_tree_add_item_ret_uint(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_address_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &remote_address_type);
4032 curr_offset++;
4033 switch (remote_address_type) {
4034 case 1:
4035 proto_tree_add_item(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv4, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
4036 curr_offset += 4;
4037 proto_tree_add_item(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_port_number, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
4038 curr_offset += 2;
4039 break;
4040 case 2:
4042 ws_in6_addr prefix;
4043 memset(&prefix, 0, sizeof(prefix));
4044 tvb_memcpy(tvb, (uint8_t*)&prefix.bytes[0], curr_offset, 8);
4045 proto_tree_add_ipv6(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv6_prefix, tvb, curr_offset, 8, &prefix);
4046 curr_offset += 8;
4048 break;
4049 case 0:
4050 default:
4051 break;
4053 if (upri4) {
4054 proto_tree_add_item(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv4_udp_port_low, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
4055 curr_offset +=2;
4056 proto_tree_add_item(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv4_udp_port_high, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
4057 curr_offset +=2;
4059 if (tpri4i) {
4060 proto_tree_add_item(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv4_tcp_port_low, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
4061 curr_offset +=2;
4062 proto_tree_add_item(subtree, hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv4_tcp_port_high, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
4063 curr_offset +=2;
4067 return len;
4071 * 9.9.4.21 PKMF address
4073 static const value_string nas_eps_esm_pkmf_address_type_values[] = {
4074 { 0x1, "IPv4" },
4075 { 0x2, "IPv6" },
4076 { 0, NULL }
4078 static uint16_t
4079 de_esm_pkmf_address(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
4080 uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
4082 uint32_t curr_offset = offset;
4083 uint32_t pkmf_address_type;
4085 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 5, ENC_BIG_ENDIAN);
4086 proto_tree_add_item_ret_uint(tree, hf_nas_eps_esm_pkmf_address_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &pkmf_address_type);
4087 curr_offset++;
4088 switch (pkmf_address_type) {
4089 case 1:
4090 proto_tree_add_item(tree, hf_nas_eps_esm_pkmf_ipv4, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
4091 break;
4092 case 2:
4093 proto_tree_add_item(tree, hf_nas_eps_esm_pkmf_ipv6, tvb, curr_offset, 16, ENC_NA);
4094 break;
4095 default:
4096 break;
4099 return len;
4103 * 9.9.4.22 Header compression configuration
4105 static const value_string nas_eps_esm_add_hdr_compr_cxt_setup_params_type_vals[] = {
4106 { 0x00, "0x0000 (No Compression)" },
4107 { 0x01, "0x0002 (UDP/IP)" },
4108 { 0x02, "0x0003 (ESP/IP)" },
4109 { 0x03, "0x0004 (IP)" },
4110 { 0x04, "0x0006 (TCP/IP)" },
4111 { 0x05, "0x0102 (UDP/IP)" },
4112 { 0x06, "0x0103 (ESP/IP)" },
4113 { 0x07, "0x0104 (IP)" },
4114 { 0x08, "Other" },
4115 { 0x0, NULL }
4118 static uint16_t
4119 de_esm_hdr_compr_config(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
4120 uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
4122 uint32_t curr_offset = offset;
4124 static int * const flags[] = {
4125 &hf_nas_eps_spare_b7,
4126 &hf_nas_eps_esm_hdr_comp_config_prof_0104,
4127 &hf_nas_eps_esm_hdr_comp_config_prof_0103,
4128 &hf_nas_eps_esm_hdr_comp_config_prof_0102,
4129 &hf_nas_eps_esm_hdr_comp_config_prof_0006,
4130 &hf_nas_eps_esm_hdr_comp_config_prof_0004,
4131 &hf_nas_eps_esm_hdr_comp_config_prof_0003,
4132 &hf_nas_eps_esm_hdr_comp_config_prof_0002,
4133 NULL
4135 proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, flags, ENC_NA);
4136 curr_offset++;
4137 proto_tree_add_item(tree, hf_nas_eps_esm_hdr_compr_config_max_cid, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
4138 curr_offset += 2;
4140 if ((curr_offset - offset) >= len) {
4141 return len;
4144 proto_tree_add_item(tree, hf_nas_eps_esm_hdr_compr_config_add_hdr_compr_cxt_setup_params_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4145 curr_offset++;
4146 proto_tree_add_item(tree, hf_nas_eps_esm_hdr_compr_config_add_hdr_compr_cxt_setup_params_cont, tvb, curr_offset, len - (curr_offset - offset), ENC_NA);
4148 return len;
4152 * 9.9.4.23 Control plane only indication
4154 static true_false_string nas_eps_ctrl_plane_only_ind_cpoi_value = {
4155 "PDN connection can be used for control plane CIoT EPS optimization only",
4156 "Reserved"
4158 static uint16_t
4159 de_esm_ctrl_plane_only_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
4160 uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
4162 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (offset<<3)+4, 3, ENC_BIG_ENDIAN);
4163 proto_tree_add_bits_item(tree, hf_nas_eps_esm_ctrl_plane_only_ind_cpoi, tvb, (offset<<3)+7, 1, ENC_BIG_ENDIAN);
4165 return 1;
4169 * 9.9.4.24 User data container
4171 static uint16_t
4172 de_esm_user_data_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
4173 uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
4175 proto_item *it;
4177 it = proto_tree_add_item(tree, hf_nas_eps_esm_user_data_cont, tvb, offset, len, ENC_NA);
4178 if (g_nas_eps_decode_user_data_container_as != DECODE_USER_DATA_AS_NONE) {
4179 tvbuff_t *user_data_cont_tvb;
4180 volatile dissector_handle_t handle;
4182 user_data_cont_tvb = tvb_new_subset_length_caplen(tvb, offset, len, len);
4183 if (g_nas_eps_decode_user_data_container_as == DECODE_USER_DATA_AS_IP) {
4184 uint8_t first_byte = tvb_get_uint8(user_data_cont_tvb, 0);
4185 if (first_byte >= 0x45 && first_byte <= 0x4f && len > 20)
4186 handle = ipv4_handle;
4187 else if ((first_byte & 0xf0) == 0x60 && len > 40)
4188 handle = ipv6_handle;
4189 else
4190 handle = NULL;
4191 } else if (g_nas_eps_decode_user_data_container_as == DECODE_USER_DATA_AS_NON_IP) {
4192 handle = non_ip_data_handle;
4193 } else {
4194 handle = ethernet_handle;
4196 if (handle) {
4197 col_append_str(pinfo->cinfo, COL_PROTOCOL, "/");
4198 col_set_fence(pinfo->cinfo, COL_PROTOCOL);
4199 col_append_str(pinfo->cinfo, COL_INFO, ", ");
4200 col_set_fence(pinfo->cinfo, COL_INFO);
4201 TRY {
4202 proto_tree *toptree = proto_tree_get_root(tree);
4203 call_dissector_only(handle, user_data_cont_tvb, pinfo, toptree, NULL);
4204 } CATCH_BOUNDS_ERRORS {
4205 /* Dissection exception: message was probably non IP and heuristic was too weak */
4206 proto_tree *subtree = proto_item_add_subtree(it, ett_nas_eps_esm_user_data_cont);
4207 show_exception(user_data_cont_tvb, pinfo, subtree, EXCEPT_CODE, GET_MESSAGE);
4208 } ENDTRY
4212 return len;
4216 * 9.9.4.25 Release assistance indication
4218 static const value_string nas_eps_esm_rel_assist_ind_ddx_vals[] = {
4219 { 0x00, "No information available" },
4220 { 0x01, "No further uplink and no further downlink data transmission subsequent to the uplink data transmission is expected" },
4221 { 0x02, "Only a single downlink data transmission and no further uplink data transmission subsequent to the uplink data transmission is expected" },
4222 { 0x03, "Reserved" },
4223 { 0, NULL}
4226 uint16_t
4227 de_esm_rel_assist_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
4228 uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
4230 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (offset<<3)+4, 2, ENC_BIG_ENDIAN);
4231 proto_tree_add_bits_item(tree, hf_nas_eps_esm_rel_assist_ind_ddx, tvb, (offset<<3)+6, 2, ENC_BIG_ENDIAN);
4233 return 1;
4237 * 9.9.4.26 Extended protocol configuration options
4239 static uint16_t
4240 de_esm_ext_pco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
4241 uint32_t offset, unsigned len, char *add_string, int string_len)
4243 return de_sm_pco(tvb, tree, pinfo, offset, len, add_string, string_len);
4247 * 9.9.4.27 Header compression configuration status
4249 static true_false_string nas_eps_esm_hdr_compr_config_status_ebi_value = {
4250 "Header compression configuration is not used",
4251 "Header compression configuration is used"
4253 static uint16_t
4254 de_esm_hdr_compr_config_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
4255 uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
4257 static int * const flags[] = {
4258 &hf_nas_eps_esm_hdr_compr_config_status_ebi7,
4259 &hf_nas_eps_esm_hdr_compr_config_status_ebi6,
4260 &hf_nas_eps_esm_hdr_compr_config_status_ebi5,
4261 &hf_nas_eps_esm_hdr_compr_config_status_ebi4,
4262 &hf_nas_eps_esm_hdr_compr_config_status_ebi3,
4263 &hf_nas_eps_esm_hdr_compr_config_status_ebi2,
4264 &hf_nas_eps_esm_hdr_compr_config_status_ebi1,
4265 &hf_nas_eps_esm_spare_bits0x0100,
4266 &hf_nas_eps_esm_hdr_compr_config_status_ebi15,
4267 &hf_nas_eps_esm_hdr_compr_config_status_ebi14,
4268 &hf_nas_eps_esm_hdr_compr_config_status_ebi13,
4269 &hf_nas_eps_esm_hdr_compr_config_status_ebi12,
4270 &hf_nas_eps_esm_hdr_compr_config_status_ebi11,
4271 &hf_nas_eps_esm_hdr_compr_config_status_ebi10,
4272 &hf_nas_eps_esm_hdr_compr_config_status_ebi9,
4273 &hf_nas_eps_esm_hdr_compr_config_status_ebi8,
4274 NULL
4277 proto_tree_add_bitmask_list(tree, tvb, offset, 2, flags, ENC_BIG_ENDIAN);
4279 return len;
4283 * 9.9.4.28 Serving PLMN rate control
4285 static uint16_t
4286 de_esm_serv_plmn_rate_ctrl(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
4287 uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
4289 proto_item *pi;
4291 pi = proto_tree_add_item(tree, hf_nas_eps_esm_serv_plmn_rate_ctrl_val, tvb, offset, 2, ENC_BIG_ENDIAN);
4292 proto_item_append_text(pi, " message(s)");
4294 return len;
4298 * 9.9.4.29 Extended APN aggregate maximum bit rate
4300 static const range_string nas_eps_ext_apn_ambr_unit_vals[] = {
4301 { 0x00, 0x02, "Not used" },
4302 { 0x03, 0x03, "Multiple of 4 Mbps" },
4303 { 0x04, 0x04, "Multiple of 16 Mbps" },
4304 { 0x05, 0x05, "Multiple of 64 Mbps" },
4305 { 0x06, 0x06, "Multiple of 256 Mbps" },
4306 { 0x07, 0x07, "Multiple of 1 Gbps" },
4307 { 0x08, 0x08, "Multiple of 4 Gbps" },
4308 { 0x09, 0x09, "Multiple of 16 Gbps" },
4309 { 0x0a, 0x0a, "Multiple of 64 Gbps" },
4310 { 0x0b, 0x0b, "Multiple of 256 Gbps" },
4311 { 0x0c, 0x0c, "Multiple of 1 Tbps" },
4312 { 0x0d, 0x0d, "Multiple of 4 Tbps" },
4313 { 0x0e, 0x0e, "Multiple of 16 Tbps" },
4314 { 0x0f, 0x0f, "Multiple of 64 Tbps" },
4315 { 0x10, 0x10, "Multiple of 256 Tbps" },
4316 { 0x11, 0x11, "Multiple of 1 Pbps" },
4317 { 0x12, 0x12, "Multiple of 4 Pbps" },
4318 { 0x13, 0x13, "Multiple of 16 Pbps" },
4319 { 0x14, 0x14, "Multiple of 64 Pbps" },
4320 { 0x15, 0xff, "Multiple of 256 Pbps" },
4321 { 0, 0, NULL }
4324 static uint32_t
4325 get_ext_ambr_unit(uint32_t byte, const char **unit_str)
4327 uint32_t mult;
4329 if (byte <= 0x02) {
4330 mult = 0;
4331 *unit_str = "";
4332 } else if (byte <= 0x06) {
4333 mult = pow4(uint32_t, byte-0x02);
4334 *unit_str = "Mbps";
4335 } else if (byte <= 0x0b) {
4336 mult = pow4(uint32_t, byte-0x07);
4337 *unit_str = "Gbps";
4338 } else if (byte <= 0x10) {
4339 mult = pow4(uint32_t, byte-0x0c);
4340 *unit_str = "Tbps";
4341 } else if (byte <= 0x15) {
4342 mult = pow4(uint32_t, byte-0x11);
4343 *unit_str = "Pbps";
4344 } else {
4345 mult = 256;
4346 *unit_str = "Pbps";
4348 return mult;
4351 uint16_t
4352 de_esm_ext_apn_agr_max_br(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
4353 uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
4355 uint32_t curr_offset, byte, mult, ambr_val;
4356 const char *unit_str;
4358 curr_offset = offset;
4359 proto_tree_add_item_ret_uint(tree, hf_nas_eps_esm_ext_apn_ambr_dl_unit, tvb, curr_offset, 1, ENC_NA, &byte);
4360 curr_offset++;
4361 mult = get_ext_ambr_unit(byte, &unit_str);
4362 ambr_val = tvb_get_ntohs(tvb, curr_offset);
4363 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_ext_apn_ambr_dl, tvb, curr_offset, 2,
4364 ambr_val, "%u %s (%u)", ambr_val * mult, unit_str, ambr_val);
4365 curr_offset += 2;
4366 proto_tree_add_item_ret_uint(tree, hf_nas_eps_esm_ext_apn_ambr_ul_unit, tvb, curr_offset, 1, ENC_NA, &byte);
4367 curr_offset++;
4368 mult = get_ext_ambr_unit(byte, &unit_str);
4369 ambr_val = tvb_get_ntohs(tvb, curr_offset);
4370 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_ext_apn_ambr_ul, tvb, curr_offset, 2,
4371 ambr_val, "%u %s (%u)", ambr_val * mult, unit_str, ambr_val);
4373 return len;
4377 * 9.9.4.30 Extended EPS quality of service
4379 static const range_string nas_eps_ext_eps_qos_unit_vals[] = {
4380 { 0x00, 0x00, "Not used" },
4381 { 0x01, 0x01, "Multiple of 200 kbps" },
4382 { 0x02, 0x02, "Multiple of 1 Mbps" },
4383 { 0x03, 0x03, "Multiple of 4 Mbps" },
4384 { 0x04, 0x04, "Multiple of 16 Mbps" },
4385 { 0x05, 0x05, "Multiple of 64 Mbps" },
4386 { 0x06, 0x06, "Multiple of 256 Mbps" },
4387 { 0x07, 0x07, "Multiple of 1 Gbps" },
4388 { 0x08, 0x08, "Multiple of 4 Gbps" },
4389 { 0x09, 0x09, "Multiple of 16 Gbps" },
4390 { 0x0a, 0x0a, "Multiple of 64 Gbps" },
4391 { 0x0b, 0x0b, "Multiple of 256 Gbps" },
4392 { 0x0c, 0x0c, "Multiple of 1 Tbps" },
4393 { 0x0d, 0x0d, "Multiple of 4 Tbps" },
4394 { 0x0e, 0x0e, "Multiple of 16 Tbps" },
4395 { 0x0f, 0x0f, "Multiple of 64 Tbps" },
4396 { 0x10, 0x10, "Multiple of 256 Tbps" },
4397 { 0x11, 0x11, "Multiple of 1 Pbps" },
4398 { 0x12, 0x12, "Multiple of 4 Pbps" },
4399 { 0x13, 0x13, "Multiple of 16 Pbps" },
4400 { 0x14, 0x14, "Multiple of 64 Pbps" },
4401 { 0x15, 0xff, "Multiple of 256 Pbps" },
4402 { 0, 0, NULL }
4405 static uint32_t
4406 get_ext_eps_qos_unit(uint32_t byte, const char **unit_str)
4408 uint32_t mult;
4410 if (byte == 0x00) {
4411 mult = 0;
4412 *unit_str = "";
4413 } else if (byte == 0x01) {
4414 mult = 200;
4415 *unit_str = "kbps";
4416 } else if (byte <= 0x06) {
4417 mult = pow4(uint32_t, byte-0x02);
4418 *unit_str = "Mbps";
4419 } else if (byte <= 0x0b) {
4420 mult = pow4(uint32_t, byte-0x07);
4421 *unit_str = "Gbps";
4422 } else if (byte <= 0x10) {
4423 mult = pow4(uint32_t, byte-0x0c);
4424 *unit_str = "Tbps";
4425 } else if (byte <= 0x15) {
4426 mult = pow4(uint32_t, byte-0x11);
4427 *unit_str = "Pbps";
4428 } else {
4429 mult = 256;
4430 *unit_str = "Pbps";
4432 return mult;
4435 uint16_t
4436 de_esm_ext_eps_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
4437 uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
4439 uint32_t curr_offset, byte, mult, val;
4440 const char *unit_str;
4442 curr_offset = offset;
4443 proto_tree_add_item_ret_uint(tree, hf_nas_eps_esm_ext_mbr_unit, tvb, curr_offset, 1, ENC_NA, &byte);
4444 curr_offset++;
4445 mult = get_ext_eps_qos_unit(byte, &unit_str);
4446 val = tvb_get_ntohs(tvb, curr_offset);
4447 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_ext_mbr_ul, tvb, curr_offset,
4448 2, val, "%u %s (%u)", val * mult, unit_str, val);
4449 curr_offset += 2;
4450 val = tvb_get_ntohs(tvb, curr_offset);
4451 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_ext_mbr_dl, tvb, curr_offset,
4452 2,val, "%u %s (%u)", val * mult, unit_str, val);
4453 curr_offset += 2;
4454 proto_tree_add_item_ret_uint(tree, hf_nas_eps_esm_ext_gbr_unit, tvb, curr_offset, 1, ENC_NA, &byte);
4455 curr_offset++;
4456 mult = get_ext_eps_qos_unit(byte, &unit_str);
4457 val = tvb_get_ntohs(tvb, curr_offset);
4458 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_ext_gbr_ul, tvb, curr_offset,
4459 2, val, "%u %s (%u)", val * mult, unit_str, val);
4460 curr_offset += 2;
4461 val = tvb_get_ntohs(tvb, curr_offset);
4462 proto_tree_add_uint_format_value(tree, hf_nas_eps_esm_ext_gbr_dl, tvb, curr_offset,
4463 2, val, "%u %s (%u)", val * mult, unit_str, val);
4465 return len;
4468 uint16_t (*emm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len) = {
4469 /* 9.9.3 EPS Mobility Management (EMM) information elements */
4470 de_emm_add_upd_res, /* 9.9.3.0A Additional update result */
4471 de_emm_add_upd_type, /* 9.9.3.0B Additional update type */
4472 NULL, /* 9.9.3.1 Authentication failure parameter(dissected in packet-gsm_a_dtap.c) */
4473 NULL, /* 9.9.3.2 Authentication parameter AUTN(packet-gsm_a_dtap.c) */
4474 NULL, /* 9.9.3.3 Authentication parameter RAND */
4475 de_emm_auth_resp_par, /* 9.9.3.4 Authentication response parameter */
4476 de_emm_sms_services_status, /* 9.9.3.4B SMS services status */
4477 de_emm_csfb_resp, /* 9.9.3.5 CSFB response */
4478 NULL, /* 9.9.3.6 Daylight saving time (packet-gsm_a_dtap.c)*/
4479 NULL, /* 9.9.3.7 Detach type */
4480 NULL, /* 9.9.3.8 DRX parameter */
4481 de_emm_cause, /* 9.9.3.9 EMM cause */
4482 NULL, /* 9.9.3.10 EPS attach result (coded inline) */
4483 NULL, /* 9.9.3.11 EPS attach type(Coded Inline) */
4484 de_emm_eps_mid, /* 9.9.3.12 EPS mobile identity */
4485 de_emm_eps_net_feature_sup, /* 9.9.3.12A EPS network feature support */
4486 NULL, /* 9.9.3.13 EPS update result (Coded Inline)*/
4487 NULL, /* 9.9.3.14 EPS update type (Inline)*/
4488 de_emm_esm_msg_cont, /* 9.9.3.15 ESM message conta */
4489 NULL, /* 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. (packet-gsm_a_gm.c)*/
4490 NULL, /* 9.9.3.16A GPRS timer 2, See subclause 10.5.7.4 in 3GPP TS 24.008. (packet-gsm_a_gm.c)*/
4491 NULL, /* 9.9.3.16B GPRS timer 3, See subclause 10.5.7.4a in 3GPP TS 24.008. (packet-gsm_a_gm.c)*/
4492 NULL, /* 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. */
4493 de_emm_nas_imeisv_req, /* 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. */
4494 de_emm_nas_ksi_and_seq_no, /* 9.9.3.19 KSI and sequence number */
4495 NULL, /* 9.9.3.20 MS network capability ,See subclause 10.5.5.12 in 3GPP TS 24.008 [6].(packet-gsm_a_gm.c) */
4496 NULL, /* 9.9.3.20A MS network feature support, See subclause 10.5.1.15 in 3GPP TS 24.008.(packet-gsm_a_gm.c) */
4497 de_emm_nas_key_set_id, /* 9.9.3.21 NAS key set identifier (Coded Inline) */
4498 de_emm_nas_msg_cont, /* 9.9.3.22 NAS message container */
4499 de_emm_nas_sec_alsgs, /* 9.9.3.23 NAS security algorithms */
4500 NULL, /* 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. (packet-gsm_a_dtap.c)*/
4501 de_emm_nonce, /* 9.9.3.25 Nonce */
4502 de_emm_paging_id, /* 9.9.3.25A Paging identity */
4503 NULL, /* 9.9.3.26 P-TMSI signature, See subclause 10.5.5.8 in 3GPP TS 24.008 [6]. (packet-gsm_a_gm.c)*/
4504 de_emm_ext_cause, /* 9.9.3.26A Extended EMM cause */
4505 NULL, /* 9.9.3.27 Service type */
4506 de_emm_nas_short_mac, /* 9.9.3.28 Short MAC */
4507 NULL, /* 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. (packet-gsm_a_dtap.c)*/
4508 NULL, /* 9.9.3.30 Time zone and time, See subclause 10.5.3.9 in 3GPP TS 24.008 [6]. (packet-gsm_a_dtap.c)*/
4509 NULL, /* 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. (packet-gsm_a_gm.c)*/
4510 de_emm_trac_area_id, /* 9.9.3.32 Tracking area identity */
4511 de_emm_trac_area_id_lst, /* 9.9.3.33 Tracking area identity list */
4512 de_emm_ue_net_cap, /* 9.9.3.34 UE network capability */
4513 de_emm_ue_ra_cap_inf_upd_need, /* 9.9.3.35 UE radio capability information update needed */
4514 de_emm_ue_sec_cap, /* 9.9.3.36 UE security capability */
4515 NULL, /* 9.9.3.37 Emergency Number List (packet-gsm_a_dtap.c) */
4516 de_emm_ext_emerg_num_list, /* 9.9.3.37a Extended Emergency Number List */
4517 NULL, /* 9.9.3.38 CLI */
4518 de_emm_ss_code, /* 9.9.3.39 SS Code */
4519 de_emm_lcs_ind, /* 9.9.3.40 LCS indicator */
4520 de_emm_lcs_client_id, /* 9.9.3.41 LCS client identity */
4521 de_emm_gen_msg_cont_type, /* 9.9.3.42 Generic message container type */
4522 de_emm_gen_msg_cont, /* 9.9.3.43 Generic message container */
4523 NULL, /* 9.9.3.44 Voice domain preference and UE's usage setting */
4524 de_emm_guti_type, /* 9.9.3.45 GUTI type */
4525 NULL, /* 9.9.3.46 Extended DRX parameters */
4526 NULL, /* 9.9.3.47 Data service type */
4527 NULL, /* 9.9.3.48 DCN-ID */
4528 NULL, /* 9.9.3.49 Non-3GPP NW provided policies */
4529 de_emm_hash_mme, /* 9.9.3.50 HashMME */
4530 de_emm_replayed_nas_msg_cont, /* 9.9.3.51 Replayed NAS message container */
4531 de_emm_network_policy, /* 9.9.3.52 Network policy */
4532 de_emm_ue_add_sec_cap, /* 9.9.3.53 UE additional security capability */
4533 NULL, /* 9.9.3.54 UE status */
4534 de_emm_add_info_req, /* 9.9.3.55 Additional information requested */
4535 de_emm_ciph_key_data, /* 9.9.3.56 Ciphering key data */
4536 de_emm_n1_ue_network_cap, /* 9.9.3.57 N1 UE network capability */
4537 de_emm_ue_radio_cap_id_avail, /* 9.9.3.58 UE radio capability ID availability */
4538 de_emm_ue_radio_cap_id_req, /* 9.9.3.59 UE radio capability ID request */
4539 NULL, /* 9.9.3.60 UE radio capability ID */
4540 NULL, /* 9.9.3.61 UE radio capability ID deletion indication */
4541 de_emm_wus_assist_info, /* 9.9.3.62 WUS assistance information */
4542 de_emm_nb_s1_drx_param, /* 9.9.3.63 NB-S1 DRX parameter */
4543 de_emm_imsi_offset, /* 9.9.3.64 IMSI offset */
4544 de_emm_ue_request_type, /* 9.9.3.65 UE request type */
4545 de_emm_paging_restriction, /* 9.9.3.66 Paging restriction */
4546 de_emm_eps_add_req_result, /* 9.9.3.67 EPS additional request result */
4547 de_emm_unavail_info, /* 9.9.3.69 Unavailability information */
4548 de_emm_unavail_config, /* 9.9.3.70 Unavailability configuration */
4549 de_emm_ue_info_req, /* 9.9.3.71 UE information request */
4550 de_emm_ue_coarse_loc_info, /* 9.9.3.72 UE coarse location information */
4552 NULL, /* NONE */
4555 #if 0
4556 defined in packet-gsm_a_common.h
4557 /* 9.9.4 EPS Session Management (ESM) information elements */
4558 typedef enum
4560 DE_ESM_APN, /* 9.9.4.1 Access point name */
4561 DE_ESM_APN_AGR_MAX_BR, /* 9.9.4.2 APN aggregate maximum bit rate */
4562 DE_ESM_CONNECTIVITY_TYPE, /* 9.9.4.2A Connectivity type */
4563 DE_ESM_EPS_QOS, /* 9.9.4.3 EPS quality of service */
4564 DE_ESM_CAUSE, /* 9.9.4.4 ESM cause */
4565 DE_ESM_INF_TRF_FLG, /* 9.9.4.5 ESM information transfer flag */
4566 DE_ESM_LNKED_EPS_B_ID, /* 9.9.4.6 Linked EPS bearer identity */
4567 DE_ESM_LLC_SAPI, /* 9.9.4.7 LLC service access point identifier */
4568 DE_ESM_NOTIF_IND, /* 9.9.4.7a Notification indicator */
4569 DE_ESM_P_FLW_ID, /* 9.9.4.8 Packet flow identifier */
4570 DE_ESM_PDN_ADDR, /* 9.9.4.9 PDN address */
4571 DE_ESM_PDN_TYPE, /* 9.9.4.10 PDN type */
4572 DE_ESM_PROT_CONF_OPT, /* 9.9.4.11 Protocol configuration options */
4573 DE_ESM_QOS, /* 9.9.4.12 Quality of service */
4574 DE_ESM_RA_PRI, /* 9.9.4.13 Radio priority */
4575 DE_ESM_RE_ATTEMPT_IND, /* 9.9.4.13a Re-attempt indicator */
4576 DE_ESM_REQ_TYPE, /* 9.9.4.14 Request type */
4577 DE_ESM_TRAF_FLOW_AGR_DESC, /* 9.9.4.15 Traffic flow aggregate description */
4578 DE_ESM_TRAF_FLOW_TEMPL, /* 9.9.4.16 Traffic flow template */
4579 DE_ESM_TID, /* 9.9.4.17 Transaction identifier */
4580 DE_ESM_WLAN_OFFLOAD_ACCEPT, /* 9.9.4.18 WLAN offload acceptability */
4581 DE_ESM_NBIFOM_CONT, /* 9.9.4.19 NBIFOM container */
4582 DE_ESM_REMOTE_UE_CONTEXT_LIST, /* 9.9.4.20 Remote UE context list */
4583 DE_ESM_PKMF_ADDRESS, /* 9.9.4.21 PKMF address */
4584 DE_ESM_HDR_COMPR_CONFIG, /* 9.9.4.22 Header compression configuration */
4585 DE_ESM_CTRL_PLANE_ONLY_IND, /* 9.9.4.23 Control plane only indication */
4586 DE_ESM_USER_DATA_CONT, /* 9.9.4.24 User data container */
4587 DE_ESM_REL_ASSIST_IND, /* 9.9.4.25 Release assistance indication */
4588 DE_ESM_EXT_PCO, /* 9.9.4.26 Extended protocol configuration options */
4589 DE_ESM_HDR_COMPR_CONFIG_STATUS, /* 9.9.4.27 Header compression configuration status */
4590 DE_ESM_SERV_PLMN_RATE_CTRL, /* 9.9.4.28 Serving PLMN rate control */
4591 DE_ESM_EXT_APN_AGR_MAX_BR, /* 9.9.4.29 Extended APN aggregate maximum bit rate */
4592 DE_ESM_EXT_EPS_QOS, /* 9.9.4.30 Extended EPS quality of service */
4593 DE_ESM_NONE /* NONE */
4595 nas_esm_elem_idx_t;
4596 #endif
4598 static const value_string nas_esm_elem_strings[] = {
4599 { DE_ESM_APN, "Access point name" }, /* 9.9.4.1 Access point name */
4600 { DE_ESM_APN_AGR_MAX_BR, "APN aggregate maximum bit rate" }, /* 9.9.4.2 APN aggregate maximum bit rate */
4601 { DE_ESM_CONNECTIVITY_TYPE, "Connectivity type" }, /* 9.9.4.2A Connectivity type */
4602 { DE_ESM_EPS_QOS, "EPS quality of service" }, /* 9.9.4.3 EPS quality of service */
4603 { DE_ESM_CAUSE, "ESM cause" }, /* 9.9.4.4 ESM cause */
4604 { DE_ESM_INF_TRF_FLG, "ESM information transfer flag" }, /* 9.9.4.5 ESM information transfer flag */
4605 { DE_ESM_LNKED_EPS_B_ID, "Linked EPS bearer identity" }, /* 9.9.4.6 Linked EPS bearer identity */
4606 { DE_ESM_LLC_SAPI, "LLC service access point identifier" }, /* 9.9.4.7 LLC service access point identifier */
4607 { DE_ESM_NOTIF_IND, "Notification indicator" }, /* 9.9.4.7a Notification indicator */
4608 { DE_ESM_P_FLW_ID, "Packet flow identifier" }, /* 9.9.4.8 Packet flow identifier */
4609 { DE_ESM_PDN_ADDR, "PDN address" }, /* 9.9.4.9 PDN address */
4610 { DE_ESM_PDN_TYPE, "PDN type" }, /* 9.9.4.10 PDN type */
4611 { DE_ESM_PROT_CONF_OPT, "Protocol configuration options" }, /* 9.9.4.11 Protocol configuration options */
4612 { DE_ESM_QOS, "Quality of service" }, /* 9.9.4.12 Quality of service */
4613 { DE_ESM_RA_PRI, "Radio priority" }, /* 9.9.4.13 Radio priority */
4614 { DE_ESM_RE_ATTEMPT_IND, "Re-attempt indicator" }, /* 9.9.4.13a Re-attempt indicator */
4615 { DE_ESM_REQ_TYPE, "Request type" }, /* 9.9.4.14 Request type */
4616 { DE_ESM_TRAF_FLOW_AGR_DESC, "Traffic flow aggregate description" }, /* 9.9.4.15 Traffic flow aggregate description */
4617 { DE_ESM_TRAF_FLOW_TEMPL, "Traffic flow template" }, /* 9.9.4.16 Traffic flow template */
4618 { DE_ESM_TID, "Transaction identifier" }, /* 9.9.4.17 Transaction identifier */
4619 { DE_ESM_WLAN_OFFLOAD_ACCEPT, "WLAN offload acceptability" }, /* 9.9.4.18 WLAN offload acceptability */
4620 { DE_ESM_NBIFOM_CONT, "NBIFOM container" }, /* 9.9.4.19 NBIFOM container */
4621 { DE_ESM_REMOTE_UE_CONTEXT_LIST, "Remote UE context list" }, /* 9.9.4.20 Remote UE context list */
4622 { DE_ESM_PKMF_ADDRESS, "PKMF address" }, /* 9.9.4.21 PKMF address */
4623 { DE_ESM_HDR_COMPR_CONFIG, "Header compression configuration" }, /* 9.9.4.22 Header compression configuration */
4624 { DE_ESM_CTRL_PLANE_ONLY_IND, "Control plane only indication" }, /* 9.9.4.23 Control plane only indication */
4625 { DE_ESM_USER_DATA_CONT, "User data container" }, /* 9.9.4.24 User data container */
4626 { DE_ESM_REL_ASSIST_IND, "Release assistance indication" }, /* 9.9.4.25 Release assistance indication */
4627 { DE_ESM_EXT_PCO, "Extended protocol configuration options" }, /* 9.9.4.26 Extended protocol configuration options */
4628 { DE_ESM_HDR_COMPR_CONFIG_STATUS, "Header compression configuration status" },/* 9.9.4.27 Header compression configuration status */
4629 { DE_ESM_SERV_PLMN_RATE_CTRL, "Serving PLMN rate control" }, /* 9.9.4.28 Serving PLMN rate control */
4630 { DE_ESM_EXT_APN_AGR_MAX_BR, "Extended APN aggregate maximum bit rate" }, /* 9.9.4.29 Extended APN aggregate maximum bit rate */
4631 { DE_ESM_EXT_EPS_QOS, "Extended EPS quality of service" }, /* 9.9.4.30 Extended EPS quality of service */
4632 { 0, NULL }
4634 value_string_ext nas_esm_elem_strings_ext = VALUE_STRING_EXT_INIT(nas_esm_elem_strings);
4636 #define NUM_NAS_ESM_ELEM array_length(nas_esm_elem_strings)
4637 int ett_nas_eps_esm_elem[NUM_NAS_ESM_ELEM];
4639 uint16_t (*esm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len) = {
4640 NULL, /* 9.9.4.1 Access point name */
4641 de_esm_apn_aggr_max_br, /* 9.9.4.2 APN aggregate maximum bit rate */
4642 NULL, /* 9.9.4.2A Connectivity type */
4643 de_esm_qos, /* 9.9.4.3 EPS quality of service */
4644 de_esm_cause, /* 9.9.4.4 ESM cause */
4645 de_esm_inf_trf_flg, /* 9.9.4.5 ESM information transfer flag */
4646 NULL, /* 9.9.4.6 Linked EPS bearer identity */
4647 NULL, /* 9.9.4.7 LLC service access point identifier */
4648 de_esm_notif_ind, /* 9.9.4.7a Notification indicator */
4649 NULL, /* 9.9.4.8 Packet flow identifier */
4650 de_esm_pdn_addr, /* 9.9.4.9 PDN address */
4651 NULL, /* 9.9.4.10 PDN type */
4652 NULL, /* 9.9.4.11 Protocol configuration options */
4653 NULL, /* 9.9.4.12 Quality of service */
4654 NULL, /* 9.9.4.13 Radio priority */
4655 de_esm_re_attempt_ind, /* 9.9.4.13a Re-attempt indicator */
4656 NULL, /* 9.9.4.14 Request type */
4657 NULL, /* 9.9.4.15 Traffic flow aggregate description */
4658 NULL, /* 9.9.4.16 Traffic flow template */
4659 NULL, /* 9.9.4.17 Transaction identifier */
4660 NULL, /* 9.9.4.18 WLAN offload acceptability */
4661 de_esm_nbifom_cont, /* 9.9.4.19 NBIFOM container */
4662 de_esm_remote_ue_context_list, /* 9.9.4.20 Remote UE context list */
4663 de_esm_pkmf_address, /* 9.9.4.21 PKMF address */
4664 de_esm_hdr_compr_config, /* 9.9.4.22 Header compression configuration */
4665 de_esm_ctrl_plane_only_ind, /* 9.9.4.23 Control plane only indication */
4666 de_esm_user_data_cont, /* 9.9.4.24 User data container */
4667 de_esm_rel_assist_ind, /* 9.9.4.25 Release assistance indication */
4668 de_esm_ext_pco, /* 9.9.4.26 Extended protocol configuration options */
4669 de_esm_hdr_compr_config_status, /* 9.9.4.27 Header compression configuration status */
4670 de_esm_serv_plmn_rate_ctrl, /* 9.9.4.28 Serving PLMN rate control */
4671 de_esm_ext_apn_agr_max_br, /* 9.9.4.29 Extended APN aggregate maximum bit rate */
4672 de_esm_ext_eps_qos, /* 9.9.4.30 Extended EPS quality of service */
4673 NULL, /* NONE */
4676 /* MESSAGE FUNCTIONS */
4679 * 8.2.1 Attach accept
4682 static void
4683 nas_emm_attach_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4685 uint32_t curr_offset, bit_offset;
4686 uint32_t consumed;
4687 unsigned curr_len;
4689 curr_offset = offset;
4690 curr_len = len;
4692 pinfo->link_dir = P2P_DIR_DL;
4694 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
4695 bit_offset = curr_offset<<3;
4696 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4697 bit_offset+=4;
4698 /* EPS attach result EPS attach result 9.9.3.10 M V 1/2 */
4699 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4700 bit_offset++;
4701 proto_tree_add_bits_item(tree, hf_nas_eps_emm_EPS_attach_result, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4702 /*bit_offset+=3;*/
4703 /* Fix up the lengths */
4704 curr_len--;
4705 curr_offset++;
4706 /* T3412 value GPRS timer 9.9.3.16 M V 1 */
4707 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3412 value", ei_nas_eps_missing_mandatory_elemen);
4708 /* Tracking area identity list 9.9.3.33 M LV 7-97 */
4709 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - TAI list", ei_nas_eps_missing_mandatory_elemen);
4710 /* ESM message container 9.9.3.15 M LV-E 2-n */
4711 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL, ei_nas_eps_missing_mandatory_elemen);
4712 /* 50 GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
4713 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
4714 /* 13 Location area identification Location area identification 9.9.2.2 O TV 6 */
4715 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, NULL);
4716 /* 23 MS identity Mobile identity 9.9.2.3 O TLV 7-10 */
4717 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - MS identity");
4718 /* 53 EMM cause EMM cause 9.9.3.9 O TV 2 */
4719 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
4720 /* 17 T3402 value GPRS timer 9.9.3.16 O TV 2 */
4721 ELEM_OPT_TV(0x17, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3402 value");
4722 /* 59 T3423 value GPRS timer 9.9.3.16 O TV 2 */
4723 ELEM_OPT_TV(0x59, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3423 value");
4724 /* 4A Equivalent PLMNs PLMN list 9.9.2.8 O TLV 5-47 */
4725 ELEM_OPT_TLV(0x4a, GSM_A_PDU_TYPE_COMMON, DE_PLMN_LIST, " - Equivalent PLMNs");
4726 /* 34 Emergency Number List 9.9.3.37 O TLV 5-50 */
4727 ELEM_OPT_TLV(0x34, GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST, NULL);
4728 /* 64 EPS network feature support EPS network feature support 9.9.3.12A O TLV 3 */
4729 ELEM_OPT_TLV(0x64, NAS_PDU_TYPE_EMM, DE_EMM_EPS_NET_FEATURE_SUP, NULL);
4730 /* F- Additional update result Additional update result 9.9.3.0A O TV 1 */
4731 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_RES, NULL );
4732 /* 5E T3412 extended value GPRS timer 3 9.9.3.16B O TLV 3 */
4733 ELEM_OPT_TLV(0x5E, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - T3412 extended value");
4734 /* 6A T3324 value GPRS timer 2 9.9.3.16A O TLV 3 */
4735 ELEM_OPT_TLV(0x6A, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2, " - T3324 value");
4736 /* 6E Extended DRX parameters Extended DRX parameters 9.9.3.46 O TLV 3-4 */
4737 ELEM_OPT_TLV(0x6E, GSM_A_PDU_TYPE_GM, DE_EXT_DRX_PARAMS, NULL);
4738 /* 65 DCN-ID DCN-ID 9.9.3.48 O TLV 4 */
4739 ELEM_OPT_TLV(0x65, GSM_A_PDU_TYPE_GM, DE_DCN_ID, NULL);
4740 /* E- SMS services status SMS services status 9.9.3.4B O TV 1 */
4741 ELEM_OPT_TV_SHORT(0xE0, NAS_PDU_TYPE_EMM, DE_EMM_SMS_SERVICES_STATUS, NULL);
4742 /* D- Non-3GPP NW provided policies Non-3GPP NW provided policies O TV 1 */
4743 ELEM_OPT_TV_SHORT(0xD0, GSM_A_PDU_TYPE_GM, DE_NON_3GPP_NW_PROV_POL, NULL);
4744 /* 6B T3448 value GPRS timer 2 9.9.3.16A O TLV 3 */
4745 ELEM_OPT_TLV(0x6B, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2, " - T3448 value");
4746 /* C- Network policy Network policy 9.9.3.52 O TV 1 */
4747 ELEM_OPT_TV_SHORT(0xC0, NAS_PDU_TYPE_EMM, DE_EMM_NETWORK_POLICY, NULL);
4748 /* 6C T3447 value GPRS timer 3 9.9.3.16B O TLV 3 */
4749 ELEM_OPT_TLV(0x6C, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - T3447 value");
4750 /* 7A Extended emergency number list Extended emergency number list 9.9.3.37A O TLV-E 7-65538 */
4751 ELEM_OPT_TLV_E(0x7A, NAS_PDU_TYPE_EMM, DE_EMM_EXT_EMERG_NUM_LIST, NULL);
4752 /* 7C Ciphering key data Ciphering key data 9.9.3.56 O TLV-E 35-2291 */
4753 ELEM_OPT_TLV_E(0x7C, NAS_PDU_TYPE_EMM, DE_EMM_CIPH_KEY_DATA, NULL);
4754 /* 66 UE radio capability ID UE radio capability ID 9.9.3.60 O TLV 3-n */
4755 ELEM_OPT_TLV(0x66, NAS_5GS_PDU_TYPE_MM, DE_NAS_5GS_MM_UE_RADIO_CAP_ID, NULL);
4756 /* B- UE radio capability ID deletion indication UE radio capability ID deletion indication O TV 1 */
4757 ELEM_OPT_TV_SHORT(0xB0, NAS_5GS_PDU_TYPE_MM, DE_NAS_5GS_MM_UE_RADIO_CAP_ID_DEL_IND, NULL);
4758 /* 35 Negotiated WUS assistance information WUS assistance information 9.9.3.62 O TLV 3-n */
4759 ELEM_OPT_TLV(0x35, NAS_PDU_TYPE_EMM, DE_EMM_WUS_ASSIST_INFO, " - Negotiated");
4760 /* 36 Negotiated DRX parameter in NB-S1 mode NB-S1 DRX parameter 9.9.3.63 O TLV 3 */
4761 ELEM_OPT_TLV(0x36, NAS_PDU_TYPE_EMM, DE_EMM_NB_S1_DRX_PARAM, " - Negotiated");
4762 /* 38 Negotiated IMSI offset IMSI offset 9.9.3.64 O TLV 4 */
4763 ELEM_OPT_TLV(0x38, NAS_PDU_TYPE_EMM, DE_EMM_IMSI_OFFSET, " - Negotiated");
4764 /* 1D Forbidden TAI(s) for the list of "forbidden tracking areas for roaming" Tracking area identity list 9.9.3.33 O TLV 8-98 */
4765 ELEM_OPT_TLV(0x1D, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - Forbidden TAI(s) for the list of \"forbidden tracking areas for roaming\"");
4766 /* 1E Forbidden TAI(s) for the list of "forbidden tracking areas for regional provision of service" Tracking area identity list 9.9.3.33 O TLV 8-98 */
4767 ELEM_OPT_TLV(0x1E, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - Forbidden TAI(s) for the list of \"forbidden tracking areas for regional provision of service\"");
4768 /* 1F Unavailability configuration Unavailability configuration 9.9.3.70 O TLV 3-9 */
4769 ELEM_OPT_TLV(0x1F, NAS_PDU_TYPE_EMM, DE_EMM_UNAVAIL_CONFIG, NULL);
4771 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
4774 * 8.2.2 Attach complete
4776 static void
4777 nas_emm_attach_comp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4779 uint32_t curr_offset;
4780 uint32_t consumed;
4781 unsigned curr_len;
4783 curr_offset = offset;
4784 curr_len = len;
4786 pinfo->link_dir = P2P_DIR_UL;
4788 /* ESM message container ESM message container 9.9.3.15 M LV-E 2-n */
4789 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL, ei_nas_eps_missing_mandatory_elemen);
4791 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
4796 * 8.2.3 Attach reject
4798 static void
4799 nas_emm_attach_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4801 uint32_t curr_offset;
4802 uint32_t consumed;
4803 unsigned curr_len;
4805 curr_offset = offset;
4806 curr_len = len;
4808 pinfo->link_dir = P2P_DIR_DL;
4810 /* * EMM cause EMM cause 9.9.3.9 M V 1 */
4811 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL, ei_nas_eps_missing_mandatory_elemen);
4812 /* 78 ESM message container ESM message container 9.9.3.15 O TLV-E 4-n */
4813 ELEM_OPT_TLV_E(0x78, NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL);
4814 /* 5F T3346 value GPRS timer 2 9.9.3.16A O TLV 3 */
4815 ELEM_OPT_TLV(0x5F, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2, " - T3346 value");
4816 /* 16 T3402 value GPRS timer 2 9.9.3.16A O TLV 3 */
4817 ELEM_OPT_TLV(0x16, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2, " - T3402 value");
4818 /* A- Extended EMM cause Extended EMM cause 9.9.3.26A O TV 1 */
4819 ELEM_OPT_TV_SHORT( 0xA0, NAS_PDU_TYPE_EMM, DE_EMM_EXT_CAUSE, NULL );
4820 /* 1C Lower bound timer value GPRS timer 3 9.9.3.16B O TLV 3 */
4821 ELEM_OPT_TLV(0x1C, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - Lower bound timer value");
4822 /* 1D Forbidden TAI(s) for the list of "forbidden tracking areas for roaming" Tracking area identity list 9.9.3.33 O TLV 8-98 */
4823 ELEM_OPT_TLV(0x1D, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - Forbidden TAI(s) for the list of \"forbidden tracking areas for roaming\"");
4824 /* 1E Forbidden TAI(s) for the list of "forbidden tracking areas for regional provision of service" Tracking area identity list 9.9.3.33 O TLV 8-98 */
4825 ELEM_OPT_TLV(0x1E, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - Forbidden TAI(s) for the list of \"forbidden tracking areas for regional provision of service\"");
4827 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
4831 * 8.2.4 Attach request
4833 static void
4834 nas_emm_attach_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4836 uint32_t curr_offset, bit_offset;
4837 uint32_t consumed;
4838 unsigned curr_len;
4840 curr_offset = offset;
4841 curr_len = len;
4843 bit_offset = curr_offset<<3;
4845 pinfo->link_dir = P2P_DIR_UL;
4847 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
4848 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
4849 bit_offset+=4;
4851 /* EPS attach type EPS attach type 9.9.3.11 M V 1/2
4852 * Inline:
4854 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4855 bit_offset++;
4856 proto_tree_add_bits_item(tree, hf_nas_eps_emm_eps_att_type, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4857 /*bit_offset+=3;*/
4859 /* Fix the lengths */
4860 curr_len--;
4861 curr_offset++;
4862 /* Old GUTI or IMSI EPS mobile identity 9.9.3.12 M LV 5-12 */
4863 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, NULL, ei_nas_eps_missing_mandatory_elemen);
4864 /* UE network capability UE network capability 9.9.3.34 M LV 3-14 */
4865 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_UE_NET_CAP, NULL, ei_nas_eps_missing_mandatory_elemen);
4866 /* ESM message container ESM message container 9.9.3.15 M LV-E 2-n */
4867 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL, ei_nas_eps_missing_mandatory_elemen);
4868 /* 19 Old P-TMSI signature P-TMSI signature 10.5.5.8 O TV 4 */
4869 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, " - Old P-TMSI Signature");
4870 /* 50 Additional GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
4871 ELEM_OPT_TLV( 0x50 , NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Additional GUTI");
4872 /* 52 Last visited registered TAI Tracking area identity 9.9.3.32 O TV 6 */
4873 ELEM_OPT_TV(0x52, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, " - Last visited registered TAI");
4874 /* 5c DRX parameter DRX parameter 9.9.3.8 O TV 3 */
4875 ELEM_OPT_TV(0x5c, GSM_A_PDU_TYPE_GM, DE_DRX_PARAM, NULL );
4876 /* 31 MS network capability MS network capability 9.9.3.20 M LV 3-9 */
4877 ELEM_OPT_TLV( 0x31, GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP , NULL );
4878 /* 13 Old location area identification Location area identification 9.9.2.2 O TV 6 */
4879 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, " - Old location area identification");
4880 /* 9- TMSI status TMSI status 9.9.3.31 O TV 1 */
4881 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , NULL );
4882 /* 11 Mobile station classmark 2 Mobile station classmark 2 9.9.2.5 O TLV 5 */
4883 ELEM_OPT_TLV( 0x11, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_2 , NULL );
4884 /* 20 Mobile station classmark 3 Mobile station classmark 3 9.9.2.5 O TLV 2-34 */
4885 ELEM_OPT_TLV( 0x20, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_3 , NULL );
4886 /* 40 Supported Codecs Supported Codec List 9.9.2.10 O TLV 5-n */
4887 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, " - Supported Codecs");
4888 /* F- Additional update type Additional update type 9.9.3.0B O TV 1 */
4889 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_TYPE, NULL );
4890 /* 5D Voice domain preference and UE's usage setting Voice domain preference and UE's usage setting 9.9.3.44 O TLV 3 */
4891 ELEM_OPT_TLV(0x5D, GSM_A_PDU_TYPE_GM, DE_VOICE_DOMAIN_PREF, NULL);
4892 /* D- Device properties Device properties 9.9.2.0A O TV 1 */
4893 ELEM_OPT_TV_SHORT(0xD0 , GSM_A_PDU_TYPE_GM, DE_DEVICE_PROPERTIES, NULL);
4894 /* E- Old GUTI type GUTI type 9.9.3.45 O TV 1 */
4895 ELEM_OPT_TV_SHORT(0xE0 , NAS_PDU_TYPE_EMM, DE_EMM_GUTI_TYPE, " - Old GUTI type");
4896 /* C- MS network feature support MS network feature support 9.9.3.20A O TV 1 */
4897 ELEM_OPT_TV_SHORT(0xC0 , GSM_A_PDU_TYPE_COMMON, DE_MS_NET_FEAT_SUP, NULL);
4898 /* 10 TMSI based NRI container Network resource identifier container 9.9.3.24A O TLV 4 */
4899 ELEM_OPT_TLV(0x10, GSM_A_PDU_TYPE_GM, DE_NET_RES_ID_CONT, " - TMSI based NRI container");
4900 /* 6A T3324 value GPRS timer 2 9.9.3.16A O TLV 3 */
4901 ELEM_OPT_TLV(0x6A, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2, " - T3324 value");
4902 /* 5E T3412 extended value GPRS timer 3 9.9.3.16B O TLV 3 */
4903 ELEM_OPT_TLV(0x5E, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - T3412 extended value");
4904 /* 6E Extended DRX parameters Extended DRX parameters 9.9.3.46 O TLV 3-4 */
4905 ELEM_OPT_TLV(0x6E, GSM_A_PDU_TYPE_GM, DE_EXT_DRX_PARAMS, NULL);
4906 /* 6F UE additional security capability UE additional security capability 9.9.3.53 O TLV 6 */
4907 ELEM_OPT_TLV(0x6F, NAS_PDU_TYPE_EMM, DE_EMM_UE_ADD_SEC_CAP, NULL);
4908 /* 6D UE status UE status 9.9.3.54 O TLV 3 */
4909 ELEM_OPT_TLV(0x6D, NAS_5GS_PDU_TYPE_MM, DE_NAS_5GS_MM_UE_STATUS, NULL);
4910 /* 17 Additional information requested Additional information requested 9.9.3.55 O TV 2 */
4911 ELEM_OPT_TV(0x17, NAS_PDU_TYPE_EMM, DE_EMM_ADD_INFO_REQ, NULL);
4912 /* 32 N1 UE network capability N1 UE network capability 9.9.3.57 O TLV 3-15 */
4913 ELEM_OPT_TLV(0x32, NAS_PDU_TYPE_EMM, DE_EMM_N1_UE_NETWORK_CAP, NULL);
4914 /* 34 UE radio capability ID availability UE radio capability ID availability O TLV 3 */
4915 ELEM_OPT_TLV(0x34, NAS_PDU_TYPE_EMM, DE_EMM_UE_RADIO_CAP_ID_AVAIL, NULL);
4916 /* 35 Requested WUS assistance WUS assistance information O TLV 3-n */
4917 ELEM_OPT_TLV(0x35, NAS_PDU_TYPE_EMM, DE_EMM_WUS_ASSIST_INFO, " - Requested");
4918 /* 36 DRX parameter in NB-S1 mode NB-S1 DRX parameter 9.9.3.63 O TLV 3 */
4919 ELEM_OPT_TLV(0x36, NAS_PDU_TYPE_EMM, DE_EMM_NB_S1_DRX_PARAM, NULL);
4920 /* 38 Requested IMSI offset IMSI offset 9.9.3.64 O TLV 4 */
4921 ELEM_OPT_TLV(0x38, NAS_PDU_TYPE_EMM, DE_EMM_IMSI_OFFSET, " - Requested");
4923 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
4927 * 8.2.5 Authentication failure
4929 static void
4930 nas_emm_auth_fail(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4932 uint32_t curr_offset;
4933 uint32_t consumed;
4934 unsigned curr_len;
4936 curr_offset = offset;
4937 curr_len = len;
4939 pinfo->link_dir = P2P_DIR_UL;
4941 /* EMM cause EMM cause 9.9.3.9 M V 1 */
4942 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL, ei_nas_eps_missing_mandatory_elemen);
4943 /* 30 Authentication failure parameter Authentication failure parameter 9.9.3.1 O TLV 1 */
4944 ELEM_OPT_TLV(0x30, GSM_A_PDU_TYPE_DTAP, DE_AUTH_FAIL_PARAM, NULL);
4946 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
4949 * 8.2.6 Authentication reject
4950 * No IE:s
4953 * 8.2.7 Authentication request
4956 static void
4957 nas_emm_auth_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4959 uint32_t curr_offset, bit_offset;
4960 uint32_t consumed;
4961 unsigned curr_len;
4963 curr_offset = offset;
4964 curr_len = len;
4966 pinfo->link_dir = P2P_DIR_DL;
4968 bit_offset = curr_offset<<3;
4969 /* H1 */
4970 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
4971 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4972 bit_offset+=4;
4973 /* H0 */
4975 * NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2
4977 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, " ASME");
4978 /*bit_offset+=4;*/
4980 /* Fix the lengths */
4981 curr_len--;
4982 curr_offset++;
4985 * Authentication parameter RAND (EPS challenge) 9.9.3.3 M V 16
4987 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_RAND, " - EPS challenge", ei_nas_eps_missing_mandatory_elemen);
4989 * Authentication parameter AUTN (EPS challenge) 9.9.3.2 M LV 17
4991 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_AUTN, " - EPS challenge", ei_nas_eps_missing_mandatory_elemen);
4993 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
4997 * 8.2.8 Authentication response
4999 static void
5000 nas_emm_auth_resp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5002 uint32_t curr_offset;
5003 uint32_t consumed;
5004 unsigned curr_len;
5006 curr_offset = offset;
5007 curr_len = len;
5009 pinfo->link_dir = P2P_DIR_UL;
5012 * Authentication response parameter 9.9.3.4 M LV 5-17
5014 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_AUTH_RESP_PAR, NULL, ei_nas_eps_missing_mandatory_elemen);
5016 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5020 * 8.2.9 CS service notification
5023 static void
5024 nas_emm_cs_serv_not(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5026 uint32_t curr_offset;
5027 uint32_t consumed;
5028 unsigned curr_len;
5030 curr_offset = offset;
5031 curr_len = len;
5033 pinfo->link_dir = P2P_DIR_DL;
5035 /* Paging identity Paging identity 9.9.3.25A M V 1 */
5036 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_PAGING_ID, NULL, ei_nas_eps_missing_mandatory_elemen);
5037 /* 60 CLI CLI 9.9.3.38 O TLV 3-12 */
5038 ELEM_OPT_TLV(0x60, GSM_A_PDU_TYPE_DTAP, DE_CLG_PARTY_BCD_NUM, " - CLI");
5039 /* 61 SS Code SS Code 9.9.3.39 O TV 2 */
5040 ELEM_OPT_TV(0x61, NAS_PDU_TYPE_EMM, DE_EMM_SS_CODE, NULL);
5041 /* 62 LCS indicator LCS indicator 9.9.3.40 O TV 2 */
5042 ELEM_OPT_TV(0x62, NAS_PDU_TYPE_EMM, DE_EMM_LCS_IND, NULL);
5043 /* 63 LCS client identity LCS client identity 9.9.3.41 O TLV 3-257 */
5044 ELEM_OPT_TLV(0x63, NAS_PDU_TYPE_EMM, DE_EMM_LCS_CLIENT_ID, NULL);
5046 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5049 * 8.2.10 Detach accept
5050 * 8.2.10.1 Detach accept (UE originating detach)
5051 * No further IE's
5052 * 8.2.10.2 Detach accept (UE terminated detach)
5053 * No further IE's
5056 * 8.2.11 Detach request
5057 * 8.2.11.1 Detach request (UE originating detach)
5060 static void
5061 nas_emm_detach_req_UL(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5063 uint32_t curr_offset,bit_offset;
5064 uint32_t consumed;
5065 unsigned curr_len;
5066 uint64_t switch_off;
5067 uint64_t detach_type;
5069 curr_offset = offset;
5070 curr_len = len;
5072 proto_tree_add_item(tree, hf_nas_eps_emm_detach_req_UL, tvb, curr_offset, len, ENC_NA);
5073 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
5074 bit_offset = curr_offset<<3;
5075 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
5076 bit_offset+=4;
5077 /* Detach type Detach type 9.9.3.6 M V 1/2 */
5078 proto_tree_add_bits_ret_val(tree, hf_nas_eps_emm_switch_off, tvb, bit_offset, 1, &switch_off, ENC_BIG_ENDIAN);
5079 bit_offset++;
5080 proto_tree_add_bits_ret_val(tree, hf_nas_eps_emm_detach_type_UL, tvb, bit_offset, 3, &detach_type, ENC_BIG_ENDIAN);
5081 /* bit_offset+=3;*/
5082 /* Show detach reason in Info column. TODO: expert info ? */
5083 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s%s)",
5084 val_to_str_const((uint32_t)detach_type, nas_eps_emm_type_of_detach_UL_vals, "Unknown"),
5085 (switch_off==0) ? "" : " / switch-off");
5087 /* Fix the lengths */
5088 curr_len--;
5089 curr_offset++;
5091 /* GUTI or IMSI EPS mobile identity 9.9.3.12 M LV 5-12 */
5092 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, NULL, ei_nas_eps_missing_mandatory_elemen);
5095 * 8.2.11.2 Detach request (UE terminated detach)
5097 static void
5098 nas_emm_detach_req_DL(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5100 uint32_t curr_offset, bit_offset;
5101 uint32_t consumed;
5102 unsigned curr_len;
5103 uint64_t detach_type;
5105 curr_offset = offset;
5106 curr_len = len;
5108 proto_tree_add_item(tree, hf_nas_eps_emm_detach_req_DL, tvb, curr_offset, len, ENC_NA);
5109 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
5110 bit_offset = curr_offset<<3;
5111 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
5112 bit_offset+=4;
5113 /* Detach type Detach type 9.9.3.6 M V 1/2 */
5114 /* In the network to UE direction bit 4 is spare. The network shall set this bit to zero. */
5115 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
5116 bit_offset++;
5117 proto_tree_add_bits_ret_val(tree, hf_nas_eps_emm_detach_type_DL, tvb, bit_offset, 3, &detach_type, ENC_BIG_ENDIAN);
5118 /*bit_offset+=3;*/
5119 /* Show detach reason in Info column. TODO: expert info ? */
5120 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
5121 val_to_str_const((uint32_t)detach_type, nas_eps_emm_type_of_detach_DL_vals, "Unknown"));
5123 /* Fix the lengths */
5124 curr_len--;
5125 curr_offset++;
5127 /* EMM cause EMM cause 9.9.3.9 O TV 2 */
5128 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
5129 /* Lower bound timer value GPRS timer 3 9.9.3.16B O TLV 3 */
5130 ELEM_OPT_TLV(0x1C, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - Lower bound timer value");
5131 /* Forbidden TAI(s) for the list of "forbidden tracking areas for roaming" Tracking area identity list 9.9.3.33 O TLV 8-98 */
5132 ELEM_OPT_TLV(0x1D, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - Forbidden TAI(s) for the list of \"forbidden tracking areas for roaming\"");
5133 /* Forbidden TAI(s) for the list of "forbidden tracking areas for regional provision of service" Tracking area identity list 9.9.3.33 O TLV 8-98 */
5134 ELEM_OPT_TLV(0x1E, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - Forbidden TAI(s) for the list of \"forbidden tracking areas for regional provision of service\"");
5136 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5138 static void
5139 nas_emm_detach_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5141 if (pinfo->link_dir == P2P_DIR_UL) {
5142 nas_emm_detach_req_UL(tvb, tree, pinfo, offset, len);
5143 return;
5144 }else if (pinfo->link_dir == P2P_DIR_DL) {
5145 nas_emm_detach_req_DL(tvb, tree, pinfo, offset, len);
5146 return;
5149 if (len >= 8) {
5150 nas_emm_detach_req_UL(tvb, tree, pinfo, offset, len);
5151 } else {
5152 nas_emm_detach_req_DL(tvb, tree, pinfo, offset, len);
5157 * 8.2.12 Downlink NAS Transport
5159 static void
5160 nas_emm_dl_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5162 uint32_t curr_offset;
5163 uint32_t consumed;
5164 unsigned curr_len;
5166 curr_offset = offset;
5167 curr_len = len;
5169 pinfo->link_dir = P2P_DIR_DL;
5171 /* NAS message container NAS message container 9.9.3.22 M LV 3-252 */
5172 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_NAS_MSG_CONT, NULL, ei_nas_eps_missing_mandatory_elemen);
5174 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5177 * 8.2.13 EMM information
5179 static void
5180 nas_emm_emm_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5182 uint32_t curr_offset;
5183 uint32_t consumed;
5184 unsigned curr_len;
5186 curr_offset = offset;
5187 curr_len = len;
5189 pinfo->link_dir = P2P_DIR_DL;
5191 /* 43 Full name for network Network name 9.9.3.24 O TLV 3-? */
5192 ELEM_OPT_TLV(0x43, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Full name for network");
5193 /* 45 Short name for network Network name 9.9.3.24 O TLV 3-? */
5194 ELEM_OPT_TLV(0x45, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Short Name");
5195 /* 46 Local time zone Time zone 9.9.3.29 O TV 2 */
5196 ELEM_OPT_TV(0x46, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE, " - Local");
5197 /* 47 Universal time and local time zone Time zone and time 9.9.3.30 O TV 8 */
5198 ELEM_OPT_TV(0x47, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE_TIME, " - Universal Time and Local Time Zone");
5199 /* 49 Network daylight saving time Daylight saving time 9.9.3.6 O TLV 3 */
5200 ELEM_OPT_TLV(0x49, GSM_A_PDU_TYPE_DTAP, DE_DAY_SAVING_TIME, NULL);
5202 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5207 * 8.2.14 EMM status
5209 static void
5210 nas_emm_emm_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5212 uint32_t curr_offset;
5213 uint32_t consumed;
5214 unsigned curr_len;
5216 curr_offset = offset;
5217 curr_len = len;
5219 /* EMM cause EMM cause 9.9.3.9 M V 1 */
5220 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL, ei_nas_eps_missing_mandatory_elemen);
5222 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5226 * 8.2.15 Extended service request
5228 static void
5229 nas_emm_ext_serv_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5231 uint32_t curr_offset,bit_offset;
5232 uint32_t consumed;
5233 unsigned curr_len;
5235 curr_offset = offset;
5236 curr_len = len;
5238 bit_offset = curr_offset<<3;
5240 pinfo->link_dir = P2P_DIR_UL;
5242 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
5243 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
5244 bit_offset+=4;
5245 /* Service type Service type 9.9.3.27 M V 1/2 Service type*/
5246 proto_tree_add_bits_item(tree, hf_nas_eps_service_type, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
5247 /*bit_offset+=4;*/
5248 /* Fix up the lengths */
5249 curr_len--;
5250 curr_offset++;
5252 /* M-TMSI Mobile identity 9.9.2.3 M LV 6 */
5253 ELEM_MAND_LV(NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - M-TMSI", ei_nas_eps_missing_mandatory_elemen);
5254 /* B- CSFB response CSFB response 9.9.3.5 C TV 1 */
5255 ELEM_OPT_TV_SHORT(0xb0, NAS_PDU_TYPE_EMM, DE_EMM_CSFB_RESP, NULL);
5256 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
5257 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, NULL);
5258 /* D- Device properties Device properties 9.9.2.0A O TV 1 */
5259 ELEM_OPT_TV_SHORT(0xD0 , GSM_A_PDU_TYPE_GM, DE_DEVICE_PROPERTIES, NULL);
5260 /* 29 UE request type UE request type 9.9.3.65 O TLV 3 */
5261 ELEM_OPT_TLV(0x29, NAS_PDU_TYPE_EMM, DE_EMM_UE_REQUEST_TYPE, NULL);
5262 /* 28 Paging restriction Paging restriction 9.9.3.66 O TLV 3-5 */
5263 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_EMM, DE_EMM_PAGING_RESTRICTION, NULL);
5265 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5268 * 8.2.16 GUTI reallocation command
5270 static void
5271 nas_emm_guti_realloc_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5273 uint32_t curr_offset;
5274 uint32_t consumed;
5275 unsigned curr_len;
5277 curr_offset = offset;
5278 curr_len = len;
5280 pinfo->link_dir = P2P_DIR_DL;
5282 /* GUTI EPS mobile identity 9.9.3.12 M LV 12 */
5283 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI", ei_nas_eps_missing_mandatory_elemen);
5284 /* 54 TAI list Tracking area identity list 9.9.3.33 O TLV 8-98 */
5285 ELEM_OPT_TLV(0x54, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, NULL);
5286 /* 65 DCN-ID DCN-ID 9.9.3.48 O TLV 4 */
5287 ELEM_OPT_TLV(0x65, GSM_A_PDU_TYPE_GM, DE_DCN_ID, NULL);
5288 /* 66 UE radio capability ID UE radio capability ID 9.9.3.60 O TLV 3-n */
5289 ELEM_OPT_TLV(0x66, NAS_5GS_PDU_TYPE_MM, DE_NAS_5GS_MM_UE_RADIO_CAP_ID, NULL);
5290 /* B- UE radio capability ID deletion indication UE radio capability ID deletion indication O TV 1 */
5291 ELEM_OPT_TV_SHORT(0xB0, NAS_5GS_PDU_TYPE_MM, DE_NAS_5GS_MM_UE_RADIO_CAP_ID_DEL_IND, NULL);
5293 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5297 * 8.2.17 GUTI reallocation complete
5298 * No more IE's
5301 * 8.2.18 Identity request
5304 static void
5305 nas_emm_id_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5307 uint32_t curr_offset, bit_offset;
5308 /*uint32_t consumed;*/
5309 unsigned curr_len;
5311 curr_offset = offset;
5312 curr_len = len;
5314 pinfo->link_dir = P2P_DIR_DL;
5316 bit_offset=curr_offset<<3;
5318 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
5319 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
5320 bit_offset+=4;
5322 /* Identity type Identity type 2 9.9.3.17 M V 1/2 */
5323 proto_tree_add_bits_item(tree, hf_nas_eps_emm_id_type2, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
5324 /*bit_offset+=4;*/
5325 /*consumed = 1;*/
5328 /* Fix up the lengths */
5329 curr_len--;
5330 curr_offset++;
5332 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5335 * 8.2.19 Identity response
5337 static void
5338 nas_emm_id_res(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5340 uint32_t curr_offset;
5341 uint32_t consumed;
5342 unsigned curr_len;
5344 curr_offset = offset;
5345 curr_len = len;
5347 pinfo->link_dir = P2P_DIR_UL;
5349 /* Mobile identity Mobile identity 9.9.2.3 M LV 4-10 */
5350 ELEM_MAND_LV(NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, NULL, ei_nas_eps_missing_mandatory_elemen);
5352 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5358 * 8.2.20 Security mode command
5360 static void
5361 nas_emm_sec_mode_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5363 uint32_t curr_offset, bit_offset;
5364 uint32_t consumed;
5365 unsigned curr_len;
5367 curr_offset = offset;
5368 curr_len = len;
5370 pinfo->link_dir = P2P_DIR_DL;
5372 /* Selected NAS security algorithms NAS security algorithms 9.9.3.23 M V 1 */
5373 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_NAS_SEC_ALGS, " - Selected NAS security algorithms", ei_nas_eps_missing_mandatory_elemen);
5375 bit_offset = curr_offset<<3;
5376 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
5377 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
5378 bit_offset+=4;
5379 /* NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2 */
5380 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, " ASME");
5381 /*bit_offset+=4;*/
5383 /* Fix up the lengths */
5384 curr_len--;
5385 curr_offset++;
5387 /* Replayed UE security capabilities UE security capability 9.9.3.36 M LV 3-6 */
5388 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_UE_SEC_CAP, " - Replayed UE security capabilities", ei_nas_eps_missing_mandatory_elemen);
5389 /* C- IMEISV request IMEISV request 9.9.3.18 O TV 1 */
5390 ELEM_OPT_TV_SHORT(0xC0, NAS_PDU_TYPE_EMM, DE_EMM_IMEISV_REQ , NULL );
5391 /* 55 Replayed NonceUE Nonce 9.9.3.25 O TV 5 */
5392 ELEM_OPT_TV(0x55, NAS_PDU_TYPE_EMM, DE_EMM_NONCE, " - Replayed NonceUE");
5393 /* 56 NonceMME Nonce 9.9.3.25 O TV 5 */
5394 ELEM_OPT_TV(0x56, NAS_PDU_TYPE_EMM, DE_EMM_NONCE, " - NonceMME");
5395 /* 4F HashMME HashMME 9.9.3.50 O TLV 10 */
5396 ELEM_OPT_TLV(0x4F, NAS_PDU_TYPE_EMM, DE_EMM_HASH_MME, NULL);
5397 /* 6F Replayed UE additional security capability UE additional security capability 9.9.3.53 O TLV 6 */
5398 ELEM_OPT_TLV(0x6F, NAS_PDU_TYPE_EMM, DE_EMM_UE_ADD_SEC_CAP, " - Replayed UE additional security capability");
5399 /* 37 UE radio capability ID request UE radio capability ID request 9.9.3.59 O TLV 3 */
5400 ELEM_OPT_TLV(0x37, NAS_PDU_TYPE_EMM, DE_EMM_UE_RADIO_CAP_ID_REQ, NULL);
5401 /* D- UE coarse location information request UE information request 9.9.3.71 O TV 1 */
5402 ELEM_OPT_TV_SHORT(0xD0, NAS_PDU_TYPE_EMM, DE_EMM_UE_INFO_REQ, " - UE coarse location information request");
5404 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5407 * 8.2.21 Security mode complete
5409 static void
5410 nas_emm_sec_mode_comp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5412 uint32_t curr_offset;
5413 uint32_t consumed;
5414 unsigned curr_len;
5416 curr_offset = offset;
5417 curr_len = len;
5419 pinfo->link_dir = P2P_DIR_UL;
5421 /* 23 IMEISV Mobile identity 9.9.2.3 O TLV 11 */
5422 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - IMEISV");
5423 /* 79 Replayed NAS message container Replayed NAS message container 9.9.3.51 O TLV-E 3-n */
5424 ELEM_OPT_TLV_E(0x79, NAS_PDU_TYPE_EMM, DE_EMM_REPLAYED_NAS_MSG_CONT, NULL);
5425 /* 66 UE radio capability ID UE radio capability ID 9.9.3.60 O TLV 3-n */
5426 ELEM_OPT_TLV(0x66, NAS_5GS_PDU_TYPE_MM, DE_NAS_5GS_MM_UE_RADIO_CAP_ID, NULL);
5427 /* 67 UE coarse location information UE coarse location information 9.9.3.72 O TLV 8 */
5428 ELEM_OPT_TLV(0x66, NAS_5GS_PDU_TYPE_MM, DE_EMM_UE_COARSE_LOC_INFO, NULL);
5430 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5433 * 8.2.22 Security mode reject
5435 static void
5436 nas_emm_sec_mode_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5438 uint32_t curr_offset;
5439 uint32_t consumed;
5440 unsigned curr_len;
5442 curr_offset = offset;
5443 curr_len = len;
5445 pinfo->link_dir = P2P_DIR_UL;
5447 /* EMM cause EMM cause 9.9.3.9 M V 1 */
5448 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL, ei_nas_eps_missing_mandatory_elemen);
5450 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5453 * 8.2.24 Service reject
5455 static void
5456 nas_emm_serv_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5458 uint32_t curr_offset;
5459 uint32_t consumed;
5460 unsigned curr_len;
5462 curr_offset = offset;
5463 curr_len = len;
5465 pinfo->link_dir = P2P_DIR_DL;
5467 /* EMM cause EMM cause 9.9.3.9 M V 1 */
5468 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL, ei_nas_eps_missing_mandatory_elemen);
5469 /* 5B T3442 value GPRS timer 9.9.3.16 C TV 2 */
5470 ELEM_OPT_TV(0x5b, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3442 value");
5471 /* 5F T3346 value GPRS timer 2 9.9.3.16A O TLV 3 */
5472 ELEM_OPT_TLV(0x5F, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2, " - T3346 value");
5473 /* 6B T3448 value GPRS timer 2 9.9.3.16A O TLV 3 */
5474 ELEM_OPT_TLV(0x6B, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2, " - T3448 value");
5475 /* 1D Forbidden TAI(s) for the list of "forbidden tracking areas for roaming" Tracking area identity list 9.9.3.33 O TLV 8-98 */
5476 ELEM_OPT_TLV(0x1D, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - Forbidden TAI(s) for the list of \"forbidden tracking areas for roaming\"");
5477 /* 1E Forbidden TAI(s) for the list of "forbidden tracking areas for regional provision of service" Tracking area identity list 9.9.3.33 O TLV 8-98 */
5478 ELEM_OPT_TLV(0x1E, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - Forbidden TAI(s) for the list of \"forbidden tracking areas for regional provision of service\"");
5480 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5483 * 8.2.25 Service request
5484 * This message is sent by the UE to the network to request the establishment
5485 * of a NAS signalling connection and of the radio and S1 bearers.
5486 * Its structure does not follow the structure of a standard layer 3 message. See table 8.2.25.1.
5488 /* Table 8.2.25.1
5489 * Protocol discriminator Protocol discriminator 9.2 M V 1/2
5490 * Security header type Security header type 9.3.1 M V 1/2
5491 * KSI and sequence number KSI and sequence number 9.9.3.19 M V 1
5492 * Message authentication code (short) Short MAC 9.9.3.28 M V 2
5494 static void
5495 nas_emm_service_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5497 uint32_t curr_offset;
5498 uint32_t consumed;
5499 unsigned curr_len;
5501 curr_offset = offset;
5502 curr_len = len;
5504 pinfo->link_dir = P2P_DIR_UL;
5506 /* KSI and sequence number 9.9.3.19 M V 1 */
5507 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_KSI_AND_SEQ_NO, NULL, ei_nas_eps_missing_mandatory_elemen);
5509 /* Short MAC 9.9.3.28 M V 2 */
5510 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_SHORT_MAC, " - Message authentication code (short)", ei_nas_eps_missing_mandatory_elemen);
5512 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5516 * 8.2.26 Tracking area update accept
5518 static void
5519 nas_emm_trac_area_upd_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5521 uint32_t curr_offset, bit_offset;
5522 uint32_t consumed;
5523 unsigned curr_len;
5525 curr_offset = offset;
5526 curr_len = len;
5528 pinfo->link_dir = P2P_DIR_DL;
5530 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
5531 bit_offset = curr_offset<<3;
5532 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
5533 bit_offset+=4;
5534 /* EPS update result EPS update result 9.9.3.13 M V 1/2 */
5535 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
5536 bit_offset++;
5537 proto_tree_add_bits_item(tree, hf_nas_eps_eps_update_result_value, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
5538 /*bit_offset+=3;*/
5539 /* Fix up the lengths */
5540 curr_len--;
5541 curr_offset++;
5543 /* 5A T3412 value GPRS timer 9.9.3.16 O TV 2 */
5544 ELEM_OPT_TV(0x5a, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3412 value");
5545 /* 50 GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
5546 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
5547 /* 54 TAI list Tracking area identity list 9.9.3.33 O TLV 8-98 */
5548 ELEM_OPT_TLV(0x54, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, NULL);
5549 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
5550 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, NULL);
5551 /* 13 Location area identification Location area identification 9.9.2.2 O TV 6 */
5552 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, NULL);
5553 /* 23 MS identity Mobile identity 9.9.2.3 O TLV 7-10 */
5554 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - MS identity");
5555 /* 53 EMM cause EMM cause 9.9.3.9 O TV 2 */
5556 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
5557 /* 17 T3402 value GPRS timer 9.9.3.16 O TV 2 */
5558 ELEM_OPT_TV(0x17, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3402 value");
5559 /* 59 T3423 value GPRS timer 9.9.3.16 O TV 2 */
5560 ELEM_OPT_TV(0x59, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3423 value");
5561 /* 4A Equivalent PLMNs PLMN list 9.9.2.8 O TLV 5-47 */
5562 ELEM_OPT_TLV(0x4a, GSM_A_PDU_TYPE_COMMON, DE_PLMN_LIST, " - PLMN list");
5563 /* 34 Emergency Number List Emergency Number List 9.9.3.37 O TLV 5-50 */
5564 ELEM_OPT_TLV(0x34, GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST, NULL);
5565 /* 64 EPS network feature support EPS network feature support 9.9.3.12A O TLV 3 */
5566 ELEM_OPT_TLV(0x64, NAS_PDU_TYPE_EMM, DE_EMM_EPS_NET_FEATURE_SUP, NULL);
5567 /* F- Additional update result Additional update result 9.9.3.0A O TV 1 */
5568 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_RES, NULL );
5569 /* 5E T3412 extended value GPRS timer 3 9.9.3.16B O TLV 3 */
5570 ELEM_OPT_TLV(0x5E, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - T3412 extended value");
5571 /* 6A T3324 value GPRS timer 2 9.9.3.16A O TLV 3 */
5572 ELEM_OPT_TLV(0x6A, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2, " - T3324 value");
5573 /* 6E Extended DRX parameters Extended DRX parameters 9.9.3.46 O TLV 3-4 */
5574 ELEM_OPT_TLV(0x6E, GSM_A_PDU_TYPE_GM, DE_EXT_DRX_PARAMS, NULL);
5575 /* 68 Header compression configuration status Header compression configuration status 9.9.4.27 O TLV 5-257 */
5576 ELEM_OPT_TLV(0x68, NAS_PDU_TYPE_ESM, DE_ESM_HDR_COMPR_CONFIG_STATUS, NULL);
5577 /* 65 DCN-ID DCN-ID 9.9.3.48 O TLV 4 */
5578 ELEM_OPT_TLV(0x65, GSM_A_PDU_TYPE_GM, DE_DCN_ID, NULL);
5579 /* E- SMS services status SMS services status 9.9.3.4B O TV 1 */
5580 ELEM_OPT_TV_SHORT(0xE0, NAS_PDU_TYPE_EMM, DE_EMM_SMS_SERVICES_STATUS, NULL);
5581 /* D- Non-3GPP NW provided policies Non-3GPP NW provided policies O TV 1 */
5582 ELEM_OPT_TV_SHORT(0xD0, GSM_A_PDU_TYPE_GM, DE_NON_3GPP_NW_PROV_POL, NULL);
5583 /* 6B T3448 value GPRS timer 2 9.9.3.16A O TLV 3 */
5584 ELEM_OPT_TLV(0x6B, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2, " - T3448 value");
5585 /* C- Network policy Network policy 9.9.3.52 O TV 1 */
5586 ELEM_OPT_TV_SHORT(0xC0, NAS_PDU_TYPE_EMM, DE_EMM_NETWORK_POLICY, NULL);
5587 /* 6C T3447 value GPRS timer 3 9.9.3.16B O TLV 3 */
5588 ELEM_OPT_TLV(0x6C, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - T3447 value");
5589 /* 7A Extended emergency number list Extended emergency number list 9.9.3.37A O TLV-E 7-65538 */
5590 ELEM_OPT_TLV_E(0x7A, NAS_PDU_TYPE_EMM, DE_EMM_EXT_EMERG_NUM_LIST, NULL);
5591 /* 7C Ciphering key data Ciphering key data 9.9.3.56 O TLV-E 35-2291 */
5592 ELEM_OPT_TLV_E(0x7C, NAS_PDU_TYPE_EMM, DE_EMM_CIPH_KEY_DATA, NULL);
5593 /* 66 UE radio capability ID UE radio capability ID 9.9.3.60 O TLV 3-n */
5594 ELEM_OPT_TLV(0x66, NAS_5GS_PDU_TYPE_MM, DE_NAS_5GS_MM_UE_RADIO_CAP_ID, NULL);
5595 /* B- UE radio capability ID deletion indication UE radio capability ID deletion indication O TV 1 */
5596 ELEM_OPT_TV_SHORT(0xB0, NAS_5GS_PDU_TYPE_MM, DE_NAS_5GS_MM_UE_RADIO_CAP_ID_DEL_IND, NULL);
5597 /* 35 Negotiated WUS assistance information WUS assistance information 9.9.3.62 O TLV 3-n */
5598 ELEM_OPT_TLV(0x35, NAS_PDU_TYPE_EMM, DE_EMM_WUS_ASSIST_INFO, " - Negotiated");
5599 /* 36 Negotiated DRX parameter in NB-S1 mode NB-S1 DRX parameter 9.9.3.63 O TLV 3 */
5600 ELEM_OPT_TLV(0x36, NAS_PDU_TYPE_EMM, DE_EMM_NB_S1_DRX_PARAM, " - Negotiated");
5601 /* 38 Negotiated IMSI offset IMSI offset 9.9.3.64 O TLV 4 */
5602 ELEM_OPT_TLV(0x38, NAS_PDU_TYPE_EMM, DE_EMM_IMSI_OFFSET, " - Negotiated");
5603 /* 37 EPS additional request result EPS additional request result 9.9.3.67 O TLV 3 */
5604 ELEM_OPT_TLV(0x37, NAS_PDU_TYPE_EMM, DE_EMM_EPS_ADD_REQ_RESULT, NULL);
5605 /* 1D Forbidden TAI(s) for the list of "forbidden tracking areas for roaming" Tracking area identity list 9.9.3.33 O TLV 8-98 */
5606 ELEM_OPT_TLV(0x1D, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - Forbidden TAI(s) for the list of \"forbidden tracking areas for roaming\"");
5607 /* 1E Forbidden TAI(s) for the list of "forbidden tracking areas for regional provision of service" Tracking area identity list 9.9.3.33 O TLV 8-98 */
5608 ELEM_OPT_TLV(0x1E, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - Forbidden TAI(s) for the list of \"forbidden tracking areas for regional provision of service\"");
5609 /* 39 Maximum time offset GPRS timer 3 9.9.3.16B O TLV 3 */
5610 ELEM_OPT_TLV(0x39, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - Maximum time offset");
5611 /* 1F Unavailability configuration Unavailability configuration 9.9.3.70 O TLV 3-9 */
5612 ELEM_OPT_TLV(0x1F, NAS_PDU_TYPE_EMM, DE_EMM_UNAVAIL_CONFIG, NULL);
5614 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5617 * 8.2.27 Tracking area update complete
5618 * No more IE's
5621 * 8.2.28 Tracking area update reject
5623 static void
5624 nas_emm_trac_area_upd_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5626 uint32_t curr_offset;
5627 uint32_t consumed;
5628 unsigned curr_len;
5630 curr_offset = offset;
5631 curr_len = len;
5633 pinfo->link_dir = P2P_DIR_DL;
5635 /* EMM cause EMM cause 9.9.3.9 M V 1 */
5636 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL, ei_nas_eps_missing_mandatory_elemen);
5637 /* 5F T3346 value GPRS timer 2 9.9.3.16A O TLV 3 */
5638 ELEM_OPT_TLV(0x5F, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2, " - T3346 value");
5639 /* A- Extended EMM cause Extended EMM cause 9.9.3.26A O TV 1 */
5640 ELEM_OPT_TV_SHORT( 0xA0, NAS_PDU_TYPE_EMM, DE_EMM_EXT_CAUSE, NULL );
5641 /* 1C Lower bound timer value GPRS timer 3 9.9.3.16B O TLV 3 */
5642 ELEM_OPT_TLV(0x1C, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - Lower bound timer value");
5643 /* 1D Forbidden TAI(s) for the list of "forbidden tracking areas for roaming" Tracking area identity list 9.9.3.33 O TLV 8-98 */
5644 ELEM_OPT_TLV(0x1D, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - Forbidden TAI(s) for the list of \"forbidden tracking areas for roaming\"");
5645 /* 1E Forbidden TAI(s) for the list of "forbidden tracking areas for regional provision of service" Tracking area identity list 9.9.3.33 O TLV 8-98 */
5646 ELEM_OPT_TLV(0x1E, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - Forbidden TAI(s) for the list of \"forbidden tracking areas for regional provision of service\"");
5648 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5651 * 8.2.29 Tracking area update request
5653 static void
5654 nas_emm_trac_area_upd_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5657 uint32_t curr_offset, bit_offset;
5658 uint32_t consumed;
5659 unsigned curr_len;
5661 curr_offset = offset;
5662 curr_len = len;
5664 bit_offset = curr_offset<<3;
5666 pinfo->link_dir = P2P_DIR_UL;
5668 /* NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2 */
5669 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, " ASME");
5670 bit_offset+=4;
5672 /* EPS update type EPS update type 9.9.3.14 M V 1/2 */
5673 proto_tree_add_bits_item(tree, hf_nas_eps_active_flg, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
5674 bit_offset++;
5675 proto_tree_add_bits_item(tree, hf_nas_eps_eps_update_type_value, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
5676 /*bit_offset+=3;*/
5678 /* Fix the lengths */
5679 curr_len--;
5680 curr_offset++;
5681 /* Old GUTI EPS mobile identity 9.9.3.12 M LV 12 */
5682 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Old GUTI", ei_nas_eps_missing_mandatory_elemen);
5683 /* No more Mandatory elements */
5685 /* B- NAS key set identifier Non-current native NAS key set identifier 9.9.3.21 O TV 1 */
5686 ELEM_OPT_TV_SHORT( 0xb0 , NAS_PDU_TYPE_EMM, DE_EMM_NAS_KEY_SET_ID , " - Non-current native NAS key set identifier" );
5687 /* 8- GPRS ciphering key sequence number Ciphering key sequence number 9.9.3.4a O TV 1 */
5688 ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_COMMON, DE_CIPH_KEY_SEQ_NUM, " - GPRS ciphering key sequence number");
5689 /* 19 Old P-TMSI signature P-TMSI signature 9.9.3.26 O TV 4 */
5690 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, " - Old P-TMSI Signature");
5691 /* 50 Additional GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
5692 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Additional GUTI");
5693 /* 55 NonceUE Nonce 9.9.3.25 O TV 5 */
5694 ELEM_OPT_TV(0x55, NAS_PDU_TYPE_EMM, DE_EMM_NONCE, " - NonceUE");
5695 /* 58 UE network capability UE network capability 9.9.3.34 O TLV 4-15 */
5696 ELEM_OPT_TLV(0x58, NAS_PDU_TYPE_EMM, DE_EMM_UE_NET_CAP, NULL);
5697 /* 52 Last visited registered TAI Tracking area identity 9.9.3.32 O TV 6 */
5698 ELEM_OPT_TV(0x52, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, " - Last visited registered TAI");
5699 /* 5C DRX parameter DRX parameter 9.9.3.8 O TV 3 */
5700 ELEM_OPT_TV(0x5c, GSM_A_PDU_TYPE_GM, DE_DRX_PARAM, NULL );
5701 /* A- UE radio capability information update needed UE radio capability information update needed 9.9.3.35 O TV 1 */
5702 ELEM_OPT_TV_SHORT( 0xA0, NAS_PDU_TYPE_EMM, DE_EMM_UE_RA_CAP_INF_UPD_NEED, NULL );
5703 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
5704 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, NULL);
5705 /* 31 MS network capability MS network capability 9.9.3.20 O TLV 4-10 */
5706 ELEM_OPT_TLV( 0x31, GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP, NULL );
5707 /* 13 Old location area identification Location area identification 9.9.2.2 O TV 6 */
5708 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, " - Old location area identification");
5709 /* 9- TMSI status TMSI status 9.9.3.31 O TV 1 */
5710 ELEM_OPT_TV_SHORT( 0x90, GSM_A_PDU_TYPE_GM, DE_TMSI_STAT, NULL );
5711 /* 11 Mobile station classmark 2 Mobile station classmark 2 9.9.2.5 O TLV 5 */
5712 ELEM_OPT_TLV( 0x11, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_2 , NULL );
5713 /* 20 Mobile station classmark 3 Mobile station classmark 3 9.9.2.5 O TLV 2-34 */
5714 ELEM_OPT_TLV( 0x20, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_3 , NULL );
5715 /* 40 Supported Codecs Supported Codec List 9.9.2.10 O TLV 5-n */
5716 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, " - Supported Codecs");
5717 /* F- Additional update type Additional update type 9.9.3.0B O TV 1 */
5718 ELEM_OPT_TV_SHORT( 0xF0, NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_TYPE, NULL );
5719 /* 5D Voice domain preference and UE's usage setting Voice domain preference and UE's usage setting 9.9.3.44 O TLV 3 */
5720 ELEM_OPT_TLV(0x5D, GSM_A_PDU_TYPE_GM, DE_VOICE_DOMAIN_PREF, NULL);
5721 /* E- Old GUTI type GUTI type 9.9.3.45 O TV 1 */
5722 ELEM_OPT_TV_SHORT(0xE0, NAS_PDU_TYPE_EMM, DE_EMM_GUTI_TYPE, " - Old GUTI type");
5723 /* D- Device properties Device properties 9.9.2.0A O TV 1 */
5724 ELEM_OPT_TV_SHORT(0xD0, GSM_A_PDU_TYPE_GM, DE_DEVICE_PROPERTIES, NULL);
5725 /* C- MS network feature support MS network feature support 9.9.3.20A 0 TV 1 */
5726 ELEM_OPT_TV_SHORT(0xC0, GSM_A_PDU_TYPE_COMMON, DE_MS_NET_FEAT_SUP, NULL);
5727 /* 10 TMSI based NRI container Network resource identifier container 9.9.3.24A 0 TLV 4 */
5728 ELEM_OPT_TLV(0x10, GSM_A_PDU_TYPE_GM, DE_NET_RES_ID_CONT, " - TMSI based NRI container");
5729 /* 6A T3324 value GPRS timer 2 9.9.3.16A O TLV 3 */
5730 ELEM_OPT_TLV(0x6A, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2, " - T3324 value");
5731 /* 5E T3412 extended value GPRS timer 3 9.9.3.16B O TLV 3 */
5732 ELEM_OPT_TLV(0x5E, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - T3412 extended value");
5733 /* 6E Extended DRX parameters Extended DRX parameters 9.9.3.46 O TLV 3-4 */
5734 ELEM_OPT_TLV(0x6E, GSM_A_PDU_TYPE_GM, DE_EXT_DRX_PARAMS, NULL);
5735 /* 6F UE additional security capability UE additional security capability 9.9.3.53 O TLV 6 */
5736 ELEM_OPT_TLV(0x6F, NAS_PDU_TYPE_EMM, DE_EMM_UE_ADD_SEC_CAP, NULL);
5737 /* 6D UE status UE status 9.9.3.54 O TLV 3 */
5738 ELEM_OPT_TLV(0x6D, NAS_5GS_PDU_TYPE_MM, DE_NAS_5GS_MM_UE_STATUS, NULL);
5739 /* 17 Additional information requested Additional information requested 9.9.3.55 O TV 2 */
5740 ELEM_OPT_TV(0x17, NAS_PDU_TYPE_EMM, DE_EMM_ADD_INFO_REQ, NULL);
5741 /* 32 N1 UE network capability N1 UE network capability 9.9.3.57 O TLV 3-15 */
5742 ELEM_OPT_TLV(0x32, NAS_PDU_TYPE_EMM, DE_EMM_N1_UE_NETWORK_CAP, NULL);
5743 /* 34 UE radio capability ID availability UE radio capability ID availability O TLV 3 */
5744 ELEM_OPT_TLV(0x34, NAS_PDU_TYPE_EMM, DE_EMM_UE_RADIO_CAP_ID_AVAIL, NULL);
5745 /* 35 Requested WUS assistance WUS assistance information O TLV 3-n */
5746 ELEM_OPT_TLV(0x35, NAS_PDU_TYPE_EMM, DE_EMM_WUS_ASSIST_INFO, " - Requested");
5747 /* 36 DRX parameter in NB-S1 mode NB-S1 DRX parameter 9.9.3.63 O TLV 3 */
5748 ELEM_OPT_TLV(0x36, NAS_PDU_TYPE_EMM, DE_EMM_NB_S1_DRX_PARAM, NULL);
5749 /* 30 Unavailability information Unavailability information 9.9.3.69 O TLV 3-9 */
5750 ELEM_OPT_TLV(0x30, NAS_PDU_TYPE_EMM, DE_EMM_UNAVAIL_INFO, NULL);
5752 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5756 * 8.2.30 Uplink NAS Transport
5758 static void
5759 nas_emm_ul_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5761 uint32_t curr_offset;
5762 uint32_t consumed;
5763 unsigned curr_len;
5765 curr_offset = offset;
5766 curr_len = len;
5768 pinfo->link_dir = P2P_DIR_UL;
5770 /* NAS message container NAS message container 9.9.3.22 M LV 3-252*/
5771 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_NAS_MSG_CONT, NULL, ei_nas_eps_missing_mandatory_elemen);
5773 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5777 * 8.2.31 Downlink generic NAS transport
5779 static void
5780 nas_emm_dl_gen_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5782 uint32_t curr_offset;
5783 uint32_t consumed;
5784 unsigned curr_len;
5786 curr_offset = offset;
5787 curr_len = len;
5789 pinfo->link_dir = P2P_DIR_DL;
5791 /* Generic message container type Generic message container type 9.9.3.42 M V 1 */
5792 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT_TYPE, NULL, ei_nas_eps_missing_mandatory_elemen);
5793 /* Generic message container Generic message container 9.9.3.43 M LV-E 3-n */
5794 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT, NULL, ei_nas_eps_missing_mandatory_elemen)
5795 /* 65 Additional information Additional information 9.9.2.0 O TLV 3-n */
5796 ELEM_OPT_TLV(0x65, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_ADD_INFO, NULL);
5798 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5802 * 8.2.32 Uplink generic NAS transport
5804 static void
5805 nas_emm_ul_gen_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5807 uint32_t curr_offset;
5808 uint32_t consumed;
5809 unsigned curr_len;
5811 curr_offset = offset;
5812 curr_len = len;
5814 pinfo->link_dir = P2P_DIR_UL;
5816 /* Generic message container type Generic message container type 9.9.3.42 M V 1 */
5817 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT_TYPE, NULL, ei_nas_eps_missing_mandatory_elemen);
5818 /* Generic message container Generic message container 9.9.3.43 M LV-E 3-n */
5819 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT, NULL, ei_nas_eps_missing_mandatory_elemen)
5820 /* 65 Additional information Additional information 9.9.2.0 O TLV 3-n */
5821 ELEM_OPT_TLV(0x65, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_ADD_INFO, NULL);
5823 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5827 * 8.2.33 Control plane service request
5829 static const value_string nas_eps_emm_data_serv_type_vals[] = {
5830 { 0x0, "Mobile originating request" },
5831 { 0x1, "Mobile terminating request" },
5832 { 0, NULL }
5835 static void
5836 nas_emm_ctrl_plane_serv_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5838 uint32_t curr_offset, bit_offset;
5839 uint32_t consumed;
5840 unsigned curr_len;
5842 curr_offset = offset;
5843 curr_len = len;
5844 bit_offset = curr_offset<<3;
5846 pinfo->link_dir = P2P_DIR_UL;
5848 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
5849 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
5850 bit_offset+=4;
5851 /* Control Plane service type Control Plane service type 9.9.3.47 M V 1/2 */
5852 proto_tree_add_bits_item(tree, hf_nas_eps_active_flg, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
5853 bit_offset += 1;
5854 proto_tree_add_bits_item(tree, hf_nas_eps_ctrl_plane_serv_type, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
5856 /* Fix the lengths */
5857 curr_len--;
5858 curr_offset++;
5860 /* 78 ESM message container ESM message container 9.9.3.15 O TLV-E 3-n */
5861 ELEM_OPT_TLV_E(0x78, NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL);
5862 /* 67 NAS message container NAS message container 9.9.3.22 O TLV 4-253 */
5863 ELEM_OPT_TLV(0x67, NAS_PDU_TYPE_EMM, DE_EMM_NAS_MSG_CONT, NULL);
5864 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
5865 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, NULL);
5866 /* D- Device properties Device properties 9.9.2.0A O TV 1 */
5867 ELEM_OPT_TV_SHORT(0xD0, GSM_A_PDU_TYPE_GM, DE_DEVICE_PROPERTIES, NULL);
5869 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5873 * 8.2.34 Service accept
5875 static void
5876 nas_emm_serv_accept(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5878 uint32_t curr_offset;
5879 uint32_t consumed;
5880 unsigned curr_len;
5882 curr_offset = offset;
5883 curr_len = len;
5885 pinfo->link_dir = P2P_DIR_DL;
5887 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
5888 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, NULL);
5889 /* 6B T3448 value GPRS timer 2 9.9.3.16A O TLV 3 */
5890 ELEM_OPT_TLV(0x6B, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2, " - T3448 value");
5891 /* 37 EPS additional request result EPS additional request result 9.9.3.67 O TLV 3 */
5892 ELEM_OPT_TLV(0x37, NAS_PDU_TYPE_EMM, DE_EMM_EPS_ADD_REQ_RESULT, NULL);
5893 /* 1D Forbidden TAI(s) for the list of "forbidden tracking areas for roaming" Tracking area identity list 9.9.3.33 O TLV 8-98 */
5894 ELEM_OPT_TLV(0x1D, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - Forbidden TAI(s) for the list of \"forbidden tracking areas for roaming\"");
5895 /* 1E Forbidden TAI(s) for the list of "forbidden tracking areas for regional provision of service" Tracking area identity list 9.9.3.33 O TLV 8-98 */
5896 ELEM_OPT_TLV(0x1E, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - Forbidden TAI(s) for the list of \"forbidden tracking areas for regional provision of service\"");
5898 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5902 * 8.3 EPS session management messages
5906 * 8.3.1 Activate dedicated EPS bearer context accept
5908 static void
5909 nas_esm_act_ded_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5911 uint32_t curr_offset;
5912 uint32_t consumed;
5913 unsigned curr_len;
5915 curr_offset = offset;
5916 curr_len = len;
5918 /* This message is sent by the UE to the network */
5919 pinfo->link_dir = P2P_DIR_UL;
5921 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
5922 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
5923 /* 33 NBIFOM container NBIFOM container 9.9.4.19 O TLV 3-257 */
5924 ELEM_OPT_TLV(0x33, NAS_PDU_TYPE_ESM, DE_ESM_NBIFOM_CONT, NULL);
5925 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
5926 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
5927 /* 5C Extended EPS QoS Extended quality of service 9.9.4.30 O TLV 12 */
5928 ELEM_OPT_TLV(0x5C, NAS_PDU_TYPE_ESM, DE_ESM_EXT_EPS_QOS, NULL);
5930 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5934 * 8.3.2 Activate dedicated EPS bearer context reject
5936 static void
5937 nas_esm_act_ded_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5939 uint32_t curr_offset;
5940 uint32_t consumed;
5941 unsigned curr_len;
5943 curr_offset = offset;
5944 curr_len = len;
5946 /* This message is sent by UE to the network to reject activation of a dedicated EPS bearer context */
5947 pinfo->link_dir = P2P_DIR_UL;
5949 /* ESM cause ESM cause 9.9.4.2 M V 1 */
5950 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL, ei_nas_eps_missing_mandatory_elemen);
5951 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
5952 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
5953 /* 33 NBIFOM container NBIFOM container 9.9.4.19 O TLV 3-257 */
5954 ELEM_OPT_TLV(0x33, NAS_PDU_TYPE_ESM, DE_ESM_NBIFOM_CONT, NULL);
5955 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
5956 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
5958 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
5961 * 8.3.3 Activate dedicated EPS bearer context request
5963 static void
5964 nas_esm_act_ded_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
5966 uint32_t curr_offset, bit_offset;
5967 uint32_t consumed;
5968 unsigned curr_len;
5970 curr_offset = offset;
5971 curr_len = len;
5973 /* This message is sent by the network to the UE to request activation of a dedicated EPS bearer context... */
5974 pinfo->link_dir = P2P_DIR_DL;
5977 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
5978 bit_offset = curr_offset<<3;
5979 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
5980 bit_offset+=4;
5981 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
5982 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
5983 /*bit_offset+=4;*/
5984 /* Fix the lengths */
5985 curr_len--;
5986 curr_offset++;
5988 /* EPS QoS EPS quality of service 9.9.4.3 M LV 2-10 */
5989 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, NULL, ei_nas_eps_missing_mandatory_elemen);
5990 /* TFT Traffic flow template 9.9.4.16 M LV 2-256 */
5991 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , NULL, ei_nas_eps_missing_mandatory_elemen);
5992 /* 5D Transaction identifier Transaction identifier 9.9.4.17 O TLV 3-4 */
5993 ELEM_OPT_TLV( 0x5d , GSM_A_PDU_TYPE_GM, DE_LINKED_TI , " - Transaction identifier" );
5994 /* 30 Negotiated QoS Quality of service 9.9.4.12 O TLV 14-18 */
5995 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
5996 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
5997 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
5998 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
5999 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , NULL );
6000 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
6001 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL );
6002 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
6003 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6004 /* C- WLAN offload indication WLAN offload indication 9.9.4.18 O TV 1 */
6005 ELEM_OPT_TV_SHORT(0xC0 , GSM_A_PDU_TYPE_GM, DE_SM_WLAN_OFFLOAD_ACCEPT, " - WLAN offload indication");
6006 /* 33 NBIFOM container NBIFOM container 9.9.4.19 O TLV 3-257 */
6007 ELEM_OPT_TLV(0x33, NAS_PDU_TYPE_ESM, DE_ESM_NBIFOM_CONT, NULL);
6008 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6009 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6010 /* 5C Extended EPS QoS Extended EPS quality of service 9.9.4.30 O TLV 12 */
6011 ELEM_OPT_TLV(0x5C, NAS_PDU_TYPE_ESM, DE_ESM_EXT_EPS_QOS, NULL);
6013 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6017 * 8.3.4 Activate default EPS bearer context accept
6019 static void
6020 nas_esm_act_def_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6022 uint32_t curr_offset;
6023 uint32_t consumed;
6024 unsigned curr_len;
6026 curr_offset = offset;
6027 curr_len = len;
6029 /* This message is sent by the UE to the network to acknowledge activation of a default EPS bearer context */
6030 pinfo->link_dir = P2P_DIR_UL;
6032 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
6033 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6034 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6035 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6037 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6041 * 8.3.5 Activate default EPS bearer context reject
6043 static void
6044 nas_esm_act_def_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6046 uint32_t curr_offset;
6047 uint32_t consumed;
6048 unsigned curr_len;
6050 curr_offset = offset;
6051 curr_len = len;
6053 /* This message is sent by UE to the network to reject activation of a default EPS bearer context. */
6054 pinfo->link_dir = P2P_DIR_UL;
6056 /* ESM cause ESM cause 9.9.4.4 M V 1 */
6057 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL, ei_nas_eps_missing_mandatory_elemen);
6058 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
6059 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6060 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6061 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6063 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6067 * 8.3.6 Activate default EPS bearer context request
6069 static void
6070 nas_esm_act_def_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6072 uint32_t curr_offset;
6073 uint32_t consumed;
6074 unsigned curr_len;
6076 curr_offset = offset;
6077 curr_len = len;
6079 /* This message is sent by the network to the UE to request activation of a default EPS bearer context. */
6080 pinfo->link_dir = P2P_DIR_DL;
6082 /* EPS QoS EPS quality of service 9.9.4.3 M LV 2-10 */
6083 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, NULL, ei_nas_eps_missing_mandatory_elemen);
6084 /* Access point name Access point name 9.9.4.1 M LV 2-101 */
6085 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL, ei_nas_eps_missing_mandatory_elemen);
6086 /* PDN address PDN address 9.9.4.9 M LV 6-14 DE_ESM_PDN_ADDR*/
6087 ELEM_MAND_LV( NAS_PDU_TYPE_ESM, DE_ESM_PDN_ADDR , NULL, ei_nas_eps_missing_mandatory_elemen);
6088 /* 5D Transaction identifier Transaction identifier 9.9.4.17 O TLV 3-4 */
6089 ELEM_OPT_TLV( 0x5d , GSM_A_PDU_TYPE_GM, DE_LINKED_TI , " - Transaction identifier" );
6090 /* 30 Negotiated QoS Quality of service 9.9.4.12 O TLV 14-18 */
6091 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
6092 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
6093 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
6094 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
6095 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , NULL );
6096 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
6097 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL );
6098 /* 5E APN-AMBR APN aggregate maximum bit rate 9.9.4.2 O TLV 4-8 DE_ESM_APN_AGR_MAX_BR*/
6099 ELEM_OPT_TLV( 0x5e , NAS_PDU_TYPE_ESM, DE_ESM_APN_AGR_MAX_BR , NULL );
6100 /* 58 ESM cause ESM cause 9.9.4.4 O TV 2 */
6101 ELEM_OPT_TV( 0x58 , NAS_PDU_TYPE_ESM, DE_ESM_CAUSE , NULL );
6102 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
6103 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6104 /* B- Connectivity type Connectivity type 9.9.4.2A O TV 1 */
6105 ELEM_OPT_TV_SHORT(0xB0 , GSM_A_PDU_TYPE_GM, DE_SM_CONNECTIVITY_TYPE, NULL);
6106 /* C- WLAN offload indication WLAN offload indication 9.9.4.18 O TV 1 */
6107 ELEM_OPT_TV_SHORT(0xC0 , GSM_A_PDU_TYPE_GM, DE_SM_WLAN_OFFLOAD_ACCEPT, " - WLAN offload indication");
6108 /* 33 NBIFOM container NBIFOM container 9.9.4.19 O TLV 3-257 */
6109 ELEM_OPT_TLV(0x33, NAS_PDU_TYPE_ESM, DE_ESM_NBIFOM_CONT, NULL);
6110 /* 66 Header compression configuration Header compression configuration 9.9.4.22 O TLV 5-257 */
6111 ELEM_OPT_TLV(0x66, NAS_PDU_TYPE_ESM, DE_ESM_HDR_COMPR_CONFIG, NULL);
6112 /* 9- Control plane only indication Control plane only indication 9.9.4.23 O TV 1 */
6113 ELEM_OPT_TV_SHORT(0x90, NAS_PDU_TYPE_ESM, DE_ESM_CTRL_PLANE_ONLY_IND, NULL);
6114 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6115 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6116 /* 6E Serving PLMN rate control Serving PLMN rate control 9.9.4.28 O TLV 4 */
6117 ELEM_OPT_TLV(0x6E, NAS_PDU_TYPE_ESM, DE_ESM_SERV_PLMN_RATE_CTRL, NULL);
6118 /* 5F Extended APN-AMBR Extended APN aggregate maximum bit rate 9.9.4.29 O TLV 8 */
6119 ELEM_OPT_TLV(0x5F, NAS_PDU_TYPE_ESM, DE_ESM_EXT_APN_AGR_MAX_BR , NULL);
6121 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6125 * 8.3.7 Bearer resource allocation reject
6127 static void
6128 nas_esm_bearer_res_all_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6130 uint32_t curr_offset;
6131 uint32_t consumed;
6132 unsigned curr_len;
6134 curr_offset = offset;
6135 curr_len = len;
6137 /* This message is sent by the network to the UE to reject the allocation of a dedicated bearer resource. */
6138 pinfo->link_dir = P2P_DIR_DL;
6140 /* ESM cause ESM cause 9.9.4.4 M V 1 */
6141 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL, ei_nas_eps_missing_mandatory_elemen);
6142 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
6143 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6144 /* 37 Back-off timer value GPRS timer 3 9.9.3.16B O TLV 3 */
6145 ELEM_OPT_TLV(0x37, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - Back-off timer value");
6146 /* 6B Re-attempt indicator Re-attempt indicator 9.9.4.13A O TLV 3 */
6147 ELEM_OPT_TLV(0x6B, NAS_PDU_TYPE_ESM, DE_ESM_RE_ATTEMPT_IND, NULL);
6148 /* 33 NBIFOM container NBIFOM container 9.9.4.19 O TLV 3-257 */
6149 ELEM_OPT_TLV(0x33, NAS_PDU_TYPE_ESM, DE_ESM_NBIFOM_CONT, NULL);
6150 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6151 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6153 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6157 * 8.3.8 Bearer resource allocation request
6159 static void
6160 nas_esm_bearer_res_all_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6162 uint32_t curr_offset, bit_offset;
6163 uint32_t consumed;
6164 unsigned curr_len;
6166 curr_offset = offset;
6167 curr_len = len;
6169 /* This message is sent by the UE to the network to request the allocation of a dedicated bearer resource. */
6170 pinfo->link_dir = P2P_DIR_UL;
6172 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
6173 bit_offset = curr_offset<<3;
6174 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
6175 bit_offset+=4;
6176 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
6177 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
6178 /*bit_offset+=4;*/
6179 /* Fix the lengths */
6180 curr_len--;
6181 curr_offset++;
6183 /* Traffic flow aggregate Traffic flow aggregate description 9.9.4.15 M LV 2-256 */
6184 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , " - Traffic flow aggregate", ei_nas_eps_missing_mandatory_elemen);
6185 /* Required traffic flow QoS EPS quality of service 9.9.4.3 M LV 2-10 */
6186 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, " - Required traffic flow QoS", ei_nas_eps_missing_mandatory_elemen);
6187 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
6188 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6189 /* C- Device properties Device properties 9.9.2.0A O TV 1 */
6190 ELEM_OPT_TV_SHORT(0xC0 , GSM_A_PDU_TYPE_GM, DE_DEVICE_PROPERTIES, NULL);
6191 /* 33 NBIFOM container NBIFOM container 9.9.4.19 O TLV 3-257 */
6192 ELEM_OPT_TLV(0x33, NAS_PDU_TYPE_ESM, DE_ESM_NBIFOM_CONT, NULL);
6193 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6194 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6195 /* 5C Extended EPS QoS Extended EPS quality of service 9.9.4.30 O TLV 12 */
6196 ELEM_OPT_TLV(0x5C, NAS_PDU_TYPE_ESM, DE_ESM_EXT_EPS_QOS, NULL);
6198 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6201 * 8.3.9 Bearer resource modification reject
6203 static void
6204 nas_esm_bearer_res_mod_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6206 uint32_t curr_offset;
6207 uint32_t consumed;
6208 unsigned curr_len;
6210 curr_offset = offset;
6211 curr_len = len;
6213 /* This message is sent by the network to the UE to reject the modification of a dedicated bearer resource. */
6214 pinfo->link_dir = P2P_DIR_DL;
6216 /* ESM cause ESM cause 9.9.4.4 M V 1 */
6217 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL, ei_nas_eps_missing_mandatory_elemen);
6218 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
6219 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6220 /* 37 Back-off timer value GPRS timer 3 9.9.3.16B O TLV 3 */
6221 ELEM_OPT_TLV(0x37, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - Back-off timer value");
6222 /* 6B Re-attempt indicator Re-attempt indicator 9.9.4.13A O TLV 3 */
6223 ELEM_OPT_TLV(0x6B, NAS_PDU_TYPE_ESM, DE_ESM_RE_ATTEMPT_IND, NULL);
6224 /* 33 NBIFOM container NBIFOM container 9.9.4.19 O TLV 3-257 */
6225 ELEM_OPT_TLV(0x33, NAS_PDU_TYPE_ESM, DE_ESM_NBIFOM_CONT, NULL);
6226 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6227 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6229 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6232 * 8.3.10 Bearer resource modification request
6234 static void
6235 nas_esm_bearer_res_mod_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6237 uint32_t curr_offset, bit_offset;
6238 uint32_t consumed;
6239 unsigned curr_len;
6241 curr_offset = offset;
6242 curr_len = len;
6244 /* This message is sent by the UE to the network to request the modification of a dedicated bearer resource. */
6245 pinfo->link_dir = P2P_DIR_UL;
6247 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
6248 bit_offset = curr_offset<<3;
6249 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
6250 bit_offset+=4;
6251 /* EPS bearer identity for packet filter Linked EPS bearer identity 9.9.4.6 M V 1/2 */
6252 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
6253 /*bit_offset+=4;*/
6254 /* Fix the lengths */
6255 curr_len--;
6256 curr_offset++;
6257 /* Traffic flow aggregate Traffic flow aggregate description 9.9.4.15 M LV 2-256 */
6258 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , " - Traffic flow aggregate", ei_nas_eps_missing_mandatory_elemen);
6259 /* 5B Required traffic flow QoS EPS quality of service 9.9.4.3 O TLV 3-11 */
6260 ELEM_OPT_TLV( 0x5B , NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS , " - Required traffic flow QoS" );
6261 /* 58 ESM cause ESM cause 9.9.4.4 O TV 2 */
6262 ELEM_OPT_TV( 0x58 , NAS_PDU_TYPE_ESM, DE_ESM_CAUSE , NULL );
6263 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
6264 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6265 /* C- Device properties Device properties 9.9.2.0A O TV 1 */
6266 ELEM_OPT_TV_SHORT(0xC0 , GSM_A_PDU_TYPE_GM, DE_DEVICE_PROPERTIES, NULL);
6267 /* 33 NBIFOM container NBIFOM container 9.9.4.19 O TLV 3-257 */
6268 ELEM_OPT_TLV(0x33, NAS_PDU_TYPE_ESM, DE_ESM_NBIFOM_CONT, NULL);
6269 /* 66 Header compression configuration Header compression configuration 9.9.4.22 O TLV 5-257 */
6270 ELEM_OPT_TLV(0x66, NAS_PDU_TYPE_ESM, DE_ESM_HDR_COMPR_CONFIG, NULL);
6271 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6272 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6273 /* 5C Extended EPS QoS Extended EPS quality of service 9.9.4.30 O TLV 12 */
6274 ELEM_OPT_TLV(0x5C, NAS_PDU_TYPE_ESM, DE_ESM_EXT_EPS_QOS, NULL);
6276 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6279 * 8.3.11 Deactivate EPS bearer context accept
6281 static void
6282 nas_esm_deact_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6284 uint32_t curr_offset;
6285 uint32_t consumed;
6286 unsigned curr_len;
6288 curr_offset = offset;
6289 curr_len = len;
6291 /* This message is sent by the UE to acknowledge deactivation of the EPS bearer context... */
6292 pinfo->link_dir = P2P_DIR_UL;
6294 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV */
6295 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6296 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6297 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6299 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6302 * 8.3.12 Deactivate EPS bearer context request
6304 static void
6305 nas_esm_deact_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6307 uint32_t curr_offset;
6308 uint32_t consumed;
6309 unsigned curr_len;
6311 curr_offset = offset;
6312 curr_len = len;
6314 /* This message is sent by the network to request deactivation of an active EPS bearer context. */
6315 pinfo->link_dir = P2P_DIR_DL;
6317 /* ESM cause ESM cause 9.9.4.4 M V 1 */
6318 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL, ei_nas_eps_missing_mandatory_elemen);
6319 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV */
6320 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6321 /* 37 T3396 value GPRS timer 3 9.9.3.16B O TLV 3 */
6322 ELEM_OPT_TLV(0x37, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - T3396 value");
6323 /* C- WLAN offload indication WLAN offload indication 9.9.4.18 O TV 1 */
6324 ELEM_OPT_TV_SHORT(0xC0 , GSM_A_PDU_TYPE_GM, DE_SM_WLAN_OFFLOAD_ACCEPT, " - WLAN offload indication");
6325 /* 33 NBIFOM container NBIFOM container 9.9.4.19 O TLV 3-257 */
6326 ELEM_OPT_TLV(0x33, NAS_PDU_TYPE_ESM, DE_ESM_NBIFOM_CONT, NULL);
6327 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6328 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6330 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6334 * 8.3.12A ESM dummy message
6335 * No IE:s
6337 static void
6338 nas_esm_dummy_msg(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6340 uint32_t curr_offset;
6341 unsigned curr_len;
6343 curr_offset = offset;
6344 curr_len = len;
6346 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6350 * 8.3.13 ESM information request
6351 * No IE:s
6353 static void
6354 nas_esm_inf_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6356 uint32_t curr_offset;
6357 unsigned curr_len;
6359 curr_offset = offset;
6360 curr_len = len;
6362 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6365 * 8.3.14 ESM information response
6367 static void
6368 nas_esm_inf_resp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6370 uint32_t curr_offset;
6371 uint32_t consumed;
6372 unsigned curr_len;
6374 curr_offset = offset;
6375 curr_len = len;
6377 /* This message is sent by the UE to the network in response to an ESM INFORMATION REQUEST... */
6378 pinfo->link_dir = P2P_DIR_UL;
6380 /* 28 Access point name Access point name 9.9.4.1 O TLV 3-102 */
6381 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL );
6382 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
6383 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6384 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6385 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6387 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6390 * 8.3.15 ESM status
6392 static void
6393 nas_esm_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6395 uint32_t curr_offset;
6396 uint32_t consumed;
6397 unsigned curr_len;
6399 curr_offset = offset;
6400 curr_len = len;
6402 /* ESM cause ESM cause 9.9.4.4 M V 1 */
6403 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL, ei_nas_eps_missing_mandatory_elemen);
6405 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6408 * 8.3.16 Modify EPS bearer context accept
6410 static void
6411 nas_esm_mod_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6413 uint32_t curr_offset;
6414 uint32_t consumed;
6415 unsigned curr_len;
6417 curr_offset = offset;
6418 curr_len = len;
6420 /* This message is sent by the UE to the network to acknowledge the modification of an active EPS bearer context. */
6421 pinfo->link_dir = P2P_DIR_UL;
6423 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
6424 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6425 /* 33 NBIFOM container NBIFOM container 9.9.4.19 O TLV 3-257 */
6426 ELEM_OPT_TLV(0x33, NAS_PDU_TYPE_ESM, DE_ESM_NBIFOM_CONT, NULL);
6427 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6428 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6430 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6433 * 8.3.17 Modify EPS bearer context reject
6435 static void
6436 nas_esm_mod_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6438 uint32_t curr_offset;
6439 uint32_t consumed;
6440 unsigned curr_len;
6442 curr_offset = offset;
6443 curr_len = len;
6445 /* This message is sent by the UE or the network to reject a modification of an active EPS bearer context. */
6446 pinfo->link_dir = P2P_DIR_UL;
6448 /* ESM cause ESM cause 9.9.4.4 M V 1 */
6449 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL, ei_nas_eps_missing_mandatory_elemen);
6450 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
6451 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6452 /* 33 NBIFOM container NBIFOM container 9.9.4.19 O TLV 3-257 */
6453 ELEM_OPT_TLV(0x33, NAS_PDU_TYPE_ESM, DE_ESM_NBIFOM_CONT, NULL);
6454 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6455 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6457 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6460 * 8.3.18 Modify EPS bearer context request
6462 static void
6463 nas_esm_mod_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6465 uint32_t curr_offset;
6466 uint32_t consumed;
6467 unsigned curr_len;
6469 curr_offset = offset;
6470 curr_len = len;
6472 /*This message is sent by the network to inform the UE about events which are relevant for the upper layer... */
6473 pinfo->link_dir = P2P_DIR_DL;
6475 /* 5B New EPS QoS EPS quality of service 9.9.4.3 O TLV 3-11 */
6476 ELEM_OPT_TLV( 0x5B , NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS , " - New EPS QoS" );
6477 /* 36 TFT Traffic flow template 9.9.4.16 O TLV 3-257 */
6478 ELEM_OPT_TLV( 0x36 , GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , NULL );
6479 /* 30 New QoS Quality of service 9.9.4.12 O TLV 14-18 */
6480 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - New QoS" );
6481 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
6482 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
6483 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
6484 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , NULL );
6485 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
6486 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL );
6487 /* 5E APN-AMBR APN aggregate maximum bit rate 9.9.4.2 O TLV 4-8 */
6488 ELEM_OPT_TLV( 0x5E , NAS_PDU_TYPE_ESM, DE_ESM_APN_AGR_MAX_BR , NULL );
6489 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
6490 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6491 /* C- WLAN offload indication WLAN offload indication 9.9.4.18 O TV 1 */
6492 ELEM_OPT_TV_SHORT(0xC0 , GSM_A_PDU_TYPE_GM, DE_SM_WLAN_OFFLOAD_ACCEPT, " - WLAN offload indication");
6493 /* 33 NBIFOM container NBIFOM container 9.9.4.19 O TLV 3-257 */
6494 ELEM_OPT_TLV(0x33, NAS_PDU_TYPE_ESM, DE_ESM_NBIFOM_CONT, NULL);
6495 /* 66 Header compression configuration Header compression configuration 9.9.4.22 O TLV 5-257 */
6496 ELEM_OPT_TLV(0x66, NAS_PDU_TYPE_ESM, DE_ESM_HDR_COMPR_CONFIG, NULL);
6497 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6498 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6499 /* 5F Extended APN-AMBR Extended APN aggregate maximum bit rate 9.9.4.29 O TLV 8 */
6500 ELEM_OPT_TLV(0x5F, NAS_PDU_TYPE_ESM, DE_ESM_EXT_APN_AGR_MAX_BR , NULL);
6501 /* 5C Extended EPS QoS Extended EPS quality of service 9.9.4.30 O TLV 12 */
6502 ELEM_OPT_TLV(0x5C, NAS_PDU_TYPE_ESM, DE_ESM_EXT_EPS_QOS, NULL);
6504 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6507 * 8.3.18A Notification
6509 static void
6510 nas_esm_notification(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6512 uint32_t curr_offset;
6513 uint32_t consumed;
6514 unsigned curr_len;
6516 curr_offset = offset;
6517 curr_len = len;
6519 pinfo->link_dir = P2P_DIR_DL;
6521 /* Notification indicator Notification indicator 9.9.4.7A M LV 2 */
6522 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_NOTIF_IND, NULL, ei_nas_eps_missing_mandatory_elemen);
6524 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6528 * 8.3.19 PDN connectivity reject
6530 static void
6531 nas_esm_pdn_con_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6533 uint32_t curr_offset;
6534 uint32_t consumed;
6535 unsigned curr_len;
6537 curr_offset = offset;
6538 curr_len = len;
6540 /*This message is sent by the network to the UE to reject establishment of a PDN connection. */
6541 pinfo->link_dir = P2P_DIR_DL;
6543 /* ESM cause ESM cause 9.9.4.4 M V 1 */
6544 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL, ei_nas_eps_missing_mandatory_elemen);
6545 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
6546 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6547 /* 37 Back-off timer value GPRS timer 3 9.9.3.16B O TLV 3 */
6548 ELEM_OPT_TLV(0x37, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - Back-off timer value");
6549 /* 6B Re-attempt indicator Re-attempt indicator 9.9.4.13A O TLV 3 */
6550 ELEM_OPT_TLV(0x6B, NAS_PDU_TYPE_ESM, DE_ESM_RE_ATTEMPT_IND, NULL);
6551 /* 33 NBIFOM container NBIFOM container 9.9.4.19 O TLV 3-257 */
6552 ELEM_OPT_TLV(0x33, NAS_PDU_TYPE_ESM, DE_ESM_NBIFOM_CONT, NULL);
6553 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6554 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6556 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6560 * 8.3.20 PDN connectivity request
6562 void
6563 nas_esm_pdn_con_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6565 uint32_t curr_offset;
6566 uint32_t consumed;
6567 unsigned curr_len;
6568 int bit_offset;
6570 curr_offset = offset;
6571 curr_len = len;
6573 /*This message is sent by the UE to the network to initiate establishment of a PDN connection. */
6574 pinfo->link_dir = P2P_DIR_UL;
6576 /* PDN type PDN type 9.9.4.10 M V 1/2 */
6577 bit_offset = curr_offset<<3;
6578 proto_tree_add_bits_item(tree, hf_nas_eps_esm_pdn_type, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
6579 bit_offset+=4;
6581 /* Request type 9.9.4.14 M V 1/2 */
6582 proto_tree_add_bits_item(tree, hf_nas_eps_esm_request_type, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
6583 /*bit_offset+=4;*/
6584 /* Fix the lengths */
6585 curr_len--;
6586 curr_offset++;
6588 /* D- ESM information transfer flag 9.9.4.5 O TV 1 */
6589 ELEM_OPT_TV_SHORT( 0xd0 , NAS_PDU_TYPE_ESM, DE_ESM_INF_TRF_FLG , NULL );
6590 /* 28 Access point name 9.9.4.1 O TLV 3-102 */
6591 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL );
6592 /* 27 Protocol configuration options 9.9.4.11 O TLV 3-253 */
6593 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6594 /* C- Device properties Device properties 9.9.2.0A O TV 1 */
6595 ELEM_OPT_TV_SHORT(0xC0 , GSM_A_PDU_TYPE_GM, DE_DEVICE_PROPERTIES, NULL);
6596 /* 33 NBIFOM container NBIFOM container 9.9.4.19 O TLV 3-257 */
6597 ELEM_OPT_TLV(0x33, NAS_PDU_TYPE_ESM, DE_ESM_NBIFOM_CONT, NULL);
6598 /* 66 Header compression configuration Header compression configuration 9.9.4.22 O TLV 5-257 */
6599 ELEM_OPT_TLV(0x66, NAS_PDU_TYPE_ESM, DE_ESM_HDR_COMPR_CONFIG, NULL);
6600 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6601 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6603 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6606 * 8.3.21 PDN disconnect reject
6608 static void
6609 nas_esm_pdn_disc_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6611 uint32_t curr_offset;
6612 uint32_t consumed;
6613 unsigned curr_len;
6615 curr_offset = offset;
6616 curr_len = len;
6618 /* This message is sent by the network to the UE to reject release of a PDN connection. */
6619 pinfo->link_dir = P2P_DIR_DL;
6621 /* ESM cause ESM cause 9.9.4.4 M V 1 */
6622 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL, ei_nas_eps_missing_mandatory_elemen);
6623 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
6624 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6625 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6626 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6628 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6631 * 8.3.22 PDN disconnect request
6633 static void
6634 nas_esm_pdn_disc_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6636 uint32_t curr_offset, bit_offset;
6637 uint32_t consumed;
6638 unsigned curr_len;
6640 curr_offset = offset;
6641 curr_len = len;
6643 /*This message is sent by the UE to the network to initiate release of a PDN connection. */
6644 pinfo->link_dir = P2P_DIR_UL;
6646 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
6647 bit_offset = curr_offset<<3;
6648 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
6649 bit_offset+=4;
6650 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
6651 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
6652 /*bit_offset+=4;*/
6653 /* Fix the lengths */
6654 curr_len--;
6655 curr_offset++;
6657 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
6658 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
6659 /* 7B Extended protocol configuration options Extended protocol configuration options 9.9.4.26 O TLV-E 4-65538 */
6660 ELEM_OPT_TLV_E(0x7B, NAS_PDU_TYPE_ESM, DE_ESM_EXT_PCO, NULL);
6662 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6665 * 8.3.23 Remote UE report
6667 static void
6668 nas_esm_remote_ue_report(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6670 uint32_t curr_offset;
6671 uint32_t consumed;
6672 unsigned curr_len;
6674 curr_offset = offset;
6675 curr_len = len;
6677 pinfo->link_dir = P2P_DIR_UL;
6679 /* 79 Remote UE Context Connected Remote UE context list 9.9.4.20 O TLV-E 3-65538 */
6680 ELEM_OPT_TLV_E(0x79, NAS_PDU_TYPE_ESM, DE_ESM_REMOTE_UE_CONTEXT_LIST, " - Remote UE Context Connected");
6681 /* 7A Remote UE Context Disconnected Remote UE context list 9.9.4.20 O TLV-E 3-65538 */
6682 ELEM_OPT_TLV_E(0x7A, NAS_PDU_TYPE_ESM, DE_ESM_REMOTE_UE_CONTEXT_LIST, " - Remote UE Context Disconnected");
6683 /* 6F ProSe Key Management Function address PKMF address 9.9.4.21 O TLV 3-19 */
6684 ELEM_OPT_TLV(0x6F, NAS_PDU_TYPE_ESM, DE_ESM_PKMF_ADDRESS, " - ProSe Key Management Function address");
6686 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6689 * 8.3.24 Remote UE report response
6691 static void
6692 nas_esm_remote_ue_report_resp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6694 uint32_t curr_offset;
6695 /*uint32_t consumed;*/
6696 unsigned curr_len;
6698 curr_offset = offset;
6699 curr_len = len;
6701 pinfo->link_dir = P2P_DIR_DL;
6703 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6706 * 8.3.25 ESM data transport
6708 static void
6709 nas_esm_data_transport(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
6711 uint32_t curr_offset;
6712 uint32_t consumed;
6713 unsigned curr_len;
6715 curr_offset = offset;
6716 curr_len = len;
6718 /* User data container User data container 9.9.4.24 M LV-E 2-n */
6719 ELEM_MAND_LV_E(NAS_PDU_TYPE_ESM, DE_ESM_USER_DATA_CONT, NULL, ei_nas_eps_missing_mandatory_elemen);
6720 /* F- Release assistance indication Release assistance indication 9.9.4.25 O TV 1 */
6721 ELEM_OPT_TV_SHORT(0xF0, NAS_PDU_TYPE_ESM, DE_ESM_REL_ASSIST_IND, NULL);
6723 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data);
6726 #define NUM_NAS_MSG_ESM array_length(nas_msg_esm_strings)
6727 static int ett_nas_msg_esm[NUM_NAS_MSG_ESM];
6728 static void (*nas_msg_esm_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len) = {
6729 nas_esm_act_def_eps_bearer_ctx_req, /* Activate default EPS bearer context request*/
6730 nas_esm_act_def_eps_bearer_ctx_acc, /* Activate default EPS bearer context accept*/
6731 nas_esm_act_def_eps_bearer_ctx_rej, /* Activate default EPS bearer context reject*/
6732 nas_esm_act_ded_eps_bearer_ctx_req, /* Activate dedicated EPS bearer context request*/
6733 nas_esm_act_ded_eps_bearer_ctx_acc, /* Activate dedicated EPS bearer context accept*/
6734 nas_esm_act_ded_eps_bearer_ctx_rej, /* Activate dedicated EPS bearer context reject*/
6735 nas_esm_mod_eps_bearer_ctx_req, /* Modify EPS bearer context request*/
6736 nas_esm_mod_eps_bearer_ctx_acc, /* Modify EPS bearer context accept*/
6737 nas_esm_mod_eps_bearer_ctx_rej, /* Modify EPS bearer context reject*/
6738 nas_esm_deact_eps_bearer_ctx_req, /* Deactivate EPS bearer context request*/
6739 nas_esm_deact_eps_bearer_ctx_acc, /* Deactivate EPS bearer context accept*/
6740 nas_esm_pdn_con_req, /* 8.3.18 PDN connectivity request */
6741 nas_esm_pdn_con_rej, /* PDN connectivity reject*/
6742 nas_esm_pdn_disc_req, /* PDN disconnect request*/
6743 nas_esm_pdn_disc_rej, /* PDN disconnect reject*/
6744 nas_esm_bearer_res_all_req, /* Bearer resource allocation request*/
6745 nas_esm_bearer_res_all_rej, /* Bearer resource allocation reject*/
6746 nas_esm_bearer_res_mod_req, /* Bearer resource modification request*/
6747 nas_esm_bearer_res_mod_rej, /* Bearer resource modification reject*/
6748 nas_esm_inf_req, /* ESM information request, No IE:s*/
6749 nas_esm_inf_resp, /* ESM information response*/
6750 nas_esm_notification, /* Notification */
6751 nas_esm_dummy_msg, /* ESM dummy message */
6752 nas_esm_status, /* ESM status */
6753 nas_esm_remote_ue_report, /* Remote UE report */
6754 nas_esm_remote_ue_report_resp, /* Remote UE report response */
6755 nas_esm_data_transport, /* ESM data transport */
6757 NULL, /* NONE */
6760 static void
6761 get_nas_esm_msg_params(uint8_t oct, const char **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p)
6763 int idx;
6765 *msg_str = try_val_to_str_idx_ext((uint32_t) (oct & 0xff), &nas_msg_esm_strings_ext, &idx);
6766 *hf_idx = hf_nas_eps_msg_esm_type;
6767 if (*msg_str != NULL) {
6768 *ett_tree = ett_nas_msg_esm[idx];
6769 *msg_fcn_p = nas_msg_esm_fcn[idx];
6772 return;
6777 #define NUM_NAS_MSG_EMM array_length(nas_msg_emm_strings)
6778 static int ett_nas_msg_emm[NUM_NAS_MSG_EMM];
6779 static void (*nas_msg_emm_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len) = {
6780 nas_emm_attach_req, /* Attach request */
6781 nas_emm_attach_acc, /* Attach accept */
6782 nas_emm_attach_comp, /* Attach complete */
6783 nas_emm_attach_rej, /* Attach reject */
6784 nas_emm_detach_req, /* Detach request */
6785 NULL, /* 8.2.10 Detach accept */
6787 nas_emm_trac_area_upd_req, /* Tracking area update request */
6788 nas_emm_trac_area_upd_acc, /* Tracking area update accept */
6789 NULL, /* Tracking area update complete (No IE's)*/
6790 nas_emm_trac_area_upd_rej, /* Tracking area update reject */
6792 nas_emm_ext_serv_req, /* Extended service request */
6793 nas_emm_ctrl_plane_serv_req,/* Control plane service request */
6794 nas_emm_serv_rej, /* Service reject */
6795 nas_emm_serv_accept, /* Service accept */
6797 nas_emm_guti_realloc_cmd, /* GUTI reallocation command */
6798 NULL, /* GUTI reallocation complete (No IE's) */
6799 nas_emm_auth_req, /* Authentication request */
6800 nas_emm_auth_resp, /* Authentication response */
6801 NULL, /* Authentication reject (No IE:s)*/
6802 nas_emm_id_req, /* Identity request */
6803 nas_emm_id_res, /* Identity response */
6804 nas_emm_auth_fail, /* Authentication failure */
6805 nas_emm_sec_mode_cmd, /* Security mode command */
6806 nas_emm_sec_mode_comp, /* Security mode complete */
6807 nas_emm_sec_mode_rej, /* Security mode reject */
6809 nas_emm_emm_status, /* EMM status */
6810 nas_emm_emm_inf, /* EMM information */
6811 nas_emm_dl_nas_trans, /* Downlink NAS transport */
6812 nas_emm_ul_nas_trans, /* Uplink NAS transport */
6813 nas_emm_cs_serv_not, /* 8.2.9 CS service notification */
6814 nas_emm_dl_gen_nas_trans, /* Downlink generic NAS transport */
6815 nas_emm_ul_gen_nas_trans, /* Uplink generic NAS transport */
6816 NULL, /* NONE */
6820 static void
6821 get_nas_emm_msg_params(uint8_t oct, const char **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p)
6823 int idx;
6825 *msg_str = try_val_to_str_idx_ext((uint32_t) (oct & 0xff), &nas_msg_emm_strings_ext, &idx);
6826 *hf_idx = hf_nas_eps_msg_emm_type;
6827 if (*msg_str != NULL) {
6828 *ett_tree = ett_nas_msg_emm[idx];
6829 *msg_fcn_p = nas_msg_emm_fcn[idx];
6832 return;
6835 static const value_string nas_eps_esm_bearer_id_vals[] = {
6836 { 0x0, "No EPS bearer identity assigned"},
6837 { 0x1, "EPS bearer identity value 1"},
6838 { 0x2, "EPS bearer identity value 2"},
6839 { 0x3, "EPS bearer identity value 3"},
6840 { 0x4, "EPS bearer identity value 4"},
6841 { 0x5, "EPS bearer identity value 5"},
6842 { 0x6, "EPS bearer identity value 6"},
6843 { 0x7, "EPS bearer identity value 7"},
6844 { 0x8, "EPS bearer identity value 8"},
6845 { 0x9, "EPS bearer identity value 9"},
6846 { 0xa, "EPS bearer identity value 10"},
6847 { 0xb, "EPS bearer identity value 11"},
6848 { 0xc, "EPS bearer identity value 12"},
6849 { 0xd, "EPS bearer identity value 13"},
6850 { 0xe, "EPS bearer identity value 14"},
6851 { 0xf, "EPS bearer identity value 15"},
6852 { 0, NULL }
6856 * EPS session management messages.
6857 * A plain NAS message is passed to this function
6859 static void
6860 dissect_nas_eps_esm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
6862 const char *msg_str;
6863 uint32_t len;
6864 int ett_tree;
6865 int hf_idx;
6866 void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len);
6867 uint8_t oct;
6869 len = tvb_reported_length(tvb);
6871 * EPS bearer identity 9.3.2
6873 proto_tree_add_item(tree, hf_nas_eps_bearer_id, tvb, offset, 1, ENC_BIG_ENDIAN);
6874 /* Protocol discriminator 9.2 */
6875 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
6876 offset++;
6878 /* Procedure transaction identity 9.4
6879 * The procedure transaction identity and its use are defined in 3GPP TS 24.007
6881 proto_tree_add_item(tree, hf_nas_eps_esm_proc_trans_id, tvb, offset, 1, ENC_BIG_ENDIAN);
6882 offset++;
6884 /*message type IE*/
6885 oct = tvb_get_uint8(tvb,offset);
6886 msg_fcn_p = NULL;
6887 ett_tree = -1;
6888 hf_idx = -1;
6889 msg_str = NULL;
6891 get_nas_esm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p);
6893 if (msg_str) {
6894 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, msg_str);
6895 } else {
6896 proto_tree_add_expert_format(tree, pinfo, &ei_nas_eps_unknown_msg_type, tvb, offset, 1, "Unknown Message Type 0x%02x", oct);
6897 return;
6901 * Add NAS message name
6903 proto_tree_add_item(tree, hf_idx, tvb, offset, 1, ENC_BIG_ENDIAN);
6904 offset++;
6907 * decode elements
6909 if (msg_fcn_p == NULL)
6911 if (tvb_reported_length_remaining(tvb, offset)) {
6912 proto_tree_add_item(tree, hf_nas_eps_msg_elems, tvb, offset, len - offset, ENC_NA);
6915 else
6917 (*msg_fcn_p)(tvb, tree, pinfo, offset, len - offset);
6922 * The "real" security header has been dissected or if dissect_header = true
6924 static void
6925 dissect_nas_eps_emm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, bool second_header)
6927 const char *msg_str;
6928 uint32_t len, security_header_type;
6929 int ett_tree;
6930 int hf_idx;
6931 void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len);
6932 uint8_t oct;
6934 len = tvb_reported_length(tvb);
6936 /* 9.3.1 Security header type */
6937 if (second_header) {
6938 security_header_type = tvb_get_uint8(tvb,offset)>>4;
6939 proto_tree_add_item_ret_uint(tree, hf_nas_eps_security_header_type, tvb, offset, 1, ENC_BIG_ENDIAN, &security_header_type);
6940 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
6941 offset++;
6942 if (security_header_type != 0) {
6943 /* Message authentication code */
6944 proto_tree_add_item(tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, ENC_BIG_ENDIAN);
6945 offset+=4;
6946 /* Sequence number */
6947 proto_tree_add_item(tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
6948 offset++;
6949 if ((security_header_type == 2)||(security_header_type == 4))
6950 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
6951 return;
6952 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, offset, 1, ENC_BIG_ENDIAN);
6953 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
6954 offset++;
6957 /* Message type IE*/
6958 oct = tvb_get_uint8(tvb,offset);
6959 msg_fcn_p = NULL;
6960 ett_tree = -1;
6961 hf_idx = -1;
6962 msg_str = NULL;
6964 get_nas_emm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p);
6966 if (msg_str) {
6967 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, msg_str);
6968 } else {
6969 proto_tree_add_expert_format(tree, pinfo, &ei_nas_eps_unknown_msg_type, tvb, offset, 1, "Unknown Message Type 0x%02x", oct);
6970 return;
6974 * Add NAS message name
6976 proto_tree_add_item(tree, hf_idx, tvb, offset, 1, ENC_BIG_ENDIAN);
6977 offset++;
6980 * decode elements
6982 if (msg_fcn_p == NULL)
6984 if (tvb_reported_length_remaining(tvb, offset)) {
6985 proto_tree_add_item(tree, hf_nas_eps_msg_elems, tvb, offset, len - offset, ENC_NA);
6988 else
6990 (*msg_fcn_p)(tvb, tree, pinfo, offset, len - offset);
6995 static int
6996 dissect_nas_eps_plain(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
6998 proto_item *item;
6999 proto_tree *nas_eps_tree;
7000 uint8_t pd;
7001 int offset = 0;
7003 /* make entry in the Protocol column on summary display */
7004 col_append_sep_str(pinfo->cinfo, COL_PROTOCOL, "/", "NAS-EPS");
7006 item = proto_tree_add_item(tree, proto_nas_eps, tvb, 0, -1, ENC_NA);
7007 nas_eps_tree = proto_item_add_subtree(item, ett_nas_eps);
7009 /* SERVICE REQUEST (security header type equal to 12 or greater) is not a plain NAS message */
7010 pd = tvb_get_uint8(tvb,offset);
7011 if (((pd&0x0f) == 0x07) && ((pd&0xf0) >= 0xc0)) {
7012 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Service request");
7013 /* Security header type Security header type 9.3.1 M V 1/2 */
7014 proto_tree_add_item(nas_eps_tree, hf_nas_eps_security_header_type, tvb, 0, 1, ENC_BIG_ENDIAN);
7015 /* Protocol discriminator Protocol discriminator 9.2 M V 1/2 */
7016 proto_tree_add_item(nas_eps_tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, ENC_BIG_ENDIAN);
7017 offset++;
7018 nas_emm_service_req(tvb, nas_eps_tree, pinfo, offset, tvb_reported_length(tvb)-offset);
7019 return tvb_captured_length(tvb);
7022 pd &= 0x0f;
7023 switch (pd) {
7024 case 2:
7025 /* EPS session management messages.
7026 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
7028 dissect_nas_eps_esm_msg(tvb, pinfo, nas_eps_tree, offset);
7029 break;
7030 case 7:
7031 /* EPS mobility management messages.
7032 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
7034 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, true);
7035 break;
7036 case 15:
7037 /* Special conformance testing functions for User Equipment messages.
7038 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
7040 if (gsm_a_dtap_handle) {
7041 tvbuff_t *new_tvb = tvb_new_subset_remaining(tvb, offset);
7042 call_dissector(gsm_a_dtap_handle, new_tvb,pinfo, nas_eps_tree);
7043 break;
7044 } /* else fall through default */
7045 /* FALL THROUGH */
7046 default:
7047 proto_tree_add_expert_format(nas_eps_tree, pinfo, &ei_nas_eps_unknown_pd, tvb, offset, -1, "Not a NAS EPS PD %u (%s)",
7048 pd, val_to_str_const(pd, protocol_discriminator_vals, "Unknown"));
7049 break;
7052 return tvb_captured_length(tvb);
7055 /* TS 24.301 8.2.1
7056 * 9 General message format and information elements coding
7057 * 9.1 Overview
7058 * Within the protocols defined in the present document, every message, except the SERVICE REQUEST message,
7059 * is a standard L3 message as defined in 3GPP TS 24.007 [12]. This means that the message consists of the following parts:
7060 * 1) if the message is a plain NAS message:
7061 * a) protocol discriminator;
7062 * b) EPS bearer identity or security header type;
7063 * c) procedure transaction identity;
7064 * d) message type;
7065 * e) other information elements, as required.
7066 * 2) if the message is a security protected NAS message:
7067 * a) protocol discriminator;
7068 * b) security header type;
7069 * c) message authentication code;
7070 * d) sequence number;
7071 * e) plain NAS message, as defined in item 1.
7073 * The EPS bearer identity and the procedure transaction identity are only used in messages
7074 * with protocol discriminator EPS session management. Octet 1a with the procedure transaction
7075 * identity shall only be included in these messages.
7079 * All messages received here will have the security header:
7080 * Figure 9.1.2: General message organization example for a security protected NAS message
7081 * 9.3.1 Bits 5 to 8 of the first octet of every EPS Mobility Management (EMM)
7082 * message contain the Security header type IE.
7083 * 4.4.4.2 All ESM messages are integrity protected.
7086 static int
7087 dissect_nas_eps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
7089 proto_item *item;
7090 proto_tree *nas_eps_tree;
7091 uint32_t pd, security_header_type;
7092 int offset = 0;
7093 uint32_t len;
7094 uint32_t msg_auth_code;
7096 len = tvb_reported_length(tvb);
7097 /* The protected NAS message header is 6 octets long, and the NAS message header is at least 2 octets long. */
7098 /* If the length of the tvbuffer is less than 8 octets, we can safely conclude the message is not protected
7099 or is a service request. */
7100 if (len < 8) {
7101 dissect_nas_eps_plain(tvb, pinfo, tree, data);
7102 return tvb_captured_length(tvb);
7105 if (g_nas_eps_dissect_plain) {
7106 dissect_nas_eps_plain(tvb, pinfo, tree, data);
7107 return tvb_captured_length(tvb);
7110 /* make entry in the Protocol column on summary display */
7111 col_append_sep_str(pinfo->cinfo, COL_PROTOCOL, "/", "NAS-EPS");
7113 item = proto_tree_add_item(tree, proto_nas_eps, tvb, 0, -1, ENC_NA);
7114 nas_eps_tree = proto_item_add_subtree(item, ett_nas_eps);
7116 /* Security header type Security header type 9.3.1 M V 1/2 */
7117 proto_tree_add_item_ret_uint(nas_eps_tree, hf_nas_eps_security_header_type, tvb, 0, 1, ENC_BIG_ENDIAN, &security_header_type);
7118 /* Protocol discriminator Protocol discriminator 9.2 M V 1/2 */
7119 proto_tree_add_item_ret_uint(nas_eps_tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, ENC_BIG_ENDIAN, &pd);
7120 offset++;
7121 /* Message authentication code Message authentication code 9.5 M V 4 */
7122 if (security_header_type == 0) {
7123 if (pd == 7) {
7124 /* Plain EPS mobility management messages. */
7125 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, false);
7126 } else {
7127 proto_tree_add_expert(nas_eps_tree, pinfo, &ei_nas_eps_esm_tp_not_integ_prot, tvb, offset, len-4);
7129 return tvb_captured_length(tvb);
7130 } else {
7131 if (pd != 7) {
7132 proto_tree_add_expert(nas_eps_tree, pinfo, &ei_nas_eps_sec_hdr_wrong_pd, tvb, offset, len-4);
7133 return tvb_captured_length(tvb);
7135 /* SERVICE REQUEST (12 or greater) is not a plain NAS message treat separately */
7136 if (security_header_type >= 12) {
7137 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Service request");
7138 nas_emm_service_req(tvb, nas_eps_tree, pinfo, offset, len-offset);
7139 return tvb_captured_length(tvb);
7141 /* Message authentication code */
7142 proto_tree_add_item(nas_eps_tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, ENC_BIG_ENDIAN);
7143 msg_auth_code = tvb_get_ntohl(tvb, offset);
7144 offset+=4;
7145 if ((security_header_type == 2)||(security_header_type == 4)) {
7146 /* Possible ciphered message */
7147 if (msg_auth_code != 0) {
7148 /* Sequence number Sequence number 9.6 M V 1 */
7149 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
7150 offset++;
7151 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
7152 /* Read security_header_type / EPS bearer id AND pd */
7153 pd = tvb_get_uint8(tvb,offset);
7154 /* If pd is in plaintext this message probably isn't ciphered */
7155 /* Use preferences settings to override this behavior */
7156 if (!g_nas_eps_null_decipher ||
7157 ((pd != 7) && (pd != 15) && ((pd&0x0f) != 2))) {
7158 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Ciphered message");
7159 proto_tree_add_item(nas_eps_tree, hf_nas_eps_ciphered_msg, tvb, offset, len-6, ENC_NA);
7160 return tvb_captured_length(tvb);
7162 } else {
7163 /* msg_auth_code == 0, probably not ciphered */
7164 /* Sequence number Sequence number 9.6 M V 1 */
7165 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
7166 offset++;
7168 } else {
7169 /* Sequence number Sequence number 9.6 M V 1 */
7170 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
7171 offset++;
7174 /* NAS message NAS message 9.7 M V 1-n */
7176 pd = tvb_get_uint8(tvb,offset)&0x0f;
7177 switch (pd) {
7178 case 2:
7179 /* EPS session management messages.
7180 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
7182 dissect_nas_eps_esm_msg(tvb, pinfo, nas_eps_tree, offset);
7183 break;
7184 case 7:
7185 /* EPS mobility management messages.
7186 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
7188 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, true);
7189 break;
7190 case 15:
7191 /* Special conformance testing functions for User Equipment messages.
7192 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
7194 if (gsm_a_dtap_handle) {
7195 tvbuff_t *new_tvb = tvb_new_subset_remaining(tvb, offset);
7196 call_dissector(gsm_a_dtap_handle, new_tvb, pinfo, nas_eps_tree);
7197 break;
7198 } /* else fall through default */
7199 /* FALL THROUGH */
7200 default:
7201 proto_tree_add_expert_format(nas_eps_tree, pinfo, &ei_nas_eps_unknown_pd, tvb, offset, -1, "Not a NAS EPS PD %u (%s)",
7202 pd, val_to_str_const(pd, protocol_discriminator_vals, "Unknown"));
7203 break;
7206 return tvb_captured_length(tvb);
7209 void
7210 proto_register_nas_eps(void)
7212 unsigned i;
7213 unsigned last_offset;
7214 module_t *nas_eps_module;
7216 /* List of fields */
7218 static hf_register_info hf[] = {
7219 { &hf_nas_eps_msg_emm_type,
7220 { "NAS EPS Mobility Management Message Type", "nas-eps.nas_msg_emm_type",
7221 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &nas_msg_emm_strings_ext, 0x0,
7222 NULL, HFILL }
7224 { &hf_nas_eps_common_elem_id,
7225 { "Element ID", "nas-eps.common.elem_id",
7226 FT_UINT8, BASE_HEX, NULL, 0,
7227 NULL, HFILL }
7229 { &hf_nas_eps_emm_elem_id,
7230 { "Element ID", "nas-eps.emm.elem_id",
7231 FT_UINT8, BASE_HEX, NULL, 0,
7232 NULL, HFILL }
7234 { &hf_nas_eps_bearer_id,
7235 { "EPS bearer identity", "nas-eps.bearer_id",
7236 FT_UINT8, BASE_DEC, VALS(nas_eps_esm_bearer_id_vals), 0xf0,
7237 NULL, HFILL }
7239 { &hf_nas_eps_spare_bits,
7240 { "Spare bit(s)", "nas-eps.spare_bits",
7241 FT_UINT8, BASE_HEX, NULL, 0x0,
7242 NULL, HFILL }
7244 { &hf_nas_eps_spare_b7,
7245 { "Spare bit(s)", "nas-eps.spare_bits",
7246 FT_UINT8, BASE_HEX, NULL, 0x80,
7247 NULL, HFILL }
7249 { &hf_nas_eps_security_header_type,
7250 { "Security header type","nas-eps.security_header_type",
7251 FT_UINT8,BASE_DEC|BASE_EXT_STRING, &security_header_type_vals_ext, 0xf0,
7252 NULL, HFILL }
7254 { &hf_nas_eps_msg_auth_code,
7255 { "Message authentication code","nas-eps.msg_auth_code",
7256 FT_UINT32,BASE_HEX, NULL, 0x0,
7257 NULL, HFILL }
7259 { &hf_nas_eps_seq_no,
7260 { "Sequence number","nas-eps.seq_no",
7261 FT_UINT8,BASE_DEC, NULL, 0x0,
7262 NULL, HFILL }
7264 { &hf_nas_eps_ciphered_msg,
7265 { "Ciphered message","nas-eps.ciphered_msg",
7266 FT_BYTES, BASE_NONE, NULL, 0x0,
7267 NULL, HFILL }
7269 { &hf_nas_eps_msg_elems,
7270 { "Message Elements", "nas-eps.message_elements",
7271 FT_BYTES, BASE_NONE, NULL, 0x0,
7272 NULL, HFILL }
7274 { &hf_nas_eps_seq_no_short,
7275 { "Sequence number (short)","nas-eps.seq_no_short",
7276 FT_UINT8,BASE_DEC, NULL, 0x0,
7277 NULL, HFILL }
7279 { &hf_nas_eps_emm_ebi0,
7280 { "EBI(0) spare","nas-eps.emm.ebi0",
7281 FT_BOOLEAN, 8, NULL, 0x01,
7282 NULL, HFILL }
7284 { &hf_nas_eps_emm_ebi1,
7285 { "EBI(1)","nas-eps.emm.ebi1",
7286 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x02,
7287 NULL, HFILL }
7289 { &hf_nas_eps_emm_ebi2,
7290 { "EBI(2)","nas-eps.emm.ebi2",
7291 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x04,
7292 NULL, HFILL }
7294 { &hf_nas_eps_emm_ebi3,
7295 { "EBI(3)","nas-eps.emm.ebi3",
7296 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x08,
7297 NULL, HFILL }
7299 { &hf_nas_eps_emm_ebi4,
7300 { "EBI(4)","nas-eps.emm.ebi4",
7301 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x10,
7302 NULL, HFILL }
7304 { &hf_nas_eps_emm_ebi5,
7305 { "EBI(5)","nas-eps.emm.ebi5",
7306 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x20,
7307 NULL, HFILL }
7309 { &hf_nas_eps_emm_ebi6,
7310 { "EBI(6)","nas-eps.emm.ebi6",
7311 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x40,
7312 NULL, HFILL }
7314 { &hf_nas_eps_emm_ebi7,
7315 { "EBI(7)","nas-eps.emm.ebi7",
7316 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x80,
7317 NULL, HFILL }
7319 { &hf_nas_eps_emm_ebi8,
7320 { "EBI(8)","nas-eps.emm.ebi8",
7321 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x01,
7322 NULL, HFILL }
7324 { &hf_nas_eps_emm_ebi9,
7325 { "EBI(9)","nas-eps.emm.ebi9",
7326 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x02,
7327 NULL, HFILL }
7329 { &hf_nas_eps_emm_ebi10,
7330 { "EBI(10)","nas-eps.emm.ebi10",
7331 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x04,
7332 NULL, HFILL }
7334 { &hf_nas_eps_emm_ebi11,
7335 { "EBI(11)","nas-eps.emm.ebi11",
7336 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x08,
7337 NULL, HFILL }
7339 { &hf_nas_eps_emm_ebi12,
7340 { "EBI(12)","nas-eps.emm.ebi12",
7341 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x10,
7342 NULL, HFILL }
7344 { &hf_nas_eps_emm_ebi13,
7345 { "EBI(13)","nas-eps.emm.ebi13",
7346 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x20,
7347 NULL, HFILL }
7349 { &hf_nas_eps_emm_ebi14,
7350 { "EBI(14)","nas-eps.emm.ebi14",
7351 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x40,
7352 NULL, HFILL }
7354 { &hf_nas_eps_emm_ebi15,
7355 { "EBI(15)","nas-eps.emm.ebi15",
7356 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x80,
7357 NULL, HFILL }
7359 { &hf_nas_eps_emm_dl_nas_cnt,
7360 { "DL NAS COUNT value","nas-eps.emm.dl_nas_cnt",
7361 FT_UINT8,BASE_DEC, NULL, 0x0f,
7362 NULL, HFILL }
7364 {&hf_nas_eps_emm_nonce_mme,
7365 { "NonceMME","nas-eps.emm.nonce_mme",
7366 FT_UINT32,BASE_HEX, NULL, 0x0,
7367 NULL, HFILL }
7369 {&hf_nas_eps_emm_nonce,
7370 { "Nonce","nas-eps.emm.nonce",
7371 FT_UINT32,BASE_HEX, NULL, 0x0,
7372 NULL, HFILL }
7374 { &hf_nas_eps_emm_paging_id,
7375 { "Paging identity value","nas-eps.emm.paging_id",
7376 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_paging_id_vals), 0x0,
7377 NULL, HFILL }
7379 { &hf_nas_eps_emm_nbiot_allowed_value,
7380 { "NB-IoT allowed value","nas-eps.emm.nbiot_allowed_value",
7381 FT_BOOLEAN, BASE_NONE, TFS(&tfs_not_allowed_allowed), 0x0,
7382 NULL, HFILL }
7384 { &hf_nas_eps_emm_eps_optim_info,
7385 { "EPS optimization info","nas-eps.emm.eps_optim_info",
7386 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_eps_optim_info), 0x0,
7387 NULL, HFILL }
7389 { &hf_nas_eps_emm_eutran_allowed_value,
7390 { "E-UTRAN allowed value","nas-eps.emm.eutran_allowed_value",
7391 FT_BOOLEAN, BASE_NONE, TFS(&tfs_not_allowed_allowed), 0x0,
7392 NULL, HFILL }
7394 { &hf_nas_eps_emm_eps_att_type,
7395 { "EPS attach type","nas-eps.emm.eps_att_type",
7396 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_att_type_vals), 0x0,
7397 NULL, HFILL }
7399 { &hf_nas_eps_emm_cp_ciot,
7400 { "Control plane CIoT EPS optimization","nas-eps.emm.cp_ciot",
7401 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
7402 NULL, HFILL }
7404 { &hf_nas_eps_emm_er_wo_pdn,
7405 { "EMM-REGISTERED w/o PDN connectivity","nas-eps.emm.er_wo_pdn",
7406 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
7407 NULL, HFILL }
7409 { &hf_nas_eps_emm_esr_ps,
7410 { "Support of EXTENDED SERVICE REQUEST for packet services","nas-eps.emm.esr_ps",
7411 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
7412 NULL, HFILL }
7414 { &hf_nas_eps_emm_cs_lcs,
7415 { "CS-LCS","nas-eps.emm.cs_lcs",
7416 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_cs_lcs_vals), 0x18,
7417 "Location services indicator in CS", HFILL }
7419 { &hf_nas_eps_emm_epc_lcs,
7420 { "Location services via EPC","nas-eps.emm.epc_lcs",
7421 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
7422 NULL, HFILL }
7424 { &hf_nas_eps_emm_emc_bs,
7425 { "Emergency bearer services in S1 mode","nas-eps.emm.emc_bs",
7426 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
7427 NULL, HFILL }
7429 { &hf_nas_eps_emm_ims_vops,
7430 { "IMS voice over PS session in S1 mode","nas-eps.emm.ims_vops",
7431 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
7432 NULL, HFILL }
7434 { &hf_nas_eps_emm_15_bearers,
7435 { "Signalling for a maximum number of 15 EPS bearer contexts","nas-eps.emm.15_bearers",
7436 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
7437 NULL, HFILL }
7439 { &hf_nas_eps_emm_iwkn26,
7440 { "Interworking without N26 interface","nas-eps.emm.iwkn26",
7441 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
7442 NULL, HFILL }
7444 { &hf_nas_eps_emm_restrict_dcnr,
7445 { "Restriction on the use of dual connectivity with NR","nas-eps.emm.restrict_dcnr",
7446 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x20,
7447 NULL, HFILL }
7449 { &hf_nas_eps_emm_restrict_ec,
7450 { "Restriction on enhanced coverage","nas-eps.emm.restrict_ec",
7451 FT_BOOLEAN , 8, TFS(&tfs_restricted_not_restricted), 0x10,
7452 NULL, HFILL }
7454 { &hf_nas_eps_emm_epco,
7455 { "Extended protocol configuration options","nas-eps.emm.epco",
7456 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
7457 NULL, HFILL }
7459 { &hf_nas_eps_emm_hc_cp_ciot,
7460 { "Header compression for control plane CIoT EPS optimization","nas-eps.emm.hc_cp_ciot",
7461 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
7462 NULL, HFILL }
7464 { &hf_nas_eps_emm_s1_u_data,
7465 { "S1-u data transfer","nas-eps.emm.s1_u_data",
7466 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
7467 NULL, HFILL }
7469 { &hf_nas_eps_emm_up_ciot,
7470 { "User plane CIoT EPS optimization","nas-eps.emm.up_ciot",
7471 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
7472 NULL, HFILL }
7474 { &hf_nas_eps_emm_edc,
7475 { "Enhanced discontinuous coverage","nas-eps.emm.edc",
7476 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
7477 NULL, HFILL }
7479 { &hf_nas_eps_emm_ptcc,
7480 { "Paging timing collision control","nas-eps.emm.ptcc",
7481 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
7482 NULL, HFILL }
7484 { &hf_nas_eps_emm_pr,
7485 { "Paging restriction","nas-eps.emm.pr",
7486 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
7487 NULL, HFILL }
7489 { &hf_nas_eps_emm_rpr,
7490 { "Reject paging request","nas-eps.emm.rpr",
7491 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
7492 NULL, HFILL }
7494 { &hf_nas_eps_emm_piv,
7495 { "Paging indication for voice services","nas-eps.emm.piv",
7496 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
7497 NULL, HFILL }
7499 { &hf_nas_eps_emm_ncr,
7500 { "NAS signalling connection release","nas-eps.emm.ncr",
7501 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
7502 NULL, HFILL }
7504 { &hf_nas_eps_tsc,
7505 { "Type of security context flag (TSC)","nas-eps.emm.tsc",
7506 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_tsc_value), 0x0,
7507 NULL, HFILL }
7509 { &hf_nas_eps_emm_nas_key_set_id,
7510 { "NAS key set identifier","nas-eps.emm.nas_key_set_id",
7511 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_NAS_key_set_identifier_vals), 0x0,
7512 NULL, HFILL }
7514 { &hf_nas_eps_emm_odd_even,
7515 { "Odd/even indication","nas-eps.emm.odd_even",
7516 FT_BOOLEAN, 8, TFS(&nas_eps_odd_even_value), 0x8,
7517 NULL, HFILL }
7519 { &hf_nas_eps_emm_type_of_id,
7520 { "Type of identity","nas-eps.emm.type_of_id",
7521 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_id_vals), 0x07,
7522 NULL, HFILL }
7524 { &hf_nas_eps_emm_mme_grp_id,
7525 { "MME Group ID","nas-eps.emm.mme_grp_id",
7526 FT_UINT16, BASE_DEC, NULL, 0x0,
7527 NULL, HFILL }
7529 { &hf_nas_eps_emm_imei,
7530 { "IMEI", "nas-eps.emm.imei",
7531 FT_STRING, BASE_NONE, NULL, 0,
7532 NULL, HFILL }
7534 { &hf_nas_eps_emm_mme_code,
7535 { "MME Code","nas-eps.emm.mme_code",
7536 FT_UINT8, BASE_DEC, NULL, 0x0,
7537 NULL, HFILL }
7539 { &hf_nas_eps_emm_m_tmsi,
7540 { "M-TMSI","nas-eps.emm.m_tmsi",
7541 FT_UINT32, BASE_DEC_HEX, NULL, 0x0,
7542 "Global flt 3gpp.tmsi", HFILL }
7544 { &hf_nas_eps_esm_msg_cont,
7545 { "ESM message container contents","nas-eps.emm.esm_msg_cont",
7546 FT_BYTES, BASE_NONE, NULL, 0x0,
7547 NULL, HFILL }
7549 { &hf_nas_eps_esm_imeisv_req,
7550 { "IMEISV request","nas-eps.emm.imeisv_req",
7551 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_imeisv_req_vals), 0x07,
7552 NULL, HFILL }
7554 { &hf_nas_eps_emm_toi,
7555 { "Type of integrity protection algorithm","nas-eps.emm.toi",
7556 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_toi_vals), 0x07,
7557 NULL, HFILL }
7559 { &hf_nas_eps_emm_toc,
7560 { "Type of ciphering algorithm","nas-eps.emm.toc",
7561 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_toc_vals), 0x70,
7562 NULL, HFILL }
7564 { &hf_nas_eps_emm_EPS_attach_result,
7565 { "Attach result","nas-eps.emm.EPS_attach_result",
7566 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_EPS_attach_result_values), 0x0,
7567 NULL, HFILL }
7569 { &hf_nas_eps_emm_spare_half_octet,
7570 { "Spare half octet","nas-eps.emm.spare_half_octet",
7571 FT_UINT8,BASE_DEC, NULL, 0x0,
7572 NULL, HFILL }
7574 { &hf_nas_eps_emm_add_upd_res,
7575 { "AURV","nas-eps.emm.add_upd_res",
7576 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_add_upd_res_vals), 0x0,
7577 "Additional update result value", HFILL }
7579 { &hf_nas_eps_emm_pnb_ciot,
7580 { "Preferred CIoT network behaviour","nas-eps.emm.pnb_ciot",
7581 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_pnb_ciot_vals), 0x0,
7582 NULL, HFILL }
7584 { &hf_nas_eps_emm_saf,
7585 { "SAF","nas-eps.emm.saf",
7586 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_saf_value), 0x0,
7587 "Signalling active flag", HFILL }
7589 { &hf_nas_eps_emm_add_upd_type,
7590 { "AUTV","nas-eps.emm.add_upd_type",
7591 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_add_upd_type_value), 0x0,
7592 "Additional update type value", HFILL }
7594 { &hf_nas_eps_emm_res,
7595 { "RES","nas-eps.emm.res",
7596 FT_BYTES, BASE_NONE, NULL, 0x0,
7597 NULL, HFILL }
7599 { &hf_nas_eps_emm_sms_services_status,
7600 { "SMS services status value","nas-eps.emm.sms_services_status",
7601 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_sms_services_status_vals), 0x0,
7602 NULL, HFILL }
7604 { &hf_nas_eps_emm_csfb_resp,
7605 { "CSFB response","nas-eps.emm.csfb_resp",
7606 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_csfb_resp_vals), 0x03,
7607 NULL, HFILL }
7609 { &hf_nas_eps_emm_cause,
7610 { "Cause","nas-eps.emm.cause",
7611 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &nas_eps_emm_cause_values_ext, 0x0,
7612 NULL, HFILL }
7614 { &hf_nas_eps_emm_id_type2,
7615 { "Identity type 2","nas-eps.emm.id_type2",
7616 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_id_type2_vals), 0x0,
7617 NULL, HFILL }
7619 { &hf_nas_eps_emm_short_mac,
7620 { "Message authentication code (short)","nas-eps.emm.short_mac",
7621 FT_UINT16, BASE_HEX, NULL, 0x0,
7622 NULL, HFILL }
7624 { &hf_nas_eps_emm_tai_tol,
7625 { "Type of list","nas-eps.emm.tai_tol",
7626 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_tai_tol_vals), 0x60,
7627 NULL, HFILL }
7629 { &hf_nas_eps_emm_tai_n_elem,
7630 { "Number of elements","nas-eps.emm.tai_n_elem",
7631 FT_UINT8, BASE_DEC, NULL, 0x1f,
7632 NULL, HFILL }
7634 { &hf_nas_eps_emm_tai_tac,
7635 { "Tracking area code(TAC)","nas-eps.emm.tai_tac",
7636 FT_UINT16, BASE_DEC, NULL, 0x0,
7637 NULL, HFILL }
7639 { &hf_nas_eps_emm_eea0,
7640 { "EEA0","nas-eps.emm.eea0",
7641 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
7642 NULL, HFILL }
7644 { &hf_nas_eps_emm_128eea1,
7645 { "128-EEA1","nas-eps.emm.128eea1",
7646 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
7647 NULL, HFILL }
7649 { &hf_nas_eps_emm_128eea2,
7650 { "128-EEA2","nas-eps.emm.128eea2",
7651 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
7652 NULL, HFILL }
7654 { &hf_nas_eps_emm_eea3,
7655 { "128-EEA3","nas-eps.emm.eea3",
7656 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
7657 NULL, HFILL }
7659 { &hf_nas_eps_emm_eea4,
7660 { "EEA4","nas-eps.emm.eea4",
7661 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
7662 NULL, HFILL }
7664 { &hf_nas_eps_emm_eea5,
7665 { "EEA5","nas-eps.emm.eea5",
7666 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
7667 NULL, HFILL }
7669 { &hf_nas_eps_emm_eea6,
7670 { "EEA6","nas-eps.emm.eea6",
7671 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
7672 NULL, HFILL }
7674 { &hf_nas_eps_emm_eea7,
7675 { "EEA7","nas-eps.emm.eea7",
7676 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
7677 NULL, HFILL }
7679 { &hf_nas_eps_emm_eia0,
7680 { "EIA0","nas-eps.emm.eia0",
7681 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
7682 NULL, HFILL }
7684 { &hf_nas_eps_emm_128eia1,
7685 { "128-EIA1","nas-eps.emm.128eia1",
7686 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
7687 NULL, HFILL }
7689 { &hf_nas_eps_emm_128eia2,
7690 { "128-EIA2","nas-eps.emm.128eia2",
7691 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
7692 NULL, HFILL }
7694 { &hf_nas_eps_emm_eia3,
7695 { "128-EIA3","nas-eps.emm.eia3",
7696 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
7697 NULL, HFILL }
7699 { &hf_nas_eps_emm_eia4,
7700 { "EIA4","nas-eps.emm.eia4",
7701 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
7702 NULL, HFILL }
7704 { &hf_nas_eps_emm_eia5,
7705 { "EIA5","nas-eps.emm.eia5",
7706 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
7707 NULL, HFILL }
7709 { &hf_nas_eps_emm_eia6,
7710 { "EIA6","nas-eps.emm.eia6",
7711 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
7712 NULL, HFILL }
7714 { &hf_nas_eps_emm_eps_upip,
7715 { "EPS-UPIP","nas-eps.emm.eps_upip",
7716 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
7717 NULL, HFILL }
7721 { &hf_nas_eps_emm_uea0,
7722 { "UEA0","nas-eps.emm.uea0",
7723 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
7724 NULL, HFILL }
7726 { &hf_nas_eps_emm_uea1,
7727 { "UEA1","nas-eps.emm.uea1",
7728 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
7729 NULL, HFILL }
7731 { &hf_nas_eps_emm_uea2,
7732 { "UEA2","nas-eps.emm.uea2",
7733 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
7734 NULL, HFILL }
7736 { &hf_nas_eps_emm_uea3,
7737 { "UEA3","nas-eps.emm.uea3",
7738 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
7739 NULL, HFILL }
7741 { &hf_nas_eps_emm_uea4,
7742 { "UEA4","nas-eps.emm.uea4",
7743 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
7744 NULL, HFILL }
7746 { &hf_nas_eps_emm_uea5,
7747 { "UEA5","nas-eps.emm.uea5",
7748 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
7749 NULL, HFILL }
7751 { &hf_nas_eps_emm_uea6,
7752 { "UEA6","nas-eps.emm.uea6",
7753 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
7754 NULL, HFILL }
7756 { &hf_nas_eps_emm_uea7,
7757 { "UEA7","nas-eps.emm.uea7",
7758 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
7759 NULL, HFILL }
7761 { &hf_nas_eps_emm_ucs2_supp,
7762 { "UCS2 support (UCS2)","nas-eps.emm.emm_ucs2_supp",
7763 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ucs2_supp_flg_value), 0x80,
7764 NULL, HFILL }
7766 { &hf_nas_eps_emm_uia1,
7767 { "UMTS integrity algorithm UIA1","nas-eps.emm.uia1",
7768 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
7769 NULL, HFILL }
7771 { &hf_nas_eps_emm_uia2,
7772 { "UMTS integrity algorithm UIA2","nas-eps.emm.uia2",
7773 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
7774 NULL, HFILL }
7776 { &hf_nas_eps_emm_uia3,
7777 { "UMTS integrity algorithm UIA3","nas-eps.emm.uia3",
7778 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
7779 NULL, HFILL }
7781 { &hf_nas_eps_emm_uia4,
7782 { "UMTS integrity algorithm UIA4","nas-eps.emm.uia4",
7783 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
7784 NULL, HFILL }
7786 { &hf_nas_eps_emm_uia5,
7787 { "UMTS integrity algorithm UIA5","nas-eps.emm.uia5",
7788 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
7789 NULL, HFILL }
7791 { &hf_nas_eps_emm_uia6,
7792 { "UMTS integrity algorithm UIA6","nas-eps.emm.uia6",
7793 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
7794 NULL, HFILL }
7796 { &hf_nas_eps_emm_uia7,
7797 { "UMTS integrity algorithm UIA7","nas-eps.emm.uia7",
7798 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
7799 NULL, HFILL }
7801 { &hf_nas_eps_emm_gea1,
7802 { "GPRS encryption algorithm GEA1","nas-eps.emm.gea1",
7803 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
7804 NULL, HFILL }
7806 { &hf_nas_eps_emm_gea2,
7807 { "GPRS encryption algorithm GEA2","nas-eps.emm.gea2",
7808 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
7809 NULL, HFILL }
7811 { &hf_nas_eps_emm_gea3,
7812 { "GPRS encryption algorithm GEA3","nas-eps.emm.gea3",
7813 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
7814 NULL, HFILL }
7816 { &hf_nas_eps_emm_gea4,
7817 { "GPRS encryption algorithm GEA4","nas-eps.emm.gea4",
7818 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
7819 NULL, HFILL }
7821 { &hf_nas_eps_emm_gea5,
7822 { "GPRS encryption algorithm GEA5","nas-eps.emm.gea5",
7823 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
7824 NULL, HFILL }
7826 { &hf_nas_eps_emm_gea6,
7827 { "GPRS encryption algorithm GEA6","nas-eps.emm.gea6",
7828 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
7829 NULL, HFILL }
7831 { &hf_nas_eps_emm_gea7,
7832 { "GPRS encryption algorithm GEA7","nas-eps.emm.gea7",
7833 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
7834 NULL, HFILL }
7836 { &hf_eps_emm_ext_emerg_num_list_eenlv,
7837 { "Extended Emergency Number List Validity","nas-eps.emm.ext_emerg_num_list.eenlv",
7838 FT_BOOLEAN, 8, TFS(&tfs_eenlv_value), 0x01,
7839 NULL, HFILL }
7841 { &hf_eps_emm_ext_emerg_num_list_emerg_num_len,
7842 { "Emergency number information length","nas-eps.emm.ext_emerg_num_list.emerg_num.len",
7843 FT_UINT8, BASE_DEC, NULL, 0x0,
7844 NULL, HFILL }
7846 { &hf_eps_emm_ext_emerg_num_list_emerg_num,
7847 { "Emergency number","nas-eps.emm.ext_emerg_num_list.emerg_num",
7848 FT_STRING, BASE_NONE, NULL, 0x0,
7849 NULL, HFILL }
7851 { &hf_eps_emm_ext_emerg_num_list_sub_serv_field_len,
7852 { "Sub-services field length","nas-eps.emm.ext_emerg_num_list.sub_serv_field.len",
7853 FT_UINT8, BASE_DEC, NULL, 0x0,
7854 NULL, HFILL }
7856 { &hf_eps_emm_ext_emerg_num_list_sub_serv_field,
7857 { "Sub-services field","nas-eps.emm.ext_emerg_num_list.sub_serv_field",
7858 FT_STRING, BASE_NONE, NULL, 0x0,
7859 NULL, HFILL }
7861 { &hf_nas_eps_emm_prose_dd_cap,
7862 { "ProSe direct discovery","nas-eps.emm.prose_dd_cap",
7863 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
7864 NULL, HFILL }
7866 { &hf_nas_eps_emm_prose_cap,
7867 { "ProSe","nas-eps.emm.prose_cap",
7868 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
7869 NULL, HFILL }
7871 { &hf_nas_eps_emm_h245_ash_cap,
7872 { "H.245 After SRVCC Handover","nas-eps.emm.h245_ash_cap",
7873 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
7874 NULL, HFILL }
7876 { &hf_nas_eps_emm_acc_csfb_cap,
7877 { "Access class control for CSFB","nas-eps.emm.acc_csfb_cap",
7878 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
7879 NULL, HFILL }
7881 { &hf_nas_eps_emm_lpp_cap,
7882 { "LTE Positioning Protocol","nas-eps.emm.lpp_cap",
7883 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
7884 NULL, HFILL }
7886 { &hf_nas_eps_emm_lcs_cap,
7887 { "Location services (LCS) notification mechanisms","nas-eps.emm.lcs_cap",
7888 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
7889 NULL, HFILL }
7891 { &hf_nas_eps_emm_1xsrvcc_cap,
7892 { "SRVCC from E-UTRAN to cdma2000 1xCS","nas-eps.emm.1xsrvcc_cap",
7893 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
7894 NULL, HFILL }
7896 { &hf_nas_eps_emm_nf_cap,
7897 { "Notification procedure","nas-eps.emm.nf_cap",
7898 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
7899 NULL, HFILL }
7901 { &hf_nas_eps_emm_epco_cap,
7902 { "Extended protocol configuration options","nas-eps.emm.epco_cap",
7903 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
7904 NULL, HFILL }
7906 { &hf_nas_eps_emm_hc_cp_ciot_cap,
7907 { "Header compression for control plane CIoT EPS optimization","nas-eps.emm.hc_cp_ciot_cap",
7908 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
7909 NULL, HFILL }
7911 { &hf_nas_eps_emm_er_wo_pdn_cap,
7912 { "EMM-REGISTERED w/o PDN connectivity","nas-eps.emm.er_wo_pdn_cap",
7913 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
7914 NULL, HFILL }
7916 { &hf_nas_eps_emm_s1u_data_cap,
7917 { "S1-U data transfer","nas-eps.emm.s1u_data_cap",
7918 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
7919 NULL, HFILL }
7921 { &hf_nas_eps_emm_up_ciot_cap,
7922 { "User plane CIoT EPS optimization","nas-eps.emm.up_ciot_cap",
7923 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
7924 NULL, HFILL }
7926 { &hf_nas_eps_emm_cp_ciot_cap,
7927 { "Control plane CIoT EPS optimization","nas-eps.emm.cp_ciot_cap",
7928 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
7929 NULL, HFILL }
7931 { &hf_nas_eps_emm_prose_relay_cap,
7932 { "ProSe UE-to-network relay","nas-eps.emm.prose_relay_cap",
7933 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
7934 NULL, HFILL }
7936 { &hf_nas_eps_emm_prose_dc_cap,
7937 { "ProSe direct communication","nas-eps.emm.prose_dc_cap",
7938 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
7939 NULL, HFILL }
7941 { &hf_nas_eps_15_bearers_cap,
7942 { "Signalling for a maximum number of 15 EPS bearer contexts","nas-eps.emm.15_bearers_cap",
7943 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
7944 NULL, HFILL }
7946 { &hf_nas_eps_sgc_cap,
7947 { "Service gap control","nas-eps.emm.sgc_cap",
7948 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
7949 NULL, HFILL }
7951 { &hf_nas_eps_n1mode_cap,
7952 { "N1 mode for 3GPP access","nas-eps.emm.n1mode_cap",
7953 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
7954 NULL, HFILL }
7956 { &hf_nas_eps_dcnr_cap,
7957 { "Dual connectivity with NR","nas-eps.emm.dcnr_cap",
7958 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
7959 NULL, HFILL }
7961 { &hf_nas_eps_cp_backoff_cap,
7962 { "Control plane data backoff","nas-eps.emm.cp_backoff_cap",
7963 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
7964 NULL, HFILL }
7966 { &hf_nas_eps_restrict_ec_cap,
7967 { "Restriction on use of enhanced coverage","nas-eps.emm.restrict_ec_cap",
7968 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
7969 NULL, HFILL }
7971 { &hf_nas_eps_v2x_pc5_cap,
7972 { "V2X communication over PC5","nas-eps.emm.v2x_pc5_cap",
7973 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
7974 NULL, HFILL }
7976 { &hf_nas_eps_multiple_drb_cap,
7977 { "Multiple DRB","nas-eps.emm.multiple_drb_cap",
7978 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
7979 NULL, HFILL }
7981 { &hf_nas_eps_rpr_cap,
7982 { "Reject paging request","nas-eps.emm.rpr_cap",
7983 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
7984 NULL, HFILL }
7986 { &hf_nas_eps_piv_cap,
7987 { "Paging indication for voice services","nas-eps.emm.piv_cap",
7988 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
7989 NULL, HFILL }
7991 { &hf_nas_eps_ncr_cap,
7992 { "NAS signalling connection release","nas-eps.emm.ncr_cap",
7993 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
7994 NULL, HFILL }
7996 { &hf_nas_eps_v2x_nr_pc5_cap,
7997 { "V2X communication over NR-PC5","nas-eps.emm.v2x_nr_pc5_cap",
7998 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
7999 NULL, HFILL }
8001 { &hf_nas_eps_up_mt_edt_cap,
8002 { "User plane Mobile Terminated-Early Data Transmission","nas-eps.emm.up_mt_edt_cap",
8003 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
8004 NULL, HFILL }
8006 { &hf_nas_eps_cp_mt_edt_cap,
8007 { "Control plane Mobile Terminated-Early Data Transmission","nas-eps.emm.cp_mt_edt_cap",
8008 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
8009 NULL, HFILL }
8011 { &hf_nas_eps_wsua_cap,
8012 { "Wake-up signal assistance","nas-eps.emm.wsua_cap",
8013 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
8014 NULL, HFILL }
8016 { &hf_nas_eps_racs_cap,
8017 { "Radio capability signalling optimisation","nas-eps.emm.racs_cap",
8018 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
8019 NULL, HFILL }
8021 { &hf_nas_eps_rclin_cap,
8022 { "Reporting coarse location information via NAS","nas-eps.emm.rclin_cap",
8023 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
8024 NULL, HFILL }
8026 { &hf_nas_eps_edc_cap,
8027 { "Enhanced discontinuous coverage","nas-eps.emm.edc_cap",
8028 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
8029 NULL, HFILL }
8031 { &hf_nas_eps_ptcc_cap,
8032 { "Paging timing collision control","nas-eps.emm.ptcc_cap",
8033 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
8034 NULL, HFILL }
8036 { &hf_nas_eps_pr_cap,
8037 { "Paging restriction","nas-eps.emm.pr_cap",
8038 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
8039 NULL, HFILL }
8041 { &hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg,
8042 { "URC upd","nas-eps.emm.ue_ra_cap_inf_upd_need_flg",
8043 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ue_ra_cap_inf_upd_need_flg), 0x01,
8044 "UE radio capability information update needed flag", HFILL }
8046 { &hf_nas_eps_emm_ss_code,
8047 { "SS Code","nas-eps.emm.ss_code",
8048 FT_UINT8,BASE_DEC, VALS(ssCode_vals), 0x0,
8049 NULL, HFILL }
8051 { &hf_nas_eps_emm_lcs_ind,
8052 { "LCS indicator","nas-eps.emm.emm_lcs_ind",
8053 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_lcs_ind_vals), 0x0,
8054 NULL, HFILL }
8056 { &hf_nas_eps_emm_gen_msg_cont_type,
8057 { "Container type","nas-eps.emm.gen_msg_cont_type",
8058 FT_UINT8,BASE_DEC|BASE_RANGE_STRING, RVALS(nas_eps_emm_gen_msg_cont_type_vals), 0x0,
8059 NULL, HFILL }
8061 { &hf_nas_eps_esm_apn_ambr_ul,
8062 { "APN-AMBR for uplink","nas-eps.esm.apn_ambr_ul",
8063 FT_UINT8,BASE_DEC, NULL, 0x0,
8064 NULL, HFILL }
8066 { &hf_nas_eps_esm_apn_ambr_dl,
8067 { "APN-AMBR for downlink","nas-eps.esm.apn_ambr_dl",
8068 FT_UINT8,BASE_DEC, NULL, 0x0,
8069 NULL, HFILL }
8071 { &hf_nas_eps_esm_apn_ambr_ul_ext,
8072 { "APN-AMBR for uplink (extended)","nas-eps.esm.apn_ambr_ul_ext",
8073 FT_UINT8,BASE_DEC, NULL, 0x0,
8074 NULL, HFILL }
8076 { &hf_nas_eps_esm_apn_ambr_dl_ext,
8077 { "APN-AMBR for downlink (extended)","nas-eps.esm.apn_ambr_dl_ext",
8078 FT_UINT8,BASE_DEC, NULL, 0x0,
8079 NULL, HFILL }
8081 { &hf_nas_eps_esm_apn_ambr_ul_ext2,
8082 { "APN-AMBR for uplink (extended-2)","nas-eps.esm.apn_ambr_ul_ext2",
8083 FT_UINT8,BASE_DEC, NULL, 0x0,
8084 NULL, HFILL }
8086 { &hf_nas_eps_esm_apn_ambr_dl_ext2,
8087 { "APN-AMBR for downlink (extended-2)","nas-eps.esm.apn_ambr_dl_ext2",
8088 FT_UINT8,BASE_DEC, NULL, 0x0,
8089 NULL, HFILL }
8091 { &hf_nas_eps_esm_apn_ambr_ul_total,
8092 { "Total APN-AMBR for uplink","nas-eps.esm.apn_ambr_ul_total",
8093 FT_UINT8,BASE_DEC, NULL, 0x0,
8094 NULL, HFILL }
8096 { &hf_nas_eps_esm_apn_ambr_dl_total,
8097 { "Total APN-AMBR for downlink","nas-eps.esm.apn_ambr_dl_total",
8098 FT_UINT8,BASE_DEC, NULL, 0x0,
8099 NULL, HFILL }
8101 { &hf_nas_eps_emm_guti_type,
8102 { "GUTI type", "nas-eps.emm.guti_type",
8103 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_guti_type_value), 0x0,
8104 NULL, HFILL }
8106 { &hf_nas_eps_hash_mme,
8107 { "HashMME", "nas-eps.emm.hash_mme",
8108 FT_BYTES, BASE_NONE, NULL, 0x0,
8109 NULL, HFILL }
8111 { &hf_nas_eps_replayed_nas_msg_cont,
8112 { "Replayed NAS message container", "nas-eps.emm.replayed_nas_msg_cont",
8113 FT_BYTES, BASE_NONE, NULL, 0x0,
8114 NULL, HFILL }
8116 { &hf_nas_eps_redir_policy,
8117 { "Redirection to GERAN or UTRAN security policy", "nas-eps.emm.redic_policy",
8118 FT_BOOLEAN, 8, TFS(&nas_eps_redir_policy_vals), 0x01,
8119 NULL, HFILL }
8121 { &hf_nas_eps_emm_5g_ea0,
8122 { "5G-EA0","nas-eps.emm.5g_ea0",
8123 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
8124 NULL, HFILL }
8126 { &hf_nas_eps_emm_128_5g_ea1,
8127 { "128-5G-EA1","nas-eps.emm.128_5g_ea1",
8128 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
8129 NULL, HFILL }
8131 { &hf_nas_eps_emm_128_5g_ea2,
8132 { "128-5G-EA2","nas-eps.emm.128_5g_ea2",
8133 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
8134 NULL, HFILL }
8136 { &hf_nas_eps_emm_128_5g_ea3,
8137 { "128-5G-EA3","nas-eps.emm.128_5g_ea3",
8138 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
8139 NULL, HFILL }
8141 { &hf_nas_eps_emm_5g_ea4,
8142 { "5G-EA4","nas-eps.emm.5g_ea4",
8143 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
8144 NULL, HFILL }
8146 { &hf_nas_eps_emm_5g_ea5,
8147 { "5G-EA5","nas-eps.emm.5g_ea5",
8148 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
8149 NULL, HFILL }
8151 { &hf_nas_eps_emm_5g_ea6,
8152 { "5G-EA6","nas-eps.emm.5g_ea6",
8153 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
8154 NULL, HFILL }
8156 { &hf_nas_eps_emm_5g_ea7,
8157 { "5G-EA7","nas-eps.emm.5g_ea7",
8158 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
8159 NULL, HFILL }
8161 { &hf_nas_eps_emm_5g_ea8,
8162 { "5G-EA8","nas-eps.emm.5g_ea8",
8163 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
8164 NULL, HFILL }
8166 { &hf_nas_eps_emm_5g_ea9,
8167 { "5G-EA9","nas-eps.emm.5g_ea9",
8168 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
8169 NULL, HFILL }
8171 { &hf_nas_eps_emm_5g_ea10,
8172 { "5G-EA10","nas-eps.emm.5g_ea10",
8173 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
8174 NULL, HFILL }
8176 { &hf_nas_eps_emm_5g_ea11,
8177 { "5G-EA11","nas-eps.emm.5g_ea11",
8178 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
8179 NULL, HFILL }
8181 { &hf_nas_eps_emm_5g_ea12,
8182 { "5G-EA12","nas-eps.emm.5g_ea12",
8183 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
8184 NULL, HFILL }
8186 { &hf_nas_eps_emm_5g_ea13,
8187 { "5G-EA13","nas-eps.emm.5g_ea13",
8188 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
8189 NULL, HFILL }
8191 { &hf_nas_eps_emm_5g_ea14,
8192 { "5G-EA14","nas-eps.emm.5g_ea14",
8193 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
8194 NULL, HFILL }
8196 { &hf_nas_eps_emm_5g_ea15,
8197 { "5G-EA15","nas-eps.emm.5g_ea15",
8198 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
8199 NULL, HFILL }
8201 { &hf_nas_eps_emm_5g_ia0,
8202 { "5G-IA0","nas-eps.emm.5g_ia0",
8203 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
8204 NULL, HFILL }
8206 { &hf_nas_eps_emm_128_5g_ia1,
8207 { "128-5G-IA1","nas-eps.emm.128_5g_ia1",
8208 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
8209 NULL, HFILL }
8211 { &hf_nas_eps_emm_128_5g_ia2,
8212 { "128-5G-IA2","nas-eps.emm.128_5g_ia2",
8213 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
8214 NULL, HFILL }
8216 { &hf_nas_eps_emm_128_5g_ia3,
8217 { "128-5G-IA3","nas-eps.emm.128_5g_ia3",
8218 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
8219 NULL, HFILL }
8221 { &hf_nas_eps_emm_5g_ia4,
8222 { "5G-IA4","nas-eps.emm.5g_ia4",
8223 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
8224 NULL, HFILL }
8226 { &hf_nas_eps_emm_5g_ia5,
8227 { "5G-IA5","nas-eps.emm.5g_ia5",
8228 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
8229 NULL, HFILL }
8231 { &hf_nas_eps_emm_5g_ia6,
8232 { "5G-IA6","nas-eps.emm.5g_ia6",
8233 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
8234 NULL, HFILL }
8236 { &hf_nas_eps_emm_5g_ia7,
8237 { "5G-IA7","nas-eps.emm.5g_ia7",
8238 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
8239 NULL, HFILL }
8241 { &hf_nas_eps_emm_5g_ia8,
8242 { "5G-IA8","nas-eps.emm.5g_ia8",
8243 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
8244 NULL, HFILL }
8246 { &hf_nas_eps_emm_5g_ia9,
8247 { "5G-IA9","nas-eps.emm.5g_ia9",
8248 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
8249 NULL, HFILL }
8251 { &hf_nas_eps_emm_5g_ia10,
8252 { "5G-IA10","nas-eps.emm.5g_ia10",
8253 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
8254 NULL, HFILL }
8256 { &hf_nas_eps_emm_5g_ia11,
8257 { "5G-IA11","nas-eps.emm.5g_ia11",
8258 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
8259 NULL, HFILL }
8261 { &hf_nas_eps_emm_5g_ia12,
8262 { "5G-IA12","nas-eps.emm.5g_ia12",
8263 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
8264 NULL, HFILL }
8266 { &hf_nas_eps_emm_5g_ia13,
8267 { "5G-IA13","nas-eps.emm.5g_ia13",
8268 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
8269 NULL, HFILL }
8271 { &hf_nas_eps_emm_5g_ia14,
8272 { "5G-IA14","nas-eps.emm.5g_ia14",
8273 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
8274 NULL, HFILL }
8276 { &hf_nas_eps_emm_5g_ia15,
8277 { "5G-IA15","nas-eps.emm.5g_ia15",
8278 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
8279 NULL, HFILL }
8281 { &hf_nas_eps_emm_cipher_key,
8282 { "Ciphering keys for ciphered broadcast assistance data","nas-eps.emm.cipher_key",
8283 FT_BOOLEAN, 8, TFS(&tfs_requested_not_requested), 0x01,
8284 NULL, HFILL }
8286 { &hf_nas_eps_emm_ciph_key_data_ciphering_set_id,
8287 { "Ciphering set ID","nas-eps.emm.ciph_key_data.ciphering_set_id",
8288 FT_UINT16, BASE_DEC, NULL, 0x0,
8289 NULL, HFILL }
8291 { &hf_nas_eps_emm_ciph_key_data_ciphering_key,
8292 { "Ciphering key","nas-eps.emm.ciph_key_data.ciphering_key",
8293 FT_BYTES, BASE_NONE, NULL, 0x0,
8294 NULL, HFILL }
8296 { &hf_nas_eps_emm_ciph_key_data_c0_len,
8297 { "c0 length","nas-eps.emm.ciph_key_data.c0_len",
8298 FT_UINT8, BASE_DEC, NULL, 0x1f,
8299 NULL, HFILL }
8301 { &hf_nas_eps_emm_ciph_key_data_c0,
8302 { "c0","nas-eps.emm.ciph_key_data.c0",
8303 FT_BYTES, BASE_NONE, NULL, 0x0,
8304 NULL, HFILL }
8306 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_1,
8307 { "Ciphering data set for positioning SIB type 1-1","nas-eps.emm.ciph_key_data.pos_sib_type_1_1",
8308 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x80,
8309 NULL, HFILL }
8311 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_2,
8312 { "Ciphering data set for positioning SIB type 1-2","nas-eps.emm.ciph_key_data.pos_sib_type_1_2",
8313 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x40,
8314 NULL, HFILL }
8316 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_3,
8317 { "Ciphering data set for positioning SIB type 1-3","nas-eps.emm.ciph_key_data.pos_sib_type_1_3",
8318 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x20,
8319 NULL, HFILL }
8321 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_4,
8322 { "Ciphering data set for positioning SIB type 1-4","nas-eps.emm.ciph_key_data.pos_sib_type_1_4",
8323 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x10,
8324 NULL, HFILL }
8326 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_5,
8327 { "Ciphering data set for positioning SIB type 1-5","nas-eps.emm.ciph_key_data.pos_sib_type_1_5",
8328 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x08,
8329 NULL, HFILL }
8331 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_6,
8332 { "Ciphering data set for positioning SIB type 1-6","nas-eps.emm.ciph_key_data.pos_sib_type_1_6",
8333 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x04,
8334 NULL, HFILL }
8336 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_1_7,
8337 { "Ciphering data set for positioning SIB type 1-7","nas-eps.emm.ciph_key_data.pos_sib_type_1_7",
8338 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x02,
8339 NULL, HFILL }
8341 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_1,
8342 { "Ciphering data set for positioning SIB type 2-1","nas-eps.emm.ciph_key_data.pos_sib_type_2_1",
8343 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x01,
8344 NULL, HFILL }
8346 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_2,
8347 { "Ciphering data set for positioning SIB type 2-2","nas-eps.emm.ciph_key_data.pos_sib_type_2_2",
8348 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x80,
8349 NULL, HFILL }
8351 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_3,
8352 { "Ciphering data set for positioning SIB type 2-3","nas-eps.emm.ciph_key_data.pos_sib_type_2_3",
8353 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x40,
8354 NULL, HFILL }
8356 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_4,
8357 { "Ciphering data set for positioning SIB type 2-4","nas-eps.emm.ciph_key_data.pos_sib_type_2_4",
8358 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x20,
8359 NULL, HFILL }
8361 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_5,
8362 { "Ciphering data set for positioning SIB type 2-5","nas-eps.emm.ciph_key_data.pos_sib_type_2_5",
8363 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x10,
8364 NULL, HFILL }
8366 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_6,
8367 { "Ciphering data set for positioning SIB type 2-6","nas-eps.emm.ciph_key_data.pos_sib_type_2_6",
8368 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x08,
8369 NULL, HFILL }
8371 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_7,
8372 { "Ciphering data set for positioning SIB type 2-7","nas-eps.emm.ciph_key_data.pos_sib_type_2_7",
8373 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x04,
8374 NULL, HFILL }
8376 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_8,
8377 { "Ciphering data set for positioning SIB type 2-8","nas-eps.emm.ciph_key_data.pos_sib_type_2_8",
8378 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x02,
8379 NULL, HFILL }
8381 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_9,
8382 { "Ciphering data set for positioning SIB type 2-9","nas-eps.emm.ciph_key_data.pos_sib_type_2_9",
8383 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x01,
8384 NULL, HFILL }
8386 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_10,
8387 { "Ciphering data set for positioning SIB type 2-10","nas-eps.emm.ciph_key_data.pos_sib_type_2_10",
8388 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x80,
8389 NULL, HFILL }
8391 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_11,
8392 { "Ciphering data set for positioning SIB type 2-11","nas-eps.emm.ciph_key_data.pos_sib_type_2_11",
8393 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x40,
8394 NULL, HFILL }
8396 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_12,
8397 { "Ciphering data set for positioning SIB type 2-12","nas-eps.emm.ciph_key_data.pos_sib_type_2_12",
8398 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x20,
8399 NULL, HFILL }
8401 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_13,
8402 { "Ciphering data set for positioning SIB type 2-13","nas-eps.emm.ciph_key_data.pos_sib_type_2_13",
8403 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x10,
8404 NULL, HFILL }
8406 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_14,
8407 { "Ciphering data set for positioning SIB type 2-14","nas-eps.emm.ciph_key_data.pos_sib_type_2_14",
8408 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x08,
8409 NULL, HFILL }
8411 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_15,
8412 { "Ciphering data set for positioning SIB type 2-15","nas-eps.emm.ciph_key_data.pos_sib_type_2_15",
8413 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x04,
8414 NULL, HFILL }
8416 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_16,
8417 { "Ciphering data set for positioning SIB type 2-16","nas-eps.emm.ciph_key_data.pos_sib_type_2_16",
8418 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x02,
8419 NULL, HFILL }
8421 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_17,
8422 { "Ciphering data set for positioning SIB type 2-17","nas-eps.emm.ciph_key_data.pos_sib_type_2_17",
8423 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x01,
8424 NULL, HFILL }
8426 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_18,
8427 { "Ciphering data set for positioning SIB type 2-18","nas-eps.emm.ciph_key_data.pos_sib_type_2_18",
8428 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x80,
8429 NULL, HFILL }
8431 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_2_19,
8432 { "Ciphering data set for positioning SIB type 2-19","nas-eps.emm.ciph_key_data.pos_sib_type_2_19",
8433 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x40,
8434 NULL, HFILL }
8436 { &hf_nas_eps_emm_ciph_key_data_pos_sib_type_3_1,
8437 { "Ciphering data set for positioning SIB type 3-1","nas-eps.emm.ciph_key_data.pos_sib_type_3_1",
8438 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x20,
8439 NULL, HFILL }
8441 { &hf_nas_eps_emm_ciph_key_data_validity_start_time,
8442 { "Validity start time", "nas-eps.emm.ciph_key_data.validity_start_time",
8443 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0,
8444 NULL, HFILL }
8446 { &hf_nas_eps_emm_ciph_key_data_validity_duration,
8447 { "Validity duration", "nas-eps.emm.ciph_key_data.validity_duration",
8448 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_minute_minutes), 0x0,
8449 NULL, HFILL }
8451 { &hf_nas_eps_emm_ciph_key_data_tais_list_len,
8452 { "TAIs list length", "nas-eps.emm.ciph_key_data.tais_list_len",
8453 FT_UINT8, BASE_DEC, NULL, 0x0,
8454 NULL, HFILL }
8456 { &hf_nas_eps_emm_detach_req_UL,
8457 { "Uplink","nas-eps.emm.detach_req_ul",
8458 FT_NONE, BASE_NONE, NULL, 0x0,
8459 NULL, HFILL }
8461 { &hf_nas_eps_emm_detach_req_DL,
8462 { "Downlink","nas-eps.emm.detach_req_dl",
8463 FT_NONE, BASE_NONE, NULL, 0x0,
8464 NULL, HFILL }
8466 { &hf_nas_eps_emm_switch_off,
8467 { "Switch off","nas-eps.emm.switch_off",
8468 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_switch_off_vals), 0x0,
8469 NULL, HFILL }
8471 { &hf_nas_eps_emm_detach_type_UL,
8472 { "Detach Type","nas-eps.emm.detach_type_ul",
8473 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_detach_UL_vals), 0x0,
8474 NULL, HFILL }
8476 { &hf_nas_eps_emm_detach_type_DL,
8477 { "Detach Type","nas-eps.emm.detach_type_dl",
8478 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_detach_DL_vals), 0x0,
8479 NULL, HFILL }
8481 { &hf_nas_eps_esm_qci,
8482 { "Quality of Service Class Identifier (QCI)","nas-eps.esm.qci",
8483 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(nas_eps_qci_vals), 0x0,
8484 NULL, HFILL }
8486 { &hf_nas_eps_esm_mbr_ul,
8487 { "Maximum bit rate for uplink","nas-eps.esm.mbr_ul",
8488 FT_UINT8,BASE_DEC, NULL, 0x0,
8489 NULL, HFILL }
8491 { &hf_nas_eps_esm_mbr_dl,
8492 { "Maximum bit rate for downlink","nas-eps.esm.mbr_dl",
8493 FT_UINT8,BASE_DEC, NULL, 0x0,
8494 NULL, HFILL }
8496 { &hf_nas_eps_esm_gbr_ul,
8497 { "Guaranteed bit rate for uplink","nas-eps.esm.gbr_ul",
8498 FT_UINT8,BASE_DEC, NULL, 0x0,
8499 NULL, HFILL }
8501 { &hf_nas_eps_esm_gbr_dl,
8502 { "Guaranteed bit rate for downlink","nas-eps.esm.gbr_dl",
8503 FT_UINT8,BASE_DEC, NULL, 0x0,
8504 NULL, HFILL }
8506 { &hf_nas_eps_esm_embr_ul,
8507 { "Maximum bit rate for uplink(ext)","nas-eps.esm.embr_ul",
8508 FT_UINT8,BASE_DEC, NULL, 0x0,
8509 NULL, HFILL }
8511 { &hf_nas_eps_esm_embr_dl,
8512 { "Maximum bit rate for downlink(ext)","nas-eps.esm.embr_dl",
8513 FT_UINT8,BASE_DEC, NULL, 0x0,
8514 NULL, HFILL }
8516 { &hf_nas_eps_esm_egbr_ul,
8517 { "Guaranteed bit rate for uplink(ext)","nas-eps.esm.egbr_ul",
8518 FT_UINT8,BASE_DEC, NULL, 0x0,
8519 NULL, HFILL }
8521 { &hf_nas_eps_esm_egbr_dl,
8522 { "Guaranteed bit rate for downlink(ext)","nas-eps.esm.egbr_dl",
8523 FT_UINT8,BASE_DEC, NULL, 0x0,
8524 NULL, HFILL }
8526 { &hf_nas_eps_esm_cause,
8527 { "Cause","nas-eps.esm.cause",
8528 FT_UINT8,BASE_DEC|BASE_EXT_STRING, &nas_eps_esm_cause_vals_ext, 0x0,
8529 NULL, HFILL }
8531 { &hf_nas_eps_esm_eit,
8532 { "EIT (ESM information transfer)", "nas-eps.esm.eit",
8533 FT_BOOLEAN, 8, TFS(&nas_eps_emm_eit_vals), 0x01,
8534 NULL, HFILL }
8536 { &hf_nas_eps_esm_notif_ind,
8537 { "Notification indicator value","nas-eps.esm.notif_ind",
8538 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_notif_ind_vals), 0x0,
8539 NULL, HFILL }
8541 { &hf_nas_eps_esm_pdn_ipv4,
8542 {"PDN IPv4", "nas-eps.esm.pdn_ipv4",
8543 FT_IPv4, BASE_NONE, NULL, 0x0,
8544 NULL, HFILL}
8546 { &hf_nas_eps_esm_pdn_ipv6_if_id,
8547 {"PDN IPv6 if id", "nas-eps.esm.pdn_ipv6_if_id",
8548 FT_BYTES, BASE_NONE, NULL, 0x0,
8549 NULL, HFILL}
8551 { &hf_nas_eps_esm_eplmnc,
8552 { "EPLMNC", "nas-eps.esm.eplmnc",
8553 FT_BOOLEAN, 8, TFS(&nas_eps_esm_eplmnc_value), 0x02,
8554 NULL, HFILL }
8556 { &hf_nas_eps_esm_ratc,
8557 { "RATC", "nas-eps.esm.ratc",
8558 FT_BOOLEAN, 8, TFS(&nas_eps_esm_ratc_value), 0x01,
8559 NULL, HFILL }
8561 { &hf_nas_eps_esm_linked_bearer_id,
8562 { "Linked EPS bearer identity","nas-eps.esm.linked_bearer_id",
8563 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_linked_bearer_id_vals), 0x0,
8564 NULL, HFILL }
8566 { &hf_nas_eps_esm_nbifom_cont,
8567 { "NBIFOM container content","nas-eps.esm.nbifom_cont",
8568 FT_BYTES, BASE_NONE, NULL, 0x0,
8569 NULL, HFILL }
8571 { &hf_nas_eps_esm_remote_ue_context_list_nb_ue_contexts,
8572 { "Number of remote UE contexts","nas-eps.esm.remote_ue_context_list.nb_ue_contexts",
8573 FT_UINT8, BASE_DEC, NULL, 0x0,
8574 NULL, HFILL }
8576 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_len,
8577 { "Length of remote UE context","nas-eps.esm.remote_ue_context_list.ue_context.len",
8578 FT_UINT8, BASE_DEC, NULL, 0x0,
8579 NULL, HFILL }
8581 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_nb_user_id,
8582 { "Number of user identities","nas-eps.esm.remote_ue_context_list.ue_context.nb_user_id",
8583 FT_UINT8, BASE_DEC, NULL, 0x0,
8584 NULL, HFILL }
8586 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_user_id_len,
8587 { "Length of user identity","nas-eps.esm.remote_ue_context_list.ue_context.user_id_len",
8588 FT_UINT8, BASE_DEC, NULL, 0x0,
8589 NULL, HFILL }
8591 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_odd_even_indic,
8592 { "Odd/even indication","nas-eps.esm.remote_ue_context_list.ue_context.odd_even_indic",
8593 FT_BOOLEAN, 8, TFS(&nas_eps_odd_even_value), 0x08,
8594 NULL, HFILL }
8596 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_user_id_type,
8597 { "Type of user identity","nas-eps.esm.remote_ue_context_list.ue_context.user_id_type",
8598 FT_UINT8, BASE_DEC, VALS(nas_eps_esm_user_info_type_values), 0x07,
8599 NULL, HFILL }
8601 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_encr_imsi,
8602 { "Encrypted IMSI", "nas-eps.esm.remote_ue_context_list.ue_context.encr_imsi",
8603 FT_BYTES, BASE_NONE, NULL, 0x0,
8604 NULL, HFILL }
8606 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_msisdn,
8607 { "MSISDN", "nas-eps.esm.remote_ue_context_list.ue_context.msisdn",
8608 FT_STRING, BASE_NONE, NULL, 0x0,
8609 NULL, HFILL }
8611 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_imei,
8612 { "IMEI", "nas-eps.esm.remote_ue_context_list.ue_context.imei",
8613 FT_STRING, BASE_NONE, NULL, 0x0,
8614 NULL, HFILL }
8616 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_imeisv,
8617 { "IMEISV", "nas-eps.esm.remote_ue_context_list.ue_context.imeisv",
8618 FT_STRING, BASE_NONE, NULL, 0x0,
8619 NULL, HFILL }
8621 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_upri4,
8622 { "UDP port range for IPv4 indicator","nas-eps.esm.remote_ue_context_list.ue_context.upri4",
8623 FT_BOOLEAN, 8, TFS(&tfs_present_absent), 0x10,
8624 NULL, HFILL }
8626 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_tpri4i,
8627 { "TCP port range for IPv4 indicator","nas-eps.esm.remote_ue_context_list.ue_context.tpri4i",
8628 FT_BOOLEAN, 8, TFS(&tfs_present_absent), 0x08,
8629 NULL, HFILL }
8631 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_address_type,
8632 { "Address type","nas-eps.esm.remote_ue_context_list.ue_context.address_type",
8633 FT_UINT8, BASE_DEC, VALS(nas_eps_esm_address_type_values), 0x07,
8634 NULL, HFILL }
8636 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv4,
8637 { "IPv4 address","nas-eps.esm.remote_ue_context_list.ue_context.ipv4",
8638 FT_IPv4, BASE_NONE, NULL, 0x0,
8639 NULL, HFILL }
8641 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_port_number,
8642 { "Port number","nas-eps.esm.remote_ue_context_list.ue_context.port_number",
8643 FT_UINT16, BASE_DEC, NULL, 0x0,
8644 NULL, HFILL }
8646 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv6_prefix,
8647 { "IPv6 prefix","nas-eps.esm.remote_ue_context_list.ue_context.ipv6_prefix",
8648 FT_IPv6, BASE_NONE, NULL, 0x0,
8649 NULL, HFILL }
8651 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv4_udp_port_low,
8652 { "IPv4 UDP port low","nas-eps.esm.remote_ue_context_list.ue_context.ipv4_udp_port_low",
8653 FT_UINT16, BASE_DEC, NULL, 0x0,
8654 NULL, HFILL }
8656 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv4_udp_port_high,
8657 { "IPv4 UDP port high","nas-eps.esm.remote_ue_context_list.ue_context.ipv4_udp_port_high",
8658 FT_UINT16, BASE_DEC, NULL, 0x0,
8659 NULL, HFILL }
8661 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv4_tcp_port_low,
8662 { "IPv4 TCP port low","nas-eps.esm.remote_ue_context_list.ue_context.ipv4_tcp_port_low",
8663 FT_UINT16, BASE_DEC, NULL, 0x0,
8664 NULL, HFILL }
8666 { &hf_nas_eps_esm_remote_ue_context_list_ue_context_ipv4_tcp_port_high,
8667 { "IPv4 TCP port high","nas-eps.esm.remote_ue_context_list.ue_context.ipv4_tcp_port_high",
8668 FT_UINT16, BASE_DEC, NULL, 0x0,
8669 NULL, HFILL }
8671 { &hf_nas_eps_esm_pkmf_address_type,
8672 { "Address type","nas-eps.esm.pkmf.address_type",
8673 FT_UINT8, BASE_DEC, VALS(nas_eps_esm_pkmf_address_type_values), 0x07,
8674 NULL, HFILL }
8676 { &hf_nas_eps_esm_pkmf_ipv4,
8677 { "IPv4 address","nas-eps.esm.pkmf.ipv4",
8678 FT_IPv4, BASE_NONE, NULL, 0x0,
8679 NULL, HFILL }
8681 { &hf_nas_eps_esm_pkmf_ipv6,
8682 { "IPv6 address","nas-eps.esm.pkmf.ipv6",
8683 FT_IPv6, BASE_NONE, NULL, 0x0,
8684 NULL, HFILL }
8686 { &hf_nas_eps_esm_hdr_comp_config_prof_0104,
8687 { "RoHC profile 0x0104 (IP)", "nas-eps.esm.hdr_comp_config.prof_0104",
8688 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
8689 NULL, HFILL }
8691 { &hf_nas_eps_esm_hdr_comp_config_prof_0103,
8692 { "RoHC profile 0x0103 (ESP/IP)", "nas-eps.esm.hdr_comp_config.prof_0103",
8693 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
8694 NULL, HFILL }
8696 { &hf_nas_eps_esm_hdr_comp_config_prof_0102,
8697 { "RoHC profile 0x0102 (UDP/IP)", "nas-eps.esm.hdr_comp_config.prof_0102",
8698 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
8699 NULL, HFILL }
8701 { &hf_nas_eps_esm_hdr_comp_config_prof_0006,
8702 { "RoHC profile 0x0006 (TCP/IP)", "nas-eps.esm.hdr_comp_config.prof_0006",
8703 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
8704 NULL, HFILL }
8706 { &hf_nas_eps_esm_hdr_comp_config_prof_0004,
8707 { "RoHC profile 0x0004 (IP)", "nas-eps.esm.hdr_comp_config.prof_0004",
8708 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
8709 NULL, HFILL }
8711 { &hf_nas_eps_esm_hdr_comp_config_prof_0003,
8712 { "RoHC profile 0x0003 (ESP/IP)", "nas-eps.esm.hdr_comp_config.prof_0003",
8713 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
8714 NULL, HFILL }
8716 { &hf_nas_eps_esm_hdr_comp_config_prof_0002,
8717 { "RoHC profile 0x0002 (UDP/IP)", "nas-eps.esm.hdr_comp_config.prof_0002",
8718 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
8719 NULL, HFILL }
8721 { &hf_nas_eps_esm_hdr_compr_config_max_cid,
8722 { "MAX_CID", "nas-eps.esm.hdr_comp_config.max_cid",
8723 FT_UINT16, BASE_DEC, NULL, 0x0,
8724 NULL, HFILL }
8726 { &hf_nas_eps_esm_hdr_compr_config_add_hdr_compr_cxt_setup_params_type,
8727 { "Additional header compression context setup parameters type", "nas-eps.esm.hdr_comp_config.add_hdr_compr_cxt_setup_params_type",
8728 FT_UINT8, BASE_HEX, VALS(nas_eps_esm_add_hdr_compr_cxt_setup_params_type_vals), 0x0,
8729 NULL, HFILL }
8731 { &hf_nas_eps_esm_hdr_compr_config_add_hdr_compr_cxt_setup_params_cont,
8732 { "Additional header compression context setup parameters container", "nas-eps.esm.hdr_comp_config.add_hdr_compr_cxt_setup_params_cont",
8733 FT_BYTES, BASE_NONE, NULL, 0x0,
8734 NULL, HFILL }
8736 { &hf_nas_eps_esm_ctrl_plane_only_ind_cpoi,
8737 { "CPOI", "nas-eps.esm.ctrl_plane_only_ind.cpoi",
8738 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_ctrl_plane_only_ind_cpoi_value), 0x0,
8739 NULL, HFILL }
8741 { &hf_nas_eps_esm_user_data_cont,
8742 { "User data contents", "nas-eps.esm.user_data_cont",
8743 FT_BYTES, BASE_NONE, NULL, 0x0,
8744 NULL, HFILL }
8746 { &hf_nas_eps_esm_rel_assist_ind_ddx,
8747 { "Downlink data expected","nas-eps.esm.rel_assist_ind.ddx",
8748 FT_UINT8, BASE_DEC, VALS(nas_eps_esm_rel_assist_ind_ddx_vals), 0x0,
8749 NULL, HFILL }
8751 { &hf_nas_eps_esm_hdr_compr_config_status_ebi7,
8752 { "EBI(7)", "nas-eps.esm.hdr_compr_config_status.ebi7",
8753 FT_BOOLEAN, 16, TFS(&nas_eps_esm_hdr_compr_config_status_ebi_value), 0x8000,
8754 NULL, HFILL }
8756 { &hf_nas_eps_esm_hdr_compr_config_status_ebi6,
8757 { "EBI(6)", "nas-eps.esm.hdr_compr_config_status.ebi6",
8758 FT_BOOLEAN, 16, TFS(&nas_eps_esm_hdr_compr_config_status_ebi_value), 0x4000,
8759 NULL, HFILL }
8761 { &hf_nas_eps_esm_hdr_compr_config_status_ebi5,
8762 { "EBI(5)", "nas-eps.esm.hdr_compr_config_status.ebi5",
8763 FT_BOOLEAN, 16, TFS(&nas_eps_esm_hdr_compr_config_status_ebi_value), 0x2000,
8764 NULL, HFILL }
8766 { &hf_nas_eps_esm_hdr_compr_config_status_ebi4,
8767 { "EBI(4)", "nas-eps.esm.hdr_compr_config_status.ebi4",
8768 FT_BOOLEAN, 16, TFS(&nas_eps_esm_hdr_compr_config_status_ebi_value), 0x1000,
8769 NULL, HFILL }
8771 { &hf_nas_eps_esm_hdr_compr_config_status_ebi3,
8772 { "EBI(3)", "nas-eps.esm.hdr_compr_config_status.ebi3",
8773 FT_BOOLEAN, 16, TFS(&nas_eps_esm_hdr_compr_config_status_ebi_value), 0x0800,
8774 NULL, HFILL }
8776 { &hf_nas_eps_esm_hdr_compr_config_status_ebi2,
8777 { "EBI(2)", "nas-eps.esm.hdr_compr_config_status.ebi2",
8778 FT_BOOLEAN, 16, TFS(&nas_eps_esm_hdr_compr_config_status_ebi_value), 0x0400,
8779 NULL, HFILL }
8781 { &hf_nas_eps_esm_hdr_compr_config_status_ebi1,
8782 { "EBI(1)", "nas-eps.esm.hdr_compr_config_status.ebi1",
8783 FT_BOOLEAN, 16, TFS(&nas_eps_esm_hdr_compr_config_status_ebi_value), 0x0200,
8784 NULL, HFILL }
8786 { &hf_nas_eps_esm_spare_bits0x0100,
8787 { "Spare bit(s)", "nas-eps.spare_bits",
8788 FT_UINT16, BASE_HEX, NULL, 0x0100,
8789 NULL, HFILL }
8791 { &hf_nas_eps_esm_hdr_compr_config_status_ebi15,
8792 { "EBI(15)", "nas-eps.esm.hdr_compr_config_status.ebi15",
8793 FT_BOOLEAN, 16, TFS(&nas_eps_esm_hdr_compr_config_status_ebi_value), 0x0080,
8794 NULL, HFILL }
8796 { &hf_nas_eps_esm_hdr_compr_config_status_ebi14,
8797 { "EBI(14)", "nas-eps.esm.hdr_compr_config_status.ebi14",
8798 FT_BOOLEAN, 16, TFS(&nas_eps_esm_hdr_compr_config_status_ebi_value), 0x0040,
8799 NULL, HFILL }
8801 { &hf_nas_eps_esm_hdr_compr_config_status_ebi13,
8802 { "EBI(13)", "nas-eps.esm.hdr_compr_config_status.ebi13",
8803 FT_BOOLEAN, 16, TFS(&nas_eps_esm_hdr_compr_config_status_ebi_value), 0x0020,
8804 NULL, HFILL }
8806 { &hf_nas_eps_esm_hdr_compr_config_status_ebi12,
8807 { "EBI(12)", "nas-eps.esm.hdr_compr_config_status.ebi12",
8808 FT_BOOLEAN, 16, TFS(&nas_eps_esm_hdr_compr_config_status_ebi_value), 0x0010,
8809 NULL, HFILL }
8811 { &hf_nas_eps_esm_hdr_compr_config_status_ebi11,
8812 { "EBI(11)", "nas-eps.esm.hdr_compr_config_status.ebi11",
8813 FT_BOOLEAN, 16, TFS(&nas_eps_esm_hdr_compr_config_status_ebi_value), 0x0008,
8814 NULL, HFILL }
8816 { &hf_nas_eps_esm_hdr_compr_config_status_ebi10,
8817 { "EBI(10)", "nas-eps.esm.hdr_compr_config_status.ebi10",
8818 FT_BOOLEAN, 16, TFS(&nas_eps_esm_hdr_compr_config_status_ebi_value), 0x0004,
8819 NULL, HFILL }
8821 { &hf_nas_eps_esm_hdr_compr_config_status_ebi9,
8822 { "EBI(9)", "nas-eps.esm.hdr_compr_config_status.ebi9",
8823 FT_BOOLEAN, 16, TFS(&nas_eps_esm_hdr_compr_config_status_ebi_value), 0x0002,
8824 NULL, HFILL }
8826 { &hf_nas_eps_esm_hdr_compr_config_status_ebi8,
8827 { "EBI(8)", "nas-eps.esm.hdr_compr_config_status.ebi8",
8828 FT_BOOLEAN, 16, TFS(&nas_eps_esm_hdr_compr_config_status_ebi_value), 0x0001,
8829 NULL, HFILL }
8831 { &hf_nas_eps_esm_serv_plmn_rate_ctrl_val,
8832 { "Serving PLMN rate control value", "nas-eps.esm.serv_plmn_rate_ctrl_val",
8833 FT_UINT16, BASE_DEC, NULL, 0x0,
8834 NULL, HFILL }
8836 { &hf_nas_eps_esm_ext_apn_ambr_dl_unit,
8837 { "Unit for extended APN-AMBR for downlink", "nas-eps.esm.ext_apn_ambr_dl_unit",
8838 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(nas_eps_ext_apn_ambr_unit_vals), 0x0,
8839 NULL, HFILL }
8841 { &hf_nas_eps_esm_ext_apn_ambr_dl,
8842 { "Extended APN-AMBR for downlink", "nas-eps.esm.ext_apn_ambr_dl",
8843 FT_UINT16, BASE_DEC, NULL, 0x0,
8844 NULL, HFILL }
8846 { &hf_nas_eps_esm_ext_apn_ambr_ul_unit,
8847 { "Unit for extended APN-AMBR for uplink", "nas-eps.esm.ext_apn_ambr_ul_unit",
8848 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(nas_eps_ext_apn_ambr_unit_vals), 0x0,
8849 NULL, HFILL }
8851 { &hf_nas_eps_esm_ext_apn_ambr_ul,
8852 { "Extended APN-AMBR for uplink", "nas-eps.esm.ext_apn_ambr_ul",
8853 FT_UINT16, BASE_DEC, NULL, 0x0,
8854 NULL, HFILL }
8856 { &hf_nas_eps_esm_ext_mbr_unit,
8857 { "Unit for maximum bit rate", "nas-eps.esm.ext_mbr_unit",
8858 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(nas_eps_ext_eps_qos_unit_vals), 0x0,
8859 NULL, HFILL }
8861 { &hf_nas_eps_esm_ext_mbr_ul,
8862 { "Maximum bit rate for uplink", "nas-eps.esm.ext_mbr_ul",
8863 FT_UINT16, BASE_DEC, NULL, 0x0,
8864 NULL, HFILL }
8866 { &hf_nas_eps_esm_ext_mbr_dl,
8867 { "Maximum bit rate for downlink", "nas-eps.esm.ext_mbr_dl",
8868 FT_UINT16, BASE_DEC, NULL, 0x0,
8869 NULL, HFILL }
8871 { &hf_nas_eps_esm_ext_gbr_unit,
8872 { "Unit for guaranteed bit rate", "nas-eps.esm.ext_gbr_unit",
8873 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(nas_eps_ext_eps_qos_unit_vals), 0x0,
8874 NULL, HFILL }
8876 { &hf_nas_eps_esm_ext_gbr_ul,
8877 { "Guaranteed bit rate for uplink", "nas-eps.esm.ext_gbr_ul",
8878 FT_UINT16, BASE_DEC, NULL, 0x0,
8879 NULL, HFILL }
8881 { &hf_nas_eps_esm_ext_gbr_dl,
8882 { "Guaranteed bit rate for downlink", "nas-eps.esm.ext_gbr_dl",
8883 FT_UINT16, BASE_DEC, NULL, 0x0,
8884 NULL, HFILL }
8886 { &hf_nas_eps_active_flg,
8887 { "Active flag", "nas-eps.emm.active_flg",
8888 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_active_flg_value), 0x0,
8889 NULL, HFILL }
8891 { &hf_nas_eps_ctrl_plane_serv_type,
8892 { "Control plane service type", "nas-eps.emm.ctrl_plane_serv_type",
8893 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_data_serv_type_vals), 0x0,
8894 NULL, HFILL }
8896 { &hf_nas_eps_eps_update_result_value,
8897 { "EPS update result value","nas-eps.emm.eps_update_result_value",
8898 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_update_result_vals), 0x0,
8899 NULL, HFILL }
8901 { &hf_nas_eps_eps_update_type_value,
8902 { "EPS update type value", "nas-eps.emm.update_type_value",
8903 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_update_type_vals), 0x0,
8904 NULL, HFILL }
8906 { &hf_nas_eps_service_type,
8907 { "Service type", "nas-eps.emm.service_type",
8908 FT_UINT8,BASE_DEC|BASE_RANGE_STRING, RVALS(nas_eps_service_type_vals), 0x0,
8909 NULL, HFILL }
8911 { &hf_nas_eps_nas_msg_cont,
8912 { "NAS message container content", "nas-eps.emm.nas_msg_cont",
8913 FT_BYTES, BASE_NONE, NULL, 0x0,
8914 NULL, HFILL }
8916 { &hf_nas_eps_gen_msg_cont,
8917 { "Generic message container content", "nas-eps.emm.gen_msg_cont",
8918 FT_BYTES, BASE_NONE, NULL, 0x0,
8919 NULL, HFILL }
8921 { &hf_nas_eps_cmn_add_info,
8922 { "Additional information content", "nas-eps.cmn.add_info",
8923 FT_BYTES, BASE_NONE, NULL, 0x0,
8924 NULL, HFILL }
8926 /* ESM hf cvariables */
8927 { &hf_nas_eps_msg_esm_type,
8928 { "NAS EPS session management messages", "nas-eps.nas_msg_esm_type",
8929 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &nas_msg_esm_strings_ext, 0x0,
8930 NULL, HFILL }
8932 { &hf_nas_eps_esm_elem_id,
8933 { "Element ID", "nas-eps.esm.elem_id",
8934 FT_UINT8, BASE_HEX, NULL, 0,
8935 NULL, HFILL }
8937 { &hf_nas_eps_esm_proc_trans_id,
8938 { "Procedure transaction identity", "nas-eps.esm.proc_trans_id",
8939 FT_UINT8, BASE_DEC, NULL, 0,
8940 NULL, HFILL }
8942 { &hf_nas_eps_esm_pdn_type,
8943 { "PDN type", "nas-eps.esm_pdn_type",
8944 FT_UINT8, BASE_DEC, VALS(nas_eps_esm_pdn_type_values), 0x0,
8945 NULL, HFILL }
8947 { &hf_nas_eps_esm_request_type,
8948 { "Request type", "nas-eps.esm_request_type",
8949 FT_UINT8, BASE_DEC, VALS(nas_eps_esm_request_type_values), 0x0,
8950 NULL, HFILL }
8952 { &hf_nas_eps_emm_5g_ehc_cp_ciot,
8953 { "Ethernet header compression for control plane CIoT 5GS optimization", "nas-eps.emm.5g_ehc_cp_ciot",
8954 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
8955 NULL, HFILL }
8957 { &hf_nas_eps_emm_5gs_pnb_ciot,
8958 { "5GS Preferred CIoT network behaviour", "nas-eps.emm.5gs_pnb_ciot",
8959 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_5gs_pnb_ciot_vals), 0x30,
8960 NULL, HFILL }
8962 { &hf_nas_eps_emm_5g_up_ciot,
8963 { "User plane CIoT 5GS optimization", "nas-eps.emm.5g_up_ciot",
8964 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
8965 NULL, HFILL }
8967 { &hf_nas_eps_emm_5g_hc_cp_ciot,
8968 { "Header compression for control plane CIoT 5GS optimization", "nas-eps.emm.5g_hc_cp_ciot",
8969 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
8970 NULL, HFILL }
8972 { &hf_nas_eps_emm_n3_data,
8973 { "N3 data transfer", "nas-eps.emm.n3_data",
8974 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
8975 NULL, HFILL }
8977 { &hf_nas_eps_emm_5g_cp_ciot,
8978 { "Control plane CIoT 5GS optimization", "nas-eps.emm.5g_cp_ciot",
8979 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
8980 NULL, HFILL }
8982 { &hf_nas_eps_emm_ue_radio_cap_id_available,
8983 { "UE radio capability ID availability", "nas-eps.emm.ue_radio_cap_id_available",
8984 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_ue_radio_cap_id_avail_vals), 0x07,
8985 NULL, HFILL }
8987 { &hf_nas_eps_emm_ue_radio_cap_id_request,
8988 { "UE radio capability ID request", "nas-eps.emm.ue_radio_cap_id_request",
8989 FT_BOOLEAN, 8, TFS(&tfs_requested_not_requested), 0x01,
8990 NULL, HFILL }
8992 { &hf_nas_eps_emm_wus_assist_info_type,
8993 { "Type", "nas-eps.emm.wus_assist_info.type",
8994 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_wus_assist_info_type_vals), 0xe0,
8995 NULL, HFILL }
8997 { &hf_nas_eps_emm_wus_assist_info_ue_paging_prob,
8998 { "UE paging probability information", "nas-eps.emm.wus_assist_info.ue_paging_probability",
8999 FT_UINT8, BASE_CUSTOM, CF_FUNC(de_emm_wus_assist_info_ue_paging_prob_fmt), 0x1f,
9000 NULL, HFILL }
9002 { &hf_nas_eps_emm_nb_s1_drx_param,
9003 { "DRX value", "nas-eps.emm.nb_s1_drx_param",
9004 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_nb_s1_drx_params_vals), 0x0f,
9005 NULL, HFILL }
9007 { &hf_nas_eps_emm_imsi_offset,
9008 { "IMSI offset", "nas-eps.emm.imsi_offset",
9009 FT_UINT16, BASE_DEC, NULL, 0x0,
9010 NULL, HFILL }
9012 { &hf_nas_eps_emm_ue_request_type,
9013 { "UE request type", "nas-eps.emm.ue_request_type",
9014 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_ue_request_type_vals), 0x0,
9015 NULL, HFILL }
9017 { &hf_nas_eps_emm_paging_restriction_type,
9018 { "Paging restriction type", "nas-eps.emm.paging_restriction.type",
9019 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_paging_restriction_type_vals), 0x0,
9020 NULL, HFILL }
9022 { &hf_nas_eps_emm_paging_restriction_ebi7,
9023 { "EBI(7)", "nas-eps.emm.paging_restriction.ebi7",
9024 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x8000,
9025 NULL, HFILL }
9027 { &hf_nas_eps_emm_paging_restriction_ebi6,
9028 { "EBI(6)", "nas-eps.emm.paging_restriction.ebi6",
9029 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x4000,
9030 NULL, HFILL }
9032 { &hf_nas_eps_emm_paging_restriction_ebi5,
9033 { "EBI(5)", "nas-eps.emm.paging_restriction.ebi5",
9034 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x2000,
9035 NULL, HFILL }
9037 { &hf_nas_eps_emm_paging_restriction_ebi4,
9038 { "EBI(4)", "nas-eps.emm.paging_restriction.ebi4",
9039 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x1000,
9040 NULL, HFILL }
9042 { &hf_nas_eps_emm_paging_restriction_ebi3,
9043 { "EBI(3)", "nas-eps.emm.paging_restriction.ebi3",
9044 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x0800,
9045 NULL, HFILL }
9047 { &hf_nas_eps_emm_paging_restriction_ebi2,
9048 { "EBI(2)", "nas-eps.emm.paging_restriction.ebi2",
9049 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x0400,
9050 NULL, HFILL }
9052 { &hf_nas_eps_emm_paging_restriction_ebi1,
9053 { "EBI(1)", "nas-eps.emm.paging_restriction.ebi1",
9054 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x0200,
9055 NULL, HFILL }
9057 { &hf_nas_eps_emm_paging_restriction_ebi0,
9058 { "EBI(0)", "nas-eps.emm.paging_restriction.ebi0",
9059 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x0100,
9060 NULL, HFILL }
9062 { &hf_nas_eps_emm_paging_restriction_ebi15,
9063 { "EBI(15)", "nas-eps.emm.paging_restriction.ebi15",
9064 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x0080,
9065 NULL, HFILL }
9067 { &hf_nas_eps_emm_paging_restriction_ebi14,
9068 { "EBI(14)", "nas-eps.emm.paging_restriction.ebi14",
9069 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x0040,
9070 NULL, HFILL }
9072 { &hf_nas_eps_emm_paging_restriction_ebi13,
9073 { "EBI(13)", "nas-eps.emm.paging_restriction.ebi13",
9074 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x0020,
9075 NULL, HFILL }
9077 { &hf_nas_eps_emm_paging_restriction_ebi12,
9078 { "EBI(12)", "nas-eps.emm.paging_restriction.ebi12",
9079 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x0010,
9080 NULL, HFILL }
9082 { &hf_nas_eps_emm_paging_restriction_ebi11,
9083 { "EBI(11)", "nas-eps.emm.paging_restriction.ebi11",
9084 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x0008,
9085 NULL, HFILL }
9087 { &hf_nas_eps_emm_paging_restriction_ebi10,
9088 { "EBI(10)", "nas-eps.emm.paging_restriction.ebi10",
9089 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x0004,
9090 NULL, HFILL }
9092 { &hf_nas_eps_emm_paging_restriction_ebi9,
9093 { "EBI(9)", "nas-eps.emm.paging_restriction.ebi9",
9094 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x0002,
9095 NULL, HFILL }
9097 { &hf_nas_eps_emm_paging_restriction_ebi8,
9098 { "EBI(8)", "nas-eps.emm.paging_restriction.ebi8",
9099 FT_BOOLEAN, 16, TFS(&tfs_not_restricted_restricted), 0x0001,
9100 NULL, HFILL }
9102 { &hf_nas_eps_emm_paging_restriction_decision,
9103 { "Paging restriction decision", "nas-eps.emm.paging_restriction.decision",
9104 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_eps_add_req_result_vals), 0x0,
9105 NULL, HFILL }
9107 { &hf_nas_eps_emm_unavail_info_suppi,
9108 { "Start of unavailability period presence indication", "nas-eps.emm.unavailability_info.suppi",
9109 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
9110 NULL, HFILL }
9112 { &hf_nas_eps_emm_unavail_info_updpi,
9113 { "Unavailability period duration presence indication", "nas-eps.emm.unavailability_info.updpi",
9114 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
9115 NULL, HFILL }
9117 { &hf_nas_eps_emm_unavail_info_type,
9118 { "Unavailability type", "nas-eps.emm.unavailability_info.type",
9119 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_unavail_info_type), 0x07,
9120 NULL, HFILL }
9122 { &hf_nas_eps_emm_unavail_info_unavail_period_duration,
9123 { "Unavailability period duration", "nas-eps.emm.unavailability_info.unavailability_period_duration",
9124 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_seconds), 0x0,
9125 NULL, HFILL }
9127 { &hf_nas_eps_emm_unavail_info_start_unavail_period,
9128 { "Start of unavailability period", "nas-eps.emm.unavailability_info.start_unavailability_period",
9129 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_seconds), 0x0,
9130 NULL, HFILL }
9132 { &hf_nas_eps_emm_unavail_config_suppi,
9133 { "Start of unavailability period presence indication", "nas-eps.emm.unavailability_config.suppi",
9134 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
9135 NULL, HFILL }
9137 { &hf_nas_eps_emm_unavail_config_updpi,
9138 { "Unavailability period duration presence indication", "nas-eps.emm.unavailability_config.updpi",
9139 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
9140 NULL, HFILL }
9142 { &hf_nas_eps_emm_unavail_config_eupr,
9143 { "End of unavailability period report", "nas-eps.emm.unavailability_config.eupr",
9144 FT_BOOLEAN, 8, TFS(&nas_eps_emm_unavail_config_eupr_flg), 0x01,
9145 NULL, HFILL }
9147 { &hf_nas_eps_emm_unavail_config_unavail_period_duration,
9148 { "Unavailability period duration", "nas-eps.emm.unavailability_config.unavailability_period_duration",
9149 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_seconds), 0x0,
9150 NULL, HFILL }
9152 { &hf_nas_eps_emm_unavail_config_start_unavail_period,
9153 { "Start of unavailability period", "nas-eps.emm.unavailability_config.start_unavailability_period",
9154 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_seconds), 0x0,
9155 NULL, HFILL }
9157 { &hf_nas_eps_emm_ue_info_req_uclir,
9158 { "UE coarse location information request", "nas-eps.emm.ue_info_request.uclir",
9159 FT_BOOLEAN, 8, TFS(&tfs_requested_not_requested), 0x01,
9160 NULL, HFILL }
9164 static ei_register_info ei[] = {
9165 { &ei_nas_eps_extraneous_data, { "nas-eps.extraneous_data", PI_PROTOCOL, PI_NOTE, "Extraneous Data, dissector bug or later version spec(report to wireshark.org)", EXPFILL }},
9166 { &ei_nas_eps_unknown_identity, { "nas-eps.emm.unknown_identity", PI_PROTOCOL, PI_WARN, "Type of identity not known", EXPFILL }},
9167 { &ei_nas_eps_unknown_type_of_list, { "nas-eps.emm.tai_unknown_list_type", PI_PROTOCOL, PI_WARN, "Unknown type of list", EXPFILL }},
9168 { &ei_nas_eps_wrong_nb_of_elems, { "nas-eps.emm.tai_wrong_number_of_elems", PI_PROTOCOL, PI_ERROR, "[Wrong number of elements?]", EXPFILL }},
9169 { &ei_nas_eps_unknown_msg_type, { "nas-eps.unknown_msg_type", PI_PROTOCOL, PI_WARN, "Unknown Message Type", EXPFILL }},
9170 { &ei_nas_eps_unknown_pd, { "nas-eps.unknown_pd", PI_PROTOCOL, PI_ERROR, "Unknown protocol discriminator", EXPFILL }},
9171 { &ei_nas_eps_esm_tp_not_integ_prot, { "nas-eps.esm_tp_not_integrity_protected", PI_PROTOCOL, PI_ERROR, "All ESM / Test Procedures messages should be integrity protected", EXPFILL }},
9172 { &ei_nas_eps_sec_hdr_wrong_pd, { "nas-eps.sec_hdr_wrong_pd", PI_PROTOCOL, PI_ERROR, "A security header should use EMM protocol discriminator", EXPFILL }},
9173 { &ei_nas_eps_missing_mandatory_elemen, { "nas-eps.missing_mandatory_element", PI_PROTOCOL, PI_ERROR, "Missing Mandatory element, rest of dissection is suspect", EXPFILL }},
9176 expert_module_t* expert_nas_eps;
9178 /* Setup protocol subtree array */
9179 #define NUM_INDIVIDUAL_ELEMS 11
9180 int *ett[NUM_INDIVIDUAL_ELEMS +
9181 NUM_NAS_EPS_COMMON_ELEM +
9182 NUM_NAS_MSG_EMM + NUM_NAS_EMM_ELEM+
9183 NUM_NAS_MSG_ESM + NUM_NAS_ESM_ELEM];
9185 ett[0] = &ett_nas_eps;
9186 ett[1] = &ett_nas_eps_esm_msg_cont;
9187 ett[2] = &ett_nas_eps_nas_msg_cont;
9188 ett[3] = &ett_nas_eps_gen_msg_cont;
9189 ett[4] = &ett_nas_eps_cmn_add_info;
9190 ett[5] = &ett_nas_eps_remote_ue_context;
9191 ett[6] = &ett_nas_eps_esm_user_data_cont;
9192 ett[7] = &ett_nas_eps_replayed_nas_msg_cont;
9193 ett[8] = &ett_nas_eps_ext_emerg_num;
9194 ett[9] = &ett_nas_eps_ciph_data_set;
9195 ett[10] = &ett_nas_eps_wus_assist_info_type;
9197 last_offset = NUM_INDIVIDUAL_ELEMS;
9199 for (i=0; i < NUM_NAS_EPS_COMMON_ELEM; i++, last_offset++)
9201 ett[last_offset] = &ett_nas_eps_common_elem[i];
9204 /* EMM */
9205 for (i=0; i < NUM_NAS_MSG_EMM; i++, last_offset++)
9207 ett[last_offset] = &ett_nas_msg_emm[i];
9210 for (i=0; i < NUM_NAS_EMM_ELEM; i++, last_offset++)
9212 ett[last_offset] = &ett_nas_eps_emm_elem[i];
9214 /* EPS */
9215 for (i=0; i < NUM_NAS_MSG_ESM; i++, last_offset++)
9217 ett[last_offset] = &ett_nas_msg_esm[i];
9220 for (i=0; i < NUM_NAS_ESM_ELEM; i++, last_offset++)
9222 ett[last_offset] = &ett_nas_eps_esm_elem[i];
9225 /* Register protocol */
9226 proto_nas_eps = proto_register_protocol(PNAME, PSNAME, PFNAME);
9227 /* Register fields and subtrees */
9228 proto_register_field_array(proto_nas_eps, hf, array_length(hf));
9229 proto_register_subtree_array(ett, array_length(ett));
9230 expert_nas_eps = expert_register_protocol(proto_nas_eps);
9231 expert_register_field_array(expert_nas_eps, ei, array_length(ei));
9233 /* Register dissector */
9234 register_dissector(PFNAME, dissect_nas_eps, proto_nas_eps);
9236 /* Backward compatibility with old filters name */
9237 proto_register_alias(proto_nas_eps, "nas_eps");
9239 /* Register dissector */
9240 register_dissector("nas-eps_plain", dissect_nas_eps_plain, proto_nas_eps);
9242 /* Register configuration options to always dissect as plain messages */
9243 nas_eps_module = prefs_register_protocol(proto_nas_eps, proto_reg_handoff_nas_eps);
9245 prefs_register_bool_preference(nas_eps_module,
9246 "dissect_plain",
9247 "Force dissect as plain NAS EPS",
9248 "Always dissect NAS EPS messages as plain",
9249 &g_nas_eps_dissect_plain);
9251 prefs_register_bool_preference(nas_eps_module,
9252 "null_decipher",
9253 "Try to detect and decode EEA0 ciphered messages",
9254 "This should work when the NAS ciphering algorithm is NULL (128-EEA0)",
9255 &g_nas_eps_null_decipher);
9257 prefs_register_enum_preference(nas_eps_module, "decode_user_data_container_as",
9258 "Try to decode User Data Container content as",
9259 NULL,
9260 &g_nas_eps_decode_user_data_container_as,
9261 nas_eps_user_data_container_as_vals, false);
9263 prefs_register_dissector_preference(nas_eps_module, "non_ip_data_dissector",
9264 "Dissector name for non IP data", NULL,
9265 &g_nas_eps_non_ip_data_dissector);
9267 prefs_register_obsolete_preference(nas_eps_module, "user_data_container_as_ip");
9270 /* Heuristic dissector looks for "nas-eps" string at packet start */
9271 static bool dissect_nas_eps_heur(tvbuff_t *tvb, packet_info *pinfo,
9272 proto_tree *tree, void *data _U_)
9274 int offset = 0;
9275 tvbuff_t *nas_tvb;
9277 /* Needs to be at least as long as:
9278 - the signature string
9279 - at least one byte of NAS PDU payload */
9280 if (tvb_captured_length_remaining(tvb, offset) < (int)(strlen(PFNAME)+1)) {
9281 return false;
9284 /* OK, compare with signature string */
9285 if (tvb_strneql(tvb, offset, PFNAME, strlen(PFNAME)) != 0) {
9286 return false;
9288 offset += (int)strlen(PFNAME);
9290 /* Clear protocol name */
9291 col_clear(pinfo->cinfo, COL_PROTOCOL);
9293 /* Clear info column */
9294 col_clear(pinfo->cinfo, COL_INFO);
9296 /* Create tvb that starts at actual NAS PDU */
9297 nas_tvb = tvb_new_subset_remaining(tvb, offset);
9298 dissect_nas_eps(nas_tvb, pinfo, tree, NULL);
9300 return true;
9303 void
9304 proto_reg_handoff_nas_eps(void)
9306 static bool initialized = false;
9308 if (!initialized) {
9309 heur_dissector_add("udp", dissect_nas_eps_heur, "NAS-EPS over UDP", "nas_eps_udp", proto_nas_eps, HEURISTIC_DISABLE);
9310 gsm_a_dtap_handle = find_dissector_add_dependency("gsm_a_dtap", proto_nas_eps);
9311 lpp_handle = find_dissector_add_dependency("lpp", proto_nas_eps);
9312 nbifom_handle = find_dissector_add_dependency("nbifom", proto_nas_eps);
9313 ipv4_handle = find_dissector_add_dependency("ip", proto_nas_eps);
9314 ipv6_handle = find_dissector_add_dependency("ipv6", proto_nas_eps);
9315 ethernet_handle = find_dissector_add_dependency("eth_withoutfcs", proto_nas_eps);
9316 initialized = true;
9318 if (g_nas_eps_non_ip_data_dissector[0] != '\0') {
9319 non_ip_data_handle = find_dissector(g_nas_eps_non_ip_data_dissector);
9320 } else {
9321 non_ip_data_handle = NULL;
9326 * Editor modelines
9328 * Local Variables:
9329 * c-basic-offset: 4
9330 * tab-width: 8
9331 * indent-tabs-mode: nil
9332 * End:
9334 * ex: set shiftwidth=4 tabstop=8 expandtab:
9335 * :indentSize=4:tabSize=8:noTabs=true: