2 * Routines for Non-Access-Stratum (NAS) protocol for Evolved Packet System (EPS) dissection
4 * Copyright 2008 - 2009, 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 V8.0.0 (2008-12) and V8.1.0 Draft v5
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_emm_ebi0 = -1;
63 static int hf_nas_eps_emm_ebi1 = -1;
64 static int hf_nas_eps_emm_ebi2 = -1;
65 static int hf_nas_eps_emm_ebi3 = -1;
66 static int hf_nas_eps_emm_ebi4 = -1;
67 static int hf_nas_eps_emm_ebi5 = -1;
68 static int hf_nas_eps_emm_ebi6 = -1;
69 static int hf_nas_eps_emm_ebi7 = -1;
70 static int hf_nas_eps_emm_ebi8 = -1;
71 static int hf_nas_eps_emm_ebi9 = -1;
72 static int hf_nas_eps_emm_ebi10 = -1;
73 static int hf_nas_eps_emm_ebi11 = -1;
74 static int hf_nas_eps_emm_ebi12 = -1;
75 static int hf_nas_eps_emm_ebi13 = -1;
76 static int hf_nas_eps_emm_ebi14 = -1;
77 static int hf_nas_eps_emm_ebi15 = -1;
78 static int hf_nas_eps_emm_dl_nas_cnt = -1;
79 static int hf_nas_eps_emm_nounce_mme = -1;
80 static int hf_nas_eps_emm_eps_att_type = -1;
81 static int hf_nas_eps_emm_nas_key_set_id = -1;
82 static int hf_nas_eps_tsc = -1;
83 static int hf_nas_eps_emm_odd_even = -1;
84 static int hf_nas_eps_emm_type_of_id = -1;
85 static int hf_nas_eps_emm_mme_grp_id = -1;
86 static int hf_nas_eps_emm_imsi = -1;
87 static int hf_nas_eps_emm_mme_code = -1;
88 static int hf_nas_eps_emm_m_tmsi = -1;
89 static int hf_nas_eps_esm_msg_cont = -1;
90 static int hf_nas_eps_esm_imeisv_req = -1;
91 static int hf_nas_eps_emm_toi = -1;
92 static int hf_nas_eps_emm_toc = -1;
93 static int hf_nas_eps_emm_EPS_attach_result = -1;
94 static int hf_nas_eps_emm_spare_half_octet = -1;
95 static int hf_nas_eps_emm_res = -1;
96 static int hf_nas_eps_emm_csfb_resp = -1;
97 static int hf_nas_eps_emm_cause = -1;
98 static int hf_nas_eps_emm_id_type2 = -1;
99 static int hf_nas_eps_emm_short_mac = -1;
100 static int hf_nas_eps_emm_tai_tol = -1;
101 static int hf_nas_eps_emm_tai_n_elem = -1;
102 static int hf_nas_eps_emm_tai_tac = -1;
103 static int hf_nas_eps_emm_128eea0 = -1;
104 static int hf_nas_eps_emm_128eea1 = -1;
105 static int hf_nas_eps_emm_128eea2 = -1;
106 static int hf_nas_eps_emm_eea3 = -1;
107 static int hf_nas_eps_emm_eea4 = -1;
108 static int hf_nas_eps_emm_eea5 = -1;
109 static int hf_nas_eps_emm_eea6 = -1;
110 static int hf_nas_eps_emm_eea7 = -1;
111 static int hf_nas_eps_emm_128eia1 = -1;
112 static int hf_nas_eps_emm_128eia2 = -1;
113 static int hf_nas_eps_emm_eia3 = -1;
114 static int hf_nas_eps_emm_eia4 = -1;
115 static int hf_nas_eps_emm_eia5 = -1;
116 static int hf_nas_eps_emm_eia6 = -1;
117 static int hf_nas_eps_emm_eia7 = -1;
118 static int hf_nas_eps_emm_uea0 = -1;
119 static int hf_nas_eps_emm_uea1 = -1;
120 static int hf_nas_eps_emm_uea2 = -1;
121 static int hf_nas_eps_emm_uea3 = -1;
122 static int hf_nas_eps_emm_uea4 = -1;
123 static int hf_nas_eps_emm_uea5 = -1;
124 static int hf_nas_eps_emm_uea6 = -1;
125 static int hf_nas_eps_emm_uea7 = -1;
126 static int hf_nas_eps_emm_ucs2_supp = -1;
127 static int hf_nas_eps_emm_uia0 = -1;
128 static int hf_nas_eps_emm_uia1 = -1;
129 static int hf_nas_eps_emm_uia2 = -1;
130 static int hf_nas_eps_emm_uia3 = -1;
131 static int hf_nas_eps_emm_uia4 = -1;
132 static int hf_nas_eps_emm_uia5 = -1;
133 static int hf_nas_eps_emm_uia6 = -1;
134 static int hf_nas_eps_emm_uia7 = -1;
135 static int hf_nas_eps_emm_gea1 = -1;
136 static int hf_nas_eps_emm_gea2 = -1;
137 static int hf_nas_eps_emm_gea3 = -1;
138 static int hf_nas_eps_emm_gea4 = -1;
139 static int hf_nas_eps_emm_gea5 = -1;
140 static int hf_nas_eps_emm_gea6 = -1;
141 static int hf_nas_eps_emm_gea7 = -1;
142 static int hf_nas_eps_emm_1xsrvcc_cap = -1;
143 static int hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg;
144 static int hf_nas_eps_emm_ss_code = -1;
145 static int hf_nas_eps_emm_lcs_ind = -1;
146 static int hf_nas_eps_emm_apn_ambr_ul = -1;
147 static int hf_nas_eps_emm_apn_ambr_dl = -1;
148 static int hf_nas_eps_emm_apn_ambr_ul_ext = -1;
149 static int hf_nas_eps_emm_apn_ambr_dl_ext = -1;
150 static int hf_nas_eps_emm_apn_ambr_ul_ext2 = -1;
151 static int hf_nas_eps_emm_apn_ambr_dl_ext2 = -1;
153 static int hf_nas_eps_emm_switch_off = -1;
154 static int hf_nas_eps_emm_detach_type_UL = -1;
155 static int hf_nas_eps_emm_detach_type_DL = -1;
157 static int hf_nas_eps_qci = -1;
158 static int hf_nas_eps_mbr_ul = -1;
159 static int hf_nas_eps_mbr_dl = -1;
160 static int hf_nas_eps_gbr_ul = -1;
161 static int hf_nas_eps_gbr_dl = -1;
162 static int hf_nas_eps_embr_ul = -1;
163 static int hf_nas_eps_embr_dl = -1;
164 static int hf_nas_eps_egbr_ul = -1;
165 static int hf_nas_eps_egbr_dl = -1;
167 static int hf_nas_eps_esm_cause = -1;
168 static int hf_nas_eps_esm_eit = -1;
169 static int hf_nas_eps_esm_lnkd_eps_bearer_id = -1;
170 static int hf_nas_eps_esm_pdn_type = -1;
171 static int hf_nas_eps_esm_pdn_ipv4 = -1;
172 static int hf_nas_eps_esm_pdn_ipv6_len = -1;
173 static int hf_nas_eps_esm_pdn_ipv6 = -1;
175 static int hf_nas_eps_esm_linked_bearer_id = -1;
177 static int hf_nas_eps_active_flg = -1;
178 static int hf_nas_eps_eps_update_result_value = -1;
179 static int hf_nas_eps_eps_update_type_value = -1;
180 static int hf_nas_eps_service_type = -1;
183 static int hf_nas_eps_msg_esm_type = -1;
184 int hf_nas_eps_esm_elem_id = -1;
185 static int hf_nas_eps_esm_proc_trans_id = -1;
186 static int hf_nas_eps_esm_request_type = -1;
188 /* Initialize the subtree pointers */
189 static int ett_nas_eps = -1;
190 static int ett_nas_eps_esm_msg_cont = -1;
192 /* Global variables */
195 /* Forward declarations */
196 static void dissect_nas_eps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
198 /* Table 9.8.1: Message types for EPS mobility management
199 * 0 1 - - - - - - EPS mobility management messages
201 static const value_string nas_msg_emm_strings[] = {
202 { 0x41, "Attach request"},
203 { 0x42, "Attach accept"},
204 { 0x43, "Attach complete"},
205 { 0x44, "Attach reject"},
206 { 0x45, "Detach request"},
207 { 0x46, "Detach accept"},
209 { 0x48, "Tracking area update request"},
210 { 0x49, "Tracking area update accept"},
211 { 0x4a, "Tracking area update complete"},
212 { 0x4b, "Tracking area update reject"},
214 { 0x4c, "Extended service request"},
215 { 0x4e, "Service reject"},
217 { 0x50, "GUTI reallocation command"},
218 { 0x51, "GUTI reallocation complete"},
219 { 0x52, "Authentication request"},
220 { 0x53, "Authentication response"},
221 { 0x54, "Authentication reject"},
222 { 0x5c, "Authentication failure"},
223 { 0x55, "Identity request"},
224 { 0x56, "Identity response"},
225 { 0x5d, "Security mode command"},
226 { 0x5e, "Security mode complete"},
227 { 0x5f, "Security mode reject"},
229 { 0x60, "EMM status"},
230 { 0x61, "EMM information"},
231 { 0x62, "Downlink NAS transport"},
232 { 0x63, "Uplink NAS transport"},
233 { 0x64, "CS Service notification"},
237 /* Table 9.8.2: Message types for EPS session management */
239 static const value_string nas_msg_esm_strings[] = {
240 { 0xc1, "Activate default EPS bearer context request"},
241 { 0xc2, "Activate default EPS bearer context accept"},
242 { 0xc3, "Activate default EPS bearer context reject"},
243 { 0xc5, "Activate dedicated EPS bearer context request"},
244 { 0xc6, "Activate dedicated EPS bearer context accept"},
245 { 0xc7, "Activate dedicated EPS bearer context reject"},
246 { 0xc9, "Modify EPS bearer context request"},
247 { 0xca, "Modify EPS bearer context accept"},
248 { 0xcb, "Modify EPS bearer context reject"},
249 { 0xcd, "Deactivate EPS bearer context request"},
250 { 0xce, "Deactivate EPS bearer context accept"},
251 { 0xd0, "PDN connectivity request"},
252 { 0xd1, "PDN connectivity reject"},
253 { 0xd2, "PDN disconnect request"},
254 { 0xd3, "PDN disconnect reject"},
255 { 0xd4, "Bearer resource allocation request"},
256 { 0xd5, "Bearer resource allocation reject"},
257 { 0xd6, "Bearer resource modification request"},
258 { 0xd7, "Bearer resource modification reject"},
259 { 0xd9, "ESM information request"},
260 { 0xda, "ESM information response"},
261 { 0xe8, "ESM status"},
265 static const value_string security_header_type_vals[] = {
266 { 0, "Plain NAS message, not security protected"},
267 { 1, "Integrity protected"},
268 { 2, "Integrity protected and ciphered"},
269 { 3, "Integrity protected with new EPS security context"},
270 { 4, "Integrity protected and ciphered with new EPS security context"},
278 { 12, "Security header for the SERVICE REQUEST message "},
279 { 13, "These values are not used in this version of the protocol. If received they shall be interpreted as \"1100\""},
280 { 14, "These values are not used in this version of the protocol. If received they shall be interpreted as \"1100\""},
281 { 15, "These values are not used in this version of the protocol. If received they shall be interpreted as \"1100\""},
285 const value_string nas_eps_common_elem_strings[] = {
286 { 0x00, "EPS bearer context status" }, /* 9.9.2.1 EPS bearer context status */
287 { 0x00, "Location area identification" }, /* 9.9.2.2 Location area identification */
288 { 0x00, "Mobile identity" }, /* 9.9.2.3 Mobile identity */
289 { 0x00, "Mobile station classmark 2" }, /* 9.9.2.4 Mobile station classmark 2 */
290 { 0x00, "Mobile station classmark 3" }, /* 9.9.2.5 Mobile station classmark 3 */
291 { 0x00, "NAS security parameters from E-UTRA" }, /* 9.9.2.6 NAS security parameters from E-UTRA */
292 { 0x00, "NAS security parameters to E-UTRA" }, /* 9.9.2.7 NAS security parameters to E-UTRA */
293 { 0x00, "PLMN list" }, /* 9.9.2.8 PLMN list */
294 /* 9.9.2.9 Spare half octet */
295 { 0x00, "Supported codec list" }, /* 9.9.2.10 Supported codec list */
298 /* Utility functions */
300 calc_bitrate(guint8 value){
303 if (value > 63 && value <= 127) {
304 value = 64 + (value - 64) * 8;
306 if (value > 127 && value <= 254) {
307 value = 576 + (value - 128) * 64;
316 calc_bitrate_ext(guint8 value){
319 if (value > 0 && value <= 0x4a) {
320 value = 8600 + value * 100;
322 if (value > 0x4a && value <= 0xba) {
323 value = 16 + (value-0x4a);
325 if (value > 0xba && value <= 0xfa) {
326 value = 128 + (value-0xba)*2;
332 #define NUM_NAS_EPS_COMMON_ELEM (sizeof(nas_eps_common_elem_strings)/sizeof(value_string))
333 gint ett_nas_eps_common_elem[NUM_NAS_EPS_COMMON_ELEM];
337 DE_EPS_CMN_EPS_BE_CTX_STATUS, /* 9.9.2.1 EPS bearer context status */
338 DE_EPS_CMN_LOC_AREA_ID, /* 9.9.2.2 Location area identification */
339 DE_EPS_CMN_MOB_ID, /* 9.9.2.3 Mobile identity */
340 DE_EPS_MS_CM_2, /* 9.9.2.4 Mobile station classmark 2 */
341 DE_EPS_MS_CM_3, /* 9.9.2.5 Mobile station classmark 3 */
342 DE_EPS_NAS_SEC_PAR_FROM_EUTRA, /* 9.9.2.6 NAS security parameters from E-UTRA */
343 DE_EPS_NAS_SEC_PAR_TO_EUTRA, /* 9.9.2.7 NAS security parameters to E-UTRA */
345 DE_EPS_CMN_PLM_LST, /* 9.9.2.8 PLMN list */
346 DE_EPS_CMN_SUP_CODEC_LST, /* 9.9.2.6 9.9.2.10 Supported codec list */
347 DE_EPS_COMMON_NONE /* NONE */
349 nas_eps_common_elem_idx_t;
351 * 9.9.2 Common information elements
355 * 9.9.2.1 EPS bearer context status
357 static const true_false_string nas_eps_emm_ebi_vals = {
358 "BEARER CONTEXT-ACTIVE",
359 "BEARER CONTEXT-INACTIVE"
363 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_)
367 curr_offset = offset;
369 /* EBI(7) EBI(6) EBI(5) EBI(4) EBI(3) EBI(2) EBI(1) EBI(0) octet 3 */
370 proto_tree_add_item(tree, hf_nas_eps_emm_ebi7, tvb, curr_offset, 1, FALSE);
371 proto_tree_add_item(tree, hf_nas_eps_emm_ebi6, tvb, curr_offset, 1, FALSE);
372 proto_tree_add_item(tree, hf_nas_eps_emm_ebi5, tvb, curr_offset, 1, FALSE);
373 /* EBI(0) - EBI(4): Bits 0 to 4 of octet 3 are spare and shall be coded as zero. */
374 proto_tree_add_item(tree, hf_nas_eps_emm_ebi4, tvb, curr_offset, 1, FALSE);
375 proto_tree_add_item(tree, hf_nas_eps_emm_ebi3, tvb, curr_offset, 1, FALSE);
376 proto_tree_add_item(tree, hf_nas_eps_emm_ebi2, tvb, curr_offset, 1, FALSE);
377 proto_tree_add_item(tree, hf_nas_eps_emm_ebi1, tvb, curr_offset, 1, FALSE);
378 proto_tree_add_item(tree, hf_nas_eps_emm_ebi0, tvb, curr_offset, 1, FALSE);
380 /* EBI(15) EBI(14) EBI(13) EBI(12) EBI(11) EBI(10) EBI(9) EBI(8) octet 4 */
381 proto_tree_add_item(tree, hf_nas_eps_emm_ebi15, tvb, curr_offset, 1, FALSE);
382 proto_tree_add_item(tree, hf_nas_eps_emm_ebi14, tvb, curr_offset, 1, FALSE);
383 proto_tree_add_item(tree, hf_nas_eps_emm_ebi13, tvb, curr_offset, 1, FALSE);
384 proto_tree_add_item(tree, hf_nas_eps_emm_ebi12, tvb, curr_offset, 1, FALSE);
385 proto_tree_add_item(tree, hf_nas_eps_emm_ebi11, tvb, curr_offset, 1, FALSE);
386 proto_tree_add_item(tree, hf_nas_eps_emm_ebi10, tvb, curr_offset, 1, FALSE);
387 proto_tree_add_item(tree, hf_nas_eps_emm_ebi9, tvb, curr_offset, 1, FALSE);
388 proto_tree_add_item(tree, hf_nas_eps_emm_ebi8, tvb, curr_offset, 1, FALSE);
393 * 9.9.2.2 Location area identification
394 * See subclause 10.5.1.3 in 3GPP TS 24.008 [6].
397 * 9.9.2.3 Mobile identity
398 * See subclause 10.5.1.4 in 3GPP TS 24.008 [6].
399 * exported from gsm_a_common
403 * 9.9.2.4 Mobile station classmark 2
404 * See subclause 10.5.1.6 in 3GPP TS 24.008 [13].
407 * 9.9.2.5 Mobile station classmark 3
408 * See subclause 10.5.1.7 in 3GPP TS 24.008 [13].
412 * See subclause 10.5.1.13 in 3GPP TS 24.008 [6].
415 * 9.9.2.7 Spare half octet
416 * This element is used in the description of EMM and ESM messages when an odd number of
417 * half octet type 1 information elements are used. This element is filled with spare bits
418 * set to zero and is placed in bits 5 to 8 of the octet unless otherwise specified.
423 * 9.9.2.6 NAS security parameters from E-UTRA
426 de_sec_par_from_eutra(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
430 curr_offset = offset;
432 /* DL NAS COUNT value (short) (octet 2, bit 1 to 4)
433 * This field contains the 4 least significant bits of the binary representation of the downlink
434 * NAS COUNT value applicable when this information element is sent.
436 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 4, FALSE);
437 proto_tree_add_item(tree, hf_nas_eps_emm_dl_nas_cnt, tvb, curr_offset, 1, FALSE);
443 * 9.9.2.7 NAS security parameters to E-UTRA
446 de_sec_par_to_eutra(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
450 curr_offset = offset;
451 /* NonceMME value (octet 1 to 5)
452 * This field is coded as the nonce value in the Nonce information element (see subclause 9.9.3.25).
454 proto_tree_add_item(tree, hf_nas_eps_emm_nounce_mme, tvb, curr_offset, 1, FALSE);
456 /* type of ciphering algorithm (octet 6, bit 5 to 7)
457 * These fields are coded as the type of integrity protection algorithm and type of ciphering algorithm
458 * in the NAS security algorithms information element (see subclause 9.9.3.23).
459 * Bit 4 and 8 of octet 6 are spare and shall be coded as zero.
461 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 1, FALSE);
462 proto_tree_add_item(tree, hf_nas_eps_emm_toc, tvb, curr_offset, 1, FALSE);
463 /* Type of integrity protection algorithm (octet 6, bit 1 to 3)*/
464 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+4, 1, FALSE);
465 proto_tree_add_item(tree, hf_nas_eps_emm_toi, tvb, curr_offset, 1, FALSE);
468 * NAS key set identifier (octet 7, bit 1 to 3) and
469 * type of security context flag (TSC) (octet 7, bit 4)
470 * These fields are coded as the NAS key set identifier and type of security context flag in the
471 * NAS key set identifier information element (see subclause 9.9.3.21).
472 * Bit 5 to 8 of octet 7 are spare and shall be coded as zero.
474 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 4, FALSE);
475 /* Type of security context flag (TSC) V 1/2 */
476 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, (curr_offset<<3)+4, 1, FALSE);
477 /* NAS key set identifier */
478 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, (curr_offset<<3)+5, 3, FALSE);
484 * 9.9.2.10 Supported codec list
485 * See subclause 10.5.4.32 in 3GPP TS 24.008 [13].
486 * Dissectecd in packet-gsm_a_dtap.c
489 guint16 (*nas_eps_common_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
490 /* 9.9.2 Common information elements */
491 de_eps_cmn_eps_be_ctx_status, /* 9.9.2.1 EPS bearer context status */
492 de_lai, /* 9.9.2.2 Location area identification */
493 de_mid, /* 9.9.2.3 Mobile identity See subclause 10.5.1.4 in 3GPP TS 24.008*/
494 de_ms_cm_2, /* 9.9.2.4 Mobile station classmark 2 */
495 de_ms_cm_3, /* 9.9.2.5 Mobile station classmark 3 */
496 de_sec_par_from_eutra, /* 9.9.2.6 NAS security parameters from E-UTRA */
497 de_sec_par_to_eutra, /* 9.9.2.7 NAS security parameters to E-UTRA */
499 de_plmn_list, /* 9.9.2.8 PLMN list */
500 NULL, /* 9.9.2.10 Supported codec list (packet-gsm_a_dtap.c) */
504 const value_string nas_emm_elem_strings[] = {
505 /* 9.9.3 EPS Mobility Management (EMM) information elements */
506 { 0x00, "Authentication failure parameter" }, /* 9.9.3.1 Authentication failure parameter */
507 { 0x00, "Authentication parameter AUTN" }, /* 9.9.3.2 Authentication parameter AUTN */
508 { 0x00, "Authentication parameter RAND" }, /* 9.9.3.3 Authentication parameter RAND */
509 { 0x00, "Authentication response parameter" }, /* 9.9.3.4 Authentication response parameter */
510 { 0x00, "CSFB response" }, /* 9.9.3.5 CSFB response */
511 { 0x00, "Daylight saving time" }, /* 9.9.3.6 Daylight saving time */
512 { 0x00, "Detach type" }, /* 9.9.3.7 Detach type */
513 { 0x00, "DRX parameter" }, /* 9.9.3.8 DRX parameter */
514 { 0x00, "EMM cause" }, /* 9.9.3.9 EMM cause */
515 { 0x00, "EPS attach result" }, /* 9.9.3.10 EPS attach result */
516 { 0x00, "EPS attach type" }, /* 9.9.3.11 EPS attach type */
517 { 0x00, "EPS mobile identity" }, /* 9.9.3.12 EPS mobile identity */
518 { 0x00, "EPS update resul" }, /* 9.9.3.13 EPS update result */
519 { 0x00, "EPS update type" }, /* 9.9.3.14 EPS update type */
520 { 0x00, "ESM message container" }, /* 9.9.3.15 ESM message conta */
521 { 0x00, "GPRS timer" }, /* 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. */
522 { 0x00, "Identity type 2" }, /* 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. */
523 { 0x00, "IMEISV request" }, /* 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. */
524 { 0x00, "KSI and sequence number" }, /* 9.9.3.19 KSI and sequence number */
525 { 0x00, "MS network capability" }, /* 9.9.3.20 MS network capability ,See subclause 10.5.5.12 in 3GPP TS 24.008 [6]. */
526 { 0x00, "NAS key set identifier" }, /* 9.9.3.21 NAS key set identifier */
527 { 0x00, "NAS message container" }, /* 9.9.3.22 NAS message container */
528 { 0x00, "NAS security algorithms" }, /* 9.9.3.23 NAS security algorithms */
529 { 0x00, "Network name" }, /* 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. */
530 { 0x00, "Nonce" }, /* 9.9.3.25 Nonce */
531 { 0x00, "P-TMSI signature" }, /* 9.9.3.26 P-TMSI signature, See subclause 10.5.5.8 in 3GPP TS 24.008 [6]. */
532 { 0x00, "Service type" }, /* 9.9.3.27 Service type ,See subclause 10.5.5.15 in 3GPP TS 24.008 [6]. */
533 { 0x00, "Short MAC" }, /* 9.9.3.28 Short MAC */
534 { 0x00, "Time zone" }, /* 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. */
535 { 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]. */
536 { 0x00, "TMSI status" }, /* 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. */
537 { 0x00, "Tracking area identity" }, /* 9.9.3.32 Tracking area identity */
538 { 0x00, "Tracking area identity list" }, /* 9.9.3.33 Tracking area identity list */
539 { 0x00, "UE network capability" }, /* 9.9.3.34 UE network capability */
540 { 0x00, "UE radio capability information update needed" }, /* 9.9.3.35 UE radio capability information update needed */
541 { 0x00, "UE security capability" }, /* 9.9.3.36 UE security capability */
542 { 0x00, "Emergency Number List" }, /* 9.9.3.37 Emergency Number List */
543 { 0x00, "CLI" }, /* 9.9.3.38 CLI */
544 { 0x00, "SS Code" }, /* 9.9.3.39 SS Code */
545 { 0x00, "LCS indicator" }, /* 9.9.3.40 LCS indicator */
546 { 0x00, "LCS client identity" }, /* 9.9.3.41 LCS client identity */
550 #define NUM_NAS_EMM_ELEM (sizeof(nas_emm_elem_strings)/sizeof(value_string))
551 gint ett_nas_eps_emm_elem[NUM_NAS_EMM_ELEM];
555 /* 9.9.3 EPS Mobility Management (EMM) information elements */
556 DE_EMM_AUTH_FAIL_PAR, /* 9.9.3.1 Authentication failure parameter (dissected in packet-gsm_a_dtap.c)*/
557 DE_EMM_AUTN, /* 9.9.3.2 Authentication parameter AUTN */
558 DE_EMM_AUTH_PAR_RAND, /* 9.9.3.3 Authentication parameter RAND */
559 DE_EMM_AUTH_RESP_PAR, /* 9.9.3.4 Authentication response parameter */
560 DE_EMM_CSFB_RESP, /* 9.9.3.5 CSFB response */
561 DE_EMM_DAYL_SAV_T, /* 9.9.3.6 Daylight saving time */
562 DE_EMM_DET_TYPE, /* 9.9.3.7 Detach type */
563 DE_EMM_DRX_PAR, /* 9.9.3.8 DRX parameter (dissected in packet-gsm_a_gm.c)*/
564 DE_EMM_CAUSE, /* 9.9.3.9 EMM cause */
565 DE_EMM_ATT_RES, /* 9.9.3.10 EPS attach result (Coded inline */
566 DE_EMM_ATT_TYPE, /* 9.9.3.11 EPS attach type (Coded Inline)*/
567 DE_EMM_EPS_MID, /* 9.9.3.12 EPS mobile identity */
568 DE_EMM_EPS_UPD_RES, /* 9.9.3.13 EPS update result ( Coded inline)*/
569 DE_EMM_EPS_UPD_TYPE, /* 9.9.3.14 EPS update type */
570 DE_EMM_ESM_MSG_CONT, /* 9.9.3.15 ESM message conta */
571 DE_EMM_GPRS_TIMER, /* 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. */
572 DE_EMM_ID_TYPE_2, /* 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. */
573 DE_EMM_IMEISV_REQ, /* 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. */
574 DE_EMM_KSI_AND_SEQ_NO, /* 9.9.3.19 KSI and sequence number */
575 DE_EMM_MS_NET_CAP, /* 9.9.3.20 MS network capability ,See subclause 10.5.5.12 in 3GPP TS 24.008 [6]. */
576 DE_EMM_NAS_KEY_SET_ID, /* 9.9.3.21 NAS key set identifier (coded inline)*/
577 DE_EMM_NAS_MSG_CONT, /* 9.9.3.22 NAS message container */
578 DE_EMM_NAS_SEC_ALGS, /* 9.9.3.23 NAS security algorithms */
579 DE_EMM_NET_NAME, /* 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. */
580 DE_EMM_NONCE, /* 9.9.3.25 Nonce */
581 DE_EMM_P_TMSI_SIGN, /* 9.9.3.26 P-TMSI signature, See subclause 10.5.5.8 in 3GPP TS 24.008 [6]. */
582 DE_EMM_SERV_TYPE, /* 9.9.3.27 Service type */
583 DE_EMM_SHORT_MAC, /* 9.9.3.28 Short MAC */
584 DE_EMM_TZ, /* 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. */
585 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]. */
586 DE_EMM_TMSI_STAT, /* 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. */
587 DE_EMM_TRAC_AREA_ID, /* 9.9.3.32 Tracking area identity */
588 DE_EMM_TRAC_AREA_ID_LST, /* 9.9.3.33 Tracking area identity list */
589 DE_EMM_UE_NET_CAP, /* 9.9.3.34 UE network capability */
590 DE_EMM_UE_RA_CAP_INF_UPD_NEED, /* 9.9.3.35 UE radio capability information update needed */
591 DE_EMM_UE_SEC_CAP, /* 9.9.3.36 UE security capability */
592 DE_EMM_EMERG_NUM_LST, /* 9.9.3.37 Emergency Number List */
593 DE_EMM_CLI, /* 9.9.3.38 CLI */
594 DE_EMM_SS_CODE, /* 9.9.3.39 SS Code */
595 DE_EMM_LCS_IND, /* 9.9.3.40 LCS indicator */
596 DE_EMM_LCS_CLIENT_ID, /* 9.9.3.41 LCS client identity */
597 DE_EMM_NONE /* NONE */
601 /* TODO: Update to latest spec */
602 /* 9.9.3 EPS Mobility Management (EMM) information elements
603 * 9.9.3.1 Authentication failure parameter
604 * See subclause 10.5.3.2.2 in 3GPP TS 24.008 [6].
605 * (dissected in packet-gsm_a_dtap.c)
608 * 9.9.3.2 Authentication parameter AUTN
609 * See subclause 10.5.3.1.1 in 3GPP TS 24.008 [6].
612 * 9.9.3.3 Authentication parameter RAND
613 * See subclause 10.5.3.1 in 3GPP TS 24.008 [6].
616 * 9.9.3.4 Authentication response parameter
619 de_emm_auth_resp_par(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
623 curr_offset = offset;
625 proto_tree_add_item(tree, hf_nas_eps_emm_res, tvb, curr_offset, len, FALSE);
630 * 9.9.3.4A Ciphering key sequence number
631 * See subclause 9.9.3.19 in 3GPP TS 24.008 [13].
635 * 9.9.3.5 CSFB response
639 * CSFB response value (octet 1)
642 static const value_string nas_eps_emm_csfb_resp_vals[] = {
643 { 0x0, "CS fallback rejected by the UE"},
644 { 0x1, "CS fallback accepted by the UE"},
649 de_emm_csfb_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
651 guint32 curr_offset, bit_offset;
653 curr_offset = offset;
656 bit_offset = curr_offset<<3;
657 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset+4, 1, FALSE);
659 proto_tree_add_item(tree, hf_nas_eps_emm_csfb_resp, tvb, curr_offset, 1, FALSE);
662 return(curr_offset-offset);
665 * 9.9.3.6 Daylight saving time
666 * See subclause 10.5.3.12 in 3GPP TS 24.008 [6].
669 * 9.9.3.7 Detach type
672 static const value_string nas_eps_emm_switch_off_vals[] = {
673 { 0x0, "Normal detach"},
674 { 0x1, "Switch off"},
677 /* Type of detach (octet 1)
678 * In the UE to network direction:
680 static const value_string nas_eps_emm_type_of_dtatch_UL_vals[] = {
681 { 0x1, "EPS detach"},
682 { 0x2, "IMSI detach"},
683 { 0x3, "Combined EPS/IMSI detach"},
684 { 0x4, "Combined EPS/IMSI detach"}, /* All other values are interpreted as "combined EPS/IMSI detach" in this version of the protocol.*/
685 { 0x5, "Combined EPS/IMSI detach"}, /* -"- */
692 * In the network to UE direction:
695 static const value_string nas_eps_emm_type_of_dtatch_DL_vals[] = {
696 { 0x1, "Re-attach required"},
697 { 0x2, "Re-attach not required"},
698 { 0x3, "IMSI detach"},
699 { 0x4, "IMSI detach"}, /* All other values are interpreted as "re-attach not required" in this version of the protocol.*/
700 { 0x5, "IMSI detach"}, /* -"- */
707 * 9.9.3.8 DRX parameter
708 * See subclause 10.5.5.6 in 3GPP TS 24.008 [13].
713 static const value_string nas_eps_emm_cause_values[] = {
714 { 0x2, "IMSI unknown in HLR"},
715 { 0x3, "Illegal MS"},
716 { 0x6, "Illegal ME"},
717 { 0x7, "EPS services not allowed"},
718 { 0x8, "EPS services and non-EPS services not allowed"},
719 { 0x9, "UE identity cannot be derived by the network"},
720 { 0xa, "Implicitly detached"},
721 { 0xb, "PLMN not allowed"},
722 { 0xc, "Tracking Area not allowed"},
723 { 0xd, "Roaming not allowed in this tracking area"},
724 { 0xe, "EPS services not allowed in this PLMN"},
725 { 0xf, "No Suitable Cells In tracking area"},
726 { 0x10, "MSC temporarily not reachable"},
727 { 0x11, "Network failure"},
728 { 0x12, "CS domain not available"},
729 { 0x13, "ESM failure"},
730 { 0x14, "MAC failure"},
731 { 0x15, "Synch failure"},
732 { 0x16, "Congestion"},
733 { 0x17, "UE security capabilities mismatch"},
734 { 0x18, "Security mode rejected, unspecified"},
735 { 0x19, "Not authorized for this CSG"},
736 { 0x1a, "Non-EPS authentication unacceptable"},
737 { 0x26, "CS fallback call establishment not allowed"},
738 { 0x27, "CS domain temporarily not available"},
739 { 0x28, "No EPS bearer context activated"},
740 { 0x5f, "Semantically incorrect message"},
741 { 0x60, "Invalid mandatory information"},
742 { 0x61, "Message type non-existent or not implemented"},
743 { 0x62, "Message type not compatible with the protocol state"},
744 { 0x63, "Information element non-existent or not implemented"},
745 { 0x64, "Conditional IE error"},
746 { 0x65, "Message not compatible with the protocol state"},
747 { 0x6f, "Protocol error, unspecified"},
752 de_emm_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
756 curr_offset = offset;
758 proto_tree_add_item(tree, hf_nas_eps_emm_cause, tvb, curr_offset, 1, FALSE);
761 return curr_offset-offset;}
763 * 9.9.3.10 EPS attach result
766 static const value_string nas_eps_emm_EPS_attach_result_values[] = {
769 { 2, "Combined EPS/IMSI attach"},
780 * 9.9.3.11 EPS attach type
783 static const value_string nas_eps_emm_eps_att_type_vals[] = {
784 { 0, "EPS attach(unused)"},
786 { 2, "Combined handover EPS/IMSI attach"},
787 { 3, "EPS attach(unused)"},
788 { 4, "EPS attach(unused)"},
789 { 5, "EPS attach(unused)"},
797 * 9.9.3.12 EPS mobile identity
800 static const value_string nas_eps_emm_type_of_id_vals[] = {
812 de_emm_eps_mid(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
819 curr_offset = offset;
821 octet = tvb_get_guint8(tvb,offset);
822 /* Type of identity (octet 3) */
823 proto_tree_add_item(tree, hf_nas_eps_emm_odd_even, tvb, curr_offset, 1, FALSE);
824 proto_tree_add_item(tree, hf_nas_eps_emm_type_of_id, tvb, curr_offset, 1, FALSE);
829 new_tvb = tvb_new_subset(tvb, curr_offset, len-1, len-1 );
830 digit_str = unpack_digits(new_tvb, 0);
831 proto_tree_add_string(tree, hf_nas_eps_emm_imsi, new_tvb, 0, -1, digit_str);
835 curr_offset = dissect_e212_mcc_mnc(tvb, tree, curr_offset);
836 /* MME Group ID octet 7 - 8 */
837 proto_tree_add_item(tree, hf_nas_eps_emm_mme_grp_id, tvb, curr_offset, 2, FALSE);
839 /* MME Code Octet 9 */
840 proto_tree_add_item(tree, hf_nas_eps_emm_mme_code, tvb, curr_offset, 1, FALSE);
842 /* M-TMSI Octet 10 - 13 */
843 proto_tree_add_item(tree, hf_nas_eps_emm_m_tmsi, tvb, curr_offset, 4, FALSE);
847 proto_tree_add_text(tree, tvb, curr_offset, len - 1, "Type of identity not known");
854 * 9.9.3.13 EPS update result
856 static const value_string nas_eps_emm_eps_update_result_vals[] = {
858 { 1, "Combined TA/LA updated"},
859 { 2, "TA updated and ISR activated"},
860 { 3, "Combined TA/LA updated and ISR activated"},
865 * 9.9.3.14 EPS update type
867 static const true_false_string nas_eps_emm_active_flg_value = {
868 "Bearer establishment requested",
869 "No bearer establishment requested"
872 static const value_string nas_eps_emm_eps_update_type_vals[] = {
874 { 1, "Combined TA/LA updating"},
875 { 2, "Combined TA/LA updating with IMSI attach"},
876 { 3, "Periodic updating"},
877 { 4, "unused; shall be interpreted as 'TA updating', if received by the network"},
878 { 5, "unused; shall be interpreted as 'TA updating', if received by the network"},
883 * 9.9.3.15 ESM message container
886 de_emm_esm_msg_cont(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
889 proto_tree *sub_tree;
893 curr_offset = offset;
896 item = proto_tree_add_item(tree, hf_nas_eps_esm_msg_cont, tvb, curr_offset, len, FALSE);
897 sub_tree = proto_item_add_subtree(item, ett_nas_eps_esm_msg_cont);
899 /* This IE can contain any ESM PDU as defined in subclause 8.3. */
900 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
901 /* Plain NAS message */
902 disect_nas_eps_esm_msg(new_tvb, gpinfo, sub_tree, 0/* offset */);
907 * 9.9.3.16 GPRS timer
908 * See subclause 10.5.7.3 in 3GPP TS 24.008 [6].
912 * 9.9.3.17 Identity type 2
913 * See subclause 10.5.5.9 in 3GPP TS 24.008 [6].
915 static const value_string nas_eps_emm_id_type2_vals[] = {
924 * 9.9.3.18 IMEISV request
925 * See subclause 10.5.5.10 in 3GPP TS 24.008 [6].
927 /* IMEISV request value (octet 1) */
928 static const value_string nas_eps_emm_imeisv_req_vals[] = {
929 { 0, "IMEISV not requested"},
930 { 1, "IMEISV requested"},
931 { 2, "IMEISV not requested"},
932 { 3, "IMEISV not requested"},
933 { 4, "IMEISV not requested"},
934 { 5, "IMEISV not requested"},
935 { 6, "IMEISV not requested"},
936 { 7, "IMEISV not requested"},
940 de_emm_nas_imeisv_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
945 curr_offset = offset;
947 bit_offset = curr_offset<<3;
949 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, FALSE);
950 proto_tree_add_item(tree, hf_nas_eps_esm_imeisv_req, tvb, curr_offset, 1, FALSE);
953 return(curr_offset - offset);
956 * 9.9.3.19 KSI and sequence number
959 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_)
963 curr_offset = offset;
965 proto_tree_add_text(tree, tvb, curr_offset, 1 , "KSI and sequence number");
968 return(curr_offset - offset);
972 * 9.9.3.20 MS network capability
973 * See subclause 10.5.5.12 in 3GPP TS 24.008 [6].
976 * 9.9.3.21 NAS key set identifier
979 * Type of security context flag (TSC) (octet 1)
981 static const value_string nas_eps_tsc_vals[] = {
982 { 0, "Native security context"},
983 { 1, "Mapped security context"},
987 /* NAS key set identifier (octet 1) Bits 3 2 1 */
989 static const value_string nas_eps_emm_NAS_key_set_identifier_vals[] = {
997 { 7, "No key is available"},
1001 /* Takes bit offset as input and consusmes 4 bits */
1003 de_emm_nas_key_set_id_bits(tvbuff_t *tvb, proto_tree *tree, guint32 bit_offset, gchar *add_string)
1009 /* Type of security context flag (TSC) (octet 1) V 1/2 */
1010 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, bit_offset, 1, FALSE);
1012 /* NAS key set identifier (octet 1) */
1013 item = proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, FALSE);
1015 proto_item_append_text(item, "%s", add_string);
1020 * Note used for TV Short
1023 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_)
1025 guint32 curr_offset, bit_offset;
1027 curr_offset = offset;
1030 /* Get the bit offset of the lover half of the octet bits 4 - 1 */
1031 bit_offset = curr_offset<<3;
1034 /* Type of security context flag (TSC) (octet 1) V 1/2 */
1035 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, bit_offset, 1, FALSE);
1037 /* NAS key set identifier (octet 1) */
1038 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, FALSE);
1045 * 9.9.3.22 NAS message container
1048 de_emm_nas_msg_cont(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1051 guint32 curr_offset;
1053 curr_offset = offset;
1056 /* NAS message container contents (octet 3 to octet n)
1057 * This IE can contain an SMS message (i.e. CP-DATA, CP-ACK or CP-ERROR)
1058 * as defined in subclause 7.2 in 3GPP TS 24.011 [13A].
1061 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1062 if(gsm_a_dtap_handle)
1063 call_dissector(gsm_a_dtap_handle,new_tvb, gpinfo, tree);
1068 * 9.9.3.23 NAS security algorithms
1070 /* Type of integrity protection algorithm (octet 2, bit 1 to 3) */
1071 static const value_string nas_eps_emm_toi_vals[] = {
1073 { 1, "EPS integrity algorithm 128-EIA1"},
1074 { 2, "EPS integrity algorithm 128-EIA2"},
1075 { 3, "EPS integrity algorithm EIA3"},
1076 { 4, "EPS integrity algorithm EIA4"},
1077 { 5, "EPS integrity algorithm EIA5"},
1078 { 6, "EPS integrity algorithm EIA6"},
1079 { 7, "EPS integrity algorithm EIA7"},
1083 /* Type of ciphering algorithm (octet 2, bit 5 to 7) */
1085 static const value_string nas_eps_emm_toc_vals[] = {
1086 { 0, "EPS encryption algorithm 128-EEA0 (ciphering not used)"},
1087 { 1, "EPS encryption algorithm 128-EEA1"},
1088 { 2, "EPS encryption algorithm 128-EEA2"},
1089 { 3, "EPS encryption algorithm EEA3"},
1090 { 4, "EPS encryption algorithm EEA4"},
1091 { 5, "EPS encryption algorithm EEA5"},
1092 { 6, "EPS encryption algorithm EEA6"},
1093 { 7, "EPS encryption algorithm EEA7"},
1097 de_emm_nas_sec_alsgs(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1100 guint32 curr_offset;
1102 curr_offset = offset;
1104 bit_offset = offset<<3;
1105 /* Bit 4 and 8 of octet 2 are spare and shall be coded as zero. */
1106 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, FALSE);
1107 /* Type of ciphering algorithm (octet 2, bit 5 to 7) */
1108 proto_tree_add_item(tree, hf_nas_eps_emm_toc, tvb, curr_offset, 1, FALSE);
1110 /* Bit 4 and 8 of octet 2 are spare and shall be coded as zero. */
1111 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, FALSE);
1112 /* Type of integrity protection algorithm (octet 2, bit 1 to 3) */
1113 proto_tree_add_item(tree, hf_nas_eps_emm_toi, tvb, curr_offset, 1, FALSE);
1117 return(curr_offset-offset);
1120 * 9.9.3.24 Network name
1121 * See subclause 10.5.3.5a in 3GPP TS 24.008 [6].
1125 * Editor's note: The coding of this information element is FFS.
1128 de_emm_nonce(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1130 guint32 curr_offset;
1132 curr_offset = offset;
1135 proto_tree_add_text(tree, tvb, curr_offset, 4 , "Nounce");
1141 * 9.9.3.26 P-TMSI signature
1142 * See subclause 10.5.5.8 in 3GPP TS 24.008 [6].
1145 * 9.9.3.27 Service type
1147 static const value_string nas_eps_service_type_vals[] = {
1148 { 0, "Mobile originating CS fallback or 1xCS fallback"},
1149 { 1, "Mobile terminating CS fallback or 1xCS fallback"},
1150 { 2, "Mobile originating CS fallback emergency call or 1xCS fallback emergency call"},
1155 * 9.9.3.28 Short MAC
1158 de_emm_nas_short_mac(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1160 guint32 curr_offset;
1162 curr_offset = offset;
1165 proto_tree_add_item(tree, hf_nas_eps_emm_short_mac, tvb, curr_offset, 2, FALSE);
1168 return(curr_offset-offset);
1171 * 9.9.3.29 Time zone
1172 * See subclause 10.5.3.8 in 3GPP TS 24.008 [6].
1175 * 9.9.3.30 Time zone and time
1176 * See subclause 10.5.3.9 in 3GPP TS 24.008 [6].
1179 * 9.9.3.31 TMSI status
1180 * See subclause 10.5.5.4 in 3GPP TS 24.008 [6].
1183 * 9.9.3.32 Tracking area identity
1187 de_emm_trac_area_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1189 guint32 curr_offset;
1191 curr_offset = offset;
1193 curr_offset = dissect_e212_mcc_mnc(tvb, tree, curr_offset);
1194 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, FALSE);
1197 return(curr_offset-offset);
1200 * 9.9.3.33 Tracking area identity list
1202 /* Type of list (octet 1)
1205 static const value_string nas_eps_emm_tai_tol_vals[] = {
1206 { 0, "list of TACs belonging to one PLMN, with non-consecutive TAC values"},
1207 { 1, "list of TACs belonging to one PLMN, with consecutive TAC values"},
1208 { 2, "list of TAIs belonging to different PLMNsl"},
1213 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_)
1216 guint32 curr_offset;
1217 guint8 octet, tol, n_elem;
1220 curr_offset = offset;
1222 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 1, FALSE);
1223 /* Type of list (octet 1) Bits 7 6 */
1224 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tol, tvb, curr_offset, 1, FALSE);
1225 /* Number of elements (octet 1) Bits 5 4 3 2 1 */
1226 octet = tvb_get_guint8(tvb,curr_offset)& 0x7f;
1228 n_elem = (octet & 0x1f)+1;
1229 item = proto_tree_add_item(tree, hf_nas_eps_emm_tai_n_elem, tvb, curr_offset, 1, FALSE);
1231 proto_item_append_text(item, " [+1 = %u element(s)]", n_elem);
1235 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 )");
1241 /* MCC digit 2 MCC digit 1 octet 2
1242 * MNC digit 3 MCC digit 3 octet 3
1243 * MNC digit 2 MNC digit 1 octet 4
1245 curr_offset = dissect_e212_mcc_mnc(tvb, tree, curr_offset);
1246 /* type of list = "000" */
1248 * TAC 1 (continued) octet 6
1252 * TAC k (continued) octet 2k+4*
1254 if (len < (guint)(4+(n_elem*2))){
1255 proto_tree_add_text(tree, tvb, curr_offset, len-1 , "[Wrong number of elements?]");
1258 for (i=0; i < n_elem; i++, curr_offset+=2)
1259 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, FALSE);
1263 /* type of list = "010" */
1264 /* MCC digit 2 MCC digit 1 octet 2
1265 * MNC digit 3 MCC digit 3 octet 3
1266 * MNC digit 2 MNC digit 1 octet 4
1268 curr_offset = dissect_e212_mcc_mnc(tvb, tree, curr_offset);
1269 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, FALSE);
1273 if (len< (guint)(1+(n_elem*5))){
1274 proto_tree_add_text(tree, tvb, curr_offset, len-1 , "[Wrong number of elements?]");
1278 for (i=0; i < n_elem; i++){
1279 /* type of list = "001" */
1280 /* MCC digit 2 MCC digit 1 octet 2
1281 * MNC digit 3 MCC digit 3 octet 3
1282 * MNC digit 2 MNC digit 1 octet 4
1284 curr_offset = dissect_e212_mcc_mnc(tvb, tree, curr_offset);
1285 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, FALSE);
1290 /* Unknown ( Not in 3GPP TS 24.301 version 8.1.0 Release 8 ) */
1293 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1295 return(curr_offset-offset);
1298 * 9.9.3.34 UE network capability
1301 static const true_false_string nas_eps_emm_supported_flg_value = {
1305 static const true_false_string nas_eps_emm_ucs2_supp_flg_value = {
1306 "The UE has no preference between the use of the default alphabet and the use of UCS2",
1307 "The UE has a preference for the default alphabet"
1309 /* 1xSRVCC capability (octet 7, bit 2) */
1310 static const true_false_string nas_eps_emm_1xsrvcc_cap_flg = {
1311 "SRVCC from E-UTRAN to cdma2000 1xCS supported",
1312 "SRVCC from E-UTRAN to cdma2000 1x CS not supported"
1316 de_emm_ue_net_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1318 guint32 curr_offset;
1320 curr_offset = offset;
1323 /* EPS encryption algorithms supported (octet 3) */
1324 /* EPS encryption algorithm 128-EEA0 supported (octet 3, bit 8) */
1325 proto_tree_add_item(tree, hf_nas_eps_emm_128eea0, tvb, curr_offset, 1, FALSE);
1326 /* EPS encryption algorithm 128-EEA1 supported (octet 3, bit 7) */
1327 proto_tree_add_item(tree, hf_nas_eps_emm_128eea1, tvb, curr_offset, 1, FALSE);
1328 /* EPS encryption algorithm 128-EEA2 supported (octet 3, bit 6) */
1329 proto_tree_add_item(tree, hf_nas_eps_emm_128eea2, tvb, curr_offset, 1, FALSE);
1330 /* EPS encryption algorithm 128-EEA3 supported (octet 3, bit 5) */
1331 proto_tree_add_item(tree, hf_nas_eps_emm_eea3, tvb, curr_offset, 1, FALSE);
1332 /* EPS encryption algorithm 128-EEA4 supported (octet 3, bit 4) */
1333 proto_tree_add_item(tree, hf_nas_eps_emm_eea4, tvb, curr_offset, 1, FALSE);
1334 /* EPS encryption algorithm 128-EEA5 supported (octet 3, bit 5) */
1335 proto_tree_add_item(tree, hf_nas_eps_emm_eea5, tvb, curr_offset, 1, FALSE);
1336 /* EPS encryption algorithm 128-EEA6 supported (octet 3, bit 6) */
1337 proto_tree_add_item(tree, hf_nas_eps_emm_eea6, tvb, curr_offset, 1, FALSE);
1338 /* EPS encryption algorithm 128-EEA7 supported (octet 3, bit 7) */
1339 proto_tree_add_item(tree, hf_nas_eps_emm_eea7, tvb, curr_offset, 1, FALSE);
1343 /* EPS integrity algorithms supported (octet 4)
1344 * Bit 8 of octet 4 is spare and shall be coded as zero.
1345 * EPS integrity algorithm 128-EIA1 supported (octet 4, bit 7)
1347 proto_tree_add_item(tree, hf_nas_eps_emm_128eia1, tvb, curr_offset, 1, FALSE);
1348 /* EPS integrity algorithm 128-EIA2 supported (octet 4, bit 6) */
1349 proto_tree_add_item(tree, hf_nas_eps_emm_128eia2, tvb, curr_offset, 1, FALSE);
1350 /* EPS integrity algorithm EIA3 supported (octet 4, bit 5) */
1351 proto_tree_add_item(tree, hf_nas_eps_emm_eia3, tvb, curr_offset, 1, FALSE);
1352 /* EPS integrity algorithm EIA4 supported (octet 4, bit 4) */
1353 proto_tree_add_item(tree, hf_nas_eps_emm_eia4, tvb, curr_offset, 1, FALSE);
1354 /* EPS integrity algorithm EIA5 supported (octet 4, bit 3) */
1355 proto_tree_add_item(tree, hf_nas_eps_emm_eia5, tvb, curr_offset, 1, FALSE);
1356 /* EPS integrity algorithm EIA6 supported (octet 4, bit 2) */
1357 proto_tree_add_item(tree, hf_nas_eps_emm_eia6, tvb, curr_offset, 1, FALSE);
1358 /* EPS integrity algorithm EIA7 supported (octet 4, bit 1) */
1359 proto_tree_add_item(tree, hf_nas_eps_emm_eia7, tvb, curr_offset, 1, FALSE);
1363 /* UMTS encryption algorithms supported (octet 5)
1364 * UMTS encryption algorithm UEA0 supported (octet 5, bit 8)
1366 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 8) */
1367 proto_tree_add_item(tree, hf_nas_eps_emm_uea0, tvb, curr_offset, 1, FALSE);
1368 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 7) */
1369 proto_tree_add_item(tree, hf_nas_eps_emm_uea1, tvb, curr_offset, 1, FALSE);
1370 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 6) */
1371 proto_tree_add_item(tree, hf_nas_eps_emm_uea2, tvb, curr_offset, 1, FALSE);
1372 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 5) */
1373 proto_tree_add_item(tree, hf_nas_eps_emm_uea3, tvb, curr_offset, 1, FALSE);
1374 /* EPS encryption algorithm 128-UEA0 supported (octet 5, bit 4) */
1375 proto_tree_add_item(tree, hf_nas_eps_emm_uea4, tvb, curr_offset, 1, FALSE);
1376 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 5) */
1377 proto_tree_add_item(tree, hf_nas_eps_emm_uea5, tvb, curr_offset, 1, FALSE);
1378 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 6) */
1379 proto_tree_add_item(tree, hf_nas_eps_emm_uea6, tvb, curr_offset, 1, FALSE);
1380 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 7) */
1381 proto_tree_add_item(tree, hf_nas_eps_emm_uea7, tvb, curr_offset, 1, FALSE);
1384 /* UCS2 support (UCS2) (octet 6, bit 8)
1385 * This information field indicates the likely treatment of UCS2 encoded character strings
1388 proto_tree_add_item(tree, hf_nas_eps_emm_ucs2_supp, tvb, curr_offset, 1, FALSE);
1389 /* UMTS integrity algorithms supported (octet 6) */
1390 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 7) */
1391 proto_tree_add_item(tree, hf_nas_eps_emm_uia1, tvb, curr_offset, 1, FALSE);
1392 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 6) */
1393 proto_tree_add_item(tree, hf_nas_eps_emm_uia2, tvb, curr_offset, 1, FALSE);
1394 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 5) */
1395 proto_tree_add_item(tree, hf_nas_eps_emm_uia3, tvb, curr_offset, 1, FALSE);
1396 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 4) */
1397 proto_tree_add_item(tree, hf_nas_eps_emm_uia4, tvb, curr_offset, 1, FALSE);
1398 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 3) */
1399 proto_tree_add_item(tree, hf_nas_eps_emm_uia5, tvb, curr_offset, 1, FALSE);
1400 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 2) */
1401 proto_tree_add_item(tree, hf_nas_eps_emm_uia6, tvb, curr_offset, 1, FALSE);
1402 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 1) */
1403 proto_tree_add_item(tree, hf_nas_eps_emm_uia7, tvb, curr_offset, 1, FALSE);
1406 /* Bits 8 to 3 and bit 1 of octet 7 are spare and shall be coded as zero. */
1407 /* 1xSRVCC capability (octet 7, bit 2) */
1408 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 6, FALSE);
1409 proto_tree_add_item(tree, hf_nas_eps_emm_1xsrvcc_cap, tvb, curr_offset, 1, FALSE);
1410 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+7, 1, FALSE);
1414 /* UE radio capability information update needed flag (URC upd) (octet 1) */
1415 static const true_false_string nas_eps_emm_ue_ra_cap_inf_upd_need_flg = {
1416 "UE radio capability information update needed",
1417 "UE radio capability information update not needed"
1421 * 9.9.3.35 UE radio capability information update needed
1425 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_)
1427 guint32 curr_offset;
1429 curr_offset = offset;
1431 proto_tree_add_item(tree, hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg, tvb, curr_offset, 1, FALSE);
1436 * 9.9.3.36 UE security capability
1440 de_emm_ue_sec_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1442 guint32 curr_offset;
1444 curr_offset = offset;
1446 /* EPS encryption algorithm 128-EEA0 supported (octet 3, bit 8) */
1447 proto_tree_add_item(tree, hf_nas_eps_emm_128eea0, tvb, curr_offset, 1, FALSE);
1448 /* EPS encryption algorithm 128-EEA1 supported (octet 3, bit 7) */
1449 proto_tree_add_item(tree, hf_nas_eps_emm_128eea1, tvb, curr_offset, 1, FALSE);
1450 /* EPS encryption algorithm 128-EEA2 supported (octet 3, bit 6) */
1451 proto_tree_add_item(tree, hf_nas_eps_emm_128eea2, tvb, curr_offset, 1, FALSE);
1452 /* EPS encryption algorithm 128-EEA3 supported (octet 3, bit 5) */
1453 proto_tree_add_item(tree, hf_nas_eps_emm_eea3, tvb, curr_offset, 1, FALSE);
1454 /* EPS encryption algorithm 128-EEA4 supported (octet 3, bit 4) */
1455 proto_tree_add_item(tree, hf_nas_eps_emm_eea4, tvb, curr_offset, 1, FALSE);
1456 /* EPS encryption algorithm 128-EEA5 supported (octet 3, bit 5) */
1457 proto_tree_add_item(tree, hf_nas_eps_emm_eea5, tvb, curr_offset, 1, FALSE);
1458 /* EPS encryption algorithm 128-EEA6 supported (octet 3, bit 6) */
1459 proto_tree_add_item(tree, hf_nas_eps_emm_eea6, tvb, curr_offset, 1, FALSE);
1460 /* EPS encryption algorithm 128-EEA7 supported (octet 3, bit 7) */
1461 proto_tree_add_item(tree, hf_nas_eps_emm_eea7, tvb, curr_offset, 1, FALSE);
1465 /* EPS integrity algorithms supported (octet 4)
1466 * Bit 8 of octet 4 is spare and shall be coded as zero.
1467 * EPS integrity algorithm 128-EIA1 supported (octet 4, bit 7)
1469 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 1, FALSE);
1470 proto_tree_add_item(tree, hf_nas_eps_emm_128eia1, tvb, curr_offset, 1, FALSE);
1471 /* EPS integrity algorithm 128-EIA2 supported (octet 4, bit 6) */
1472 proto_tree_add_item(tree, hf_nas_eps_emm_128eia2, tvb, curr_offset, 1, FALSE);
1473 /* EPS integrity algorithm EIA3 supported (octet 4, bit 5) */
1474 proto_tree_add_item(tree, hf_nas_eps_emm_eia3, tvb, curr_offset, 1, FALSE);
1475 /* EPS integrity algorithm EIA4 supported (octet 4, bit 4) */
1476 proto_tree_add_item(tree, hf_nas_eps_emm_eia4, tvb, curr_offset, 1, FALSE);
1477 /* EPS integrity algorithm EIA5 supported (octet 4, bit 3) */
1478 proto_tree_add_item(tree, hf_nas_eps_emm_eia5, tvb, curr_offset, 1, FALSE);
1479 /* EPS integrity algorithm EIA6 supported (octet 4, bit 2) */
1480 proto_tree_add_item(tree, hf_nas_eps_emm_eia6, tvb, curr_offset, 1, FALSE);
1481 /* EPS integrity algorithm EIA7 supported (octet 4, bit 1) */
1482 proto_tree_add_item(tree, hf_nas_eps_emm_eia7, tvb, curr_offset, 1, FALSE);
1486 /* UMTS encryption algorithms supported (octet 5)
1487 * UMTS encryption algorithm UEA0 supported (octet 5, bit 8)
1489 /* UMTS encryption algorithm UEA0 supported (octet 5, bit 8) */
1490 proto_tree_add_item(tree, hf_nas_eps_emm_uea0, tvb, curr_offset, 1, FALSE);
1491 /* UMTS encryption algorithm UEA1 supported (octet 5, bit 7) */
1492 proto_tree_add_item(tree, hf_nas_eps_emm_uea1, tvb, curr_offset, 1, FALSE);
1493 /* UMTS encryption algorithm UEA2 supported (octet 5, bit 6) */
1494 proto_tree_add_item(tree, hf_nas_eps_emm_uea2, tvb, curr_offset, 1, FALSE);
1495 /* UMTS encryption algorithm UEA3 supported (octet 5, bit 5) */
1496 proto_tree_add_item(tree, hf_nas_eps_emm_uea3, tvb, curr_offset, 1, FALSE);
1497 /* EPS encryption algorithm UEA4 supported (octet 5, bit 4) */
1498 proto_tree_add_item(tree, hf_nas_eps_emm_uea4, tvb, curr_offset, 1, FALSE);
1499 /* UMTS encryption algorithm UEA5 supported (octet 5, bit 5) */
1500 proto_tree_add_item(tree, hf_nas_eps_emm_uea5, tvb, curr_offset, 1, FALSE);
1501 /* UMTS encryption algorithm UEA6 supported (octet 5, bit 6) */
1502 proto_tree_add_item(tree, hf_nas_eps_emm_uea6, tvb, curr_offset, 1, FALSE);
1503 /* UMTS encryption algorithm UEA7 supported (octet 5, bit 7) */
1504 proto_tree_add_item(tree, hf_nas_eps_emm_uea7, tvb, curr_offset, 1, FALSE);
1507 /* UMTS integrity algorithm UIA0 supported (octet 6, bit ) */
1508 proto_tree_add_item(tree, hf_nas_eps_emm_uia0, tvb, curr_offset, 1, FALSE);
1509 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 7) */
1510 proto_tree_add_item(tree, hf_nas_eps_emm_uia1, tvb, curr_offset, 1, FALSE);
1511 /* UMTS integrity algorithm UIA2 supported (octet 6, bit 6) */
1512 proto_tree_add_item(tree, hf_nas_eps_emm_uia2, tvb, curr_offset, 1, FALSE);
1513 /* UMTS integrity algorithm UIA3 supported (octet 6, bit 5) */
1514 proto_tree_add_item(tree, hf_nas_eps_emm_uia3, tvb, curr_offset, 1, FALSE);
1515 /* UMTS integrity algorithm UIA4 supported (octet 6, bit 4) */
1516 proto_tree_add_item(tree, hf_nas_eps_emm_uia4, tvb, curr_offset, 1, FALSE);
1517 /* UMTS integrity algorithm UIA5 supported (octet 6, bit 3) */
1518 proto_tree_add_item(tree, hf_nas_eps_emm_uia5, tvb, curr_offset, 1, FALSE);
1519 /* UMTS integrity algorithm UIA6 supported (octet 6, bit 2) */
1520 proto_tree_add_item(tree, hf_nas_eps_emm_uia6, tvb, curr_offset, 1, FALSE);
1521 /* UMTS integrity algorithm UIA7 supported (octet 6, bit 1) */
1522 proto_tree_add_item(tree, hf_nas_eps_emm_uia7, tvb, curr_offset, 1, FALSE);
1525 /* Bit 8 of octet 7 is spare and shall be coded as zero. */
1526 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 1, FALSE);
1527 /* GPRS encryption algorithm GEA1 supported (octet 7, bit 7) */
1528 proto_tree_add_item(tree, hf_nas_eps_emm_gea1, tvb, curr_offset, 1, FALSE);
1529 /* GPRS encryption algorithm GEA2 supported (octet 7, bit 6) */
1530 proto_tree_add_item(tree, hf_nas_eps_emm_gea2, tvb, curr_offset, 1, FALSE);
1531 /* GPRS encryption algorithm GEA3 supported (octet 7, bit 5) */
1532 proto_tree_add_item(tree, hf_nas_eps_emm_gea3, tvb, curr_offset, 1, FALSE);
1533 /* GPRS encryption algorithm GEA4 supported (octet 7, bit 4) */
1534 proto_tree_add_item(tree, hf_nas_eps_emm_gea4, tvb, curr_offset, 1, FALSE);
1535 /* GPRS encryption algorithm GEA5 supported (octet 7, bit 3) */
1536 proto_tree_add_item(tree, hf_nas_eps_emm_gea5, tvb, curr_offset, 1, FALSE);
1537 /* GPRS encryption algorithm GEA6 supported (octet 7, bit 2) */
1538 proto_tree_add_item(tree, hf_nas_eps_emm_gea6, tvb, curr_offset, 1, FALSE);
1539 /* GPRS encryption algorithm GEA7 supported (octet 7, bit 1) */
1540 proto_tree_add_item(tree, hf_nas_eps_emm_gea7, tvb, curr_offset, 1, FALSE);
1546 * 9.9.3.37 Emergency Number List
1547 * See subclause 10.5.3.13 in 3GPP TS 24.008 [13].
1548 * packet-gsm_a_dtap.c
1556 * The coding of the CLI value part is the same as for octets 3 to 14
1557 * of the Calling party BCD number information element defined in
1558 * subclause 10.5.4.9 of 3GPP TS 24.008
1565 de_emm_ss_code(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1567 guint32 curr_offset;
1569 curr_offset = offset;
1573 * The coding of the SS Code value is given in subclause 17.7.5 of 3GPP TS 29.002 [15B].
1574 * value string imported from gsm map
1576 proto_tree_add_item(tree, hf_nas_eps_emm_ss_code, tvb, curr_offset, 1, FALSE);
1582 * 9.9.3.40 LCS indicator
1584 /* LCS indicator value */
1585 static const value_string nas_eps_emm_lcs_ind_vals[] = {
1586 { 0, "Normal, unspecified"},
1593 de_emm_lcs_ind(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1595 guint32 curr_offset;
1597 curr_offset = offset;
1600 proto_tree_add_item(tree, hf_nas_eps_emm_lcs_ind, tvb, curr_offset, 1, FALSE);
1605 * 9.9.3.41 LCS client identity
1608 de_emm_lcs_client_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1610 guint32 curr_offset;
1613 curr_offset = offset;
1615 /* LCS client identity (value part)
1616 * The coding of the value part of the LCS client identity is given
1617 * in subclause 17.7.13 of 3GPP TS 29.002 [15B](GSM MAP).
1619 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1620 dissect_gsm_map_lcs_LCS_ClientID_PDU( new_tvb, gpinfo, tree );
1626 * 9.9.4 EPS Session Management (ESM) information elements
1630 * 9.9.4.1 Access point name
1631 * See subclause 10.5.6.1 in 3GPP TS 24.008 [6].
1634 * 9.9.4.2 APN aggregate maximum bit rate
1638 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_)
1640 guint32 curr_offset;
1643 curr_offset = offset;
1644 /* APN-AMBR for downlink octet 3 */
1645 octet = tvb_get_guint8(tvb,curr_offset);
1647 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl, tvb, curr_offset, 1, octet,
1650 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl, tvb, curr_offset, 1, octet,
1651 "APN-AMBR for downlink : %u kbps", calc_bitrate(octet));
1655 /* APN-AMBR for uplink octet 4 */
1656 octet = tvb_get_guint8(tvb,curr_offset);
1658 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul, tvb, curr_offset, 1, octet,
1661 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul, tvb, curr_offset, 1, octet,
1662 "APN-AMBR for uplink : %u kbps", calc_bitrate(octet));
1665 /* APN-AMBR for downlink (extended) octet 5 */
1666 octet = tvb_get_guint8(tvb,curr_offset);
1668 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext, tvb, curr_offset, 1, octet,
1669 "Use the value indicated by the APN-AMBR for downlink");
1671 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext, tvb, curr_offset, 1, octet,
1672 "APN-AMBR for downlink (extended) : %u %s",
1673 calc_bitrate_ext(octet),
1674 (octet > 0x4a) ? "Mbps" : "kbps");
1677 /* APN-AMBR for uplink (extended) octet 6 */
1678 octet = tvb_get_guint8(tvb,curr_offset);
1680 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext, tvb, curr_offset, 1, octet,
1681 "Use the value indicated by the APN-AMBR for uplink");
1683 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext, tvb, curr_offset, 1, octet,
1684 "APN-AMBR for uplink (extended) : %u %s",
1685 calc_bitrate_ext(octet),
1686 (octet > 0x4a) ? "Mbps" : "kbps");
1689 /* APN-AMBR for downlink (extended-2) octet 7 */
1690 octet = tvb_get_guint8(tvb,curr_offset);
1691 if((octet==0)||(octet==0xff)){
1692 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext2, tvb, curr_offset, 1, octet,
1693 "Use the value indicated by the APN-AMBR for downlink and APN-AMBR for downlink (extended)");
1695 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext2, tvb, curr_offset, 1, octet,
1696 "APN-AMBR for downlink (extended) : %u Mbs",
1700 /* APN-AMBR for uplink (extended-2) octet 8 */
1701 octet = tvb_get_guint8(tvb,curr_offset);
1702 if((octet==0)||(octet==0xff)){
1703 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext2, tvb, curr_offset, 1, octet,
1704 "Use the value indicated by the APN-AMBR for uplink and APN-AMBR for downlink (extended)");
1706 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext2, tvb, curr_offset, 1, octet,
1707 "APN-AMBR for uplink (extended) : %u Mbs",
1715 * 9.9.4.3 EPS quality of service
1718 /* Quality of Service Class Identifier (QCI), octet 3 (see 3GPP TS 23.203 [7]) */
1719 static const value_string nas_eps_qci_vals[] = {
1720 { 0, "UE -> NW Network selects the QCI / NW -> UE Reserved"},
1736 de_esm_qos(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1738 guint32 curr_offset;
1741 curr_offset = offset;
1744 proto_tree_add_item(tree, hf_nas_eps_qci, tvb, curr_offset, 1, FALSE);
1747 /* Maximum bit rate for uplink octet 4 */
1748 octet = tvb_get_guint8(tvb,curr_offset);
1750 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_ul, tvb, curr_offset, 1, octet,
1751 "UE->NW Subscribed maximum bit rate for uplink/ NW->UE Reserved");
1753 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_ul, tvb, curr_offset, 1, octet,
1754 "Maximum bit rate for uplink : %u kbps", calc_bitrate(octet));
1757 /* Maximum bit rate for downlink octet 5 */
1758 octet = tvb_get_guint8(tvb,curr_offset);
1760 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_dl, tvb, curr_offset, 1, octet,
1761 "UE->NW Subscribed maximum bit rate for downlink/ NW->UE Reserved");
1763 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_dl, tvb, curr_offset, 1, octet,
1764 "Maximum bit rate for downlink : %u kbps", calc_bitrate(octet));
1767 /* Guaranteed bit rate for uplink octet 6 */
1768 octet = tvb_get_guint8(tvb,curr_offset);
1769 proto_tree_add_uint_format(tree, hf_nas_eps_gbr_ul, tvb, curr_offset, 1, octet,
1770 "Guaranteed bit rate for uplink : %u kbps", calc_bitrate(octet));
1773 /* Guaranteed bit rate for downlink octet 7 */
1774 octet = tvb_get_guint8(tvb,curr_offset);
1775 proto_tree_add_uint_format(tree, hf_nas_eps_gbr_ul, tvb, curr_offset, 1, octet,
1776 "Guaranteed bit rate for downlink : %u kbps", calc_bitrate(octet));
1779 /* Maximum bit rate for uplink (extended) octet 8 */
1780 octet = tvb_get_guint8(tvb,curr_offset);
1782 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
1783 "Use the value indicated by the maximum bit rate for uplink in octet 4.");
1785 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
1786 "Maximum bit rate for uplink(extended) : %u %s",
1787 calc_bitrate_ext(octet),
1788 (octet > 0x4a) ? "Mbps" : "kbps");
1792 /* Maximum bit rate for downlink (extended) octet 9 */
1793 octet = tvb_get_guint8(tvb,curr_offset);
1795 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
1796 "Use the value indicated by the maximum bit rate for downlink in octet 5.");
1798 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
1799 "Maximum bit rate for downlink(extended) : %u %s",
1800 calc_bitrate_ext(octet),
1801 (octet > 0x4a) ? "Mbps" : "kbps");
1804 /* Guaranteed bit rate for uplink (extended) octet 10 */
1805 octet = tvb_get_guint8(tvb,curr_offset);
1807 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
1808 "Use the value indicated by the Guaranteed bit rate for uplink in octet 6.");
1810 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
1811 "Guaranteed bit rate for uplink(extended) : %u %s",
1812 calc_bitrate_ext(octet),
1813 (octet > 0x4a) ? "Mbps" : "kbps");
1816 /* Guaranteed bit rate for downlink (extended) octet 11 */
1817 octet = tvb_get_guint8(tvb,curr_offset);
1819 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
1820 "Use the value indicated by the Guaranteed bit rate for downlink in octet 7.");
1822 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
1823 "Guaranteed bit rate for downlink(extended) : %u %s",
1824 calc_bitrate_ext(octet),
1825 (octet > 0x4a) ? "Mbps" : "kbps");
1835 static const value_string nas_eps_esm_cause_vals[] = {
1836 { 0x08, "Operator Determined Barring"},
1837 { 0x1a, "Insufficient resources"},
1838 { 0x1b, "Unknown or missing APN"},
1839 { 0x1c, "Unknown PDN type"},
1840 { 0x1d, "User authentication failed"},
1841 { 0x1e, "Activation rejected by Serving GW or PDN GW"},
1842 { 0x1f, "Activation rejected, unspecified"},
1843 { 0x20, "Service option not supported"},
1844 { 0x21, "Requested service option not subscribed"},
1845 { 0x22, "Service option temporarily out of order"},
1846 { 0x23, "PTI already in use"},
1847 { 0x24, "Regular deactivation"},
1848 { 0x25, "EPS QoS not accepted"},
1849 { 0x26, "Network failure"},
1850 { 0x28, "Feature not supported"},
1851 { 0x29, "Semantic error in the TFT operation"},
1852 { 0x2a, "Syntactical error in the TFT operation"},
1853 { 0x2b, "Invalid EPS bearer identity"},
1854 { 0x2c, "Semantic errors in packet filter(s)"},
1855 { 0x2d, "Syntactical errors in packet filter(s)"},
1856 { 0x2e, "EPS bearer context without TFT already activated"},
1857 { 0x2f, "PTI mismatch"},
1858 { 0x31, "Last PDN disconnection not allowed"},
1859 { 0x32, "PDN type IPv4 only allowed"},
1860 { 0x33, "PDN type IPv6 only allowed"},
1861 { 0x34, "Single address bearers only allowed"},
1862 { 0x35, "ESM information not received"},
1863 { 0x36, "PDN connection does not exist"},
1864 { 0x37, "Multiple PDN connections for a given APN not allowed"},
1865 { 0x38, "Collision with network initiated request"},
1866 { 0x51, "Invalid PTI value"},
1867 { 0x5f, "Semantically incorrect message"},
1868 { 0x60, "Invalid mandatory information"},
1869 { 0x61, "Message type non-existent or not implemented"},
1870 { 0x62, "Message type not compatible with the protocol state"},
1871 { 0x63, "Information element non-existent or not implemented"},
1872 { 0x64, "Conditional IE error"},
1873 { 0x65, "Message not compatible with the protocol state"},
1874 { 0x6f, "Protocol error, unspecified"},
1875 { 0x70, "APN restriction value incompatible with active EPS bearer context"},
1880 de_esm_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1882 guint32 curr_offset;
1884 curr_offset = offset;
1886 proto_tree_add_item(tree, hf_nas_eps_esm_cause, tvb, curr_offset, 1, FALSE);
1891 * 9.9.4.5 ESM information transfer flag
1893 /* EIT (ESM information transfer) */
1894 static const true_false_string nas_eps_emm_eit_vals = {
1895 "Security protected ESM information transfer required",
1896 "Security protected ESM information transfer not required"
1899 de_esm_inf_trf_flg(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1901 guint32 curr_offset;
1903 curr_offset = offset;
1906 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+4, 3, FALSE);
1907 proto_tree_add_item(tree, hf_nas_eps_esm_eit, tvb, curr_offset, 1, FALSE);
1909 return(curr_offset-offset);
1912 * 9.9.4.6 Linked EPS bearer identity
1915 * Linked EPS bearer identity (bits 1-4)
1918 static const value_string nas_eps_esm_linked_bearer_id_vals[] = {
1924 { 0x5, "EPS bearer identity value 5"},
1925 { 0x6, "EPS bearer identity value 6"},
1926 { 0x7, "EPS bearer identity value 7"},
1927 { 0x8, "EPS bearer identity value 8"},
1928 { 0x9, "EPS bearer identity value 9"},
1929 { 0xa, "EPS bearer identity value 10"},
1930 { 0xb, "EPS bearer identity value 11"},
1931 { 0xc, "EPS bearer identity value 12"},
1932 { 0xd, "EPS bearer identity value 13"},
1933 { 0xe, "EPS bearer identity value 14"},
1934 { 0xf, "EPS bearer identity value 15"},
1941 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_)
1943 guint32 curr_offset;
1945 curr_offset = offset;
1947 proto_tree_add_item(tree, hf_nas_eps_esm_lnkd_eps_bearer_id, tvb, curr_offset, 1, FALSE);
1952 * 9.9.4.7 LLC service access point identifier
1953 * See subclause 10.5.6.9 in 3GPP TS 24.008
1956 * 9.9.4.8 Packet flow identifier
1957 * See subclause 10.5.6.11 in 3GPP TS 24.008
1960 * 9.9.4.9 PDN address
1963 de_esm_pdn_addr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1965 guint32 curr_offset;
1968 curr_offset = offset;
1971 pdn_type = tvb_get_guint8(tvb, offset) & 0x7;
1972 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 5, FALSE);
1973 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_type, tvb, curr_offset, 1, FALSE);
1979 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv4, tvb, curr_offset, 4, FALSE);
1984 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv6_len, tvb, curr_offset, 1, FALSE);
1986 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv6, tvb, curr_offset, 16, FALSE);
1991 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv6_len, tvb, curr_offset, 1, FALSE);
1993 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv6, tvb, curr_offset, 16, FALSE);
1995 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv4, tvb, curr_offset, 4, FALSE);
2002 return(curr_offset-offset);
2007 * Coded inline 1/2 octet
2009 static const value_string nas_eps_esm_pdn_type_values[] = {
2017 * 9.9.4.11 Protocol configuration options
2018 * See subclause 10.5.6.3 in 3GPP TS 24.008
2021 * 9.9.4.12 Quality of service
2022 * See subclause 10.5.6.5 in 3GPP TS 24.008
2025 * 9.9.4.13 Radio priority
2026 * See subclause 10.5.7.2 in 3GPP TS 24.008
2029 * 9.9.4.14 Request type
2030 * Coded inline 1/2 octet
2032 static const value_string nas_eps_esm_request_type_values[] = {
2033 { 0x1, "Initial attach" },
2034 { 0x2, "Handover" },
2038 * 9.9.4.15 Traffic flow aggregate description
2039 * The Traffic flow aggregate description information element is encoded using the same format as the Traffic flow
2040 * template information element (see subclause 10.5.6.12 in 3GPP TS 24.008 [13]). When sending this IE, the UE shall
2041 * assign the packet filter identifier values so that they are unique across all packet filters for the PDN connection.
2044 * 9.9.4.16 Traffic flow template
2045 * See subclause 10.5.6.12 in 3GPP TS 24.008
2049 * 9.9.4.17 Transaction identifier
2050 * The Transaction identifier information element is coded as the Linked TI information element in 3GPP TS 24.008 [13],
2051 * subclause 10.5.6.7.
2052 * The coding of the TI flag, the TI value and the EXT bit is defined in 3GPP TS 24.007[20].
2055 guint16 (*emm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
2056 /* 9.9.3 EPS Mobility Management (EMM) information elements */
2057 NULL, /* 9.9.3.1 Authentication failure parameter(dissected in packet-gsm_a_dtap.c) */
2058 NULL, /* 9.9.3.2 Authentication parameter AUTN(packet-gsm_a_dtap.c) */
2059 NULL, /* 9.9.3.3 Authentication parameter RAND */
2060 de_emm_auth_resp_par, /* 9.9.3.4 Authentication response parameter */
2061 de_emm_csfb_resp, /* 9.9.3.5 CSFB response */
2062 NULL, /* 9.9.3.6 Daylight saving time (packet-gsm_a_dtap.c)*/
2063 NULL, /* 9.9.3.7 Detach type */
2064 NULL, /* 9.9.3.8 DRX parameter */
2065 de_emm_cause, /* 9.9.3.9 EMM cause */
2066 NULL, /* 9.9.3.10 EPS attach result (coded inline) */
2067 NULL, /* 9.9.3.11 EPS attach type(Coded Inline) */
2068 de_emm_eps_mid, /* 9.9.3.12 EPS mobile identity */
2069 NULL, /* 9.9.3.13 EPS update result (Coded Inline)*/
2070 NULL, /* 9.9.3.14 EPS update type (Inline)*/
2071 de_emm_esm_msg_cont, /* 9.9.3.15 ESM message conta */
2072 NULL, /* 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. (packet-gsm_a_gm.c)*/
2073 NULL, /* 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. */
2074 de_emm_nas_imeisv_req, /* 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. */
2075 de_emm_nas_ksi_and_seq_no, /* 9.9.3.19 KSI and sequence number */
2076 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) */
2077 de_emm_nas_key_set_id, /* 9.9.3.21 NAS key set identifier (Coded Inline) */
2078 de_emm_nas_msg_cont, /* 9.9.3.22 NAS message container */
2079 de_emm_nas_sec_alsgs, /* 9.9.3.23 NAS security algorithms */
2080 NULL, /* 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. (packet-gsm_a_dtap.c)*/
2081 de_emm_nonce, /* 9.9.3.25 Nonce */
2082 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)*/
2083 NULL, /* 9.9.3.27 Service type */
2084 de_emm_nas_short_mac, /* 9.9.3.28 Short MAC */
2085 NULL, /* 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. (packet-gsm_a_dtap.c)*/
2086 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)*/
2087 NULL, /* 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. (packet-gsm_a_gm.c)*/
2088 de_emm_trac_area_id, /* 9.9.3.32 Tracking area identity */
2089 de_emm_trac_area_id_lst, /* 9.9.3.33 Tracking area identity list */
2090 de_emm_ue_net_cap, /* 9.9.3.34 UE network capability */
2091 de_emm_ue_ra_cap_inf_upd_need, /* 9.9.3.35 UE radio capability information update needed */
2092 de_emm_ue_sec_cap, /* 9.9.3.36 UE security capability */
2093 NULL, /* 9.9.3.37 Emergency Number List (packet-gsm_A_dtap.c) */
2094 NULL, /* 9.9.3.38 CLI */
2095 de_emm_ss_code, /* 9.9.3.39 SS Code */
2096 de_emm_lcs_ind, /* 9.9.3.40 LCS indicator */
2097 de_emm_lcs_client_id, /* 9.9.3.41 LCS client identity */
2101 /* 9.9.4 EPS Session Management (ESM) information elements */
2102 const value_string nas_esm_elem_strings[] = {
2103 { 0x00, "Access point name" }, /* 9.9.4.1 Access point name */
2104 { 0x00, "APN aggregate maximum bit rate" }, /* 9.9.4.2 APN aggregate maximum bit rate */
2105 { 0x00, "EPS quality of service" }, /* 9.9.4.3 EPS quality of service */
2106 { 0x00, "ESM cause" }, /* 9.9.4.4 ESM cause */
2107 { 0x00, "ESM information transfer flag" }, /* 9.9.4.5 ESM information transfer flag */
2108 { 0x00, "Linked EPS bearer identity" }, /* 9.9.4.6 Linked EPS bearer identity */
2109 { 0x00, "LLC service access point identifier" }, /* 9.9.4.7 LLC service access point identifier */
2110 { 0x00, "Packet flow identifier" }, /* 9.9.4.8 Packet flow identifier */
2111 { 0x00, "PDN address" }, /* 9.9.4.9 PDN address */
2112 { 0x00, "PDN type" }, /* 9.9.4.10 PDN type */
2113 { 0x00, "Protocol configuration options" }, /* 9.9.4.11 Protocol configuration options */
2114 { 0x00, "Quality of service" }, /* 9.9.4.12 Quality of service */
2115 { 0x00, "Radio priority" }, /* 9.9.4.13 Radio priority */
2116 { 0x00, "Request type" }, /* 9.9.4.14 Request type */
2117 { 0x00, "Traffic flow aggregate description" }, /* 9.9.4.15 Traffic flow aggregate description */
2118 { 0x00, "Traffic flow templat" }, /* 9.9.4.16 Traffic flow template */
2119 { 0x00, "Transaction identifier" }, /* 9.9.4.17 Transaction identifier */
2124 #define NUM_NAS_ESM_ELEM (sizeof(nas_esm_elem_strings)/sizeof(value_string))
2125 gint ett_nas_eps_esm_elem[NUM_NAS_ESM_ELEM];
2129 DE_ESM_APN, /* 9.9.4.1 Access point name */
2130 DE_ESM_APN_AGR_MAX_BR, /* 9.9.4.2 APN aggregate maximum bit rate */
2131 DE_ESM_EPS_QOS, /* 9.9.4.3 EPS quality of service */
2132 DE_ESM_CAUSE, /* 9.9.4.4 ESM cause */
2133 DE_ESM_INF_TRF_FLG, /* 9.9.4.5 ESM information transfer flag */
2134 DE_ESM_LNKED_EPS_B_ID, /* 9.9.4.6 Linked EPS bearer identity */
2135 DE_ESM_LLC_SAPI, /* 9.9.4.7 LLC service access point identifier */
2136 DE_ESM_P_FLW_ID, /* 9.9.4.8 Packet flow identifier */
2137 DE_ESM_PDN_ADDR, /* 9.9.4.9 PDN address */
2138 DE_ESM_PDN_TYPE, /* 9.9.4.10 PDN type */
2139 DE_ESM_PROT_CONF_OPT, /* 9.9.4.11 Protocol configuration options */
2140 DE_ESM_QOS, /* 9.9.4.12 Quality of service */
2141 DE_ESM_RA_PRI, /* 9.9.4.13 Radio priority */
2142 DE_ESM_REQ_TYPE, /* 9.9.4.14 Request type */
2143 DE_ESM_TRAF_FLOW_AGR_DESC, /* 9.9.4.15 Traffic flow aggregate description */
2144 DE_ESM_TRAF_FLOW_TEMPL, /* 9.9.4.16 Traffic flow template */
2145 DE_ESM_TID, /* 9.9.4.17 Transaction identifier */
2146 DE_ESM_NONE /* NONE */
2151 guint16 (*esm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
2152 NULL, /* 9.9.4.1 Access point name */
2153 de_esm_apn_aggr_max_br, /* 9.9.4.2 APN aggregate maximum bit rate */
2154 de_esm_qos, /* 9.9.4.3 EPS quality of service */
2155 de_esm_cause, /* 9.9.4.4 ESM cause */
2156 de_esm_inf_trf_flg, /* 9.9.4.5 ESM information transfer flag */
2157 de_esm_lnkd_eps_bearer_id, /* 9.9.4.6 Linked EPS bearer identity */
2158 NULL, /* 9.9.4.7 LLC service access point identifier */
2159 NULL, /* 9.9.4.8 Packet flow identifier */
2160 de_esm_pdn_addr, /* 9.9.4.9 PDN address */
2161 NULL, /* 9.9.4.10 PDN type */
2162 NULL, /* 9.9.4.11 Protocol configuration options */
2163 NULL, /* 9.9.4.12 Quality of service */
2164 NULL, /* 9.9.4.13 Radio priority */
2165 NULL, /* 9.9.4.14 Request type */
2166 NULL, /* 9.9.4.15 Traffic flow aggregate description */
2167 NULL, /* 9.9.4.16 Traffic flow template */
2168 NULL, /* 9.9.4.17 Transaction identifier */
2172 /* MESSAGE FUNCTIONS */
2175 * 8.2.1 Attach accept
2179 nas_emm_attach_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2181 guint32 curr_offset, bit_offset;
2185 curr_offset = offset;
2188 /* EPS attach result EPS attach result 9.9.3.10 M V 1/2 */
2189 bit_offset = curr_offset<<3;
2190 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, FALSE);
2192 proto_tree_add_bits_item(tree, hf_nas_eps_emm_EPS_attach_result, tvb, bit_offset, 3, FALSE);
2194 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2195 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
2197 /* Fix up the lengths */
2200 /* T3412 value GPRS timer 9.9.3.16 M V 1 */
2201 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER);
2202 /* Tracking area identity list 9.9.3.33 M LV 7-97 */
2203 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - TAI list");
2204 /* ESM message container 9.9.3.15 M LV-E 2-n */
2205 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, "");
2206 /* 50 GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
2207 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, "GUTI");
2208 /* 13 Location area identification Location area identification 9.9.2.2 O TV 6 */
2209 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, "Location area identification");
2210 /* 23 MS identity Mobile identity 9.9.2.3 O TLV 7-10 */
2211 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, "MS identity");
2212 /* 53 EMM cause EMM cause 9.9.3.9 O TV 2 */
2213 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, "");
2214 /* 17 T3402 value GPRS timer 9.9.3.16 O TV 2 */
2215 ELEM_OPT_TV(0x17, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, "T3402 value");
2216 /* 59 T3423 value GPRS timer 9.9.3.16 O TV 2 */
2217 ELEM_OPT_TV(0x59, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, "T3423 value");
2218 /* 4A Equivalent PLMNs PLMN list 9.9.2.8 O TLV 5-47 */
2219 ELEM_OPT_TLV(0x4a, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_PLM_LST, "Equivalent PLMNs");
2220 /* 34 Emergency Number List 9.9.3.37 O TLV 5-50 */
2221 ELEM_OPT_TLV(0x34, GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST, "");
2223 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2226 * 8.2.2 Attach complete
2229 nas_emm_attach_comp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2231 guint32 curr_offset;
2235 curr_offset = offset;
2238 /* ESM message container ESM message container 9.9.3.15 M LV-E 2-n */
2239 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, "");
2241 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2246 * 8.2.3 Attach reject
2249 nas_emm_attach_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2251 guint32 curr_offset;
2255 curr_offset = offset;
2258 /* * EMM cause EMM cause 9.9.3.9 M V 1 */
2259 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE);
2260 /* 78 ESM message container ESM message container 9.9.3.15 O TLV-E 4-n */
2261 ELEM_OPT_TLV(0x78, NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, "");
2263 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2267 * 8.2.4 Attach request
2270 nas_emm_attach_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2272 guint32 curr_offset, bit_offset;
2276 curr_offset = offset;
2279 bit_offset = curr_offset<<3;
2280 /* EPS attach type EPS attach type 9.9.3.11 M V 1/2
2283 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, FALSE);
2285 proto_tree_add_bits_item(tree, hf_nas_eps_emm_eps_att_type, tvb, bit_offset, 3, FALSE);
2288 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
2289 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
2291 /* Fix the lengths */
2294 /* Old GUTI or IMSI EPS mobile identity 9.9.3.12 M LV 5-12 */
2295 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Old GUTI or IMSI");
2296 /* UE network capability UE network capability 9.9.3.34 M LV 3-14 */
2297 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_UE_NET_CAP, "");
2298 /* ESM message container ESM message container 9.9.3.15 M LV-E 2-n */
2299 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, "");
2300 /* 19 Old P-TMSI signature P-TMSI signature 10.5.5.8 O TV 4 */
2301 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, " - Old P-TMSI Signature");
2302 /* 50 Additional GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
2303 ELEM_OPT_TV( 0x50 , NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Additional GUTI");
2304 /* 52 Last visited registered TAI Tracking area identity 9.9.3.32 O TV 6 */
2305 ELEM_OPT_TV(0x52, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, "Last visited registered TAI");
2306 /* 5c DRX parameter DRX parameter 9.9.3.8 O TV 3 */
2307 ELEM_OPT_TV(0x5c, GSM_A_PDU_TYPE_GM, DE_DRX_PARAM, "" );
2308 /* 31 MS network capability MS network capability 9.9.3.20 M LV 3-9 */
2309 ELEM_OPT_TLV( 0x31, GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP , "" );
2310 /* 13 Old location area identification Location area identification 9.9.2.2 O TV 6 */
2311 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, "Old location area identification");
2312 /* 9- TMSI status TMSI status 9.9.3.31 O TV 1 */
2313 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , "" );
2314 /* 11 Mobile station classmark 2 Mobile station classmark 2 9.9.2.5 O TLV 5 */
2315 ELEM_OPT_TLV( 0x11, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_2 , "" );
2316 /* 20 Mobile station classmark 3 Mobile station classmark 3 9.9.2.5 O TLV 2-34 */
2317 ELEM_OPT_TLV( 0x20, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_3 , "" );
2318 /* 40 Supported Codecs Supported Codec List 9.9.2.10 O TLV 5-n */
2319 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, " - Supported Codecs");
2321 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2324 * 8.2.5 Authentication failure
2327 nas_emm_attach_fail(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2329 guint32 curr_offset;
2333 curr_offset = offset;
2336 /* EMM cause EMM cause 9.9.3.9 M V 1 */
2337 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE);
2338 /* 30 Authentication failure parameter Authentication failure parameter 9.9.3.1 O TLV 1 */
2339 ELEM_OPT_TLV(0x30, GSM_A_PDU_TYPE_DTAP, DE_AUTH_FAIL_PARAM, "");
2341 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2344 * 8.2.6 Authentication reject
2348 * 8.2.7 Authentication request
2352 nas_emm_auth_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2354 guint32 curr_offset, bit_offset;
2358 curr_offset = offset;
2362 * NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2
2364 bit_offset = curr_offset<<3;
2365 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, "ASME");
2368 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2369 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
2371 /* Fix the lengths */
2376 * Authentication parameter RAND (EPS challenge) 9.9.3.3 M V 16
2378 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_RAND);
2380 * Authentication parameter AUTN (EPS challenge) 9.9.3.2 M LV 17
2382 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_AUTH_PARAM_AUTN, " - EPS challenge");
2384 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2388 * 8.2.8 Authentication response
2391 nas_emm_auth_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2393 guint32 curr_offset;
2397 curr_offset = offset;
2401 * Authentication response parameter 9.9.3.4 M LV 5-17
2403 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_AUTH_RESP_PAR, "");
2405 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2409 * 8.2.9 CS service notification
2413 nas_emm_cs_serv_not(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2415 guint32 curr_offset;
2419 curr_offset = offset;
2424 /* 60 CLI CLI 9.9.3.38 O TLV 3-12 */
2425 ELEM_OPT_TLV(0x60, GSM_A_PDU_TYPE_DTAP, DE_CLD_PARTY_BCD_NUM, " - CLI");
2426 /* 61 SS Code SS Code 9.9.3.39 O TV 2 */
2427 ELEM_OPT_TLV(0x61, NAS_PDU_TYPE_EMM, DE_EMM_SS_CODE, "");
2428 /* 62 LCS indicator LCS indicator 9.9.3.40 O TV 2 */
2429 ELEM_OPT_TLV(0x62, NAS_PDU_TYPE_EMM, DE_EMM_LCS_IND, "");
2430 /* 63 LCS client identity LCS client identity 9.9.3.41 O TLV 3-257 */
2431 ELEM_OPT_TLV(0x63, NAS_PDU_TYPE_EMM, DE_EMM_LCS_CLIENT_ID, "");
2433 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2436 * 8.2.10 Detach accept
2437 * 8.2.10.1 Detach accept (UE originating detach)
2439 * 8.2.10.2 Detach accept (UE terminated detach)
2443 * 8.2.11 Detach request
2444 * 8.2.11.1 Detach request (UE originating detach)
2448 nas_emm_detach_req_UL(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2450 guint32 curr_offset,bit_offset;
2454 curr_offset = offset;
2457 proto_tree_add_text(tree, tvb, curr_offset, len,"Up link");
2458 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2459 bit_offset = curr_offset<<3;
2460 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 4, FALSE);
2462 /* Detach type Detach type 9.9.3.6 M V 1/2 */
2463 proto_tree_add_bits_item(tree, hf_nas_eps_emm_switch_off, tvb, bit_offset, 1, FALSE);
2465 proto_tree_add_bits_item(tree, hf_nas_eps_emm_detach_type_UL, tvb, bit_offset, 3, FALSE);
2468 /* Fix the lengths */
2472 /* GUTI or IMSI EPS mobile identity 9.9.3.12 M LV 5-12 */
2473 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI or IMSI");
2478 * 8.2.11.2 Detach request (UE terminated detach)
2481 nas_emm_detach_req_DL(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2483 guint32 curr_offset, bit_offset;
2487 curr_offset = offset;
2490 proto_tree_add_text(tree, tvb, curr_offset, len,"Down link");
2491 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2492 bit_offset = curr_offset<<3;
2493 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 4, FALSE);
2495 /* Detach type Detach type 9.9.3.6 M V 1/2 */
2496 /* In the network to UE direction bit 4 is spare. The network shall set this bit to zero. */
2497 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, FALSE);
2499 proto_tree_add_bits_item(tree, hf_nas_eps_emm_detach_type_DL, tvb, bit_offset, 3, FALSE);
2502 /* Fix the lengths */
2506 /* EMM cause EMM cause 9.9.3.9 O TV 2 */
2507 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, "");
2509 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2514 nas_emm_detach_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2516 guint32 curr_offset;
2519 curr_offset = offset;
2523 if(gpinfo->link_dir==P2P_DIR_UL){
2524 nas_emm_detach_req_UL(tvb, tree, offset, len);
2526 }else if(gpinfo->link_dir==P2P_DIR_DL){
2527 nas_emm_detach_req_DL(tvb, tree, offset, len);
2531 proto_tree_add_text(tree, tvb, curr_offset, len,"UL/DL not known, can't properly dissect");
2538 * 8.2.12 Downlink NAS Transport
2541 nas_emm_dl_nas_trans(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2543 guint32 curr_offset;
2547 curr_offset = offset;
2550 /* NAS message container NAS message container 9.9.3.22 M LV 3-252 */
2551 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_NAS_MSG_CONT, "");
2553 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2556 * 8.2.13 EMM information
2559 nas_emm_emm_inf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2561 guint32 curr_offset;
2565 curr_offset = offset;
2568 /* 43 Full name for network Network name 9.9.3.24 O TLV 3-? */
2569 ELEM_OPT_TLV(0x43, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Full name for network");
2570 /* 45 Short name for network Network name 9.9.3.24 O TLV 3-? */
2571 ELEM_OPT_TLV(0x45, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Short Name");
2572 /* 46 Local time zone Time zone 9.9.3.29 O TV 2 */
2573 ELEM_OPT_TV(0x46, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE, " - Local");
2574 /* 47 Universal time and local time zone Time zone and time 9.9.3.30 O TV 8 */
2575 ELEM_OPT_TV(0x47, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE_TIME, " - Universal Time and Local Time Zone");
2576 /* 49 Network daylight saving time Daylight saving time 9.9.3.6 O TLV 3 */
2577 ELEM_OPT_TLV(0x49, GSM_A_PDU_TYPE_DTAP, DE_DAY_SAVING_TIME, "");
2579 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2587 nas_emm_emm_status(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2589 guint32 curr_offset;
2593 curr_offset = offset;
2596 /* EMM cause EMM cause 9.9.3.9 M V 1 */
2597 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE);
2599 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2603 * 8.2.15 Extended service request
2606 nas_emm_ext_serv_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2608 guint32 curr_offset,bit_offset;
2612 curr_offset = offset;
2615 /* Service type Service type 9.9.3.27 M V 1/2 Service type*/
2616 bit_offset = curr_offset<<3;
2617 proto_tree_add_bits_item(tree, hf_nas_eps_service_type, tvb, bit_offset, 4, FALSE);
2619 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
2620 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
2622 /* Fix up the lengths */
2626 /* M-TMSI Mobile identity 9.9.2.3 M LV 6 */
2627 ELEM_MAND_LV(NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, "M-TMSI");
2628 /* B- CSFB response CSFB response 9.9.3.5 C TV 1 */
2629 ELEM_OPT_TV_SHORT(0xb0, NAS_PDU_TYPE_EMM, DE_EMM_CSFB_RESP, "");
2631 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2634 * 8.2.16 GUTI reallocation command
2637 nas_emm_guti_realloc_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2639 guint32 curr_offset;
2643 curr_offset = offset;
2646 /* GUTI EPS mobile identity 9.9.3.12 M LV 12 */
2647 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
2649 /* 54 TAI list Tracking area identity list 9.9.3.33 O TLV 8-98 */
2650 ELEM_OPT_TLV(0x54, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, "");
2652 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2656 * 8.2.17 GUTI reallocation complete
2660 * 8.2.18 Identity request
2664 nas_emm_id_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2666 guint32 curr_offset, bit_offset;
2670 curr_offset = offset;
2674 bit_offset=curr_offset<<3;
2676 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2677 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
2680 /* Identity type Identity type 2 9.9.3.17 M V 1/2 */
2681 proto_tree_add_bits_item(tree, hf_nas_eps_emm_id_type2, tvb, bit_offset, 4, FALSE);
2686 /* Fix up the lengths */
2690 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2693 * 8.2.19 Identity response
2696 nas_emm_id_res(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2698 guint32 curr_offset;
2702 curr_offset = offset;
2705 /* Mobile identity Mobile identity 9.9.2.3 M LV 4-10 */
2706 ELEM_MAND_LV(NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, "");
2708 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2714 * 8.2.20 Security mode command
2717 nas_emm_sec_mode_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2719 guint32 curr_offset, bit_offset;
2723 curr_offset = offset;
2726 /* Selected NAS security algorithms NAS security algorithms 9.9.3.23 M V 1 */
2727 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_NAS_SEC_ALGS);
2729 bit_offset = curr_offset<<3;
2730 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2731 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
2733 /* NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2 */
2734 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, "ASME");
2737 /* Fix up the lengths */
2741 /* Replayed UE security capabilities UE security capability 9.9.3.36 M LV 3-6 */
2742 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_UE_SEC_CAP, " - Replayed UE security capabilities");
2743 /* C- IMEISV request IMEISV request 9.9.3.18 O TV 1 */
2744 ELEM_OPT_TV_SHORT( 0xC0 , NAS_PDU_TYPE_EMM, DE_EMM_IMEISV_REQ , "" );
2745 /* 55 Replayed NonceUE Nonce 9.9.3.25 O TV 5 */
2746 ELEM_OPT_TV(0x55, GSM_A_PDU_TYPE_GM, DE_EMM_NONCE, " - Replayed NonceUE");
2747 /* 56 NonceMME Nonce 9.9.3.25 O TV 5 */
2748 ELEM_OPT_TV(0x56, GSM_A_PDU_TYPE_GM, DE_EMM_NONCE, " - NonceMME");
2750 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2753 * 8.2.21 Security mode complete
2756 nas_emm_sec_mode_comp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2758 guint32 curr_offset;
2762 curr_offset = offset;
2765 /* 23 IMEISV Mobile identity 9.9.2.3 O TLV 11 */
2766 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, "IMEISV");
2768 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2771 * 8.2.22 Security mode reject
2774 nas_emm_sec_mode_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2776 guint32 curr_offset;
2780 curr_offset = offset;
2783 /* EMM cause EMM cause 9.9.3.9 M V 1 */
2784 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE);
2786 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2789 * 8.2.23 Security protected NAS message
2793 nas_emm_sec_prot_msg(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2795 guint32 curr_offset;
2797 guint8 security_header_type;
2799 curr_offset = offset;
2802 /* Security header type Security header type 9.3.1 M V 1/2 */
2803 security_header_type = tvb_get_guint8(tvb,offset)>>4;
2804 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, 0, 1, FALSE);
2805 /* Protocol discriminator Protocol discriminator 9.2 M V 1/2 */
2806 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, FALSE);
2808 /* Message authentication code Message authentication code 9.5 M V 4 */
2809 if (security_header_type !=0){
2810 /* Message authentication code */
2811 proto_tree_add_item(tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, FALSE);
2813 if ((security_header_type==2)||(security_header_type==4)){
2814 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
2815 proto_tree_add_text(tree, tvb, offset, len-5,"Ciphered message");
2819 proto_tree_add_text(tree, tvb, offset, len,"Not a security protected message");
2822 /* Sequence number Sequence number 9.6 M V 1 */
2823 proto_tree_add_item(tree, hf_nas_eps_seq_no, tvb, offset, 1, FALSE);
2825 /* NAS message NAS message 9.7 M V 1-n */
2830 * 8.2.24 Service reject
2833 nas_emm_serv_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2835 guint32 curr_offset;
2839 curr_offset = offset;
2842 /* EMM cause EMM cause 9.9.3.9 M V 1 */
2843 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE);
2845 /* 5B T3442 value GPRS timer 9.9.3.16 C TV 2 */
2846 ELEM_OPT_TV(0x5b, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3442 value");
2848 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2851 * 8.2.25 Service request
2852 * This message is sent by the UE to the network to request the establishment
2853 * of a NAS signalling connection and of the radio and S1 bearers.
2854 * Its structure does not follow the structure of a standard layer 3 message. See table 8.2.22.1.
2857 * Protocol discriminator Protocol discriminator 9.2 M V 1/2
2858 * Security header type Security header type 9.3.1 M V 1/2
2859 * KSI and sequence number KSI and sequence number 9.9.3.19 M V 1
2860 * Message authentication code (short) Short MAC 9.9.3.28 M V 2
2863 nas_emm_service_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2865 guint32 curr_offset;
2869 curr_offset = offset;
2872 /* KSI and sequence number 9.9.3.19 M V 1 */
2873 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_KSI_AND_SEQ_NO);
2875 /* Short MAC 9.9.3.28 M V 2 */
2876 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_SHORT_MAC);
2878 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2882 * 8.2.26 Tracking area update accept
2885 nas_emm_trac_area_upd_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2887 guint32 curr_offset, bit_offset;
2891 curr_offset = offset;
2894 /* EPS update result EPS update result 9.9.3.13 M V 1/2 */
2895 bit_offset = curr_offset<<3;
2896 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, FALSE);
2898 proto_tree_add_bits_item(tree, hf_nas_eps_eps_update_result_value, tvb, bit_offset, 3, FALSE);
2900 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2901 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
2903 /* Fix up the lengths */
2906 /* No more mandatory elements */
2909 /* 5A T3412 value GPRS timer 9.9.3.16 O TV 2 */
2910 ELEM_OPT_TV(0x5a, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3412 value");
2911 /* 50 GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
2912 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
2913 /* 54 TAI list Tracking area identity list 9.9.3.33 O TLV 8-98 */
2914 ELEM_OPT_TLV(0x54, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, "");
2915 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
2916 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, "");
2917 /* 13 Location area identification Location area identification 9.9.2.2 O TV 6 */
2918 ELEM_OPT_TLV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, "");
2919 /* 23 MS identity Mobile identity 9.9.2.3 O TLV 7-10 */
2920 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - MS identity");
2921 /* 53 EMM cause EMM cause 9.9.3.9 O TV 2 */
2922 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, "");
2923 /* 17 T3402 value GPRS timer 9.9.3.16 O TV 2 */
2924 ELEM_OPT_TV(0x17, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3402 value");
2925 /* 59 T3423 value GPRS timer 9.9.3.16 O TV 2 */
2926 ELEM_OPT_TV(0x59, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3423 value");
2927 /* 4A Equivalent PLMNs PLMN list 9.9.2.8 O TLV 5-47 */
2928 ELEM_OPT_TLV(0x4a, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_PLM_LST, " - PLMN list");
2929 /* 34 Emergency Number List Emergency Number List 9.9.3.37 O TLV 5-50 */
2930 ELEM_OPT_TLV(0x34, GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST, "");
2932 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2935 * 8.2.27 Tracking area update complete
2939 * 8.2.28 Tracking area update reject
2942 nas_emm_trac_area_upd_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2944 guint32 curr_offset;
2948 curr_offset = offset;
2951 /* EMM cause EMM cause 9.9.3.9 M V 1 */
2952 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE);
2954 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2957 * 8.2.29 Tracking area update request
2960 nas_emm_trac_area_upd_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
2963 guint32 curr_offset, bit_offset;
2967 curr_offset = offset;
2970 /* EPS update type EPS update type 9.9.3.14 M V 1/2 */
2971 bit_offset = curr_offset<<3;
2972 proto_tree_add_bits_item(tree, hf_nas_eps_active_flg, tvb, bit_offset, 1, FALSE);
2974 proto_tree_add_bits_item(tree, hf_nas_eps_eps_update_type_value, tvb, bit_offset, 3, FALSE);
2977 /* NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2 */
2978 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, "ASME");
2980 /* Fix the lengths */
2983 /* Old GUTI EPS mobile identity 9.9.3.12 M LV 12 */
2984 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Old GUTI");
2985 /* No more Mandatory elements */
2988 /* B- NAS key set identifierSGSN NAS key set identifier 9.9.3.21 O TV 1 */
2989 ELEM_OPT_TV_SHORT( 0xb0 , NAS_PDU_TYPE_EMM, DE_EMM_UE_RA_CAP_INF_UPD_NEED , "SGSN" );
2990 /* 8- GPRS ciphering key sequence number Ciphering key sequence number 9.9.3.4a O TV 1 */
2991 ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_COMMON, DE_CIPH_KEY_SEQ_NUM, "");
2992 /* 19 Old P-TMSI signature P-TMSI signature 9.9.3.26 O TV 4 */
2993 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, " - Old P-TMSI Signature");
2994 /* 50 Additional GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
2995 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Additional GUTI");
2996 /* 55 NonceUE Nonce 9.9.3.25 O TV 5 */
2997 ELEM_OPT_TV(0x55, GSM_A_PDU_TYPE_GM, DE_EMM_NONCE, " - NonceUE");
2998 /* 58 UE network capability UE network capability 9.9.3.34 O TLV 4-15 */
2999 ELEM_OPT_TLV(0x58, NAS_PDU_TYPE_EMM, DE_EMM_UE_NET_CAP, "");
3000 /* 52 Last visited registered TAI Tracking area identity 9.9.3.32 O TV 6 */
3001 ELEM_OPT_TV(0x52, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, "Last visited registered TAI");
3002 /* 5C DRX parameter DRX parameter 9.9.3.8 O TV 3 */
3003 ELEM_OPT_TV(0x5c, GSM_A_PDU_TYPE_GM, DE_DRX_PARAM, "" );
3004 /* A- UE radio capability information update needed UE radio capability information update needed 9.9.3.35 O TV 1 */
3005 ELEM_OPT_TV_SHORT( 0xA0 , NAS_PDU_TYPE_EMM, DE_EMM_UE_RA_CAP_INF_UPD_NEED , "" );
3006 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
3007 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, "");
3008 /* 31 MS network capability MS network capability 9.9.3.20 O TLV 4-10 */
3009 ELEM_OPT_TLV( 0x31 , GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP , "" );
3010 /* 13 Old location area identification Location area identification 9.9.2.2 O TV 6 */
3011 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, "Old location area identification");
3012 /* 9- TMSI status TMSI status 9.9.3.31 O TV 1 */
3013 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , "" );
3014 /* 11 Mobile station classmark 2 Mobile station classmark 2 9.9.2.5 O TLV 5 */
3015 ELEM_OPT_TLV( 0x11, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_2 , "" );
3016 /* 20 Mobile station classmark 3 Mobile station classmark 3 9.9.2.5 O TLV 2-34 */
3017 ELEM_OPT_TLV( 0x20, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_3 , "" );
3018 /* 40 Supported Codecs Supported Codec List 9.9.2.10 O TLV 5-n */
3019 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, " - Supported Codecs");
3021 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3025 * 8.2.30 Uplink NAS Transport
3028 nas_emm_ul_nas_trans(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3030 guint32 curr_offset;
3034 curr_offset = offset;
3037 /* NAS message container NAS message container 9.9.3.22 M LV 3-252*/
3038 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_NAS_MSG_CONT, "");
3040 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3044 * 8.3 EPS session management messages
3048 * 8.3.1 Activate dedicated EPS bearer context accept
3051 nas_esm_act_ded_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3053 guint32 curr_offset;
3057 curr_offset = offset;
3060 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3061 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3063 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3067 * 8.3.2 Activate dedicated EPS bearer context reject
3070 nas_esm_act_ded_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3072 guint32 curr_offset;
3076 curr_offset = offset;
3079 /* ESM cause ESM cause 9.9.4.2 M V 1 */
3080 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3081 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3082 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3084 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3087 * 8.3.3 Activate dedicated EPS bearer context request
3090 nas_esm_act_ded_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3092 guint32 curr_offset, bit_offset;
3096 curr_offset = offset;
3099 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3100 bit_offset = curr_offset<<3;
3101 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, FALSE);
3103 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
3104 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
3106 /* Fix the lengths */
3110 /* EPS QoS EPS quality of service 9.9.4.3 M LV 2-10 */
3111 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, "");
3112 /* TFT Traffic flow template 9.9.4.16 M LV 2-256 */
3113 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , "" );
3114 /* 5D Transaction identifier Transaction identifier 9.9.4.17 O TLV 3-4 */
3115 ELEM_OPT_TLV( 0x5d , GSM_A_PDU_TYPE_GM, DE_LINKED_TI , "Transaction identifier" );
3116 /* 30 Negotiated QoS Quality of service 9.9.4.12 O TLV 14-18 */
3117 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
3118 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
3119 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
3120 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
3121 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , "" );
3122 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
3123 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , "" );
3124 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3125 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3127 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3131 * 8.3.4 Activate default EPS bearer context accept
3134 nas_esm_act_def_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3136 guint32 curr_offset;
3140 curr_offset = offset;
3146 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3147 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3149 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3153 * 8.3.5 Activate default EPS bearer context reject
3156 nas_esm_act_def_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3158 guint32 curr_offset;
3162 curr_offset = offset;
3165 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3166 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3167 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3168 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3170 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3174 * 8.3.6 Activate default EPS bearer context request
3177 nas_esm_act_def_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3179 guint32 curr_offset;
3183 curr_offset = offset;
3186 /* EPS QoS EPS quality of service 9.9.4.3 M LV 2-10 */
3187 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, "");
3188 /* Access point name Access point name 9.9.4.1 M LV 2-101 */
3189 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , "" );
3190 /* PDN address PDN address 9.9.4.9 M LV 6-14 DE_ESM_PDN_ADDR*/
3191 ELEM_MAND_LV( NAS_PDU_TYPE_ESM, DE_ESM_PDN_ADDR , "" );
3192 /* 5D Transaction identifier Transaction identifier 9.9.4.17 O TLV 3-4 */
3193 ELEM_OPT_TLV( 0x5d , GSM_A_PDU_TYPE_GM, DE_LINKED_TI , "Transaction identifier" );
3194 /* 30 Negotiated QoS Quality of service 9.9.4.12 O TLV 14-18 */
3195 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
3196 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
3197 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
3198 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
3199 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , "" );
3200 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
3201 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , "" );
3202 /* 5E APN-AMBR APN aggregate maximum bit rate 9.9.4.2 O TLV 4-8 DE_ESM_APN_AGR_MAX_BR*/
3203 ELEM_OPT_TLV( 0x34 , NAS_PDU_TYPE_ESM, DE_ESM_APN_AGR_MAX_BR , "" );
3204 /* 58 ESM cause ESM cause 9.9.4.4 O TV 2 */
3205 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3206 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3207 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3209 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3213 * 8.3.7 Bearer resource allocation reject
3216 nas_esm_bearer_res_all_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3218 guint32 curr_offset;
3222 curr_offset = offset;
3225 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3226 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3227 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3228 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3230 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3234 * 8.3.8 Bearer resource allocation request
3237 nas_esm_bearer_res_all_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3239 guint32 curr_offset, bit_offset;
3243 curr_offset = offset;
3246 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3247 bit_offset = curr_offset<<3;
3248 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, FALSE);
3250 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
3251 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
3253 /* Fix the lengths */
3257 /* Traffic flow aggregate Traffic flow aggregate description 9.9.4.15 M LV 2-256 */
3258 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , " - Traffic flow aggregate" );
3259 /* Required traffic flow QoS EPS quality of service 9.9.4.3 M LV 2-10 */
3260 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, " - Required traffic flow QoS");
3261 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3262 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3264 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3267 * 8.3.9 Bearer resource modification reject
3270 nas_esm_bearer_res_mod_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3272 guint32 curr_offset;
3276 curr_offset = offset;
3279 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3280 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3281 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3282 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3284 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3287 * 8.3.108 Bearer resource modification request
3290 nas_esm_bearer_res_mod_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3292 guint32 curr_offset, bit_offset;
3296 curr_offset = offset;
3299 /* EPS bearer identity for packet filter Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3300 bit_offset = curr_offset<<3;
3301 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, FALSE);
3303 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
3304 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
3306 /* Fix the lengths */
3309 /* Traffic flow aggregate Traffic flow aggregate description 9.9.4.15 M LV 2-256 */
3310 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , " - Traffic flow aggregate" );
3311 /* 5B Required traffic flow QoS EPS quality of service 9.9.4.3 O TLV 3-11 */
3312 ELEM_OPT_TLV( 0x27 , NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS , " - Required traffic flow QoS" );
3313 /* 58 ESM cause ESM cause 9.9.4.4 O TV 2 */
3314 ELEM_OPT_TLV( 0x27 , NAS_PDU_TYPE_ESM, DE_ESM_CAUSE , "" );
3315 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3316 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3318 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3321 * 8.3.11 Deactivate EPS bearer context accept
3324 nas_esm_deact_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3326 guint32 curr_offset;
3330 curr_offset = offset;
3336 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV */
3337 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3339 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3342 * 8.3.12 Deactivate EPS bearer context request
3345 nas_esm_deact_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3347 guint32 curr_offset;
3351 curr_offset = offset;
3354 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3355 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3356 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV */
3357 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3359 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3363 * 8.3.13 ESM information request
3367 nas_esm_inf_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3369 guint32 curr_offset;
3372 curr_offset = offset;
3375 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3378 * 8.3.14 ESM information response
3381 nas_esm_inf_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3383 guint32 curr_offset;
3387 curr_offset = offset;
3393 /* 28 Access point name Access point name 9.9.4.1 O TLV 3-102 */
3394 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , "" );
3395 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3396 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3398 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3404 nas_esm_status(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3406 guint32 curr_offset;
3410 curr_offset = offset;
3413 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3414 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3416 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3419 * 8.3.16 Modify EPS bearer context accept
3422 nas_esm_mod_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3424 guint32 curr_offset;
3428 curr_offset = offset;
3434 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3435 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3437 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3440 * 8.3.17 Modify EPS bearer context reject
3443 nas_esm_mod_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3445 guint32 curr_offset;
3449 curr_offset = offset;
3452 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3453 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3454 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3455 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3457 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3460 * 8.3.18 Modify EPS bearer context request
3463 nas_esm_mod_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3465 guint32 curr_offset;
3469 curr_offset = offset;
3474 /* 5B New EPS QoS EPS quality of service 9.9.4.3 O TLV 3-11 */
3475 ELEM_OPT_TLV( 0x27 , NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS , " - New EPS QoS" );
3476 /* 36 TFT Traffic flow template 9.9.4.16 O TLV 3-257 */
3477 ELEM_OPT_TLV( 0x36 , GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , "" );
3478 /* 30 New QoS Quality of service 9.9.4.12 O TLV 14-18 */
3479 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - New QoS" );
3480 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
3481 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
3482 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
3483 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , "" );
3484 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
3485 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , "" );
3486 /* 5E APN-AMBR APN aggregate maximum bit rate 9.9.4.2 O TLV 4-8 */
3487 ELEM_OPT_TLV( 0x34 , NAS_PDU_TYPE_ESM, DE_ESM_APN_AGR_MAX_BR , "" );
3488 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3489 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3491 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3494 * 8.3.19 PDN connectivity reject
3497 nas_esm_pdn_con_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3499 guint32 curr_offset;
3503 curr_offset = offset;
3506 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3507 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3508 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3509 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3511 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3515 * 8.3.18 PDN connectivity request
3518 nas_esm_pdn_con_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3520 guint32 curr_offset, bit_offset;
3524 curr_offset = offset;
3527 bit_offset=curr_offset<<3;
3528 /* PDN type PDN type 9.9.4.10 M V 1/2 */
3529 proto_tree_add_bits_item(tree, hf_nas_eps_esm_pdn_type, tvb, bit_offset, 4, FALSE);
3532 /* Request type 9.9.4.14 M V 1/2 */
3533 proto_tree_add_bits_item(tree, hf_nas_eps_esm_request_type, tvb, bit_offset, 4, FALSE);
3536 /* Fix up the lengths */
3542 /* D- ESM information transfer flag 9.9.4.5 O TV 1 */
3543 ELEM_OPT_TV_SHORT( 0xd0 , NAS_PDU_TYPE_ESM, DE_ESM_INF_TRF_FLG , "" );
3544 /* 28 Access point name 9.9.4.1 O TLV 3-102 */
3545 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , "" );
3546 /* 27 Protocol configuration options 9.9.4.11 O TLV 3-253 */
3547 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3549 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3552 * 8.3.20 PDN disconnect reject
3555 nas_esm_pdn_disc_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3557 guint32 curr_offset;
3561 curr_offset = offset;
3564 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3565 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE);
3566 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3567 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3569 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3572 * 8.3.21 PDN disconnect request
3575 nas_esm_pdn_disc_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3577 guint32 curr_offset, bit_offset;
3581 curr_offset = offset;
3584 /* EPS bearer identity for packet filter Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3585 bit_offset = curr_offset<<3;
3586 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, FALSE);
3588 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
3589 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, FALSE);
3591 /* Fix the lengths */
3594 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3595 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , "" );
3597 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3601 #define NUM_NAS_MSG_ESM (sizeof(nas_msg_esm_strings)/sizeof(value_string))
3602 static gint ett_nas_msg_esm[NUM_NAS_MSG_ESM];
3603 static void (*nas_msg_esm_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
3604 nas_esm_act_def_eps_bearer_ctx_req, /* Activate default EPS bearer context request*/
3605 nas_esm_act_def_eps_bearer_ctx_acc, /* Activate default EPS bearer context accept*/
3606 nas_esm_act_def_eps_bearer_ctx_rej, /* Activate default EPS bearer context reject*/
3607 nas_esm_act_ded_eps_bearer_ctx_req, /* Activate dedicated EPS bearer context request*/
3608 nas_esm_act_ded_eps_bearer_ctx_acc, /* Activate dedicated EPS bearer context accept*/
3609 nas_esm_act_ded_eps_bearer_ctx_rej, /* Activate dedicated EPS bearer context reject*/
3610 nas_esm_mod_eps_bearer_ctx_req, /* Modify EPS bearer context request*/
3611 nas_esm_mod_eps_bearer_ctx_acc, /* Modify EPS bearer context accept*/
3612 nas_esm_mod_eps_bearer_ctx_rej, /* Modify EPS bearer context reject*/
3613 nas_esm_deact_eps_bearer_ctx_req, /* Deactivate EPS bearer context request*/
3614 nas_esm_deact_eps_bearer_ctx_acc, /* Deactivate EPS bearer context accept*/
3615 nas_esm_pdn_con_req, /* 8.3.18 PDN connectivity request */
3616 nas_esm_pdn_con_rej, /* PDN connectivity reject*/
3617 nas_esm_pdn_disc_req, /* PDN disconnect request*/
3618 nas_esm_pdn_disc_rej, /* PDN disconnect reject*/
3619 nas_esm_bearer_res_all_req, /* Bearer resource allocation request*/
3620 nas_esm_bearer_res_all_rej, /* Bearer resource allocation reject*/
3621 nas_esm_bearer_res_mod_req, /* Bearer resource modification request*/
3622 nas_esm_bearer_res_mod_rej, /* Bearer resource modification reject*/
3623 nas_esm_inf_req, /* ESM information request, No IE:s*/
3624 nas_esm_inf_resp, /* ESM information response*/
3625 nas_esm_status, /* ESM status */
3630 void get_nas_esm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn)
3634 *msg_str = match_strval_idx((guint32) (oct & 0xff), nas_msg_esm_strings, &idx);
3635 *ett_tree = ett_nas_msg_esm[idx];
3636 *hf_idx = hf_nas_eps_msg_esm_type;
3637 *msg_fcn = nas_msg_esm_fcn[idx];
3644 #define NUM_NAS_MSG_EMM (sizeof(nas_msg_emm_strings)/sizeof(value_string))
3645 static gint ett_nas_msg_emm[NUM_NAS_MSG_EMM];
3646 static void (*nas_msg_emm_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
3647 nas_emm_attach_req, /* Attach request */
3648 nas_emm_attach_acc, /* Attach accept */
3649 nas_emm_attach_comp, /* Attach complete */
3650 nas_emm_attach_rej, /* Attach reject */
3651 nas_emm_detach_req, /* Detach request */
3652 NULL, /* 8.2.10 Detach accept */
3654 nas_emm_trac_area_upd_req, /* Tracking area update request */
3655 nas_emm_trac_area_upd_acc, /* Tracking area update accept */
3656 NULL, /* Tracking area update complete (No IE's)*/
3657 nas_emm_trac_area_upd_rej, /* Tracking area update reject */
3659 nas_emm_ext_serv_req, /* Extended service request */
3660 nas_emm_serv_rej, /* Service reject */
3662 nas_emm_guti_realloc_cmd, /* GUTI reallocation command */
3663 NULL, /* GUTI reallocation complete (No IE's) */
3664 nas_emm_auth_req, /* Authentication request */
3665 nas_emm_auth_resp, /* Authentication response */
3666 NULL, /* Authentication reject (No IE:s)*/
3667 nas_emm_attach_fail, /* Authentication failure */
3668 nas_emm_id_req, /* Identity request */
3669 nas_emm_id_res, /* Identity response */
3670 nas_emm_sec_mode_cmd, /* Security mode command */
3671 nas_emm_sec_mode_comp, /* Security mode complete */
3672 nas_emm_sec_mode_rej, /* Security mode reject */
3674 nas_emm_emm_status, /* EMM status */
3675 nas_emm_emm_inf, /* EMM information */
3676 nas_emm_dl_nas_trans, /* Downlink NAS transport */
3677 nas_emm_ul_nas_trans, /* Uplink NAS transport */
3678 nas_emm_cs_serv_not, /* 8.2.9 CS service notification */
3683 void get_nas_emm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn)
3687 *msg_str = match_strval_idx((guint32) (oct & 0xff), nas_msg_emm_strings, &idx);
3688 *ett_tree = ett_nas_msg_emm[idx];
3689 *hf_idx = hf_nas_eps_msg_emm_type;
3690 *msg_fcn = nas_msg_emm_fcn[idx];
3696 * EPS session management messages.
3697 * A plain NAS message is pased to this function
3700 disect_nas_eps_esm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3702 const gchar *msg_str;
3706 void (*msg_fcn)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len);
3709 len = tvb_length(tvb);
3711 * EPS bearer identity 9.3.2
3713 proto_tree_add_item(tree, hf_nas_eps_bearer_id, tvb, offset, 1, FALSE);
3714 /* Protocol discriminator 9.2 */
3715 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, FALSE);
3718 /* Procedure transaction identity 9.4
3719 * The procedure transaction identity and its use are defined in 3GPP TS 24.007
3721 proto_tree_add_item(tree, hf_nas_eps_esm_proc_trans_id, tvb, offset, 1, FALSE);
3725 oct = tvb_get_guint8(tvb,offset);
3731 get_nas_esm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn);
3734 if (check_col(pinfo->cinfo, COL_INFO)){
3735 col_append_fstr(pinfo->cinfo, COL_INFO, " %s ", msg_str);
3738 proto_tree_add_text(tree, tvb, offset, 1,"Unknown message 0x%x",oct);
3743 * Add NAS message name
3745 proto_tree_add_item(tree, hf_idx, tvb, offset, 1, FALSE);
3752 if (msg_fcn == NULL)
3754 proto_tree_add_text(tree, tvb, offset, len - offset,
3755 "Message Elements");
3759 (*msg_fcn)(tvb, tree, offset, len - offset);
3764 * The "real" security header has been dissected or if dissect_header = TRUE
3767 dissect_nas_eps_emm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean second_header)
3769 const gchar *msg_str;
3773 void (*msg_fcn)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len);
3774 guint8 security_header_type, oct;
3776 len = tvb_length(tvb);
3778 /* 9.3.1 Security header type */
3780 security_header_type = tvb_get_guint8(tvb,offset)>>4;
3781 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, offset, 1, FALSE);
3782 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, FALSE);
3784 if (security_header_type !=0){
3785 /* Message authentication code */
3786 proto_tree_add_item(tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, FALSE);
3788 /* Sequence number */
3789 proto_tree_add_item(tree, hf_nas_eps_seq_no, tvb, offset, 1, FALSE);
3791 if ((security_header_type==2)||(security_header_type==4))
3792 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
3794 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, offset, 1, FALSE);
3795 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, FALSE);
3800 oct = tvb_get_guint8(tvb,offset);
3806 get_nas_emm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn);
3809 if (check_col(pinfo->cinfo, COL_INFO)){
3810 col_append_fstr(pinfo->cinfo, COL_INFO, " %s ", msg_str);
3813 proto_tree_add_text(tree, tvb, offset, 1,"Unknown message 0x%x",oct);
3818 * Add NAS message name
3820 proto_tree_add_item(tree, hf_idx, tvb, offset, 1, FALSE);
3827 if (msg_fcn == NULL)
3829 proto_tree_add_text(tree, tvb, offset, len - offset,
3830 "Message Elements");
3834 (*msg_fcn)(tvb, tree, offset, len - offset);
3839 * 9 General message format and information elements coding
3841 * Within the protocols defined in the present document, every message, except the SERVICE REQUEST message,
3842 * is a standard L3 message as defined in 3GPP TS 24.007 [12]. This means that the message consists of the following parts:
3843 * 1) if the message is a plain NAS message:
3844 * a) protocol discriminator;
3845 * b) EPS bearer identity or security header type;
3846 * c) procedure transaction identity;
3848 * e) other information elements, as required.
3849 * 2) if the message is a security protected NAS message:
3850 * a) protocol discriminator;
3851 * b) security header type;
3852 * c) message authentication code;
3853 * d) sequence number;
3854 * e) plain NAS message, as defined in item 1.
3856 * The EPS bearer identity and the procedure transaction identity are only used in messages
3857 * with protocol discriminator EPS session management. Octet 1a with the procedure transaction
3858 * identity shall only be included in these messages.
3862 * All messages recived here will have the security header:
3863 * Figure 9.1.2: General message organization example for a security protected NAS message
3864 * 9.3.1 Bits 5 to 8 of the first octet of every EPS Mobility Management (EMM)
3865 * message contain the Security header type IE.
3866 * 4.4.4.2 All ESM messages are integrity protected.
3870 dissect_nas_eps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3873 proto_tree *nas_eps_tree;
3874 guint8 pd, security_header_type;
3880 len = tvb_length(tvb);
3882 /* make entry in the Protocol column on summary display */
3883 if (check_col(pinfo->cinfo, COL_PROTOCOL))
3884 col_append_str(pinfo->cinfo, COL_PROTOCOL, "/NAS-EPS");
3886 item = proto_tree_add_item(tree, proto_nas_eps, tvb, 0, -1, FALSE);
3887 nas_eps_tree = proto_item_add_subtree(item, ett_nas_eps);
3889 /* Security header type Security header type 9.3.1 M V 1/2 */
3890 security_header_type = tvb_get_guint8(tvb,offset)>>4;
3891 proto_tree_add_item(nas_eps_tree, hf_nas_eps_security_header_type, tvb, 0, 1, FALSE);
3892 /* Protocol discriminator Protocol discriminator 9.2 M V 1/2 */
3893 proto_tree_add_item(nas_eps_tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, FALSE);
3894 pd = tvb_get_guint8(tvb,offset)&0x0f;
3896 /* Message authentication code Message authentication code 9.5 M V 4 */
3897 if (security_header_type == 0){
3899 /* Plain EPS mobility management messages. */
3900 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, FALSE);
3903 proto_tree_add_text(tree, tvb, offset, len, "All ESM messages should be integrity protected");
3907 /* SERVICE REQUEST (12) is not a plain NAS message treat separately */
3908 if (security_header_type == 12){
3909 nas_emm_service_req(tvb, tree, offset, len-offset);
3912 /* Message authentication code */
3913 proto_tree_add_item(nas_eps_tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, FALSE);
3915 if ((security_header_type==2)||(security_header_type==4)){
3916 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
3917 proto_tree_add_text(nas_eps_tree, tvb, offset, len-5,"Ciphered message");
3921 /* Sequence number Sequence number 9.6 M V 1 */
3922 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, FALSE);
3924 /* NAS message NAS message 9.7 M V 1-n */
3926 pd = tvb_get_guint8(tvb,offset)&0x0f;
3929 /* EPS session management messages.
3930 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
3932 disect_nas_eps_esm_msg(tvb, pinfo, nas_eps_tree, offset);
3935 /* EPS mobility management messages.
3936 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
3938 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, TRUE);
3941 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"));
3947 void proto_register_nas_eps(void) {
3951 /* List of fields */
3953 static hf_register_info hf[] = {
3954 { &hf_nas_eps_msg_emm_type,
3955 { "NAS EPS Mobility Management Message Type", "nas_eps.nas_msg_emm_type",
3956 FT_UINT8, BASE_HEX, VALS(nas_msg_emm_strings), 0x0,
3959 { &hf_nas_eps_common_elem_id,
3960 { "Element ID", "nas_eps.common.elem_id",
3961 FT_UINT8, BASE_DEC, NULL, 0,
3964 { &hf_nas_eps_emm_elem_id,
3965 { "Element ID", "nas_eps.emm.elem_id",
3966 FT_UINT8, BASE_DEC, NULL, 0,
3969 { &hf_nas_eps_bearer_id,
3970 { "EPS bearer identity", "nas_eps.bearer_id",
3971 FT_UINT8, BASE_HEX, NULL, 0xf0,
3974 { &hf_nas_eps_spare_bits,
3975 { "Spare bit(s)", "nas_eps.spare_bits",
3976 FT_UINT8, BASE_HEX, NULL, 0x0,
3979 { &hf_nas_eps_security_header_type,
3980 { "Security header type","nas_eps.security_header_type",
3981 FT_UINT8,BASE_DEC, VALS(security_header_type_vals), 0xf0,
3984 { &hf_nas_eps_msg_auth_code,
3985 { "Message authentication code","nas_eps.msg_auth_code",
3986 FT_UINT32,BASE_HEX, NULL, 0x0,
3989 { &hf_nas_eps_seq_no,
3990 { "Sequence number","nas_eps.seq_no",
3991 FT_UINT8,BASE_DEC, NULL, 0x0,
3994 { &hf_nas_eps_emm_ebi0,
3995 { "EBI(0) spare","nas_eps.emm.ebi0",
3996 FT_BOOLEAN, 8, NULL, 0x01,
3999 { &hf_nas_eps_emm_ebi1,
4000 { "EBI(1) spare","nas_eps.emm.ebi1",
4001 FT_BOOLEAN, 8, NULL, 0x02,
4004 { &hf_nas_eps_emm_ebi2,
4005 { "EBI(2) spare","nas_eps.emm.ebi2",
4006 FT_BOOLEAN, 8, NULL, 0x04,
4009 { &hf_nas_eps_emm_ebi3,
4010 { "EBI(3) spare","nas_eps.emm.ebi3",
4011 FT_BOOLEAN, 8, NULL, 0x08,
4014 { &hf_nas_eps_emm_ebi4,
4015 { "EBI(4) spare","nas_eps.emm.ebi4",
4016 FT_BOOLEAN, 8, NULL, 0x10,
4019 { &hf_nas_eps_emm_ebi5,
4020 { "EBI(5)","nas_eps.emm.ebi5",
4021 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x20,
4024 { &hf_nas_eps_emm_ebi6,
4025 { "EBI(6)","nas_eps.emm.ebi6",
4026 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x40,
4029 { &hf_nas_eps_emm_ebi7,
4030 { "EBI(7)","nas_eps.emm.ebi7",
4031 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x80,
4034 { &hf_nas_eps_emm_ebi8,
4035 { "EBI(8)","nas_eps.emm.ebi8",
4036 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x01,
4039 { &hf_nas_eps_emm_ebi9,
4040 { "EBI(9)","nas_eps.emm.ebi9",
4041 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x02,
4044 { &hf_nas_eps_emm_ebi10,
4045 { "EBI(10)","nas_eps.emm.ebi10",
4046 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x04,
4049 { &hf_nas_eps_emm_ebi11,
4050 { "EBI(11)","nas_eps.emm.ebi11",
4051 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x08,
4054 { &hf_nas_eps_emm_ebi12,
4055 { "EBI(12)","nas_eps.emm.ebi12",
4056 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x10,
4059 { &hf_nas_eps_emm_ebi13,
4060 { "EBI(13)","nas_eps.emm.ebi13",
4061 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x20,
4064 { &hf_nas_eps_emm_ebi14,
4065 { "EBI(14)","nas_eps.emm.ebi14",
4066 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x40,
4069 { &hf_nas_eps_emm_ebi15,
4070 { "EBI(15)","nas_eps.emm.ebi15",
4071 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x80,
4074 { &hf_nas_eps_emm_dl_nas_cnt,
4075 { "DL NAS COUNT value","nas_eps.emm.dl_nas_cnt",
4076 FT_UINT8,BASE_DEC, NULL, 0x0f,
4079 {&hf_nas_eps_emm_nounce_mme,
4080 { "NonceMME","nas_eps.emm.nounce_mme",
4081 FT_UINT32,BASE_HEX, NULL, 0x0,
4084 { &hf_nas_eps_emm_eps_att_type,
4085 { "EPS attach type","nas_eps.emm.eps_att_type",
4086 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_att_type_vals), 0x0,
4090 { "Type of security context flag (TSC) ","nas_eps.emm.tsc",
4091 FT_UINT8,BASE_DEC, VALS(nas_eps_tsc_vals), 0x0,
4094 { &hf_nas_eps_emm_nas_key_set_id,
4095 { "NAS key set identifier","nas_eps.emm.nas_key_set_id",
4096 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_NAS_key_set_identifier_vals), 0x0,
4099 { &hf_nas_eps_emm_odd_even,
4100 { "odd/even indic","nas_eps.emm.odd_even",
4101 FT_UINT8,BASE_DEC, NULL, 0x8,
4104 { &hf_nas_eps_emm_type_of_id,
4105 { "Type of identity","nas_eps.emm.type_of_id",
4106 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_id_vals), 0x07,
4109 { &hf_nas_eps_emm_mme_grp_id,
4110 { "MME Group ID","nas_eps.emm.mme_grp_id",
4111 FT_UINT16, BASE_DEC, NULL, 0x0,
4114 { &hf_nas_eps_emm_imsi,
4115 { "IMSI", "nas_eps.emm.imsi",
4116 FT_STRING, BASE_NONE, NULL, 0,
4119 { &hf_nas_eps_emm_mme_code,
4120 { "MME Code","nas_eps.emm.mme_code",
4121 FT_UINT8, BASE_DEC, NULL, 0x0,
4124 { &hf_nas_eps_emm_m_tmsi,
4125 { "M-TMSI","nas_eps.emm.m_tmsi",
4126 FT_UINT32, BASE_HEX, NULL, 0x0,
4129 { &hf_nas_eps_esm_msg_cont,
4130 { "ESM message container contents","nas_eps.emm.esm_msg_cont",
4131 FT_BYTES, BASE_NONE, NULL, 0x0,
4132 "ESM message container contents", HFILL }
4134 { &hf_nas_eps_esm_imeisv_req,
4135 { "IMEISV request","nas_eps.emm.imeisv_req",
4136 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_imeisv_req_vals), 0x07,
4139 { &hf_nas_eps_emm_toi,
4140 { "Type of integrity protection algorithm","nas_eps.emm.toi",
4141 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_toi_vals), 0x07,
4144 { &hf_nas_eps_emm_toc,
4145 { "Type of ciphering algorithm","nas_eps.emm.toc",
4146 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_toc_vals), 0x70,
4149 { &hf_nas_eps_emm_EPS_attach_result,
4150 { "Type of identity","nas_eps.emm.EPS_attach_result",
4151 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_EPS_attach_result_values), 0x0,
4154 { &hf_nas_eps_emm_spare_half_octet,
4155 { "Spare half octet","nas_eps.emm.EPS_attach_result",
4156 FT_UINT8,BASE_DEC, NULL, 0x0,
4159 { &hf_nas_eps_emm_res,
4160 { "RES","nas_eps.emm.res",
4161 FT_BYTES, BASE_HEX, NULL, 0x0,
4164 { &hf_nas_eps_emm_csfb_resp,
4165 { "CSFB response","nas_eps.emm.csfb_resp",
4166 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_csfb_resp_vals), 0x03,
4169 { &hf_nas_eps_emm_cause,
4170 { "Cause","nas_eps.emm.cause",
4171 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_cause_values), 0x0,
4174 { &hf_nas_eps_emm_id_type2,
4175 { "Identity type 2","nas_eps.emm.id_type2",
4176 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_id_type2_vals), 0x0,
4179 { &hf_nas_eps_emm_short_mac,
4180 { "Short MAC value","nas_eps.emm.short_mac",
4181 FT_BYTES, BASE_HEX, NULL, 0x0,
4184 { &hf_nas_eps_emm_tai_tol,
4185 { "Type of list","nas_eps.emm.tai_tol",
4186 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_tai_tol_vals), 0x60,
4189 { &hf_nas_eps_emm_tai_n_elem,
4190 { "Number of elements","nas_eps.emm.tai_n_elem",
4191 FT_UINT8, BASE_DEC, NULL, 0x1f,
4194 { &hf_nas_eps_emm_tai_tac,
4195 { "Tracking area code(TAC)","nas_eps.emm.tai_tac",
4196 FT_UINT16, BASE_HEX, NULL, 0x0,
4199 { &hf_nas_eps_emm_128eea0,
4200 { "128-EEA0","nas_eps.emm.128eea0",
4201 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
4204 { &hf_nas_eps_emm_128eea1,
4205 { "128-EEA1","nas_eps.emm.128eea1",
4206 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4209 { &hf_nas_eps_emm_128eea2,
4210 { "128-EEA2","nas_eps.emm.128eea2",
4211 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4214 { &hf_nas_eps_emm_eea3,
4215 { "EEA3","nas_eps.emm.eea3",
4216 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4219 { &hf_nas_eps_emm_eea4,
4220 { "EEA4","nas_eps.emm.eea4",
4221 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4224 { &hf_nas_eps_emm_eea5,
4225 { "EEA5","nas_eps.emm.eea5",
4226 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4229 { &hf_nas_eps_emm_eea6,
4230 { "EEA6","nas_eps.emm.eea6",
4231 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4234 { &hf_nas_eps_emm_eea7,
4235 { "EEA7","nas_eps.emm.eea7",
4236 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4239 { &hf_nas_eps_emm_128eia1,
4240 { "128-EIA1","nas_eps.emm.128eia1",
4241 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4244 { &hf_nas_eps_emm_128eia2,
4245 { "128-EIA2","nas_eps.emm.128eia2",
4246 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4249 { &hf_nas_eps_emm_eia3,
4250 { "EIA3","nas_eps.emm.eia3",
4251 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4254 { &hf_nas_eps_emm_eia4,
4255 { "EIA4","nas_eps.emm.eia4",
4256 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4259 { &hf_nas_eps_emm_eia5,
4260 { "EIA5","nas_eps.emm.eia5",
4261 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4264 { &hf_nas_eps_emm_eia6,
4265 { "EIA6","nas_eps.emm.eia6",
4266 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4269 { &hf_nas_eps_emm_eia7,
4270 { "EIA7","nas_eps.emm.eia7",
4271 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4276 { &hf_nas_eps_emm_uea0,
4277 { "UEA0","nas_eps.emm.uea0",
4278 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
4281 { &hf_nas_eps_emm_uea1,
4282 { "UEA1","nas_eps.emm.uea1",
4283 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4286 { &hf_nas_eps_emm_uea2,
4287 { "UEA2","nas_eps.emm.uea2",
4288 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4291 { &hf_nas_eps_emm_uea3,
4292 { "UEA3","nas_eps.emm.uea3",
4293 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4296 { &hf_nas_eps_emm_uea4,
4297 { "UEA4","nas_eps.emm.uea4",
4298 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4301 { &hf_nas_eps_emm_uea5,
4302 { "UEA5","nas_eps.emm.uea5",
4303 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4306 { &hf_nas_eps_emm_uea6,
4307 { "UEA6","nas_eps.emm.uea6",
4308 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4311 { &hf_nas_eps_emm_uea7,
4312 { "UEA7","nas_eps.emm.uea7",
4313 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4316 { &hf_nas_eps_emm_ucs2_supp,
4317 { "UCS2 support (UCS2)","nas_eps.emm.emm_ucs2_supp",
4318 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ucs2_supp_flg_value), 0x80,
4321 { &hf_nas_eps_emm_uia0,
4322 { "UMTS integrity algorithm UIA0","nas_eps.emm.uia0",
4323 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
4326 { &hf_nas_eps_emm_uia1,
4327 { "UMTS integrity algorithm UIA1","nas_eps.emm.uia1",
4328 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4331 { &hf_nas_eps_emm_uia2,
4332 { "UMTS integrity algorithm UIA2","nas_eps.emm.uia2",
4333 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4336 { &hf_nas_eps_emm_uia3,
4337 { "UMTS integrity algorithm UIA3","nas_eps.emm.uia3",
4338 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4341 { &hf_nas_eps_emm_uia4,
4342 { "UMTS integrity algorithm UIA4","nas_eps.emm.uia4",
4343 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4346 { &hf_nas_eps_emm_uia5,
4347 { "UMTS integrity algorithm UIA5","nas_eps.emm.uia5",
4348 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4351 { &hf_nas_eps_emm_uia6,
4352 { "UMTS integrity algorithm UIA6","nas_eps.emm.uia6",
4353 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4356 { &hf_nas_eps_emm_uia7,
4357 { "UMTS integrity algorithm UIA7","nas_eps.emm.uia7",
4358 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4361 { &hf_nas_eps_emm_gea1,
4362 { "GPRS encryption algorithm GEA1","nas_eps.emm.gea1",
4363 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4366 { &hf_nas_eps_emm_gea2,
4367 { "GPRS encryption algorithm GEA2","nas_eps.emm.gea2",
4368 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4371 { &hf_nas_eps_emm_gea3,
4372 { "GPRS encryption algorithm GEA3","nas_eps.emm.gea3",
4373 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4376 { &hf_nas_eps_emm_gea4,
4377 { "GPRS encryption algorithm GEA4","nas_eps.emm.gea4",
4378 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4381 { &hf_nas_eps_emm_gea5,
4382 { "GPRS encryption algorithm GEA5","nas_eps.emm.gea5",
4383 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4386 { &hf_nas_eps_emm_gea6,
4387 { "GPRS encryption algorithm GEA6","nas_eps.emm.gea6",
4388 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4391 { &hf_nas_eps_emm_gea7,
4392 { "GPRS encryption algorithm GEA7","nas_eps.emm.gea7",
4393 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4397 { &hf_nas_eps_emm_1xsrvcc_cap,
4398 { "1xSRVCC capability ","nas_eps.emm.1xsrvcc_cap",
4399 FT_BOOLEAN, 8, TFS(&nas_eps_emm_1xsrvcc_cap_flg), 0x02,
4402 { &hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg,
4403 { "1xSRVCC capability ","nas_eps.emm.ue_ra_cap_inf_upd_need_flg",
4404 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ue_ra_cap_inf_upd_need_flg), 0x01,
4407 { &hf_nas_eps_emm_ss_code,
4408 { "SS Code","nas_eps.emm.eps_update_result_value",
4409 FT_UINT8,BASE_DEC, VALS(ssCode_vals), 0x0,
4412 { &hf_nas_eps_emm_lcs_ind,
4413 { "LCS indicator","nas_eps.emm.emm_lcs_ind",
4414 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_lcs_ind_vals), 0x0,
4417 { &hf_nas_eps_emm_apn_ambr_ul,
4418 { "APN-AMBR for uplink","nas_eps.emm.apn_ambr_ul",
4419 FT_UINT8,BASE_DEC, NULL, 0x0,
4422 { &hf_nas_eps_emm_apn_ambr_dl,
4423 { "APN-AMBR for downlink","nas_eps.emm.apn_ambr_dl",
4424 FT_UINT8,BASE_DEC, NULL, 0x0,
4427 { &hf_nas_eps_emm_apn_ambr_ul_ext,
4428 { "APN-AMBR for uplink(Extended)","nas_eps.emm.apn_ambr_ul_ext",
4429 FT_UINT8,BASE_DEC, NULL, 0x0,
4432 { &hf_nas_eps_emm_apn_ambr_dl_ext,
4433 { "APN-AMBR for downlink(Extended)","nas_eps.emm.apn_ambr_dl_ext",
4434 FT_UINT8,BASE_DEC, NULL, 0x0,
4437 { &hf_nas_eps_emm_apn_ambr_ul_ext2,
4438 { "APN-AMBR for uplink(Extended-2)","nas_eps.emm.apn_ambr_ul_ext2",
4439 FT_UINT8,BASE_DEC, NULL, 0x0,
4442 { &hf_nas_eps_emm_apn_ambr_dl_ext2,
4443 { "APN-AMBR for downlink(Extended-2)","nas_eps.emm.apn_ambr_dl_ext2",
4444 FT_UINT8,BASE_DEC, NULL, 0x0,
4447 { &hf_nas_eps_emm_switch_off,
4448 { "Switch off","nas_eps.emm.switch_off",
4449 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_switch_off_vals), 0x0,
4452 { &hf_nas_eps_emm_detach_type_UL,
4453 { "Detach Type","nas_eps.emm.detach_type_ul",
4454 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_dtatch_UL_vals), 0x0,
4457 { &hf_nas_eps_emm_detach_type_DL,
4458 { "Detach Type","nas_eps.emm.detach_type_dl",
4459 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_dtatch_DL_vals), 0x0,
4463 { "Quality of Service Class Identifier (QCI)","nas_eps.emm.qci",
4464 FT_UINT8,BASE_DEC, VALS(nas_eps_qci_vals), 0x0,
4467 { &hf_nas_eps_mbr_ul,
4468 { "Maximum bit rate for uplink","nas_eps.emm.mbr_ul",
4469 FT_UINT8,BASE_DEC, NULL, 0x0,
4472 { &hf_nas_eps_mbr_dl,
4473 { "Maximum bit rate for downlink","nas_eps.emm.mbr_dl",
4474 FT_UINT8,BASE_DEC, NULL, 0x0,
4477 { &hf_nas_eps_gbr_ul,
4478 { "Guaranteed bit rate for uplink","nas_eps.emm.gbr_ul",
4479 FT_UINT8,BASE_DEC, NULL, 0x0,
4482 { &hf_nas_eps_gbr_dl,
4483 { "Guaranteed bit rate for downlink","nas_eps.emm.gbr_dl",
4484 FT_UINT8,BASE_DEC, NULL, 0x0,
4487 { &hf_nas_eps_embr_ul,
4488 { "Maximum bit rate for uplink(ext)","nas_eps.emm.embr_ul",
4489 FT_UINT8,BASE_DEC, NULL, 0x0,
4492 { &hf_nas_eps_embr_dl,
4493 { "Maximum bit rate for downlink(ext)","nas_eps.emm.embr_dl",
4494 FT_UINT8,BASE_DEC, NULL, 0x0,
4497 { &hf_nas_eps_egbr_ul,
4498 { "Guaranteed bit rate for uplink(ext)","nas_eps.emm.egbr_ul",
4499 FT_UINT8,BASE_DEC, NULL, 0x0,
4502 { &hf_nas_eps_egbr_dl,
4503 { "Guaranteed bit rate for downlink(ext)","nas_eps.emm.egbr_dl",
4504 FT_UINT8,BASE_DEC, NULL, 0x0,
4507 { &hf_nas_eps_esm_cause,
4508 { "Cause","nas_eps.esm.cause",
4509 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_cause_vals), 0x0,
4512 { &hf_nas_eps_esm_eit,
4513 { "EIT (ESM information transfer)", "nas_eps.emm.eit",
4514 FT_BOOLEAN, 8, TFS(&nas_eps_emm_active_flg_value), 0x01,
4517 { &hf_nas_eps_esm_lnkd_eps_bearer_id,
4518 { "Linked EPS bearer identity","nas_eps.esm.lnkd_eps_bearer_id",
4519 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_linked_bearer_id_vals), 0x0f,
4522 { &hf_nas_eps_esm_pdn_ipv4,
4523 {"PDN IPv4", "nas_eps.esm.pdn_ipv4",
4524 FT_IPv4, BASE_DEC, NULL, 0x0,
4527 { &hf_nas_eps_esm_pdn_ipv6_len,
4528 {"IPv6 Prefix Length", "nas_eps.esm.pdn_ipv6_len",
4529 FT_UINT8, BASE_DEC, NULL, 0x0,
4530 "IPv6 Prefix Length", HFILL}
4532 { &hf_nas_eps_esm_pdn_ipv6,
4533 {"PDN IPv6", "nas_eps.esm.pdn_ipv6",
4534 FT_IPv6, BASE_HEX, NULL, 0x0,
4537 { &hf_nas_eps_esm_linked_bearer_id,
4538 { "Linked EPS bearer identity ","nas_eps.esm.linked_bearer_id",
4539 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_linked_bearer_id_vals), 0x0,
4542 { &hf_nas_eps_active_flg,
4543 { "Active flag", "nas_eps.emm.active_flg",
4544 FT_BOOLEAN, 8, TFS(&nas_eps_emm_active_flg_value), 0x0,
4547 { &hf_nas_eps_eps_update_result_value,
4548 { "EPS update result value","nas_eps.emm.eps_update_result_value",
4549 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_update_result_vals), 0x0,
4552 { &hf_nas_eps_eps_update_type_value,
4553 { "EPS update type value", "nas_eps.emm.update_type_value",
4554 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_update_type_vals), 0x0,
4557 { &hf_nas_eps_service_type,
4558 { "Service type", "nas_eps.emm.service_type",
4559 FT_UINT8,BASE_DEC, VALS(nas_eps_service_type_vals), 0x0,
4562 /* ESM hf cvariables */
4563 { &hf_nas_eps_msg_esm_type,
4564 { "NAS EPS session management messages", "nas_eps.nas_msg_esm_type",
4565 FT_UINT8, BASE_HEX, VALS(nas_msg_esm_strings), 0x0,
4568 { &hf_nas_eps_esm_elem_id,
4569 { "Element ID", "nas_eps.esm.elem_id",
4570 FT_UINT8, BASE_DEC, NULL, 0,
4573 { &hf_nas_eps_esm_proc_trans_id,
4574 { "Procedure transaction identity", "nas_eps.esm.proc_trans_id",
4575 FT_UINT8, BASE_DEC, NULL, 0,
4578 { &hf_nas_eps_esm_pdn_type,
4579 { "PDN type", "nas_eps.nas_eps_esm_pdn_type",
4580 FT_UINT8, BASE_DEC, VALS(nas_eps_esm_pdn_type_values), 0x0,
4583 { &hf_nas_eps_esm_request_type,
4584 { "Request type", "nas_eps.esm_request_type",
4585 FT_UINT8, BASE_HEX, VALS(nas_eps_esm_request_type_values), 0x0,
4590 /* Setup protocol subtree array */
4591 #define NUM_INDIVIDUAL_ELEMS 2
4592 static gint *ett[NUM_INDIVIDUAL_ELEMS +
4593 NUM_NAS_EPS_COMMON_ELEM +
4594 NUM_NAS_MSG_EMM + NUM_NAS_EMM_ELEM+
4595 NUM_NAS_MSG_ESM + NUM_NAS_ESM_ELEM];
4597 ett[0] = &ett_nas_eps;
4598 ett[1] = &ett_nas_eps_esm_msg_cont;
4600 last_offset = NUM_INDIVIDUAL_ELEMS;
4602 for (i=0; i < NUM_NAS_EPS_COMMON_ELEM; i++, last_offset++)
4604 ett_nas_eps_common_elem[i] = -1;
4605 ett[last_offset] = &ett_nas_eps_common_elem[i];
4609 for (i=0; i < NUM_NAS_MSG_EMM; i++, last_offset++)
4611 ett_nas_msg_emm[i] = -1;
4612 ett[last_offset] = &ett_nas_msg_emm[i];
4615 for (i=0; i < NUM_NAS_EMM_ELEM; i++, last_offset++)
4617 ett_nas_eps_emm_elem[i] = -1;
4618 ett[last_offset] = &ett_nas_eps_emm_elem[i];
4621 for (i=0; i < NUM_NAS_MSG_ESM; i++, last_offset++)
4623 ett_nas_msg_esm[i] = -1;
4624 ett[last_offset] = &ett_nas_msg_esm[i];
4627 for (i=0; i < NUM_NAS_ESM_ELEM; i++, last_offset++)
4629 ett_nas_eps_esm_elem[i] = -1;
4630 ett[last_offset] = &ett_nas_eps_esm_elem[i];
4633 /* Register protocol */
4634 proto_nas_eps = proto_register_protocol(PNAME, PSNAME, PFNAME);
4635 /* Register fields and subtrees */
4636 proto_register_field_array(proto_nas_eps, hf, array_length(hf));
4637 proto_register_subtree_array(ett, array_length(ett));
4639 /* Register dissector */
4640 register_dissector(PFNAME, dissect_nas_eps, proto_nas_eps);
4643 proto_reg_handoff_nas_eps(void)
4646 gsm_a_dtap_handle = find_dissector("gsm_a_dtap");