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"
41 #define PNAME "Non-Access-Stratum (NAS)PDU"
42 #define PSNAME "NAS-EPS"
43 #define PFNAME "nas-eps"
45 /* Initialize the protocol and registered fields */
46 static int proto_nas_eps = -1;
48 /* Dissector handles */
49 static dissector_handle_t gsm_a_dtap_handle;
51 /* Forward declaration */
52 static void disect_nas_eps_esm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset);
54 static int hf_nas_eps_msg_emm_type = -1;
55 int hf_nas_eps_common_elem_id = -1;
56 int hf_nas_eps_emm_elem_id = -1;
57 static int hf_nas_eps_bearer_id = -1;
58 static int hf_nas_eps_spare_bits = -1;
59 static int hf_nas_eps_security_header_type = -1;
60 static int hf_nas_eps_msg_auth_code = -1;
61 static int hf_nas_eps_seq_no = -1;
62 static int hf_nas_eps_seq_no_short = -1;
63 static int hf_nas_eps_emm_ebi0 = -1;
64 static int hf_nas_eps_emm_ebi1 = -1;
65 static int hf_nas_eps_emm_ebi2 = -1;
66 static int hf_nas_eps_emm_ebi3 = -1;
67 static int hf_nas_eps_emm_ebi4 = -1;
68 static int hf_nas_eps_emm_ebi5 = -1;
69 static int hf_nas_eps_emm_ebi6 = -1;
70 static int hf_nas_eps_emm_ebi7 = -1;
71 static int hf_nas_eps_emm_ebi8 = -1;
72 static int hf_nas_eps_emm_ebi9 = -1;
73 static int hf_nas_eps_emm_ebi10 = -1;
74 static int hf_nas_eps_emm_ebi11 = -1;
75 static int hf_nas_eps_emm_ebi12 = -1;
76 static int hf_nas_eps_emm_ebi13 = -1;
77 static int hf_nas_eps_emm_ebi14 = -1;
78 static int hf_nas_eps_emm_ebi15 = -1;
79 static int hf_nas_eps_emm_dl_nas_cnt = -1;
80 static int hf_nas_eps_emm_nonce_mme = -1;
81 static int hf_nas_eps_emm_nonce = -1;
82 static int hf_nas_eps_emm_paging_id = -1;
83 static int hf_nas_eps_emm_eps_att_type = -1;
84 static int hf_nas_eps_emm_cs_lcs_type = -1;
85 static int hf_nas_eps_emm_epc_lcs_type = -1;
86 static int hf_nas_eps_emm_emc_bs_type = -1;
87 static int hf_nas_eps_emm_ims_vops_type = -1;
88 static int hf_nas_eps_emm_nas_key_set_id = -1;
89 static int hf_nas_eps_tsc = -1;
90 static int hf_nas_eps_emm_odd_even = -1;
91 static int hf_nas_eps_emm_type_of_id = -1;
92 static int hf_nas_eps_emm_mme_grp_id = -1;
93 static int hf_nas_eps_emm_imsi = -1;
94 static int hf_nas_eps_emm_imei = -1;
95 static int hf_nas_eps_emm_mme_code = -1;
96 static int hf_nas_eps_emm_m_tmsi = -1;
97 static int hf_nas_eps_esm_msg_cont = -1;
98 static int hf_nas_eps_esm_imeisv_req = -1;
99 static int hf_nas_eps_emm_toi = -1;
100 static int hf_nas_eps_emm_toc = -1;
101 static int hf_nas_eps_emm_EPS_attach_result = -1;
102 static int hf_nas_eps_emm_spare_half_octet = -1;
103 static int hf_nas_eps_emm_add_upd_res = -1;
104 static int hf_nas_eps_emm_add_upd_type = -1;
105 static int hf_nas_eps_emm_res = -1;
106 static int hf_nas_eps_emm_csfb_resp = -1;
107 static int hf_nas_eps_emm_cause = -1;
108 static int hf_nas_eps_emm_id_type2 = -1;
109 static int hf_nas_eps_emm_short_mac = -1;
110 static int hf_nas_eps_emm_tai_tol = -1;
111 static int hf_nas_eps_emm_tai_n_elem = -1;
112 static int hf_nas_eps_emm_tai_tac = -1;
113 static int hf_nas_eps_emm_eea0 = -1;
114 static int hf_nas_eps_emm_128eea1 = -1;
115 static int hf_nas_eps_emm_128eea2 = -1;
116 static int hf_nas_eps_emm_eea3 = -1;
117 static int hf_nas_eps_emm_eea4 = -1;
118 static int hf_nas_eps_emm_eea5 = -1;
119 static int hf_nas_eps_emm_eea6 = -1;
120 static int hf_nas_eps_emm_eea7 = -1;
121 static int hf_nas_eps_emm_eia0 = -1;
122 static int hf_nas_eps_emm_128eia1 = -1;
123 static int hf_nas_eps_emm_128eia2 = -1;
124 static int hf_nas_eps_emm_eia3 = -1;
125 static int hf_nas_eps_emm_eia4 = -1;
126 static int hf_nas_eps_emm_eia5 = -1;
127 static int hf_nas_eps_emm_eia6 = -1;
128 static int hf_nas_eps_emm_eia7 = -1;
129 static int hf_nas_eps_emm_uea0 = -1;
130 static int hf_nas_eps_emm_uea1 = -1;
131 static int hf_nas_eps_emm_uea2 = -1;
132 static int hf_nas_eps_emm_uea3 = -1;
133 static int hf_nas_eps_emm_uea4 = -1;
134 static int hf_nas_eps_emm_uea5 = -1;
135 static int hf_nas_eps_emm_uea6 = -1;
136 static int hf_nas_eps_emm_uea7 = -1;
137 static int hf_nas_eps_emm_ucs2_supp = -1;
138 static int hf_nas_eps_emm_uia1 = -1;
139 static int hf_nas_eps_emm_uia2 = -1;
140 static int hf_nas_eps_emm_uia3 = -1;
141 static int hf_nas_eps_emm_uia4 = -1;
142 static int hf_nas_eps_emm_uia5 = -1;
143 static int hf_nas_eps_emm_uia6 = -1;
144 static int hf_nas_eps_emm_uia7 = -1;
145 static int hf_nas_eps_emm_gea1 = -1;
146 static int hf_nas_eps_emm_gea2 = -1;
147 static int hf_nas_eps_emm_gea3 = -1;
148 static int hf_nas_eps_emm_gea4 = -1;
149 static int hf_nas_eps_emm_gea5 = -1;
150 static int hf_nas_eps_emm_gea6 = -1;
151 static int hf_nas_eps_emm_gea7 = -1;
152 static int hf_nas_eps_emm_lpp_cap = -1;
153 static int hf_nas_eps_emm_lcs_cap = -1;
154 static int hf_nas_eps_emm_1xsrvcc_cap = -1;
155 static int hf_nas_eps_emm_nf_cap = -1;
156 static int hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg;
157 static int hf_nas_eps_emm_ss_code = -1;
158 static int hf_nas_eps_emm_lcs_ind = -1;
159 static int hf_nas_eps_emm_gen_msg_cont_type = -1;
160 static int hf_nas_eps_emm_apn_ambr_ul = -1;
161 static int hf_nas_eps_emm_apn_ambr_dl = -1;
162 static int hf_nas_eps_emm_apn_ambr_ul_ext = -1;
163 static int hf_nas_eps_emm_apn_ambr_dl_ext = -1;
164 static int hf_nas_eps_emm_apn_ambr_ul_ext2 = -1;
165 static int hf_nas_eps_emm_apn_ambr_dl_ext2 = -1;
167 static int hf_nas_eps_emm_switch_off = -1;
168 static int hf_nas_eps_emm_detach_type_UL = -1;
169 static int hf_nas_eps_emm_detach_type_DL = -1;
171 static int hf_nas_eps_qci = -1;
172 static int hf_nas_eps_mbr_ul = -1;
173 static int hf_nas_eps_mbr_dl = -1;
174 static int hf_nas_eps_gbr_ul = -1;
175 static int hf_nas_eps_gbr_dl = -1;
176 static int hf_nas_eps_embr_ul = -1;
177 static int hf_nas_eps_embr_dl = -1;
178 static int hf_nas_eps_egbr_ul = -1;
179 static int hf_nas_eps_egbr_dl = -1;
181 static int hf_nas_eps_esm_cause = -1;
182 static int hf_nas_eps_esm_eit = -1;
183 static int hf_nas_eps_esm_lnkd_eps_bearer_id = -1;
184 static int hf_nas_eps_esm_notif_ind = -1;
185 static int hf_nas_eps_esm_pdn_type = -1;
186 static int hf_nas_eps_esm_pdn_ipv4 = -1;
187 static int hf_nas_eps_esm_pdn_ipv6_if_id = -1;
189 static int hf_nas_eps_esm_linked_bearer_id = -1;
191 static int hf_nas_eps_active_flg = -1;
192 static int hf_nas_eps_eps_update_result_value = -1;
193 static int hf_nas_eps_eps_update_type_value = -1;
194 static int hf_nas_eps_service_type = -1;
197 static int hf_nas_eps_msg_esm_type = -1;
198 int hf_nas_eps_esm_elem_id = -1;
199 static int hf_nas_eps_esm_proc_trans_id = -1;
201 /* Initialize the subtree pointers */
202 static int ett_nas_eps = -1;
203 static int ett_nas_eps_esm_msg_cont = -1;
205 /* Global variables */
206 static packet_info *gpinfo;
208 /* Table 9.8.1: Message types for EPS mobility management
209 * 0 1 - - - - - - EPS mobility management messages
211 static const value_string nas_msg_emm_strings[] = {
212 { 0x41, "Attach request"},
213 { 0x42, "Attach accept"},
214 { 0x43, "Attach complete"},
215 { 0x44, "Attach reject"},
216 { 0x45, "Detach request"},
217 { 0x46, "Detach accept"},
219 { 0x48, "Tracking area update request"},
220 { 0x49, "Tracking area update accept"},
221 { 0x4a, "Tracking area update complete"},
222 { 0x4b, "Tracking area update reject"},
224 { 0x4c, "Extended service request"},
225 { 0x4e, "Service reject"},
227 { 0x50, "GUTI reallocation command"},
228 { 0x51, "GUTI reallocation complete"},
229 { 0x52, "Authentication request"},
230 { 0x53, "Authentication response"},
231 { 0x54, "Authentication reject"},
232 { 0x5c, "Authentication failure"},
233 { 0x55, "Identity request"},
234 { 0x56, "Identity response"},
235 { 0x5d, "Security mode command"},
236 { 0x5e, "Security mode complete"},
237 { 0x5f, "Security mode reject"},
239 { 0x60, "EMM status"},
240 { 0x61, "EMM information"},
241 { 0x62, "Downlink NAS transport"},
242 { 0x63, "Uplink NAS transport"},
243 { 0x64, "CS Service notification"},
244 { 0x68, "Downlink generic NAS transport"},
245 { 0x69, "Uplink generic NAS transport"},
249 /* Table 9.8.2: Message types for EPS session management */
251 static const value_string nas_msg_esm_strings[] = {
252 { 0xc1, "Activate default EPS bearer context request"},
253 { 0xc2, "Activate default EPS bearer context accept"},
254 { 0xc3, "Activate default EPS bearer context reject"},
255 { 0xc5, "Activate dedicated EPS bearer context request"},
256 { 0xc6, "Activate dedicated EPS bearer context accept"},
257 { 0xc7, "Activate dedicated EPS bearer context reject"},
258 { 0xc9, "Modify EPS bearer context request"},
259 { 0xca, "Modify EPS bearer context accept"},
260 { 0xcb, "Modify EPS bearer context reject"},
261 { 0xcd, "Deactivate EPS bearer context request"},
262 { 0xce, "Deactivate EPS bearer context accept"},
263 { 0xd0, "PDN connectivity request"},
264 { 0xd1, "PDN connectivity reject"},
265 { 0xd2, "PDN disconnect request"},
266 { 0xd3, "PDN disconnect reject"},
267 { 0xd4, "Bearer resource allocation request"},
268 { 0xd5, "Bearer resource allocation reject"},
269 { 0xd6, "Bearer resource modification request"},
270 { 0xd7, "Bearer resource modification reject"},
271 { 0xd9, "ESM information request"},
272 { 0xda, "ESM information response"},
273 { 0xdb, "Notification"},
274 { 0xe8, "ESM status"},
278 static const value_string security_header_type_vals[] = {
279 { 0, "Plain NAS message, not security protected"},
280 { 1, "Integrity protected"},
281 { 2, "Integrity protected and ciphered"},
282 { 3, "Integrity protected with new EPS security context"},
283 { 4, "Integrity protected and ciphered with new EPS security context"},
291 { 12, "Security header for the SERVICE REQUEST message "},
292 { 13, "These values are not used in this version of the protocol. If received they shall be interpreted as \"1100\""},
293 { 14, "These values are not used in this version of the protocol. If received they shall be interpreted as \"1100\""},
294 { 15, "These values are not used in this version of the protocol. If received they shall be interpreted as \"1100\""},
297 static value_string_ext security_header_type_vals_ext = VALUE_STRING_EXT_INIT(security_header_type_vals);
299 const value_string nas_eps_common_elem_strings[] = {
300 { 0x00, "Additional information" }, /* 9.9.2.0 Additional information */
301 { 0x00, "EPS bearer context status" }, /* 9.9.2.1 EPS bearer context status */
302 { 0x00, "Location area identification" }, /* 9.9.2.2 Location area identification */
303 { 0x00, "Mobile identity" }, /* 9.9.2.3 Mobile identity */
304 { 0x00, "Mobile station classmark 2" }, /* 9.9.2.4 Mobile station classmark 2 */
305 { 0x00, "Mobile station classmark 3" }, /* 9.9.2.5 Mobile station classmark 3 */
306 { 0x00, "NAS security parameters from E-UTRA" }, /* 9.9.2.6 NAS security parameters from E-UTRA */
307 { 0x00, "NAS security parameters to E-UTRA" }, /* 9.9.2.7 NAS security parameters to E-UTRA */
308 { 0x00, "PLMN list" }, /* 9.9.2.8 PLMN list */
309 /* 9.9.2.9 Spare half octet */
310 { 0x00, "Supported codec list" }, /* 9.9.2.10 Supported codec list */
313 /* Utility functions */
315 calc_bitrate(guint8 value){
316 guint16 return_value = value;
318 if (value > 63 && value <= 127) {
319 return_value = 64 + (value - 64) * 8;
321 else if (value > 127 && value <= 254) {
322 return_value = 576 + (value - 128) * 64;
324 else if (value==0xff) {
330 calc_bitrate_ext(guint8 value){
331 guint32 return_value = 0;
333 if (value > 0 && value <= 0x4a) {
334 return_value = 8600 + value * 100;
336 else if (value > 0x4a && value <= 0xba) {
337 return_value = 16 + (value-0x4a);
339 else if (value > 0xba && value <= 0xfa) {
340 return_value = 128 + (value-0xba)*2;
349 #define NUM_NAS_EPS_COMMON_ELEM (sizeof(nas_eps_common_elem_strings)/sizeof(value_string))
350 gint ett_nas_eps_common_elem[NUM_NAS_EPS_COMMON_ELEM];
354 DE_EPS_CMN_ADD_INFO, /* 9.9.2.0 Additional information */
355 DE_EPS_CMN_EPS_BE_CTX_STATUS, /* 9.9.2.1 EPS bearer context status */
356 DE_EPS_CMN_LOC_AREA_ID, /* 9.9.2.2 Location area identification */
357 DE_EPS_CMN_MOB_ID, /* 9.9.2.3 Mobile identity */
358 DE_EPS_MS_CM_2, /* 9.9.2.4 Mobile station classmark 2 */
359 DE_EPS_MS_CM_3, /* 9.9.2.5 Mobile station classmark 3 */
360 DE_EPS_NAS_SEC_PAR_FROM_EUTRA, /* 9.9.2.6 NAS security parameters from E-UTRA */
361 DE_EPS_NAS_SEC_PAR_TO_EUTRA, /* 9.9.2.7 NAS security parameters to E-UTRA */
363 DE_EPS_CMN_PLM_LST, /* 9.9.2.8 PLMN list */
364 DE_EPS_CMN_SUP_CODEC_LST, /* 9.9.2.6 9.9.2.10 Supported codec list */
365 DE_EPS_COMMON_NONE /* NONE */
367 nas_eps_common_elem_idx_t;
369 * 9.9.2 Common information elements
372 /* 9.9.2.0 Additional information */
374 de_eps_cmn_add_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
376 proto_tree_add_text(tree, tvb, offset, len, "Not dissected yet");
382 * 9.9.2.1 EPS bearer context status
384 static const true_false_string nas_eps_emm_ebi_vals = {
385 "BEARER CONTEXT-ACTIVE",
386 "BEARER CONTEXT-INACTIVE"
390 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_)
394 curr_offset = offset;
396 /* EBI(7) EBI(6) EBI(5) EBI(4) EBI(3) EBI(2) EBI(1) EBI(0) octet 3 */
397 proto_tree_add_item(tree, hf_nas_eps_emm_ebi7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
398 proto_tree_add_item(tree, hf_nas_eps_emm_ebi6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
399 proto_tree_add_item(tree, hf_nas_eps_emm_ebi5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
400 /* EBI(0) - EBI(4): Bits 0 to 4 of octet 3 are spare and shall be coded as zero. */
401 proto_tree_add_item(tree, hf_nas_eps_emm_ebi4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
402 proto_tree_add_item(tree, hf_nas_eps_emm_ebi3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
403 proto_tree_add_item(tree, hf_nas_eps_emm_ebi2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
404 proto_tree_add_item(tree, hf_nas_eps_emm_ebi1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
405 proto_tree_add_item(tree, hf_nas_eps_emm_ebi0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
407 /* EBI(15) EBI(14) EBI(13) EBI(12) EBI(11) EBI(10) EBI(9) EBI(8) octet 4 */
408 proto_tree_add_item(tree, hf_nas_eps_emm_ebi15, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
409 proto_tree_add_item(tree, hf_nas_eps_emm_ebi14, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
410 proto_tree_add_item(tree, hf_nas_eps_emm_ebi13, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
411 proto_tree_add_item(tree, hf_nas_eps_emm_ebi12, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
412 proto_tree_add_item(tree, hf_nas_eps_emm_ebi11, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
413 proto_tree_add_item(tree, hf_nas_eps_emm_ebi10, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
414 proto_tree_add_item(tree, hf_nas_eps_emm_ebi9, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
415 proto_tree_add_item(tree, hf_nas_eps_emm_ebi8, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
420 * 9.9.2.2 Location area identification
421 * See subclause 10.5.1.3 in 3GPP TS 24.008 [6].
424 * 9.9.2.3 Mobile identity
425 * See subclause 10.5.1.4 in 3GPP TS 24.008 [6].
426 * exported from gsm_a_common
430 * 9.9.2.4 Mobile station classmark 2
431 * See subclause 10.5.1.6 in 3GPP TS 24.008 [13].
434 * 9.9.2.5 Mobile station classmark 3
435 * See subclause 10.5.1.7 in 3GPP TS 24.008 [13].
439 * 9.9.2.6 NAS security parameters from E-UTRA
442 de_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_)
446 curr_offset = offset;
448 /* DL NAS COUNT value (short) (octet 2, bit 1 to 4)
449 * This field contains the 4 least significant bits of the binary representation of the downlink
450 * NAS COUNT value applicable when this information element is sent.
452 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
453 proto_tree_add_item(tree, hf_nas_eps_emm_dl_nas_cnt, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
459 * 9.9.2.7 NAS security parameters to E-UTRA
462 de_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_)
466 curr_offset = offset;
467 /* NonceMME value (octet 1 to 5)
468 * This field is coded as the nonce value in the Nonce information element (see subclause 9.9.3.25).
470 proto_tree_add_item(tree, hf_nas_eps_emm_nonce_mme, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
472 /* type of ciphering algorithm (octet 6, bit 5 to 7)
473 * These fields are coded as the type of integrity protection algorithm and type of ciphering algorithm
474 * in the NAS security algorithms information element (see subclause 9.9.3.23).
475 * Bit 4 and 8 of octet 6 are spare and shall be coded as zero.
477 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN);
478 proto_tree_add_item(tree, hf_nas_eps_emm_toc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
479 /* Type of integrity protection algorithm (octet 6, bit 1 to 3)*/
480 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+4, 1, ENC_BIG_ENDIAN);
481 proto_tree_add_item(tree, hf_nas_eps_emm_toi, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
484 * NAS key set identifier (octet 7, bit 1 to 3) and
485 * type of security context flag (TSC) (octet 7, bit 4)
486 * These fields are coded as the NAS key set identifier and type of security context flag in the
487 * NAS key set identifier information element (see subclause 9.9.3.21).
488 * Bit 5 to 8 of octet 7 are spare and shall be coded as zero.
490 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
491 /* Type of security context flag (TSC) V 1/2 */
492 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, (curr_offset<<3)+4, 1, ENC_BIG_ENDIAN);
493 /* NAS key set identifier */
494 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, (curr_offset<<3)+5, 3, ENC_BIG_ENDIAN);
501 * See subclause 10.5.1.13 in 3GPP TS 24.008 [6].
504 * 9.9.2.9 Spare half octet
505 * This element is used in the description of EMM and ESM messages when an odd number of
506 * half octet type 1 information elements are used. This element is filled with spare bits
507 * set to zero and is placed in bits 5 to 8 of the octet unless otherwise specified.
512 * 9.9.2.10 Supported codec list
513 * See subclause 10.5.4.32 in 3GPP TS 24.008 [13].
514 * Dissected in packet-gsm_a_dtap.c
517 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) = {
518 /* 9.9.2 Common information elements */
519 de_eps_cmn_add_info, /* 9.9.2.0 Additional information */
520 de_eps_cmn_eps_be_ctx_status, /* 9.9.2.1 EPS bearer context status */
521 de_lai, /* 9.9.2.2 Location area identification */
522 de_mid, /* 9.9.2.3 Mobile identity See subclause 10.5.1.4 in 3GPP TS 24.008*/
523 de_ms_cm_2, /* 9.9.2.4 Mobile station classmark 2 */
524 de_ms_cm_3, /* 9.9.2.5 Mobile station classmark 3 */
525 de_sec_par_from_eutra, /* 9.9.2.6 NAS security parameters from E-UTRA */
526 de_sec_par_to_eutra, /* 9.9.2.7 NAS security parameters to E-UTRA */
528 de_plmn_list, /* 9.9.2.8 PLMN list */
529 NULL, /* 9.9.2.10 Supported codec list (packet-gsm_a_dtap.c) */
533 const value_string nas_emm_elem_strings[] = {
534 /* 9.9.3 EPS Mobility Management (EMM) information elements */
535 { 0x00, "Additional update result" }, /* 9.9.3.0A Additional update result */
536 { 0x00, "Additional update type" }, /* 9.9.3.0B Additional update type */
537 { 0x00, "Authentication failure parameter" }, /* 9.9.3.1 Authentication failure parameter */
538 { 0x00, "Authentication parameter AUTN" }, /* 9.9.3.2 Authentication parameter AUTN */
539 { 0x00, "Authentication parameter RAND" }, /* 9.9.3.3 Authentication parameter RAND */
540 { 0x00, "Authentication response parameter" }, /* 9.9.3.4 Authentication response parameter */
541 { 0x00, "CSFB response" }, /* 9.9.3.5 CSFB response */
542 { 0x00, "Daylight saving time" }, /* 9.9.3.6 Daylight saving time */
543 { 0x00, "Detach type" }, /* 9.9.3.7 Detach type */
544 { 0x00, "DRX parameter" }, /* 9.9.3.8 DRX parameter */
545 { 0x00, "EMM cause" }, /* 9.9.3.9 EMM cause */
546 { 0x00, "EPS attach result" }, /* 9.9.3.10 EPS attach result */
547 { 0x00, "EPS attach type" }, /* 9.9.3.11 EPS attach type */
548 { 0x00, "EPS mobile identity" }, /* 9.9.3.12 EPS mobile identity */
549 { 0x00, "EPS network feature support" }, /* 9.9.3.12 EPS mobile identity */
550 { 0x00, "EPS update result" }, /* 9.9.3.13 EPS update result */
551 { 0x00, "EPS update type" }, /* 9.9.3.14 EPS update type */
552 { 0x00, "ESM message container" }, /* 9.9.3.15 ESM message conta */
553 { 0x00, "GPRS timer" }, /* 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. */
554 { 0x00, "Identity type 2" }, /* 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. */
555 { 0x00, "IMEISV request" }, /* 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. */
556 { 0x00, "KSI and sequence number" }, /* 9.9.3.19 KSI and sequence number */
557 { 0x00, "MS network capability" }, /* 9.9.3.20 MS network capability ,See subclause 10.5.5.12 in 3GPP TS 24.008 [6]. */
558 { 0x00, "NAS key set identifier" }, /* 9.9.3.21 NAS key set identifier */
559 { 0x00, "NAS message container" }, /* 9.9.3.22 NAS message container */
560 { 0x00, "NAS security algorithms" }, /* 9.9.3.23 NAS security algorithms */
561 { 0x00, "Network name" }, /* 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. */
562 { 0x00, "Nonce" }, /* 9.9.3.25 Nonce */
563 { 0x00, "Paging identity" }, /* 9.9.3.25A Paging identity */
564 { 0x00, "P-TMSI signature" }, /* 9.9.3.26 P-TMSI signature, See subclause 10.5.5.8 in 3GPP TS 24.008 [6]. */
565 { 0x00, "Service type" }, /* 9.9.3.27 Service type ,See subclause 10.5.5.15 in 3GPP TS 24.008 [6]. */
566 { 0x00, "Short MAC" }, /* 9.9.3.28 Short MAC */
567 { 0x00, "Time zone" }, /* 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. */
568 { 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]. */
569 { 0x00, "TMSI status" }, /* 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. */
570 { 0x00, "Tracking area identity" }, /* 9.9.3.32 Tracking area identity */
571 { 0x00, "Tracking area identity list" }, /* 9.9.3.33 Tracking area identity list */
572 { 0x00, "UE network capability" }, /* 9.9.3.34 UE network capability */
573 { 0x00, "UE radio capability information update needed" }, /* 9.9.3.35 UE radio capability information update needed */
574 { 0x00, "UE security capability" }, /* 9.9.3.36 UE security capability */
575 { 0x00, "Emergency Number List" }, /* 9.9.3.37 Emergency Number List */
576 { 0x00, "CLI" }, /* 9.9.3.38 CLI */
577 { 0x00, "SS Code" }, /* 9.9.3.39 SS Code */
578 { 0x00, "LCS indicator" }, /* 9.9.3.40 LCS indicator */
579 { 0x00, "LCS client identity" }, /* 9.9.3.41 LCS client identity */
583 #define NUM_NAS_EMM_ELEM (sizeof(nas_emm_elem_strings)/sizeof(value_string))
584 gint ett_nas_eps_emm_elem[NUM_NAS_EMM_ELEM];
587 This enum has been moved to packet-gsm_a_common to
588 make it possible to use element dissection from this dissector
590 It is left here as a comment for easier reference.
592 Note this enum must be of the same size as the element decoding list
596 /. 9.9.3 EPS Mobility Management (EMM) information elements ./
597 DE_EMM_ADD_UPD_RES, /. 9.9.3.0A Additional update result ./
598 DE_EMM_ADD_UPD_TYPE, /. 9.9.3.0B Additional update type ./
599 DE_EMM_AUTH_FAIL_PAR, /. 9.9.3.1 Authentication failure parameter (dissected in packet-gsm_a_dtap.c)./
600 DE_EMM_AUTN, /. 9.9.3.2 Authentication parameter AUTN ./
601 DE_EMM_AUTH_PAR_RAND, /. 9.9.3.3 Authentication parameter RAND ./
602 DE_EMM_AUTH_RESP_PAR, /. 9.9.3.4 Authentication response parameter ./
603 DE_EMM_CSFB_RESP, /. 9.9.3.5 CSFB response ./
604 DE_EMM_DAYL_SAV_T, /. 9.9.3.6 Daylight saving time ./
605 DE_EMM_DET_TYPE, /. 9.9.3.7 Detach type ./
606 DE_EMM_DRX_PAR, /. 9.9.3.8 DRX parameter (dissected in packet-gsm_a_gm.c)./
607 DE_EMM_CAUSE, /. 9.9.3.9 EMM cause ./
608 DE_EMM_ATT_RES, /. 9.9.3.10 EPS attach result (Coded inline ./
609 DE_EMM_ATT_TYPE, /. 9.9.3.11 EPS attach type (Coded Inline)./
610 DE_EMM_EPS_MID, /. 9.9.3.12 EPS mobile identity ./
611 DE_EMM_EPS_NET_FEATURE_SUP, /. 9.9.3.12A EPS network feature support ./
612 DE_EMM_EPS_UPD_RES, /. 9.9.3.13 EPS update result ( Coded inline)./
613 DE_EMM_EPS_UPD_TYPE, /. 9.9.3.14 EPS update type ./
614 DE_EMM_ESM_MSG_CONT, /. 9.9.3.15 ESM message conta ./
615 DE_EMM_GPRS_TIMER, /. 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. ./
616 DE_EMM_ID_TYPE_2, /. 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. ./
617 DE_EMM_IMEISV_REQ, /. 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. ./
618 DE_EMM_KSI_AND_SEQ_NO, /. 9.9.3.19 KSI and sequence number ./
619 DE_EMM_MS_NET_CAP, /. 9.9.3.20 MS network capability ,See subclause 10.5.5.12 in 3GPP TS 24.008 [6]. ./
620 DE_EMM_NAS_KEY_SET_ID, /. 9.9.3.21 NAS key set identifier (coded inline)./
621 DE_EMM_NAS_MSG_CONT, /. 9.9.3.22 NAS message container ./
622 DE_EMM_NAS_SEC_ALGS, /. 9.9.3.23 NAS security algorithms ./
623 DE_EMM_NET_NAME, /. 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. ./
624 DE_EMM_NONCE, /. 9.9.3.25 Nonce ./
625 DE_EMM_PAGING_ID, /. 9.9.3.25A Paging identity ./
626 DE_EMM_P_TMSI_SIGN, /. 9.9.3.26 P-TMSI signature, See subclause 10.5.5.8 in 3GPP TS 24.008 [6]. ./
627 DE_EMM_SERV_TYPE, /. 9.9.3.27 Service type ./
628 DE_EMM_SHORT_MAC, /. 9.9.3.28 Short MAC ./
629 DE_EMM_TZ, /. 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. ./
630 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]. ./
631 DE_EMM_TMSI_STAT, /. 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. ./
632 DE_EMM_TRAC_AREA_ID, /. 9.9.3.32 Tracking area identity ./
633 DE_EMM_TRAC_AREA_ID_LST, /. 9.9.3.33 Tracking area identity list ./
634 DE_EMM_UE_NET_CAP, /. 9.9.3.34 UE network capability ./
635 DE_EMM_UE_RA_CAP_INF_UPD_NEED, /. 9.9.3.35 UE radio capability information update needed ./
636 DE_EMM_UE_SEC_CAP, /. 9.9.3.36 UE security capability ./
637 DE_EMM_EMERG_NUM_LST, /. 9.9.3.37 Emergency Number List ./
638 DE_EMM_CLI, /. 9.9.3.38 CLI ./
639 DE_EMM_SS_CODE, /. 9.9.3.39 SS Code ./
640 DE_EMM_LCS_IND, /. 9.9.3.40 LCS indicator ./
641 DE_EMM_LCS_CLIENT_ID, /. 9.9.3.41 LCS client identity ./
642 DE_EMM_GEN_MSG_CONT_TYPE, /. 9.9.3.42 Generic message container type ./
643 DE_EMM_GEN_MSG_CONT, /. 9.9.3.43 Generic message container ./
644 DE_EMM_VOICE_DMN_PREF, /. 9.9.3.44 Voice domain preference and UEs usage setting ./
645 DE_EMM_NONE /. NONE ./
651 /* TODO: Update to latest spec */
652 /* 9.9.3 EPS Mobility Management (EMM) information elements
655 * 9.9.3.0A Additional update result
657 static const value_string nas_eps_emm_add_upd_res_vals[] = {
658 { 0x0, "no additional information"},
659 { 0x1, "CS Fallback not preferred"},
665 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_)
667 guint32 curr_offset, bit_offset;
669 curr_offset = offset;
670 bit_offset = (curr_offset<<3)+4;
672 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
674 proto_tree_add_bits_item(tree, hf_nas_eps_emm_add_upd_res, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
677 return (curr_offset - offset);
680 * 9.9.3.0B Additional update type
682 static const value_string nas_eps_emm_add_upd_type_vals[] = {
683 { 0x0, "no additional information (shall be interpreted as request for combined attach or combined tracking area updating)"},
688 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_)
690 guint32 curr_offset, bit_offset;
692 curr_offset = offset;
693 bit_offset = (curr_offset<<3)+4;
695 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
697 proto_tree_add_bits_item(tree, hf_nas_eps_emm_add_upd_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
700 return (curr_offset - offset);
703 * 9.9.3.1 Authentication failure parameter
704 * See subclause 10.5.3.2.2 in 3GPP TS 24.008 [6].
705 * (dissected in packet-gsm_a_dtap.c)
708 * 9.9.3.2 Authentication parameter AUTN
709 * See subclause 10.5.3.1.1 in 3GPP TS 24.008 [6].
712 * 9.9.3.3 Authentication parameter RAND
713 * See subclause 10.5.3.1 in 3GPP TS 24.008 [6].
716 * 9.9.3.4 Authentication response parameter
719 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_)
723 curr_offset = offset;
725 proto_tree_add_item(tree, hf_nas_eps_emm_res, tvb, curr_offset, len, ENC_BIG_ENDIAN);
730 * 9.9.3.4A Ciphering key sequence number
731 * See subclause 9.9.3.19 in 3GPP TS 24.008 [13].
735 * 9.9.3.5 CSFB response
739 * CSFB response value (octet 1)
742 static const value_string nas_eps_emm_csfb_resp_vals[] = {
743 { 0x0, "CS fallback rejected by the UE"},
744 { 0x1, "CS fallback accepted by the UE"},
749 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_)
751 guint32 curr_offset, bit_offset;
753 curr_offset = offset;
756 bit_offset = curr_offset<<3;
757 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset+4, 1, ENC_BIG_ENDIAN);
759 proto_tree_add_item(tree, hf_nas_eps_emm_csfb_resp, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
762 return(curr_offset-offset);
765 * 9.9.3.6 Daylight saving time
766 * See subclause 10.5.3.12 in 3GPP TS 24.008 [6].
769 * 9.9.3.7 Detach type
772 static const value_string nas_eps_emm_switch_off_vals[] = {
773 { 0x0, "Normal detach"},
774 { 0x1, "Switch off"},
783 /* Type of detach (octet 1)
784 * In the UE to network direction:
786 static const value_string nas_eps_emm_type_of_dtatch_UL_vals[] = {
787 { 0x1, "EPS detach"},
788 { 0x2, "IMSI detach"},
789 { 0x3, "Combined EPS/IMSI detach"},
790 { 0x4, "Combined EPS/IMSI detach"}, /* All other values are interpreted as "combined EPS/IMSI detach" in this version of the protocol.*/
791 { 0x5, "Combined EPS/IMSI detach"}, /* -"- */
798 * In the network to UE direction:
801 static const value_string nas_eps_emm_type_of_dtatch_DL_vals[] = {
802 { 0x1, "Re-attach required"},
803 { 0x2, "Re-attach not required"},
804 { 0x3, "IMSI detach"},
805 { 0x4, "Re-attach not required"}, /* All other values are interpreted as "re-attach not required" in this version of the protocol.*/
806 { 0x5, "Re-attach not required"}, /* -"- */
813 * 9.9.3.8 DRX parameter
814 * See subclause 10.5.5.6 in 3GPP TS 24.008 [13].
819 static const value_string nas_eps_emm_cause_values[] = {
820 { 0x2, "IMSI unknown in HSS"},
821 { 0x3, "Illegal UE"},
822 { 0x5, "IMEI not accepted"},
823 { 0x6, "Illegal ME"},
824 { 0x7, "EPS services not allowed"},
825 { 0x8, "EPS services and non-EPS services not allowed"},
826 { 0x9, "UE identity cannot be derived by the network"},
827 { 0xa, "Implicitly detached"},
828 { 0xb, "PLMN not allowed"},
829 { 0xc, "Tracking Area not allowed"},
830 { 0xd, "Roaming not allowed in this tracking area"},
831 { 0xe, "EPS services not allowed in this PLMN"},
832 { 0xf, "No Suitable Cells In tracking area"},
833 { 0x10, "MSC temporarily not reachable"},
834 { 0x11, "Network failure"},
835 { 0x12, "CS domain not available"},
836 { 0x13, "ESM failure"},
837 { 0x14, "MAC failure"},
838 { 0x15, "Synch failure"},
839 { 0x16, "Congestion"},
840 { 0x17, "UE security capabilities mismatch"},
841 { 0x18, "Security mode rejected, unspecified"},
842 { 0x19, "Not authorized for this CSG"},
843 { 0x1a, "Non-EPS authentication unacceptable"},
844 { 0x27, "CS domain temporarily not available"},
845 { 0x28, "No EPS bearer context activated"},
846 { 0x5f, "Semantically incorrect message"},
847 { 0x60, "Invalid mandatory information"},
848 { 0x61, "Message type non-existent or not implemented"},
849 { 0x62, "Message type not compatible with the protocol state"},
850 { 0x63, "Information element non-existent or not implemented"},
851 { 0x64, "Conditional IE error"},
852 { 0x65, "Message not compatible with the protocol state"},
853 { 0x6f, "Protocol error, unspecified"},
858 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_)
862 curr_offset = offset;
864 proto_tree_add_item(tree, hf_nas_eps_emm_cause, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
867 return curr_offset-offset;}
869 * 9.9.3.10 EPS attach result
872 static const value_string nas_eps_emm_EPS_attach_result_values[] = {
875 { 2, "Combined EPS/IMSI attach"},
886 * 9.9.3.11 EPS attach type
889 static const value_string nas_eps_emm_eps_att_type_vals[] = {
890 { 0, "EPS attach(unused)"},
892 { 2, "Combined handover EPS/IMSI attach"},
893 { 3, "EPS attach(unused)"},
894 { 4, "EPS attach(unused)"},
895 { 5, "EPS attach(unused)"},
896 { 6, "EPS emergency attach"},
903 * 9.9.3.12 EPS mobile identity
906 unpack_eps_mid_digits(tvbuff_t *tvb) {
914 length = tvb_length(tvb);
916 digit_str = ep_alloc(length*2);
918 /* Get identity digit 1 */
919 octet = tvb_get_guint8(tvb,offset);
920 digit_str[i++] = (((octet>>4) & 0x0f) + '0');
923 /* Loop on following octets to retrieve other identity digits */
924 while ( offset < length ){
926 octet = tvb_get_guint8(tvb,offset);
927 digit_str[i] = ((octet & 0x0f) + '0');
931 * unpack second value in byte
935 if (octet == 0x0f) /* odd number bytes - hit filler */
938 digit_str[i] = ((octet & 0x0f) + '0');
947 static const value_string nas_eps_emm_type_of_id_vals[] = {
959 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_)
966 curr_offset = offset;
968 octet = tvb_get_guint8(tvb,offset);
969 /* Type of identity (octet 3) */
970 proto_tree_add_item(tree, hf_nas_eps_emm_odd_even, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
971 proto_tree_add_item(tree, hf_nas_eps_emm_type_of_id, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
975 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
976 digit_str = unpack_eps_mid_digits(new_tvb);
977 proto_tree_add_string(tree, hf_nas_eps_emm_imsi, new_tvb, 0, -1, digit_str);
981 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
982 digit_str = unpack_eps_mid_digits(new_tvb);
983 proto_tree_add_string(tree, hf_nas_eps_emm_imei, new_tvb, 0, -1, digit_str);
988 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
989 /* MME Group ID octet 7 - 8 */
990 proto_tree_add_item(tree, hf_nas_eps_emm_mme_grp_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
992 /* MME Code Octet 9 */
993 proto_tree_add_item(tree, hf_nas_eps_emm_mme_code, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
995 /* M-TMSI Octet 10 - 13 */
996 proto_tree_add_item(tree, hf_nas_eps_emm_m_tmsi, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
1000 proto_tree_add_text(tree, tvb, curr_offset, len - 1, "Type of identity not known");
1008 * 9.9.3.12A EPS network feature support
1010 static const value_string nas_eps_emm_cs_lcs_vals[] = {
1011 { 0, "no information about support of location services via CS domain is available"},
1012 { 1, "location services via CS domain not supported"},
1013 { 2, "location services via CS domain supported"},
1017 static const true_false_string nas_eps_emm_epc_lcs_value = {
1018 "location services via EPC supported",
1019 "location services via EPC not supported"
1021 static const true_false_string nas_eps_emm_emc_bs_value = {
1022 "emergency bearer services in S1 mode supported",
1023 "emergency bearer services in S1 mode not supported"
1025 static const true_false_string nas_eps_emm_ims_vops_value = {
1026 "IMS voice over PS session in S1 mode supported",
1027 "IMS voice over PS session in S1 mode not supported"
1031 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_)
1033 guint32 curr_offset, bit_offset;
1035 curr_offset = offset;
1036 bit_offset = curr_offset << 3;
1037 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1039 proto_tree_add_bits_item(tree, hf_nas_eps_emm_cs_lcs_type, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
1041 proto_tree_add_bits_item(tree, hf_nas_eps_emm_epc_lcs_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1043 proto_tree_add_bits_item(tree, hf_nas_eps_emm_emc_bs_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1045 proto_tree_add_bits_item(tree, hf_nas_eps_emm_ims_vops_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1051 * 9.9.3.13 EPS update result
1053 static const value_string nas_eps_emm_eps_update_result_vals[] = {
1055 { 1, "Combined TA/LA updated"},
1058 { 4, "TA updated and ISR activated"},
1059 { 5, "Combined TA/LA updated and ISR activated"},
1066 * 9.9.3.14 EPS update type
1068 static const true_false_string nas_eps_emm_active_flg_value = {
1069 "Bearer establishment requested",
1070 "No bearer establishment requested"
1073 static const value_string nas_eps_emm_eps_update_type_vals[] = {
1074 { 0, "TA updating"},
1075 { 1, "Combined TA/LA updating"},
1076 { 2, "Combined TA/LA updating with IMSI attach"},
1077 { 3, "Periodic updating"},
1078 { 4, "Unused; shall be interpreted as 'TA updating', if received by the network"},
1079 { 5, "Unused; shall be interpreted as 'TA updating', if received by the network"},
1086 * 9.9.3.15 ESM message container
1089 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_)
1092 proto_tree *sub_tree;
1094 guint32 curr_offset;
1096 curr_offset = offset;
1099 item = proto_tree_add_item(tree, hf_nas_eps_esm_msg_cont, tvb, curr_offset, len, ENC_BIG_ENDIAN);
1100 sub_tree = proto_item_add_subtree(item, ett_nas_eps_esm_msg_cont);
1102 /* This IE can contain any ESM PDU as defined in subclause 8.3. */
1103 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1104 /* Plain NAS message */
1105 disect_nas_eps_esm_msg(new_tvb, gpinfo, sub_tree, 0/* offset */);
1110 * 9.9.3.16 GPRS timer
1111 * See subclause 10.5.7.3 in 3GPP TS 24.008 [6].
1115 * 9.9.3.17 Identity type 2
1116 * See subclause 10.5.5.9 in 3GPP TS 24.008 [6].
1118 static const value_string nas_eps_emm_id_type2_vals[] = {
1127 * 9.9.3.18 IMEISV request
1128 * See subclause 10.5.5.10 in 3GPP TS 24.008 [6].
1130 /* IMEISV request value (octet 1) */
1131 static const value_string nas_eps_emm_imeisv_req_vals[] = {
1132 { 0, "IMEISV not requested"},
1133 { 1, "IMEISV requested"},
1134 { 2, "IMEISV not requested"},
1135 { 3, "IMEISV not requested"},
1136 { 4, "IMEISV not requested"},
1137 { 5, "IMEISV not requested"},
1138 { 6, "IMEISV not requested"},
1139 { 7, "IMEISV not requested"},
1143 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_)
1145 guint32 curr_offset;
1148 curr_offset = offset;
1150 bit_offset = curr_offset<<3;
1152 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1153 proto_tree_add_item(tree, hf_nas_eps_esm_imeisv_req, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1156 return(curr_offset - offset);
1159 * 9.9.3.19 KSI and sequence number
1162 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_)
1164 guint32 curr_offset;
1167 curr_offset = offset;
1168 bit_offset = curr_offset<<3;
1170 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1172 proto_tree_add_bits_item(tree, hf_nas_eps_seq_no_short, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
1175 return(curr_offset - offset);
1179 * 9.9.3.20 MS network capability
1180 * See subclause 10.5.5.12 in 3GPP TS 24.008 [6].
1183 * 9.9.3.21 NAS key set identifier
1186 * Type of security context flag (TSC) (octet 1)
1188 static const value_string nas_eps_tsc_vals[] = {
1189 { 0, "Native security context (for KSIasme)"},
1190 { 1, "Mapped security context (for KSIsgsn)"},
1194 /* NAS key set identifier (octet 1) Bits 3 2 1 */
1196 static const value_string nas_eps_emm_NAS_key_set_identifier_vals[] = {
1204 { 7, "No key is available"},
1208 /* Takes bit offset as input and consumes 4 bits */
1210 de_emm_nas_key_set_id_bits(tvbuff_t *tvb, proto_tree *tree, guint32 bit_offset, const gchar *add_string)
1214 /* Type of security context flag (TSC) (octet 1) V 1/2 */
1215 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1217 /* NAS key set identifier (octet 1) */
1218 item = proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1220 proto_item_append_text(item, "%s", add_string);
1225 * Note used for TV Short
1228 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_)
1230 guint32 curr_offset, bit_offset;
1232 curr_offset = offset;
1234 /* Get the bit offset of the lover half of the octet bits 4 - 1 */
1235 bit_offset = curr_offset<<3;
1238 /* Type of security context flag (TSC) (octet 1) V 1/2 */
1239 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1241 /* NAS key set identifier (octet 1) */
1242 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1246 return(curr_offset - offset);
1250 * 9.9.3.22 NAS message container
1253 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_)
1256 guint32 curr_offset;
1258 curr_offset = offset;
1261 /* NAS message container contents (octet 3 to octet n)
1262 * This IE can contain an SMS message (i.e. CP-DATA, CP-ACK or CP-ERROR)
1263 * as defined in subclause 7.2 in 3GPP TS 24.011 [13A].
1266 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1267 if(gsm_a_dtap_handle)
1268 call_dissector(gsm_a_dtap_handle,new_tvb, gpinfo, tree);
1273 * 9.9.3.23 NAS security algorithms
1275 /* Type of integrity protection algorithm (octet 2, bit 1 to 3) */
1276 static const value_string nas_eps_emm_toi_vals[] = {
1277 { 0, "EPS integrity algorithm EIA0 (null integrity protection algorithm)"},
1278 { 1, "EPS integrity algorithm 128-EIA1"},
1279 { 2, "EPS integrity algorithm 128-EIA2"},
1280 { 3, "EPS integrity algorithm EIA3"},
1281 { 4, "EPS integrity algorithm EIA4"},
1282 { 5, "EPS integrity algorithm EIA5"},
1283 { 6, "EPS integrity algorithm EIA6"},
1284 { 7, "EPS integrity algorithm EIA7"},
1288 /* Type of ciphering algorithm (octet 2, bit 5 to 7) */
1290 static const value_string nas_eps_emm_toc_vals[] = {
1291 { 0, "EPS encryption algorithm EEA0 (null ciphering algorithm)"},
1292 { 1, "EPS encryption algorithm 128-EEA1"},
1293 { 2, "EPS encryption algorithm 128-EEA2"},
1294 { 3, "EPS encryption algorithm EEA3"},
1295 { 4, "EPS encryption algorithm EEA4"},
1296 { 5, "EPS encryption algorithm EEA5"},
1297 { 6, "EPS encryption algorithm EEA6"},
1298 { 7, "EPS encryption algorithm EEA7"},
1302 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_)
1305 guint32 curr_offset;
1307 curr_offset = offset;
1309 bit_offset = offset<<3;
1310 /* Bit 4 and 8 of octet 2 are spare and shall be coded as zero. */
1311 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1312 /* Type of ciphering algorithm (octet 2, bit 5 to 7) */
1313 proto_tree_add_item(tree, hf_nas_eps_emm_toc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1315 /* Bit 4 and 8 of octet 2 are spare and shall be coded as zero. */
1316 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1317 /* Type of integrity protection algorithm (octet 2, bit 1 to 3) */
1318 proto_tree_add_item(tree, hf_nas_eps_emm_toi, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1322 return(curr_offset-offset);
1325 * 9.9.3.24 Network name
1326 * See subclause 10.5.3.5a in 3GPP TS 24.008 [6].
1332 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_)
1334 guint32 curr_offset;
1336 curr_offset = offset;
1338 proto_tree_add_item(tree, hf_nas_eps_emm_nonce, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
1344 * 9.9.3.25A Paging identity
1346 static const true_false_string nas_eps_emm_paging_id_vals = {
1352 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_)
1354 guint32 curr_offset;
1356 curr_offset = offset;
1358 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 7, ENC_BIG_ENDIAN);
1359 proto_tree_add_bits_item(tree, hf_nas_eps_emm_paging_id, tvb, (curr_offset<<3)+7, 1, ENC_BIG_ENDIAN);
1365 * 9.9.3.26 P-TMSI signature
1366 * See subclause 10.5.5.8 in 3GPP TS 24.008 [6].
1369 * 9.9.3.27 Service type
1371 static const value_string nas_eps_service_type_vals[] = {
1372 { 0, "Mobile originating CS fallback or 1xCS fallback"},
1373 { 1, "Mobile terminating CS fallback or 1xCS fallback"},
1374 { 2, "Mobile originating CS fallback emergency call or 1xCS fallback emergency call"},
1379 * 9.9.3.28 Short MAC
1382 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_)
1384 guint32 curr_offset;
1386 curr_offset = offset;
1389 proto_tree_add_item(tree, hf_nas_eps_emm_short_mac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1392 return(curr_offset-offset);
1395 * 9.9.3.29 Time zone
1396 * See subclause 10.5.3.8 in 3GPP TS 24.008 [6].
1399 * 9.9.3.30 Time zone and time
1400 * See subclause 10.5.3.9 in 3GPP TS 24.008 [6].
1403 * 9.9.3.31 TMSI status
1404 * See subclause 10.5.5.4 in 3GPP TS 24.008 [6].
1407 * 9.9.3.32 Tracking area identity
1411 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_)
1413 guint32 curr_offset;
1415 curr_offset = offset;
1417 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1418 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1421 return(curr_offset-offset);
1424 * 9.9.3.33 Tracking area identity list
1426 /* Type of list (octet 1)
1429 static const value_string nas_eps_emm_tai_tol_vals[] = {
1430 { 0, "list of TACs belonging to one PLMN, with non-consecutive TAC values"},
1431 { 1, "list of TACs belonging to one PLMN, with consecutive TAC values"},
1432 { 2, "list of TAIs belonging to different PLMNs"},
1437 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_)
1440 guint32 curr_offset;
1441 guint8 octet, tol, n_elem;
1444 curr_offset = offset;
1446 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN);
1447 /* Type of list (octet 1) Bits 7 6 */
1448 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tol, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1449 /* Number of elements (octet 1) Bits 5 4 3 2 1 */
1450 octet = tvb_get_guint8(tvb,curr_offset)& 0x7f;
1452 n_elem = (octet & 0x1f)+1;
1453 item = proto_tree_add_item(tree, hf_nas_eps_emm_tai_n_elem, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1455 proto_item_append_text(item, " [+1 = %u element(s)]", n_elem);
1459 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 )");
1465 /* MCC digit 2 MCC digit 1 octet 2
1466 * MNC digit 3 MCC digit 3 octet 3
1467 * MNC digit 2 MNC digit 1 octet 4
1469 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1470 /* type of list = "000" */
1472 * TAC 1 (continued) octet 6
1476 * TAC k (continued) octet 2k+4*
1478 if (len < (guint)(4+(n_elem*2))){
1479 proto_tree_add_text(tree, tvb, curr_offset, len-1 , "[Wrong number of elements?]");
1482 for (i=0; i < n_elem; i++, curr_offset+=2)
1483 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1487 /* type of list = "010" */
1488 /* MCC digit 2 MCC digit 1 octet 2
1489 * MNC digit 3 MCC digit 3 octet 3
1490 * MNC digit 2 MNC digit 1 octet 4
1492 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1493 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1497 if (len< (guint)(1+(n_elem*5))){
1498 proto_tree_add_text(tree, tvb, curr_offset, len-1 , "[Wrong number of elements?]");
1502 for (i=0; i < n_elem; i++){
1503 /* type of list = "001" */
1504 /* MCC digit 2 MCC digit 1 octet 2
1505 * MNC digit 3 MCC digit 3 octet 3
1506 * MNC digit 2 MNC digit 1 octet 4
1508 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1509 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1514 /* Unknown ( Not in 3GPP TS 24.301 version 8.1.0 Release 8 ) */
1517 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1519 return(curr_offset-offset);
1522 * 9.9.3.34 UE network capability
1525 static const true_false_string nas_eps_emm_supported_flg_value = {
1529 static const true_false_string nas_eps_emm_ucs2_supp_flg_value = {
1530 "The UE has no preference between the use of the default alphabet and the use of UCS2",
1531 "The UE has a preference for the default alphabet"
1533 /* LPP capability (octet 7, bit 4) */
1534 static const true_false_string nas_eps_emm_lpp_cap_flg = {
1535 "LTE Positioning Protocol supported",
1536 "LTE Positioning Protocol not supported"
1538 /* LCS capability (octet 7, bit 3) */
1539 static const true_false_string nas_eps_emm_lcs_cap_flg = {
1540 "Location services notification mechanisms supported",
1541 "Location services notification mechanisms not supported"
1543 /* 1xSRVCC capability (octet 7, bit 2) */
1544 static const true_false_string nas_eps_emm_1xsrvcc_cap_flg = {
1545 "SRVCC from E-UTRAN to cdma2000 1xCS supported",
1546 "SRVCC from E-UTRAN to cdma2000 1x CS not supported"
1548 /* NF capability (octet 7, bit 1) */
1549 static const true_false_string nas_eps_emm_nf_cap_flg = {
1550 "Notification procedure supported",
1551 "Notification procedure not supported"
1555 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_)
1557 guint32 curr_offset;
1559 curr_offset = offset;
1562 /* EPS encryption algorithms supported (octet 3) */
1563 /* EPS encryption algorithm EEA0 supported (octet 3, bit 8) */
1564 proto_tree_add_item(tree, hf_nas_eps_emm_eea0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1565 /* EPS encryption algorithm 128-EEA1 supported (octet 3, bit 7) */
1566 proto_tree_add_item(tree, hf_nas_eps_emm_128eea1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1567 /* EPS encryption algorithm 128-EEA2 supported (octet 3, bit 6) */
1568 proto_tree_add_item(tree, hf_nas_eps_emm_128eea2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1569 /* EPS encryption algorithm 128-EEA3 supported (octet 3, bit 5) */
1570 proto_tree_add_item(tree, hf_nas_eps_emm_eea3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1571 /* EPS encryption algorithm 128-EEA4 supported (octet 3, bit 4) */
1572 proto_tree_add_item(tree, hf_nas_eps_emm_eea4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1573 /* EPS encryption algorithm 128-EEA5 supported (octet 3, bit 5) */
1574 proto_tree_add_item(tree, hf_nas_eps_emm_eea5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1575 /* EPS encryption algorithm 128-EEA6 supported (octet 3, bit 6) */
1576 proto_tree_add_item(tree, hf_nas_eps_emm_eea6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1577 /* EPS encryption algorithm 128-EEA7 supported (octet 3, bit 7) */
1578 proto_tree_add_item(tree, hf_nas_eps_emm_eea7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1582 /* EPS integrity algorithms supported (octet 4) */
1583 /* EPS integrity algorithm EIA0 supported (octet 4, bit 8) */
1584 proto_tree_add_item(tree, hf_nas_eps_emm_eia0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1585 /* EPS integrity algorithm 128-EIA1 supported (octet 4, bit 7) */
1586 proto_tree_add_item(tree, hf_nas_eps_emm_128eia1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1587 /* EPS integrity algorithm 128-EIA2 supported (octet 4, bit 6) */
1588 proto_tree_add_item(tree, hf_nas_eps_emm_128eia2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1589 /* EPS integrity algorithm EIA3 supported (octet 4, bit 5) */
1590 proto_tree_add_item(tree, hf_nas_eps_emm_eia3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1591 /* EPS integrity algorithm EIA4 supported (octet 4, bit 4) */
1592 proto_tree_add_item(tree, hf_nas_eps_emm_eia4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1593 /* EPS integrity algorithm EIA5 supported (octet 4, bit 3) */
1594 proto_tree_add_item(tree, hf_nas_eps_emm_eia5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1595 /* EPS integrity algorithm EIA6 supported (octet 4, bit 2) */
1596 proto_tree_add_item(tree, hf_nas_eps_emm_eia6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1597 /* EPS integrity algorithm EIA7 supported (octet 4, bit 1) */
1598 proto_tree_add_item(tree, hf_nas_eps_emm_eia7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1602 /* Following octets are optional */
1603 if ((curr_offset - offset) >= len)
1606 /* UMTS encryption algorithms supported (octet 5)
1607 * UMTS encryption algorithm UEA0 supported (octet 5, bit 8)
1609 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 8) */
1610 proto_tree_add_item(tree, hf_nas_eps_emm_uea0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1611 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 7) */
1612 proto_tree_add_item(tree, hf_nas_eps_emm_uea1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1613 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 6) */
1614 proto_tree_add_item(tree, hf_nas_eps_emm_uea2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1615 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 5) */
1616 proto_tree_add_item(tree, hf_nas_eps_emm_uea3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1617 /* EPS encryption algorithm 128-UEA0 supported (octet 5, bit 4) */
1618 proto_tree_add_item(tree, hf_nas_eps_emm_uea4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1619 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 5) */
1620 proto_tree_add_item(tree, hf_nas_eps_emm_uea5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1621 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 6) */
1622 proto_tree_add_item(tree, hf_nas_eps_emm_uea6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1623 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 7) */
1624 proto_tree_add_item(tree, hf_nas_eps_emm_uea7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1627 if ((curr_offset - offset) >= len)
1630 /* UCS2 support (UCS2) (octet 6, bit 8)
1631 * This information field indicates the likely treatment of UCS2 encoded character strings
1634 proto_tree_add_item(tree, hf_nas_eps_emm_ucs2_supp, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1635 /* UMTS integrity algorithms supported (octet 6) */
1636 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 7) */
1637 proto_tree_add_item(tree, hf_nas_eps_emm_uia1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1638 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 6) */
1639 proto_tree_add_item(tree, hf_nas_eps_emm_uia2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1640 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 5) */
1641 proto_tree_add_item(tree, hf_nas_eps_emm_uia3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1642 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 4) */
1643 proto_tree_add_item(tree, hf_nas_eps_emm_uia4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1644 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 3) */
1645 proto_tree_add_item(tree, hf_nas_eps_emm_uia5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1646 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 2) */
1647 proto_tree_add_item(tree, hf_nas_eps_emm_uia6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1648 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 1) */
1649 proto_tree_add_item(tree, hf_nas_eps_emm_uia7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1652 if ((curr_offset - offset) >= len)
1655 /* Bits 8 to 5 of octet 7 are spare and shall be coded as zero. */
1656 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 4, ENC_BIG_ENDIAN);
1657 /* LPP capability (octet 7, bit 4) */
1658 proto_tree_add_item(tree, hf_nas_eps_emm_lpp_cap, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1659 /* LCS capability (octet 7, bit 3) */
1660 proto_tree_add_item(tree, hf_nas_eps_emm_lcs_cap, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1661 /* 1xSRVCC capability (octet 7, bit 2) */
1662 proto_tree_add_item(tree, hf_nas_eps_emm_1xsrvcc_cap, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1663 /* NF capability (octet 7, bit 1) */
1664 proto_tree_add_item(tree, hf_nas_eps_emm_nf_cap, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1669 /* UE radio capability information update needed flag (URC upd) (octet 1) */
1670 static const true_false_string nas_eps_emm_ue_ra_cap_inf_upd_need_flg = {
1671 "UE radio capability information update needed",
1672 "UE radio capability information update not needed"
1676 * 9.9.3.35 UE radio capability information update needed
1680 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_)
1682 guint32 curr_offset;
1684 curr_offset = offset;
1686 proto_tree_add_item(tree, hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1691 * 9.9.3.36 UE security capability
1695 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_)
1697 guint32 curr_offset;
1699 curr_offset = offset;
1701 /* EPS encryption algorithms supported (octet 3) */
1702 /* EPS encryption algorithm EEA0 supported (octet 3, bit 8) */
1703 proto_tree_add_item(tree, hf_nas_eps_emm_eea0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1704 /* EPS encryption algorithm 128-EEA1 supported (octet 3, bit 7) */
1705 proto_tree_add_item(tree, hf_nas_eps_emm_128eea1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1706 /* EPS encryption algorithm 128-EEA2 supported (octet 3, bit 6) */
1707 proto_tree_add_item(tree, hf_nas_eps_emm_128eea2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1708 /* EPS encryption algorithm 128-EEA3 supported (octet 3, bit 5) */
1709 proto_tree_add_item(tree, hf_nas_eps_emm_eea3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1710 /* EPS encryption algorithm 128-EEA4 supported (octet 3, bit 4) */
1711 proto_tree_add_item(tree, hf_nas_eps_emm_eea4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1712 /* EPS encryption algorithm 128-EEA5 supported (octet 3, bit 5) */
1713 proto_tree_add_item(tree, hf_nas_eps_emm_eea5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1714 /* EPS encryption algorithm 128-EEA6 supported (octet 3, bit 6) */
1715 proto_tree_add_item(tree, hf_nas_eps_emm_eea6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1716 /* EPS encryption algorithm 128-EEA7 supported (octet 3, bit 7) */
1717 proto_tree_add_item(tree, hf_nas_eps_emm_eea7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1721 /* EPS integrity algorithms supported (octet 4) */
1722 /* EPS integrity algorithm EIA0 supported (octet 4, bit 8) */
1723 proto_tree_add_item(tree, hf_nas_eps_emm_eia0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1724 /* EPS integrity algorithm 128-EIA1 supported (octet 4, bit 7) */
1725 proto_tree_add_item(tree, hf_nas_eps_emm_128eia1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1726 /* EPS integrity algorithm 128-EIA2 supported (octet 4, bit 6) */
1727 proto_tree_add_item(tree, hf_nas_eps_emm_128eia2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1728 /* EPS integrity algorithm EIA3 supported (octet 4, bit 5) */
1729 proto_tree_add_item(tree, hf_nas_eps_emm_eia3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1730 /* EPS integrity algorithm EIA4 supported (octet 4, bit 4) */
1731 proto_tree_add_item(tree, hf_nas_eps_emm_eia4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1732 /* EPS integrity algorithm EIA5 supported (octet 4, bit 3) */
1733 proto_tree_add_item(tree, hf_nas_eps_emm_eia5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1734 /* EPS integrity algorithm EIA6 supported (octet 4, bit 2) */
1735 proto_tree_add_item(tree, hf_nas_eps_emm_eia6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1736 /* EPS integrity algorithm EIA7 supported (octet 4, bit 1) */
1737 proto_tree_add_item(tree, hf_nas_eps_emm_eia7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1741 /* Octets 5, 6, and 7 are optional. If octet 5 is included,
1742 * then also octet 6 shall be included and octet 7 may be included.
1747 /* UMTS encryption algorithms supported (octet 5) */
1748 /* UMTS encryption algorithm UEA0 supported (octet 5, bit 8) */
1749 proto_tree_add_item(tree, hf_nas_eps_emm_uea0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1750 /* UMTS encryption algorithm UEA1 supported (octet 5, bit 7) */
1751 proto_tree_add_item(tree, hf_nas_eps_emm_uea1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1752 /* UMTS encryption algorithm UEA2 supported (octet 5, bit 6) */
1753 proto_tree_add_item(tree, hf_nas_eps_emm_uea2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1754 /* UMTS encryption algorithm UEA3 supported (octet 5, bit 5) */
1755 proto_tree_add_item(tree, hf_nas_eps_emm_uea3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1756 /* EPS encryption algorithm UEA4 supported (octet 5, bit 4) */
1757 proto_tree_add_item(tree, hf_nas_eps_emm_uea4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1758 /* UMTS encryption algorithm UEA5 supported (octet 5, bit 5) */
1759 proto_tree_add_item(tree, hf_nas_eps_emm_uea5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1760 /* UMTS encryption algorithm UEA6 supported (octet 5, bit 6) */
1761 proto_tree_add_item(tree, hf_nas_eps_emm_uea6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1762 /* UMTS encryption algorithm UEA7 supported (octet 5, bit 7) */
1763 proto_tree_add_item(tree, hf_nas_eps_emm_uea7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1766 /* UMTS integrity algorithms supported (octet 6) */
1767 /* Bit 8 of octet 6 is spare and shall be coded as zero. */
1768 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 1, ENC_BIG_ENDIAN);
1769 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 7) */
1770 proto_tree_add_item(tree, hf_nas_eps_emm_uia1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1771 /* UMTS integrity algorithm UIA2 supported (octet 6, bit 6) */
1772 proto_tree_add_item(tree, hf_nas_eps_emm_uia2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1773 /* UMTS integrity algorithm UIA3 supported (octet 6, bit 5) */
1774 proto_tree_add_item(tree, hf_nas_eps_emm_uia3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1775 /* UMTS integrity algorithm UIA4 supported (octet 6, bit 4) */
1776 proto_tree_add_item(tree, hf_nas_eps_emm_uia4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1777 /* UMTS integrity algorithm UIA5 supported (octet 6, bit 3) */
1778 proto_tree_add_item(tree, hf_nas_eps_emm_uia5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1779 /* UMTS integrity algorithm UIA6 supported (octet 6, bit 2) */
1780 proto_tree_add_item(tree, hf_nas_eps_emm_uia6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1781 /* UMTS integrity algorithm UIA7 supported (octet 6, bit 1) */
1782 proto_tree_add_item(tree, hf_nas_eps_emm_uia7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1788 /* Bit 8 of octet 7 is spare and shall be coded as zero. */
1789 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 1, ENC_BIG_ENDIAN);
1790 /* GPRS encryption algorithm GEA1 supported (octet 7, bit 7) */
1791 proto_tree_add_item(tree, hf_nas_eps_emm_gea1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1792 /* GPRS encryption algorithm GEA2 supported (octet 7, bit 6) */
1793 proto_tree_add_item(tree, hf_nas_eps_emm_gea2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1794 /* GPRS encryption algorithm GEA3 supported (octet 7, bit 5) */
1795 proto_tree_add_item(tree, hf_nas_eps_emm_gea3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1796 /* GPRS encryption algorithm GEA4 supported (octet 7, bit 4) */
1797 proto_tree_add_item(tree, hf_nas_eps_emm_gea4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1798 /* GPRS encryption algorithm GEA5 supported (octet 7, bit 3) */
1799 proto_tree_add_item(tree, hf_nas_eps_emm_gea5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1800 /* GPRS encryption algorithm GEA6 supported (octet 7, bit 2) */
1801 proto_tree_add_item(tree, hf_nas_eps_emm_gea6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1802 /* GPRS encryption algorithm GEA7 supported (octet 7, bit 1) */
1803 proto_tree_add_item(tree, hf_nas_eps_emm_gea7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1809 * 9.9.3.37 Emergency Number List
1810 * See subclause 10.5.3.13 in 3GPP TS 24.008 [13].
1811 * packet-gsm_a_dtap.c
1819 * The coding of the CLI value part is the same as for octets 3 to 14
1820 * of the Calling party BCD number information element defined in
1821 * subclause 10.5.4.9 of 3GPP TS 24.008
1828 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_)
1830 guint32 curr_offset;
1832 curr_offset = offset;
1836 * The coding of the SS Code value is given in subclause 17.7.5 of 3GPP TS 29.002 [15B].
1837 * value string imported from gsm map
1839 proto_tree_add_item(tree, hf_nas_eps_emm_ss_code, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1845 * 9.9.3.40 LCS indicator
1847 /* LCS indicator value */
1848 static const value_string nas_eps_emm_lcs_ind_vals[] = {
1849 { 0, "Normal, unspecified"},
1856 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_)
1858 guint32 curr_offset;
1860 curr_offset = offset;
1863 proto_tree_add_item(tree, hf_nas_eps_emm_lcs_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1868 * 9.9.3.41 LCS client identity
1871 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_)
1873 guint32 curr_offset;
1876 curr_offset = offset;
1878 /* LCS client identity (value part)
1879 * The coding of the value part of the LCS client identity is given
1880 * in subclause 17.7.13 of 3GPP TS 29.002 [15B](GSM MAP).
1882 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1883 dissect_gsm_map_lcs_LCS_ClientID_PDU( new_tvb, gpinfo, tree );
1889 * 9.9.3.42 Generic message container type
1891 static const value_string nas_eps_emm_gen_msg_cont_type_vals[] = {
1893 { 1, "LTE Positioning Protocol (LPP) message container"},
1894 { 2, "Location services message container "},
1899 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_)
1901 guint32 curr_offset;
1903 curr_offset = offset;
1905 proto_tree_add_item(tree, hf_nas_eps_emm_gen_msg_cont_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1911 * 9.9.3.43 Generic message container
1914 de_emm_gen_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_)
1916 proto_tree_add_text(tree, tvb, offset, len, "Not dissected yet");
1921 * 9.9.3.44 Voice domain preference and UE's usage setting
1922 * See subclause 10.5.5.28 in 3GPP TS 24.008 [13].
1923 * packet-gsm_a_dtap.c
1927 * 9.9.4 EPS Session Management (ESM) information elements
1931 * 9.9.4.1 Access point name
1932 * See subclause 10.5.6.1 in 3GPP TS 24.008 [6].
1935 * 9.9.4.2 APN aggregate maximum bit rate
1939 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_)
1941 guint32 curr_offset;
1943 guint32 dl_total = 0;
1944 guint32 ul_total = 0;
1945 guint32 bitrate = 0;
1947 curr_offset = offset;
1948 /* APN-AMBR for downlink octet 3 */
1949 octet = tvb_get_guint8(tvb,curr_offset);
1951 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl, tvb, curr_offset, 1, octet,
1954 bitrate = calc_bitrate(octet);
1955 dl_total += bitrate;
1956 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl, tvb, curr_offset, 1, octet,
1957 "APN-AMBR for downlink : %u kbps", bitrate);
1961 /* APN-AMBR for uplink octet 4 */
1962 octet = tvb_get_guint8(tvb,curr_offset);
1964 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul, tvb, curr_offset, 1, octet,
1967 bitrate = calc_bitrate(octet);
1968 ul_total += bitrate;
1969 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul, tvb, curr_offset, 1, octet,
1970 "APN-AMBR for uplink : %u kbps", bitrate);
1973 if ((curr_offset - offset) >= len)
1975 /* APN-AMBR for downlink (extended) octet 5 */
1976 octet = tvb_get_guint8(tvb,curr_offset);
1978 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext, tvb, curr_offset, 1, octet,
1979 "Use the value indicated by the APN-AMBR for downlink");
1981 bitrate = calc_bitrate_ext(octet);
1982 dl_total += (octet > 0x4a) ? bitrate*1000 : bitrate;
1983 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext, tvb, curr_offset, 1, octet,
1984 "APN-AMBR for downlink (extended) : %u %s",
1986 (octet > 0x4a) ? "Mbps" : "kbps");
1989 /* APN-AMBR for downlink (extended-2) is not present; display total now */
1991 /* Ignore value indicated by the APN-AMBR for downlink */
1992 dl_total = (octet > 0x4a) ? bitrate*1000 : bitrate;
1994 if (dl_total >= 1000) {
1995 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for downlink : %.3f Mbps", (gfloat)dl_total / 1000);
1997 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for downlink : %u kbps", dl_total);
2001 if ((curr_offset - offset) >= len)
2003 /* APN-AMBR for uplink (extended) octet 6 */
2004 octet = tvb_get_guint8(tvb,curr_offset);
2006 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext, tvb, curr_offset, 1, octet,
2007 "Use the value indicated by the APN-AMBR for uplink");
2009 bitrate = calc_bitrate_ext(octet);
2010 ul_total += (octet > 0x4a) ? bitrate*1000 : bitrate;
2011 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext, tvb, curr_offset, 1, octet,
2012 "APN-AMBR for uplink (extended) : %u %s",
2014 (octet > 0x4a) ? "Mbps" : "kbps");
2017 /* APN-AMBR for uplink (extended-2) is not present; display total now */
2019 /* Ignore value indicated by the APN-AMBR for uplink */
2020 ul_total = (octet > 0x4a) ? bitrate*1000 : bitrate;
2022 if (ul_total >= 1000) {
2023 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for uplink : %.3f Mbps", (gfloat)ul_total / 1000);
2025 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for uplink : %u kbps", ul_total);
2029 if ((curr_offset - offset) >= len)
2031 /* APN-AMBR for downlink (extended-2) octet 7 */
2032 octet = tvb_get_guint8(tvb,curr_offset);
2033 if((octet==0)||(octet==0xff)){
2034 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext2, tvb, curr_offset, 1, octet,
2035 "Use the value indicated by the APN-AMBR for downlink and APN-AMBR for downlink (extended)");
2037 dl_total += octet*256*1000;
2038 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext2, tvb, curr_offset, 1, octet,
2039 "APN-AMBR for downlink (extended-2) : %u Mbps",
2042 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for downlink : %.3f Mbps", (gfloat)dl_total / 1000);
2044 if ((curr_offset - offset) >= len)
2046 /* APN-AMBR for uplink (extended-2) octet 8 */
2047 octet = tvb_get_guint8(tvb,curr_offset);
2048 if((octet==0)||(octet==0xff)){
2049 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext2, tvb, curr_offset, 1, octet,
2050 "Use the value indicated by the APN-AMBR for uplink and APN-AMBR for downlink (extended)");
2052 ul_total += octet*256*1000;
2053 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext2, tvb, curr_offset, 1, octet,
2054 "APN-AMBR for uplink (extended-2) : %u Mbps",
2057 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for uplink : %.3f Mbps", (gfloat)ul_total / 1000);
2063 * 9.9.4.3 EPS quality of service
2066 /* Quality of Service Class Identifier (QCI), octet 3 (see 3GPP TS 23.203 [7]) */
2067 static const value_string nas_eps_qci_vals[] = {
2068 { 0, "UE -> NW Network selects the QCI / NW -> UE Reserved"},
2084 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_)
2086 guint32 curr_offset;
2089 curr_offset = offset;
2092 proto_tree_add_item(tree, hf_nas_eps_qci, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2094 if ((curr_offset - offset) >= len)
2096 /* Maximum bit rate for uplink octet 4 */
2097 octet = tvb_get_guint8(tvb,curr_offset);
2099 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_ul, tvb, curr_offset, 1, octet,
2100 "UE->NW Subscribed maximum bit rate for uplink/ NW->UE Reserved");
2102 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_ul, tvb, curr_offset, 1, octet,
2103 "Maximum bit rate for uplink : %u kbps", calc_bitrate(octet));
2106 if ((curr_offset - offset) >= len)
2108 /* Maximum bit rate for downlink octet 5 */
2109 octet = tvb_get_guint8(tvb,curr_offset);
2111 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_dl, tvb, curr_offset, 1, octet,
2112 "UE->NW Subscribed maximum bit rate for downlink/ NW->UE Reserved");
2114 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_dl, tvb, curr_offset, 1, octet,
2115 "Maximum bit rate for downlink : %u kbps", calc_bitrate(octet));
2118 if ((curr_offset - offset) >= len)
2120 /* Guaranteed bit rate for uplink octet 6 */
2121 octet = tvb_get_guint8(tvb,curr_offset);
2122 proto_tree_add_uint_format(tree, hf_nas_eps_gbr_ul, tvb, curr_offset, 1, octet,
2123 "Guaranteed bit rate for uplink : %u kbps", calc_bitrate(octet));
2126 if ((curr_offset - offset) >= len)
2128 /* Guaranteed bit rate for downlink octet 7 */
2129 octet = tvb_get_guint8(tvb,curr_offset);
2130 proto_tree_add_uint_format(tree, hf_nas_eps_gbr_ul, tvb, curr_offset, 1, octet,
2131 "Guaranteed bit rate for downlink : %u kbps", calc_bitrate(octet));
2134 if ((curr_offset - offset) >= len)
2136 /* Maximum bit rate for uplink (extended) octet 8 */
2137 octet = tvb_get_guint8(tvb,curr_offset);
2139 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2140 "Use the value indicated by the maximum bit rate for uplink in octet 4.");
2142 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2143 "Maximum bit rate for uplink(extended) : %u %s",
2144 calc_bitrate_ext(octet),
2145 (octet > 0x4a) ? "Mbps" : "kbps");
2148 if ((curr_offset - offset) >= len)
2150 /* Maximum bit rate for downlink (extended) octet 9 */
2151 octet = tvb_get_guint8(tvb,curr_offset);
2153 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2154 "Use the value indicated by the maximum bit rate for downlink in octet 5.");
2156 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2157 "Maximum bit rate for downlink(extended) : %u %s",
2158 calc_bitrate_ext(octet),
2159 (octet > 0x4a) ? "Mbps" : "kbps");
2162 if ((curr_offset - offset) >= len)
2164 /* Guaranteed bit rate for uplink (extended) octet 10 */
2165 octet = tvb_get_guint8(tvb,curr_offset);
2167 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2168 "Use the value indicated by the Guaranteed bit rate for uplink in octet 6.");
2170 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2171 "Guaranteed bit rate for uplink(extended) : %u %s",
2172 calc_bitrate_ext(octet),
2173 (octet > 0x4a) ? "Mbps" : "kbps");
2176 if ((curr_offset - offset) >= len)
2178 /* Guaranteed bit rate for downlink (extended) octet 11 */
2179 octet = tvb_get_guint8(tvb,curr_offset);
2181 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2182 "Use the value indicated by the Guaranteed bit rate for downlink in octet 7.");
2184 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2185 "Guaranteed bit rate for downlink(extended) : %u %s",
2186 calc_bitrate_ext(octet),
2187 (octet > 0x4a) ? "Mbps" : "kbps");
2197 static const value_string nas_eps_esm_cause_vals[] = {
2198 { 0x08, "Operator Determined Barring"},
2199 { 0x1a, "Insufficient resources"},
2200 { 0x1b, "Unknown or missing APN"},
2201 { 0x1c, "Unknown PDN type"},
2202 { 0x1d, "User authentication failed"},
2203 { 0x1e, "Request rejected by Serving GW or PDN GW"},
2204 { 0x1f, "Request rejected, unspecified"},
2205 { 0x20, "Service option not supported"},
2206 { 0x21, "Requested service option not subscribed"},
2207 { 0x22, "Service option temporarily out of order"},
2208 { 0x23, "PTI already in use"},
2209 { 0x24, "Regular deactivation"},
2210 { 0x25, "EPS QoS not accepted"},
2211 { 0x26, "Network failure"},
2212 { 0x27, "Reactivation requested"},
2213 { 0x29, "Semantic error in the TFT operation"},
2214 { 0x2a, "Syntactical error in the TFT operation"},
2215 { 0x2b, "Invalid EPS bearer identity"},
2216 { 0x2c, "Semantic errors in packet filter(s)"},
2217 { 0x2d, "Syntactical errors in packet filter(s)"},
2218 { 0x2e, "EPS bearer context without TFT already activated"},
2219 { 0x2f, "PTI mismatch"},
2220 { 0x31, "Last PDN disconnection not allowed"},
2221 { 0x32, "PDN type IPv4 only allowed"},
2222 { 0x33, "PDN type IPv6 only allowed"},
2223 { 0x34, "Single address bearers only allowed"},
2224 { 0x35, "ESM information not received"},
2225 { 0x36, "PDN connection does not exist"},
2226 { 0x37, "Multiple PDN connections for a given APN not allowed"},
2227 { 0x38, "Collision with network initiated request"},
2228 { 0x3b, "Unsupported QCI value"},
2229 { 0x51, "Invalid PTI value"},
2230 { 0x5f, "Semantically incorrect message"},
2231 { 0x60, "Invalid mandatory information"},
2232 { 0x61, "Message type non-existent or not implemented"},
2233 { 0x62, "Message type not compatible with the protocol state"},
2234 { 0x63, "Information element non-existent or not implemented"},
2235 { 0x64, "Conditional IE error"},
2236 { 0x65, "Message not compatible with the protocol state"},
2237 { 0x6f, "Protocol error, unspecified"},
2238 { 0x70, "APN restriction value incompatible with active EPS bearer context"},
2243 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_)
2245 guint32 curr_offset;
2247 curr_offset = offset;
2249 proto_tree_add_item(tree, hf_nas_eps_esm_cause, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2252 return(curr_offset - offset);
2255 * 9.9.4.5 ESM information transfer flag
2257 /* EIT (ESM information transfer) */
2258 static const true_false_string nas_eps_emm_eit_vals = {
2259 "Security protected ESM information transfer required",
2260 "Security protected ESM information transfer not required"
2263 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_)
2265 guint32 curr_offset;
2267 curr_offset = offset;
2270 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+4, 3, ENC_BIG_ENDIAN);
2271 proto_tree_add_item(tree, hf_nas_eps_esm_eit, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2273 return(curr_offset-offset);
2276 * 9.9.4.6 Linked EPS bearer identity
2279 * Linked EPS bearer identity (bits 1-4)
2282 static const value_string nas_eps_esm_linked_bearer_id_vals[] = {
2288 { 0x5, "EPS bearer identity value 5"},
2289 { 0x6, "EPS bearer identity value 6"},
2290 { 0x7, "EPS bearer identity value 7"},
2291 { 0x8, "EPS bearer identity value 8"},
2292 { 0x9, "EPS bearer identity value 9"},
2293 { 0xa, "EPS bearer identity value 10"},
2294 { 0xb, "EPS bearer identity value 11"},
2295 { 0xc, "EPS bearer identity value 12"},
2296 { 0xd, "EPS bearer identity value 13"},
2297 { 0xe, "EPS bearer identity value 14"},
2298 { 0xf, "EPS bearer identity value 15"},
2305 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_)
2307 guint32 curr_offset;
2309 curr_offset = offset;
2311 proto_tree_add_item(tree, hf_nas_eps_esm_lnkd_eps_bearer_id, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2317 * 9.9.4.7 LLC service access point identifier
2318 * See subclause 10.5.6.9 in 3GPP TS 24.008
2322 * 9.9.4.7a Notification indicator
2324 static const value_string nas_eps_esm_notif_ind_vals[] = {
2326 { 0x1, "SRVCC handover cancelled, IMS session re-establishment required"},
2331 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_)
2333 guint32 curr_offset;
2335 curr_offset = offset;
2337 proto_tree_add_item(tree, hf_nas_eps_esm_notif_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2343 * 9.9.4.8 Packet flow identifier
2344 * See subclause 10.5.6.11 in 3GPP TS 24.008
2347 * 9.9.4.9 PDN address
2350 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_)
2352 guint32 curr_offset;
2355 curr_offset = offset;
2358 pdn_type = tvb_get_guint8(tvb, offset) & 0x7;
2359 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 5, ENC_BIG_ENDIAN);
2360 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2366 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv4, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
2370 /* IPv6 3GPP TS 24.301 version 9.4.0 Release 9
2371 * If PDN type value indicates IPv6, the PDN address information in octet 4 to octet 11
2372 * contains an IPv6 interface identifier. Bit 8 of octet 4 represents the most significant bit
2373 * of the IPv6 interface identifier and bit 1 of octet 11 the least significant bit.
2375 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv6_if_id, tvb, curr_offset, 8, ENC_BIG_ENDIAN);
2379 /* IPv4/IPv6 3GPP TS 24.301 version 9.4.0 Release 9
2380 * If PDN type value indicates IPv4v6, the PDN address information in octet 4 to octet 15
2381 * contains an IPv6 interface identifier and an IPv4 address. Bit 8 of octet 4 represents
2382 * the most significant bit of the IPv6 interface identifier and bit 1 of octet 11 the least
2383 * significant bit. Bit 8 of octet 12 represents the most significant bit of the IPv4 address
2384 * and bit 1 of octet 15 the least significant bit.
2386 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv6_if_id, tvb, curr_offset, 8, ENC_BIG_ENDIAN);
2388 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv4, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
2395 return(curr_offset-offset);
2400 * Coded inline 1/2 octet
2402 static const value_string nas_eps_esm_pdn_type_values[] = {
2406 { 0x4, "Unused; shall be interpreted as IPv6 if received by the network" },
2411 * 9.9.4.11 Protocol configuration options
2412 * See subclause 10.5.6.3 in 3GPP TS 24.008
2415 * 9.9.4.12 Quality of service
2416 * See subclause 10.5.6.5 in 3GPP TS 24.008
2419 * 9.9.4.13 Radio priority
2420 * See subclause 10.5.7.2 in 3GPP TS 24.008
2423 * 9.9.4.14 Request type
2424 * See subclause 10.5.6.17 in 3GPP TS 24.008
2427 * 9.9.4.15 Traffic flow aggregate description
2428 * The Traffic flow aggregate description information element is encoded using the same format as the Traffic flow
2429 * template information element (see subclause 10.5.6.12 in 3GPP TS 24.008 [13]). When sending this IE, the UE shall
2430 * assign the packet filter identifier values so that they are unique across all packet filters for the PDN connection.
2433 * 9.9.4.16 Traffic flow template
2434 * See subclause 10.5.6.12 in 3GPP TS 24.008
2438 * 9.9.4.17 Transaction identifier
2439 * The Transaction identifier information element is coded as the Linked TI information element in 3GPP TS 24.008 [13],
2440 * subclause 10.5.6.7.
2441 * The coding of the TI flag, the TI value and the EXT bit is defined in 3GPP TS 24.007[20].
2444 guint16 (*emm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string, int string_len) = {
2445 /* 9.9.3 EPS Mobility Management (EMM) information elements */
2446 de_emm_add_upd_res, /* 9.9.3.0A Additional update result */
2447 de_emm_add_upd_type, /* 9.9.3.0B Additional update type */
2448 NULL, /* 9.9.3.1 Authentication failure parameter(dissected in packet-gsm_a_dtap.c) */
2449 NULL, /* 9.9.3.2 Authentication parameter AUTN(packet-gsm_a_dtap.c) */
2450 NULL, /* 9.9.3.3 Authentication parameter RAND */
2451 de_emm_auth_resp_par, /* 9.9.3.4 Authentication response parameter */
2452 de_emm_csfb_resp, /* 9.9.3.5 CSFB response */
2453 NULL, /* 9.9.3.6 Daylight saving time (packet-gsm_a_dtap.c)*/
2454 NULL, /* 9.9.3.7 Detach type */
2455 NULL, /* 9.9.3.8 DRX parameter */
2456 de_emm_cause, /* 9.9.3.9 EMM cause */
2457 NULL, /* 9.9.3.10 EPS attach result (coded inline) */
2458 NULL, /* 9.9.3.11 EPS attach type(Coded Inline) */
2459 de_emm_eps_mid, /* 9.9.3.12 EPS mobile identity */
2460 de_emm_eps_net_feature_sup, /* 9.9.3.12A EPS network feature support */
2461 NULL, /* 9.9.3.13 EPS update result (Coded Inline)*/
2462 NULL, /* 9.9.3.14 EPS update type (Inline)*/
2463 de_emm_esm_msg_cont, /* 9.9.3.15 ESM message conta */
2464 NULL, /* 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. (packet-gsm_a_gm.c)*/
2465 NULL, /* 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. */
2466 de_emm_nas_imeisv_req, /* 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. */
2467 de_emm_nas_ksi_and_seq_no, /* 9.9.3.19 KSI and sequence number */
2468 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) */
2469 de_emm_nas_key_set_id, /* 9.9.3.21 NAS key set identifier (Coded Inline) */
2470 de_emm_nas_msg_cont, /* 9.9.3.22 NAS message container */
2471 de_emm_nas_sec_alsgs, /* 9.9.3.23 NAS security algorithms */
2472 NULL, /* 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. (packet-gsm_a_dtap.c)*/
2473 de_emm_nonce, /* 9.9.3.25 Nonce */
2474 de_emm_paging_id, /* 9.9.3.25A Paging identity */
2475 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)*/
2476 NULL, /* 9.9.3.27 Service type */
2477 de_emm_nas_short_mac, /* 9.9.3.28 Short MAC */
2478 NULL, /* 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. (packet-gsm_a_dtap.c)*/
2479 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)*/
2480 NULL, /* 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. (packet-gsm_a_gm.c)*/
2481 de_emm_trac_area_id, /* 9.9.3.32 Tracking area identity */
2482 de_emm_trac_area_id_lst, /* 9.9.3.33 Tracking area identity list */
2483 de_emm_ue_net_cap, /* 9.9.3.34 UE network capability */
2484 de_emm_ue_ra_cap_inf_upd_need, /* 9.9.3.35 UE radio capability information update needed */
2485 de_emm_ue_sec_cap, /* 9.9.3.36 UE security capability */
2486 NULL, /* 9.9.3.37 Emergency Number List (packet-gsm_A_dtap.c) */
2487 NULL, /* 9.9.3.38 CLI */
2488 de_emm_ss_code, /* 9.9.3.39 SS Code */
2489 de_emm_lcs_ind, /* 9.9.3.40 LCS indicator */
2490 de_emm_lcs_client_id, /* 9.9.3.41 LCS client identity */
2491 de_emm_gen_msg_cont_type, /* 9.9.3.42 Generic message container type */
2492 de_emm_gen_msg_cont, /* 9.9.3.43 Generic message container */
2493 NULL, /* 9.9.3.44 Voice domain preference and UE's usage setting */
2497 /* 9.9.4 EPS Session Management (ESM) information elements */
2498 const value_string nas_esm_elem_strings[] = {
2499 { 0x00, "Access point name" }, /* 9.9.4.1 Access point name */
2500 { 0x00, "APN aggregate maximum bit rate" }, /* 9.9.4.2 APN aggregate maximum bit rate */
2501 { 0x00, "EPS quality of service" }, /* 9.9.4.3 EPS quality of service */
2502 { 0x00, "ESM cause" }, /* 9.9.4.4 ESM cause */
2503 { 0x00, "ESM information transfer flag" }, /* 9.9.4.5 ESM information transfer flag */
2504 { 0x00, "Linked EPS bearer identity" }, /* 9.9.4.6 Linked EPS bearer identity */
2505 { 0x00, "LLC service access point identifier" }, /* 9.9.4.7 LLC service access point identifier */
2506 { 0x00, "Notification indicator" }, /* 9.9.4.7a Notification indicator */
2507 { 0x00, "Packet flow identifier" }, /* 9.9.4.8 Packet flow identifier */
2508 { 0x00, "PDN address" }, /* 9.9.4.9 PDN address */
2509 { 0x00, "PDN type" }, /* 9.9.4.10 PDN type */
2510 { 0x00, "Protocol configuration options" }, /* 9.9.4.11 Protocol configuration options */
2511 { 0x00, "Quality of service" }, /* 9.9.4.12 Quality of service */
2512 { 0x00, "Radio priority" }, /* 9.9.4.13 Radio priority */
2513 { 0x00, "Request type" }, /* 9.9.4.14 Request type */
2514 { 0x00, "Traffic flow aggregate description" }, /* 9.9.4.15 Traffic flow aggregate description */
2515 { 0x00, "Traffic flow templat" }, /* 9.9.4.16 Traffic flow template */
2516 { 0x00, "Transaction identifier" }, /* 9.9.4.17 Transaction identifier */
2521 #define NUM_NAS_ESM_ELEM (sizeof(nas_esm_elem_strings)/sizeof(value_string))
2522 gint ett_nas_eps_esm_elem[NUM_NAS_ESM_ELEM];
2526 DE_ESM_APN, /* 9.9.4.1 Access point name */
2527 DE_ESM_APN_AGR_MAX_BR, /* 9.9.4.2 APN aggregate maximum bit rate */
2528 DE_ESM_EPS_QOS, /* 9.9.4.3 EPS quality of service */
2529 DE_ESM_CAUSE, /* 9.9.4.4 ESM cause */
2530 DE_ESM_INF_TRF_FLG, /* 9.9.4.5 ESM information transfer flag */
2531 DE_ESM_LNKED_EPS_B_ID, /* 9.9.4.6 Linked EPS bearer identity */
2532 DE_ESM_LLC_SAPI, /* 9.9.4.7 LLC service access point identifier */
2533 DE_ESM_NOTIF_IND, /* 9.9.4.7a Notification indicator */
2534 DE_ESM_P_FLW_ID, /* 9.9.4.8 Packet flow identifier */
2535 DE_ESM_PDN_ADDR, /* 9.9.4.9 PDN address */
2536 DE_ESM_PDN_TYPE, /* 9.9.4.10 PDN type */
2537 DE_ESM_PROT_CONF_OPT, /* 9.9.4.11 Protocol configuration options */
2538 DE_ESM_QOS, /* 9.9.4.12 Quality of service */
2539 DE_ESM_RA_PRI, /* 9.9.4.13 Radio priority */
2540 DE_ESM_REQ_TYPE, /* 9.9.4.14 Request type */
2541 DE_ESM_TRAF_FLOW_AGR_DESC, /* 9.9.4.15 Traffic flow aggregate description */
2542 DE_ESM_TRAF_FLOW_TEMPL, /* 9.9.4.16 Traffic flow template */
2543 DE_ESM_TID, /* 9.9.4.17 Transaction identifier */
2544 DE_ESM_NONE /* NONE */
2549 guint16 (*esm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string, int string_len) = {
2550 NULL, /* 9.9.4.1 Access point name */
2551 de_esm_apn_aggr_max_br, /* 9.9.4.2 APN aggregate maximum bit rate */
2552 de_esm_qos, /* 9.9.4.3 EPS quality of service */
2553 de_esm_cause, /* 9.9.4.4 ESM cause */
2554 de_esm_inf_trf_flg, /* 9.9.4.5 ESM information transfer flag */
2555 de_esm_lnkd_eps_bearer_id, /* 9.9.4.6 Linked EPS bearer identity */
2556 NULL, /* 9.9.4.7 LLC service access point identifier */
2557 de_esm_notif_ind, /* 9.9.4.7a Notification indicator */
2558 NULL, /* 9.9.4.8 Packet flow identifier */
2559 de_esm_pdn_addr, /* 9.9.4.9 PDN address */
2560 NULL, /* 9.9.4.10 PDN type */
2561 NULL, /* 9.9.4.11 Protocol configuration options */
2562 NULL, /* 9.9.4.12 Quality of service */
2563 NULL, /* 9.9.4.13 Radio priority */
2564 NULL, /* 9.9.4.14 Request type */
2565 NULL, /* 9.9.4.15 Traffic flow aggregate description */
2566 NULL, /* 9.9.4.16 Traffic flow template */
2567 NULL, /* 9.9.4.17 Transaction identifier */
2571 /* MESSAGE FUNCTIONS */
2574 * 8.2.1 Attach accept
2578 nas_emm_attach_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2580 guint32 curr_offset, bit_offset;
2584 curr_offset = offset;
2587 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2588 bit_offset = curr_offset<<3;
2589 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2591 /* EPS attach result EPS attach result 9.9.3.10 M V 1/2 */
2592 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2594 proto_tree_add_bits_item(tree, hf_nas_eps_emm_EPS_attach_result, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2596 /* Fix up the lengths */
2599 /* T3412 value GPRS timer 9.9.3.16 M V 1 */
2600 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3412 value");
2601 /* Tracking area identity list 9.9.3.33 M LV 7-97 */
2602 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - TAI list");
2603 /* ESM message container 9.9.3.15 M LV-E 2-n */
2604 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL);
2605 /* 50 GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
2606 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
2607 /* 13 Location area identification Location area identification 9.9.2.2 O TV 6 */
2608 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, NULL);
2609 /* 23 MS identity Mobile identity 9.9.2.3 O TLV 7-10 */
2610 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - MS identity");
2611 /* 53 EMM cause EMM cause 9.9.3.9 O TV 2 */
2612 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
2613 /* 17 T3402 value GPRS timer 9.9.3.16 O TV 2 */
2614 ELEM_OPT_TV(0x17, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3402 value");
2615 /* 59 T3423 value GPRS timer 9.9.3.16 O TV 2 */
2616 ELEM_OPT_TV(0x59, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3423 value");
2617 /* 4A Equivalent PLMNs PLMN list 9.9.2.8 O TLV 5-47 */
2618 ELEM_OPT_TLV(0x4a, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_PLM_LST, " - Equivalent PLMNs");
2619 /* 34 Emergency Number List 9.9.3.37 O TLV 5-50 */
2620 ELEM_OPT_TLV(0x34, GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST, NULL);
2621 /* 64 EPS network feature support EPS network feature support 9.9.3.12A O TLV 3 */
2622 ELEM_OPT_TLV(0x64, NAS_PDU_TYPE_EMM, DE_EMM_EPS_NET_FEATURE_SUP, NULL);
2623 /* F- Additional update result Additional update result 9.9.3.0A O TV 1 */
2624 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_RES, NULL );
2626 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2629 * 8.2.2 Attach complete
2632 nas_emm_attach_comp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2634 guint32 curr_offset;
2638 curr_offset = offset;
2641 /* ESM message container ESM message container 9.9.3.15 M LV-E 2-n */
2642 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL);
2644 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2649 * 8.2.3 Attach reject
2652 nas_emm_attach_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2654 guint32 curr_offset;
2658 curr_offset = offset;
2661 /* * EMM cause EMM cause 9.9.3.9 M V 1 */
2662 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
2663 /* 78 ESM message container ESM message container 9.9.3.15 O TLV-E 4-n */
2664 ELEM_OPT_TLV_E(0x78, NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL);
2666 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2670 * 8.2.4 Attach request
2673 nas_emm_attach_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2675 guint32 curr_offset, bit_offset;
2679 curr_offset = offset;
2682 bit_offset = curr_offset<<3;
2684 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
2685 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
2688 /* EPS attach type EPS attach type 9.9.3.11 M V 1/2
2691 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2693 proto_tree_add_bits_item(tree, hf_nas_eps_emm_eps_att_type, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2696 /* Fix the lengths */
2699 /* Old GUTI or IMSI EPS mobile identity 9.9.3.12 M LV 5-12 */
2700 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Old GUTI or IMSI");
2701 /* UE network capability UE network capability 9.9.3.34 M LV 3-14 */
2702 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_UE_NET_CAP, NULL);
2703 /* ESM message container ESM message container 9.9.3.15 M LV-E 2-n */
2704 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL);
2705 /* 19 Old P-TMSI signature P-TMSI signature 10.5.5.8 O TV 4 */
2706 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, " - Old P-TMSI Signature");
2707 /* 50 Additional GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
2708 ELEM_OPT_TLV( 0x50 , NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Additional GUTI");
2709 /* 52 Last visited registered TAI Tracking area identity 9.9.3.32 O TV 6 */
2710 ELEM_OPT_TV(0x52, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, " - Last visited registered TAI");
2711 /* 5c DRX parameter DRX parameter 9.9.3.8 O TV 3 */
2712 ELEM_OPT_TV(0x5c, GSM_A_PDU_TYPE_GM, DE_DRX_PARAM, NULL );
2713 /* 31 MS network capability MS network capability 9.9.3.20 M LV 3-9 */
2714 ELEM_OPT_TLV( 0x31, GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP , NULL );
2715 /* 13 Old location area identification Location area identification 9.9.2.2 O TV 6 */
2716 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, " - Old location area identification");
2717 /* 9- TMSI status TMSI status 9.9.3.31 O TV 1 */
2718 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , NULL );
2719 /* 11 Mobile station classmark 2 Mobile station classmark 2 9.9.2.5 O TLV 5 */
2720 ELEM_OPT_TLV( 0x11, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_2 , NULL );
2721 /* 20 Mobile station classmark 3 Mobile station classmark 3 9.9.2.5 O TLV 2-34 */
2722 ELEM_OPT_TLV( 0x20, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_3 , NULL );
2723 /* 40 Supported Codecs Supported Codec List 9.9.2.10 O TLV 5-n */
2724 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, " - Supported Codecs");
2725 /* F- Additional update type Additional update type 9.9.3.0B O TV 1 */
2726 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_TYPE, NULL );
2727 /* 5D Voice domain preference and UE's usage setting Voice domain preference and UE's usage setting 9.9.3.44 O TLV 3 */
2728 ELEM_OPT_TLV(0x5D, GSM_A_PDU_TYPE_GM, DE_VOICE_DOMAIN_PREF, NULL);
2730 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2733 * 8.2.5 Authentication failure
2736 nas_emm_attach_fail(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2738 guint32 curr_offset;
2742 curr_offset = offset;
2745 /* EMM cause EMM cause 9.9.3.9 M V 1 */
2746 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
2747 /* 30 Authentication failure parameter Authentication failure parameter 9.9.3.1 O TLV 1 */
2748 ELEM_OPT_TLV(0x30, GSM_A_PDU_TYPE_DTAP, DE_AUTH_FAIL_PARAM, NULL);
2750 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2753 * 8.2.6 Authentication reject
2757 * 8.2.7 Authentication request
2761 nas_emm_auth_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2763 guint32 curr_offset, bit_offset;
2767 curr_offset = offset;
2770 bit_offset = curr_offset<<3;
2772 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2773 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2777 * NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2
2779 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, " ASME");
2782 /* Fix the lengths */
2787 * Authentication parameter RAND (EPS challenge) 9.9.3.3 M V 16
2789 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_RAND, " - EPS challenge");
2791 * Authentication parameter AUTN (EPS challenge) 9.9.3.2 M LV 17
2793 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_AUTN, " - EPS challenge");
2795 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2799 * 8.2.8 Authentication response
2802 nas_emm_auth_resp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2804 guint32 curr_offset;
2808 curr_offset = offset;
2812 * Authentication response parameter 9.9.3.4 M LV 5-17
2814 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_AUTH_RESP_PAR, NULL);
2816 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2820 * 8.2.9 CS service notification
2824 nas_emm_cs_serv_not(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2826 guint32 curr_offset;
2830 curr_offset = offset;
2835 /* Paging identity Paging identity 9.9.3.25A M V 1 */
2836 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_PAGING_ID, NULL);
2837 /* 60 CLI CLI 9.9.3.38 O TLV 3-12 */
2838 ELEM_OPT_TLV(0x60, GSM_A_PDU_TYPE_DTAP, DE_CLD_PARTY_BCD_NUM, " - CLI");
2839 /* 61 SS Code SS Code 9.9.3.39 O TV 2 */
2840 ELEM_OPT_TV(0x61, NAS_PDU_TYPE_EMM, DE_EMM_SS_CODE, NULL);
2841 /* 62 LCS indicator LCS indicator 9.9.3.40 O TV 2 */
2842 ELEM_OPT_TV(0x62, NAS_PDU_TYPE_EMM, DE_EMM_LCS_IND, NULL);
2843 /* 63 LCS client identity LCS client identity 9.9.3.41 O TLV 3-257 */
2844 ELEM_OPT_TLV(0x63, NAS_PDU_TYPE_EMM, DE_EMM_LCS_CLIENT_ID, NULL);
2846 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2849 * 8.2.10 Detach accept
2850 * 8.2.10.1 Detach accept (UE originating detach)
2852 * 8.2.10.2 Detach accept (UE terminated detach)
2856 * 8.2.11 Detach request
2857 * 8.2.11.1 Detach request (UE originating detach)
2861 nas_emm_detach_req_UL(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2863 guint32 curr_offset,bit_offset;
2867 curr_offset = offset;
2870 proto_tree_add_text(tree, tvb, curr_offset, len,"Up link");
2871 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
2872 bit_offset = curr_offset<<3;
2873 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
2875 /* Detach type Detach type 9.9.3.6 M V 1/2 */
2876 proto_tree_add_bits_item(tree, hf_nas_eps_emm_switch_off, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2878 proto_tree_add_bits_item(tree, hf_nas_eps_emm_detach_type_UL, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2881 /* Fix the lengths */
2885 /* GUTI or IMSI EPS mobile identity 9.9.3.12 M LV 5-12 */
2886 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI or IMSI");
2891 * 8.2.11.2 Detach request (UE terminated detach)
2894 nas_emm_detach_req_DL(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2896 guint32 curr_offset, bit_offset;
2900 curr_offset = offset;
2903 proto_tree_add_text(tree, tvb, curr_offset, len,"Down link");
2904 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2905 bit_offset = curr_offset<<3;
2906 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2908 /* Detach type Detach type 9.9.3.6 M V 1/2 */
2909 /* In the network to UE direction bit 4 is spare. The network shall set this bit to zero. */
2910 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2912 proto_tree_add_bits_item(tree, hf_nas_eps_emm_detach_type_DL, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2915 /* Fix the lengths */
2919 /* No more mandatory elements */
2923 /* EMM cause EMM cause 9.9.3.9 O TV 2 */
2924 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
2926 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2931 nas_emm_detach_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
2933 guint32 curr_offset;
2936 curr_offset = offset;
2940 if(pinfo->link_dir==P2P_DIR_UL){
2941 nas_emm_detach_req_UL(tvb, tree, pinfo, offset, len);
2943 }else if(pinfo->link_dir==P2P_DIR_DL){
2944 nas_emm_detach_req_DL(tvb, tree, pinfo, offset, len);
2948 proto_tree_add_text(tree, tvb, curr_offset, len,"UL/DL not known, can't properly dissect");
2949 proto_tree_add_text(tree, tvb, curr_offset, len,"Trying to dissect as UE terminated detach");
2950 nas_emm_detach_req_DL(tvb, tree, pinfo, offset, len);
2951 proto_tree_add_text(tree, tvb, curr_offset, len,"Trying to dissect as UE originating detach");
2952 nas_emm_detach_req_UL(tvb, tree, pinfo, offset, len);
2959 * 8.2.12 Downlink NAS Transport
2962 nas_emm_dl_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2964 guint32 curr_offset;
2968 curr_offset = offset;
2971 /* NAS message container NAS message container 9.9.3.22 M LV 3-252 */
2972 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_NAS_MSG_CONT, NULL);
2974 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2977 * 8.2.13 EMM information
2980 nas_emm_emm_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2982 guint32 curr_offset;
2986 curr_offset = offset;
2989 /* 43 Full name for network Network name 9.9.3.24 O TLV 3-? */
2990 ELEM_OPT_TLV(0x43, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Full name for network");
2991 /* 45 Short name for network Network name 9.9.3.24 O TLV 3-? */
2992 ELEM_OPT_TLV(0x45, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Short Name");
2993 /* 46 Local time zone Time zone 9.9.3.29 O TV 2 */
2994 ELEM_OPT_TV(0x46, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE, " - Local");
2995 /* 47 Universal time and local time zone Time zone and time 9.9.3.30 O TV 8 */
2996 ELEM_OPT_TV(0x47, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE_TIME, " - Universal Time and Local Time Zone");
2997 /* 49 Network daylight saving time Daylight saving time 9.9.3.6 O TLV 3 */
2998 ELEM_OPT_TLV(0x49, GSM_A_PDU_TYPE_DTAP, DE_DAY_SAVING_TIME, NULL);
3000 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3008 nas_emm_emm_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3010 guint32 curr_offset;
3014 curr_offset = offset;
3017 /* EMM cause EMM cause 9.9.3.9 M V 1 */
3018 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
3020 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3024 * 8.2.15 Extended service request
3027 nas_emm_ext_serv_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3029 guint32 curr_offset,bit_offset;
3033 curr_offset = offset;
3036 bit_offset = curr_offset<<3;
3038 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
3039 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
3041 /* Service type Service type 9.9.3.27 M V 1/2 Service type*/
3042 proto_tree_add_bits_item(tree, hf_nas_eps_service_type, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3044 /* Fix up the lengths */
3048 /* M-TMSI Mobile identity 9.9.2.3 M LV 6 */
3049 ELEM_MAND_LV(NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - M-TMSI");
3050 /* B- CSFB response CSFB response 9.9.3.5 C TV 1 */
3051 ELEM_OPT_TV_SHORT(0xb0, NAS_PDU_TYPE_EMM, DE_EMM_CSFB_RESP, NULL);
3052 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
3053 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, NULL);
3055 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3058 * 8.2.16 GUTI reallocation command
3061 nas_emm_guti_realloc_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3063 guint32 curr_offset;
3067 curr_offset = offset;
3070 /* GUTI EPS mobile identity 9.9.3.12 M LV 12 */
3071 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
3073 /* 54 TAI list Tracking area identity list 9.9.3.33 O TLV 8-98 */
3074 ELEM_OPT_TLV(0x54, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, NULL);
3076 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3080 * 8.2.17 GUTI reallocation complete
3084 * 8.2.18 Identity request
3088 nas_emm_id_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3090 guint32 curr_offset, bit_offset;
3094 curr_offset = offset;
3098 bit_offset=curr_offset<<3;
3100 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
3101 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3104 /* Identity type Identity type 2 9.9.3.17 M V 1/2 */
3105 proto_tree_add_bits_item(tree, hf_nas_eps_emm_id_type2, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3110 /* Fix up the lengths */
3114 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3117 * 8.2.19 Identity response
3120 nas_emm_id_res(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3122 guint32 curr_offset;
3126 curr_offset = offset;
3129 /* Mobile identity Mobile identity 9.9.2.3 M LV 4-10 */
3130 ELEM_MAND_LV(NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, NULL);
3132 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3138 * 8.2.20 Security mode command
3141 nas_emm_sec_mode_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3143 guint32 curr_offset, bit_offset;
3147 curr_offset = offset;
3150 /* Selected NAS security algorithms NAS security algorithms 9.9.3.23 M V 1 */
3151 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_NAS_SEC_ALGS, " - Selected NAS security algorithms");
3153 bit_offset = curr_offset<<3;
3154 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
3155 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3157 /* NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2 */
3158 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, " ASME");
3161 /* Fix up the lengths */
3165 /* Replayed UE security capabilities UE security capability 9.9.3.36 M LV 3-6 */
3166 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_UE_SEC_CAP, " - Replayed UE security capabilities");
3167 /* C- IMEISV request IMEISV request 9.9.3.18 O TV 1 */
3168 ELEM_OPT_TV_SHORT( 0xC0 , NAS_PDU_TYPE_EMM, DE_EMM_IMEISV_REQ , NULL );
3169 /* 55 Replayed NonceUE Nonce 9.9.3.25 O TV 5 */
3170 ELEM_OPT_TV(0x55, GSM_A_PDU_TYPE_GM, DE_EMM_NONCE, " - Replayed NonceUE");
3171 /* 56 NonceMME Nonce 9.9.3.25 O TV 5 */
3172 ELEM_OPT_TV(0x56, GSM_A_PDU_TYPE_GM, DE_EMM_NONCE, " - NonceMME");
3174 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3177 * 8.2.21 Security mode complete
3180 nas_emm_sec_mode_comp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3182 guint32 curr_offset;
3186 curr_offset = offset;
3192 /* 23 IMEISV Mobile identity 9.9.2.3 O TLV 11 */
3193 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - IMEISV");
3195 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3198 * 8.2.22 Security mode reject
3201 nas_emm_sec_mode_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3203 guint32 curr_offset;
3207 curr_offset = offset;
3210 /* EMM cause EMM cause 9.9.3.9 M V 1 */
3211 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
3213 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3216 * 8.2.23 Security protected NAS message
3220 nas_emm_sec_prot_msg(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3222 guint32 curr_offset;
3224 guint8 security_header_type;
3226 curr_offset = offset;
3229 /* Security header type Security header type 9.3.1 M V 1/2 */
3230 security_header_type = tvb_get_guint8(tvb,offset)>>4;
3231 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, 0, 1, ENC_BIG_ENDIAN);
3232 /* Protocol discriminator Protocol discriminator 9.2 M V 1/2 */
3233 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, ENC_BIG_ENDIAN);
3235 /* Message authentication code Message authentication code 9.5 M V 4 */
3236 if (security_header_type !=0){
3237 /* Message authentication code */
3238 proto_tree_add_item(tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, ENC_BIG_ENDIAN);
3240 if ((security_header_type==2)||(security_header_type==4)){
3241 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
3242 proto_tree_add_text(tree, tvb, offset, len-5,"Ciphered message");
3246 proto_tree_add_text(tree, tvb, offset, len,"Not a security protected message");
3249 /* Sequence number Sequence number 9.6 M V 1 */
3250 proto_tree_add_item(tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
3252 /* NAS message NAS message 9.7 M V 1-n */
3257 * 8.2.24 Service reject
3260 nas_emm_serv_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3262 guint32 curr_offset;
3266 curr_offset = offset;
3269 /* EMM cause EMM cause 9.9.3.9 M V 1 */
3270 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
3272 /* 5B T3442 value GPRS timer 9.9.3.16 C TV 2 */
3273 ELEM_OPT_TV(0x5b, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3442 value");
3275 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3278 * 8.2.25 Service request
3279 * This message is sent by the UE to the network to request the establishment
3280 * of a NAS signalling connection and of the radio and S1 bearers.
3281 * Its structure does not follow the structure of a standard layer 3 message. See table 8.2.25.1.
3284 * Protocol discriminator Protocol discriminator 9.2 M V 1/2
3285 * Security header type Security header type 9.3.1 M V 1/2
3286 * KSI and sequence number KSI and sequence number 9.9.3.19 M V 1
3287 * Message authentication code (short) Short MAC 9.9.3.28 M V 2
3290 nas_emm_service_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3292 guint32 curr_offset;
3296 curr_offset = offset;
3299 /* KSI and sequence number 9.9.3.19 M V 1 */
3300 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_KSI_AND_SEQ_NO, NULL);
3302 /* Short MAC 9.9.3.28 M V 2 */
3303 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_SHORT_MAC, " - Message authentication code (short)");
3305 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3309 * 8.2.26 Tracking area update accept
3312 nas_emm_trac_area_upd_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3314 guint32 curr_offset, bit_offset;
3318 curr_offset = offset;
3321 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
3322 bit_offset = curr_offset<<3;
3323 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3325 /* EPS update result EPS update result 9.9.3.13 M V 1/2 */
3326 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3328 proto_tree_add_bits_item(tree, hf_nas_eps_eps_update_result_value, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
3330 /* Fix up the lengths */
3333 /* No more mandatory elements */
3336 /* 5A T3412 value GPRS timer 9.9.3.16 O TV 2 */
3337 ELEM_OPT_TV(0x5a, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3412 value");
3338 /* 50 GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
3339 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
3340 /* 54 TAI list Tracking area identity list 9.9.3.33 O TLV 8-98 */
3341 ELEM_OPT_TLV(0x54, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, NULL);
3342 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
3343 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, NULL);
3344 /* 13 Location area identification Location area identification 9.9.2.2 O TV 6 */
3345 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, NULL);
3346 /* 23 MS identity Mobile identity 9.9.2.3 O TLV 7-10 */
3347 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - MS identity");
3348 /* 53 EMM cause EMM cause 9.9.3.9 O TV 2 */
3349 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
3350 /* 17 T3402 value GPRS timer 9.9.3.16 O TV 2 */
3351 ELEM_OPT_TV(0x17, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3402 value");
3352 /* 59 T3423 value GPRS timer 9.9.3.16 O TV 2 */
3353 ELEM_OPT_TV(0x59, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3423 value");
3354 /* 4A Equivalent PLMNs PLMN list 9.9.2.8 O TLV 5-47 */
3355 ELEM_OPT_TLV(0x4a, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_PLM_LST, " - PLMN list");
3356 /* 34 Emergency Number List Emergency Number List 9.9.3.37 O TLV 5-50 */
3357 ELEM_OPT_TLV(0x34, GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST, NULL);
3358 /* 64 EPS network feature support EPS network feature support 9.9.3.12A O TLV 3 */
3359 ELEM_OPT_TLV(0x64, NAS_PDU_TYPE_EMM, DE_EMM_EPS_NET_FEATURE_SUP, NULL);
3360 /* F- Additional update result Additional update result 9.9.3.0A O TV 1 */
3361 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_RES, NULL );
3363 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3366 * 8.2.27 Tracking area update complete
3370 * 8.2.28 Tracking area update reject
3373 nas_emm_trac_area_upd_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3375 guint32 curr_offset;
3379 curr_offset = offset;
3382 /* EMM cause EMM cause 9.9.3.9 M V 1 */
3383 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
3385 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3388 * 8.2.29 Tracking area update request
3391 nas_emm_trac_area_upd_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3394 guint32 curr_offset, bit_offset;
3398 curr_offset = offset;
3401 bit_offset = curr_offset<<3;
3403 /* NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2 */
3404 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, " ASME");
3407 /* EPS update type EPS update type 9.9.3.14 M V 1/2 */
3408 proto_tree_add_bits_item(tree, hf_nas_eps_active_flg, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3410 proto_tree_add_bits_item(tree, hf_nas_eps_eps_update_type_value, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
3413 /* Fix the lengths */
3416 /* Old GUTI EPS mobile identity 9.9.3.12 M LV 12 */
3417 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Old GUTI");
3418 /* No more Mandatory elements */
3421 /* B- NAS key set identifier Non-current native NAS key set identifier 9.9.3.21 O TV 1 */
3422 ELEM_OPT_TV_SHORT( 0xb0 , NAS_PDU_TYPE_EMM, DE_EMM_NAS_KEY_SET_ID , " - Non-current native NAS key set identifier" );
3423 /* 8- GPRS ciphering key sequence number Ciphering key sequence number 9.9.3.4a O TV 1 */
3424 ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_COMMON, DE_CIPH_KEY_SEQ_NUM, " - GPRS ciphering key sequence number");
3425 /* 19 Old P-TMSI signature P-TMSI signature 9.9.3.26 O TV 4 */
3426 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, " - Old P-TMSI Signature");
3427 /* 50 Additional GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
3428 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Additional GUTI");
3429 /* 55 NonceUE Nonce 9.9.3.25 O TV 5 */
3430 ELEM_OPT_TV(0x55, GSM_A_PDU_TYPE_GM, DE_EMM_NONCE, " - NonceUE");
3431 /* 58 UE network capability UE network capability 9.9.3.34 O TLV 4-15 */
3432 ELEM_OPT_TLV(0x58, NAS_PDU_TYPE_EMM, DE_EMM_UE_NET_CAP, NULL);
3433 /* 52 Last visited registered TAI Tracking area identity 9.9.3.32 O TV 6 */
3434 ELEM_OPT_TV(0x52, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, " - Last visited registered TAI");
3435 /* 5C DRX parameter DRX parameter 9.9.3.8 O TV 3 */
3436 ELEM_OPT_TV(0x5c, GSM_A_PDU_TYPE_GM, DE_DRX_PARAM, NULL );
3437 /* A- UE radio capability information update needed UE radio capability information update needed 9.9.3.35 O TV 1 */
3438 ELEM_OPT_TV_SHORT( 0xA0 , NAS_PDU_TYPE_EMM, DE_EMM_UE_RA_CAP_INF_UPD_NEED , NULL );
3439 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
3440 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, NULL);
3441 /* 31 MS network capability MS network capability 9.9.3.20 O TLV 4-10 */
3442 ELEM_OPT_TLV( 0x31 , GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP , NULL );
3443 /* 13 Old location area identification Location area identification 9.9.2.2 O TV 6 */
3444 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, " - Old location area identification");
3445 /* 9- TMSI status TMSI status 9.9.3.31 O TV 1 */
3446 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , NULL );
3447 /* 11 Mobile station classmark 2 Mobile station classmark 2 9.9.2.5 O TLV 5 */
3448 ELEM_OPT_TLV( 0x11, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_2 , NULL );
3449 /* 20 Mobile station classmark 3 Mobile station classmark 3 9.9.2.5 O TLV 2-34 */
3450 ELEM_OPT_TLV( 0x20, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_3 , NULL );
3451 /* 40 Supported Codecs Supported Codec List 9.9.2.10 O TLV 5-n */
3452 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, " - Supported Codecs");
3453 /* F- Additional update type Additional update type 9.9.3.0B O TV 1 */
3454 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_TYPE, NULL );
3455 /* 5D Voice domain preference and UE's usage setting Voice domain preference and UE's usage setting 9.9.3.44 O TLV 3 */
3456 ELEM_OPT_TLV(0x5D, GSM_A_PDU_TYPE_GM, DE_VOICE_DOMAIN_PREF, NULL);
3458 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3462 * 8.2.30 Uplink NAS Transport
3465 nas_emm_ul_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3467 guint32 curr_offset;
3471 curr_offset = offset;
3474 /* NAS message container NAS message container 9.9.3.22 M LV 3-252*/
3475 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_NAS_MSG_CONT, NULL);
3477 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3481 * 8.2.31 Downlink generic NAS transport
3484 nas_emm_dl_gen_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3486 guint32 curr_offset;
3490 curr_offset = offset;
3493 /* Generic message container type Generic message container type 9.9.3.42 M V 1 */
3494 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT_TYPE, NULL);
3495 /* Generic message container Generic message container 9.9.3.43 M LV-E 3-n */
3496 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT, NULL)
3497 /* 65 Additional information Additional information 9.9.2.0 O TLV 3-n */
3498 ELEM_OPT_TLV(0x65, NAS_PDU_TYPE_EMM, DE_EPS_CMN_ADD_INFO, NULL);
3500 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3504 * 8.2.32 Uplink generic NAS transport
3507 nas_emm_ul_gen_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3509 guint32 curr_offset;
3513 curr_offset = offset;
3516 /* Generic message container type Generic message container type 9.9.3.42 M V 1 */
3517 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT_TYPE, NULL);
3518 /* Generic message container Generic message container 9.9.3.43 M LV-E 3-n */
3519 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT, NULL)
3520 /* 65 Additional information Additional information 9.9.2.0 O TLV 3-n */
3521 ELEM_OPT_TLV(0x65, NAS_PDU_TYPE_EMM, DE_EPS_CMN_ADD_INFO, NULL);
3523 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3527 * 8.3 EPS session management messages
3531 * 8.3.1 Activate dedicated EPS bearer context accept
3534 nas_esm_act_ded_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3536 guint32 curr_offset;
3543 curr_offset = offset;
3546 /* This message is sent by the UE to the network */
3547 pinfo->link_dir = P2P_DIR_UL;
3549 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3550 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3552 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3556 * 8.3.2 Activate dedicated EPS bearer context reject
3559 nas_esm_act_ded_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3561 guint32 curr_offset;
3565 curr_offset = offset;
3568 /* This message is sent by UE to the network to reject activation of a dedicated EPS bearer context */
3569 pinfo->link_dir = P2P_DIR_UL;
3571 /* ESM cause ESM cause 9.9.4.2 M V 1 */
3572 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3573 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3574 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3576 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3579 * 8.3.3 Activate dedicated EPS bearer context request
3582 nas_esm_act_ded_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3584 guint32 curr_offset, bit_offset;
3588 curr_offset = offset;
3591 /* This message is sent by the network to the UE to request activation of a dedicated EPS bearer context... */
3592 pinfo->link_dir = P2P_DIR_DL;
3595 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
3596 bit_offset = curr_offset<<3;
3597 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3599 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3600 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3602 /* Fix the lengths */
3606 /* EPS QoS EPS quality of service 9.9.4.3 M LV 2-10 */
3607 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, NULL);
3608 /* TFT Traffic flow template 9.9.4.16 M LV 2-256 */
3609 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , NULL );
3610 /* 5D Transaction identifier Transaction identifier 9.9.4.17 O TLV 3-4 */
3611 ELEM_OPT_TLV( 0x5d , GSM_A_PDU_TYPE_GM, DE_LINKED_TI , " - Transaction identifier" );
3612 /* 30 Negotiated QoS Quality of service 9.9.4.12 O TLV 14-18 */
3613 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
3614 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
3615 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
3616 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
3617 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , NULL );
3618 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
3619 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL );
3620 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3621 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3623 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3627 * 8.3.4 Activate default EPS bearer context accept
3630 nas_esm_act_def_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3632 guint32 curr_offset;
3636 curr_offset = offset;
3642 /* This message is sent by the UE to the network to acknowledge activation of a default EPS bearer context */
3643 pinfo->link_dir = P2P_DIR_UL;
3645 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3646 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3648 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3652 * 8.3.5 Activate default EPS bearer context reject
3655 nas_esm_act_def_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3657 guint32 curr_offset;
3661 curr_offset = offset;
3664 /* This message is sent by UE to the network to reject activation of a default EPS bearer context. */
3665 pinfo->link_dir = P2P_DIR_UL;
3667 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3668 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3669 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3670 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3672 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3676 * 8.3.6 Activate default EPS bearer context request
3679 nas_esm_act_def_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3681 guint32 curr_offset;
3685 curr_offset = offset;
3688 /* This message is sent by the network to the UE to request activation of a default EPS bearer context. */
3689 pinfo->link_dir = P2P_DIR_DL;
3691 /* EPS QoS EPS quality of service 9.9.4.3 M LV 2-10 */
3692 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, NULL);
3693 /* Access point name Access point name 9.9.4.1 M LV 2-101 */
3694 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL );
3695 /* PDN address PDN address 9.9.4.9 M LV 6-14 DE_ESM_PDN_ADDR*/
3696 ELEM_MAND_LV( NAS_PDU_TYPE_ESM, DE_ESM_PDN_ADDR , NULL );
3697 /* 5D Transaction identifier Transaction identifier 9.9.4.17 O TLV 3-4 */
3698 ELEM_OPT_TLV( 0x5d , GSM_A_PDU_TYPE_GM, DE_LINKED_TI , " - Transaction identifier" );
3699 /* 30 Negotiated QoS Quality of service 9.9.4.12 O TLV 14-18 */
3700 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
3701 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
3702 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
3703 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
3704 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , NULL );
3705 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
3706 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL );
3707 /* 5E APN-AMBR APN aggregate maximum bit rate 9.9.4.2 O TLV 4-8 DE_ESM_APN_AGR_MAX_BR*/
3708 ELEM_OPT_TLV( 0x5e , NAS_PDU_TYPE_ESM, DE_ESM_APN_AGR_MAX_BR , NULL );
3709 /* 58 ESM cause ESM cause 9.9.4.4 O TV 2 */
3710 ELEM_OPT_TV( 0x58 , NAS_PDU_TYPE_ESM, DE_ESM_CAUSE , NULL );
3711 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3712 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3714 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3718 * 8.3.7 Bearer resource allocation reject
3721 nas_esm_bearer_res_all_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3723 guint32 curr_offset;
3727 curr_offset = offset;
3730 /* This message is sent by the network to the UE to reject the allocation of a dedicated bearer resource. */
3731 pinfo->link_dir = P2P_DIR_DL;
3733 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3734 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3735 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3736 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3738 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3742 * 8.3.8 Bearer resource allocation request
3745 nas_esm_bearer_res_all_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3747 guint32 curr_offset, bit_offset;
3751 curr_offset = offset;
3754 /* This message is sent by the UE to the network to request the allocation of a dedicated bearer resource. */
3755 pinfo->link_dir = P2P_DIR_UL;
3757 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
3758 bit_offset = curr_offset<<3;
3759 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3761 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3762 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3764 /* Fix the lengths */
3768 /* Traffic flow aggregate Traffic flow aggregate description 9.9.4.15 M LV 2-256 */
3769 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , " - Traffic flow aggregate" );
3770 /* Required traffic flow QoS EPS quality of service 9.9.4.3 M LV 2-10 */
3771 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, " - Required traffic flow QoS");
3772 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3773 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3775 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3778 * 8.3.9 Bearer resource modification reject
3781 nas_esm_bearer_res_mod_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3783 guint32 curr_offset;
3787 curr_offset = offset;
3790 /* This message is sent by the network to the UE to reject the modification of a dedicated bearer resource. */
3791 pinfo->link_dir = P2P_DIR_DL;
3793 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3794 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3795 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3796 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3798 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3801 * 8.3.10 Bearer resource modification request
3804 nas_esm_bearer_res_mod_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3806 guint32 curr_offset, bit_offset;
3810 curr_offset = offset;
3813 /* This message is sent by the UE to the network to request the modification of a dedicated bearer resource. */
3814 pinfo->link_dir = P2P_DIR_UL;
3816 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
3817 bit_offset = curr_offset<<3;
3818 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3820 /* EPS bearer identity for packet filter Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3821 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3823 /* Fix the lengths */
3826 /* Traffic flow aggregate Traffic flow aggregate description 9.9.4.15 M LV 2-256 */
3827 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , " - Traffic flow aggregate" );
3828 /* 5B Required traffic flow QoS EPS quality of service 9.9.4.3 O TLV 3-11 */
3829 ELEM_OPT_TLV( 0x5B , NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS , " - Required traffic flow QoS" );
3830 /* 58 ESM cause ESM cause 9.9.4.4 O TV 2 */
3831 ELEM_OPT_TV( 0x58 , NAS_PDU_TYPE_ESM, DE_ESM_CAUSE , NULL );
3832 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3833 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3835 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3838 * 8.3.11 Deactivate EPS bearer context accept
3841 nas_esm_deact_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3843 guint32 curr_offset;
3847 curr_offset = offset;
3853 /* This message is sent by the UE to acknowledge deactivation of the EPS bearer context... */
3854 pinfo->link_dir = P2P_DIR_UL;
3856 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV */
3857 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3859 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3862 * 8.3.12 Deactivate EPS bearer context request
3865 nas_esm_deact_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3867 guint32 curr_offset;
3871 curr_offset = offset;
3874 /* This message is sent by the network to request deactivation of an active EPS bearer context. */
3875 pinfo->link_dir = P2P_DIR_DL;
3877 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3878 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3879 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV */
3880 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3882 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3886 * 8.3.13 ESM information request
3890 nas_esm_inf_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3892 guint32 curr_offset;
3895 curr_offset = offset;
3898 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3901 * 8.3.14 ESM information response
3904 nas_esm_inf_resp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3906 guint32 curr_offset;
3910 curr_offset = offset;
3916 /* This message is sent by the UE to the network in response to an ESM INFORMATION REQUEST... */
3917 pinfo->link_dir = P2P_DIR_UL;
3919 /* 28 Access point name Access point name 9.9.4.1 O TLV 3-102 */
3920 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL );
3921 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3922 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3924 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3930 nas_esm_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3932 guint32 curr_offset;
3936 curr_offset = offset;
3939 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3940 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3942 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3945 * 8.3.16 Modify EPS bearer context accept
3948 nas_esm_mod_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3950 guint32 curr_offset;
3954 curr_offset = offset;
3960 /* This message is sent by the UE to the network to acknowledge the modification of an active EPS bearer context. */
3961 pinfo->link_dir = P2P_DIR_UL;
3963 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3964 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3966 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3969 * 8.3.17 Modify EPS bearer context reject
3972 nas_esm_mod_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3974 guint32 curr_offset;
3978 curr_offset = offset;
3981 /* This message is sent by the UE or the network to reject a modification of an active EPS bearer context. */
3982 pinfo->link_dir = P2P_DIR_UL;
3984 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3985 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3986 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3987 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3989 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3992 * 8.3.18 Modify EPS bearer context request
3995 nas_esm_mod_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
3997 guint32 curr_offset;
4001 curr_offset = offset;
4007 /*This message is sent by the network to inform the UE about events which are relevant for the upper layer... */
4008 pinfo->link_dir = P2P_DIR_DL;
4010 /* 5B New EPS QoS EPS quality of service 9.9.4.3 O TLV 3-11 */
4011 ELEM_OPT_TLV( 0x5B , NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS , " - New EPS QoS" );
4012 /* 36 TFT Traffic flow template 9.9.4.16 O TLV 3-257 */
4013 ELEM_OPT_TLV( 0x36 , GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , NULL );
4014 /* 30 New QoS Quality of service 9.9.4.12 O TLV 14-18 */
4015 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - New QoS" );
4016 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
4017 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
4018 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
4019 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , NULL );
4020 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
4021 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL );
4022 /* 5E APN-AMBR APN aggregate maximum bit rate 9.9.4.2 O TLV 4-8 */
4023 ELEM_OPT_TLV( 0x5E , NAS_PDU_TYPE_ESM, DE_ESM_APN_AGR_MAX_BR , NULL );
4024 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
4025 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4027 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4030 * 8.3.18A Notification
4033 nas_esm_notification(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
4035 guint32 curr_offset;
4039 curr_offset = offset;
4042 /* Notification indicator Notification indicator 9.9.4.7A M LV 2 */
4043 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_NOTIF_IND, NULL);
4045 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4049 * 8.3.19 PDN connectivity reject
4052 nas_esm_pdn_con_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
4054 guint32 curr_offset;
4058 curr_offset = offset;
4061 /*This message is sent by the network to the UE to reject establishment of a PDN connection. */
4062 pinfo->link_dir = P2P_DIR_DL;
4064 /* ESM cause ESM cause 9.9.4.4 M V 1 */
4065 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
4066 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
4067 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4069 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4073 * 8.3.20 PDN connectivity request
4076 nas_esm_pdn_con_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
4078 guint32 curr_offset;
4082 curr_offset = offset;
4085 /*This message is sent by the UE to the network to initiate establishment of a PDN connection. */
4086 pinfo->link_dir = P2P_DIR_UL;
4088 /* PDN type PDN type 9.9.4.10 M V 1/2 */
4089 proto_tree_add_bits_item(tree, hf_nas_eps_esm_pdn_type, tvb, (curr_offset<<3), 4, ENC_BIG_ENDIAN);
4091 /* Request type 9.9.4.14 M V 1/2 */
4092 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_REQ_TYPE, NULL);
4094 /* Lengths already fixed by the call to ELEM_MAND_V macro */
4099 /* D- ESM information transfer flag 9.9.4.5 O TV 1 */
4100 ELEM_OPT_TV_SHORT( 0xd0 , NAS_PDU_TYPE_ESM, DE_ESM_INF_TRF_FLG , NULL );
4101 /* 28 Access point name 9.9.4.1 O TLV 3-102 */
4102 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL );
4103 /* 27 Protocol configuration options 9.9.4.11 O TLV 3-253 */
4104 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4106 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4109 * 8.3.20 PDN disconnect reject
4112 nas_esm_pdn_disc_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
4114 guint32 curr_offset;
4118 curr_offset = offset;
4121 /*This message is sent by the UE to the network to initiate establishment of a PDN connection. */
4122 pinfo->link_dir = P2P_DIR_UL;
4124 /* ESM cause ESM cause 9.9.4.4 M V 1 */
4125 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
4126 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
4127 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4129 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4132 * 8.3.21 PDN disconnect request
4135 nas_esm_pdn_disc_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
4137 guint32 curr_offset, bit_offset;
4141 curr_offset = offset;
4144 /* This message is sent by the network to the UE to reject release of a PDN connection. */
4145 pinfo->link_dir = P2P_DIR_DL;
4147 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
4148 bit_offset = curr_offset<<3;
4149 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4151 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
4152 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4154 /* Fix the lengths */
4159 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
4160 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4162 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4166 #define NUM_NAS_MSG_ESM (sizeof(nas_msg_esm_strings)/sizeof(value_string))
4167 static gint ett_nas_msg_esm[NUM_NAS_MSG_ESM];
4168 static void (*nas_msg_esm_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) = {
4169 nas_esm_act_def_eps_bearer_ctx_req, /* Activate default EPS bearer context request*/
4170 nas_esm_act_def_eps_bearer_ctx_acc, /* Activate default EPS bearer context accept*/
4171 nas_esm_act_def_eps_bearer_ctx_rej, /* Activate default EPS bearer context reject*/
4172 nas_esm_act_ded_eps_bearer_ctx_req, /* Activate dedicated EPS bearer context request*/
4173 nas_esm_act_ded_eps_bearer_ctx_acc, /* Activate dedicated EPS bearer context accept*/
4174 nas_esm_act_ded_eps_bearer_ctx_rej, /* Activate dedicated EPS bearer context reject*/
4175 nas_esm_mod_eps_bearer_ctx_req, /* Modify EPS bearer context request*/
4176 nas_esm_mod_eps_bearer_ctx_acc, /* Modify EPS bearer context accept*/
4177 nas_esm_mod_eps_bearer_ctx_rej, /* Modify EPS bearer context reject*/
4178 nas_esm_deact_eps_bearer_ctx_req, /* Deactivate EPS bearer context request*/
4179 nas_esm_deact_eps_bearer_ctx_acc, /* Deactivate EPS bearer context accept*/
4180 nas_esm_pdn_con_req, /* 8.3.18 PDN connectivity request */
4181 nas_esm_pdn_con_rej, /* PDN connectivity reject*/
4182 nas_esm_pdn_disc_req, /* PDN disconnect request*/
4183 nas_esm_pdn_disc_rej, /* PDN disconnect reject*/
4184 nas_esm_bearer_res_all_req, /* Bearer resource allocation request*/
4185 nas_esm_bearer_res_all_rej, /* Bearer resource allocation reject*/
4186 nas_esm_bearer_res_mod_req, /* Bearer resource modification request*/
4187 nas_esm_bearer_res_mod_rej, /* Bearer resource modification reject*/
4188 nas_esm_inf_req, /* ESM information request, No IE:s*/
4189 nas_esm_inf_resp, /* ESM information response*/
4190 nas_esm_notification, /* Notification */
4191 nas_esm_status, /* ESM status */
4197 get_nas_esm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p)
4201 *msg_str = match_strval_idx((guint32) (oct & 0xff), nas_msg_esm_strings, &idx);
4202 *ett_tree = ett_nas_msg_esm[idx];
4203 *hf_idx = hf_nas_eps_msg_esm_type;
4204 *msg_fcn_p = nas_msg_esm_fcn[idx];
4211 #define NUM_NAS_MSG_EMM (sizeof(nas_msg_emm_strings)/sizeof(value_string))
4212 static gint ett_nas_msg_emm[NUM_NAS_MSG_EMM];
4213 static void (*nas_msg_emm_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) = {
4214 nas_emm_attach_req, /* Attach request */
4215 nas_emm_attach_acc, /* Attach accept */
4216 nas_emm_attach_comp, /* Attach complete */
4217 nas_emm_attach_rej, /* Attach reject */
4218 nas_emm_detach_req, /* Detach request */
4219 NULL, /* 8.2.10 Detach accept */
4221 nas_emm_trac_area_upd_req, /* Tracking area update request */
4222 nas_emm_trac_area_upd_acc, /* Tracking area update accept */
4223 NULL, /* Tracking area update complete (No IE's)*/
4224 nas_emm_trac_area_upd_rej, /* Tracking area update reject */
4226 nas_emm_ext_serv_req, /* Extended service request */
4227 nas_emm_serv_rej, /* Service reject */
4229 nas_emm_guti_realloc_cmd, /* GUTI reallocation command */
4230 NULL, /* GUTI reallocation complete (No IE's) */
4231 nas_emm_auth_req, /* Authentication request */
4232 nas_emm_auth_resp, /* Authentication response */
4233 NULL, /* Authentication reject (No IE:s)*/
4234 nas_emm_attach_fail, /* Authentication failure */
4235 nas_emm_id_req, /* Identity request */
4236 nas_emm_id_res, /* Identity response */
4237 nas_emm_sec_mode_cmd, /* Security mode command */
4238 nas_emm_sec_mode_comp, /* Security mode complete */
4239 nas_emm_sec_mode_rej, /* Security mode reject */
4241 nas_emm_emm_status, /* EMM status */
4242 nas_emm_emm_inf, /* EMM information */
4243 nas_emm_dl_nas_trans, /* Downlink NAS transport */
4244 nas_emm_ul_nas_trans, /* Uplink NAS transport */
4245 nas_emm_cs_serv_not, /* 8.2.9 CS service notification */
4246 nas_emm_dl_gen_nas_trans, /* Downlink generic NAS transport */
4247 nas_emm_ul_gen_nas_trans, /* Uplink generic NAS transport */
4253 get_nas_emm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p)
4257 *msg_str = match_strval_idx((guint32) (oct & 0xff), nas_msg_emm_strings, &idx);
4258 *ett_tree = ett_nas_msg_emm[idx];
4259 *hf_idx = hf_nas_eps_msg_emm_type;
4260 *msg_fcn_p = nas_msg_emm_fcn[idx];
4266 * EPS session management messages.
4267 * A plain NAS message is pased to this function
4270 disect_nas_eps_esm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
4272 const gchar *msg_str;
4276 void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len);
4279 len = tvb_length(tvb);
4281 * EPS bearer identity 9.3.2
4283 proto_tree_add_item(tree, hf_nas_eps_bearer_id, tvb, offset, 1, ENC_BIG_ENDIAN);
4284 /* Protocol discriminator 9.2 */
4285 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
4288 /* Procedure transaction identity 9.4
4289 * The procedure transaction identity and its use are defined in 3GPP TS 24.007
4291 proto_tree_add_item(tree, hf_nas_eps_esm_proc_trans_id, tvb, offset, 1, ENC_BIG_ENDIAN);
4295 oct = tvb_get_guint8(tvb,offset);
4301 get_nas_esm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p);
4304 col_append_fstr(pinfo->cinfo, COL_INFO, " %s ", msg_str);
4306 proto_tree_add_text(tree, tvb, offset, 1,"Unknown message 0x%x",oct);
4311 * Add NAS message name
4313 proto_tree_add_item(tree, hf_idx, tvb, offset, 1, ENC_BIG_ENDIAN);
4320 if (msg_fcn_p == NULL)
4322 proto_tree_add_text(tree, tvb, offset, len - offset,
4323 "Message Elements");
4327 (*msg_fcn_p)(tvb, tree, pinfo, offset, len - offset);
4332 * The "real" security header has been dissected or if dissect_header = TRUE
4335 dissect_nas_eps_emm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean second_header)
4337 const gchar *msg_str;
4341 void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len);
4342 guint8 security_header_type, oct;
4344 len = tvb_length(tvb);
4346 /* 9.3.1 Security header type */
4348 security_header_type = tvb_get_guint8(tvb,offset)>>4;
4349 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4350 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
4352 if (security_header_type !=0){
4353 /* Message authentication code */
4354 proto_tree_add_item(tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, ENC_BIG_ENDIAN);
4356 /* Sequence number */
4357 proto_tree_add_item(tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
4359 if ((security_header_type==2)||(security_header_type==4))
4360 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
4362 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4363 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
4368 oct = tvb_get_guint8(tvb,offset);
4374 get_nas_emm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p);
4377 col_append_fstr(pinfo->cinfo, COL_INFO, " %s ", msg_str);
4379 proto_tree_add_text(tree, tvb, offset, 1,"Unknown message 0x%x",oct);
4384 * Add NAS message name
4386 proto_tree_add_item(tree, hf_idx, tvb, offset, 1, ENC_BIG_ENDIAN);
4393 if (msg_fcn_p == NULL)
4395 proto_tree_add_text(tree, tvb, offset, len - offset,
4396 "Message Elements");
4400 (*msg_fcn_p)(tvb, tree, pinfo, offset, len - offset);
4405 * 9 General message format and information elements coding
4407 * Within the protocols defined in the present document, every message, except the SERVICE REQUEST message,
4408 * is a standard L3 message as defined in 3GPP TS 24.007 [12]. This means that the message consists of the following parts:
4409 * 1) if the message is a plain NAS message:
4410 * a) protocol discriminator;
4411 * b) EPS bearer identity or security header type;
4412 * c) procedure transaction identity;
4414 * e) other information elements, as required.
4415 * 2) if the message is a security protected NAS message:
4416 * a) protocol discriminator;
4417 * b) security header type;
4418 * c) message authentication code;
4419 * d) sequence number;
4420 * e) plain NAS message, as defined in item 1.
4422 * The EPS bearer identity and the procedure transaction identity are only used in messages
4423 * with protocol discriminator EPS session management. Octet 1a with the procedure transaction
4424 * identity shall only be included in these messages.
4428 * All messages recived here will have the security header:
4429 * Figure 9.1.2: General message organization example for a security protected NAS message
4430 * 9.3.1 Bits 5 to 8 of the first octet of every EPS Mobility Management (EMM)
4431 * message contain the Security header type IE.
4432 * 4.4.4.2 All ESM messages are integrity protected.
4436 dissect_nas_eps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
4439 proto_tree *nas_eps_tree;
4440 guint8 pd, security_header_type;
4443 guint32 msg_auth_code;
4447 len = tvb_length(tvb);
4449 /* make entry in the Protocol column on summary display */
4450 col_append_str(pinfo->cinfo, COL_PROTOCOL, "/NAS-EPS");
4452 item = proto_tree_add_item(tree, proto_nas_eps, tvb, 0, -1, ENC_BIG_ENDIAN);
4453 nas_eps_tree = proto_item_add_subtree(item, ett_nas_eps);
4455 /* Security header type Security header type 9.3.1 M V 1/2 */
4456 security_header_type = tvb_get_guint8(tvb,offset)>>4;
4457 proto_tree_add_item(nas_eps_tree, hf_nas_eps_security_header_type, tvb, 0, 1, ENC_BIG_ENDIAN);
4458 /* Protocol discriminator Protocol discriminator 9.2 M V 1/2 */
4459 proto_tree_add_item(nas_eps_tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, ENC_BIG_ENDIAN);
4460 pd = tvb_get_guint8(tvb,offset)&0x0f;
4462 /* Message authentication code Message authentication code 9.5 M V 4 */
4463 if (security_header_type == 0){
4465 /* Plain EPS mobility management messages. */
4466 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, ENC_BIG_ENDIAN);
4469 proto_tree_add_text(tree, tvb, offset, len, "All ESM messages should be integrity protected");
4473 /* SERVICE REQUEST (12) is not a plain NAS message treat separately */
4474 if (security_header_type == 12){
4475 col_append_fstr(pinfo->cinfo, COL_INFO, " SERVICE REQUEST ");
4476 nas_emm_service_req(tvb, nas_eps_tree, pinfo, offset, len-offset);
4479 /* Message authentication code */
4480 proto_tree_add_item(nas_eps_tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, ENC_BIG_ENDIAN);
4481 msg_auth_code = tvb_get_ntohl(tvb, offset);
4483 if ((security_header_type==2)||(security_header_type==4)){
4484 /* Possible ciphered message */
4485 if(msg_auth_code!=0){
4486 /* Sequence number Sequence number 9.6 M V 1 */
4487 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
4489 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
4490 pd = tvb_get_guint8(tvb,offset)&0x0f;
4491 /* If pd is in plaintext this message probably isn't ciphered */
4492 if((pd!=7)&&(pd!=2)&&(pd!=15)){
4493 proto_tree_add_text(nas_eps_tree, tvb, offset, len-6,"Ciphered message");
4497 /* msg_auth_code == 0, probably not ciphered */
4498 /* Sequence number Sequence number 9.6 M V 1 */
4499 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
4503 /* Sequence number Sequence number 9.6 M V 1 */
4504 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
4508 /* NAS message NAS message 9.7 M V 1-n */
4510 pd = tvb_get_guint8(tvb,offset)&0x0f;
4513 /* EPS session management messages.
4514 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4516 disect_nas_eps_esm_msg(tvb, pinfo, nas_eps_tree, offset);
4519 /* EPS mobility management messages.
4520 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4522 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, TRUE);
4525 /* Special conformance testing functions for User Equipment messages.
4526 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4528 if (gsm_a_dtap_handle){
4529 tvbuff_t *new_tvb = tvb_new_subset(tvb, offset, -1, -1);
4530 call_dissector(gsm_a_dtap_handle, new_tvb, pinfo, nas_eps_tree);
4532 } /* else fall through default */
4534 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"));
4541 dissect_nas_eps_plain(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
4544 proto_tree *nas_eps_tree;
4551 len = tvb_length(tvb);
4553 /* make entry in the Protocol column on summary display */
4554 col_append_str(pinfo->cinfo, COL_PROTOCOL, "/NAS-EPS");
4556 item = proto_tree_add_item(tree, proto_nas_eps, tvb, 0, -1, ENC_BIG_ENDIAN);
4557 nas_eps_tree = proto_item_add_subtree(item, ett_nas_eps);
4559 pd = tvb_get_guint8(tvb,offset)&0x0f;
4562 /* EPS session management messages.
4563 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4565 disect_nas_eps_esm_msg(tvb, pinfo, nas_eps_tree, offset);
4568 /* EPS mobility management messages.
4569 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4571 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, TRUE);
4574 /* Special conformance testing functions for User Equipment messages.
4575 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4577 if (gsm_a_dtap_handle){
4578 tvbuff_t *new_tvb = tvb_new_subset(tvb, offset, -1, -1);
4579 call_dissector(gsm_a_dtap_handle, new_tvb,pinfo, nas_eps_tree);
4581 } /* else fall through default */
4583 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"));
4589 void proto_register_nas_eps(void) {
4593 /* List of fields */
4595 static hf_register_info hf[] = {
4596 { &hf_nas_eps_msg_emm_type,
4597 { "NAS EPS Mobility Management Message Type", "nas_eps.nas_msg_emm_type",
4598 FT_UINT8, BASE_HEX, VALS(nas_msg_emm_strings), 0x0,
4601 { &hf_nas_eps_common_elem_id,
4602 { "Element ID", "nas_eps.common.elem_id",
4603 FT_UINT8, BASE_DEC, NULL, 0,
4606 { &hf_nas_eps_emm_elem_id,
4607 { "Element ID", "nas_eps.emm.elem_id",
4608 FT_UINT8, BASE_DEC, NULL, 0,
4611 { &hf_nas_eps_bearer_id,
4612 { "EPS bearer identity", "nas_eps.bearer_id",
4613 FT_UINT8, BASE_HEX, NULL, 0xf0,
4616 { &hf_nas_eps_spare_bits,
4617 { "Spare bit(s)", "nas_eps.spare_bits",
4618 FT_UINT8, BASE_HEX, NULL, 0x0,
4621 { &hf_nas_eps_security_header_type,
4622 { "Security header type","nas_eps.security_header_type",
4623 FT_UINT8,BASE_DEC|BASE_EXT_STRING, &security_header_type_vals_ext, 0xf0,
4626 { &hf_nas_eps_msg_auth_code,
4627 { "Message authentication code","nas_eps.msg_auth_code",
4628 FT_UINT32,BASE_HEX, NULL, 0x0,
4631 { &hf_nas_eps_seq_no,
4632 { "Sequence number","nas_eps.seq_no",
4633 FT_UINT8,BASE_DEC, NULL, 0x0,
4636 { &hf_nas_eps_seq_no_short,
4637 { "Sequence number (short)","nas_eps.seq_no_short",
4638 FT_UINT8,BASE_DEC, NULL, 0x0,
4641 { &hf_nas_eps_emm_ebi0,
4642 { "EBI(0) spare","nas_eps.emm.ebi0",
4643 FT_BOOLEAN, 8, NULL, 0x01,
4646 { &hf_nas_eps_emm_ebi1,
4647 { "EBI(1) spare","nas_eps.emm.ebi1",
4648 FT_BOOLEAN, 8, NULL, 0x02,
4651 { &hf_nas_eps_emm_ebi2,
4652 { "EBI(2) spare","nas_eps.emm.ebi2",
4653 FT_BOOLEAN, 8, NULL, 0x04,
4656 { &hf_nas_eps_emm_ebi3,
4657 { "EBI(3) spare","nas_eps.emm.ebi3",
4658 FT_BOOLEAN, 8, NULL, 0x08,
4661 { &hf_nas_eps_emm_ebi4,
4662 { "EBI(4) spare","nas_eps.emm.ebi4",
4663 FT_BOOLEAN, 8, NULL, 0x10,
4666 { &hf_nas_eps_emm_ebi5,
4667 { "EBI(5)","nas_eps.emm.ebi5",
4668 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x20,
4671 { &hf_nas_eps_emm_ebi6,
4672 { "EBI(6)","nas_eps.emm.ebi6",
4673 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x40,
4676 { &hf_nas_eps_emm_ebi7,
4677 { "EBI(7)","nas_eps.emm.ebi7",
4678 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x80,
4681 { &hf_nas_eps_emm_ebi8,
4682 { "EBI(8)","nas_eps.emm.ebi8",
4683 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x01,
4686 { &hf_nas_eps_emm_ebi9,
4687 { "EBI(9)","nas_eps.emm.ebi9",
4688 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x02,
4691 { &hf_nas_eps_emm_ebi10,
4692 { "EBI(10)","nas_eps.emm.ebi10",
4693 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x04,
4696 { &hf_nas_eps_emm_ebi11,
4697 { "EBI(11)","nas_eps.emm.ebi11",
4698 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x08,
4701 { &hf_nas_eps_emm_ebi12,
4702 { "EBI(12)","nas_eps.emm.ebi12",
4703 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x10,
4706 { &hf_nas_eps_emm_ebi13,
4707 { "EBI(13)","nas_eps.emm.ebi13",
4708 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x20,
4711 { &hf_nas_eps_emm_ebi14,
4712 { "EBI(14)","nas_eps.emm.ebi14",
4713 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x40,
4716 { &hf_nas_eps_emm_ebi15,
4717 { "EBI(15)","nas_eps.emm.ebi15",
4718 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x80,
4721 { &hf_nas_eps_emm_dl_nas_cnt,
4722 { "DL NAS COUNT value","nas_eps.emm.dl_nas_cnt",
4723 FT_UINT8,BASE_DEC, NULL, 0x0f,
4726 {&hf_nas_eps_emm_nonce_mme,
4727 { "NonceMME","nas_eps.emm.nonce_mme",
4728 FT_UINT32,BASE_HEX, NULL, 0x0,
4731 {&hf_nas_eps_emm_nonce,
4732 { "Nonce","nas_eps.emm.nonce",
4733 FT_UINT32,BASE_HEX, NULL, 0x0,
4736 { &hf_nas_eps_emm_paging_id,
4737 { "Paging identity value","nas_eps.emm.paging_id",
4738 FT_BOOLEAN, 8, TFS(&nas_eps_emm_paging_id_vals), 0x0,
4741 { &hf_nas_eps_emm_eps_att_type,
4742 { "EPS attach type","nas_eps.emm.eps_att_type",
4743 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_att_type_vals), 0x0,
4746 { &hf_nas_eps_emm_cs_lcs_type,
4747 { "CS-LCS","nas_eps.emm.cs_lcs",
4748 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_cs_lcs_vals), 0x0,
4749 "Location services indicator in CS", HFILL }
4751 { &hf_nas_eps_emm_epc_lcs_type,
4752 { "EPC-LCS","nas_eps.emm.epc_lcs",
4753 FT_BOOLEAN ,BASE_NONE, TFS(&nas_eps_emm_epc_lcs_value), 0x0,
4754 "Location services indicator in EPC", HFILL }
4756 { &hf_nas_eps_emm_emc_bs_type,
4757 { "EMC BS","nas_eps.emm.emc_bs",
4758 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_emc_bs_value), 0x0,
4759 "Emergency bearer services indicator", HFILL }
4761 { &hf_nas_eps_emm_ims_vops_type,
4762 { "IMS VoPS","nas_eps.emm.ims_vops",
4763 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_ims_vops_value), 0x0,
4764 "IMS voice over PS session indicator", HFILL }
4767 { "Type of security context flag (TSC)","nas_eps.emm.tsc",
4768 FT_UINT8,BASE_DEC, VALS(nas_eps_tsc_vals), 0x0,
4771 { &hf_nas_eps_emm_nas_key_set_id,
4772 { "NAS key set identifier","nas_eps.emm.nas_key_set_id",
4773 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_NAS_key_set_identifier_vals), 0x0,
4776 { &hf_nas_eps_emm_odd_even,
4777 { "odd/even indic","nas_eps.emm.odd_even",
4778 FT_UINT8,BASE_DEC, NULL, 0x8,
4781 { &hf_nas_eps_emm_type_of_id,
4782 { "Type of identity","nas_eps.emm.type_of_id",
4783 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_id_vals), 0x07,
4786 { &hf_nas_eps_emm_mme_grp_id,
4787 { "MME Group ID","nas_eps.emm.mme_grp_id",
4788 FT_UINT16, BASE_DEC, NULL, 0x0,
4791 { &hf_nas_eps_emm_imsi,
4792 { "IMSI", "nas_eps.emm.imsi",
4793 FT_STRING, BASE_NONE, NULL, 0,
4796 { &hf_nas_eps_emm_imei,
4797 { "IMEI", "nas_eps.emm.imei",
4798 FT_STRING, BASE_NONE, NULL, 0,
4801 { &hf_nas_eps_emm_mme_code,
4802 { "MME Code","nas_eps.emm.mme_code",
4803 FT_UINT8, BASE_DEC, NULL, 0x0,
4806 { &hf_nas_eps_emm_m_tmsi,
4807 { "M-TMSI","nas_eps.emm.m_tmsi",
4808 FT_UINT32, BASE_HEX, NULL, 0x0,
4811 { &hf_nas_eps_esm_msg_cont,
4812 { "ESM message container contents","nas_eps.emm.esm_msg_cont",
4813 FT_BYTES, BASE_NONE, NULL, 0x0,
4816 { &hf_nas_eps_esm_imeisv_req,
4817 { "IMEISV request","nas_eps.emm.imeisv_req",
4818 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_imeisv_req_vals), 0x07,
4821 { &hf_nas_eps_emm_toi,
4822 { "Type of integrity protection algorithm","nas_eps.emm.toi",
4823 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_toi_vals), 0x07,
4826 { &hf_nas_eps_emm_toc,
4827 { "Type of ciphering algorithm","nas_eps.emm.toc",
4828 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_toc_vals), 0x70,
4831 { &hf_nas_eps_emm_EPS_attach_result,
4832 { "Attach result","nas_eps.emm.EPS_attach_result",
4833 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_EPS_attach_result_values), 0x0,
4836 { &hf_nas_eps_emm_spare_half_octet,
4837 { "Spare half octet","nas_eps.emm.EPS_attach_result",
4838 FT_UINT8,BASE_DEC, NULL, 0x0,
4841 { &hf_nas_eps_emm_add_upd_res,
4842 { "AURV","nas_eps.emm.add_upd_res",
4843 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_add_upd_res_vals), 0x0,
4844 "Additional update result value", HFILL }
4846 { &hf_nas_eps_emm_add_upd_type,
4847 { "AUTV","nas_eps.emm.add_upd_type",
4848 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_add_upd_type_vals), 0x0,
4849 "Additional update type value", HFILL }
4851 { &hf_nas_eps_emm_res,
4852 { "RES","nas_eps.emm.res",
4853 FT_BYTES, BASE_NONE, NULL, 0x0,
4856 { &hf_nas_eps_emm_csfb_resp,
4857 { "CSFB response","nas_eps.emm.csfb_resp",
4858 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_csfb_resp_vals), 0x03,
4861 { &hf_nas_eps_emm_cause,
4862 { "Cause","nas_eps.emm.cause",
4863 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_cause_values), 0x0,
4866 { &hf_nas_eps_emm_id_type2,
4867 { "Identity type 2","nas_eps.emm.id_type2",
4868 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_id_type2_vals), 0x0,
4871 { &hf_nas_eps_emm_short_mac,
4872 { "Message authentication code (short)","nas_eps.emm.short_mac",
4873 FT_UINT16, BASE_HEX, NULL, 0x0,
4876 { &hf_nas_eps_emm_tai_tol,
4877 { "Type of list","nas_eps.emm.tai_tol",
4878 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_tai_tol_vals), 0x60,
4881 { &hf_nas_eps_emm_tai_n_elem,
4882 { "Number of elements","nas_eps.emm.tai_n_elem",
4883 FT_UINT8, BASE_DEC, NULL, 0x1f,
4886 { &hf_nas_eps_emm_tai_tac,
4887 { "Tracking area code(TAC)","nas_eps.emm.tai_tac",
4888 FT_UINT16, BASE_HEX, NULL, 0x0,
4891 { &hf_nas_eps_emm_eea0,
4892 { "EEA0","nas_eps.emm.eea0",
4893 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
4896 { &hf_nas_eps_emm_128eea1,
4897 { "128-EEA1","nas_eps.emm.128eea1",
4898 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4901 { &hf_nas_eps_emm_128eea2,
4902 { "128-EEA2","nas_eps.emm.128eea2",
4903 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4906 { &hf_nas_eps_emm_eea3,
4907 { "EEA3","nas_eps.emm.eea3",
4908 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4911 { &hf_nas_eps_emm_eea4,
4912 { "EEA4","nas_eps.emm.eea4",
4913 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4916 { &hf_nas_eps_emm_eea5,
4917 { "EEA5","nas_eps.emm.eea5",
4918 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4921 { &hf_nas_eps_emm_eea6,
4922 { "EEA6","nas_eps.emm.eea6",
4923 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4926 { &hf_nas_eps_emm_eea7,
4927 { "EEA7","nas_eps.emm.eea7",
4928 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4931 { &hf_nas_eps_emm_eia0,
4932 { "EIA0","nas_eps.emm.eia0",
4933 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
4936 { &hf_nas_eps_emm_128eia1,
4937 { "128-EIA1","nas_eps.emm.128eia1",
4938 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4941 { &hf_nas_eps_emm_128eia2,
4942 { "128-EIA2","nas_eps.emm.128eia2",
4943 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4946 { &hf_nas_eps_emm_eia3,
4947 { "EIA3","nas_eps.emm.eia3",
4948 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4951 { &hf_nas_eps_emm_eia4,
4952 { "EIA4","nas_eps.emm.eia4",
4953 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4956 { &hf_nas_eps_emm_eia5,
4957 { "EIA5","nas_eps.emm.eia5",
4958 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4961 { &hf_nas_eps_emm_eia6,
4962 { "EIA6","nas_eps.emm.eia6",
4963 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4966 { &hf_nas_eps_emm_eia7,
4967 { "EIA7","nas_eps.emm.eia7",
4968 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4973 { &hf_nas_eps_emm_uea0,
4974 { "UEA0","nas_eps.emm.uea0",
4975 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
4978 { &hf_nas_eps_emm_uea1,
4979 { "UEA1","nas_eps.emm.uea1",
4980 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4983 { &hf_nas_eps_emm_uea2,
4984 { "UEA2","nas_eps.emm.uea2",
4985 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4988 { &hf_nas_eps_emm_uea3,
4989 { "UEA3","nas_eps.emm.uea3",
4990 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4993 { &hf_nas_eps_emm_uea4,
4994 { "UEA4","nas_eps.emm.uea4",
4995 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4998 { &hf_nas_eps_emm_uea5,
4999 { "UEA5","nas_eps.emm.uea5",
5000 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
5003 { &hf_nas_eps_emm_uea6,
5004 { "UEA6","nas_eps.emm.uea6",
5005 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
5008 { &hf_nas_eps_emm_uea7,
5009 { "UEA7","nas_eps.emm.uea7",
5010 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
5013 { &hf_nas_eps_emm_ucs2_supp,
5014 { "UCS2 support (UCS2)","nas_eps.emm.emm_ucs2_supp",
5015 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ucs2_supp_flg_value), 0x80,
5018 { &hf_nas_eps_emm_uia1,
5019 { "UMTS integrity algorithm UIA1","nas_eps.emm.uia1",
5020 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
5023 { &hf_nas_eps_emm_uia2,
5024 { "UMTS integrity algorithm UIA2","nas_eps.emm.uia2",
5025 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
5028 { &hf_nas_eps_emm_uia3,
5029 { "UMTS integrity algorithm UIA3","nas_eps.emm.uia3",
5030 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
5033 { &hf_nas_eps_emm_uia4,
5034 { "UMTS integrity algorithm UIA4","nas_eps.emm.uia4",
5035 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
5038 { &hf_nas_eps_emm_uia5,
5039 { "UMTS integrity algorithm UIA5","nas_eps.emm.uia5",
5040 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
5043 { &hf_nas_eps_emm_uia6,
5044 { "UMTS integrity algorithm UIA6","nas_eps.emm.uia6",
5045 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
5048 { &hf_nas_eps_emm_uia7,
5049 { "UMTS integrity algorithm UIA7","nas_eps.emm.uia7",
5050 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
5053 { &hf_nas_eps_emm_gea1,
5054 { "GPRS encryption algorithm GEA1","nas_eps.emm.gea1",
5055 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
5058 { &hf_nas_eps_emm_gea2,
5059 { "GPRS encryption algorithm GEA2","nas_eps.emm.gea2",
5060 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
5063 { &hf_nas_eps_emm_gea3,
5064 { "GPRS encryption algorithm GEA3","nas_eps.emm.gea3",
5065 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
5068 { &hf_nas_eps_emm_gea4,
5069 { "GPRS encryption algorithm GEA4","nas_eps.emm.gea4",
5070 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
5073 { &hf_nas_eps_emm_gea5,
5074 { "GPRS encryption algorithm GEA5","nas_eps.emm.gea5",
5075 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
5078 { &hf_nas_eps_emm_gea6,
5079 { "GPRS encryption algorithm GEA6","nas_eps.emm.gea6",
5080 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
5083 { &hf_nas_eps_emm_gea7,
5084 { "GPRS encryption algorithm GEA7","nas_eps.emm.gea7",
5085 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
5088 { &hf_nas_eps_emm_lpp_cap,
5089 { "LPP capability","nas_eps.emm.lpp_cap",
5090 FT_BOOLEAN, 8, TFS(&nas_eps_emm_lpp_cap_flg), 0x08,
5093 { &hf_nas_eps_emm_lcs_cap,
5094 { "LCS capability","nas_eps.emm.lcs_cap",
5095 FT_BOOLEAN, 8, TFS(&nas_eps_emm_lcs_cap_flg), 0x04,
5098 { &hf_nas_eps_emm_1xsrvcc_cap,
5099 { "1xSRVCC capability","nas_eps.emm.1xsrvcc_cap",
5100 FT_BOOLEAN, 8, TFS(&nas_eps_emm_1xsrvcc_cap_flg), 0x02,
5103 { &hf_nas_eps_emm_nf_cap,
5104 { "NF capability","nas_eps.emm.nf_cap",
5105 FT_BOOLEAN, 8, TFS(&nas_eps_emm_nf_cap_flg), 0x01,
5108 { &hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg,
5109 { "1xSRVCC capability","nas_eps.emm.ue_ra_cap_inf_upd_need_flg",
5110 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ue_ra_cap_inf_upd_need_flg), 0x01,
5113 { &hf_nas_eps_emm_ss_code,
5114 { "SS Code","nas_eps.emm.eps_update_result_value",
5115 FT_UINT8,BASE_DEC, VALS(ssCode_vals), 0x0,
5118 { &hf_nas_eps_emm_lcs_ind,
5119 { "LCS indicator","nas_eps.emm.emm_lcs_ind",
5120 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_lcs_ind_vals), 0x0,
5123 { &hf_nas_eps_emm_gen_msg_cont_type,
5124 { "Container type","nas_eps.emm.gen_msg_cont_type",
5125 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_gen_msg_cont_type_vals), 0x0,
5128 { &hf_nas_eps_emm_apn_ambr_ul,
5129 { "APN-AMBR for uplink","nas_eps.emm.apn_ambr_ul",
5130 FT_UINT8,BASE_DEC, NULL, 0x0,
5133 { &hf_nas_eps_emm_apn_ambr_dl,
5134 { "APN-AMBR for downlink","nas_eps.emm.apn_ambr_dl",
5135 FT_UINT8,BASE_DEC, NULL, 0x0,
5138 { &hf_nas_eps_emm_apn_ambr_ul_ext,
5139 { "APN-AMBR for uplink(Extended)","nas_eps.emm.apn_ambr_ul_ext",
5140 FT_UINT8,BASE_DEC, NULL, 0x0,
5143 { &hf_nas_eps_emm_apn_ambr_dl_ext,
5144 { "APN-AMBR for downlink(Extended)","nas_eps.emm.apn_ambr_dl_ext",
5145 FT_UINT8,BASE_DEC, NULL, 0x0,
5148 { &hf_nas_eps_emm_apn_ambr_ul_ext2,
5149 { "APN-AMBR for uplink(Extended-2)","nas_eps.emm.apn_ambr_ul_ext2",
5150 FT_UINT8,BASE_DEC, NULL, 0x0,
5153 { &hf_nas_eps_emm_apn_ambr_dl_ext2,
5154 { "APN-AMBR for downlink(Extended-2)","nas_eps.emm.apn_ambr_dl_ext2",
5155 FT_UINT8,BASE_DEC, NULL, 0x0,
5158 { &hf_nas_eps_emm_switch_off,
5159 { "Switch off","nas_eps.emm.switch_off",
5160 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_switch_off_vals), 0x0,
5163 { &hf_nas_eps_emm_detach_type_UL,
5164 { "Detach Type","nas_eps.emm.detach_type_ul",
5165 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_dtatch_UL_vals), 0x0,
5168 { &hf_nas_eps_emm_detach_type_DL,
5169 { "Detach Type","nas_eps.emm.detach_type_dl",
5170 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_dtatch_DL_vals), 0x0,
5174 { "Quality of Service Class Identifier (QCI)","nas_eps.emm.qci",
5175 FT_UINT8,BASE_DEC, VALS(nas_eps_qci_vals), 0x0,
5178 { &hf_nas_eps_mbr_ul,
5179 { "Maximum bit rate for uplink","nas_eps.emm.mbr_ul",
5180 FT_UINT8,BASE_DEC, NULL, 0x0,
5183 { &hf_nas_eps_mbr_dl,
5184 { "Maximum bit rate for downlink","nas_eps.emm.mbr_dl",
5185 FT_UINT8,BASE_DEC, NULL, 0x0,
5188 { &hf_nas_eps_gbr_ul,
5189 { "Guaranteed bit rate for uplink","nas_eps.emm.gbr_ul",
5190 FT_UINT8,BASE_DEC, NULL, 0x0,
5193 { &hf_nas_eps_gbr_dl,
5194 { "Guaranteed bit rate for downlink","nas_eps.emm.gbr_dl",
5195 FT_UINT8,BASE_DEC, NULL, 0x0,
5198 { &hf_nas_eps_embr_ul,
5199 { "Maximum bit rate for uplink(ext)","nas_eps.emm.embr_ul",
5200 FT_UINT8,BASE_DEC, NULL, 0x0,
5203 { &hf_nas_eps_embr_dl,
5204 { "Maximum bit rate for downlink(ext)","nas_eps.emm.embr_dl",
5205 FT_UINT8,BASE_DEC, NULL, 0x0,
5208 { &hf_nas_eps_egbr_ul,
5209 { "Guaranteed bit rate for uplink(ext)","nas_eps.emm.egbr_ul",
5210 FT_UINT8,BASE_DEC, NULL, 0x0,
5213 { &hf_nas_eps_egbr_dl,
5214 { "Guaranteed bit rate for downlink(ext)","nas_eps.emm.egbr_dl",
5215 FT_UINT8,BASE_DEC, NULL, 0x0,
5218 { &hf_nas_eps_esm_cause,
5219 { "Cause","nas_eps.esm.cause",
5220 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_cause_vals), 0x0,
5223 { &hf_nas_eps_esm_eit,
5224 { "EIT (ESM information transfer)", "nas_eps.emm.eit",
5225 FT_BOOLEAN, 8, TFS(&nas_eps_emm_active_flg_value), 0x01,
5228 { &hf_nas_eps_esm_lnkd_eps_bearer_id,
5229 { "Linked EPS bearer identity","nas_eps.esm.lnkd_eps_bearer_id",
5230 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_linked_bearer_id_vals), 0x0f,
5233 { &hf_nas_eps_esm_notif_ind,
5234 { "Notification indicator value","nas_eps.esm.notif_ind",
5235 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_notif_ind_vals), 0x0,
5238 { &hf_nas_eps_esm_pdn_ipv4,
5239 {"PDN IPv4", "nas_eps.esm.pdn_ipv4",
5240 FT_IPv4, BASE_NONE, NULL, 0x0,
5243 { &hf_nas_eps_esm_pdn_ipv6_if_id,
5244 {"PDN IPv6 if id", "nas_eps.esm.pdn_ipv6_if_id",
5245 FT_BYTES, BASE_NONE, NULL, 0x0,
5248 { &hf_nas_eps_esm_linked_bearer_id,
5249 { "Linked EPS bearer identity","nas_eps.esm.linked_bearer_id",
5250 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_linked_bearer_id_vals), 0x0,
5253 { &hf_nas_eps_active_flg,
5254 { "Active flag", "nas_eps.emm.active_flg",
5255 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_active_flg_value), 0x0,
5258 { &hf_nas_eps_eps_update_result_value,
5259 { "EPS update result value","nas_eps.emm.eps_update_result_value",
5260 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_update_result_vals), 0x0,
5263 { &hf_nas_eps_eps_update_type_value,
5264 { "EPS update type value", "nas_eps.emm.update_type_value",
5265 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_update_type_vals), 0x0,
5268 { &hf_nas_eps_service_type,
5269 { "Service type", "nas_eps.emm.service_type",
5270 FT_UINT8,BASE_DEC, VALS(nas_eps_service_type_vals), 0x0,
5273 /* ESM hf cvariables */
5274 { &hf_nas_eps_msg_esm_type,
5275 { "NAS EPS session management messages", "nas_eps.nas_msg_esm_type",
5276 FT_UINT8, BASE_HEX, VALS(nas_msg_esm_strings), 0x0,
5279 { &hf_nas_eps_esm_elem_id,
5280 { "Element ID", "nas_eps.esm.elem_id",
5281 FT_UINT8, BASE_DEC, NULL, 0,
5284 { &hf_nas_eps_esm_proc_trans_id,
5285 { "Procedure transaction identity", "nas_eps.esm.proc_trans_id",
5286 FT_UINT8, BASE_DEC, NULL, 0,
5289 { &hf_nas_eps_esm_pdn_type,
5290 { "PDN type", "nas_eps.nas_eps_esm_pdn_type",
5291 FT_UINT8, BASE_DEC, VALS(nas_eps_esm_pdn_type_values), 0x0,
5296 /* Setup protocol subtree array */
5297 #define NUM_INDIVIDUAL_ELEMS 2
5298 gint *ett[NUM_INDIVIDUAL_ELEMS +
5299 NUM_NAS_EPS_COMMON_ELEM +
5300 NUM_NAS_MSG_EMM + NUM_NAS_EMM_ELEM+
5301 NUM_NAS_MSG_ESM + NUM_NAS_ESM_ELEM];
5303 ett[0] = &ett_nas_eps;
5304 ett[1] = &ett_nas_eps_esm_msg_cont;
5306 last_offset = NUM_INDIVIDUAL_ELEMS;
5308 for (i=0; i < NUM_NAS_EPS_COMMON_ELEM; i++, last_offset++)
5310 ett_nas_eps_common_elem[i] = -1;
5311 ett[last_offset] = &ett_nas_eps_common_elem[i];
5315 for (i=0; i < NUM_NAS_MSG_EMM; i++, last_offset++)
5317 ett_nas_msg_emm[i] = -1;
5318 ett[last_offset] = &ett_nas_msg_emm[i];
5321 for (i=0; i < NUM_NAS_EMM_ELEM; i++, last_offset++)
5323 ett_nas_eps_emm_elem[i] = -1;
5324 ett[last_offset] = &ett_nas_eps_emm_elem[i];
5327 for (i=0; i < NUM_NAS_MSG_ESM; i++, last_offset++)
5329 ett_nas_msg_esm[i] = -1;
5330 ett[last_offset] = &ett_nas_msg_esm[i];
5333 for (i=0; i < NUM_NAS_ESM_ELEM; i++, last_offset++)
5335 ett_nas_eps_esm_elem[i] = -1;
5336 ett[last_offset] = &ett_nas_eps_esm_elem[i];
5339 /* Register protocol */
5340 proto_nas_eps = proto_register_protocol(PNAME, PSNAME, PFNAME);
5341 /* Register fields and subtrees */
5342 proto_register_field_array(proto_nas_eps, hf, array_length(hf));
5343 proto_register_subtree_array(ett, array_length(ett));
5345 /* Register dissector */
5346 register_dissector(PFNAME, dissect_nas_eps, proto_nas_eps);
5348 /* Register dissector */
5349 register_dissector("nas-eps_plain", dissect_nas_eps_plain, proto_nas_eps);
5353 proto_reg_handoff_nas_eps(void)
5356 gsm_a_dtap_handle = find_dissector("gsm_a_dtap");