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.0.0 (2009-09)
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_nounce_mme = -1;
81 static int hf_nas_eps_emm_eps_att_type = -1;
82 static int hf_nas_eps_emm_cs_lcs_type = -1;
83 static int hf_nas_eps_emm_epc_lcs_type = -1;
84 static int hf_nas_eps_emm_emc_bs_type = -1;
85 static int hf_nas_eps_emm_ims_vops_type = -1;
86 static int hf_nas_eps_emm_nas_key_set_id = -1;
87 static int hf_nas_eps_tsc = -1;
88 static int hf_nas_eps_emm_odd_even = -1;
89 static int hf_nas_eps_emm_type_of_id = -1;
90 static int hf_nas_eps_emm_mme_grp_id = -1;
91 static int hf_nas_eps_emm_imsi = -1;
92 static int hf_nas_eps_emm_imei = -1;
93 static int hf_nas_eps_emm_mme_code = -1;
94 static int hf_nas_eps_emm_m_tmsi = -1;
95 static int hf_nas_eps_esm_msg_cont = -1;
96 static int hf_nas_eps_esm_imeisv_req = -1;
97 static int hf_nas_eps_emm_toi = -1;
98 static int hf_nas_eps_emm_toc = -1;
99 static int hf_nas_eps_emm_EPS_attach_result = -1;
100 static int hf_nas_eps_emm_spare_half_octet = -1;
101 static int hf_nas_eps_emm_add_upd_res = -1;
102 static int hf_nas_eps_emm_add_upd_type = -1;
103 static int hf_nas_eps_emm_res = -1;
104 static int hf_nas_eps_emm_csfb_resp = -1;
105 static int hf_nas_eps_emm_cause = -1;
106 static int hf_nas_eps_emm_id_type2 = -1;
107 static int hf_nas_eps_emm_short_mac = -1;
108 static int hf_nas_eps_emm_tai_tol = -1;
109 static int hf_nas_eps_emm_tai_n_elem = -1;
110 static int hf_nas_eps_emm_tai_tac = -1;
111 static int hf_nas_eps_emm_eea0 = -1;
112 static int hf_nas_eps_emm_128eea1 = -1;
113 static int hf_nas_eps_emm_128eea2 = -1;
114 static int hf_nas_eps_emm_eea3 = -1;
115 static int hf_nas_eps_emm_eea4 = -1;
116 static int hf_nas_eps_emm_eea5 = -1;
117 static int hf_nas_eps_emm_eea6 = -1;
118 static int hf_nas_eps_emm_eea7 = -1;
119 static int hf_nas_eps_emm_eia0 = -1;
120 static int hf_nas_eps_emm_128eia1 = -1;
121 static int hf_nas_eps_emm_128eia2 = -1;
122 static int hf_nas_eps_emm_eia3 = -1;
123 static int hf_nas_eps_emm_eia4 = -1;
124 static int hf_nas_eps_emm_eia5 = -1;
125 static int hf_nas_eps_emm_eia6 = -1;
126 static int hf_nas_eps_emm_eia7 = -1;
127 static int hf_nas_eps_emm_uea0 = -1;
128 static int hf_nas_eps_emm_uea1 = -1;
129 static int hf_nas_eps_emm_uea2 = -1;
130 static int hf_nas_eps_emm_uea3 = -1;
131 static int hf_nas_eps_emm_uea4 = -1;
132 static int hf_nas_eps_emm_uea5 = -1;
133 static int hf_nas_eps_emm_uea6 = -1;
134 static int hf_nas_eps_emm_uea7 = -1;
135 static int hf_nas_eps_emm_ucs2_supp = -1;
136 static int hf_nas_eps_emm_uia0 = -1;
137 static int hf_nas_eps_emm_uia1 = -1;
138 static int hf_nas_eps_emm_uia2 = -1;
139 static int hf_nas_eps_emm_uia3 = -1;
140 static int hf_nas_eps_emm_uia4 = -1;
141 static int hf_nas_eps_emm_uia5 = -1;
142 static int hf_nas_eps_emm_uia6 = -1;
143 static int hf_nas_eps_emm_uia7 = -1;
144 static int hf_nas_eps_emm_gea1 = -1;
145 static int hf_nas_eps_emm_gea2 = -1;
146 static int hf_nas_eps_emm_gea3 = -1;
147 static int hf_nas_eps_emm_gea4 = -1;
148 static int hf_nas_eps_emm_gea5 = -1;
149 static int hf_nas_eps_emm_gea6 = -1;
150 static int hf_nas_eps_emm_gea7 = -1;
151 static int hf_nas_eps_emm_1xsrvcc_cap = -1;
152 static int hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg;
153 static int hf_nas_eps_emm_ss_code = -1;
154 static int hf_nas_eps_emm_lcs_ind = -1;
155 static int hf_nas_eps_emm_apn_ambr_ul = -1;
156 static int hf_nas_eps_emm_apn_ambr_dl = -1;
157 static int hf_nas_eps_emm_apn_ambr_ul_ext = -1;
158 static int hf_nas_eps_emm_apn_ambr_dl_ext = -1;
159 static int hf_nas_eps_emm_apn_ambr_ul_ext2 = -1;
160 static int hf_nas_eps_emm_apn_ambr_dl_ext2 = -1;
162 static int hf_nas_eps_emm_switch_off = -1;
163 static int hf_nas_eps_emm_detach_type_UL = -1;
164 static int hf_nas_eps_emm_detach_type_DL = -1;
166 static int hf_nas_eps_qci = -1;
167 static int hf_nas_eps_mbr_ul = -1;
168 static int hf_nas_eps_mbr_dl = -1;
169 static int hf_nas_eps_gbr_ul = -1;
170 static int hf_nas_eps_gbr_dl = -1;
171 static int hf_nas_eps_embr_ul = -1;
172 static int hf_nas_eps_embr_dl = -1;
173 static int hf_nas_eps_egbr_ul = -1;
174 static int hf_nas_eps_egbr_dl = -1;
176 static int hf_nas_eps_esm_cause = -1;
177 static int hf_nas_eps_esm_eit = -1;
178 static int hf_nas_eps_esm_lnkd_eps_bearer_id = -1;
179 static int hf_nas_eps_esm_pdn_type = -1;
180 static int hf_nas_eps_esm_pdn_ipv4 = -1;
181 static int hf_nas_eps_esm_pdn_ipv6_if_id = -1;
183 static int hf_nas_eps_esm_linked_bearer_id = -1;
185 static int hf_nas_eps_active_flg = -1;
186 static int hf_nas_eps_eps_update_result_value = -1;
187 static int hf_nas_eps_eps_update_type_value = -1;
188 static int hf_nas_eps_service_type = -1;
191 static int hf_nas_eps_msg_esm_type = -1;
192 int hf_nas_eps_esm_elem_id = -1;
193 static int hf_nas_eps_esm_proc_trans_id = -1;
195 /* Initialize the subtree pointers */
196 static int ett_nas_eps = -1;
197 static int ett_nas_eps_esm_msg_cont = -1;
199 /* Global variables */
200 static packet_info *gpinfo;
202 /* Table 9.8.1: Message types for EPS mobility management
203 * 0 1 - - - - - - EPS mobility management messages
205 static const value_string nas_msg_emm_strings[] = {
206 { 0x41, "Attach request"},
207 { 0x42, "Attach accept"},
208 { 0x43, "Attach complete"},
209 { 0x44, "Attach reject"},
210 { 0x45, "Detach request"},
211 { 0x46, "Detach accept"},
213 { 0x48, "Tracking area update request"},
214 { 0x49, "Tracking area update accept"},
215 { 0x4a, "Tracking area update complete"},
216 { 0x4b, "Tracking area update reject"},
218 { 0x4c, "Extended service request"},
219 { 0x4e, "Service reject"},
221 { 0x50, "GUTI reallocation command"},
222 { 0x51, "GUTI reallocation complete"},
223 { 0x52, "Authentication request"},
224 { 0x53, "Authentication response"},
225 { 0x54, "Authentication reject"},
226 { 0x5c, "Authentication failure"},
227 { 0x55, "Identity request"},
228 { 0x56, "Identity response"},
229 { 0x5d, "Security mode command"},
230 { 0x5e, "Security mode complete"},
231 { 0x5f, "Security mode reject"},
233 { 0x60, "EMM status"},
234 { 0x61, "EMM information"},
235 { 0x62, "Downlink NAS transport"},
236 { 0x63, "Uplink NAS transport"},
237 { 0x64, "CS Service notification"},
238 { 0x68, "Downlink generic NAS transport"},
239 { 0x69, "Uplink generic NAS transport"},
243 /* Table 9.8.2: Message types for EPS session management */
245 static const value_string nas_msg_esm_strings[] = {
246 { 0xc1, "Activate default EPS bearer context request"},
247 { 0xc2, "Activate default EPS bearer context accept"},
248 { 0xc3, "Activate default EPS bearer context reject"},
249 { 0xc5, "Activate dedicated EPS bearer context request"},
250 { 0xc6, "Activate dedicated EPS bearer context accept"},
251 { 0xc7, "Activate dedicated EPS bearer context reject"},
252 { 0xc9, "Modify EPS bearer context request"},
253 { 0xca, "Modify EPS bearer context accept"},
254 { 0xcb, "Modify EPS bearer context reject"},
255 { 0xcd, "Deactivate EPS bearer context request"},
256 { 0xce, "Deactivate EPS bearer context accept"},
257 { 0xd0, "PDN connectivity request"},
258 { 0xd1, "PDN connectivity reject"},
259 { 0xd2, "PDN disconnect request"},
260 { 0xd3, "PDN disconnect reject"},
261 { 0xd4, "Bearer resource allocation request"},
262 { 0xd5, "Bearer resource allocation reject"},
263 { 0xd6, "Bearer resource modification request"},
264 { 0xd7, "Bearer resource modification reject"},
265 { 0xd9, "ESM information request"},
266 { 0xda, "ESM information response"},
267 { 0xdb, "Notification"},
268 { 0xe8, "ESM status"},
272 static const value_string security_header_type_vals[] = {
273 { 0, "Plain NAS message, not security protected"},
274 { 1, "Integrity protected"},
275 { 2, "Integrity protected and ciphered"},
276 { 3, "Integrity protected with new EPS security context"},
277 { 4, "Integrity protected and ciphered with new EPS security context"},
285 { 12, "Security header for the SERVICE REQUEST message "},
286 { 13, "These values are not used in this version of the protocol. If received they shall be interpreted as \"1100\""},
287 { 14, "These values are not used in this version of the protocol. If received they shall be interpreted as \"1100\""},
288 { 15, "These values are not used in this version of the protocol. If received they shall be interpreted as \"1100\""},
292 const value_string nas_eps_common_elem_strings[] = {
293 { 0x00, "EPS bearer context status" }, /* 9.9.2.1 EPS bearer context status */
294 { 0x00, "Location area identification" }, /* 9.9.2.2 Location area identification */
295 { 0x00, "Mobile identity" }, /* 9.9.2.3 Mobile identity */
296 { 0x00, "Mobile station classmark 2" }, /* 9.9.2.4 Mobile station classmark 2 */
297 { 0x00, "Mobile station classmark 3" }, /* 9.9.2.5 Mobile station classmark 3 */
298 { 0x00, "NAS security parameters from E-UTRA" }, /* 9.9.2.6 NAS security parameters from E-UTRA */
299 { 0x00, "NAS security parameters to E-UTRA" }, /* 9.9.2.7 NAS security parameters to E-UTRA */
300 { 0x00, "PLMN list" }, /* 9.9.2.8 PLMN list */
301 /* 9.9.2.9 Spare half octet */
302 { 0x00, "Supported codec list" }, /* 9.9.2.10 Supported codec list */
305 /* Utility functions */
307 calc_bitrate(guint8 value){
308 guint16 return_value = value;
310 if (value > 63 && value <= 127) {
311 return_value = 64 + (value - 64) * 8;
313 else if (value > 127 && value <= 254) {
314 return_value = 576 + (value - 128) * 64;
316 else if (value==0xff) {
322 calc_bitrate_ext(guint8 value){
323 guint32 return_value = 0;
325 if (value > 0 && value <= 0x4a) {
326 return_value = 8600 + value * 100;
328 else if (value > 0x4a && value <= 0xba) {
329 return_value = 16 + (value-0x4a);
331 else if (value > 0xba && value <= 0xfa) {
332 return_value = 128 + (value-0xba)*2;
341 #define NUM_NAS_EPS_COMMON_ELEM (sizeof(nas_eps_common_elem_strings)/sizeof(value_string))
342 gint ett_nas_eps_common_elem[NUM_NAS_EPS_COMMON_ELEM];
346 DE_EPS_CMN_EPS_BE_CTX_STATUS, /* 9.9.2.1 EPS bearer context status */
347 DE_EPS_CMN_LOC_AREA_ID, /* 9.9.2.2 Location area identification */
348 DE_EPS_CMN_MOB_ID, /* 9.9.2.3 Mobile identity */
349 DE_EPS_MS_CM_2, /* 9.9.2.4 Mobile station classmark 2 */
350 DE_EPS_MS_CM_3, /* 9.9.2.5 Mobile station classmark 3 */
351 DE_EPS_NAS_SEC_PAR_FROM_EUTRA, /* 9.9.2.6 NAS security parameters from E-UTRA */
352 DE_EPS_NAS_SEC_PAR_TO_EUTRA, /* 9.9.2.7 NAS security parameters to E-UTRA */
354 DE_EPS_CMN_PLM_LST, /* 9.9.2.8 PLMN list */
355 DE_EPS_CMN_SUP_CODEC_LST, /* 9.9.2.6 9.9.2.10 Supported codec list */
356 DE_EPS_COMMON_NONE /* NONE */
358 nas_eps_common_elem_idx_t;
360 * 9.9.2 Common information elements
364 * 9.9.2.1 EPS bearer context status
366 static const true_false_string nas_eps_emm_ebi_vals = {
367 "BEARER CONTEXT-ACTIVE",
368 "BEARER CONTEXT-INACTIVE"
372 de_eps_cmn_eps_be_ctx_status(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
376 curr_offset = offset;
378 /* EBI(7) EBI(6) EBI(5) EBI(4) EBI(3) EBI(2) EBI(1) EBI(0) octet 3 */
379 proto_tree_add_item(tree, hf_nas_eps_emm_ebi7, tvb, curr_offset, 1, FALSE);
380 proto_tree_add_item(tree, hf_nas_eps_emm_ebi6, tvb, curr_offset, 1, FALSE);
381 proto_tree_add_item(tree, hf_nas_eps_emm_ebi5, tvb, curr_offset, 1, FALSE);
382 /* EBI(0) - EBI(4): Bits 0 to 4 of octet 3 are spare and shall be coded as zero. */
383 proto_tree_add_item(tree, hf_nas_eps_emm_ebi4, tvb, curr_offset, 1, FALSE);
384 proto_tree_add_item(tree, hf_nas_eps_emm_ebi3, tvb, curr_offset, 1, FALSE);
385 proto_tree_add_item(tree, hf_nas_eps_emm_ebi2, tvb, curr_offset, 1, FALSE);
386 proto_tree_add_item(tree, hf_nas_eps_emm_ebi1, tvb, curr_offset, 1, FALSE);
387 proto_tree_add_item(tree, hf_nas_eps_emm_ebi0, tvb, curr_offset, 1, FALSE);
389 /* EBI(15) EBI(14) EBI(13) EBI(12) EBI(11) EBI(10) EBI(9) EBI(8) octet 4 */
390 proto_tree_add_item(tree, hf_nas_eps_emm_ebi15, tvb, curr_offset, 1, FALSE);
391 proto_tree_add_item(tree, hf_nas_eps_emm_ebi14, tvb, curr_offset, 1, FALSE);
392 proto_tree_add_item(tree, hf_nas_eps_emm_ebi13, tvb, curr_offset, 1, FALSE);
393 proto_tree_add_item(tree, hf_nas_eps_emm_ebi12, tvb, curr_offset, 1, FALSE);
394 proto_tree_add_item(tree, hf_nas_eps_emm_ebi11, tvb, curr_offset, 1, FALSE);
395 proto_tree_add_item(tree, hf_nas_eps_emm_ebi10, tvb, curr_offset, 1, FALSE);
396 proto_tree_add_item(tree, hf_nas_eps_emm_ebi9, tvb, curr_offset, 1, FALSE);
397 proto_tree_add_item(tree, hf_nas_eps_emm_ebi8, tvb, curr_offset, 1, FALSE);
402 * 9.9.2.2 Location area identification
403 * See subclause 10.5.1.3 in 3GPP TS 24.008 [6].
406 * 9.9.2.3 Mobile identity
407 * See subclause 10.5.1.4 in 3GPP TS 24.008 [6].
408 * exported from gsm_a_common
412 * 9.9.2.4 Mobile station classmark 2
413 * See subclause 10.5.1.6 in 3GPP TS 24.008 [13].
416 * 9.9.2.5 Mobile station classmark 3
417 * See subclause 10.5.1.7 in 3GPP TS 24.008 [13].
421 * See subclause 10.5.1.13 in 3GPP TS 24.008 [6].
424 * 9.9.2.7 Spare half octet
425 * This element is used in the description of EMM and ESM messages when an odd number of
426 * half octet type 1 information elements are used. This element is filled with spare bits
427 * set to zero and is placed in bits 5 to 8 of the octet unless otherwise specified.
432 * 9.9.2.6 NAS security parameters from E-UTRA
435 de_sec_par_from_eutra(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
439 curr_offset = offset;
441 /* DL NAS COUNT value (short) (octet 2, bit 1 to 4)
442 * This field contains the 4 least significant bits of the binary representation of the downlink
443 * NAS COUNT value applicable when this information element is sent.
445 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 4, FALSE);
446 proto_tree_add_item(tree, hf_nas_eps_emm_dl_nas_cnt, tvb, curr_offset, 1, FALSE);
452 * 9.9.2.7 NAS security parameters to E-UTRA
455 de_sec_par_to_eutra(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
459 curr_offset = offset;
460 /* NonceMME value (octet 1 to 5)
461 * This field is coded as the nonce value in the Nonce information element (see subclause 9.9.3.25).
463 proto_tree_add_item(tree, hf_nas_eps_emm_nounce_mme, tvb, curr_offset, 1, FALSE);
465 /* type of ciphering algorithm (octet 6, bit 5 to 7)
466 * These fields are coded as the type of integrity protection algorithm and type of ciphering algorithm
467 * in the NAS security algorithms information element (see subclause 9.9.3.23).
468 * Bit 4 and 8 of octet 6 are spare and shall be coded as zero.
470 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 1, FALSE);
471 proto_tree_add_item(tree, hf_nas_eps_emm_toc, tvb, curr_offset, 1, FALSE);
472 /* Type of integrity protection algorithm (octet 6, bit 1 to 3)*/
473 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+4, 1, FALSE);
474 proto_tree_add_item(tree, hf_nas_eps_emm_toi, tvb, curr_offset, 1, FALSE);
477 * NAS key set identifier (octet 7, bit 1 to 3) and
478 * type of security context flag (TSC) (octet 7, bit 4)
479 * These fields are coded as the NAS key set identifier and type of security context flag in the
480 * NAS key set identifier information element (see subclause 9.9.3.21).
481 * Bit 5 to 8 of octet 7 are spare and shall be coded as zero.
483 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 4, FALSE);
484 /* Type of security context flag (TSC) V 1/2 */
485 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, (curr_offset<<3)+4, 1, FALSE);
486 /* NAS key set identifier */
487 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, (curr_offset<<3)+5, 3, FALSE);
493 * 9.9.2.10 Supported codec list
494 * See subclause 10.5.4.32 in 3GPP TS 24.008 [13].
495 * Dissectecd in packet-gsm_a_dtap.c
498 guint16 (*nas_eps_common_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
499 /* 9.9.2 Common information elements */
500 de_eps_cmn_eps_be_ctx_status, /* 9.9.2.1 EPS bearer context status */
501 de_lai, /* 9.9.2.2 Location area identification */
502 de_mid, /* 9.9.2.3 Mobile identity See subclause 10.5.1.4 in 3GPP TS 24.008*/
503 de_ms_cm_2, /* 9.9.2.4 Mobile station classmark 2 */
504 de_ms_cm_3, /* 9.9.2.5 Mobile station classmark 3 */
505 de_sec_par_from_eutra, /* 9.9.2.6 NAS security parameters from E-UTRA */
506 de_sec_par_to_eutra, /* 9.9.2.7 NAS security parameters to E-UTRA */
508 de_plmn_list, /* 9.9.2.8 PLMN list */
509 NULL, /* 9.9.2.10 Supported codec list (packet-gsm_a_dtap.c) */
513 const value_string nas_emm_elem_strings[] = {
514 /* 9.9.3 EPS Mobility Management (EMM) information elements */
515 { 0x00, "Additional update result" }, /* 9.9.3.0A Additional update result */
516 { 0x00, "Additional update type" }, /* 9.9.3.0B Additional update type */
517 { 0x00, "Authentication failure parameter" }, /* 9.9.3.1 Authentication failure parameter */
518 { 0x00, "Authentication parameter AUTN" }, /* 9.9.3.2 Authentication parameter AUTN */
519 { 0x00, "Authentication parameter RAND" }, /* 9.9.3.3 Authentication parameter RAND */
520 { 0x00, "Authentication response parameter" }, /* 9.9.3.4 Authentication response parameter */
521 { 0x00, "CSFB response" }, /* 9.9.3.5 CSFB response */
522 { 0x00, "Daylight saving time" }, /* 9.9.3.6 Daylight saving time */
523 { 0x00, "Detach type" }, /* 9.9.3.7 Detach type */
524 { 0x00, "DRX parameter" }, /* 9.9.3.8 DRX parameter */
525 { 0x00, "EMM cause" }, /* 9.9.3.9 EMM cause */
526 { 0x00, "EPS attach result" }, /* 9.9.3.10 EPS attach result */
527 { 0x00, "EPS attach type" }, /* 9.9.3.11 EPS attach type */
528 { 0x00, "EPS mobile identity" }, /* 9.9.3.12 EPS mobile identity */
529 { 0x00, "EPS network feature support" }, /* 9.9.3.12 EPS mobile identity */
530 { 0x00, "EPS update result" }, /* 9.9.3.13 EPS update result */
531 { 0x00, "EPS update type" }, /* 9.9.3.14 EPS update type */
532 { 0x00, "ESM message container" }, /* 9.9.3.15 ESM message conta */
533 { 0x00, "GPRS timer" }, /* 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. */
534 { 0x00, "Identity type 2" }, /* 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. */
535 { 0x00, "IMEISV request" }, /* 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. */
536 { 0x00, "KSI and sequence number" }, /* 9.9.3.19 KSI and sequence number */
537 { 0x00, "MS network capability" }, /* 9.9.3.20 MS network capability ,See subclause 10.5.5.12 in 3GPP TS 24.008 [6]. */
538 { 0x00, "NAS key set identifier" }, /* 9.9.3.21 NAS key set identifier */
539 { 0x00, "NAS message container" }, /* 9.9.3.22 NAS message container */
540 { 0x00, "NAS security algorithms" }, /* 9.9.3.23 NAS security algorithms */
541 { 0x00, "Network name" }, /* 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. */
542 { 0x00, "Nonce" }, /* 9.9.3.25 Nonce */
543 { 0x00, "Paging identity" }, /* 9.9.3.25A Paging identity */
544 { 0x00, "P-TMSI signature" }, /* 9.9.3.26 P-TMSI signature, See subclause 10.5.5.8 in 3GPP TS 24.008 [6]. */
545 { 0x00, "Service type" }, /* 9.9.3.27 Service type ,See subclause 10.5.5.15 in 3GPP TS 24.008 [6]. */
546 { 0x00, "Short MAC" }, /* 9.9.3.28 Short MAC */
547 { 0x00, "Time zone" }, /* 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. */
548 { 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]. */
549 { 0x00, "TMSI status" }, /* 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. */
550 { 0x00, "Tracking area identity" }, /* 9.9.3.32 Tracking area identity */
551 { 0x00, "Tracking area identity list" }, /* 9.9.3.33 Tracking area identity list */
552 { 0x00, "UE network capability" }, /* 9.9.3.34 UE network capability */
553 { 0x00, "UE radio capability information update needed" }, /* 9.9.3.35 UE radio capability information update needed */
554 { 0x00, "UE security capability" }, /* 9.9.3.36 UE security capability */
555 { 0x00, "Emergency Number List" }, /* 9.9.3.37 Emergency Number List */
556 { 0x00, "CLI" }, /* 9.9.3.38 CLI */
557 { 0x00, "SS Code" }, /* 9.9.3.39 SS Code */
558 { 0x00, "LCS indicator" }, /* 9.9.3.40 LCS indicator */
559 { 0x00, "LCS client identity" }, /* 9.9.3.41 LCS client identity */
563 #define NUM_NAS_EMM_ELEM (sizeof(nas_emm_elem_strings)/sizeof(value_string))
564 gint ett_nas_eps_emm_elem[NUM_NAS_EMM_ELEM];
567 This enum has been moved to packet-gsm_a_common to
568 make it possible to use element dissecton from this dissector
570 It is left here as a comment for easier reference.
572 Note this enum must be of the same size as the element decoding list
576 /. 9.9.3 EPS Mobility Management (EMM) information elements ./
577 DE_EMM_ADD_UPD_RES, /. 9.9.3.0A Additional update result ./
578 DE_EMM_ADD_UPD_TYPE, /. 9.9.3.0B Additional update type ./
579 DE_EMM_AUTH_FAIL_PAR, /. 9.9.3.1 Authentication failure parameter (dissected in packet-gsm_a_dtap.c)./
580 DE_EMM_AUTN, /. 9.9.3.2 Authentication parameter AUTN ./
581 DE_EMM_AUTH_PAR_RAND, /. 9.9.3.3 Authentication parameter RAND ./
582 DE_EMM_AUTH_RESP_PAR, /. 9.9.3.4 Authentication response parameter ./
583 DE_EMM_CSFB_RESP, /. 9.9.3.5 CSFB response ./
584 DE_EMM_DAYL_SAV_T, /. 9.9.3.6 Daylight saving time ./
585 DE_EMM_DET_TYPE, /. 9.9.3.7 Detach type ./
586 DE_EMM_DRX_PAR, /. 9.9.3.8 DRX parameter (dissected in packet-gsm_a_gm.c)./
587 DE_EMM_CAUSE, /. 9.9.3.9 EMM cause ./
588 DE_EMM_ATT_RES, /. 9.9.3.10 EPS attach result (Coded inline ./
589 DE_EMM_ATT_TYPE, /. 9.9.3.11 EPS attach type (Coded Inline)./
590 DE_EMM_EPS_MID, /. 9.9.3.12 EPS mobile identity ./
591 DE_EMM_EPS_NET_FEATURE_SUP, /. 9.9.3.12A EPS network feature support ./
592 DE_EMM_EPS_UPD_RES, /. 9.9.3.13 EPS update result ( Coded inline)./
593 DE_EMM_EPS_UPD_TYPE, /. 9.9.3.14 EPS update type ./
594 DE_EMM_ESM_MSG_CONT, /. 9.9.3.15 ESM message conta ./
595 DE_EMM_GPRS_TIMER, /. 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. ./
596 DE_EMM_ID_TYPE_2, /. 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. ./
597 DE_EMM_IMEISV_REQ, /. 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. ./
598 DE_EMM_KSI_AND_SEQ_NO, /. 9.9.3.19 KSI and sequence number ./
599 DE_EMM_MS_NET_CAP, /. 9.9.3.20 MS network capability ,See subclause 10.5.5.12 in 3GPP TS 24.008 [6]. ./
600 DE_EMM_NAS_KEY_SET_ID, /. 9.9.3.21 NAS key set identifier (coded inline)./
601 DE_EMM_NAS_MSG_CONT, /. 9.9.3.22 NAS message container ./
602 DE_EMM_NAS_SEC_ALGS, /. 9.9.3.23 NAS security algorithms ./
603 DE_EMM_NET_NAME, /. 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. ./
604 DE_EMM_NONCE, /. 9.9.3.25 Nonce ./
605 DE_EMM_PAGING_ID, /. 9.9.3.25A Paging identity ./
606 DE_EMM_P_TMSI_SIGN, /. 9.9.3.26 P-TMSI signature, See subclause 10.5.5.8 in 3GPP TS 24.008 [6]. ./
607 DE_EMM_SERV_TYPE, /. 9.9.3.27 Service type ./
608 DE_EMM_SHORT_MAC, /. 9.9.3.28 Short MAC ./
609 DE_EMM_TZ, /. 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. ./
610 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]. ./
611 DE_EMM_TMSI_STAT, /. 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. ./
612 DE_EMM_TRAC_AREA_ID, /. 9.9.3.32 Tracking area identity ./
613 DE_EMM_TRAC_AREA_ID_LST, /. 9.9.3.33 Tracking area identity list ./
614 DE_EMM_UE_NET_CAP, /. 9.9.3.34 UE network capability ./
615 DE_EMM_UE_RA_CAP_INF_UPD_NEED, /. 9.9.3.35 UE radio capability information update needed ./
616 DE_EMM_UE_SEC_CAP, /. 9.9.3.36 UE security capability ./
617 DE_EMM_EMERG_NUM_LST, /. 9.9.3.37 Emergency Number List ./
618 DE_EMM_CLI, /. 9.9.3.38 CLI ./
619 DE_EMM_SS_CODE, /. 9.9.3.39 SS Code ./
620 DE_EMM_LCS_IND, /. 9.9.3.40 LCS indicator ./
621 DE_EMM_LCS_CLIENT_ID, /. 9.9.3.41 LCS client identity ./
622 DE_EMM_GEN_MSG_CONT_TYPE, /. 9.9.3.42 Generic message container type ./
623 DE_EMM_GEN_MSG_CONT, /. 9.9.3.43 Generic message container ./
624 DE_EMM_VOICE_DMN_PREF, /. 9.9.3.44 Voice domain preference and UEs usage setting ./
625 DE_EMM_NONE /. NONE ./
631 /* TODO: Update to latest spec */
632 /* 9.9.3 EPS Mobility Management (EMM) information elements
635 * 9.9.3.0A Additional update result
637 static const value_string nas_eps_emm_add_upd_res_vals[] = {
638 { 0x0, "no additional information"},
639 { 0x1, "CS Fallback not preferred"},
645 de_emm_add_upd_res(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
647 guint32 curr_offset, bit_offset;
649 curr_offset = offset;
650 bit_offset = (curr_offset<<3)+4;
652 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 2, FALSE);
654 proto_tree_add_bits_item(tree, hf_nas_eps_emm_add_upd_res, tvb, bit_offset, 2, FALSE);
657 return (curr_offset - offset);
660 * 9.9.3.0B Additional update type
662 static const value_string nas_eps_emm_add_upd_type_vals[] = {
663 { 0x0, "no additional information (shall be interpreted as request for combined attach or combined tracking area updating)"},
668 de_emm_add_upd_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
670 guint32 curr_offset, bit_offset;
672 curr_offset = offset;
673 bit_offset = (curr_offset<<3)+4;
675 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 3, FALSE);
677 proto_tree_add_bits_item(tree, hf_nas_eps_emm_add_upd_type, tvb, bit_offset, 1, FALSE);
680 return (curr_offset - offset);
683 * 9.9.3.1 Authentication failure parameter
684 * See subclause 10.5.3.2.2 in 3GPP TS 24.008 [6].
685 * (dissected in packet-gsm_a_dtap.c)
688 * 9.9.3.2 Authentication parameter AUTN
689 * See subclause 10.5.3.1.1 in 3GPP TS 24.008 [6].
692 * 9.9.3.3 Authentication parameter RAND
693 * See subclause 10.5.3.1 in 3GPP TS 24.008 [6].
696 * 9.9.3.4 Authentication response parameter
699 de_emm_auth_resp_par(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
703 curr_offset = offset;
705 proto_tree_add_item(tree, hf_nas_eps_emm_res, tvb, curr_offset, len, FALSE);
710 * 9.9.3.4A Ciphering key sequence number
711 * See subclause 9.9.3.19 in 3GPP TS 24.008 [13].
715 * 9.9.3.5 CSFB response
719 * CSFB response value (octet 1)
722 static const value_string nas_eps_emm_csfb_resp_vals[] = {
723 { 0x0, "CS fallback rejected by the UE"},
724 { 0x1, "CS fallback accepted by the UE"},
729 de_emm_csfb_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
731 guint32 curr_offset, bit_offset;
733 curr_offset = offset;
736 bit_offset = curr_offset<<3;
737 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset+4, 1, FALSE);
739 proto_tree_add_item(tree, hf_nas_eps_emm_csfb_resp, tvb, curr_offset, 1, FALSE);
742 return(curr_offset-offset);
745 * 9.9.3.6 Daylight saving time
746 * See subclause 10.5.3.12 in 3GPP TS 24.008 [6].
749 * 9.9.3.7 Detach type
752 static const value_string nas_eps_emm_switch_off_vals[] = {
753 { 0x0, "Normal detach"},
754 { 0x1, "Switch off"},
757 /* Type of detach (octet 1)
758 * In the UE to network direction:
760 static const value_string nas_eps_emm_type_of_dtatch_UL_vals[] = {
761 { 0x1, "EPS detach"},
762 { 0x2, "IMSI detach"},
763 { 0x3, "Combined EPS/IMSI detach"},
764 { 0x4, "Combined EPS/IMSI detach"}, /* All other values are interpreted as "combined EPS/IMSI detach" in this version of the protocol.*/
765 { 0x5, "Combined EPS/IMSI detach"}, /* -"- */
772 * In the network to UE direction:
775 static const value_string nas_eps_emm_type_of_dtatch_DL_vals[] = {
776 { 0x1, "Re-attach required"},
777 { 0x2, "Re-attach not required"},
778 { 0x3, "IMSI detach"},
779 { 0x4, "IMSI detach"}, /* All other values are interpreted as "re-attach not required" in this version of the protocol.*/
780 { 0x5, "IMSI detach"}, /* -"- */
787 * 9.9.3.8 DRX parameter
788 * See subclause 10.5.5.6 in 3GPP TS 24.008 [13].
793 static const value_string nas_eps_emm_cause_values[] = {
794 { 0x2, "IMSI unknown in HLR"},
795 { 0x3, "Illegal MS"},
796 { 0x6, "Illegal ME"},
797 { 0x7, "EPS services not allowed"},
798 { 0x8, "EPS services and non-EPS services not allowed"},
799 { 0x9, "UE identity cannot be derived by the network"},
800 { 0xa, "Implicitly detached"},
801 { 0xb, "PLMN not allowed"},
802 { 0xc, "Tracking Area not allowed"},
803 { 0xd, "Roaming not allowed in this tracking area"},
804 { 0xe, "EPS services not allowed in this PLMN"},
805 { 0xf, "No Suitable Cells In tracking area"},
806 { 0x10, "MSC temporarily not reachable"},
807 { 0x11, "Network failure"},
808 { 0x12, "CS domain not available"},
809 { 0x13, "ESM failure"},
810 { 0x14, "MAC failure"},
811 { 0x15, "Synch failure"},
812 { 0x16, "Congestion"},
813 { 0x17, "UE security capabilities mismatch"},
814 { 0x18, "Security mode rejected, unspecified"},
815 { 0x19, "Not authorized for this CSG"},
816 { 0x1a, "Non-EPS authentication unacceptable"},
817 { 0x26, "CS fallback call establishment not allowed"},
818 { 0x27, "CS domain temporarily not available"},
819 { 0x28, "No EPS bearer context activated"},
820 { 0x5f, "Semantically incorrect message"},
821 { 0x60, "Invalid mandatory information"},
822 { 0x61, "Message type non-existent or not implemented"},
823 { 0x62, "Message type not compatible with the protocol state"},
824 { 0x63, "Information element non-existent or not implemented"},
825 { 0x64, "Conditional IE error"},
826 { 0x65, "Message not compatible with the protocol state"},
827 { 0x6f, "Protocol error, unspecified"},
832 de_emm_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
836 curr_offset = offset;
838 proto_tree_add_item(tree, hf_nas_eps_emm_cause, tvb, curr_offset, 1, FALSE);
841 return curr_offset-offset;}
843 * 9.9.3.10 EPS attach result
846 static const value_string nas_eps_emm_EPS_attach_result_values[] = {
849 { 2, "Combined EPS/IMSI attach"},
860 * 9.9.3.11 EPS attach type
863 static const value_string nas_eps_emm_eps_att_type_vals[] = {
864 { 0, "EPS attach(unused)"},
866 { 2, "Combined handover EPS/IMSI attach"},
867 { 3, "EPS attach(unused)"},
868 { 4, "EPS attach(unused)"},
869 { 5, "EPS attach(unused)"},
870 { 6, "EPS emergency attach"},
877 * 9.9.3.12 EPS mobile identity
880 unpack_eps_mid_digits(tvbuff_t *tvb) {
888 length = tvb_length(tvb);
890 digit_str = ep_alloc(length*2);
892 /* Get identity digit 1 */
893 octet = tvb_get_guint8(tvb,offset);
894 digit_str[i++] = (((octet>>4) & 0x0f) + '0');
897 /* Loop on following octets to retrieve other identity digits */
898 while ( offset < length ){
900 octet = tvb_get_guint8(tvb,offset);
901 digit_str[i] = ((octet & 0x0f) + '0');
905 * unpack second value in byte
909 if (octet == 0x0f) /* odd number bytes - hit filler */
912 digit_str[i] = ((octet & 0x0f) + '0');
921 static const value_string nas_eps_emm_type_of_id_vals[] = {
933 de_emm_eps_mid(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
940 curr_offset = offset;
942 octet = tvb_get_guint8(tvb,offset);
943 /* Type of identity (octet 3) */
944 proto_tree_add_item(tree, hf_nas_eps_emm_odd_even, tvb, curr_offset, 1, FALSE);
945 proto_tree_add_item(tree, hf_nas_eps_emm_type_of_id, tvb, curr_offset, 1, FALSE);
949 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
950 digit_str = unpack_eps_mid_digits(new_tvb);
951 proto_tree_add_string(tree, hf_nas_eps_emm_imsi, new_tvb, 0, -1, digit_str);
955 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
956 digit_str = unpack_eps_mid_digits(new_tvb);
957 proto_tree_add_string(tree, hf_nas_eps_emm_imei, new_tvb, 0, -1, digit_str);
962 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
963 /* MME Group ID octet 7 - 8 */
964 proto_tree_add_item(tree, hf_nas_eps_emm_mme_grp_id, tvb, curr_offset, 2, FALSE);
966 /* MME Code Octet 9 */
967 proto_tree_add_item(tree, hf_nas_eps_emm_mme_code, tvb, curr_offset, 1, FALSE);
969 /* M-TMSI Octet 10 - 13 */
970 proto_tree_add_item(tree, hf_nas_eps_emm_m_tmsi, tvb, curr_offset, 4, FALSE);
974 proto_tree_add_text(tree, tvb, curr_offset, len - 1, "Type of identity not known");
982 * 9.9.3.12A EPS network feature support
984 static const value_string nas_eps_emm_cs_lcs_vals[] = {
985 { 0, "no information about support of location services via CS domain is available"},
986 { 1, "location services via CS domain not supported"},
987 { 2, "location services via CS domain supported"},
991 static const true_false_string nas_eps_emm_epc_lcs_value = {
992 "location services via EPC supported",
993 "location services via EPC not supported"
995 static const true_false_string nas_eps_emm_emc_bs_value = {
996 "emergency bearer services in S1 mode supported",
997 "emergency bearer services in S1 mode not supported"
999 static const true_false_string nas_eps_emm_ims_vops_value = {
1000 "IMS voice over PS session in S1 mode supported",
1001 "IMS voice over PS session in S1 mode not supported"
1005 de_emm_eps_net_feature_sup(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1007 guint32 curr_offset, bit_offset;
1009 curr_offset = offset;
1010 bit_offset = curr_offset << 3;
1011 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 3, FALSE);
1013 proto_tree_add_bits_item(tree, hf_nas_eps_emm_cs_lcs_type, tvb, bit_offset, 2, FALSE);
1015 proto_tree_add_bits_item(tree, hf_nas_eps_emm_epc_lcs_type, tvb, bit_offset, 1, FALSE);
1017 proto_tree_add_bits_item(tree, hf_nas_eps_emm_emc_bs_type, tvb, bit_offset, 1, FALSE);
1019 proto_tree_add_bits_item(tree, hf_nas_eps_emm_ims_vops_type, tvb, bit_offset, 1, FALSE);
1025 * 9.9.3.13 EPS update result
1027 static const value_string nas_eps_emm_eps_update_result_vals[] = {
1029 { 1, "Combined TA/LA updated"},
1030 { 2, "TA updated and ISR activated"},
1031 { 3, "Combined TA/LA updated and ISR activated"},
1036 * 9.9.3.14 EPS update type
1038 static const true_false_string nas_eps_emm_active_flg_value = {
1039 "Bearer establishment requested",
1040 "No bearer establishment requested"
1043 static const value_string nas_eps_emm_eps_update_type_vals[] = {
1044 { 0, "TA updating"},
1045 { 1, "Combined TA/LA updating"},
1046 { 2, "Combined TA/LA updating with IMSI attach"},
1047 { 3, "Periodic updating"},
1048 { 4, "unused; shall be interpreted as 'TA updating', if received by the network"},
1049 { 5, "unused; shall be interpreted as 'TA updating', if received by the network"},
1054 * 9.9.3.15 ESM message container
1057 de_emm_esm_msg_cont(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1060 proto_tree *sub_tree;
1062 guint32 curr_offset;
1064 curr_offset = offset;
1067 item = proto_tree_add_item(tree, hf_nas_eps_esm_msg_cont, tvb, curr_offset, len, FALSE);
1068 sub_tree = proto_item_add_subtree(item, ett_nas_eps_esm_msg_cont);
1070 /* This IE can contain any ESM PDU as defined in subclause 8.3. */
1071 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1072 /* Plain NAS message */
1073 disect_nas_eps_esm_msg(new_tvb, gpinfo, sub_tree, 0/* offset */);
1078 * 9.9.3.16 GPRS timer
1079 * See subclause 10.5.7.3 in 3GPP TS 24.008 [6].
1083 * 9.9.3.17 Identity type 2
1084 * See subclause 10.5.5.9 in 3GPP TS 24.008 [6].
1086 static const value_string nas_eps_emm_id_type2_vals[] = {
1095 * 9.9.3.18 IMEISV request
1096 * See subclause 10.5.5.10 in 3GPP TS 24.008 [6].
1098 /* IMEISV request value (octet 1) */
1099 static const value_string nas_eps_emm_imeisv_req_vals[] = {
1100 { 0, "IMEISV not requested"},
1101 { 1, "IMEISV requested"},
1102 { 2, "IMEISV not requested"},
1103 { 3, "IMEISV not requested"},
1104 { 4, "IMEISV not requested"},
1105 { 5, "IMEISV not requested"},
1106 { 6, "IMEISV not requested"},
1107 { 7, "IMEISV not requested"},
1111 de_emm_nas_imeisv_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1113 guint32 curr_offset;
1116 curr_offset = offset;
1118 bit_offset = curr_offset<<3;
1120 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, FALSE);
1121 proto_tree_add_item(tree, hf_nas_eps_esm_imeisv_req, tvb, curr_offset, 1, FALSE);
1124 return(curr_offset - offset);
1127 * 9.9.3.19 KSI and sequence number
1130 de_emm_nas_ksi_and_seq_no(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1132 guint32 curr_offset;
1135 curr_offset = offset;
1136 bit_offset = curr_offset<<3;
1138 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, FALSE);
1140 proto_tree_add_bits_item(tree, hf_nas_eps_seq_no_short, tvb, bit_offset, 5, FALSE);
1143 return(curr_offset - offset);
1147 * 9.9.3.20 MS network capability
1148 * See subclause 10.5.5.12 in 3GPP TS 24.008 [6].
1151 * 9.9.3.21 NAS key set identifier
1154 * Type of security context flag (TSC) (octet 1)
1156 static const value_string nas_eps_tsc_vals[] = {
1157 { 0, "Native security context"},
1158 { 1, "Mapped security context"},
1162 /* NAS key set identifier (octet 1) Bits 3 2 1 */
1164 static const value_string nas_eps_emm_NAS_key_set_identifier_vals[] = {
1172 { 7, "No key is available"},
1176 /* Takes bit offset as input and consumes 4 bits */
1178 de_emm_nas_key_set_id_bits(tvbuff_t *tvb, proto_tree *tree, guint32 bit_offset, const gchar *add_string)
1182 /* Type of security context flag (TSC) (octet 1) V 1/2 */
1183 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, bit_offset, 1, FALSE);
1185 /* NAS key set identifier (octet 1) */
1186 item = proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, FALSE);
1188 proto_item_append_text(item, "%s", add_string);
1193 * Note used for TV Short
1196 de_emm_nas_key_set_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1198 guint32 curr_offset, bit_offset;
1200 curr_offset = offset;
1202 /* Get the bit offset of the lover half of the octet bits 4 - 1 */
1203 bit_offset = curr_offset<<3;
1206 /* Type of security context flag (TSC) (octet 1) V 1/2 */
1207 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, bit_offset, 1, FALSE);
1209 /* NAS key set identifier (octet 1) */
1210 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, FALSE);
1214 return(curr_offset - offset);
1218 * 9.9.3.22 NAS message container
1221 de_emm_nas_msg_cont(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1224 guint32 curr_offset;
1226 curr_offset = offset;
1229 /* NAS message container contents (octet 3 to octet n)
1230 * This IE can contain an SMS message (i.e. CP-DATA, CP-ACK or CP-ERROR)
1231 * as defined in subclause 7.2 in 3GPP TS 24.011 [13A].
1234 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1235 if(gsm_a_dtap_handle)
1236 call_dissector(gsm_a_dtap_handle,new_tvb, gpinfo, tree);
1241 * 9.9.3.23 NAS security algorithms
1243 /* Type of integrity protection algorithm (octet 2, bit 1 to 3) */
1244 static const value_string nas_eps_emm_toi_vals[] = {
1245 { 0, "EPS integrity algorithm EIA0 (null integrity protection algorithm)"},
1246 { 1, "EPS integrity algorithm 128-EIA1"},
1247 { 2, "EPS integrity algorithm 128-EIA2"},
1248 { 3, "EPS integrity algorithm EIA3"},
1249 { 4, "EPS integrity algorithm EIA4"},
1250 { 5, "EPS integrity algorithm EIA5"},
1251 { 6, "EPS integrity algorithm EIA6"},
1252 { 7, "EPS integrity algorithm EIA7"},
1256 /* Type of ciphering algorithm (octet 2, bit 5 to 7) */
1258 static const value_string nas_eps_emm_toc_vals[] = {
1259 { 0, "EPS encryption algorithm EEA0 (null ciphering algorithm)"},
1260 { 1, "EPS encryption algorithm 128-EEA1"},
1261 { 2, "EPS encryption algorithm 128-EEA2"},
1262 { 3, "EPS encryption algorithm EEA3"},
1263 { 4, "EPS encryption algorithm EEA4"},
1264 { 5, "EPS encryption algorithm EEA5"},
1265 { 6, "EPS encryption algorithm EEA6"},
1266 { 7, "EPS encryption algorithm EEA7"},
1270 de_emm_nas_sec_alsgs(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1273 guint32 curr_offset;
1275 curr_offset = offset;
1277 bit_offset = offset<<3;
1278 /* Bit 4 and 8 of octet 2 are spare and shall be coded as zero. */
1279 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, FALSE);
1280 /* Type of ciphering algorithm (octet 2, bit 5 to 7) */
1281 proto_tree_add_item(tree, hf_nas_eps_emm_toc, tvb, curr_offset, 1, FALSE);
1283 /* Bit 4 and 8 of octet 2 are spare and shall be coded as zero. */
1284 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, FALSE);
1285 /* Type of integrity protection algorithm (octet 2, bit 1 to 3) */
1286 proto_tree_add_item(tree, hf_nas_eps_emm_toi, tvb, curr_offset, 1, FALSE);
1290 return(curr_offset-offset);
1293 * 9.9.3.24 Network name
1294 * See subclause 10.5.3.5a in 3GPP TS 24.008 [6].
1298 * Editor's note: The coding of this information element is FFS.
1301 de_emm_nonce(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1303 guint32 curr_offset;
1305 curr_offset = offset;
1308 proto_tree_add_text(tree, tvb, curr_offset, 4 , "Nounce");
1314 * 9.9.3.25A Paging identity
1317 de_emm_paging_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1319 guint32 curr_offset;
1321 curr_offset = offset;
1324 proto_tree_add_text(tree, tvb, curr_offset, len , "Paging identity value (Not dissected yet)");
1330 * 9.9.3.26 P-TMSI signature
1331 * See subclause 10.5.5.8 in 3GPP TS 24.008 [6].
1334 * 9.9.3.27 Service type
1336 static const value_string nas_eps_service_type_vals[] = {
1337 { 0, "Mobile originating CS fallback or 1xCS fallback"},
1338 { 1, "Mobile terminating CS fallback or 1xCS fallback"},
1339 { 2, "Mobile originating CS fallback emergency call or 1xCS fallback emergency call"},
1344 * 9.9.3.28 Short MAC
1347 de_emm_nas_short_mac(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1349 guint32 curr_offset;
1351 curr_offset = offset;
1354 proto_tree_add_item(tree, hf_nas_eps_emm_short_mac, tvb, curr_offset, 2, FALSE);
1357 return(curr_offset-offset);
1360 * 9.9.3.29 Time zone
1361 * See subclause 10.5.3.8 in 3GPP TS 24.008 [6].
1364 * 9.9.3.30 Time zone and time
1365 * See subclause 10.5.3.9 in 3GPP TS 24.008 [6].
1368 * 9.9.3.31 TMSI status
1369 * See subclause 10.5.5.4 in 3GPP TS 24.008 [6].
1372 * 9.9.3.32 Tracking area identity
1376 de_emm_trac_area_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1378 guint32 curr_offset;
1380 curr_offset = offset;
1382 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1383 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, FALSE);
1386 return(curr_offset-offset);
1389 * 9.9.3.33 Tracking area identity list
1391 /* Type of list (octet 1)
1394 static const value_string nas_eps_emm_tai_tol_vals[] = {
1395 { 0, "list of TACs belonging to one PLMN, with non-consecutive TAC values"},
1396 { 1, "list of TACs belonging to one PLMN, with consecutive TAC values"},
1397 { 2, "list of TAIs belonging to different PLMNs"},
1402 de_emm_trac_area_id_lst(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1405 guint32 curr_offset;
1406 guint8 octet, tol, n_elem;
1409 curr_offset = offset;
1411 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 1, FALSE);
1412 /* Type of list (octet 1) Bits 7 6 */
1413 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tol, tvb, curr_offset, 1, FALSE);
1414 /* Number of elements (octet 1) Bits 5 4 3 2 1 */
1415 octet = tvb_get_guint8(tvb,curr_offset)& 0x7f;
1417 n_elem = (octet & 0x1f)+1;
1418 item = proto_tree_add_item(tree, hf_nas_eps_emm_tai_n_elem, tvb, curr_offset, 1, FALSE);
1420 proto_item_append_text(item, " [+1 = %u element(s)]", n_elem);
1424 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 )");
1430 /* MCC digit 2 MCC digit 1 octet 2
1431 * MNC digit 3 MCC digit 3 octet 3
1432 * MNC digit 2 MNC digit 1 octet 4
1434 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1435 /* type of list = "000" */
1437 * TAC 1 (continued) octet 6
1441 * TAC k (continued) octet 2k+4*
1443 if (len < (guint)(4+(n_elem*2))){
1444 proto_tree_add_text(tree, tvb, curr_offset, len-1 , "[Wrong number of elements?]");
1447 for (i=0; i < n_elem; i++, curr_offset+=2)
1448 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, FALSE);
1452 /* type of list = "010" */
1453 /* MCC digit 2 MCC digit 1 octet 2
1454 * MNC digit 3 MCC digit 3 octet 3
1455 * MNC digit 2 MNC digit 1 octet 4
1457 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1458 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, FALSE);
1462 if (len< (guint)(1+(n_elem*5))){
1463 proto_tree_add_text(tree, tvb, curr_offset, len-1 , "[Wrong number of elements?]");
1467 for (i=0; i < n_elem; i++){
1468 /* type of list = "001" */
1469 /* MCC digit 2 MCC digit 1 octet 2
1470 * MNC digit 3 MCC digit 3 octet 3
1471 * MNC digit 2 MNC digit 1 octet 4
1473 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1474 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, FALSE);
1479 /* Unknown ( Not in 3GPP TS 24.301 version 8.1.0 Release 8 ) */
1482 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1484 return(curr_offset-offset);
1487 * 9.9.3.34 UE network capability
1490 static const true_false_string nas_eps_emm_supported_flg_value = {
1494 static const true_false_string nas_eps_emm_ucs2_supp_flg_value = {
1495 "The UE has no preference between the use of the default alphabet and the use of UCS2",
1496 "The UE has a preference for the default alphabet"
1498 /* 1xSRVCC capability (octet 7, bit 2) */
1499 static const true_false_string nas_eps_emm_1xsrvcc_cap_flg = {
1500 "SRVCC from E-UTRAN to cdma2000 1xCS supported",
1501 "SRVCC from E-UTRAN to cdma2000 1x CS not supported"
1505 de_emm_ue_net_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1507 guint32 curr_offset;
1509 curr_offset = offset;
1512 /* EPS encryption algorithms supported (octet 3) */
1513 /* EPS encryption algorithm EEA0 supported (octet 3, bit 8) */
1514 proto_tree_add_item(tree, hf_nas_eps_emm_eea0, tvb, curr_offset, 1, FALSE);
1515 /* EPS encryption algorithm 128-EEA1 supported (octet 3, bit 7) */
1516 proto_tree_add_item(tree, hf_nas_eps_emm_128eea1, tvb, curr_offset, 1, FALSE);
1517 /* EPS encryption algorithm 128-EEA2 supported (octet 3, bit 6) */
1518 proto_tree_add_item(tree, hf_nas_eps_emm_128eea2, tvb, curr_offset, 1, FALSE);
1519 /* EPS encryption algorithm 128-EEA3 supported (octet 3, bit 5) */
1520 proto_tree_add_item(tree, hf_nas_eps_emm_eea3, tvb, curr_offset, 1, FALSE);
1521 /* EPS encryption algorithm 128-EEA4 supported (octet 3, bit 4) */
1522 proto_tree_add_item(tree, hf_nas_eps_emm_eea4, tvb, curr_offset, 1, FALSE);
1523 /* EPS encryption algorithm 128-EEA5 supported (octet 3, bit 5) */
1524 proto_tree_add_item(tree, hf_nas_eps_emm_eea5, tvb, curr_offset, 1, FALSE);
1525 /* EPS encryption algorithm 128-EEA6 supported (octet 3, bit 6) */
1526 proto_tree_add_item(tree, hf_nas_eps_emm_eea6, tvb, curr_offset, 1, FALSE);
1527 /* EPS encryption algorithm 128-EEA7 supported (octet 3, bit 7) */
1528 proto_tree_add_item(tree, hf_nas_eps_emm_eea7, tvb, curr_offset, 1, FALSE);
1532 /* EPS integrity algorithms supported (octet 4) */
1533 /* EPS integrity algorithm EIA0 supported (octet 4, bit 8) */
1534 proto_tree_add_item(tree, hf_nas_eps_emm_eia0, tvb, curr_offset, 1, FALSE);
1535 /* EPS integrity algorithm 128-EIA1 supported (octet 4, bit 7) */
1536 proto_tree_add_item(tree, hf_nas_eps_emm_128eia1, tvb, curr_offset, 1, FALSE);
1537 /* EPS integrity algorithm 128-EIA2 supported (octet 4, bit 6) */
1538 proto_tree_add_item(tree, hf_nas_eps_emm_128eia2, tvb, curr_offset, 1, FALSE);
1539 /* EPS integrity algorithm EIA3 supported (octet 4, bit 5) */
1540 proto_tree_add_item(tree, hf_nas_eps_emm_eia3, tvb, curr_offset, 1, FALSE);
1541 /* EPS integrity algorithm EIA4 supported (octet 4, bit 4) */
1542 proto_tree_add_item(tree, hf_nas_eps_emm_eia4, tvb, curr_offset, 1, FALSE);
1543 /* EPS integrity algorithm EIA5 supported (octet 4, bit 3) */
1544 proto_tree_add_item(tree, hf_nas_eps_emm_eia5, tvb, curr_offset, 1, FALSE);
1545 /* EPS integrity algorithm EIA6 supported (octet 4, bit 2) */
1546 proto_tree_add_item(tree, hf_nas_eps_emm_eia6, tvb, curr_offset, 1, FALSE);
1547 /* EPS integrity algorithm EIA7 supported (octet 4, bit 1) */
1548 proto_tree_add_item(tree, hf_nas_eps_emm_eia7, tvb, curr_offset, 1, FALSE);
1552 /* Following octets are optional */
1553 if ((curr_offset - offset) >= len)
1556 /* UMTS encryption algorithms supported (octet 5)
1557 * UMTS encryption algorithm UEA0 supported (octet 5, bit 8)
1559 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 8) */
1560 proto_tree_add_item(tree, hf_nas_eps_emm_uea0, tvb, curr_offset, 1, FALSE);
1561 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 7) */
1562 proto_tree_add_item(tree, hf_nas_eps_emm_uea1, tvb, curr_offset, 1, FALSE);
1563 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 6) */
1564 proto_tree_add_item(tree, hf_nas_eps_emm_uea2, tvb, curr_offset, 1, FALSE);
1565 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 5) */
1566 proto_tree_add_item(tree, hf_nas_eps_emm_uea3, tvb, curr_offset, 1, FALSE);
1567 /* EPS encryption algorithm 128-UEA0 supported (octet 5, bit 4) */
1568 proto_tree_add_item(tree, hf_nas_eps_emm_uea4, tvb, curr_offset, 1, FALSE);
1569 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 5) */
1570 proto_tree_add_item(tree, hf_nas_eps_emm_uea5, tvb, curr_offset, 1, FALSE);
1571 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 6) */
1572 proto_tree_add_item(tree, hf_nas_eps_emm_uea6, tvb, curr_offset, 1, FALSE);
1573 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 7) */
1574 proto_tree_add_item(tree, hf_nas_eps_emm_uea7, tvb, curr_offset, 1, FALSE);
1577 if ((curr_offset - offset) >= len)
1580 /* UCS2 support (UCS2) (octet 6, bit 8)
1581 * This information field indicates the likely treatment of UCS2 encoded character strings
1584 proto_tree_add_item(tree, hf_nas_eps_emm_ucs2_supp, tvb, curr_offset, 1, FALSE);
1585 /* UMTS integrity algorithms supported (octet 6) */
1586 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 7) */
1587 proto_tree_add_item(tree, hf_nas_eps_emm_uia1, tvb, curr_offset, 1, FALSE);
1588 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 6) */
1589 proto_tree_add_item(tree, hf_nas_eps_emm_uia2, tvb, curr_offset, 1, FALSE);
1590 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 5) */
1591 proto_tree_add_item(tree, hf_nas_eps_emm_uia3, tvb, curr_offset, 1, FALSE);
1592 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 4) */
1593 proto_tree_add_item(tree, hf_nas_eps_emm_uia4, tvb, curr_offset, 1, FALSE);
1594 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 3) */
1595 proto_tree_add_item(tree, hf_nas_eps_emm_uia5, tvb, curr_offset, 1, FALSE);
1596 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 2) */
1597 proto_tree_add_item(tree, hf_nas_eps_emm_uia6, tvb, curr_offset, 1, FALSE);
1598 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 1) */
1599 proto_tree_add_item(tree, hf_nas_eps_emm_uia7, tvb, curr_offset, 1, FALSE);
1602 if ((curr_offset - offset) >= len)
1605 /* Bits 8 to 3 and bit 1 of octet 7 are spare and shall be coded as zero. */
1606 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 6, FALSE);
1607 /* 1xSRVCC capability (octet 7, bit 2) */
1608 proto_tree_add_item(tree, hf_nas_eps_emm_1xsrvcc_cap, tvb, curr_offset, 1, FALSE);
1609 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+7, 1, FALSE);
1613 /* UE radio capability information update needed flag (URC upd) (octet 1) */
1614 static const true_false_string nas_eps_emm_ue_ra_cap_inf_upd_need_flg = {
1615 "UE radio capability information update needed",
1616 "UE radio capability information update not needed"
1620 * 9.9.3.35 UE radio capability information update needed
1624 de_emm_ue_ra_cap_inf_upd_need(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1626 guint32 curr_offset;
1628 curr_offset = offset;
1630 proto_tree_add_item(tree, hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg, tvb, curr_offset, 1, FALSE);
1635 * 9.9.3.36 UE security capability
1639 de_emm_ue_sec_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1641 guint32 curr_offset;
1643 curr_offset = offset;
1645 /* EPS encryption algorithm EEA0 supported (octet 3, bit 8) */
1646 proto_tree_add_item(tree, hf_nas_eps_emm_eea0, tvb, curr_offset, 1, FALSE);
1647 /* EPS encryption algorithm 128-EEA1 supported (octet 3, bit 7) */
1648 proto_tree_add_item(tree, hf_nas_eps_emm_128eea1, tvb, curr_offset, 1, FALSE);
1649 /* EPS encryption algorithm 128-EEA2 supported (octet 3, bit 6) */
1650 proto_tree_add_item(tree, hf_nas_eps_emm_128eea2, tvb, curr_offset, 1, FALSE);
1651 /* EPS encryption algorithm 128-EEA3 supported (octet 3, bit 5) */
1652 proto_tree_add_item(tree, hf_nas_eps_emm_eea3, tvb, curr_offset, 1, FALSE);
1653 /* EPS encryption algorithm 128-EEA4 supported (octet 3, bit 4) */
1654 proto_tree_add_item(tree, hf_nas_eps_emm_eea4, tvb, curr_offset, 1, FALSE);
1655 /* EPS encryption algorithm 128-EEA5 supported (octet 3, bit 5) */
1656 proto_tree_add_item(tree, hf_nas_eps_emm_eea5, tvb, curr_offset, 1, FALSE);
1657 /* EPS encryption algorithm 128-EEA6 supported (octet 3, bit 6) */
1658 proto_tree_add_item(tree, hf_nas_eps_emm_eea6, tvb, curr_offset, 1, FALSE);
1659 /* EPS encryption algorithm 128-EEA7 supported (octet 3, bit 7) */
1660 proto_tree_add_item(tree, hf_nas_eps_emm_eea7, tvb, curr_offset, 1, FALSE);
1664 /* EPS integrity algorithms supported (octet 4) */
1665 /* EPS integrity algorithm EIA0 supported (octet 4, bit 8) */
1666 proto_tree_add_item(tree, hf_nas_eps_emm_eia0, tvb, curr_offset, 1, FALSE);
1667 /* EPS integrity algorithm 128-EIA1 supported (octet 4, bit 7) */
1668 proto_tree_add_item(tree, hf_nas_eps_emm_128eia1, tvb, curr_offset, 1, FALSE);
1669 /* EPS integrity algorithm 128-EIA2 supported (octet 4, bit 6) */
1670 proto_tree_add_item(tree, hf_nas_eps_emm_128eia2, tvb, curr_offset, 1, FALSE);
1671 /* EPS integrity algorithm EIA3 supported (octet 4, bit 5) */
1672 proto_tree_add_item(tree, hf_nas_eps_emm_eia3, tvb, curr_offset, 1, FALSE);
1673 /* EPS integrity algorithm EIA4 supported (octet 4, bit 4) */
1674 proto_tree_add_item(tree, hf_nas_eps_emm_eia4, tvb, curr_offset, 1, FALSE);
1675 /* EPS integrity algorithm EIA5 supported (octet 4, bit 3) */
1676 proto_tree_add_item(tree, hf_nas_eps_emm_eia5, tvb, curr_offset, 1, FALSE);
1677 /* EPS integrity algorithm EIA6 supported (octet 4, bit 2) */
1678 proto_tree_add_item(tree, hf_nas_eps_emm_eia6, tvb, curr_offset, 1, FALSE);
1679 /* EPS integrity algorithm EIA7 supported (octet 4, bit 1) */
1680 proto_tree_add_item(tree, hf_nas_eps_emm_eia7, tvb, curr_offset, 1, FALSE);
1684 /* Octets 5, 6, and 7 are optional. If octet 5 is included,
1685 * then also octet 6 shall be included and octet 7 may be included.
1690 /* UMTS encryption algorithms supported (octet 5)
1691 * UMTS encryption algorithm UEA0 supported (octet 5, bit 8)
1693 /* UMTS encryption algorithm UEA0 supported (octet 5, bit 8) */
1694 proto_tree_add_item(tree, hf_nas_eps_emm_uea0, tvb, curr_offset, 1, FALSE);
1695 /* UMTS encryption algorithm UEA1 supported (octet 5, bit 7) */
1696 proto_tree_add_item(tree, hf_nas_eps_emm_uea1, tvb, curr_offset, 1, FALSE);
1697 /* UMTS encryption algorithm UEA2 supported (octet 5, bit 6) */
1698 proto_tree_add_item(tree, hf_nas_eps_emm_uea2, tvb, curr_offset, 1, FALSE);
1699 /* UMTS encryption algorithm UEA3 supported (octet 5, bit 5) */
1700 proto_tree_add_item(tree, hf_nas_eps_emm_uea3, tvb, curr_offset, 1, FALSE);
1701 /* EPS encryption algorithm UEA4 supported (octet 5, bit 4) */
1702 proto_tree_add_item(tree, hf_nas_eps_emm_uea4, tvb, curr_offset, 1, FALSE);
1703 /* UMTS encryption algorithm UEA5 supported (octet 5, bit 5) */
1704 proto_tree_add_item(tree, hf_nas_eps_emm_uea5, tvb, curr_offset, 1, FALSE);
1705 /* UMTS encryption algorithm UEA6 supported (octet 5, bit 6) */
1706 proto_tree_add_item(tree, hf_nas_eps_emm_uea6, tvb, curr_offset, 1, FALSE);
1707 /* UMTS encryption algorithm UEA7 supported (octet 5, bit 7) */
1708 proto_tree_add_item(tree, hf_nas_eps_emm_uea7, tvb, curr_offset, 1, FALSE);
1711 /* UMTS integrity algorithm UIA0 supported (octet 6, bit ) */
1712 proto_tree_add_item(tree, hf_nas_eps_emm_uia0, tvb, curr_offset, 1, FALSE);
1713 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 7) */
1714 proto_tree_add_item(tree, hf_nas_eps_emm_uia1, tvb, curr_offset, 1, FALSE);
1715 /* UMTS integrity algorithm UIA2 supported (octet 6, bit 6) */
1716 proto_tree_add_item(tree, hf_nas_eps_emm_uia2, tvb, curr_offset, 1, FALSE);
1717 /* UMTS integrity algorithm UIA3 supported (octet 6, bit 5) */
1718 proto_tree_add_item(tree, hf_nas_eps_emm_uia3, tvb, curr_offset, 1, FALSE);
1719 /* UMTS integrity algorithm UIA4 supported (octet 6, bit 4) */
1720 proto_tree_add_item(tree, hf_nas_eps_emm_uia4, tvb, curr_offset, 1, FALSE);
1721 /* UMTS integrity algorithm UIA5 supported (octet 6, bit 3) */
1722 proto_tree_add_item(tree, hf_nas_eps_emm_uia5, tvb, curr_offset, 1, FALSE);
1723 /* UMTS integrity algorithm UIA6 supported (octet 6, bit 2) */
1724 proto_tree_add_item(tree, hf_nas_eps_emm_uia6, tvb, curr_offset, 1, FALSE);
1725 /* UMTS integrity algorithm UIA7 supported (octet 6, bit 1) */
1726 proto_tree_add_item(tree, hf_nas_eps_emm_uia7, tvb, curr_offset, 1, FALSE);
1731 /* Bit 8 of octet 7 is spare and shall be coded as zero. */
1732 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 1, FALSE);
1733 /* GPRS encryption algorithm GEA1 supported (octet 7, bit 7) */
1734 proto_tree_add_item(tree, hf_nas_eps_emm_gea1, tvb, curr_offset, 1, FALSE);
1735 /* GPRS encryption algorithm GEA2 supported (octet 7, bit 6) */
1736 proto_tree_add_item(tree, hf_nas_eps_emm_gea2, tvb, curr_offset, 1, FALSE);
1737 /* GPRS encryption algorithm GEA3 supported (octet 7, bit 5) */
1738 proto_tree_add_item(tree, hf_nas_eps_emm_gea3, tvb, curr_offset, 1, FALSE);
1739 /* GPRS encryption algorithm GEA4 supported (octet 7, bit 4) */
1740 proto_tree_add_item(tree, hf_nas_eps_emm_gea4, tvb, curr_offset, 1, FALSE);
1741 /* GPRS encryption algorithm GEA5 supported (octet 7, bit 3) */
1742 proto_tree_add_item(tree, hf_nas_eps_emm_gea5, tvb, curr_offset, 1, FALSE);
1743 /* GPRS encryption algorithm GEA6 supported (octet 7, bit 2) */
1744 proto_tree_add_item(tree, hf_nas_eps_emm_gea6, tvb, curr_offset, 1, FALSE);
1745 /* GPRS encryption algorithm GEA7 supported (octet 7, bit 1) */
1746 proto_tree_add_item(tree, hf_nas_eps_emm_gea7, tvb, curr_offset, 1, FALSE);
1752 * 9.9.3.37 Emergency Number List
1753 * See subclause 10.5.3.13 in 3GPP TS 24.008 [13].
1754 * packet-gsm_a_dtap.c
1762 * The coding of the CLI value part is the same as for octets 3 to 14
1763 * of the Calling party BCD number information element defined in
1764 * subclause 10.5.4.9 of 3GPP TS 24.008
1771 de_emm_ss_code(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1773 guint32 curr_offset;
1775 curr_offset = offset;
1779 * The coding of the SS Code value is given in subclause 17.7.5 of 3GPP TS 29.002 [15B].
1780 * value string imported from gsm map
1782 proto_tree_add_item(tree, hf_nas_eps_emm_ss_code, tvb, curr_offset, 1, FALSE);
1788 * 9.9.3.40 LCS indicator
1790 /* LCS indicator value */
1791 static const value_string nas_eps_emm_lcs_ind_vals[] = {
1792 { 0, "Normal, unspecified"},
1799 de_emm_lcs_ind(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1801 guint32 curr_offset;
1803 curr_offset = offset;
1806 proto_tree_add_item(tree, hf_nas_eps_emm_lcs_ind, tvb, curr_offset, 1, FALSE);
1811 * 9.9.3.41 LCS client identity
1814 de_emm_lcs_client_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1816 guint32 curr_offset;
1819 curr_offset = offset;
1821 /* LCS client identity (value part)
1822 * The coding of the value part of the LCS client identity is given
1823 * in subclause 17.7.13 of 3GPP TS 29.002 [15B](GSM MAP).
1825 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1826 dissect_gsm_map_lcs_LCS_ClientID_PDU( new_tvb, gpinfo, tree );
1832 * 9.9.3.42 Generic message container type
1836 de_emm_gen_msg_cont_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1838 guint32 curr_offset;
1840 curr_offset = offset;
1842 proto_tree_add_text(tree, tvb, offset, len, "Not dissected yet");
1847 * 9.9.3.43 Generic message container
1850 de_emm_gen_msg_cont(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1852 guint32 curr_offset;
1854 curr_offset = offset;
1856 proto_tree_add_text(tree, tvb, offset, len, "Not dissected yet");
1861 * 9.9.3.44 Voice domain preference and UE's usage setting
1864 de_emm_gen_voice_dmn_pref(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1866 guint32 curr_offset;
1868 curr_offset = offset;
1870 proto_tree_add_text(tree, tvb, offset, len, "Not dissected yet");
1875 * 9.9.4 EPS Session Management (ESM) information elements
1879 * 9.9.4.1 Access point name
1880 * See subclause 10.5.6.1 in 3GPP TS 24.008 [6].
1883 * 9.9.4.2 APN aggregate maximum bit rate
1887 de_esm_apn_aggr_max_br(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1889 guint32 curr_offset;
1891 guint32 dl_total = 0;
1892 guint32 ul_total = 0;
1893 guint32 bitrate = 0;
1895 curr_offset = offset;
1896 /* APN-AMBR for downlink octet 3 */
1897 octet = tvb_get_guint8(tvb,curr_offset);
1899 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl, tvb, curr_offset, 1, octet,
1902 bitrate = calc_bitrate(octet);
1903 dl_total += bitrate;
1904 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl, tvb, curr_offset, 1, octet,
1905 "APN-AMBR for downlink : %u kbps", bitrate);
1909 /* APN-AMBR for uplink octet 4 */
1910 octet = tvb_get_guint8(tvb,curr_offset);
1912 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul, tvb, curr_offset, 1, octet,
1915 bitrate = calc_bitrate(octet);
1916 ul_total += bitrate;
1917 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul, tvb, curr_offset, 1, octet,
1918 "APN-AMBR for uplink : %u kbps", bitrate);
1921 if ((curr_offset - offset) >= len)
1923 /* APN-AMBR for downlink (extended) octet 5 */
1924 octet = tvb_get_guint8(tvb,curr_offset);
1926 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext, tvb, curr_offset, 1, octet,
1927 "Use the value indicated by the APN-AMBR for downlink");
1929 bitrate = calc_bitrate_ext(octet);
1930 dl_total += (octet > 0x4a) ? bitrate*1000 : bitrate;
1931 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext, tvb, curr_offset, 1, octet,
1932 "APN-AMBR for downlink (extended) : %u %s",
1934 (octet > 0x4a) ? "Mbps" : "kbps");
1937 /* APN-AMBR for downlink (extended-2) is not present; display total now */
1939 /* Ignore value indicated by the APN-AMBR for downlink */
1940 dl_total = (octet > 0x4a) ? bitrate*1000 : bitrate;
1942 if (dl_total >= 1000) {
1943 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for downlink : %.3f Mbps", (gfloat)dl_total / 1000);
1945 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for downlink : %u kbps", dl_total);
1949 if ((curr_offset - offset) >= len)
1951 /* APN-AMBR for uplink (extended) octet 6 */
1952 octet = tvb_get_guint8(tvb,curr_offset);
1954 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext, tvb, curr_offset, 1, octet,
1955 "Use the value indicated by the APN-AMBR for uplink");
1957 bitrate = calc_bitrate_ext(octet);
1958 ul_total += (octet > 0x4a) ? bitrate*1000 : bitrate;
1959 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext, tvb, curr_offset, 1, octet,
1960 "APN-AMBR for uplink (extended) : %u %s",
1962 (octet > 0x4a) ? "Mbps" : "kbps");
1965 /* APN-AMBR for uplink (extended-2) is not present; display total now */
1967 /* Ignore value indicated by the APN-AMBR for uplink */
1968 ul_total = (octet > 0x4a) ? bitrate*1000 : bitrate;
1970 if (ul_total >= 1000) {
1971 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for uplink : %.3f Mbps", (gfloat)ul_total / 1000);
1973 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for uplink : %u kbps", ul_total);
1977 if ((curr_offset - offset) >= len)
1979 /* APN-AMBR for downlink (extended-2) octet 7 */
1980 octet = tvb_get_guint8(tvb,curr_offset);
1981 if((octet==0)||(octet==0xff)){
1982 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext2, tvb, curr_offset, 1, octet,
1983 "Use the value indicated by the APN-AMBR for downlink and APN-AMBR for downlink (extended)");
1985 dl_total += octet*256*1000;
1986 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext2, tvb, curr_offset, 1, octet,
1987 "APN-AMBR for downlink (extended-2) : %u Mbps",
1990 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for downlink : %.3f Mbps", (gfloat)dl_total / 1000);
1992 if ((curr_offset - offset) >= len)
1994 /* APN-AMBR for uplink (extended-2) octet 8 */
1995 octet = tvb_get_guint8(tvb,curr_offset);
1996 if((octet==0)||(octet==0xff)){
1997 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext2, tvb, curr_offset, 1, octet,
1998 "Use the value indicated by the APN-AMBR for uplink and APN-AMBR for downlink (extended)");
2000 ul_total += octet*256*1000;
2001 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext2, tvb, curr_offset, 1, octet,
2002 "APN-AMBR for uplink (extended-2) : %u Mbps",
2005 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for uplink : %.3f Mbps", (gfloat)ul_total / 1000);
2011 * 9.9.4.3 EPS quality of service
2014 /* Quality of Service Class Identifier (QCI), octet 3 (see 3GPP TS 23.203 [7]) */
2015 static const value_string nas_eps_qci_vals[] = {
2016 { 0, "UE -> NW Network selects the QCI / NW -> UE Reserved"},
2032 de_esm_qos(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2034 guint32 curr_offset;
2037 curr_offset = offset;
2040 proto_tree_add_item(tree, hf_nas_eps_qci, tvb, curr_offset, 1, FALSE);
2042 if ((curr_offset - offset) >= len)
2044 /* Maximum bit rate for uplink octet 4 */
2045 octet = tvb_get_guint8(tvb,curr_offset);
2047 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_ul, tvb, curr_offset, 1, octet,
2048 "UE->NW Subscribed maximum bit rate for uplink/ NW->UE Reserved");
2050 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_ul, tvb, curr_offset, 1, octet,
2051 "Maximum bit rate for uplink : %u kbps", calc_bitrate(octet));
2054 if ((curr_offset - offset) >= len)
2056 /* Maximum bit rate for downlink octet 5 */
2057 octet = tvb_get_guint8(tvb,curr_offset);
2059 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_dl, tvb, curr_offset, 1, octet,
2060 "UE->NW Subscribed maximum bit rate for downlink/ NW->UE Reserved");
2062 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_dl, tvb, curr_offset, 1, octet,
2063 "Maximum bit rate for downlink : %u kbps", calc_bitrate(octet));
2066 if ((curr_offset - offset) >= len)
2068 /* Guaranteed bit rate for uplink octet 6 */
2069 octet = tvb_get_guint8(tvb,curr_offset);
2070 proto_tree_add_uint_format(tree, hf_nas_eps_gbr_ul, tvb, curr_offset, 1, octet,
2071 "Guaranteed bit rate for uplink : %u kbps", calc_bitrate(octet));
2074 if ((curr_offset - offset) >= len)
2076 /* Guaranteed bit rate for downlink octet 7 */
2077 octet = tvb_get_guint8(tvb,curr_offset);
2078 proto_tree_add_uint_format(tree, hf_nas_eps_gbr_ul, tvb, curr_offset, 1, octet,
2079 "Guaranteed bit rate for downlink : %u kbps", calc_bitrate(octet));
2082 if ((curr_offset - offset) >= len)
2084 /* Maximum bit rate for uplink (extended) octet 8 */
2085 octet = tvb_get_guint8(tvb,curr_offset);
2087 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2088 "Use the value indicated by the maximum bit rate for uplink in octet 4.");
2090 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2091 "Maximum bit rate for uplink(extended) : %u %s",
2092 calc_bitrate_ext(octet),
2093 (octet > 0x4a) ? "Mbps" : "kbps");
2096 if ((curr_offset - offset) >= len)
2098 /* Maximum bit rate for downlink (extended) octet 9 */
2099 octet = tvb_get_guint8(tvb,curr_offset);
2101 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2102 "Use the value indicated by the maximum bit rate for downlink in octet 5.");
2104 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2105 "Maximum bit rate for downlink(extended) : %u %s",
2106 calc_bitrate_ext(octet),
2107 (octet > 0x4a) ? "Mbps" : "kbps");
2110 if ((curr_offset - offset) >= len)
2112 /* Guaranteed bit rate for uplink (extended) octet 10 */
2113 octet = tvb_get_guint8(tvb,curr_offset);
2115 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2116 "Use the value indicated by the Guaranteed bit rate for uplink in octet 6.");
2118 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2119 "Guaranteed bit rate for uplink(extended) : %u %s",
2120 calc_bitrate_ext(octet),
2121 (octet > 0x4a) ? "Mbps" : "kbps");
2124 if ((curr_offset - offset) >= len)
2126 /* Guaranteed bit rate for downlink (extended) octet 11 */
2127 octet = tvb_get_guint8(tvb,curr_offset);
2129 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2130 "Use the value indicated by the Guaranteed bit rate for downlink in octet 7.");
2132 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2133 "Guaranteed bit rate for downlink(extended) : %u %s",
2134 calc_bitrate_ext(octet),
2135 (octet > 0x4a) ? "Mbps" : "kbps");
2145 static const value_string nas_eps_esm_cause_vals[] = {
2146 { 0x08, "Operator Determined Barring"},
2147 { 0x1a, "Insufficient resources"},
2148 { 0x1b, "Unknown or missing APN"},
2149 { 0x1c, "Unknown PDN type"},
2150 { 0x1d, "User authentication failed"},
2151 { 0x1e, "Request rejected by Serving GW or PDN GW"},
2152 { 0x1f, "Request rejected, unspecified"},
2153 { 0x20, "Service option not supported"},
2154 { 0x21, "Requested service option not subscribed"},
2155 { 0x22, "Service option temporarily out of order"},
2156 { 0x23, "PTI already in use"},
2157 { 0x24, "Regular deactivation"},
2158 { 0x25, "EPS QoS not accepted"},
2159 { 0x26, "Network failure"},
2160 { 0x28, "Feature not supported"},
2161 { 0x29, "Semantic error in the TFT operation"},
2162 { 0x2a, "Syntactical error in the TFT operation"},
2163 { 0x2b, "Invalid EPS bearer identity"},
2164 { 0x2c, "Semantic errors in packet filter(s)"},
2165 { 0x2d, "Syntactical errors in packet filter(s)"},
2166 { 0x2e, "EPS bearer context without TFT already activated"},
2167 { 0x2f, "PTI mismatch"},
2168 { 0x31, "Last PDN disconnection not allowed"},
2169 { 0x32, "PDN type IPv4 only allowed"},
2170 { 0x33, "PDN type IPv6 only allowed"},
2171 { 0x34, "Single address bearers only allowed"},
2172 { 0x35, "ESM information not received"},
2173 { 0x36, "PDN connection does not exist"},
2174 { 0x37, "Multiple PDN connections for a given APN not allowed"},
2175 { 0x38, "Collision with network initiated request"},
2176 { 0x3b, "Unsupported QCI value"},
2177 { 0x51, "Invalid PTI value"},
2178 { 0x5f, "Semantically incorrect message"},
2179 { 0x60, "Invalid mandatory information"},
2180 { 0x61, "Message type non-existent or not implemented"},
2181 { 0x62, "Message type not compatible with the protocol state"},
2182 { 0x63, "Information element non-existent or not implemented"},
2183 { 0x64, "Conditional IE error"},
2184 { 0x65, "Message not compatible with the protocol state"},
2185 { 0x6f, "Protocol error, unspecified"},
2186 { 0x70, "APN restriction value incompatible with active EPS bearer context"},
2191 de_esm_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2193 guint32 curr_offset;
2195 curr_offset = offset;
2197 proto_tree_add_item(tree, hf_nas_eps_esm_cause, tvb, curr_offset, 1, FALSE);
2200 return(curr_offset - offset);
2203 * 9.9.4.5 ESM information transfer flag
2205 /* EIT (ESM information transfer) */
2206 static const true_false_string nas_eps_emm_eit_vals = {
2207 "Security protected ESM information transfer required",
2208 "Security protected ESM information transfer not required"
2211 de_esm_inf_trf_flg(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2213 guint32 curr_offset;
2215 curr_offset = offset;
2218 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+4, 3, FALSE);
2219 proto_tree_add_item(tree, hf_nas_eps_esm_eit, tvb, curr_offset, 1, FALSE);
2221 return(curr_offset-offset);
2224 * 9.9.4.6 Linked EPS bearer identity
2227 * Linked EPS bearer identity (bits 1-4)
2230 static const value_string nas_eps_esm_linked_bearer_id_vals[] = {
2236 { 0x5, "EPS bearer identity value 5"},
2237 { 0x6, "EPS bearer identity value 6"},
2238 { 0x7, "EPS bearer identity value 7"},
2239 { 0x8, "EPS bearer identity value 8"},
2240 { 0x9, "EPS bearer identity value 9"},
2241 { 0xa, "EPS bearer identity value 10"},
2242 { 0xb, "EPS bearer identity value 11"},
2243 { 0xc, "EPS bearer identity value 12"},
2244 { 0xd, "EPS bearer identity value 13"},
2245 { 0xe, "EPS bearer identity value 14"},
2246 { 0xf, "EPS bearer identity value 15"},
2253 de_esm_lnkd_eps_bearer_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2255 guint32 curr_offset;
2257 curr_offset = offset;
2259 proto_tree_add_item(tree, hf_nas_eps_esm_lnkd_eps_bearer_id, tvb, curr_offset, 1, FALSE);
2264 * 9.9.4.7 LLC service access point identifier
2265 * See subclause 10.5.6.9 in 3GPP TS 24.008
2268 * 9.9.4.8 Packet flow identifier
2269 * See subclause 10.5.6.11 in 3GPP TS 24.008
2272 * 9.9.4.9 PDN address
2275 de_esm_pdn_addr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2277 guint32 curr_offset;
2280 curr_offset = offset;
2283 pdn_type = tvb_get_guint8(tvb, offset) & 0x7;
2284 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 5, FALSE);
2285 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_type, tvb, curr_offset, 1, FALSE);
2291 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv4, tvb, curr_offset, 4, FALSE);
2295 /* IPv6 3GPP TS 24.301 version 9.4.0 Release 9
2296 * If PDN type value indicates IPv6, the PDN address information in octet 4 to octet 11
2297 * contains an IPv6 interface identifier. Bit 8 of octet 4 represents the most significant bit
2298 * of the IPv6 interface identifier and bit 1 of octet 11 the least significant bit.
2300 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv6_if_id, tvb, curr_offset, 8, FALSE);
2304 /* IPv4/IPv6 3GPP TS 24.301 version 9.4.0 Release 9
2305 * If PDN type value indicates IPv4v6, the PDN address information in octet 4 to octet 15
2306 * contains an IPv6 interface identifier and an IPv4 address. Bit 8 of octet 4 represents
2307 * the most significant bit of the IPv6 interface identifier and bit 1 of octet 11 the least
2308 * significant bit. Bit 8 of octet 12 represents the most significant bit of the IPv4 address
2309 * and bit 1 of octet 15 the least significant bit.
2311 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv6_if_id, tvb, curr_offset, 8, FALSE);
2313 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv4, tvb, curr_offset, 4, FALSE);
2320 return(curr_offset-offset);
2325 * Coded inline 1/2 octet
2327 static const value_string nas_eps_esm_pdn_type_values[] = {
2335 * 9.9.4.11 Protocol configuration options
2336 * See subclause 10.5.6.3 in 3GPP TS 24.008
2339 * 9.9.4.12 Quality of service
2340 * See subclause 10.5.6.5 in 3GPP TS 24.008
2343 * 9.9.4.13 Radio priority
2344 * See subclause 10.5.7.2 in 3GPP TS 24.008
2347 * 9.9.4.14 Request type
2348 * See subclause 10.5.6.17 in 3GPP TS 24.008
2351 * 9.9.4.15 Traffic flow aggregate description
2352 * The Traffic flow aggregate description information element is encoded using the same format as the Traffic flow
2353 * template information element (see subclause 10.5.6.12 in 3GPP TS 24.008 [13]). When sending this IE, the UE shall
2354 * assign the packet filter identifier values so that they are unique across all packet filters for the PDN connection.
2357 * 9.9.4.16 Traffic flow template
2358 * See subclause 10.5.6.12 in 3GPP TS 24.008
2362 * 9.9.4.17 Transaction identifier
2363 * The Transaction identifier information element is coded as the Linked TI information element in 3GPP TS 24.008 [13],
2364 * subclause 10.5.6.7.
2365 * The coding of the TI flag, the TI value and the EXT bit is defined in 3GPP TS 24.007[20].
2368 guint16 (*emm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
2369 /* 9.9.3 EPS Mobility Management (EMM) information elements */
2370 de_emm_add_upd_res, /* 9.9.3.0A Additional update result */
2371 de_emm_add_upd_type, /* 9.9.3.0B Additional update type */
2372 NULL, /* 9.9.3.1 Authentication failure parameter(dissected in packet-gsm_a_dtap.c) */
2373 NULL, /* 9.9.3.2 Authentication parameter AUTN(packet-gsm_a_dtap.c) */
2374 NULL, /* 9.9.3.3 Authentication parameter RAND */
2375 de_emm_auth_resp_par, /* 9.9.3.4 Authentication response parameter */
2376 de_emm_csfb_resp, /* 9.9.3.5 CSFB response */
2377 NULL, /* 9.9.3.6 Daylight saving time (packet-gsm_a_dtap.c)*/
2378 NULL, /* 9.9.3.7 Detach type */
2379 NULL, /* 9.9.3.8 DRX parameter */
2380 de_emm_cause, /* 9.9.3.9 EMM cause */
2381 NULL, /* 9.9.3.10 EPS attach result (coded inline) */
2382 NULL, /* 9.9.3.11 EPS attach type(Coded Inline) */
2383 de_emm_eps_mid, /* 9.9.3.12 EPS mobile identity */
2384 de_emm_eps_net_feature_sup, /* 9.9.3.12A EPS network feature support */
2385 NULL, /* 9.9.3.13 EPS update result (Coded Inline)*/
2386 NULL, /* 9.9.3.14 EPS update type (Inline)*/
2387 de_emm_esm_msg_cont, /* 9.9.3.15 ESM message conta */
2388 NULL, /* 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. (packet-gsm_a_gm.c)*/
2389 NULL, /* 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. */
2390 de_emm_nas_imeisv_req, /* 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. */
2391 de_emm_nas_ksi_and_seq_no, /* 9.9.3.19 KSI and sequence number */
2392 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) */
2393 de_emm_nas_key_set_id, /* 9.9.3.21 NAS key set identifier (Coded Inline) */
2394 de_emm_nas_msg_cont, /* 9.9.3.22 NAS message container */
2395 de_emm_nas_sec_alsgs, /* 9.9.3.23 NAS security algorithms */
2396 NULL, /* 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. (packet-gsm_a_dtap.c)*/
2397 de_emm_nonce, /* 9.9.3.25 Nonce */
2398 de_emm_paging_id, /* 9.9.3.25A Paging identity */
2399 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)*/
2400 NULL, /* 9.9.3.27 Service type */
2401 de_emm_nas_short_mac, /* 9.9.3.28 Short MAC */
2402 NULL, /* 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. (packet-gsm_a_dtap.c)*/
2403 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)*/
2404 NULL, /* 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. (packet-gsm_a_gm.c)*/
2405 de_emm_trac_area_id, /* 9.9.3.32 Tracking area identity */
2406 de_emm_trac_area_id_lst, /* 9.9.3.33 Tracking area identity list */
2407 de_emm_ue_net_cap, /* 9.9.3.34 UE network capability */
2408 de_emm_ue_ra_cap_inf_upd_need, /* 9.9.3.35 UE radio capability information update needed */
2409 de_emm_ue_sec_cap, /* 9.9.3.36 UE security capability */
2410 NULL, /* 9.9.3.37 Emergency Number List (packet-gsm_A_dtap.c) */
2411 NULL, /* 9.9.3.38 CLI */
2412 de_emm_ss_code, /* 9.9.3.39 SS Code */
2413 de_emm_lcs_ind, /* 9.9.3.40 LCS indicator */
2414 de_emm_lcs_client_id, /* 9.9.3.41 LCS client identity */
2415 de_emm_gen_msg_cont_type, /* 9.9.3.42 Generic message container type */
2416 de_emm_gen_msg_cont, /* 9.9.3.43 Generic message container */
2417 de_emm_gen_voice_dmn_pref, /* 9.9.3.44 Voice domain preference and UE's usage setting */
2421 /* 9.9.4 EPS Session Management (ESM) information elements */
2422 const value_string nas_esm_elem_strings[] = {
2423 { 0x00, "Access point name" }, /* 9.9.4.1 Access point name */
2424 { 0x00, "APN aggregate maximum bit rate" }, /* 9.9.4.2 APN aggregate maximum bit rate */
2425 { 0x00, "EPS quality of service" }, /* 9.9.4.3 EPS quality of service */
2426 { 0x00, "ESM cause" }, /* 9.9.4.4 ESM cause */
2427 { 0x00, "ESM information transfer flag" }, /* 9.9.4.5 ESM information transfer flag */
2428 { 0x00, "Linked EPS bearer identity" }, /* 9.9.4.6 Linked EPS bearer identity */
2429 { 0x00, "LLC service access point identifier" }, /* 9.9.4.7 LLC service access point identifier */
2430 { 0x00, "Packet flow identifier" }, /* 9.9.4.8 Packet flow identifier */
2431 { 0x00, "PDN address" }, /* 9.9.4.9 PDN address */
2432 { 0x00, "PDN type" }, /* 9.9.4.10 PDN type */
2433 { 0x00, "Protocol configuration options" }, /* 9.9.4.11 Protocol configuration options */
2434 { 0x00, "Quality of service" }, /* 9.9.4.12 Quality of service */
2435 { 0x00, "Radio priority" }, /* 9.9.4.13 Radio priority */
2436 { 0x00, "Request type" }, /* 9.9.4.14 Request type */
2437 { 0x00, "Traffic flow aggregate description" }, /* 9.9.4.15 Traffic flow aggregate description */
2438 { 0x00, "Traffic flow templat" }, /* 9.9.4.16 Traffic flow template */
2439 { 0x00, "Transaction identifier" }, /* 9.9.4.17 Transaction identifier */
2444 #define NUM_NAS_ESM_ELEM (sizeof(nas_esm_elem_strings)/sizeof(value_string))
2445 gint ett_nas_eps_esm_elem[NUM_NAS_ESM_ELEM];
2449 DE_ESM_APN, /* 9.9.4.1 Access point name */
2450 DE_ESM_APN_AGR_MAX_BR, /* 9.9.4.2 APN aggregate maximum bit rate */
2451 DE_ESM_EPS_QOS, /* 9.9.4.3 EPS quality of service */
2452 DE_ESM_CAUSE, /* 9.9.4.4 ESM cause */
2453 DE_ESM_INF_TRF_FLG, /* 9.9.4.5 ESM information transfer flag */
2454 DE_ESM_LNKED_EPS_B_ID, /* 9.9.4.6 Linked EPS bearer identity */
2455 DE_ESM_LLC_SAPI, /* 9.9.4.7 LLC service access point identifier */
2456 DE_ESM_P_FLW_ID, /* 9.9.4.8 Packet flow identifier */
2457 DE_ESM_PDN_ADDR, /* 9.9.4.9 PDN address */
2458 DE_ESM_PDN_TYPE, /* 9.9.4.10 PDN type */
2459 DE_ESM_PROT_CONF_OPT, /* 9.9.4.11 Protocol configuration options */
2460 DE_ESM_QOS, /* 9.9.4.12 Quality of service */
2461 DE_ESM_RA_PRI, /* 9.9.4.13 Radio priority */
2462 DE_ESM_REQ_TYPE, /* 9.9.4.14 Request type */
2463 DE_ESM_TRAF_FLOW_AGR_DESC, /* 9.9.4.15 Traffic flow aggregate description */
2464 DE_ESM_TRAF_FLOW_TEMPL, /* 9.9.4.16 Traffic flow template */
2465 DE_ESM_TID, /* 9.9.4.17 Transaction identifier */
2466 DE_ESM_NONE /* NONE */
2471 guint16 (*esm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
2472 NULL, /* 9.9.4.1 Access point name */
2473 de_esm_apn_aggr_max_br, /* 9.9.4.2 APN aggregate maximum bit rate */
2474 de_esm_qos, /* 9.9.4.3 EPS quality of service */
2475 de_esm_cause, /* 9.9.4.4 ESM cause */
2476 de_esm_inf_trf_flg, /* 9.9.4.5 ESM information transfer flag */
2477 de_esm_lnkd_eps_bearer_id, /* 9.9.4.6 Linked EPS bearer identity */
2478 NULL, /* 9.9.4.7 LLC service access point identifier */
2479 NULL, /* 9.9.4.8 Packet flow identifier */
2480 de_esm_pdn_addr, /* 9.9.4.9 PDN address */
2481 NULL, /* 9.9.4.10 PDN type */
2482 NULL, /* 9.9.4.11 Protocol configuration options */
2483 NULL, /* 9.9.4.12 Quality of service */
2484 NULL, /* 9.9.4.13 Radio priority */
2485 NULL, /* 9.9.4.14 Request type */
2486 NULL, /* 9.9.4.15 Traffic flow aggregate description */
2487 NULL, /* 9.9.4.16 Traffic flow template */
2488 NULL, /* 9.9.4.17 Transaction identifier */
2492 /* MESSAGE FUNCTIONS */
2495 * 8.2.1 Attach accept
2499 nas_emm_attach_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2501 guint32 curr_offset, bit_offset;
2505 curr_offset = offset;
2508 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2509 bit_offset = curr_offset<<3;
2510 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
2512 /* EPS attach result EPS attach result 9.9.3.10 M V 1/2 */
2513 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, FALSE);
2515 proto_tree_add_bits_item(tree, hf_nas_eps_emm_EPS_attach_result, tvb, bit_offset, 3, FALSE);
2517 /* Fix up the lengths */
2520 /* T3412 value GPRS timer 9.9.3.16 M V 1 */
2521 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER);
2522 /* Tracking area identity list 9.9.3.33 M LV 7-97 */
2523 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - TAI list");
2524 /* ESM message container 9.9.3.15 M LV-E 2-n */
2525 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, "");
2526 /* 50 GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
2527 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
2528 /* 13 Location area identification Location area identification 9.9.2.2 O TV 6 */
2529 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, "");
2530 /* 23 MS identity Mobile identity 9.9.2.3 O TLV 7-10 */
2531 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - MS identity");
2532 /* 53 EMM cause EMM cause 9.9.3.9 O TV 2 */
2533 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, "");
2534 /* 17 T3402 value GPRS timer 9.9.3.16 O TV 2 */
2535 ELEM_OPT_TV(0x17, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3402 value");
2536 /* 59 T3423 value GPRS timer 9.9.3.16 O TV 2 */
2537 ELEM_OPT_TV(0x59, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3423 value");
2538 /* 4A Equivalent PLMNs PLMN list 9.9.2.8 O TLV 5-47 */
2539 ELEM_OPT_TLV(0x4a, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_PLM_LST, " - Equivalent PLMNs");
2540 /* 34 Emergency Number List 9.9.3.37 O TLV 5-50 */
2541 ELEM_OPT_TLV(0x34, GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST, "");
2542 /* 64 EPS network feature support EPS network feature support 9.9.3.12A O TLV 3 */
2543 ELEM_OPT_TLV(0x64, NAS_PDU_TYPE_EMM, DE_EMM_EPS_NET_FEATURE_SUP, "");
2544 /* F- Additional update result Additional update result 9.9.3.0A O TV 1 */
2545 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_RES, "" );
2547 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2550 * 8.2.2 Attach complete
2553 nas_emm_attach_comp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2555 guint32 curr_offset;
2559 curr_offset = offset;
2562 /* ESM message container ESM message container 9.9.3.15 M LV-E 2-n */
2563 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, "");
2565 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2570 * 8.2.3 Attach reject
2573 nas_emm_attach_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2575 guint32 curr_offset;
2579 curr_offset = offset;
2582 /* * EMM cause EMM cause 9.9.3.9 M V 1 */
2583 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE);
2584 /* 78 ESM message container ESM message container 9.9.3.15 O TLV-E 4-n */
2585 ELEM_OPT_TLV_E(0x78, NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, "");
2587 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2591 * 8.2.4 Attach request
2594 nas_emm_attach_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2596 guint32 curr_offset, bit_offset;
2600 curr_offset = offset;
2603 bit_offset = curr_offset<<3;
2605 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
2606 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
2609 /* EPS attach type EPS attach type 9.9.3.11 M V 1/2
2612 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, FALSE);
2614 proto_tree_add_bits_item(tree, hf_nas_eps_emm_eps_att_type, tvb, bit_offset, 3, FALSE);
2617 /* Fix the lengths */
2620 /* Old GUTI or IMSI EPS mobile identity 9.9.3.12 M LV 5-12 */
2621 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Old GUTI or IMSI");
2622 /* UE network capability UE network capability 9.9.3.34 M LV 3-14 */
2623 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_UE_NET_CAP, "");
2624 /* ESM message container ESM message container 9.9.3.15 M LV-E 2-n */
2625 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, "");
2626 /* 19 Old P-TMSI signature P-TMSI signature 10.5.5.8 O TV 4 */
2627 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, " - Old P-TMSI Signature");
2628 /* 50 Additional GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
2629 ELEM_OPT_TLV( 0x50 , NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Additional GUTI");
2630 /* 52 Last visited registered TAI Tracking area identity 9.9.3.32 O TV 6 */
2631 ELEM_OPT_TV(0x52, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, " - Last visited registered TAI");
2632 /* 5c DRX parameter DRX parameter 9.9.3.8 O TV 3 */
2633 ELEM_OPT_TV(0x5c, GSM_A_PDU_TYPE_GM, DE_DRX_PARAM, "" );
2634 /* 31 MS network capability MS network capability 9.9.3.20 M LV 3-9 */
2635 ELEM_OPT_TLV( 0x31, GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP , "" );
2636 /* 13 Old location area identification Location area identification 9.9.2.2 O TV 6 */
2637 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, " - Old location area identification");
2638 /* 9- TMSI status TMSI status 9.9.3.31 O TV 1 */
2639 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , "" );
2640 /* 11 Mobile station classmark 2 Mobile station classmark 2 9.9.2.5 O TLV 5 */
2641 ELEM_OPT_TLV( 0x11, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_2 , "" );
2642 /* 20 Mobile station classmark 3 Mobile station classmark 3 9.9.2.5 O TLV 2-34 */
2643 ELEM_OPT_TLV( 0x20, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_3 , "" );
2644 /* 40 Supported Codecs Supported Codec List 9.9.2.10 O TLV 5-n */
2645 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, " - Supported Codecs");
2646 /* F- Additional update type Additional update type 9.9.3.0B O TV 1 */
2647 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_TYPE, "" );
2648 /* 5D Voice domain preference and UE's usage setting Voice domain preference and UE's usage setting 9.9.3.44 O TLV 3 */
2649 /* ELEM_OPT_TLV(0x5D, xxxxxx, xxxxxx, ""); */
2652 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2655 * 8.2.5 Authentication failure
2658 nas_emm_attach_fail(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2660 guint32 curr_offset;
2664 curr_offset = offset;
2667 /* EMM cause EMM cause 9.9.3.9 M V 1 */
2668 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE);
2669 /* 30 Authentication failure parameter Authentication failure parameter 9.9.3.1 O TLV 1 */
2670 ELEM_OPT_TLV(0x30, GSM_A_PDU_TYPE_DTAP, DE_AUTH_FAIL_PARAM, "");
2672 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2675 * 8.2.6 Authentication reject
2679 * 8.2.7 Authentication request
2683 nas_emm_auth_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2685 guint32 curr_offset, bit_offset;
2689 curr_offset = offset;
2692 bit_offset = curr_offset<<3;
2694 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2695 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
2699 * NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2
2701 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, " ASME");
2704 /* Fix the lengths */
2709 * Authentication parameter RAND (EPS challenge) 9.9.3.3 M V 16
2711 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_RAND);
2713 * Authentication parameter AUTN (EPS challenge) 9.9.3.2 M LV 17
2715 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_AUTN, " - EPS challenge");
2717 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2721 * 8.2.8 Authentication response
2724 nas_emm_auth_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2726 guint32 curr_offset;
2730 curr_offset = offset;
2734 * Authentication response parameter 9.9.3.4 M LV 5-17
2736 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_AUTH_RESP_PAR, "");
2738 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2742 * 8.2.9 CS service notification
2746 nas_emm_cs_serv_not(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2748 guint32 curr_offset;
2752 curr_offset = offset;
2757 /* Paging identity Paging identity 9.9.3.25A M V 1 */
2758 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_PAGING_ID);
2759 /* 60 CLI CLI 9.9.3.38 O TLV 3-12 */
2760 ELEM_OPT_TLV(0x60, GSM_A_PDU_TYPE_DTAP, DE_CLD_PARTY_BCD_NUM, " - CLI");
2761 /* 61 SS Code SS Code 9.9.3.39 O TV 2 */
2762 ELEM_OPT_TV(0x61, NAS_PDU_TYPE_EMM, DE_EMM_SS_CODE, "");
2763 /* 62 LCS indicator LCS indicator 9.9.3.40 O TV 2 */
2764 ELEM_OPT_TV(0x62, NAS_PDU_TYPE_EMM, DE_EMM_LCS_IND, "");
2765 /* 63 LCS client identity LCS client identity 9.9.3.41 O TLV 3-257 */
2766 ELEM_OPT_TLV(0x63, NAS_PDU_TYPE_EMM, DE_EMM_LCS_CLIENT_ID, "");
2768 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2771 * 8.2.10 Detach accept
2772 * 8.2.10.1 Detach accept (UE originating detach)
2774 * 8.2.10.2 Detach accept (UE terminated detach)
2778 * 8.2.11 Detach request
2779 * 8.2.11.1 Detach request (UE originating detach)
2783 nas_emm_detach_req_UL(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2785 guint32 curr_offset,bit_offset;
2789 curr_offset = offset;
2792 proto_tree_add_text(tree, tvb, curr_offset, len,"Up link");
2793 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
2794 bit_offset = curr_offset<<3;
2795 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
2797 /* Detach type Detach type 9.9.3.6 M V 1/2 */
2798 proto_tree_add_bits_item(tree, hf_nas_eps_emm_switch_off, tvb, bit_offset, 1, FALSE);
2800 proto_tree_add_bits_item(tree, hf_nas_eps_emm_detach_type_UL, tvb, bit_offset, 3, FALSE);
2803 /* Fix the lengths */
2807 /* GUTI or IMSI EPS mobile identity 9.9.3.12 M LV 5-12 */
2808 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI or IMSI");
2813 * 8.2.11.2 Detach request (UE terminated detach)
2816 nas_emm_detach_req_DL(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2818 guint32 curr_offset, bit_offset;
2822 curr_offset = offset;
2825 proto_tree_add_text(tree, tvb, curr_offset, len,"Down link");
2826 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2827 bit_offset = curr_offset<<3;
2828 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 4, FALSE);
2830 /* Detach type Detach type 9.9.3.6 M V 1/2 */
2831 /* In the network to UE direction bit 4 is spare. The network shall set this bit to zero. */
2832 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, FALSE);
2834 proto_tree_add_bits_item(tree, hf_nas_eps_emm_detach_type_DL, tvb, bit_offset, 3, FALSE);
2837 /* Fix the lengths */
2841 /* No more mandatory elements */
2845 /* EMM cause EMM cause 9.9.3.9 O TV 2 */
2846 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, "");
2848 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2853 nas_emm_detach_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2855 guint32 curr_offset;
2858 curr_offset = offset;
2862 if(gpinfo->link_dir==P2P_DIR_UL){
2863 nas_emm_detach_req_UL(tvb, tree, offset, len);
2865 }else if(gpinfo->link_dir==P2P_DIR_DL){
2866 nas_emm_detach_req_DL(tvb, tree, offset, len);
2870 proto_tree_add_text(tree, tvb, curr_offset, len,"UL/DL not known, can't properly dissect");
2871 proto_tree_add_text(tree, tvb, curr_offset, len,"Trying to dissect as UE terminated detach");
2872 nas_emm_detach_req_DL(tvb, tree, offset, len);
2873 proto_tree_add_text(tree, tvb, curr_offset, len,"Trying to dissect as UE originating detach");
2874 nas_emm_detach_req_UL(tvb, tree, offset, len);
2881 * 8.2.12 Downlink NAS Transport
2884 nas_emm_dl_nas_trans(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2886 guint32 curr_offset;
2890 curr_offset = offset;
2893 /* NAS message container NAS message container 9.9.3.22 M LV 3-252 */
2894 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_NAS_MSG_CONT, "");
2896 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2899 * 8.2.13 EMM information
2902 nas_emm_emm_inf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2904 guint32 curr_offset;
2908 curr_offset = offset;
2911 /* 43 Full name for network Network name 9.9.3.24 O TLV 3-? */
2912 ELEM_OPT_TLV(0x43, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Full name for network");
2913 /* 45 Short name for network Network name 9.9.3.24 O TLV 3-? */
2914 ELEM_OPT_TLV(0x45, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Short Name");
2915 /* 46 Local time zone Time zone 9.9.3.29 O TV 2 */
2916 ELEM_OPT_TV(0x46, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE, " - Local");
2917 /* 47 Universal time and local time zone Time zone and time 9.9.3.30 O TV 8 */
2918 ELEM_OPT_TV(0x47, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE_TIME, " - Universal Time and Local Time Zone");
2919 /* 49 Network daylight saving time Daylight saving time 9.9.3.6 O TLV 3 */
2920 ELEM_OPT_TLV(0x49, GSM_A_PDU_TYPE_DTAP, DE_DAY_SAVING_TIME, "");
2922 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2930 nas_emm_emm_status(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2932 guint32 curr_offset;
2936 curr_offset = offset;
2939 /* EMM cause EMM cause 9.9.3.9 M V 1 */
2940 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE);
2942 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2946 * 8.2.15 Extended service request
2949 nas_emm_ext_serv_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2951 guint32 curr_offset,bit_offset;
2955 curr_offset = offset;
2958 bit_offset = curr_offset<<3;
2960 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
2961 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
2963 /* Service type Service type 9.9.3.27 M V 1/2 Service type*/
2964 proto_tree_add_bits_item(tree, hf_nas_eps_service_type, tvb, bit_offset, 4, FALSE);
2966 /* Fix up the lengths */
2970 /* M-TMSI Mobile identity 9.9.2.3 M LV 6 */
2971 ELEM_MAND_LV(NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - M-TMSI");
2972 /* B- CSFB response CSFB response 9.9.3.5 C TV 1 */
2973 ELEM_OPT_TV_SHORT(0xb0, NAS_PDU_TYPE_EMM, DE_EMM_CSFB_RESP, "");
2974 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
2975 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, "");
2977 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2980 * 8.2.16 GUTI reallocation command
2983 nas_emm_guti_realloc_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2985 guint32 curr_offset;
2989 curr_offset = offset;
2992 /* GUTI EPS mobile identity 9.9.3.12 M LV 12 */
2993 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
2995 /* 54 TAI list Tracking area identity list 9.9.3.33 O TLV 8-98 */
2996 ELEM_OPT_TLV(0x54, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, "");
2998 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3002 * 8.2.17 GUTI reallocation complete
3006 * 8.2.18 Identity request
3010 nas_emm_id_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3012 guint32 curr_offset, bit_offset;
3016 curr_offset = offset;
3020 bit_offset=curr_offset<<3;
3022 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
3023 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
3026 /* Identity type Identity type 2 9.9.3.17 M V 1/2 */
3027 proto_tree_add_bits_item(tree, hf_nas_eps_emm_id_type2, tvb, bit_offset, 4, FALSE);
3032 /* Fix up the lengths */
3036 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3039 * 8.2.19 Identity response
3042 nas_emm_id_res(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3044 guint32 curr_offset;
3048 curr_offset = offset;
3051 /* Mobile identity Mobile identity 9.9.2.3 M LV 4-10 */
3052 ELEM_MAND_LV(NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, "");
3054 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3060 * 8.2.20 Security mode command
3063 nas_emm_sec_mode_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3065 guint32 curr_offset, bit_offset;
3069 curr_offset = offset;
3072 /* Selected NAS security algorithms NAS security algorithms 9.9.3.23 M V 1 */
3073 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_NAS_SEC_ALGS);
3075 bit_offset = curr_offset<<3;
3076 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
3077 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
3079 /* NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2 */
3080 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, " ASME");
3083 /* Fix up the lengths */
3087 /* Replayed UE security capabilities UE security capability 9.9.3.36 M LV 3-6 */
3088 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_UE_SEC_CAP, " - Replayed UE security capabilities");
3089 /* C- IMEISV request IMEISV request 9.9.3.18 O TV 1 */
3090 ELEM_OPT_TV_SHORT( 0xC0 , NAS_PDU_TYPE_EMM, DE_EMM_IMEISV_REQ , "" );
3091 /* 55 Replayed NonceUE Nonce 9.9.3.25 O TV 5 */
3092 ELEM_OPT_TV(0x55, GSM_A_PDU_TYPE_GM, DE_EMM_NONCE, " - Replayed NonceUE");
3093 /* 56 NonceMME Nonce 9.9.3.25 O TV 5 */
3094 ELEM_OPT_TV(0x56, GSM_A_PDU_TYPE_GM, DE_EMM_NONCE, " - NonceMME");
3096 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3099 * 8.2.21 Security mode complete
3102 nas_emm_sec_mode_comp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3104 guint32 curr_offset;
3108 curr_offset = offset;
3114 /* 23 IMEISV Mobile identity 9.9.2.3 O TLV 11 */
3115 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - IMEISV");
3117 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3120 * 8.2.22 Security mode reject
3123 nas_emm_sec_mode_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3125 guint32 curr_offset;
3129 curr_offset = offset;
3132 /* EMM cause EMM cause 9.9.3.9 M V 1 */
3133 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE);
3135 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3138 * 8.2.23 Security protected NAS message
3142 nas_emm_sec_prot_msg(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3144 guint32 curr_offset;
3146 guint8 security_header_type;
3148 curr_offset = offset;
3151 /* Security header type Security header type 9.3.1 M V 1/2 */
3152 security_header_type = tvb_get_guint8(tvb,offset)>>4;
3153 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, 0, 1, FALSE);
3154 /* Protocol discriminator Protocol discriminator 9.2 M V 1/2 */
3155 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, FALSE);
3157 /* Message authentication code Message authentication code 9.5 M V 4 */
3158 if (security_header_type !=0){
3159 /* Message authentication code */
3160 proto_tree_add_item(tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, FALSE);
3162 if ((security_header_type==2)||(security_header_type==4)){
3163 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
3164 proto_tree_add_text(tree, tvb, offset, len-5,"Ciphered message");
3168 proto_tree_add_text(tree, tvb, offset, len,"Not a security protected message");
3171 /* Sequence number Sequence number 9.6 M V 1 */
3172 proto_tree_add_item(tree, hf_nas_eps_seq_no, tvb, offset, 1, FALSE);
3174 /* NAS message NAS message 9.7 M V 1-n */
3179 * 8.2.24 Service reject
3182 nas_emm_serv_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3184 guint32 curr_offset;
3188 curr_offset = offset;
3191 /* EMM cause EMM cause 9.9.3.9 M V 1 */
3192 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE);
3194 /* 5B T3442 value GPRS timer 9.9.3.16 C TV 2 */
3195 ELEM_OPT_TV(0x5b, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3442 value");
3197 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3200 * 8.2.25 Service request
3201 * This message is sent by the UE to the network to request the establishment
3202 * of a NAS signalling connection and of the radio and S1 bearers.
3203 * Its structure does not follow the structure of a standard layer 3 message. See table 8.2.25.1.
3206 * Protocol discriminator Protocol discriminator 9.2 M V 1/2
3207 * Security header type Security header type 9.3.1 M V 1/2
3208 * KSI and sequence number KSI and sequence number 9.9.3.19 M V 1
3209 * Message authentication code (short) Short MAC 9.9.3.28 M V 2
3212 nas_emm_service_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3214 guint32 curr_offset;
3218 curr_offset = offset;
3221 /* KSI and sequence number 9.9.3.19 M V 1 */
3222 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_KSI_AND_SEQ_NO);
3224 /* Short MAC 9.9.3.28 M V 2 */
3225 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_SHORT_MAC);
3227 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3231 * 8.2.26 Tracking area update accept
3234 nas_emm_trac_area_upd_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3236 guint32 curr_offset, bit_offset;
3240 curr_offset = offset;
3243 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
3244 bit_offset = curr_offset<<3;
3245 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
3247 /* EPS update result EPS update result 9.9.3.13 M V 1/2 */
3248 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, FALSE);
3250 proto_tree_add_bits_item(tree, hf_nas_eps_eps_update_result_value, tvb, bit_offset, 3, FALSE);
3252 /* Fix up the lengths */
3255 /* No more mandatory elements */
3258 /* 5A T3412 value GPRS timer 9.9.3.16 O TV 2 */
3259 ELEM_OPT_TV(0x5a, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3412 value");
3260 /* 50 GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
3261 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
3262 /* 54 TAI list Tracking area identity list 9.9.3.33 O TLV 8-98 */
3263 ELEM_OPT_TLV(0x54, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, "");
3264 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
3265 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, "");
3266 /* 13 Location area identification Location area identification 9.9.2.2 O TV 6 */
3267 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, "");
3268 /* 23 MS identity Mobile identity 9.9.2.3 O TLV 7-10 */
3269 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - MS identity");
3270 /* 53 EMM cause EMM cause 9.9.3.9 O TV 2 */
3271 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, "");
3272 /* 17 T3402 value GPRS timer 9.9.3.16 O TV 2 */
3273 ELEM_OPT_TV(0x17, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3402 value");
3274 /* 59 T3423 value GPRS timer 9.9.3.16 O TV 2 */
3275 ELEM_OPT_TV(0x59, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3423 value");
3276 /* 4A Equivalent PLMNs PLMN list 9.9.2.8 O TLV 5-47 */
3277 ELEM_OPT_TLV(0x4a, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_PLM_LST, " - PLMN list");
3278 /* 34 Emergency Number List Emergency Number List 9.9.3.37 O TLV 5-50 */
3279 ELEM_OPT_TLV(0x34, GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST, "");
3280 /* 64 EPS network feature support EPS network feature support 9.9.3.12A O TLV 3 */
3281 ELEM_OPT_TLV(0x64, NAS_PDU_TYPE_EMM, DE_EMM_EPS_NET_FEATURE_SUP, "");
3282 /* F- Additional update result Additional update result 9.9.3.0A O TV 1 */
3283 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_RES, "" );
3285 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3288 * 8.2.27 Tracking area update complete
3292 * 8.2.28 Tracking area update reject
3295 nas_emm_trac_area_upd_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3297 guint32 curr_offset;
3301 curr_offset = offset;
3304 /* EMM cause EMM cause 9.9.3.9 M V 1 */
3305 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE);
3307 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3310 * 8.2.29 Tracking area update request
3313 nas_emm_trac_area_upd_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3316 guint32 curr_offset, bit_offset;
3320 curr_offset = offset;
3323 bit_offset = curr_offset<<3;
3325 /* NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2 */
3326 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, " ASME");
3329 /* EPS update type EPS update type 9.9.3.14 M V 1/2 */
3330 proto_tree_add_bits_item(tree, hf_nas_eps_active_flg, tvb, bit_offset, 1, FALSE);
3332 proto_tree_add_bits_item(tree, hf_nas_eps_eps_update_type_value, tvb, bit_offset, 3, FALSE);
3335 /* Fix the lengths */
3338 /* Old GUTI EPS mobile identity 9.9.3.12 M LV 12 */
3339 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Old GUTI");
3340 /* No more Mandatory elements */
3343 /* B- NAS key set identifier Non-current native NAS key set identifier 9.9.3.21 O TV 1 */
3344 ELEM_OPT_TV_SHORT( 0xb0 , NAS_PDU_TYPE_EMM, DE_EMM_NAS_KEY_SET_ID , " - Non-current native NAS key set identifier" );
3345 /* 8- GPRS ciphering key sequence number Ciphering key sequence number 9.9.3.4a O TV 1 */
3346 ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_COMMON, DE_CIPH_KEY_SEQ_NUM, " - GPRS ciphering key sequence number");
3347 /* 19 Old P-TMSI signature P-TMSI signature 9.9.3.26 O TV 4 */
3348 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, " - Old P-TMSI Signature");
3349 /* 50 Additional GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
3350 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Additional GUTI");
3351 /* 55 NonceUE Nonce 9.9.3.25 O TV 5 */
3352 ELEM_OPT_TV(0x55, GSM_A_PDU_TYPE_GM, DE_EMM_NONCE, " - NonceUE");
3353 /* 58 UE network capability UE network capability 9.9.3.34 O TLV 4-15 */
3354 ELEM_OPT_TLV(0x58, NAS_PDU_TYPE_EMM, DE_EMM_UE_NET_CAP, "");
3355 /* 52 Last visited registered TAI Tracking area identity 9.9.3.32 O TV 6 */
3356 ELEM_OPT_TV(0x52, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, " - Last visited registered TAI");
3357 /* 5C DRX parameter DRX parameter 9.9.3.8 O TV 3 */
3358 ELEM_OPT_TV(0x5c, GSM_A_PDU_TYPE_GM, DE_DRX_PARAM, "" );
3359 /* A- UE radio capability information update needed UE radio capability information update needed 9.9.3.35 O TV 1 */
3360 ELEM_OPT_TV_SHORT( 0xA0 , NAS_PDU_TYPE_EMM, DE_EMM_UE_RA_CAP_INF_UPD_NEED , "" );
3361 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
3362 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, "");
3363 /* 31 MS network capability MS network capability 9.9.3.20 O TLV 4-10 */
3364 ELEM_OPT_TLV( 0x31 , GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP , "" );
3365 /* 13 Old location area identification Location area identification 9.9.2.2 O TV 6 */
3366 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, " - Old location area identification");
3367 /* 9- TMSI status TMSI status 9.9.3.31 O TV 1 */
3368 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , "" );
3369 /* 11 Mobile station classmark 2 Mobile station classmark 2 9.9.2.5 O TLV 5 */
3370 ELEM_OPT_TLV( 0x11, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_2 , "" );
3371 /* 20 Mobile station classmark 3 Mobile station classmark 3 9.9.2.5 O TLV 2-34 */
3372 ELEM_OPT_TLV( 0x20, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_3 , "" );
3373 /* 40 Supported Codecs Supported Codec List 9.9.2.10 O TLV 5-n */
3374 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, " - Supported Codecs");
3375 /* F- Additional update type Additional update type 9.9.3.0B O TV 1 */
3376 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_TYPE, "" );
3377 /* 5D Voice domain preference and UE's usage setting Voice domain preference and UE's usage setting 9.9.3.44 O TLV 3 */
3378 /* ELEM_OPT_TLV(0x5D, xxxxxx, xxxxxx, ""); */
3380 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3384 * 8.2.30 Uplink NAS Transport
3387 nas_emm_ul_nas_trans(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3389 guint32 curr_offset;
3393 curr_offset = offset;
3396 /* NAS message container NAS message container 9.9.3.22 M LV 3-252*/
3397 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_NAS_MSG_CONT, "");
3399 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3403 * 8.2.31 Downlink generic NAS transport
3406 nas_emm_ul_gen_nas_trans(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3408 guint32 curr_offset;
3412 curr_offset = offset;
3415 /* Generic message container type Generic message container type 9.9.3.42 M V 1 */
3416 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_EMM_GEN_MSG_CONT_TYPE);
3417 /* Generic message container Generic message container 9.9.3.43 M LV-E 3-n */
3418 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT, "")
3419 /* 65 Additional information Additional information 9.9.2.0 O TLV 3-n */
3423 * 8.2.32 Uplink generic NAS transport
3426 nas_emm_dl_gen_nas_trans(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3428 guint32 curr_offset;
3432 curr_offset = offset;
3435 /* Generic message container type Generic message container type 9.9.3.42 M V 1 */
3436 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_EMM_GEN_MSG_CONT_TYPE);
3437 /* Generic message container Generic message container 9.9.3.43 M LV-E 3-n */
3438 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT, "")
3439 /* 65 Additional information Additional information 9.9.2.0 O TLV 3-n */
3444 * 8.3 EPS session management messages
3448 * 8.3.1 Activate dedicated EPS bearer context accept
3451 nas_esm_act_ded_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3453 guint32 curr_offset;
3460 curr_offset = offset;
3463 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3464 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3466 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3470 * 8.3.2 Activate dedicated EPS bearer context reject
3473 nas_esm_act_ded_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3475 guint32 curr_offset;
3479 curr_offset = offset;
3482 /* ESM cause ESM cause 9.9.4.2 M V 1 */
3483 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3484 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3485 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3487 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3490 * 8.3.3 Activate dedicated EPS bearer context request
3493 nas_esm_act_ded_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3495 guint32 curr_offset, bit_offset;
3499 curr_offset = offset;
3502 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
3503 bit_offset = curr_offset<<3;
3504 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
3506 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3507 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, FALSE);
3509 /* Fix the lengths */
3513 /* EPS QoS EPS quality of service 9.9.4.3 M LV 2-10 */
3514 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, "");
3515 /* TFT Traffic flow template 9.9.4.16 M LV 2-256 */
3516 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , "" );
3517 /* 5D Transaction identifier Transaction identifier 9.9.4.17 O TLV 3-4 */
3518 ELEM_OPT_TLV( 0x5d , GSM_A_PDU_TYPE_GM, DE_LINKED_TI , " - Transaction identifier" );
3519 /* 30 Negotiated QoS Quality of service 9.9.4.12 O TLV 14-18 */
3520 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
3521 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
3522 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
3523 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
3524 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , "" );
3525 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
3526 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , "" );
3527 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3528 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3530 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3534 * 8.3.4 Activate default EPS bearer context accept
3537 nas_esm_act_def_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3539 guint32 curr_offset;
3543 curr_offset = offset;
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 , "" );
3552 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3556 * 8.3.5 Activate default EPS bearer context reject
3559 nas_esm_act_def_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3561 guint32 curr_offset;
3565 curr_offset = offset;
3568 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3569 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3570 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3571 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3573 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3577 * 8.3.6 Activate default EPS bearer context request
3580 nas_esm_act_def_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3582 guint32 curr_offset;
3586 curr_offset = offset;
3589 /* EPS QoS EPS quality of service 9.9.4.3 M LV 2-10 */
3590 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, "");
3591 /* Access point name Access point name 9.9.4.1 M LV 2-101 */
3592 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , "" );
3593 /* PDN address PDN address 9.9.4.9 M LV 6-14 DE_ESM_PDN_ADDR*/
3594 ELEM_MAND_LV( NAS_PDU_TYPE_ESM, DE_ESM_PDN_ADDR , "" );
3595 /* 5D Transaction identifier Transaction identifier 9.9.4.17 O TLV 3-4 */
3596 ELEM_OPT_TLV( 0x5d , GSM_A_PDU_TYPE_GM, DE_LINKED_TI , " - Transaction identifier" );
3597 /* 30 Negotiated QoS Quality of service 9.9.4.12 O TLV 14-18 */
3598 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
3599 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
3600 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
3601 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
3602 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , "" );
3603 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
3604 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , "" );
3605 /* 5E APN-AMBR APN aggregate maximum bit rate 9.9.4.2 O TLV 4-8 DE_ESM_APN_AGR_MAX_BR*/
3606 ELEM_OPT_TLV( 0x5e , NAS_PDU_TYPE_ESM, DE_ESM_APN_AGR_MAX_BR , "" );
3607 /* 58 ESM cause ESM cause 9.9.4.4 O TV 2 */
3608 ELEM_OPT_TV( 0x58 , NAS_PDU_TYPE_ESM, DE_ESM_CAUSE , "" );
3609 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3610 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3612 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3616 * 8.3.7 Bearer resource allocation reject
3619 nas_esm_bearer_res_all_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3621 guint32 curr_offset;
3625 curr_offset = offset;
3628 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3629 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3630 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3631 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3633 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3637 * 8.3.8 Bearer resource allocation request
3640 nas_esm_bearer_res_all_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3642 guint32 curr_offset, bit_offset;
3646 curr_offset = offset;
3649 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
3650 bit_offset = curr_offset<<3;
3651 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
3653 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3654 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, FALSE);
3656 /* Fix the lengths */
3660 /* Traffic flow aggregate Traffic flow aggregate description 9.9.4.15 M LV 2-256 */
3661 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , " - Traffic flow aggregate" );
3662 /* Required traffic flow QoS EPS quality of service 9.9.4.3 M LV 2-10 */
3663 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, " - Required traffic flow QoS");
3664 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3665 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3667 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3670 * 8.3.9 Bearer resource modification reject
3673 nas_esm_bearer_res_mod_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3675 guint32 curr_offset;
3679 curr_offset = offset;
3682 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3683 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3684 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3685 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3687 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3690 * 8.3.10 Bearer resource modification request
3693 nas_esm_bearer_res_mod_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3695 guint32 curr_offset, bit_offset;
3699 curr_offset = offset;
3702 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
3703 bit_offset = curr_offset<<3;
3704 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
3706 /* EPS bearer identity for packet filter Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3707 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, FALSE);
3709 /* Fix the lengths */
3712 /* Traffic flow aggregate Traffic flow aggregate description 9.9.4.15 M LV 2-256 */
3713 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , " - Traffic flow aggregate" );
3714 /* 5B Required traffic flow QoS EPS quality of service 9.9.4.3 O TLV 3-11 */
3715 ELEM_OPT_TLV( 0x5B , NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS , " - Required traffic flow QoS" );
3716 /* 58 ESM cause ESM cause 9.9.4.4 O TV 2 */
3717 ELEM_OPT_TV( 0x58 , NAS_PDU_TYPE_ESM, DE_ESM_CAUSE , "" );
3718 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3719 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3721 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3724 * 8.3.11 Deactivate EPS bearer context accept
3727 nas_esm_deact_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3729 guint32 curr_offset;
3733 curr_offset = offset;
3739 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV */
3740 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3742 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3745 * 8.3.12 Deactivate EPS bearer context request
3748 nas_esm_deact_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3750 guint32 curr_offset;
3754 curr_offset = offset;
3757 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3758 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3759 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV */
3760 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3762 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3766 * 8.3.13 ESM information request
3770 nas_esm_inf_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3772 guint32 curr_offset;
3775 curr_offset = offset;
3778 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3781 * 8.3.14 ESM information response
3784 nas_esm_inf_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3786 guint32 curr_offset;
3790 curr_offset = offset;
3796 /* 28 Access point name Access point name 9.9.4.1 O TLV 3-102 */
3797 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , "" );
3798 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3799 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3801 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3807 nas_esm_status(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3809 guint32 curr_offset;
3813 curr_offset = offset;
3816 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3817 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3819 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3822 * 8.3.16 Modify EPS bearer context accept
3825 nas_esm_mod_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3827 guint32 curr_offset;
3831 curr_offset = offset;
3837 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3838 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3840 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3843 * 8.3.17 Modify EPS bearer context reject
3846 nas_esm_mod_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3848 guint32 curr_offset;
3852 curr_offset = offset;
3855 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3856 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3857 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3858 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3860 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3863 * 8.3.18 Modify EPS bearer context request
3866 nas_esm_mod_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3868 guint32 curr_offset;
3872 curr_offset = offset;
3877 /* 5B New EPS QoS EPS quality of service 9.9.4.3 O TLV 3-11 */
3878 ELEM_OPT_TLV( 0x5B , NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS , " - New EPS QoS" );
3879 /* 36 TFT Traffic flow template 9.9.4.16 O TLV 3-257 */
3880 ELEM_OPT_TLV( 0x36 , GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , "" );
3881 /* 30 New QoS Quality of service 9.9.4.12 O TLV 14-18 */
3882 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - New QoS" );
3883 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
3884 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
3885 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
3886 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , "" );
3887 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
3888 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , "" );
3889 /* 5E APN-AMBR APN aggregate maximum bit rate 9.9.4.2 O TLV 4-8 */
3890 ELEM_OPT_TLV( 0x5E , NAS_PDU_TYPE_ESM, DE_ESM_APN_AGR_MAX_BR , "" );
3891 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3892 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3894 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3897 * 8.3.18A Notification
3900 nas_esm_notification(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3902 guint32 curr_offset;
3905 curr_offset = offset;
3908 /* Notification indicator Notification indicator 9.9.4.7A M LV 2 */
3909 proto_tree_add_text(tree, tvb, offset, len, "Not dissected yet");
3913 * 8.3.19 PDN connectivity reject
3916 nas_esm_pdn_con_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3918 guint32 curr_offset;
3922 curr_offset = offset;
3925 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3926 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3927 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3928 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3930 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3934 * 8.3.20 PDN connectivity request
3937 nas_esm_pdn_con_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3939 guint32 curr_offset;
3943 curr_offset = offset;
3946 /* PDN type PDN type 9.9.4.10 M V 1/2 */
3947 proto_tree_add_bits_item(tree, hf_nas_eps_esm_pdn_type, tvb, (curr_offset<<3), 4, FALSE);
3949 /* Request type 9.9.4.14 M V 1/2 */
3950 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_REQ_TYPE);
3952 /* Lengths already fixed by the call to ELEM_MAND_V macro */
3957 /* D- ESM information transfer flag 9.9.4.5 O TV 1 */
3958 ELEM_OPT_TV_SHORT( 0xd0 , NAS_PDU_TYPE_ESM, DE_ESM_INF_TRF_FLG , "" );
3959 /* 28 Access point name 9.9.4.1 O TLV 3-102 */
3960 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , "" );
3961 /* 27 Protocol configuration options 9.9.4.11 O TLV 3-253 */
3962 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3964 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3967 * 8.3.20 PDN disconnect reject
3970 nas_esm_pdn_disc_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3972 guint32 curr_offset;
3976 curr_offset = offset;
3979 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3980 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3981 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3982 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3984 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3987 * 8.3.21 PDN disconnect request
3990 nas_esm_pdn_disc_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3992 guint32 curr_offset, bit_offset;
3996 curr_offset = offset;
3999 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
4000 bit_offset = curr_offset<<3;
4001 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
4003 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
4004 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, FALSE);
4006 /* Fix the lengths */
4011 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
4012 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
4014 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4018 #define NUM_NAS_MSG_ESM (sizeof(nas_msg_esm_strings)/sizeof(value_string))
4019 static gint ett_nas_msg_esm[NUM_NAS_MSG_ESM];
4020 static void (*nas_msg_esm_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
4021 nas_esm_act_def_eps_bearer_ctx_req, /* Activate default EPS bearer context request*/
4022 nas_esm_act_def_eps_bearer_ctx_acc, /* Activate default EPS bearer context accept*/
4023 nas_esm_act_def_eps_bearer_ctx_rej, /* Activate default EPS bearer context reject*/
4024 nas_esm_act_ded_eps_bearer_ctx_req, /* Activate dedicated EPS bearer context request*/
4025 nas_esm_act_ded_eps_bearer_ctx_acc, /* Activate dedicated EPS bearer context accept*/
4026 nas_esm_act_ded_eps_bearer_ctx_rej, /* Activate dedicated EPS bearer context reject*/
4027 nas_esm_mod_eps_bearer_ctx_req, /* Modify EPS bearer context request*/
4028 nas_esm_mod_eps_bearer_ctx_acc, /* Modify EPS bearer context accept*/
4029 nas_esm_mod_eps_bearer_ctx_rej, /* Modify EPS bearer context reject*/
4030 nas_esm_deact_eps_bearer_ctx_req, /* Deactivate EPS bearer context request*/
4031 nas_esm_deact_eps_bearer_ctx_acc, /* Deactivate EPS bearer context accept*/
4032 nas_esm_pdn_con_req, /* 8.3.18 PDN connectivity request */
4033 nas_esm_pdn_con_rej, /* PDN connectivity reject*/
4034 nas_esm_pdn_disc_req, /* PDN disconnect request*/
4035 nas_esm_pdn_disc_rej, /* PDN disconnect reject*/
4036 nas_esm_bearer_res_all_req, /* Bearer resource allocation request*/
4037 nas_esm_bearer_res_all_rej, /* Bearer resource allocation reject*/
4038 nas_esm_bearer_res_mod_req, /* Bearer resource modification request*/
4039 nas_esm_bearer_res_mod_rej, /* Bearer resource modification reject*/
4040 nas_esm_inf_req, /* ESM information request, No IE:s*/
4041 nas_esm_inf_resp, /* ESM information response*/
4042 nas_esm_notification, /* Notification */
4043 nas_esm_status, /* ESM status */
4049 get_nas_esm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p)
4053 *msg_str = match_strval_idx((guint32) (oct & 0xff), nas_msg_esm_strings, &idx);
4054 *ett_tree = ett_nas_msg_esm[idx];
4055 *hf_idx = hf_nas_eps_msg_esm_type;
4056 *msg_fcn_p = nas_msg_esm_fcn[idx];
4063 #define NUM_NAS_MSG_EMM (sizeof(nas_msg_emm_strings)/sizeof(value_string))
4064 static gint ett_nas_msg_emm[NUM_NAS_MSG_EMM];
4065 static void (*nas_msg_emm_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
4066 nas_emm_attach_req, /* Attach request */
4067 nas_emm_attach_acc, /* Attach accept */
4068 nas_emm_attach_comp, /* Attach complete */
4069 nas_emm_attach_rej, /* Attach reject */
4070 nas_emm_detach_req, /* Detach request */
4071 NULL, /* 8.2.10 Detach accept */
4073 nas_emm_trac_area_upd_req, /* Tracking area update request */
4074 nas_emm_trac_area_upd_acc, /* Tracking area update accept */
4075 NULL, /* Tracking area update complete (No IE's)*/
4076 nas_emm_trac_area_upd_rej, /* Tracking area update reject */
4078 nas_emm_ext_serv_req, /* Extended service request */
4079 nas_emm_serv_rej, /* Service reject */
4081 nas_emm_guti_realloc_cmd, /* GUTI reallocation command */
4082 NULL, /* GUTI reallocation complete (No IE's) */
4083 nas_emm_auth_req, /* Authentication request */
4084 nas_emm_auth_resp, /* Authentication response */
4085 NULL, /* Authentication reject (No IE:s)*/
4086 nas_emm_attach_fail, /* Authentication failure */
4087 nas_emm_id_req, /* Identity request */
4088 nas_emm_id_res, /* Identity response */
4089 nas_emm_sec_mode_cmd, /* Security mode command */
4090 nas_emm_sec_mode_comp, /* Security mode complete */
4091 nas_emm_sec_mode_rej, /* Security mode reject */
4093 nas_emm_emm_status, /* EMM status */
4094 nas_emm_emm_inf, /* EMM information */
4095 nas_emm_dl_nas_trans, /* Downlink NAS transport */
4096 nas_emm_ul_nas_trans, /* Uplink NAS transport */
4097 nas_emm_cs_serv_not, /* 8.2.9 CS service notification */
4098 nas_emm_ul_gen_nas_trans, /* Downlink generic NAS transport */
4099 nas_emm_dl_gen_nas_trans, /* Uplink generic NAS transport */
4105 get_nas_emm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p)
4109 *msg_str = match_strval_idx((guint32) (oct & 0xff), nas_msg_emm_strings, &idx);
4110 *ett_tree = ett_nas_msg_emm[idx];
4111 *hf_idx = hf_nas_eps_msg_emm_type;
4112 *msg_fcn_p = nas_msg_emm_fcn[idx];
4118 * EPS session management messages.
4119 * A plain NAS message is pased to this function
4122 disect_nas_eps_esm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
4124 const gchar *msg_str;
4128 void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len);
4131 len = tvb_length(tvb);
4133 * EPS bearer identity 9.3.2
4135 proto_tree_add_item(tree, hf_nas_eps_bearer_id, tvb, offset, 1, FALSE);
4136 /* Protocol discriminator 9.2 */
4137 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, FALSE);
4140 /* Procedure transaction identity 9.4
4141 * The procedure transaction identity and its use are defined in 3GPP TS 24.007
4143 proto_tree_add_item(tree, hf_nas_eps_esm_proc_trans_id, tvb, offset, 1, FALSE);
4147 oct = tvb_get_guint8(tvb,offset);
4153 get_nas_esm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p);
4156 if (check_col(pinfo->cinfo, COL_INFO)){
4157 col_append_fstr(pinfo->cinfo, COL_INFO, " %s ", msg_str);
4160 proto_tree_add_text(tree, tvb, offset, 1,"Unknown message 0x%x",oct);
4165 * Add NAS message name
4167 proto_tree_add_item(tree, hf_idx, tvb, offset, 1, FALSE);
4174 if (msg_fcn_p == NULL)
4176 proto_tree_add_text(tree, tvb, offset, len - offset,
4177 "Message Elements");
4181 /* If calling any "gsm" ie dissectors needing pinfo */
4182 gsm_a_dtap_pinfo = pinfo;
4183 (*msg_fcn_p)(tvb, tree, offset, len - offset);
4188 * The "real" security header has been dissected or if dissect_header = TRUE
4191 dissect_nas_eps_emm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean second_header)
4193 const gchar *msg_str;
4197 void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len);
4198 guint8 security_header_type, oct;
4200 len = tvb_length(tvb);
4202 /* 9.3.1 Security header type */
4204 security_header_type = tvb_get_guint8(tvb,offset)>>4;
4205 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, offset, 1, FALSE);
4206 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, FALSE);
4208 if (security_header_type !=0){
4209 /* Message authentication code */
4210 proto_tree_add_item(tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, FALSE);
4212 /* Sequence number */
4213 proto_tree_add_item(tree, hf_nas_eps_seq_no, tvb, offset, 1, FALSE);
4215 if ((security_header_type==2)||(security_header_type==4))
4216 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
4218 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, offset, 1, FALSE);
4219 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, FALSE);
4224 oct = tvb_get_guint8(tvb,offset);
4230 get_nas_emm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p);
4233 if (check_col(pinfo->cinfo, COL_INFO)){
4234 col_append_fstr(pinfo->cinfo, COL_INFO, " %s ", msg_str);
4237 proto_tree_add_text(tree, tvb, offset, 1,"Unknown message 0x%x",oct);
4242 * Add NAS message name
4244 proto_tree_add_item(tree, hf_idx, tvb, offset, 1, FALSE);
4251 if (msg_fcn_p == NULL)
4253 proto_tree_add_text(tree, tvb, offset, len - offset,
4254 "Message Elements");
4258 /* If calling any "gsm" ie dissectors needing pinfo */
4259 gsm_a_dtap_pinfo = pinfo;
4260 (*msg_fcn_p)(tvb, tree, offset, len - offset);
4265 * 9 General message format and information elements coding
4267 * Within the protocols defined in the present document, every message, except the SERVICE REQUEST message,
4268 * is a standard L3 message as defined in 3GPP TS 24.007 [12]. This means that the message consists of the following parts:
4269 * 1) if the message is a plain NAS message:
4270 * a) protocol discriminator;
4271 * b) EPS bearer identity or security header type;
4272 * c) procedure transaction identity;
4274 * e) other information elements, as required.
4275 * 2) if the message is a security protected NAS message:
4276 * a) protocol discriminator;
4277 * b) security header type;
4278 * c) message authentication code;
4279 * d) sequence number;
4280 * e) plain NAS message, as defined in item 1.
4282 * The EPS bearer identity and the procedure transaction identity are only used in messages
4283 * with protocol discriminator EPS session management. Octet 1a with the procedure transaction
4284 * identity shall only be included in these messages.
4288 * All messages recived here will have the security header:
4289 * Figure 9.1.2: General message organization example for a security protected NAS message
4290 * 9.3.1 Bits 5 to 8 of the first octet of every EPS Mobility Management (EMM)
4291 * message contain the Security header type IE.
4292 * 4.4.4.2 All ESM messages are integrity protected.
4296 dissect_nas_eps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
4299 proto_tree *nas_eps_tree;
4300 guint8 pd, security_header_type;
4303 guint32 msg_auth_code;
4307 len = tvb_length(tvb);
4309 /* make entry in the Protocol column on summary display */
4310 col_append_str(pinfo->cinfo, COL_PROTOCOL, "/NAS-EPS");
4312 item = proto_tree_add_item(tree, proto_nas_eps, tvb, 0, -1, FALSE);
4313 nas_eps_tree = proto_item_add_subtree(item, ett_nas_eps);
4315 /* Security header type Security header type 9.3.1 M V 1/2 */
4316 security_header_type = tvb_get_guint8(tvb,offset)>>4;
4317 proto_tree_add_item(nas_eps_tree, hf_nas_eps_security_header_type, tvb, 0, 1, FALSE);
4318 /* Protocol discriminator Protocol discriminator 9.2 M V 1/2 */
4319 proto_tree_add_item(nas_eps_tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, FALSE);
4320 pd = tvb_get_guint8(tvb,offset)&0x0f;
4322 /* Message authentication code Message authentication code 9.5 M V 4 */
4323 if (security_header_type == 0){
4325 /* Plain EPS mobility management messages. */
4326 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, FALSE);
4329 proto_tree_add_text(tree, tvb, offset, len, "All ESM messages should be integrity protected");
4333 /* SERVICE REQUEST (12) is not a plain NAS message treat separately */
4334 if (security_header_type == 12){
4335 nas_emm_service_req(tvb, nas_eps_tree, offset, len-offset);
4338 /* Message authentication code */
4339 proto_tree_add_item(nas_eps_tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, FALSE);
4340 msg_auth_code = tvb_get_ntohl(tvb, offset);
4342 if ((security_header_type==2)||(security_header_type==4)){
4343 /* Possible ciphered message */
4344 if(msg_auth_code!=0){
4345 /* Sequence number Sequence number 9.6 M V 1 */
4346 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, FALSE);
4348 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
4349 pd = tvb_get_guint8(tvb,offset)&0x0f;
4350 /* If pd is in plaintext this message probably isn't ciphered */
4351 if((pd!=7)&&(pd!=2)&&(pd!=15)){
4352 proto_tree_add_text(nas_eps_tree, tvb, offset, len-6,"Ciphered message");
4356 /* msg_auth_code == 0, probably not ciphered */
4357 /* Sequence number Sequence number 9.6 M V 1 */
4358 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, FALSE);
4362 /* Sequence number Sequence number 9.6 M V 1 */
4363 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, FALSE);
4367 /* NAS message NAS message 9.7 M V 1-n */
4369 pd = tvb_get_guint8(tvb,offset)&0x0f;
4372 /* EPS session management messages.
4373 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4375 disect_nas_eps_esm_msg(tvb, pinfo, nas_eps_tree, offset);
4378 /* EPS mobility management messages.
4379 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4381 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, TRUE);
4384 /* Special conformance testing functions for User Equipment messages.
4385 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4387 if (gsm_a_dtap_handle){
4388 tvbuff_t *new_tvb = tvb_new_subset(tvb, offset, -1, -1);
4389 gsm_a_dtap_pinfo = pinfo;
4390 call_dissector(gsm_a_dtap_handle, new_tvb, gsm_a_dtap_pinfo, nas_eps_tree);
4392 } /* else fall through default */
4394 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"));
4401 dissect_nas_eps_plain(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
4404 proto_tree *nas_eps_tree;
4411 len = tvb_length(tvb);
4413 /* make entry in the Protocol column on summary display */
4414 col_append_str(pinfo->cinfo, COL_PROTOCOL, "/NAS-EPS");
4416 item = proto_tree_add_item(tree, proto_nas_eps, tvb, 0, -1, FALSE);
4417 nas_eps_tree = proto_item_add_subtree(item, ett_nas_eps);
4419 pd = tvb_get_guint8(tvb,offset)&0x0f;
4422 /* EPS session management messages.
4423 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4425 disect_nas_eps_esm_msg(tvb, pinfo, nas_eps_tree, offset);
4428 /* EPS mobility management messages.
4429 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4431 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, TRUE);
4434 /* Special conformance testing functions for User Equipment messages.
4435 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4437 if (gsm_a_dtap_handle){
4438 tvbuff_t *new_tvb = tvb_new_subset(tvb, offset, -1, -1);
4439 gsm_a_dtap_pinfo = pinfo;
4440 call_dissector(gsm_a_dtap_handle, new_tvb, gsm_a_dtap_pinfo, nas_eps_tree);
4442 } /* else fall through default */
4444 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"));
4450 void proto_register_nas_eps(void) {
4454 /* List of fields */
4456 static hf_register_info hf[] = {
4457 { &hf_nas_eps_msg_emm_type,
4458 { "NAS EPS Mobility Management Message Type", "nas_eps.nas_msg_emm_type",
4459 FT_UINT8, BASE_HEX, VALS(nas_msg_emm_strings), 0x0,
4462 { &hf_nas_eps_common_elem_id,
4463 { "Element ID", "nas_eps.common.elem_id",
4464 FT_UINT8, BASE_DEC, NULL, 0,
4467 { &hf_nas_eps_emm_elem_id,
4468 { "Element ID", "nas_eps.emm.elem_id",
4469 FT_UINT8, BASE_DEC, NULL, 0,
4472 { &hf_nas_eps_bearer_id,
4473 { "EPS bearer identity", "nas_eps.bearer_id",
4474 FT_UINT8, BASE_HEX, NULL, 0xf0,
4477 { &hf_nas_eps_spare_bits,
4478 { "Spare bit(s)", "nas_eps.spare_bits",
4479 FT_UINT8, BASE_HEX, NULL, 0x0,
4482 { &hf_nas_eps_security_header_type,
4483 { "Security header type","nas_eps.security_header_type",
4484 FT_UINT8,BASE_DEC, VALS(security_header_type_vals), 0xf0,
4487 { &hf_nas_eps_msg_auth_code,
4488 { "Message authentication code","nas_eps.msg_auth_code",
4489 FT_UINT32,BASE_HEX, NULL, 0x0,
4492 { &hf_nas_eps_seq_no,
4493 { "Sequence number","nas_eps.seq_no",
4494 FT_UINT8,BASE_DEC, NULL, 0x0,
4497 { &hf_nas_eps_seq_no_short,
4498 { "Sequence number (short)","nas_eps.seq_no_short",
4499 FT_UINT8,BASE_DEC, NULL, 0x0,
4502 { &hf_nas_eps_emm_ebi0,
4503 { "EBI(0) spare","nas_eps.emm.ebi0",
4504 FT_BOOLEAN, 8, NULL, 0x01,
4507 { &hf_nas_eps_emm_ebi1,
4508 { "EBI(1) spare","nas_eps.emm.ebi1",
4509 FT_BOOLEAN, 8, NULL, 0x02,
4512 { &hf_nas_eps_emm_ebi2,
4513 { "EBI(2) spare","nas_eps.emm.ebi2",
4514 FT_BOOLEAN, 8, NULL, 0x04,
4517 { &hf_nas_eps_emm_ebi3,
4518 { "EBI(3) spare","nas_eps.emm.ebi3",
4519 FT_BOOLEAN, 8, NULL, 0x08,
4522 { &hf_nas_eps_emm_ebi4,
4523 { "EBI(4) spare","nas_eps.emm.ebi4",
4524 FT_BOOLEAN, 8, NULL, 0x10,
4527 { &hf_nas_eps_emm_ebi5,
4528 { "EBI(5)","nas_eps.emm.ebi5",
4529 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x20,
4532 { &hf_nas_eps_emm_ebi6,
4533 { "EBI(6)","nas_eps.emm.ebi6",
4534 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x40,
4537 { &hf_nas_eps_emm_ebi7,
4538 { "EBI(7)","nas_eps.emm.ebi7",
4539 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x80,
4542 { &hf_nas_eps_emm_ebi8,
4543 { "EBI(8)","nas_eps.emm.ebi8",
4544 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x01,
4547 { &hf_nas_eps_emm_ebi9,
4548 { "EBI(9)","nas_eps.emm.ebi9",
4549 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x02,
4552 { &hf_nas_eps_emm_ebi10,
4553 { "EBI(10)","nas_eps.emm.ebi10",
4554 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x04,
4557 { &hf_nas_eps_emm_ebi11,
4558 { "EBI(11)","nas_eps.emm.ebi11",
4559 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x08,
4562 { &hf_nas_eps_emm_ebi12,
4563 { "EBI(12)","nas_eps.emm.ebi12",
4564 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x10,
4567 { &hf_nas_eps_emm_ebi13,
4568 { "EBI(13)","nas_eps.emm.ebi13",
4569 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x20,
4572 { &hf_nas_eps_emm_ebi14,
4573 { "EBI(14)","nas_eps.emm.ebi14",
4574 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x40,
4577 { &hf_nas_eps_emm_ebi15,
4578 { "EBI(15)","nas_eps.emm.ebi15",
4579 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x80,
4582 { &hf_nas_eps_emm_dl_nas_cnt,
4583 { "DL NAS COUNT value","nas_eps.emm.dl_nas_cnt",
4584 FT_UINT8,BASE_DEC, NULL, 0x0f,
4587 {&hf_nas_eps_emm_nounce_mme,
4588 { "NonceMME","nas_eps.emm.nounce_mme",
4589 FT_UINT32,BASE_HEX, NULL, 0x0,
4592 { &hf_nas_eps_emm_eps_att_type,
4593 { "EPS attach type","nas_eps.emm.eps_att_type",
4594 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_att_type_vals), 0x0,
4597 { &hf_nas_eps_emm_cs_lcs_type,
4598 { "CS-LCS","nas_eps.emm.cs_lcs",
4599 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_cs_lcs_vals), 0x0,
4600 "Location services indicator in CS", HFILL }
4602 { &hf_nas_eps_emm_epc_lcs_type,
4603 { "EPC-LCS","nas_eps.emm.epc_lcs",
4604 FT_BOOLEAN ,BASE_NONE, TFS(&nas_eps_emm_epc_lcs_value), 0x0,
4605 "Location services indicator in EPC", HFILL }
4607 { &hf_nas_eps_emm_emc_bs_type,
4608 { "EMC BS","nas_eps.emm.emc_bs",
4609 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_emc_bs_value), 0x0,
4610 "Emergency bearer services indicator", HFILL }
4612 { &hf_nas_eps_emm_ims_vops_type,
4613 { "IMS VoPS","nas_eps.emm.ims_vops",
4614 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_ims_vops_value), 0x0,
4615 "IMS voice over PS session indicator", HFILL }
4618 { "Type of security context flag (TSC)","nas_eps.emm.tsc",
4619 FT_UINT8,BASE_DEC, VALS(nas_eps_tsc_vals), 0x0,
4622 { &hf_nas_eps_emm_nas_key_set_id,
4623 { "NAS key set identifier","nas_eps.emm.nas_key_set_id",
4624 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_NAS_key_set_identifier_vals), 0x0,
4627 { &hf_nas_eps_emm_odd_even,
4628 { "odd/even indic","nas_eps.emm.odd_even",
4629 FT_UINT8,BASE_DEC, NULL, 0x8,
4632 { &hf_nas_eps_emm_type_of_id,
4633 { "Type of identity","nas_eps.emm.type_of_id",
4634 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_id_vals), 0x07,
4637 { &hf_nas_eps_emm_mme_grp_id,
4638 { "MME Group ID","nas_eps.emm.mme_grp_id",
4639 FT_UINT16, BASE_DEC, NULL, 0x0,
4642 { &hf_nas_eps_emm_imsi,
4643 { "IMSI", "nas_eps.emm.imsi",
4644 FT_STRING, BASE_NONE, NULL, 0,
4647 { &hf_nas_eps_emm_imei,
4648 { "IMEI", "nas_eps.emm.imei",
4649 FT_STRING, BASE_NONE, NULL, 0,
4652 { &hf_nas_eps_emm_mme_code,
4653 { "MME Code","nas_eps.emm.mme_code",
4654 FT_UINT8, BASE_DEC, NULL, 0x0,
4657 { &hf_nas_eps_emm_m_tmsi,
4658 { "M-TMSI","nas_eps.emm.m_tmsi",
4659 FT_UINT32, BASE_HEX, NULL, 0x0,
4662 { &hf_nas_eps_esm_msg_cont,
4663 { "ESM message container contents","nas_eps.emm.esm_msg_cont",
4664 FT_BYTES, BASE_NONE, NULL, 0x0,
4667 { &hf_nas_eps_esm_imeisv_req,
4668 { "IMEISV request","nas_eps.emm.imeisv_req",
4669 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_imeisv_req_vals), 0x07,
4672 { &hf_nas_eps_emm_toi,
4673 { "Type of integrity protection algorithm","nas_eps.emm.toi",
4674 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_toi_vals), 0x07,
4677 { &hf_nas_eps_emm_toc,
4678 { "Type of ciphering algorithm","nas_eps.emm.toc",
4679 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_toc_vals), 0x70,
4682 { &hf_nas_eps_emm_EPS_attach_result,
4683 { "Attach result","nas_eps.emm.EPS_attach_result",
4684 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_EPS_attach_result_values), 0x0,
4687 { &hf_nas_eps_emm_spare_half_octet,
4688 { "Spare half octet","nas_eps.emm.EPS_attach_result",
4689 FT_UINT8,BASE_DEC, NULL, 0x0,
4692 { &hf_nas_eps_emm_add_upd_res,
4693 { "AURV","nas_eps.emm.add_upd_res",
4694 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_add_upd_res_vals), 0x0,
4695 "Additional update result value", HFILL }
4697 { &hf_nas_eps_emm_add_upd_type,
4698 { "AUTV","nas_eps.emm.add_upd_type",
4699 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_add_upd_type_vals), 0x0,
4700 "Additional update type value", HFILL }
4702 { &hf_nas_eps_emm_res,
4703 { "RES","nas_eps.emm.res",
4704 FT_BYTES, BASE_NONE, NULL, 0x0,
4707 { &hf_nas_eps_emm_csfb_resp,
4708 { "CSFB response","nas_eps.emm.csfb_resp",
4709 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_csfb_resp_vals), 0x03,
4712 { &hf_nas_eps_emm_cause,
4713 { "Cause","nas_eps.emm.cause",
4714 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_cause_values), 0x0,
4717 { &hf_nas_eps_emm_id_type2,
4718 { "Identity type 2","nas_eps.emm.id_type2",
4719 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_id_type2_vals), 0x0,
4722 { &hf_nas_eps_emm_short_mac,
4723 { "Message authentication code (short)","nas_eps.emm.short_mac",
4724 FT_UINT16, BASE_HEX, NULL, 0x0,
4727 { &hf_nas_eps_emm_tai_tol,
4728 { "Type of list","nas_eps.emm.tai_tol",
4729 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_tai_tol_vals), 0x60,
4732 { &hf_nas_eps_emm_tai_n_elem,
4733 { "Number of elements","nas_eps.emm.tai_n_elem",
4734 FT_UINT8, BASE_DEC, NULL, 0x1f,
4737 { &hf_nas_eps_emm_tai_tac,
4738 { "Tracking area code(TAC)","nas_eps.emm.tai_tac",
4739 FT_UINT16, BASE_HEX, NULL, 0x0,
4742 { &hf_nas_eps_emm_eea0,
4743 { "EEA0","nas_eps.emm.eea0",
4744 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
4747 { &hf_nas_eps_emm_128eea1,
4748 { "128-EEA1","nas_eps.emm.128eea1",
4749 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4752 { &hf_nas_eps_emm_128eea2,
4753 { "128-EEA2","nas_eps.emm.128eea2",
4754 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4757 { &hf_nas_eps_emm_eea3,
4758 { "EEA3","nas_eps.emm.eea3",
4759 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4762 { &hf_nas_eps_emm_eea4,
4763 { "EEA4","nas_eps.emm.eea4",
4764 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4767 { &hf_nas_eps_emm_eea5,
4768 { "EEA5","nas_eps.emm.eea5",
4769 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4772 { &hf_nas_eps_emm_eea6,
4773 { "EEA6","nas_eps.emm.eea6",
4774 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4777 { &hf_nas_eps_emm_eea7,
4778 { "EEA7","nas_eps.emm.eea7",
4779 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4782 { &hf_nas_eps_emm_eia0,
4783 { "EIA0","nas_eps.emm.eia0",
4784 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
4787 { &hf_nas_eps_emm_128eia1,
4788 { "128-EIA1","nas_eps.emm.128eia1",
4789 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4792 { &hf_nas_eps_emm_128eia2,
4793 { "128-EIA2","nas_eps.emm.128eia2",
4794 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4797 { &hf_nas_eps_emm_eia3,
4798 { "EIA3","nas_eps.emm.eia3",
4799 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4802 { &hf_nas_eps_emm_eia4,
4803 { "EIA4","nas_eps.emm.eia4",
4804 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4807 { &hf_nas_eps_emm_eia5,
4808 { "EIA5","nas_eps.emm.eia5",
4809 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4812 { &hf_nas_eps_emm_eia6,
4813 { "EIA6","nas_eps.emm.eia6",
4814 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4817 { &hf_nas_eps_emm_eia7,
4818 { "EIA7","nas_eps.emm.eia7",
4819 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4824 { &hf_nas_eps_emm_uea0,
4825 { "UEA0","nas_eps.emm.uea0",
4826 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
4829 { &hf_nas_eps_emm_uea1,
4830 { "UEA1","nas_eps.emm.uea1",
4831 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4834 { &hf_nas_eps_emm_uea2,
4835 { "UEA2","nas_eps.emm.uea2",
4836 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4839 { &hf_nas_eps_emm_uea3,
4840 { "UEA3","nas_eps.emm.uea3",
4841 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4844 { &hf_nas_eps_emm_uea4,
4845 { "UEA4","nas_eps.emm.uea4",
4846 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4849 { &hf_nas_eps_emm_uea5,
4850 { "UEA5","nas_eps.emm.uea5",
4851 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4854 { &hf_nas_eps_emm_uea6,
4855 { "UEA6","nas_eps.emm.uea6",
4856 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4859 { &hf_nas_eps_emm_uea7,
4860 { "UEA7","nas_eps.emm.uea7",
4861 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4864 { &hf_nas_eps_emm_ucs2_supp,
4865 { "UCS2 support (UCS2)","nas_eps.emm.emm_ucs2_supp",
4866 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ucs2_supp_flg_value), 0x80,
4869 { &hf_nas_eps_emm_uia0,
4870 { "UMTS integrity algorithm UIA0","nas_eps.emm.uia0",
4871 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
4874 { &hf_nas_eps_emm_uia1,
4875 { "UMTS integrity algorithm UIA1","nas_eps.emm.uia1",
4876 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4879 { &hf_nas_eps_emm_uia2,
4880 { "UMTS integrity algorithm UIA2","nas_eps.emm.uia2",
4881 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4884 { &hf_nas_eps_emm_uia3,
4885 { "UMTS integrity algorithm UIA3","nas_eps.emm.uia3",
4886 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4889 { &hf_nas_eps_emm_uia4,
4890 { "UMTS integrity algorithm UIA4","nas_eps.emm.uia4",
4891 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4894 { &hf_nas_eps_emm_uia5,
4895 { "UMTS integrity algorithm UIA5","nas_eps.emm.uia5",
4896 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4899 { &hf_nas_eps_emm_uia6,
4900 { "UMTS integrity algorithm UIA6","nas_eps.emm.uia6",
4901 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4904 { &hf_nas_eps_emm_uia7,
4905 { "UMTS integrity algorithm UIA7","nas_eps.emm.uia7",
4906 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4909 { &hf_nas_eps_emm_gea1,
4910 { "GPRS encryption algorithm GEA1","nas_eps.emm.gea1",
4911 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4914 { &hf_nas_eps_emm_gea2,
4915 { "GPRS encryption algorithm GEA2","nas_eps.emm.gea2",
4916 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4919 { &hf_nas_eps_emm_gea3,
4920 { "GPRS encryption algorithm GEA3","nas_eps.emm.gea3",
4921 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4924 { &hf_nas_eps_emm_gea4,
4925 { "GPRS encryption algorithm GEA4","nas_eps.emm.gea4",
4926 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4929 { &hf_nas_eps_emm_gea5,
4930 { "GPRS encryption algorithm GEA5","nas_eps.emm.gea5",
4931 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4934 { &hf_nas_eps_emm_gea6,
4935 { "GPRS encryption algorithm GEA6","nas_eps.emm.gea6",
4936 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4939 { &hf_nas_eps_emm_gea7,
4940 { "GPRS encryption algorithm GEA7","nas_eps.emm.gea7",
4941 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4945 { &hf_nas_eps_emm_1xsrvcc_cap,
4946 { "1xSRVCC capability","nas_eps.emm.1xsrvcc_cap",
4947 FT_BOOLEAN, 8, TFS(&nas_eps_emm_1xsrvcc_cap_flg), 0x02,
4950 { &hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg,
4951 { "1xSRVCC capability","nas_eps.emm.ue_ra_cap_inf_upd_need_flg",
4952 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ue_ra_cap_inf_upd_need_flg), 0x01,
4955 { &hf_nas_eps_emm_ss_code,
4956 { "SS Code","nas_eps.emm.eps_update_result_value",
4957 FT_UINT8,BASE_DEC, VALS(ssCode_vals), 0x0,
4960 { &hf_nas_eps_emm_lcs_ind,
4961 { "LCS indicator","nas_eps.emm.emm_lcs_ind",
4962 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_lcs_ind_vals), 0x0,
4965 { &hf_nas_eps_emm_apn_ambr_ul,
4966 { "APN-AMBR for uplink","nas_eps.emm.apn_ambr_ul",
4967 FT_UINT8,BASE_DEC, NULL, 0x0,
4970 { &hf_nas_eps_emm_apn_ambr_dl,
4971 { "APN-AMBR for downlink","nas_eps.emm.apn_ambr_dl",
4972 FT_UINT8,BASE_DEC, NULL, 0x0,
4975 { &hf_nas_eps_emm_apn_ambr_ul_ext,
4976 { "APN-AMBR for uplink(Extended)","nas_eps.emm.apn_ambr_ul_ext",
4977 FT_UINT8,BASE_DEC, NULL, 0x0,
4980 { &hf_nas_eps_emm_apn_ambr_dl_ext,
4981 { "APN-AMBR for downlink(Extended)","nas_eps.emm.apn_ambr_dl_ext",
4982 FT_UINT8,BASE_DEC, NULL, 0x0,
4985 { &hf_nas_eps_emm_apn_ambr_ul_ext2,
4986 { "APN-AMBR for uplink(Extended-2)","nas_eps.emm.apn_ambr_ul_ext2",
4987 FT_UINT8,BASE_DEC, NULL, 0x0,
4990 { &hf_nas_eps_emm_apn_ambr_dl_ext2,
4991 { "APN-AMBR for downlink(Extended-2)","nas_eps.emm.apn_ambr_dl_ext2",
4992 FT_UINT8,BASE_DEC, NULL, 0x0,
4995 { &hf_nas_eps_emm_switch_off,
4996 { "Switch off","nas_eps.emm.switch_off",
4997 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_switch_off_vals), 0x0,
5000 { &hf_nas_eps_emm_detach_type_UL,
5001 { "Detach Type","nas_eps.emm.detach_type_ul",
5002 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_dtatch_UL_vals), 0x0,
5005 { &hf_nas_eps_emm_detach_type_DL,
5006 { "Detach Type","nas_eps.emm.detach_type_dl",
5007 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_dtatch_DL_vals), 0x0,
5011 { "Quality of Service Class Identifier (QCI)","nas_eps.emm.qci",
5012 FT_UINT8,BASE_DEC, VALS(nas_eps_qci_vals), 0x0,
5015 { &hf_nas_eps_mbr_ul,
5016 { "Maximum bit rate for uplink","nas_eps.emm.mbr_ul",
5017 FT_UINT8,BASE_DEC, NULL, 0x0,
5020 { &hf_nas_eps_mbr_dl,
5021 { "Maximum bit rate for downlink","nas_eps.emm.mbr_dl",
5022 FT_UINT8,BASE_DEC, NULL, 0x0,
5025 { &hf_nas_eps_gbr_ul,
5026 { "Guaranteed bit rate for uplink","nas_eps.emm.gbr_ul",
5027 FT_UINT8,BASE_DEC, NULL, 0x0,
5030 { &hf_nas_eps_gbr_dl,
5031 { "Guaranteed bit rate for downlink","nas_eps.emm.gbr_dl",
5032 FT_UINT8,BASE_DEC, NULL, 0x0,
5035 { &hf_nas_eps_embr_ul,
5036 { "Maximum bit rate for uplink(ext)","nas_eps.emm.embr_ul",
5037 FT_UINT8,BASE_DEC, NULL, 0x0,
5040 { &hf_nas_eps_embr_dl,
5041 { "Maximum bit rate for downlink(ext)","nas_eps.emm.embr_dl",
5042 FT_UINT8,BASE_DEC, NULL, 0x0,
5045 { &hf_nas_eps_egbr_ul,
5046 { "Guaranteed bit rate for uplink(ext)","nas_eps.emm.egbr_ul",
5047 FT_UINT8,BASE_DEC, NULL, 0x0,
5050 { &hf_nas_eps_egbr_dl,
5051 { "Guaranteed bit rate for downlink(ext)","nas_eps.emm.egbr_dl",
5052 FT_UINT8,BASE_DEC, NULL, 0x0,
5055 { &hf_nas_eps_esm_cause,
5056 { "Cause","nas_eps.esm.cause",
5057 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_cause_vals), 0x0,
5060 { &hf_nas_eps_esm_eit,
5061 { "EIT (ESM information transfer)", "nas_eps.emm.eit",
5062 FT_BOOLEAN, 8, TFS(&nas_eps_emm_active_flg_value), 0x01,
5065 { &hf_nas_eps_esm_lnkd_eps_bearer_id,
5066 { "Linked EPS bearer identity","nas_eps.esm.lnkd_eps_bearer_id",
5067 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_linked_bearer_id_vals), 0x0f,
5070 { &hf_nas_eps_esm_pdn_ipv4,
5071 {"PDN IPv4", "nas_eps.esm.pdn_ipv4",
5072 FT_IPv4, BASE_NONE, NULL, 0x0,
5075 { &hf_nas_eps_esm_pdn_ipv6_if_id,
5076 {"PDN IPv6 if id", "nas_eps.esm.pdn_ipv6_if_id",
5077 FT_BYTES, BASE_NONE, NULL, 0x0,
5080 { &hf_nas_eps_esm_linked_bearer_id,
5081 { "Linked EPS bearer identity","nas_eps.esm.linked_bearer_id",
5082 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_linked_bearer_id_vals), 0x0,
5085 { &hf_nas_eps_active_flg,
5086 { "Active flag", "nas_eps.emm.active_flg",
5087 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_active_flg_value), 0x0,
5090 { &hf_nas_eps_eps_update_result_value,
5091 { "EPS update result value","nas_eps.emm.eps_update_result_value",
5092 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_update_result_vals), 0x0,
5095 { &hf_nas_eps_eps_update_type_value,
5096 { "EPS update type value", "nas_eps.emm.update_type_value",
5097 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_update_type_vals), 0x0,
5100 { &hf_nas_eps_service_type,
5101 { "Service type", "nas_eps.emm.service_type",
5102 FT_UINT8,BASE_DEC, VALS(nas_eps_service_type_vals), 0x0,
5105 /* ESM hf cvariables */
5106 { &hf_nas_eps_msg_esm_type,
5107 { "NAS EPS session management messages", "nas_eps.nas_msg_esm_type",
5108 FT_UINT8, BASE_HEX, VALS(nas_msg_esm_strings), 0x0,
5111 { &hf_nas_eps_esm_elem_id,
5112 { "Element ID", "nas_eps.esm.elem_id",
5113 FT_UINT8, BASE_DEC, NULL, 0,
5116 { &hf_nas_eps_esm_proc_trans_id,
5117 { "Procedure transaction identity", "nas_eps.esm.proc_trans_id",
5118 FT_UINT8, BASE_DEC, NULL, 0,
5121 { &hf_nas_eps_esm_pdn_type,
5122 { "PDN type", "nas_eps.nas_eps_esm_pdn_type",
5123 FT_UINT8, BASE_DEC, VALS(nas_eps_esm_pdn_type_values), 0x0,
5128 /* Setup protocol subtree array */
5129 #define NUM_INDIVIDUAL_ELEMS 2
5130 gint *ett[NUM_INDIVIDUAL_ELEMS +
5131 NUM_NAS_EPS_COMMON_ELEM +
5132 NUM_NAS_MSG_EMM + NUM_NAS_EMM_ELEM+
5133 NUM_NAS_MSG_ESM + NUM_NAS_ESM_ELEM];
5135 ett[0] = &ett_nas_eps;
5136 ett[1] = &ett_nas_eps_esm_msg_cont;
5138 last_offset = NUM_INDIVIDUAL_ELEMS;
5140 for (i=0; i < NUM_NAS_EPS_COMMON_ELEM; i++, last_offset++)
5142 ett_nas_eps_common_elem[i] = -1;
5143 ett[last_offset] = &ett_nas_eps_common_elem[i];
5147 for (i=0; i < NUM_NAS_MSG_EMM; i++, last_offset++)
5149 ett_nas_msg_emm[i] = -1;
5150 ett[last_offset] = &ett_nas_msg_emm[i];
5153 for (i=0; i < NUM_NAS_EMM_ELEM; i++, last_offset++)
5155 ett_nas_eps_emm_elem[i] = -1;
5156 ett[last_offset] = &ett_nas_eps_emm_elem[i];
5159 for (i=0; i < NUM_NAS_MSG_ESM; i++, last_offset++)
5161 ett_nas_msg_esm[i] = -1;
5162 ett[last_offset] = &ett_nas_msg_esm[i];
5165 for (i=0; i < NUM_NAS_ESM_ELEM; i++, last_offset++)
5167 ett_nas_eps_esm_elem[i] = -1;
5168 ett[last_offset] = &ett_nas_eps_esm_elem[i];
5171 /* Register protocol */
5172 proto_nas_eps = proto_register_protocol(PNAME, PSNAME, PFNAME);
5173 /* Register fields and subtrees */
5174 proto_register_field_array(proto_nas_eps, hf, array_length(hf));
5175 proto_register_subtree_array(ett, array_length(ett));
5177 /* Register dissector */
5178 register_dissector(PFNAME, dissect_nas_eps, proto_nas_eps);
5180 /* Register dissector */
5181 register_dissector("nas-eps_plain", dissect_nas_eps_plain, proto_nas_eps);
5185 proto_reg_handoff_nas_eps(void)
5188 gsm_a_dtap_handle = find_dissector("gsm_a_dtap");