2 * Routines for GSM A Interface GPRS Mobilty Management and GPRS Session Management
4 * Copyright 2003, Michael Lum <mlum [AT] telostech.com>
5 * In association with Telos Technology Inc.
7 * Added the GPRS Mobility Managment Protocol and
8 * the GPRS Session Managment Protocol
9 * Copyright 2004, Rene Pilz <rene.pilz [AT] ftw.com>
10 * In association with Telecommunications Research Center
11 * Vienna (ftw.)Betriebs-GmbH within the Project Metawin.
13 * Various updates, enhancements and fixes
14 * Copyright 2009, Gerasimos Dimitriadis <dimeg [AT] intracom.gr>
15 * In association with Intracom Telecom SA
20 * Mobile radio interface Layer 3 specification;
21 * Core network protocols;
23 * (3GPP TS 24.008 version 5.9.0 Release 5)
26 * Mobile radio interface Layer 3 specification;
27 * Core network protocols;
29 * (3GPP TS 24.008 version 6.7.0 Release 6)
30 * (3GPP TS 24.008 version 6.8.0 Release 6)
33 * Mobile radio interface Layer 3 specification;
34 * Core network protocols;
36 * (3GPP TS 24.008 version 8.6.0 Release 8)
40 * Wireshark - Network traffic analyzer
41 * By Gerald Combs <gerald@wireshark.org>
42 * Copyright 1998 Gerald Combs
44 * This program is free software; you can redistribute it and/or
45 * modify it under the terms of the GNU General Public License
46 * as published by the Free Software Foundation; either version 2
47 * of the License, or (at your option) any later version.
49 * This program is distributed in the hope that it will be useful,
50 * but WITHOUT ANY WARRANTY; without even the implied warranty of
51 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52 * GNU General Public License for more details.
54 * You should have received a copy of the GNU General Public License
55 * along with this program; if not, write to the Free Software
56 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
65 #include <epan/packet.h>
66 #include <epan/prefs.h>
68 #include <epan/asn1.h>
70 #include "packet-bssap.h"
71 #include "packet-sccp.h"
72 #include "packet-ber.h"
73 #include "packet-q931.h"
74 #include "packet-gsm_a_common.h"
75 #include "packet-ipv6.h"
76 #include "packet-e212.h"
77 #include "packet-ppp.h"
79 /* PROTOTYPES/FORWARDS */
81 const value_string gsm_a_dtap_msg_gmm_strings[] = {
82 { 0x01, "Attach Request" },
83 { 0x02, "Attach Accept" },
84 { 0x03, "Attach Complete" },
85 { 0x04, "Attach Reject" },
86 { 0x05, "Detach Request" },
87 { 0x06, "Detach Accept" },
88 { 0x08, "Routing Area Update Request" },
89 { 0x09, "Routing Area Update Accept" },
90 { 0x0a, "Routing Area Update Complete" },
91 { 0x0b, "Routing Area Update Reject" },
92 { 0x0c, "Service Request" },
93 { 0x0d, "Service Accept" },
94 { 0x0e, "Service Reject" },
95 { 0x10, "P-TMSI Reallocation Command" },
96 { 0x11, "P-TMSI Reallocation Complete" },
97 { 0x12, "Authentication and Ciphering Req" },
98 { 0x13, "Authentication and Ciphering Resp" },
99 { 0x14, "Authentication and Ciphering Rej" },
100 { 0x1c, "Authentication and Ciphering Failure" },
101 { 0x15, "Identity Request" },
102 { 0x16, "Identity Response" },
103 { 0x20, "GMM Status" },
104 { 0x21, "GMM Information" },
108 const value_string gsm_a_dtap_msg_sm_strings[] = {
109 { 0x41, "Activate PDP Context Request" },
110 { 0x42, "Activate PDP Context Accept" },
111 { 0x43, "Activate PDP Context Reject" },
112 { 0x44, "Request PDP Context Activation" },
113 { 0x45, "Request PDP Context Activation rej." },
114 { 0x46, "Deactivate PDP Context Request" },
115 { 0x47, "Deactivate PDP Context Accept" },
116 { 0x48, "Modify PDP Context Request(Network to MS direction)" },
117 { 0x49, "Modify PDP Context Accept (MS to network direction)" },
118 { 0x4a, "Modify PDP Context Request(MS to network direction)" },
119 { 0x4b, "Modify PDP Context Accept (Network to MS direction)" },
120 { 0x4c, "Modify PDP Context Reject" },
121 { 0x4d, "Activate Secondary PDP Context Request" },
122 { 0x4e, "Activate Secondary PDP Context Accept" },
123 { 0x4f, "Activate Secondary PDP Context Reject" },
124 { 0x50, "Reserved: was allocated in earlier phases of the protocol" },
125 { 0x51, "Reserved: was allocated in earlier phases of the protocol" },
126 { 0x52, "Reserved: was allocated in earlier phases of the protocol" },
127 { 0x53, "Reserved: was allocated in earlier phases of the protocol" },
128 { 0x54, "Reserved: was allocated in earlier phases of the protocol" },
129 { 0x55, "SM Status" },
130 { 0x56, "Activate MBMS Context Request" },
131 { 0x57, "Activate MBMS Context Accept" },
132 { 0x58, "Activate MBMS Context Reject" },
133 { 0x59, "Request MBMS Context Activation" },
134 { 0x5a, "Request MBMS Context Activation Reject" },
138 const value_string gsm_gm_elem_strings[] = {
139 /* GPRS Mobility Management Information Elements 10.5.5 */
140 { 0x00, "Attach Result" },
141 { 0x00, "Attach Type" },
142 { 0x00, "Cipher Algorithm" },
143 { 0x00, "TMSI Status" },
144 { 0x00, "Detach Type" },
145 { 0x00, "DRX Parameter" },
146 { 0x00, "Force to Standby" },
147 { 0x00, "Force to Standby" },
148 { 0x00, "P-TMSI Signature" },
149 { 0x00, "P-TMSI Signature 2" },
150 { 0x00, "Identity Type 2" },
151 { 0x00, "IMEISV Request" },
152 { 0x00, "Receive N-PDU Numbers List" },
153 { 0x00, "MS Network Capability" },
154 { 0x00, "MS Radio Access Capability" },
155 { 0x00, "GMM Cause" },
156 { 0x00, "Routing Area Identification" },
157 { 0x00, "Update Result" },
158 { 0x00, "Update Type" },
159 { 0x00, "A&C Reference Number" },
160 { 0x00, "A&C Reference Number" },
161 { 0x00, "Service Type" },
162 { 0x00, "Cell Notification" },
163 { 0x00, "PS LCS Capability" },
164 { 0x00, "Network Feature Support" },
165 { 0x00, "Inter RAT information container" },
166 /* Session Management Information Elements 10.5.6 */
167 { 0x00, "Access Point Name" },
168 { 0x00, "Network Service Access Point Identifier" },
169 { 0x00, "Protocol Configuration Options" },
170 { 0x00, "Packet Data Protocol Address" },
171 { 0x00, "Quality Of Service" },
172 { 0x00, "SM Cause" },
173 { 0x00, "SM Cause 2" },
174 { 0x00, "Linked TI" },
175 { 0x00, "LLC Service Access Point Identifier" },
176 { 0x00, "Tear Down Indicator" },
177 { 0x00, "Packet Flow Identifier" },
178 { 0x00, "Traffic Flow Template" },
179 { 0x00, "Temporary Mobile Group Identity (TMGI)" },
180 { 0x00, "MBMS bearer capabilities" },
181 { 0x00, "MBMS protocol configuration options" },
182 { 0x00, "Enhanced network service access point identifier" },
183 { 0x00, "Request type" },
184 /* GPRS Common Information Elements 10.5.7 */
185 { 0x00, "PDP Context Status" },
186 { 0x00, "Radio Priority" },
187 { 0x00, "GPRS Timer" },
188 { 0x00, "GPRS Timer 2" },
189 { 0x00, "Radio Priority 2"},
190 { 0x00, "MBMS context status"},
191 { 0x00, "Spare Nibble"},
195 #define DTAP_GMM_IEI_MASK 0xff
196 #define DTAP_SM_IEI_MASK 0xff
198 /* Initialize the protocol and registered fields */
199 static int proto_a_gm = -1;
201 static int hf_gsm_a_dtap_msg_gmm_type = -1;
202 static int hf_gsm_a_dtap_msg_sm_type = -1;
203 int hf_gsm_a_gm_elem_id = -1;
204 static int hf_gsm_a_qos_delay_cls = -1;
205 static int hf_gsm_a_qos_reliability_cls = -1;
206 static int hf_gsm_a_qos_traffic_cls = -1;
207 static int hf_gsm_a_qos_del_order = -1;
208 static int hf_gsm_a_qos_del_of_err_sdu = -1;
209 static int hf_gsm_a_qos_ber = -1;
210 static int hf_gsm_a_qos_sdu_err_rat = -1;
211 static int hf_gsm_a_qos_traff_hdl_pri = -1;
213 static int hf_gsm_a_gmm_split_on_ccch = -1;
214 static int hf_gsm_a_gmm_non_drx_timer = -1;
215 static int hf_gsm_a_gmm_cn_spec_drs_cycle_len_coef = -1;
217 static int hf_gsm_a_ptmsi_sig =-1;
218 static int hf_gsm_a_ptmsi_sig2 =-1;
220 static int hf_gsm_a_tft_op_code = -1;
221 static int hf_gsm_a_tft_e_bit = -1;
222 static int hf_gsm_a_tft_pkt_flt = -1;
223 static int hf_gsm_a_tft_pkt_flt_id = -1;
224 static int hf_gsm_a_tft_pkt_flt_dir = -1;
225 static int hf_gsm_a_sm_ip4_address = -1;
226 static int hf_gsm_a_sm_ip4_mask = -1;
227 static int hf_gsm_a_sm_ip6_address = -1;
228 static int hf_gsm_a_sm_ip6_mask = -1;
229 static int hf_gsm_a_tft_protocol_header = -1;
230 static int hf_gsm_a_tft_port = -1;
231 static int hf_gsm_a_tft_port_low = -1;
232 static int hf_gsm_a_tft_port_high = -1;
233 static int hf_gsm_a_tft_security = -1;
234 static int hf_gsm_a_tft_traffic_mask = -1;
235 static int hf_gsm_a_tft_flow_label_type = -1;
236 static int hf_gsm_a_tft_param_id = -1;
237 static int hf_gsm_a_gm_acc_tech_type = -1;
238 static int hf_gsm_a_gm_acc_cap_struct_len = -1;
239 static int hf_gsm_a_gm_sms_value = -1;
240 static int hf_gsm_a_gm_sm_value = -1;
241 static int hf_gsm_a_gm_sm_ext = -1;
242 static int hf_gsm_a_gm_link_dir = -1;
243 static int hf_gsm_a_gm_cause = -1;
245 static int hf_gsm_a_gm_fop = -1;
246 static int hf_gsm_a_gm_res_of_attach = -1;
247 static int hf_gsm_a_gm_type_of_ciph_alg = -1;
248 static int hf_gsm_a_gm_imeisv_req = -1;
249 static int hf_gsm_a_gm_ac_ref_nr = -1;
250 static int hf_gsm_a_gm_force_to_standby = -1;
251 static int hf_gsm_a_gm_serv_type = -1;
252 static int hf_gsm_a_gm_ciph_key_seq_num = -1;
253 static int hf_gsm_a_gm_for = -1;
254 static int hf_gsm_a_gm_type_of_attach = -1;
255 static int hf_gsm_a_gm_tmsi_flag = -1;
256 static int hf_gsm_a_gm_update_type = -1;
257 static int hf_gsm_a_gm_gprs_timer_unit = -1;
258 static int hf_gsm_a_gm_gprs_timer_value = -1;
259 static int hf_gsm_a_gm_pco_pid = -1;
260 static int hf_gsm_a_gm_type_of_identity = -1;
261 static int hf_gsm_a_gm_rac = -1;
262 static int hf_gsm_a_gm_apc = -1;
263 static int hf_gsm_a_gm_otd_a = -1;
264 static int hf_gsm_a_gm_otd_b = -1;
265 static int hf_gsm_a_gm_gps_a = -1;
266 static int hf_gsm_a_gm_gps_b = -1;
267 static int hf_gsm_a_gm_gps_c = -1;
268 static int hf_gsm_a_sm_pdp_type_org = -1;
269 static int hf_gsm_a_qos_mean_thr = -1;
270 static int hf_gsm_a_qos_peak_thr = -1;
271 static int hf_gsm_a_qos_prec_class = -1;
272 static int hf_gsm_a_qos_traf_handl_prio = -1;
273 static int hf_gsm_a_qos_trans_delay = -1;
274 static int hf_gsm_a_qos_signalling_ind = -1;
275 static int hf_gsm_a_qos_source_stat_desc = -1;
276 static int hf_gsm_a_qos_max_bitrate_upl = -1;
277 static int hf_gsm_a_qos_max_bitrate_downl = -1;
278 static int hf_gsm_a_qos_guar_bitrate_upl = -1;
279 static int hf_gsm_a_qos_guar_bitrate_downl = -1;
280 static int hf_gsm_a_qos_max_bitrate_upl_ext = -1;
281 static int hf_gsm_a_qos_max_bitrate_downl_ext = -1;
282 static int hf_gsm_a_qos_guar_bitrate_upl_ext = -1;
283 static int hf_gsm_a_qos_guar_bitrate_downl_ext = -1;
284 static int hf_gsm_a_sm_cause = -1;
285 static int hf_gsm_a_sm_cause_2 = -1;
286 static int hf_gsm_a_sm_llc_sapi = -1;
287 static int hf_gsm_a_sm_tdi = -1;
288 static int hf_gsm_a_sm_packet_flow_id = -1;
289 static int hf_gsm_a_sm_tmgi = -1;
290 static int hf_gsm_a_sm_enh_nsapi = -1;
291 static int hf_gsm_a_sm_req_type = -1;
292 static int hf_gsm_a_gm_rel_lev_ind = -1;
294 static int hf_gsm_a_gmm_net_cap_gea1 = -1;
295 static int hf_gsm_a_gmm_net_cap_smdch = -1;
296 static int hf_gsm_a_gmm_net_cap_smgprs = -1;
297 static int hf_gsm_a_gmm_net_cap_ucs2 = -1;
298 static int hf_gsm_a_gmm_net_cap_ss_scr_ind = -1;
299 static int hf_gsm_a_gmm_net_cap_solsa = -1;
300 static int hf_gsm_a_gmm_net_cap_rev = -1;
301 static int hf_gsm_a_gmm_net_cap_pfc = -1;
302 static int hf_gsm_a_gmm_net_cap_ext_gea_bits = -1;
303 static int hf_gsm_a_gmm_net_cap_gea2 = -1;
304 static int hf_gsm_a_gmm_net_cap_gea3 = -1;
305 static int hf_gsm_a_gmm_net_cap_gea4 = -1;
306 static int hf_gsm_a_gmm_net_cap_gea5 = -1;
307 static int hf_gsm_a_gmm_net_cap_gea6 = -1;
308 static int hf_gsm_a_gmm_net_cap_gea7 = -1;
309 static int hf_gsm_a_gmm_net_cap_lcs = -1;
310 static int hf_gsm_a_gmm_net_cap_ps_irat_iu = -1;
311 static int hf_gsm_a_gmm_net_cap_ps_irat_s1 = -1;
312 static int hf_gsm_a_gmm_net_cap_csfb = -1;
313 static int hf_gsm_a_gmm_net_cap_isr = -1;
314 static int hf_gsm_a_gmm_net_cap_srvcc_to_geran = -1;
315 static int hf_gsm_a_gmm_net_cap_epc = -1;
317 /* Initialize the subtree pointers */
318 static gint ett_tc_component = -1;
319 static gint ett_tc_invoke_id = -1;
320 static gint ett_tc_linked_id = -1;
321 static gint ett_tc_opr_code = -1;
322 static gint ett_tc_err_code = -1;
323 static gint ett_tc_prob_code = -1;
324 static gint ett_tc_sequence = -1;
326 static gint ett_gmm_drx = -1;
327 static gint ett_gmm_detach_type = -1;
328 static gint ett_gmm_attach_type = -1;
329 static gint ett_gmm_context_stat = -1;
330 static gint ett_gmm_update_type = -1;
331 static gint ett_gmm_radio_cap = -1;
332 static gint ett_gmm_network_cap = -1;
333 static gint ett_gmm_rai = -1;
334 static gint ett_gmm_gprs_timer = -1;
336 static gint ett_sm_tft = -1;
338 static dissector_handle_t data_handle;
339 static dissector_handle_t rrc_irat_ho_info_handle;
341 static dissector_table_t gprs_sm_pco_subdissector_table; /* GPRS SM PCO PPP Protocols */
343 #define NUM_GSM_GM_ELEM (sizeof(gsm_gm_elem_strings)/sizeof(value_string))
344 gint ett_gsm_gm_elem[NUM_GSM_GM_ELEM];
346 static const gchar *pdp_str[2]={ "PDP-INACTIVE", "PDP-ACTIVE" };
349 * [9] 10.5.5.1 Attach result
351 static const value_string gsm_a_gm_res_of_attach_vals[] = {
352 { 0x01, "GPRS only attached" },
353 { 0x03, "Combined GPRS/IMSI attached" },
358 de_gmm_attach_res(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
360 proto_tree_add_item(tree, hf_gsm_a_gm_fop, tvb, offset, 1, FALSE);
361 proto_tree_add_item(tree, hf_gsm_a_gm_res_of_attach, tvb, offset, 1, FALSE);
363 /* no length check possible */
368 * [9] 10.5.5.2 Attach type
370 static const value_string gsm_a_gm_type_of_attach_vals[] = {
371 { 0x01, "GPRS attach" },
372 { 0x02, "Not used (In earlier versions: GPRS attach while IMSI attached)" },
373 { 0x03, "Combined GPRS/IMSI attached" },
378 de_gmm_attach_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
380 proto_item *tf = NULL;
381 proto_tree *tf_tree = NULL;
383 proto_tree_add_bits_item(tree, hf_gsm_a_gm_ciph_key_seq_num, tvb, offset << 3, 4, FALSE);
385 tf = proto_tree_add_text(tree,
389 tf_tree = proto_item_add_subtree(tf, ett_gmm_attach_type );
391 proto_tree_add_item(tf_tree, hf_gsm_a_gm_for, tvb, offset, 1, FALSE);
392 proto_tree_add_item(tf_tree, hf_gsm_a_gm_type_of_attach, tvb, offset, 1, FALSE);
394 /* no length check possible */
399 * [9] 10.5.5.3 Ciphering algorithm
401 static const value_string gsm_a_gm_type_of_ciph_alg_vals[] = {
402 { 0x00, "ciphering not used" },
403 { 0x01, "GPRS Encryption Algorithm GEA/1" },
404 { 0x02, "GPRS Encryption Algorithm GEA/2" },
405 { 0x03, "GPRS Encryption Algorithm GEA/3" },
406 { 0x04, "GPRS Encryption Algorithm GEA/4" },
407 { 0x05, "GPRS Encryption Algorithm GEA/5" },
408 { 0x06, "GPRS Encryption Algorithm GEA/6" },
409 { 0x07, "GPRS Encryption Algorithm GEA/7" },
414 de_gmm_ciph_alg(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
416 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (offset << 3) + 4, 1, FALSE);
417 proto_tree_add_item(tree, hf_gsm_a_gm_type_of_ciph_alg, tvb, offset, 1, FALSE);
419 /* no length check possible */
424 * [9] 10.5.5.4 TMSI status
426 const true_false_string gsm_a_gm_tmsi_flag_value = {
427 "valid TMSI available",
428 "no valid TMSI available"
432 de_gmm_tmsi_stat(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
434 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (offset << 3) + 4, 3, FALSE);
435 proto_tree_add_item(tree, hf_gsm_a_gm_tmsi_flag, tvb, offset, 1, FALSE);
437 /* no length check possible */
445 de_gmm_detach_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
450 const gchar *str_power;
451 proto_item *tf = NULL;
452 proto_tree *tf_tree = NULL;
454 curr_offset = offset;
456 oct = tvb_get_guint8(tvb, curr_offset);
460 case 1: str="GPRS detach/re-attach required"; break;
461 case 2: str="IMSI detach/re-attach not required"; break;
462 case 3: str="Combined GPRS/IMSI detach/IMSI detach (after VLR failure)"; break;
463 default: str="Combined GPRS/IMSI detach/re-attach not required";
468 case 8: str_power="power switched off"; break;
469 default: str_power="normal detach"; break;
472 tf = proto_tree_add_text(tree,
476 tf_tree = proto_item_add_subtree(tf, ett_gmm_detach_type );
478 proto_tree_add_text(tf_tree,
484 proto_tree_add_text(tf_tree,
492 /* no length check possible */
494 return(curr_offset - offset);
500 * SPLIT on CCCH, octet 3 (bit 4)
501 * 0 Split pg cycle on CCCH is not supported by the mobile station
502 * 1 Split pg cycle on CCCH is supported by the mobile station
504 static const true_false_string gsm_a_gmm_split_on_ccch_value = {
505 "Split pg cycle on CCCH is supported by the mobile station",
506 "Split pg cycle on CCCH is not supported by the mobile station"
509 /* non-DRX timer, octet 3
513 static const value_string gsm_a_gmm_non_drx_timer_strings[] = {
514 { 0x00, "no non-DRX mode after transfer state" },
515 { 0x01, "max. 1 sec non-DRX mode after transfer state" },
516 { 0x02, "max. 2 sec non-DRX mode after transfer state" },
517 { 0x03, "max. 4 sec non-DRX mode after transfer state" },
518 { 0x04, "max. 8 sec non-DRX mode after transfer state" },
519 { 0x05, "max. 16 sec non-DRX mode after transfer state" },
520 { 0x06, "max. 32 sec non-DRX mode after transfer state" },
521 { 0x07, "max. 64 sec non-DRX mode after transfer state" },
525 * CN Specific DRX cycle length coefficient, octet 3
527 * 8 7 6 5 Iu mode specific
528 * 0 0 0 0 CN Specific DRX cycle length coefficient not specified by the MS, ie. the
529 * system information value 'CN domain specific DRX cycle length' is used.
530 * (Ref 3GPP TS 25.331)
531 * 0 1 1 0 CN Specific DRX cycle length coefficient 6
532 * 0 1 1 1 CN Specific DRX cycle length coefficient 7
533 * 1 0 0 0 CN Specific DRX cycle length coefficient 8
534 * 1 0 0 1 CN Specific DRX cycle length coefficient 9
535 * All other values shall be interpreted as "CN Specific DRX cycle length coefficient not
536 * specified by the MS " by this version of the protocol.
537 * NOTE: In Iu mode this field (octet 3 bits 8 to 5) is used, but was spare in earlier
538 * versions of this protocol.
540 static const range_string gsm_a_gmm_cn_spec_drs_cycle_len_coef_strings[] = {
541 { 0x00, 0x05, "CN Specific DRX cycle length coefficient not specified by the MS" },
542 { 0x06, 0x06, "CN Specific DRX cycle length coefficient 6" },
543 { 0x07, 0x07, "CN Specific DRX cycle length coefficient 7" },
544 { 0x08, 0x08, "CN Specific DRX cycle length coefficient 8" },
545 { 0x09, 0x09, "CN Specific DRX cycle length coefficient 9" },
546 { 0x0a, 0x0f, "CN Specific DRX cycle length coefficient not specified by the MS" },
550 de_gmm_drx_param(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
555 proto_item *tf = NULL;
556 proto_tree *tf_tree = NULL;
558 curr_offset = offset;
560 tf = proto_tree_add_text(tree,
564 tf_tree = proto_item_add_subtree(tf, ett_gmm_drx );
566 oct = tvb_get_guint8(tvb, curr_offset);
570 case 0: str="704"; break;
571 case 65: str="71"; break;
572 case 66: str="72"; break;
573 case 67: str="74"; break;
574 case 68: str="75"; break;
575 case 69: str="77"; break;
576 case 70: str="79"; break;
577 case 71: str="80"; break;
578 case 72: str="83"; break;
579 case 73: str="86"; break;
580 case 74: str="88"; break;
581 case 75: str="90"; break;
582 case 76: str="92"; break;
583 case 77: str="96"; break;
584 case 78: str="101"; break;
585 case 79: str="103"; break;
586 case 80: str="107"; break;
587 case 81: str="112"; break;
588 case 82: str="116"; break;
589 case 83: str="118"; break;
590 case 84: str="128"; break;
591 case 85: str="141"; break;
592 case 86: str="144"; break;
593 case 87: str="150"; break;
594 case 88: str="160"; break;
595 case 89: str="171"; break;
596 case 90: str="176"; break;
597 case 91: str="192"; break;
598 case 92: str="214"; break;
599 case 93: str="224"; break;
600 case 94: str="235"; break;
601 case 95: str="256"; break;
602 case 96: str="288"; break;
603 case 97: str="320"; break;
604 case 98: str="352"; break;
605 default: str="Reserved, interpreted as 1";
608 proto_tree_add_text(tf_tree,
610 "Split PG Cycle Code: %s (%u)",
615 proto_tree_add_item(tf_tree, hf_gsm_a_gmm_cn_spec_drs_cycle_len_coef, tvb, curr_offset, 1, FALSE);
616 proto_tree_add_item(tf_tree, hf_gsm_a_gmm_split_on_ccch, tvb, curr_offset, 1, FALSE);
617 proto_tree_add_item(tf_tree, hf_gsm_a_gmm_non_drx_timer, tvb, curr_offset, 1, FALSE);
621 /* no length check possible */
623 return(curr_offset - offset);
627 * [9] 10.5.5.7 Force to standby (lower nibble)
629 static const range_string gsm_a_gm_force_to_standby_vals[] = {
630 { 0x00, 0x00, "Force to standby not indicated" },
631 { 0x01, 0x01, "Force to standby indicated" },
632 { 0x02, 0x07, "Unknown, interpreted as Force to standby not indicated" },
637 de_gmm_ftostby(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
641 /* IMPORTANT - IT'S ASSUMED THAT THE INFORMATION IS IN THE LOWER NIBBLE */
642 bit_offset = (offset << 3) + 4;
643 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, bit_offset, 1, FALSE);
644 proto_tree_add_bits_item(tree, hf_gsm_a_gm_force_to_standby, tvb, bit_offset + 1, 3, FALSE);
646 /* no length check possible */
651 * [9] 10.5.5.7 Force to standby (higher nibble)
654 de_gmm_ftostby_h(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
658 /* IMPORTANT - IT'S ASSUMED THAT THE INFORMATION IS IN THE HIGHER NIBBLE */
659 bit_offset = offset << 3;
660 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, bit_offset, 1, FALSE);
661 proto_tree_add_bits_item(tree, hf_gsm_a_gm_force_to_standby, tvb, bit_offset + 1, 3, FALSE);
663 /* no length check possible */
671 de_gmm_ptmsi_sig(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
674 proto_item *curr_item;
676 curr_offset = offset;
678 curr_item= proto_tree_add_item(tree,hf_gsm_a_ptmsi_sig,tvb,curr_offset,3,FALSE);
679 proto_item_append_text(curr_item,"%s",add_string ? add_string : "");
683 /* no length check possible */
685 return(curr_offset - offset);
692 de_gmm_ptmsi_sig2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len _U_)
695 proto_item *curr_item;
697 curr_offset = offset;
699 curr_item= proto_tree_add_item(tree,hf_gsm_a_ptmsi_sig2,tvb,curr_offset,3,FALSE);
700 proto_item_append_text(curr_item,"%s",add_string ? add_string : "");
703 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
705 return(curr_offset - offset);
709 * [9] 10.5.5.9 Identity type 2
711 static const value_string gsm_a_gm_type_of_identity_vals[] = {
720 de_gmm_ident_type2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
722 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (offset << 3) + 4, 1, FALSE);
723 proto_tree_add_item(tree, hf_gsm_a_gm_type_of_identity, tvb, offset, 1, FALSE);
725 /* no length check possible */
730 * [9] 10.5.5.10 IMEISV request
732 static const range_string gsm_a_gm_imeisv_req_vals[] = {
733 { 0x00, 0x00, "IMEISV not requested" },
734 { 0x01, 0x01, "IMEISV requested" },
735 { 0x02, 0x07, "Unknown, interpreted as IMEISV not requested" },
740 de_gmm_imeisv_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
744 /* IMPORTANT - IT'S ASSUMED THAT THE INFORMATION IS IN THE HIGHER NIBBLE */
745 bit_offset = offset << 3;
746 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, bit_offset, 1, FALSE);
747 proto_tree_add_bits_item(tree, hf_gsm_a_gm_imeisv_req, tvb, bit_offset + 1, 3, FALSE);
749 /* no length check possible */
757 de_gmm_rec_npdu_lst(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
763 curr_offset = offset;
765 if ( len == 0 ) return 0;
770 oct = tvb_get_guint8(tvb, curr_offset);
772 oct |= tvb_get_guint8(tvb, curr_offset+1);
776 proto_tree_add_text(tree,
778 "NSAPI %d: 0x%02x (%u)",
786 oct |= tvb_get_guint8(tvb, curr_offset+2);
790 proto_tree_add_text(tree,
791 tvb, curr_offset-1, 2,
792 "NSAPI %d: 0x%02x (%u)",
799 } while ( curr_len > 1 );
801 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
803 return(curr_offset - offset);
807 * [9] 10.5.5.12 MS network capability
809 static const true_false_string gsm_a_gmm_net_cap_gea_vals = {
810 "Encryption algorithm available",
811 "Encryption algorithm not available"
814 static const true_false_string gsm_a_gmm_net_cap_smdch_vals = {
815 "Mobile station supports mobile terminated point to point SMS via dedicated signalling channels",
816 "Mobile station does not support mobile terminated point to point SMS via dedicated signalling channels"
819 static const true_false_string gsm_a_gmm_net_cap_smgprs_vals = {
820 "Mobile station supports mobile terminated point to point SMS via GPRS packet data channels",
821 "Mobile station does not support mobile terminated point to point SMS via GPRS packet data channels"
824 static const true_false_string gsm_a_gmm_net_cap_ucs2_vals = {
825 "The ME has no preference between the use of the default alphabet and the use of UCS2",
826 "The ME has a preference for the default alphabet (defined in 3GPP TS 23.038 [8b]) over UCS2"
829 static const value_string gsm_a_gmm_net_cap_ss_scr_ind_vals[]={
830 { 0x00, "Default value of phase 1" },
831 { 0x01, "capability of handling of ellipsis notation and phase 2 error handling" },
832 { 0x02, "For future use, interpreted as Capability of handling of ellipsis notation and phase 2 error handling" },
833 { 0x03, "For future use, interpreted as Capability of handling of ellipsis notation and phase 2 error handling" },
837 static const true_false_string gsm_a_gmm_net_cap_solsa_vals = {
838 "The ME supports SoLSA",
839 "The ME does not support SoLSA"
842 static const true_false_string gsm_a_gmm_net_cap_rev_vals = {
843 "Used by a mobile station supporting R99 or later versions of the protocol",
844 "Used by a mobile station not supporting R99 or later versions of the protocol"
847 static const true_false_string gsm_a_gmm_net_cap_pfc_vals = {
848 "Mobile station does support BSS packet flow procedures",
849 "Mobile station does not support BSS packet flow procedures"
852 static const true_false_string gsm_a_gmm_net_cap_lcs_vals = {
853 "LCS value added location request notification capability supported",
854 "LCS value added location request notification capability not supported"
857 static const true_false_string gsm_a_gmm_net_cap_ps_irat_iu_vals = {
858 "PS inter-RAT HO to UTRAN Iu mode supported",
859 "PS inter-RAT HO to UTRAN Iu mode not supported"
862 static const true_false_string gsm_a_gmm_net_cap_ps_irat_s1_vals = {
863 "PS inter-RAT HO to E-UTRAN S1 mode supported",
864 "PS inter-RAT HO to E-UTRAN S1 mode not supported"
867 static const true_false_string gsm_a_gmm_net_cap_csfb_vals = {
868 "Mobile station supports CS fallback",
869 "Mobile station does not support CS fallback"
872 static const true_false_string gsm_a_gmm_net_cap_isr_vals = {
873 "The mobile station supports ISR",
874 "The mobile station does not support ISR"
877 static const true_false_string gsm_a_gmm_net_cap_srvcc_to_geran_vals = {
878 "SRVCC from UTRAN HSPA or E-UTRAN to GERAN/UTRAN supported",
879 "SRVCC from UTRAN HSPA or E-UTRAN to GERAN/UTRAN not supported"
882 static const true_false_string gsm_a_gmm_net_cap_epc_vals = {
888 de_gmm_ms_net_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
894 curr_offset = offset;
897 proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_gea1, tvb, curr_offset, 1, FALSE);
899 /* bit 7: SM capabilities via dedicated channels */
900 proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_smdch, tvb, curr_offset, 1, FALSE);
902 /* bit 6: SM capabilities via GPRS channels */
903 proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_smgprs, tvb, curr_offset, 1, FALSE);
905 /* bit 5: UCS2 support */
906 proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_ucs2, tvb, curr_offset, 1, FALSE);
908 /* bits 4 3: SS Screening Indicator */
909 proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_ss_scr_ind, tvb, curr_offset, 1, FALSE);
911 /* bit 2: SoLSA Capability */
912 proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_solsa, tvb, curr_offset, 1, FALSE);
915 proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_rev, tvb, curr_offset, 1, FALSE);
918 NO_MORE_DATA_CHECK(len);
920 /* bit 8: PFC feature mode */
921 proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_pfc, tvb, curr_offset, 1, FALSE);
923 /* bits 7 6 5 4 3 2: Extended GEA bits */
924 item = proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_ext_gea_bits, tvb, curr_offset, 1, FALSE);
925 subtree = proto_item_add_subtree(item, ett_gmm_network_cap);
926 proto_tree_add_item(subtree, hf_gsm_a_gmm_net_cap_gea2, tvb, curr_offset, 1, FALSE);
927 proto_tree_add_item(subtree, hf_gsm_a_gmm_net_cap_gea3, tvb, curr_offset, 1, FALSE);
928 proto_tree_add_item(subtree, hf_gsm_a_gmm_net_cap_gea4, tvb, curr_offset, 1, FALSE);
929 proto_tree_add_item(subtree, hf_gsm_a_gmm_net_cap_gea5, tvb, curr_offset, 1, FALSE);
930 proto_tree_add_item(subtree, hf_gsm_a_gmm_net_cap_gea6, tvb, curr_offset, 1, FALSE);
931 proto_tree_add_item(subtree, hf_gsm_a_gmm_net_cap_gea7, tvb, curr_offset, 1, FALSE);
933 /* bit 1: LCS VA capability */
934 proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_lcs, tvb, curr_offset, 1, FALSE);
937 NO_MORE_DATA_CHECK(len);
939 /* bit 8: PS inter-RAT HO to UTRAN Iu mode capability */
940 proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_ps_irat_iu, tvb, curr_offset, 1, FALSE);
942 /* bit 7: PS inter-RAT HO to E-UTRAN S1 mode capability */
943 proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_ps_irat_s1, tvb, curr_offset, 1, FALSE);
945 /* bit 6: CSFB Capability */
946 proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_csfb, tvb, curr_offset, 1, FALSE);
948 /* bit 5: ISR support */
949 proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_isr, tvb, curr_offset, 1, FALSE);
951 /* bit 4: SRVCC to GERAN/UTRAN capability */
952 proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_srvcc_to_geran, tvb, curr_offset, 1, FALSE);
954 /* bit 3: EPC capability */
955 proto_tree_add_item(tree, hf_gsm_a_gmm_net_cap_epc, tvb, curr_offset, 1, FALSE);
957 /* bits 2 1: Spare bits */
958 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+6, 2, FALSE);
961 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
963 return(curr_offset - offset);
969 #define GET_DATA /* check if we have enough bits left */ \
970 if ( curr_bits_length < bits_needed ) \
972 /* check if oct has enougth bits */ \
973 if ( bits_in_oct < bits_needed ) \
976 if ( curr_len == 0 ) \
978 proto_tree_add_text(tf_tree, \
979 tvb, curr_offset, 1, \
980 "Not enough data available"); \
982 tmp_oct = tvb_get_guint8(tvb, curr_offset); \
983 oct |= tmp_oct<<(32-8-bits_in_oct); \
986 if ( bits_in_oct != 0 ) \
995 /* Access Technology Type */
997 static const value_string gsm_a_gm_acc_tech_type_vals[] = {
999 { 0x01, "GSM E --note that GSM E covers GSM P" },
1000 { 0x02, "GSM R --note that GSM R covers GSM E and GSM P" },
1001 { 0x03, "GSM 1800" },
1002 { 0x04, "GSM 1900" },
1003 { 0x05, "GSM 450" },
1004 { 0x06, "GSM 480" },
1005 { 0x07, "GSM 850" },
1006 { 0x08, "GSM 750" },
1007 { 0x09, "GSM T 380" },
1008 { 0x0a, "GSM T 410" },
1009 { 0x0b, "GSM T 900" },
1010 { 0x0c, "GSM 710" },
1011 { 0x0d, "GSM T 810" },
1012 { 0x0f, "Indicates the presence of a list of Additional access technologies" },
1016 static const value_string gsm_a_gm_revision_level_indicator_vals[] = {
1017 { 0x00, "The ME is Release '98 or older" },
1018 { 0x01, "The ME is Release '99 onwards" },
1023 de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1025 guint32 curr_offset;
1028 proto_item *tf = NULL;
1029 proto_tree *tf_tree = NULL;
1034 guint add_ocetets; /* octets which are covered by one element -1 */
1035 guint curr_bits_length;
1039 /** XXX: AFAIT only the first 32 entries of the following are actually used. Is this a bug someplace ?? */
1040 static const gchar *multi_slot_str[64] = {
1041 "Not specified", /* 00 */
1042 "Max Rx-Slot/TDMA:1 Max Tx-Slot/TDMA:1 Max-Sum-Slot/TDMA:2 Tta:3 Ttb:2 Tra:4 Trb:2 Type:1", /* 01 */
1043 "Max Rx-Slot/TDMA:2 Max Tx-Slot/TDMA:1 Max-Sum-Slot/TDMA:3 Tta:3 Ttb:2 Tra:3 Trb:1 Type:1", /* 02 */
1044 "Max Rx-Slot/TDMA:2 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:3 Tta:3 Ttb:2 Tra:3 Trb:1 Type:1", /* 03 */
1045 "Max Rx-Slot/TDMA:3 Max Tx-Slot/TDMA:1 Max-Sum-Slot/TDMA:4 Tta:3 Ttb:1 Tra:3 Trb:1 Type:1", /* 04 */
1046 "Max Rx-Slot/TDMA:2 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:4 Tta:3 Ttb:1 Tra:3 Trb:1 Type:1", /* 05 */
1047 "Max Rx-Slot/TDMA:3 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:4 Tta:3 Ttb:1 Tra:3 Trb:1 Type:1", /* 06 */
1048 "Max Rx-Slot/TDMA:3 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:4 Tta:3 Ttb:1 Tra:3 Trb:1 Type:1", /* 07 */
1049 "Max Rx-Slot/TDMA:4 Max Tx-Slot/TDMA:1 Max-Sum-Slot/TDMA:5 Tta:3 Ttb:1 Tra:2 Trb:1 Type:1", /* 08 */
1050 "Max Rx-Slot/TDMA:3 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:5 Tta:3 Ttb:1 Tra:2 Trb:1 Type:1", /* 09 */
1051 "Max Rx-Slot/TDMA:4 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:5 Tta:3 Ttb:1 Tra:2 Trb:1 Type:1", /* 10 */
1052 "Max Rx-Slot/TDMA:4 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:5 Tta:3 Ttb:1 Tra:2 Trb:1 Type:1", /* 11 */
1053 "Max Rx-Slot/TDMA:4 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:5 Tta:2 Ttb:1 Tra:2 Trb:1 Type:1", /* 12 */
1054 "Max Rx-Slot/TDMA:3 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:NA Tta:NA Ttb:a) Tra:3 Trb:a) Type:2 (a: 1 with frequency hopping, 0 otherwise)", /* 13 */
1055 "Max Rx-Slot/TDMA:4 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:NA Tta:NA Ttb:a) Tra:3 Trb:a) Type:2 (a: 1 with frequency hopping, 0 otherwise)", /* 14 */
1056 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:5 Max-Sum-Slot/TDMA:NA Tta:NA Ttb:a) Tra:3 Trb:a) Type:2 (a: 1 with frequency hopping, 0 otherwise)", /* 15 */
1057 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:6 Max-Sum-Slot/TDMA:NA Tta:NA Ttb:a) Tra:2 Trb:a) Type:2 (a: 1 with frequency hopping, 0 otherwise)", /* 16 */
1058 "Max Rx-Slot/TDMA:7 Max Tx-Slot/TDMA:7 Max-Sum-Slot/TDMA:NA Tta:NA Ttb:a) Tra:1 Trb:0 Type:2 (a: 1 with frequency hopping, 0 otherwise)", /* 17 */
1059 "Max Rx-Slot/TDMA:8 Max Tx-Slot/TDMA:8 Max-Sum-Slot/TDMA:NA Tta:NA Ttb:0 Tra:0 Trb:0 Type:2", /* 18 */
1060 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 19 */
1061 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 20 */
1062 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 21 */
1063 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 22 */
1064 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:6 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 23 */
1065 "Max Rx-Slot/TDMA:8 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 24 */
1066 "Max Rx-Slot/TDMA:8 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 25 */
1067 "Max Rx-Slot/TDMA:8 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 26 */
1068 "Max Rx-Slot/TDMA:8 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 27 */
1069 "Max Rx-Slot/TDMA:8 Max Tx-Slot/TDMA:6 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 28 */
1070 "Max Rx-Slot/TDMA:8 Max Tx-Slot/TDMA:8 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 29 */
1071 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:1 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1 Trb:1 Type:1", /* 30 */
1072 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1 Trb:1 Type:1", /* 31 */
1073 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1 Trb:1 Type:1", /* 32 */
1074 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1 Trb:1 Type:1", /* 33 */
1075 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:5 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1 Trb:1 Type:1", /* 34 */
1076 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:1 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1+to Trb:1 Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 35 */
1077 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1+to Trb:1 Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 36 */
1078 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1+to Trb:1 Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 37 */
1079 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1+to Trb:1 Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 38 */
1080 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:5 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1+to Trb:1 Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 39 */
1081 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:1 Max-Sum-Slot/TDMA:7 Tta:1 Ttb:1 Tra:1 Trb:to Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 40 */
1082 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:7 Tta:1 Ttb:1 Tra:1 Trb:to Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 41 */
1083 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:7 Tta:1 Ttb:1 Tra:1 Trb:to Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 42 */
1084 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:7 Tta:1 Ttb:1 Tra:1 Trb:to Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 43 */
1085 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:5 Max-Sum-Slot/TDMA:7 Tta:1 Ttb:1 Tra:1 Trb:to Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 44 */
1086 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:6 Max-Sum-Slot/TDMA:7 Tta:1 Ttb:1 Tra:1 Trb:to Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 45 */
1087 "Not specified", /* 46 */
1088 "Not specified", /* 47 */
1089 "Not specified", /* 48 */
1090 "Not specified", /* 49 */
1091 "Not specified", /* 50 */
1092 "Not specified", /* 51 */
1093 "Not specified", /* 52 */
1094 "Not specified", /* 53 */
1095 "Not specified", /* 54 */
1096 "Not specified", /* 55 */
1097 "Not specified", /* 56 */
1098 "Not specified", /* 57 */
1099 "Not specified", /* 58 */
1100 "Not specified", /* 59 */
1101 "Not specified", /* 60 */
1102 "Not specified", /* 61 */
1103 "Not specified", /* 62 */
1104 "Not specified", /* 63 */
1107 guchar dtm_gprs_mslot = 0;
1108 guchar dtm_egprs_mslot = 4;
1109 gboolean finished = TRUE;
1112 curr_offset = offset;
1113 bit_offset = offset<<3;
1121 /* check for a new round */
1122 if (( curr_len*8 + bits_in_oct ) < 11 )
1125 /* now read the first 11 bits */
1126 curr_bits_length = 11;
1130 if ( curr_len != len )
1135 if (( oct>>(32-bits_needed) ) == 1 )
1137 curr_bits_length -= bits_needed;
1138 oct <<= bits_needed;
1139 bits_in_oct -= bits_needed;
1141 if (( curr_len*8 + bits_in_oct ) < 11 )
1143 curr_bits_length = 11;
1147 curr_bits_length -= bits_needed;
1148 oct <<= bits_needed;
1149 bits_in_oct -= bits_needed;
1155 tf = proto_tree_add_text(tree,
1156 tvb, curr_offset, 1,
1157 "MS RA capability %d",indx);
1159 tf_tree = proto_item_add_subtree(tf, ett_gmm_radio_cap );
1167 acc_type = oct>>(32-bits_needed);
1169 proto_tree_add_bits_item(tf_tree, hf_gsm_a_gm_acc_tech_type, tvb, bit_offset, 4, FALSE);
1172 curr_bits_length -= bits_needed;
1173 oct <<= bits_needed;
1174 bits_in_oct -= bits_needed;
1176 /* < Access capabilities struct > ::= */
1183 bits_length = curr_bits_length = oct>>(32-bits_needed);
1184 proto_tree_add_bits_item(tf_tree, hf_gsm_a_gm_acc_cap_struct_len, tvb, bit_offset, 7, FALSE);
1185 proto_item_set_len(tf, (bits_length>>3)+1);
1186 /* This is already done - length doesn't contain this field
1187 curr_bits_length -= bits_needed;
1190 oct <<= bits_needed;
1191 bits_in_oct -= bits_needed;
1193 if ( acc_type == 0x0f )
1198 * Additional access technologies:
1200 finished = TRUE; /* Break out of the loop unless proven unfinished */
1209 switch ( oct>>(32-bits_needed) )
1211 case 0x00: str="Not Present"; finished = TRUE; break;
1212 case 0x01: str="Present"; finished = FALSE; break;
1213 default: str="This should not happen";
1216 proto_tree_add_text(tf_tree,
1217 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1218 "Presence: %s (%u)", str, oct>>(32-bits_needed));
1220 curr_bits_length -= bits_needed;
1221 oct <<= bits_needed;
1222 bits_in_oct -= bits_needed;
1227 * No more valid data, get spare bits if any
1229 while ( curr_bits_length > 0 )
1231 if ( curr_bits_length > 8 )
1234 bits_needed = curr_bits_length;
1236 curr_bits_length -= bits_needed;
1237 oct <<= bits_needed;
1238 bits_in_oct -= bits_needed;
1239 bit_offset+= bits_needed;
1250 acc_type = oct>>(32-bits_needed);
1252 proto_tree_add_bits_item(tf_tree, hf_gsm_a_gm_acc_cap_struct_len, tvb, bit_offset, 7, FALSE);
1255 curr_bits_length -= bits_needed;
1256 oct <<= bits_needed;
1257 bits_in_oct -= bits_needed;
1265 value = tvb_get_bits8(tvb, bit_offset, 3);
1267 if ( acc_type == 0x04 ) /* GSM 1900 */
1271 case 0x01: str="1 W (30 dBm)"; break;
1272 case 0x02: str="0,25 W (24 dBm)"; break;
1273 case 0x03: str="2 W (33 dBm)"; break;
1274 default: str="Not specified";
1277 else if ( acc_type == 0x03 )
1284 case 0x01: str="1 W (30 dBm)"; break;
1285 case 0x02: str="0,25 W (24 dBm)"; break;
1286 case 0x03: str="4 W (36 dBm)"; break;
1287 default: str="Not specified";
1290 else if ( acc_type <= 0x08 )
1302 case 0x02: str="8 W (39 dBm)"; break;
1303 case 0x03: str="5 W (37 dBm)"; break;
1304 case 0x04: str="2 W (33 dBm)"; break;
1305 case 0x05: str="0,8 W (29 dBm)"; break;
1306 default: str="Not specified";
1310 str="Not specified??";
1312 /* decode_bits_in_field(gint bit_offset, gint no_of_bits, guint64 value)*/
1313 proto_tree_add_text(tf_tree,
1314 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1315 "%s RF Power Capability, GMSK Power Class: %s (%u)", decode_bits_in_field(bit_offset, 3, value), str, value);
1317 curr_bits_length -= bits_needed;
1318 oct <<= bits_needed;
1319 bits_in_oct -= bits_needed;
1327 value = tvb_get_bits8(tvb, bit_offset, 2);
1331 case 0x00: str="8PSK modulation not supported for uplink"; break;
1332 case 0x01: str="Power class E1"; break;
1333 case 0x02: str="Power class E2"; break;
1334 case 0x03: str="Power class E3"; break;
1335 default: str="This should not happen";
1338 proto_tree_add_text(tf_tree,
1339 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1340 "8PSK Power Class: %s (%u)",str,value);
1342 curr_bits_length -= bits_needed;
1343 oct <<= bits_needed;
1344 bits_in_oct -= bits_needed;
1346 } while (!finished);
1357 value = tvb_get_bits8(tvb, bit_offset, 3);
1359 if ( acc_type == 0x04 ) /* GSM 1900 */
1363 case 0x01: str="1 W (30 dBm)"; break;
1364 case 0x02: str="0,25 W (24 dBm)"; break;
1365 case 0x03: str="2 W (33 dBm)"; break;
1366 default: str="Not specified";
1369 else if ( acc_type == 0x03 )
1373 case 0x01: str="1 W (30 dBm)"; break;
1374 case 0x02: str="0,25 W (24 dBm)"; break;
1375 case 0x03: str="4 W (36 dBm)"; break;
1376 default: str="Not specified";
1379 else if ( acc_type <= 0x08 )
1383 case 0x02: str="8 W (39 dBm)"; break;
1384 case 0x03: str="5 W (37 dBm)"; break;
1385 case 0x04: str="2 W (33 dBm)"; break;
1386 case 0x05: str="0,8 W (29 dBm)"; break;
1387 default: str="Not specified";
1391 str="Not specified??";
1393 proto_tree_add_text(tf_tree,
1394 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1395 "%s RF Power Capability, GMSK Power Class: %s (%u)", decode_bits_in_field(bit_offset, 3, value),str,value);
1398 curr_bits_length -= bits_needed;
1399 oct <<= bits_needed;
1400 bits_in_oct -= bits_needed;
1409 if ((oct>>(32-bits_needed))==0)
1411 proto_tree_add_text(tf_tree,
1412 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1413 "A5 Bits: Same values apply for parameters as in the immediately preceding Access capabilities field within this IE (%u)",oct>>(32-bits_needed));
1415 curr_bits_length -= bits_needed;
1416 oct <<= bits_needed;
1417 bits_in_oct -= bits_needed;
1423 proto_tree_add_text(tf_tree,
1424 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1425 "A5 Bits: A5 bits follow (%u)",oct>>(32-bits_needed));
1428 curr_bits_length -= bits_needed;
1429 oct <<= bits_needed;
1430 bits_in_oct -= bits_needed;
1432 for (i=1; i<= 7 ; i++ )
1441 switch ( oct>>(32-bits_needed) )
1443 case 0x00: str="encryption algorithm not available"; break;
1444 case 0x01: str="encryption algorithm available"; break;
1445 default: str="This should not happen";
1448 proto_tree_add_text(tf_tree,
1449 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1450 "A5/%d: %s (%u)",i,str,oct>>(32-bits_needed));
1452 curr_bits_length -= bits_needed;
1453 oct <<= bits_needed;
1454 bits_in_oct -= bits_needed;
1465 switch ( oct>>(32-bits_needed) )
1467 case 0x00: str="controlled early Classmark Sending option is not implemented"; break;
1468 case 0x01: str="controlled early Classmark Sending option is implemented"; break;
1469 default: str="This should not happen";
1472 proto_tree_add_text(tf_tree,
1473 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1474 "Controlled early Classmark Sending: %s (%u)",str,oct>>(32-bits_needed));
1476 curr_bits_length -= bits_needed;
1477 oct <<= bits_needed;
1478 bits_in_oct -= bits_needed;
1487 switch ( oct>>(32-bits_needed) )
1489 case 0x00: str="PS capability not present"; break;
1490 case 0x01: str="PS capability present"; break;
1491 default: str="This should not happen";
1494 proto_tree_add_text(tf_tree,
1495 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1496 "Pseudo Synchronisation: %s (%u)",str,oct>>(32-bits_needed));
1498 curr_bits_length -= bits_needed;
1499 oct <<= bits_needed;
1500 bits_in_oct -= bits_needed;
1509 switch ( oct>>(32-bits_needed) )
1511 case 0x00: str="no VGCS capability or no notifications wanted"; break;
1512 case 0x01: str="VGCS capability and notifications wanted"; break;
1513 default: str="This should not happen";
1516 proto_tree_add_text(tf_tree,
1517 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1518 "Voice Group Call Service: %s (%u)",str,oct>>(32-bits_needed));
1520 curr_bits_length -= bits_needed;
1521 oct <<= bits_needed;
1522 bits_in_oct -= bits_needed;
1531 switch ( oct>>(32-bits_needed) )
1533 case 0x00: str="no VBS capability or no notifications wanted"; break;
1534 case 0x01: str="VBS capability and notifications wanted"; break;
1535 default: str="This should not happen";
1538 proto_tree_add_text(tf_tree,
1539 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1540 "Voice Broadcast Service: %s (%u)",str,oct>>(32-bits_needed));
1542 curr_bits_length -= bits_needed;
1543 oct <<= bits_needed;
1544 bits_in_oct -= bits_needed;
1547 * Multislot capability?
1553 if ((oct>>(32-bits_needed))==0)
1555 proto_tree_add_text(tf_tree,
1556 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1557 "Multislot capability: Same values apply for parameters as in the immediately preceding Access capabilities field within this IE (%u)",oct>>(32-bits_needed));
1559 curr_bits_length -= bits_needed;
1560 oct <<= bits_needed;
1561 bits_in_oct -= bits_needed;
1565 proto_tree_add_text(tf_tree,
1566 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1567 "Multislot capability: Multislot capability struct available (%u)",oct>>(32-bits_needed));
1570 curr_bits_length -= bits_needed;
1571 oct <<= bits_needed;
1572 bits_in_oct -= bits_needed;
1575 * HSCSD multislot class?
1581 if ((oct>>(32-bits_needed))==0)
1583 proto_tree_add_text(tf_tree,
1584 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1585 "HSCSD multislot class: Bits are not available (%u)",oct>>(32-bits_needed));
1587 curr_bits_length -= bits_needed;
1588 oct <<= bits_needed;
1589 bits_in_oct -= bits_needed;
1593 curr_bits_length -= bits_needed;
1594 oct <<= bits_needed;
1595 bits_in_oct -= bits_needed;
1599 * HSCSD multislot class
1605 proto_tree_add_text(tf_tree,
1606 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1607 "HSCSD multislot class: %s (%u)",multi_slot_str[oct>>(32-bits_needed)],oct>>(32-bits_needed));
1609 curr_bits_length -= bits_needed;
1610 oct <<= bits_needed;
1611 bits_in_oct -= bits_needed;
1615 * GPRS multislot class?
1621 if ((oct>>(32-bits_needed))==0)
1623 proto_tree_add_text(tf_tree,
1624 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1625 "GPRS multislot class: Bits are not available (%u)",oct>>(32-bits_needed));
1627 curr_bits_length -= bits_needed;
1628 oct <<= bits_needed;
1629 bits_in_oct -= bits_needed;
1633 curr_bits_length -= bits_needed;
1634 oct <<= bits_needed;
1635 bits_in_oct -= bits_needed;
1639 * GPRS multislot class
1645 proto_tree_add_text(tf_tree,
1646 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1647 "GPRS multislot class: %s (%u)",multi_slot_str[oct>>(32-bits_needed)],oct>>(32-bits_needed));
1649 curr_bits_length -= bits_needed;
1650 oct <<= bits_needed;
1651 bits_in_oct -= bits_needed;
1654 * GPRS Extended Dynamic Allocation Capability
1660 switch ( oct>>(32-bits_needed) )
1662 case 0x00: str="Extended Dynamic Allocation Capability for GPRS is not implemented"; break;
1663 case 0x01: str="Extended Dynamic Allocation Capability for GPRS is implemented"; break;
1664 default: str="This should not happen";
1666 proto_tree_add_text(tf_tree,
1667 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1668 "GPRS Extended Dynamic Allocation Capability: %s (%u)",str,oct>>(32-bits_needed));
1670 curr_bits_length -= bits_needed;
1671 oct <<= bits_needed;
1672 bits_in_oct -= bits_needed;
1682 if ((oct>>(32-bits_needed))==0)
1684 proto_tree_add_text(tf_tree,
1685 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1686 "SMS/SM values: Bits are not available (%u)",oct>>(32-bits_needed));
1688 curr_bits_length -= bits_needed;
1689 oct <<= bits_needed;
1690 bits_in_oct -= bits_needed;
1694 curr_bits_length -= bits_needed;
1695 oct <<= bits_needed;
1696 bits_in_oct -= bits_needed;
1700 * Switch-Measure-Switch value
1706 proto_tree_add_bits_item(tf_tree, hf_gsm_a_gm_sms_value, tvb, bit_offset, 4, FALSE);
1708 curr_bits_length -= bits_needed;
1709 oct <<= bits_needed;
1710 bits_in_oct -= bits_needed;
1713 * Switch-Measure value
1719 proto_tree_add_bits_item(tf_tree, hf_gsm_a_gm_sm_value, tvb, bit_offset, 4, FALSE);
1721 curr_bits_length -= bits_needed;
1722 oct <<= bits_needed;
1723 bits_in_oct -= bits_needed;
1727 * ECSD multislot class?
1733 if ((oct>>(32-bits_needed))==0)
1735 proto_tree_add_text(tf_tree,
1736 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1737 "ECSD multislot class: Bits are not available (%u)",oct>>(32-bits_needed));
1739 curr_bits_length -= bits_needed;
1740 oct <<= bits_needed;
1741 bits_in_oct -= bits_needed;
1745 curr_bits_length -= bits_needed;
1746 oct <<= bits_needed;
1747 bits_in_oct -= bits_needed;
1751 * ECSD multislot class
1757 proto_tree_add_text(tf_tree,
1758 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1759 "ECSD multislot class: %s (%u)",multi_slot_str[oct>>(32-bits_needed)],oct>>(32-bits_needed));
1761 curr_bits_length -= bits_needed;
1762 oct <<= bits_needed;
1763 bits_in_oct -= bits_needed;
1767 * EGPRS multislot class?
1773 if ((oct>>(32-bits_needed))==0)
1775 proto_tree_add_text(tf_tree,
1776 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1777 "EGPRS multislot class: Bits are not available (%u)",oct>>(32-bits_needed));
1778 curr_bits_length -= bits_needed;
1779 oct <<= bits_needed;
1780 bits_in_oct -= bits_needed;
1785 curr_bits_length -= bits_needed;
1786 oct <<= bits_needed;
1787 bits_in_oct -= bits_needed;
1791 * EGPRS multislot class
1797 proto_tree_add_text(tf_tree,
1798 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1799 "EGPRS multislot class: %s (%u)",multi_slot_str[oct>>(32-bits_needed)],oct>>(32-bits_needed));
1801 curr_bits_length -= bits_needed;
1802 oct <<= bits_needed;
1803 bits_in_oct -= bits_needed;
1806 * EGPRS Extended Dynamic Allocation Capability
1812 switch ( oct>>(32-bits_needed) )
1814 case 0x00: str="Extended Dynamic Allocation Capability for EGPRS is not implemented"; break;
1815 case 0x01: str="Extended Dynamic Allocation Capability for EGPRS is implemented"; break;
1816 default: str="This should not happen";
1818 proto_tree_add_text(tf_tree,
1819 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1820 "EGPRS Extended Dynamic Allocation Capability: %s (%u)",str, oct>>(32-bits_needed));
1822 curr_bits_length -= bits_needed;
1823 oct <<= bits_needed;
1824 bits_in_oct -= bits_needed;
1828 * DTM GPRS Multi Slot Class ?
1834 if ((oct>>(32-bits_needed))==0)
1836 proto_tree_add_text(tf_tree,
1837 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1838 "DTM GPRS Multi Slot Class: Bits are not available (%u)",oct>>(32-bits_needed));
1840 curr_bits_length -= bits_needed;
1841 oct <<= bits_needed;
1842 bits_in_oct -= bits_needed;
1846 curr_bits_length -= bits_needed;
1847 oct <<= bits_needed;
1848 bits_in_oct -= bits_needed;
1852 * DTM GPRS Multi Slot Class
1858 dtm_gprs_mslot = oct>>(32-bits_needed);
1860 switch ( oct>>(32-bits_needed) )
1862 case 0: str="Unused. If received, the network shall interpret this as Multislot class 5"; break;
1863 case 1: str="Multislot class 5 supported"; break;
1864 case 2: str="Multislot class 9 supported"; break;
1865 case 3: str="Multislot class 11 supported"; break;
1866 default: str="This should not happen";
1869 proto_tree_add_text(tf_tree,
1870 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1871 "DTM GPRS Multi Slot Class: %s (%u)",str,oct>>(32-bits_needed));
1873 curr_bits_length -= bits_needed;
1874 oct <<= bits_needed;
1875 bits_in_oct -= bits_needed;
1884 switch ( oct>>(32-bits_needed) )
1886 case 0x00: str="Single Slot DTM not supported"; break;
1887 case 0x01: str="Single Slot DTM supported"; break;
1888 default: str="This should not happen";
1890 proto_tree_add_text(tf_tree,
1891 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1892 "Single Slot DTM: %s (%u)",str,oct>>(32-bits_needed));
1894 curr_bits_length -= bits_needed;
1895 oct <<= bits_needed;
1896 bits_in_oct -= bits_needed;
1899 * DTM EGPRS Multi Slot Class ?
1905 dtm_egprs_mslot = oct>>(32-bits_needed);
1907 if ((oct>>(32-bits_needed))==0)
1909 proto_tree_add_text(tf_tree,
1910 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1911 "DTM EGPRS Multi Slot Class: Bits are not available (%u)",oct>>(32-bits_needed));
1913 curr_bits_length -= bits_needed;
1914 oct <<= bits_needed;
1915 bits_in_oct -= bits_needed;
1919 curr_bits_length -= bits_needed;
1920 oct <<= bits_needed;
1921 bits_in_oct -= bits_needed;
1925 * DTM EGPRS Multi Slot Class
1931 switch ( oct>>(32-bits_needed) )
1933 case 0: str="Unused. If received, the network shall interpret this as Multislot class 5"; break;
1934 case 1: str="Multislot class 5 supported"; break;
1935 case 2: str="Multislot class 9 supported"; break;
1936 case 3: str="Multislot class 11 supported"; break;
1937 default: str="This should not happen";
1940 proto_tree_add_text(tf_tree,
1941 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1942 "DTM EGPRS Multi Slot Class: %s (%u)",str,oct>>(32-bits_needed));
1944 curr_bits_length -= bits_needed;
1945 oct <<= bits_needed;
1946 bits_in_oct -= bits_needed;
1952 * 8PSK Power Capability?
1958 if ((oct>>(32-bits_needed))==0)
1960 proto_tree_add_text(tf_tree,
1961 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1962 "8PSK Power Capability: Bits are not available (%u)",oct>>(32-bits_needed));
1964 curr_bits_length -= bits_needed;
1965 oct <<= bits_needed;
1966 bits_in_oct -= bits_needed;
1970 curr_bits_length -= bits_needed;
1971 oct <<= bits_needed;
1972 bits_in_oct -= bits_needed;
1976 * 8PSK Power Capability
1982 switch ( oct>>(32-bits_needed) )
1984 case 0x00: str="Reserved"; break;
1985 case 0x01: str="Power class E1"; break;
1986 case 0x02: str="Power class E2"; break;
1987 case 0x03: str="Power class E3"; break;
1988 default: str="This should not happen";
1991 proto_tree_add_text(tf_tree,
1992 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1993 "8PSK Power Capability: %s (%u)",str,oct>>(32-bits_needed));
1995 curr_bits_length -= bits_needed;
1996 oct <<= bits_needed;
1997 bits_in_oct -= bits_needed;
2001 * COMPACT Interference Measurement Capability
2007 switch ( oct>>(32-bits_needed) )
2009 case 0x00: str="COMPACT Interference Measurement Capability is not implemented"; break;
2010 case 0x01: str="COMPACT Interference Measurement Capability is implemented"; break;
2011 default: str="This should not happen";
2014 proto_tree_add_text(tf_tree,
2015 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2016 "COMPACT Interference Measurement Capability: %s (%u)", str, oct>>(32-bits_needed));
2018 curr_bits_length -= bits_needed;
2019 oct <<= bits_needed;
2020 bits_in_oct -= bits_needed;
2023 * Revision Level Indicator
2028 proto_tree_add_bits_item(tf_tree, hf_gsm_a_gm_rel_lev_ind, tvb, bit_offset, 1, FALSE);
2030 curr_bits_length -= bits_needed;
2031 oct <<= bits_needed;
2032 bits_in_oct -= bits_needed;
2035 * UMTS FDD Radio Access Technology Capability
2041 switch ( oct>>(32-bits_needed) )
2043 case 0x00: str="UMTS FDD not supported"; break;
2044 case 0x01: str="UMTS FDD supported"; break;
2045 default: str="This should not happen";
2048 proto_tree_add_text(tf_tree,
2049 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2050 "UMTS FDD Radio Access Technology Capability: %s (%u)",str,oct>>(32-bits_needed));
2052 curr_bits_length -= bits_needed;
2053 oct <<= bits_needed;
2054 bits_in_oct -= bits_needed;
2057 * UMTS 3.84 Mcps TDD Radio Access Technology Capability
2063 switch ( oct>>(32-bits_needed) )
2065 case 0x00: str="UMTS 3.84 Mcps TDD not supported"; break;
2066 case 0x01: str="UMTS 3.84 Mcps TDD supported"; break;
2067 default: str="This should not happen";
2070 proto_tree_add_text(tf_tree,
2071 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2072 "UMTS 3.84 Mcps TDD Radio Access Technology Capability: %s (%u)",str,oct>>(32-bits_needed));
2074 curr_bits_length -= bits_needed;
2075 oct <<= bits_needed;
2076 bits_in_oct -= bits_needed;
2079 * CDMA 2000 Radio Access Technology Capability
2085 switch ( oct>>(32-bits_needed) )
2087 case 0x00: str="CDMA 2000 not supported"; break;
2088 case 0x01: str="CDMA 2000 supported"; break;
2089 default: str="This should not happen";
2092 proto_tree_add_text(tf_tree,
2093 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2094 "CDMA 2000 Radio Access Technology Capability: %s (%u)",str,oct>>(32-bits_needed));
2096 curr_bits_length -= bits_needed;
2097 oct <<= bits_needed;
2098 bits_in_oct -= bits_needed;
2101 * UMTS 1.28 Mcps TDD Radio Access Technology Capability
2107 switch ( oct>>(32-bits_needed) )
2109 case 0x00: str="UMTS 1.28 Mcps TDD not supported"; break;
2110 case 0x01: str="UMTS 1.28 Mcps TDD supported"; break;
2111 default: str="This should not happen";
2114 proto_tree_add_text(tf_tree,
2115 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2116 "UMTS 1.28 Mcps TDD Radio Access Technology Capability: %s (%u)",str,oct>>(32-bits_needed));
2118 curr_bits_length -= bits_needed;
2119 oct <<= bits_needed;
2120 bits_in_oct -= bits_needed;
2123 * GERAN Feature Package 1
2129 switch ( oct>>(32-bits_needed) )
2131 case 0x00: str="GERAN feature package 1 not supported"; break;
2132 case 0x01: str="GERAN feature package 1 supported"; break;
2133 default: str="This should not happen";
2136 proto_tree_add_text(tf_tree,
2137 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2138 "GERAN Feature Package 1: %s (%u)",str,oct>>(32-bits_needed));
2140 curr_bits_length -= bits_needed;
2141 oct <<= bits_needed;
2142 bits_in_oct -= bits_needed;
2145 * Extended DTM (E)GPRS Multi Slot Class
2151 if ((oct>>(32-bits_needed))==0)
2153 proto_tree_add_text(tf_tree,
2154 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2155 "Extended DTM (E)GPRS Multi Slot Class: Bits are not available (%u)",oct>>(32-bits_needed));
2156 curr_bits_length -= bits_needed;
2157 oct <<= bits_needed;
2158 bits_in_oct -= bits_needed;
2163 curr_bits_length -= bits_needed;
2164 oct <<= bits_needed;
2165 bits_in_oct -= bits_needed;
2168 * Extended DTM GPRS Multi Slot Class
2174 switch ( (oct>>(32-bits_needed))|(dtm_gprs_mslot<<4) )
2176 case 0x00: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2177 case 0x01: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2178 case 0x02: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2179 case 0x03: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2180 case 0x10: str="Multislot class 5 supported"; break;
2181 case 0x11: str="Multislot class 6 supported"; break;
2182 case 0x12: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2183 case 0x13: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2184 case 0x20: str="Multislot class 9 supported"; break;
2185 case 0x21: str="Multislot class 10 supported"; break;
2186 case 0x22: str="Unused. If received, it shall be interpreted as Multislot class 9 supported"; break;
2187 case 0x23: str="Unused. If received, it shall be interpreted as Multislot class 9 supported"; break;
2188 case 0x30: str="Multislot class 11 supported"; break;
2189 case 0x31: str="Unused. If received, it shall be interpreted as Multislot class 11 supported"; break;
2190 case 0x32: str="Unused. If received, it shall be interpreted as Multislot class 11 supported"; break;
2191 case 0x33: str="Unused. If received, it shall be interpreted as Multislot class 11 supported"; break;
2192 default: str="This should not happen";
2195 proto_tree_add_text(tf_tree,
2196 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2197 "Extended DTM GPRS Multi Slot Class: %s (%u)",str,oct>>(32-bits_needed));
2199 curr_bits_length -= bits_needed;
2200 oct <<= bits_needed;
2201 bits_in_oct -= bits_needed;
2203 if ( dtm_egprs_mslot <= 3 )
2206 * Extended DTM EGPRS Multi Slot Class
2212 switch ( (oct>>(32-bits_needed))|(dtm_egprs_mslot<<4) )
2214 case 0x00: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2215 case 0x01: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2216 case 0x02: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2217 case 0x03: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2218 case 0x10: str="Multislot class 5 supported"; break;
2219 case 0x11: str="Multislot class 6 supported"; break;
2220 case 0x12: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2221 case 0x13: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2222 case 0x20: str="Multislot class 9 supported"; break;
2223 case 0x21: str="Multislot class 10 supported"; break;
2224 case 0x22: str="Unused. If received, it shall be interpreted as Multislot class 9 supported"; break;
2225 case 0x23: str="Unused. If received, it shall be interpreted as Multislot class 9 supported"; break;
2226 case 0x30: str="Multislot class 11 supported"; break;
2227 case 0x31: str="Unused. If received, it shall be interpreted as Multislot class 11 supported"; break;
2228 case 0x32: str="Unused. If received, it shall be interpreted as Multislot class 11 supported"; break;
2229 case 0x33: str="Unused. If received, it shall be interpreted as Multislot class 11 supported"; break;
2230 default: str="This should not happen";
2233 proto_tree_add_text(tf_tree,
2234 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2235 "Extended DTM EGPRS Multi Slot Class: %s (%u)",str, oct>>(32-bits_needed));
2237 curr_bits_length -= bits_needed;
2238 oct <<= bits_needed;
2239 bits_in_oct -= bits_needed;
2244 * Modulation based multislot class support
2250 switch ( oct>>(32-bits_needed) )
2252 case 0x00: str="Modulation based multislot class not supported"; break;
2253 case 0x01: str="Modulation based multislot class supported"; break;
2254 default: str="This should not happen";
2257 proto_tree_add_text(tf_tree,
2258 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2259 "Modulation based multislot class support: %s (%u)",str,oct>>(32-bits_needed));
2261 curr_bits_length -= bits_needed;
2262 oct <<= bits_needed;
2263 bits_in_oct -= bits_needed;
2266 * High Multislot Capability
2272 if ((oct>>(32-bits_needed))==0)
2274 proto_tree_add_text(tf_tree,
2275 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2276 "High Multislot Capability: Bits are not available (%u)",oct>>(32-bits_needed));
2278 curr_bits_length -= bits_needed;
2279 oct <<= bits_needed;
2280 bits_in_oct -= bits_needed;
2284 curr_bits_length -= bits_needed;
2285 oct <<= bits_needed;
2286 bits_in_oct -= bits_needed;
2290 * High Multislot Capability
2296 proto_tree_add_text(tf_tree,
2297 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2298 "High Multislot Capability: 0x%02x (%u)"
2299 " - This field effect all other multislot fields."
2300 " To understand the value please read TS 24.008 5.6.0"
2301 " Release 5 Chap 10.5.5.12 Page 406",
2302 oct>>(32-bits_needed),
2303 oct>>(32-bits_needed));
2305 curr_bits_length -= bits_needed;
2306 oct <<= bits_needed;
2307 bits_in_oct -= bits_needed;
2311 * GERAN Iu Mode Capability
2317 switch ( oct>>(32-bits_needed) )
2319 case 0x00: str="GERAN Iu mode not supported"; break;
2320 case 0x01: str="GERAN Iu mode supported"; break;
2321 default: str="This should not happen";
2324 proto_tree_add_text(tf_tree,
2325 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2326 "GERAN Iu Mode Capability: %s (%u)",str,oct>>(32-bits_needed));
2328 curr_bits_length -= bits_needed;
2329 oct <<= bits_needed;
2330 bits_in_oct -= bits_needed;
2333 * GMSK/8-PSK Multislot Power Profile
2339 if ((oct>>(32-bits_needed))==0)
2341 proto_tree_add_text(tf_tree,
2342 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2343 "GMSK/8-PSK Multislot Power Profile: Bits are not available (%u)",oct>>(32-bits_needed));
2345 curr_bits_length -= bits_needed;
2346 oct <<= bits_needed;
2347 bits_in_oct -= bits_needed;
2351 curr_bits_length -= bits_needed;
2352 oct <<= bits_needed;
2353 bits_in_oct -= bits_needed;
2357 * GMSK Multislot Power Profile
2363 switch ( oct>>(32-bits_needed) )
2365 case 0x00: str="GMSK_MULTISLOT_POWER_PROFILE 0"; break;
2366 case 0x01: str="GMSK_MULTISLOT_POWER_PROFILE 1"; break;
2367 case 0x02: str="GMSK_MULTISLOT_POWER_PROFILE 2"; break;
2368 case 0x03: str="GMSK_MULTISLOT_POWER_PROFILE 3"; break;
2369 default: str="This should not happen";
2372 proto_tree_add_text(tf_tree,
2373 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2374 "GMSK Multislot Power Profile: %s (%u)",str,oct>>(32-bits_needed));
2376 curr_bits_length -= bits_needed;
2377 oct <<= bits_needed;
2378 bits_in_oct -= bits_needed;
2381 * 8-PSK Multislot Power Profile
2387 switch ( oct>>(32-bits_needed) )
2389 case 0x00: str="8-PSK_MULTISLOT_POWER_PROFILE 0"; break;
2390 case 0x01: str="8-PSK_MULTISLOT_POWER_PROFILE 1"; break;
2391 case 0x02: str="8-PSK_MULTISLOT_POWER_PROFILE 2"; break;
2392 case 0x03: str="8-PSK_MULTISLOT_POWER_PROFILE 3"; break;
2393 default: str="This should not happen";
2396 proto_tree_add_text(tf_tree,
2397 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2398 "8-PSK Multislot Power Profile: %s (%u)",str,oct>>(32-bits_needed));
2400 curr_bits_length -= bits_needed;
2401 oct <<= bits_needed;
2402 bits_in_oct -= bits_needed;
2407 * we are too long ... so jump over it
2409 while ( curr_bits_length > 0 )
2411 if ( curr_bits_length > 8 )
2414 bits_needed = curr_bits_length;
2416 curr_bits_length -= bits_needed;
2417 oct <<= bits_needed;
2418 bits_in_oct -= bits_needed;
2423 curr_offset+= curr_len;
2425 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2427 return(curr_offset - offset);
2433 static const range_string gmm_cause_vals[] = {
2434 { 0x00, 0x01, "Protocol error, unspecified(Not def in v8.6.0)"},
2435 { 0x02, 0x02, "IMSI unknown in HLR"},
2436 { 0x03, 0x03, "Illegal MS"},
2437 { 0x04, 0x04, "IMSI unknown in VLR"}, /* Annex G.1 */
2438 { 0x05, 0x05, "IMEI not accepted"}, /* Annex G.1 */
2439 { 0x06, 0x06, "Illegal ME"},
2440 { 0x07, 0x07, "GPRS services not allowed"},
2441 { 0x08, 0x08, "GPRS services and non-GPRS services not allowed"},
2442 { 0x09, 0x09, "MS identity cannot be derived by the network"},
2443 { 0x0a, 0x0a, "Implicitly detached"},
2444 { 0x0b, 0x0b, "PLMN not allowed"},
2445 { 0x0c, 0x0c, "Location Area not allowed"},
2446 { 0x0d, 0x0d, "Roaming not allowed in this location area"},
2447 { 0x0e, 0x0e, "GPRS services not allowed in this PLMN"},
2448 { 0x0f, 0x0f, "No Suitable Cells In Location Area"},
2449 { 0x10, 0x10, "MSC temporarily not reachable"},
2450 { 0x11, 0x11, "Network failure"},
2451 { 0x12, 0x13, "Protocol error, unspecified(Not def in v8.6.0)"},
2452 { 0x14, 0x14, "MAC failure"},
2453 { 0x15, 0x15, "Synch failure"},
2454 { 0x16, 0x16, "Congestion"},
2455 { 0x17, 0x17, "GSM authentication unacceptable"},
2456 { 0x18, 0x18, "Protocol error, unspecified(Not def in v8.6.0)"},
2457 { 0x19, 0x19, "Not authorized for this CSG"},
2458 { 0x20, 0x20, "Service option not supported"}, /* Annex G.4 */
2459 { 0x21, 0x21, "Requested service option not subscribed"}, /* Annex G.4 */
2460 { 0x22, 0x22, "Service option temporarily out of order"}, /* Annex G.4 */
2462 { 0x23, 0x25, "Protocol error, unspecified(Not def in v8.6.0)"},
2464 { 0x26, 0x26, "Call cannot be identified(non-GPRS services only)"}, /* Annex G.4 */
2465 { 0x27, 0x27, "Protocol error, unspecified(Not def in v8.6.0)"},
2466 { 0x28, 0x28, "No PDP context activated"},
2467 { 0x29, 0x2f, "Protocol error, unspecified(Not def in v8.6.0)"},
2468 { 0x30, 0x3f, "Retry upon entry into a new cell"},
2470 { 0x40, 0x5e, "Protocol error, unspecified(Not def in v8.6.0)"},
2472 { 0x5f, 0x5f, "Semantically incorrect message"},
2473 { 0x60, 0x60, "Invalid mandatory information"},
2474 { 0x61, 0x61, "Message type non-existent or not implemented"},
2475 { 0x62, 0x62, "Message type not compatible with the protocol state"},
2476 { 0x63, 0x63, "Information element non-existent or notimplemented"},
2477 { 0x64, 0x64, "Conditional IE error"},
2478 { 0x65, 0x65, "Message not compatible with the protocol state"},
2480 { 0x66, 0x6e, "Protocol error, unspecified(Not def in v8.6.0)"},
2482 { 0x6f, 0x6f, "Protocol error, unspecified"},
2483 { 0x70, 0xff, "Protocol error, unspecified(Not def in v8.6.0)"},
2486 /* NOTE 1 TS 124 008 V8.6.0 (2009-07)
2487 "Any other value received by the mobile station shall be treated as 0110 1111, "Protocol
2488 error, unspecified". Any other value received by the network shall be treated as
2489 0110 1111, "Protocol error, unspecified".
2492 /* NOTE: The listed reject cause values are defined in annex G. */
2495 de_gmm_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2497 guint32 curr_offset;
2499 curr_offset = offset;
2501 proto_tree_add_item(tree, hf_gsm_a_gm_cause, tvb, curr_offset, 1, FALSE);
2505 /* no length check possible */
2507 return(curr_offset - offset);
2511 * [7] 10.5.5.15 Routing area identification
2514 de_gmm_rai(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2516 proto_tree *subtree;
2522 guint32 curr_offset;
2524 curr_offset = offset;
2526 mcc = (tvb_get_guint8(tvb, curr_offset) & 0x0f) <<8;
2527 mcc |= (tvb_get_guint8(tvb, curr_offset) & 0xf0);
2528 mcc |= (tvb_get_guint8(tvb, curr_offset+1) & 0x0f);
2529 mnc = (tvb_get_guint8(tvb, curr_offset+2) & 0x0f) <<8;
2530 mnc |= (tvb_get_guint8(tvb, curr_offset+2) & 0xf0);
2531 mnc |= (tvb_get_guint8(tvb, curr_offset+1) & 0xf0) >>4;
2532 if ((mnc&0x000f) == 0x000f)
2535 lac = tvb_get_ntohs(tvb, curr_offset+3);
2536 rac = tvb_get_guint8(tvb, curr_offset+5);
2538 item = proto_tree_add_text(tree,
2539 tvb, curr_offset, 6,
2540 "Routing area identification: %x-%x-%u-%u",
2543 subtree = proto_item_add_subtree(item, ett_gmm_rai);
2544 dissect_e212_mcc_mnc(tvb, gsm_a_dtap_pinfo, subtree, offset, TRUE);
2546 proto_tree_add_item(subtree, hf_gsm_a_lac, tvb, curr_offset+3, 2, FALSE);
2547 proto_tree_add_item(subtree, hf_gsm_a_gm_rac, tvb, curr_offset+5, 1, FALSE);
2551 /* no length check possible */
2553 return(curr_offset - offset);
2560 de_gmm_update_res(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2563 guint32 curr_offset;
2566 curr_offset = offset;
2568 oct = tvb_get_guint8(tvb, curr_offset);
2570 /* IMPORTANT - IT'S ASSUMED THAT THE INFORMATION IS IN THE HIGHER NIBBLE */
2575 case 0: str="RA updated"; break;
2576 case 1: str="combined RA/LA updated"; break;
2577 default: str="reserved";
2580 proto_tree_add_text(tree,
2581 tvb, curr_offset, 1,
2582 "Update Result: %s (%u)",
2588 /* no length check possible */
2590 return(curr_offset - offset);
2594 * [9] 10.5.5.18 Update Type
2596 static const value_string gsm_a_gm_update_type_vals[] = {
2597 { 0x00, "RA updating" },
2598 { 0x01, "combined RA/LA updating" },
2599 { 0x02, "combined RA/LA updating with IMSI attach" },
2600 { 0x03, "Periodic updating" },
2605 de_gmm_update_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2607 proto_item *tf = NULL;
2608 proto_tree *tf_tree = NULL;
2610 proto_tree_add_bits_item(tree, hf_gsm_a_gm_ciph_key_seq_num, tvb, offset << 3, 4, FALSE);
2612 tf = proto_tree_add_text(tree,
2616 tf_tree = proto_item_add_subtree(tf, ett_gmm_update_type );
2618 proto_tree_add_item(tf_tree, hf_gsm_a_gm_for, tvb, offset, 1, FALSE);
2619 proto_tree_add_item(tf_tree, hf_gsm_a_gm_update_type, tvb, offset, 1, FALSE);
2621 /* no length check possible */
2626 * [9] 10.5.5.19 A&C reference number (lower nibble)
2629 de_gmm_ac_ref_nr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2631 /* IMPORTANT - IT'S ASSUMED THAT THE INFORMATION IS IN THE LOWER NIBBLE */
2632 proto_tree_add_bits_item(tree, hf_gsm_a_gm_ac_ref_nr, tvb, (offset << 3) + 4, 4, FALSE);
2634 /* no length check possible */
2639 * [9] 10.5.5.19 A&C reference number (higher nibble)
2642 de_gmm_ac_ref_nr_h(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2644 /* IMPORTANT - IT'S ASSUMED THAT THE INFORMATION IS IN THE HIGHER NIBBLE */
2645 proto_tree_add_bits_item(tree, hf_gsm_a_gm_ac_ref_nr, tvb, offset << 3, 4, FALSE);
2647 /* no length check possible */
2652 * [9] 10.5.5.20 Service type
2654 static const value_string gsm_a_gm_serv_type_vals[] = {
2655 { 0x00, "Signalling" },
2657 { 0x02, "Paging response" },
2658 { 0x03, "MBMS Multicast Service Reception" },
2659 { 0x04, "MBMS Broadcast Service Reception" },
2664 de_gmm_service_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2668 bit_offset = offset << 3;
2669 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, bit_offset, 1, FALSE);
2671 proto_tree_add_bits_item(tree, hf_gsm_a_gm_serv_type, tvb, bit_offset, 3, FALSE);
2673 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, bit_offset, 1, FALSE);
2675 proto_tree_add_bits_item(tree, hf_gsm_a_gm_ciph_key_seq_num, tvb, bit_offset, 3, FALSE);
2677 /* no length check possible */
2682 * [9] 10.5.5.21 Cell Notification
2687 * [9] 10.5.5.22 PS LCS Capability
2689 static const true_false_string gsm_a_gm_apc_vals = {
2690 "Additional Positioning Capabilities which can be retrieved by RRLP are supported",
2691 "Additional Positioning Capabilities which can be retrieved by RRLP are not supported"
2694 static const true_false_string gsm_a_gm_otd_a_vals = {
2695 "MS assisted E-OTD supported",
2696 "MS assisted E-OTD not supported"
2699 static const true_false_string gsm_a_gm_otd_b_vals = {
2700 "MS based E-OTD supported",
2701 "MS based E-OTD not supported"
2704 static const true_false_string gsm_a_gm_gps_a_vals = {
2705 "MS assisted GPS supported",
2706 "MS assisted GPS not supported"
2709 static const true_false_string gsm_a_gm_gps_b_vals = {
2710 "MS based GPS supported",
2711 "MS based GPS not supported"
2714 static const true_false_string gsm_a_gm_gps_c_vals = {
2715 "Conventional GPS supported",
2716 "Conventional GPS not supported"
2720 de_gmm_ps_lcs_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2722 guint32 curr_offset;
2724 curr_offset = offset;
2725 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset << 3, 2, FALSE);
2726 proto_tree_add_item(tree, hf_gsm_a_gm_apc, tvb, curr_offset, 1, FALSE);
2727 proto_tree_add_item(tree, hf_gsm_a_gm_otd_a, tvb, curr_offset, 1, FALSE);
2728 proto_tree_add_item(tree, hf_gsm_a_gm_otd_b, tvb, curr_offset, 1, FALSE);
2729 proto_tree_add_item(tree, hf_gsm_a_gm_gps_a, tvb, curr_offset, 1, FALSE);
2730 proto_tree_add_item(tree, hf_gsm_a_gm_gps_b, tvb, curr_offset, 1, FALSE);
2731 proto_tree_add_item(tree, hf_gsm_a_gm_gps_c, tvb, curr_offset, 1, FALSE);
2735 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2737 return(curr_offset - offset);
2744 de_gmm_net_feat_supp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2747 guint32 curr_offset;
2750 curr_offset = offset;
2752 oct = tvb_get_guint8(tvb, curr_offset);
2756 case 8: str="LCS-MOLR via PS domain not supported"; break;
2757 default: str="LCS-MOLR via PS domain supported";
2760 proto_tree_add_text(tree,
2761 tvb, curr_offset, 1,
2762 "Network Feature Support: %s (%u)",
2768 /* no length check possible */
2770 return(curr_offset - offset);
2773 /* [7] 10.5.5.24 Inter RAT information container */
2775 de_gmm_rat_info_container(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2777 guint32 curr_offset;
2778 tvbuff_t *rrc_irat_ho_info_tvb;
2780 curr_offset = offset;
2782 /* The value part of the Inter RAT information container information element is the INTER RAT HANDOVER INFO as
2783 defined in 3GPP TS 25.331 [23c]. If this field includes padding bits, they are defined in 3GPP TS 25.331 [23c].*/
2784 rrc_irat_ho_info_tvb = tvb_new_subset(tvb, curr_offset, len, len);
2785 if (rrc_irat_ho_info_handle)
2786 call_dissector(rrc_irat_ho_info_handle, rrc_irat_ho_info_tvb, gsm_a_dtap_pinfo , tree);
2788 proto_tree_add_text(tree, tvb, curr_offset, len,"INTER RAT HANDOVER INFO - Not decoded");
2798 de_gc_context_stat(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2802 guint32 curr_offset;
2803 proto_item *tf = NULL;
2804 proto_tree *tf_tree = NULL;
2806 curr_offset = offset;
2808 oct = tvb_get_guint8(tvb, curr_offset);
2810 tf = proto_tree_add_text(tree,
2811 tvb, curr_offset, 1,
2812 "PDP Context Status");
2814 tf_tree = proto_item_add_subtree(tf, ett_gmm_context_stat );
2816 oct = tvb_get_guint8(tvb, curr_offset);
2818 for ( pdp_nr=0;pdp_nr<16; pdp_nr++ )
2823 oct = tvb_get_guint8(tvb, curr_offset);
2825 proto_tree_add_text(tf_tree,
2826 tvb, curr_offset, 1,
2827 "NSAPI %d: %s (%u)",pdp_nr,
2835 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2837 return(curr_offset - offset);
2844 de_gc_radio_prio(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2847 guint32 curr_offset;
2850 curr_offset = offset;
2852 oct = tvb_get_guint8(tvb, curr_offset);
2856 case 1: str="priority level 1 (highest)"; break;
2857 case 2: str="priority level 2"; break;
2858 case 3: str="priority level 3"; break;
2859 case 4: str="priority level 4 (lowest)"; break;
2860 default: str="priority level 4 (lowest)";
2863 proto_tree_add_text(tree,
2864 tvb, curr_offset, 1,
2865 "Radio Priority (PDP or SMS): %s (%u)",
2871 return(curr_offset - offset);
2875 * [9] 10.5.7.3 GPRS Timer
2877 static const value_string gsm_a_gm_gprs_timer_unit_vals[] = {
2878 { 0x00, "value is incremented in multiples of 2 seconds" },
2879 { 0x01, "value is incremented in multiples of 1 minute" },
2880 { 0x02, "value is incremented in multiples of decihours" },
2881 { 0x07, "value indicates that the timer is deactivated" },
2886 de_gc_timer(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2891 proto_tree *subtree;
2894 oct = tvb_get_guint8(tvb, offset);
2899 case 0: str="sec"; val*=2; break;
2900 case 1: str="min"; break;
2901 case 2: str="min"; val*=6; break;
2903 proto_tree_add_text(tree,
2905 "GPRS Timer: timer is deactivated");
2910 item = proto_tree_add_text(tree,
2912 "GPRS Timer: %u %s",
2916 subtree = proto_item_add_subtree(item, ett_gmm_gprs_timer);
2917 proto_tree_add_item(subtree, hf_gsm_a_gm_gprs_timer_unit, tvb, offset, 1, FALSE);
2918 proto_tree_add_item(subtree, hf_gsm_a_gm_gprs_timer_value, tvb, offset, 1, FALSE);
2920 /* no length check possible */
2928 de_gc_timer2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len _U_)
2932 guint32 curr_offset;
2935 curr_offset = offset;
2937 oct = tvb_get_guint8(tvb, curr_offset);
2943 case 0: str="sec"; val*=2; break;
2944 case 1: str="min"; break;
2945 case 2: str="min"; val*=6; break;
2947 proto_tree_add_text(tree,
2948 tvb, curr_offset, 1,
2949 "GPRS Timer: timer is deactivated");
2954 proto_tree_add_text(tree,
2955 tvb, curr_offset, 1,
2956 "GPRS Timer: %u %s %s (%u)",
2958 str, add_string ? add_string : "", oct);
2962 return(curr_offset - offset);
2969 de_gc_radio_prio2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2972 guint32 curr_offset;
2975 curr_offset = offset;
2977 oct = tvb_get_guint8(tvb, curr_offset);
2979 /* IMPORTANT - IT'S ASSUMED THAT THE INFORMATION IS IN THE HIGHER NIBBLE */
2984 case 1: str="priority level 1 (highest)"; break;
2985 case 2: str="priority level 2"; break;
2986 case 3: str="priority level 3"; break;
2987 case 4: str="priority level 4 (lowest)"; break;
2988 default: str="priority level 4 (lowest)";
2991 proto_tree_add_text(tree,
2992 tvb, curr_offset, 1,
2993 "Radio Priority (TOM8): %s (%u)",
2999 return(curr_offset - offset);
3003 * [8] 10.5.7.6 MBMS context status
3006 de_gc_mbms_context_stat(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3008 guint32 curr_offset;
3011 proto_item *tf = NULL;
3012 proto_tree *tf_tree = NULL;
3014 curr_offset = offset;
3016 oct = tvb_get_guint8(tvb, curr_offset);
3018 tf = proto_tree_add_text(tree,
3019 tvb, curr_offset, 1,
3020 "MBMS Context Status");
3022 tf_tree = proto_item_add_subtree(tf, ett_gmm_context_stat );
3024 for (i=0; i<len; i++)
3026 oct = tvb_get_guint8(tvb, curr_offset);
3030 proto_tree_add_text(tf_tree,
3031 tvb, curr_offset, 1,
3032 "NSAPI %d: %s (%u)",128+i*8+j,
3045 #define MAX_APN_LENGTH 50
3048 de_sm_apn(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len _U_)
3050 guint32 curr_offset;
3052 guint8 str[MAX_APN_LENGTH+1];
3054 curr_offset = offset;
3056 /* init buffer and copy it */
3057 memset ( str , 0 , MAX_APN_LENGTH );
3058 tvb_memcpy(tvb, str, offset, len<MAX_APN_LENGTH?len:MAX_APN_LENGTH);
3061 while (( curr_len < len ) && ( curr_len < MAX_APN_LENGTH ))
3063 guint step = str[curr_len];
3068 proto_tree_add_text(tree,
3069 tvb, curr_offset, len,
3070 "APN: %s %s", str+1 , add_string ? add_string : "");
3074 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3076 return(curr_offset - offset);
3083 de_sm_nsapi(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len _U_)
3086 guint32 curr_offset;
3088 curr_offset = offset;
3090 oct = tvb_get_guint8(tvb, curr_offset);
3092 proto_tree_add_text(tree,
3093 tvb, curr_offset, 1,
3094 "NSAPI: 0x%02x (%u) %s",
3095 oct&0x0f, oct&0x0f,add_string ? add_string : "");
3099 return(curr_offset - offset);
3103 * [7] 10.5.6.3 Protocol configuration options
3105 static const value_string gsm_a_sm_pco_ms2net_prot_vals[] = {
3106 { 0x01, "P-CSCF IPv6 Address Request" },
3107 { 0x02, "IM CN Subsystem Signaling Flag" },
3108 { 0x03, "DNS Server IPv6 Address Request" },
3109 { 0x04, "Not Supported" },
3110 { 0x05, "MS Support of Network Requested Bearer Control indicator" },
3111 { 0x06, "Reserved" },
3112 { 0x07, "DSMIPv6 Home Agent Address Request" },
3113 { 0x08, "DSMIPv6 Home Network Prefix Request" },
3114 { 0x09, "DSMIPv6 IPv4 Home Agent Address Request" },
3115 { 0x0a, "IP address allocation via NAS signalling" },
3116 { 0x0b, "IPv4 address allocation via DHCPv4" },
3117 { 0x0c, "P-CSCF IPv4 Address Request" },
3118 { 0x0d, "DNS Server IPv4 Address Request" },
3119 { 0x0e, "MSISDN Request" },
3122 static const value_string gsm_a_sm_pco_net2ms_prot_vals[] = {
3123 { 0x01, "P-CSCF IPv6 Address" },
3124 { 0x02, "IM CN Subsystem Signaling Flag" },
3125 { 0x03, "DNS Server IPv6 Address" },
3126 { 0x04, "Policy Control rejection code" },
3127 { 0x05, "Selected Bearer Control Mode" },
3128 { 0x06, "Reserved" },
3129 { 0x07, "DSMIPv6 Home Agent Address" },
3130 { 0x08, "DSMIPv6 Home Network Prefix" },
3131 { 0x09, "DSMIPv6 IPv4 Home Agent Address" },
3132 { 0x0a, "Reserved" },
3133 { 0x0b, "Reserved" },
3134 { 0x0c, "P-CSCF IPv4 Address" },
3135 { 0x0d, "DNS Server IPv4 Address" },
3140 static const value_string gsm_a_gm_link_dir_vals[] = {
3142 { 0x0, "MS to network" },
3143 { 0x1, "Network to MS" },
3148 de_sm_pco(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3150 proto_item *generated_item = NULL;
3151 guint32 curr_offset;
3154 struct e_in6_addr ipv6_addr;
3158 curr_offset = offset;
3160 oct = tvb_get_guint8(tvb, curr_offset);
3162 link_dir = gsm_a_dtap_pinfo->link_dir;
3163 generated_item =proto_tree_add_int(tree, hf_gsm_a_gm_link_dir, tvb, curr_offset, 0, link_dir);
3164 PROTO_ITEM_SET_GENERATED(generated_item);
3167 /* 1 ext 0 0 0 0 Spare Configuration protocol */
3168 proto_tree_add_item(tree, hf_gsm_a_gm_sm_ext, tvb, curr_offset, 1, FALSE);
3169 /* Configuration protocol (octet 3)
3172 * 0 0 0 PPP for use with IP PDP type or IP PDN type (see 3GPP TS 24.301 [120])
3174 * All other values are interpreted as PPP in this version of the protocol.
3175 * (3GPP TS 24.008 version 9.4.0 Release 9)
3177 proto_tree_add_text(tree,tvb, curr_offset, 1, "Configuration Protocol: PPP (%u)",oct&0x07);
3181 while ( curr_len > 0 )
3186 dissector_handle_t handle = NULL;
3188 /* Protocol ID 1 octet 4
3190 * Length of protocol ID 1 contents octet 6
3191 * Protocol ID 1 contents octet 7
3194 prot = tvb_get_ntohs(tvb,curr_offset);
3195 proto_tree_add_uint_format(tree, hf_gsm_a_gm_pco_pid, tvb, curr_offset, 2, (guint32)prot,
3196 "Protocol or Container ID: %s (%u)",
3198 val_to_str_const((guint32)prot, gsm_a_sm_pco_net2ms_prot_vals, val_to_str_ext_const(prot, &ppp_vals_ext, "Unknown")) :
3199 val_to_str_const((guint32)prot, gsm_a_sm_pco_ms2net_prot_vals, val_to_str_ext_const(prot, &ppp_vals_ext, "Unknown")),
3204 e_len = tvb_get_guint8(tvb, curr_offset);
3205 proto_tree_add_text(tree,tvb, curr_offset, 1, "Length: 0x%02x (%u)", e_len , e_len);
3214 tvb_get_ipv6(tvb, curr_offset, &ipv6_addr);
3215 proto_tree_add_text(tree,
3216 tvb, curr_offset, 16,
3217 "IPv6: %s", ip6_to_str(&ipv6_addr));
3226 tvb_get_ipv6(tvb, curr_offset, &ipv6_addr);
3227 proto_tree_add_text(tree,
3228 tvb, curr_offset, 16,
3229 "IPv6: %s", ip6_to_str(&ipv6_addr));
3234 oct = tvb_get_guint8(tvb, curr_offset);
3235 proto_tree_add_text(tree,tvb, curr_offset, 1, "Reject Code: 0x%02x (%u)", e_len , e_len);
3239 handle = dissector_get_uint_handle ( gprs_sm_pco_subdissector_table , prot );
3240 if ( handle != NULL )
3243 * dissect the embedded message
3245 l3_tvb = tvb_new_subset(tvb, curr_offset, e_len, e_len);
3246 call_dissector(handle, l3_tvb , gsm_a_dtap_pinfo , tree );
3251 * dissect the embedded DATA message
3253 l3_tvb = tvb_new_subset(tvb, curr_offset, e_len, e_len);
3254 call_dissector(data_handle, l3_tvb, gsm_a_dtap_pinfo , tree);
3260 curr_offset+= e_len;
3262 curr_offset+= curr_len;
3264 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3266 return(curr_offset - offset);
3270 * [9] 10.5.6.4 Packet data protocol address
3272 static const value_string gsm_a_sm_pdp_type_org_vals[] = {
3273 { 0x00, "ETSI allocated address" },
3274 { 0x01, "IETF allocated address" },
3275 { 0x0f, "Empty PDP type" },
3280 de_sm_pdp_addr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3282 guint32 curr_offset;
3285 guchar pdp_type_org, pdp_type_num;
3288 curr_offset = offset;
3290 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset << 3), 4, FALSE);
3291 proto_tree_add_item(tree, hf_gsm_a_sm_pdp_type_org, tvb, curr_offset, 1, FALSE);
3293 pdp_type_org = tvb_get_guint8(tvb, curr_offset) & 0x0f;
3295 pdp_type_num = tvb_get_guint8(tvb, curr_offset);
3297 if (pdp_type_org == 0 )
3299 /* ETSI allocated address */
3300 switch (pdp_type_num)
3302 case 0x00: str="Reserved, used in earlier version of this protocol"; break;
3303 case 0x01: str="PDP-type PPP"; break;
3304 default: str="reserved";
3307 else if (pdp_type_org == 1)
3309 /* IETF allocated addres */
3310 switch (pdp_type_num)
3312 case 0x21: str="IPv4 address"; break;
3313 case 0x57: str="IPv6 address"; break;
3314 case 0x8d: str="IPv4v6 address"; break;
3315 default: str="Unknown, interpreted as IPv4 address";
3318 else if ((pdp_type_num == 0) && (pdp_type_org == 0x0f))
3321 str="Not specified";
3323 proto_tree_add_text(tree,
3324 tvb, curr_offset, 1,
3325 "PDP type number: %s (%u)",str,pdp_type_num);
3327 if (( len == 2 ) && (( pdp_type_num == 0x21 ) || ( pdp_type_num == 0x57 ) || (pdp_type_num == 0x8d)))
3329 proto_tree_add_text(tree,
3330 tvb, curr_offset, 1,
3331 "Dynamic addressing");
3333 return(curr_offset - offset);
3335 else if ( len == 2 )
3337 proto_tree_add_text(tree,
3338 tvb, curr_offset, 1,
3339 "No PDP address is included");
3341 return(curr_offset - offset);
3345 if (pdp_type_org == 1)
3346 switch (pdp_type_num)
3349 proto_tree_add_item(tree,hf_gsm_a_sm_ip6_address,tvb,curr_offset,16,FALSE);
3354 proto_tree_add_item(tree,hf_gsm_a_sm_ip4_address,tvb,curr_offset,4,FALSE);
3356 proto_tree_add_item(tree,hf_gsm_a_sm_ip6_address,tvb,curr_offset,16,FALSE);
3361 proto_tree_add_item(tree,hf_gsm_a_sm_ip4_address,tvb,curr_offset,4,FALSE);
3365 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3367 return(curr_offset - offset);
3371 * [9] 10.5.6.5 Quality of service
3373 static const value_string gsm_a_qos_delay_cls_vals[] = {
3374 { 0x00, "Subscribed delay class (in MS to network direction)" },
3375 { 0x01, "Delay class 1" },
3376 { 0x02, "Delay class 2" },
3377 { 0x03, "Delay class 3" },
3378 { 0x04, "Delay class 4 (best effort)" },
3379 { 0x07, "Reserved" },
3383 static const value_string gsm_a_qos_reliability_vals[] = {
3384 { 0x00, "Subscribed reliability class (in MS to network direction)" },
3385 { 0x01, "Acknowledged GTP, LLC, and RLC; Protected data" },
3386 { 0x02, "Unacknowledged GTP, Ack LLC/RLC, Protected data" },
3387 { 0x03, "Unacknowledged GTP/LLC, Ack RLC, Protected data" },
3388 { 0x04, "Unacknowledged GTP/LLC/RLC, Protected data" },
3389 { 0x05, "Unacknowledged GTP/LLC/RLC, Unprotected data" },
3390 { 0x07, "Reserved" },
3393 /* Delivery of erroneous SDUs, octet 6 (see 3GPP TS 23.107) Bits 3 2 1 */
3394 const value_string gsm_a_qos_del_of_err_sdu_vals[] = {
3395 { 0, "Subscribed delivery of erroneous SDUs/Reserved" },
3396 { 1, "No detect('-')" },
3397 { 2, "Erroneous SDUs are delivered('yes')" },
3398 { 3, "Erroneous SDUs are not delivered('No')" },
3403 /* Delivery order, octet 6 (see 3GPP TS 23.107) Bits 5 4 3 */
3404 const value_string gsm_a_qos_del_order_vals[] = {
3405 { 0, "Subscribed delivery order/Reserved" },
3406 { 1, "With delivery order ('yes')" },
3407 { 2, "Without delivery order ('no')" },
3411 /* Traffic class, octet 6 (see 3GPP TS 23.107) Bits 8 7 6 */
3412 const value_string gsm_a_qos_traffic_cls_vals[] = {
3413 { 0, "Subscribed traffic class/Reserved" },
3414 { 1, "Conversational class" },
3415 { 2, "Streaming class" },
3416 { 3, "Interactive class" },
3417 { 4, "Background class" },
3422 /* Residual Bit Error Rate (BER), octet 10 (see 3GPP TS 23.107) Bits 8 7 6 5 */
3423 const value_string gsm_a_qos_ber_vals[] = {
3424 { 0, "Subscribed residual BER/Reserved" },
3438 /* SDU error ratio, octet 10 (see 3GPP TS 23.107) Bits 4 3 2 1 */
3439 const value_string gsm_a_qos_sdu_err_rat_vals[] = {
3440 { 0, "Subscribed SDU error ratio/Reserved" },
3452 /* Traffic handling priority, octet 11 (see 3GPP TS 23.107) Bits 2 1 */
3453 const value_string gsm_a_qos_traff_hdl_pri_vals[] = {
3454 { 0, "Subscribed traffic handling priority/Reserved" },
3455 { 1, "Priority level 1" },
3456 { 2, "Priority level 2" },
3457 { 3, "Priority level 3" },
3461 const range_string gsm_a_qos_peak_thr_vals[] = {
3462 { 0x00, 0x00, "Subscribed peak throughput/reserved" },
3463 { 0x01, 0x01, "Up to 1 000 octet/s" },
3464 { 0x02, 0x02, "Up to 2 000 octet/s" },
3465 { 0x03, 0x03, "Up to 4 000 octet/s" },
3466 { 0x04, 0x04, "Up to 8 000 octet/s" },
3467 { 0x05, 0x05, "Up to 16 000 octet/s" },
3468 { 0x06, 0x06, "Up to 32 000 octet/s" },
3469 { 0x07, 0x07, "Up to 64 000 octet/s" },
3470 { 0x08, 0x08, "Up to 128 000 octet/s" },
3471 { 0x09, 0x09, "Up to 256 000 octet/s" },
3472 { 0x0a, 0x0e, "Interpreted as Up to 1 000 octet/s" },
3473 { 0x0f, 0x0f, "Reserved" },
3477 const range_string gsm_a_qos_mean_thr_vals[] = {
3478 { 0x00, 0x00, "Subscribed peak throughput/reserved" },
3479 { 0x01, 0x01, "100 octet/h" },
3480 { 0x02, 0x02, "200 octet/h" },
3481 { 0x03, 0x03, "500 octet/h" },
3482 { 0x04, 0x04, "1 000 octet/h" },
3483 { 0x05, 0x05, "2 000 octet/h" },
3484 { 0x06, 0x06, "5 000 octet/h" },
3485 { 0x07, 0x07, "10 000 octet/h" },
3486 { 0x08, 0x08, "20 000 octet/h" },
3487 { 0x09, 0x09, "50 000 octet/h" },
3488 { 0x0a, 0x0a, "100 000 octet/h" },
3489 { 0x0b, 0x0b, "200 000 octet/h" },
3490 { 0x0c, 0x0c, "500 000 octet/h" },
3491 { 0x0d, 0x0d, "1 000 000 octet/h" },
3492 { 0x0e, 0x0e, "2 000 000 octet/h" },
3493 { 0x0f, 0x0f, "5 000 000 octet/h" },
3494 { 0x10, 0x10, "10 000 000 octet/h" },
3495 { 0x11, 0x11, "20 000 000 octet/h" },
3496 { 0x12, 0x12, "50 000 000 octet/h" },
3497 { 0x13, 0x1d, "Interpreted as Best effort" },
3498 { 0x1e, 0x1e, "Reserved" },
3499 { 0x1f, 0x1f, "Best effort" },
3503 const range_string gsm_a_qos_prec_class_vals[] = {
3504 { 0x00, 0x00, "Subscribed precedence/reserved" },
3505 { 0x01, 0x01, "High priority" },
3506 { 0x02, 0x02, "Normal priority" },
3507 { 0x03, 0x03, "Low priority" },
3508 { 0x04, 0x06, "Interpreted as Normal priority" },
3509 { 0x07, 0x07, "Reserved" },
3513 const true_false_string gsm_a_qos_signalling_ind_value = {
3514 "Optimised for signalling traffic",
3515 "Not optimised for signalling traffic"
3518 /* Helper function returning the main bitrates in kbps */
3520 qos_calc_bitrate(guint8 oct)
3525 return 64 + (oct-0x40) * 8;
3527 return 576 + (oct-0x80) * 64;
3530 /* Helper function returning the extended bitrates in kbps */
3532 qos_calc_ext_bitrate(guint8 oct)
3535 return 8600 + oct * 100;
3537 return 16000 + (oct-0x4a) * 1000;
3539 return 128000 + (oct - 0xba) * 2000;
3543 de_sm_qos(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3545 guint32 curr_offset;
3546 guchar oct, tmp_oct;
3550 curr_offset = offset;
3553 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset << 3), 2, FALSE);
3554 proto_tree_add_item(tree, hf_gsm_a_qos_delay_cls, tvb, curr_offset, 1, FALSE);
3555 proto_tree_add_item(tree, hf_gsm_a_qos_reliability_cls, tvb, curr_offset, 1, FALSE);
3559 oct = tvb_get_guint8(tvb, curr_offset);
3560 proto_tree_add_item(tree, hf_gsm_a_qos_peak_thr, tvb, curr_offset, 1, FALSE);
3561 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset << 3) + 4, 1, FALSE);
3562 proto_tree_add_item(tree, hf_gsm_a_qos_prec_class, tvb, curr_offset, 1, FALSE);
3566 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset << 3), 3, FALSE);
3567 proto_tree_add_item(tree, hf_gsm_a_qos_mean_thr, tvb, curr_offset, 1, FALSE);
3570 NO_MORE_DATA_CHECK(len);
3573 proto_tree_add_item(tree, hf_gsm_a_qos_traffic_cls, tvb, curr_offset, 1, FALSE);
3574 proto_tree_add_item(tree, hf_gsm_a_qos_del_order, tvb, curr_offset, 1, FALSE);
3575 proto_tree_add_item(tree, hf_gsm_a_qos_del_of_err_sdu, tvb, curr_offset, 1, FALSE);
3578 NO_MORE_DATA_CHECK(len);
3581 oct = tvb_get_guint8(tvb, curr_offset);
3585 case 0x00: str="Subscribed maximum SDU size/reserved"; break;
3586 case 0x97: str="1502 octets"; break;
3587 case 0x98: str="1510 octets"; break;
3588 case 0x99: str="1520 octets"; break;
3589 case 0xff: str="Reserved"; break;
3590 default: str="Unspecified";
3593 if (( oct >= 1 ) && ( oct <= 0x96 ))
3594 proto_tree_add_text(tree,
3595 tvb, curr_offset, 1,
3596 "Maximum SDU size: %u octets (%u)",oct*10, oct);
3598 proto_tree_add_text(tree,
3599 tvb, curr_offset, 1,
3600 "Maximum SDU size: %s (%u)",str, oct);
3604 NO_MORE_DATA_CHECK(len);
3607 oct = tvb_get_guint8(tvb, curr_offset);
3611 case 0x00: str = "Subscribed maximum bit rate for uplink/reserved"; break;
3612 case 0xff: str = "0 kbps"; break;
3613 default: str = ep_strdup_printf("%u kbps", qos_calc_bitrate(oct));
3616 proto_tree_add_uint_format_value(tree, hf_gsm_a_qos_max_bitrate_upl, tvb,
3617 curr_offset, 1, oct, "%s (%u)", str, oct);
3620 NO_MORE_DATA_CHECK(len);
3623 oct = tvb_get_guint8(tvb, curr_offset);
3627 case 0x00: str="Subscribed maximum bit rate for downlink/reserved"; break;
3628 case 0xff: str="0 kbps"; break;
3629 default: str = ep_strdup_printf("%u kbps", qos_calc_bitrate(oct));
3632 proto_tree_add_uint_format_value(tree, hf_gsm_a_qos_max_bitrate_downl, tvb,
3633 curr_offset, 1, oct, "%s (%u)", str, oct);
3636 NO_MORE_DATA_CHECK(len);
3639 proto_tree_add_item(tree, hf_gsm_a_qos_ber, tvb, curr_offset, 1, FALSE);
3640 proto_tree_add_item(tree, hf_gsm_a_qos_sdu_err_rat, tvb, curr_offset, 1, FALSE);
3643 NO_MORE_DATA_CHECK(len);
3646 oct = tvb_get_guint8(tvb, curr_offset);
3651 case 0x00: str="Subscribed transfer delay/reserved"; break;
3652 case 0x3f: str="Reserved"; break;
3654 if (tmp_oct <= 0x0f)
3655 temp32 = tmp_oct * 10;
3656 else if (tmp_oct <= 0x1f)
3657 temp32 = (tmp_oct - 0x10) * 50 + 200;
3659 temp32 = (tmp_oct - 0x20) * 100 + 1000;
3660 str = ep_strdup_printf("%u ms", temp32);
3663 proto_tree_add_uint_format_value(tree, hf_gsm_a_qos_trans_delay, tvb,
3664 curr_offset, 1, oct, "%s (%u)", str, tmp_oct);
3666 tmp_oct = oct & 0x03;
3668 str = "Subscribed traffic handling priority/reserved";
3670 str = ep_strdup_printf("Priority level %u", tmp_oct);
3672 proto_tree_add_uint_format_value(tree, hf_gsm_a_qos_traf_handl_prio, tvb,
3673 curr_offset, 1, oct, "%s (%u)", str, tmp_oct);
3676 NO_MORE_DATA_CHECK(len);
3679 oct = tvb_get_guint8(tvb, curr_offset);
3683 case 0x00: str="Subscribed guaranteed bit rate for uplink/reserved"; break;
3684 case 0xff: str="0 kbps"; break;
3685 default: str = ep_strdup_printf("%u kbps", qos_calc_bitrate(oct));
3688 proto_tree_add_uint_format_value(tree, hf_gsm_a_qos_guar_bitrate_upl, tvb,
3689 curr_offset, 1, oct, "%s (%u)", str, oct);
3692 NO_MORE_DATA_CHECK(len);
3695 oct = tvb_get_guint8(tvb, curr_offset);
3699 case 0x00: str="Subscribed guaranteed bit rate for downlink/reserved"; break;
3700 case 0xff: str="0 kbps"; break;
3701 default: str = ep_strdup_printf("%u kbps", qos_calc_bitrate(oct));
3704 proto_tree_add_uint_format_value(tree, hf_gsm_a_qos_guar_bitrate_downl, tvb,
3705 curr_offset, 1, oct, "%s (%u)", str, oct);
3708 NO_MORE_DATA_CHECK(len);
3711 oct = tvb_get_guint8(tvb, curr_offset);
3712 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset << 3), 3, FALSE);
3713 proto_tree_add_item(tree, hf_gsm_a_qos_signalling_ind, tvb , curr_offset, 1, FALSE);
3716 if (tmp_oct == 0x01)
3721 proto_tree_add_uint_format_value(tree, hf_gsm_a_qos_source_stat_desc, tvb,
3722 curr_offset, 1, oct, "%s (%u)", str, tmp_oct);
3725 NO_MORE_DATA_CHECK(len);
3728 oct = tvb_get_guint8(tvb, curr_offset);
3731 str = "Use the value indicated by the Maximum bit rate for downlink";
3734 temp32 = qos_calc_ext_bitrate(oct);
3735 if (temp32 % 1000 == 0)
3736 str = ep_strdup_printf("%u Mbps", temp32 / 1000);
3738 str = ep_strdup_printf("%u kbps", temp32);
3740 proto_tree_add_uint_format_value(tree, hf_gsm_a_qos_max_bitrate_downl_ext, tvb,
3741 curr_offset, 1, oct, "%s (%u)", str, oct);
3744 NO_MORE_DATA_CHECK(len);
3747 oct = tvb_get_guint8(tvb, curr_offset);
3750 str = "Use the value indicated by the Guaranteed bit rate for downlink";
3753 temp32 = qos_calc_ext_bitrate(oct);
3754 if (temp32 % 1000 == 0)
3755 str = ep_strdup_printf("%u Mbps", temp32 / 1000);
3757 str = ep_strdup_printf("%u kbps", temp32);
3759 proto_tree_add_uint_format_value(tree, hf_gsm_a_qos_guar_bitrate_downl_ext, tvb,
3760 curr_offset, 1, oct, "%s (%u)", str, oct);
3763 NO_MORE_DATA_CHECK(len);
3765 /* Maximum bit rate for uplink (extended) Octet 17 */
3766 oct = tvb_get_guint8(tvb, curr_offset);
3769 str = "Use the value indicated by the Maximum bit rate for uplink";
3772 temp32 = qos_calc_ext_bitrate(oct);
3773 if (temp32 % 1000 == 0)
3774 str = ep_strdup_printf("%u Mbps", temp32 / 1000);
3776 str = ep_strdup_printf("%u kbps", temp32);
3778 proto_tree_add_uint_format_value(tree, hf_gsm_a_qos_max_bitrate_upl_ext, tvb,
3779 curr_offset, 1, oct, "%s (%u)", str, oct);
3782 NO_MORE_DATA_CHECK(len);
3784 /* Guaranteed bit rate for uplink (extended) Octet 18 */
3785 oct = tvb_get_guint8(tvb, curr_offset);
3788 str = "Use the value indicated by the Guaranteed bit rate for uplink";
3791 temp32 = qos_calc_ext_bitrate(oct);
3792 if (temp32 % 1000 == 0)
3793 str = ep_strdup_printf("%u Mbps", temp32 / 1000);
3795 str = ep_strdup_printf("%u kbps", temp32);
3797 proto_tree_add_uint_format_value(tree, hf_gsm_a_qos_guar_bitrate_upl_ext, tvb,
3798 curr_offset, 1, oct, "%s (%u)", str, oct);
3802 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3804 return(curr_offset - offset);
3808 * [9] 10.5.6.6 SM cause
3810 static const value_string gsm_a_sm_cause_vals[] = {
3811 { 0x08, "Operator Determined Barring" },
3812 { 0x18, "MBMS bearer capabilities insufficient for the service" },
3813 { 0x19, "LLC or SNDCP failure(GSM only)" },
3814 { 0x1a, "Insufficient resources" },
3815 { 0x1b, "Missing or unknown APN" },
3816 { 0x1c, "Unknown PDP address or PDP type" },
3817 { 0x1d, "User Authentication failed" },
3818 { 0x1e, "Activation rejected by GGSN" },
3819 { 0x1f, "Activation rejected, unspecified" },
3820 { 0x20, "Service option not supported" },
3821 { 0x21, "Requested service option not subscribed" },
3822 { 0x22, "Service option temporarily out of order" },
3823 { 0x23, "NSAPI already used (not sent)" },
3824 { 0x24, "Regular deactivation" },
3825 { 0x25, "QoS not accepted" },
3826 { 0x26, "Network failure" },
3827 { 0x27, "Reactivation required" },
3828 { 0x28, "Feature not supported" },
3829 { 0x29, "Semantic error in the TFT operation" },
3830 { 0x2a, "Syntactical error in the TFT operation" },
3831 { 0x2b, "Unknown PDP context" },
3832 { 0x2c, "Semantic errors in packet filter(s)" },
3833 { 0x2d, "Syntactical errors in packet filter(s)" },
3834 { 0x2e, "PDP context without TFT already activated" },
3835 { 0x2f, "Multicast group membership time-out" },
3836 { 0x2c, "Semantic errors in packet filter(s)" },
3837 { 0x2d, "Syntactical errors in packet filter(s)" },
3838 { 0x30, "Activation rejected, BCM violation" },
3839 { 0x32, "PDP type IPv4 only allowed" },
3840 { 0x33, "PDP type IPv6 only allowed" },
3841 { 0x34, "Single address bearers only allowed" },
3842 { 0x51, "Invalid transaction identifier value" },
3843 { 0x5f, "Semantically incorrect message" },
3844 { 0x60, "Invalid mandatory information" },
3845 { 0x61, "Message type non-existent or not implemented" },
3846 { 0x62, "Message type not compatible with the protocol state" },
3847 { 0x63, "Information element non-existent or not implemented" },
3848 { 0x64, "Conditional IE error" },
3849 { 0x65, "Message not compatible with the protocol state" },
3850 { 0x6f, "Protocol error, unspecified" },
3851 { 0x70, "APN restriction value incompatible with active PDP context" },
3856 de_sm_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3861 oct = tvb_get_guint8(tvb, offset);
3862 str = match_strval(oct, gsm_a_sm_cause_vals);
3864 /* SM Cause can be sent in both directions */
3866 str = "Protocol error, unspecified / Service option temporarily out of order";
3868 proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_cause, tvb,
3869 offset, 1, oct, "%s (%u)", str, oct);
3871 /* no length check possible */
3876 * [9] 10.5.6.6a SM cause 2
3879 de_sm_cause_2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3884 oct = tvb_get_guint8(tvb, offset);
3885 str = match_strval(oct, gsm_a_sm_cause_vals);
3887 /* SM Cause 2 is sent only in the Network-to-MS direction */
3889 str = "Service option temporarily out of order";
3891 proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_cause_2, tvb,
3892 offset, 1, oct, "%s (%u)", str, oct);
3894 /* no length check possible */
3901 de_sm_linked_ti(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3903 guint32 curr_offset;
3907 static const gchar *ti_flag[2]={
3908 "The message is sent from the side that originates the TI" ,
3909 "The message is sent to the side that originates the TI" };
3912 curr_offset = offset;
3914 oct = tvb_get_guint8(tvb, curr_offset);
3916 proto_tree_add_text(tree,
3917 tvb, curr_offset, 1,
3918 "TI flag: %s (%u)",ti_flag[oct>>7],oct>>7);
3922 oct = tvb_get_guint8(tvb, curr_offset);
3924 proto_tree_add_text(tree,
3925 tvb, curr_offset, 1,
3926 "TI value: 0x%02x (%u)",oct&0x7f,oct&0x7f);
3928 proto_tree_add_text(tree,
3929 tvb, curr_offset, 1,
3930 "ext: 0x%02x (%u)",oct>>7,oct>>7);
3935 proto_tree_add_text(tree,
3936 tvb, curr_offset, 1,
3937 "TI value: 0x%02x (%u)",(oct>>4)&7,(oct>>4)&7);
3940 curr_offset+= curr_len;
3942 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3944 return(curr_offset - offset);
3948 * [9] 10.5.6.9 LLC service access point identifier
3950 static const value_string gsm_a_sm_llc_sapi_vals[] = {
3951 { 0, "LLC SAPI not assigned" },
3960 de_sm_sapi(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3962 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, offset << 3, 4, FALSE);
3963 proto_tree_add_item(tree, hf_gsm_a_sm_llc_sapi, tvb, offset, 1, FALSE);
3965 /* no length check possible */
3970 * [9] 10.5.6.10 Tear down indicator
3972 const true_false_string gsm_a_sm_tdi_value = {
3973 "Tear down requested",
3974 "Tear down not requested"
3978 de_sm_tear_down(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3980 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (offset << 3) + 4, 3, FALSE);
3981 proto_tree_add_item(tree, hf_gsm_a_sm_tdi, tvb, offset, 1, FALSE);
3983 /* no length check possible */
3988 * [9] 10.5.6.11 Packet Flow Identifier
3990 static const range_string gsm_a_sm_packet_flow_id_vals[] = {
3991 { 0x00, 0x00, "Best Effort"},
3992 { 0x01, 0x01, "Signaling"},
3993 { 0x02, 0x02, "SMS"},
3994 { 0x03, 0x03, "TOM8"},
3995 { 0x04, 0x07, "Reserved"},
3996 { 0x08, 0x7f, "Dynamically assigned"},
3997 { 0x00, 0x00, NULL }
4001 de_sm_pflow_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4003 guint32 curr_offset;
4005 curr_offset = offset;
4006 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset << 3, 1, FALSE);
4007 proto_tree_add_item(tree, hf_gsm_a_sm_packet_flow_id, tvb, curr_offset, 1, FALSE);
4010 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4012 return(curr_offset - offset);
4016 * [7] 10.5.6.12 TFT - Traffic Flow Template
4018 /* TFT operation code (octet 3) */
4019 static const value_string gsm_a_tft_op_code_vals[] = {
4021 { 1, "Create new TFT"},
4022 { 2, "Delete existing TFT"},
4023 { 3, "Add packet filters to existing TFT"},
4024 { 4, "Replace packet filters in existing TFT"},
4025 { 5, "Delete packet filters from existing TFT"},
4026 { 6, "No TFT operation"},
4031 static const true_false_string gsm_a_tft_e_bit = {
4032 "Parameters list is included",
4033 "Parameters list is not included"
4036 static const value_string gsm_a_tft_pkt_flt_dir_vals[] = {
4037 { 0, "Pre Rel-7 TFT filter"},
4038 { 1, "Downlink only"},
4039 { 2, "Uplink only"},
4040 { 3, "Bidirectional"},
4044 static const value_string gsm_a_tft_param_id_vals[] = {
4045 { 1, "Authorization Token"},
4046 { 2, "Flow Identifier"},
4047 { 3, "Packet Filter Identifier"},
4052 de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4054 guint32 curr_offset;
4056 proto_item *tf = NULL;
4057 proto_tree *tf_tree = NULL;
4058 proto_tree *comp_tree = NULL;
4060 guchar pkt_fil_count;
4067 gint pack_component_type;
4071 curr_offset = offset;
4074 * parse first octet. It contain TFT operation code, E bit and Number of packet filters
4076 oct = tvb_get_guint8(tvb, curr_offset);
4079 pkt_fil_count = oct&0x0f;
4082 proto_tree_add_item(tree,hf_gsm_a_tft_op_code,tvb,curr_offset,1,FALSE);
4083 proto_tree_add_item(tree,hf_gsm_a_tft_e_bit,tvb,curr_offset,1,FALSE);
4084 proto_tree_add_item(tree,hf_gsm_a_tft_pkt_flt,tvb,curr_offset,1,FALSE);
4089 /* Packet filter list dissect */
4092 if ( op_code == 2 ) /* delete TFT contains no packet filters. so we will jump over it */
4093 count = pkt_fil_count;
4094 while ( count < pkt_fil_count )
4096 tf = proto_tree_add_text(tree,
4097 tvb, curr_offset, 1,
4098 "Packet filter %d",count); /* 0-> 7 */
4100 tf_tree = proto_item_add_subtree(tf, ett_sm_tft );
4102 if ( op_code == 5 ) /* Delete packet filters from existing TFT - just a list of identifiers */
4104 if ((curr_offset-offset)<1) {
4105 proto_tree_add_text(tf_tree,tvb, curr_offset, 1,"Not enough data");
4108 proto_tree_add_bits_item(tf_tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3), 4, FALSE);
4109 proto_tree_add_item(tf_tree, hf_gsm_a_tft_pkt_flt_id, tvb, curr_offset, 1, FALSE);
4114 else /* create new, Add packet filters or Replace packet filters */
4117 if ((curr_offset-offset)<1) {
4118 proto_tree_add_text(tf_tree,tvb, curr_offset, 1,"Not enough data");
4121 proto_tree_add_bits_item(tf_tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3), 2, FALSE);
4122 proto_tree_add_item(tf_tree, hf_gsm_a_tft_pkt_flt_dir, tvb, curr_offset, 1, FALSE);
4123 proto_tree_add_item(tf_tree, hf_gsm_a_tft_pkt_flt_id, tvb, curr_offset, 1, FALSE);
4127 if ((curr_offset-offset)<1) {
4128 proto_tree_add_text(tf_tree,tvb, curr_offset, 1,"Not enough data");
4131 oct = tvb_get_guint8(tvb, curr_offset);
4135 proto_tree_add_text(tf_tree,
4136 tvb, curr_offset-1, 1,
4137 "Packet evaluation precedence: 0x%02x (%u)",oct,oct );
4139 if ((curr_offset-offset)<1) { proto_tree_add_text(tf_tree,tvb, curr_offset, 1,"Not enough data"); return(len);}
4140 pf_length = tvb_get_guint8(tvb, curr_offset);
4144 proto_tree_add_text(tf_tree,
4145 tvb, curr_offset-1, 1,
4146 "Packet filter length: 0x%02x (%u)",pf_length,pf_length );
4147 /* New tree for component */
4149 /* Dissect Packet filter Component */
4150 /* while ( filter_len > 1 ) */
4151 /* packet filter component type identifier: */
4153 while (pf_length > 0 ){
4154 if ((curr_offset-offset)<1) {
4155 proto_tree_add_text(tf_tree,tvb, curr_offset, 1,"Not enough data");
4158 pack_component_type = tvb_get_guint8(tvb, curr_offset);
4163 tf=proto_tree_add_text(tf_tree,tvb, curr_offset-1, 1,"Packet filter component type identifier: ");
4164 comp_tree = proto_item_add_subtree(tf, ett_sm_tft );
4166 switch ( pack_component_type ){
4169 str="IPv4 remote address type";
4170 proto_tree_add_item(comp_tree,hf_gsm_a_sm_ip4_address,tvb,curr_offset,4,FALSE);
4173 proto_tree_add_item(comp_tree,hf_gsm_a_sm_ip4_mask,tvb,curr_offset,4,FALSE);
4180 str="IPv6 remote address type";
4181 proto_tree_add_item(comp_tree,hf_gsm_a_sm_ip6_address,tvb,curr_offset,16,FALSE);
4184 proto_tree_add_item(comp_tree,hf_gsm_a_sm_ip6_mask,tvb,curr_offset,16,FALSE);
4191 str="Protocol identifier/Next header type";
4192 proto_tree_add_item(comp_tree,hf_gsm_a_tft_protocol_header,tvb,curr_offset,1,FALSE);
4199 str="Single local port type";
4200 proto_tree_add_item(comp_tree,hf_gsm_a_tft_port,tvb,curr_offset,2,FALSE);
4207 str="Local port range type";
4208 proto_tree_add_item(comp_tree,hf_gsm_a_tft_port_low,tvb,curr_offset,2,FALSE);
4210 proto_tree_add_item(comp_tree,hf_gsm_a_tft_port_high,tvb,curr_offset,2,FALSE);
4217 str="Single remote port type";
4218 proto_tree_add_item(comp_tree,hf_gsm_a_tft_port,tvb,curr_offset,2,FALSE);
4225 str="Remote port range type";
4226 proto_tree_add_item(comp_tree,hf_gsm_a_tft_port_low,tvb,curr_offset,2,FALSE);
4228 proto_tree_add_item(comp_tree,hf_gsm_a_tft_port_high,tvb,curr_offset,2,FALSE);
4235 str="Security parameter index type";
4236 proto_tree_add_item(comp_tree,hf_gsm_a_tft_security,tvb,curr_offset,4,FALSE);
4244 str="Type of service/Traffic class type";
4245 proto_tree_add_item(comp_tree,hf_gsm_a_qos_traffic_cls,tvb,curr_offset,1,FALSE);
4247 proto_tree_add_item(comp_tree,hf_gsm_a_tft_traffic_mask,tvb,curr_offset,1,FALSE);
4254 str="Flow label type";
4255 proto_tree_add_bits_item(comp_tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3), 4, FALSE);
4256 proto_tree_add_item(comp_tree,hf_gsm_a_tft_flow_label_type,tvb,curr_offset,3,FALSE);
4263 str="not specified";
4264 curr_offset+=pf_length;
4265 curr_len-=pf_length;
4268 proto_item_append_text(tf, "%s (%u)", str, pack_component_type);
4274 /* The parameters list contains a variable number of parameters that might need to be
4275 * transferred in addition to the packet filters. If the parameters list is included, the E
4276 * bit is set to 1; otherwise, the E bit is set to 0.
4278 if ((e_bit == 1) && curr_len) {
4281 pf_length = tvb_get_guint8(tvb, curr_offset+1);
4282 tf = proto_tree_add_text(tree, tvb, curr_offset, pf_length+2, "Parameter %d" ,count);
4283 tf_tree = proto_item_add_subtree(tf, ett_sm_tft );
4284 param = tvb_get_guint8(tvb, curr_offset);
4285 proto_tree_add_item(tf_tree, hf_gsm_a_tft_param_id, tvb, curr_offset, 1, FALSE);
4290 proto_tree_add_text(tf_tree, tvb, curr_offset, pf_length, "Authorization token value: 0x%s",
4291 tvb_bytes_to_str(tvb, curr_offset, pf_length));
4295 proto_tree_add_text(tf_tree, tvb, curr_offset, 2, "Media Component number value: 0x%x",
4296 tvb_get_bits16(tvb, curr_offset<<3, 16, FALSE));
4297 proto_tree_add_text(tf_tree, tvb, curr_offset+2, 2, "IP flow number: 0x%x",
4298 tvb_get_bits16(tvb, (curr_offset+2)<<3, 16, FALSE));
4302 for (i = 0; i < pf_length; i++) {
4303 proto_tree_add_text(tf_tree, tvb, curr_offset+i, 1, "Packet filter identifier %d: %d",
4304 i, tvb_get_guint8(tvb, curr_offset+i));
4309 proto_tree_add_text(tf_tree, tvb, curr_offset, pf_length, "Parameter content: 0x%s",
4310 tvb_bytes_to_str(tvb, curr_offset, pf_length));
4313 curr_offset += pf_length;
4314 curr_len -= pf_length;
4319 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4325 * [9] 10.5.6.13 Temporary Mobile Group Identity (TMGI)
4328 de_sm_tmgi(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4330 guint32 curr_offset;
4332 curr_offset = offset;
4334 proto_tree_add_item(tree, hf_gsm_a_sm_tmgi, tvb, curr_offset, 3, FALSE);
4337 NO_MORE_DATA_CHECK(len);
4338 curr_offset = dissect_e212_mcc_mnc(tvb, gsm_a_dtap_pinfo, tree, curr_offset, TRUE);
4340 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4342 return(curr_offset - offset);
4346 * [9] 10.5.6.14 MBMS bearer capabilities
4349 de_sm_mbms_bearer_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4351 guint32 curr_offset, temp32;
4355 curr_offset = offset;
4357 oct = tvb_get_guint8(tvb, curr_offset);
4361 case 0x00: str="Subscribed maximum bit rate for downlink/reserved"; break;
4362 case 0xff: str="0 kbps"; break;
4363 default: str = ep_strdup_printf("%u kbps", qos_calc_bitrate(oct));
4366 proto_tree_add_uint_format_value(tree, hf_gsm_a_qos_max_bitrate_downl, tvb,
4367 curr_offset, 1, oct, "%s (%u)", str, oct);
4370 NO_MORE_DATA_CHECK(len);
4372 oct = tvb_get_guint8(tvb, curr_offset);
4375 str = "Use the value indicated by the Maximum bit rate for downlink";
4378 temp32 = qos_calc_ext_bitrate(oct);
4379 if (temp32 % 1000 == 0)
4380 str = ep_strdup_printf("%u Mbps", temp32 / 1000);
4382 str = ep_strdup_printf("%u kbps", temp32);
4384 proto_tree_add_uint_format_value(tree, hf_gsm_a_qos_max_bitrate_downl_ext, tvb,
4385 curr_offset, 1, oct, "%s (%u)", str, oct);
4389 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4391 return(curr_offset - offset);
4395 * [9] 10.5.6.15 MBMS protocol configuration options
4398 de_sm_mbms_prot_conf_opt(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4400 guint32 curr_offset;
4402 curr_offset = offset;
4403 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3), 8, FALSE);
4406 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4408 return(curr_offset - offset);
4412 * [9] 10.5.6.16 Enhanced network service access point identifier
4415 de_sm_enh_nsapi(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4420 oct = tvb_get_guint8(tvb, offset);
4424 else if (oct < 0xff)
4425 str = ep_strdup_printf("NSAPI %u for Multimedia Broadcast/Multicast Service (MBMS) Multicast mode", oct);
4427 str = "Reserved for use by lower layers in the p2p radio bearer allocation message for MBMS Broadcast mode";
4430 proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_enh_nsapi, tvb,
4431 offset, 1, oct, "%s (%u)", str, oct);
4433 /* no length check possible */
4438 * [9] 10.5.6.17 Request type
4440 static const value_string gsm_a_sm_req_type_vals[] = {
4441 { 0x01, "Initial request" },
4442 { 0x02, "Handover" },
4443 { 0x03, "Unused. If received, the network shall interpret this as \"Initial request\"." },
4448 de_sm_req_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4450 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (offset<<3) + 4, 1, FALSE);
4451 proto_tree_add_item(tree, hf_gsm_a_sm_req_type, tvb, offset, 1, FALSE);
4453 /* no length check possible */
4457 guint16 (*gm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
4458 /* GPRS Mobility Management Information Elements 10.5.5 */
4459 de_gmm_attach_res, /* Attach Result */
4460 de_gmm_attach_type, /* Attach Type */
4461 de_gmm_ciph_alg, /* Cipher Algorithm */
4462 de_gmm_tmsi_stat, /* TMSI Status */
4463 de_gmm_detach_type, /* Detach Type */
4464 de_gmm_drx_param, /* DRX Parameter */
4465 de_gmm_ftostby, /* Force to Standby */
4466 de_gmm_ftostby_h, /* Force to Standby - Info is in the high nibble */
4467 de_gmm_ptmsi_sig, /* P-TMSI Signature */
4468 de_gmm_ptmsi_sig2, /* P-TMSI Signature 2 */
4469 de_gmm_ident_type2, /* Identity Type 2 */
4470 de_gmm_imeisv_req, /* IMEISV Request */
4471 de_gmm_rec_npdu_lst, /* Receive N-PDU Numbers List */
4472 de_gmm_ms_net_cap, /* MS Network Capability */
4473 de_gmm_ms_radio_acc_cap,/* MS Radio Access Capability */
4474 de_gmm_cause, /* GMM Cause */
4475 de_gmm_rai, /* Routing Area Identification */
4476 de_gmm_update_res, /* Update Result */
4477 de_gmm_update_type, /* Update Type */
4478 de_gmm_ac_ref_nr, /* A&C Reference Number */
4479 de_gmm_ac_ref_nr_h, /* A&C Reference Numer - Info is in the high nibble */
4480 de_gmm_service_type, /* Service Type */
4481 NULL /* no associated data */, /* Cell Notification */
4482 de_gmm_ps_lcs_cap, /* PS LCS Capability */
4483 de_gmm_net_feat_supp, /* Network Feature Support */
4484 de_gmm_rat_info_container, /* Inter RAT information container */
4485 /* Session Management Information Elements 10.5.6 */
4486 de_sm_apn, /* Access Point Name */
4487 de_sm_nsapi, /* Network Service Access Point Identifier */
4488 de_sm_pco, /* Protocol Configuration Options */
4489 de_sm_pdp_addr, /* Packet Data Protocol Address */
4490 de_sm_qos, /* Quality Of Service */
4491 de_sm_cause, /* SM Cause */
4492 de_sm_cause_2, /* SM Cause 2 */
4493 de_sm_linked_ti, /* Linked TI */
4494 de_sm_sapi, /* LLC Service Access Point Identifier */
4495 de_sm_tear_down, /* Tear Down Indicator */
4496 de_sm_pflow_id, /* Packet Flow Identifier */
4497 de_sm_tflow_temp, /* Traffic Flow Template */
4498 de_sm_tmgi, /* Temporary Mobile Group Identity (TMGI) */
4499 de_sm_mbms_bearer_cap, /* MBMS bearer capabilities */
4500 de_sm_mbms_prot_conf_opt, /* MBMS protocol configuration options */
4501 de_sm_enh_nsapi, /* Enhanced network service access point identifier */
4502 de_sm_req_type, /* Request type */
4503 /* GPRS Common Information Elements 10.5.7 */
4504 de_gc_context_stat, /* PDP Context Status */
4505 de_gc_radio_prio, /* Radio Priority */
4506 de_gc_timer, /* GPRS Timer */
4507 de_gc_timer2, /* GPRS Timer 2 */
4508 de_gc_radio_prio2, /* Radio Priority 2 */
4509 de_gc_mbms_context_stat,/* 10.5.7.6 MBMS context status */
4513 /* MESSAGE FUNCTIONS */
4519 dtap_gmm_attach_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4521 guint32 curr_offset;
4525 curr_offset = offset;
4528 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
4530 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP, NULL);
4532 /* Included in attach type
4534 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_CIPH_KEY_SEQ_NUM );
4539 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_ATTACH_TYPE );
4541 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_DRX_PARAM );
4543 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID , NULL);
4545 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAI );
4547 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_MS_RAD_ACC_CAP , NULL);
4549 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, " - Old P-TMSI Signature");
4551 ELEM_OPT_TV( 0x17 , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER , " - Ready Timer" );
4553 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , NULL);
4555 ELEM_OPT_TLV( 0x33 , GSM_A_PDU_TYPE_GM, DE_PS_LCS_CAP , NULL);
4557 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4564 dtap_gmm_attach_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4566 guint32 curr_offset;
4570 curr_offset = offset;
4573 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
4575 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND_H );
4579 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_ATTACH_RES );
4581 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER );
4583 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAD_PRIO_2 );
4587 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAD_PRIO );
4589 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAI );
4591 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, NULL);
4593 ELEM_OPT_TV( 0x17 , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER , " - Negotiated Ready Timer" );
4595 ELEM_OPT_TLV( 0x18 , GSM_A_PDU_TYPE_COMMON, DE_MID , " - Allocated P-TMSI" );
4597 ELEM_OPT_TLV( 0x23 , GSM_A_PDU_TYPE_COMMON, DE_MID , NULL);
4599 ELEM_OPT_TV( 0x25 , GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE , NULL);
4601 ELEM_OPT_TLV( 0x2A , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2 , " - T3302" );
4603 ELEM_OPT_T( 0x8C , GSM_A_PDU_TYPE_GM, DE_CELL_NOT , NULL);
4605 ELEM_OPT_TLV( 0x4A , GSM_A_PDU_TYPE_COMMON, DE_PLMN_LIST , NULL);
4607 ELEM_OPT_TV_SHORT( 0xB0 , GSM_A_PDU_TYPE_GM, DE_NET_FEAT_SUP , NULL);
4609 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST , NULL);
4611 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4618 dtap_gmm_attach_com(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4621 guint32 curr_offset;
4622 /* guint32 consumed; */
4625 curr_offset = offset;
4628 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
4630 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4637 dtap_gmm_attach_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4639 guint32 curr_offset;
4643 curr_offset = offset;
4646 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
4648 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE );
4650 ELEM_OPT_TLV( 0x2A , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2 , " - T3302" );
4652 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4659 dtap_gmm_detach_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4661 guint32 curr_offset;
4665 curr_offset = offset;
4668 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
4670 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND_H );
4671 /* Force to standy might be wrong - To decode it correct, we need the direction */
4675 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_DETACH_TYPE );
4677 ELEM_OPT_TV( 0x25 , GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE , NULL);
4679 ELEM_OPT_TLV( 0x18 , GSM_A_PDU_TYPE_COMMON, DE_MID , " - P-TMSI" );
4681 ELEM_OPT_TLV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG , NULL);
4683 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4690 dtap_gmm_detach_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4692 guint32 curr_offset;
4696 curr_offset = offset;
4699 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
4701 if ( curr_len != 0 )
4703 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_SPARE_NIBBLE );
4707 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND );
4710 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4717 dtap_gmm_ptmsi_realloc_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4719 guint32 curr_offset;
4723 curr_offset = offset;
4726 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
4728 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID , " - Allocated P-TMSI" );
4730 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAI );
4732 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_SPARE_NIBBLE );
4736 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND );
4738 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_COMMON, DE_MID , " - P-TMSI Signature" );
4740 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4747 dtap_gmm_ptmsi_realloc_com(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4749 guint32 curr_offset;
4750 /* guint32 consumed; */
4753 curr_offset = offset;
4756 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
4758 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4765 dtap_gmm_auth_ciph_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4767 guint32 curr_offset;
4772 curr_offset = offset;
4775 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
4777 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_IMEISV_REQ );
4781 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_CIPH_ALG );
4783 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_AC_REF_NUM_H );
4787 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND );
4789 ELEM_OPT_TV( 0x21 , GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_RAND , NULL);
4792 ELEM_OPT_TV_SHORT( 0x08 , GSM_A_PDU_TYPE_COMMON, DE_CIPH_KEY_SEQ_NUM , NULL);
4796 oct = tvb_get_guint8(tvb, curr_offset);
4797 if (( oct & 0xf0 ) == 0x80 )
4799 /* The ciphering key sequence number is added here */
4800 proto_tree_add_text(tree,
4801 tvb, curr_offset, 1,
4802 "Ciphering key sequence number: 0x%02x (%u)",
4811 if ( curr_len == 0 )
4813 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4817 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_AUTN , NULL);
4819 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4826 dtap_gmm_auth_ciph_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4828 guint32 curr_offset;
4832 curr_offset = offset;
4835 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
4837 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_SPARE_NIBBLE );
4841 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_AC_REF_NUM );
4843 ELEM_OPT_TV( 0x22 , GSM_A_PDU_TYPE_DTAP, DE_AUTH_RESP_PARAM , NULL);
4845 ELEM_OPT_TLV( 0x23 , GSM_A_PDU_TYPE_COMMON, DE_MID , " - IMEISV" );
4847 ELEM_OPT_TLV( 0x29 , GSM_A_PDU_TYPE_DTAP, DE_AUTH_RESP_PARAM_EXT , NULL);
4849 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4856 dtap_gmm_auth_ciph_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4858 guint32 curr_offset;
4861 curr_offset = offset;
4864 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
4866 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4873 dtap_gmm_auth_ciph_fail(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4875 guint32 curr_offset;
4879 curr_offset = offset;
4882 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
4884 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE );
4886 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_DTAP, DE_AUTH_FAIL_PARAM , NULL);
4888 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4895 dtap_gmm_ident_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4897 guint32 curr_offset;
4900 curr_offset = offset;
4903 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
4905 /* If the half octect that are about to get decoded is the LAST in the octetstream, the macro will call return BEFORE we get a chance to fix the index. The end result will be that the first half-octet will be decoded but not the last. */
4907 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_ID_TYPE_2 );
4910 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND_H );
4913 elem_v(tvb, tree, GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND_H, curr_offset);
4914 elem_v(tvb, tree, GSM_A_PDU_TYPE_GM, DE_ID_TYPE_2, curr_offset);
4919 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4926 dtap_gmm_ident_res(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4928 guint32 curr_offset;
4932 curr_offset = offset;
4935 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
4937 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID , NULL);
4939 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4946 dtap_gmm_rau_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4948 guint32 curr_offset;
4952 curr_offset = offset;
4955 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
4957 /* is included in update type
4958 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_CIPH_KEY_SEQ_NUM );
4963 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_UPD_TYPE );
4965 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAI );
4967 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_MS_RAD_ACC_CAP , NULL);
4969 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG , " - Old P-TMSI Signature" );
4971 ELEM_OPT_TV( 0x17 , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER , " - Requested Ready Timer" );
4973 ELEM_OPT_TV( 0x27 , GSM_A_PDU_TYPE_GM, DE_DRX_PARAM , NULL);
4975 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , NULL);
4977 ELEM_OPT_TLV( 0x18 , GSM_A_PDU_TYPE_COMMON, DE_MID , " - P-TMSI" );
4979 ELEM_OPT_TLV( 0x31 , GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP , NULL);
4981 ELEM_OPT_TLV( 0x32 , GSM_A_PDU_TYPE_GM, DE_PDP_CONTEXT_STAT , NULL);
4983 ELEM_OPT_TLV( 0x33 , GSM_A_PDU_TYPE_GM, DE_PS_LCS_CAP , NULL);
4985 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4992 dtap_gmm_rau_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4994 guint32 curr_offset;
4998 curr_offset = offset;
5001 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
5003 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_UPD_RES );
5007 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND );
5009 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER );
5011 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAI );
5013 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG , NULL);
5015 ELEM_OPT_TLV( 0x18 , GSM_A_PDU_TYPE_COMMON, DE_MID , " - Allocated P-TMSI");
5017 ELEM_OPT_TLV( 0x23 , GSM_A_PDU_TYPE_COMMON, DE_MID , NULL);
5019 ELEM_OPT_TLV( 0x26 , GSM_A_PDU_TYPE_GM, DE_REC_N_PDU_NUM_LIST , NULL);
5021 ELEM_OPT_TV( 0x17 , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER , " - Negotiated Ready Timer" );
5023 ELEM_OPT_TV( 0x25 , GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE , NULL);
5025 ELEM_OPT_TLV( 0x2A , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2 , " - T3302" );
5027 ELEM_OPT_T( 0x8C , GSM_A_PDU_TYPE_GM, DE_CELL_NOT , NULL);
5029 ELEM_OPT_TLV( 0x4A , GSM_A_PDU_TYPE_COMMON, DE_PLMN_LIST , NULL);
5031 ELEM_OPT_TLV( 0x32 , GSM_A_PDU_TYPE_GM, DE_PDP_CONTEXT_STAT , NULL);
5033 ELEM_OPT_TV_SHORT ( 0xB0 , GSM_A_PDU_TYPE_GM, DE_NET_FEAT_SUP , NULL);
5035 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST , NULL);
5037 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5044 dtap_gmm_rau_com(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5046 guint32 curr_offset;
5050 curr_offset = offset;
5053 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
5055 ELEM_OPT_TLV( 0x26 , GSM_A_PDU_TYPE_GM, DE_REC_N_PDU_NUM_LIST , NULL);
5056 /* Inter RAT information container 10.5.5.24 TS 24.008 version 6.8.0 Release 6 */
5057 /*TO DO: Implement */
5058 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_RAT_INFO_CONTAINER , NULL);
5060 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5067 dtap_gmm_rau_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5069 guint32 curr_offset;
5073 curr_offset = offset;
5076 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
5078 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE );
5080 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_SPARE_NIBBLE );
5084 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND );
5086 ELEM_OPT_TLV( 0x26 , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2 , " - T3302" );
5088 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5095 dtap_gmm_status(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5097 guint32 curr_offset;
5101 curr_offset = offset;
5104 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5106 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE );
5108 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5112 * [8] 9.4.19 GMM Information
5115 dtap_gmm_information(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5117 guint32 curr_offset;
5121 curr_offset = offset;
5124 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
5126 ELEM_OPT_TLV( 0x43 , GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME , " - Full Name" );
5128 ELEM_OPT_TLV( 0x45 , GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME , " - Short Name" );
5130 ELEM_OPT_TV( 0x46 , GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE , NULL);
5132 ELEM_OPT_TV( 0x47 , GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE_TIME , NULL);
5134 ELEM_OPT_TLV( 0x48 , GSM_A_PDU_TYPE_DTAP, DE_LSA_ID , NULL);
5136 ELEM_OPT_TLV( 0x49 , GSM_A_PDU_TYPE_DTAP, DE_DAY_SAVING_TIME , NULL);
5138 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5145 dtap_gmm_service_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5147 guint32 curr_offset;
5151 curr_offset = offset;
5154 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
5156 /* Is included in SRVC TYPE
5157 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_CIPH_KEY_SEQ_NUM );
5162 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SRVC_TYPE );
5164 /* P-TMSI Mobile station identity 10.5.1.4 M LV 6 */
5165 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, NULL);
5167 ELEM_OPT_TLV( 0x32 , GSM_A_PDU_TYPE_GM, DE_PDP_CONTEXT_STAT , NULL);
5169 /* MBMS context status 10.5.7.6 TLV 2 - 18 */
5170 ELEM_OPT_TLV( 0x35 , GSM_A_PDU_TYPE_GM, DE_MBMS_CTX_STATUS , NULL);
5172 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5179 dtap_gmm_service_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5181 guint32 curr_offset;
5185 curr_offset = offset;
5188 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
5190 ELEM_OPT_TLV( 0x32 , GSM_A_PDU_TYPE_GM, DE_PDP_CONTEXT_STAT , NULL);
5192 /* MBMS context status 10.5.7.6 TLV 2 - 18 */
5193 ELEM_OPT_TLV( 0x35 , GSM_A_PDU_TYPE_GM, DE_MBMS_CTX_STATUS , NULL);
5195 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5202 dtap_gmm_service_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5204 guint32 curr_offset;
5208 curr_offset = offset;
5211 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
5213 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE );
5215 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5219 * [8] 9.5.1 Activate PDP context request
5220 * Direction: MS to network
5223 dtap_sm_act_pdp_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5225 guint32 curr_offset;
5229 curr_offset = offset;
5232 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5234 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
5236 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_NET_SAPI );
5238 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_LLC_SAPI );
5240 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_QOS , " - Requested QoS" );
5242 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_PD_PRO_ADDR , " - Requested PDP address" );
5244 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL);
5246 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5248 ELEM_OPT_TV_SHORT(0xA0, GSM_A_PDU_TYPE_GM, DE_REQ_TYPE, NULL);
5250 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5254 * [9] 9.5.2 Activate PDP context accept
5255 * Direction: network to MS
5258 dtap_sm_act_pdp_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5260 guint32 curr_offset;
5264 curr_offset = offset;
5267 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5269 gsm_a_dtap_pinfo->link_dir = P2P_DIR_DL;
5271 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_LLC_SAPI );
5273 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
5276 /* This is done automatically */
5277 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SPARE );
5282 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAD_PRIO );
5284 ELEM_OPT_TLV( 0x2B , GSM_A_PDU_TYPE_GM, DE_PD_PRO_ADDR , NULL);
5286 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5288 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL);
5290 ELEM_OPT_TLV( 0x39 , GSM_A_PDU_TYPE_GM, DE_SM_CAUSE_2, NULL );
5292 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5296 * [8] 9.5.3 Activate PDP context reject
5297 * Direction: network to MS
5300 dtap_sm_act_pdp_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5302 guint32 curr_offset;
5306 curr_offset = offset;
5309 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5311 gsm_a_dtap_pinfo->link_dir = P2P_DIR_DL;
5313 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SM_CAUSE );
5315 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5317 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5321 * [8] 9.5.4 Activate Secondary PDP Context Request
5322 * Direction: MS to network
5325 dtap_sm_act_sec_pdp_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5327 guint32 curr_offset;
5331 curr_offset = offset;
5334 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5336 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
5338 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_NET_SAPI );
5340 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_LLC_SAPI );
5342 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_QOS , " - Requested QoS" );
5344 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_LINKED_TI , NULL);
5346 /* 3GPP TS 24.008 version 6.8.0 Release 6, 36 TFT Traffic Flow Template 10.5.6.12 O TLV 3-257 */
5347 ELEM_OPT_TLV( 0x36 , GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , NULL);
5349 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5351 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5355 * [7] 9.5.5 Activate Secondary PDP Context Accept
5356 * Direction: network to MS
5359 dtap_sm_act_sec_pdp_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5361 guint32 curr_offset;
5365 curr_offset = offset;
5368 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5370 gsm_a_dtap_pinfo->link_dir = P2P_DIR_DL;
5372 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_LLC_SAPI );
5374 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
5376 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAD_PRIO);
5379 /* This is done automatically */
5380 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SPARE );
5385 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL);
5387 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5389 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5393 * [8] 9.5.6 Activate Secondary PDP Context Reject
5394 * Direction: network to MS
5397 dtap_sm_act_sec_pdp_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5399 guint32 curr_offset;
5403 curr_offset = offset;
5406 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5408 gsm_a_dtap_pinfo->link_dir = P2P_DIR_DL;
5410 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SM_CAUSE );
5412 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5414 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5418 * [8] 9.5.7 Request PDP context activation
5419 * Direction: network to MS
5422 dtap_sm_req_pdp_act(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5424 guint32 curr_offset;
5428 curr_offset = offset;
5431 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5433 gsm_a_dtap_pinfo->link_dir = P2P_DIR_DL;
5435 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_PD_PRO_ADDR , " - Offered PDP address" );
5437 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL);
5439 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5441 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5445 * [8] 9.5.8 Request PDP context activation reject
5446 * Direction: MS to network
5449 dtap_sm_req_pdp_act_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5451 guint32 curr_offset;
5455 curr_offset = offset;
5458 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5460 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
5462 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SM_CAUSE );
5464 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5466 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5470 * [8] 9.5.9 Modify PDP context request (Network to MS direction)
5471 * Direction: network to MS
5474 dtap_sm_mod_pdp_req_net(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5476 guint32 curr_offset;
5480 curr_offset = offset;
5483 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5485 gsm_a_dtap_pinfo->link_dir = P2P_DIR_DL;
5487 ELEM_MAND_V(GSM_A_PDU_TYPE_GM,DE_RAD_PRIO);
5489 /* This is done automatically */
5490 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SPARE );
5495 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_LLC_SAPI );
5497 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_QOS , " - New QoS" );
5499 ELEM_OPT_TLV( 0x2B , GSM_A_PDU_TYPE_GM, DE_PD_PRO_ADDR , NULL);
5501 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL);
5503 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5505 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5509 * [8] 9.5.10 Modify PDP context request (MS to network direction)
5510 * Direction: MS to network
5513 dtap_sm_mod_pdp_req_ms(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5515 guint32 curr_offset;
5519 curr_offset = offset;
5522 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5524 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
5526 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Requested LLC SAPI" );
5528 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Requested new QoS" );
5530 ELEM_OPT_TLV( 0x31 , GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , " - New TFT" );
5532 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5534 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5538 * [8] 9.5.11 Modify PDP context accept (MS to network direction)
5539 * Direction: MS to network
5542 dtap_sm_mod_pdp_acc_ms(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5544 guint32 curr_offset;
5548 curr_offset = offset;
5551 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5553 gsm_a_dtap_pinfo->link_dir = P2P_DIR_UL;
5555 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5557 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5561 * [8] 9.5.12 Modify PDP context accept (Network to MS direction)
5562 * Direction: Network to MS
5565 dtap_sm_mod_pdp_acc_net(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5567 guint32 curr_offset;
5571 curr_offset = offset;
5574 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5576 gsm_a_dtap_pinfo->link_dir = P2P_DIR_DL;
5578 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
5580 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
5582 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , " - New radio priority" );
5584 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL);
5586 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5588 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5592 * [8] 9.5.13 Modify PDP Context Reject
5596 dtap_sm_mod_pdp_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5598 guint32 curr_offset;
5602 curr_offset = offset;
5605 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5606 /* Network or the MS */
5607 gsm_a_dtap_pinfo->link_dir = LINK_DIR_UNKNOWN;
5610 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SM_CAUSE );
5612 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5614 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5618 * [8] 9.5.14 Deactivate PDP context request
5622 dtap_sm_deact_pdp_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5624 guint32 curr_offset;
5628 curr_offset = offset;
5631 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5632 gsm_a_dtap_pinfo->link_dir = LINK_DIR_UNKNOWN;
5634 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SM_CAUSE );
5636 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM , DE_TEAR_DOWN_IND , NULL);
5638 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5640 /* MBMS context status 10.5.7.6 TLV 2 - 18 */
5641 ELEM_OPT_TLV( 0x35 , GSM_A_PDU_TYPE_GM, DE_MBMS_CTX_STATUS , NULL);
5643 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5647 * [8] 9.5.15 Deactivate PDP context accept
5651 dtap_sm_deact_pdp_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5653 guint32 curr_offset;
5657 curr_offset = offset;
5660 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5661 gsm_a_dtap_pinfo->link_dir = LINK_DIR_UNKNOWN;
5663 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5665 /* MBMS context status 10.5.7.6 TLV 2 - 18 */
5666 ELEM_OPT_TLV( 0x35 , GSM_A_PDU_TYPE_GM, DE_MBMS_CTX_STATUS , NULL);
5668 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5672 * [8] 9.5.21 SM Status
5676 dtap_sm_status(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5678 guint32 curr_offset;
5682 curr_offset = offset;
5685 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5686 gsm_a_dtap_pinfo->link_dir = LINK_DIR_UNKNOWN;
5688 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SM_CAUSE );
5690 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5694 * [9] 9.5.22 Activate MBMS Context Request
5695 * Direction: MS to network
5698 dtap_sm_act_mbms_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5700 guint32 curr_offset;
5704 curr_offset = offset;
5707 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
5709 /* Requested MBMS NSAPI Enhanced Network service access point identifier 10.5.6.16 M V */
5710 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_ENH_NSAPI );
5712 /* Requested LLC SAPI LLC service access point identifier 10.5.6.9 M V 1 */
5713 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_LLC_SAPI );
5715 /* Supported MBMS bearer capabilities MBMS bearer capabilities 10.5.6.14 M LV 2 - 3 */
5716 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_MBMS_BEARER_CAP , NULL );
5718 /* Requested multicast address Packet data protocol address 10.5.6.4 M LV 3 - 19 */
5719 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_PD_PRO_ADDR , " - Requested multicast address" );
5721 /* Access point name Access point name 10.5.6.1 M LV 2 - 101 */
5722 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL );
5724 /* 35 MBMS protocol configuration options MBMS protocol configuration options 10.5.6.15 O TLV 3 - 253 */
5725 ELEM_OPT_TLV( 0x35 , GSM_A_PDU_TYPE_GM, DE_MBMS_PROT_CONF_OPT , NULL);
5727 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5731 * [9] 9.5.23 Activate MBMS Context Accept
5732 * Direction: network to MS
5735 dtap_sm_act_mbms_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5737 guint32 curr_offset;
5741 curr_offset = offset;
5744 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
5746 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_TMGI, NULL);
5748 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_LLC_SAPI );
5750 ELEM_OPT_TLV( 0x35 , GSM_A_PDU_TYPE_GM, DE_MBMS_PROT_CONF_OPT , NULL);
5752 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5756 * [9] 9.5.24 Activate MBMS Context Reject
5757 * Direction: network to MS
5760 dtap_sm_act_mbms_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5762 guint32 curr_offset;
5766 curr_offset = offset;
5769 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
5771 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SM_CAUSE );
5773 ELEM_OPT_TLV( 0x35 , GSM_A_PDU_TYPE_GM, DE_MBMS_PROT_CONF_OPT , NULL);
5775 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5779 * [9] 9.5.25 Request MBMS Context Activation
5780 * Direction: network to MS
5783 dtap_sm_req_mbms_act(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5785 guint32 curr_offset;
5789 curr_offset = offset;
5792 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
5794 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_NET_SAPI );
5796 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_PD_PRO_ADDR , " - Offered multicast address" );
5798 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL );
5800 ELEM_OPT_TLV( 0x35 , GSM_A_PDU_TYPE_GM, DE_MBMS_PROT_CONF_OPT , NULL);
5802 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5806 * [8] 9.5.26 Request MBMS Context Activation Reject
5807 * Direction: MS to network
5810 dtap_sm_req_mbms_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5812 guint32 curr_offset;
5816 curr_offset = offset;
5819 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
5821 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SM_CAUSE );
5823 ELEM_OPT_TLV( 0x35 , GSM_A_PDU_TYPE_GM, DE_MBMS_PROT_CONF_OPT , NULL);
5825 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5828 #define NUM_GSM_DTAP_MSG_GMM (sizeof(gsm_a_dtap_msg_gmm_strings)/sizeof(value_string))
5829 static gint ett_gsm_dtap_msg_gmm[NUM_GSM_DTAP_MSG_GMM];
5830 static void (*dtap_msg_gmm_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
5831 dtap_gmm_attach_req, /* Attach Request */
5832 dtap_gmm_attach_acc, /* Attach Accept */
5833 dtap_gmm_attach_com, /* Attach Complete */
5834 dtap_gmm_attach_rej, /* Attach Reject */
5835 dtap_gmm_detach_req, /* Detach Request */
5836 dtap_gmm_detach_acc, /* Detach Accept */
5837 dtap_gmm_rau_req, /* Routing Area Update Request */
5838 dtap_gmm_rau_acc, /* Routing Area Update Accept */
5839 dtap_gmm_rau_com, /* Routing Area Update Complete */
5840 dtap_gmm_rau_rej, /* Routing Area Update Reject */
5841 dtap_gmm_service_req, /* Service Request */
5842 dtap_gmm_service_acc, /* Service Accept */
5843 dtap_gmm_service_rej, /* Service Reject */
5844 dtap_gmm_ptmsi_realloc_cmd, /* P-TMSI Reallocation Command */
5845 dtap_gmm_ptmsi_realloc_com, /* P-TMSI Reallocation Complete */
5846 dtap_gmm_auth_ciph_req, /* Authentication and Ciphering Req */
5847 dtap_gmm_auth_ciph_resp, /* Authentication and Ciphering Resp */
5848 dtap_gmm_auth_ciph_rej, /* Authentication and Ciphering Rej */
5849 dtap_gmm_auth_ciph_fail, /* Authentication and Ciphering Failure */
5850 dtap_gmm_ident_req, /* Identity Request */
5851 dtap_gmm_ident_res, /* Identity Response */
5852 dtap_gmm_status, /* GMM Status */
5853 dtap_gmm_information, /* GMM Information */
5857 #define NUM_GSM_DTAP_MSG_SM (sizeof(gsm_a_dtap_msg_sm_strings)/sizeof(value_string))
5858 static gint ett_gsm_dtap_msg_sm[NUM_GSM_DTAP_MSG_SM];
5859 static void (*dtap_msg_sm_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
5860 dtap_sm_act_pdp_req, /* Activate PDP Context Request */
5861 dtap_sm_act_pdp_acc, /* Activate PDP Context Accept */
5862 dtap_sm_act_pdp_rej, /* Activate PDP Context Reject */
5863 dtap_sm_req_pdp_act, /* Request PDP Context Activation */
5864 dtap_sm_req_pdp_act_rej, /* Request PDP Context Activation rej. */
5865 dtap_sm_deact_pdp_req, /* Deactivate PDP Context Request */
5866 dtap_sm_deact_pdp_acc, /* Deactivate PDP Context Accept */
5867 dtap_sm_mod_pdp_req_net, /* Modify PDP Context Request(Network to MS direction) */
5868 dtap_sm_mod_pdp_acc_ms, /* Modify PDP Context Accept (MS to network direction) */
5869 dtap_sm_mod_pdp_req_ms, /* Modify PDP Context Request(MS to network direction) */
5870 dtap_sm_mod_pdp_acc_net, /* Modify PDP Context Accept (Network to MS direction) */
5871 dtap_sm_mod_pdp_rej, /* Modify PDP Context Reject */
5872 dtap_sm_act_sec_pdp_req, /* Activate Secondary PDP Context Request */
5873 dtap_sm_act_sec_pdp_acc, /* Activate Secondary PDP Context Accept */
5874 dtap_sm_act_sec_pdp_rej, /* Activate Secondary PDP Context Reject */
5875 NULL, /* Reserved: was allocated in earlier phases of the protocol */
5876 NULL, /* Reserved: was allocated in earlier phases of the protocol */
5877 NULL, /* Reserved: was allocated in earlier phases of the protocol */
5878 NULL, /* Reserved: was allocated in earlier phases of the protocol */
5879 NULL, /* Reserved: was allocated in earlier phases of the protocol */
5880 dtap_sm_status, /* SM Status */
5881 dtap_sm_act_mbms_req, /* Activate MBMS Context Request */
5882 dtap_sm_act_mbms_acc, /* Activate MBMS Context Accept */
5883 dtap_sm_act_mbms_rej, /* Activate MBMS Context Reject */
5884 dtap_sm_req_mbms_act, /* Request MBMS Context Activation */
5885 dtap_sm_req_mbms_rej, /* Request MBMS Context Activation Reject */
5889 void get_gmm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *dtap_msg_fcn)
5893 *msg_str = match_strval_idx((guint32) (oct & DTAP_GMM_IEI_MASK), gsm_a_dtap_msg_gmm_strings, &idx);
5894 *ett_tree = ett_gsm_dtap_msg_gmm[idx];
5895 *hf_idx = hf_gsm_a_dtap_msg_gmm_type;
5896 *dtap_msg_fcn = dtap_msg_gmm_fcn[idx];
5901 void get_sm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *dtap_msg_fcn)
5905 *msg_str = match_strval_idx((guint32) (oct & DTAP_SM_IEI_MASK), gsm_a_dtap_msg_sm_strings, &idx);
5906 *ett_tree = ett_gsm_dtap_msg_sm[idx];
5907 *hf_idx = hf_gsm_a_dtap_msg_sm_type;
5908 *dtap_msg_fcn = dtap_msg_sm_fcn[idx];
5913 /* Register the protocol with Wireshark */
5915 proto_register_gsm_a_gm(void)
5920 /* Setup list of header fields */
5922 static hf_register_info hf[] =
5924 { &hf_gsm_a_dtap_msg_gmm_type,
5925 { "DTAP GPRS Mobility Management Message Type", "gsm_a.dtap_msg_gmm_type",
5926 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_gmm_strings), 0x0,
5929 { &hf_gsm_a_dtap_msg_sm_type,
5930 { "DTAP GPRS Session Management Message Type", "gsm_a.dtap_msg_sm_type",
5931 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_sm_strings), 0x0,
5934 { &hf_gsm_a_gm_elem_id,
5935 { "Element ID", "gsm_a_gm.elem_id",
5936 FT_UINT8, BASE_DEC, NULL, 0,
5939 { &hf_gsm_a_qos_delay_cls,
5940 { "Quality of Service Delay class", "gsm_a.qos.delay_cls",
5941 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_delay_cls_vals), 0x38,
5944 { &hf_gsm_a_qos_reliability_cls,
5945 { "Reliability class", "gsm_a.qos.delay_cls",
5946 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_delay_cls_vals), 0x07,
5949 { &hf_gsm_a_qos_traffic_cls,
5950 { "Traffic class", "gsm_a.qos.traffic_cls",
5951 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_traffic_cls_vals), 0xe0,
5954 { &hf_gsm_a_qos_del_order,
5955 { "Delivery order", "gsm_a.qos.del_order",
5956 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_traffic_cls_vals), 0x18,
5959 { &hf_gsm_a_qos_del_of_err_sdu,
5960 { "Delivery of erroneous SDUs", "gsm_a.qos.del_of_err_sdu",
5961 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_del_of_err_sdu_vals), 0x03,
5964 { &hf_gsm_a_qos_ber,
5965 { "Residual Bit Error Rate (BER)", "gsm_a.qos.ber",
5966 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_ber_vals), 0xf0,
5969 { &hf_gsm_a_qos_sdu_err_rat,
5970 { "SDU error ratio", "gsm_a.qos.sdu_err_rat",
5971 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_sdu_err_rat_vals), 0x0f,
5974 { &hf_gsm_a_qos_traff_hdl_pri,
5975 { "Traffic handling priority", "gsm_a.qos.traff_hdl_pri",
5976 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_traff_hdl_pri_vals), 0x03,
5979 { &hf_gsm_a_gmm_split_on_ccch,
5980 { "SPLIT on CCCH","gsm_a.gmm.split_on_ccch",
5981 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_split_on_ccch_value), 0x08,
5984 { &hf_gsm_a_gmm_non_drx_timer,
5985 { "Non-DRX timer","gsm_a.gmm.non_drx_timer",
5986 FT_UINT8, BASE_DEC, VALS(gsm_a_gmm_non_drx_timer_strings), 0x07,
5989 { &hf_gsm_a_gmm_cn_spec_drs_cycle_len_coef,
5990 { "CN Specific DRX cycle length coefficient","gsm_a.gmm.cn_spec_drs_cycle_len_coef",
5991 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gsm_a_gmm_cn_spec_drs_cycle_len_coef_strings), 0xf0,
5994 { &hf_gsm_a_tft_op_code,
5995 { "TFT operation code", "gsm_a.tft.op_code",
5996 FT_UINT8, BASE_DEC, VALS(gsm_a_tft_op_code_vals), 0xe0,
5999 { &hf_gsm_a_tft_e_bit,
6000 { "E bit","gsm_a.tft.e_bit",
6001 FT_BOOLEAN, 8, TFS(&gsm_a_tft_e_bit), 0x10,
6004 { &hf_gsm_a_tft_pkt_flt,
6005 { "Number of packet filters", "gsm_a.tft.pkt_flt",
6006 FT_UINT8, BASE_DEC, NULL, 0x0f,
6009 { &hf_gsm_a_tft_pkt_flt_dir,
6010 { "Packet filter direction", "gsm_a.tft.pkt_flt_dir",
6011 FT_UINT8, BASE_DEC, VALS(gsm_a_tft_pkt_flt_dir_vals), 0x30,
6014 { &hf_gsm_a_tft_pkt_flt_id,
6015 { "Packet filter identifier", "gsm_a.tft.pkt_flt_id",
6016 FT_UINT8, BASE_DEC, NULL, 0x0f,
6019 { &hf_gsm_a_sm_ip4_address,
6020 { "IPv4 adress", "gsm_a.sm.ip4_address",
6021 FT_IPv4, BASE_NONE, NULL, 0x0,
6024 { &hf_gsm_a_sm_ip4_mask,
6025 { "IPv4 address mask", "gsm_a.sm.ip4_mask",
6026 FT_IPv4, BASE_NONE, NULL, 0x0,
6029 { &hf_gsm_a_sm_ip6_address,
6030 { "IPv6 adress", "gsm_a.sm.ip6_address",
6031 FT_IPv6, BASE_NONE, NULL, 0x0,
6034 { &hf_gsm_a_sm_ip6_mask,
6035 { "IPv6 adress mask", "gsm_a.sm.ip6_mask",
6036 FT_IPv6, BASE_NONE, NULL, 0x0,
6039 { &hf_gsm_a_tft_protocol_header,
6040 { "Protocol/header", "gsm_a.tft.protocol_header",
6041 FT_UINT8, BASE_HEX, NULL, 0x0,
6044 { &hf_gsm_a_tft_port,
6045 { "Port", "gsm_a.tft.port",
6046 FT_UINT16, BASE_DEC, NULL, 0x0,
6049 { &hf_gsm_a_tft_port_low,
6050 { "Low limit port", "gsm_a.tft.port_low",
6051 FT_UINT16, BASE_DEC, NULL, 0x0,
6054 { &hf_gsm_a_tft_port_high,
6055 { "High limit port", "gsm_a.tft.port_high",
6056 FT_UINT16, BASE_DEC, NULL, 0x0,
6059 { &hf_gsm_a_tft_security,
6060 { "IPSec security parameter index", "gsm_a.tft.security",
6061 FT_UINT32, BASE_HEX, NULL, 0x0,
6064 { &hf_gsm_a_tft_traffic_mask,
6065 { "Mask field", "gsm_a.tft.traffic_mask",
6066 FT_UINT8, BASE_HEX, NULL, 0x0,
6069 { &hf_gsm_a_tft_flow_label_type,
6070 { "Flow Label Type", "gsm_a.tft.flow_label_type",
6071 FT_UINT24, BASE_HEX, NULL, 0x0FFFFF,
6074 { &hf_gsm_a_tft_param_id,
6075 { "Parameter identifier", "gsm_a.tft.param_id",
6076 FT_UINT8, BASE_DEC, VALS(gsm_a_tft_param_id_vals), 0x0,
6079 { &hf_gsm_a_ptmsi_sig,
6080 { "P-TMSI Signature", "gsm_a.ptmsi_sig",
6081 FT_UINT24, BASE_HEX, NULL, 0x0,
6084 { &hf_gsm_a_ptmsi_sig2,
6085 { "P-TMSI Signature 2", "gsm_a.ptmsi_sig2",
6086 FT_UINT24, BASE_HEX, NULL, 0x0,
6089 { &hf_gsm_a_gm_acc_tech_type,
6090 { "Access Technology Type", "gsm_a.gm.acc_tech_type",
6091 FT_UINT8, BASE_DEC, VALS(gsm_a_gm_acc_tech_type_vals), 0x0,
6094 { &hf_gsm_a_gm_acc_cap_struct_len,
6095 { "Length in bits", "gsm_a.gm.acc_cap_struct_len",
6096 FT_UINT8, BASE_HEX_DEC,NULL, 0x0,
6099 { &hf_gsm_a_gm_sms_value,
6100 { "SMS_VALUE (Switch-Measure-Switch)", "gsm_a.gm.sms",
6101 FT_UINT8, BASE_DEC, VALS(gsm_a_sms_vals), 0x0,
6104 { &hf_gsm_a_gm_sm_value,
6105 { "(SM_VALUE) Switch-Measure", "gsm_a.gm.sm",
6106 FT_UINT8, BASE_DEC, VALS(gsm_a_sms_vals), 0x0,
6109 { &hf_gsm_a_gm_sm_ext,
6110 { "Ext", "gsm_a.gm.sm.ext",
6111 FT_UINT8, BASE_HEX, NULL, 0x80,
6114 { &hf_gsm_a_gm_link_dir,
6115 { "Link direction", "gsm_a.gm.link_dir",
6116 FT_INT32, BASE_DEC, VALS(gsm_a_gm_link_dir_vals), 0x0,
6119 { &hf_gsm_a_gm_cause,
6120 { "gmm Cause", "gsm_a.gm.cause",
6121 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gmm_cause_vals), 0x0,
6125 { "Follow-on proceed", "gsm_a.gm.fop",
6126 FT_BOOLEAN, 8, NULL, 0x08,
6129 { &hf_gsm_a_gm_res_of_attach,
6130 { "Result of attach", "gsm_a.gm.res_of_attach",
6131 FT_UINT8, BASE_DEC, VALS(gsm_a_gm_res_of_attach_vals), 0x07,
6134 { &hf_gsm_a_gm_type_of_ciph_alg,
6135 { "Type of ciphering algorithm", "gsm_a.gm.type_of_ciph_alg",
6136 FT_UINT8, BASE_DEC, VALS(gsm_a_gm_type_of_ciph_alg_vals), 0x07,
6139 { &hf_gsm_a_gm_imeisv_req,
6140 { "IMEISV request", "gsm_a.gm.imeisv_req",
6141 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gsm_a_gm_imeisv_req_vals), 0x00,
6144 { &hf_gsm_a_gm_ac_ref_nr,
6145 { "A&C reference number", "gsm_a.gm.ac_ref_nr",
6146 FT_UINT8, BASE_DEC, NULL, 0x0,
6149 { &hf_gsm_a_gm_force_to_standby,
6150 { "Force to standby", "gsm_a.gm.force_to_standby",
6151 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gsm_a_gm_force_to_standby_vals), 0x00,
6154 { &hf_gsm_a_gm_ciph_key_seq_num,
6155 { "Ciphering key sequence number", "gsm_a.gm.ciph_key_seq_num",
6156 FT_UINT8, BASE_DEC, NULL, 0x00,
6159 { &hf_gsm_a_gm_serv_type,
6160 { "Service type", "gsm_a.gm.serv_type",
6161 FT_UINT8, BASE_DEC, VALS(gsm_a_gm_serv_type_vals), 0x00,
6165 { "Follow-on request pending", "gsm_a.gm.for",
6166 FT_BOOLEAN, 8, NULL, 0x08,
6169 { &hf_gsm_a_gm_type_of_attach,
6170 { "Type of attach", "gsm_a.gm.type_of_attach",
6171 FT_UINT8, BASE_DEC, VALS(gsm_a_gm_type_of_attach_vals), 0x07,
6174 { &hf_gsm_a_gm_tmsi_flag,
6175 { "TMSI flag", "gsm_a.gm.tmsi_flag",
6176 FT_BOOLEAN, 8, TFS(&gsm_a_gm_tmsi_flag_value), 0x01,
6179 { &hf_gsm_a_gm_update_type,
6180 { "Update type", "gsm_a.gm.update_type",
6181 FT_UINT8, BASE_DEC, VALS(gsm_a_gm_update_type_vals), 0x07,
6184 { &hf_gsm_a_gm_gprs_timer_unit,
6185 { "Unit", "gsm_a.gm.gprs_timer_unit",
6186 FT_UINT8, BASE_DEC, VALS(gsm_a_gm_gprs_timer_unit_vals), 0xe0,
6189 { &hf_gsm_a_gm_gprs_timer_value,
6190 { "Timer value", "gsm_a.gm.gprs_timer_value",
6191 FT_UINT8, BASE_DEC, NULL, 0x1f,
6194 { &hf_gsm_a_gm_pco_pid,
6195 { "Protocol or Container ID", "gsm_a.gm.pco_pid",
6196 FT_UINT16, BASE_DEC, NULL, 0x0,
6199 { &hf_gsm_a_gm_type_of_identity,
6200 { "Type of identity", "gsm_a.gm.type_of_identity",
6201 FT_UINT8, BASE_DEC, VALS(gsm_a_gm_type_of_identity_vals), 0x07,
6205 { "Routing Area Code (RAC)","gsm_a.gm.rac",
6206 FT_UINT8, BASE_HEX_DEC, NULL, 0x00,
6210 { "APC","gsm_a.gm.apc",
6211 FT_BOOLEAN, 8, TFS(&gsm_a_gm_apc_vals), 0x20,
6214 { &hf_gsm_a_gm_otd_a,
6215 { "OTD-A","gsm_a.gm.otd_a",
6216 FT_BOOLEAN, 8, TFS(&gsm_a_gm_otd_a_vals), 0x10,
6219 { &hf_gsm_a_gm_otd_b,
6220 { "OTD-B","gsm_a.gm.otd_b",
6221 FT_BOOLEAN, 8, TFS(&gsm_a_gm_otd_b_vals), 0x08,
6224 { &hf_gsm_a_gm_gps_a,
6225 { "GPS-A","gsm_a.gm.gps_a",
6226 FT_BOOLEAN, 8, TFS(&gsm_a_gm_gps_a_vals), 0x04,
6229 { &hf_gsm_a_gm_gps_b,
6230 { "GPS-B","gsm_a.gm.gps_b",
6231 FT_BOOLEAN, 8, TFS(&gsm_a_gm_gps_b_vals), 0x02,
6234 { &hf_gsm_a_gm_gps_c,
6235 { "GPS-C","gsm_a.gm.gps_c",
6236 FT_BOOLEAN, 8, TFS(&gsm_a_gm_gps_c_vals), 0x01,
6239 { &hf_gsm_a_sm_pdp_type_org,
6240 { "PDP type organization", "gsm_a.sm.pdp_type_org",
6241 FT_UINT8, BASE_DEC, VALS(gsm_a_sm_pdp_type_org_vals), 0x0f,
6244 { &hf_gsm_a_qos_mean_thr,
6245 { "Mean throughput", "gsm_a.qos.mean_throughput",
6246 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gsm_a_qos_mean_thr_vals), 0x1f,
6249 { &hf_gsm_a_qos_peak_thr,
6250 { "Peak throughput", "gsm_a.qos.peak_throughput",
6251 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gsm_a_qos_peak_thr_vals), 0xf0,
6254 { &hf_gsm_a_qos_prec_class,
6255 { "Precedence class", "gsm_a.qos.prec_class",
6256 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gsm_a_qos_prec_class_vals), 0x07,
6259 { &hf_gsm_a_qos_traf_handl_prio,
6260 { "Traffic handling priority", "gsm_a.qos.traf_handl_prio",
6261 FT_UINT8, BASE_DEC, NULL, 0x03,
6264 { &hf_gsm_a_qos_trans_delay,
6265 { "Transfer delay", "gsm_a.qos.trans_delay",
6266 FT_UINT8, BASE_DEC, NULL, 0xfc,
6269 { &hf_gsm_a_qos_signalling_ind,
6270 { "Signalling indication", "gsm_a.qos.signalling_ind",
6271 FT_BOOLEAN, 8, TFS(&gsm_a_qos_signalling_ind_value), 0x10,
6274 { &hf_gsm_a_qos_source_stat_desc,
6275 { "Source statistics description", "gsm_a.qos.source_stat_desc",
6276 FT_UINT8, BASE_DEC, NULL, 0x0f,
6279 { &hf_gsm_a_qos_max_bitrate_upl,
6280 { "Maximum bitrate for uplink", "gsm_a.qos.max_bitrate_upl",
6281 FT_UINT8, BASE_DEC, NULL, 0x0,
6284 { &hf_gsm_a_qos_max_bitrate_downl,
6285 { "Maximum bitrate for downlink", "gsm_a.qos.max_bitrate_downl",
6286 FT_UINT8, BASE_DEC, NULL, 0x0,
6289 { &hf_gsm_a_qos_guar_bitrate_upl,
6290 { "Guaranteed bitrate for uplink", "gsm_a.qos.guar_bitrate_upl",
6291 FT_UINT8, BASE_DEC, NULL, 0x0,
6294 { &hf_gsm_a_qos_guar_bitrate_downl,
6295 { "Guaranteed bitrate for downlink", "gsm_a.qos.guar_bitrate_downl",
6296 FT_UINT8, BASE_DEC, NULL, 0x0,
6299 { &hf_gsm_a_qos_max_bitrate_upl_ext,
6300 { "Maximum bitrate for uplink (extended)", "gsm_a.qos.max_bitrate_upl_ext",
6301 FT_UINT8, BASE_DEC, NULL, 0x0,
6304 { &hf_gsm_a_qos_max_bitrate_downl_ext,
6305 { "Maximum bitrate for downlink (extended)", "gsm_a.qos.max_bitrate_downl_ext",
6306 FT_UINT8, BASE_DEC, NULL, 0x0,
6309 { &hf_gsm_a_qos_guar_bitrate_upl_ext,
6310 { "Guaranteed bitrate for uplink (extended)", "gsm_a.qos.guar_bitrate_upl_ext",
6311 FT_UINT8, BASE_DEC, NULL, 0x0,
6314 { &hf_gsm_a_qos_guar_bitrate_downl_ext,
6315 { "Guaranteed bitrate for downlink (extended)", "gsm_a.qos.guar_bitrate_downl_ext",
6316 FT_UINT8, BASE_DEC, NULL, 0x0,
6319 { &hf_gsm_a_sm_cause,
6320 { "SM Cause", "gsm_a.sm.cause",
6321 FT_UINT8, BASE_DEC, NULL, 0x0,
6324 { &hf_gsm_a_sm_cause_2,
6325 { "SM Cause 2", "gsm_a.sm.cause_2",
6326 FT_UINT8, BASE_DEC, NULL, 0x0,
6329 { &hf_gsm_a_sm_llc_sapi,
6330 { "LLC SAPI", "gsm_a.sm.llc_sapi",
6331 FT_UINT8, BASE_DEC, VALS(gsm_a_sm_llc_sapi_vals), 0x0f,
6335 { "Tear Down Indicator (TDI)", "gsm_a.sm.tdi",
6336 FT_BOOLEAN, 8, TFS(&gsm_a_sm_tdi_value), 0x01,
6339 { &hf_gsm_a_sm_packet_flow_id,
6340 { "Packet Flow Identifier (PFI)", "gsm_a.sm.packet_flow_id",
6341 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gsm_a_sm_packet_flow_id_vals), 0x7f,
6344 { &hf_gsm_a_gmm_net_cap_gea1,
6345 { "GEA/1", "gsm_a.gmm.net_cap.gea1",
6346 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_gea_vals), 0x80,
6349 { &hf_gsm_a_gmm_net_cap_smdch,
6350 { "SM capabilities via dedicated channels", "gsm_a.gmm.net_cap.smdch",
6351 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_smdch_vals), 0x40,
6354 { &hf_gsm_a_gmm_net_cap_smgprs,
6355 { "SM capabilities via GPRS channels", "gsm_a.gmm.net_cap.smgprs",
6356 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_smgprs_vals), 0x20,
6359 { &hf_gsm_a_gmm_net_cap_ucs2,
6360 { "UCS2 support", "gsm_a.gmm.net_cap.ucs2",
6361 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_smgprs_vals), 0x10,
6364 { &hf_gsm_a_gmm_net_cap_ss_scr_ind,
6365 { "SS Screening Indicator", "gsm_a.gmm.net_cap.ss_scr_ind",
6366 FT_UINT8, BASE_HEX, VALS(gsm_a_gmm_net_cap_ss_scr_ind_vals), 0x0c,
6369 { &hf_gsm_a_gmm_net_cap_solsa,
6370 { "SoLSA Capability", "gsm_a.gmm.net_cap.solsa",
6371 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_solsa_vals), 0x02,
6374 { &hf_gsm_a_gmm_net_cap_rev,
6375 { "Revision level indicator", "gsm_a.gmm.net_cap.rev",
6376 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_rev_vals), 0x01,
6379 { &hf_gsm_a_gmm_net_cap_pfc,
6380 { "PFC feature mode", "gsm_a.gmm.net_cap.pfc",
6381 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_pfc_vals), 0x80,
6384 { &hf_gsm_a_gmm_net_cap_ext_gea_bits,
6385 { "Extended GEA bits", "gsm_a.gmm.net_cap.ext_gea_bits",
6386 FT_UINT8, BASE_HEX, NULL, 0x7e,
6389 { &hf_gsm_a_gmm_net_cap_gea2,
6390 { "GEA/2", "gsm_a.gmm.net_cap.gea2",
6391 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_gea_vals), 0x40,
6394 { &hf_gsm_a_gmm_net_cap_gea3,
6395 { "GEA/3", "gsm_a.gmm.net_cap.gea3",
6396 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_gea_vals), 0x20,
6399 { &hf_gsm_a_gmm_net_cap_gea4,
6400 { "GEA/4", "gsm_a.gmm.net_cap.gea4",
6401 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_gea_vals), 0x10,
6404 { &hf_gsm_a_gmm_net_cap_gea5,
6405 { "GEA/5", "gsm_a.gmm.net_cap.gea5",
6406 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_gea_vals), 0x08,
6409 { &hf_gsm_a_gmm_net_cap_gea6,
6410 { "GEA/6", "gsm_a.gmm.net_cap.gea6",
6411 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_gea_vals), 0x04,
6414 { &hf_gsm_a_gmm_net_cap_gea7,
6415 { "GEA/7", "gsm_a.gmm.net_cap.gea7",
6416 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_gea_vals), 0x02,
6419 { &hf_gsm_a_gmm_net_cap_lcs,
6420 { "LCS VA capability", "gsm_a.gmm.net_cap.lcs",
6421 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_lcs_vals), 0x01,
6424 { &hf_gsm_a_gmm_net_cap_ps_irat_iu,
6425 { "PS inter-RAT HO to UTRAN Iu mode capability", "gsm_a.gmm.net_cap.ps_irat_iu",
6426 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_ps_irat_iu_vals), 0x80,
6429 { &hf_gsm_a_gmm_net_cap_ps_irat_s1,
6430 { "PS inter-RAT HO to E-UTRAN S1 mode capability", "gsm_a.gmm.net_cap.ps_irat_s1",
6431 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_ps_irat_s1_vals), 0x40,
6434 { &hf_gsm_a_gmm_net_cap_csfb,
6435 { "CSFB Capability", "gsm_a.gmm.net_cap.csfb",
6436 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_csfb_vals), 0x20,
6439 { &hf_gsm_a_gmm_net_cap_isr,
6440 { "ISR support", "gsm_a.gmm.net_cap.isr",
6441 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_isr_vals), 0x10,
6444 { &hf_gsm_a_gmm_net_cap_srvcc_to_geran,
6445 { "SRVCC to GERAN/UTRAN capability", "gsm_a.gmm.net_cap.srvcc_to_geran",
6446 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_srvcc_to_geran_vals), 0x08,
6449 { &hf_gsm_a_gmm_net_cap_epc,
6450 { "EPC Capability", "gsm_a.gmm.net_cap.epc",
6451 FT_BOOLEAN, 8, TFS(&gsm_a_gmm_net_cap_epc_vals), 0x04,
6454 { &hf_gsm_a_sm_tmgi,
6455 { "Temporary Mobile Group Identity (TMGI)", "gsm_a.sm.tmgi",
6456 FT_UINT24, BASE_HEX, NULL, 0x0,
6459 { &hf_gsm_a_sm_enh_nsapi,
6460 { "Enhanced NSAPI", "gsm_a.sm.enh_nsapi",
6461 FT_UINT8, BASE_DEC, NULL, 0x0,
6464 { &hf_gsm_a_sm_req_type,
6465 { "Request type", "gsm_a.sm.req_type",
6466 FT_UINT8, BASE_DEC, VALS(gsm_a_sm_req_type_vals), 0x07,
6469 { &hf_gsm_a_gm_rel_lev_ind,
6470 { "Revision Level Indicator", "gsm_a.gm.rel_lev_ind",
6471 FT_UINT8, BASE_HEX, VALS(gsm_a_gm_revision_level_indicator_vals), 0x0,
6476 /* Setup protocol subtree array */
6477 #define NUM_INDIVIDUAL_ELEMS 17
6478 gint *ett[NUM_INDIVIDUAL_ELEMS +
6479 NUM_GSM_DTAP_MSG_GMM + NUM_GSM_DTAP_MSG_SM +
6482 ett[0] = &ett_tc_component;
6483 ett[1] = &ett_tc_invoke_id;
6484 ett[2] = &ett_tc_linked_id;
6485 ett[3] = &ett_tc_opr_code;
6486 ett[4] = &ett_tc_err_code;
6487 ett[5] = &ett_tc_prob_code;
6488 ett[6] = &ett_tc_sequence;
6489 ett[7] = &ett_gmm_drx;
6490 ett[8] = &ett_gmm_detach_type;
6491 ett[9] = &ett_gmm_attach_type;
6492 ett[10] = &ett_gmm_context_stat;
6493 ett[11] = &ett_gmm_update_type;
6494 ett[12] = &ett_gmm_radio_cap;
6495 ett[13] = &ett_gmm_rai;
6496 ett[14] = &ett_sm_tft;
6497 ett[15] = &ett_gmm_gprs_timer;
6498 ett[16] = &ett_gmm_network_cap;
6500 last_offset = NUM_INDIVIDUAL_ELEMS;
6502 for (i=0; i < NUM_GSM_DTAP_MSG_GMM; i++, last_offset++)
6504 ett_gsm_dtap_msg_gmm[i] = -1;
6505 ett[last_offset] = &ett_gsm_dtap_msg_gmm[i];
6508 for (i=0; i < NUM_GSM_DTAP_MSG_SM; i++, last_offset++)
6510 ett_gsm_dtap_msg_sm[i] = -1;
6511 ett[last_offset] = &ett_gsm_dtap_msg_sm[i];
6514 for (i=0; i < NUM_GSM_GM_ELEM; i++, last_offset++)
6516 ett_gsm_gm_elem[i] = -1;
6517 ett[last_offset] = &ett_gsm_gm_elem[i];
6521 proto_register_protocol("GSM A-I/F GPRS Mobility and Session Management", "GSM Management", "gsm_a_gm");
6523 proto_register_field_array(proto_a_gm, hf, array_length(hf));
6525 proto_register_subtree_array(ett, array_length(ett));
6527 /* subdissector code */
6528 gprs_sm_pco_subdissector_table = register_dissector_table("sm_pco.protocol",
6529 "GPRS SM PCO PPP protocol", FT_UINT16, BASE_HEX);
6533 proto_reg_handoff_gsm_a_gm(void)
6535 data_handle = find_dissector("data");
6536 rrc_irat_ho_info_handle = find_dissector("rrc.irat.irat_ho_info");