2 * Routines for Non-Access-Stratum (NAS) protocol for Evolved Packet System (EPS) dissection
4 * Copyright 2008 - 2010, Anders Broman <anders.broman@ericsson.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 * References: 3GPP TS 24.301 V9.6.0 (2011-03)
34 #include <epan/packet.h>
35 #include <epan/asn1.h>
37 #include "packet-gsm_map.h"
38 #include "packet-gsm_a_common.h"
39 #include "packet-e212.h"
40 #include "packet-lcsap.h"
42 #define PNAME "Non-Access-Stratum (NAS)PDU"
43 #define PSNAME "NAS-EPS"
44 #define PFNAME "nas-eps"
46 /* Initialize the protocol and registered fields */
47 static int proto_nas_eps = -1;
49 /* Dissector handles */
50 static dissector_handle_t gsm_a_dtap_handle;
51 static dissector_handle_t lpp_handle;
53 /* Forward declaration */
54 static void disect_nas_eps_esm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset);
56 static int hf_nas_eps_msg_emm_type = -1;
57 int hf_nas_eps_common_elem_id = -1;
58 int hf_nas_eps_emm_elem_id = -1;
59 static int hf_nas_eps_bearer_id = -1;
60 static int hf_nas_eps_spare_bits = -1;
61 static int hf_nas_eps_security_header_type = -1;
62 static int hf_nas_eps_msg_auth_code = -1;
63 static int hf_nas_eps_seq_no = -1;
64 static int hf_nas_eps_seq_no_short = -1;
65 static int hf_nas_eps_emm_ebi0 = -1;
66 static int hf_nas_eps_emm_ebi1 = -1;
67 static int hf_nas_eps_emm_ebi2 = -1;
68 static int hf_nas_eps_emm_ebi3 = -1;
69 static int hf_nas_eps_emm_ebi4 = -1;
70 static int hf_nas_eps_emm_ebi5 = -1;
71 static int hf_nas_eps_emm_ebi6 = -1;
72 static int hf_nas_eps_emm_ebi7 = -1;
73 static int hf_nas_eps_emm_ebi8 = -1;
74 static int hf_nas_eps_emm_ebi9 = -1;
75 static int hf_nas_eps_emm_ebi10 = -1;
76 static int hf_nas_eps_emm_ebi11 = -1;
77 static int hf_nas_eps_emm_ebi12 = -1;
78 static int hf_nas_eps_emm_ebi13 = -1;
79 static int hf_nas_eps_emm_ebi14 = -1;
80 static int hf_nas_eps_emm_ebi15 = -1;
81 static int hf_nas_eps_emm_dl_nas_cnt = -1;
82 static int hf_nas_eps_emm_nonce_mme = -1;
83 static int hf_nas_eps_emm_nonce = -1;
84 static int hf_nas_eps_emm_paging_id = -1;
85 static int hf_nas_eps_emm_eps_att_type = -1;
86 static int hf_nas_eps_emm_cs_lcs_type = -1;
87 static int hf_nas_eps_emm_epc_lcs_type = -1;
88 static int hf_nas_eps_emm_emc_bs_type = -1;
89 static int hf_nas_eps_emm_ims_vops_type = -1;
90 static int hf_nas_eps_emm_nas_key_set_id = -1;
91 static int hf_nas_eps_tsc = -1;
92 static int hf_nas_eps_emm_odd_even = -1;
93 static int hf_nas_eps_emm_type_of_id = -1;
94 static int hf_nas_eps_emm_mme_grp_id = -1;
95 static int hf_nas_eps_emm_imsi = -1;
96 static int hf_nas_eps_emm_imei = -1;
97 static int hf_nas_eps_emm_mme_code = -1;
98 static int hf_nas_eps_emm_m_tmsi = -1;
99 static int hf_nas_eps_esm_msg_cont = -1;
100 static int hf_nas_eps_esm_imeisv_req = -1;
101 static int hf_nas_eps_emm_toi = -1;
102 static int hf_nas_eps_emm_toc = -1;
103 static int hf_nas_eps_emm_EPS_attach_result = -1;
104 static int hf_nas_eps_emm_spare_half_octet = -1;
105 static int hf_nas_eps_emm_add_upd_res = -1;
106 static int hf_nas_eps_emm_add_upd_type = -1;
107 static int hf_nas_eps_emm_res = -1;
108 static int hf_nas_eps_emm_csfb_resp = -1;
109 static int hf_nas_eps_emm_cause = -1;
110 static int hf_nas_eps_emm_id_type2 = -1;
111 static int hf_nas_eps_emm_short_mac = -1;
112 static int hf_nas_eps_emm_tai_tol = -1;
113 static int hf_nas_eps_emm_tai_n_elem = -1;
114 static int hf_nas_eps_emm_tai_tac = -1;
115 static int hf_nas_eps_emm_eea0 = -1;
116 static int hf_nas_eps_emm_128eea1 = -1;
117 static int hf_nas_eps_emm_128eea2 = -1;
118 static int hf_nas_eps_emm_eea3 = -1;
119 static int hf_nas_eps_emm_eea4 = -1;
120 static int hf_nas_eps_emm_eea5 = -1;
121 static int hf_nas_eps_emm_eea6 = -1;
122 static int hf_nas_eps_emm_eea7 = -1;
123 static int hf_nas_eps_emm_eia0 = -1;
124 static int hf_nas_eps_emm_128eia1 = -1;
125 static int hf_nas_eps_emm_128eia2 = -1;
126 static int hf_nas_eps_emm_eia3 = -1;
127 static int hf_nas_eps_emm_eia4 = -1;
128 static int hf_nas_eps_emm_eia5 = -1;
129 static int hf_nas_eps_emm_eia6 = -1;
130 static int hf_nas_eps_emm_eia7 = -1;
131 static int hf_nas_eps_emm_uea0 = -1;
132 static int hf_nas_eps_emm_uea1 = -1;
133 static int hf_nas_eps_emm_uea2 = -1;
134 static int hf_nas_eps_emm_uea3 = -1;
135 static int hf_nas_eps_emm_uea4 = -1;
136 static int hf_nas_eps_emm_uea5 = -1;
137 static int hf_nas_eps_emm_uea6 = -1;
138 static int hf_nas_eps_emm_uea7 = -1;
139 static int hf_nas_eps_emm_ucs2_supp = -1;
140 static int hf_nas_eps_emm_uia1 = -1;
141 static int hf_nas_eps_emm_uia2 = -1;
142 static int hf_nas_eps_emm_uia3 = -1;
143 static int hf_nas_eps_emm_uia4 = -1;
144 static int hf_nas_eps_emm_uia5 = -1;
145 static int hf_nas_eps_emm_uia6 = -1;
146 static int hf_nas_eps_emm_uia7 = -1;
147 static int hf_nas_eps_emm_gea1 = -1;
148 static int hf_nas_eps_emm_gea2 = -1;
149 static int hf_nas_eps_emm_gea3 = -1;
150 static int hf_nas_eps_emm_gea4 = -1;
151 static int hf_nas_eps_emm_gea5 = -1;
152 static int hf_nas_eps_emm_gea6 = -1;
153 static int hf_nas_eps_emm_gea7 = -1;
154 static int hf_nas_eps_emm_lpp_cap = -1;
155 static int hf_nas_eps_emm_lcs_cap = -1;
156 static int hf_nas_eps_emm_1xsrvcc_cap = -1;
157 static int hf_nas_eps_emm_nf_cap = -1;
158 static int hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg;
159 static int hf_nas_eps_emm_ss_code = -1;
160 static int hf_nas_eps_emm_lcs_ind = -1;
161 static int hf_nas_eps_emm_gen_msg_cont_type = -1;
162 static int hf_nas_eps_emm_apn_ambr_ul = -1;
163 static int hf_nas_eps_emm_apn_ambr_dl = -1;
164 static int hf_nas_eps_emm_apn_ambr_ul_ext = -1;
165 static int hf_nas_eps_emm_apn_ambr_dl_ext = -1;
166 static int hf_nas_eps_emm_apn_ambr_ul_ext2 = -1;
167 static int hf_nas_eps_emm_apn_ambr_dl_ext2 = -1;
169 static int hf_nas_eps_emm_switch_off = -1;
170 static int hf_nas_eps_emm_detach_type_UL = -1;
171 static int hf_nas_eps_emm_detach_type_DL = -1;
173 static int hf_nas_eps_qci = -1;
174 static int hf_nas_eps_mbr_ul = -1;
175 static int hf_nas_eps_mbr_dl = -1;
176 static int hf_nas_eps_gbr_ul = -1;
177 static int hf_nas_eps_gbr_dl = -1;
178 static int hf_nas_eps_embr_ul = -1;
179 static int hf_nas_eps_embr_dl = -1;
180 static int hf_nas_eps_egbr_ul = -1;
181 static int hf_nas_eps_egbr_dl = -1;
183 static int hf_nas_eps_esm_cause = -1;
184 static int hf_nas_eps_esm_eit = -1;
185 static int hf_nas_eps_esm_lnkd_eps_bearer_id = -1;
186 static int hf_nas_eps_esm_notif_ind = -1;
187 static int hf_nas_eps_esm_pdn_type = -1;
188 static int hf_nas_eps_esm_pdn_ipv4 = -1;
189 static int hf_nas_eps_esm_pdn_ipv6_if_id = -1;
191 static int hf_nas_eps_esm_linked_bearer_id = -1;
193 static int hf_nas_eps_active_flg = -1;
194 static int hf_nas_eps_eps_update_result_value = -1;
195 static int hf_nas_eps_eps_update_type_value = -1;
196 static int hf_nas_eps_service_type = -1;
198 static int hf_nas_eps_nas_msg_cont = -1;
199 static int hf_nas_eps_gen_msg_cont = -1;
201 static int hf_nas_eps_cmn_add_info = -1;
202 static int hf_nas_eps_esm_request_type = -1;
205 static int hf_nas_eps_msg_esm_type = -1;
206 int hf_nas_eps_esm_elem_id = -1;
207 static int hf_nas_eps_esm_proc_trans_id = -1;
209 /* Initialize the subtree pointers */
210 static int ett_nas_eps = -1;
211 static int ett_nas_eps_esm_msg_cont = -1;
212 static int ett_nas_eps_nas_msg_cont = -1;
213 static int ett_nas_eps_gen_msg_cont = -1;
214 static int ett_nas_eps_cmn_add_info = -1;
216 /* Global variables */
217 static packet_info *gpinfo;
219 guint8 eps_nas_gen_msg_cont_type = 0;
221 /* Table 9.8.1: Message types for EPS mobility management
222 * 0 1 - - - - - - EPS mobility management messages
224 static const value_string nas_msg_emm_strings[] = {
225 { 0x41, "Attach request"},
226 { 0x42, "Attach accept"},
227 { 0x43, "Attach complete"},
228 { 0x44, "Attach reject"},
229 { 0x45, "Detach request"},
230 { 0x46, "Detach accept"},
232 { 0x48, "Tracking area update request"},
233 { 0x49, "Tracking area update accept"},
234 { 0x4a, "Tracking area update complete"},
235 { 0x4b, "Tracking area update reject"},
237 { 0x4c, "Extended service request"},
238 { 0x4e, "Service reject"},
240 { 0x50, "GUTI reallocation command"},
241 { 0x51, "GUTI reallocation complete"},
242 { 0x52, "Authentication request"},
243 { 0x53, "Authentication response"},
244 { 0x54, "Authentication reject"},
245 { 0x5c, "Authentication failure"},
246 { 0x55, "Identity request"},
247 { 0x56, "Identity response"},
248 { 0x5d, "Security mode command"},
249 { 0x5e, "Security mode complete"},
250 { 0x5f, "Security mode reject"},
252 { 0x60, "EMM status"},
253 { 0x61, "EMM information"},
254 { 0x62, "Downlink NAS transport"},
255 { 0x63, "Uplink NAS transport"},
256 { 0x64, "CS Service notification"},
257 { 0x68, "Downlink generic NAS transport"},
258 { 0x69, "Uplink generic NAS transport"},
262 /* Table 9.8.2: Message types for EPS session management */
264 static const value_string nas_msg_esm_strings[] = {
265 { 0xc1, "Activate default EPS bearer context request"},
266 { 0xc2, "Activate default EPS bearer context accept"},
267 { 0xc3, "Activate default EPS bearer context reject"},
268 { 0xc5, "Activate dedicated EPS bearer context request"},
269 { 0xc6, "Activate dedicated EPS bearer context accept"},
270 { 0xc7, "Activate dedicated EPS bearer context reject"},
271 { 0xc9, "Modify EPS bearer context request"},
272 { 0xca, "Modify EPS bearer context accept"},
273 { 0xcb, "Modify EPS bearer context reject"},
274 { 0xcd, "Deactivate EPS bearer context request"},
275 { 0xce, "Deactivate EPS bearer context accept"},
276 { 0xd0, "PDN connectivity request"},
277 { 0xd1, "PDN connectivity reject"},
278 { 0xd2, "PDN disconnect request"},
279 { 0xd3, "PDN disconnect reject"},
280 { 0xd4, "Bearer resource allocation request"},
281 { 0xd5, "Bearer resource allocation reject"},
282 { 0xd6, "Bearer resource modification request"},
283 { 0xd7, "Bearer resource modification reject"},
284 { 0xd9, "ESM information request"},
285 { 0xda, "ESM information response"},
286 { 0xdb, "Notification"},
287 { 0xe8, "ESM status"},
291 static const value_string security_header_type_vals[] = {
292 { 0, "Plain NAS message, not security protected"},
293 { 1, "Integrity protected"},
294 { 2, "Integrity protected and ciphered"},
295 { 3, "Integrity protected with new EPS security context"},
296 { 4, "Integrity protected and ciphered with new EPS security context"},
304 { 12, "Security header for the SERVICE REQUEST message "},
305 { 13, "These values are not used in this version of the protocol. If received they shall be interpreted as \"1100\""},
306 { 14, "These values are not used in this version of the protocol. If received they shall be interpreted as \"1100\""},
307 { 15, "These values are not used in this version of the protocol. If received they shall be interpreted as \"1100\""},
310 static value_string_ext security_header_type_vals_ext = VALUE_STRING_EXT_INIT(security_header_type_vals);
312 const value_string nas_eps_common_elem_strings[] = {
313 { 0x00, "Additional information" }, /* 9.9.2.0 Additional information */
314 { 0x00, "EPS bearer context status" }, /* 9.9.2.1 EPS bearer context status */
315 { 0x00, "Location area identification" }, /* 9.9.2.2 Location area identification */
316 { 0x00, "Mobile identity" }, /* 9.9.2.3 Mobile identity */
317 { 0x00, "Mobile station classmark 2" }, /* 9.9.2.4 Mobile station classmark 2 */
318 { 0x00, "Mobile station classmark 3" }, /* 9.9.2.5 Mobile station classmark 3 */
319 { 0x00, "NAS security parameters from E-UTRA" }, /* 9.9.2.6 NAS security parameters from E-UTRA */
320 { 0x00, "NAS security parameters to E-UTRA" }, /* 9.9.2.7 NAS security parameters to E-UTRA */
321 { 0x00, "PLMN list" }, /* 9.9.2.8 PLMN list */
322 /* 9.9.2.9 Spare half octet */
323 { 0x00, "Supported codec list" }, /* 9.9.2.10 Supported codec list */
326 /* Utility functions */
328 calc_bitrate(guint8 value){
329 guint16 return_value = value;
331 if (value > 63 && value <= 127) {
332 return_value = 64 + (value - 64) * 8;
334 else if (value > 127 && value <= 254) {
335 return_value = 576 + (value - 128) * 64;
337 else if (value==0xff) {
343 calc_bitrate_ext(guint8 value){
344 guint32 return_value = 0;
346 if (value > 0 && value <= 0x4a) {
347 return_value = 8600 + value * 100;
349 else if (value > 0x4a && value <= 0xba) {
350 return_value = 16 + (value-0x4a);
352 else if (value > 0xba && value <= 0xfa) {
353 return_value = 128 + (value-0xba)*2;
362 #define NUM_NAS_EPS_COMMON_ELEM (sizeof(nas_eps_common_elem_strings)/sizeof(value_string))
363 gint ett_nas_eps_common_elem[NUM_NAS_EPS_COMMON_ELEM];
367 DE_EPS_CMN_ADD_INFO, /* 9.9.2.0 Additional information */
368 DE_EPS_CMN_EPS_BE_CTX_STATUS, /* 9.9.2.1 EPS bearer context status */
369 DE_EPS_CMN_LOC_AREA_ID, /* 9.9.2.2 Location area identification */
370 DE_EPS_CMN_MOB_ID, /* 9.9.2.3 Mobile identity */
371 DE_EPS_MS_CM_2, /* 9.9.2.4 Mobile station classmark 2 */
372 DE_EPS_MS_CM_3, /* 9.9.2.5 Mobile station classmark 3 */
373 DE_EPS_NAS_SEC_PAR_FROM_EUTRA, /* 9.9.2.6 NAS security parameters from E-UTRA */
374 DE_EPS_NAS_SEC_PAR_TO_EUTRA, /* 9.9.2.7 NAS security parameters to E-UTRA */
376 DE_EPS_CMN_PLM_LST, /* 9.9.2.8 PLMN list */
377 DE_EPS_CMN_SUP_CODEC_LST, /* 9.9.2.6 9.9.2.10 Supported codec list */
378 DE_EPS_COMMON_NONE /* NONE */
380 nas_eps_common_elem_idx_t;
382 * 9.9.2 Common information elements
385 /* 9.9.2.0 Additional information */
387 de_eps_cmn_add_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
390 proto_tree *sub_tree;
393 item = proto_tree_add_item(tree, hf_nas_eps_cmn_add_info, tvb, offset, len, ENC_NA);
394 sub_tree = proto_item_add_subtree(item, ett_nas_eps_cmn_add_info);
396 new_tvb = tvb_new_subset(tvb, offset, len, len);
398 switch (eps_nas_gen_msg_cont_type) {
401 dissect_lcsap_Correlation_ID_PDU(new_tvb, pinfo, sub_tree);
411 * 9.9.2.1 EPS bearer context status
413 static const true_false_string nas_eps_emm_ebi_vals = {
414 "BEARER CONTEXT-ACTIVE",
415 "BEARER CONTEXT-INACTIVE"
419 de_eps_cmn_eps_be_ctx_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
423 curr_offset = offset;
425 /* EBI(7) EBI(6) EBI(5) EBI(4) EBI(3) EBI(2) EBI(1) EBI(0) octet 3 */
426 proto_tree_add_item(tree, hf_nas_eps_emm_ebi7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
427 proto_tree_add_item(tree, hf_nas_eps_emm_ebi6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
428 proto_tree_add_item(tree, hf_nas_eps_emm_ebi5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
429 /* EBI(0) - EBI(4): Bits 0 to 4 of octet 3 are spare and shall be coded as zero. */
430 proto_tree_add_item(tree, hf_nas_eps_emm_ebi4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
431 proto_tree_add_item(tree, hf_nas_eps_emm_ebi3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
432 proto_tree_add_item(tree, hf_nas_eps_emm_ebi2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
433 proto_tree_add_item(tree, hf_nas_eps_emm_ebi1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
434 proto_tree_add_item(tree, hf_nas_eps_emm_ebi0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
436 /* EBI(15) EBI(14) EBI(13) EBI(12) EBI(11) EBI(10) EBI(9) EBI(8) octet 4 */
437 proto_tree_add_item(tree, hf_nas_eps_emm_ebi15, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
438 proto_tree_add_item(tree, hf_nas_eps_emm_ebi14, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
439 proto_tree_add_item(tree, hf_nas_eps_emm_ebi13, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
440 proto_tree_add_item(tree, hf_nas_eps_emm_ebi12, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
441 proto_tree_add_item(tree, hf_nas_eps_emm_ebi11, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
442 proto_tree_add_item(tree, hf_nas_eps_emm_ebi10, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
443 proto_tree_add_item(tree, hf_nas_eps_emm_ebi9, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
444 proto_tree_add_item(tree, hf_nas_eps_emm_ebi8, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
449 * 9.9.2.2 Location area identification
450 * See subclause 10.5.1.3 in 3GPP TS 24.008 [6].
453 * 9.9.2.3 Mobile identity
454 * See subclause 10.5.1.4 in 3GPP TS 24.008 [6].
455 * exported from gsm_a_common
459 * 9.9.2.4 Mobile station classmark 2
460 * See subclause 10.5.1.6 in 3GPP TS 24.008 [13].
463 * 9.9.2.5 Mobile station classmark 3
464 * See subclause 10.5.1.7 in 3GPP TS 24.008 [13].
468 * 9.9.2.6 NAS security parameters from E-UTRA
471 de_emm_sec_par_from_eutra(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
475 curr_offset = offset;
477 /* DL NAS COUNT value (short) (octet 2, bit 1 to 4)
478 * This field contains the 4 least significant bits of the binary representation of the downlink
479 * NAS COUNT value applicable when this information element is sent.
481 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
482 proto_tree_add_item(tree, hf_nas_eps_emm_dl_nas_cnt, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
488 * 9.9.2.7 NAS security parameters to E-UTRA
491 de_emm_sec_par_to_eutra(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
495 curr_offset = offset;
496 /* NonceMME value (octet 1 to 5)
497 * This field is coded as the nonce value in the Nonce information element (see subclause 9.9.3.25).
499 proto_tree_add_item(tree, hf_nas_eps_emm_nonce_mme, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
501 /* type of ciphering algorithm (octet 6, bit 5 to 7)
502 * These fields are coded as the type of integrity protection algorithm and type of ciphering algorithm
503 * in the NAS security algorithms information element (see subclause 9.9.3.23).
504 * Bit 4 and 8 of octet 6 are spare and shall be coded as zero.
506 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN);
507 proto_tree_add_item(tree, hf_nas_eps_emm_toc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
508 /* Type of integrity protection algorithm (octet 6, bit 1 to 3)*/
509 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+4, 1, ENC_BIG_ENDIAN);
510 proto_tree_add_item(tree, hf_nas_eps_emm_toi, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
513 * NAS key set identifier (octet 7, bit 1 to 3) and
514 * type of security context flag (TSC) (octet 7, bit 4)
515 * These fields are coded as the NAS key set identifier and type of security context flag in the
516 * NAS key set identifier information element (see subclause 9.9.3.21).
517 * Bit 5 to 8 of octet 7 are spare and shall be coded as zero.
519 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
520 /* Type of security context flag (TSC) V 1/2 */
521 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, (curr_offset<<3)+4, 1, ENC_BIG_ENDIAN);
522 /* NAS key set identifier */
523 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, (curr_offset<<3)+5, 3, ENC_BIG_ENDIAN);
530 * See subclause 10.5.1.13 in 3GPP TS 24.008 [6].
533 * 9.9.2.9 Spare half octet
534 * This element is used in the description of EMM and ESM messages when an odd number of
535 * half octet type 1 information elements are used. This element is filled with spare bits
536 * set to zero and is placed in bits 5 to 8 of the octet unless otherwise specified.
541 * 9.9.2.10 Supported codec list
542 * See subclause 10.5.4.32 in 3GPP TS 24.008 [13].
543 * Dissected in packet-gsm_a_dtap.c
546 guint16 (*nas_eps_common_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string, int string_len) = {
547 /* 9.9.2 Common information elements */
548 de_eps_cmn_add_info, /* 9.9.2.0 Additional information */
549 de_eps_cmn_eps_be_ctx_status, /* 9.9.2.1 EPS bearer context status */
550 de_lai, /* 9.9.2.2 Location area identification */
551 de_mid, /* 9.9.2.3 Mobile identity See subclause 10.5.1.4 in 3GPP TS 24.008*/
552 de_ms_cm_2, /* 9.9.2.4 Mobile station classmark 2 */
553 de_ms_cm_3, /* 9.9.2.5 Mobile station classmark 3 */
554 de_emm_sec_par_from_eutra, /* 9.9.2.6 NAS security parameters from E-UTRA */
555 de_emm_sec_par_to_eutra, /* 9.9.2.7 NAS security parameters to E-UTRA */
557 de_plmn_list, /* 9.9.2.8 PLMN list */
558 NULL, /* 9.9.2.10 Supported codec list (packet-gsm_a_dtap.c) */
562 const value_string nas_emm_elem_strings[] = {
563 /* 9.9.3 EPS Mobility Management (EMM) information elements */
564 { 0x00, "Additional update result" }, /* 9.9.3.0A Additional update result */
565 { 0x00, "Additional update type" }, /* 9.9.3.0B Additional update type */
566 { 0x00, "Authentication failure parameter" }, /* 9.9.3.1 Authentication failure parameter */
567 { 0x00, "Authentication parameter AUTN" }, /* 9.9.3.2 Authentication parameter AUTN */
568 { 0x00, "Authentication parameter RAND" }, /* 9.9.3.3 Authentication parameter RAND */
569 { 0x00, "Authentication response parameter" }, /* 9.9.3.4 Authentication response parameter */
570 { 0x00, "CSFB response" }, /* 9.9.3.5 CSFB response */
571 { 0x00, "Daylight saving time" }, /* 9.9.3.6 Daylight saving time */
572 { 0x00, "Detach type" }, /* 9.9.3.7 Detach type */
573 { 0x00, "DRX parameter" }, /* 9.9.3.8 DRX parameter */
574 { 0x00, "EMM cause" }, /* 9.9.3.9 EMM cause */
575 { 0x00, "EPS attach result" }, /* 9.9.3.10 EPS attach result */
576 { 0x00, "EPS attach type" }, /* 9.9.3.11 EPS attach type */
577 { 0x00, "EPS mobile identity" }, /* 9.9.3.12 EPS mobile identity */
578 { 0x00, "EPS network feature support" }, /* 9.9.3.12 EPS mobile identity */
579 { 0x00, "EPS update result" }, /* 9.9.3.13 EPS update result */
580 { 0x00, "EPS update type" }, /* 9.9.3.14 EPS update type */
581 { 0x00, "ESM message container" }, /* 9.9.3.15 ESM message conta */
582 { 0x00, "GPRS timer" }, /* 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. */
583 { 0x00, "Identity type 2" }, /* 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. */
584 { 0x00, "IMEISV request" }, /* 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. */
585 { 0x00, "KSI and sequence number" }, /* 9.9.3.19 KSI and sequence number */
586 { 0x00, "MS network capability" }, /* 9.9.3.20 MS network capability ,See subclause 10.5.5.12 in 3GPP TS 24.008 [6]. */
587 { 0x00, "NAS key set identifier" }, /* 9.9.3.21 NAS key set identifier */
588 { 0x00, "NAS message container" }, /* 9.9.3.22 NAS message container */
589 { 0x00, "NAS security algorithms" }, /* 9.9.3.23 NAS security algorithms */
590 { 0x00, "Network name" }, /* 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. */
591 { 0x00, "Nonce" }, /* 9.9.3.25 Nonce */
592 { 0x00, "Paging identity" }, /* 9.9.3.25A Paging identity */
593 { 0x00, "P-TMSI signature" }, /* 9.9.3.26 P-TMSI signature, See subclause 10.5.5.8 in 3GPP TS 24.008 [6]. */
594 { 0x00, "Service type" }, /* 9.9.3.27 Service type ,See subclause 10.5.5.15 in 3GPP TS 24.008 [6]. */
595 { 0x00, "Short MAC" }, /* 9.9.3.28 Short MAC */
596 { 0x00, "Time zone" }, /* 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. */
597 { 0x00, "Time zone and time" }, /* 9.9.3.30 Time zone and time, See subclause 10.5.3.9 in 3GPP TS 24.008 [6]. */
598 { 0x00, "TMSI status" }, /* 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. */
599 { 0x00, "Tracking area identity" }, /* 9.9.3.32 Tracking area identity */
600 { 0x00, "Tracking area identity list" }, /* 9.9.3.33 Tracking area identity list */
601 { 0x00, "UE network capability" }, /* 9.9.3.34 UE network capability */
602 { 0x00, "UE radio capability information update needed" }, /* 9.9.3.35 UE radio capability information update needed */
603 { 0x00, "UE security capability" }, /* 9.9.3.36 UE security capability */
604 { 0x00, "Emergency Number List" }, /* 9.9.3.37 Emergency Number List */
605 { 0x00, "CLI" }, /* 9.9.3.38 CLI */
606 { 0x00, "SS Code" }, /* 9.9.3.39 SS Code */
607 { 0x00, "LCS indicator" }, /* 9.9.3.40 LCS indicator */
608 { 0x00, "LCS client identity" }, /* 9.9.3.41 LCS client identity */
609 { 0x00, "Generic message container type" }, /* 9.9.3.42 Generic message container type */
610 { 0x00, "Generic message container" }, /* 9.9.3.43 Generic message container */
611 { 0x00, "Voice domain preference and UEs usage setting" }, /* 9.9.3.44 Voice domain preference and UEs usage setting */
614 #define NUM_NAS_EMM_ELEM (sizeof(nas_emm_elem_strings)/sizeof(value_string))
615 gint ett_nas_eps_emm_elem[NUM_NAS_EMM_ELEM];
618 This enum has been moved to packet-gsm_a_common to
619 make it possible to use element dissection from this dissector
621 It is left here as a comment for easier reference.
623 Note this enum must be of the same size as the element decoding list
627 /. 9.9.3 EPS Mobility Management (EMM) information elements ./
628 DE_EMM_ADD_UPD_RES, /. 9.9.3.0A Additional update result ./
629 DE_EMM_ADD_UPD_TYPE, /. 9.9.3.0B Additional update type ./
630 DE_EMM_AUTH_FAIL_PAR, /. 9.9.3.1 Authentication failure parameter (dissected in packet-gsm_a_dtap.c)./
631 DE_EMM_AUTN, /. 9.9.3.2 Authentication parameter AUTN ./
632 DE_EMM_AUTH_PAR_RAND, /. 9.9.3.3 Authentication parameter RAND ./
633 DE_EMM_AUTH_RESP_PAR, /. 9.9.3.4 Authentication response parameter ./
634 DE_EMM_CSFB_RESP, /. 9.9.3.5 CSFB response ./
635 DE_EMM_DAYL_SAV_T, /. 9.9.3.6 Daylight saving time ./
636 DE_EMM_DET_TYPE, /. 9.9.3.7 Detach type ./
637 DE_EMM_DRX_PAR, /. 9.9.3.8 DRX parameter (dissected in packet-gsm_a_gm.c)./
638 DE_EMM_CAUSE, /. 9.9.3.9 EMM cause ./
639 DE_EMM_ATT_RES, /. 9.9.3.10 EPS attach result (Coded inline ./
640 DE_EMM_ATT_TYPE, /. 9.9.3.11 EPS attach type (Coded Inline)./
641 DE_EMM_EPS_MID, /. 9.9.3.12 EPS mobile identity ./
642 DE_EMM_EPS_NET_FEATURE_SUP, /. 9.9.3.12A EPS network feature support ./
643 DE_EMM_EPS_UPD_RES, /. 9.9.3.13 EPS update result ( Coded inline)./
644 DE_EMM_EPS_UPD_TYPE, /. 9.9.3.14 EPS update type ./
645 DE_EMM_ESM_MSG_CONT, /. 9.9.3.15 ESM message conta ./
646 DE_EMM_GPRS_TIMER, /. 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. ./
647 DE_EMM_ID_TYPE_2, /. 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. ./
648 DE_EMM_IMEISV_REQ, /. 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. ./
649 DE_EMM_KSI_AND_SEQ_NO, /. 9.9.3.19 KSI and sequence number ./
650 DE_EMM_MS_NET_CAP, /. 9.9.3.20 MS network capability ,See subclause 10.5.5.12 in 3GPP TS 24.008 [6]. ./
651 DE_EMM_NAS_KEY_SET_ID, /. 9.9.3.21 NAS key set identifier (coded inline)./
652 DE_EMM_NAS_MSG_CONT, /. 9.9.3.22 NAS message container ./
653 DE_EMM_NAS_SEC_ALGS, /. 9.9.3.23 NAS security algorithms ./
654 DE_EMM_NET_NAME, /. 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. ./
655 DE_EMM_NONCE, /. 9.9.3.25 Nonce ./
656 DE_EMM_PAGING_ID, /. 9.9.3.25A Paging identity ./
657 DE_EMM_P_TMSI_SIGN, /. 9.9.3.26 P-TMSI signature, See subclause 10.5.5.8 in 3GPP TS 24.008 [6]. ./
658 DE_EMM_SERV_TYPE, /. 9.9.3.27 Service type ./
659 DE_EMM_SHORT_MAC, /. 9.9.3.28 Short MAC ./
660 DE_EMM_TZ, /. 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. ./
661 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]. ./
662 DE_EMM_TMSI_STAT, /. 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. ./
663 DE_EMM_TRAC_AREA_ID, /. 9.9.3.32 Tracking area identity ./
664 DE_EMM_TRAC_AREA_ID_LST, /. 9.9.3.33 Tracking area identity list ./
665 DE_EMM_UE_NET_CAP, /. 9.9.3.34 UE network capability ./
666 DE_EMM_UE_RA_CAP_INF_UPD_NEED, /. 9.9.3.35 UE radio capability information update needed ./
667 DE_EMM_UE_SEC_CAP, /. 9.9.3.36 UE security capability ./
668 DE_EMM_EMERG_NUM_LST, /. 9.9.3.37 Emergency Number List ./
669 DE_EMM_CLI, /. 9.9.3.38 CLI ./
670 DE_EMM_SS_CODE, /. 9.9.3.39 SS Code ./
671 DE_EMM_LCS_IND, /. 9.9.3.40 LCS indicator ./
672 DE_EMM_LCS_CLIENT_ID, /. 9.9.3.41 LCS client identity ./
673 DE_EMM_GEN_MSG_CONT_TYPE, /. 9.9.3.42 Generic message container type ./
674 DE_EMM_GEN_MSG_CONT, /. 9.9.3.43 Generic message container ./
675 DE_EMM_VOICE_DMN_PREF, /. 9.9.3.44 Voice domain preference and UEs usage setting ./
676 DE_EMM_NONE /. NONE ./
682 /* TODO: Update to latest spec */
683 /* 9.9.3 EPS Mobility Management (EMM) information elements
686 * 9.9.3.0A Additional update result
688 static const value_string nas_eps_emm_add_upd_res_vals[] = {
689 { 0x0, "no additional information"},
690 { 0x1, "CS Fallback not preferred"},
696 de_emm_add_upd_res(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
698 guint32 curr_offset, bit_offset;
700 curr_offset = offset;
701 bit_offset = (curr_offset<<3)+4;
703 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
705 proto_tree_add_bits_item(tree, hf_nas_eps_emm_add_upd_res, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
708 return (curr_offset - offset);
711 * 9.9.3.0B Additional update type
713 static const value_string nas_eps_emm_add_upd_type_vals[] = {
714 { 0x0, "no additional information (shall be interpreted as request for combined attach or combined tracking area updating)"},
719 de_emm_add_upd_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
721 guint32 curr_offset, bit_offset;
723 curr_offset = offset;
724 bit_offset = (curr_offset<<3)+4;
726 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
728 proto_tree_add_bits_item(tree, hf_nas_eps_emm_add_upd_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
731 return (curr_offset - offset);
734 * 9.9.3.1 Authentication failure parameter
735 * See subclause 10.5.3.2.2 in 3GPP TS 24.008 [6].
736 * (dissected in packet-gsm_a_dtap.c)
739 * 9.9.3.2 Authentication parameter AUTN
740 * See subclause 10.5.3.1.1 in 3GPP TS 24.008 [6].
743 * 9.9.3.3 Authentication parameter RAND
744 * See subclause 10.5.3.1 in 3GPP TS 24.008 [6].
747 * 9.9.3.4 Authentication response parameter
750 de_emm_auth_resp_par(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
754 curr_offset = offset;
756 proto_tree_add_item(tree, hf_nas_eps_emm_res, tvb, curr_offset, len, ENC_NA);
761 * 9.9.3.4A Ciphering key sequence number
762 * See subclause 9.9.3.19 in 3GPP TS 24.008 [13].
766 * 9.9.3.5 CSFB response
770 * CSFB response value (octet 1)
773 static const value_string nas_eps_emm_csfb_resp_vals[] = {
774 { 0x0, "CS fallback rejected by the UE"},
775 { 0x1, "CS fallback accepted by the UE"},
780 de_emm_csfb_resp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
782 guint32 curr_offset, bit_offset;
784 curr_offset = offset;
787 bit_offset = curr_offset<<3;
788 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset+4, 1, ENC_BIG_ENDIAN);
790 proto_tree_add_item(tree, hf_nas_eps_emm_csfb_resp, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
793 return(curr_offset-offset);
796 * 9.9.3.6 Daylight saving time
797 * See subclause 10.5.3.12 in 3GPP TS 24.008 [6].
800 * 9.9.3.7 Detach type
803 static const value_string nas_eps_emm_switch_off_vals[] = {
804 { 0x0, "Normal detach"},
805 { 0x1, "Switch off"},
814 /* Type of detach (octet 1)
815 * In the UE to network direction:
817 static const value_string nas_eps_emm_type_of_dtatch_UL_vals[] = {
818 { 0x1, "EPS detach"},
819 { 0x2, "IMSI detach"},
820 { 0x3, "Combined EPS/IMSI detach"},
821 { 0x4, "Combined EPS/IMSI detach"}, /* All other values are interpreted as "combined EPS/IMSI detach" in this version of the protocol.*/
822 { 0x5, "Combined EPS/IMSI detach"}, /* -"- */
829 * In the network to UE direction:
832 static const value_string nas_eps_emm_type_of_dtatch_DL_vals[] = {
833 { 0x1, "Re-attach required"},
834 { 0x2, "Re-attach not required"},
835 { 0x3, "IMSI detach"},
836 { 0x4, "Re-attach not required"}, /* All other values are interpreted as "re-attach not required" in this version of the protocol.*/
837 { 0x5, "Re-attach not required"}, /* -"- */
844 * 9.9.3.8 DRX parameter
845 * See subclause 10.5.5.6 in 3GPP TS 24.008 [13].
850 static const value_string nas_eps_emm_cause_values[] = {
851 { 0x2, "IMSI unknown in HSS"},
852 { 0x3, "Illegal UE"},
853 { 0x5, "IMEI not accepted"},
854 { 0x6, "Illegal ME"},
855 { 0x7, "EPS services not allowed"},
856 { 0x8, "EPS services and non-EPS services not allowed"},
857 { 0x9, "UE identity cannot be derived by the network"},
858 { 0xa, "Implicitly detached"},
859 { 0xb, "PLMN not allowed"},
860 { 0xc, "Tracking Area not allowed"},
861 { 0xd, "Roaming not allowed in this tracking area"},
862 { 0xe, "EPS services not allowed in this PLMN"},
863 { 0xf, "No Suitable Cells In tracking area"},
864 { 0x10, "MSC temporarily not reachable"},
865 { 0x11, "Network failure"},
866 { 0x12, "CS domain not available"},
867 { 0x13, "ESM failure"},
868 { 0x14, "MAC failure"},
869 { 0x15, "Synch failure"},
870 { 0x16, "Congestion"},
871 { 0x17, "UE security capabilities mismatch"},
872 { 0x18, "Security mode rejected, unspecified"},
873 { 0x19, "Not authorized for this CSG"},
874 { 0x1a, "Non-EPS authentication unacceptable"},
875 { 0x27, "CS domain temporarily not available"},
876 { 0x28, "No EPS bearer context activated"},
877 { 0x5f, "Semantically incorrect message"},
878 { 0x60, "Invalid mandatory information"},
879 { 0x61, "Message type non-existent or not implemented"},
880 { 0x62, "Message type not compatible with the protocol state"},
881 { 0x63, "Information element non-existent or not implemented"},
882 { 0x64, "Conditional IE error"},
883 { 0x65, "Message not compatible with the protocol state"},
884 { 0x6f, "Protocol error, unspecified"},
889 de_emm_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
893 curr_offset = offset;
895 proto_tree_add_item(tree, hf_nas_eps_emm_cause, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
898 return curr_offset-offset;}
900 * 9.9.3.10 EPS attach result
903 static const value_string nas_eps_emm_EPS_attach_result_values[] = {
906 { 2, "Combined EPS/IMSI attach"},
917 * 9.9.3.11 EPS attach type
920 static const value_string nas_eps_emm_eps_att_type_vals[] = {
921 { 0, "EPS attach(unused)"},
923 { 2, "Combined handover EPS/IMSI attach"},
924 { 3, "EPS attach(unused)"},
925 { 4, "EPS attach(unused)"},
926 { 5, "EPS attach(unused)"},
927 { 6, "EPS emergency attach"},
934 * 9.9.3.12 EPS mobile identity
937 unpack_eps_mid_digits(tvbuff_t *tvb) {
945 length = tvb_length(tvb);
947 digit_str = ep_alloc(length*2);
949 /* Get identity digit 1 */
950 octet = tvb_get_guint8(tvb,offset);
951 digit_str[i++] = (((octet>>4) & 0x0f) + '0');
954 /* Loop on following octets to retrieve other identity digits */
955 while ( offset < length ){
957 octet = tvb_get_guint8(tvb,offset);
958 digit_str[i] = ((octet & 0x0f) + '0');
962 * unpack second value in byte
966 if (octet == 0x0f) /* odd number bytes - hit filler */
969 digit_str[i] = ((octet & 0x0f) + '0');
978 static const value_string nas_eps_emm_type_of_id_vals[] = {
990 de_emm_eps_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
997 curr_offset = offset;
999 octet = tvb_get_guint8(tvb,offset);
1000 /* Type of identity (octet 3) */
1001 proto_tree_add_item(tree, hf_nas_eps_emm_odd_even, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1002 proto_tree_add_item(tree, hf_nas_eps_emm_type_of_id, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1006 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1007 digit_str = unpack_eps_mid_digits(new_tvb);
1008 proto_tree_add_string(tree, hf_nas_eps_emm_imsi, new_tvb, 0, -1, digit_str);
1012 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1013 digit_str = unpack_eps_mid_digits(new_tvb);
1014 proto_tree_add_string(tree, hf_nas_eps_emm_imei, new_tvb, 0, -1, digit_str);
1019 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1020 /* MME Group ID octet 7 - 8 */
1021 proto_tree_add_item(tree, hf_nas_eps_emm_mme_grp_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1023 /* MME Code Octet 9 */
1024 proto_tree_add_item(tree, hf_nas_eps_emm_mme_code, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1026 /* M-TMSI Octet 10 - 13 */
1027 proto_tree_add_item(tree, hf_nas_eps_emm_m_tmsi, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
1031 proto_tree_add_text(tree, tvb, curr_offset, len - 1, "Type of identity not known");
1039 * 9.9.3.12A EPS network feature support
1041 static const value_string nas_eps_emm_cs_lcs_vals[] = {
1042 { 0, "no information about support of location services via CS domain is available"},
1043 { 1, "location services via CS domain not supported"},
1044 { 2, "location services via CS domain supported"},
1048 static const true_false_string nas_eps_emm_epc_lcs_value = {
1049 "location services via EPC supported",
1050 "location services via EPC not supported"
1052 static const true_false_string nas_eps_emm_emc_bs_value = {
1053 "emergency bearer services in S1 mode supported",
1054 "emergency bearer services in S1 mode not supported"
1056 static const true_false_string nas_eps_emm_ims_vops_value = {
1057 "IMS voice over PS session in S1 mode supported",
1058 "IMS voice over PS session in S1 mode not supported"
1062 de_emm_eps_net_feature_sup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1064 guint32 curr_offset, bit_offset;
1066 curr_offset = offset;
1067 bit_offset = curr_offset << 3;
1068 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1070 proto_tree_add_bits_item(tree, hf_nas_eps_emm_cs_lcs_type, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
1072 proto_tree_add_bits_item(tree, hf_nas_eps_emm_epc_lcs_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1074 proto_tree_add_bits_item(tree, hf_nas_eps_emm_emc_bs_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1076 proto_tree_add_bits_item(tree, hf_nas_eps_emm_ims_vops_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1082 * 9.9.3.13 EPS update result
1084 static const value_string nas_eps_emm_eps_update_result_vals[] = {
1086 { 1, "Combined TA/LA updated"},
1089 { 4, "TA updated and ISR activated"},
1090 { 5, "Combined TA/LA updated and ISR activated"},
1097 * 9.9.3.14 EPS update type
1099 static const true_false_string nas_eps_emm_active_flg_value = {
1100 "Bearer establishment requested",
1101 "No bearer establishment requested"
1104 static const value_string nas_eps_emm_eps_update_type_vals[] = {
1105 { 0, "TA updating"},
1106 { 1, "Combined TA/LA updating"},
1107 { 2, "Combined TA/LA updating with IMSI attach"},
1108 { 3, "Periodic updating"},
1109 { 4, "Unused; shall be interpreted as 'TA updating', if received by the network"},
1110 { 5, "Unused; shall be interpreted as 'TA updating', if received by the network"},
1117 * 9.9.3.15 ESM message container
1120 de_emm_esm_msg_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1123 proto_tree *sub_tree;
1125 guint32 curr_offset;
1127 curr_offset = offset;
1130 item = proto_tree_add_item(tree, hf_nas_eps_esm_msg_cont, tvb, curr_offset, len, ENC_NA);
1131 sub_tree = proto_item_add_subtree(item, ett_nas_eps_esm_msg_cont);
1133 /* This IE can contain any ESM PDU as defined in subclause 8.3. */
1134 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1135 /* Plain NAS message */
1136 disect_nas_eps_esm_msg(new_tvb, gpinfo, sub_tree, 0/* offset */);
1141 * 9.9.3.16 GPRS timer
1142 * See subclause 10.5.7.3 in 3GPP TS 24.008 [6].
1146 * 9.9.3.17 Identity type 2
1147 * See subclause 10.5.5.9 in 3GPP TS 24.008 [6].
1149 static const value_string nas_eps_emm_id_type2_vals[] = {
1158 * 9.9.3.18 IMEISV request
1159 * See subclause 10.5.5.10 in 3GPP TS 24.008 [6].
1161 /* IMEISV request value (octet 1) */
1162 static const value_string nas_eps_emm_imeisv_req_vals[] = {
1163 { 0, "IMEISV not requested"},
1164 { 1, "IMEISV requested"},
1165 { 2, "IMEISV not requested"},
1166 { 3, "IMEISV not requested"},
1167 { 4, "IMEISV not requested"},
1168 { 5, "IMEISV not requested"},
1169 { 6, "IMEISV not requested"},
1170 { 7, "IMEISV not requested"},
1174 de_emm_nas_imeisv_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1176 guint32 curr_offset;
1179 curr_offset = offset;
1181 bit_offset = curr_offset<<3;
1183 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1184 proto_tree_add_item(tree, hf_nas_eps_esm_imeisv_req, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1187 return(curr_offset - offset);
1190 * 9.9.3.19 KSI and sequence number
1193 de_emm_nas_ksi_and_seq_no(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1195 guint32 curr_offset;
1198 curr_offset = offset;
1199 bit_offset = curr_offset<<3;
1201 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1203 proto_tree_add_bits_item(tree, hf_nas_eps_seq_no_short, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
1206 return(curr_offset - offset);
1210 * 9.9.3.20 MS network capability
1211 * See subclause 10.5.5.12 in 3GPP TS 24.008 [6].
1214 * 9.9.3.21 NAS key set identifier
1217 * Type of security context flag (TSC) (octet 1)
1219 static const value_string nas_eps_tsc_vals[] = {
1220 { 0, "Native security context (for KSIasme)"},
1221 { 1, "Mapped security context (for KSIsgsn)"},
1225 /* NAS key set identifier (octet 1) Bits 3 2 1 */
1227 static const value_string nas_eps_emm_NAS_key_set_identifier_vals[] = {
1235 { 7, "No key is available"},
1239 /* Takes bit offset as input and consumes 4 bits */
1241 de_emm_nas_key_set_id_bits(tvbuff_t *tvb, proto_tree *tree, guint32 bit_offset, const gchar *add_string)
1245 /* Type of security context flag (TSC) (octet 1) V 1/2 */
1246 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1248 /* NAS key set identifier (octet 1) */
1249 item = proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1251 proto_item_append_text(item, "%s", add_string);
1256 * Note used for TV Short
1259 de_emm_nas_key_set_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1261 guint32 curr_offset, bit_offset;
1263 curr_offset = offset;
1265 /* Get the bit offset of the lover half of the octet bits 4 - 1 */
1266 bit_offset = curr_offset<<3;
1269 /* Type of security context flag (TSC) (octet 1) V 1/2 */
1270 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1272 /* NAS key set identifier (octet 1) */
1273 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1277 return(curr_offset - offset);
1281 * 9.9.3.22 NAS message container
1284 de_emm_nas_msg_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1287 proto_tree *sub_tree;
1289 guint32 curr_offset;
1291 curr_offset = offset;
1293 /* NAS message container contents (octet 3 to octet n)
1294 * This IE can contain an SMS message (i.e. CP-DATA, CP-ACK or CP-ERROR)
1295 * as defined in subclause 7.2 in 3GPP TS 24.011 [13A].
1298 item = proto_tree_add_item(tree, hf_nas_eps_nas_msg_cont, tvb, curr_offset, len, ENC_NA);
1299 sub_tree = proto_item_add_subtree(item, ett_nas_eps_nas_msg_cont);
1301 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1302 if(gsm_a_dtap_handle)
1303 call_dissector(gsm_a_dtap_handle, new_tvb, gpinfo, sub_tree);
1308 * 9.9.3.23 NAS security algorithms
1310 /* Type of integrity protection algorithm (octet 2, bit 1 to 3) */
1311 static const value_string nas_eps_emm_toi_vals[] = {
1312 { 0, "EPS integrity algorithm EIA0 (null integrity protection algorithm)"},
1313 { 1, "EPS integrity algorithm 128-EIA1"},
1314 { 2, "EPS integrity algorithm 128-EIA2"},
1315 { 3, "EPS integrity algorithm EIA3"},
1316 { 4, "EPS integrity algorithm EIA4"},
1317 { 5, "EPS integrity algorithm EIA5"},
1318 { 6, "EPS integrity algorithm EIA6"},
1319 { 7, "EPS integrity algorithm EIA7"},
1323 /* Type of ciphering algorithm (octet 2, bit 5 to 7) */
1325 static const value_string nas_eps_emm_toc_vals[] = {
1326 { 0, "EPS encryption algorithm EEA0 (null ciphering algorithm)"},
1327 { 1, "EPS encryption algorithm 128-EEA1"},
1328 { 2, "EPS encryption algorithm 128-EEA2"},
1329 { 3, "EPS encryption algorithm EEA3"},
1330 { 4, "EPS encryption algorithm EEA4"},
1331 { 5, "EPS encryption algorithm EEA5"},
1332 { 6, "EPS encryption algorithm EEA6"},
1333 { 7, "EPS encryption algorithm EEA7"},
1337 de_emm_nas_sec_alsgs(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1340 guint32 curr_offset;
1342 curr_offset = offset;
1344 bit_offset = offset<<3;
1345 /* Bit 4 and 8 of octet 2 are spare and shall be coded as zero. */
1346 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1347 /* Type of ciphering algorithm (octet 2, bit 5 to 7) */
1348 proto_tree_add_item(tree, hf_nas_eps_emm_toc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1350 /* Bit 4 and 8 of octet 2 are spare and shall be coded as zero. */
1351 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1352 /* Type of integrity protection algorithm (octet 2, bit 1 to 3) */
1353 proto_tree_add_item(tree, hf_nas_eps_emm_toi, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1357 return(curr_offset-offset);
1360 * 9.9.3.24 Network name
1361 * See subclause 10.5.3.5a in 3GPP TS 24.008 [6].
1367 de_emm_nonce(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1369 guint32 curr_offset;
1371 curr_offset = offset;
1373 proto_tree_add_item(tree, hf_nas_eps_emm_nonce, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
1376 return(curr_offset-offset);
1379 * 9.9.3.25A Paging identity
1381 static const true_false_string nas_eps_emm_paging_id_vals = {
1387 de_emm_paging_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1389 guint32 curr_offset;
1391 curr_offset = offset;
1393 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 7, ENC_BIG_ENDIAN);
1394 proto_tree_add_bits_item(tree, hf_nas_eps_emm_paging_id, tvb, (curr_offset<<3)+7, 1, ENC_BIG_ENDIAN);
1400 * 9.9.3.26 P-TMSI signature
1401 * See subclause 10.5.5.8 in 3GPP TS 24.008 [6].
1404 * 9.9.3.27 Service type
1406 static const value_string nas_eps_service_type_vals[] = {
1407 { 0, "Mobile originating CS fallback or 1xCS fallback"},
1408 { 1, "Mobile terminating CS fallback or 1xCS fallback"},
1409 { 2, "Mobile originating CS fallback emergency call or 1xCS fallback emergency call"},
1414 * 9.9.3.28 Short MAC
1417 de_emm_nas_short_mac(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1419 guint32 curr_offset;
1421 curr_offset = offset;
1424 proto_tree_add_item(tree, hf_nas_eps_emm_short_mac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1427 return(curr_offset-offset);
1430 * 9.9.3.29 Time zone
1431 * See subclause 10.5.3.8 in 3GPP TS 24.008 [6].
1434 * 9.9.3.30 Time zone and time
1435 * See subclause 10.5.3.9 in 3GPP TS 24.008 [6].
1438 * 9.9.3.31 TMSI status
1439 * See subclause 10.5.5.4 in 3GPP TS 24.008 [6].
1442 * 9.9.3.32 Tracking area identity
1446 de_emm_trac_area_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1448 guint32 curr_offset;
1450 curr_offset = offset;
1452 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1453 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1456 return(curr_offset-offset);
1459 * 9.9.3.33 Tracking area identity list
1461 /* Type of list (octet 1)
1464 static const value_string nas_eps_emm_tai_tol_vals[] = {
1465 { 0, "list of TACs belonging to one PLMN, with non-consecutive TAC values"},
1466 { 1, "list of TACs belonging to one PLMN, with consecutive TAC values"},
1467 { 2, "list of TAIs belonging to different PLMNs"},
1472 de_emm_trac_area_id_lst(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1475 guint32 curr_offset;
1476 guint8 octet, tol, n_elem;
1479 curr_offset = offset;
1481 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN);
1482 /* Type of list (octet 1) Bits 7 6 */
1483 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tol, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1484 /* Number of elements (octet 1) Bits 5 4 3 2 1 */
1485 octet = tvb_get_guint8(tvb,curr_offset)& 0x7f;
1487 n_elem = (octet & 0x1f)+1;
1488 item = proto_tree_add_item(tree, hf_nas_eps_emm_tai_n_elem, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1490 proto_item_append_text(item, " [+1 = %u element(s)]", n_elem);
1494 proto_tree_add_text(tree, tvb, curr_offset, len-(curr_offset-offset) , "Unknown type of list ( Not in 3GPP TS 24.301 version 8.1.0 Release 8 )");
1500 /* MCC digit 2 MCC digit 1 octet 2
1501 * MNC digit 3 MCC digit 3 octet 3
1502 * MNC digit 2 MNC digit 1 octet 4
1504 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1505 /* type of list = "000" */
1507 * TAC 1 (continued) octet 6
1511 * TAC k (continued) octet 2k+4*
1513 if (len < (guint)(4+(n_elem*2))){
1514 proto_tree_add_text(tree, tvb, curr_offset, len-1 , "[Wrong number of elements?]");
1517 for (i=0; i < n_elem; i++, curr_offset+=2)
1518 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1522 /* type of list = "010" */
1523 /* MCC digit 2 MCC digit 1 octet 2
1524 * MNC digit 3 MCC digit 3 octet 3
1525 * MNC digit 2 MNC digit 1 octet 4
1527 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1528 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1532 if (len< (guint)(1+(n_elem*5))){
1533 proto_tree_add_text(tree, tvb, curr_offset, len-1 , "[Wrong number of elements?]");
1537 for (i=0; i < n_elem; i++){
1538 /* type of list = "001" */
1539 /* MCC digit 2 MCC digit 1 octet 2
1540 * MNC digit 3 MCC digit 3 octet 3
1541 * MNC digit 2 MNC digit 1 octet 4
1543 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1544 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1549 /* Unknown ( Not in 3GPP TS 24.301 version 8.1.0 Release 8 ) */
1552 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1554 return(curr_offset-offset);
1557 * 9.9.3.34 UE network capability
1560 static const true_false_string nas_eps_emm_supported_flg_value = {
1564 static const true_false_string nas_eps_emm_ucs2_supp_flg_value = {
1565 "The UE has no preference between the use of the default alphabet and the use of UCS2",
1566 "The UE has a preference for the default alphabet"
1568 /* LPP capability (octet 7, bit 4) */
1569 static const true_false_string nas_eps_emm_lpp_cap_flg = {
1570 "LTE Positioning Protocol supported",
1571 "LTE Positioning Protocol not supported"
1573 /* LCS capability (octet 7, bit 3) */
1574 static const true_false_string nas_eps_emm_lcs_cap_flg = {
1575 "Location services notification mechanisms supported",
1576 "Location services notification mechanisms not supported"
1578 /* 1xSRVCC capability (octet 7, bit 2) */
1579 static const true_false_string nas_eps_emm_1xsrvcc_cap_flg = {
1580 "SRVCC from E-UTRAN to cdma2000 1xCS supported",
1581 "SRVCC from E-UTRAN to cdma2000 1x CS not supported"
1583 /* NF capability (octet 7, bit 1) */
1584 static const true_false_string nas_eps_emm_nf_cap_flg = {
1585 "Notification procedure supported",
1586 "Notification procedure not supported"
1590 de_emm_ue_net_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1592 guint32 curr_offset;
1594 curr_offset = offset;
1597 /* EPS encryption algorithms supported (octet 3) */
1598 /* EPS encryption algorithm EEA0 supported (octet 3, bit 8) */
1599 proto_tree_add_item(tree, hf_nas_eps_emm_eea0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1600 /* EPS encryption algorithm 128-EEA1 supported (octet 3, bit 7) */
1601 proto_tree_add_item(tree, hf_nas_eps_emm_128eea1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1602 /* EPS encryption algorithm 128-EEA2 supported (octet 3, bit 6) */
1603 proto_tree_add_item(tree, hf_nas_eps_emm_128eea2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1604 /* EPS encryption algorithm 128-EEA3 supported (octet 3, bit 5) */
1605 proto_tree_add_item(tree, hf_nas_eps_emm_eea3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1606 /* EPS encryption algorithm 128-EEA4 supported (octet 3, bit 4) */
1607 proto_tree_add_item(tree, hf_nas_eps_emm_eea4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1608 /* EPS encryption algorithm 128-EEA5 supported (octet 3, bit 5) */
1609 proto_tree_add_item(tree, hf_nas_eps_emm_eea5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1610 /* EPS encryption algorithm 128-EEA6 supported (octet 3, bit 6) */
1611 proto_tree_add_item(tree, hf_nas_eps_emm_eea6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1612 /* EPS encryption algorithm 128-EEA7 supported (octet 3, bit 7) */
1613 proto_tree_add_item(tree, hf_nas_eps_emm_eea7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1617 /* EPS integrity algorithms supported (octet 4) */
1618 /* EPS integrity algorithm EIA0 supported (octet 4, bit 8) */
1619 proto_tree_add_item(tree, hf_nas_eps_emm_eia0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1620 /* EPS integrity algorithm 128-EIA1 supported (octet 4, bit 7) */
1621 proto_tree_add_item(tree, hf_nas_eps_emm_128eia1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1622 /* EPS integrity algorithm 128-EIA2 supported (octet 4, bit 6) */
1623 proto_tree_add_item(tree, hf_nas_eps_emm_128eia2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1624 /* EPS integrity algorithm EIA3 supported (octet 4, bit 5) */
1625 proto_tree_add_item(tree, hf_nas_eps_emm_eia3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1626 /* EPS integrity algorithm EIA4 supported (octet 4, bit 4) */
1627 proto_tree_add_item(tree, hf_nas_eps_emm_eia4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1628 /* EPS integrity algorithm EIA5 supported (octet 4, bit 3) */
1629 proto_tree_add_item(tree, hf_nas_eps_emm_eia5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1630 /* EPS integrity algorithm EIA6 supported (octet 4, bit 2) */
1631 proto_tree_add_item(tree, hf_nas_eps_emm_eia6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1632 /* EPS integrity algorithm EIA7 supported (octet 4, bit 1) */
1633 proto_tree_add_item(tree, hf_nas_eps_emm_eia7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1637 /* Following octets are optional */
1638 if ((curr_offset - offset) >= len)
1641 /* UMTS encryption algorithms supported (octet 5)
1642 * UMTS encryption algorithm UEA0 supported (octet 5, bit 8)
1644 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 8) */
1645 proto_tree_add_item(tree, hf_nas_eps_emm_uea0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1646 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 7) */
1647 proto_tree_add_item(tree, hf_nas_eps_emm_uea1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1648 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 6) */
1649 proto_tree_add_item(tree, hf_nas_eps_emm_uea2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1650 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 5) */
1651 proto_tree_add_item(tree, hf_nas_eps_emm_uea3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1652 /* EPS encryption algorithm 128-UEA0 supported (octet 5, bit 4) */
1653 proto_tree_add_item(tree, hf_nas_eps_emm_uea4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1654 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 5) */
1655 proto_tree_add_item(tree, hf_nas_eps_emm_uea5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1656 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 6) */
1657 proto_tree_add_item(tree, hf_nas_eps_emm_uea6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1658 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 7) */
1659 proto_tree_add_item(tree, hf_nas_eps_emm_uea7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1662 if ((curr_offset - offset) >= len)
1665 /* UCS2 support (UCS2) (octet 6, bit 8)
1666 * This information field indicates the likely treatment of UCS2 encoded character strings
1669 proto_tree_add_item(tree, hf_nas_eps_emm_ucs2_supp, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1670 /* UMTS integrity algorithms supported (octet 6) */
1671 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 7) */
1672 proto_tree_add_item(tree, hf_nas_eps_emm_uia1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1673 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 6) */
1674 proto_tree_add_item(tree, hf_nas_eps_emm_uia2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1675 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 5) */
1676 proto_tree_add_item(tree, hf_nas_eps_emm_uia3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1677 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 4) */
1678 proto_tree_add_item(tree, hf_nas_eps_emm_uia4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1679 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 3) */
1680 proto_tree_add_item(tree, hf_nas_eps_emm_uia5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1681 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 2) */
1682 proto_tree_add_item(tree, hf_nas_eps_emm_uia6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1683 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 1) */
1684 proto_tree_add_item(tree, hf_nas_eps_emm_uia7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1687 if ((curr_offset - offset) >= len)
1690 /* Bits 8 to 5 of octet 7 are spare and shall be coded as zero. */
1691 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 4, ENC_BIG_ENDIAN);
1692 /* LPP capability (octet 7, bit 4) */
1693 proto_tree_add_item(tree, hf_nas_eps_emm_lpp_cap, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1694 /* LCS capability (octet 7, bit 3) */
1695 proto_tree_add_item(tree, hf_nas_eps_emm_lcs_cap, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1696 /* 1xSRVCC capability (octet 7, bit 2) */
1697 proto_tree_add_item(tree, hf_nas_eps_emm_1xsrvcc_cap, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1698 /* NF capability (octet 7, bit 1) */
1699 proto_tree_add_item(tree, hf_nas_eps_emm_nf_cap, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1704 /* UE radio capability information update needed flag (URC upd) (octet 1) */
1705 static const true_false_string nas_eps_emm_ue_ra_cap_inf_upd_need_flg = {
1706 "UE radio capability information update needed",
1707 "UE radio capability information update not needed"
1711 * 9.9.3.35 UE radio capability information update needed
1715 de_emm_ue_ra_cap_inf_upd_need(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1717 guint32 curr_offset;
1719 curr_offset = offset;
1721 proto_tree_add_item(tree, hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1726 * 9.9.3.36 UE security capability
1730 de_emm_ue_sec_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1732 guint32 curr_offset;
1734 curr_offset = offset;
1736 /* EPS encryption algorithms supported (octet 3) */
1737 /* EPS encryption algorithm EEA0 supported (octet 3, bit 8) */
1738 proto_tree_add_item(tree, hf_nas_eps_emm_eea0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1739 /* EPS encryption algorithm 128-EEA1 supported (octet 3, bit 7) */
1740 proto_tree_add_item(tree, hf_nas_eps_emm_128eea1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1741 /* EPS encryption algorithm 128-EEA2 supported (octet 3, bit 6) */
1742 proto_tree_add_item(tree, hf_nas_eps_emm_128eea2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1743 /* EPS encryption algorithm 128-EEA3 supported (octet 3, bit 5) */
1744 proto_tree_add_item(tree, hf_nas_eps_emm_eea3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1745 /* EPS encryption algorithm 128-EEA4 supported (octet 3, bit 4) */
1746 proto_tree_add_item(tree, hf_nas_eps_emm_eea4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1747 /* EPS encryption algorithm 128-EEA5 supported (octet 3, bit 5) */
1748 proto_tree_add_item(tree, hf_nas_eps_emm_eea5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1749 /* EPS encryption algorithm 128-EEA6 supported (octet 3, bit 6) */
1750 proto_tree_add_item(tree, hf_nas_eps_emm_eea6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1751 /* EPS encryption algorithm 128-EEA7 supported (octet 3, bit 7) */
1752 proto_tree_add_item(tree, hf_nas_eps_emm_eea7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1756 /* EPS integrity algorithms supported (octet 4) */
1757 /* EPS integrity algorithm EIA0 supported (octet 4, bit 8) */
1758 proto_tree_add_item(tree, hf_nas_eps_emm_eia0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1759 /* EPS integrity algorithm 128-EIA1 supported (octet 4, bit 7) */
1760 proto_tree_add_item(tree, hf_nas_eps_emm_128eia1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1761 /* EPS integrity algorithm 128-EIA2 supported (octet 4, bit 6) */
1762 proto_tree_add_item(tree, hf_nas_eps_emm_128eia2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1763 /* EPS integrity algorithm EIA3 supported (octet 4, bit 5) */
1764 proto_tree_add_item(tree, hf_nas_eps_emm_eia3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1765 /* EPS integrity algorithm EIA4 supported (octet 4, bit 4) */
1766 proto_tree_add_item(tree, hf_nas_eps_emm_eia4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1767 /* EPS integrity algorithm EIA5 supported (octet 4, bit 3) */
1768 proto_tree_add_item(tree, hf_nas_eps_emm_eia5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1769 /* EPS integrity algorithm EIA6 supported (octet 4, bit 2) */
1770 proto_tree_add_item(tree, hf_nas_eps_emm_eia6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1771 /* EPS integrity algorithm EIA7 supported (octet 4, bit 1) */
1772 proto_tree_add_item(tree, hf_nas_eps_emm_eia7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1776 /* Octets 5, 6, and 7 are optional. If octet 5 is included,
1777 * then also octet 6 shall be included and octet 7 may be included.
1782 /* UMTS encryption algorithms supported (octet 5) */
1783 /* UMTS encryption algorithm UEA0 supported (octet 5, bit 8) */
1784 proto_tree_add_item(tree, hf_nas_eps_emm_uea0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1785 /* UMTS encryption algorithm UEA1 supported (octet 5, bit 7) */
1786 proto_tree_add_item(tree, hf_nas_eps_emm_uea1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1787 /* UMTS encryption algorithm UEA2 supported (octet 5, bit 6) */
1788 proto_tree_add_item(tree, hf_nas_eps_emm_uea2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1789 /* UMTS encryption algorithm UEA3 supported (octet 5, bit 5) */
1790 proto_tree_add_item(tree, hf_nas_eps_emm_uea3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1791 /* EPS encryption algorithm UEA4 supported (octet 5, bit 4) */
1792 proto_tree_add_item(tree, hf_nas_eps_emm_uea4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1793 /* UMTS encryption algorithm UEA5 supported (octet 5, bit 5) */
1794 proto_tree_add_item(tree, hf_nas_eps_emm_uea5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1795 /* UMTS encryption algorithm UEA6 supported (octet 5, bit 6) */
1796 proto_tree_add_item(tree, hf_nas_eps_emm_uea6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1797 /* UMTS encryption algorithm UEA7 supported (octet 5, bit 7) */
1798 proto_tree_add_item(tree, hf_nas_eps_emm_uea7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1801 /* UMTS integrity algorithms supported (octet 6) */
1802 /* Bit 8 of octet 6 is spare and shall be coded as zero. */
1803 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 1, ENC_BIG_ENDIAN);
1804 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 7) */
1805 proto_tree_add_item(tree, hf_nas_eps_emm_uia1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1806 /* UMTS integrity algorithm UIA2 supported (octet 6, bit 6) */
1807 proto_tree_add_item(tree, hf_nas_eps_emm_uia2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1808 /* UMTS integrity algorithm UIA3 supported (octet 6, bit 5) */
1809 proto_tree_add_item(tree, hf_nas_eps_emm_uia3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1810 /* UMTS integrity algorithm UIA4 supported (octet 6, bit 4) */
1811 proto_tree_add_item(tree, hf_nas_eps_emm_uia4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1812 /* UMTS integrity algorithm UIA5 supported (octet 6, bit 3) */
1813 proto_tree_add_item(tree, hf_nas_eps_emm_uia5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1814 /* UMTS integrity algorithm UIA6 supported (octet 6, bit 2) */
1815 proto_tree_add_item(tree, hf_nas_eps_emm_uia6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1816 /* UMTS integrity algorithm UIA7 supported (octet 6, bit 1) */
1817 proto_tree_add_item(tree, hf_nas_eps_emm_uia7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1823 /* Bit 8 of octet 7 is spare and shall be coded as zero. */
1824 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 1, ENC_BIG_ENDIAN);
1825 /* GPRS encryption algorithm GEA1 supported (octet 7, bit 7) */
1826 proto_tree_add_item(tree, hf_nas_eps_emm_gea1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1827 /* GPRS encryption algorithm GEA2 supported (octet 7, bit 6) */
1828 proto_tree_add_item(tree, hf_nas_eps_emm_gea2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1829 /* GPRS encryption algorithm GEA3 supported (octet 7, bit 5) */
1830 proto_tree_add_item(tree, hf_nas_eps_emm_gea3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1831 /* GPRS encryption algorithm GEA4 supported (octet 7, bit 4) */
1832 proto_tree_add_item(tree, hf_nas_eps_emm_gea4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1833 /* GPRS encryption algorithm GEA5 supported (octet 7, bit 3) */
1834 proto_tree_add_item(tree, hf_nas_eps_emm_gea5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1835 /* GPRS encryption algorithm GEA6 supported (octet 7, bit 2) */
1836 proto_tree_add_item(tree, hf_nas_eps_emm_gea6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1837 /* GPRS encryption algorithm GEA7 supported (octet 7, bit 1) */
1838 proto_tree_add_item(tree, hf_nas_eps_emm_gea7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1844 * 9.9.3.37 Emergency Number List
1845 * See subclause 10.5.3.13 in 3GPP TS 24.008 [13].
1846 * packet-gsm_a_dtap.c
1854 * The coding of the CLI value part is the same as for octets 3 to 14
1855 * of the Calling party BCD number information element defined in
1856 * subclause 10.5.4.9 of 3GPP TS 24.008
1863 de_emm_ss_code(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1865 guint32 curr_offset;
1867 curr_offset = offset;
1871 * The coding of the SS Code value is given in subclause 17.7.5 of 3GPP TS 29.002 [15B].
1872 * value string imported from gsm map
1874 proto_tree_add_item(tree, hf_nas_eps_emm_ss_code, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1880 * 9.9.3.40 LCS indicator
1882 /* LCS indicator value */
1883 static const value_string nas_eps_emm_lcs_ind_vals[] = {
1884 { 0, "Normal, unspecified"},
1891 de_emm_lcs_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1893 guint32 curr_offset;
1895 curr_offset = offset;
1898 proto_tree_add_item(tree, hf_nas_eps_emm_lcs_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1903 * 9.9.3.41 LCS client identity
1906 de_emm_lcs_client_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1908 guint32 curr_offset;
1911 curr_offset = offset;
1913 /* LCS client identity (value part)
1914 * The coding of the value part of the LCS client identity is given
1915 * in subclause 17.7.13 of 3GPP TS 29.002 [15B](GSM MAP).
1917 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1918 dissect_gsm_map_lcs_LCS_ClientID_PDU( new_tvb, gpinfo, tree );
1924 * 9.9.3.42 Generic message container type
1926 static const value_string nas_eps_emm_gen_msg_cont_type_vals[] = {
1928 { 1, "LTE Positioning Protocol (LPP) message container"},
1929 { 2, "Location services message container "},
1934 de_emm_gen_msg_cont_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1936 guint32 curr_offset;
1938 curr_offset = offset;
1940 eps_nas_gen_msg_cont_type = tvb_get_guint8(tvb, curr_offset);
1941 proto_tree_add_item(tree, hf_nas_eps_emm_gen_msg_cont_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1944 return(curr_offset - offset);
1947 * 9.9.3.43 Generic message container
1950 de_emm_gen_msg_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1953 proto_tree *sub_tree;
1956 item = proto_tree_add_item(tree, hf_nas_eps_gen_msg_cont, tvb, offset, len, ENC_NA);
1957 sub_tree = proto_item_add_subtree(item, ett_nas_eps_gen_msg_cont);
1959 new_tvb = tvb_new_subset(tvb, offset, len, len);
1961 switch (eps_nas_gen_msg_cont_type) {
1965 call_dissector(lpp_handle, new_tvb, pinfo, sub_tree);
1969 /* Location services */
1970 if (gsm_a_dtap_handle) {
1971 call_dissector(gsm_a_dtap_handle, new_tvb, pinfo, sub_tree);
1981 * 9.9.3.44 Voice domain preference and UE's usage setting
1982 * See subclause 10.5.5.28 in 3GPP TS 24.008 [13].
1983 * packet-gsm_a_dtap.c
1987 * 9.9.4 EPS Session Management (ESM) information elements
1991 * 9.9.4.1 Access point name
1992 * See subclause 10.5.6.1 in 3GPP TS 24.008 [6].
1995 * 9.9.4.2 APN aggregate maximum bit rate
1999 de_esm_apn_aggr_max_br(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2001 guint32 curr_offset;
2003 guint32 dl_total = 0;
2004 guint32 ul_total = 0;
2005 guint32 bitrate = 0;
2007 curr_offset = offset;
2008 /* APN-AMBR for downlink octet 3 */
2009 octet = tvb_get_guint8(tvb,curr_offset);
2011 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl, tvb, curr_offset, 1, octet,
2014 bitrate = calc_bitrate(octet);
2015 dl_total += bitrate;
2016 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl, tvb, curr_offset, 1, octet,
2017 "APN-AMBR for downlink : %u kbps", bitrate);
2021 /* APN-AMBR for uplink octet 4 */
2022 octet = tvb_get_guint8(tvb,curr_offset);
2024 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul, tvb, curr_offset, 1, octet,
2027 bitrate = calc_bitrate(octet);
2028 ul_total += bitrate;
2029 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul, tvb, curr_offset, 1, octet,
2030 "APN-AMBR for uplink : %u kbps", bitrate);
2033 if ((curr_offset - offset) >= len)
2035 /* APN-AMBR for downlink (extended) octet 5 */
2036 octet = tvb_get_guint8(tvb,curr_offset);
2038 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext, tvb, curr_offset, 1, octet,
2039 "Use the value indicated by the APN-AMBR for downlink");
2041 bitrate = calc_bitrate_ext(octet);
2042 dl_total += (octet > 0x4a) ? bitrate*1000 : bitrate;
2043 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext, tvb, curr_offset, 1, octet,
2044 "APN-AMBR for downlink (extended) : %u %s",
2046 (octet > 0x4a) ? "Mbps" : "kbps");
2049 /* APN-AMBR for downlink (extended-2) is not present; display total now */
2051 /* Ignore value indicated by the APN-AMBR for downlink */
2052 dl_total = (octet > 0x4a) ? bitrate*1000 : bitrate;
2054 if (dl_total >= 1000) {
2055 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for downlink : %.3f Mbps", (gfloat)dl_total / 1000);
2057 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for downlink : %u kbps", dl_total);
2061 if ((curr_offset - offset) >= len)
2063 /* APN-AMBR for uplink (extended) octet 6 */
2064 octet = tvb_get_guint8(tvb,curr_offset);
2066 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext, tvb, curr_offset, 1, octet,
2067 "Use the value indicated by the APN-AMBR for uplink");
2069 bitrate = calc_bitrate_ext(octet);
2070 ul_total += (octet > 0x4a) ? bitrate*1000 : bitrate;
2071 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext, tvb, curr_offset, 1, octet,
2072 "APN-AMBR for uplink (extended) : %u %s",
2074 (octet > 0x4a) ? "Mbps" : "kbps");
2077 /* APN-AMBR for uplink (extended-2) is not present; display total now */
2079 /* Ignore value indicated by the APN-AMBR for uplink */
2080 ul_total = (octet > 0x4a) ? bitrate*1000 : bitrate;
2082 if (ul_total >= 1000) {
2083 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for uplink : %.3f Mbps", (gfloat)ul_total / 1000);
2085 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for uplink : %u kbps", ul_total);
2089 if ((curr_offset - offset) >= len)
2091 /* APN-AMBR for downlink (extended-2) octet 7 */
2092 octet = tvb_get_guint8(tvb,curr_offset);
2093 if((octet==0)||(octet==0xff)){
2094 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext2, tvb, curr_offset, 1, octet,
2095 "Use the value indicated by the APN-AMBR for downlink and APN-AMBR for downlink (extended)");
2097 dl_total += octet*256*1000;
2098 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext2, tvb, curr_offset, 1, octet,
2099 "APN-AMBR for downlink (extended-2) : %u Mbps",
2102 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for downlink : %.3f Mbps", (gfloat)dl_total / 1000);
2104 if ((curr_offset - offset) >= len)
2106 /* APN-AMBR for uplink (extended-2) octet 8 */
2107 octet = tvb_get_guint8(tvb,curr_offset);
2108 if((octet==0)||(octet==0xff)){
2109 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext2, tvb, curr_offset, 1, octet,
2110 "Use the value indicated by the APN-AMBR for uplink and APN-AMBR for downlink (extended)");
2112 ul_total += octet*256*1000;
2113 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext2, tvb, curr_offset, 1, octet,
2114 "APN-AMBR for uplink (extended-2) : %u Mbps",
2117 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for uplink : %.3f Mbps", (gfloat)ul_total / 1000);
2123 * 9.9.4.3 EPS quality of service
2126 /* Quality of Service Class Identifier (QCI), octet 3 (see 3GPP TS 23.203 [7]) */
2127 static const range_string nas_eps_qci_vals[] = {
2128 { 0x00, 0x00, "UE -> NW Network selects the QCI / NW -> UE Reserved"},
2129 { 0x01, 0x01, "QCI 1"},
2130 { 0x02, 0x02, "QCI 2"},
2131 { 0x03, 0x03, "QCI 3"},
2132 { 0x04, 0x04, "QCI 4"},
2133 { 0x05, 0x05, "QCI 5"},
2134 { 0x06, 0x06, "QCI 6"},
2135 { 0x07, 0x07, "QCI 7"},
2136 { 0x08, 0x08, "QCI 8"},
2137 { 0x09, 0x09, "QCI 9"},
2138 { 0x0A, 0x7F, "Reserved"},
2139 { 0x80, 0xFE, "Operator-specific QCI"},
2140 { 0xFF, 0xFF, "Reserved"},
2147 de_esm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2149 guint32 curr_offset;
2152 curr_offset = offset;
2155 proto_tree_add_item(tree, hf_nas_eps_qci, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2157 if ((curr_offset - offset) >= len)
2159 /* Maximum bit rate for uplink octet 4 */
2160 octet = tvb_get_guint8(tvb,curr_offset);
2162 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_ul, tvb, curr_offset, 1, octet,
2163 "UE->NW Subscribed maximum bit rate for uplink/ NW->UE Reserved");
2165 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_ul, tvb, curr_offset, 1, octet,
2166 "Maximum bit rate for uplink : %u kbps", calc_bitrate(octet));
2169 if ((curr_offset - offset) >= len)
2171 /* Maximum bit rate for downlink octet 5 */
2172 octet = tvb_get_guint8(tvb,curr_offset);
2174 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_dl, tvb, curr_offset, 1, octet,
2175 "UE->NW Subscribed maximum bit rate for downlink/ NW->UE Reserved");
2177 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_dl, tvb, curr_offset, 1, octet,
2178 "Maximum bit rate for downlink : %u kbps", calc_bitrate(octet));
2181 if ((curr_offset - offset) >= len)
2183 /* Guaranteed bit rate for uplink octet 6 */
2184 octet = tvb_get_guint8(tvb,curr_offset);
2185 proto_tree_add_uint_format(tree, hf_nas_eps_gbr_ul, tvb, curr_offset, 1, octet,
2186 "Guaranteed bit rate for uplink : %u kbps", calc_bitrate(octet));
2189 if ((curr_offset - offset) >= len)
2191 /* Guaranteed bit rate for downlink octet 7 */
2192 octet = tvb_get_guint8(tvb,curr_offset);
2193 proto_tree_add_uint_format(tree, hf_nas_eps_gbr_ul, tvb, curr_offset, 1, octet,
2194 "Guaranteed bit rate for downlink : %u kbps", calc_bitrate(octet));
2197 if ((curr_offset - offset) >= len)
2199 /* Maximum bit rate for uplink (extended) octet 8 */
2200 octet = tvb_get_guint8(tvb,curr_offset);
2202 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2203 "Use the value indicated by the maximum bit rate for uplink in octet 4.");
2205 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2206 "Maximum bit rate for uplink(extended) : %u %s",
2207 calc_bitrate_ext(octet),
2208 (octet > 0x4a) ? "Mbps" : "kbps");
2211 if ((curr_offset - offset) >= len)
2213 /* Maximum bit rate for downlink (extended) octet 9 */
2214 octet = tvb_get_guint8(tvb,curr_offset);
2216 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2217 "Use the value indicated by the maximum bit rate for downlink in octet 5.");
2219 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2220 "Maximum bit rate for downlink(extended) : %u %s",
2221 calc_bitrate_ext(octet),
2222 (octet > 0x4a) ? "Mbps" : "kbps");
2225 if ((curr_offset - offset) >= len)
2227 /* Guaranteed bit rate for uplink (extended) octet 10 */
2228 octet = tvb_get_guint8(tvb,curr_offset);
2230 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2231 "Use the value indicated by the Guaranteed bit rate for uplink in octet 6.");
2233 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2234 "Guaranteed bit rate for uplink(extended) : %u %s",
2235 calc_bitrate_ext(octet),
2236 (octet > 0x4a) ? "Mbps" : "kbps");
2239 if ((curr_offset - offset) >= len)
2241 /* Guaranteed bit rate for downlink (extended) octet 11 */
2242 octet = tvb_get_guint8(tvb,curr_offset);
2244 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2245 "Use the value indicated by the Guaranteed bit rate for downlink in octet 7.");
2247 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2248 "Guaranteed bit rate for downlink(extended) : %u %s",
2249 calc_bitrate_ext(octet),
2250 (octet > 0x4a) ? "Mbps" : "kbps");
2260 static const value_string nas_eps_esm_cause_vals[] = {
2261 { 0x08, "Operator Determined Barring"},
2262 { 0x1a, "Insufficient resources"},
2263 { 0x1b, "Unknown or missing APN"},
2264 { 0x1c, "Unknown PDN type"},
2265 { 0x1d, "User authentication failed"},
2266 { 0x1e, "Request rejected by Serving GW or PDN GW"},
2267 { 0x1f, "Request rejected, unspecified"},
2268 { 0x20, "Service option not supported"},
2269 { 0x21, "Requested service option not subscribed"},
2270 { 0x22, "Service option temporarily out of order"},
2271 { 0x23, "PTI already in use"},
2272 { 0x24, "Regular deactivation"},
2273 { 0x25, "EPS QoS not accepted"},
2274 { 0x26, "Network failure"},
2275 { 0x27, "Reactivation requested"},
2276 { 0x29, "Semantic error in the TFT operation"},
2277 { 0x2a, "Syntactical error in the TFT operation"},
2278 { 0x2b, "Invalid EPS bearer identity"},
2279 { 0x2c, "Semantic errors in packet filter(s)"},
2280 { 0x2d, "Syntactical errors in packet filter(s)"},
2281 { 0x2e, "EPS bearer context without TFT already activated"},
2282 { 0x2f, "PTI mismatch"},
2283 { 0x31, "Last PDN disconnection not allowed"},
2284 { 0x32, "PDN type IPv4 only allowed"},
2285 { 0x33, "PDN type IPv6 only allowed"},
2286 { 0x34, "Single address bearers only allowed"},
2287 { 0x35, "ESM information not received"},
2288 { 0x36, "PDN connection does not exist"},
2289 { 0x37, "Multiple PDN connections for a given APN not allowed"},
2290 { 0x38, "Collision with network initiated request"},
2291 { 0x3b, "Unsupported QCI value"},
2292 { 0x51, "Invalid PTI value"},
2293 { 0x5f, "Semantically incorrect message"},
2294 { 0x60, "Invalid mandatory information"},
2295 { 0x61, "Message type non-existent or not implemented"},
2296 { 0x62, "Message type not compatible with the protocol state"},
2297 { 0x63, "Information element non-existent or not implemented"},
2298 { 0x64, "Conditional IE error"},
2299 { 0x65, "Message not compatible with the protocol state"},
2300 { 0x6f, "Protocol error, unspecified"},
2301 { 0x70, "APN restriction value incompatible with active EPS bearer context"},
2306 de_esm_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2308 guint32 curr_offset;
2310 curr_offset = offset;
2312 proto_tree_add_item(tree, hf_nas_eps_esm_cause, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2315 return(curr_offset - offset);
2318 * 9.9.4.5 ESM information transfer flag
2320 /* EIT (ESM information transfer) */
2321 static const true_false_string nas_eps_emm_eit_vals = {
2322 "Security protected ESM information transfer required",
2323 "Security protected ESM information transfer not required"
2326 de_esm_inf_trf_flg(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2328 guint32 curr_offset;
2330 curr_offset = offset;
2333 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+4, 3, ENC_BIG_ENDIAN);
2334 proto_tree_add_item(tree, hf_nas_eps_esm_eit, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2336 return(curr_offset-offset);
2339 * 9.9.4.6 Linked EPS bearer identity
2342 * Linked EPS bearer identity (bits 1-4)
2345 static const value_string nas_eps_esm_linked_bearer_id_vals[] = {
2351 { 0x5, "EPS bearer identity value 5"},
2352 { 0x6, "EPS bearer identity value 6"},
2353 { 0x7, "EPS bearer identity value 7"},
2354 { 0x8, "EPS bearer identity value 8"},
2355 { 0x9, "EPS bearer identity value 9"},
2356 { 0xa, "EPS bearer identity value 10"},
2357 { 0xb, "EPS bearer identity value 11"},
2358 { 0xc, "EPS bearer identity value 12"},
2359 { 0xd, "EPS bearer identity value 13"},
2360 { 0xe, "EPS bearer identity value 14"},
2361 { 0xf, "EPS bearer identity value 15"},
2368 de_esm_lnkd_eps_bearer_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2370 guint32 curr_offset;
2372 curr_offset = offset;
2374 proto_tree_add_item(tree, hf_nas_eps_esm_lnkd_eps_bearer_id, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2380 * 9.9.4.7 LLC service access point identifier
2381 * See subclause 10.5.6.9 in 3GPP TS 24.008
2385 * 9.9.4.7a Notification indicator
2387 static const value_string nas_eps_esm_notif_ind_vals[] = {
2389 { 0x1, "SRVCC handover cancelled, IMS session re-establishment required"},
2394 de_esm_notif_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2396 guint32 curr_offset;
2398 curr_offset = offset;
2400 proto_tree_add_item(tree, hf_nas_eps_esm_notif_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2406 * 9.9.4.8 Packet flow identifier
2407 * See subclause 10.5.6.11 in 3GPP TS 24.008
2410 * 9.9.4.9 PDN address
2413 de_esm_pdn_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2415 guint32 curr_offset;
2418 curr_offset = offset;
2421 pdn_type = tvb_get_guint8(tvb, offset) & 0x7;
2422 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 5, ENC_BIG_ENDIAN);
2423 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2429 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv4, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
2433 /* IPv6 3GPP TS 24.301 version 9.4.0 Release 9
2434 * If PDN type value indicates IPv6, the PDN address information in octet 4 to octet 11
2435 * contains an IPv6 interface identifier. Bit 8 of octet 4 represents the most significant bit
2436 * of the IPv6 interface identifier and bit 1 of octet 11 the least significant bit.
2438 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv6_if_id, tvb, curr_offset, 8, ENC_NA);
2442 /* IPv4/IPv6 3GPP TS 24.301 version 9.4.0 Release 9
2443 * If PDN type value indicates IPv4v6, the PDN address information in octet 4 to octet 15
2444 * contains an IPv6 interface identifier and an IPv4 address. Bit 8 of octet 4 represents
2445 * the most significant bit of the IPv6 interface identifier and bit 1 of octet 11 the least
2446 * significant bit. Bit 8 of octet 12 represents the most significant bit of the IPv4 address
2447 * and bit 1 of octet 15 the least significant bit.
2449 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv6_if_id, tvb, curr_offset, 8, ENC_NA);
2451 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv4, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
2458 return(curr_offset-offset);
2463 * Coded inline 1/2 octet
2465 static const value_string nas_eps_esm_pdn_type_values[] = {
2469 { 0x4, "Unused; shall be interpreted as IPv6 if received by the network" },
2474 * 9.9.4.11 Protocol configuration options
2475 * See subclause 10.5.6.3 in 3GPP TS 24.008
2478 * 9.9.4.12 Quality of service
2479 * See subclause 10.5.6.5 in 3GPP TS 24.008
2480 * Coded inline 1/2 octet
2483 * 9.9.4.13 Radio priority
2484 * See subclause 10.5.7.2 in 3GPP TS 24.008
2487 * 9.9.4.14 Request type
2488 * See subclause 10.5.6.17 in 3GPP TS 24.008
2490 static const value_string nas_eps_esm_request_type_values[] = {
2491 { 0x1, "initial request" },
2492 { 0x2, "Handover" },
2493 { 0x3, "Unused; shall be interpreted as initial request if received by the network" },
2494 { 0x4, "emergency" },
2499 * 9.9.4.15 Traffic flow aggregate description
2500 * The Traffic flow aggregate description information element is encoded using the same format as the Traffic flow
2501 * template information element (see subclause 10.5.6.12 in 3GPP TS 24.008 [13]). When sending this IE, the UE shall
2502 * assign the packet filter identifier values so that they are unique across all packet filters for the PDN connection.
2505 * 9.9.4.16 Traffic flow template
2506 * See subclause 10.5.6.12 in 3GPP TS 24.008
2510 * 9.9.4.17 Transaction identifier
2511 * The Transaction identifier information element is coded as the Linked TI information element in 3GPP TS 24.008 [13],
2512 * subclause 10.5.6.7.
2513 * The coding of the TI flag, the TI value and the EXT bit is defined in 3GPP TS 24.007[20].
2516 guint16 (*emm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string, int string_len) = {
2517 /* 9.9.3 EPS Mobility Management (EMM) information elements */
2518 de_emm_add_upd_res, /* 9.9.3.0A Additional update result */
2519 de_emm_add_upd_type, /* 9.9.3.0B Additional update type */
2520 NULL, /* 9.9.3.1 Authentication failure parameter(dissected in packet-gsm_a_dtap.c) */
2521 NULL, /* 9.9.3.2 Authentication parameter AUTN(packet-gsm_a_dtap.c) */
2522 NULL, /* 9.9.3.3 Authentication parameter RAND */
2523 de_emm_auth_resp_par, /* 9.9.3.4 Authentication response parameter */
2524 de_emm_csfb_resp, /* 9.9.3.5 CSFB response */
2525 NULL, /* 9.9.3.6 Daylight saving time (packet-gsm_a_dtap.c)*/
2526 NULL, /* 9.9.3.7 Detach type */
2527 NULL, /* 9.9.3.8 DRX parameter */
2528 de_emm_cause, /* 9.9.3.9 EMM cause */
2529 NULL, /* 9.9.3.10 EPS attach result (coded inline) */
2530 NULL, /* 9.9.3.11 EPS attach type(Coded Inline) */
2531 de_emm_eps_mid, /* 9.9.3.12 EPS mobile identity */
2532 de_emm_eps_net_feature_sup, /* 9.9.3.12A EPS network feature support */
2533 NULL, /* 9.9.3.13 EPS update result (Coded Inline)*/
2534 NULL, /* 9.9.3.14 EPS update type (Inline)*/
2535 de_emm_esm_msg_cont, /* 9.9.3.15 ESM message conta */
2536 NULL, /* 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. (packet-gsm_a_gm.c)*/
2537 NULL, /* 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. */
2538 de_emm_nas_imeisv_req, /* 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. */
2539 de_emm_nas_ksi_and_seq_no, /* 9.9.3.19 KSI and sequence number */
2540 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) */
2541 de_emm_nas_key_set_id, /* 9.9.3.21 NAS key set identifier (Coded Inline) */
2542 de_emm_nas_msg_cont, /* 9.9.3.22 NAS message container */
2543 de_emm_nas_sec_alsgs, /* 9.9.3.23 NAS security algorithms */
2544 NULL, /* 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. (packet-gsm_a_dtap.c)*/
2545 de_emm_nonce, /* 9.9.3.25 Nonce */
2546 de_emm_paging_id, /* 9.9.3.25A Paging identity */
2547 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)*/
2548 NULL, /* 9.9.3.27 Service type */
2549 de_emm_nas_short_mac, /* 9.9.3.28 Short MAC */
2550 NULL, /* 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. (packet-gsm_a_dtap.c)*/
2551 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)*/
2552 NULL, /* 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. (packet-gsm_a_gm.c)*/
2553 de_emm_trac_area_id, /* 9.9.3.32 Tracking area identity */
2554 de_emm_trac_area_id_lst, /* 9.9.3.33 Tracking area identity list */
2555 de_emm_ue_net_cap, /* 9.9.3.34 UE network capability */
2556 de_emm_ue_ra_cap_inf_upd_need, /* 9.9.3.35 UE radio capability information update needed */
2557 de_emm_ue_sec_cap, /* 9.9.3.36 UE security capability */
2558 NULL, /* 9.9.3.37 Emergency Number List (packet-gsm_A_dtap.c) */
2559 NULL, /* 9.9.3.38 CLI */
2560 de_emm_ss_code, /* 9.9.3.39 SS Code */
2561 de_emm_lcs_ind, /* 9.9.3.40 LCS indicator */
2562 de_emm_lcs_client_id, /* 9.9.3.41 LCS client identity */
2563 de_emm_gen_msg_cont_type, /* 9.9.3.42 Generic message container type */
2564 de_emm_gen_msg_cont, /* 9.9.3.43 Generic message container */
2565 NULL, /* 9.9.3.44 Voice domain preference and UE's usage setting */
2569 /* 9.9.4 EPS Session Management (ESM) information elements */
2570 const value_string nas_esm_elem_strings[] = {
2571 { 0x00, "Access point name" }, /* 9.9.4.1 Access point name */
2572 { 0x00, "APN aggregate maximum bit rate" }, /* 9.9.4.2 APN aggregate maximum bit rate */
2573 { 0x00, "EPS quality of service" }, /* 9.9.4.3 EPS quality of service */
2574 { 0x00, "ESM cause" }, /* 9.9.4.4 ESM cause */
2575 { 0x00, "ESM information transfer flag" }, /* 9.9.4.5 ESM information transfer flag */
2576 { 0x00, "Linked EPS bearer identity" }, /* 9.9.4.6 Linked EPS bearer identity */
2577 { 0x00, "LLC service access point identifier" }, /* 9.9.4.7 LLC service access point identifier */
2578 { 0x00, "Notification indicator" }, /* 9.9.4.7a Notification indicator */
2579 { 0x00, "Packet flow identifier" }, /* 9.9.4.8 Packet flow identifier */
2580 { 0x00, "PDN address" }, /* 9.9.4.9 PDN address */
2581 { 0x00, "PDN type" }, /* 9.9.4.10 PDN type */
2582 { 0x00, "Protocol configuration options" }, /* 9.9.4.11 Protocol configuration options */
2583 { 0x00, "Quality of service" }, /* 9.9.4.12 Quality of service */
2584 { 0x00, "Radio priority" }, /* 9.9.4.13 Radio priority */
2585 { 0x00, "Request type" }, /* 9.9.4.14 Request type */
2586 { 0x00, "Traffic flow aggregate description" }, /* 9.9.4.15 Traffic flow aggregate description */
2587 { 0x00, "Traffic flow templat" }, /* 9.9.4.16 Traffic flow template */
2588 { 0x00, "Transaction identifier" }, /* 9.9.4.17 Transaction identifier */
2593 #define NUM_NAS_ESM_ELEM (sizeof(nas_esm_elem_strings)/sizeof(value_string))
2594 gint ett_nas_eps_esm_elem[NUM_NAS_ESM_ELEM];
2598 DE_ESM_APN, /* 9.9.4.1 Access point name */
2599 DE_ESM_APN_AGR_MAX_BR, /* 9.9.4.2 APN aggregate maximum bit rate */
2600 DE_ESM_EPS_QOS, /* 9.9.4.3 EPS quality of service */
2601 DE_ESM_CAUSE, /* 9.9.4.4 ESM cause */
2602 DE_ESM_INF_TRF_FLG, /* 9.9.4.5 ESM information transfer flag */
2603 DE_ESM_LNKED_EPS_B_ID, /* 9.9.4.6 Linked EPS bearer identity */
2604 DE_ESM_LLC_SAPI, /* 9.9.4.7 LLC service access point identifier */
2605 DE_ESM_NOTIF_IND, /* 9.9.4.7a Notification indicator */
2606 DE_ESM_P_FLW_ID, /* 9.9.4.8 Packet flow identifier */
2607 DE_ESM_PDN_ADDR, /* 9.9.4.9 PDN address */
2608 DE_ESM_PDN_TYPE, /* 9.9.4.10 PDN type */
2609 DE_ESM_PROT_CONF_OPT, /* 9.9.4.11 Protocol configuration options */
2610 DE_ESM_QOS, /* 9.9.4.12 Quality of service */
2611 DE_ESM_RA_PRI, /* 9.9.4.13 Radio priority */
2612 DE_ESM_REQ_TYPE, /* 9.9.4.14 Request type */
2613 DE_ESM_TRAF_FLOW_AGR_DESC, /* 9.9.4.15 Traffic flow aggregate description */
2614 DE_ESM_TRAF_FLOW_TEMPL, /* 9.9.4.16 Traffic flow template */
2615 DE_ESM_TID, /* 9.9.4.17 Transaction identifier */
2616 DE_ESM_NONE /* NONE */
2621 guint16 (*esm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string, int string_len) = {
2622 NULL, /* 9.9.4.1 Access point name */
2623 de_esm_apn_aggr_max_br, /* 9.9.4.2 APN aggregate maximum bit rate */
2624 de_esm_qos, /* 9.9.4.3 EPS quality of service */
2625 de_esm_cause, /* 9.9.4.4 ESM cause */
2626 de_esm_inf_trf_flg, /* 9.9.4.5 ESM information transfer flag */
2627 de_esm_lnkd_eps_bearer_id, /* 9.9.4.6 Linked EPS bearer identity */
2628 NULL, /* 9.9.4.7 LLC service access point identifier */
2629 de_esm_notif_ind, /* 9.9.4.7a Notification indicator */
2630 NULL, /* 9.9.4.8 Packet flow identifier */
2631 de_esm_pdn_addr, /* 9.9.4.9 PDN address */
2632 NULL, /* 9.9.4.10 PDN type */
2633 NULL, /* 9.9.4.11 Protocol configuration options */
2634 NULL, /* 9.9.4.12 Quality of service */
2635 NULL, /* 9.9.4.13 Radio priority */
2636 NULL, /* 9.9.4.14 Request type */
2637 NULL, /* 9.9.4.15 Traffic flow aggregate description */
2638 NULL, /* 9.9.4.16 Traffic flow template */
2639 NULL, /* 9.9.4.17 Transaction identifier */
2643 /* MESSAGE FUNCTIONS */
2646 * 8.2.1 Attach accept
2650 nas_emm_attach_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2652 guint32 curr_offset, bit_offset;
2656 curr_offset = offset;
2659 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2660 bit_offset = curr_offset<<3;
2661 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2663 /* EPS attach result EPS attach result 9.9.3.10 M V 1/2 */
2664 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2666 proto_tree_add_bits_item(tree, hf_nas_eps_emm_EPS_attach_result, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2668 /* Fix up the lengths */
2671 /* T3412 value GPRS timer 9.9.3.16 M V 1 */
2672 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3412 value");
2673 /* Tracking area identity list 9.9.3.33 M LV 7-97 */
2674 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - TAI list");
2675 /* ESM message container 9.9.3.15 M LV-E 2-n */
2676 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL);
2677 /* 50 GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
2678 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
2679 /* 13 Location area identification Location area identification 9.9.2.2 O TV 6 */
2680 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, NULL);
2681 /* 23 MS identity Mobile identity 9.9.2.3 O TLV 7-10 */
2682 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - MS identity");
2683 /* 53 EMM cause EMM cause 9.9.3.9 O TV 2 */
2684 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
2685 /* 17 T3402 value GPRS timer 9.9.3.16 O TV 2 */
2686 ELEM_OPT_TV(0x17, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3402 value");
2687 /* 59 T3423 value GPRS timer 9.9.3.16 O TV 2 */
2688 ELEM_OPT_TV(0x59, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3423 value");
2689 /* 4A Equivalent PLMNs PLMN list 9.9.2.8 O TLV 5-47 */
2690 ELEM_OPT_TLV(0x4a, GSM_A_PDU_TYPE_COMMON, DE_PLMN_LIST, " - Equivalent PLMNs");
2691 /* 34 Emergency Number List 9.9.3.37 O TLV 5-50 */
2692 ELEM_OPT_TLV(0x34, GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST, NULL);
2693 /* 64 EPS network feature support EPS network feature support 9.9.3.12A O TLV 3 */
2694 ELEM_OPT_TLV(0x64, NAS_PDU_TYPE_EMM, DE_EMM_EPS_NET_FEATURE_SUP, NULL);
2695 /* F- Additional update result Additional update result 9.9.3.0A O TV 1 */
2696 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_RES, NULL );
2698 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2701 * 8.2.2 Attach complete
2704 nas_emm_attach_comp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2706 guint32 curr_offset;
2710 curr_offset = offset;
2713 /* ESM message container ESM message container 9.9.3.15 M LV-E 2-n */
2714 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL);
2716 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2721 * 8.2.3 Attach reject
2724 nas_emm_attach_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2726 guint32 curr_offset;
2730 curr_offset = offset;
2733 /* * EMM cause EMM cause 9.9.3.9 M V 1 */
2734 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
2735 /* 78 ESM message container ESM message container 9.9.3.15 O TLV-E 4-n */
2736 ELEM_OPT_TLV_E(0x78, NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL);
2738 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2742 * 8.2.4 Attach request
2745 nas_emm_attach_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2747 guint32 curr_offset, bit_offset;
2751 curr_offset = offset;
2754 bit_offset = curr_offset<<3;
2756 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
2757 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
2760 /* EPS attach type EPS attach type 9.9.3.11 M V 1/2
2763 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2765 proto_tree_add_bits_item(tree, hf_nas_eps_emm_eps_att_type, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2768 /* Fix the lengths */
2771 /* Old GUTI or IMSI EPS mobile identity 9.9.3.12 M LV 5-12 */
2772 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Old GUTI or IMSI");
2773 /* UE network capability UE network capability 9.9.3.34 M LV 3-14 */
2774 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_UE_NET_CAP, NULL);
2775 /* ESM message container ESM message container 9.9.3.15 M LV-E 2-n */
2776 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL);
2777 /* 19 Old P-TMSI signature P-TMSI signature 10.5.5.8 O TV 4 */
2778 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, " - Old P-TMSI Signature");
2779 /* 50 Additional GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
2780 ELEM_OPT_TLV( 0x50 , NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Additional GUTI");
2781 /* 52 Last visited registered TAI Tracking area identity 9.9.3.32 O TV 6 */
2782 ELEM_OPT_TV(0x52, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, " - Last visited registered TAI");
2783 /* 5c DRX parameter DRX parameter 9.9.3.8 O TV 3 */
2784 ELEM_OPT_TV(0x5c, GSM_A_PDU_TYPE_GM, DE_DRX_PARAM, NULL );
2785 /* 31 MS network capability MS network capability 9.9.3.20 M LV 3-9 */
2786 ELEM_OPT_TLV( 0x31, GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP , NULL );
2787 /* 13 Old location area identification Location area identification 9.9.2.2 O TV 6 */
2788 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, " - Old location area identification");
2789 /* 9- TMSI status TMSI status 9.9.3.31 O TV 1 */
2790 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , NULL );
2791 /* 11 Mobile station classmark 2 Mobile station classmark 2 9.9.2.5 O TLV 5 */
2792 ELEM_OPT_TLV( 0x11, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_2 , NULL );
2793 /* 20 Mobile station classmark 3 Mobile station classmark 3 9.9.2.5 O TLV 2-34 */
2794 ELEM_OPT_TLV( 0x20, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_3 , NULL );
2795 /* 40 Supported Codecs Supported Codec List 9.9.2.10 O TLV 5-n */
2796 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, " - Supported Codecs");
2797 /* F- Additional update type Additional update type 9.9.3.0B O TV 1 */
2798 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_TYPE, NULL );
2799 /* 5D Voice domain preference and UE's usage setting Voice domain preference and UE's usage setting 9.9.3.44 O TLV 3 */
2800 ELEM_OPT_TLV(0x5D, GSM_A_PDU_TYPE_GM, DE_VOICE_DOMAIN_PREF, NULL);
2802 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2805 * 8.2.5 Authentication failure
2808 nas_emm_attach_fail(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2810 guint32 curr_offset;
2814 curr_offset = offset;
2817 /* EMM cause EMM cause 9.9.3.9 M V 1 */
2818 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
2819 /* 30 Authentication failure parameter Authentication failure parameter 9.9.3.1 O TLV 1 */
2820 ELEM_OPT_TLV(0x30, GSM_A_PDU_TYPE_DTAP, DE_AUTH_FAIL_PARAM, NULL);
2822 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2825 * 8.2.6 Authentication reject
2829 * 8.2.7 Authentication request
2833 nas_emm_auth_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2835 guint32 curr_offset, bit_offset;
2839 curr_offset = offset;
2842 bit_offset = curr_offset<<3;
2844 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2845 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2849 * NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2
2851 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, " ASME");
2854 /* Fix the lengths */
2859 * Authentication parameter RAND (EPS challenge) 9.9.3.3 M V 16
2861 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_RAND, " - EPS challenge");
2863 * Authentication parameter AUTN (EPS challenge) 9.9.3.2 M LV 17
2865 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_AUTN, " - EPS challenge");
2867 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2871 * 8.2.8 Authentication response
2874 nas_emm_auth_resp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2876 guint32 curr_offset;
2880 curr_offset = offset;
2884 * Authentication response parameter 9.9.3.4 M LV 5-17
2886 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_AUTH_RESP_PAR, NULL);
2888 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2892 * 8.2.9 CS service notification
2896 nas_emm_cs_serv_not(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2898 guint32 curr_offset;
2902 curr_offset = offset;
2907 /* Paging identity Paging identity 9.9.3.25A M V 1 */
2908 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_PAGING_ID, NULL);
2909 /* 60 CLI CLI 9.9.3.38 O TLV 3-12 */
2910 ELEM_OPT_TLV(0x60, GSM_A_PDU_TYPE_DTAP, DE_CLD_PARTY_BCD_NUM, " - CLI");
2911 /* 61 SS Code SS Code 9.9.3.39 O TV 2 */
2912 ELEM_OPT_TV(0x61, NAS_PDU_TYPE_EMM, DE_EMM_SS_CODE, NULL);
2913 /* 62 LCS indicator LCS indicator 9.9.3.40 O TV 2 */
2914 ELEM_OPT_TV(0x62, NAS_PDU_TYPE_EMM, DE_EMM_LCS_IND, NULL);
2915 /* 63 LCS client identity LCS client identity 9.9.3.41 O TLV 3-257 */
2916 ELEM_OPT_TLV(0x63, NAS_PDU_TYPE_EMM, DE_EMM_LCS_CLIENT_ID, NULL);
2918 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2921 * 8.2.10 Detach accept
2922 * 8.2.10.1 Detach accept (UE originating detach)
2924 * 8.2.10.2 Detach accept (UE terminated detach)
2928 * 8.2.11 Detach request
2929 * 8.2.11.1 Detach request (UE originating detach)
2933 nas_emm_detach_req_UL(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2935 guint32 curr_offset,bit_offset;
2939 curr_offset = offset;
2942 proto_tree_add_text(tree, tvb, curr_offset, len,"Up link");
2943 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
2944 bit_offset = curr_offset<<3;
2945 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
2947 /* Detach type Detach type 9.9.3.6 M V 1/2 */
2948 proto_tree_add_bits_item(tree, hf_nas_eps_emm_switch_off, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2950 proto_tree_add_bits_item(tree, hf_nas_eps_emm_detach_type_UL, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2953 /* Fix the lengths */
2957 /* GUTI or IMSI EPS mobile identity 9.9.3.12 M LV 5-12 */
2958 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI or IMSI");
2963 * 8.2.11.2 Detach request (UE terminated detach)
2966 nas_emm_detach_req_DL(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2968 guint32 curr_offset, bit_offset;
2972 curr_offset = offset;
2975 proto_tree_add_text(tree, tvb, curr_offset, len,"Down link");
2976 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2977 bit_offset = curr_offset<<3;
2978 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2980 /* Detach type Detach type 9.9.3.6 M V 1/2 */
2981 /* In the network to UE direction bit 4 is spare. The network shall set this bit to zero. */
2982 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2984 proto_tree_add_bits_item(tree, hf_nas_eps_emm_detach_type_DL, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2987 /* Fix the lengths */
2991 /* No more mandatory elements */
2995 /* EMM cause EMM cause 9.9.3.9 O TV 2 */
2996 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
2998 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3003 nas_emm_detach_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3005 guint32 curr_offset;
3008 curr_offset = offset;
3012 if(pinfo->link_dir==P2P_DIR_UL){
3013 nas_emm_detach_req_UL(tvb, tree, pinfo, offset, len);
3015 }else if(pinfo->link_dir==P2P_DIR_DL){
3016 nas_emm_detach_req_DL(tvb, tree, pinfo, offset, len);
3020 proto_tree_add_text(tree, tvb, curr_offset, len,"UL/DL not known, can't properly dissect");
3021 proto_tree_add_text(tree, tvb, curr_offset, len,"Trying to dissect as UE terminated detach");
3022 nas_emm_detach_req_DL(tvb, tree, pinfo, offset, len);
3023 proto_tree_add_text(tree, tvb, curr_offset, len,"Trying to dissect as UE originating detach");
3024 nas_emm_detach_req_UL(tvb, tree, pinfo, offset, len);
3031 * 8.2.12 Downlink NAS Transport
3034 nas_emm_dl_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3036 guint32 curr_offset;
3040 curr_offset = offset;
3043 pinfo->link_dir = P2P_DIR_DL;
3045 /* NAS message container NAS message container 9.9.3.22 M LV 3-252 */
3046 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_NAS_MSG_CONT, NULL);
3048 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3051 * 8.2.13 EMM information
3054 nas_emm_emm_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3056 guint32 curr_offset;
3060 curr_offset = offset;
3063 /* 43 Full name for network Network name 9.9.3.24 O TLV 3-? */
3064 ELEM_OPT_TLV(0x43, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Full name for network");
3065 /* 45 Short name for network Network name 9.9.3.24 O TLV 3-? */
3066 ELEM_OPT_TLV(0x45, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Short Name");
3067 /* 46 Local time zone Time zone 9.9.3.29 O TV 2 */
3068 ELEM_OPT_TV(0x46, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE, " - Local");
3069 /* 47 Universal time and local time zone Time zone and time 9.9.3.30 O TV 8 */
3070 ELEM_OPT_TV(0x47, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE_TIME, " - Universal Time and Local Time Zone");
3071 /* 49 Network daylight saving time Daylight saving time 9.9.3.6 O TLV 3 */
3072 ELEM_OPT_TLV(0x49, GSM_A_PDU_TYPE_DTAP, DE_DAY_SAVING_TIME, NULL);
3074 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3082 nas_emm_emm_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3084 guint32 curr_offset;
3088 curr_offset = offset;
3091 /* EMM cause EMM cause 9.9.3.9 M V 1 */
3092 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
3094 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3098 * 8.2.15 Extended service request
3101 nas_emm_ext_serv_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3103 guint32 curr_offset,bit_offset;
3107 curr_offset = offset;
3110 bit_offset = curr_offset<<3;
3112 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
3113 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
3115 /* Service type Service type 9.9.3.27 M V 1/2 Service type*/
3116 proto_tree_add_bits_item(tree, hf_nas_eps_service_type, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3118 /* Fix up the lengths */
3122 /* M-TMSI Mobile identity 9.9.2.3 M LV 6 */
3123 ELEM_MAND_LV(NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - M-TMSI");
3124 /* B- CSFB response CSFB response 9.9.3.5 C TV 1 */
3125 ELEM_OPT_TV_SHORT(0xb0, NAS_PDU_TYPE_EMM, DE_EMM_CSFB_RESP, NULL);
3126 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
3127 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, NULL);
3129 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3132 * 8.2.16 GUTI reallocation command
3135 nas_emm_guti_realloc_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3137 guint32 curr_offset;
3141 curr_offset = offset;
3144 /* GUTI EPS mobile identity 9.9.3.12 M LV 12 */
3145 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
3147 /* 54 TAI list Tracking area identity list 9.9.3.33 O TLV 8-98 */
3148 ELEM_OPT_TLV(0x54, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, NULL);
3150 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3154 * 8.2.17 GUTI reallocation complete
3158 * 8.2.18 Identity request
3162 nas_emm_id_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3164 guint32 curr_offset, bit_offset;
3165 /*guint32 consumed;*/
3168 curr_offset = offset;
3172 bit_offset=curr_offset<<3;
3174 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
3175 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3178 /* Identity type Identity type 2 9.9.3.17 M V 1/2 */
3179 proto_tree_add_bits_item(tree, hf_nas_eps_emm_id_type2, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3184 /* Fix up the lengths */
3188 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3191 * 8.2.19 Identity response
3194 nas_emm_id_res(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3196 guint32 curr_offset;
3200 curr_offset = offset;
3203 /* Mobile identity Mobile identity 9.9.2.3 M LV 4-10 */
3204 ELEM_MAND_LV(NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, NULL);
3206 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3212 * 8.2.20 Security mode command
3215 nas_emm_sec_mode_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3217 guint32 curr_offset, bit_offset;
3221 curr_offset = offset;
3224 /* Selected NAS security algorithms NAS security algorithms 9.9.3.23 M V 1 */
3225 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_NAS_SEC_ALGS, " - Selected NAS security algorithms");
3227 bit_offset = curr_offset<<3;
3228 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
3229 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3231 /* NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2 */
3232 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, " ASME");
3235 /* Fix up the lengths */
3239 /* Replayed UE security capabilities UE security capability 9.9.3.36 M LV 3-6 */
3240 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_UE_SEC_CAP, " - Replayed UE security capabilities");
3241 /* C- IMEISV request IMEISV request 9.9.3.18 O TV 1 */
3242 ELEM_OPT_TV_SHORT( 0xC0 , NAS_PDU_TYPE_EMM, DE_EMM_IMEISV_REQ , NULL );
3243 /* 55 Replayed NonceUE Nonce 9.9.3.25 O TV 5 */
3244 ELEM_OPT_TV(0x55, NAS_PDU_TYPE_EMM, DE_EMM_NONCE, " - Replayed NonceUE");
3245 /* 56 NonceMME Nonce 9.9.3.25 O TV 5 */
3246 ELEM_OPT_TV(0x56, NAS_PDU_TYPE_EMM, DE_EMM_NONCE, " - NonceMME");
3248 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3251 * 8.2.21 Security mode complete
3254 nas_emm_sec_mode_comp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3256 guint32 curr_offset;
3260 curr_offset = offset;
3266 /* 23 IMEISV Mobile identity 9.9.2.3 O TLV 11 */
3267 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - IMEISV");
3269 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3272 * 8.2.22 Security mode reject
3275 nas_emm_sec_mode_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3277 guint32 curr_offset;
3281 curr_offset = offset;
3284 /* EMM cause EMM cause 9.9.3.9 M V 1 */
3285 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
3287 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3290 * 8.2.23 Security protected NAS message
3294 nas_emm_sec_prot_msg(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3296 guint32 curr_offset;
3298 guint8 security_header_type;
3300 curr_offset = offset;
3303 /* Security header type Security header type 9.3.1 M V 1/2 */
3304 security_header_type = tvb_get_guint8(tvb,offset)>>4;
3305 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, 0, 1, ENC_BIG_ENDIAN);
3306 /* Protocol discriminator Protocol discriminator 9.2 M V 1/2 */
3307 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, ENC_BIG_ENDIAN);
3309 /* Message authentication code Message authentication code 9.5 M V 4 */
3310 if (security_header_type !=0){
3311 /* Message authentication code */
3312 proto_tree_add_item(tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, ENC_BIG_ENDIAN);
3314 if ((security_header_type==2)||(security_header_type==4)){
3315 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
3316 proto_tree_add_text(tree, tvb, offset, len-5,"Ciphered message");
3320 proto_tree_add_text(tree, tvb, offset, len,"Not a security protected message");
3323 /* Sequence number Sequence number 9.6 M V 1 */
3324 proto_tree_add_item(tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
3326 /* NAS message NAS message 9.7 M V 1-n */
3331 * 8.2.24 Service reject
3334 nas_emm_serv_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3336 guint32 curr_offset;
3340 curr_offset = offset;
3343 /* EMM cause EMM cause 9.9.3.9 M V 1 */
3344 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
3346 /* 5B T3442 value GPRS timer 9.9.3.16 C TV 2 */
3347 ELEM_OPT_TV(0x5b, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3442 value");
3349 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3352 * 8.2.25 Service request
3353 * This message is sent by the UE to the network to request the establishment
3354 * of a NAS signalling connection and of the radio and S1 bearers.
3355 * Its structure does not follow the structure of a standard layer 3 message. See table 8.2.25.1.
3358 * Protocol discriminator Protocol discriminator 9.2 M V 1/2
3359 * Security header type Security header type 9.3.1 M V 1/2
3360 * KSI and sequence number KSI and sequence number 9.9.3.19 M V 1
3361 * Message authentication code (short) Short MAC 9.9.3.28 M V 2
3364 nas_emm_service_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3366 guint32 curr_offset;
3370 curr_offset = offset;
3373 /* KSI and sequence number 9.9.3.19 M V 1 */
3374 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_KSI_AND_SEQ_NO, NULL);
3376 /* Short MAC 9.9.3.28 M V 2 */
3377 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_SHORT_MAC, " - Message authentication code (short)");
3379 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3383 * 8.2.26 Tracking area update accept
3386 nas_emm_trac_area_upd_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3388 guint32 curr_offset, bit_offset;
3392 curr_offset = offset;
3395 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
3396 bit_offset = curr_offset<<3;
3397 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3399 /* EPS update result EPS update result 9.9.3.13 M V 1/2 */
3400 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3402 proto_tree_add_bits_item(tree, hf_nas_eps_eps_update_result_value, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
3404 /* Fix up the lengths */
3407 /* No more mandatory elements */
3410 /* 5A T3412 value GPRS timer 9.9.3.16 O TV 2 */
3411 ELEM_OPT_TV(0x5a, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3412 value");
3412 /* 50 GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
3413 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
3414 /* 54 TAI list Tracking area identity list 9.9.3.33 O TLV 8-98 */
3415 ELEM_OPT_TLV(0x54, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, NULL);
3416 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
3417 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, NULL);
3418 /* 13 Location area identification Location area identification 9.9.2.2 O TV 6 */
3419 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, NULL);
3420 /* 23 MS identity Mobile identity 9.9.2.3 O TLV 7-10 */
3421 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - MS identity");
3422 /* 53 EMM cause EMM cause 9.9.3.9 O TV 2 */
3423 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
3424 /* 17 T3402 value GPRS timer 9.9.3.16 O TV 2 */
3425 ELEM_OPT_TV(0x17, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3402 value");
3426 /* 59 T3423 value GPRS timer 9.9.3.16 O TV 2 */
3427 ELEM_OPT_TV(0x59, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3423 value");
3428 /* 4A Equivalent PLMNs PLMN list 9.9.2.8 O TLV 5-47 */
3429 ELEM_OPT_TLV(0x4a, GSM_A_PDU_TYPE_COMMON, DE_PLMN_LIST, " - PLMN list");
3430 /* 34 Emergency Number List Emergency Number List 9.9.3.37 O TLV 5-50 */
3431 ELEM_OPT_TLV(0x34, GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST, NULL);
3432 /* 64 EPS network feature support EPS network feature support 9.9.3.12A O TLV 3 */
3433 ELEM_OPT_TLV(0x64, NAS_PDU_TYPE_EMM, DE_EMM_EPS_NET_FEATURE_SUP, NULL);
3434 /* F- Additional update result Additional update result 9.9.3.0A O TV 1 */
3435 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_RES, NULL );
3437 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3440 * 8.2.27 Tracking area update complete
3444 * 8.2.28 Tracking area update reject
3447 nas_emm_trac_area_upd_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3449 guint32 curr_offset;
3453 curr_offset = offset;
3456 /* EMM cause EMM cause 9.9.3.9 M V 1 */
3457 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
3459 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3462 * 8.2.29 Tracking area update request
3465 nas_emm_trac_area_upd_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3468 guint32 curr_offset, bit_offset;
3472 curr_offset = offset;
3475 bit_offset = curr_offset<<3;
3477 /* NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2 */
3478 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, " ASME");
3481 /* EPS update type EPS update type 9.9.3.14 M V 1/2 */
3482 proto_tree_add_bits_item(tree, hf_nas_eps_active_flg, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3484 proto_tree_add_bits_item(tree, hf_nas_eps_eps_update_type_value, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
3487 /* Fix the lengths */
3490 /* Old GUTI EPS mobile identity 9.9.3.12 M LV 12 */
3491 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Old GUTI");
3492 /* No more Mandatory elements */
3494 /* B- NAS key set identifier Non-current native NAS key set identifier 9.9.3.21 O TV 1 */
3495 ELEM_OPT_TV_SHORT( 0xb0 , NAS_PDU_TYPE_EMM, DE_EMM_NAS_KEY_SET_ID , " - Non-current native NAS key set identifier" );
3496 /* 8- GPRS ciphering key sequence number Ciphering key sequence number 9.9.3.4a O TV 1 */
3497 ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_COMMON, DE_CIPH_KEY_SEQ_NUM, " - GPRS ciphering key sequence number");
3498 /* 19 Old P-TMSI signature P-TMSI signature 9.9.3.26 O TV 4 */
3499 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, " - Old P-TMSI Signature");
3500 /* 50 Additional GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
3501 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Additional GUTI");
3502 /* 55 NonceUE Nonce 9.9.3.25 O TV 5 */
3503 ELEM_OPT_TV(0x55, NAS_PDU_TYPE_EMM, DE_EMM_NONCE, " - NonceUE");
3504 /* 58 UE network capability UE network capability 9.9.3.34 O TLV 4-15 */
3505 ELEM_OPT_TLV(0x58, NAS_PDU_TYPE_EMM, DE_EMM_UE_NET_CAP, NULL);
3506 /* 52 Last visited registered TAI Tracking area identity 9.9.3.32 O TV 6 */
3507 ELEM_OPT_TV(0x52, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, " - Last visited registered TAI");
3508 /* 5C DRX parameter DRX parameter 9.9.3.8 O TV 3 */
3509 ELEM_OPT_TV(0x5c, GSM_A_PDU_TYPE_GM, DE_DRX_PARAM, NULL );
3510 /* A- UE radio capability information update needed UE radio capability information update needed 9.9.3.35 O TV 1 */
3511 ELEM_OPT_TV_SHORT( 0xA0 , NAS_PDU_TYPE_EMM, DE_EMM_UE_RA_CAP_INF_UPD_NEED , NULL );
3512 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
3513 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, NULL);
3514 /* 31 MS network capability MS network capability 9.9.3.20 O TLV 4-10 */
3515 ELEM_OPT_TLV( 0x31 , GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP , NULL );
3516 /* 13 Old location area identification Location area identification 9.9.2.2 O TV 6 */
3517 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, " - Old location area identification");
3518 /* 9- TMSI status TMSI status 9.9.3.31 O TV 1 */
3519 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , NULL );
3520 /* 11 Mobile station classmark 2 Mobile station classmark 2 9.9.2.5 O TLV 5 */
3521 ELEM_OPT_TLV( 0x11, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_2 , NULL );
3522 /* 20 Mobile station classmark 3 Mobile station classmark 3 9.9.2.5 O TLV 2-34 */
3523 ELEM_OPT_TLV( 0x20, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_3 , NULL );
3524 /* 40 Supported Codecs Supported Codec List 9.9.2.10 O TLV 5-n */
3525 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, " - Supported Codecs");
3526 /* F- Additional update type Additional update type 9.9.3.0B O TV 1 */
3527 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_TYPE, NULL );
3528 /* 5D Voice domain preference and UE's usage setting Voice domain preference and UE's usage setting 9.9.3.44 O TLV 3 */
3529 ELEM_OPT_TLV(0x5D, GSM_A_PDU_TYPE_GM, DE_VOICE_DOMAIN_PREF, NULL);
3531 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3535 * 8.2.30 Uplink NAS Transport
3538 nas_emm_ul_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3540 guint32 curr_offset;
3544 curr_offset = offset;
3547 pinfo->link_dir = P2P_DIR_UL;
3549 /* NAS message container NAS message container 9.9.3.22 M LV 3-252*/
3550 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_NAS_MSG_CONT, NULL);
3552 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3556 * 8.2.31 Downlink generic NAS transport
3559 nas_emm_dl_gen_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3561 guint32 curr_offset;
3565 curr_offset = offset;
3568 pinfo->link_dir = P2P_DIR_DL;
3570 /* Generic message container type Generic message container type 9.9.3.42 M V 1 */
3571 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT_TYPE, NULL);
3572 /* Generic message container Generic message container 9.9.3.43 M LV-E 3-n */
3573 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT, NULL)
3574 /* 65 Additional information Additional information 9.9.2.0 O TLV 3-n */
3575 ELEM_OPT_TLV(0x65, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_ADD_INFO, NULL);
3577 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3579 eps_nas_gen_msg_cont_type = 0;
3583 * 8.2.32 Uplink generic NAS transport
3586 nas_emm_ul_gen_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3588 guint32 curr_offset;
3592 curr_offset = offset;
3595 pinfo->link_dir = P2P_DIR_UL;
3597 /* Generic message container type Generic message container type 9.9.3.42 M V 1 */
3598 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT_TYPE, NULL);
3599 /* Generic message container Generic message container 9.9.3.43 M LV-E 3-n */
3600 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT, NULL)
3601 /* 65 Additional information Additional information 9.9.2.0 O TLV 3-n */
3602 ELEM_OPT_TLV(0x65, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_ADD_INFO, NULL);
3604 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3606 eps_nas_gen_msg_cont_type = 0;
3610 * 8.3 EPS session management messages
3614 * 8.3.1 Activate dedicated EPS bearer context accept
3617 nas_esm_act_ded_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3619 guint32 curr_offset;
3626 curr_offset = offset;
3629 /* This message is sent by the UE to the network */
3630 pinfo->link_dir = P2P_DIR_UL;
3632 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3633 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3635 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3639 * 8.3.2 Activate dedicated EPS bearer context reject
3642 nas_esm_act_ded_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3644 guint32 curr_offset;
3648 curr_offset = offset;
3651 /* This message is sent by UE to the network to reject activation of a dedicated EPS bearer context */
3652 pinfo->link_dir = P2P_DIR_UL;
3654 /* ESM cause ESM cause 9.9.4.2 M V 1 */
3655 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3656 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3657 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3659 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3662 * 8.3.3 Activate dedicated EPS bearer context request
3665 nas_esm_act_ded_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3667 guint32 curr_offset, bit_offset;
3671 curr_offset = offset;
3674 /* This message is sent by the network to the UE to request activation of a dedicated EPS bearer context... */
3675 pinfo->link_dir = P2P_DIR_DL;
3678 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
3679 bit_offset = curr_offset<<3;
3680 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3682 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3683 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3685 /* Fix the lengths */
3689 /* EPS QoS EPS quality of service 9.9.4.3 M LV 2-10 */
3690 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, NULL);
3691 /* TFT Traffic flow template 9.9.4.16 M LV 2-256 */
3692 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , NULL );
3693 /* 5D Transaction identifier Transaction identifier 9.9.4.17 O TLV 3-4 */
3694 ELEM_OPT_TLV( 0x5d , GSM_A_PDU_TYPE_GM, DE_LINKED_TI , " - Transaction identifier" );
3695 /* 30 Negotiated QoS Quality of service 9.9.4.12 O TLV 14-18 */
3696 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
3697 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
3698 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
3699 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
3700 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , NULL );
3701 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
3702 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL );
3703 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3704 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3706 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3710 * 8.3.4 Activate default EPS bearer context accept
3713 nas_esm_act_def_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3715 guint32 curr_offset;
3719 curr_offset = offset;
3725 /* This message is sent by the UE to the network to acknowledge activation of a default EPS bearer context */
3726 pinfo->link_dir = P2P_DIR_UL;
3728 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3729 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3731 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3735 * 8.3.5 Activate default EPS bearer context reject
3738 nas_esm_act_def_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3740 guint32 curr_offset;
3744 curr_offset = offset;
3747 /* This message is sent by UE to the network to reject activation of a default EPS bearer context. */
3748 pinfo->link_dir = P2P_DIR_UL;
3750 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3751 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3752 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3753 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3755 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3759 * 8.3.6 Activate default EPS bearer context request
3762 nas_esm_act_def_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3764 guint32 curr_offset;
3768 curr_offset = offset;
3771 /* This message is sent by the network to the UE to request activation of a default EPS bearer context. */
3772 pinfo->link_dir = P2P_DIR_DL;
3774 /* EPS QoS EPS quality of service 9.9.4.3 M LV 2-10 */
3775 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, NULL);
3776 /* Access point name Access point name 9.9.4.1 M LV 2-101 */
3777 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL );
3778 /* PDN address PDN address 9.9.4.9 M LV 6-14 DE_ESM_PDN_ADDR*/
3779 ELEM_MAND_LV( NAS_PDU_TYPE_ESM, DE_ESM_PDN_ADDR , NULL );
3780 /* 5D Transaction identifier Transaction identifier 9.9.4.17 O TLV 3-4 */
3781 ELEM_OPT_TLV( 0x5d , GSM_A_PDU_TYPE_GM, DE_LINKED_TI , " - Transaction identifier" );
3782 /* 30 Negotiated QoS Quality of service 9.9.4.12 O TLV 14-18 */
3783 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
3784 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
3785 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
3786 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
3787 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , NULL );
3788 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
3789 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL );
3790 /* 5E APN-AMBR APN aggregate maximum bit rate 9.9.4.2 O TLV 4-8 DE_ESM_APN_AGR_MAX_BR*/
3791 ELEM_OPT_TLV( 0x5e , NAS_PDU_TYPE_ESM, DE_ESM_APN_AGR_MAX_BR , NULL );
3792 /* 58 ESM cause ESM cause 9.9.4.4 O TV 2 */
3793 ELEM_OPT_TV( 0x58 , NAS_PDU_TYPE_ESM, DE_ESM_CAUSE , NULL );
3794 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3795 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3797 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3801 * 8.3.7 Bearer resource allocation reject
3804 nas_esm_bearer_res_all_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3806 guint32 curr_offset;
3810 curr_offset = offset;
3813 /* This message is sent by the network to the UE to reject the allocation of a dedicated bearer resource. */
3814 pinfo->link_dir = P2P_DIR_DL;
3816 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3817 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3818 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3819 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3821 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3825 * 8.3.8 Bearer resource allocation request
3828 nas_esm_bearer_res_all_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3830 guint32 curr_offset, bit_offset;
3834 curr_offset = offset;
3837 /* This message is sent by the UE to the network to request the allocation of a dedicated bearer resource. */
3838 pinfo->link_dir = P2P_DIR_UL;
3840 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
3841 bit_offset = curr_offset<<3;
3842 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3844 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3845 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3847 /* Fix the lengths */
3851 /* Traffic flow aggregate Traffic flow aggregate description 9.9.4.15 M LV 2-256 */
3852 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , " - Traffic flow aggregate" );
3853 /* Required traffic flow QoS EPS quality of service 9.9.4.3 M LV 2-10 */
3854 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, " - Required traffic flow QoS");
3855 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3856 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3858 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3861 * 8.3.9 Bearer resource modification reject
3864 nas_esm_bearer_res_mod_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3866 guint32 curr_offset;
3870 curr_offset = offset;
3873 /* This message is sent by the network to the UE to reject the modification of a dedicated bearer resource. */
3874 pinfo->link_dir = P2P_DIR_DL;
3876 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3877 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3878 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3879 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3881 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3884 * 8.3.10 Bearer resource modification request
3887 nas_esm_bearer_res_mod_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3889 guint32 curr_offset, bit_offset;
3893 curr_offset = offset;
3896 /* This message is sent by the UE to the network to request the modification of a dedicated bearer resource. */
3897 pinfo->link_dir = P2P_DIR_UL;
3899 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
3900 bit_offset = curr_offset<<3;
3901 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3903 /* EPS bearer identity for packet filter Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3904 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3906 /* Fix the lengths */
3909 /* Traffic flow aggregate Traffic flow aggregate description 9.9.4.15 M LV 2-256 */
3910 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , " - Traffic flow aggregate" );
3911 /* 5B Required traffic flow QoS EPS quality of service 9.9.4.3 O TLV 3-11 */
3912 ELEM_OPT_TLV( 0x5B , NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS , " - Required traffic flow QoS" );
3913 /* 58 ESM cause ESM cause 9.9.4.4 O TV 2 */
3914 ELEM_OPT_TV( 0x58 , NAS_PDU_TYPE_ESM, DE_ESM_CAUSE , NULL );
3915 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3916 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3918 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3921 * 8.3.11 Deactivate EPS bearer context accept
3924 nas_esm_deact_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3926 guint32 curr_offset;
3930 curr_offset = offset;
3936 /* This message is sent by the UE to acknowledge deactivation of the EPS bearer context... */
3937 pinfo->link_dir = P2P_DIR_UL;
3939 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV */
3940 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3942 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3945 * 8.3.12 Deactivate EPS bearer context request
3948 nas_esm_deact_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3950 guint32 curr_offset;
3954 curr_offset = offset;
3957 /* This message is sent by the network to request deactivation of an active EPS bearer context. */
3958 pinfo->link_dir = P2P_DIR_DL;
3960 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3961 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3962 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV */
3963 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3965 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3969 * 8.3.13 ESM information request
3973 nas_esm_inf_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3975 guint32 curr_offset;
3978 curr_offset = offset;
3981 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3984 * 8.3.14 ESM information response
3987 nas_esm_inf_resp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3989 guint32 curr_offset;
3993 curr_offset = offset;
3999 /* This message is sent by the UE to the network in response to an ESM INFORMATION REQUEST... */
4000 pinfo->link_dir = P2P_DIR_UL;
4002 /* 28 Access point name Access point name 9.9.4.1 O TLV 3-102 */
4003 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL );
4004 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
4005 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4007 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4013 nas_esm_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
4015 guint32 curr_offset;
4019 curr_offset = offset;
4022 /* ESM cause ESM cause 9.9.4.4 M V 1 */
4023 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
4025 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4028 * 8.3.16 Modify EPS bearer context accept
4031 nas_esm_mod_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
4033 guint32 curr_offset;
4037 curr_offset = offset;
4043 /* This message is sent by the UE to the network to acknowledge the modification of an active EPS bearer context. */
4044 pinfo->link_dir = P2P_DIR_UL;
4046 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
4047 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4049 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4052 * 8.3.17 Modify EPS bearer context reject
4055 nas_esm_mod_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
4057 guint32 curr_offset;
4061 curr_offset = offset;
4064 /* This message is sent by the UE or the network to reject a modification of an active EPS bearer context. */
4065 pinfo->link_dir = P2P_DIR_UL;
4067 /* ESM cause ESM cause 9.9.4.4 M V 1 */
4068 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
4069 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
4070 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4072 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4075 * 8.3.18 Modify EPS bearer context request
4078 nas_esm_mod_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
4080 guint32 curr_offset;
4084 curr_offset = offset;
4090 /*This message is sent by the network to inform the UE about events which are relevant for the upper layer... */
4091 pinfo->link_dir = P2P_DIR_DL;
4093 /* 5B New EPS QoS EPS quality of service 9.9.4.3 O TLV 3-11 */
4094 ELEM_OPT_TLV( 0x5B , NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS , " - New EPS QoS" );
4095 /* 36 TFT Traffic flow template 9.9.4.16 O TLV 3-257 */
4096 ELEM_OPT_TLV( 0x36 , GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , NULL );
4097 /* 30 New QoS Quality of service 9.9.4.12 O TLV 14-18 */
4098 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - New QoS" );
4099 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
4100 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
4101 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
4102 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , NULL );
4103 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
4104 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL );
4105 /* 5E APN-AMBR APN aggregate maximum bit rate 9.9.4.2 O TLV 4-8 */
4106 ELEM_OPT_TLV( 0x5E , NAS_PDU_TYPE_ESM, DE_ESM_APN_AGR_MAX_BR , NULL );
4107 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
4108 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4110 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4113 * 8.3.18A Notification
4116 nas_esm_notification(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
4118 guint32 curr_offset;
4122 curr_offset = offset;
4125 /* Notification indicator Notification indicator 9.9.4.7A M LV 2 */
4126 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_NOTIF_IND, NULL);
4128 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4132 * 8.3.19 PDN connectivity reject
4135 nas_esm_pdn_con_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
4137 guint32 curr_offset;
4141 curr_offset = offset;
4144 /*This message is sent by the network to the UE to reject establishment of a PDN connection. */
4145 pinfo->link_dir = P2P_DIR_DL;
4147 /* ESM cause ESM cause 9.9.4.4 M V 1 */
4148 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
4149 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
4150 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4152 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4156 * 8.3.20 PDN connectivity request
4159 nas_esm_pdn_con_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
4161 guint32 curr_offset;
4166 curr_offset = offset;
4169 /*This message is sent by the UE to the network to initiate establishment of a PDN connection. */
4170 pinfo->link_dir = P2P_DIR_UL;
4172 /* PDN type PDN type 9.9.4.10 M V 1/2 */
4173 bit_offset = curr_offset<<3;
4174 proto_tree_add_bits_item(tree, hf_nas_eps_esm_pdn_type, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4177 /* Request type 9.9.4.14 M V 1/2 */
4178 proto_tree_add_bits_item(tree, hf_nas_eps_esm_request_type, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4180 /* Fix the lengths */
4185 /* D- ESM information transfer flag 9.9.4.5 O TV 1 */
4186 ELEM_OPT_TV_SHORT( 0xd0 , NAS_PDU_TYPE_ESM, DE_ESM_INF_TRF_FLG , NULL );
4187 /* 28 Access point name 9.9.4.1 O TLV 3-102 */
4188 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL );
4189 /* 27 Protocol configuration options 9.9.4.11 O TLV 3-253 */
4190 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4192 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4195 * 8.3.20 PDN disconnect reject
4198 nas_esm_pdn_disc_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
4200 guint32 curr_offset;
4204 curr_offset = offset;
4207 /*This message is sent by the UE to the network to initiate establishment of a PDN connection. */
4208 pinfo->link_dir = P2P_DIR_UL;
4210 /* ESM cause ESM cause 9.9.4.4 M V 1 */
4211 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
4212 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
4213 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4215 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4218 * 8.3.21 PDN disconnect request
4221 nas_esm_pdn_disc_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
4223 guint32 curr_offset, bit_offset;
4227 curr_offset = offset;
4230 /* This message is sent by the network to the UE to reject release of a PDN connection. */
4231 pinfo->link_dir = P2P_DIR_DL;
4233 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
4234 bit_offset = curr_offset<<3;
4235 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4237 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
4238 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4240 /* Fix the lengths */
4245 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
4246 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4248 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4252 #define NUM_NAS_MSG_ESM (sizeof(nas_msg_esm_strings)/sizeof(value_string))
4253 static gint ett_nas_msg_esm[NUM_NAS_MSG_ESM];
4254 static void (*nas_msg_esm_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) = {
4255 nas_esm_act_def_eps_bearer_ctx_req, /* Activate default EPS bearer context request*/
4256 nas_esm_act_def_eps_bearer_ctx_acc, /* Activate default EPS bearer context accept*/
4257 nas_esm_act_def_eps_bearer_ctx_rej, /* Activate default EPS bearer context reject*/
4258 nas_esm_act_ded_eps_bearer_ctx_req, /* Activate dedicated EPS bearer context request*/
4259 nas_esm_act_ded_eps_bearer_ctx_acc, /* Activate dedicated EPS bearer context accept*/
4260 nas_esm_act_ded_eps_bearer_ctx_rej, /* Activate dedicated EPS bearer context reject*/
4261 nas_esm_mod_eps_bearer_ctx_req, /* Modify EPS bearer context request*/
4262 nas_esm_mod_eps_bearer_ctx_acc, /* Modify EPS bearer context accept*/
4263 nas_esm_mod_eps_bearer_ctx_rej, /* Modify EPS bearer context reject*/
4264 nas_esm_deact_eps_bearer_ctx_req, /* Deactivate EPS bearer context request*/
4265 nas_esm_deact_eps_bearer_ctx_acc, /* Deactivate EPS bearer context accept*/
4266 nas_esm_pdn_con_req, /* 8.3.18 PDN connectivity request */
4267 nas_esm_pdn_con_rej, /* PDN connectivity reject*/
4268 nas_esm_pdn_disc_req, /* PDN disconnect request*/
4269 nas_esm_pdn_disc_rej, /* PDN disconnect reject*/
4270 nas_esm_bearer_res_all_req, /* Bearer resource allocation request*/
4271 nas_esm_bearer_res_all_rej, /* Bearer resource allocation reject*/
4272 nas_esm_bearer_res_mod_req, /* Bearer resource modification request*/
4273 nas_esm_bearer_res_mod_rej, /* Bearer resource modification reject*/
4274 nas_esm_inf_req, /* ESM information request, No IE:s*/
4275 nas_esm_inf_resp, /* ESM information response*/
4276 nas_esm_notification, /* Notification */
4277 nas_esm_status, /* ESM status */
4283 get_nas_esm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p)
4287 *msg_str = match_strval_idx((guint32) (oct & 0xff), nas_msg_esm_strings, &idx);
4288 *ett_tree = ett_nas_msg_esm[idx];
4289 *hf_idx = hf_nas_eps_msg_esm_type;
4290 *msg_fcn_p = nas_msg_esm_fcn[idx];
4297 #define NUM_NAS_MSG_EMM (sizeof(nas_msg_emm_strings)/sizeof(value_string))
4298 static gint ett_nas_msg_emm[NUM_NAS_MSG_EMM];
4299 static void (*nas_msg_emm_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) = {
4300 nas_emm_attach_req, /* Attach request */
4301 nas_emm_attach_acc, /* Attach accept */
4302 nas_emm_attach_comp, /* Attach complete */
4303 nas_emm_attach_rej, /* Attach reject */
4304 nas_emm_detach_req, /* Detach request */
4305 NULL, /* 8.2.10 Detach accept */
4307 nas_emm_trac_area_upd_req, /* Tracking area update request */
4308 nas_emm_trac_area_upd_acc, /* Tracking area update accept */
4309 NULL, /* Tracking area update complete (No IE's)*/
4310 nas_emm_trac_area_upd_rej, /* Tracking area update reject */
4312 nas_emm_ext_serv_req, /* Extended service request */
4313 nas_emm_serv_rej, /* Service reject */
4315 nas_emm_guti_realloc_cmd, /* GUTI reallocation command */
4316 NULL, /* GUTI reallocation complete (No IE's) */
4317 nas_emm_auth_req, /* Authentication request */
4318 nas_emm_auth_resp, /* Authentication response */
4319 NULL, /* Authentication reject (No IE:s)*/
4320 nas_emm_attach_fail, /* Authentication failure */
4321 nas_emm_id_req, /* Identity request */
4322 nas_emm_id_res, /* Identity response */
4323 nas_emm_sec_mode_cmd, /* Security mode command */
4324 nas_emm_sec_mode_comp, /* Security mode complete */
4325 nas_emm_sec_mode_rej, /* Security mode reject */
4327 nas_emm_emm_status, /* EMM status */
4328 nas_emm_emm_inf, /* EMM information */
4329 nas_emm_dl_nas_trans, /* Downlink NAS transport */
4330 nas_emm_ul_nas_trans, /* Uplink NAS transport */
4331 nas_emm_cs_serv_not, /* 8.2.9 CS service notification */
4332 nas_emm_dl_gen_nas_trans, /* Downlink generic NAS transport */
4333 nas_emm_ul_gen_nas_trans, /* Uplink generic NAS transport */
4339 get_nas_emm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p)
4343 *msg_str = match_strval_idx((guint32) (oct & 0xff), nas_msg_emm_strings, &idx);
4344 *ett_tree = ett_nas_msg_emm[idx];
4345 *hf_idx = hf_nas_eps_msg_emm_type;
4346 *msg_fcn_p = nas_msg_emm_fcn[idx];
4352 * EPS session management messages.
4353 * A plain NAS message is pased to this function
4356 disect_nas_eps_esm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
4358 const gchar *msg_str;
4362 void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len);
4365 len = tvb_length(tvb);
4367 * EPS bearer identity 9.3.2
4369 proto_tree_add_item(tree, hf_nas_eps_bearer_id, tvb, offset, 1, ENC_BIG_ENDIAN);
4370 /* Protocol discriminator 9.2 */
4371 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
4374 /* Procedure transaction identity 9.4
4375 * The procedure transaction identity and its use are defined in 3GPP TS 24.007
4377 proto_tree_add_item(tree, hf_nas_eps_esm_proc_trans_id, tvb, offset, 1, ENC_BIG_ENDIAN);
4381 oct = tvb_get_guint8(tvb,offset);
4387 get_nas_esm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p);
4390 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, msg_str);
4392 proto_tree_add_text(tree, tvb, offset, 1,"Unknown message 0x%x",oct);
4397 * Add NAS message name
4399 proto_tree_add_item(tree, hf_idx, tvb, offset, 1, ENC_BIG_ENDIAN);
4406 if (msg_fcn_p == NULL)
4408 proto_tree_add_text(tree, tvb, offset, len - offset,
4409 "Message Elements");
4413 (*msg_fcn_p)(tvb, tree, pinfo, offset, len - offset);
4418 * The "real" security header has been dissected or if dissect_header = TRUE
4421 dissect_nas_eps_emm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean second_header)
4423 const gchar *msg_str;
4427 void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len);
4428 guint8 security_header_type, oct;
4430 len = tvb_length(tvb);
4432 /* 9.3.1 Security header type */
4434 security_header_type = tvb_get_guint8(tvb,offset)>>4;
4435 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4436 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
4438 if (security_header_type !=0){
4439 /* Message authentication code */
4440 proto_tree_add_item(tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, ENC_BIG_ENDIAN);
4442 /* Sequence number */
4443 proto_tree_add_item(tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
4445 if ((security_header_type==2)||(security_header_type==4))
4446 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
4448 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4449 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
4454 oct = tvb_get_guint8(tvb,offset);
4460 get_nas_emm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p);
4463 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, msg_str);
4465 proto_tree_add_text(tree, tvb, offset, 1,"Unknown message 0x%x",oct);
4470 * Add NAS message name
4472 proto_tree_add_item(tree, hf_idx, tvb, offset, 1, ENC_BIG_ENDIAN);
4479 if (msg_fcn_p == NULL)
4481 proto_tree_add_text(tree, tvb, offset, len - offset,
4482 "Message Elements");
4486 (*msg_fcn_p)(tvb, tree, pinfo, offset, len - offset);
4491 * 9 General message format and information elements coding
4493 * Within the protocols defined in the present document, every message, except the SERVICE REQUEST message,
4494 * is a standard L3 message as defined in 3GPP TS 24.007 [12]. This means that the message consists of the following parts:
4495 * 1) if the message is a plain NAS message:
4496 * a) protocol discriminator;
4497 * b) EPS bearer identity or security header type;
4498 * c) procedure transaction identity;
4500 * e) other information elements, as required.
4501 * 2) if the message is a security protected NAS message:
4502 * a) protocol discriminator;
4503 * b) security header type;
4504 * c) message authentication code;
4505 * d) sequence number;
4506 * e) plain NAS message, as defined in item 1.
4508 * The EPS bearer identity and the procedure transaction identity are only used in messages
4509 * with protocol discriminator EPS session management. Octet 1a with the procedure transaction
4510 * identity shall only be included in these messages.
4514 * All messages recived here will have the security header:
4515 * Figure 9.1.2: General message organization example for a security protected NAS message
4516 * 9.3.1 Bits 5 to 8 of the first octet of every EPS Mobility Management (EMM)
4517 * message contain the Security header type IE.
4518 * 4.4.4.2 All ESM messages are integrity protected.
4522 dissect_nas_eps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
4525 proto_tree *nas_eps_tree;
4526 guint8 pd, security_header_type;
4529 guint32 msg_auth_code;
4533 len = tvb_length(tvb);
4535 /* make entry in the Protocol column on summary display */
4536 col_append_str(pinfo->cinfo, COL_PROTOCOL, "/NAS-EPS");
4538 item = proto_tree_add_item(tree, proto_nas_eps, tvb, 0, -1, ENC_NA);
4539 nas_eps_tree = proto_item_add_subtree(item, ett_nas_eps);
4541 /* Security header type Security header type 9.3.1 M V 1/2 */
4542 security_header_type = tvb_get_guint8(tvb,offset)>>4;
4543 proto_tree_add_item(nas_eps_tree, hf_nas_eps_security_header_type, tvb, 0, 1, ENC_BIG_ENDIAN);
4544 /* Protocol discriminator Protocol discriminator 9.2 M V 1/2 */
4545 proto_tree_add_item(nas_eps_tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, ENC_BIG_ENDIAN);
4546 pd = tvb_get_guint8(tvb,offset)&0x0f;
4548 /* Message authentication code Message authentication code 9.5 M V 4 */
4549 if (security_header_type == 0){
4551 /* Plain EPS mobility management messages. */
4552 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, ENC_BIG_ENDIAN);
4555 proto_tree_add_text(tree, tvb, offset, len, "All ESM messages should be integrity protected");
4559 /* SERVICE REQUEST (12) is not a plain NAS message treat separately */
4560 if (security_header_type == 12){
4561 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "SERVICE REQUEST");
4562 nas_emm_service_req(tvb, nas_eps_tree, pinfo, offset, len-offset);
4565 /* Message authentication code */
4566 proto_tree_add_item(nas_eps_tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, ENC_BIG_ENDIAN);
4567 msg_auth_code = tvb_get_ntohl(tvb, offset);
4569 if ((security_header_type==2)||(security_header_type==4)){
4570 /* Possible ciphered message */
4571 if(msg_auth_code!=0){
4572 /* Sequence number Sequence number 9.6 M V 1 */
4573 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
4575 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
4576 /* Read security_header_type AND pd */
4577 pd = tvb_get_guint8(tvb,offset);
4578 /* If pd is in plaintext this message probably isn't ciphered */
4579 if((pd!=7)&&(pd!=2)&&(pd!=15)){
4580 proto_tree_add_text(nas_eps_tree, tvb, offset, len-6,"Ciphered message");
4584 /* msg_auth_code == 0, probably not ciphered */
4585 /* Sequence number Sequence number 9.6 M V 1 */
4586 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
4590 /* Sequence number Sequence number 9.6 M V 1 */
4591 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
4595 /* NAS message NAS message 9.7 M V 1-n */
4597 pd = tvb_get_guint8(tvb,offset)&0x0f;
4600 /* EPS session management messages.
4601 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4603 disect_nas_eps_esm_msg(tvb, pinfo, nas_eps_tree, offset);
4606 /* EPS mobility management messages.
4607 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4609 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, TRUE);
4612 /* Special conformance testing functions for User Equipment messages.
4613 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4615 if (gsm_a_dtap_handle){
4616 tvbuff_t *new_tvb = tvb_new_subset(tvb, offset, -1, -1);
4617 call_dissector(gsm_a_dtap_handle, new_tvb, pinfo, nas_eps_tree);
4619 } /* else fall through default */
4621 proto_tree_add_text(nas_eps_tree, tvb, offset, -1, "Not a NAS EPS PD %u(%s)",pd,val_to_str(pd, protocol_discriminator_vals,"unknown"));
4628 dissect_nas_eps_plain(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
4631 proto_tree *nas_eps_tree;
4638 /* make entry in the Protocol column on summary display */
4639 col_append_str(pinfo->cinfo, COL_PROTOCOL, "/NAS-EPS");
4641 item = proto_tree_add_item(tree, proto_nas_eps, tvb, 0, -1, ENC_NA);
4642 nas_eps_tree = proto_item_add_subtree(item, ett_nas_eps);
4644 pd = tvb_get_guint8(tvb,offset)&0x0f;
4647 /* EPS session management messages.
4648 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4650 disect_nas_eps_esm_msg(tvb, pinfo, nas_eps_tree, offset);
4653 /* EPS mobility management messages.
4654 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4656 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, TRUE);
4659 /* Special conformance testing functions for User Equipment messages.
4660 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4662 if (gsm_a_dtap_handle){
4663 tvbuff_t *new_tvb = tvb_new_subset(tvb, offset, -1, -1);
4664 call_dissector(gsm_a_dtap_handle, new_tvb,pinfo, nas_eps_tree);
4666 } /* else fall through default */
4668 proto_tree_add_text(nas_eps_tree, tvb, offset, -1, "Not a NAS EPS PD %u(%s)",pd,val_to_str(pd, protocol_discriminator_vals,"unknown"));
4674 void proto_register_nas_eps(void) {
4678 /* List of fields */
4680 static hf_register_info hf[] = {
4681 { &hf_nas_eps_msg_emm_type,
4682 { "NAS EPS Mobility Management Message Type", "nas_eps.nas_msg_emm_type",
4683 FT_UINT8, BASE_HEX, VALS(nas_msg_emm_strings), 0x0,
4686 { &hf_nas_eps_common_elem_id,
4687 { "Element ID", "nas_eps.common.elem_id",
4688 FT_UINT8, BASE_DEC, NULL, 0,
4691 { &hf_nas_eps_emm_elem_id,
4692 { "Element ID", "nas_eps.emm.elem_id",
4693 FT_UINT8, BASE_DEC, NULL, 0,
4696 { &hf_nas_eps_bearer_id,
4697 { "EPS bearer identity", "nas_eps.bearer_id",
4698 FT_UINT8, BASE_HEX, NULL, 0xf0,
4701 { &hf_nas_eps_spare_bits,
4702 { "Spare bit(s)", "nas_eps.spare_bits",
4703 FT_UINT8, BASE_HEX, NULL, 0x0,
4706 { &hf_nas_eps_security_header_type,
4707 { "Security header type","nas_eps.security_header_type",
4708 FT_UINT8,BASE_DEC|BASE_EXT_STRING, &security_header_type_vals_ext, 0xf0,
4711 { &hf_nas_eps_msg_auth_code,
4712 { "Message authentication code","nas_eps.msg_auth_code",
4713 FT_UINT32,BASE_HEX, NULL, 0x0,
4716 { &hf_nas_eps_seq_no,
4717 { "Sequence number","nas_eps.seq_no",
4718 FT_UINT8,BASE_DEC, NULL, 0x0,
4721 { &hf_nas_eps_seq_no_short,
4722 { "Sequence number (short)","nas_eps.seq_no_short",
4723 FT_UINT8,BASE_DEC, NULL, 0x0,
4726 { &hf_nas_eps_emm_ebi0,
4727 { "EBI(0) spare","nas_eps.emm.ebi0",
4728 FT_BOOLEAN, 8, NULL, 0x01,
4731 { &hf_nas_eps_emm_ebi1,
4732 { "EBI(1) spare","nas_eps.emm.ebi1",
4733 FT_BOOLEAN, 8, NULL, 0x02,
4736 { &hf_nas_eps_emm_ebi2,
4737 { "EBI(2) spare","nas_eps.emm.ebi2",
4738 FT_BOOLEAN, 8, NULL, 0x04,
4741 { &hf_nas_eps_emm_ebi3,
4742 { "EBI(3) spare","nas_eps.emm.ebi3",
4743 FT_BOOLEAN, 8, NULL, 0x08,
4746 { &hf_nas_eps_emm_ebi4,
4747 { "EBI(4) spare","nas_eps.emm.ebi4",
4748 FT_BOOLEAN, 8, NULL, 0x10,
4751 { &hf_nas_eps_emm_ebi5,
4752 { "EBI(5)","nas_eps.emm.ebi5",
4753 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x20,
4756 { &hf_nas_eps_emm_ebi6,
4757 { "EBI(6)","nas_eps.emm.ebi6",
4758 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x40,
4761 { &hf_nas_eps_emm_ebi7,
4762 { "EBI(7)","nas_eps.emm.ebi7",
4763 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x80,
4766 { &hf_nas_eps_emm_ebi8,
4767 { "EBI(8)","nas_eps.emm.ebi8",
4768 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x01,
4771 { &hf_nas_eps_emm_ebi9,
4772 { "EBI(9)","nas_eps.emm.ebi9",
4773 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x02,
4776 { &hf_nas_eps_emm_ebi10,
4777 { "EBI(10)","nas_eps.emm.ebi10",
4778 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x04,
4781 { &hf_nas_eps_emm_ebi11,
4782 { "EBI(11)","nas_eps.emm.ebi11",
4783 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x08,
4786 { &hf_nas_eps_emm_ebi12,
4787 { "EBI(12)","nas_eps.emm.ebi12",
4788 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x10,
4791 { &hf_nas_eps_emm_ebi13,
4792 { "EBI(13)","nas_eps.emm.ebi13",
4793 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x20,
4796 { &hf_nas_eps_emm_ebi14,
4797 { "EBI(14)","nas_eps.emm.ebi14",
4798 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x40,
4801 { &hf_nas_eps_emm_ebi15,
4802 { "EBI(15)","nas_eps.emm.ebi15",
4803 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x80,
4806 { &hf_nas_eps_emm_dl_nas_cnt,
4807 { "DL NAS COUNT value","nas_eps.emm.dl_nas_cnt",
4808 FT_UINT8,BASE_DEC, NULL, 0x0f,
4811 {&hf_nas_eps_emm_nonce_mme,
4812 { "NonceMME","nas_eps.emm.nonce_mme",
4813 FT_UINT32,BASE_HEX, NULL, 0x0,
4816 {&hf_nas_eps_emm_nonce,
4817 { "Nonce","nas_eps.emm.nonce",
4818 FT_UINT32,BASE_HEX, NULL, 0x0,
4821 { &hf_nas_eps_emm_paging_id,
4822 { "Paging identity value","nas_eps.emm.paging_id",
4823 FT_BOOLEAN, 8, TFS(&nas_eps_emm_paging_id_vals), 0x0,
4826 { &hf_nas_eps_emm_eps_att_type,
4827 { "EPS attach type","nas_eps.emm.eps_att_type",
4828 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_att_type_vals), 0x0,
4831 { &hf_nas_eps_emm_cs_lcs_type,
4832 { "CS-LCS","nas_eps.emm.cs_lcs",
4833 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_cs_lcs_vals), 0x0,
4834 "Location services indicator in CS", HFILL }
4836 { &hf_nas_eps_emm_epc_lcs_type,
4837 { "EPC-LCS","nas_eps.emm.epc_lcs",
4838 FT_BOOLEAN ,BASE_NONE, TFS(&nas_eps_emm_epc_lcs_value), 0x0,
4839 "Location services indicator in EPC", HFILL }
4841 { &hf_nas_eps_emm_emc_bs_type,
4842 { "EMC BS","nas_eps.emm.emc_bs",
4843 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_emc_bs_value), 0x0,
4844 "Emergency bearer services indicator", HFILL }
4846 { &hf_nas_eps_emm_ims_vops_type,
4847 { "IMS VoPS","nas_eps.emm.ims_vops",
4848 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_ims_vops_value), 0x0,
4849 "IMS voice over PS session indicator", HFILL }
4852 { "Type of security context flag (TSC)","nas_eps.emm.tsc",
4853 FT_UINT8,BASE_DEC, VALS(nas_eps_tsc_vals), 0x0,
4856 { &hf_nas_eps_emm_nas_key_set_id,
4857 { "NAS key set identifier","nas_eps.emm.nas_key_set_id",
4858 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_NAS_key_set_identifier_vals), 0x0,
4861 { &hf_nas_eps_emm_odd_even,
4862 { "odd/even indic","nas_eps.emm.odd_even",
4863 FT_UINT8,BASE_DEC, NULL, 0x8,
4866 { &hf_nas_eps_emm_type_of_id,
4867 { "Type of identity","nas_eps.emm.type_of_id",
4868 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_id_vals), 0x07,
4871 { &hf_nas_eps_emm_mme_grp_id,
4872 { "MME Group ID","nas_eps.emm.mme_grp_id",
4873 FT_UINT16, BASE_DEC, NULL, 0x0,
4876 { &hf_nas_eps_emm_imsi,
4877 { "IMSI", "nas_eps.emm.imsi",
4878 FT_STRING, BASE_NONE, NULL, 0,
4881 { &hf_nas_eps_emm_imei,
4882 { "IMEI", "nas_eps.emm.imei",
4883 FT_STRING, BASE_NONE, NULL, 0,
4886 { &hf_nas_eps_emm_mme_code,
4887 { "MME Code","nas_eps.emm.mme_code",
4888 FT_UINT8, BASE_DEC, NULL, 0x0,
4891 { &hf_nas_eps_emm_m_tmsi,
4892 { "M-TMSI","nas_eps.emm.m_tmsi",
4893 FT_UINT32, BASE_HEX, NULL, 0x0,
4896 { &hf_nas_eps_esm_msg_cont,
4897 { "ESM message container contents","nas_eps.emm.esm_msg_cont",
4898 FT_BYTES, BASE_NONE, NULL, 0x0,
4901 { &hf_nas_eps_esm_imeisv_req,
4902 { "IMEISV request","nas_eps.emm.imeisv_req",
4903 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_imeisv_req_vals), 0x07,
4906 { &hf_nas_eps_emm_toi,
4907 { "Type of integrity protection algorithm","nas_eps.emm.toi",
4908 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_toi_vals), 0x07,
4911 { &hf_nas_eps_emm_toc,
4912 { "Type of ciphering algorithm","nas_eps.emm.toc",
4913 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_toc_vals), 0x70,
4916 { &hf_nas_eps_emm_EPS_attach_result,
4917 { "Attach result","nas_eps.emm.EPS_attach_result",
4918 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_EPS_attach_result_values), 0x0,
4921 { &hf_nas_eps_emm_spare_half_octet,
4922 { "Spare half octet","nas_eps.emm.spare_half_octet",
4923 FT_UINT8,BASE_DEC, NULL, 0x0,
4926 { &hf_nas_eps_emm_add_upd_res,
4927 { "AURV","nas_eps.emm.add_upd_res",
4928 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_add_upd_res_vals), 0x0,
4929 "Additional update result value", HFILL }
4931 { &hf_nas_eps_emm_add_upd_type,
4932 { "AUTV","nas_eps.emm.add_upd_type",
4933 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_add_upd_type_vals), 0x0,
4934 "Additional update type value", HFILL }
4936 { &hf_nas_eps_emm_res,
4937 { "RES","nas_eps.emm.res",
4938 FT_BYTES, BASE_NONE, NULL, 0x0,
4941 { &hf_nas_eps_emm_csfb_resp,
4942 { "CSFB response","nas_eps.emm.csfb_resp",
4943 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_csfb_resp_vals), 0x03,
4946 { &hf_nas_eps_emm_cause,
4947 { "Cause","nas_eps.emm.cause",
4948 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_cause_values), 0x0,
4951 { &hf_nas_eps_emm_id_type2,
4952 { "Identity type 2","nas_eps.emm.id_type2",
4953 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_id_type2_vals), 0x0,
4956 { &hf_nas_eps_emm_short_mac,
4957 { "Message authentication code (short)","nas_eps.emm.short_mac",
4958 FT_UINT16, BASE_HEX, NULL, 0x0,
4961 { &hf_nas_eps_emm_tai_tol,
4962 { "Type of list","nas_eps.emm.tai_tol",
4963 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_tai_tol_vals), 0x60,
4966 { &hf_nas_eps_emm_tai_n_elem,
4967 { "Number of elements","nas_eps.emm.tai_n_elem",
4968 FT_UINT8, BASE_DEC, NULL, 0x1f,
4971 { &hf_nas_eps_emm_tai_tac,
4972 { "Tracking area code(TAC)","nas_eps.emm.tai_tac",
4973 FT_UINT16, BASE_HEX, NULL, 0x0,
4976 { &hf_nas_eps_emm_eea0,
4977 { "EEA0","nas_eps.emm.eea0",
4978 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
4981 { &hf_nas_eps_emm_128eea1,
4982 { "128-EEA1","nas_eps.emm.128eea1",
4983 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4986 { &hf_nas_eps_emm_128eea2,
4987 { "128-EEA2","nas_eps.emm.128eea2",
4988 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4991 { &hf_nas_eps_emm_eea3,
4992 { "EEA3","nas_eps.emm.eea3",
4993 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4996 { &hf_nas_eps_emm_eea4,
4997 { "EEA4","nas_eps.emm.eea4",
4998 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
5001 { &hf_nas_eps_emm_eea5,
5002 { "EEA5","nas_eps.emm.eea5",
5003 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
5006 { &hf_nas_eps_emm_eea6,
5007 { "EEA6","nas_eps.emm.eea6",
5008 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
5011 { &hf_nas_eps_emm_eea7,
5012 { "EEA7","nas_eps.emm.eea7",
5013 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
5016 { &hf_nas_eps_emm_eia0,
5017 { "EIA0","nas_eps.emm.eia0",
5018 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
5021 { &hf_nas_eps_emm_128eia1,
5022 { "128-EIA1","nas_eps.emm.128eia1",
5023 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
5026 { &hf_nas_eps_emm_128eia2,
5027 { "128-EIA2","nas_eps.emm.128eia2",
5028 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
5031 { &hf_nas_eps_emm_eia3,
5032 { "EIA3","nas_eps.emm.eia3",
5033 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
5036 { &hf_nas_eps_emm_eia4,
5037 { "EIA4","nas_eps.emm.eia4",
5038 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
5041 { &hf_nas_eps_emm_eia5,
5042 { "EIA5","nas_eps.emm.eia5",
5043 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
5046 { &hf_nas_eps_emm_eia6,
5047 { "EIA6","nas_eps.emm.eia6",
5048 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
5051 { &hf_nas_eps_emm_eia7,
5052 { "EIA7","nas_eps.emm.eia7",
5053 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
5058 { &hf_nas_eps_emm_uea0,
5059 { "UEA0","nas_eps.emm.uea0",
5060 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
5063 { &hf_nas_eps_emm_uea1,
5064 { "UEA1","nas_eps.emm.uea1",
5065 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
5068 { &hf_nas_eps_emm_uea2,
5069 { "UEA2","nas_eps.emm.uea2",
5070 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
5073 { &hf_nas_eps_emm_uea3,
5074 { "UEA3","nas_eps.emm.uea3",
5075 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
5078 { &hf_nas_eps_emm_uea4,
5079 { "UEA4","nas_eps.emm.uea4",
5080 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
5083 { &hf_nas_eps_emm_uea5,
5084 { "UEA5","nas_eps.emm.uea5",
5085 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
5088 { &hf_nas_eps_emm_uea6,
5089 { "UEA6","nas_eps.emm.uea6",
5090 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
5093 { &hf_nas_eps_emm_uea7,
5094 { "UEA7","nas_eps.emm.uea7",
5095 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
5098 { &hf_nas_eps_emm_ucs2_supp,
5099 { "UCS2 support (UCS2)","nas_eps.emm.emm_ucs2_supp",
5100 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ucs2_supp_flg_value), 0x80,
5103 { &hf_nas_eps_emm_uia1,
5104 { "UMTS integrity algorithm UIA1","nas_eps.emm.uia1",
5105 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
5108 { &hf_nas_eps_emm_uia2,
5109 { "UMTS integrity algorithm UIA2","nas_eps.emm.uia2",
5110 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
5113 { &hf_nas_eps_emm_uia3,
5114 { "UMTS integrity algorithm UIA3","nas_eps.emm.uia3",
5115 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
5118 { &hf_nas_eps_emm_uia4,
5119 { "UMTS integrity algorithm UIA4","nas_eps.emm.uia4",
5120 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
5123 { &hf_nas_eps_emm_uia5,
5124 { "UMTS integrity algorithm UIA5","nas_eps.emm.uia5",
5125 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
5128 { &hf_nas_eps_emm_uia6,
5129 { "UMTS integrity algorithm UIA6","nas_eps.emm.uia6",
5130 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
5133 { &hf_nas_eps_emm_uia7,
5134 { "UMTS integrity algorithm UIA7","nas_eps.emm.uia7",
5135 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
5138 { &hf_nas_eps_emm_gea1,
5139 { "GPRS encryption algorithm GEA1","nas_eps.emm.gea1",
5140 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
5143 { &hf_nas_eps_emm_gea2,
5144 { "GPRS encryption algorithm GEA2","nas_eps.emm.gea2",
5145 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
5148 { &hf_nas_eps_emm_gea3,
5149 { "GPRS encryption algorithm GEA3","nas_eps.emm.gea3",
5150 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
5153 { &hf_nas_eps_emm_gea4,
5154 { "GPRS encryption algorithm GEA4","nas_eps.emm.gea4",
5155 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
5158 { &hf_nas_eps_emm_gea5,
5159 { "GPRS encryption algorithm GEA5","nas_eps.emm.gea5",
5160 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
5163 { &hf_nas_eps_emm_gea6,
5164 { "GPRS encryption algorithm GEA6","nas_eps.emm.gea6",
5165 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
5168 { &hf_nas_eps_emm_gea7,
5169 { "GPRS encryption algorithm GEA7","nas_eps.emm.gea7",
5170 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
5173 { &hf_nas_eps_emm_lpp_cap,
5174 { "LPP capability","nas_eps.emm.lpp_cap",
5175 FT_BOOLEAN, 8, TFS(&nas_eps_emm_lpp_cap_flg), 0x08,
5178 { &hf_nas_eps_emm_lcs_cap,
5179 { "LCS capability","nas_eps.emm.lcs_cap",
5180 FT_BOOLEAN, 8, TFS(&nas_eps_emm_lcs_cap_flg), 0x04,
5183 { &hf_nas_eps_emm_1xsrvcc_cap,
5184 { "1xSRVCC capability","nas_eps.emm.1xsrvcc_cap",
5185 FT_BOOLEAN, 8, TFS(&nas_eps_emm_1xsrvcc_cap_flg), 0x02,
5188 { &hf_nas_eps_emm_nf_cap,
5189 { "NF capability","nas_eps.emm.nf_cap",
5190 FT_BOOLEAN, 8, TFS(&nas_eps_emm_nf_cap_flg), 0x01,
5193 { &hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg,
5194 { "1xSRVCC capability","nas_eps.emm.ue_ra_cap_inf_upd_need_flg",
5195 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ue_ra_cap_inf_upd_need_flg), 0x01,
5198 { &hf_nas_eps_emm_ss_code,
5199 { "SS Code","nas_eps.emm.ss_code",
5200 FT_UINT8,BASE_DEC, VALS(ssCode_vals), 0x0,
5203 { &hf_nas_eps_emm_lcs_ind,
5204 { "LCS indicator","nas_eps.emm.emm_lcs_ind",
5205 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_lcs_ind_vals), 0x0,
5208 { &hf_nas_eps_emm_gen_msg_cont_type,
5209 { "Container type","nas_eps.emm.gen_msg_cont_type",
5210 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_gen_msg_cont_type_vals), 0x0,
5213 { &hf_nas_eps_emm_apn_ambr_ul,
5214 { "APN-AMBR for uplink","nas_eps.emm.apn_ambr_ul",
5215 FT_UINT8,BASE_DEC, NULL, 0x0,
5218 { &hf_nas_eps_emm_apn_ambr_dl,
5219 { "APN-AMBR for downlink","nas_eps.emm.apn_ambr_dl",
5220 FT_UINT8,BASE_DEC, NULL, 0x0,
5223 { &hf_nas_eps_emm_apn_ambr_ul_ext,
5224 { "APN-AMBR for uplink(Extended)","nas_eps.emm.apn_ambr_ul_ext",
5225 FT_UINT8,BASE_DEC, NULL, 0x0,
5228 { &hf_nas_eps_emm_apn_ambr_dl_ext,
5229 { "APN-AMBR for downlink(Extended)","nas_eps.emm.apn_ambr_dl_ext",
5230 FT_UINT8,BASE_DEC, NULL, 0x0,
5233 { &hf_nas_eps_emm_apn_ambr_ul_ext2,
5234 { "APN-AMBR for uplink(Extended-2)","nas_eps.emm.apn_ambr_ul_ext2",
5235 FT_UINT8,BASE_DEC, NULL, 0x0,
5238 { &hf_nas_eps_emm_apn_ambr_dl_ext2,
5239 { "APN-AMBR for downlink(Extended-2)","nas_eps.emm.apn_ambr_dl_ext2",
5240 FT_UINT8,BASE_DEC, NULL, 0x0,
5243 { &hf_nas_eps_emm_switch_off,
5244 { "Switch off","nas_eps.emm.switch_off",
5245 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_switch_off_vals), 0x0,
5248 { &hf_nas_eps_emm_detach_type_UL,
5249 { "Detach Type","nas_eps.emm.detach_type_ul",
5250 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_dtatch_UL_vals), 0x0,
5253 { &hf_nas_eps_emm_detach_type_DL,
5254 { "Detach Type","nas_eps.emm.detach_type_dl",
5255 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_dtatch_DL_vals), 0x0,
5259 { "Quality of Service Class Identifier (QCI)","nas_eps.emm.qci",
5260 FT_UINT8,(BASE_DEC|BASE_RANGE_STRING), RVALS(nas_eps_qci_vals), 0x0,
5263 { &hf_nas_eps_mbr_ul,
5264 { "Maximum bit rate for uplink","nas_eps.emm.mbr_ul",
5265 FT_UINT8,BASE_DEC, NULL, 0x0,
5268 { &hf_nas_eps_mbr_dl,
5269 { "Maximum bit rate for downlink","nas_eps.emm.mbr_dl",
5270 FT_UINT8,BASE_DEC, NULL, 0x0,
5273 { &hf_nas_eps_gbr_ul,
5274 { "Guaranteed bit rate for uplink","nas_eps.emm.gbr_ul",
5275 FT_UINT8,BASE_DEC, NULL, 0x0,
5278 { &hf_nas_eps_gbr_dl,
5279 { "Guaranteed bit rate for downlink","nas_eps.emm.gbr_dl",
5280 FT_UINT8,BASE_DEC, NULL, 0x0,
5283 { &hf_nas_eps_embr_ul,
5284 { "Maximum bit rate for uplink(ext)","nas_eps.emm.embr_ul",
5285 FT_UINT8,BASE_DEC, NULL, 0x0,
5288 { &hf_nas_eps_embr_dl,
5289 { "Maximum bit rate for downlink(ext)","nas_eps.emm.embr_dl",
5290 FT_UINT8,BASE_DEC, NULL, 0x0,
5293 { &hf_nas_eps_egbr_ul,
5294 { "Guaranteed bit rate for uplink(ext)","nas_eps.emm.egbr_ul",
5295 FT_UINT8,BASE_DEC, NULL, 0x0,
5298 { &hf_nas_eps_egbr_dl,
5299 { "Guaranteed bit rate for downlink(ext)","nas_eps.emm.egbr_dl",
5300 FT_UINT8,BASE_DEC, NULL, 0x0,
5303 { &hf_nas_eps_esm_cause,
5304 { "Cause","nas_eps.esm.cause",
5305 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_cause_vals), 0x0,
5308 { &hf_nas_eps_esm_eit,
5309 { "EIT (ESM information transfer)", "nas_eps.emm.eit",
5310 FT_BOOLEAN, 8, TFS(&nas_eps_emm_active_flg_value), 0x01,
5313 { &hf_nas_eps_esm_lnkd_eps_bearer_id,
5314 { "Linked EPS bearer identity","nas_eps.esm.lnkd_eps_bearer_id",
5315 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_linked_bearer_id_vals), 0x0f,
5318 { &hf_nas_eps_esm_notif_ind,
5319 { "Notification indicator value","nas_eps.esm.notif_ind",
5320 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_notif_ind_vals), 0x0,
5323 { &hf_nas_eps_esm_pdn_ipv4,
5324 {"PDN IPv4", "nas_eps.esm.pdn_ipv4",
5325 FT_IPv4, BASE_NONE, NULL, 0x0,
5328 { &hf_nas_eps_esm_pdn_ipv6_if_id,
5329 {"PDN IPv6 if id", "nas_eps.esm.pdn_ipv6_if_id",
5330 FT_BYTES, BASE_NONE, NULL, 0x0,
5333 { &hf_nas_eps_esm_linked_bearer_id,
5334 { "Linked EPS bearer identity","nas_eps.esm.linked_bearer_id",
5335 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_linked_bearer_id_vals), 0x0,
5338 { &hf_nas_eps_active_flg,
5339 { "Active flag", "nas_eps.emm.active_flg",
5340 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_active_flg_value), 0x0,
5343 { &hf_nas_eps_eps_update_result_value,
5344 { "EPS update result value","nas_eps.emm.eps_update_result_value",
5345 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_update_result_vals), 0x0,
5348 { &hf_nas_eps_eps_update_type_value,
5349 { "EPS update type value", "nas_eps.emm.update_type_value",
5350 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_update_type_vals), 0x0,
5353 { &hf_nas_eps_service_type,
5354 { "Service type", "nas_eps.emm.service_type",
5355 FT_UINT8,BASE_DEC, VALS(nas_eps_service_type_vals), 0x0,
5358 { &hf_nas_eps_nas_msg_cont,
5359 { "NAS message container content", "nas_eps.emm.nas_msg_cont",
5360 FT_BYTES, BASE_NONE, NULL, 0x0,
5363 { &hf_nas_eps_gen_msg_cont,
5364 { "Generic message container content", "nas_eps.emm.gen_msg_cont",
5365 FT_BYTES, BASE_NONE, NULL, 0x0,
5368 { &hf_nas_eps_cmn_add_info,
5369 { "Additional information content", "nas_eps.cmn.add_info",
5370 FT_BYTES, BASE_NONE, NULL, 0x0,
5373 /* ESM hf cvariables */
5374 { &hf_nas_eps_msg_esm_type,
5375 { "NAS EPS session management messages", "nas_eps.nas_msg_esm_type",
5376 FT_UINT8, BASE_HEX, VALS(nas_msg_esm_strings), 0x0,
5379 { &hf_nas_eps_esm_elem_id,
5380 { "Element ID", "nas_eps.esm.elem_id",
5381 FT_UINT8, BASE_DEC, NULL, 0,
5384 { &hf_nas_eps_esm_proc_trans_id,
5385 { "Procedure transaction identity", "nas_eps.esm.proc_trans_id",
5386 FT_UINT8, BASE_DEC, NULL, 0,
5389 { &hf_nas_eps_esm_pdn_type,
5390 { "PDN type", "nas_eps.nas_eps_esm_pdn_type",
5391 FT_UINT8, BASE_DEC, VALS(nas_eps_esm_pdn_type_values), 0x0,
5394 { &hf_nas_eps_esm_request_type,
5395 { "Request type", "nas_eps.nas_eps_esm_request_type",
5396 FT_UINT8, BASE_DEC, VALS(nas_eps_esm_request_type_values), 0x0,
5401 /* Setup protocol subtree array */
5402 #define NUM_INDIVIDUAL_ELEMS 5
5403 gint *ett[NUM_INDIVIDUAL_ELEMS +
5404 NUM_NAS_EPS_COMMON_ELEM +
5405 NUM_NAS_MSG_EMM + NUM_NAS_EMM_ELEM+
5406 NUM_NAS_MSG_ESM + NUM_NAS_ESM_ELEM];
5408 ett[0] = &ett_nas_eps;
5409 ett[1] = &ett_nas_eps_esm_msg_cont;
5410 ett[2] = &ett_nas_eps_nas_msg_cont;
5411 ett[3] = &ett_nas_eps_gen_msg_cont;
5412 ett[4] = &ett_nas_eps_cmn_add_info;
5414 last_offset = NUM_INDIVIDUAL_ELEMS;
5416 for (i=0; i < NUM_NAS_EPS_COMMON_ELEM; i++, last_offset++)
5418 ett_nas_eps_common_elem[i] = -1;
5419 ett[last_offset] = &ett_nas_eps_common_elem[i];
5423 for (i=0; i < NUM_NAS_MSG_EMM; i++, last_offset++)
5425 ett_nas_msg_emm[i] = -1;
5426 ett[last_offset] = &ett_nas_msg_emm[i];
5429 for (i=0; i < NUM_NAS_EMM_ELEM; i++, last_offset++)
5431 ett_nas_eps_emm_elem[i] = -1;
5432 ett[last_offset] = &ett_nas_eps_emm_elem[i];
5435 for (i=0; i < NUM_NAS_MSG_ESM; i++, last_offset++)
5437 ett_nas_msg_esm[i] = -1;
5438 ett[last_offset] = &ett_nas_msg_esm[i];
5441 for (i=0; i < NUM_NAS_ESM_ELEM; i++, last_offset++)
5443 ett_nas_eps_esm_elem[i] = -1;
5444 ett[last_offset] = &ett_nas_eps_esm_elem[i];
5447 /* Register protocol */
5448 proto_nas_eps = proto_register_protocol(PNAME, PSNAME, PFNAME);
5449 /* Register fields and subtrees */
5450 proto_register_field_array(proto_nas_eps, hf, array_length(hf));
5451 proto_register_subtree_array(ett, array_length(ett));
5453 /* Register dissector */
5454 register_dissector(PFNAME, dissect_nas_eps, proto_nas_eps);
5456 /* Register dissector */
5457 register_dissector("nas-eps_plain", dissect_nas_eps_plain, proto_nas_eps);
5461 proto_reg_handoff_nas_eps(void)
5463 gsm_a_dtap_handle = find_dissector("gsm_a_dtap");
5464 lpp_handle = find_dissector("lpp");