2 * Routines for Non-Access-Stratum (NAS) protocol for Evolved Packet System (EPS) dissection
4 * Copyright 2008 - 2010, Anders Broman <anders.broman@ericsson.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 * References: 3GPP TS 24.301 V9.0.0 (2009-09)
34 #include <epan/packet.h>
35 #include <epan/asn1.h>
37 #include "packet-gsm_map.h"
38 #include "packet-gsm_a_common.h"
39 #include "packet-e212.h"
41 #define PNAME "Non-Access-Stratum (NAS)PDU"
42 #define PSNAME "NAS-EPS"
43 #define PFNAME "nas-eps"
45 /* Initialize the protocol and registered fields */
46 static int proto_nas_eps = -1;
48 /* Dissector handles */
49 static dissector_handle_t gsm_a_dtap_handle;
51 /* Forward declaration */
52 static void disect_nas_eps_esm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset);
54 static int hf_nas_eps_msg_emm_type = -1;
55 int hf_nas_eps_common_elem_id = -1;
56 int hf_nas_eps_emm_elem_id = -1;
57 static int hf_nas_eps_bearer_id = -1;
58 static int hf_nas_eps_spare_bits = -1;
59 static int hf_nas_eps_security_header_type = -1;
60 static int hf_nas_eps_msg_auth_code = -1;
61 static int hf_nas_eps_seq_no = -1;
62 static int hf_nas_eps_seq_no_short = -1;
63 static int hf_nas_eps_emm_ebi0 = -1;
64 static int hf_nas_eps_emm_ebi1 = -1;
65 static int hf_nas_eps_emm_ebi2 = -1;
66 static int hf_nas_eps_emm_ebi3 = -1;
67 static int hf_nas_eps_emm_ebi4 = -1;
68 static int hf_nas_eps_emm_ebi5 = -1;
69 static int hf_nas_eps_emm_ebi6 = -1;
70 static int hf_nas_eps_emm_ebi7 = -1;
71 static int hf_nas_eps_emm_ebi8 = -1;
72 static int hf_nas_eps_emm_ebi9 = -1;
73 static int hf_nas_eps_emm_ebi10 = -1;
74 static int hf_nas_eps_emm_ebi11 = -1;
75 static int hf_nas_eps_emm_ebi12 = -1;
76 static int hf_nas_eps_emm_ebi13 = -1;
77 static int hf_nas_eps_emm_ebi14 = -1;
78 static int hf_nas_eps_emm_ebi15 = -1;
79 static int hf_nas_eps_emm_dl_nas_cnt = -1;
80 static int hf_nas_eps_emm_nounce_mme = -1;
81 static int hf_nas_eps_emm_eps_att_type = -1;
82 static int hf_nas_eps_emm_cs_lcs_type = -1;
83 static int hf_nas_eps_emm_epc_lcs_type = -1;
84 static int hf_nas_eps_emm_emc_bs_type = -1;
85 static int hf_nas_eps_emm_ims_vops_type = -1;
86 static int hf_nas_eps_emm_nas_key_set_id = -1;
87 static int hf_nas_eps_tsc = -1;
88 static int hf_nas_eps_emm_odd_even = -1;
89 static int hf_nas_eps_emm_type_of_id = -1;
90 static int hf_nas_eps_emm_mme_grp_id = -1;
91 static int hf_nas_eps_emm_imsi = -1;
92 static int hf_nas_eps_emm_imei = -1;
93 static int hf_nas_eps_emm_mme_code = -1;
94 static int hf_nas_eps_emm_m_tmsi = -1;
95 static int hf_nas_eps_esm_msg_cont = -1;
96 static int hf_nas_eps_esm_imeisv_req = -1;
97 static int hf_nas_eps_emm_toi = -1;
98 static int hf_nas_eps_emm_toc = -1;
99 static int hf_nas_eps_emm_EPS_attach_result = -1;
100 static int hf_nas_eps_emm_spare_half_octet = -1;
101 static int hf_nas_eps_emm_add_upd_res = -1;
102 static int hf_nas_eps_emm_add_upd_type = -1;
103 static int hf_nas_eps_emm_res = -1;
104 static int hf_nas_eps_emm_csfb_resp = -1;
105 static int hf_nas_eps_emm_cause = -1;
106 static int hf_nas_eps_emm_id_type2 = -1;
107 static int hf_nas_eps_emm_short_mac = -1;
108 static int hf_nas_eps_emm_tai_tol = -1;
109 static int hf_nas_eps_emm_tai_n_elem = -1;
110 static int hf_nas_eps_emm_tai_tac = -1;
111 static int hf_nas_eps_emm_eea0 = -1;
112 static int hf_nas_eps_emm_128eea1 = -1;
113 static int hf_nas_eps_emm_128eea2 = -1;
114 static int hf_nas_eps_emm_eea3 = -1;
115 static int hf_nas_eps_emm_eea4 = -1;
116 static int hf_nas_eps_emm_eea5 = -1;
117 static int hf_nas_eps_emm_eea6 = -1;
118 static int hf_nas_eps_emm_eea7 = -1;
119 static int hf_nas_eps_emm_eia0 = -1;
120 static int hf_nas_eps_emm_128eia1 = -1;
121 static int hf_nas_eps_emm_128eia2 = -1;
122 static int hf_nas_eps_emm_eia3 = -1;
123 static int hf_nas_eps_emm_eia4 = -1;
124 static int hf_nas_eps_emm_eia5 = -1;
125 static int hf_nas_eps_emm_eia6 = -1;
126 static int hf_nas_eps_emm_eia7 = -1;
127 static int hf_nas_eps_emm_uea0 = -1;
128 static int hf_nas_eps_emm_uea1 = -1;
129 static int hf_nas_eps_emm_uea2 = -1;
130 static int hf_nas_eps_emm_uea3 = -1;
131 static int hf_nas_eps_emm_uea4 = -1;
132 static int hf_nas_eps_emm_uea5 = -1;
133 static int hf_nas_eps_emm_uea6 = -1;
134 static int hf_nas_eps_emm_uea7 = -1;
135 static int hf_nas_eps_emm_ucs2_supp = -1;
136 static int hf_nas_eps_emm_uia0 = -1;
137 static int hf_nas_eps_emm_uia1 = -1;
138 static int hf_nas_eps_emm_uia2 = -1;
139 static int hf_nas_eps_emm_uia3 = -1;
140 static int hf_nas_eps_emm_uia4 = -1;
141 static int hf_nas_eps_emm_uia5 = -1;
142 static int hf_nas_eps_emm_uia6 = -1;
143 static int hf_nas_eps_emm_uia7 = -1;
144 static int hf_nas_eps_emm_gea1 = -1;
145 static int hf_nas_eps_emm_gea2 = -1;
146 static int hf_nas_eps_emm_gea3 = -1;
147 static int hf_nas_eps_emm_gea4 = -1;
148 static int hf_nas_eps_emm_gea5 = -1;
149 static int hf_nas_eps_emm_gea6 = -1;
150 static int hf_nas_eps_emm_gea7 = -1;
151 static int hf_nas_eps_emm_1xsrvcc_cap = -1;
152 static int hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg;
153 static int hf_nas_eps_emm_ss_code = -1;
154 static int hf_nas_eps_emm_lcs_ind = -1;
155 static int hf_nas_eps_emm_apn_ambr_ul = -1;
156 static int hf_nas_eps_emm_apn_ambr_dl = -1;
157 static int hf_nas_eps_emm_apn_ambr_ul_ext = -1;
158 static int hf_nas_eps_emm_apn_ambr_dl_ext = -1;
159 static int hf_nas_eps_emm_apn_ambr_ul_ext2 = -1;
160 static int hf_nas_eps_emm_apn_ambr_dl_ext2 = -1;
162 static int hf_nas_eps_emm_switch_off = -1;
163 static int hf_nas_eps_emm_detach_type_UL = -1;
164 static int hf_nas_eps_emm_detach_type_DL = -1;
166 static int hf_nas_eps_qci = -1;
167 static int hf_nas_eps_mbr_ul = -1;
168 static int hf_nas_eps_mbr_dl = -1;
169 static int hf_nas_eps_gbr_ul = -1;
170 static int hf_nas_eps_gbr_dl = -1;
171 static int hf_nas_eps_embr_ul = -1;
172 static int hf_nas_eps_embr_dl = -1;
173 static int hf_nas_eps_egbr_ul = -1;
174 static int hf_nas_eps_egbr_dl = -1;
176 static int hf_nas_eps_esm_cause = -1;
177 static int hf_nas_eps_esm_eit = -1;
178 static int hf_nas_eps_esm_lnkd_eps_bearer_id = -1;
179 static int hf_nas_eps_esm_pdn_type = -1;
180 static int hf_nas_eps_esm_pdn_ipv4 = -1;
181 static int hf_nas_eps_esm_pdn_ipv6_if_id = -1;
183 static int hf_nas_eps_esm_linked_bearer_id = -1;
185 static int hf_nas_eps_active_flg = -1;
186 static int hf_nas_eps_eps_update_result_value = -1;
187 static int hf_nas_eps_eps_update_type_value = -1;
188 static int hf_nas_eps_service_type = -1;
191 static int hf_nas_eps_msg_esm_type = -1;
192 int hf_nas_eps_esm_elem_id = -1;
193 static int hf_nas_eps_esm_proc_trans_id = -1;
195 /* Initialize the subtree pointers */
196 static int ett_nas_eps = -1;
197 static int ett_nas_eps_esm_msg_cont = -1;
199 /* Global variables */
200 static packet_info *gpinfo;
202 /* Table 9.8.1: Message types for EPS mobility management
203 * 0 1 - - - - - - EPS mobility management messages
205 static const value_string nas_msg_emm_strings[] = {
206 { 0x41, "Attach request"},
207 { 0x42, "Attach accept"},
208 { 0x43, "Attach complete"},
209 { 0x44, "Attach reject"},
210 { 0x45, "Detach request"},
211 { 0x46, "Detach accept"},
213 { 0x48, "Tracking area update request"},
214 { 0x49, "Tracking area update accept"},
215 { 0x4a, "Tracking area update complete"},
216 { 0x4b, "Tracking area update reject"},
218 { 0x4c, "Extended service request"},
219 { 0x4e, "Service reject"},
221 { 0x50, "GUTI reallocation command"},
222 { 0x51, "GUTI reallocation complete"},
223 { 0x52, "Authentication request"},
224 { 0x53, "Authentication response"},
225 { 0x54, "Authentication reject"},
226 { 0x5c, "Authentication failure"},
227 { 0x55, "Identity request"},
228 { 0x56, "Identity response"},
229 { 0x5d, "Security mode command"},
230 { 0x5e, "Security mode complete"},
231 { 0x5f, "Security mode reject"},
233 { 0x60, "EMM status"},
234 { 0x61, "EMM information"},
235 { 0x62, "Downlink NAS transport"},
236 { 0x63, "Uplink NAS transport"},
237 { 0x64, "CS Service notification"},
238 { 0x68, "Downlink generic NAS transport"},
239 { 0x69, "Uplink generic NAS transport"},
243 /* Table 9.8.2: Message types for EPS session management */
245 static const value_string nas_msg_esm_strings[] = {
246 { 0xc1, "Activate default EPS bearer context request"},
247 { 0xc2, "Activate default EPS bearer context accept"},
248 { 0xc3, "Activate default EPS bearer context reject"},
249 { 0xc5, "Activate dedicated EPS bearer context request"},
250 { 0xc6, "Activate dedicated EPS bearer context accept"},
251 { 0xc7, "Activate dedicated EPS bearer context reject"},
252 { 0xc9, "Modify EPS bearer context request"},
253 { 0xca, "Modify EPS bearer context accept"},
254 { 0xcb, "Modify EPS bearer context reject"},
255 { 0xcd, "Deactivate EPS bearer context request"},
256 { 0xce, "Deactivate EPS bearer context accept"},
257 { 0xd0, "PDN connectivity request"},
258 { 0xd1, "PDN connectivity reject"},
259 { 0xd2, "PDN disconnect request"},
260 { 0xd3, "PDN disconnect reject"},
261 { 0xd4, "Bearer resource allocation request"},
262 { 0xd5, "Bearer resource allocation reject"},
263 { 0xd6, "Bearer resource modification request"},
264 { 0xd7, "Bearer resource modification reject"},
265 { 0xd9, "ESM information request"},
266 { 0xda, "ESM information response"},
267 { 0xdb, "Notification"},
268 { 0xe8, "ESM status"},
272 static const value_string security_header_type_vals[] = {
273 { 0, "Plain NAS message, not security protected"},
274 { 1, "Integrity protected"},
275 { 2, "Integrity protected and ciphered"},
276 { 3, "Integrity protected with new EPS security context"},
277 { 4, "Integrity protected and ciphered with new EPS security context"},
285 { 12, "Security header for the SERVICE REQUEST message "},
286 { 13, "These values are not used in this version of the protocol. If received they shall be interpreted as \"1100\""},
287 { 14, "These values are not used in this version of the protocol. If received they shall be interpreted as \"1100\""},
288 { 15, "These values are not used in this version of the protocol. If received they shall be interpreted as \"1100\""},
291 static value_string_ext security_header_type_vals_ext = VALUE_STRING_EXT_INIT(security_header_type_vals);
293 const value_string nas_eps_common_elem_strings[] = {
294 { 0x00, "EPS bearer context status" }, /* 9.9.2.1 EPS bearer context status */
295 { 0x00, "Location area identification" }, /* 9.9.2.2 Location area identification */
296 { 0x00, "Mobile identity" }, /* 9.9.2.3 Mobile identity */
297 { 0x00, "Mobile station classmark 2" }, /* 9.9.2.4 Mobile station classmark 2 */
298 { 0x00, "Mobile station classmark 3" }, /* 9.9.2.5 Mobile station classmark 3 */
299 { 0x00, "NAS security parameters from E-UTRA" }, /* 9.9.2.6 NAS security parameters from E-UTRA */
300 { 0x00, "NAS security parameters to E-UTRA" }, /* 9.9.2.7 NAS security parameters to E-UTRA */
301 { 0x00, "PLMN list" }, /* 9.9.2.8 PLMN list */
302 /* 9.9.2.9 Spare half octet */
303 { 0x00, "Supported codec list" }, /* 9.9.2.10 Supported codec list */
306 /* Utility functions */
308 calc_bitrate(guint8 value){
309 guint16 return_value = value;
311 if (value > 63 && value <= 127) {
312 return_value = 64 + (value - 64) * 8;
314 else if (value > 127 && value <= 254) {
315 return_value = 576 + (value - 128) * 64;
317 else if (value==0xff) {
323 calc_bitrate_ext(guint8 value){
324 guint32 return_value = 0;
326 if (value > 0 && value <= 0x4a) {
327 return_value = 8600 + value * 100;
329 else if (value > 0x4a && value <= 0xba) {
330 return_value = 16 + (value-0x4a);
332 else if (value > 0xba && value <= 0xfa) {
333 return_value = 128 + (value-0xba)*2;
342 #define NUM_NAS_EPS_COMMON_ELEM (sizeof(nas_eps_common_elem_strings)/sizeof(value_string))
343 gint ett_nas_eps_common_elem[NUM_NAS_EPS_COMMON_ELEM];
347 DE_EPS_CMN_EPS_BE_CTX_STATUS, /* 9.9.2.1 EPS bearer context status */
348 DE_EPS_CMN_LOC_AREA_ID, /* 9.9.2.2 Location area identification */
349 DE_EPS_CMN_MOB_ID, /* 9.9.2.3 Mobile identity */
350 DE_EPS_MS_CM_2, /* 9.9.2.4 Mobile station classmark 2 */
351 DE_EPS_MS_CM_3, /* 9.9.2.5 Mobile station classmark 3 */
352 DE_EPS_NAS_SEC_PAR_FROM_EUTRA, /* 9.9.2.6 NAS security parameters from E-UTRA */
353 DE_EPS_NAS_SEC_PAR_TO_EUTRA, /* 9.9.2.7 NAS security parameters to E-UTRA */
355 DE_EPS_CMN_PLM_LST, /* 9.9.2.8 PLMN list */
356 DE_EPS_CMN_SUP_CODEC_LST, /* 9.9.2.6 9.9.2.10 Supported codec list */
357 DE_EPS_COMMON_NONE /* NONE */
359 nas_eps_common_elem_idx_t;
361 * 9.9.2 Common information elements
365 * 9.9.2.1 EPS bearer context status
367 static const true_false_string nas_eps_emm_ebi_vals = {
368 "BEARER CONTEXT-ACTIVE",
369 "BEARER CONTEXT-INACTIVE"
373 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_)
377 curr_offset = offset;
379 /* EBI(7) EBI(6) EBI(5) EBI(4) EBI(3) EBI(2) EBI(1) EBI(0) octet 3 */
380 proto_tree_add_item(tree, hf_nas_eps_emm_ebi7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
381 proto_tree_add_item(tree, hf_nas_eps_emm_ebi6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
382 proto_tree_add_item(tree, hf_nas_eps_emm_ebi5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
383 /* EBI(0) - EBI(4): Bits 0 to 4 of octet 3 are spare and shall be coded as zero. */
384 proto_tree_add_item(tree, hf_nas_eps_emm_ebi4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
385 proto_tree_add_item(tree, hf_nas_eps_emm_ebi3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
386 proto_tree_add_item(tree, hf_nas_eps_emm_ebi2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
387 proto_tree_add_item(tree, hf_nas_eps_emm_ebi1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
388 proto_tree_add_item(tree, hf_nas_eps_emm_ebi0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
390 /* EBI(15) EBI(14) EBI(13) EBI(12) EBI(11) EBI(10) EBI(9) EBI(8) octet 4 */
391 proto_tree_add_item(tree, hf_nas_eps_emm_ebi15, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
392 proto_tree_add_item(tree, hf_nas_eps_emm_ebi14, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
393 proto_tree_add_item(tree, hf_nas_eps_emm_ebi13, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
394 proto_tree_add_item(tree, hf_nas_eps_emm_ebi12, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
395 proto_tree_add_item(tree, hf_nas_eps_emm_ebi11, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
396 proto_tree_add_item(tree, hf_nas_eps_emm_ebi10, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
397 proto_tree_add_item(tree, hf_nas_eps_emm_ebi9, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
398 proto_tree_add_item(tree, hf_nas_eps_emm_ebi8, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
403 * 9.9.2.2 Location area identification
404 * See subclause 10.5.1.3 in 3GPP TS 24.008 [6].
407 * 9.9.2.3 Mobile identity
408 * See subclause 10.5.1.4 in 3GPP TS 24.008 [6].
409 * exported from gsm_a_common
413 * 9.9.2.4 Mobile station classmark 2
414 * See subclause 10.5.1.6 in 3GPP TS 24.008 [13].
417 * 9.9.2.5 Mobile station classmark 3
418 * See subclause 10.5.1.7 in 3GPP TS 24.008 [13].
422 * See subclause 10.5.1.13 in 3GPP TS 24.008 [6].
425 * 9.9.2.7 Spare half octet
426 * This element is used in the description of EMM and ESM messages when an odd number of
427 * half octet type 1 information elements are used. This element is filled with spare bits
428 * set to zero and is placed in bits 5 to 8 of the octet unless otherwise specified.
433 * 9.9.2.6 NAS security parameters from E-UTRA
436 de_sec_par_from_eutra(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
440 curr_offset = offset;
442 /* DL NAS COUNT value (short) (octet 2, bit 1 to 4)
443 * This field contains the 4 least significant bits of the binary representation of the downlink
444 * NAS COUNT value applicable when this information element is sent.
446 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
447 proto_tree_add_item(tree, hf_nas_eps_emm_dl_nas_cnt, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
453 * 9.9.2.7 NAS security parameters to E-UTRA
456 de_sec_par_to_eutra(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
460 curr_offset = offset;
461 /* NonceMME value (octet 1 to 5)
462 * This field is coded as the nonce value in the Nonce information element (see subclause 9.9.3.25).
464 proto_tree_add_item(tree, hf_nas_eps_emm_nounce_mme, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
466 /* type of ciphering algorithm (octet 6, bit 5 to 7)
467 * These fields are coded as the type of integrity protection algorithm and type of ciphering algorithm
468 * in the NAS security algorithms information element (see subclause 9.9.3.23).
469 * Bit 4 and 8 of octet 6 are spare and shall be coded as zero.
471 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN);
472 proto_tree_add_item(tree, hf_nas_eps_emm_toc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
473 /* Type of integrity protection algorithm (octet 6, bit 1 to 3)*/
474 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+4, 1, ENC_BIG_ENDIAN);
475 proto_tree_add_item(tree, hf_nas_eps_emm_toi, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
478 * NAS key set identifier (octet 7, bit 1 to 3) and
479 * type of security context flag (TSC) (octet 7, bit 4)
480 * These fields are coded as the NAS key set identifier and type of security context flag in the
481 * NAS key set identifier information element (see subclause 9.9.3.21).
482 * Bit 5 to 8 of octet 7 are spare and shall be coded as zero.
484 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
485 /* Type of security context flag (TSC) V 1/2 */
486 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, (curr_offset<<3)+4, 1, ENC_BIG_ENDIAN);
487 /* NAS key set identifier */
488 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, (curr_offset<<3)+5, 3, ENC_BIG_ENDIAN);
494 * 9.9.2.10 Supported codec list
495 * See subclause 10.5.4.32 in 3GPP TS 24.008 [13].
496 * Dissectecd in packet-gsm_a_dtap.c
499 guint16 (*nas_eps_common_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
500 /* 9.9.2 Common information elements */
501 de_eps_cmn_eps_be_ctx_status, /* 9.9.2.1 EPS bearer context status */
502 de_lai, /* 9.9.2.2 Location area identification */
503 de_mid, /* 9.9.2.3 Mobile identity See subclause 10.5.1.4 in 3GPP TS 24.008*/
504 de_ms_cm_2, /* 9.9.2.4 Mobile station classmark 2 */
505 de_ms_cm_3, /* 9.9.2.5 Mobile station classmark 3 */
506 de_sec_par_from_eutra, /* 9.9.2.6 NAS security parameters from E-UTRA */
507 de_sec_par_to_eutra, /* 9.9.2.7 NAS security parameters to E-UTRA */
509 de_plmn_list, /* 9.9.2.8 PLMN list */
510 NULL, /* 9.9.2.10 Supported codec list (packet-gsm_a_dtap.c) */
514 const value_string nas_emm_elem_strings[] = {
515 /* 9.9.3 EPS Mobility Management (EMM) information elements */
516 { 0x00, "Additional update result" }, /* 9.9.3.0A Additional update result */
517 { 0x00, "Additional update type" }, /* 9.9.3.0B Additional update type */
518 { 0x00, "Authentication failure parameter" }, /* 9.9.3.1 Authentication failure parameter */
519 { 0x00, "Authentication parameter AUTN" }, /* 9.9.3.2 Authentication parameter AUTN */
520 { 0x00, "Authentication parameter RAND" }, /* 9.9.3.3 Authentication parameter RAND */
521 { 0x00, "Authentication response parameter" }, /* 9.9.3.4 Authentication response parameter */
522 { 0x00, "CSFB response" }, /* 9.9.3.5 CSFB response */
523 { 0x00, "Daylight saving time" }, /* 9.9.3.6 Daylight saving time */
524 { 0x00, "Detach type" }, /* 9.9.3.7 Detach type */
525 { 0x00, "DRX parameter" }, /* 9.9.3.8 DRX parameter */
526 { 0x00, "EMM cause" }, /* 9.9.3.9 EMM cause */
527 { 0x00, "EPS attach result" }, /* 9.9.3.10 EPS attach result */
528 { 0x00, "EPS attach type" }, /* 9.9.3.11 EPS attach type */
529 { 0x00, "EPS mobile identity" }, /* 9.9.3.12 EPS mobile identity */
530 { 0x00, "EPS network feature support" }, /* 9.9.3.12 EPS mobile identity */
531 { 0x00, "EPS update result" }, /* 9.9.3.13 EPS update result */
532 { 0x00, "EPS update type" }, /* 9.9.3.14 EPS update type */
533 { 0x00, "ESM message container" }, /* 9.9.3.15 ESM message conta */
534 { 0x00, "GPRS timer" }, /* 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. */
535 { 0x00, "Identity type 2" }, /* 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. */
536 { 0x00, "IMEISV request" }, /* 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. */
537 { 0x00, "KSI and sequence number" }, /* 9.9.3.19 KSI and sequence number */
538 { 0x00, "MS network capability" }, /* 9.9.3.20 MS network capability ,See subclause 10.5.5.12 in 3GPP TS 24.008 [6]. */
539 { 0x00, "NAS key set identifier" }, /* 9.9.3.21 NAS key set identifier */
540 { 0x00, "NAS message container" }, /* 9.9.3.22 NAS message container */
541 { 0x00, "NAS security algorithms" }, /* 9.9.3.23 NAS security algorithms */
542 { 0x00, "Network name" }, /* 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. */
543 { 0x00, "Nonce" }, /* 9.9.3.25 Nonce */
544 { 0x00, "Paging identity" }, /* 9.9.3.25A Paging identity */
545 { 0x00, "P-TMSI signature" }, /* 9.9.3.26 P-TMSI signature, See subclause 10.5.5.8 in 3GPP TS 24.008 [6]. */
546 { 0x00, "Service type" }, /* 9.9.3.27 Service type ,See subclause 10.5.5.15 in 3GPP TS 24.008 [6]. */
547 { 0x00, "Short MAC" }, /* 9.9.3.28 Short MAC */
548 { 0x00, "Time zone" }, /* 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. */
549 { 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]. */
550 { 0x00, "TMSI status" }, /* 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. */
551 { 0x00, "Tracking area identity" }, /* 9.9.3.32 Tracking area identity */
552 { 0x00, "Tracking area identity list" }, /* 9.9.3.33 Tracking area identity list */
553 { 0x00, "UE network capability" }, /* 9.9.3.34 UE network capability */
554 { 0x00, "UE radio capability information update needed" }, /* 9.9.3.35 UE radio capability information update needed */
555 { 0x00, "UE security capability" }, /* 9.9.3.36 UE security capability */
556 { 0x00, "Emergency Number List" }, /* 9.9.3.37 Emergency Number List */
557 { 0x00, "CLI" }, /* 9.9.3.38 CLI */
558 { 0x00, "SS Code" }, /* 9.9.3.39 SS Code */
559 { 0x00, "LCS indicator" }, /* 9.9.3.40 LCS indicator */
560 { 0x00, "LCS client identity" }, /* 9.9.3.41 LCS client identity */
564 #define NUM_NAS_EMM_ELEM (sizeof(nas_emm_elem_strings)/sizeof(value_string))
565 gint ett_nas_eps_emm_elem[NUM_NAS_EMM_ELEM];
568 This enum has been moved to packet-gsm_a_common to
569 make it possible to use element dissecton from this dissector
571 It is left here as a comment for easier reference.
573 Note this enum must be of the same size as the element decoding list
577 /. 9.9.3 EPS Mobility Management (EMM) information elements ./
578 DE_EMM_ADD_UPD_RES, /. 9.9.3.0A Additional update result ./
579 DE_EMM_ADD_UPD_TYPE, /. 9.9.3.0B Additional update type ./
580 DE_EMM_AUTH_FAIL_PAR, /. 9.9.3.1 Authentication failure parameter (dissected in packet-gsm_a_dtap.c)./
581 DE_EMM_AUTN, /. 9.9.3.2 Authentication parameter AUTN ./
582 DE_EMM_AUTH_PAR_RAND, /. 9.9.3.3 Authentication parameter RAND ./
583 DE_EMM_AUTH_RESP_PAR, /. 9.9.3.4 Authentication response parameter ./
584 DE_EMM_CSFB_RESP, /. 9.9.3.5 CSFB response ./
585 DE_EMM_DAYL_SAV_T, /. 9.9.3.6 Daylight saving time ./
586 DE_EMM_DET_TYPE, /. 9.9.3.7 Detach type ./
587 DE_EMM_DRX_PAR, /. 9.9.3.8 DRX parameter (dissected in packet-gsm_a_gm.c)./
588 DE_EMM_CAUSE, /. 9.9.3.9 EMM cause ./
589 DE_EMM_ATT_RES, /. 9.9.3.10 EPS attach result (Coded inline ./
590 DE_EMM_ATT_TYPE, /. 9.9.3.11 EPS attach type (Coded Inline)./
591 DE_EMM_EPS_MID, /. 9.9.3.12 EPS mobile identity ./
592 DE_EMM_EPS_NET_FEATURE_SUP, /. 9.9.3.12A EPS network feature support ./
593 DE_EMM_EPS_UPD_RES, /. 9.9.3.13 EPS update result ( Coded inline)./
594 DE_EMM_EPS_UPD_TYPE, /. 9.9.3.14 EPS update type ./
595 DE_EMM_ESM_MSG_CONT, /. 9.9.3.15 ESM message conta ./
596 DE_EMM_GPRS_TIMER, /. 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. ./
597 DE_EMM_ID_TYPE_2, /. 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. ./
598 DE_EMM_IMEISV_REQ, /. 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. ./
599 DE_EMM_KSI_AND_SEQ_NO, /. 9.9.3.19 KSI and sequence number ./
600 DE_EMM_MS_NET_CAP, /. 9.9.3.20 MS network capability ,See subclause 10.5.5.12 in 3GPP TS 24.008 [6]. ./
601 DE_EMM_NAS_KEY_SET_ID, /. 9.9.3.21 NAS key set identifier (coded inline)./
602 DE_EMM_NAS_MSG_CONT, /. 9.9.3.22 NAS message container ./
603 DE_EMM_NAS_SEC_ALGS, /. 9.9.3.23 NAS security algorithms ./
604 DE_EMM_NET_NAME, /. 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. ./
605 DE_EMM_NONCE, /. 9.9.3.25 Nonce ./
606 DE_EMM_PAGING_ID, /. 9.9.3.25A Paging identity ./
607 DE_EMM_P_TMSI_SIGN, /. 9.9.3.26 P-TMSI signature, See subclause 10.5.5.8 in 3GPP TS 24.008 [6]. ./
608 DE_EMM_SERV_TYPE, /. 9.9.3.27 Service type ./
609 DE_EMM_SHORT_MAC, /. 9.9.3.28 Short MAC ./
610 DE_EMM_TZ, /. 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. ./
611 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]. ./
612 DE_EMM_TMSI_STAT, /. 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. ./
613 DE_EMM_TRAC_AREA_ID, /. 9.9.3.32 Tracking area identity ./
614 DE_EMM_TRAC_AREA_ID_LST, /. 9.9.3.33 Tracking area identity list ./
615 DE_EMM_UE_NET_CAP, /. 9.9.3.34 UE network capability ./
616 DE_EMM_UE_RA_CAP_INF_UPD_NEED, /. 9.9.3.35 UE radio capability information update needed ./
617 DE_EMM_UE_SEC_CAP, /. 9.9.3.36 UE security capability ./
618 DE_EMM_EMERG_NUM_LST, /. 9.9.3.37 Emergency Number List ./
619 DE_EMM_CLI, /. 9.9.3.38 CLI ./
620 DE_EMM_SS_CODE, /. 9.9.3.39 SS Code ./
621 DE_EMM_LCS_IND, /. 9.9.3.40 LCS indicator ./
622 DE_EMM_LCS_CLIENT_ID, /. 9.9.3.41 LCS client identity ./
623 DE_EMM_GEN_MSG_CONT_TYPE, /. 9.9.3.42 Generic message container type ./
624 DE_EMM_GEN_MSG_CONT, /. 9.9.3.43 Generic message container ./
625 DE_EMM_VOICE_DMN_PREF, /. 9.9.3.44 Voice domain preference and UEs usage setting ./
626 DE_EMM_NONE /. NONE ./
632 /* TODO: Update to latest spec */
633 /* 9.9.3 EPS Mobility Management (EMM) information elements
636 * 9.9.3.0A Additional update result
638 static const value_string nas_eps_emm_add_upd_res_vals[] = {
639 { 0x0, "no additional information"},
640 { 0x1, "CS Fallback not preferred"},
646 de_emm_add_upd_res(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
648 guint32 curr_offset, bit_offset;
650 curr_offset = offset;
651 bit_offset = (curr_offset<<3)+4;
653 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
655 proto_tree_add_bits_item(tree, hf_nas_eps_emm_add_upd_res, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
658 return (curr_offset - offset);
661 * 9.9.3.0B Additional update type
663 static const value_string nas_eps_emm_add_upd_type_vals[] = {
664 { 0x0, "no additional information (shall be interpreted as request for combined attach or combined tracking area updating)"},
669 de_emm_add_upd_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
671 guint32 curr_offset, bit_offset;
673 curr_offset = offset;
674 bit_offset = (curr_offset<<3)+4;
676 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
678 proto_tree_add_bits_item(tree, hf_nas_eps_emm_add_upd_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
681 return (curr_offset - offset);
684 * 9.9.3.1 Authentication failure parameter
685 * See subclause 10.5.3.2.2 in 3GPP TS 24.008 [6].
686 * (dissected in packet-gsm_a_dtap.c)
689 * 9.9.3.2 Authentication parameter AUTN
690 * See subclause 10.5.3.1.1 in 3GPP TS 24.008 [6].
693 * 9.9.3.3 Authentication parameter RAND
694 * See subclause 10.5.3.1 in 3GPP TS 24.008 [6].
697 * 9.9.3.4 Authentication response parameter
700 de_emm_auth_resp_par(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
704 curr_offset = offset;
706 proto_tree_add_item(tree, hf_nas_eps_emm_res, tvb, curr_offset, len, ENC_BIG_ENDIAN);
711 * 9.9.3.4A Ciphering key sequence number
712 * See subclause 9.9.3.19 in 3GPP TS 24.008 [13].
716 * 9.9.3.5 CSFB response
720 * CSFB response value (octet 1)
723 static const value_string nas_eps_emm_csfb_resp_vals[] = {
724 { 0x0, "CS fallback rejected by the UE"},
725 { 0x1, "CS fallback accepted by the UE"},
730 de_emm_csfb_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
732 guint32 curr_offset, bit_offset;
734 curr_offset = offset;
737 bit_offset = curr_offset<<3;
738 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset+4, 1, ENC_BIG_ENDIAN);
740 proto_tree_add_item(tree, hf_nas_eps_emm_csfb_resp, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
743 return(curr_offset-offset);
746 * 9.9.3.6 Daylight saving time
747 * See subclause 10.5.3.12 in 3GPP TS 24.008 [6].
750 * 9.9.3.7 Detach type
753 static const value_string nas_eps_emm_switch_off_vals[] = {
754 { 0x0, "Normal detach"},
755 { 0x1, "Switch off"},
758 /* Type of detach (octet 1)
759 * In the UE to network direction:
761 static const value_string nas_eps_emm_type_of_dtatch_UL_vals[] = {
762 { 0x1, "EPS detach"},
763 { 0x2, "IMSI detach"},
764 { 0x3, "Combined EPS/IMSI detach"},
765 { 0x4, "Combined EPS/IMSI detach"}, /* All other values are interpreted as "combined EPS/IMSI detach" in this version of the protocol.*/
766 { 0x5, "Combined EPS/IMSI detach"}, /* -"- */
773 * In the network to UE direction:
776 static const value_string nas_eps_emm_type_of_dtatch_DL_vals[] = {
777 { 0x1, "Re-attach required"},
778 { 0x2, "Re-attach not required"},
779 { 0x3, "IMSI detach"},
780 { 0x4, "IMSI detach"}, /* All other values are interpreted as "re-attach not required" in this version of the protocol.*/
781 { 0x5, "IMSI detach"}, /* -"- */
788 * 9.9.3.8 DRX parameter
789 * See subclause 10.5.5.6 in 3GPP TS 24.008 [13].
794 static const value_string nas_eps_emm_cause_values[] = {
795 { 0x2, "IMSI unknown in HLR"},
796 { 0x3, "Illegal UE"},
797 { 0x5, "IMEI not accepted"},
798 { 0x6, "Illegal ME"},
799 { 0x7, "EPS services not allowed"},
800 { 0x8, "EPS services and non-EPS services not allowed"},
801 { 0x9, "UE identity cannot be derived by the network"},
802 { 0xa, "Implicitly detached"},
803 { 0xb, "PLMN not allowed"},
804 { 0xc, "Tracking Area not allowed"},
805 { 0xd, "Roaming not allowed in this tracking area"},
806 { 0xe, "EPS services not allowed in this PLMN"},
807 { 0xf, "No Suitable Cells In tracking area"},
808 { 0x10, "MSC temporarily not reachable"},
809 { 0x11, "Network failure"},
810 { 0x12, "CS domain not available"},
811 { 0x13, "ESM failure"},
812 { 0x14, "MAC failure"},
813 { 0x15, "Synch failure"},
814 { 0x16, "Congestion"},
815 { 0x17, "UE security capabilities mismatch"},
816 { 0x18, "Security mode rejected, unspecified"},
817 { 0x19, "Not authorized for this CSG"},
818 { 0x1a, "Non-EPS authentication unacceptable"},
819 { 0x26, "CS fallback call establishment not allowed"},
820 { 0x27, "CS service temporarily not available"},
821 { 0x28, "No EPS bearer context activated"},
822 { 0x5f, "Semantically incorrect message"},
823 { 0x60, "Invalid mandatory information"},
824 { 0x61, "Message type non-existent or not implemented"},
825 { 0x62, "Message type not compatible with the protocol state"},
826 { 0x63, "Information element non-existent or not implemented"},
827 { 0x64, "Conditional IE error"},
828 { 0x65, "Message not compatible with the protocol state"},
829 { 0x6f, "Protocol error, unspecified"},
834 de_emm_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
838 curr_offset = offset;
840 proto_tree_add_item(tree, hf_nas_eps_emm_cause, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
843 return curr_offset-offset;}
845 * 9.9.3.10 EPS attach result
848 static const value_string nas_eps_emm_EPS_attach_result_values[] = {
851 { 2, "Combined EPS/IMSI attach"},
862 * 9.9.3.11 EPS attach type
865 static const value_string nas_eps_emm_eps_att_type_vals[] = {
866 { 0, "EPS attach(unused)"},
868 { 2, "Combined handover EPS/IMSI attach"},
869 { 3, "EPS attach(unused)"},
870 { 4, "EPS attach(unused)"},
871 { 5, "EPS attach(unused)"},
872 { 6, "EPS emergency attach"},
879 * 9.9.3.12 EPS mobile identity
882 unpack_eps_mid_digits(tvbuff_t *tvb) {
890 length = tvb_length(tvb);
892 digit_str = ep_alloc(length*2);
894 /* Get identity digit 1 */
895 octet = tvb_get_guint8(tvb,offset);
896 digit_str[i++] = (((octet>>4) & 0x0f) + '0');
899 /* Loop on following octets to retrieve other identity digits */
900 while ( offset < length ){
902 octet = tvb_get_guint8(tvb,offset);
903 digit_str[i] = ((octet & 0x0f) + '0');
907 * unpack second value in byte
911 if (octet == 0x0f) /* odd number bytes - hit filler */
914 digit_str[i] = ((octet & 0x0f) + '0');
923 static const value_string nas_eps_emm_type_of_id_vals[] = {
935 de_emm_eps_mid(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
942 curr_offset = offset;
944 octet = tvb_get_guint8(tvb,offset);
945 /* Type of identity (octet 3) */
946 proto_tree_add_item(tree, hf_nas_eps_emm_odd_even, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
947 proto_tree_add_item(tree, hf_nas_eps_emm_type_of_id, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
951 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
952 digit_str = unpack_eps_mid_digits(new_tvb);
953 proto_tree_add_string(tree, hf_nas_eps_emm_imsi, new_tvb, 0, -1, digit_str);
957 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
958 digit_str = unpack_eps_mid_digits(new_tvb);
959 proto_tree_add_string(tree, hf_nas_eps_emm_imei, new_tvb, 0, -1, digit_str);
964 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
965 /* MME Group ID octet 7 - 8 */
966 proto_tree_add_item(tree, hf_nas_eps_emm_mme_grp_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
968 /* MME Code Octet 9 */
969 proto_tree_add_item(tree, hf_nas_eps_emm_mme_code, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
971 /* M-TMSI Octet 10 - 13 */
972 proto_tree_add_item(tree, hf_nas_eps_emm_m_tmsi, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
976 proto_tree_add_text(tree, tvb, curr_offset, len - 1, "Type of identity not known");
984 * 9.9.3.12A EPS network feature support
986 static const value_string nas_eps_emm_cs_lcs_vals[] = {
987 { 0, "no information about support of location services via CS domain is available"},
988 { 1, "location services via CS domain not supported"},
989 { 2, "location services via CS domain supported"},
993 static const true_false_string nas_eps_emm_epc_lcs_value = {
994 "location services via EPC supported",
995 "location services via EPC not supported"
997 static const true_false_string nas_eps_emm_emc_bs_value = {
998 "emergency bearer services in S1 mode supported",
999 "emergency bearer services in S1 mode not supported"
1001 static const true_false_string nas_eps_emm_ims_vops_value = {
1002 "IMS voice over PS session in S1 mode supported",
1003 "IMS voice over PS session in S1 mode not supported"
1007 de_emm_eps_net_feature_sup(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1009 guint32 curr_offset, bit_offset;
1011 curr_offset = offset;
1012 bit_offset = curr_offset << 3;
1013 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1015 proto_tree_add_bits_item(tree, hf_nas_eps_emm_cs_lcs_type, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
1017 proto_tree_add_bits_item(tree, hf_nas_eps_emm_epc_lcs_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1019 proto_tree_add_bits_item(tree, hf_nas_eps_emm_emc_bs_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1021 proto_tree_add_bits_item(tree, hf_nas_eps_emm_ims_vops_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1027 * 9.9.3.13 EPS update result
1029 static const value_string nas_eps_emm_eps_update_result_vals[] = {
1031 { 1, "Combined TA/LA updated"},
1032 { 2, "TA updated and ISR activated"},
1033 { 3, "Combined TA/LA updated and ISR activated"},
1038 * 9.9.3.14 EPS update type
1040 static const true_false_string nas_eps_emm_active_flg_value = {
1041 "Bearer establishment requested",
1042 "No bearer establishment requested"
1045 static const value_string nas_eps_emm_eps_update_type_vals[] = {
1046 { 0, "TA updating"},
1047 { 1, "Combined TA/LA updating"},
1048 { 2, "Combined TA/LA updating with IMSI attach"},
1049 { 3, "Periodic updating"},
1050 { 4, "unused; shall be interpreted as 'TA updating', if received by the network"},
1051 { 5, "unused; shall be interpreted as 'TA updating', if received by the network"},
1056 * 9.9.3.15 ESM message container
1059 de_emm_esm_msg_cont(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1062 proto_tree *sub_tree;
1064 guint32 curr_offset;
1066 curr_offset = offset;
1069 item = proto_tree_add_item(tree, hf_nas_eps_esm_msg_cont, tvb, curr_offset, len, ENC_BIG_ENDIAN);
1070 sub_tree = proto_item_add_subtree(item, ett_nas_eps_esm_msg_cont);
1072 /* This IE can contain any ESM PDU as defined in subclause 8.3. */
1073 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1074 /* Plain NAS message */
1075 disect_nas_eps_esm_msg(new_tvb, gpinfo, sub_tree, 0/* offset */);
1080 * 9.9.3.16 GPRS timer
1081 * See subclause 10.5.7.3 in 3GPP TS 24.008 [6].
1085 * 9.9.3.17 Identity type 2
1086 * See subclause 10.5.5.9 in 3GPP TS 24.008 [6].
1088 static const value_string nas_eps_emm_id_type2_vals[] = {
1097 * 9.9.3.18 IMEISV request
1098 * See subclause 10.5.5.10 in 3GPP TS 24.008 [6].
1100 /* IMEISV request value (octet 1) */
1101 static const value_string nas_eps_emm_imeisv_req_vals[] = {
1102 { 0, "IMEISV not requested"},
1103 { 1, "IMEISV requested"},
1104 { 2, "IMEISV not requested"},
1105 { 3, "IMEISV not requested"},
1106 { 4, "IMEISV not requested"},
1107 { 5, "IMEISV not requested"},
1108 { 6, "IMEISV not requested"},
1109 { 7, "IMEISV not requested"},
1113 de_emm_nas_imeisv_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1115 guint32 curr_offset;
1118 curr_offset = offset;
1120 bit_offset = curr_offset<<3;
1122 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1123 proto_tree_add_item(tree, hf_nas_eps_esm_imeisv_req, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1126 return(curr_offset - offset);
1129 * 9.9.3.19 KSI and sequence number
1132 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_)
1134 guint32 curr_offset;
1137 curr_offset = offset;
1138 bit_offset = curr_offset<<3;
1140 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1142 proto_tree_add_bits_item(tree, hf_nas_eps_seq_no_short, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
1145 return(curr_offset - offset);
1149 * 9.9.3.20 MS network capability
1150 * See subclause 10.5.5.12 in 3GPP TS 24.008 [6].
1153 * 9.9.3.21 NAS key set identifier
1156 * Type of security context flag (TSC) (octet 1)
1158 static const value_string nas_eps_tsc_vals[] = {
1159 { 0, "Native security context"},
1160 { 1, "Mapped security context"},
1164 /* NAS key set identifier (octet 1) Bits 3 2 1 */
1166 static const value_string nas_eps_emm_NAS_key_set_identifier_vals[] = {
1174 { 7, "No key is available"},
1178 /* Takes bit offset as input and consumes 4 bits */
1180 de_emm_nas_key_set_id_bits(tvbuff_t *tvb, proto_tree *tree, guint32 bit_offset, const gchar *add_string)
1184 /* Type of security context flag (TSC) (octet 1) V 1/2 */
1185 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1187 /* NAS key set identifier (octet 1) */
1188 item = proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1190 proto_item_append_text(item, "%s", add_string);
1195 * Note used for TV Short
1198 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_)
1200 guint32 curr_offset, bit_offset;
1202 curr_offset = offset;
1204 /* Get the bit offset of the lover half of the octet bits 4 - 1 */
1205 bit_offset = curr_offset<<3;
1208 /* Type of security context flag (TSC) (octet 1) V 1/2 */
1209 proto_tree_add_bits_item(tree, hf_nas_eps_tsc, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1211 /* NAS key set identifier (octet 1) */
1212 proto_tree_add_bits_item(tree, hf_nas_eps_emm_nas_key_set_id, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1216 return(curr_offset - offset);
1220 * 9.9.3.22 NAS message container
1223 de_emm_nas_msg_cont(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1226 guint32 curr_offset;
1228 curr_offset = offset;
1231 /* NAS message container contents (octet 3 to octet n)
1232 * This IE can contain an SMS message (i.e. CP-DATA, CP-ACK or CP-ERROR)
1233 * as defined in subclause 7.2 in 3GPP TS 24.011 [13A].
1236 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1237 if(gsm_a_dtap_handle)
1238 call_dissector(gsm_a_dtap_handle,new_tvb, gpinfo, tree);
1243 * 9.9.3.23 NAS security algorithms
1245 /* Type of integrity protection algorithm (octet 2, bit 1 to 3) */
1246 static const value_string nas_eps_emm_toi_vals[] = {
1247 { 0, "EPS integrity algorithm EIA0 (null integrity protection algorithm)"},
1248 { 1, "EPS integrity algorithm 128-EIA1"},
1249 { 2, "EPS integrity algorithm 128-EIA2"},
1250 { 3, "EPS integrity algorithm EIA3"},
1251 { 4, "EPS integrity algorithm EIA4"},
1252 { 5, "EPS integrity algorithm EIA5"},
1253 { 6, "EPS integrity algorithm EIA6"},
1254 { 7, "EPS integrity algorithm EIA7"},
1258 /* Type of ciphering algorithm (octet 2, bit 5 to 7) */
1260 static const value_string nas_eps_emm_toc_vals[] = {
1261 { 0, "EPS encryption algorithm EEA0 (null ciphering algorithm)"},
1262 { 1, "EPS encryption algorithm 128-EEA1"},
1263 { 2, "EPS encryption algorithm 128-EEA2"},
1264 { 3, "EPS encryption algorithm EEA3"},
1265 { 4, "EPS encryption algorithm EEA4"},
1266 { 5, "EPS encryption algorithm EEA5"},
1267 { 6, "EPS encryption algorithm EEA6"},
1268 { 7, "EPS encryption algorithm EEA7"},
1272 de_emm_nas_sec_alsgs(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1275 guint32 curr_offset;
1277 curr_offset = offset;
1279 bit_offset = offset<<3;
1280 /* Bit 4 and 8 of octet 2 are spare and shall be coded as zero. */
1281 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1282 /* Type of ciphering algorithm (octet 2, bit 5 to 7) */
1283 proto_tree_add_item(tree, hf_nas_eps_emm_toc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1285 /* Bit 4 and 8 of octet 2 are spare and shall be coded as zero. */
1286 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
1287 /* Type of integrity protection algorithm (octet 2, bit 1 to 3) */
1288 proto_tree_add_item(tree, hf_nas_eps_emm_toi, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1292 return(curr_offset-offset);
1295 * 9.9.3.24 Network name
1296 * See subclause 10.5.3.5a in 3GPP TS 24.008 [6].
1300 * Editor's note: The coding of this information element is FFS.
1303 de_emm_nonce(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1305 guint32 curr_offset;
1307 curr_offset = offset;
1310 proto_tree_add_text(tree, tvb, curr_offset, 4 , "Nounce");
1316 * 9.9.3.25A Paging identity
1319 de_emm_paging_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1321 guint32 curr_offset;
1323 curr_offset = offset;
1326 proto_tree_add_text(tree, tvb, curr_offset, len , "Paging identity value (Not dissected yet)");
1332 * 9.9.3.26 P-TMSI signature
1333 * See subclause 10.5.5.8 in 3GPP TS 24.008 [6].
1336 * 9.9.3.27 Service type
1338 static const value_string nas_eps_service_type_vals[] = {
1339 { 0, "Mobile originating CS fallback or 1xCS fallback"},
1340 { 1, "Mobile terminating CS fallback or 1xCS fallback"},
1341 { 2, "Mobile originating CS fallback emergency call or 1xCS fallback emergency call"},
1346 * 9.9.3.28 Short MAC
1349 de_emm_nas_short_mac(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1351 guint32 curr_offset;
1353 curr_offset = offset;
1356 proto_tree_add_item(tree, hf_nas_eps_emm_short_mac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1359 return(curr_offset-offset);
1362 * 9.9.3.29 Time zone
1363 * See subclause 10.5.3.8 in 3GPP TS 24.008 [6].
1366 * 9.9.3.30 Time zone and time
1367 * See subclause 10.5.3.9 in 3GPP TS 24.008 [6].
1370 * 9.9.3.31 TMSI status
1371 * See subclause 10.5.5.4 in 3GPP TS 24.008 [6].
1374 * 9.9.3.32 Tracking area identity
1378 de_emm_trac_area_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1380 guint32 curr_offset;
1382 curr_offset = offset;
1384 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1385 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1388 return(curr_offset-offset);
1391 * 9.9.3.33 Tracking area identity list
1393 /* Type of list (octet 1)
1396 static const value_string nas_eps_emm_tai_tol_vals[] = {
1397 { 0, "list of TACs belonging to one PLMN, with non-consecutive TAC values"},
1398 { 1, "list of TACs belonging to one PLMN, with consecutive TAC values"},
1399 { 2, "list of TAIs belonging to different PLMNs"},
1404 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_)
1407 guint32 curr_offset;
1408 guint8 octet, tol, n_elem;
1411 curr_offset = offset;
1413 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN);
1414 /* Type of list (octet 1) Bits 7 6 */
1415 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tol, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1416 /* Number of elements (octet 1) Bits 5 4 3 2 1 */
1417 octet = tvb_get_guint8(tvb,curr_offset)& 0x7f;
1419 n_elem = (octet & 0x1f)+1;
1420 item = proto_tree_add_item(tree, hf_nas_eps_emm_tai_n_elem, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1422 proto_item_append_text(item, " [+1 = %u element(s)]", n_elem);
1426 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 )");
1432 /* MCC digit 2 MCC digit 1 octet 2
1433 * MNC digit 3 MCC digit 3 octet 3
1434 * MNC digit 2 MNC digit 1 octet 4
1436 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1437 /* type of list = "000" */
1439 * TAC 1 (continued) octet 6
1443 * TAC k (continued) octet 2k+4*
1445 if (len < (guint)(4+(n_elem*2))){
1446 proto_tree_add_text(tree, tvb, curr_offset, len-1 , "[Wrong number of elements?]");
1449 for (i=0; i < n_elem; i++, curr_offset+=2)
1450 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1454 /* type of list = "010" */
1455 /* MCC digit 2 MCC digit 1 octet 2
1456 * MNC digit 3 MCC digit 3 octet 3
1457 * MNC digit 2 MNC digit 1 octet 4
1459 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1460 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1464 if (len< (guint)(1+(n_elem*5))){
1465 proto_tree_add_text(tree, tvb, curr_offset, len-1 , "[Wrong number of elements?]");
1469 for (i=0; i < n_elem; i++){
1470 /* type of list = "001" */
1471 /* MCC digit 2 MCC digit 1 octet 2
1472 * MNC digit 3 MCC digit 3 octet 3
1473 * MNC digit 2 MNC digit 1 octet 4
1475 curr_offset = dissect_e212_mcc_mnc(tvb, gpinfo, tree, curr_offset, TRUE);
1476 proto_tree_add_item(tree, hf_nas_eps_emm_tai_tac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1481 /* Unknown ( Not in 3GPP TS 24.301 version 8.1.0 Release 8 ) */
1484 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1486 return(curr_offset-offset);
1489 * 9.9.3.34 UE network capability
1492 static const true_false_string nas_eps_emm_supported_flg_value = {
1496 static const true_false_string nas_eps_emm_ucs2_supp_flg_value = {
1497 "The UE has no preference between the use of the default alphabet and the use of UCS2",
1498 "The UE has a preference for the default alphabet"
1500 /* 1xSRVCC capability (octet 7, bit 2) */
1501 static const true_false_string nas_eps_emm_1xsrvcc_cap_flg = {
1502 "SRVCC from E-UTRAN to cdma2000 1xCS supported",
1503 "SRVCC from E-UTRAN to cdma2000 1x CS not supported"
1507 de_emm_ue_net_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1509 guint32 curr_offset;
1511 curr_offset = offset;
1514 /* EPS encryption algorithms supported (octet 3) */
1515 /* EPS encryption algorithm EEA0 supported (octet 3, bit 8) */
1516 proto_tree_add_item(tree, hf_nas_eps_emm_eea0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1517 /* EPS encryption algorithm 128-EEA1 supported (octet 3, bit 7) */
1518 proto_tree_add_item(tree, hf_nas_eps_emm_128eea1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1519 /* EPS encryption algorithm 128-EEA2 supported (octet 3, bit 6) */
1520 proto_tree_add_item(tree, hf_nas_eps_emm_128eea2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1521 /* EPS encryption algorithm 128-EEA3 supported (octet 3, bit 5) */
1522 proto_tree_add_item(tree, hf_nas_eps_emm_eea3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1523 /* EPS encryption algorithm 128-EEA4 supported (octet 3, bit 4) */
1524 proto_tree_add_item(tree, hf_nas_eps_emm_eea4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1525 /* EPS encryption algorithm 128-EEA5 supported (octet 3, bit 5) */
1526 proto_tree_add_item(tree, hf_nas_eps_emm_eea5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1527 /* EPS encryption algorithm 128-EEA6 supported (octet 3, bit 6) */
1528 proto_tree_add_item(tree, hf_nas_eps_emm_eea6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1529 /* EPS encryption algorithm 128-EEA7 supported (octet 3, bit 7) */
1530 proto_tree_add_item(tree, hf_nas_eps_emm_eea7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1534 /* EPS integrity algorithms supported (octet 4) */
1535 /* EPS integrity algorithm EIA0 supported (octet 4, bit 8) */
1536 proto_tree_add_item(tree, hf_nas_eps_emm_eia0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1537 /* EPS integrity algorithm 128-EIA1 supported (octet 4, bit 7) */
1538 proto_tree_add_item(tree, hf_nas_eps_emm_128eia1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1539 /* EPS integrity algorithm 128-EIA2 supported (octet 4, bit 6) */
1540 proto_tree_add_item(tree, hf_nas_eps_emm_128eia2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1541 /* EPS integrity algorithm EIA3 supported (octet 4, bit 5) */
1542 proto_tree_add_item(tree, hf_nas_eps_emm_eia3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1543 /* EPS integrity algorithm EIA4 supported (octet 4, bit 4) */
1544 proto_tree_add_item(tree, hf_nas_eps_emm_eia4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1545 /* EPS integrity algorithm EIA5 supported (octet 4, bit 3) */
1546 proto_tree_add_item(tree, hf_nas_eps_emm_eia5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1547 /* EPS integrity algorithm EIA6 supported (octet 4, bit 2) */
1548 proto_tree_add_item(tree, hf_nas_eps_emm_eia6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1549 /* EPS integrity algorithm EIA7 supported (octet 4, bit 1) */
1550 proto_tree_add_item(tree, hf_nas_eps_emm_eia7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1554 /* Following octets are optional */
1555 if ((curr_offset - offset) >= len)
1558 /* UMTS encryption algorithms supported (octet 5)
1559 * UMTS encryption algorithm UEA0 supported (octet 5, bit 8)
1561 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 8) */
1562 proto_tree_add_item(tree, hf_nas_eps_emm_uea0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1563 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 7) */
1564 proto_tree_add_item(tree, hf_nas_eps_emm_uea1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1565 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 6) */
1566 proto_tree_add_item(tree, hf_nas_eps_emm_uea2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1567 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 5) */
1568 proto_tree_add_item(tree, hf_nas_eps_emm_uea3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1569 /* EPS encryption algorithm 128-UEA0 supported (octet 5, bit 4) */
1570 proto_tree_add_item(tree, hf_nas_eps_emm_uea4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1571 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 5) */
1572 proto_tree_add_item(tree, hf_nas_eps_emm_uea5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1573 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 6) */
1574 proto_tree_add_item(tree, hf_nas_eps_emm_uea6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1575 /* UMTS encryption algorithm 128-UEA0 supported (octet 5, bit 7) */
1576 proto_tree_add_item(tree, hf_nas_eps_emm_uea7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1579 if ((curr_offset - offset) >= len)
1582 /* UCS2 support (UCS2) (octet 6, bit 8)
1583 * This information field indicates the likely treatment of UCS2 encoded character strings
1586 proto_tree_add_item(tree, hf_nas_eps_emm_ucs2_supp, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1587 /* UMTS integrity algorithms supported (octet 6) */
1588 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 7) */
1589 proto_tree_add_item(tree, hf_nas_eps_emm_uia1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1590 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 6) */
1591 proto_tree_add_item(tree, hf_nas_eps_emm_uia2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1592 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 5) */
1593 proto_tree_add_item(tree, hf_nas_eps_emm_uia3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1594 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 4) */
1595 proto_tree_add_item(tree, hf_nas_eps_emm_uia4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1596 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 3) */
1597 proto_tree_add_item(tree, hf_nas_eps_emm_uia5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1598 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 2) */
1599 proto_tree_add_item(tree, hf_nas_eps_emm_uia6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1600 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 1) */
1601 proto_tree_add_item(tree, hf_nas_eps_emm_uia7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1604 if ((curr_offset - offset) >= len)
1607 /* Bits 8 to 3 and bit 1 of octet 7 are spare and shall be coded as zero. */
1608 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 6, ENC_BIG_ENDIAN);
1609 /* 1xSRVCC capability (octet 7, bit 2) */
1610 proto_tree_add_item(tree, hf_nas_eps_emm_1xsrvcc_cap, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1611 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+7, 1, ENC_BIG_ENDIAN);
1615 /* UE radio capability information update needed flag (URC upd) (octet 1) */
1616 static const true_false_string nas_eps_emm_ue_ra_cap_inf_upd_need_flg = {
1617 "UE radio capability information update needed",
1618 "UE radio capability information update not needed"
1622 * 9.9.3.35 UE radio capability information update needed
1626 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_)
1628 guint32 curr_offset;
1630 curr_offset = offset;
1632 proto_tree_add_item(tree, hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1637 * 9.9.3.36 UE security capability
1641 de_emm_ue_sec_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1643 guint32 curr_offset;
1645 curr_offset = offset;
1647 /* EPS encryption algorithm EEA0 supported (octet 3, bit 8) */
1648 proto_tree_add_item(tree, hf_nas_eps_emm_eea0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1649 /* EPS encryption algorithm 128-EEA1 supported (octet 3, bit 7) */
1650 proto_tree_add_item(tree, hf_nas_eps_emm_128eea1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1651 /* EPS encryption algorithm 128-EEA2 supported (octet 3, bit 6) */
1652 proto_tree_add_item(tree, hf_nas_eps_emm_128eea2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1653 /* EPS encryption algorithm 128-EEA3 supported (octet 3, bit 5) */
1654 proto_tree_add_item(tree, hf_nas_eps_emm_eea3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1655 /* EPS encryption algorithm 128-EEA4 supported (octet 3, bit 4) */
1656 proto_tree_add_item(tree, hf_nas_eps_emm_eea4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1657 /* EPS encryption algorithm 128-EEA5 supported (octet 3, bit 5) */
1658 proto_tree_add_item(tree, hf_nas_eps_emm_eea5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1659 /* EPS encryption algorithm 128-EEA6 supported (octet 3, bit 6) */
1660 proto_tree_add_item(tree, hf_nas_eps_emm_eea6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1661 /* EPS encryption algorithm 128-EEA7 supported (octet 3, bit 7) */
1662 proto_tree_add_item(tree, hf_nas_eps_emm_eea7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1666 /* EPS integrity algorithms supported (octet 4) */
1667 /* EPS integrity algorithm EIA0 supported (octet 4, bit 8) */
1668 proto_tree_add_item(tree, hf_nas_eps_emm_eia0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1669 /* EPS integrity algorithm 128-EIA1 supported (octet 4, bit 7) */
1670 proto_tree_add_item(tree, hf_nas_eps_emm_128eia1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1671 /* EPS integrity algorithm 128-EIA2 supported (octet 4, bit 6) */
1672 proto_tree_add_item(tree, hf_nas_eps_emm_128eia2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1673 /* EPS integrity algorithm EIA3 supported (octet 4, bit 5) */
1674 proto_tree_add_item(tree, hf_nas_eps_emm_eia3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1675 /* EPS integrity algorithm EIA4 supported (octet 4, bit 4) */
1676 proto_tree_add_item(tree, hf_nas_eps_emm_eia4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1677 /* EPS integrity algorithm EIA5 supported (octet 4, bit 3) */
1678 proto_tree_add_item(tree, hf_nas_eps_emm_eia5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1679 /* EPS integrity algorithm EIA6 supported (octet 4, bit 2) */
1680 proto_tree_add_item(tree, hf_nas_eps_emm_eia6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1681 /* EPS integrity algorithm EIA7 supported (octet 4, bit 1) */
1682 proto_tree_add_item(tree, hf_nas_eps_emm_eia7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1686 /* Octets 5, 6, and 7 are optional. If octet 5 is included,
1687 * then also octet 6 shall be included and octet 7 may be included.
1692 /* UMTS encryption algorithms supported (octet 5)
1693 * UMTS encryption algorithm UEA0 supported (octet 5, bit 8)
1695 /* UMTS encryption algorithm UEA0 supported (octet 5, bit 8) */
1696 proto_tree_add_item(tree, hf_nas_eps_emm_uea0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1697 /* UMTS encryption algorithm UEA1 supported (octet 5, bit 7) */
1698 proto_tree_add_item(tree, hf_nas_eps_emm_uea1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1699 /* UMTS encryption algorithm UEA2 supported (octet 5, bit 6) */
1700 proto_tree_add_item(tree, hf_nas_eps_emm_uea2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1701 /* UMTS encryption algorithm UEA3 supported (octet 5, bit 5) */
1702 proto_tree_add_item(tree, hf_nas_eps_emm_uea3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1703 /* EPS encryption algorithm UEA4 supported (octet 5, bit 4) */
1704 proto_tree_add_item(tree, hf_nas_eps_emm_uea4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1705 /* UMTS encryption algorithm UEA5 supported (octet 5, bit 5) */
1706 proto_tree_add_item(tree, hf_nas_eps_emm_uea5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1707 /* UMTS encryption algorithm UEA6 supported (octet 5, bit 6) */
1708 proto_tree_add_item(tree, hf_nas_eps_emm_uea6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1709 /* UMTS encryption algorithm UEA7 supported (octet 5, bit 7) */
1710 proto_tree_add_item(tree, hf_nas_eps_emm_uea7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1713 /* UMTS integrity algorithm UIA0 supported (octet 6, bit ) */
1714 proto_tree_add_item(tree, hf_nas_eps_emm_uia0, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1715 /* UMTS integrity algorithm UIA1 supported (octet 6, bit 7) */
1716 proto_tree_add_item(tree, hf_nas_eps_emm_uia1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1717 /* UMTS integrity algorithm UIA2 supported (octet 6, bit 6) */
1718 proto_tree_add_item(tree, hf_nas_eps_emm_uia2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1719 /* UMTS integrity algorithm UIA3 supported (octet 6, bit 5) */
1720 proto_tree_add_item(tree, hf_nas_eps_emm_uia3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1721 /* UMTS integrity algorithm UIA4 supported (octet 6, bit 4) */
1722 proto_tree_add_item(tree, hf_nas_eps_emm_uia4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1723 /* UMTS integrity algorithm UIA5 supported (octet 6, bit 3) */
1724 proto_tree_add_item(tree, hf_nas_eps_emm_uia5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1725 /* UMTS integrity algorithm UIA6 supported (octet 6, bit 2) */
1726 proto_tree_add_item(tree, hf_nas_eps_emm_uia6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1727 /* UMTS integrity algorithm UIA7 supported (octet 6, bit 1) */
1728 proto_tree_add_item(tree, hf_nas_eps_emm_uia7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1733 /* Bit 8 of octet 7 is spare and shall be coded as zero. */
1734 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3), 1, ENC_BIG_ENDIAN);
1735 /* GPRS encryption algorithm GEA1 supported (octet 7, bit 7) */
1736 proto_tree_add_item(tree, hf_nas_eps_emm_gea1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1737 /* GPRS encryption algorithm GEA2 supported (octet 7, bit 6) */
1738 proto_tree_add_item(tree, hf_nas_eps_emm_gea2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1739 /* GPRS encryption algorithm GEA3 supported (octet 7, bit 5) */
1740 proto_tree_add_item(tree, hf_nas_eps_emm_gea3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1741 /* GPRS encryption algorithm GEA4 supported (octet 7, bit 4) */
1742 proto_tree_add_item(tree, hf_nas_eps_emm_gea4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1743 /* GPRS encryption algorithm GEA5 supported (octet 7, bit 3) */
1744 proto_tree_add_item(tree, hf_nas_eps_emm_gea5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1745 /* GPRS encryption algorithm GEA6 supported (octet 7, bit 2) */
1746 proto_tree_add_item(tree, hf_nas_eps_emm_gea6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1747 /* GPRS encryption algorithm GEA7 supported (octet 7, bit 1) */
1748 proto_tree_add_item(tree, hf_nas_eps_emm_gea7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1754 * 9.9.3.37 Emergency Number List
1755 * See subclause 10.5.3.13 in 3GPP TS 24.008 [13].
1756 * packet-gsm_a_dtap.c
1764 * The coding of the CLI value part is the same as for octets 3 to 14
1765 * of the Calling party BCD number information element defined in
1766 * subclause 10.5.4.9 of 3GPP TS 24.008
1773 de_emm_ss_code(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1775 guint32 curr_offset;
1777 curr_offset = offset;
1781 * The coding of the SS Code value is given in subclause 17.7.5 of 3GPP TS 29.002 [15B].
1782 * value string imported from gsm map
1784 proto_tree_add_item(tree, hf_nas_eps_emm_ss_code, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1790 * 9.9.3.40 LCS indicator
1792 /* LCS indicator value */
1793 static const value_string nas_eps_emm_lcs_ind_vals[] = {
1794 { 0, "Normal, unspecified"},
1801 de_emm_lcs_ind(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1803 guint32 curr_offset;
1805 curr_offset = offset;
1808 proto_tree_add_item(tree, hf_nas_eps_emm_lcs_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1813 * 9.9.3.41 LCS client identity
1816 de_emm_lcs_client_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1818 guint32 curr_offset;
1821 curr_offset = offset;
1823 /* LCS client identity (value part)
1824 * The coding of the value part of the LCS client identity is given
1825 * in subclause 17.7.13 of 3GPP TS 29.002 [15B](GSM MAP).
1827 new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
1828 dissect_gsm_map_lcs_LCS_ClientID_PDU( new_tvb, gpinfo, tree );
1834 * 9.9.3.42 Generic message container type
1838 de_emm_gen_msg_cont_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1840 guint32 curr_offset;
1842 curr_offset = offset;
1844 proto_tree_add_text(tree, tvb, offset, len, "Not dissected yet");
1849 * 9.9.3.43 Generic message container
1852 de_emm_gen_msg_cont(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1854 guint32 curr_offset;
1856 curr_offset = offset;
1858 proto_tree_add_text(tree, tvb, offset, len, "Not dissected yet");
1863 * 9.9.3.44 Voice domain preference and UE's usage setting
1866 de_emm_gen_voice_dmn_pref(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1868 guint32 curr_offset;
1870 curr_offset = offset;
1872 proto_tree_add_text(tree, tvb, offset, len, "Not dissected yet");
1877 * 9.9.4 EPS Session Management (ESM) information elements
1881 * 9.9.4.1 Access point name
1882 * See subclause 10.5.6.1 in 3GPP TS 24.008 [6].
1885 * 9.9.4.2 APN aggregate maximum bit rate
1889 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_)
1891 guint32 curr_offset;
1893 guint32 dl_total = 0;
1894 guint32 ul_total = 0;
1895 guint32 bitrate = 0;
1897 curr_offset = offset;
1898 /* APN-AMBR for downlink octet 3 */
1899 octet = tvb_get_guint8(tvb,curr_offset);
1901 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl, tvb, curr_offset, 1, octet,
1904 bitrate = calc_bitrate(octet);
1905 dl_total += bitrate;
1906 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl, tvb, curr_offset, 1, octet,
1907 "APN-AMBR for downlink : %u kbps", bitrate);
1911 /* APN-AMBR for uplink octet 4 */
1912 octet = tvb_get_guint8(tvb,curr_offset);
1914 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul, tvb, curr_offset, 1, octet,
1917 bitrate = calc_bitrate(octet);
1918 ul_total += bitrate;
1919 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul, tvb, curr_offset, 1, octet,
1920 "APN-AMBR for uplink : %u kbps", bitrate);
1923 if ((curr_offset - offset) >= len)
1925 /* APN-AMBR for downlink (extended) octet 5 */
1926 octet = tvb_get_guint8(tvb,curr_offset);
1928 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext, tvb, curr_offset, 1, octet,
1929 "Use the value indicated by the APN-AMBR for downlink");
1931 bitrate = calc_bitrate_ext(octet);
1932 dl_total += (octet > 0x4a) ? bitrate*1000 : bitrate;
1933 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext, tvb, curr_offset, 1, octet,
1934 "APN-AMBR for downlink (extended) : %u %s",
1936 (octet > 0x4a) ? "Mbps" : "kbps");
1939 /* APN-AMBR for downlink (extended-2) is not present; display total now */
1941 /* Ignore value indicated by the APN-AMBR for downlink */
1942 dl_total = (octet > 0x4a) ? bitrate*1000 : bitrate;
1944 if (dl_total >= 1000) {
1945 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for downlink : %.3f Mbps", (gfloat)dl_total / 1000);
1947 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for downlink : %u kbps", dl_total);
1951 if ((curr_offset - offset) >= len)
1953 /* APN-AMBR for uplink (extended) octet 6 */
1954 octet = tvb_get_guint8(tvb,curr_offset);
1956 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext, tvb, curr_offset, 1, octet,
1957 "Use the value indicated by the APN-AMBR for uplink");
1959 bitrate = calc_bitrate_ext(octet);
1960 ul_total += (octet > 0x4a) ? bitrate*1000 : bitrate;
1961 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext, tvb, curr_offset, 1, octet,
1962 "APN-AMBR for uplink (extended) : %u %s",
1964 (octet > 0x4a) ? "Mbps" : "kbps");
1967 /* APN-AMBR for uplink (extended-2) is not present; display total now */
1969 /* Ignore value indicated by the APN-AMBR for uplink */
1970 ul_total = (octet > 0x4a) ? bitrate*1000 : bitrate;
1972 if (ul_total >= 1000) {
1973 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for uplink : %.3f Mbps", (gfloat)ul_total / 1000);
1975 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for uplink : %u kbps", ul_total);
1979 if ((curr_offset - offset) >= len)
1981 /* APN-AMBR for downlink (extended-2) octet 7 */
1982 octet = tvb_get_guint8(tvb,curr_offset);
1983 if((octet==0)||(octet==0xff)){
1984 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext2, tvb, curr_offset, 1, octet,
1985 "Use the value indicated by the APN-AMBR for downlink and APN-AMBR for downlink (extended)");
1987 dl_total += octet*256*1000;
1988 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext2, tvb, curr_offset, 1, octet,
1989 "APN-AMBR for downlink (extended-2) : %u Mbps",
1992 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for downlink : %.3f Mbps", (gfloat)dl_total / 1000);
1994 if ((curr_offset - offset) >= len)
1996 /* APN-AMBR for uplink (extended-2) octet 8 */
1997 octet = tvb_get_guint8(tvb,curr_offset);
1998 if((octet==0)||(octet==0xff)){
1999 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext2, tvb, curr_offset, 1, octet,
2000 "Use the value indicated by the APN-AMBR for uplink and APN-AMBR for downlink (extended)");
2002 ul_total += octet*256*1000;
2003 proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext2, tvb, curr_offset, 1, octet,
2004 "APN-AMBR for uplink (extended-2) : %u Mbps",
2007 proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for uplink : %.3f Mbps", (gfloat)ul_total / 1000);
2013 * 9.9.4.3 EPS quality of service
2016 /* Quality of Service Class Identifier (QCI), octet 3 (see 3GPP TS 23.203 [7]) */
2017 static const value_string nas_eps_qci_vals[] = {
2018 { 0, "UE -> NW Network selects the QCI / NW -> UE Reserved"},
2034 de_esm_qos(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2036 guint32 curr_offset;
2039 curr_offset = offset;
2042 proto_tree_add_item(tree, hf_nas_eps_qci, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2044 if ((curr_offset - offset) >= len)
2046 /* Maximum bit rate for uplink octet 4 */
2047 octet = tvb_get_guint8(tvb,curr_offset);
2049 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_ul, tvb, curr_offset, 1, octet,
2050 "UE->NW Subscribed maximum bit rate for uplink/ NW->UE Reserved");
2052 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_ul, tvb, curr_offset, 1, octet,
2053 "Maximum bit rate for uplink : %u kbps", calc_bitrate(octet));
2056 if ((curr_offset - offset) >= len)
2058 /* Maximum bit rate for downlink octet 5 */
2059 octet = tvb_get_guint8(tvb,curr_offset);
2061 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_dl, tvb, curr_offset, 1, octet,
2062 "UE->NW Subscribed maximum bit rate for downlink/ NW->UE Reserved");
2064 proto_tree_add_uint_format(tree, hf_nas_eps_mbr_dl, tvb, curr_offset, 1, octet,
2065 "Maximum bit rate for downlink : %u kbps", calc_bitrate(octet));
2068 if ((curr_offset - offset) >= len)
2070 /* Guaranteed bit rate for uplink octet 6 */
2071 octet = tvb_get_guint8(tvb,curr_offset);
2072 proto_tree_add_uint_format(tree, hf_nas_eps_gbr_ul, tvb, curr_offset, 1, octet,
2073 "Guaranteed bit rate for uplink : %u kbps", calc_bitrate(octet));
2076 if ((curr_offset - offset) >= len)
2078 /* Guaranteed bit rate for downlink octet 7 */
2079 octet = tvb_get_guint8(tvb,curr_offset);
2080 proto_tree_add_uint_format(tree, hf_nas_eps_gbr_ul, tvb, curr_offset, 1, octet,
2081 "Guaranteed bit rate for downlink : %u kbps", calc_bitrate(octet));
2084 if ((curr_offset - offset) >= len)
2086 /* Maximum bit rate for uplink (extended) octet 8 */
2087 octet = tvb_get_guint8(tvb,curr_offset);
2089 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2090 "Use the value indicated by the maximum bit rate for uplink in octet 4.");
2092 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2093 "Maximum bit rate for uplink(extended) : %u %s",
2094 calc_bitrate_ext(octet),
2095 (octet > 0x4a) ? "Mbps" : "kbps");
2098 if ((curr_offset - offset) >= len)
2100 /* Maximum bit rate for downlink (extended) octet 9 */
2101 octet = tvb_get_guint8(tvb,curr_offset);
2103 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2104 "Use the value indicated by the maximum bit rate for downlink in octet 5.");
2106 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2107 "Maximum bit rate for downlink(extended) : %u %s",
2108 calc_bitrate_ext(octet),
2109 (octet > 0x4a) ? "Mbps" : "kbps");
2112 if ((curr_offset - offset) >= len)
2114 /* Guaranteed bit rate for uplink (extended) octet 10 */
2115 octet = tvb_get_guint8(tvb,curr_offset);
2117 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2118 "Use the value indicated by the Guaranteed bit rate for uplink in octet 6.");
2120 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2121 "Guaranteed bit rate for uplink(extended) : %u %s",
2122 calc_bitrate_ext(octet),
2123 (octet > 0x4a) ? "Mbps" : "kbps");
2126 if ((curr_offset - offset) >= len)
2128 /* Guaranteed bit rate for downlink (extended) octet 11 */
2129 octet = tvb_get_guint8(tvb,curr_offset);
2131 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2132 "Use the value indicated by the Guaranteed bit rate for downlink in octet 7.");
2134 proto_tree_add_uint_format(tree, hf_nas_eps_embr_ul, tvb, curr_offset, 1, octet,
2135 "Guaranteed bit rate for downlink(extended) : %u %s",
2136 calc_bitrate_ext(octet),
2137 (octet > 0x4a) ? "Mbps" : "kbps");
2147 static const value_string nas_eps_esm_cause_vals[] = {
2148 { 0x08, "Operator Determined Barring"},
2149 { 0x1a, "Insufficient resources"},
2150 { 0x1b, "Unknown or missing APN"},
2151 { 0x1c, "Unknown PDN type"},
2152 { 0x1d, "User authentication failed"},
2153 { 0x1e, "Request rejected by Serving GW or PDN GW"},
2154 { 0x1f, "Request rejected, unspecified"},
2155 { 0x20, "Service option not supported"},
2156 { 0x21, "Requested service option not subscribed"},
2157 { 0x22, "Service option temporarily out of order"},
2158 { 0x23, "PTI already in use"},
2159 { 0x24, "Regular deactivation"},
2160 { 0x25, "EPS QoS not accepted"},
2161 { 0x26, "Network failure"},
2162 { 0x28, "Feature not supported"},
2163 { 0x29, "Semantic error in the TFT operation"},
2164 { 0x2a, "Syntactical error in the TFT operation"},
2165 { 0x2b, "Invalid EPS bearer identity"},
2166 { 0x2c, "Semantic errors in packet filter(s)"},
2167 { 0x2d, "Syntactical errors in packet filter(s)"},
2168 { 0x2e, "EPS bearer context without TFT already activated"},
2169 { 0x2f, "PTI mismatch"},
2170 { 0x31, "Last PDN disconnection not allowed"},
2171 { 0x32, "PDN type IPv4 only allowed"},
2172 { 0x33, "PDN type IPv6 only allowed"},
2173 { 0x34, "Single address bearers only allowed"},
2174 { 0x35, "ESM information not received"},
2175 { 0x36, "PDN connection does not exist"},
2176 { 0x37, "Multiple PDN connections for a given APN not allowed"},
2177 { 0x38, "Collision with network initiated request"},
2178 { 0x3b, "Unsupported QCI value"},
2179 { 0x51, "Invalid PTI value"},
2180 { 0x5f, "Semantically incorrect message"},
2181 { 0x60, "Invalid mandatory information"},
2182 { 0x61, "Message type non-existent or not implemented"},
2183 { 0x62, "Message type not compatible with the protocol state"},
2184 { 0x63, "Information element non-existent or not implemented"},
2185 { 0x64, "Conditional IE error"},
2186 { 0x65, "Message not compatible with the protocol state"},
2187 { 0x6f, "Protocol error, unspecified"},
2188 { 0x70, "APN restriction value incompatible with active EPS bearer context"},
2193 de_esm_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2195 guint32 curr_offset;
2197 curr_offset = offset;
2199 proto_tree_add_item(tree, hf_nas_eps_esm_cause, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2202 return(curr_offset - offset);
2205 * 9.9.4.5 ESM information transfer flag
2207 /* EIT (ESM information transfer) */
2208 static const true_false_string nas_eps_emm_eit_vals = {
2209 "Security protected ESM information transfer required",
2210 "Security protected ESM information transfer not required"
2213 de_esm_inf_trf_flg(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2215 guint32 curr_offset;
2217 curr_offset = offset;
2220 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, (curr_offset<<3)+4, 3, ENC_BIG_ENDIAN);
2221 proto_tree_add_item(tree, hf_nas_eps_esm_eit, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2223 return(curr_offset-offset);
2226 * 9.9.4.6 Linked EPS bearer identity
2229 * Linked EPS bearer identity (bits 1-4)
2232 static const value_string nas_eps_esm_linked_bearer_id_vals[] = {
2238 { 0x5, "EPS bearer identity value 5"},
2239 { 0x6, "EPS bearer identity value 6"},
2240 { 0x7, "EPS bearer identity value 7"},
2241 { 0x8, "EPS bearer identity value 8"},
2242 { 0x9, "EPS bearer identity value 9"},
2243 { 0xa, "EPS bearer identity value 10"},
2244 { 0xb, "EPS bearer identity value 11"},
2245 { 0xc, "EPS bearer identity value 12"},
2246 { 0xd, "EPS bearer identity value 13"},
2247 { 0xe, "EPS bearer identity value 14"},
2248 { 0xf, "EPS bearer identity value 15"},
2255 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_)
2257 guint32 curr_offset;
2259 curr_offset = offset;
2261 proto_tree_add_item(tree, hf_nas_eps_esm_lnkd_eps_bearer_id, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2266 * 9.9.4.7 LLC service access point identifier
2267 * See subclause 10.5.6.9 in 3GPP TS 24.008
2270 * 9.9.4.8 Packet flow identifier
2271 * See subclause 10.5.6.11 in 3GPP TS 24.008
2274 * 9.9.4.9 PDN address
2277 de_esm_pdn_addr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2279 guint32 curr_offset;
2282 curr_offset = offset;
2285 pdn_type = tvb_get_guint8(tvb, offset) & 0x7;
2286 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, curr_offset<<3, 5, ENC_BIG_ENDIAN);
2287 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2293 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv4, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
2297 /* IPv6 3GPP TS 24.301 version 9.4.0 Release 9
2298 * If PDN type value indicates IPv6, the PDN address information in octet 4 to octet 11
2299 * contains an IPv6 interface identifier. Bit 8 of octet 4 represents the most significant bit
2300 * of the IPv6 interface identifier and bit 1 of octet 11 the least significant bit.
2302 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv6_if_id, tvb, curr_offset, 8, ENC_BIG_ENDIAN);
2306 /* IPv4/IPv6 3GPP TS 24.301 version 9.4.0 Release 9
2307 * If PDN type value indicates IPv4v6, the PDN address information in octet 4 to octet 15
2308 * contains an IPv6 interface identifier and an IPv4 address. Bit 8 of octet 4 represents
2309 * the most significant bit of the IPv6 interface identifier and bit 1 of octet 11 the least
2310 * significant bit. Bit 8 of octet 12 represents the most significant bit of the IPv4 address
2311 * and bit 1 of octet 15 the least significant bit.
2313 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv6_if_id, tvb, curr_offset, 8, ENC_BIG_ENDIAN);
2315 proto_tree_add_item(tree, hf_nas_eps_esm_pdn_ipv4, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
2322 return(curr_offset-offset);
2327 * Coded inline 1/2 octet
2329 static const value_string nas_eps_esm_pdn_type_values[] = {
2337 * 9.9.4.11 Protocol configuration options
2338 * See subclause 10.5.6.3 in 3GPP TS 24.008
2341 * 9.9.4.12 Quality of service
2342 * See subclause 10.5.6.5 in 3GPP TS 24.008
2345 * 9.9.4.13 Radio priority
2346 * See subclause 10.5.7.2 in 3GPP TS 24.008
2349 * 9.9.4.14 Request type
2350 * See subclause 10.5.6.17 in 3GPP TS 24.008
2353 * 9.9.4.15 Traffic flow aggregate description
2354 * The Traffic flow aggregate description information element is encoded using the same format as the Traffic flow
2355 * template information element (see subclause 10.5.6.12 in 3GPP TS 24.008 [13]). When sending this IE, the UE shall
2356 * assign the packet filter identifier values so that they are unique across all packet filters for the PDN connection.
2359 * 9.9.4.16 Traffic flow template
2360 * See subclause 10.5.6.12 in 3GPP TS 24.008
2364 * 9.9.4.17 Transaction identifier
2365 * The Transaction identifier information element is coded as the Linked TI information element in 3GPP TS 24.008 [13],
2366 * subclause 10.5.6.7.
2367 * The coding of the TI flag, the TI value and the EXT bit is defined in 3GPP TS 24.007[20].
2370 guint16 (*emm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
2371 /* 9.9.3 EPS Mobility Management (EMM) information elements */
2372 de_emm_add_upd_res, /* 9.9.3.0A Additional update result */
2373 de_emm_add_upd_type, /* 9.9.3.0B Additional update type */
2374 NULL, /* 9.9.3.1 Authentication failure parameter(dissected in packet-gsm_a_dtap.c) */
2375 NULL, /* 9.9.3.2 Authentication parameter AUTN(packet-gsm_a_dtap.c) */
2376 NULL, /* 9.9.3.3 Authentication parameter RAND */
2377 de_emm_auth_resp_par, /* 9.9.3.4 Authentication response parameter */
2378 de_emm_csfb_resp, /* 9.9.3.5 CSFB response */
2379 NULL, /* 9.9.3.6 Daylight saving time (packet-gsm_a_dtap.c)*/
2380 NULL, /* 9.9.3.7 Detach type */
2381 NULL, /* 9.9.3.8 DRX parameter */
2382 de_emm_cause, /* 9.9.3.9 EMM cause */
2383 NULL, /* 9.9.3.10 EPS attach result (coded inline) */
2384 NULL, /* 9.9.3.11 EPS attach type(Coded Inline) */
2385 de_emm_eps_mid, /* 9.9.3.12 EPS mobile identity */
2386 de_emm_eps_net_feature_sup, /* 9.9.3.12A EPS network feature support */
2387 NULL, /* 9.9.3.13 EPS update result (Coded Inline)*/
2388 NULL, /* 9.9.3.14 EPS update type (Inline)*/
2389 de_emm_esm_msg_cont, /* 9.9.3.15 ESM message conta */
2390 NULL, /* 9.9.3.16 GPRS timer ,See subclause 10.5.7.3 in 3GPP TS 24.008 [6]. (packet-gsm_a_gm.c)*/
2391 NULL, /* 9.9.3.17 Identity type 2 ,See subclause 10.5.5.9 in 3GPP TS 24.008 [6]. */
2392 de_emm_nas_imeisv_req, /* 9.9.3.18 IMEISV request ,See subclause 10.5.5.10 in 3GPP TS 24.008 [6]. */
2393 de_emm_nas_ksi_and_seq_no, /* 9.9.3.19 KSI and sequence number */
2394 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) */
2395 de_emm_nas_key_set_id, /* 9.9.3.21 NAS key set identifier (Coded Inline) */
2396 de_emm_nas_msg_cont, /* 9.9.3.22 NAS message container */
2397 de_emm_nas_sec_alsgs, /* 9.9.3.23 NAS security algorithms */
2398 NULL, /* 9.9.3.24 Network name, See subclause 10.5.3.5a in 3GPP TS 24.008 [6]. (packet-gsm_a_dtap.c)*/
2399 de_emm_nonce, /* 9.9.3.25 Nonce */
2400 de_emm_paging_id, /* 9.9.3.25A Paging identity */
2401 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)*/
2402 NULL, /* 9.9.3.27 Service type */
2403 de_emm_nas_short_mac, /* 9.9.3.28 Short MAC */
2404 NULL, /* 9.9.3.29 Time zone, See subclause 10.5.3.8 in 3GPP TS 24.008 [6]. (packet-gsm_a_dtap.c)*/
2405 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)*/
2406 NULL, /* 9.9.3.31 TMSI status, See subclause 10.5.5.4 in 3GPP TS 24.008 [6]. (packet-gsm_a_gm.c)*/
2407 de_emm_trac_area_id, /* 9.9.3.32 Tracking area identity */
2408 de_emm_trac_area_id_lst, /* 9.9.3.33 Tracking area identity list */
2409 de_emm_ue_net_cap, /* 9.9.3.34 UE network capability */
2410 de_emm_ue_ra_cap_inf_upd_need, /* 9.9.3.35 UE radio capability information update needed */
2411 de_emm_ue_sec_cap, /* 9.9.3.36 UE security capability */
2412 NULL, /* 9.9.3.37 Emergency Number List (packet-gsm_A_dtap.c) */
2413 NULL, /* 9.9.3.38 CLI */
2414 de_emm_ss_code, /* 9.9.3.39 SS Code */
2415 de_emm_lcs_ind, /* 9.9.3.40 LCS indicator */
2416 de_emm_lcs_client_id, /* 9.9.3.41 LCS client identity */
2417 de_emm_gen_msg_cont_type, /* 9.9.3.42 Generic message container type */
2418 de_emm_gen_msg_cont, /* 9.9.3.43 Generic message container */
2419 de_emm_gen_voice_dmn_pref, /* 9.9.3.44 Voice domain preference and UE's usage setting */
2423 /* 9.9.4 EPS Session Management (ESM) information elements */
2424 const value_string nas_esm_elem_strings[] = {
2425 { 0x00, "Access point name" }, /* 9.9.4.1 Access point name */
2426 { 0x00, "APN aggregate maximum bit rate" }, /* 9.9.4.2 APN aggregate maximum bit rate */
2427 { 0x00, "EPS quality of service" }, /* 9.9.4.3 EPS quality of service */
2428 { 0x00, "ESM cause" }, /* 9.9.4.4 ESM cause */
2429 { 0x00, "ESM information transfer flag" }, /* 9.9.4.5 ESM information transfer flag */
2430 { 0x00, "Linked EPS bearer identity" }, /* 9.9.4.6 Linked EPS bearer identity */
2431 { 0x00, "LLC service access point identifier" }, /* 9.9.4.7 LLC service access point identifier */
2432 { 0x00, "Packet flow identifier" }, /* 9.9.4.8 Packet flow identifier */
2433 { 0x00, "PDN address" }, /* 9.9.4.9 PDN address */
2434 { 0x00, "PDN type" }, /* 9.9.4.10 PDN type */
2435 { 0x00, "Protocol configuration options" }, /* 9.9.4.11 Protocol configuration options */
2436 { 0x00, "Quality of service" }, /* 9.9.4.12 Quality of service */
2437 { 0x00, "Radio priority" }, /* 9.9.4.13 Radio priority */
2438 { 0x00, "Request type" }, /* 9.9.4.14 Request type */
2439 { 0x00, "Traffic flow aggregate description" }, /* 9.9.4.15 Traffic flow aggregate description */
2440 { 0x00, "Traffic flow templat" }, /* 9.9.4.16 Traffic flow template */
2441 { 0x00, "Transaction identifier" }, /* 9.9.4.17 Transaction identifier */
2446 #define NUM_NAS_ESM_ELEM (sizeof(nas_esm_elem_strings)/sizeof(value_string))
2447 gint ett_nas_eps_esm_elem[NUM_NAS_ESM_ELEM];
2451 DE_ESM_APN, /* 9.9.4.1 Access point name */
2452 DE_ESM_APN_AGR_MAX_BR, /* 9.9.4.2 APN aggregate maximum bit rate */
2453 DE_ESM_EPS_QOS, /* 9.9.4.3 EPS quality of service */
2454 DE_ESM_CAUSE, /* 9.9.4.4 ESM cause */
2455 DE_ESM_INF_TRF_FLG, /* 9.9.4.5 ESM information transfer flag */
2456 DE_ESM_LNKED_EPS_B_ID, /* 9.9.4.6 Linked EPS bearer identity */
2457 DE_ESM_LLC_SAPI, /* 9.9.4.7 LLC service access point identifier */
2458 DE_ESM_P_FLW_ID, /* 9.9.4.8 Packet flow identifier */
2459 DE_ESM_PDN_ADDR, /* 9.9.4.9 PDN address */
2460 DE_ESM_PDN_TYPE, /* 9.9.4.10 PDN type */
2461 DE_ESM_PROT_CONF_OPT, /* 9.9.4.11 Protocol configuration options */
2462 DE_ESM_QOS, /* 9.9.4.12 Quality of service */
2463 DE_ESM_RA_PRI, /* 9.9.4.13 Radio priority */
2464 DE_ESM_REQ_TYPE, /* 9.9.4.14 Request type */
2465 DE_ESM_TRAF_FLOW_AGR_DESC, /* 9.9.4.15 Traffic flow aggregate description */
2466 DE_ESM_TRAF_FLOW_TEMPL, /* 9.9.4.16 Traffic flow template */
2467 DE_ESM_TID, /* 9.9.4.17 Transaction identifier */
2468 DE_ESM_NONE /* NONE */
2473 guint16 (*esm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
2474 NULL, /* 9.9.4.1 Access point name */
2475 de_esm_apn_aggr_max_br, /* 9.9.4.2 APN aggregate maximum bit rate */
2476 de_esm_qos, /* 9.9.4.3 EPS quality of service */
2477 de_esm_cause, /* 9.9.4.4 ESM cause */
2478 de_esm_inf_trf_flg, /* 9.9.4.5 ESM information transfer flag */
2479 de_esm_lnkd_eps_bearer_id, /* 9.9.4.6 Linked EPS bearer identity */
2480 NULL, /* 9.9.4.7 LLC service access point identifier */
2481 NULL, /* 9.9.4.8 Packet flow identifier */
2482 de_esm_pdn_addr, /* 9.9.4.9 PDN address */
2483 NULL, /* 9.9.4.10 PDN type */
2484 NULL, /* 9.9.4.11 Protocol configuration options */
2485 NULL, /* 9.9.4.12 Quality of service */
2486 NULL, /* 9.9.4.13 Radio priority */
2487 NULL, /* 9.9.4.14 Request type */
2488 NULL, /* 9.9.4.15 Traffic flow aggregate description */
2489 NULL, /* 9.9.4.16 Traffic flow template */
2490 NULL, /* 9.9.4.17 Transaction identifier */
2494 /* MESSAGE FUNCTIONS */
2497 * 8.2.1 Attach accept
2501 nas_emm_attach_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2503 guint32 curr_offset, bit_offset;
2507 curr_offset = offset;
2510 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2511 bit_offset = curr_offset<<3;
2512 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2514 /* EPS attach result EPS attach result 9.9.3.10 M V 1/2 */
2515 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2517 proto_tree_add_bits_item(tree, hf_nas_eps_emm_EPS_attach_result, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2519 /* Fix up the lengths */
2522 /* T3412 value GPRS timer 9.9.3.16 M V 1 */
2523 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3412 value");
2524 /* Tracking area identity list 9.9.3.33 M LV 7-97 */
2525 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, " - TAI list");
2526 /* ESM message container 9.9.3.15 M LV-E 2-n */
2527 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL);
2528 /* 50 GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
2529 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
2530 /* 13 Location area identification Location area identification 9.9.2.2 O TV 6 */
2531 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, NULL);
2532 /* 23 MS identity Mobile identity 9.9.2.3 O TLV 7-10 */
2533 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - MS identity");
2534 /* 53 EMM cause EMM cause 9.9.3.9 O TV 2 */
2535 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
2536 /* 17 T3402 value GPRS timer 9.9.3.16 O TV 2 */
2537 ELEM_OPT_TV(0x17, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3402 value");
2538 /* 59 T3423 value GPRS timer 9.9.3.16 O TV 2 */
2539 ELEM_OPT_TV(0x59, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3423 value");
2540 /* 4A Equivalent PLMNs PLMN list 9.9.2.8 O TLV 5-47 */
2541 ELEM_OPT_TLV(0x4a, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_PLM_LST, " - Equivalent PLMNs");
2542 /* 34 Emergency Number List 9.9.3.37 O TLV 5-50 */
2543 ELEM_OPT_TLV(0x34, GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST, NULL);
2544 /* 64 EPS network feature support EPS network feature support 9.9.3.12A O TLV 3 */
2545 ELEM_OPT_TLV(0x64, NAS_PDU_TYPE_EMM, DE_EMM_EPS_NET_FEATURE_SUP, NULL);
2546 /* F- Additional update result Additional update result 9.9.3.0A O TV 1 */
2547 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_RES, NULL );
2549 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2552 * 8.2.2 Attach complete
2555 nas_emm_attach_comp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2557 guint32 curr_offset;
2561 curr_offset = offset;
2564 /* ESM message container ESM message container 9.9.3.15 M LV-E 2-n */
2565 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL);
2567 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2572 * 8.2.3 Attach reject
2575 nas_emm_attach_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2577 guint32 curr_offset;
2581 curr_offset = offset;
2584 /* * EMM cause EMM cause 9.9.3.9 M V 1 */
2585 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
2586 /* 78 ESM message container ESM message container 9.9.3.15 O TLV-E 4-n */
2587 ELEM_OPT_TLV_E(0x78, NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL);
2589 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2593 * 8.2.4 Attach request
2596 nas_emm_attach_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2598 guint32 curr_offset, bit_offset;
2602 curr_offset = offset;
2605 bit_offset = curr_offset<<3;
2607 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
2608 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
2611 /* EPS attach type EPS attach type 9.9.3.11 M V 1/2
2614 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2616 proto_tree_add_bits_item(tree, hf_nas_eps_emm_eps_att_type, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2619 /* Fix the lengths */
2622 /* Old GUTI or IMSI EPS mobile identity 9.9.3.12 M LV 5-12 */
2623 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Old GUTI or IMSI");
2624 /* UE network capability UE network capability 9.9.3.34 M LV 3-14 */
2625 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_UE_NET_CAP, NULL);
2626 /* ESM message container ESM message container 9.9.3.15 M LV-E 2-n */
2627 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_ESM_MSG_CONT, NULL);
2628 /* 19 Old P-TMSI signature P-TMSI signature 10.5.5.8 O TV 4 */
2629 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, " - Old P-TMSI Signature");
2630 /* 50 Additional GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
2631 ELEM_OPT_TLV( 0x50 , NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Additional GUTI");
2632 /* 52 Last visited registered TAI Tracking area identity 9.9.3.32 O TV 6 */
2633 ELEM_OPT_TV(0x52, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, " - Last visited registered TAI");
2634 /* 5c DRX parameter DRX parameter 9.9.3.8 O TV 3 */
2635 ELEM_OPT_TV(0x5c, GSM_A_PDU_TYPE_GM, DE_DRX_PARAM, NULL );
2636 /* 31 MS network capability MS network capability 9.9.3.20 M LV 3-9 */
2637 ELEM_OPT_TLV( 0x31, GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP , NULL );
2638 /* 13 Old location area identification Location area identification 9.9.2.2 O TV 6 */
2639 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, " - Old location area identification");
2640 /* 9- TMSI status TMSI status 9.9.3.31 O TV 1 */
2641 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , NULL );
2642 /* 11 Mobile station classmark 2 Mobile station classmark 2 9.9.2.5 O TLV 5 */
2643 ELEM_OPT_TLV( 0x11, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_2 , NULL );
2644 /* 20 Mobile station classmark 3 Mobile station classmark 3 9.9.2.5 O TLV 2-34 */
2645 ELEM_OPT_TLV( 0x20, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_3 , NULL );
2646 /* 40 Supported Codecs Supported Codec List 9.9.2.10 O TLV 5-n */
2647 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, " - Supported Codecs");
2648 /* F- Additional update type Additional update type 9.9.3.0B O TV 1 */
2649 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_TYPE, NULL );
2650 /* 5D Voice domain preference and UE's usage setting Voice domain preference and UE's usage setting 9.9.3.44 O TLV 3 */
2651 /* ELEM_OPT_TLV(0x5D, xxxxxx, xxxxxx, NULL); */
2654 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2657 * 8.2.5 Authentication failure
2660 nas_emm_attach_fail(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2662 guint32 curr_offset;
2666 curr_offset = offset;
2669 /* EMM cause EMM cause 9.9.3.9 M V 1 */
2670 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
2671 /* 30 Authentication failure parameter Authentication failure parameter 9.9.3.1 O TLV 1 */
2672 ELEM_OPT_TLV(0x30, GSM_A_PDU_TYPE_DTAP, DE_AUTH_FAIL_PARAM, NULL);
2674 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2677 * 8.2.6 Authentication reject
2681 * 8.2.7 Authentication request
2685 nas_emm_auth_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2687 guint32 curr_offset, bit_offset;
2691 curr_offset = offset;
2694 bit_offset = curr_offset<<3;
2696 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2697 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2701 * NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2
2703 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, " ASME");
2706 /* Fix the lengths */
2711 * Authentication parameter RAND (EPS challenge) 9.9.3.3 M V 16
2713 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_RAND, " - EPS challenge");
2715 * Authentication parameter AUTN (EPS challenge) 9.9.3.2 M LV 17
2717 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_AUTN, " - EPS challenge");
2719 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2723 * 8.2.8 Authentication response
2726 nas_emm_auth_resp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2728 guint32 curr_offset;
2732 curr_offset = offset;
2736 * Authentication response parameter 9.9.3.4 M LV 5-17
2738 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_AUTH_RESP_PAR, NULL);
2740 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2744 * 8.2.9 CS service notification
2748 nas_emm_cs_serv_not(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2750 guint32 curr_offset;
2754 curr_offset = offset;
2759 /* Paging identity Paging identity 9.9.3.25A M V 1 */
2760 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_PAGING_ID, NULL);
2761 /* 60 CLI CLI 9.9.3.38 O TLV 3-12 */
2762 ELEM_OPT_TLV(0x60, GSM_A_PDU_TYPE_DTAP, DE_CLD_PARTY_BCD_NUM, " - CLI");
2763 /* 61 SS Code SS Code 9.9.3.39 O TV 2 */
2764 ELEM_OPT_TV(0x61, NAS_PDU_TYPE_EMM, DE_EMM_SS_CODE, NULL);
2765 /* 62 LCS indicator LCS indicator 9.9.3.40 O TV 2 */
2766 ELEM_OPT_TV(0x62, NAS_PDU_TYPE_EMM, DE_EMM_LCS_IND, NULL);
2767 /* 63 LCS client identity LCS client identity 9.9.3.41 O TLV 3-257 */
2768 ELEM_OPT_TLV(0x63, NAS_PDU_TYPE_EMM, DE_EMM_LCS_CLIENT_ID, NULL);
2770 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2773 * 8.2.10 Detach accept
2774 * 8.2.10.1 Detach accept (UE originating detach)
2776 * 8.2.10.2 Detach accept (UE terminated detach)
2780 * 8.2.11 Detach request
2781 * 8.2.11.1 Detach request (UE originating detach)
2785 nas_emm_detach_req_UL(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2787 guint32 curr_offset,bit_offset;
2791 curr_offset = offset;
2794 proto_tree_add_text(tree, tvb, curr_offset, len,"Up link");
2795 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
2796 bit_offset = curr_offset<<3;
2797 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
2799 /* Detach type Detach type 9.9.3.6 M V 1/2 */
2800 proto_tree_add_bits_item(tree, hf_nas_eps_emm_switch_off, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2802 proto_tree_add_bits_item(tree, hf_nas_eps_emm_detach_type_UL, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2805 /* Fix the lengths */
2809 /* GUTI or IMSI EPS mobile identity 9.9.3.12 M LV 5-12 */
2810 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI or IMSI");
2815 * 8.2.11.2 Detach request (UE terminated detach)
2818 nas_emm_detach_req_DL(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2820 guint32 curr_offset, bit_offset;
2824 curr_offset = offset;
2827 proto_tree_add_text(tree, tvb, curr_offset, len,"Down link");
2828 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
2829 bit_offset = curr_offset<<3;
2830 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2832 /* Detach type Detach type 9.9.3.6 M V 1/2 */
2833 /* In the network to UE direction bit 4 is spare. The network shall set this bit to zero. */
2834 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2836 proto_tree_add_bits_item(tree, hf_nas_eps_emm_detach_type_DL, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2839 /* Fix the lengths */
2843 /* No more mandatory elements */
2847 /* EMM cause EMM cause 9.9.3.9 O TV 2 */
2848 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
2850 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2855 nas_emm_detach_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len)
2857 guint32 curr_offset;
2860 curr_offset = offset;
2864 if(pinfo->link_dir==P2P_DIR_UL){
2865 nas_emm_detach_req_UL(tvb, tree, pinfo, offset, len);
2867 }else if(pinfo->link_dir==P2P_DIR_DL){
2868 nas_emm_detach_req_DL(tvb, tree, pinfo, offset, len);
2872 proto_tree_add_text(tree, tvb, curr_offset, len,"UL/DL not known, can't properly dissect");
2873 proto_tree_add_text(tree, tvb, curr_offset, len,"Trying to dissect as UE terminated detach");
2874 nas_emm_detach_req_DL(tvb, tree, pinfo, offset, len);
2875 proto_tree_add_text(tree, tvb, curr_offset, len,"Trying to dissect as UE originating detach");
2876 nas_emm_detach_req_UL(tvb, tree, pinfo, offset, len);
2883 * 8.2.12 Downlink NAS Transport
2886 nas_emm_dl_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2888 guint32 curr_offset;
2892 curr_offset = offset;
2895 /* NAS message container NAS message container 9.9.3.22 M LV 3-252 */
2896 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_NAS_MSG_CONT, NULL);
2898 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2901 * 8.2.13 EMM information
2904 nas_emm_emm_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2906 guint32 curr_offset;
2910 curr_offset = offset;
2913 /* 43 Full name for network Network name 9.9.3.24 O TLV 3-? */
2914 ELEM_OPT_TLV(0x43, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Full name for network");
2915 /* 45 Short name for network Network name 9.9.3.24 O TLV 3-? */
2916 ELEM_OPT_TLV(0x45, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Short Name");
2917 /* 46 Local time zone Time zone 9.9.3.29 O TV 2 */
2918 ELEM_OPT_TV(0x46, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE, " - Local");
2919 /* 47 Universal time and local time zone Time zone and time 9.9.3.30 O TV 8 */
2920 ELEM_OPT_TV(0x47, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE_TIME, " - Universal Time and Local Time Zone");
2921 /* 49 Network daylight saving time Daylight saving time 9.9.3.6 O TLV 3 */
2922 ELEM_OPT_TLV(0x49, GSM_A_PDU_TYPE_DTAP, DE_DAY_SAVING_TIME, NULL);
2924 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2932 nas_emm_emm_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2934 guint32 curr_offset;
2938 curr_offset = offset;
2941 /* EMM cause EMM cause 9.9.3.9 M V 1 */
2942 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
2944 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2948 * 8.2.15 Extended service request
2951 nas_emm_ext_serv_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2953 guint32 curr_offset,bit_offset;
2957 curr_offset = offset;
2960 bit_offset = curr_offset<<3;
2962 /* NAS key set identifier NAS key set identifier 9.9.3.21 M V 1/2 */
2963 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, NULL);
2965 /* Service type Service type 9.9.3.27 M V 1/2 Service type*/
2966 proto_tree_add_bits_item(tree, hf_nas_eps_service_type, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2968 /* Fix up the lengths */
2972 /* M-TMSI Mobile identity 9.9.2.3 M LV 6 */
2973 ELEM_MAND_LV(NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - M-TMSI");
2974 /* B- CSFB response CSFB response 9.9.3.5 C TV 1 */
2975 ELEM_OPT_TV_SHORT(0xb0, NAS_PDU_TYPE_EMM, DE_EMM_CSFB_RESP, NULL);
2976 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
2977 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, NULL);
2979 EXTRANEOUS_DATA_CHECK(curr_len, 0);
2982 * 8.2.16 GUTI reallocation command
2985 nas_emm_guti_realloc_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
2987 guint32 curr_offset;
2991 curr_offset = offset;
2994 /* GUTI EPS mobile identity 9.9.3.12 M LV 12 */
2995 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
2997 /* 54 TAI list Tracking area identity list 9.9.3.33 O TLV 8-98 */
2998 ELEM_OPT_TLV(0x54, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, NULL);
3000 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3004 * 8.2.17 GUTI reallocation complete
3008 * 8.2.18 Identity request
3012 nas_emm_id_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3014 guint32 curr_offset, bit_offset;
3018 curr_offset = offset;
3022 bit_offset=curr_offset<<3;
3024 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
3025 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3028 /* Identity type Identity type 2 9.9.3.17 M V 1/2 */
3029 proto_tree_add_bits_item(tree, hf_nas_eps_emm_id_type2, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3034 /* Fix up the lengths */
3038 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3041 * 8.2.19 Identity response
3044 nas_emm_id_res(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3046 guint32 curr_offset;
3050 curr_offset = offset;
3053 /* Mobile identity Mobile identity 9.9.2.3 M LV 4-10 */
3054 ELEM_MAND_LV(NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, NULL);
3056 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3062 * 8.2.20 Security mode command
3065 nas_emm_sec_mode_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3067 guint32 curr_offset, bit_offset;
3071 curr_offset = offset;
3074 /* Selected NAS security algorithms NAS security algorithms 9.9.3.23 M V 1 */
3075 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_NAS_SEC_ALGS, " - Selected NAS security algorithms");
3077 bit_offset = curr_offset<<3;
3078 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
3079 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3081 /* NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2 */
3082 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, " ASME");
3085 /* Fix up the lengths */
3089 /* Replayed UE security capabilities UE security capability 9.9.3.36 M LV 3-6 */
3090 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_UE_SEC_CAP, " - Replayed UE security capabilities");
3091 /* C- IMEISV request IMEISV request 9.9.3.18 O TV 1 */
3092 ELEM_OPT_TV_SHORT( 0xC0 , NAS_PDU_TYPE_EMM, DE_EMM_IMEISV_REQ , NULL );
3093 /* 55 Replayed NonceUE Nonce 9.9.3.25 O TV 5 */
3094 ELEM_OPT_TV(0x55, GSM_A_PDU_TYPE_GM, DE_EMM_NONCE, " - Replayed NonceUE");
3095 /* 56 NonceMME Nonce 9.9.3.25 O TV 5 */
3096 ELEM_OPT_TV(0x56, GSM_A_PDU_TYPE_GM, DE_EMM_NONCE, " - NonceMME");
3098 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3101 * 8.2.21 Security mode complete
3104 nas_emm_sec_mode_comp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3106 guint32 curr_offset;
3110 curr_offset = offset;
3116 /* 23 IMEISV Mobile identity 9.9.2.3 O TLV 11 */
3117 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - IMEISV");
3119 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3122 * 8.2.22 Security mode reject
3125 nas_emm_sec_mode_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3127 guint32 curr_offset;
3131 curr_offset = offset;
3134 /* EMM cause EMM cause 9.9.3.9 M V 1 */
3135 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
3137 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3140 * 8.2.23 Security protected NAS message
3144 nas_emm_sec_prot_msg(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3146 guint32 curr_offset;
3148 guint8 security_header_type;
3150 curr_offset = offset;
3153 /* Security header type Security header type 9.3.1 M V 1/2 */
3154 security_header_type = tvb_get_guint8(tvb,offset)>>4;
3155 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, 0, 1, ENC_BIG_ENDIAN);
3156 /* Protocol discriminator Protocol discriminator 9.2 M V 1/2 */
3157 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, ENC_BIG_ENDIAN);
3159 /* Message authentication code Message authentication code 9.5 M V 4 */
3160 if (security_header_type !=0){
3161 /* Message authentication code */
3162 proto_tree_add_item(tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, ENC_BIG_ENDIAN);
3164 if ((security_header_type==2)||(security_header_type==4)){
3165 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
3166 proto_tree_add_text(tree, tvb, offset, len-5,"Ciphered message");
3170 proto_tree_add_text(tree, tvb, offset, len,"Not a security protected message");
3173 /* Sequence number Sequence number 9.6 M V 1 */
3174 proto_tree_add_item(tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
3176 /* NAS message NAS message 9.7 M V 1-n */
3181 * 8.2.24 Service reject
3184 nas_emm_serv_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3186 guint32 curr_offset;
3190 curr_offset = offset;
3193 /* EMM cause EMM cause 9.9.3.9 M V 1 */
3194 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
3196 /* 5B T3442 value GPRS timer 9.9.3.16 C TV 2 */
3197 ELEM_OPT_TV(0x5b, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3442 value");
3199 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3202 * 8.2.25 Service request
3203 * This message is sent by the UE to the network to request the establishment
3204 * of a NAS signalling connection and of the radio and S1 bearers.
3205 * Its structure does not follow the structure of a standard layer 3 message. See table 8.2.25.1.
3208 * Protocol discriminator Protocol discriminator 9.2 M V 1/2
3209 * Security header type Security header type 9.3.1 M V 1/2
3210 * KSI and sequence number KSI and sequence number 9.9.3.19 M V 1
3211 * Message authentication code (short) Short MAC 9.9.3.28 M V 2
3214 nas_emm_service_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3216 guint32 curr_offset;
3220 curr_offset = offset;
3223 /* KSI and sequence number 9.9.3.19 M V 1 */
3224 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_KSI_AND_SEQ_NO, NULL);
3226 /* Short MAC 9.9.3.28 M V 2 */
3227 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_SHORT_MAC, " - Message authentication code (short)");
3229 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3233 * 8.2.26 Tracking area update accept
3236 nas_emm_trac_area_upd_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3238 guint32 curr_offset, bit_offset;
3242 curr_offset = offset;
3245 /* Spare half octet Spare half octet 9.9.2.7 M V 1/2 */
3246 bit_offset = curr_offset<<3;
3247 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3249 /* EPS update result EPS update result 9.9.3.13 M V 1/2 */
3250 proto_tree_add_bits_item(tree, hf_nas_eps_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3252 proto_tree_add_bits_item(tree, hf_nas_eps_eps_update_result_value, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
3254 /* Fix up the lengths */
3257 /* No more mandatory elements */
3260 /* 5A T3412 value GPRS timer 9.9.3.16 O TV 2 */
3261 ELEM_OPT_TV(0x5a, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3412 value");
3262 /* 50 GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
3263 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - GUTI");
3264 /* 54 TAI list Tracking area identity list 9.9.3.33 O TLV 8-98 */
3265 ELEM_OPT_TLV(0x54, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID_LST, NULL);
3266 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
3267 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, NULL);
3268 /* 13 Location area identification Location area identification 9.9.2.2 O TV 6 */
3269 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, NULL);
3270 /* 23 MS identity Mobile identity 9.9.2.3 O TLV 7-10 */
3271 ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_MOB_ID, " - MS identity");
3272 /* 53 EMM cause EMM cause 9.9.3.9 O TV 2 */
3273 ELEM_OPT_TV(0x53, NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
3274 /* 17 T3402 value GPRS timer 9.9.3.16 O TV 2 */
3275 ELEM_OPT_TV(0x17, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3402 value");
3276 /* 59 T3423 value GPRS timer 9.9.3.16 O TV 2 */
3277 ELEM_OPT_TV(0x59, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER, " - T3423 value");
3278 /* 4A Equivalent PLMNs PLMN list 9.9.2.8 O TLV 5-47 */
3279 ELEM_OPT_TLV(0x4a, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_PLM_LST, " - PLMN list");
3280 /* 34 Emergency Number List Emergency Number List 9.9.3.37 O TLV 5-50 */
3281 ELEM_OPT_TLV(0x34, GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST, NULL);
3282 /* 64 EPS network feature support EPS network feature support 9.9.3.12A O TLV 3 */
3283 ELEM_OPT_TLV(0x64, NAS_PDU_TYPE_EMM, DE_EMM_EPS_NET_FEATURE_SUP, NULL);
3284 /* F- Additional update result Additional update result 9.9.3.0A O TV 1 */
3285 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_RES, NULL );
3287 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3290 * 8.2.27 Tracking area update complete
3294 * 8.2.28 Tracking area update reject
3297 nas_emm_trac_area_upd_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3299 guint32 curr_offset;
3303 curr_offset = offset;
3306 /* EMM cause EMM cause 9.9.3.9 M V 1 */
3307 ELEM_MAND_V(NAS_PDU_TYPE_EMM, DE_EMM_CAUSE, NULL);
3309 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3312 * 8.2.29 Tracking area update request
3315 nas_emm_trac_area_upd_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3318 guint32 curr_offset, bit_offset;
3322 curr_offset = offset;
3325 bit_offset = curr_offset<<3;
3327 /* NAS key set identifierASME NAS key set identifier 9.9.3.21 M V 1/2 */
3328 de_emm_nas_key_set_id_bits(tvb, tree, bit_offset, " ASME");
3331 /* EPS update type EPS update type 9.9.3.14 M V 1/2 */
3332 proto_tree_add_bits_item(tree, hf_nas_eps_active_flg, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3334 proto_tree_add_bits_item(tree, hf_nas_eps_eps_update_type_value, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
3337 /* Fix the lengths */
3340 /* Old GUTI EPS mobile identity 9.9.3.12 M LV 12 */
3341 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Old GUTI");
3342 /* No more Mandatory elements */
3345 /* B- NAS key set identifier Non-current native NAS key set identifier 9.9.3.21 O TV 1 */
3346 ELEM_OPT_TV_SHORT( 0xb0 , NAS_PDU_TYPE_EMM, DE_EMM_NAS_KEY_SET_ID , " - Non-current native NAS key set identifier" );
3347 /* 8- GPRS ciphering key sequence number Ciphering key sequence number 9.9.3.4a O TV 1 */
3348 ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_COMMON, DE_CIPH_KEY_SEQ_NUM, " - GPRS ciphering key sequence number");
3349 /* 19 Old P-TMSI signature P-TMSI signature 9.9.3.26 O TV 4 */
3350 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, " - Old P-TMSI Signature");
3351 /* 50 Additional GUTI EPS mobile identity 9.9.3.12 O TLV 13 */
3352 ELEM_OPT_TLV(0x50, NAS_PDU_TYPE_EMM, DE_EMM_EPS_MID, " - Additional GUTI");
3353 /* 55 NonceUE Nonce 9.9.3.25 O TV 5 */
3354 ELEM_OPT_TV(0x55, GSM_A_PDU_TYPE_GM, DE_EMM_NONCE, " - NonceUE");
3355 /* 58 UE network capability UE network capability 9.9.3.34 O TLV 4-15 */
3356 ELEM_OPT_TLV(0x58, NAS_PDU_TYPE_EMM, DE_EMM_UE_NET_CAP, NULL);
3357 /* 52 Last visited registered TAI Tracking area identity 9.9.3.32 O TV 6 */
3358 ELEM_OPT_TV(0x52, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, " - Last visited registered TAI");
3359 /* 5C DRX parameter DRX parameter 9.9.3.8 O TV 3 */
3360 ELEM_OPT_TV(0x5c, GSM_A_PDU_TYPE_GM, DE_DRX_PARAM, NULL );
3361 /* A- UE radio capability information update needed UE radio capability information update needed 9.9.3.35 O TV 1 */
3362 ELEM_OPT_TV_SHORT( 0xA0 , NAS_PDU_TYPE_EMM, DE_EMM_UE_RA_CAP_INF_UPD_NEED , NULL );
3363 /* 57 EPS bearer context status EPS bearer context status 9.9.2.1 O TLV 4 */
3364 ELEM_OPT_TLV(0x57, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_EPS_BE_CTX_STATUS, NULL);
3365 /* 31 MS network capability MS network capability 9.9.3.20 O TLV 4-10 */
3366 ELEM_OPT_TLV( 0x31 , GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP , NULL );
3367 /* 13 Old location area identification Location area identification 9.9.2.2 O TV 6 */
3368 ELEM_OPT_TV(0x13, NAS_PDU_TYPE_COMMON, DE_EPS_CMN_LOC_AREA_ID, " - Old location area identification");
3369 /* 9- TMSI status TMSI status 9.9.3.31 O TV 1 */
3370 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , NULL );
3371 /* 11 Mobile station classmark 2 Mobile station classmark 2 9.9.2.5 O TLV 5 */
3372 ELEM_OPT_TLV( 0x11, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_2 , NULL );
3373 /* 20 Mobile station classmark 3 Mobile station classmark 3 9.9.2.5 O TLV 2-34 */
3374 ELEM_OPT_TLV( 0x20, NAS_PDU_TYPE_COMMON, DE_EPS_MS_CM_3 , NULL );
3375 /* 40 Supported Codecs Supported Codec List 9.9.2.10 O TLV 5-n */
3376 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, " - Supported Codecs");
3377 /* F- Additional update type Additional update type 9.9.3.0B O TV 1 */
3378 ELEM_OPT_TV_SHORT( 0xF0 , NAS_PDU_TYPE_EMM, DE_EMM_ADD_UPD_TYPE, NULL );
3379 /* 5D Voice domain preference and UE's usage setting Voice domain preference and UE's usage setting 9.9.3.44 O TLV 3 */
3380 /* ELEM_OPT_TLV(0x5D, xxxxxx, xxxxxx, NULL); */
3382 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3386 * 8.2.30 Uplink NAS Transport
3389 nas_emm_ul_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3391 guint32 curr_offset;
3395 curr_offset = offset;
3398 /* NAS message container NAS message container 9.9.3.22 M LV 3-252*/
3399 ELEM_MAND_LV(NAS_PDU_TYPE_EMM, DE_EMM_NAS_MSG_CONT, NULL);
3401 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3405 * 8.2.31 Downlink generic NAS transport
3408 nas_emm_ul_gen_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3410 guint32 curr_offset;
3414 curr_offset = offset;
3417 /* Generic message container type Generic message container type 9.9.3.42 M V 1 */
3418 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_EMM_GEN_MSG_CONT_TYPE, NULL);
3419 /* Generic message container Generic message container 9.9.3.43 M LV-E 3-n */
3420 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT, NULL)
3421 /* 65 Additional information Additional information 9.9.2.0 O TLV 3-n */
3425 * 8.2.32 Uplink generic NAS transport
3428 nas_emm_dl_gen_nas_trans(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3430 guint32 curr_offset;
3434 curr_offset = offset;
3437 /* Generic message container type Generic message container type 9.9.3.42 M V 1 */
3438 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_EMM_GEN_MSG_CONT_TYPE, NULL);
3439 /* Generic message container Generic message container 9.9.3.43 M LV-E 3-n */
3440 ELEM_MAND_LV_E(NAS_PDU_TYPE_EMM, DE_EMM_GEN_MSG_CONT, NULL)
3441 /* 65 Additional information Additional information 9.9.2.0 O TLV 3-n */
3446 * 8.3 EPS session management messages
3450 * 8.3.1 Activate dedicated EPS bearer context accept
3453 nas_esm_act_ded_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3455 guint32 curr_offset;
3462 curr_offset = offset;
3465 /* This message is sent by the UE to the network */
3466 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
3468 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3469 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3471 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3475 * 8.3.2 Activate dedicated EPS bearer context reject
3478 nas_esm_act_ded_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3480 guint32 curr_offset;
3484 curr_offset = offset;
3487 /* This message is sent by UE to the network to reject activation of a dedicated EPS bearer context */
3488 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
3490 /* ESM cause ESM cause 9.9.4.2 M V 1 */
3491 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3492 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3493 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3495 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3498 * 8.3.3 Activate dedicated EPS bearer context request
3501 nas_esm_act_ded_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3503 guint32 curr_offset, bit_offset;
3507 curr_offset = offset;
3510 /* This message is sent by the network to the UE to request activation of a dedicated EPS bearer context... */
3511 gsm_a_dtap_pinfo->link_dir = P2P_DIR_DL;
3514 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
3515 bit_offset = curr_offset<<3;
3516 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3518 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3519 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3521 /* Fix the lengths */
3525 /* EPS QoS EPS quality of service 9.9.4.3 M LV 2-10 */
3526 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, NULL);
3527 /* TFT Traffic flow template 9.9.4.16 M LV 2-256 */
3528 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , NULL );
3529 /* 5D Transaction identifier Transaction identifier 9.9.4.17 O TLV 3-4 */
3530 ELEM_OPT_TLV( 0x5d , GSM_A_PDU_TYPE_GM, DE_LINKED_TI , " - Transaction identifier" );
3531 /* 30 Negotiated QoS Quality of service 9.9.4.12 O TLV 14-18 */
3532 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
3533 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
3534 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
3535 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
3536 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , NULL );
3537 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
3538 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL );
3539 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3540 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3542 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3546 * 8.3.4 Activate default EPS bearer context accept
3549 nas_esm_act_def_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3551 guint32 curr_offset;
3555 curr_offset = offset;
3561 /* This message is sent by the UE to the network to acknowledge activation of a default EPS bearer context */
3562 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
3564 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3565 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3567 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3571 * 8.3.5 Activate default EPS bearer context reject
3574 nas_esm_act_def_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3576 guint32 curr_offset;
3580 curr_offset = offset;
3583 /* This message is sent by UE to the network to reject activation of a default EPS bearer context. */
3584 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
3586 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3587 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3588 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3589 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3591 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3595 * 8.3.6 Activate default EPS bearer context request
3598 nas_esm_act_def_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3600 guint32 curr_offset;
3604 curr_offset = offset;
3607 /* This message is sent by the network to the UE to request activation of a default EPS bearer context. */
3608 gsm_a_dtap_pinfo->link_dir = P2P_DIR_DL;
3610 /* EPS QoS EPS quality of service 9.9.4.3 M LV 2-10 */
3611 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, NULL);
3612 /* Access point name Access point name 9.9.4.1 M LV 2-101 */
3613 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL );
3614 /* PDN address PDN address 9.9.4.9 M LV 6-14 DE_ESM_PDN_ADDR*/
3615 ELEM_MAND_LV( NAS_PDU_TYPE_ESM, DE_ESM_PDN_ADDR , NULL );
3616 /* 5D Transaction identifier Transaction identifier 9.9.4.17 O TLV 3-4 */
3617 ELEM_OPT_TLV( 0x5d , GSM_A_PDU_TYPE_GM, DE_LINKED_TI , " - Transaction identifier" );
3618 /* 30 Negotiated QoS Quality of service 9.9.4.12 O TLV 14-18 */
3619 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
3620 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
3621 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
3622 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
3623 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , NULL );
3624 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
3625 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL );
3626 /* 5E APN-AMBR APN aggregate maximum bit rate 9.9.4.2 O TLV 4-8 DE_ESM_APN_AGR_MAX_BR*/
3627 ELEM_OPT_TLV( 0x5e , NAS_PDU_TYPE_ESM, DE_ESM_APN_AGR_MAX_BR , NULL );
3628 /* 58 ESM cause ESM cause 9.9.4.4 O TV 2 */
3629 ELEM_OPT_TV( 0x58 , NAS_PDU_TYPE_ESM, DE_ESM_CAUSE , NULL );
3630 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3631 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3633 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3637 * 8.3.7 Bearer resource allocation reject
3640 nas_esm_bearer_res_all_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3642 guint32 curr_offset;
3646 curr_offset = offset;
3649 /* This message is sent by the network to the UE to reject the allocation of a dedicated bearer resource. */
3650 gsm_a_dtap_pinfo->link_dir = P2P_DIR_DL;
3652 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3653 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3654 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3655 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3657 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3661 * 8.3.8 Bearer resource allocation request
3664 nas_esm_bearer_res_all_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3666 guint32 curr_offset, bit_offset;
3670 curr_offset = offset;
3673 /* This message is sent by the UE to the network to request the allocation of a dedicated bearer resource. */
3674 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
3676 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
3677 bit_offset = curr_offset<<3;
3678 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3680 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3681 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3683 /* Fix the lengths */
3687 /* Traffic flow aggregate Traffic flow aggregate description 9.9.4.15 M LV 2-256 */
3688 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , " - Traffic flow aggregate" );
3689 /* Required traffic flow QoS EPS quality of service 9.9.4.3 M LV 2-10 */
3690 ELEM_MAND_LV(NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS, " - Required traffic flow QoS");
3691 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3692 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3694 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3697 * 8.3.9 Bearer resource modification reject
3700 nas_esm_bearer_res_mod_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3702 guint32 curr_offset;
3706 curr_offset = offset;
3709 /* This message is sent by the network to the UE to reject the modification of a dedicated bearer resource. */
3710 gsm_a_dtap_pinfo->link_dir = P2P_DIR_DL;
3712 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3713 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3714 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3715 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3717 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3720 * 8.3.10 Bearer resource modification request
3723 nas_esm_bearer_res_mod_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3725 guint32 curr_offset, bit_offset;
3729 curr_offset = offset;
3732 /* This message is sent by the UE to the network to request the modification of a dedicated bearer resource. */
3733 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
3735 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
3736 bit_offset = curr_offset<<3;
3737 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3739 /* EPS bearer identity for packet filter Linked EPS bearer identity 9.9.4.6 M V 1/2 */
3740 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3742 /* Fix the lengths */
3745 /* Traffic flow aggregate Traffic flow aggregate description 9.9.4.15 M LV 2-256 */
3746 ELEM_MAND_LV( GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , " - Traffic flow aggregate" );
3747 /* 5B Required traffic flow QoS EPS quality of service 9.9.4.3 O TLV 3-11 */
3748 ELEM_OPT_TLV( 0x5B , NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS , " - Required traffic flow QoS" );
3749 /* 58 ESM cause ESM cause 9.9.4.4 O TV 2 */
3750 ELEM_OPT_TV( 0x58 , NAS_PDU_TYPE_ESM, DE_ESM_CAUSE , NULL );
3751 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3752 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3754 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3757 * 8.3.11 Deactivate EPS bearer context accept
3760 nas_esm_deact_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3762 guint32 curr_offset;
3766 curr_offset = offset;
3772 /* This message is sent by the UE to acknowledge deactivation of the EPS bearer context... */
3773 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
3775 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV */
3776 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3778 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3781 * 8.3.12 Deactivate EPS bearer context request
3784 nas_esm_deact_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3786 guint32 curr_offset;
3790 curr_offset = offset;
3793 /* This message is sent by the network to request deactivation of an active EPS bearer context. */
3794 gsm_a_dtap_pinfo->link_dir = P2P_DIR_DL;
3796 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3797 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3798 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV */
3799 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3801 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3805 * 8.3.13 ESM information request
3809 nas_esm_inf_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3811 guint32 curr_offset;
3814 curr_offset = offset;
3817 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3820 * 8.3.14 ESM information response
3823 nas_esm_inf_resp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3825 guint32 curr_offset;
3829 curr_offset = offset;
3835 /* This message is sent by the UE to the network in response to an ESM INFORMATION REQUEST... */
3836 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
3838 /* 28 Access point name Access point name 9.9.4.1 O TLV 3-102 */
3839 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL );
3840 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3841 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3843 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3849 nas_esm_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3851 guint32 curr_offset;
3855 curr_offset = offset;
3858 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3859 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3861 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3864 * 8.3.16 Modify EPS bearer context accept
3867 nas_esm_mod_eps_bearer_ctx_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3869 guint32 curr_offset;
3873 curr_offset = offset;
3879 /* This message is sent by the UE to the network to acknowledge the modification of an active EPS bearer context. */
3880 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
3882 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3883 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3885 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3888 * 8.3.17 Modify EPS bearer context reject
3891 nas_esm_mod_eps_bearer_ctx_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3893 guint32 curr_offset;
3897 curr_offset = offset;
3900 /* This message is sent by the UE or the network to reject a modification of an active EPS bearer context. */
3901 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
3903 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3904 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3905 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3906 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3908 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3911 * 8.3.18 Modify EPS bearer context request
3914 nas_esm_mod_eps_bearer_ctx_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3916 guint32 curr_offset;
3920 curr_offset = offset;
3926 /*This message is sent by the network to inform the UE about events which are relevant for the upper layer... */
3927 gsm_a_dtap_pinfo->link_dir = P2P_DIR_DL;
3929 /* 5B New EPS QoS EPS quality of service 9.9.4.3 O TLV 3-11 */
3930 ELEM_OPT_TLV( 0x5B , NAS_PDU_TYPE_ESM, DE_ESM_EPS_QOS , " - New EPS QoS" );
3931 /* 36 TFT Traffic flow template 9.9.4.16 O TLV 3-257 */
3932 ELEM_OPT_TLV( 0x36 , GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , NULL );
3933 /* 30 New QoS Quality of service 9.9.4.12 O TLV 14-18 */
3934 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - New QoS" );
3935 /* 32 Negotiated LLC SAPI LLC service access point identifier 9.9.4.7 O TV 2 */
3936 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
3937 /* 8- Radio priority Radio priority 9.9.4.13 O TV 1 */
3938 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , NULL );
3939 /* 34 Packet flow Identifier Packet flow Identifier 9.9.4.8 O TLV 3 */
3940 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL );
3941 /* 5E APN-AMBR APN aggregate maximum bit rate 9.9.4.2 O TLV 4-8 */
3942 ELEM_OPT_TLV( 0x5E , NAS_PDU_TYPE_ESM, DE_ESM_APN_AGR_MAX_BR , NULL );
3943 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3944 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3946 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3949 * 8.3.18A Notification
3952 nas_esm_notification(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3954 guint32 curr_offset;
3957 curr_offset = offset;
3960 /* Notification indicator Notification indicator 9.9.4.7A M LV 2 */
3961 proto_tree_add_text(tree, tvb, offset, len, "Not dissected yet");
3965 * 8.3.19 PDN connectivity reject
3968 nas_esm_pdn_con_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3970 guint32 curr_offset;
3974 curr_offset = offset;
3977 /*This message is sent by the network to the UE to reject establishment of a PDN connection. */
3978 gsm_a_dtap_pinfo->link_dir = P2P_DIR_DL;
3980 /* ESM cause ESM cause 9.9.4.4 M V 1 */
3981 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
3982 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
3983 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
3985 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3989 * 8.3.20 PDN connectivity request
3992 nas_esm_pdn_con_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
3994 guint32 curr_offset;
3998 curr_offset = offset;
4001 /*This message is sent by the UE to the network to initiate establishment of a PDN connection. */
4002 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
4004 /* PDN type PDN type 9.9.4.10 M V 1/2 */
4005 proto_tree_add_bits_item(tree, hf_nas_eps_esm_pdn_type, tvb, (curr_offset<<3), 4, ENC_BIG_ENDIAN);
4007 /* Request type 9.9.4.14 M V 1/2 */
4008 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_REQ_TYPE, NULL);
4010 /* Lengths already fixed by the call to ELEM_MAND_V macro */
4015 /* D- ESM information transfer flag 9.9.4.5 O TV 1 */
4016 ELEM_OPT_TV_SHORT( 0xd0 , NAS_PDU_TYPE_ESM, DE_ESM_INF_TRF_FLG , NULL );
4017 /* 28 Access point name 9.9.4.1 O TLV 3-102 */
4018 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL );
4019 /* 27 Protocol configuration options 9.9.4.11 O TLV 3-253 */
4020 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4022 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4025 * 8.3.20 PDN disconnect reject
4028 nas_esm_pdn_disc_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
4030 guint32 curr_offset;
4034 curr_offset = offset;
4037 /*This message is sent by the UE to the network to initiate establishment of a PDN connection. */
4038 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
4040 /* ESM cause ESM cause 9.9.4.4 M V 1 */
4041 ELEM_MAND_V(NAS_PDU_TYPE_ESM, DE_ESM_CAUSE, NULL);
4042 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
4043 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4045 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4048 * 8.3.21 PDN disconnect request
4051 nas_esm_pdn_disc_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
4053 guint32 curr_offset, bit_offset;
4057 curr_offset = offset;
4060 /* This message is sent by the network to the UE to reject release of a PDN connection. */
4061 gsm_a_dtap_pinfo->link_dir = P2P_DIR_DL;
4063 /* Spare half octet Spare half octet 9.9.2.9 M V 1/2 */
4064 bit_offset = curr_offset<<3;
4065 proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4067 /* Linked EPS bearer identity Linked EPS bearer identity 9.9.4.6 M V 1/2 */
4068 proto_tree_add_bits_item(tree, hf_nas_eps_esm_linked_bearer_id, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4070 /* Fix the lengths */
4075 /* 27 Protocol configuration options Protocol configuration options 9.9.4.11 O TLV 3-253 */
4076 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL );
4078 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4082 #define NUM_NAS_MSG_ESM (sizeof(nas_msg_esm_strings)/sizeof(value_string))
4083 static gint ett_nas_msg_esm[NUM_NAS_MSG_ESM];
4084 static void (*nas_msg_esm_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) = {
4085 nas_esm_act_def_eps_bearer_ctx_req, /* Activate default EPS bearer context request*/
4086 nas_esm_act_def_eps_bearer_ctx_acc, /* Activate default EPS bearer context accept*/
4087 nas_esm_act_def_eps_bearer_ctx_rej, /* Activate default EPS bearer context reject*/
4088 nas_esm_act_ded_eps_bearer_ctx_req, /* Activate dedicated EPS bearer context request*/
4089 nas_esm_act_ded_eps_bearer_ctx_acc, /* Activate dedicated EPS bearer context accept*/
4090 nas_esm_act_ded_eps_bearer_ctx_rej, /* Activate dedicated EPS bearer context reject*/
4091 nas_esm_mod_eps_bearer_ctx_req, /* Modify EPS bearer context request*/
4092 nas_esm_mod_eps_bearer_ctx_acc, /* Modify EPS bearer context accept*/
4093 nas_esm_mod_eps_bearer_ctx_rej, /* Modify EPS bearer context reject*/
4094 nas_esm_deact_eps_bearer_ctx_req, /* Deactivate EPS bearer context request*/
4095 nas_esm_deact_eps_bearer_ctx_acc, /* Deactivate EPS bearer context accept*/
4096 nas_esm_pdn_con_req, /* 8.3.18 PDN connectivity request */
4097 nas_esm_pdn_con_rej, /* PDN connectivity reject*/
4098 nas_esm_pdn_disc_req, /* PDN disconnect request*/
4099 nas_esm_pdn_disc_rej, /* PDN disconnect reject*/
4100 nas_esm_bearer_res_all_req, /* Bearer resource allocation request*/
4101 nas_esm_bearer_res_all_rej, /* Bearer resource allocation reject*/
4102 nas_esm_bearer_res_mod_req, /* Bearer resource modification request*/
4103 nas_esm_bearer_res_mod_rej, /* Bearer resource modification reject*/
4104 nas_esm_inf_req, /* ESM information request, No IE:s*/
4105 nas_esm_inf_resp, /* ESM information response*/
4106 nas_esm_notification, /* Notification */
4107 nas_esm_status, /* ESM status */
4113 get_nas_esm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p)
4117 *msg_str = match_strval_idx((guint32) (oct & 0xff), nas_msg_esm_strings, &idx);
4118 *ett_tree = ett_nas_msg_esm[idx];
4119 *hf_idx = hf_nas_eps_msg_esm_type;
4120 *msg_fcn_p = nas_msg_esm_fcn[idx];
4127 #define NUM_NAS_MSG_EMM (sizeof(nas_msg_emm_strings)/sizeof(value_string))
4128 static gint ett_nas_msg_emm[NUM_NAS_MSG_EMM];
4129 static void (*nas_msg_emm_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) = {
4130 nas_emm_attach_req, /* Attach request */
4131 nas_emm_attach_acc, /* Attach accept */
4132 nas_emm_attach_comp, /* Attach complete */
4133 nas_emm_attach_rej, /* Attach reject */
4134 nas_emm_detach_req, /* Detach request */
4135 NULL, /* 8.2.10 Detach accept */
4137 nas_emm_trac_area_upd_req, /* Tracking area update request */
4138 nas_emm_trac_area_upd_acc, /* Tracking area update accept */
4139 NULL, /* Tracking area update complete (No IE's)*/
4140 nas_emm_trac_area_upd_rej, /* Tracking area update reject */
4142 nas_emm_ext_serv_req, /* Extended service request */
4143 nas_emm_serv_rej, /* Service reject */
4145 nas_emm_guti_realloc_cmd, /* GUTI reallocation command */
4146 NULL, /* GUTI reallocation complete (No IE's) */
4147 nas_emm_auth_req, /* Authentication request */
4148 nas_emm_auth_resp, /* Authentication response */
4149 NULL, /* Authentication reject (No IE:s)*/
4150 nas_emm_attach_fail, /* Authentication failure */
4151 nas_emm_id_req, /* Identity request */
4152 nas_emm_id_res, /* Identity response */
4153 nas_emm_sec_mode_cmd, /* Security mode command */
4154 nas_emm_sec_mode_comp, /* Security mode complete */
4155 nas_emm_sec_mode_rej, /* Security mode reject */
4157 nas_emm_emm_status, /* EMM status */
4158 nas_emm_emm_inf, /* EMM information */
4159 nas_emm_dl_nas_trans, /* Downlink NAS transport */
4160 nas_emm_ul_nas_trans, /* Uplink NAS transport */
4161 nas_emm_cs_serv_not, /* 8.2.9 CS service notification */
4162 nas_emm_ul_gen_nas_trans, /* Downlink generic NAS transport */
4163 nas_emm_dl_gen_nas_trans, /* Uplink generic NAS transport */
4169 get_nas_emm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p)
4173 *msg_str = match_strval_idx((guint32) (oct & 0xff), nas_msg_emm_strings, &idx);
4174 *ett_tree = ett_nas_msg_emm[idx];
4175 *hf_idx = hf_nas_eps_msg_emm_type;
4176 *msg_fcn_p = nas_msg_emm_fcn[idx];
4182 * EPS session management messages.
4183 * A plain NAS message is pased to this function
4186 disect_nas_eps_esm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
4188 const gchar *msg_str;
4192 void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len);
4195 len = tvb_length(tvb);
4197 * EPS bearer identity 9.3.2
4199 proto_tree_add_item(tree, hf_nas_eps_bearer_id, tvb, offset, 1, ENC_BIG_ENDIAN);
4200 /* Protocol discriminator 9.2 */
4201 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
4204 /* Procedure transaction identity 9.4
4205 * The procedure transaction identity and its use are defined in 3GPP TS 24.007
4207 proto_tree_add_item(tree, hf_nas_eps_esm_proc_trans_id, tvb, offset, 1, ENC_BIG_ENDIAN);
4211 oct = tvb_get_guint8(tvb,offset);
4217 get_nas_esm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p);
4220 col_append_fstr(pinfo->cinfo, COL_INFO, " %s ", msg_str);
4222 proto_tree_add_text(tree, tvb, offset, 1,"Unknown message 0x%x",oct);
4227 * Add NAS message name
4229 proto_tree_add_item(tree, hf_idx, tvb, offset, 1, ENC_BIG_ENDIAN);
4236 if (msg_fcn_p == NULL)
4238 proto_tree_add_text(tree, tvb, offset, len - offset,
4239 "Message Elements");
4243 /* If calling any "gsm" ie dissectors needing pinfo */
4244 gsm_a_dtap_pinfo = pinfo;
4245 (*msg_fcn_p)(tvb, tree, pinfo, offset, len - offset);
4250 * The "real" security header has been dissected or if dissect_header = TRUE
4253 dissect_nas_eps_emm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean second_header)
4255 const gchar *msg_str;
4259 void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len);
4260 guint8 security_header_type, oct;
4262 len = tvb_length(tvb);
4264 /* 9.3.1 Security header type */
4266 security_header_type = tvb_get_guint8(tvb,offset)>>4;
4267 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4268 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
4270 if (security_header_type !=0){
4271 /* Message authentication code */
4272 proto_tree_add_item(tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, ENC_BIG_ENDIAN);
4274 /* Sequence number */
4275 proto_tree_add_item(tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
4277 if ((security_header_type==2)||(security_header_type==4))
4278 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
4280 proto_tree_add_item(tree, hf_nas_eps_security_header_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4281 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
4286 oct = tvb_get_guint8(tvb,offset);
4292 get_nas_emm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p);
4295 col_append_fstr(pinfo->cinfo, COL_INFO, " %s ", msg_str);
4297 proto_tree_add_text(tree, tvb, offset, 1,"Unknown message 0x%x",oct);
4302 * Add NAS message name
4304 proto_tree_add_item(tree, hf_idx, tvb, offset, 1, ENC_BIG_ENDIAN);
4311 if (msg_fcn_p == NULL)
4313 proto_tree_add_text(tree, tvb, offset, len - offset,
4314 "Message Elements");
4318 /* If calling any "gsm" ie dissectors needing pinfo */
4319 gsm_a_dtap_pinfo = pinfo;
4320 (*msg_fcn_p)(tvb, tree, pinfo, offset, len - offset);
4325 * 9 General message format and information elements coding
4327 * Within the protocols defined in the present document, every message, except the SERVICE REQUEST message,
4328 * is a standard L3 message as defined in 3GPP TS 24.007 [12]. This means that the message consists of the following parts:
4329 * 1) if the message is a plain NAS message:
4330 * a) protocol discriminator;
4331 * b) EPS bearer identity or security header type;
4332 * c) procedure transaction identity;
4334 * e) other information elements, as required.
4335 * 2) if the message is a security protected NAS message:
4336 * a) protocol discriminator;
4337 * b) security header type;
4338 * c) message authentication code;
4339 * d) sequence number;
4340 * e) plain NAS message, as defined in item 1.
4342 * The EPS bearer identity and the procedure transaction identity are only used in messages
4343 * with protocol discriminator EPS session management. Octet 1a with the procedure transaction
4344 * identity shall only be included in these messages.
4348 * All messages recived here will have the security header:
4349 * Figure 9.1.2: General message organization example for a security protected NAS message
4350 * 9.3.1 Bits 5 to 8 of the first octet of every EPS Mobility Management (EMM)
4351 * message contain the Security header type IE.
4352 * 4.4.4.2 All ESM messages are integrity protected.
4356 dissect_nas_eps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
4359 proto_tree *nas_eps_tree;
4360 guint8 pd, security_header_type;
4363 guint32 msg_auth_code;
4367 len = tvb_length(tvb);
4369 /* make entry in the Protocol column on summary display */
4370 col_append_str(pinfo->cinfo, COL_PROTOCOL, "/NAS-EPS");
4372 item = proto_tree_add_item(tree, proto_nas_eps, tvb, 0, -1, ENC_BIG_ENDIAN);
4373 nas_eps_tree = proto_item_add_subtree(item, ett_nas_eps);
4375 /* Security header type Security header type 9.3.1 M V 1/2 */
4376 security_header_type = tvb_get_guint8(tvb,offset)>>4;
4377 proto_tree_add_item(nas_eps_tree, hf_nas_eps_security_header_type, tvb, 0, 1, ENC_BIG_ENDIAN);
4378 /* Protocol discriminator Protocol discriminator 9.2 M V 1/2 */
4379 proto_tree_add_item(nas_eps_tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, ENC_BIG_ENDIAN);
4380 pd = tvb_get_guint8(tvb,offset)&0x0f;
4382 /* Message authentication code Message authentication code 9.5 M V 4 */
4383 if (security_header_type == 0){
4385 /* Plain EPS mobility management messages. */
4386 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, ENC_BIG_ENDIAN);
4389 proto_tree_add_text(tree, tvb, offset, len, "All ESM messages should be integrity protected");
4393 /* SERVICE REQUEST (12) is not a plain NAS message treat separately */
4394 if (security_header_type == 12){
4395 col_append_fstr(pinfo->cinfo, COL_INFO, " SERVICE REQUEST ");
4396 nas_emm_service_req(tvb, nas_eps_tree, pinfo, offset, len-offset);
4399 /* Message authentication code */
4400 proto_tree_add_item(nas_eps_tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, ENC_BIG_ENDIAN);
4401 msg_auth_code = tvb_get_ntohl(tvb, offset);
4403 if ((security_header_type==2)||(security_header_type==4)){
4404 /* Possible ciphered message */
4405 if(msg_auth_code!=0){
4406 /* Sequence number Sequence number 9.6 M V 1 */
4407 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
4409 /* Integrity protected and ciphered = 2, Integrity protected and ciphered with new EPS security context = 4 */
4410 pd = tvb_get_guint8(tvb,offset)&0x0f;
4411 /* If pd is in plaintext this message probably isn't ciphered */
4412 if((pd!=7)&&(pd!=2)&&(pd!=15)){
4413 proto_tree_add_text(nas_eps_tree, tvb, offset, len-6,"Ciphered message");
4417 /* msg_auth_code == 0, probably not ciphered */
4418 /* Sequence number Sequence number 9.6 M V 1 */
4419 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
4423 /* Sequence number Sequence number 9.6 M V 1 */
4424 proto_tree_add_item(nas_eps_tree, hf_nas_eps_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
4428 /* NAS message NAS message 9.7 M V 1-n */
4430 pd = tvb_get_guint8(tvb,offset)&0x0f;
4433 /* EPS session management messages.
4434 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4436 disect_nas_eps_esm_msg(tvb, pinfo, nas_eps_tree, offset);
4439 /* EPS mobility management messages.
4440 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4442 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, TRUE);
4445 /* Special conformance testing functions for User Equipment messages.
4446 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4448 if (gsm_a_dtap_handle){
4449 tvbuff_t *new_tvb = tvb_new_subset(tvb, offset, -1, -1);
4450 gsm_a_dtap_pinfo = pinfo;
4451 call_dissector(gsm_a_dtap_handle, new_tvb, gsm_a_dtap_pinfo, nas_eps_tree);
4453 } /* else fall through default */
4455 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"));
4462 dissect_nas_eps_plain(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
4465 proto_tree *nas_eps_tree;
4472 len = tvb_length(tvb);
4474 /* make entry in the Protocol column on summary display */
4475 col_append_str(pinfo->cinfo, COL_PROTOCOL, "/NAS-EPS");
4477 item = proto_tree_add_item(tree, proto_nas_eps, tvb, 0, -1, ENC_BIG_ENDIAN);
4478 nas_eps_tree = proto_item_add_subtree(item, ett_nas_eps);
4480 pd = tvb_get_guint8(tvb,offset)&0x0f;
4483 /* EPS session management messages.
4484 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4486 disect_nas_eps_esm_msg(tvb, pinfo, nas_eps_tree, offset);
4489 /* EPS mobility management messages.
4490 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4492 dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, TRUE);
4495 /* Special conformance testing functions for User Equipment messages.
4496 * Ref 3GPP TS 24.007 version 8.0.0 Release 8, Table 11.2: Protocol discriminator values
4498 if (gsm_a_dtap_handle){
4499 tvbuff_t *new_tvb = tvb_new_subset(tvb, offset, -1, -1);
4500 gsm_a_dtap_pinfo = pinfo;
4501 call_dissector(gsm_a_dtap_handle, new_tvb, gsm_a_dtap_pinfo, nas_eps_tree);
4503 } /* else fall through default */
4505 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"));
4511 void proto_register_nas_eps(void) {
4515 /* List of fields */
4517 static hf_register_info hf[] = {
4518 { &hf_nas_eps_msg_emm_type,
4519 { "NAS EPS Mobility Management Message Type", "nas_eps.nas_msg_emm_type",
4520 FT_UINT8, BASE_HEX, VALS(nas_msg_emm_strings), 0x0,
4523 { &hf_nas_eps_common_elem_id,
4524 { "Element ID", "nas_eps.common.elem_id",
4525 FT_UINT8, BASE_DEC, NULL, 0,
4528 { &hf_nas_eps_emm_elem_id,
4529 { "Element ID", "nas_eps.emm.elem_id",
4530 FT_UINT8, BASE_DEC, NULL, 0,
4533 { &hf_nas_eps_bearer_id,
4534 { "EPS bearer identity", "nas_eps.bearer_id",
4535 FT_UINT8, BASE_HEX, NULL, 0xf0,
4538 { &hf_nas_eps_spare_bits,
4539 { "Spare bit(s)", "nas_eps.spare_bits",
4540 FT_UINT8, BASE_HEX, NULL, 0x0,
4543 { &hf_nas_eps_security_header_type,
4544 { "Security header type","nas_eps.security_header_type",
4545 FT_UINT8,BASE_DEC|BASE_EXT_STRING, &security_header_type_vals_ext, 0xf0,
4548 { &hf_nas_eps_msg_auth_code,
4549 { "Message authentication code","nas_eps.msg_auth_code",
4550 FT_UINT32,BASE_HEX, NULL, 0x0,
4553 { &hf_nas_eps_seq_no,
4554 { "Sequence number","nas_eps.seq_no",
4555 FT_UINT8,BASE_DEC, NULL, 0x0,
4558 { &hf_nas_eps_seq_no_short,
4559 { "Sequence number (short)","nas_eps.seq_no_short",
4560 FT_UINT8,BASE_DEC, NULL, 0x0,
4563 { &hf_nas_eps_emm_ebi0,
4564 { "EBI(0) spare","nas_eps.emm.ebi0",
4565 FT_BOOLEAN, 8, NULL, 0x01,
4568 { &hf_nas_eps_emm_ebi1,
4569 { "EBI(1) spare","nas_eps.emm.ebi1",
4570 FT_BOOLEAN, 8, NULL, 0x02,
4573 { &hf_nas_eps_emm_ebi2,
4574 { "EBI(2) spare","nas_eps.emm.ebi2",
4575 FT_BOOLEAN, 8, NULL, 0x04,
4578 { &hf_nas_eps_emm_ebi3,
4579 { "EBI(3) spare","nas_eps.emm.ebi3",
4580 FT_BOOLEAN, 8, NULL, 0x08,
4583 { &hf_nas_eps_emm_ebi4,
4584 { "EBI(4) spare","nas_eps.emm.ebi4",
4585 FT_BOOLEAN, 8, NULL, 0x10,
4588 { &hf_nas_eps_emm_ebi5,
4589 { "EBI(5)","nas_eps.emm.ebi5",
4590 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x20,
4593 { &hf_nas_eps_emm_ebi6,
4594 { "EBI(6)","nas_eps.emm.ebi6",
4595 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x40,
4598 { &hf_nas_eps_emm_ebi7,
4599 { "EBI(7)","nas_eps.emm.ebi7",
4600 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x80,
4603 { &hf_nas_eps_emm_ebi8,
4604 { "EBI(8)","nas_eps.emm.ebi8",
4605 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x01,
4608 { &hf_nas_eps_emm_ebi9,
4609 { "EBI(9)","nas_eps.emm.ebi9",
4610 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x02,
4613 { &hf_nas_eps_emm_ebi10,
4614 { "EBI(10)","nas_eps.emm.ebi10",
4615 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x04,
4618 { &hf_nas_eps_emm_ebi11,
4619 { "EBI(11)","nas_eps.emm.ebi11",
4620 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x08,
4623 { &hf_nas_eps_emm_ebi12,
4624 { "EBI(12)","nas_eps.emm.ebi12",
4625 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x10,
4628 { &hf_nas_eps_emm_ebi13,
4629 { "EBI(13)","nas_eps.emm.ebi13",
4630 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x20,
4633 { &hf_nas_eps_emm_ebi14,
4634 { "EBI(14)","nas_eps.emm.ebi14",
4635 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x40,
4638 { &hf_nas_eps_emm_ebi15,
4639 { "EBI(15)","nas_eps.emm.ebi15",
4640 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ebi_vals), 0x80,
4643 { &hf_nas_eps_emm_dl_nas_cnt,
4644 { "DL NAS COUNT value","nas_eps.emm.dl_nas_cnt",
4645 FT_UINT8,BASE_DEC, NULL, 0x0f,
4648 {&hf_nas_eps_emm_nounce_mme,
4649 { "NonceMME","nas_eps.emm.nounce_mme",
4650 FT_UINT32,BASE_HEX, NULL, 0x0,
4653 { &hf_nas_eps_emm_eps_att_type,
4654 { "EPS attach type","nas_eps.emm.eps_att_type",
4655 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_att_type_vals), 0x0,
4658 { &hf_nas_eps_emm_cs_lcs_type,
4659 { "CS-LCS","nas_eps.emm.cs_lcs",
4660 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_cs_lcs_vals), 0x0,
4661 "Location services indicator in CS", HFILL }
4663 { &hf_nas_eps_emm_epc_lcs_type,
4664 { "EPC-LCS","nas_eps.emm.epc_lcs",
4665 FT_BOOLEAN ,BASE_NONE, TFS(&nas_eps_emm_epc_lcs_value), 0x0,
4666 "Location services indicator in EPC", HFILL }
4668 { &hf_nas_eps_emm_emc_bs_type,
4669 { "EMC BS","nas_eps.emm.emc_bs",
4670 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_emc_bs_value), 0x0,
4671 "Emergency bearer services indicator", HFILL }
4673 { &hf_nas_eps_emm_ims_vops_type,
4674 { "IMS VoPS","nas_eps.emm.ims_vops",
4675 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_ims_vops_value), 0x0,
4676 "IMS voice over PS session indicator", HFILL }
4679 { "Type of security context flag (TSC)","nas_eps.emm.tsc",
4680 FT_UINT8,BASE_DEC, VALS(nas_eps_tsc_vals), 0x0,
4683 { &hf_nas_eps_emm_nas_key_set_id,
4684 { "NAS key set identifier","nas_eps.emm.nas_key_set_id",
4685 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_NAS_key_set_identifier_vals), 0x0,
4688 { &hf_nas_eps_emm_odd_even,
4689 { "odd/even indic","nas_eps.emm.odd_even",
4690 FT_UINT8,BASE_DEC, NULL, 0x8,
4693 { &hf_nas_eps_emm_type_of_id,
4694 { "Type of identity","nas_eps.emm.type_of_id",
4695 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_id_vals), 0x07,
4698 { &hf_nas_eps_emm_mme_grp_id,
4699 { "MME Group ID","nas_eps.emm.mme_grp_id",
4700 FT_UINT16, BASE_DEC, NULL, 0x0,
4703 { &hf_nas_eps_emm_imsi,
4704 { "IMSI", "nas_eps.emm.imsi",
4705 FT_STRING, BASE_NONE, NULL, 0,
4708 { &hf_nas_eps_emm_imei,
4709 { "IMEI", "nas_eps.emm.imei",
4710 FT_STRING, BASE_NONE, NULL, 0,
4713 { &hf_nas_eps_emm_mme_code,
4714 { "MME Code","nas_eps.emm.mme_code",
4715 FT_UINT8, BASE_DEC, NULL, 0x0,
4718 { &hf_nas_eps_emm_m_tmsi,
4719 { "M-TMSI","nas_eps.emm.m_tmsi",
4720 FT_UINT32, BASE_HEX, NULL, 0x0,
4723 { &hf_nas_eps_esm_msg_cont,
4724 { "ESM message container contents","nas_eps.emm.esm_msg_cont",
4725 FT_BYTES, BASE_NONE, NULL, 0x0,
4728 { &hf_nas_eps_esm_imeisv_req,
4729 { "IMEISV request","nas_eps.emm.imeisv_req",
4730 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_imeisv_req_vals), 0x07,
4733 { &hf_nas_eps_emm_toi,
4734 { "Type of integrity protection algorithm","nas_eps.emm.toi",
4735 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_toi_vals), 0x07,
4738 { &hf_nas_eps_emm_toc,
4739 { "Type of ciphering algorithm","nas_eps.emm.toc",
4740 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_toc_vals), 0x70,
4743 { &hf_nas_eps_emm_EPS_attach_result,
4744 { "Attach result","nas_eps.emm.EPS_attach_result",
4745 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_EPS_attach_result_values), 0x0,
4748 { &hf_nas_eps_emm_spare_half_octet,
4749 { "Spare half octet","nas_eps.emm.EPS_attach_result",
4750 FT_UINT8,BASE_DEC, NULL, 0x0,
4753 { &hf_nas_eps_emm_add_upd_res,
4754 { "AURV","nas_eps.emm.add_upd_res",
4755 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_add_upd_res_vals), 0x0,
4756 "Additional update result value", HFILL }
4758 { &hf_nas_eps_emm_add_upd_type,
4759 { "AUTV","nas_eps.emm.add_upd_type",
4760 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_add_upd_type_vals), 0x0,
4761 "Additional update type value", HFILL }
4763 { &hf_nas_eps_emm_res,
4764 { "RES","nas_eps.emm.res",
4765 FT_BYTES, BASE_NONE, NULL, 0x0,
4768 { &hf_nas_eps_emm_csfb_resp,
4769 { "CSFB response","nas_eps.emm.csfb_resp",
4770 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_csfb_resp_vals), 0x03,
4773 { &hf_nas_eps_emm_cause,
4774 { "Cause","nas_eps.emm.cause",
4775 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_cause_values), 0x0,
4778 { &hf_nas_eps_emm_id_type2,
4779 { "Identity type 2","nas_eps.emm.id_type2",
4780 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_id_type2_vals), 0x0,
4783 { &hf_nas_eps_emm_short_mac,
4784 { "Message authentication code (short)","nas_eps.emm.short_mac",
4785 FT_UINT16, BASE_HEX, NULL, 0x0,
4788 { &hf_nas_eps_emm_tai_tol,
4789 { "Type of list","nas_eps.emm.tai_tol",
4790 FT_UINT8, BASE_DEC, VALS(nas_eps_emm_tai_tol_vals), 0x60,
4793 { &hf_nas_eps_emm_tai_n_elem,
4794 { "Number of elements","nas_eps.emm.tai_n_elem",
4795 FT_UINT8, BASE_DEC, NULL, 0x1f,
4798 { &hf_nas_eps_emm_tai_tac,
4799 { "Tracking area code(TAC)","nas_eps.emm.tai_tac",
4800 FT_UINT16, BASE_HEX, NULL, 0x0,
4803 { &hf_nas_eps_emm_eea0,
4804 { "EEA0","nas_eps.emm.eea0",
4805 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
4808 { &hf_nas_eps_emm_128eea1,
4809 { "128-EEA1","nas_eps.emm.128eea1",
4810 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4813 { &hf_nas_eps_emm_128eea2,
4814 { "128-EEA2","nas_eps.emm.128eea2",
4815 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4818 { &hf_nas_eps_emm_eea3,
4819 { "EEA3","nas_eps.emm.eea3",
4820 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4823 { &hf_nas_eps_emm_eea4,
4824 { "EEA4","nas_eps.emm.eea4",
4825 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4828 { &hf_nas_eps_emm_eea5,
4829 { "EEA5","nas_eps.emm.eea5",
4830 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4833 { &hf_nas_eps_emm_eea6,
4834 { "EEA6","nas_eps.emm.eea6",
4835 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4838 { &hf_nas_eps_emm_eea7,
4839 { "EEA7","nas_eps.emm.eea7",
4840 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4843 { &hf_nas_eps_emm_eia0,
4844 { "EIA0","nas_eps.emm.eia0",
4845 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
4848 { &hf_nas_eps_emm_128eia1,
4849 { "128-EIA1","nas_eps.emm.128eia1",
4850 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4853 { &hf_nas_eps_emm_128eia2,
4854 { "128-EIA2","nas_eps.emm.128eia2",
4855 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4858 { &hf_nas_eps_emm_eia3,
4859 { "EIA3","nas_eps.emm.eia3",
4860 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4863 { &hf_nas_eps_emm_eia4,
4864 { "EIA4","nas_eps.emm.eia4",
4865 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4868 { &hf_nas_eps_emm_eia5,
4869 { "EIA5","nas_eps.emm.eia5",
4870 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4873 { &hf_nas_eps_emm_eia6,
4874 { "EIA6","nas_eps.emm.eia6",
4875 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4878 { &hf_nas_eps_emm_eia7,
4879 { "EIA7","nas_eps.emm.eia7",
4880 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4885 { &hf_nas_eps_emm_uea0,
4886 { "UEA0","nas_eps.emm.uea0",
4887 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
4890 { &hf_nas_eps_emm_uea1,
4891 { "UEA1","nas_eps.emm.uea1",
4892 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4895 { &hf_nas_eps_emm_uea2,
4896 { "UEA2","nas_eps.emm.uea2",
4897 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4900 { &hf_nas_eps_emm_uea3,
4901 { "UEA3","nas_eps.emm.uea3",
4902 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4905 { &hf_nas_eps_emm_uea4,
4906 { "UEA4","nas_eps.emm.uea4",
4907 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4910 { &hf_nas_eps_emm_uea5,
4911 { "UEA5","nas_eps.emm.uea5",
4912 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4915 { &hf_nas_eps_emm_uea6,
4916 { "UEA6","nas_eps.emm.uea6",
4917 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4920 { &hf_nas_eps_emm_uea7,
4921 { "UEA7","nas_eps.emm.uea7",
4922 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4925 { &hf_nas_eps_emm_ucs2_supp,
4926 { "UCS2 support (UCS2)","nas_eps.emm.emm_ucs2_supp",
4927 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ucs2_supp_flg_value), 0x80,
4930 { &hf_nas_eps_emm_uia0,
4931 { "UMTS integrity algorithm UIA0","nas_eps.emm.uia0",
4932 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x80,
4935 { &hf_nas_eps_emm_uia1,
4936 { "UMTS integrity algorithm UIA1","nas_eps.emm.uia1",
4937 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4940 { &hf_nas_eps_emm_uia2,
4941 { "UMTS integrity algorithm UIA2","nas_eps.emm.uia2",
4942 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4945 { &hf_nas_eps_emm_uia3,
4946 { "UMTS integrity algorithm UIA3","nas_eps.emm.uia3",
4947 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4950 { &hf_nas_eps_emm_uia4,
4951 { "UMTS integrity algorithm UIA4","nas_eps.emm.uia4",
4952 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4955 { &hf_nas_eps_emm_uia5,
4956 { "UMTS integrity algorithm UIA5","nas_eps.emm.uia5",
4957 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4960 { &hf_nas_eps_emm_uia6,
4961 { "UMTS integrity algorithm UIA6","nas_eps.emm.uia6",
4962 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
4965 { &hf_nas_eps_emm_uia7,
4966 { "UMTS integrity algorithm UIA7","nas_eps.emm.uia7",
4967 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
4970 { &hf_nas_eps_emm_gea1,
4971 { "GPRS encryption algorithm GEA1","nas_eps.emm.gea1",
4972 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x40,
4975 { &hf_nas_eps_emm_gea2,
4976 { "GPRS encryption algorithm GEA2","nas_eps.emm.gea2",
4977 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x20,
4980 { &hf_nas_eps_emm_gea3,
4981 { "GPRS encryption algorithm GEA3","nas_eps.emm.gea3",
4982 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x10,
4985 { &hf_nas_eps_emm_gea4,
4986 { "GPRS encryption algorithm GEA4","nas_eps.emm.gea4",
4987 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x08,
4990 { &hf_nas_eps_emm_gea5,
4991 { "GPRS encryption algorithm GEA5","nas_eps.emm.gea5",
4992 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x04,
4995 { &hf_nas_eps_emm_gea6,
4996 { "GPRS encryption algorithm GEA6","nas_eps.emm.gea6",
4997 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x02,
5000 { &hf_nas_eps_emm_gea7,
5001 { "GPRS encryption algorithm GEA7","nas_eps.emm.gea7",
5002 FT_BOOLEAN, 8, TFS(&nas_eps_emm_supported_flg_value), 0x01,
5006 { &hf_nas_eps_emm_1xsrvcc_cap,
5007 { "1xSRVCC capability","nas_eps.emm.1xsrvcc_cap",
5008 FT_BOOLEAN, 8, TFS(&nas_eps_emm_1xsrvcc_cap_flg), 0x02,
5011 { &hf_nas_eps_emm_ue_ra_cap_inf_upd_need_flg,
5012 { "1xSRVCC capability","nas_eps.emm.ue_ra_cap_inf_upd_need_flg",
5013 FT_BOOLEAN, 8, TFS(&nas_eps_emm_ue_ra_cap_inf_upd_need_flg), 0x01,
5016 { &hf_nas_eps_emm_ss_code,
5017 { "SS Code","nas_eps.emm.eps_update_result_value",
5018 FT_UINT8,BASE_DEC, VALS(ssCode_vals), 0x0,
5021 { &hf_nas_eps_emm_lcs_ind,
5022 { "LCS indicator","nas_eps.emm.emm_lcs_ind",
5023 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_lcs_ind_vals), 0x0,
5026 { &hf_nas_eps_emm_apn_ambr_ul,
5027 { "APN-AMBR for uplink","nas_eps.emm.apn_ambr_ul",
5028 FT_UINT8,BASE_DEC, NULL, 0x0,
5031 { &hf_nas_eps_emm_apn_ambr_dl,
5032 { "APN-AMBR for downlink","nas_eps.emm.apn_ambr_dl",
5033 FT_UINT8,BASE_DEC, NULL, 0x0,
5036 { &hf_nas_eps_emm_apn_ambr_ul_ext,
5037 { "APN-AMBR for uplink(Extended)","nas_eps.emm.apn_ambr_ul_ext",
5038 FT_UINT8,BASE_DEC, NULL, 0x0,
5041 { &hf_nas_eps_emm_apn_ambr_dl_ext,
5042 { "APN-AMBR for downlink(Extended)","nas_eps.emm.apn_ambr_dl_ext",
5043 FT_UINT8,BASE_DEC, NULL, 0x0,
5046 { &hf_nas_eps_emm_apn_ambr_ul_ext2,
5047 { "APN-AMBR for uplink(Extended-2)","nas_eps.emm.apn_ambr_ul_ext2",
5048 FT_UINT8,BASE_DEC, NULL, 0x0,
5051 { &hf_nas_eps_emm_apn_ambr_dl_ext2,
5052 { "APN-AMBR for downlink(Extended-2)","nas_eps.emm.apn_ambr_dl_ext2",
5053 FT_UINT8,BASE_DEC, NULL, 0x0,
5056 { &hf_nas_eps_emm_switch_off,
5057 { "Switch off","nas_eps.emm.switch_off",
5058 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_switch_off_vals), 0x0,
5061 { &hf_nas_eps_emm_detach_type_UL,
5062 { "Detach Type","nas_eps.emm.detach_type_ul",
5063 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_dtatch_UL_vals), 0x0,
5066 { &hf_nas_eps_emm_detach_type_DL,
5067 { "Detach Type","nas_eps.emm.detach_type_dl",
5068 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_type_of_dtatch_DL_vals), 0x0,
5072 { "Quality of Service Class Identifier (QCI)","nas_eps.emm.qci",
5073 FT_UINT8,BASE_DEC, VALS(nas_eps_qci_vals), 0x0,
5076 { &hf_nas_eps_mbr_ul,
5077 { "Maximum bit rate for uplink","nas_eps.emm.mbr_ul",
5078 FT_UINT8,BASE_DEC, NULL, 0x0,
5081 { &hf_nas_eps_mbr_dl,
5082 { "Maximum bit rate for downlink","nas_eps.emm.mbr_dl",
5083 FT_UINT8,BASE_DEC, NULL, 0x0,
5086 { &hf_nas_eps_gbr_ul,
5087 { "Guaranteed bit rate for uplink","nas_eps.emm.gbr_ul",
5088 FT_UINT8,BASE_DEC, NULL, 0x0,
5091 { &hf_nas_eps_gbr_dl,
5092 { "Guaranteed bit rate for downlink","nas_eps.emm.gbr_dl",
5093 FT_UINT8,BASE_DEC, NULL, 0x0,
5096 { &hf_nas_eps_embr_ul,
5097 { "Maximum bit rate for uplink(ext)","nas_eps.emm.embr_ul",
5098 FT_UINT8,BASE_DEC, NULL, 0x0,
5101 { &hf_nas_eps_embr_dl,
5102 { "Maximum bit rate for downlink(ext)","nas_eps.emm.embr_dl",
5103 FT_UINT8,BASE_DEC, NULL, 0x0,
5106 { &hf_nas_eps_egbr_ul,
5107 { "Guaranteed bit rate for uplink(ext)","nas_eps.emm.egbr_ul",
5108 FT_UINT8,BASE_DEC, NULL, 0x0,
5111 { &hf_nas_eps_egbr_dl,
5112 { "Guaranteed bit rate for downlink(ext)","nas_eps.emm.egbr_dl",
5113 FT_UINT8,BASE_DEC, NULL, 0x0,
5116 { &hf_nas_eps_esm_cause,
5117 { "Cause","nas_eps.esm.cause",
5118 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_cause_vals), 0x0,
5121 { &hf_nas_eps_esm_eit,
5122 { "EIT (ESM information transfer)", "nas_eps.emm.eit",
5123 FT_BOOLEAN, 8, TFS(&nas_eps_emm_active_flg_value), 0x01,
5126 { &hf_nas_eps_esm_lnkd_eps_bearer_id,
5127 { "Linked EPS bearer identity","nas_eps.esm.lnkd_eps_bearer_id",
5128 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_linked_bearer_id_vals), 0x0f,
5131 { &hf_nas_eps_esm_pdn_ipv4,
5132 {"PDN IPv4", "nas_eps.esm.pdn_ipv4",
5133 FT_IPv4, BASE_NONE, NULL, 0x0,
5136 { &hf_nas_eps_esm_pdn_ipv6_if_id,
5137 {"PDN IPv6 if id", "nas_eps.esm.pdn_ipv6_if_id",
5138 FT_BYTES, BASE_NONE, NULL, 0x0,
5141 { &hf_nas_eps_esm_linked_bearer_id,
5142 { "Linked EPS bearer identity","nas_eps.esm.linked_bearer_id",
5143 FT_UINT8,BASE_DEC, VALS(nas_eps_esm_linked_bearer_id_vals), 0x0,
5146 { &hf_nas_eps_active_flg,
5147 { "Active flag", "nas_eps.emm.active_flg",
5148 FT_BOOLEAN, BASE_NONE, TFS(&nas_eps_emm_active_flg_value), 0x0,
5151 { &hf_nas_eps_eps_update_result_value,
5152 { "EPS update result value","nas_eps.emm.eps_update_result_value",
5153 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_update_result_vals), 0x0,
5156 { &hf_nas_eps_eps_update_type_value,
5157 { "EPS update type value", "nas_eps.emm.update_type_value",
5158 FT_UINT8,BASE_DEC, VALS(nas_eps_emm_eps_update_type_vals), 0x0,
5161 { &hf_nas_eps_service_type,
5162 { "Service type", "nas_eps.emm.service_type",
5163 FT_UINT8,BASE_DEC, VALS(nas_eps_service_type_vals), 0x0,
5166 /* ESM hf cvariables */
5167 { &hf_nas_eps_msg_esm_type,
5168 { "NAS EPS session management messages", "nas_eps.nas_msg_esm_type",
5169 FT_UINT8, BASE_HEX, VALS(nas_msg_esm_strings), 0x0,
5172 { &hf_nas_eps_esm_elem_id,
5173 { "Element ID", "nas_eps.esm.elem_id",
5174 FT_UINT8, BASE_DEC, NULL, 0,
5177 { &hf_nas_eps_esm_proc_trans_id,
5178 { "Procedure transaction identity", "nas_eps.esm.proc_trans_id",
5179 FT_UINT8, BASE_DEC, NULL, 0,
5182 { &hf_nas_eps_esm_pdn_type,
5183 { "PDN type", "nas_eps.nas_eps_esm_pdn_type",
5184 FT_UINT8, BASE_DEC, VALS(nas_eps_esm_pdn_type_values), 0x0,
5189 /* Setup protocol subtree array */
5190 #define NUM_INDIVIDUAL_ELEMS 2
5191 gint *ett[NUM_INDIVIDUAL_ELEMS +
5192 NUM_NAS_EPS_COMMON_ELEM +
5193 NUM_NAS_MSG_EMM + NUM_NAS_EMM_ELEM+
5194 NUM_NAS_MSG_ESM + NUM_NAS_ESM_ELEM];
5196 ett[0] = &ett_nas_eps;
5197 ett[1] = &ett_nas_eps_esm_msg_cont;
5199 last_offset = NUM_INDIVIDUAL_ELEMS;
5201 for (i=0; i < NUM_NAS_EPS_COMMON_ELEM; i++, last_offset++)
5203 ett_nas_eps_common_elem[i] = -1;
5204 ett[last_offset] = &ett_nas_eps_common_elem[i];
5208 for (i=0; i < NUM_NAS_MSG_EMM; i++, last_offset++)
5210 ett_nas_msg_emm[i] = -1;
5211 ett[last_offset] = &ett_nas_msg_emm[i];
5214 for (i=0; i < NUM_NAS_EMM_ELEM; i++, last_offset++)
5216 ett_nas_eps_emm_elem[i] = -1;
5217 ett[last_offset] = &ett_nas_eps_emm_elem[i];
5220 for (i=0; i < NUM_NAS_MSG_ESM; i++, last_offset++)
5222 ett_nas_msg_esm[i] = -1;
5223 ett[last_offset] = &ett_nas_msg_esm[i];
5226 for (i=0; i < NUM_NAS_ESM_ELEM; i++, last_offset++)
5228 ett_nas_eps_esm_elem[i] = -1;
5229 ett[last_offset] = &ett_nas_eps_esm_elem[i];
5232 /* Register protocol */
5233 proto_nas_eps = proto_register_protocol(PNAME, PSNAME, PFNAME);
5234 /* Register fields and subtrees */
5235 proto_register_field_array(proto_nas_eps, hf, array_length(hf));
5236 proto_register_subtree_array(ett, array_length(ett));
5238 /* Register dissector */
5239 register_dissector(PFNAME, dissect_nas_eps, proto_nas_eps);
5241 /* Register dissector */
5242 register_dissector("nas-eps_plain", dissect_nas_eps_plain, proto_nas_eps);
5246 proto_reg_handoff_nas_eps(void)
5249 gsm_a_dtap_handle = find_dissector("gsm_a_dtap");