Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-gsm_a_dtap.c
blob457fe9e64dfb81449fae40a3b33956c65a067dac
1 /* packet-gsm_a_dtap.c
2 * Routines for GSM A Interface DTAP dissection - A.K.A. GSM layer 3
3 * NOTE: it actually includes RR messages, which are (generally) not carried
4 * over the A interface on DTAP, but are part of the same Layer 3 protocol set
6 * Copyright 2003, Michael Lum <mlum [AT] telostech.com>
7 * In association with Telos Technology Inc.
10 * Added the GPRS Mobility Management Protocol and
11 * the GPRS Session Management Protocol
12 * Copyright 2004, Rene Pilz <rene.pilz [AT] ftw.com>
13 * In association with Telecommunications Research Center
14 * Vienna (ftw.)Betriebs-GmbH within the Project Metawin.
16 * Added Dissection of Radio Resource Management Information Elements
17 * and other enhancements and fixes.
18 * Copyright 2005 - 2009, Anders Broman [AT] ericsson.com
19 * Small bugfixes, mainly in Qos and TFT by Nils Ljungberg and Stefan Boman [AT] ericsson.com
21 * Various updates, enhancements and fixes
22 * Copyright 2009, Gerasimos Dimitriadis <dimeg [AT] intracom.gr>
23 * In association with Intracom Telecom SA
25 * Added Dissection of Group Call Control (GCC) protocol.
26 * Added Dissection of Broadcast Call Control (BCC) protocol.
27 * Copyright 2015, Michail Koreshkov <michail.koreshkov [at] zte.com.cn
29 * Title 3GPP Other
31 * Reference [3]
32 * Mobile radio interface Layer 3 specification;
33 * Core network protocols;
34 * Stage 3
35 * (3GPP TS 24.008 version 4.7.0 Release 4)
36 * (ETSI TS 124 008 V6.8.0 (2005-03))
38 * Reference [4]
39 * Mobile radio interface layer 3 specification;
40 * Radio Resource Control Protocol
41 * (GSM 04.18 version 8.4.1 Release 1999)
42 * (3GPP TS 04.18 version 8.26.0 Release 1999)
44 * Reference [5]
45 * Point-to-Point (PP) Short Message Service (SMS)
46 * support on mobile radio interface
47 * (3GPP TS 24.011 version 4.1.1 Release 4)
49 * Reference [6]
50 * Mobile radio Layer 3 supplementary service specification;
51 * Formats and coding
52 * (3GPP TS 24.080 version 4.3.0 Release 4)
54 * Reference [7]
55 * Mobile radio interface Layer 3 specification;
56 * Core network protocols;
57 * Stage 3
58 * (3GPP TS 24.008 version 5.9.0 Release 5)
60 * Reference [8]
61 * Mobile radio interface Layer 3 specification;
62 * Core network protocols;
63 * Stage 3
64 * (3GPP TS 24.008 version 6.7.0 Release 6)
65 * (3GPP TS 24.008 version 6.8.0 Release 6)
67 * Reference [9]
68 * Mobile radio interface Layer 3 specification;
69 * Core network protocols;
70 * Stage 3
71 * (3GPP TS 24.008 version 9.6.0 Release 9)
73 * Reference [10]
74 * Mobile radio interface Layer 3 specification;
75 * Core network protocols;
76 * Stage 3
77 * (3GPP TS 24.008 version 10.6.1 Release 10)
79 * Reference [11]
80 * Mobile radio interface Layer 3 specification;
81 * Core network protocols;
82 * Stage 3
83 * (3GPP TS 24.008 version 11.6.0 Release 11)
85 * Reference [12]
86 * Digital cellular telecommunications system (Phase 2+);
87 * Group Call Control (GCC) protocol
88 * (GSM 04.68 version 8.1.0 Release 1999)
90 * Reference [13]
91 * Digital cellular telecommunications system (Phase 2+);
92 * Broadcast Call Control (BCC) protocol
93 * (3GPP TS 44.069 version 11.0.0 Release 11)
95 * Wireshark - Network traffic analyzer
96 * By Gerald Combs <gerald@wireshark.org>
97 * Copyright 1998 Gerald Combs
99 * SPDX-License-Identifier: GPL-2.0-or-later
102 #include "config.h"
104 #include <epan/packet.h>
105 #include <epan/expert.h>
106 #include <epan/tap.h>
107 #include <epan/strutil.h>
108 #include <epan/tfs.h>
109 #include <epan/unit_strings.h>
111 #include <wsutil/array.h>
113 #include "packet-bssap.h"
114 #include "packet-ber.h"
115 #include "packet-q931.h"
116 #include "packet-gsm_a_common.h"
117 #include "packet-isup.h"
119 void proto_register_gsm_a_dtap(void);
120 void proto_reg_handoff_gsm_a_dtap(void);
122 /* PROTOTYPES/FORWARDS */
124 static const value_string gsm_a_dtap_msg_gcc_strings[] = {
125 { 0x31, "Immediate Setup" },
126 { 0x32, "Setup" },
127 { 0x33, "Connect" },
128 { 0x34, "Termination" },
129 { 0x35, "Termination Request" },
130 { 0x36, "Termination Reject" },
131 { 0x38, "Status" },
132 { 0x39, "Get Status" },
133 { 0x3A, "Set Parameter" },
134 { 0, NULL }
137 static const value_string gsm_a_dtap_msg_bcc_strings[] = {
138 { 0x31, "Immediate Setup" },
139 { 0x32, "Setup" },
140 { 0x33, "Connect" },
141 { 0x34, "Termination" },
142 { 0x35, "Termination Request" },
143 { 0x36, "Termination Reject" },
144 { 0x38, "Status" },
145 { 0x39, "Get Status" },
146 { 0x3A, "Set Parameter" },
147 { 0x3B, "Immediate Setup 2" },
148 { 0, NULL }
151 const value_string gsm_a_dtap_msg_mm_strings[] = {
152 { 0x01, "IMSI Detach Indication" },
153 { 0x02, "Location Updating Accept" },
154 { 0x04, "Location Updating Reject" },
155 { 0x08, "Location Updating Request" },
156 { 0x11, "Authentication Reject" },
157 { 0x12, "Authentication Request" },
158 { 0x14, "Authentication Response" },
159 { 0x1c, "Authentication Failure" },
160 { 0x18, "Identity Request" },
161 { 0x19, "Identity Response" },
162 { 0x1a, "TMSI Reallocation Command" },
163 { 0x1b, "TMSI Reallocation Complete" },
164 { 0x21, "CM Service Accept" },
165 { 0x22, "CM Service Reject" },
166 { 0x23, "CM Service Abort" },
167 { 0x24, "CM Service Request" },
168 { 0x25, "CM Service Prompt" },
169 { 0x26, "Reserved: was allocated in earlier phases of the protocol" },
170 { 0x28, "CM Re-establishment Request" },
171 { 0x29, "Abort" },
172 { 0x30, "MM Null" },
173 { 0x31, "MM Status" },
174 { 0x32, "MM Information" },
175 { 0, NULL }
178 const value_string gsm_a_dtap_msg_cc_strings[] = {
179 { 0x01, "Alerting" },
180 { 0x08, "Call Confirmed" },
181 { 0x02, "Call Proceeding" },
182 { 0x07, "Connect" },
183 { 0x0f, "Connect Acknowledge" },
184 { 0x0e, "Emergency Setup" },
185 { 0x03, "Progress" },
186 { 0x04, "CC-Establishment" },
187 { 0x06, "CC-Establishment Confirmed" },
188 { 0x0b, "Recall" },
189 { 0x09, "Start CC" },
190 { 0x05, "Setup" },
191 { 0x17, "Modify" },
192 { 0x1f, "Modify Complete" },
193 { 0x13, "Modify Reject" },
194 { 0x10, "User Information" },
195 { 0x18, "Hold" },
196 { 0x19, "Hold Acknowledge" },
197 { 0x1a, "Hold Reject" },
198 { 0x1c, "Retrieve" },
199 { 0x1d, "Retrieve Acknowledge" },
200 { 0x1e, "Retrieve Reject" },
201 { 0x25, "Disconnect" },
202 { 0x2d, "Release" },
203 { 0x2a, "Release Complete" },
204 { 0x39, "Congestion Control" },
205 { 0x3e, "Notify" },
206 { 0x3d, "Status" },
207 { 0x34, "Status Enquiry" },
208 { 0x35, "Start DTMF" },
209 { 0x31, "Stop DTMF" },
210 { 0x32, "Stop DTMF Acknowledge" },
211 { 0x36, "Start DTMF Acknowledge" },
212 { 0x37, "Start DTMF Reject" },
213 { 0x3a, "Facility" },
214 { 0, NULL }
217 const value_string gsm_a_dtap_msg_sms_strings[] = {
218 { 0x01, "CP-DATA" },
219 { 0x04, "CP-ACK" },
220 { 0x10, "CP-ERROR" },
221 { 0, NULL }
224 const value_string gsm_a_dtap_msg_ss_strings[] = {
225 { 0x2a, "Release Complete" },
226 { 0x3a, "Facility" },
227 { 0x3b, "Register" },
228 { 0, NULL }
231 const value_string gsm_a_dtap_msg_tp_strings[] = {
232 { 0x00, "Close TCH Loop Cmd" },
233 { 0x01, "Close TCH Loop Ack" },
234 { 0x06, "Open Loop Cmd" },
235 { 0x0c, "Act EMMI Cmd" },
236 { 0x0d, "Act EMMI Ack" },
237 { 0x10, "Deact EMMI" },
238 { 0x14, "Test Interface" },
239 { 0x20, "Close Multi-slot Loop Cmd" },
240 { 0x21, "Close Multi-slot Loop Ack" },
241 { 0x22, "Open Multi-slot Loop Cmd" },
242 { 0x23, "Open Multi-slot Loop Ack" },
243 { 0x24, "GPRS Test Mode Cmd" },
244 { 0x25, "EGPRS Start Radio Block Loopback Cmd" },
245 { 0x26, "Reset MS Positioning Stored Information" },
246 { 0x40, "Close UE Test Loop" },
247 { 0x41, "Close UE Test Loop Complete" },
248 { 0x42, "Open UE Test Loop" },
249 { 0x43, "Open UE Test Loop Complete" },
250 { 0x44, "Activate RB Test Mode" },
251 { 0x45, "Activate RB Test Mode Complete" },
252 { 0x46, "Deactivate RB Test Mode" },
253 { 0x47, "Deactivate RB Test Mode Complete" },
254 { 0x48, "Reset UE Positioning Stored Information" },
255 { 0x49, "UE Test Loop Mode 3 RLC SDU Counter Request" },
256 { 0x4A, "UE Test Loop Mode 3 RLC SDU Counter Response" },
257 { 0x80, "Close UE Test Loop" },
258 { 0x81, "Close UE Test Loop Complete" },
259 { 0x82, "Open UE Test Loop" },
260 { 0x83, "Open UE Test Loop Complete" },
261 { 0x84, "Activate Test Mode" },
262 { 0x85, "Activate Test Mode Complete" },
263 { 0x86, "Deactivate Test Mode" },
264 { 0x87, "Deactivate Test Mode Complete" },
265 { 0x88, "Reset UE Positioning Stored Information" },
266 { 0x89, "UE Test Loop Mode C MBMS Packet Counter Request" },
267 { 0x8a, "UE Test Loop Mode C MBMS Packet Counter Response" },
268 { 0x8b, "Update UE Location Information" },
269 { 0x8c, "UE Test Loop ProSe Packet Counter Request" },
270 { 0x8d, "UE Test Loop ProSe Packet Counter Response" },
271 { 0x8e, "UE Test Loop Mode F SCPTM Packet Counter Request" },
272 { 0x8f, "UE Test Loop Mode F SCPTM Packet Counter Response" },
273 { 0, NULL }
276 static const value_string gsm_dtap_elem_strings[] = {
277 /* Mobility Management Information Elements 10.5.3 */
278 { DE_AUTH_PARAM_RAND, "Authentication Parameter RAND" },
279 { DE_AUTH_PARAM_AUTN, "Authentication Parameter AUTN (UMTS and EPS authentication challenge)" },
280 { DE_AUTH_RESP_PARAM, "Authentication Response Parameter" },
281 { DE_AUTH_RESP_PARAM_EXT, "Authentication Response Parameter (extension) (UMTS authentication challenge only)" },
282 { DE_AUTH_FAIL_PARAM, "Authentication Failure Parameter (UMTS and EPS authentication challenge)" },
283 { DE_CM_SRVC_TYPE, "CM Service Type" },
284 { DE_ID_TYPE, "Identity Type" },
285 { DE_LOC_UPD_TYPE, "Location Updating Type" },
286 { DE_NETWORK_NAME, "Network Name" },
287 { DE_REJ_CAUSE, "Reject Cause" },
288 { DE_FOP, "Follow-on Proceed" },
289 { DE_TIME_ZONE, "Time Zone" },
290 { DE_TIME_ZONE_TIME, "Time Zone and Time" },
291 { DE_CTS_PERM, "CTS Permission" },
292 { DE_LSA_ID, "LSA Identifier" },
293 { DE_DAY_SAVING_TIME, "Daylight Saving Time" },
294 { DE_EMERGENCY_NUM_LIST, "Emergency Number List" },
295 { DE_ADD_UPD_PARAMS, "Additional update parameters" },
296 { DE_MM_TIMER, "MM Timer" },
297 /* Call Control Information Elements 10.5.4 */
298 { DE_AUX_STATES, "Auxiliary States" }, /* 10.5.4.4 Auxiliary states */
299 { DE_BEARER_CAP, "Bearer Capability" }, /* 10.5.4.4a Backup bearer capability */
300 { DE_CC_CAP, "Call Control Capabilities" },
301 { DE_CALL_STATE, "Call State" },
302 { DE_CLD_PARTY_BCD_NUM, "Called Party BCD Number" },
303 { DE_CLD_PARTY_SUB_ADDR, "Called Party Subaddress" },
304 { DE_CLG_PARTY_BCD_NUM, "Calling Party BCD Number" },
305 { DE_CLG_PARTY_SUB_ADDR, "Calling Party Subaddress" },
306 { DE_CAUSE, "Cause" },
307 { DE_CLIR_SUP, "CLIR Suppression" },
308 { DE_CLIR_INV, "CLIR Invocation" },
309 { DE_CONGESTION, "Congestion Level" },
310 { DE_CONN_NUM, "Connected Number" },
311 { DE_CONN_SUB_ADDR, "Connected Subaddress" },
312 { DE_FACILITY, "Facility" },
313 { DE_HLC, "High Layer Compatibility" },
314 { DE_KEYPAD_FACILITY, "Keypad Facility" },
315 { DE_LLC, "Low Layer Compatibility" },
316 { DE_MORE_DATA, "More Data" },
317 { DE_NOT_IND, "Notification Indicator" },
318 { DE_PROG_IND, "Progress Indicator" },
319 { DE_RECALL_TYPE, "Recall type $(CCBS)$" },
320 { DE_RED_PARTY_BCD_NUM, "Redirecting Party BCD Number" },
321 { DE_RED_PARTY_SUB_ADDR, "Redirecting Party Subaddress" },
322 { DE_REPEAT_IND, "Repeat Indicator" },
323 { DE_REV_CALL_SETUP_DIR, "Reverse Call Setup Direction" },
324 { DE_SETUP_CONTAINER, "SETUP Container $(CCBS)$" },
325 { DE_SIGNAL, "Signal" },
326 { DE_SS_VER_IND, "SS Version Indicator" },
327 { DE_USER_USER, "User-user" },
328 { DE_ALERT_PATTERN, "Alerting Pattern $(NIA)$" }, /* 10.5.4.26 Alerting Pattern $(NIA)$ */
329 { DE_ALLOWED_ACTIONS, "Allowed Actions $(CCBS)$" },
330 { DE_SI, "Stream Identifier" },
331 { DE_NET_CC_CAP, "Network Call Control Capabilities" },
332 { DE_CAUSE_NO_CLI, "Cause of No CLI" }, /* 10.5.4.30 Cause of No CLI */
333 /* 10.5.4.31 Void */
334 { DE_SUP_CODEC_LIST, "Supported Codec List" }, /* 10.5.4.32 Supported codec list */
335 { DE_SERV_CAT, "Service Category" }, /* 10.5.4.33 Service category */
336 { DE_REDIAL, "Redial" }, /* 10.5.4.34 Redial */
337 { DE_NET_INIT_SERV_UPG, "Network-initiated Service Upgrade indicator" },
338 /* 10.5.4.35 Network-initiated Service Upgrade indicator */
339 /* Short Message Service Information Elements [5] 8.1.4 */
340 { DE_CP_USER_DATA, "CP-User Data" },
341 { DE_CP_CAUSE, "CP-Cause" },
342 /* Tests procedures information elements 3GPP TS 44.014 6.4.0, 3GPP TS 34.109 6.4.0 and 3GPP TS 36.509 13.3.0 */
343 { DE_TP_SUB_CHANNEL, "Close TCH Loop Cmd Sub-channel"},
344 { DE_TP_ACK, "Open Loop Cmd Ack"},
345 { DE_TP_LOOP_TYPE, "Close Multi-slot Loop Cmd Loop type"},
346 { DE_TP_LOOP_ACK, "Close Multi-slot Loop Ack Result"},
347 { DE_TP_TESTED_DEVICE, "Test Interface Tested device"},
348 { DE_TP_PDU_DESCRIPTION, "GPRS Test Mode Cmd PDU description"},
349 { DE_TP_MODE_FLAG, "GPRS Test Mode Cmd Mode flag"},
350 { DE_TP_EGPRS_MODE_FLAG, "EGPRS Start Radio Block Loopback Cmd Mode flag"},
351 { DE_TP_MS_POSITIONING_TECHNOLOGY, "MS Positioning Technology"},
352 { DE_TP_UE_TEST_LOOP_MODE, "Close UE Test Loop Mode"},
353 { DE_TP_UE_POSITIONING_TECHNOLOGY, "UE Positioning Technology"},
354 { DE_TP_RLC_SDU_COUNTER_VALUE, "RLC SDU Counter Value"},
355 { DE_TP_EPC_UE_TEST_LOOP_MODE, "UE Test Loop Mode"},
356 { DE_TP_EPC_UE_TL_A_LB_SETUP, "UE Test Loop Mode A LB Setup"},
357 { DE_TP_EPC_UE_TL_B_LB_SETUP, "UE Test Loop Mode B LB Setup"},
358 { DE_TP_EPC_UE_TL_C_SETUP, "UE Test Loop Mode C Setup"},
359 { DE_TP_EPC_UE_TL_D_SETUP, "UE Test Loop Mode D Setup"},
360 { DE_TP_EPC_UE_TL_E_SETUP, "UE Test Loop Mode E Setup"},
361 { DE_TP_EPC_UE_TL_F_SETUP, "UE Test Loop Mode F Setup"},
362 { DE_TP_EPC_UE_TL_GH_SETUP, "UE Test Loop Mode GH Setup"},
363 { DE_TP_EPC_UE_POSITIONING_TECHNOLOGY, "UE Positioning Technology"},
364 { DE_TP_EPC_MBMS_PACKET_COUNTER_VALUE, "MBMS Packet Counter Value"},
365 { DE_TP_EPC_ELLIPSOID_POINT_WITH_ALT, "Ellipsoid Point With Altitude"},
366 { DE_TP_EPC_HORIZONTAL_VELOCITY, "Horizontal Velocity"},
367 { DE_TP_EPC_GNSS_TOD_MSEC, "GNSS-TOD-msec"},
368 /* Group Call Control Service Information Elements ETSI TS 100 948 V8.1.0 (GSM 04.68 version 8.1.0 Release 1999) */
369 { DE_GCC_CALL_REF, "Call Reference"},
370 { DE_GCC_CALL_STATE, "Call state"},
371 { DE_GCC_CAUSE, "Cause"},
372 { DE_GCC_ORIG_IND, "Originator indication"},
373 { DE_GCC_STATE_ATTR, "State attributes"},
374 /* Broadcast Call Control Information Elements ETSI TS 144 069 V10.0.0 (3GPP TS 44.069 version 10.0.0 Release 10) */
375 {DE_BCC_CALL_REF, "Call Reference"},
376 {DE_BCC_CALL_STATE, "Call state"},
377 {DE_BCC_CAUSE, "Cause"},
378 {DE_BCC_ORIG_IND, "Originator indication"},
379 {DE_BCC_STATE_ATTR, "State attributes"},
380 {DE_BCC_COMPR_OTDI, "Compressed otdi"},
381 { 0, NULL }
383 value_string_ext gsm_dtap_elem_strings_ext = VALUE_STRING_EXT_INIT(gsm_dtap_elem_strings);
385 const char *gsm_a_pd_str[] = {
386 "Group Call Control",
387 "Broadcast Call Control",
388 "EPS session management messages",
389 "Call Control; call related SS messages",
390 "GPRS Transparent Transport Protocol (GTTP)",
391 "Mobility Management messages",
392 "Radio Resources Management messages",
393 "EPS mobility management messages",
394 "GPRS Mobility Management messages",
395 "SMS messages",
396 "GPRS Session Management messages",
397 "Non call related SS messages",
398 "Location services specified in 3GPP TS 44.071",
399 "Unknown",
400 "Reserved for extension of the PD to one octet length",
401 "Special conformance testing functions"
403 /* L3 Protocol discriminator values according to TS 24 007 (6.4.0) */
404 const value_string protocol_discriminator_vals[] = {
405 {0x0, "Group call control"},
406 {0x1, "Broadcast call control"},
407 {0x2, "EPS session management messages"},
408 {0x3, "Call Control; call related SS messages"},
409 {0x4, "GPRS Transparent Transport Protocol (GTTP)"},
410 {0x5, "Mobility Management messages"},
411 {0x6, "Radio Resources Management messages"},
412 {0x7, "EPS mobility management messages"},
413 {0x8, "GPRS mobility management messages"},
414 {0x9, "SMS messages"},
415 {0xa, "GPRS session management messages"},
416 {0xb, "Non call related SS messages"},
417 {0xc, "Location services specified in 3GPP TS 44.071"},
418 {0xd, "Unknown"},
419 {0xe, "Reserved for extension of the PD to one octet length "},
420 {0xf, "Tests procedures described in 3GPP TS 44.014, 3GPP TS 34.109 and 3GPP TS 36.509"},
421 { 0, NULL }
424 const value_string gsm_a_pd_short_str_vals[] = {
425 {0x0, "GCC"}, /* Group Call Control */
426 {0x1, "BCC"}, /* Broadcast Call Control */
427 {0x2, "Reserved"}, /* : was allocated in earlier phases of the protocol */
428 {0x3, "CC"}, /* Call Control; call related SS messages */
429 {0x4, "GTTP"}, /* GPRS Transparent Transport Protocol (GTTP) */
430 {0x5, "MM"}, /* Mobility Management messages */
431 {0x6, "RR"}, /* Radio Resources Management messages */
432 {0x7, "Unknown"},
433 {0x8, "GMM"}, /* GPRS Mobility Management messages */
434 {0x9, "SMS"},
435 {0xa, "SM"}, /* GPRS Session Management messages */
436 {0xb, "SS"},
437 {0xc, "LS"}, /* Location Services */
438 {0xd, "Unknown"},
439 {0xe, "Reserved"}, /* for extension of the PD to one octet length */
440 {0xf, "TP"}, /* for tests procedures described in 3GPP TS 44.014 6.4.0 and 3GPP TS 34.109 6.4.0.*/
441 { 0, NULL }
444 static const true_false_string tfs_acceptable_not_acceptable = { "Acceptable", "Not Acceptable" };
447 #define DTAP_PD_MASK 0x0f
448 #define DTAP_SKIP_MASK 0xf0
449 #define DTAP_TI_MASK DTAP_SKIP_MASK
450 #define DTAP_TIE_PRES_MASK 0x07 /* after TI shifted to right */
451 #define DTAP_TIE_MASK 0x7f
453 #define DTAP_MM_IEI_MASK 0x3f
454 #define DTAP_GCC_IEI_MASK 0x3f
455 #define DTAP_BCC_IEI_MASK 0x3f
456 #define DTAP_CC_IEI_MASK 0x3f
457 #define DTAP_SMS_IEI_MASK 0xff
458 #define DTAP_SS_IEI_MASK 0x3f
459 #define DTAP_TP_IEI_MASK 0xff
461 /* Initialize the protocol and registered fields */
462 static int proto_a_dtap;
464 static int hf_gsm_a_dtap_msg_gcc_type;
465 static int hf_gsm_a_dtap_msg_bcc_type;
466 static int hf_gsm_a_dtap_msg_mm_type;
467 static int hf_gsm_a_dtap_msg_cc_type;
468 static int hf_gsm_a_seq_no;
469 static int hf_gsm_a_dtap_msg_sms_type;
470 static int hf_gsm_a_dtap_msg_ss_type;
471 static int hf_gsm_a_dtap_msg_tp_type;
472 int hf_gsm_a_dtap_elem_id;
473 static int hf_gsm_a_dtap_cld_party_bcd_num;
474 static int hf_gsm_a_dtap_clg_party_bcd_num;
475 static int hf_gsm_a_dtap_conn_num;
476 static int hf_gsm_a_dtap_red_party_bcd_num;
477 static int hf_gsm_a_dtap_present_ind;
478 static int hf_gsm_a_dtap_screening_ind;
479 static int hf_gsm_a_dtap_type_of_sub_addr;
480 static int hf_gsm_a_dtap_odd_even_ind;
482 static int hf_gsm_a_dtap_cause;
483 static int hf_gsm_a_dtap_cause_ss_diagnostics;
484 static int hf_gsm_a_dtap_emergency_bcd_num;
485 static int hf_gsm_a_dtap_emerg_num_info_length;
487 static int hf_gsm_a_dtap_type_of_number;
488 static int hf_gsm_a_dtap_numbering_plan_id;
490 static int hf_gsm_a_dtap_lsa_id;
491 static int hf_gsm_a_dtap_speech_vers_ind;
492 static int hf_gsm_a_dtap_itc;
493 static int hf_gsm_a_dtap_sysid;
494 static int hf_gsm_a_dtap_bitmap_length;
495 static int hf_gsm_a_dtap_serv_cat_b7;
496 static int hf_gsm_a_dtap_serv_cat_b6;
497 static int hf_gsm_a_dtap_serv_cat_b5;
498 static int hf_gsm_a_dtap_serv_cat_b4;
499 static int hf_gsm_a_dtap_serv_cat_b3;
500 static int hf_gsm_a_dtap_serv_cat_b2;
501 static int hf_gsm_a_dtap_serv_cat_b1;
502 static int hf_gsm_a_dtap_drvcc;
503 static int hf_gsm_a_dtap_csmo;
504 static int hf_gsm_a_dtap_csmt;
505 static int hf_gsm_a_dtap_mm_timer_unit;
506 static int hf_gsm_a_dtap_mm_timer_value;
507 static int hf_gsm_a_dtap_alerting_pattern;
508 static int hf_gsm_a_dtap_ccbs_activation;
509 static int hf_gsm_a_dtap_stream_identifier;
510 static int hf_gsm_a_dtap_mcs;
511 static int hf_gsm_a_dtap_cause_of_no_cli;
512 static int hf_gsm_a_dtap_signal_value;
514 static int hf_gsm_a_dtap_codec_tdma_efr;
515 static int hf_gsm_a_dtap_codec_umts_amr_2;
516 static int hf_gsm_a_dtap_codec_umts_amr;
517 static int hf_gsm_a_dtap_codec_hr_amr;
518 static int hf_gsm_a_dtap_codec_fr_amr;
519 static int hf_gsm_a_dtap_codec_gsm_efr;
520 static int hf_gsm_a_dtap_codec_gsm_hr;
521 static int hf_gsm_a_dtap_codec_gsm_fr;
522 static int hf_gsm_a_dtap_codec_umts_evs;
523 static int hf_gsm_a_dtap_codec_ohr_amr_wb;
524 static int hf_gsm_a_dtap_codec_ofr_amr_wb;
525 static int hf_gsm_a_dtap_codec_ohr_amr;
526 static int hf_gsm_a_dtap_codec_umts_amr_wb;
527 static int hf_gsm_a_dtap_codec_fr_amr_wb;
528 static int hf_gsm_a_dtap_codec_pdc_efr;
530 static int hf_gsm_a_dtap_notification_description;
531 static int hf_gsm_a_dtap_recall_type;
532 static int hf_gsm_a_dtap_coding_standard;
533 static int hf_gsm_a_dtap_call_state;
534 static int hf_gsm_a_dtap_prog_coding_standard;
535 static int hf_gsm_a_dtap_location;
536 static int hf_gsm_a_dtap_progress_description;
537 static int hf_gsm_a_dtap_afi;
538 static int hf_gsm_a_dtap_rej_cause;
539 static int hf_gsm_a_dtap_timezone;
540 static int hf_gsm_a_dtap_u2u_prot_discr;
541 static int hf_gsm_a_dtap_mcat;
542 static int hf_gsm_a_dtap_enicm;
543 static int hf_gsm_a_dtap_rand;
544 static int hf_gsm_a_dtap_autn;
545 static int hf_gsm_a_dtap_xres;
546 static int hf_gsm_a_dtap_sres;
547 static int hf_gsm_a_dtap_auts;
548 static int hf_gsm_a_dtap_autn_sqn_xor_ak;
549 static int hf_gsm_a_dtap_autn_amf;
550 static int hf_gsm_a_dtap_autn_mac;
551 static int hf_gsm_a_dtap_auts_sqn_ms_xor_ak;
552 static int hf_gsm_a_dtap_auts_mac_s;
554 static int hf_gsm_a_dtap_epc_ue_tl_mode;
555 static int hf_gsm_a_dtap_epc_ue_tl_a_ul_sdu_size;
556 static int hf_gsm_a_dtap_epc_ue_tl_a_drb;
557 static int hf_gsm_a_dtap_epc_ue_tl_b_ip_pdu_delay;
558 static int hf_gsm_a_dtap_epc_ue_tl_c_mbsfn_area_id;
559 static int hf_gsm_a_dtap_epc_ue_tl_c_mch_id;
560 static int hf_gsm_a_dtap_epc_ue_tl_c_lcid;
561 static int hf_gsm_a_dtap_epc_ue_tl_d_discovery;
562 static int hf_gsm_a_dtap_epc_ue_tl_d_prose_app_code;
563 static int hf_gsm_a_dtap_epc_ue_tl_e_communication;
564 static int hf_gsm_a_dtap_epc_ue_tl_e_group_destination_id;
565 static int hf_gsm_a_dtap_epc_ue_tl_f_sc_mtch_id;
566 static int hf_gsm_a_dtap_epc_ue_tl_gh_ul_loopback_op_mode;
567 static int hf_gsm_a_dtap_epc_ue_tl_gh_repetitions;
568 static int hf_gsm_a_dtap_epc_ue_tl_gh_ul_data_delay;
569 static int hf_gsm_a_dtap_epc_ue_positioning_technology;
570 static int hf_gsm_a_dtap_epc_mbms_packet_counter_value;
571 static int hf_gsm_a_dtap_epc_latitude_sign;
572 static int hf_gsm_a_dtap_epc_degrees_latitude;
573 static int hf_gsm_a_dtap_epc_degrees_longitude;
574 static int hf_gsm_a_dtap_epc_altitude_dir;
575 static int hf_gsm_a_dtap_epc_altitude;
576 static int hf_gsm_a_dtap_epc_bearing;
577 static int hf_gsm_a_dtap_epc_horizontal_speed;
578 static int hf_gsm_a_dtap_epc_gnss_tod_msec;
580 /* Generated from convert_proto_tree_add_text.pl */
581 static int hf_gsm_a_dtap_maximum_number_of_supported_bearers;
582 static int hf_gsm_a_dtap_edge_channel_codings;
583 static int hf_gsm_a_dtap_acceptable_channel_codings_TCH_F9_6;
584 static int hf_gsm_a_dtap_assignor_assignee;
585 static int hf_gsm_a_dtap_configuration;
586 static int hf_gsm_a_dtap_de_cause_coding_standard;
587 static int hf_gsm_a_dtap_ss_version_indicator;
588 static int hf_gsm_a_dtap_mode_of_operation;
589 static int hf_gsm_a_dtap_bearer_cap_coding_standard;
590 static int hf_gsm_a_dtap_nirr;
591 static int hf_gsm_a_dtap_other_rate_adaption;
592 static int hf_gsm_a_dtap_connection_element;
593 static int hf_gsm_a_dtap_nic_on_tx;
594 static int hf_gsm_a_dtap_user_rate;
595 static int hf_gsm_a_dtap_protocol_discriminator;
596 static int hf_gsm_a_dtap_cp_cause;
597 static int hf_gsm_a_dtap_rate_adaption_header;
598 static int hf_gsm_a_dtap_synchronous;
599 static int hf_gsm_a_dtap_logical_link_identifier_negotiation;
600 static int hf_gsm_a_dtap_multi_party_auxiliary_state;
601 static int hf_gsm_a_dtap_parity_information;
602 static int hf_gsm_a_dtap_channel_coding03;
603 static int hf_gsm_a_dtap_channel_coding30;
604 static int hf_gsm_a_dtap_loop_mechanism0E;
605 static int hf_gsm_a_dtap_loop_mechanism1C;
606 static int hf_gsm_a_dtap_multislot_tch;
607 static int hf_gsm_a_dtap_acceptable_channel_codings_ext_TCH_F43_2;
608 static int hf_gsm_a_dtap_ue_positioning_technology;
609 static int hf_gsm_a_dtap_acceptable_channel_codings_TCH_F4_8;
610 static int hf_gsm_a_dtap_number_of_spare_bits;
611 static int hf_gsm_a_dtap_tie;
612 static int hf_gsm_a_dtap_updating_type;
613 static int hf_gsm_a_dtap_multiple_frame_establishment_support;
614 static int hf_gsm_a_dtap_maximum_number_of_traffic_channels;
615 static int hf_gsm_a_dtap_compression;
616 static int hf_gsm_a_dtap_compression_up;
617 static int hf_gsm_a_dtap_downlink_timeslot_offset;
618 static int hf_gsm_a_dtap_acceptable_channel_codings_ext_TCH_F32_0;
619 static int hf_gsm_a_dtap_tio;
620 static int hf_gsm_a_dtap_other_modem_type;
621 static int hf_gsm_a_dtap_other_itc;
622 static int hf_gsm_a_dtap_negotiation;
623 static int hf_gsm_a_dtap_rate_adaption;
624 static int hf_gsm_a_dtap_ms_positioning_technology;
625 static int hf_gsm_a_dtap_ue_test_loop_mode;
626 static int hf_gsm_a_dtap_number_of_data_bits;
627 static int hf_gsm_a_dtap_follow_on_request;
628 static int hf_gsm_a_dtap_repeat_indicator;
629 static int hf_gsm_a_dtap_dst_adjustment;
630 static int hf_gsm_a_dtap_pcp;
631 static int hf_gsm_a_dtap_user_information_layer_2_protocol;
632 static int hf_gsm_a_dtap_structure;
633 static int hf_gsm_a_dtap_congestion_level;
634 static int hf_gsm_a_dtap_access_identity;
635 static int hf_gsm_a_dtap_modem_type;
636 static int hf_gsm_a_dtap_test_loop;
637 static int hf_gsm_a_dtap_subchannel;
638 static int hf_gsm_a_dtap_ack_element;
639 static int hf_gsm_a_dtap_layer_1_identity;
640 static int hf_gsm_a_dtap_ciphering_key_sequence_number70;
641 static int hf_gsm_a_dtap_tp_pdu_description;
642 static int hf_gsm_a_dtap_mode_flag;
643 static int hf_gsm_a_dtap_egprs_mode_flag;
644 static int hf_gsm_a_dtap_dtmf;
645 static int hf_gsm_a_dtap_coding;
646 static int hf_gsm_a_dtap_nic_on_rx;
647 static int hf_gsm_a_dtap_emergency_number_information;
648 static int hf_gsm_a_dtap_uimi;
649 static int hf_gsm_a_dtap_number_of_stop_bits;
650 static int hf_gsm_a_dtap_acceptable_channel_codings_spare78;
651 static int hf_gsm_a_dtap_type_of_identity;
652 static int hf_gsm_a_dtap_ciphering_key_sequence_number;
653 static int hf_gsm_a_dtap_recommendation;
654 static int hf_gsm_a_dtap_max_num_of_speech_bearers;
655 static int hf_gsm_a_dtap_keypad_information;
656 static int hf_gsm_a_dtap_signalling_access_protocol;
657 static int hf_gsm_a_dtap_user_information_layer_1_protocol;
658 static int hf_gsm_a_dtap_wanted_air_interface_user_rate;
659 static int hf_gsm_a_dtap_hold_auxiliary_state;
660 static int hf_gsm_a_dtap_radio_channel_requirement;
661 static int hf_gsm_a_dtap_channel_coding_asymmetry_indication;
662 static int hf_gsm_a_dtap_service_type;
663 static int hf_gsm_a_dtap_text_string;
664 static int hf_gsm_a_dtap_tp_tested_device;
665 static int hf_gsm_a_dtap_fixed_network_user_rate;
666 static int hf_gsm_a_dtap_coding_scheme;
667 static int hf_gsm_a_dtap_acceptable_channel_codings_ext_TCH_F28_8;
668 static int hf_gsm_a_dtap_v110_x30_rate_adaptation;
669 static int hf_gsm_a_dtap_transfer_mode;
670 static int hf_gsm_a_dtap_layer_2_identity;
671 static int hf_gsm_a_dtap_add_ci;
672 static int hf_gsm_a_dtap_mm_timer;
673 static int hf_gsm_a_dtap_in_out_band;
674 static int hf_gsm_a_dtap_data;
675 static int hf_gsm_a_dtap_acceptable_channel_codings_TCH_F14_4;
676 static int hf_gsm_a_dtap_ti_flag;
677 static int hf_gsm_a_dtap_time_zone_time;
678 static int hf_gsm_a_dtap_acceptable_channel_codings_spare20;
679 static int hf_gsm_a_dtap_establishment;
680 static int hf_gsm_a_dtap_duplex_mode;
681 static int hf_gsm_a_dtap_subaddress;
682 static int hf_gsm_a_dtap_subaddress_information;
683 static int hf_gsm_a_dtap_message_elements;
684 static int hf_gsm_a_dtap_rpdu;
685 static int hf_gsm_a_dtap_timeslot_number;
686 static int hf_gsm_a_dtap_uplink_rlc_sdu_size;
687 static int hf_gsm_a_dtap_radio_bearer;
688 static int hf_gsm_a_dtap_mbms_short_transmission_identity;
689 static int hf_gsm_a_dtap_ue_received_rlc_sdu_counter_value;
690 static int hf_gsm_a_dtap_num_lb_entities;
693 static int hf_gsm_a_dtap_gcc_call_ref;
694 static int hf_gsm_a_dtap_gcc_call_ref_has_priority;
695 static int hf_gsm_a_dtap_gcc_call_priority;
696 static int hf_gsm_a_dtap_gcc_call_state;
697 static int hf_gsm_a_dtap_gcc_cause;
698 static int hf_gsm_a_dtap_gcc_cause_structure;
699 static int hf_gsm_a_dtap_gcc_orig_ind;
700 static int hf_gsm_a_dtap_gcc_state_attr;
701 static int hf_gsm_a_dtap_gcc_state_attr_da;
702 static int hf_gsm_a_dtap_gcc_state_attr_ua;
703 static int hf_gsm_a_dtap_gcc_state_attr_comm;
704 static int hf_gsm_a_dtap_gcc_state_attr_oi;
706 static int hf_gsm_a_dtap_gcc_spare_1;
707 static int hf_gsm_a_dtap_gcc_spare_3;
708 static int hf_gsm_a_dtap_gcc_spare_4;
710 static int hf_gsm_a_dtap_bcc_call_ref;
711 static int hf_gsm_a_dtap_bcc_call_ref_has_priority;
712 static int hf_gsm_a_dtap_bcc_call_priority;
713 static int hf_gsm_a_dtap_bcc_call_state;
714 static int hf_gsm_a_dtap_bcc_cause;
715 static int hf_gsm_a_dtap_bcc_cause_structure;
716 static int hf_gsm_a_dtap_bcc_orig_ind;
717 static int hf_gsm_a_dtap_bcc_state_attr;
718 static int hf_gsm_a_dtap_bcc_state_attr_da;
719 static int hf_gsm_a_dtap_bcc_state_attr_ua;
720 static int hf_gsm_a_dtap_bcc_state_attr_comm;
721 static int hf_gsm_a_dtap_bcc_state_attr_oi;
722 static int hf_gsm_a_dtap_bcc_compr_otdi;
724 static int hf_gsm_a_dtap_bcc_spare_1;
725 static int hf_gsm_a_dtap_bcc_spare_3;
726 static int hf_gsm_a_dtap_bcc_spare_4;
730 /* Initialize the subtree pointers */
731 static int ett_dtap_msg;
732 static int ett_dtap_oct_1;
733 static int ett_cm_srvc_type;
734 static int ett_gsm_enc_info;
735 static int ett_bc_oct_3;
736 static int ett_bc_oct_3a;
737 static int ett_bc_oct_4;
738 static int ett_bc_oct_5;
739 static int ett_bc_oct_5a;
740 static int ett_bc_oct_5b;
741 static int ett_bc_oct_6;
742 static int ett_bc_oct_6a;
743 static int ett_bc_oct_6b;
744 static int ett_bc_oct_6c;
745 static int ett_bc_oct_6d;
746 static int ett_bc_oct_6e;
747 static int ett_bc_oct_6f;
748 static int ett_bc_oct_6g;
749 static int ett_bc_oct_7;
750 static int ett_epc_ue_tl_a_lb_setup;
751 static int ett_mm_timer;
752 static int ett_ue_test_loop_mode;
754 static expert_field ei_gsm_a_dtap_keypad_info_not_dtmf_digit;
755 static expert_field ei_gsm_a_dtap_text_string_not_multiple_of_7;
756 static expert_field ei_gsm_a_dtap_autn;
757 static expert_field ei_gsm_a_dtap_invalid_ia5_character;
758 static expert_field ei_gsm_a_dtap_auts;
759 static expert_field ei_gsm_a_dtap_not_digit;
760 static expert_field ei_gsm_a_dtap_end_mark_unexpected;
761 static expert_field ei_gsm_a_dtap_extraneous_data;
762 static expert_field ei_gsm_a_dtap_missing_mandatory_element;
763 static expert_field ei_gsm_a_dtap_coding_scheme;
764 static expert_field ei_gsm_a_dtap_ti_not_valid;
767 static dissector_table_t u2u_dissector_table;
769 static dissector_handle_t gsm_map_handle;
770 static dissector_handle_t rp_handle;
771 static dissector_handle_t dtap_handle;
773 static proto_tree *g_tree;
776 * this should be set on a per message basis, if possible
778 static int is_uplink;
779 static uint8_t epc_test_loop_mode;
781 #define NUM_GSM_DTAP_ELEM array_length(gsm_dtap_elem_strings)
782 int ett_gsm_dtap_elem[NUM_GSM_DTAP_ELEM];
785 * [9] 10.5.3.1 Authentication parameter RAND
787 static uint16_t
788 de_auth_param_rand(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
790 /* The RAND value is 16 octets long */
791 proto_tree_add_item(tree, hf_gsm_a_dtap_rand, tvb, offset, 16, ENC_NA);
793 /* no length check possible */
794 return (16);
798 * [9] 10.5.3.1.1 Authentication Parameter AUTN (UMTS and EPS authentication challenge)
800 static uint16_t
801 de_auth_param_autn(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
803 proto_item *item;
804 proto_tree *subtree;
806 item = proto_tree_add_item(tree, hf_gsm_a_dtap_autn, tvb, offset, len, ENC_NA);
807 subtree = proto_item_add_subtree(item, ett_gsm_dtap_elem[DE_AUTH_PARAM_AUTN]);
809 if (len == 16)
811 proto_tree_add_item(subtree, hf_gsm_a_dtap_autn_sqn_xor_ak, tvb, offset, 6, ENC_NA);
812 proto_tree_add_item(subtree, hf_gsm_a_dtap_autn_amf, tvb, offset + 6, 2, ENC_NA);
813 proto_tree_add_item(subtree, hf_gsm_a_dtap_autn_mac, tvb, offset + 8, 8, ENC_NA);
815 else
816 expert_add_info(pinfo, item, &ei_gsm_a_dtap_autn);
818 return (len);
822 * [9] 10.5.3.2 Authentication Response parameter
824 static uint16_t
825 de_auth_resp_param(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
827 /* This IE contains either the SRES or the 4 most significant octets of the RES */
828 proto_tree_add_item(tree, hf_gsm_a_dtap_sres, tvb, offset, 4, ENC_NA);
830 /* no length check possible */
831 return 4;
835 * [9] 10.5.3.2.1 Authentication Response Parameter (extension) (UMTS authentication challenge only)
837 static uint16_t
838 de_auth_resp_param_ext(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
840 /* This IE contains all but 4 most significant octets of RES */
841 proto_tree_add_item(tree, hf_gsm_a_dtap_xres, tvb, offset, len, ENC_NA);
843 return (len);
847 * [9] 10.5.3.2.2 Authentication Failure parameter (UMTS and EPS authentication challenge)
849 static uint16_t
850 de_auth_fail_param(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
852 proto_item *item;
853 proto_tree *subtree;
855 item = proto_tree_add_item(tree, hf_gsm_a_dtap_auts, tvb, offset, len, ENC_NA);
856 subtree = proto_item_add_subtree(item, ett_gsm_dtap_elem[DE_AUTH_FAIL_PARAM]);
858 if (len == 14)
860 proto_tree_add_item(subtree, hf_gsm_a_dtap_auts_sqn_ms_xor_ak, tvb, offset, 6, ENC_NA);
861 proto_tree_add_item(subtree, hf_gsm_a_dtap_auts_mac_s, tvb, offset + 6, 8, ENC_NA);
863 else
864 expert_add_info(pinfo, item, &ei_gsm_a_dtap_auts);
866 return (len);
870 * 10.5.3.3 CM service type
871 * handled inline
874 * 10.5.3.4 Identity type
875 * handled inline
878 * 10.5.3.5 Location updating type
879 * handled inline
882 * [3] 10.5.3.5a Network Name
884 static const value_string gsm_a_dtap_number_of_spare_bits_vals[] = {
885 { 0, "this field carries no information about the number of spare bits in octet n"},
886 { 1, "bit 8 is spare and set to '0' in octet n"},
887 { 2, "bits 7 and 8 are spare and set to '0' in octet n"},
888 { 3, "bits 6 to 8(inclusive) are spare and set to '0' in octet n"},
889 { 4, "bits 5 to 8(inclusive) are spare and set to '0' in octet n"},
890 { 5, "bits 4 to 8(inclusive) are spare and set to '0' in octet n"},
891 { 6, "bits 3 to 8(inclusive) are spare and set to '0' in octet n"},
892 { 7, "bits 2 to 8(inclusive) are spare and set to '0' in octet n"},
893 { 0, NULL }
896 static const true_false_string tfs_add_ci = { "The MS should add the letters for the Country's Initials and a separator (e.g. a space) to the text string",
897 "The MS should not add the letters for the Country's Initials to the text string" };
899 static const value_string gsm_a_dtap_coding_scheme_vals[] = {
900 { 0, "Cell Broadcast data coding scheme, GSM default alphabet, language unspecified, defined in 3GPP TS 23.038"},
901 { 1, "UCS2 (16 bit)"},
902 { 2, "Reserved"},
903 { 3, "Reserved"},
904 { 4, "Reserved"},
905 { 5, "Reserved"},
906 { 6, "Reserved"},
907 { 7, "Reserved"},
908 { 0, NULL }
910 static uint16_t
911 de_network_name(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
913 uint8_t oct;
914 uint32_t curr_offset;
915 uint8_t coding_scheme, num_spare_bits;
916 uint32_t num_text_bits;
917 proto_item *item;
919 curr_offset = offset;
921 oct = tvb_get_uint8(tvb, curr_offset);
923 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
925 coding_scheme = (oct & 0x70) >> 4;
926 proto_tree_add_item(tree, hf_gsm_a_dtap_coding_scheme, tvb, curr_offset, 1, ENC_NA);
928 proto_tree_add_item(tree, hf_gsm_a_dtap_add_ci, tvb, curr_offset, 1, ENC_NA);
930 num_spare_bits = oct & 0x07;
931 item = proto_tree_add_item(tree, hf_gsm_a_dtap_number_of_spare_bits, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
932 curr_offset++;
934 NO_MORE_DATA_CHECK(len);
935 switch (coding_scheme)
937 case 0:
938 /* Check if there was a reasonable value for number of spare bits in last octet */
939 num_text_bits = ((len - 1) << 3) - num_spare_bits;
940 if (num_spare_bits && (num_text_bits % 7))
942 expert_add_info(pinfo, item, &ei_gsm_a_dtap_text_string_not_multiple_of_7);
944 proto_tree_add_ts_23_038_7bits_packed_item(tree, hf_gsm_a_dtap_text_string, tvb, curr_offset<<3, num_text_bits/7);
945 break;
946 case 1:
947 proto_tree_add_item(tree, hf_gsm_a_dtap_text_string, tvb, curr_offset, len - 1, ENC_UCS_2|ENC_BIG_ENDIAN);
948 break;
949 default:
950 proto_tree_add_expert(tree, pinfo, &ei_gsm_a_dtap_coding_scheme, tvb, curr_offset, len - 1);
953 return (len);
956 /* 3GPP TS 24.008
957 * [9] 10.5.3.6 Reject cause
959 static const range_string gsm_a_dtap_rej_cause_vals[] = {
960 { 0x02, 0x02, "IMSI unknown in HLR"},
961 { 0x03, 0x03, "Illegal MS"},
962 { 0x04, 0x04, "IMSI unknown in VLR"},
963 { 0x05, 0x05, "IMEI not accepted"},
964 { 0x06, 0x06, "Illegal ME"},
965 { 0x0b, 0x0b, "PLMN not allowed"},
966 { 0x0c, 0x0c, "Location Area not allowed"},
967 { 0x0d, 0x0d, "Roaming not allowed in this location area"},
968 { 0x0f, 0x0f, "No Suitable Cells In Location Area"},
969 { 0x11, 0x11, "Network failure"},
970 { 0x14, 0x14, "MAC failure"},
971 { 0x15, 0x15, "Synch failure"},
972 { 0x16, 0x16, "Congestion"},
973 { 0x17, 0x17, "GSM authentication unacceptable"},
974 { 0x19, 0x19, "Not authorized for this CSG"},
975 { 0x20, 0x20, "Service option not supported"},
976 { 0x21, 0x21, "Requested service option not subscribed"},
977 { 0x22, 0x22, "Service option temporarily out of order"},
978 { 0x26, 0x26, "Call cannot be identified"},
979 { 0x30, 0x3f, "Retry upon entry into a new cell"},
980 { 0x5f, 0x5f, "Semantically incorrect message"},
981 { 0x60, 0x60, "Invalid mandatory information"},
982 { 0x61, 0x61, "Message type non-existent or not implemented"},
983 { 0x62, 0x62, "Message type not compatible with the protocol state"},
984 { 0x63, 0x63, "Information element non-existent or not implemented"},
985 { 0x64, 0x64, "Conditional IE error"},
986 { 0x65, 0x65, "Message not compatible with the protocol state"},
987 { 0x6f, 0x6f, "Protocol error, unspecified"},
988 { 0, 0, NULL }
991 uint16_t
992 de_rej_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
994 uint8_t oct;
995 const char *str;
997 oct = tvb_get_uint8(tvb, offset);
999 str = try_rval_to_str(oct, gsm_a_dtap_rej_cause_vals);
1000 if (!str)
1002 if (is_uplink == IS_UPLINK_TRUE)
1003 str = "Protocol error, unspecified";
1004 else
1005 str = "Service option temporarily out of order";
1008 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_rej_cause, tvb,
1009 offset, 1, oct, "%s (%u)", str, oct);
1011 /* no length check possible */
1013 return 1;
1017 * 10.5.3.7 Follow-on Proceed
1018 * No data
1021 * [3] 10.5.3.8 Time Zone
1023 uint16_t
1024 de_time_zone(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
1026 uint8_t oct;
1027 uint32_t curr_offset;
1028 char sign;
1030 curr_offset = offset;
1032 /* 3GPP TS 23.040 version 6.6.0 Release 6
1033 * 9.2.3.11 TP-Service-Centre-Time-Stamp (TP-SCTS)
1035 * The Time Zone indicates the difference, expressed in quarters of an hour,
1036 * between the local time and GMT. In the first of the two semi-octets,
1037 * the first bit (bit 3 of the seventh octet of the TP-Service-Centre-Time-Stamp field)
1038 * represents the algebraic sign of this difference (0: positive, 1: negative).
1041 oct = tvb_get_uint8(tvb, curr_offset);
1042 sign = (oct & 0x08)?'-':'+';
1043 oct = (oct >> 4) + (oct & 0x07) * 10;
1045 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_timezone, tvb, curr_offset, 1, oct, "GMT %c %d hours %d minutes", sign, oct / 4, oct % 4 * 15);
1046 curr_offset++;
1048 /* no length check possible */
1050 return (curr_offset - offset);
1054 * [3] 10.5.3.9 Time Zone and Time
1056 static uint16_t
1057 de_time_zone_time(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
1059 uint8_t oct;
1060 uint32_t curr_offset;
1061 char sign;
1062 nstime_t tv;
1063 struct tm tm;
1065 curr_offset = offset;
1067 /* "unused" part of structure */
1068 tm.tm_wday = 0;
1069 tm.tm_yday = 0;
1070 tm.tm_isdst = -1;
1072 oct = tvb_get_uint8(tvb, curr_offset);
1073 tm.tm_year = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4) + 100;
1074 oct = tvb_get_uint8(tvb, curr_offset+1);
1075 tm.tm_mon = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4) - 1;
1076 oct = tvb_get_uint8(tvb, curr_offset+2);
1077 tm.tm_mday = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
1078 oct = tvb_get_uint8(tvb, curr_offset+3);
1079 tm.tm_hour = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
1080 oct = tvb_get_uint8(tvb, curr_offset+4);
1081 tm.tm_min = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
1082 oct = tvb_get_uint8(tvb, curr_offset+5);
1083 tm.tm_sec = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
1085 tv.secs = mktime(&tm);
1086 tv.nsecs = 0;
1088 proto_tree_add_time_format_value(tree, hf_gsm_a_dtap_time_zone_time, tvb, curr_offset, 6,
1089 &tv, "%s", abs_time_to_str(pinfo->pool, &tv, ABSOLUTE_TIME_LOCAL, false));
1090 curr_offset += 6;
1092 /* 3GPP TS 23.040 version 6.6.0 Release 6
1093 * 9.2.3.11 TP-Service-Centre-Time-Stamp (TP-SCTS)
1095 * The Time Zone indicates the difference, expressed in quarters of an hour,
1096 * between the local time and GMT. In the first of the two semi-octets,
1097 * the first bit (bit 3 of the seventh octet of the TP-Service-Centre-Time-Stamp field)
1098 * represents the algebraic sign of this difference (0: positive, 1: negative).
1101 oct = tvb_get_uint8(tvb, curr_offset);
1102 sign = (oct & 0x08)?'-':'+';
1103 oct = (oct >> 4) + (oct & 0x07) * 10;
1105 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_timezone, tvb, curr_offset, 1, oct, "GMT %c %d hours %d minutes", sign, oct / 4, oct % 4 * 15);
1107 curr_offset++;
1109 /* no length check possible */
1111 return (curr_offset - offset);
1114 * 10.5.3.10 CTS permission
1115 * No data
1118 * [3] 10.5.3.11 LSA Identifier
1119 * 3GPP TS 24.008 version 6.8.0 Release 6
1121 static uint16_t
1122 de_lsa_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
1124 uint32_t curr_offset;
1126 curr_offset = offset;
1128 if (len == 0) {
1129 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_lsa_id, tvb, curr_offset, len, 0, "not included");
1131 else
1133 proto_tree_add_item(tree, hf_gsm_a_dtap_lsa_id, tvb, curr_offset, 3, ENC_BIG_ENDIAN);
1136 curr_offset += len;
1138 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data);
1140 return (curr_offset - offset);
1144 * [3] 10.5.3.12 Daylight Saving Time
1146 static const value_string gsm_a_dtap_dst_adjustment_vals[] = {
1147 { 0, "No adjustment for Daylight Saving Time"},
1148 { 1, "+1 hour adjustment for Daylight Saving Time"},
1149 { 2, "+2 hours adjustment for Daylight Saving Time"},
1150 { 3, "Reserved"},
1151 { 0, NULL }
1154 static uint16_t
1155 de_day_saving_time(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
1157 uint32_t curr_offset;
1159 curr_offset = offset;
1161 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 6, ENC_BIG_ENDIAN);
1163 proto_tree_add_item(tree, hf_gsm_a_dtap_dst_adjustment, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1164 curr_offset++;
1166 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data);
1168 return (curr_offset - offset);
1172 * 10.5.3.13 Emergency Number List
1174 static uint16_t
1175 de_emerg_num_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
1177 uint32_t curr_offset;
1178 uint8_t en_len;
1179 uint8_t count;
1180 proto_tree *subtree;
1181 proto_item *item;
1182 char *digit_str;
1184 curr_offset = offset;
1186 count = 1;
1187 while ((curr_offset - offset) < len) {
1188 /* Length of 1st Emergency Number information note 1) octet 3
1189 * NOTE 1: The length contains the number of octets used to encode the
1190 * Emergency Service Category Value and the Number digits.
1192 en_len = tvb_get_uint8(tvb, curr_offset);
1194 item = proto_tree_add_uint(tree, hf_gsm_a_dtap_emergency_number_information,
1195 tvb, curr_offset, en_len + 1, count);
1196 subtree = proto_item_add_subtree(item, ett_gsm_dtap_elem[DE_EMERGENCY_NUM_LIST]);
1197 proto_tree_add_item(subtree, hf_gsm_a_dtap_emerg_num_info_length, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1199 curr_offset++;
1200 /* 0 0 0 Emergency Service Category Value (see
1201 * Table 10.5.135d/3GPP TS 24.008
1202 * Table 10.5.135d/3GPP TS 24.008: Service Category information element
1204 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 3, ENC_BIG_ENDIAN);
1205 proto_tree_add_item(subtree, hf_gsm_a_dtap_serv_cat_b5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1206 proto_tree_add_item(subtree, hf_gsm_a_dtap_serv_cat_b4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1207 proto_tree_add_item(subtree, hf_gsm_a_dtap_serv_cat_b3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1208 proto_tree_add_item(subtree, hf_gsm_a_dtap_serv_cat_b2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1209 proto_tree_add_item(subtree, hf_gsm_a_dtap_serv_cat_b1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1210 curr_offset++;
1211 en_len--;
1213 item = proto_tree_add_item_ret_display_string(subtree, hf_gsm_a_dtap_emergency_bcd_num, tvb, curr_offset, en_len, ENC_BCD_DIGITS_0_9|ENC_LITTLE_ENDIAN, pinfo->pool, &digit_str);
1215 /* Check for values that aren't digits; they get mapped to '?' */
1216 if(strchr(digit_str,'?')){
1217 expert_add_info(pinfo, item, &ei_gsm_a_dtap_not_digit);
1220 curr_offset = curr_offset + en_len;
1221 count++;
1224 return (len);
1228 * 10.5.3.14 Additional update parameters
1230 static const true_false_string gsm_a_dtap_drvcc_value = {
1231 "DRVCC call",
1232 "No additional information"
1235 static const true_false_string gsm_a_dtap_csmo_value = {
1236 "CS fallback mobile originating call",
1237 "No additional information"
1240 static const true_false_string gsm_a_dtap_csmt_value = {
1241 "CS fallback mobile terminating call",
1242 "No additional information"
1245 static uint16_t
1246 de_add_upd_params(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
1248 uint32_t curr_offset;
1250 curr_offset = offset;
1252 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 1, ENC_BIG_ENDIAN);
1253 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_drvcc, tvb, (curr_offset<<3)+5, 1, ENC_BIG_ENDIAN);
1254 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_csmo, tvb, (curr_offset<<3)+6, 1, ENC_BIG_ENDIAN);
1255 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_csmt, tvb, (curr_offset<<3)+7, 1, ENC_BIG_ENDIAN);
1257 return (len);
1261 * 10.5.3.15 MM Timer
1263 static const value_string gsm_a_dtap_mm_timer_unit_vals[] = {
1264 { 0x00, "value is incremented in multiples of 2 seconds" },
1265 { 0x01, "value is incremented in multiples of 1 minute" },
1266 { 0x02, "value is incremented in multiples of decihours" },
1267 { 0x07, "value indicates that the timer is deactivated" },
1268 { 0, NULL }
1271 static uint16_t
1272 de_mm_timer(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
1274 uint8_t oct;
1275 uint16_t val;
1276 const char *str;
1277 proto_tree *subtree;
1278 proto_item *item = NULL;
1280 oct = tvb_get_uint8(tvb, offset);
1281 val = oct&0x1f;
1283 switch (oct>>5)
1285 case 0:
1286 str = "sec"; val*=2;
1287 break;
1288 case 1:
1289 str = "min";
1290 break;
1291 case 2:
1292 str = "min"; val*=6;
1293 break;
1294 case 7:
1295 str = "";
1296 item = proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_mm_timer, tvb, offset, 1,
1297 oct, "timer is deactivated");
1298 break;
1299 default:
1300 str = "min";
1301 break;
1304 if (item == NULL) {
1305 item = proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_mm_timer, tvb, offset, 1, val,
1306 "%u %s", val, str);
1309 subtree = proto_item_add_subtree(item, ett_mm_timer);
1310 proto_tree_add_item(subtree, hf_gsm_a_dtap_mm_timer_unit, tvb, offset, 1, ENC_BIG_ENDIAN);
1311 proto_tree_add_item(subtree, hf_gsm_a_dtap_mm_timer_value, tvb, offset, 1, ENC_BIG_ENDIAN);
1313 return 1;
1317 * [3] 10.5.4.4 Auxiliary states
1320 static const value_string gsm_a_dtap_hold_auxiliary_state_vals[] = {
1321 { 0x00, "Idle" },
1322 { 0x01, "Hold request" },
1323 { 0x02, "Call held" },
1324 { 0x03, "Retrieve request" },
1325 { 0, NULL }
1328 static const value_string gsm_a_dtap_multi_party_auxiliary_state_vals[] = {
1329 { 0x00, "Idle" },
1330 { 0x01, "MPTY request" },
1331 { 0x02, "Call in MPTY" },
1332 { 0x03, "Split request" },
1333 { 0, NULL }
1336 static uint16_t
1337 de_aux_states(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
1339 uint32_t curr_offset;
1341 curr_offset = offset;
1343 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1345 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+1, 3, ENC_BIG_ENDIAN);
1346 proto_tree_add_item(tree, hf_gsm_a_dtap_hold_auxiliary_state, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1347 proto_tree_add_item(tree, hf_gsm_a_dtap_multi_party_auxiliary_state, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1348 curr_offset++;
1350 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data);
1352 return (curr_offset - offset);
1355 * 10.5.4.4a Backup bearer capability
1358 * [3] 10.5.4.5 Bearer capability (3GPP TS 24.008 version 8.4.0 Release 8)
1360 /* Speech version indication (octet(s) 3a etc.) Bits 4 3 2 1 */
1362 static const value_string gsm_a_dtap_speech_vers_ind_values[] = {
1363 { 0x0, "GSM full rate speech version 1(GSM FR)" },
1364 { 0x1, "GSM half rate speech version 1(GSM HR)" },
1365 { 0x2, "GSM full rate speech version 2(GSM EFR)" },
1366 { 0x3, "Speech version tbd" },
1367 { 0x4, "GSM full rate speech version 3(FR AMR)" },
1368 { 0x5, "GSM half rate speech version 3(HR AMR)" },
1369 { 0x6, "GSM full rate speech version 4(OFR AMR-WB)" },
1370 { 0x7, "GSM half rate speech version 4(OHR AMR-WB)" },
1371 { 0x8, "GSM full rate speech version 5(FR AMR-WB)" },
1372 { 0x9, "Speech version tbd" },
1373 { 0xa, "Speech version tbd" },
1374 { 0xb, "GSM half rate speech version 6(OHR AMR)" },
1375 { 0xc, "Speech version tbd" },
1376 { 0xd, "Speech version tbd" },
1377 { 0xe, "Speech version tbd" },
1378 { 0xf, "No speech version supported for GERAN" },
1379 { 0, NULL }
1381 /* All other values have the meaning "speech version tbd" and shall be ignored
1382 * when received.
1385 * Information transfer capability (octet 3) Bits 3 2 1
1387 static const value_string gsm_a_dtap_itc_values[] = {
1388 { 0x0, "Speech" },
1389 { 0x1, "Unrestricted digital information" },
1390 { 0x2, "3.1 kHz audio, ex PLMN" },
1391 { 0x3, "Facsimile group 3" },
1392 { 0x5, "Other ITC (See Octet 5a)" },
1393 { 0x7, "Reserved,(In Network alternate speech/facsimile group 3)" },
1394 { 0, NULL }
1397 static const value_string gsm_a_dtap_structure_vals[] = {
1398 { 0x0, "Service data unit integrity" },
1399 { 0x1, "Reserved" },
1400 { 0x2, "Reserved" },
1401 { 0x3, "Unstructured" },
1402 { 0, NULL }
1405 static const value_string gsm_a_dtap_access_identity_vals[] = {
1406 { 0x0, "Octet identifier" },
1407 { 0x1, "Octet identifier" },
1408 { 0x2, "Octet identifier" },
1409 { 0x3, "Reserved" },
1410 { 0, NULL }
1413 static const value_string gsm_a_dtap_rate_adaption_vals[] = {
1414 { 0x0, "No rate adaption" },
1415 { 0x1, "Rate adaptation according to ITU-T Rec. V.110 and ITU-T Rec. X.30" },
1416 { 0x2, "Flag stuffing according to ITU-T Rec. X.31" },
1417 { 0x3, "Other rate adaption (see octet 5a)" },
1418 { 0, NULL }
1421 static const value_string gsm_a_dtap_signal_access_protocol_vals[] = {
1422 { 0x0, "Reserved" },
1423 /* 3GPP TS 24.008 (version 16.6.0), Table 10.5.101c defines only one value.
1424 * All other values are reserved (were allocated in earlier phases of the protocol). */
1425 { 0x1, "According to ITU-T Rec. Q.920 and ITU-T Rec. Q.930" },
1426 /* Below are values from GSM 04.08 (version 5.3.0, July 1996). */
1427 { 0x2, "Reserved (old meaning: X.21)" },
1428 { 0x3, "Reserved (old meaning: X.28 - dedicated PAD, individual NUI)" },
1429 { 0x4, "Reserved (old meaning: X.28 - dedicated PAD, universal NUI)" },
1430 { 0x5, "Reserved (old meaning: X.28 - non dedicated PAD)" },
1431 { 0x6, "Reserved (old meaning: X.32)" },
1432 { 0x7, "Reserved" },
1433 { 0, NULL }
1436 static const value_string gsm_a_dtap_other_itc_vals[] = {
1437 { 0x0, "Restricted digital information" },
1438 { 0x1, "Restricted digital information" },
1439 { 0x2, "Restricted digital information" },
1440 { 0x3, "Reserved" },
1441 { 0, NULL }
1444 static const value_string gsm_a_dtap_other_rate_adaption_vals[] = {
1445 { 0x0, "According to ITU-T Rec. V.120" },
1446 { 0x1, "According to ITU-T Rec. H.223 and ITU-T Rec. H.245" },
1447 { 0x2, "PIAFS" },
1448 { 0x3, "Reserved" },
1449 { 0, NULL }
1452 static const value_string gsm_a_dtap_user_rate_vals[] = {
1453 { 0x1, "0.3 kbit/s (according to ITU-T Rec. X.1 and ITU-T Rec. V.110)" },
1454 { 0x2, "1.2 kbit/s (according to ITU-T Rec. X.1 and ITU-T Rec. V.110)" },
1455 { 0x3, "2.4 kbit/s (according to ITU-T Rec. X.1 and ITU-T Rec. V.110)" },
1456 { 0x4, "4.8 kbit/s (according to ITU-T Rec. X.1 and ITU-T Rec. V.110)" },
1457 { 0x5, "9.6 kbit/s (according to ITU-T Rec. X.1 and ITU-T Rec. V.110)" },
1458 { 0x6, "12.0 kbit/s transparent (non compliance with ITU-T Rec. X.1 and ITU-T Rec. V.110)" },
1459 { 0x7, "Reserved: was allocated in earlier phases of the protocol" },
1460 { 0, NULL }
1463 static const value_string gsm_a_dtap_v110_x30_rate_adaptation_vals[] = {
1464 { 0x0, "Reserved" },
1465 { 0x1, "Reserved" },
1466 { 0x2, "8 kbit/s" },
1467 { 0x3, "16 kbit/s" },
1468 { 0, NULL }
1471 static const value_string gsm_a_dtap_parity_info_vals[] = {
1472 { 0x0, "Odd" },
1473 { 0x1, "Reserved" },
1474 { 0x2, "Even" },
1475 { 0x3, "None" },
1476 { 0x4, "Forced to 0" },
1477 { 0x5, "Forced to 1" },
1478 { 0x6, "Reserved" },
1479 { 0x7, "Reserved" },
1480 { 0, NULL }
1483 static const value_string gsm_a_dtap_connection_element_vals[] = {
1484 { 0x0, "Transparent" },
1485 { 0x1, "Non transparent (RLP)" },
1486 { 0x2, "Both, transparent preferred" },
1487 { 0x3, "Both, non transparent preferred" },
1488 { 0, NULL }
1491 static const value_string gsm_a_dtap_modem_type_vals[] = {
1492 { 0x0, "None" },
1493 { 0x1, "According to ITU-T Rec. V.21" },
1494 { 0x2, "According to ITU-T Rec. V.22" },
1495 { 0x3, "According to ITU-T Rec. V.22 bis" },
1496 { 0x4, "Reserved: was allocated in earlier phases of the protocol" },
1497 { 0x5, "According to ITU-T Rec. V.26 ter" },
1498 { 0x6, "According to ITU-T Rec. V.32" },
1499 { 0x7, "Modem for undefined interface" },
1500 { 0x8, "Autobauding type 1" },
1501 { 0, NULL }
1504 static const value_string gsm_a_dtap_other_modem_type_vals[] = {
1505 { 0x0, "No other modem type specified in this field" },
1506 { 0x1, "Reserved" },
1507 { 0x2, "According to ITU-T Rec. V.34" },
1508 { 0x3, "Reserved" },
1509 { 0, NULL }
1512 static const value_string gsm_a_dtap_fixed_network_user_rate_vals[] = {
1513 { 0x00, "Fixed network user rate not applicable/No meaning is associated with this value"},
1514 { 0x01, "9.6 kbit/s (according to ITU-T Rec. X.1 and ITU-T Rec. V.110)"},
1515 { 0x02, "14.4 kbit/s (according to ITU-T Rec. X.1 and ITU-T Rec. V.110)"},
1516 { 0x03, "19.2 kbit/s (according to ITU-T Rec. X.1 and ITU-T Rec. V.110)"},
1517 { 0x04, "28.8 kbit/s (according to ITU-T Rec. X.1 and ITU-T Rec. V.110)"},
1518 { 0x05, "38.4 kbit/s (according to ITU-T Rec. X.1 and ITU-T Rec. V.110)"},
1519 { 0x06, "48.0 kbit/s (according to ITU-T Rec. X.1 and ITU-T Rec. V.110 (synch))"},
1520 { 0x07, "56.0 kbit/s (according to ITU-T Rec. X.1 and ITU-T Rec. V.110 (synch) /bit transparent)"},
1521 { 0x08, "64.0 kbit/s bit transparent"},
1522 { 0x09, "33.6 kbit/s bit transparent"},
1523 { 0x0a, "32.0 kbit/s (according to ITU-T Rec. I.460)"},
1524 { 0x0b, "31.2 kbit/s (according to ITU-T Rec. V.34)"},
1525 { 0, NULL }
1528 static const value_string gsm_a_dtap_uimi_vals[] = {
1529 { 0x0, "not allowed/required/applicable" },
1530 { 0x1, "up to 1 TCH/F allowed/may be requested" },
1531 { 0x2, "up to 2 TCH/F allowed/may be requested" },
1532 { 0x3, "up to 3 TCH/F allowed/may be requested" },
1533 { 0x4, "up to 4 TCH/F allowed/may be requested" },
1534 { 0x5, "up to 4 TCH/F may be requested" },
1535 { 0x6, "up to 4 TCH/F may be requested" },
1536 { 0x7, "up to 4 TCH/F may be requested" },
1537 { 0, NULL }
1540 static const value_string gsm_a_dtap_wanted_air_rate_vals[] = {
1541 { 0x0, "Air interface user rate not applicable/No meaning associated with this value" },
1542 { 0x1, "9.6 kbit/s" },
1543 { 0x2, "14.4 kbit/s" },
1544 { 0x3, "19.2 kbit/s" },
1545 { 0x4, "Reserved" },
1546 { 0x5, "28.8 kbit/s" },
1547 { 0x6, "38.4 kbit/s" },
1548 { 0x7, "43.2 kbit/s" },
1549 { 0x8, "57.6 kbit/s" },
1550 { 0x9, "interpreted by the network as 38.4 kbit/s in this version of the protocol" },
1551 { 0xa, "interpreted by the network as 38.4 kbit/s in this version of the protocol" },
1552 { 0xb, "interpreted by the network as 38.4 kbit/s in this version of the protocol" },
1553 { 0xc, "interpreted by the network as 38.4 kbit/s in this version of the protocol" },
1554 { 0xd, "Reserved" },
1555 { 0xe, "Reserved" },
1556 { 0xf, "Reserved" },
1557 { 0, NULL }
1560 static const value_string gsm_a_dtap_channel_coding_asymmetry_ind_vals[] = {
1561 { 0x0, "Channel coding symmetry preferred" },
1562 { 0x1, "Uplink biased channel coding asymmetry is preferred" },
1563 { 0x2, "Downlink biased channel coding asymmetry is preferred" },
1564 { 0x3, "Unused, treat as Channel coding symmetry preferred" },
1565 { 0, NULL }
1568 static const value_string gsm_a_dtap_user_info_layer2_vals[] = {
1569 { 0x06, "Reserved: was allocated in earlier phases of the protocol" },
1570 { 0x08, "According to ISO/IEC 6429, codeset 0 (DC1/DC3)" },
1571 { 0x09, "Reserved: was allocated but never used in earlier phases of the protocol" },
1572 { 0x0a, "Videotex profile 1" },
1573 { 0x0c, "COPnoFlCt (Character oriented Protocol with no Flow Control mechanism)" },
1574 { 0x0d, "Reserved: was allocated in earlier phases of the protocol" },
1575 { 0, NULL }
1578 static const true_false_string tfs_bearer_cap_coding_standard = { "reserved", "GSM standardized coding" };
1579 static const true_false_string tfs_bearer_cap_transfer_mode = { "packet", "circuit" };
1580 static const true_false_string tfs_bearer_cap_coding = { "octet used for other extension of octet 3", "octet used for extension of information transfer capability" };
1581 static const true_false_string tfs_bearer_cap_configuration = { "Reserved", "Point-to-point" };
1582 static const true_false_string tfs_nirr = { "Data up to and including 4.8 kb/s, full rate, non-transparent, 6 kb/s radio interface rate is requested",
1583 "No meaning is associated with this value" };
1584 static const true_false_string tfs_bearer_cap_establishment = { "Reserved", "Demand" };
1585 static const true_false_string tfs_frame_est_supported_not_supported = { "Supported", "Not supported, only UI frames allowed" };
1586 static const true_false_string tfs_log_link_neg = { "Full protocol negotiation", "Default, LLI=256 only" };
1587 static const true_false_string tfs_assignor_assignee = { "Message originator is assignor only", "Message originator is default assignee" };
1588 static const true_false_string tfs_in_out_band = { "Negotiation is done with USER INFORMATION messages on a temporary signalling connection",
1589 "Negotiation is done in-band using logical link zero" };
1590 static const true_false_string tfs_stop_bits = { "2", "1" };
1591 static const true_false_string tfs_negotiation = { "Reserved", "In-band negotiation not possible" };
1592 static const true_false_string tfs_parity_bits = { "8", "7" };
1593 static const true_false_string tfs_nic_on_tx = { "requires to send data with network independent clock",
1594 "does not require to send data with network independent clock" };
1595 static const true_false_string tfs_nic_on_rx = { "can accept data with network independent clock",
1596 "cannot accept data with network independent clock" };
1598 uint16_t
1599 de_bearer_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len)
1601 uint8_t oct;
1602 uint8_t itc;
1603 bool extended;
1604 uint32_t curr_offset;
1605 uint32_t saved_offset;
1606 proto_tree *subtree;
1607 proto_item *item;
1608 const char *str;
1610 #define DE_BC_ITC_SPEECH 0x00
1611 #define DE_BC_ITC_UDI 0x01
1612 #define DE_BC_ITC_EX_PLMN 0x02
1613 #define DE_BC_ITC_FASC_G3 0x03
1614 #define DE_BC_ITC_OTHER_ITC 0x05
1615 #define DE_BC_ITC_RSVD_NET 0x07
1617 curr_offset = offset;
1619 oct = tvb_get_uint8(tvb, curr_offset);
1621 /* octet 3 */
1624 * warning, bearer cap uses extended values that
1625 * are reversed from other parameters!
1627 subtree =
1628 proto_tree_add_subtree(tree,
1629 tvb, curr_offset, 1,
1630 ett_bc_oct_3, NULL, "Octet 3");
1632 extended = (oct & 0x80) ? false : true;
1633 itc = oct & 0x07;
1635 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1637 switch (is_uplink)
1639 case IS_UPLINK_FALSE:
1640 str = "Spare";
1641 break;
1643 case IS_UPLINK_TRUE:
1645 * depends on Information transfer capability
1647 switch (itc)
1649 case DE_BC_ITC_SPEECH:
1650 if (extended)
1652 switch ((oct & 0x60) >> 5)
1654 case 1: str = "MS supports at least full rate speech version 1 but does not support half rate speech version 1"; break;
1655 case 2: str = "MS supports at least full rate speech version 1 and half rate speech version 1. MS has a greater preference for half rate speech version 1 than for full rate speech version 1"; break;
1656 case 3: str = "MS supports at least full rate speech version 1 and half rate speech version 1. MS has a greater preference for full rate speech version 1 than for half rate speech version 1"; break;
1657 default:
1658 str = "Reserved";
1659 break;
1662 else
1664 switch ((oct & 0x60) >> 5)
1666 case 1: str = "Full rate support only MS/fullrate speech version 1 supported"; break;
1667 case 2: str = "Dual rate support MS/half rate speech version 1 preferred, full rate speech version 1 also supported"; break;
1668 case 3: str = "Dual rate support MS/full rate speech version 1 preferred, half rate speech version 1 also supported"; break;
1669 default:
1670 str = "Reserved";
1671 break;
1674 break;
1676 default:
1677 switch ((oct & 0x60) >> 5)
1679 case 1: str = "Full rate support only MS"; break;
1680 case 2: str = "Dual rate support MS/half rate preferred"; break;
1681 case 3: str = "Dual rate support MS/full rate preferred"; break;
1682 default:
1683 str = "Reserved";
1684 break;
1686 break;
1688 break;
1690 default:
1691 str = "(dissect problem)";
1692 break;
1695 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_radio_channel_requirement, tvb, curr_offset, 1,
1696 oct, "%s", str);
1698 proto_tree_add_item(subtree, hf_gsm_a_dtap_bearer_cap_coding_standard, tvb, curr_offset, 1, ENC_NA);
1699 proto_tree_add_item(subtree, hf_gsm_a_dtap_transfer_mode, tvb, curr_offset, 1, ENC_NA);
1701 proto_tree_add_item(subtree, hf_gsm_a_dtap_itc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1703 if (add_string)
1704 snprintf(add_string, string_len, " - (%s)", str);
1706 curr_offset++;
1708 NO_MORE_DATA_CHECK(len);
1710 switch (itc)
1712 case DE_BC_ITC_SPEECH:
1713 /* octets 3a */
1715 subtree =
1716 proto_tree_add_subtree(tree,
1717 tvb, curr_offset, -1, ett_bc_oct_3a, &item,
1718 "Octets 3a - Speech Versions");
1720 saved_offset = curr_offset;
1724 oct = tvb_get_uint8(tvb, curr_offset);
1726 extended = (oct & 0x80) ? false : true;
1728 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1729 proto_tree_add_item(subtree, hf_gsm_a_dtap_coding, tvb, curr_offset, 1, ENC_NA);
1730 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+2, 2, ENC_BIG_ENDIAN);
1731 proto_tree_add_item(subtree, hf_gsm_a_dtap_speech_vers_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1732 curr_offset++;
1734 while (extended &&
1735 ((len - (curr_offset - offset)) > 0));
1737 proto_item_set_len(item, curr_offset - saved_offset);
1738 break;
1740 default:
1741 /* octet 4 */
1743 subtree =
1744 proto_tree_add_subtree(tree,
1745 tvb, curr_offset, 1,
1746 ett_bc_oct_4, NULL, "Octet 4");
1748 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1749 proto_tree_add_item(subtree, is_uplink ? hf_gsm_a_dtap_compression_up : hf_gsm_a_dtap_compression,
1750 tvb, curr_offset, 1, ENC_NA);
1752 proto_tree_add_item(subtree, hf_gsm_a_dtap_structure, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1753 proto_tree_add_item(subtree, hf_gsm_a_dtap_duplex_mode, tvb, curr_offset, 1, ENC_NA);
1754 proto_tree_add_item(subtree, hf_gsm_a_dtap_configuration, tvb, curr_offset, 1, ENC_NA);
1755 proto_tree_add_item(subtree, hf_gsm_a_dtap_nirr, tvb, curr_offset, 1, ENC_NA);
1756 proto_tree_add_item(subtree, hf_gsm_a_dtap_establishment, tvb, curr_offset, 1, ENC_NA);
1757 curr_offset++;
1759 NO_MORE_DATA_CHECK(len);
1761 /* octet 5 */
1763 subtree =
1764 proto_tree_add_subtree(tree,
1765 tvb, curr_offset, 1,
1766 ett_bc_oct_5, NULL, "Octet 5");
1768 oct = tvb_get_uint8(tvb, curr_offset);
1770 extended = (oct & 0x80) ? false : true;
1772 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1773 proto_tree_add_item(subtree, hf_gsm_a_dtap_access_identity, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1774 proto_tree_add_item(subtree, hf_gsm_a_dtap_rate_adaption, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1775 proto_tree_add_item(subtree, hf_gsm_a_dtap_signalling_access_protocol, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1776 curr_offset++;
1778 NO_MORE_DATA_CHECK(len);
1780 if (!extended) goto bc_octet_6;
1782 /* octet 5a */
1784 subtree =
1785 proto_tree_add_subtree(tree,
1786 tvb, curr_offset, 1,
1787 ett_bc_oct_5a, NULL, "Octet 5a");
1789 oct = tvb_get_uint8(tvb, curr_offset);
1791 extended = (oct & 0x80) ? false : true;
1793 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1794 proto_tree_add_item(subtree, hf_gsm_a_dtap_other_itc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1795 proto_tree_add_item(subtree, hf_gsm_a_dtap_other_rate_adaption, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1796 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+5, 3, ENC_BIG_ENDIAN);
1797 curr_offset++;
1799 NO_MORE_DATA_CHECK(len);
1801 if (!extended) goto bc_octet_6;
1803 /* octet 5b */
1805 subtree =
1806 proto_tree_add_subtree(tree,
1807 tvb, curr_offset, 1,
1808 ett_bc_oct_5b, NULL, "Octet 5b");
1810 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1811 proto_tree_add_item(subtree, hf_gsm_a_dtap_rate_adaption_header, tvb, curr_offset, 1, ENC_NA);
1812 proto_tree_add_item(subtree, hf_gsm_a_dtap_multiple_frame_establishment_support, tvb, curr_offset, 1, ENC_NA);
1813 proto_tree_add_item(subtree, hf_gsm_a_dtap_mode_of_operation, tvb, curr_offset, 1, ENC_NA);
1814 proto_tree_add_item(subtree, hf_gsm_a_dtap_logical_link_identifier_negotiation, tvb, curr_offset, 1, ENC_NA);
1815 proto_tree_add_item(subtree, hf_gsm_a_dtap_assignor_assignee, tvb, curr_offset, 1, ENC_NA);
1816 proto_tree_add_item(subtree, hf_gsm_a_dtap_in_out_band, tvb, curr_offset, 1, ENC_NA);
1817 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+7, 1, ENC_BIG_ENDIAN);
1819 curr_offset++;
1821 NO_MORE_DATA_CHECK(len);
1823 bc_octet_6:
1825 /* octet 6 */
1827 subtree =
1828 proto_tree_add_subtree(tree,
1829 tvb, curr_offset, 1,
1830 ett_bc_oct_6, NULL, "Octet 6");
1832 oct = tvb_get_uint8(tvb, curr_offset);
1834 extended = (oct & 0x80) ? false : true;
1836 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1838 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_layer_1_identity, tvb, curr_offset, 1, oct,
1839 "%s", ((oct & 0x60) == 0x20) ? "Octet identifier" : "Reserved");
1841 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_user_information_layer_1_protocol,
1842 tvb, curr_offset, 1, oct, "%s",
1843 (oct & 0x1e) ? "Reserved" : "Default layer 1 protocol");
1845 proto_tree_add_item(subtree, hf_gsm_a_dtap_synchronous, tvb, curr_offset, 1, ENC_NA);
1846 curr_offset++;
1848 NO_MORE_DATA_CHECK(len);
1850 if (!extended) goto bc_octet_7;
1852 /* octet 6a */
1854 subtree =
1855 proto_tree_add_subtree(tree,
1856 tvb, curr_offset, 1,
1857 ett_bc_oct_6a, NULL, "Octet 6a");
1859 oct = tvb_get_uint8(tvb, curr_offset);
1861 extended = (oct & 0x80) ? false : true;
1863 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1864 proto_tree_add_item(subtree, hf_gsm_a_dtap_number_of_stop_bits, tvb, curr_offset, 1, ENC_NA);
1865 proto_tree_add_item(subtree, hf_gsm_a_dtap_negotiation, tvb, curr_offset, 1, ENC_NA);
1866 proto_tree_add_item(subtree, hf_gsm_a_dtap_number_of_data_bits, tvb, curr_offset, 1, ENC_NA);
1868 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_user_rate,
1869 tvb, curr_offset, 1, oct, "%s", val_to_str_const(oct & 0xF, gsm_a_dtap_user_rate_vals, "Reserved"));
1871 curr_offset++;
1873 NO_MORE_DATA_CHECK(len);
1875 if (!extended) goto bc_octet_7;
1877 /* octet 6b */
1879 subtree =
1880 proto_tree_add_subtree(tree,
1881 tvb, curr_offset, 1,
1882 ett_bc_oct_6b, NULL, "Octet 6b");
1884 oct = tvb_get_uint8(tvb, curr_offset);
1886 extended = (oct & 0x80) ? false : true;
1888 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1889 proto_tree_add_item(subtree, hf_gsm_a_dtap_v110_x30_rate_adaptation, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1890 proto_tree_add_item(subtree, hf_gsm_a_dtap_nic_on_tx, tvb, curr_offset, 1, ENC_NA);
1891 proto_tree_add_item(subtree, hf_gsm_a_dtap_nic_on_rx, tvb, curr_offset, 1, ENC_NA);
1892 proto_tree_add_item(subtree, hf_gsm_a_dtap_parity_information, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1893 curr_offset++;
1895 NO_MORE_DATA_CHECK(len);
1897 if (!extended) goto bc_octet_7;
1899 /* octet 6c */
1901 subtree =
1902 proto_tree_add_subtree(tree,
1903 tvb, curr_offset, 1,
1904 ett_bc_oct_6c, NULL, "Octet 6c");
1906 oct = tvb_get_uint8(tvb, curr_offset);
1908 extended = (oct & 0x80) ? false : true;
1910 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1911 proto_tree_add_item(subtree, hf_gsm_a_dtap_connection_element, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1912 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_modem_type, tvb, curr_offset, 1,
1913 oct, "%s", val_to_str_const(oct & 0x1f, gsm_a_dtap_modem_type_vals, "Reserved"));
1915 curr_offset++;
1917 NO_MORE_DATA_CHECK(len);
1919 if (!extended) goto bc_octet_7;
1921 /* octet 6d */
1923 subtree =
1924 proto_tree_add_subtree(tree,
1925 tvb, curr_offset, 1,
1926 ett_bc_oct_6d, NULL, "Octet 6d");
1928 oct = tvb_get_uint8(tvb, curr_offset);
1930 extended = (oct & 0x80) ? false : true;
1932 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1933 proto_tree_add_item(subtree, hf_gsm_a_dtap_other_modem_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1934 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_fixed_network_user_rate, tvb, curr_offset, 1,
1935 oct, "%s", val_to_str_const(oct & 0x1f, gsm_a_dtap_fixed_network_user_rate_vals, "Reserved"));
1936 curr_offset++;
1938 NO_MORE_DATA_CHECK(len);
1940 if (!extended) goto bc_octet_7;
1942 /* octet 6e */
1944 subtree =
1945 proto_tree_add_subtree(tree,
1946 tvb, curr_offset, 1,
1947 ett_bc_oct_6e, NULL, "Octet 6e");
1949 oct = tvb_get_uint8(tvb, curr_offset);
1951 extended = (oct & 0x80) ? false : true;
1953 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1955 if (is_uplink == IS_UPLINK_TRUE)
1957 proto_tree_add_item(subtree, hf_gsm_a_dtap_acceptable_channel_codings_TCH_F14_4, tvb, curr_offset, 1, ENC_NA);
1958 proto_tree_add_item(subtree, hf_gsm_a_dtap_acceptable_channel_codings_spare20, tvb, curr_offset, 1, ENC_NA);
1959 proto_tree_add_item(subtree, hf_gsm_a_dtap_acceptable_channel_codings_TCH_F9_6, tvb, curr_offset, 1, ENC_NA);
1960 proto_tree_add_item(subtree, hf_gsm_a_dtap_acceptable_channel_codings_TCH_F4_8, tvb, curr_offset, 1, ENC_NA);
1962 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_maximum_number_of_traffic_channels, tvb, curr_offset, 1,
1963 (oct & 0x07) + 1, "%u TCH", (oct & 0x07) + 1);
1965 else
1967 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_acceptable_channel_codings_spare78, tvb, curr_offset, 1,
1968 oct, "Spare");
1969 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_maximum_number_of_traffic_channels, tvb, curr_offset, 1,
1970 oct, "Spare");
1973 curr_offset++;
1975 NO_MORE_DATA_CHECK(len);
1977 if (!extended) goto bc_octet_7;
1979 /* octet 6f */
1981 subtree =
1982 proto_tree_add_subtree(tree,
1983 tvb, curr_offset, 1,
1984 ett_bc_oct_6f, NULL, "Octet 6f");
1986 oct = tvb_get_uint8(tvb, curr_offset);
1988 extended = (oct & 0x80) ? false : true;
1990 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1991 proto_tree_add_item(subtree, hf_gsm_a_dtap_uimi, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1993 if (is_uplink == IS_UPLINK_TRUE)
1995 proto_tree_add_item(subtree, hf_gsm_a_dtap_wanted_air_interface_user_rate, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1997 else
1999 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_wanted_air_interface_user_rate, tvb, curr_offset, 1,
2000 oct, "Spare");
2003 curr_offset++;
2005 NO_MORE_DATA_CHECK(len);
2007 if (!extended) goto bc_octet_7;
2009 /* octet 6g */
2011 subtree =
2012 proto_tree_add_subtree(tree,
2013 tvb, curr_offset, 1,
2014 ett_bc_oct_6g, NULL, "Octet 6g");
2016 oct = tvb_get_uint8(tvb, curr_offset);
2018 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2020 if (is_uplink == IS_UPLINK_TRUE)
2022 proto_tree_add_item(subtree, hf_gsm_a_dtap_acceptable_channel_codings_ext_TCH_F28_8, tvb, curr_offset, 1, ENC_NA);
2023 proto_tree_add_item(subtree, hf_gsm_a_dtap_acceptable_channel_codings_ext_TCH_F32_0, tvb, curr_offset, 1, ENC_NA);
2024 proto_tree_add_item(subtree, hf_gsm_a_dtap_acceptable_channel_codings_ext_TCH_F43_2, tvb, curr_offset, 1, ENC_NA);
2025 proto_tree_add_item(subtree, hf_gsm_a_dtap_channel_coding_asymmetry_indication, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2027 else
2029 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_edge_channel_codings, tvb, curr_offset, 1, oct, "Spare");
2032 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+6, 2, ENC_BIG_ENDIAN);
2034 curr_offset++;
2036 NO_MORE_DATA_CHECK(len);
2038 bc_octet_7:
2039 /* octet 7 */
2041 subtree =
2042 proto_tree_add_subtree(tree,
2043 tvb, curr_offset, 1,
2044 ett_bc_oct_7, NULL, "Octet 7");
2046 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2048 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_layer_2_identity, tvb, curr_offset, 1, oct,
2049 "%s", ((oct & 0x60) == 0x40) ? "Octet identifier" : "Reserved");
2051 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_user_information_layer_2_protocol, tvb, curr_offset, 1,
2052 oct, "%s", val_to_str_const(oct & 0x1F, gsm_a_dtap_user_info_layer2_vals, "Reserved"));
2053 break;
2056 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data);
2058 return (curr_offset - offset);
2062 uint16_t
2063 de_bearer_cap_uplink(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len)
2065 is_uplink = IS_UPLINK_TRUE;
2066 return de_bearer_cap(tvb, tree, pinfo, offset, len, add_string, string_len);
2071 * [9] 10.5.4.5a Call Control Capabilities
2073 static const true_false_string gsm_a_dtap_mcat_value = {
2074 "The mobile station supports Multimedia CAT during the alerting phase of a mobile originated multimedia call establishment",
2075 "The mobile station does not support Multimedia CAT"
2078 static const true_false_string gsm_a_dtap_enicm_value = {
2079 "The mobile station supports the Enhanced Network-initiated In-Call Modification procedure",
2080 "The mobile station does not support the Enhanced Network-initiated In-Call Modification procedure"
2083 static const true_false_string gsm_a_dtap_dtmf_value = {
2084 "the mobile station supports DTMF as specified in subclause 5.5.7 of TS 24.008",
2085 "reserved for earlier versions of the protocol"
2088 static uint16_t
2089 de_cc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_) {
2090 uint8_t oct;
2091 uint32_t curr_offset;
2093 curr_offset = offset;
2095 oct = tvb_get_uint8(tvb, curr_offset);
2097 if (((oct & 0xf0) >> 4) == 0)
2099 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_maximum_number_of_supported_bearers, tvb, curr_offset, 1, 0, "1");
2101 else
2103 proto_tree_add_item(tree, hf_gsm_a_dtap_maximum_number_of_supported_bearers, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2106 proto_tree_add_item(tree, hf_gsm_a_dtap_mcat, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2107 proto_tree_add_item(tree, hf_gsm_a_dtap_enicm, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2108 proto_tree_add_item(tree, hf_gsm_a_dtap_pcp, tvb, curr_offset, 1, ENC_NA);
2109 proto_tree_add_item(tree, hf_gsm_a_dtap_dtmf, tvb, curr_offset, 1, ENC_NA);
2111 curr_offset++;
2113 NO_MORE_DATA_CHECK(len);
2115 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
2116 proto_tree_add_item(tree, hf_gsm_a_dtap_max_num_of_speech_bearers, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2118 curr_offset++;
2120 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data);
2122 return (curr_offset - offset);
2126 * [3] 10.5.4.6 Call state
2128 static const value_string gsm_a_dtap_coding_standard_vals[] = {
2129 { 0x00, "standardized coding as described in ITU-T Rec. Q.931" },
2130 { 0x01, "reserved for other international standards" },
2131 { 0x02, "national standard" },
2132 { 0x03, "standard defined for the GSM PLMNS as described below" },
2133 { 0, NULL }
2136 static const value_string gsm_a_dtap_call_state_vals[] = {
2137 { 0x00, "U0/N0 - null" },
2138 { 0x02, "U0.1/N0.1 - MM connection pending" },
2139 { 0x22, "U0.2 - CC prompt present / N0.2 - CC connection pending" },
2140 { 0x23, "U0.3 - Wait for network information / N0.3 - Network answer pending" },
2141 { 0x24, "U0.4/N0.4 - CC-Establishment present" },
2142 { 0x25, "U0.5/N0.5 - CC-Establishment confirmed" },
2143 { 0x26, "U0.6/N0.6 - Recall present" },
2144 { 0x01, "U1/N1 - call initiated" },
2145 { 0x03, "U3/N3 - mobile originating call proceeding" },
2146 { 0x04, "U4/N4 - call delivered" },
2147 { 0x06, "U6/N6 - call present" },
2148 { 0x07, "U7/N7 - call received" },
2149 { 0x08, "U8/N8 - connect request" },
2150 { 0x09, "U9/N9 - mobile terminating call confirmed" },
2151 { 0x0a, "U10/N10 - active" },
2152 { 0x0b, "U11 - disconnect request" },
2153 { 0x0c, "U12/N12 - disconnect indication" },
2154 { 0x13, "U19/N19 - release request" },
2155 { 0x1a, "U26/N26 - mobile originating modify" },
2156 { 0x1b, "U27/N27 - mobile terminating modify" },
2157 { 0x1c, "N28 - connect indication" },
2158 { 0, NULL }
2161 static uint16_t
2162 de_call_state(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
2164 uint8_t oct, coding_standard, call_state;
2165 proto_tree *subtree;
2167 subtree =
2168 proto_tree_add_subtree(tree,
2169 tvb, offset, 1, ett_gsm_dtap_elem[DE_CALL_STATE], NULL,
2170 val_to_str_ext_const(DE_CALL_STATE, &gsm_dtap_elem_strings_ext, ""));
2172 proto_tree_add_item(subtree, hf_gsm_a_dtap_coding_standard, tvb, offset, 1, ENC_BIG_ENDIAN);
2174 oct = tvb_get_uint8(tvb, offset);
2175 coding_standard = (oct & 0xc0) >> 6;
2176 call_state = oct & 0x3f;
2178 switch (coding_standard)
2180 case 0:
2181 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_call_state, tvb,
2182 offset, 1, call_state, "%s (%u)",
2183 val_to_str_ext_const(call_state, &q931_call_state_vals_ext, "Reserved"),
2184 call_state);
2185 break;
2186 case 1:
2187 case 2:
2188 proto_tree_add_item(subtree, hf_gsm_a_dtap_call_state, tvb, offset, 1, ENC_BIG_ENDIAN);
2189 break;
2190 default:
2191 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_call_state, tvb,
2192 offset, 1, call_state, "%s (%u)",
2193 val_to_str_const(call_state, gsm_a_dtap_call_state_vals, "Reserved"),
2194 call_state);
2195 break;
2198 /* no length check possible */
2200 return 1;
2204 * Helper function for BCD address decoding
2206 const value_string gsm_a_dtap_type_of_number_values[] = {
2207 { 0x00, "unknown" },
2208 { 0x01, "International Number" },
2209 { 0x02, "National number" },
2210 { 0x03, "Network Specific Number" },
2211 { 0x04, "Dedicated access, short code" },
2212 { 0x05, "Reserved" },
2213 { 0x06, "Reserved" },
2214 { 0x07, "Reserved for extension" },
2215 { 0, NULL }
2218 const value_string gsm_a_dtap_numbering_plan_id_values[] = {
2219 { 0x00, "unknown" },
2220 { 0x01, "ISDN/Telephony Numbering (ITU-T Rec. E.164 / ITU-T Rec. E.163)" },
2221 { 0x02, "spare" },
2222 { 0x03, "Data Numbering (ITU-T Rec. X.121)" },
2223 { 0x04, "Telex Numbering (ITU-T Rec. F.69)" },
2224 { 0x08, "National Numbering" },
2225 { 0x09, "Private Numbering" },
2226 { 0x0d, "Reserved for CTS (see 3GPP TS 44.056)" },
2227 { 0x0f, "Reserved for extension" },
2228 { 0, NULL }
2231 static const value_string gsm_a_dtap_present_ind_values[] = {
2232 { 0x00, "Presentation allowed" },
2233 { 0x01, "Presentation restricted" },
2234 { 0x02, "Number not available due to interworking" },
2235 { 0x03, "Reserved" },
2236 { 0, NULL }
2239 static const value_string gsm_a_dtap_screening_ind_values[] = {
2240 { 0x00, "User-provided, not screened" },
2241 { 0x01, "User-provided, verified and passed" },
2242 { 0x02, "User-provided, verified and failed" },
2243 { 0x03, "Network provided" },
2244 { 0, NULL }
2247 static uint16_t
2248 de_bcd_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, int header_field, char **extracted_address)
2250 uint8_t extension;
2251 uint32_t curr_offset, num_string_len;
2252 proto_item *item;
2254 *extracted_address = NULL;
2255 curr_offset = offset;
2257 extension = tvb_get_uint8(tvb, curr_offset) & 0x80;
2258 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2259 proto_tree_add_item(tree, hf_gsm_a_dtap_type_of_number, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2260 proto_tree_add_item(tree, hf_gsm_a_dtap_numbering_plan_id, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2261 curr_offset++;
2263 if (!extension)
2265 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2266 proto_tree_add_item(tree, hf_gsm_a_dtap_present_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2267 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+3, 3, ENC_BIG_ENDIAN);
2268 proto_tree_add_item(tree, hf_gsm_a_dtap_screening_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2269 curr_offset++;
2272 NO_MORE_DATA_CHECK(len);
2274 num_string_len = len - (curr_offset - offset);
2276 item = proto_tree_add_item_ret_display_string(tree, header_field, tvb, curr_offset, num_string_len, ENC_KEYPAD_ABC_TBCD|ENC_LITTLE_ENDIAN, pinfo->pool, extracted_address);
2278 /* Check for an end mark, which gets mapped to '?' */
2279 if(strchr(*extracted_address,'?')){
2280 expert_add_info(pinfo, item, &ei_gsm_a_dtap_end_mark_unexpected);
2283 return (len);
2287 * Helper function for sub address decoding
2289 static const value_string gsm_a_dtap_type_of_sub_addr_values[] = {
2290 { 0x00, "NSAP (ITU-T Rec. X.213/ISO 8348 AD2)" },
2291 { 0x02, "User specified" },
2292 { 0, NULL }
2295 static const value_string gsm_a_dtap_odd_even_ind_values[] = {
2296 { 0x00, "even number of address signals" },
2297 { 0x01, "odd number of address signals" },
2298 { 0, NULL }
2302 static uint16_t
2303 de_sub_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char **extracted_address)
2305 uint32_t curr_offset, ia5_string_len, i;
2306 uint8_t type_of_sub_addr, afi, dig1, dig2, oct;
2307 char *ia5_string;
2308 bool invalid_ia5_char;
2309 proto_item *item;
2311 curr_offset = offset;
2313 *extracted_address = NULL;
2314 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2315 proto_tree_add_item(tree, hf_gsm_a_dtap_type_of_sub_addr, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2316 proto_tree_add_item(tree, hf_gsm_a_dtap_odd_even_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2317 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+5, 3, ENC_BIG_ENDIAN);
2318 type_of_sub_addr = (tvb_get_uint8(tvb, curr_offset) & 0x70) >> 4;
2319 curr_offset++;
2321 NO_MORE_DATA_CHECK(len);
2323 if (!type_of_sub_addr)
2325 afi = tvb_get_uint8(tvb, curr_offset);
2326 proto_tree_add_item(tree, hf_gsm_a_dtap_afi, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2327 curr_offset++;
2329 NO_MORE_DATA_CHECK(len);
2331 if (afi == 0x50)
2333 ia5_string_len = len - (curr_offset - offset);
2334 ia5_string = (uint8_t *)tvb_memdup(pinfo->pool, tvb, curr_offset, ia5_string_len);
2335 *extracted_address = (char *)wmem_alloc(pinfo->pool, ia5_string_len + 1);
2337 invalid_ia5_char = false;
2338 for(i = 0; i < ia5_string_len; i++)
2340 dig1 = (ia5_string[i] & 0xf0) >> 4;
2341 dig2 = ia5_string[i] & 0x0f;
2342 oct = (dig1 * 10) + dig2 + 32;
2343 if (oct > 127)
2344 invalid_ia5_char = true;
2345 ia5_string[i] = oct;
2349 IA5_7BIT_decode(*extracted_address, ia5_string, ia5_string_len);
2351 item = proto_tree_add_string(tree, hf_gsm_a_dtap_subaddress, tvb, curr_offset, len - (curr_offset - offset), *extracted_address);
2353 if (invalid_ia5_char)
2354 expert_add_info(pinfo, item, &ei_gsm_a_dtap_invalid_ia5_character);
2356 return (len);
2360 proto_tree_add_item(tree, hf_gsm_a_dtap_subaddress_information, tvb, curr_offset, len - (curr_offset - offset), ENC_NA);
2362 return (len);
2366 * [3] 10.5.4.7 Called party BCD number
2368 uint16_t
2369 de_cld_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len)
2371 char *extr_addr;
2373 de_bcd_num(tvb, tree, pinfo, offset, len, hf_gsm_a_dtap_cld_party_bcd_num, &extr_addr);
2375 if (extr_addr) {
2376 if (sccp_assoc && ! sccp_assoc->called_party) {
2377 sccp_assoc->called_party = wmem_strdup(wmem_file_scope(), extr_addr);
2380 if (add_string)
2381 snprintf(add_string, string_len, " - (%s)", extr_addr);
2384 return (len);
2388 * [3] 10.5.4.8 Called party subaddress
2390 static uint16_t
2391 de_cld_party_sub_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len _U_)
2393 char *extr_addr;
2395 de_sub_addr(tvb, tree, pinfo, offset, len, &extr_addr);
2397 if (extr_addr && add_string)
2398 snprintf(add_string, string_len, " - (%s)", extr_addr);
2400 return (len);
2403 /* 3GPP TS 24.008
2404 * [3] 10.5.4.9 Calling party BCD number
2406 static uint16_t
2407 de_clg_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len)
2409 char *extr_addr;
2411 de_bcd_num(tvb, tree, pinfo, offset, len, hf_gsm_a_dtap_clg_party_bcd_num, &extr_addr);
2413 if (extr_addr && add_string)
2414 snprintf(add_string, string_len, " - (%s)", extr_addr);
2416 return (len);
2420 * [3] 10.5.4.10 Calling party subaddress
2422 static uint16_t
2423 de_clg_party_sub_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len _U_)
2425 char *extr_addr;
2427 de_sub_addr(tvb, tree, pinfo, offset, len, &extr_addr);
2429 if (extr_addr && add_string)
2430 snprintf(add_string, string_len, " - (%s)", extr_addr);
2432 return (len);
2436 * [3] 10.5.4.11 Cause
2438 static const value_string gsm_a_dtap_cause_ss_diagnostics_vals[] = {
2439 { 0x01, "Outgoing calls barred within CUG" },
2440 { 0x02, "No CUG selected" },
2441 { 0x03, "Unknown CUG index" },
2442 { 0x04, "CUG index incompatible with requested basic service" },
2443 { 0x05, "CUG call failure, unspecified" },
2444 { 0x06, "CLIR not subscribed" },
2445 { 0x07, "CCBS possible" },
2446 { 0x08, "CCBS not possible" },
2447 { 0, NULL }
2450 static const value_string gsm_a_dtap_de_cause_coding_standard_vals[] = {
2451 { 0x00, "Coding as specified in ITU-T Rec. Q.931" },
2452 { 0x01, "Reserved for other international standards" },
2453 { 0x02, "National standard" },
2454 { 0x03, "Standard defined for the GSM PLMNS" },
2455 { 0, NULL }
2458 static uint16_t
2459 de_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len)
2461 uint8_t oct;
2462 uint8_t cause;
2463 uint32_t curr_offset;
2464 uint32_t diag_length;
2465 proto_tree *subtree;
2466 const char *str;
2468 curr_offset = offset;
2470 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2471 proto_tree_add_item(tree, hf_gsm_a_dtap_de_cause_coding_standard, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2473 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+3, 1, ENC_BIG_ENDIAN);
2475 proto_tree_add_item(tree, hf_gsm_a_dtap_location, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2476 curr_offset++;
2478 oct = tvb_get_uint8(tvb, curr_offset);
2480 if (!(oct & 0x80))
2482 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2483 proto_tree_add_item(tree, hf_gsm_a_dtap_recommendation, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2485 curr_offset++;
2487 oct = tvb_get_uint8(tvb, curr_offset);
2490 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2492 cause = oct & 0x7f;
2493 switch (cause)
2495 case 1: str = "Unassigned (unallocated) number"; break;
2496 case 3: str = "No route to destination"; break;
2497 case 6: str = "Channel unacceptable"; break;
2498 case 8: str = "Operator determined barring"; break;
2499 case 13: str = "Call completed elsewhere"; break;
2500 case 16: str = "Normal call clearing"; break;
2501 case 17: str = "User busy"; break;
2502 case 18: str = "No user responding"; break;
2503 case 19: str = "User alerting, no answer"; break;
2504 case 21: str = "Call rejected"; break;
2505 case 22: str = "Call rejected due to feature at the destination"; break;
2506 case 24: str = "Number changed"; break;
2507 case 25: str = "Pre-emption"; break;
2508 case 26: str = "Non selected user clearing"; break;
2509 case 27: str = "Destination out of order"; break;
2510 case 28: str = "Invalid number format (incomplete number)"; break;
2511 case 29: str = "Facility rejected"; break;
2512 case 30: str = "Response to STATUS ENQUIRY"; break;
2513 case 31: str = "Normal, unspecified"; break;
2514 case 34: str = "No circuit/channel available"; break;
2515 case 38: str = "Network out of order"; break;
2516 case 41: str = "Temporary failure"; break;
2517 case 42: str = "Switching equipment congestion"; break;
2518 case 43: str = "Access information discarded"; break;
2519 case 44: str = "requested circuit/channel not available"; break;
2520 case 47: str = "Resources unavailable, unspecified"; break;
2521 case 49: str = "Quality of service unavailable"; break;
2522 case 50: str = "Requested facility not subscribed"; break;
2523 case 55: str = "Incoming calls barred within the CUG"; break;
2524 case 57: str = "Bearer capability not authorized"; break;
2525 case 58: str = "Bearer capability not presently available"; break;
2526 case 63: str = "Service or option not available, unspecified"; break;
2527 case 65: str = "Bearer service not implemented"; break;
2528 case 68: str = "ACM equal to or greater than ACMmax"; break;
2529 case 69: str = "Requested facility not implemented"; break;
2530 case 70: str = "Only restricted digital information bearer capability is available"; break;
2531 case 79: str = "Service or option not implemented, unspecified"; break;
2532 case 81: str = "Invalid transaction identifier value"; break;
2533 case 87: str = "User not member of CUG"; break;
2534 case 88: str = "Incompatible destination"; break;
2535 case 91: str = "Invalid transit network selection"; break;
2536 case 95: str = "Semantically incorrect message"; break;
2537 case 96: str = "Invalid mandatory information"; break;
2538 case 97: str = "Message type non-existent or not implemented"; break;
2539 case 98: str = "Message type not compatible with protocol state"; break;
2540 case 99: str = "Information element non-existent or not implemented"; break;
2541 case 100: str = "Conditional IE error"; break;
2542 case 101: str = "Message not compatible with protocol state"; break;
2543 case 102: str = "Recovery on timer expiry"; break;
2544 case 111: str = "Protocol error, unspecified"; break;
2545 case 127: str = "Interworking, unspecified"; break;
2546 default:
2547 if (cause <= 31) { str = "Treat as Normal, unspecified"; }
2548 else if ((cause >= 32) && (cause <= 47)) { str = "Treat as Resources unavailable, unspecified"; }
2549 else if ((cause >= 48) && (cause <= 63)) { str = "Treat as Service or option not available, unspecified"; }
2550 else if ((cause >= 64) && (cause <= 79)) { str = "Treat as Service or option not implemented, unspecified"; }
2551 else if ((cause >= 80) && (cause <= 95)) { str = "Treat as Semantically incorrect message"; }
2552 else if ((cause >= 96) && (cause <= 111)) { str = "Treat as Protocol error, unspecified"; }
2553 else { str = "Treat as Interworking, unspecified"; }
2554 break;
2557 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_cause,
2558 tvb, curr_offset, 1, cause,
2559 "Cause: (%u) %s",
2560 cause,
2561 str);
2563 curr_offset++;
2565 if (add_string)
2566 snprintf(add_string, string_len, " - (%u) %s", cause, str);
2568 NO_MORE_DATA_CHECK(len);
2570 subtree = proto_tree_add_subtree(tree, tvb, curr_offset, len - (curr_offset - offset),
2571 ett_gsm_dtap_elem[DE_CAUSE], NULL, "Diagnostics");
2574 * Diagnostics for supplementary services may be included in the case of
2575 * the following cause codes:
2576 * 17 - User busy
2577 * 29 - Facility rejected
2578 * 34 - No circuit/channel available
2579 * 50 - Requested facility not subscribed
2580 * 55 - Incoming calls barred within the CUG
2581 * 69 - Requested facility not implemented
2582 * 87 - User not member of CUG
2584 if ((cause == 17) || (cause == 29) || (cause == 34) || (cause == 50) ||
2585 (cause == 55) || (cause == 69) || (cause == 87))
2587 proto_tree_add_item(subtree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2588 proto_tree_add_item(subtree, hf_gsm_a_dtap_cause_ss_diagnostics, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2589 curr_offset++;
2591 else
2593 diag_length = len - (curr_offset - offset);
2594 proto_tree_add_item(subtree, hf_gsm_a_dtap_data, tvb, curr_offset, diag_length, ENC_NA);
2595 curr_offset += diag_length;
2598 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data);
2600 return (curr_offset - offset);
2603 * 10.5.4.11a CLIR suppression
2604 * No data
2607 * 10.5.4.11b CLIR invocation
2608 * No data
2611 * 10.5.4.12 Congestion level
2612 * handled inline
2615 * 10.5.4.13 Connected number
2617 static uint16_t
2618 de_conn_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len)
2620 char *extr_addr;
2622 de_bcd_num(tvb, tree, pinfo, offset, len, hf_gsm_a_dtap_conn_num, &extr_addr);
2624 if (extr_addr && add_string)
2625 snprintf(add_string, string_len, " - (%s)", extr_addr);
2627 return (len);
2631 * 10.5.4.14 Connected subaddress
2633 static uint16_t
2634 de_conn_sub_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
2636 char *extr_addr;
2638 de_sub_addr(tvb, tree, pinfo, offset, len, &extr_addr);
2640 if (extr_addr && add_string)
2641 snprintf(add_string, string_len, " - (%s)", extr_addr);
2643 return (len);
2647 * 10.5.4.15 Facility
2650 static uint16_t
2651 de_facility(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned fac_len, char *add_string _U_, int string_len _U_)
2653 unsigned saved_offset;
2654 int8_t appclass;
2655 bool pc;
2656 bool ind = false;
2657 uint32_t component_len = 0;
2658 uint32_t header_end_offset;
2659 uint32_t header_len;
2660 asn1_ctx_t asn1_ctx;
2661 tvbuff_t *SS_tvb = NULL;
2662 static int comp_type_tag;
2664 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2666 saved_offset = offset;
2667 col_append_str(pinfo->cinfo, COL_PROTOCOL,"/");
2668 col_set_fence(pinfo->cinfo, COL_PROTOCOL);
2669 while (fac_len > (offset - saved_offset)) {
2671 /* Get the length of the component there can be more than one component in a facility message */
2673 header_end_offset = get_ber_identifier(tvb, offset, &appclass, &pc, &comp_type_tag);
2674 header_end_offset = get_ber_length(tvb, header_end_offset, &component_len, &ind);
2675 header_len = header_end_offset - offset;
2676 component_len = header_len + component_len;
2678 dissect_ROS_Component(false, tvb, offset, &asn1_ctx, tree, hf_ROS_component);
2679 TODO Call gsm map here
2681 SS_tvb = tvb_new_subset_length(tvb, offset, component_len);
2682 col_append_str(pinfo->cinfo, COL_INFO,"(GSM MAP) ");
2683 col_set_fence(pinfo->cinfo, COL_INFO);
2684 call_dissector(gsm_map_handle, SS_tvb, pinfo, tree);
2685 offset = offset + component_len;
2687 return (fac_len);
2690 * 10.5.4.16 High layer compatibility
2692 static uint16_t
2693 de_hlc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
2695 uint32_t curr_offset;
2697 curr_offset = offset;
2699 dissect_q931_high_layer_compat_ie(tvb, offset, len, tree);
2701 curr_offset = curr_offset + len;
2702 return (curr_offset - offset);
2706 * [3] 10.5.4.17 Keypad facility
2708 static uint16_t
2709 de_keypad_facility(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len _U_, char *add_string, int string_len)
2711 uint8_t keypad_char;
2712 uint32_t curr_offset;
2713 proto_item *item;
2715 curr_offset = offset;
2717 keypad_char = tvb_get_uint8(tvb, curr_offset) & 0x7f;
2719 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN);
2721 item = proto_tree_add_uint(tree, hf_gsm_a_dtap_keypad_information, tvb, curr_offset, 1,
2722 keypad_char);
2724 if (((keypad_char < '0') || (keypad_char > '9')) &&
2725 ((keypad_char < 'A') || (keypad_char > 'D')) &&
2726 (keypad_char != '*') && (keypad_char != '#'))
2727 expert_add_info(pinfo, item, &ei_gsm_a_dtap_keypad_info_not_dtmf_digit);
2728 curr_offset++;
2730 if (add_string)
2731 snprintf(add_string, string_len, " - %c", keypad_char);
2733 /* no length check possible */
2735 return (curr_offset - offset);
2739 * 10.5.4.18 Low layer compatibility
2741 static uint16_t
2742 de_llc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
2744 uint32_t curr_offset;
2746 curr_offset = offset;
2748 dissect_q931_bearer_capability_ie(tvb, offset, len, tree);
2750 curr_offset = curr_offset + len;
2751 return (curr_offset - offset);
2755 * 10.5.4.19 More data
2756 * No data
2759 * 10.5.4.20 Notification indicator
2761 static const value_string gsm_a_dtap_notification_description_vals[] = {
2762 { 0x00, "User suspended" },
2763 { 0x01, "User resumed" },
2764 { 0x02, "Bearer change" },
2765 { 0, NULL }
2768 static uint16_t
2769 de_notif_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
2771 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, offset, 1, ENC_BIG_ENDIAN);
2772 proto_tree_add_item(tree, hf_gsm_a_dtap_notification_description, tvb, offset, 1, ENC_BIG_ENDIAN);
2774 return 1;
2777 * [3] 10.5.4.21 Progress indicator
2779 static const value_string gsm_a_dtap_location_vals[] = {
2780 { 0x00, "User" },
2781 { 0x01, "Private network serving the local user" },
2782 { 0x02, "Public network serving the local user" },
2783 { 0x03, "Transit network" },
2784 { 0x04, "Public network serving the remote user" },
2785 { 0x05, "Private network serving the remote user" },
2786 { 0x07, "International network" },
2787 { 0x0a, "Network beyond interworking point" },
2788 { 0, NULL }
2791 static const value_string gsm_a_dtap_progress_description_vals[] = {
2792 { 0x01, "Call is not end-to-end PLMN/ISDN, further call progress information may be available in-band" },
2793 { 0x02, "Destination address in non-PLMN/ISDN" },
2794 { 0x03, "Origination address in non-PLMN/ISDN" },
2795 { 0x04, "Call has returned to the PLMN/ISDN" },
2796 { 0x08, "In-band information or appropriate pattern now available" },
2797 { 0x09, "In-band multimedia CAT available" },
2798 { 0x20, "Call is end-to-end PLMN/ISDN" },
2799 { 0x40, "Queueing" },
2800 { 0, NULL }
2803 static uint16_t
2804 de_prog_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
2806 uint8_t oct, coding_standard, progress_description;
2807 uint32_t curr_offset;
2809 curr_offset = offset;
2811 oct = tvb_get_uint8(tvb, curr_offset);
2812 coding_standard = (oct & 0x60) >> 5;
2813 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2814 proto_tree_add_item(tree, hf_gsm_a_dtap_prog_coding_standard, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2815 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset << 3) + 3, 1, ENC_BIG_ENDIAN);
2816 proto_tree_add_item(tree, hf_gsm_a_dtap_location, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2817 curr_offset++;
2819 oct = tvb_get_uint8(tvb, curr_offset);
2820 progress_description = oct & 0x7f;
2821 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2823 switch (coding_standard)
2825 case 0:
2826 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_progress_description, tvb,
2827 curr_offset, 1, progress_description, "%s (%u)",
2828 val_to_str_ext_const(progress_description, &q931_progress_description_vals_ext, "Reserved"),
2829 progress_description);
2830 break;
2831 case 1:
2832 case 2:
2833 proto_tree_add_item(tree, hf_gsm_a_dtap_progress_description, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2834 break;
2835 default:
2836 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_progress_description, tvb,
2837 curr_offset, 1, progress_description, "%s (%u)",
2838 val_to_str_const(progress_description, gsm_a_dtap_progress_description_vals, "Unspecific"),
2839 progress_description);
2840 break;
2842 curr_offset++;
2844 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data);
2846 return (curr_offset - offset);
2850 * 10.5.4.21a Recall type $(CCBS)$
2852 static const range_string gsm_a_dtap_recall_type_vals[] = {
2853 { 0x00, 0x00, "CCBS" },
2854 { 0x01, 0x06, "shall be treated as CCBS (intended for other similar type of Recall)" },
2855 { 0, 0, NULL }
2858 static uint16_t
2859 de_recall_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
2861 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (offset<<3), 5, ENC_BIG_ENDIAN);
2862 proto_tree_add_item(tree, hf_gsm_a_dtap_recall_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2864 return 1;
2868 * 10.5.4.21b Redirecting party BCD number
2870 static uint16_t
2871 de_red_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len)
2873 char *extr_addr;
2875 de_bcd_num(tvb, tree, pinfo, offset, len, hf_gsm_a_dtap_red_party_bcd_num, &extr_addr);
2877 if (extr_addr && add_string)
2878 snprintf(add_string, string_len, " - (%s)", extr_addr);
2880 return (len);
2884 * 10.5.4.21c Redirecting party subaddress
2886 static uint16_t
2887 de_red_party_sub_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len)
2889 char *extr_addr;
2891 de_sub_addr(tvb, tree, pinfo, offset, len, &extr_addr);
2893 if (extr_addr && add_string)
2894 snprintf(add_string, string_len, " - (%s)", extr_addr);
2896 return (len);
2900 * [3] 10.5.4.22 Repeat indicator
2902 static const value_string gsm_a_dtap_repeat_indicator_vals[] = {
2903 { 0x01, "Circular for successive selection 'mode 1 alternate mode 2'" },
2904 { 0x02, "Support of fallback mode 1 preferred, mode 2 selected if setup of mode 1 fails" },
2905 { 0x03, "Reserved: was allocated in earlier phases of the protocol" },
2906 { 0, NULL }
2909 static uint16_t
2910 de_repeat_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
2912 uint8_t oct;
2913 uint32_t curr_offset;
2915 curr_offset = offset;
2917 oct = tvb_get_uint8(tvb, curr_offset);
2919 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_repeat_indicator, tvb, curr_offset, 1, oct,
2920 "%s", val_to_str_const(oct & 0xF, gsm_a_dtap_repeat_indicator_vals, "Reserved"));
2921 curr_offset++;
2923 /* no length check possible */
2925 return (curr_offset - offset);
2928 * 10.5.4.22a Reverse call setup direction
2929 * No data
2932 * 10.5.4.22b SETUP Container $(CCBS)$
2934 static void
2935 dtap_cc_setup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len);
2937 static uint16_t
2938 de_setup_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
2940 dtap_cc_setup(tvb, tree, pinfo, offset, len);
2942 return (len);
2946 * 10.5.4.23 Signal
2948 static const value_string gsm_a_dtap_signal_value_vals[] = {
2949 { 0x00, "dial tone on" },
2950 { 0x01, "ring back tone on" },
2951 { 0x02, "intercept tone on" },
2952 { 0x03, "network congestion tone on" },
2953 { 0x04, "busy tone on" },
2954 { 0x05, "confirm tone on" },
2955 { 0x06, "answer tone on" },
2956 { 0x07, "call waiting tone on" },
2957 { 0x08, "off-hook warning tone on" },
2958 { 0x3f, "tones off" },
2959 { 0x4f, "alerting off" },
2960 { 0, NULL }
2963 static uint16_t
2964 de_signal(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
2966 proto_tree_add_item(tree, hf_gsm_a_dtap_signal_value, tvb, offset, 1, ENC_BIG_ENDIAN);
2968 return 1;
2972 * 10.5.4.24 SS Version Indicator
2974 static const value_string gsm_a_dtap_ss_ver_ind_vals[] = {
2975 { 0x00, "Phase 2 service, ellipsis notation, and phase 2 error handling is supported" },
2976 { 0x01, "SS-Protocol version 3 is supported, and phase 2 error handling is supported" },
2977 { 0, NULL }
2980 static uint16_t
2981 de_ss_ver_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
2983 uint8_t oct;
2984 uint32_t curr_offset;
2986 curr_offset = offset;
2988 oct = tvb_get_uint8(tvb, curr_offset);
2990 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_ss_version_indicator, tvb, curr_offset, 1,
2991 oct, "%s", val_to_str_const(oct, gsm_a_dtap_ss_ver_ind_vals, "Reserved"));
2992 curr_offset++;
2994 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data);
2996 return (curr_offset - offset);
2999 * 10.5.4.25 User-user
3002 User-user protocol discriminator (octet 3)
3003 Bits
3004 8 7 6 5 4 3 2 1
3005 0 0 0 0 0 0 0 0 User specific protocol (Note 1)
3006 0 0 0 0 0 0 0 1 OSI high layer protocols
3007 0 0 0 0 0 0 1 0 X.244 (Note 2)
3008 0 0 0 0 0 0 1 1 Reserved for system management convergence function
3009 0 0 0 0 0 1 0 0 IA5 characters (Note 3)
3010 0 0 0 0 0 1 1 1 Rec.V.120 rate adaption
3011 0 0 0 0 1 0 0 0 Q.931 (I.451) user-network call control messages
3013 0 0 0 1 0 0 0 0 Reserved for other network layer or
3014 through layer 3 protocols
3015 0 0 1 1 1 1 1 1
3017 0 1 0 0 0 0 0 0
3018 through National use
3019 0 1 0 0 1 1 1 0
3020 0 1 0 0 1 1 1 1 3GPP capability exchange protocol (NOTE 4)
3022 0 1 0 1 0 0 0 0 Reserved for other network
3023 through layer or layer 3 protocols
3024 1 1 1 1 1 1 1 0
3026 All other values are reserved.
3028 static const range_string gsm_a_dtap_u2u_prot_discr_vals[] = {
3029 { 0x00, 0x00, "User specific protocol" },
3030 { 0x01, 0x01, "OSI high layer protocols" },
3031 { 0x02, 0x02, "X.244" },
3032 { 0x03, 0x03, "Reserved for system management convergence function" },
3033 { 0x04, 0x04, "IA5 characters" },
3034 { 0x07, 0x07, "Rate adaption according to ITU-T Rec. V.120" },
3035 { 0x08, 0x08, "User-network call control messages according to ITU-T Rec. Q.931" },
3036 { 0x10, 0x3F, "Reserved for other network layer or layer 3 protocols" },
3037 { 0x40, 0x4E, "National use" },
3038 { 0x4F, 0x4F, "3GPP capability exchange protocol" },
3039 { 0x50, 0xFE, "Reserved for other network layer or layer 3 protocols" },
3040 { 0, 0, NULL }
3043 static uint16_t
3044 de_u2u(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3046 uint32_t curr_offset;
3047 uint32_t proto_discr;
3048 proto_tree *subtree;
3049 tvbuff_t *u2u_tvb;
3051 curr_offset = offset;
3052 proto_tree_add_item_ret_uint(tree, hf_gsm_a_dtap_u2u_prot_discr, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &proto_discr);
3053 curr_offset++;
3055 subtree = proto_tree_add_subtree(tree, tvb, curr_offset, len - 1, ett_gsm_dtap_elem[DE_USER_USER], NULL, "User-user information");
3056 proto_tree_add_item(subtree, hf_gsm_a_dtap_data, tvb, curr_offset, len - 1, ENC_NA);
3058 u2u_tvb = tvb_new_subset_length(tvb, curr_offset, len - 1);
3059 dissector_try_uint_with_data(u2u_dissector_table, proto_discr, u2u_tvb, pinfo, proto_tree_get_root(tree), true, NULL);
3062 return (len);
3065 * 10.5.4.26 Alerting Pattern $(NIA)$
3067 static const value_string gsm_a_alerting_pattern_vals[] = {
3068 { 0x00, "Alerting Pattern 1" },
3069 { 0x01, "Alerting Pattern 2" },
3070 { 0x02, "Alerting Pattern 3" },
3071 { 0x04, "Alerting Pattern 5" },
3072 { 0x05, "Alerting Pattern 6" },
3073 { 0x06, "Alerting Pattern 7" },
3074 { 0x07, "Alerting Pattern 8" },
3075 { 0x08, "Alerting Pattern 9" },
3076 { 0, NULL }
3079 static uint16_t
3080 de_alert_pat(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3082 uint32_t curr_offset;
3084 curr_offset = offset;
3086 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset << 3), 4, ENC_BIG_ENDIAN);
3087 proto_tree_add_item(tree, hf_gsm_a_dtap_alerting_pattern, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3088 curr_offset++;
3090 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data);
3092 return (len);
3095 * 10.5.4.27 Allowed actions $(CCBS)$
3097 static const true_false_string gsm_a_ccbs_activation_value = {
3098 "Activation of CCBS possible",
3099 "Activation of CCBS not possible"
3101 static uint16_t
3102 de_allowed_act(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3104 uint32_t curr_offset;
3106 curr_offset = offset;
3108 proto_tree_add_item(tree, hf_gsm_a_dtap_ccbs_activation, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3109 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset << 3) + 1, 7, ENC_BIG_ENDIAN);
3111 curr_offset++;
3113 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data);
3115 return (len);
3118 * 10.5.4.28 Stream Identifier
3120 static uint16_t
3121 de_stream_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len)
3123 uint32_t curr_offset;
3124 uint8_t oct;
3126 curr_offset = offset;
3128 oct = tvb_get_uint8(tvb, curr_offset);
3129 if (oct == 0x00)
3131 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_stream_identifier, tvb, curr_offset, 1, oct,
3132 "No Bearer (%u)", oct);
3134 if (add_string)
3135 snprintf(add_string, string_len, " - (No Bearer)");
3137 else
3139 proto_tree_add_item(tree, hf_gsm_a_dtap_stream_identifier, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3141 if (add_string)
3142 snprintf(add_string, string_len, " - (%u)", oct);
3145 curr_offset++;
3147 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data);
3149 return (len);
3152 * 10.5.4.29 Network Call Control Capabilities
3155 static const true_false_string gsm_a_mcs_value = {
3156 "This value indicates that the network supports the multicall",
3157 "This value indicates that the network does not support the multicall"
3159 static uint16_t
3160 de_nw_call_ctrl_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3162 uint32_t curr_offset;
3164 curr_offset = offset;
3166 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset << 3), 7, ENC_BIG_ENDIAN);
3167 proto_tree_add_item(tree, hf_gsm_a_dtap_mcs, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3169 curr_offset++;
3171 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data);
3173 return (len);
3176 * 10.5.4.30 Cause of No CLI
3178 static const value_string gsm_a_cause_of_no_cli_values[] = {
3179 { 0x00, "Unavailable" },
3180 { 0x01, "Reject by user" },
3181 { 0x02, "Interaction with other service" },
3182 { 0x03, "Coin line/payphone" },
3183 { 0, NULL }
3186 static uint16_t
3187 de_ca_of_no_cli(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len)
3189 uint32_t curr_offset;
3190 uint8_t oct;
3192 curr_offset = offset;
3194 oct = tvb_get_uint8(tvb, curr_offset);
3195 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_cause_of_no_cli, tvb, curr_offset, 1, oct,
3196 "%s (%u)",
3197 val_to_str_const(oct, gsm_a_cause_of_no_cli_values, "Unavailable"),
3198 oct);
3200 curr_offset++;
3202 if (add_string)
3203 snprintf(add_string, string_len, " - (%s)", val_to_str_const(oct, gsm_a_cause_of_no_cli_values, "Unavailable"));
3205 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data);
3207 return (len);
3210 * 10.5.4.31 Void
3213 * 10.5.4.32 Supported codec list
3215 /* 6.1 System Identifiers for GSM and UMTS
3216 * The system identifiers for the radio access technologies
3217 * supported by this specification are:
3218 * SysID for GSM: 0x0000.0000 (bit 8 .. bit 1)
3219 * SysID for UMTS: 0x0000.0100 (bit 8 .. bit 1)
3220 * These values are selected in accordance with [7] (3GPP TS 28.062).
3222 static const value_string gsm_a_dtap_sysid_values[] = {
3223 { 0x0, "GSM" },
3224 { 0x4, "UMTS" },
3225 { 0, NULL }
3227 uint16_t
3228 de_sup_codec_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3230 uint32_t curr_offset;
3231 uint8_t length;
3232 proto_tree *subtree;
3233 uint8_t sysid_counter;
3235 curr_offset = offset;
3237 /* System Identification 1 (SysID 1) octet 3
3238 * SysID indicates the radio access technology for which the subsequent Codec
3239 * Bitmap indicates the supported codec types.
3240 * Coding of this Octet is defined in 3GPP TS 26.103
3242 sysid_counter = 0;
3243 while (len>(curr_offset-offset)) {
3244 sysid_counter++;
3245 proto_tree_add_item(tree, hf_gsm_a_dtap_sysid, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3246 curr_offset++;
3247 /* Length Of Bitmap for SysID */
3248 proto_tree_add_item(tree, hf_gsm_a_dtap_bitmap_length, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3249 length = tvb_get_uint8(tvb,curr_offset);
3250 curr_offset++;
3251 if (length > 0)
3253 subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, length, ett_gsm_dtap_elem[DE_SUP_CODEC_LIST], NULL,
3254 "Codec Bitmap for SysID %u", sysid_counter);
3255 /* 6.2 Codec Bitmap
3256 * The Codec Types are coded in the first and second octet of the Codec List
3257 * Bitmap as follows:
3258 * 8 7 6 5 4 3 2 bit 1
3259 * TDMA UMTS UMTS HR AMR FR AMR GSM EFR GSM HR GSM FR Octet 1
3260 * EFR AMR 2 AMR
3261 * bit 16 15 14 13 12 11 10 bit 9
3262 *(reserved) UMTS OHR OFR OHR UMTS FR PDC EFR Octet 2
3263 * EVS AMR-WB AMR-WB AMR AMR-WB AMR-WB
3264 * A Codec Type is supported, if the corresponding bit is set to "1".
3265 * All reserved bits shall be set to "0".
3267 * NOTE: If the Codec Bitmap for a SysID is 1 octet, it is an indication that
3268 * all codecs of the 2nd octet are not supported.
3269 * If the Codec Bitmap for a SysID is more than 2 octets, the network shall
3270 * ignore the additional octet(s) of the bitmap and process the rest of the
3271 * information element.
3273 * Right now we are sure that at least the first octet of the bitmap is present
3275 static int * const oct1_flags[] = {
3276 &hf_gsm_a_dtap_codec_tdma_efr,
3277 &hf_gsm_a_dtap_codec_umts_amr_2,
3278 &hf_gsm_a_dtap_codec_umts_amr,
3279 &hf_gsm_a_dtap_codec_hr_amr,
3280 &hf_gsm_a_dtap_codec_fr_amr,
3281 &hf_gsm_a_dtap_codec_gsm_efr,
3282 &hf_gsm_a_dtap_codec_gsm_hr,
3283 &hf_gsm_a_dtap_codec_gsm_fr,
3284 NULL
3286 proto_tree_add_bitmask_list(subtree, tvb, curr_offset, 1, oct1_flags, ENC_NA);
3287 curr_offset++;
3288 length--;
3290 if (length > 0)
3293 * We can proceed with the second octet of the bitmap
3295 static int * const oct2_flags[] = {
3296 &hf_gsm_a_dtap_codec_umts_evs,
3297 &hf_gsm_a_dtap_codec_ohr_amr_wb,
3298 &hf_gsm_a_dtap_codec_ofr_amr_wb,
3299 &hf_gsm_a_dtap_codec_ohr_amr,
3300 &hf_gsm_a_dtap_codec_umts_amr_wb,
3301 &hf_gsm_a_dtap_codec_fr_amr_wb,
3302 &hf_gsm_a_dtap_codec_pdc_efr,
3303 NULL
3306 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, curr_offset << 3, 1, ENC_BIG_ENDIAN);
3307 proto_tree_add_bitmask_list(subtree, tvb, curr_offset, 1, oct2_flags, ENC_NA);
3308 curr_offset++;
3309 length--;
3313 curr_offset = curr_offset + length;
3317 return (curr_offset-offset);
3320 * 10.5.4.33 Service category
3323 Emergency Service Category Value (octet 3)
3324 The meaning of the Emergency Category Value is derived from the following settings (see 3GPP TS 22.101 [8] clause
3325 10):
3326 Bit 1 Police
3327 Bit 2 Ambulance
3328 Bit 3 Fire Brigade
3329 Bit 4 Marine Guard
3330 Bit 5 Mountain Rescue
3331 Bit 6 manually initiated eCall
3332 Bit 7 automatically initiated eCall
3333 Bit 8 is spare and set to "0"
3335 uint16_t
3336 de_serv_cat(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3338 uint32_t curr_offset;
3340 curr_offset = offset;
3342 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN);
3343 proto_tree_add_item(tree, hf_gsm_a_dtap_serv_cat_b7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3344 proto_tree_add_item(tree, hf_gsm_a_dtap_serv_cat_b6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3345 proto_tree_add_item(tree, hf_gsm_a_dtap_serv_cat_b5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3346 proto_tree_add_item(tree, hf_gsm_a_dtap_serv_cat_b4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3347 proto_tree_add_item(tree, hf_gsm_a_dtap_serv_cat_b3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3348 proto_tree_add_item(tree, hf_gsm_a_dtap_serv_cat_b2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3349 proto_tree_add_item(tree, hf_gsm_a_dtap_serv_cat_b1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3350 curr_offset++;
3352 return len;
3355 * 10.5.4.34 Redial
3356 * No data
3359 * 10.5.4.35 Network-initiated Service Upgrade indicator
3360 * No data
3363 * [5] 8.1.4.1 3GPP TS 24.011 version 6.1.0 Release 6
3365 static uint16_t
3366 de_cp_user_data(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3368 uint32_t curr_offset;
3369 tvbuff_t *rp_tvb;
3371 curr_offset = offset;
3373 proto_tree_add_bytes_format(tree, hf_gsm_a_dtap_rpdu, tvb, curr_offset, len, NULL, "RPDU (not displayed)");
3376 * dissect the embedded RP message
3378 rp_tvb = tvb_new_subset_length(tvb, curr_offset, len);
3380 call_dissector(rp_handle, rp_tvb, pinfo, g_tree);
3382 curr_offset += len;
3384 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data);
3386 return (curr_offset - offset);
3390 * [5] 8.1.4.2
3392 static const value_string gsm_a_dtap_cp_cause_values[] = {
3393 { 17, "Network failure"},
3394 { 22, "Congestion"},
3395 { 81, "Invalid Transaction Identifier value"},
3396 { 95, "Semantically incorrect message"},
3397 { 96, "Invalid mandatory information"},
3398 { 97, "Message type non-existent or not implemented"},
3399 { 98, "Message not compatible with the short message protocol state"},
3400 { 99, "Information element non-existent or not implemented"},
3401 { 111, "Protocol error, unspecified"},
3402 { 0, NULL }
3405 static uint16_t
3406 de_cp_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string, int string_len)
3408 uint8_t oct;
3409 uint32_t curr_offset;
3410 const char *str;
3412 curr_offset = offset;
3414 oct = tvb_get_uint8(tvb, curr_offset);
3415 str = val_to_str_const(oct, gsm_a_dtap_cp_cause_values, "Reserved, treat as Protocol error, unspecified");
3416 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_cp_cause, tvb, curr_offset, 1,
3417 oct, "(%u) %s", oct, str);
3418 curr_offset++;
3420 if (add_string)
3421 snprintf(add_string, string_len, " - (%u) %s", oct, str);
3423 /* no length check possible */
3425 return (curr_offset - offset);
3428 static const true_false_string tfs_gsm_a_dtap_subchannel = { "Only one TCH active or sub-channel 0 of two half rate channels is to be looped", "Sub-channel 1 of two half rate channels is to be looped" };
3431 static uint16_t
3432 de_tp_sub_channel(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3434 uint32_t curr_offset;
3435 unsigned char oct;
3436 const char *str;
3438 curr_offset = offset;
3440 oct = tvb_get_uint8(tvb, curr_offset) & 0x3f;
3441 if ((oct & 0x38) == 0x38)
3442 str = "I";
3443 else if ((oct & 0x38) == 0x18)
3444 str = "F";
3445 else if ((oct & 0x38) == 0x10)
3446 str = "E";
3447 else if ((oct & 0x38) == 0x08)
3448 str = "D";
3449 else if ((oct & 0x3c) == 0x04)
3450 str = "C";
3451 else if ((oct & 0x3e) == 0x02)
3452 str = "B";
3453 else if ((oct & 0x3e) == 0x00)
3454 str = "A";
3455 else
3456 str = "unknown";
3458 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_test_loop, tvb, curr_offset, 1, oct, "%s", str);
3459 proto_tree_add_item(tree, hf_gsm_a_dtap_subchannel, tvb, curr_offset, 1, ENC_NA);
3460 curr_offset+= 1;
3462 return (curr_offset - offset);
3465 static uint16_t
3466 de_tp_ack(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3468 uint32_t curr_offset;
3469 unsigned char oct;
3471 curr_offset = offset;
3473 oct = tvb_get_uint8(tvb, curr_offset);
3475 if ((oct & 0xF0) == 0x80)
3476 proto_tree_add_uint(tree, hf_gsm_a_dtap_ack_element, tvb, curr_offset, 1, oct&0x01);
3477 else
3478 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_ack_element, tvb, curr_offset, 1, 0xFF, "No acknowledgment element present");
3480 curr_offset+= 1;
3482 return (curr_offset - offset);
3485 static const value_string gsm_channel_coding_vals[] = {
3486 { 0x00, "not needed. The Burst-by-Burst loop is activated, type G" },
3487 { 0x01, "Channel coding needed. Frame erasure is to be signalled, type H" },
3488 { 0x02, "reserved" },
3489 { 0x03, "reserved" },
3490 { 0, NULL }
3493 static const value_string gsm_a_dtap_loop_mech_vals[] = {
3494 { 0, "Multi-slot mechanism 1"},
3495 { 1, "Multi-slot mechanism 2"},
3496 { 2, "Reserved"},
3497 { 3, "Reserved"},
3498 { 4, "Reserved"},
3499 { 5, "Reserved"},
3500 { 6, "Reserved"},
3501 { 7, "Reserved"},
3502 { 0, NULL }
3505 static uint16_t
3506 de_tp_loop_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3508 uint32_t curr_offset;
3509 unsigned char oct;
3511 curr_offset = offset;
3513 oct = tvb_get_uint8(tvb, curr_offset);
3515 proto_tree_add_item(tree, hf_gsm_a_dtap_channel_coding03, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3516 proto_tree_add_item(tree, hf_gsm_a_dtap_loop_mechanism1C, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3518 if ((oct & 0x1c) == 0)
3520 proto_tree_add_item(tree, hf_gsm_a_dtap_timeslot_number, tvb, curr_offset, 1, ENC_NA);
3523 curr_offset+= 1;
3525 return (curr_offset - offset);
3528 static const true_false_string tfs_multislot_tch = { "not closed due to error", "closed successfully" };
3530 static uint16_t
3531 de_tp_loop_ack(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3533 uint32_t curr_offset = offset;
3535 proto_tree_add_item(tree, hf_gsm_a_dtap_channel_coding30, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3536 proto_tree_add_item(tree, hf_gsm_a_dtap_loop_mechanism0E, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3537 proto_tree_add_item(tree, hf_gsm_a_dtap_multislot_tch, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3538 curr_offset+= 1;
3540 return (curr_offset - offset);
3543 static const value_string gsm_tp_tested_device_vals[] = {
3544 { 0x00, "Normal operation (no tested device via DAI)" },
3545 { 0x01, "Test of speech decoder / DTX functions (downlink)" },
3546 { 0x02, "Test of speech encoder / DTX functions (uplink)" },
3547 { 0x03, "Test of acoustic devices and A/D & D/A" },
3548 { 0, NULL }
3551 static uint16_t
3552 de_tp_tested_device(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3554 uint32_t curr_offset;
3555 unsigned char oct;
3557 curr_offset = offset;
3559 oct = tvb_get_uint8(tvb, curr_offset);
3560 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_tp_tested_device, tvb, curr_offset, 1,
3561 oct, "%s", val_to_str(oct, gsm_tp_tested_device_vals, "Reserved (%d)"));
3562 curr_offset+= 1;
3564 return (curr_offset - offset);
3567 static uint16_t
3568 de_tp_pdu_description(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3570 uint32_t curr_offset;
3571 uint16_t value;
3573 curr_offset = offset;
3575 value = tvb_get_ntohs(tvb, curr_offset);
3576 curr_offset += 2;
3578 if (value & 0x8000)
3580 if ((value & 0xfff) == 0)
3581 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_tp_pdu_description,
3582 tvb, curr_offset, 2, value, "Infinite number of PDUs to be transmitted in the TBF");
3583 else
3584 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_tp_pdu_description,
3585 tvb, curr_offset, 2, value & 0xfff, "%d PDUs to be transmitted in the TBF", value & 0xfff);
3587 else
3588 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_tp_pdu_description,
3589 tvb, curr_offset, 2, value, "reserved");
3591 return (curr_offset - offset);
3594 static const true_false_string tfs_gsm_a_dtap_mode_flag = { "MS shall select the loop back option", "MS shall itself generate the pseudorandom data" };
3596 static uint16_t
3597 de_tp_mode_flag(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3599 uint32_t curr_offset = offset;
3601 proto_tree_add_item(tree, hf_gsm_a_dtap_mode_flag, tvb, curr_offset, 1, ENC_NA);
3602 proto_tree_add_item(tree, hf_gsm_a_dtap_downlink_timeslot_offset, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3604 curr_offset+= 1;
3606 return (curr_offset - offset);
3609 static const true_false_string tfs_gsm_a_dtap_egprs_mode_flag = { "MS loops back blocks on the uplink using GMSK modulation only",
3610 "MS loops back blocks on the uplink using either GMSK or 8-PSK modulation following the detected received modulation" };
3612 static uint16_t
3613 de_tp_egprs_mode_flag(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3615 uint32_t curr_offset = offset;
3617 proto_tree_add_item(tree, hf_gsm_a_dtap_egprs_mode_flag, tvb, curr_offset, 1, ENC_NA);
3618 proto_tree_add_item(tree, hf_gsm_a_dtap_downlink_timeslot_offset, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3620 curr_offset+= 1;
3622 return (curr_offset - offset);
3625 static const value_string gsm_positioning_technology_vals[] = {
3626 { 0x00, "AGPS" },
3627 { 0x01, "AGNSS" },
3628 { 0, NULL }
3631 static uint16_t
3632 de_tp_ms_positioning_technology(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3634 uint32_t curr_offset;
3635 unsigned char oct;
3637 curr_offset = offset;
3639 oct = tvb_get_uint8(tvb, curr_offset);
3640 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_ms_positioning_technology, tvb, curr_offset, 1,
3641 oct, "%s", val_to_str(oct, gsm_positioning_technology_vals, "Reserved (%d)"));
3642 curr_offset+= 1;
3644 return (curr_offset - offset);
3647 static const value_string gsm_a_dtap_ue_test_loop_mode_vals[] = {
3648 { 0, "Mode 1 loop back (loopback of RLC SDUs or PDCP SDUs)"},
3649 { 1, "Mode 2 loop back (loopback of transport block data and CRC bits)"},
3650 { 2, "Mode 3 RLC SDU counting (counting of received RLC SDUs)"},
3651 { 3, "Reserved"},
3652 { 0, NULL }
3655 static uint16_t
3656 de_tp_ue_test_loop_mode(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3658 uint32_t curr_offset;
3659 unsigned char oct;
3660 uint8_t lb_setup_length,i,j;
3661 proto_tree* subtree;
3663 curr_offset = offset;
3665 oct = tvb_get_uint8(tvb, curr_offset);
3666 proto_tree_add_item(tree, hf_gsm_a_dtap_ue_test_loop_mode, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3667 curr_offset+= 1;
3669 switch (oct & 0x03)
3671 case 0:
3673 lb_setup_length = tvb_get_uint8(tvb, curr_offset);
3674 curr_offset += 1;
3675 for (i=0,j=0; (i<lb_setup_length) && (j<4); i+=3,j++)
3677 subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, 3, ett_ue_test_loop_mode, NULL, "LB setup RB IE: %d",j+1);
3678 proto_tree_add_item(subtree, hf_gsm_a_dtap_uplink_rlc_sdu_size, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
3679 curr_offset += 2;
3680 proto_tree_add_item(subtree, hf_gsm_a_dtap_radio_bearer, tvb, curr_offset, 1, ENC_NA);
3681 curr_offset+= 1;
3683 break;
3685 case 2:
3686 oct = tvb_get_uint8(tvb, curr_offset);
3687 curr_offset+= 1;
3688 proto_tree_add_uint(tree, hf_gsm_a_dtap_mbms_short_transmission_identity, tvb, curr_offset, 1, (oct & 0x1f)+1);
3689 break;
3692 return (curr_offset - offset);
3695 static uint16_t
3696 de_tp_ue_positioning_technology(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3698 uint32_t curr_offset;
3699 unsigned char oct;
3701 curr_offset = offset;
3703 oct = tvb_get_uint8(tvb, curr_offset);
3705 proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_ue_positioning_technology, tvb, curr_offset, 1,
3706 oct, "%s", val_to_str(oct, gsm_positioning_technology_vals, "Reserved (%d)"));
3707 curr_offset+= 1;
3709 return (curr_offset - offset);
3712 static uint16_t
3713 de_tp_rlc_sdu_counter_value(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3715 uint32_t curr_offset = offset;
3717 proto_tree_add_item(tree, hf_gsm_a_dtap_ue_received_rlc_sdu_counter_value, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
3718 curr_offset+= 4;
3721 return (curr_offset - offset);
3724 static const value_string epc_ue_test_loop_mode_vals[] = {
3725 { 0, "A"},
3726 { 1, "B"},
3727 { 2, "C"},
3728 { 3, "D"},
3729 { 4, "E"},
3730 { 5, "F"},
3731 { 6, "G"},
3732 { 7, "H"},
3733 { 0, NULL }
3735 static uint16_t
3736 de_tp_epc_ue_test_loop_mode(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3738 uint32_t curr_offset;
3739 uint32_t bit_offset;
3741 curr_offset = offset;
3742 bit_offset = curr_offset<<3;
3744 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
3745 bit_offset += 5;
3746 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_ue_tl_mode, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
3747 /* Store test loop mode to know how to dissect Close UE Test Loop message */
3748 epc_test_loop_mode = tvb_get_uint8(tvb, curr_offset) & 0x07;
3749 curr_offset++;
3751 return (curr_offset - offset);
3754 static uint16_t
3755 de_tp_epc_ue_tl_a_lb_setup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3757 uint32_t curr_offset;
3758 uint32_t count, nb_lb;
3759 uint8_t drb;
3760 proto_tree *lb_setup_tree = NULL;
3761 proto_item *ti;
3763 curr_offset = offset;
3765 count = 0;
3766 nb_lb = len / 3;
3768 ti = proto_tree_add_uint(tree, hf_gsm_a_dtap_num_lb_entities, tvb, curr_offset, 1, nb_lb);
3769 proto_item_set_len(ti, len);
3770 while ((count < nb_lb) && (count < 8)) {
3771 lb_setup_tree = proto_tree_add_subtree_format(tree, tvb, curr_offset, 3,
3772 ett_epc_ue_tl_a_lb_setup, NULL, "LB entity %d", count);
3774 proto_tree_add_bits_item(lb_setup_tree, hf_gsm_a_dtap_epc_ue_tl_a_ul_sdu_size, tvb, curr_offset<<3, 16, ENC_BIG_ENDIAN);
3775 curr_offset += 2;
3776 drb = tvb_get_uint8(tvb, curr_offset) & 0x1f;
3777 proto_tree_add_uint_format_value(lb_setup_tree, hf_gsm_a_dtap_epc_ue_tl_a_drb, tvb, curr_offset, 1,
3778 drb, "%d (%d)", drb+1, drb);
3779 curr_offset++;
3780 count++;
3783 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data);
3785 return (len);
3788 static uint16_t
3789 de_tp_epc_ue_tl_b_lb_setup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3791 uint32_t curr_offset;
3793 curr_offset = offset;
3795 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_ue_tl_b_ip_pdu_delay, tvb, curr_offset<<3, 8, ENC_BIG_ENDIAN);
3796 curr_offset++;
3798 return (curr_offset - offset);
3801 static uint16_t
3802 de_tp_epc_ue_tl_c_setup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3804 uint32_t curr_offset;
3806 curr_offset = offset;
3808 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_ue_tl_c_mbsfn_area_id, tvb, curr_offset<<3, 8, ENC_BIG_ENDIAN);
3809 curr_offset++;
3810 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_ue_tl_c_mch_id, tvb, (curr_offset<<3)+4, 4, ENC_BIG_ENDIAN);
3811 curr_offset++;
3812 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_ue_tl_c_lcid, tvb, (curr_offset<<3)+3, 5, ENC_BIG_ENDIAN);
3813 curr_offset++;
3815 return (curr_offset - offset);
3818 static const true_false_string epc_ue_tl_d_discovery_value = {
3819 "Announce",
3820 "Monitor"
3823 static const crumb_spec_t epc_ue_tl_d_prose_app_code_crumbs[] = {
3824 { 15, 1},
3825 { 0, 8},
3826 { 0, 0}
3829 static uint16_t
3830 de_tp_epc_ue_tl_d_setup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3832 uint32_t curr_offset;
3834 curr_offset = offset;
3836 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 7, ENC_BIG_ENDIAN);
3837 proto_tree_add_item(tree, hf_gsm_a_dtap_epc_ue_tl_d_discovery, tvb, curr_offset, 1, ENC_NA);
3838 curr_offset++;
3840 while ((curr_offset - offset) < len) {
3841 proto_tree_add_split_bits_item_ret_val(tree, hf_gsm_a_dtap_epc_ue_tl_d_prose_app_code, tvb,
3842 curr_offset<<3, epc_ue_tl_d_prose_app_code_crumbs, NULL);
3843 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset+1)<<3, 7, ENC_BIG_ENDIAN);
3844 curr_offset += 2;
3847 return len;
3850 static const true_false_string epc_ue_tl_e_communication_value = {
3851 "Transmit",
3852 "Receive"
3855 static uint16_t
3856 de_tp_epc_ue_tl_e_setup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3858 uint32_t curr_offset;
3860 curr_offset = offset;
3862 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 7, ENC_BIG_ENDIAN);
3863 proto_tree_add_item(tree, hf_gsm_a_dtap_epc_ue_tl_e_communication, tvb, curr_offset, 1, ENC_NA);
3864 curr_offset++;
3865 while ((curr_offset - offset) < len) {
3866 proto_tree_add_item(tree, hf_gsm_a_dtap_epc_ue_tl_e_group_destination_id, tvb, curr_offset, 1, ENC_NA);
3867 curr_offset++;
3870 return (curr_offset - offset);
3873 static const crumb_spec_t epc_ue_tl_f_sc_mtch_id_crumbs[] = {
3874 { 8, 8},
3875 { 0, 8},
3876 { 0, 0}
3879 static uint16_t
3880 de_tp_epc_ue_tl_f_setup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3882 proto_tree_add_split_bits_item_ret_val(tree, hf_gsm_a_dtap_epc_ue_tl_f_sc_mtch_id, tvb,
3883 offset<<3, epc_ue_tl_f_sc_mtch_id_crumbs, NULL);
3885 return 2;
3888 static const true_false_string epc_ue_tl_gh_communication_value = {
3889 "SRB1bis (NB-IoT UE) or SRB2 (E-UTRA UE)",
3890 "EMM (mode G) or SMR (mode H)"
3893 static uint16_t
3894 de_tp_epc_ue_tl_gh_setup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3896 uint32_t curr_offset;
3898 curr_offset = offset;
3900 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_ue_tl_gh_ul_loopback_op_mode, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN);
3901 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_ue_tl_gh_repetitions, tvb, (curr_offset<<3)+1, 7, ENC_BIG_ENDIAN);
3902 curr_offset++;
3903 proto_tree_add_item(tree, hf_gsm_a_dtap_epc_ue_tl_gh_ul_data_delay, tvb, curr_offset, 1, ENC_NA);
3904 curr_offset++;
3906 return (curr_offset - offset);
3909 static const value_string epc_ue_positioning_technology_vals[] = {
3910 { 0, "AGNSS"},
3911 { 1, "OTDOA"},
3912 { 2, "MBS"},
3913 { 3, "WLAN"},
3914 { 4, "Bluetooth"},
3915 { 5, "Sensor"},
3916 { 0, NULL }
3919 static uint16_t
3920 de_tp_epc_ue_positioning_technology(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3922 uint32_t curr_offset;
3924 curr_offset = offset;
3926 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_ue_positioning_technology, tvb, curr_offset<<3, 8, ENC_BIG_ENDIAN);
3927 curr_offset++;
3929 return (curr_offset - offset);
3932 static uint16_t
3933 de_tp_epc_mbms_packet_counter_value(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3935 uint32_t curr_offset;
3937 curr_offset = offset;
3939 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_mbms_packet_counter_value, tvb, curr_offset<<3, 32, ENC_BIG_ENDIAN);
3940 curr_offset += 4;
3942 return (curr_offset - offset);
3945 static const true_false_string epc_latitude_sign_value = {
3946 "South",
3947 "North"
3950 static const true_false_string epc_altitude_dir_value = {
3951 "Depth",
3952 "Height"
3955 static uint16_t
3956 de_tp_epc_ellipsoid_point_with_alt(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3958 uint32_t curr_offset;
3959 uint32_t longitude;
3961 curr_offset = offset;
3963 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_latitude_sign, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN);
3964 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_degrees_latitude, tvb, (curr_offset<<3)+1, 23, ENC_BIG_ENDIAN);
3965 curr_offset += 3;
3966 longitude = tvb_get_ntoh24(tvb, curr_offset);
3967 proto_tree_add_int_format(tree, hf_gsm_a_dtap_epc_degrees_longitude, tvb, curr_offset, 3, longitude,
3968 "%s = %s: %d", decode_bits_in_field(pinfo->pool, curr_offset<<3, 24, longitude, ENC_BIG_ENDIAN),
3969 proto_registrar_get_name(hf_gsm_a_dtap_epc_degrees_longitude), longitude-8388608);
3970 curr_offset += 3;
3971 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_altitude_dir, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN);
3972 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_altitude, tvb, (curr_offset<<3)+1, 15, ENC_BIG_ENDIAN);
3973 curr_offset += 2;
3975 return (curr_offset - offset);
3978 static uint16_t
3979 de_tp_epc_horizontal_velocity(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3981 uint32_t curr_offset;
3983 curr_offset = offset;
3985 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_bearing, tvb, curr_offset<<3, 9, ENC_BIG_ENDIAN);
3986 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_horizontal_speed, tvb, (curr_offset<<3)+9, 11, ENC_BIG_ENDIAN);
3987 curr_offset += 3;
3989 return (curr_offset - offset);
3992 static uint16_t
3993 de_tp_epc_gnss_tod_msec(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3995 uint32_t curr_offset;
3997 curr_offset = offset;
3999 proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_gnss_tod_msec, tvb, (curr_offset<<3)+2, 22, ENC_BIG_ENDIAN);
4000 curr_offset += 3;
4002 return (curr_offset - offset);
4005 static const value_string gcc_call_ref_priority[] = {
4006 { 0, "reserved"},
4007 { 1, "level 4"},
4008 { 2, "level 3"},
4009 { 3, "level 2"},
4010 { 4, "level 1"},
4011 { 5, "level 0"},
4012 { 6, "level B"},
4013 { 7, "level A"},
4014 { 0, NULL }
4016 static uint16_t
4017 de_gcc_call_ref(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
4019 uint32_t curr_offset;
4020 uint32_t value;
4022 curr_offset = offset;
4024 value = tvb_get_ntohl(tvb, curr_offset);
4026 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_call_ref, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
4028 if (value & 0x10){
4029 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_call_ref_has_priority, tvb, curr_offset, 4, ENC_NA);
4030 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_call_priority, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
4031 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_spare_1, tvb, curr_offset, 4, ENC_NA);
4033 else{
4034 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_call_ref_has_priority, tvb, curr_offset, 4, ENC_NA);
4035 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_spare_4, tvb, curr_offset, 4, ENC_NA);
4038 curr_offset += 4;
4040 return curr_offset - offset;
4043 static const value_string gcc_call_state_vals[] = {
4044 { 0, "U0"},
4045 { 1, "U1"},
4046 { 2, "U2sl"},
4047 { 3, "U3"},
4048 { 4, "U4"},
4049 { 5, "U5"},
4050 { 6, "U0.p"},
4051 { 7, "U2wr"},
4052 { 8, "U2r"},
4053 { 9, "U2ws"},
4054 { 10, "U2sr"},
4055 { 11, "U2nc"},
4056 { 0, NULL }
4057 /* All other values are reserved. */
4060 static uint16_t
4061 de_gcc_call_state(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
4063 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_call_state, tvb, offset, 2, ENC_BIG_ENDIAN);
4065 return 2;
4068 static const range_string gcc_cause_vals[] = {
4069 {0, 2, "Unspecified"},
4070 {3, 3, "Illegal MS"},
4071 {4, 4, "Unspecified"},
4072 {5, 5, "IMEI not accepted"},
4073 {6, 6, "Illegal ME"},
4074 {7, 7, "Unspecified"},
4075 {8, 8, "Service not authorized"},
4076 {9, 9, "Application not supported on the protocol"},
4077 {10, 10, "RR connection aborted"},
4078 {11, 15, "Unspecified"},
4079 {16, 16, "Normal call clearing"},
4080 {17, 17, "Network failure"},
4081 {18, 19, "Unspecified"},
4082 {20, 20, "Busy"},
4083 {21, 21, "Unspecified"},
4084 {22, 22, "Congestion"},
4085 {23, 23, "User not originator of call"},
4086 {24, 24, "Network wants to maintain call"},
4087 {25, 29, "Unspecified"},
4088 {30, 30, "Response to GET STATUS"},
4089 {31, 31, "Unspecified"},
4090 {32, 32, "Service option not supported"},
4091 {33, 33, "Requested service option not subscribed"},
4092 {34, 34, "Service option temporarily out of order"},
4093 {35, 37, "Unspecified"},
4094 {38, 38, "Call cannot be identified"},
4095 {39, 47, "Unspecified"},
4096 {48, 63, "Retry upon entry into a new cell"},
4097 {64, 80, "Unspecified"},
4098 {81, 81, "Invalid transaction identifier value"},
4099 {82, 94, "Unspecified"},
4100 {95, 95, "Semantically incorrect message"},
4101 {96, 96, "Invalid mandatory information"},
4102 {97, 97, "Message type non-existent or not implemented"},
4103 {98, 98, "Message type not compatible with the protocol state"},
4104 {99, 99, "Information element non-existent or not implemented"},
4105 {100, 100, "Message type not compatible with the protocol state"},
4106 {101, 111, "Unspecified"},
4107 {112, 112, "Protocol error, unspecified"},
4108 {113, 127, "Unspecified"},
4109 {0, 0, NULL }
4112 static const true_false_string gcc_cause_structure_val = {
4113 "cause_part [diagnostics]",
4114 "cause_part <cause>"
4117 static uint16_t
4118 de_gcc_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
4120 uint32_t curr_offset;
4122 int curr_len;
4123 curr_len = len;
4125 curr_offset = offset;
4127 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_cause_structure, tvb, curr_offset, 1, ENC_NA);
4128 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_cause, tvb, curr_offset, 1, ENC_NA);
4130 curr_offset++;
4131 curr_len--;
4133 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
4135 return curr_offset - offset;
4138 static const true_false_string gcc_orig_ind_vals = {
4139 "The MS is the originator of the call",
4140 "The MS is not the originator of the call"
4142 static uint16_t
4143 de_gcc_orig_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
4145 uint32_t curr_offset;
4147 curr_offset = offset;
4149 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_spare_3, tvb, curr_offset, 1, ENC_NA);
4150 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_orig_ind, tvb, curr_offset, 1, ENC_NA);
4152 curr_offset++;
4154 return curr_offset - offset;
4157 static const true_false_string gcc_state_attr_da = {
4158 "User connection in the downlink attached (D-ATT = T)",
4159 "User connection in the downlink not attached (D-ATT = F)"
4161 static const true_false_string gcc_state_attr_ua = {
4162 "User connection in the uplink attached (U-ATT = T)",
4163 "User connection in the uplink not attached (U-ATT = F)"
4165 static const true_false_string gcc_state_attr_comm = {
4166 "Communication with its peer entity is enabled in both directions (COMM = T)",
4167 "Communication with its peer entity is not enabled in both directions (COMM = F)"
4169 static const true_false_string gcc_state_attr_oi = {
4170 "The MS is the originator of the call (ORIG = T)",
4171 "The MS is not the originator of the call (ORIG = F)"
4173 static uint16_t
4174 de_gcc_state_attr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
4176 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_state_attr, tvb, offset, 1, ENC_NA);
4177 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_state_attr_da, tvb, offset, 1, ENC_NA);
4178 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_state_attr_ua, tvb, offset, 1, ENC_NA);
4179 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_state_attr_comm, tvb, offset, 1, ENC_NA);
4180 proto_tree_add_item(tree, hf_gsm_a_dtap_gcc_state_attr_oi, tvb, offset, 1, ENC_NA);
4182 return 1;
4185 static const value_string bcc_call_ref_priority[] = {
4186 { 0, "reserved"},
4187 { 1, "level 4"},
4188 { 2, "level 3"},
4189 { 3, "level 2"},
4190 { 4, "level 1"},
4191 { 5, "level 0"},
4192 { 6, "level B"},
4193 { 7, "level A"},
4194 { 0, NULL }
4196 static uint16_t
4197 de_bcc_call_ref(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
4199 uint32_t curr_offset;
4200 uint32_t value;
4202 curr_offset = offset;
4204 value = tvb_get_ntohl(tvb, curr_offset);
4206 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_call_ref, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
4208 if (value & 0x10){
4209 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_call_ref_has_priority, tvb, curr_offset, 4, ENC_NA);
4210 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_call_priority, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
4211 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_spare_1, tvb, curr_offset, 4, ENC_NA);
4213 else{
4214 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_call_ref_has_priority, tvb, curr_offset, 4, ENC_NA);
4215 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_spare_4, tvb, curr_offset, 4, ENC_NA);
4218 curr_offset += 4;
4220 return curr_offset - offset;
4223 static const range_string bcc_call_state_vals[] = {
4224 {0, 0, "U0"},
4225 {1, 1, "U1"},
4226 {2, 2, "U2"},
4227 {3, 3, "U3"},
4228 {4, 4, "U4"},
4229 {5, 5, "U5"},
4230 {6, 6, "U0.p"},
4231 {7, 7, "U6"},
4232 {8, 15, "Reserved"},
4233 {0, 0, NULL }
4236 static uint16_t
4237 de_bcc_call_state(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
4239 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_call_state, tvb, offset, 2, ENC_NA);
4241 return 1;
4244 static const range_string bcc_cause_vals[] = {
4245 {0, 2, "Unspecified"},
4246 {3, 3, "Illegal MS"},
4247 {4, 4, "Unspecified"},
4248 {5, 5, "IMEI not accepted"},
4249 {6, 6, "Illegal ME"},
4250 {7, 7, "Unspecified"},
4251 {8, 8, "Service not authorized"},
4252 {9, 9, "Application not supported on the protocol"},
4253 {10, 10, "RR connection aborted"},
4254 {11, 15, "Unspecified"},
4255 {16, 16, "Normal call clearing"},
4256 {17, 17, "Network failure"},
4257 {18, 19, "Unspecified"},
4258 {20, 20, "Busy"},
4259 {21, 21, "Unspecified"},
4260 {22, 22, "Congestion"},
4261 {23, 23, "User not originator of call"},
4262 {24, 24, "Network wants to maintain call"},
4263 {25, 29, "Unspecified"},
4264 {30, 30, "Response to GET STATUS"},
4265 {31, 31, "Unspecified"},
4266 {32, 32, "Service option not supported"},
4267 {33, 33, "Requested service option not subscribed"},
4268 {34, 34, "Service option temporarily out of order"},
4269 {35, 37, "Unspecified"},
4270 {38, 38, "Call cannot be identified"},
4271 {39, 47, "Unspecified"},
4272 {48, 63, "Retry upon entry into a new cell"},
4273 {64, 80, "Unspecified"},
4274 {81, 81, "Invalid transaction identifier value"},
4275 {82, 94, "Unspecified"},
4276 {95, 95, "Semantically incorrect message"},
4277 {96, 96, "Invalid mandatory information"},
4278 {97, 97, "Message type non-existent or not implemented"},
4279 {98, 98, "Message type not compatible with the protocol state"},
4280 {99, 99, "Information element non-existent or not implemented"},
4281 {100, 100, "Message type not compatible with the protocol state"},
4282 {101, 111, "Unspecified"},
4283 {112, 112, "Protocol error, unspecified"},
4284 {113, 127, "Unspecified"},
4285 {0, 0, NULL }
4288 static const true_false_string bcc_cause_structure_val = {
4289 "cause_part [diagnostics]",
4290 "cause_part <cause>"
4293 static uint16_t
4294 de_bcc_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
4296 uint32_t curr_offset;
4298 int curr_len;
4299 curr_len = len;
4301 curr_offset = offset;
4303 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_cause_structure, tvb, curr_offset, 1, ENC_NA);
4304 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_cause, tvb, curr_offset, 1, ENC_NA);
4306 curr_offset++;
4307 curr_len--;
4309 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
4311 return curr_offset - offset;
4314 static const true_false_string bcc_orig_ind_vals = {
4315 "The MS is the originator of the call",
4316 "The MS is not the originator of the call"
4318 static uint16_t
4319 de_bcc_orig_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
4321 uint32_t curr_offset;
4323 curr_offset = offset;
4325 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_spare_3, tvb, curr_offset, 1, ENC_NA);
4326 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_orig_ind, tvb, curr_offset, 1, ENC_NA);
4328 curr_offset++;
4330 return curr_offset - offset;
4333 static const true_false_string bcc_state_attr_da = {
4334 "User connection in the downlink attached (D-ATT = T)",
4335 "User connection in the downlink not attached (D-ATT = F)"
4337 static const true_false_string bcc_state_attr_ua = {
4338 "User connection in the uplink attached (U-ATT = T)",
4339 "User connection in the uplink not attached (U-ATT = F)"
4341 static const true_false_string bcc_state_attr_comm = {
4342 "Communication with its peer entity is enabled in both directions (COMM = T)",
4343 "Communication with its peer entity is not enabled in both directions (COMM = F)"
4345 static const true_false_string bcc_state_attr_oi = {
4346 "The MS is the originator of the call (ORIG = T)",
4347 "The MS is not the originator of the call (ORIG = F)"
4349 static uint16_t
4350 de_bcc_state_attr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
4352 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_state_attr, tvb, offset, 1, ENC_NA);
4353 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_state_attr_da, tvb, offset, 1, ENC_NA);
4354 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_state_attr_ua, tvb, offset, 1, ENC_NA);
4355 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_state_attr_comm, tvb, offset, 1, ENC_NA);
4356 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_state_attr_oi, tvb, offset, 1, ENC_NA);
4358 return 1;
4361 static uint16_t
4362 de_bcc_compr_otdi(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
4364 proto_tree_add_item(tree, hf_gsm_a_dtap_bcc_compr_otdi, tvb, offset, len, ENC_NA);
4366 return len;
4369 uint16_t (*dtap_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len, char *add_string, int string_len) = {
4370 /* Mobility Management Information Elements 10.5.3 */
4371 de_auth_param_rand, /* Authentication Parameter RAND */
4372 de_auth_param_autn, /* Authentication Parameter AUTN (UMTS and EPS authentication challenge) */
4373 de_auth_resp_param, /* Authentication Response Parameter */
4374 de_auth_resp_param_ext, /* Authentication Response Parameter (extension) (UMTS authentication challenge only) */
4375 de_auth_fail_param, /* Authentication Failure Parameter (UMTS and EPS authentication challenge) */
4376 NULL /* handled inline */, /* CM Service Type */
4377 NULL /* handled inline */, /* Identity Type */
4378 NULL /* handled inline */, /* Location Updating Type */
4379 de_network_name, /* Network Name */
4380 de_rej_cause, /* Reject Cause */
4381 NULL /* no associated data */, /* Follow-on Proceed */
4382 de_time_zone, /* Time Zone */
4383 de_time_zone_time, /* Time Zone and Time */
4384 NULL /* no associated data */, /* CTS Permission */
4385 de_lsa_id, /* LSA Identifier */
4386 de_day_saving_time, /* Daylight Saving Time */
4387 de_emerg_num_list, /* Emergency Number List */
4388 de_add_upd_params, /* Additional update parameters */
4389 de_mm_timer, /* MM Timer */
4390 /* Call Control Information Elements 10.5.4 */
4391 de_aux_states, /* Auxiliary States */
4392 de_bearer_cap, /* Bearer Capability */
4393 de_cc_cap, /* Call Control Capabilities */
4394 de_call_state, /* Call State */
4395 de_cld_party_bcd_num, /* Called Party BCD Number */
4396 de_cld_party_sub_addr, /* Called Party Subaddress */
4397 de_clg_party_bcd_num, /* Calling Party BCD Number */
4398 de_clg_party_sub_addr, /* Calling Party Subaddress */
4399 de_cause, /* Cause */
4400 NULL /* no associated data */, /* CLIR Suppression */
4401 NULL /* no associated data */, /* CLIR Invocation */
4402 NULL /* handled inline */, /* Congestion Level */
4403 de_conn_num, /* Connected Number */
4404 de_conn_sub_addr, /* Connected Subaddress */
4405 de_facility, /* Facility */
4406 de_hlc, /* High Layer Compatibility */
4407 de_keypad_facility, /* Keypad Facility */
4408 de_llc, /* 10.5.4.18 Low layer compatibility */
4409 NULL, /* More Data */
4410 de_notif_ind, /* Notification Indicator */
4411 de_prog_ind, /* Progress Indicator */
4412 de_recall_type, /* 10.5.4.21a Recall type $(CCBS)$ */
4413 de_red_party_bcd_num, /* Redirecting Party BCD Number */
4414 de_red_party_sub_addr, /* Redirecting Party Subaddress */
4415 de_repeat_ind, /* Repeat Indicator */
4416 NULL /* no associated data */, /* Reverse Call Setup Direction */
4417 de_setup_cont, /* SETUP Container $(CCBS)$ */
4418 de_signal, /* Signal */
4419 de_ss_ver_ind, /* SS Version Indicator */
4420 de_u2u, /* User-user */
4421 de_alert_pat, /* Alerting Pattern $(NIA)$ */
4422 de_allowed_act, /* Allowed Actions $(CCBS)$ */
4423 de_stream_id, /* Stream Identifier */
4424 de_nw_call_ctrl_cap, /* Network Call Control Capabilities */
4425 de_ca_of_no_cli, /* Cause of No CLI */
4426 de_sup_codec_list, /* Supported Codec List */
4427 de_serv_cat, /* Service Category */
4428 NULL, /* 10.5.4.34 Redial */
4429 NULL, /* 10.5.4.35 Network-initiated Service Upgrade ind */
4430 /* Short Message Service Information Elements [5] 8.1.4 */
4431 de_cp_user_data, /* CP-User Data */
4432 de_cp_cause, /* CP-Cause */
4433 /* Tests procedures information elements 3GPP TS 44.014 6.4.0 and 3GPP TS 34.109 6.4.0 */
4434 de_tp_sub_channel, /* Close TCH Loop Cmd Sub-channel */
4435 de_tp_ack, /* Open Loop Cmd Ack */
4436 de_tp_loop_type, /* Close Multi-slot Loop Cmd Loop type */
4437 de_tp_loop_ack, /* Close Multi-slot Loop Ack Result */
4438 de_tp_tested_device, /* Test Interface Tested device */
4439 de_tp_pdu_description, /* GPRS Test Mode Cmd PDU description */
4440 de_tp_mode_flag, /* GPRS Test Mode Cmd Mode flag */
4441 de_tp_egprs_mode_flag, /* EGPRS Start Radio Block Loopback Cmd Mode flag */
4442 de_tp_ms_positioning_technology, /* MS Positioning Technology */
4443 de_tp_ue_test_loop_mode, /* Close UE Test Loop Mode */
4444 de_tp_ue_positioning_technology, /* UE Positioning Technology */
4445 de_tp_rlc_sdu_counter_value, /* RLC SDU Counter Value */
4446 de_tp_epc_ue_test_loop_mode, /* UE Test Loop Mode */
4447 de_tp_epc_ue_tl_a_lb_setup, /* UE Test Loop Mode A LB Setup */
4448 de_tp_epc_ue_tl_b_lb_setup, /* UE Test Loop Mode B LB Setup */
4449 de_tp_epc_ue_tl_c_setup, /* UE Test Loop Mode C Setup */
4450 de_tp_epc_ue_tl_d_setup, /* UE Test Loop Mode D Setup */
4451 de_tp_epc_ue_tl_e_setup, /* UE Test Loop Mode E Setup */
4452 de_tp_epc_ue_tl_f_setup, /* UE Test Loop Mode F Setup */
4453 de_tp_epc_ue_tl_gh_setup, /* UE Test Loop Mode GH Setup */
4454 de_tp_epc_ue_positioning_technology, /* UE Positioning Technology */
4455 de_tp_epc_mbms_packet_counter_value, /* MBMS Packet Counter Value */
4456 de_tp_epc_ellipsoid_point_with_alt, /* ellipsoidPointWithAltitude */
4457 de_tp_epc_horizontal_velocity, /* horizontalVelocity */
4458 de_tp_epc_gnss_tod_msec, /* gnss-TOD-msec */
4459 /* GCC Elements */
4460 de_gcc_call_ref, /* Call Reference */
4461 de_gcc_call_state, /* Call state */
4462 de_gcc_cause, /* Cause */
4463 de_gcc_orig_ind, /* Originator indication */
4464 de_gcc_state_attr, /* State attributes */
4465 /* BCC Elements */
4466 de_bcc_call_ref, /* Call Reference */
4467 de_bcc_call_state, /* Call state */
4468 de_bcc_cause, /* Cause */
4469 de_bcc_orig_ind, /* Originator indication */
4470 de_bcc_state_attr, /* State attributes */
4471 de_bcc_compr_otdi, /* Compressed otdi */
4472 NULL, /* NONE */
4475 /* MESSAGE FUNCTIONS */
4478 * [12] 8.3 IMMEDIATE SETUP
4480 static void
4481 dtap_gcc_imm_setup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4483 uint32_t curr_offset;
4484 uint32_t consumed;
4485 unsigned curr_len;
4486 uint8_t oct;
4487 proto_tree *subtree;
4489 curr_offset = offset;
4490 curr_len = len;
4493 * special dissection for Cipher Key Sequence Number
4495 oct = tvb_get_uint8(tvb, curr_offset);
4497 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
4499 subtree =
4500 proto_tree_add_subtree(tree,
4501 tvb, curr_offset, 1, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM], NULL,
4502 val_to_str_ext_const(DE_CIPH_KEY_SEQ_NUM, &gsm_common_elem_strings_ext, ""));
4504 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 1, ENC_BIG_ENDIAN);
4506 switch (oct & 0x07)
4508 case 0x07:
4509 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_ciphering_key_sequence_number, tvb, curr_offset, 1,
4510 oct, "No key is available");
4511 break;
4513 default:
4514 proto_tree_add_item(subtree, hf_gsm_a_dtap_ciphering_key_sequence_number, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4515 break;
4518 curr_offset++;
4519 curr_len--;
4521 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4522 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4523 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_GCC_CALL_REF, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4524 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, NULL);
4528 * [12] 8.5 SETUP
4530 static void
4531 dtap_gcc_setup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4533 uint32_t curr_offset;
4534 uint32_t consumed;
4535 unsigned curr_len;
4537 curr_offset = offset;
4538 curr_len = len;
4540 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_GCC_CALL_REF, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4541 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, NULL);
4545 * [12] 8.1 CONNECT
4547 static void
4548 dtap_gcc_connect(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4550 uint32_t curr_offset;
4551 uint32_t consumed;
4552 unsigned curr_len;
4554 curr_offset = offset;
4555 curr_len = len;
4557 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_GCC_CALL_REF, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4559 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 4, ENC_NA);
4561 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_GCC_ORIG_IND, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4565 * [12] 8.7 TERMINATION
4567 static void
4568 dtap_gcc_term(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4570 uint32_t curr_offset;
4571 uint32_t consumed;
4572 unsigned curr_len;
4574 curr_offset = offset;
4575 curr_len = len;
4577 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_GCC_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4581 * [12] 8.9 TERMINATION REQUEST
4583 static void
4584 dtap_gcc_term_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4586 uint32_t curr_offset;
4587 uint32_t consumed;
4588 unsigned curr_len;
4590 curr_offset = offset;
4591 curr_len = len;
4593 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_GCC_CALL_REF, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4597 * [12] 8.8 TERMINATION REJECT
4599 static void
4600 dtap_gcc_term_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4602 uint32_t curr_offset;
4603 uint32_t consumed;
4604 unsigned curr_len;
4606 curr_offset = offset;
4607 curr_len = len;
4609 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_GCC_CAUSE, "(Reject Cause)", ei_gsm_a_dtap_missing_mandatory_element);
4613 * [12] 8.6 STATUS
4615 static void
4616 dtap_gcc_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4618 uint32_t curr_offset;
4619 uint32_t consumed;
4620 unsigned curr_len;
4622 curr_offset = offset;
4623 curr_len = len;
4625 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_GCC_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4626 ELEM_OPT_TV_SHORT(0xa0, GSM_A_PDU_TYPE_DTAP, DE_GCC_CALL_STATE, NULL);
4627 ELEM_OPT_TV_SHORT(0xb0, GSM_A_PDU_TYPE_DTAP, DE_GCC_STATE_ATTR, NULL);
4631 * [12] 8.2 GET STATUS
4633 static void
4634 dtap_gcc_get_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4636 uint32_t curr_offset;
4637 uint32_t consumed;
4638 unsigned curr_len;
4640 curr_offset = offset;
4641 curr_len = len;
4643 ELEM_OPT_TLV(0x17, GSM_A_PDU_TYPE_COMMON, DE_MID, NULL);
4644 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
4648 * [12] 8.4 SET PARAMETER
4650 static void
4651 dtap_gcc_set_param(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4653 uint32_t curr_offset;
4654 uint32_t consumed;
4655 unsigned curr_len;
4657 curr_offset = offset;
4658 curr_len = len;
4660 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 4, ENC_NA);
4661 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_GCC_STATE_ATTR, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4666 * [13] 8.1 CONNECT
4668 static void
4669 dtap_bcc_connect(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4671 uint32_t curr_offset;
4672 uint32_t consumed;
4673 unsigned curr_len;
4675 curr_offset = offset;
4676 curr_len = len;
4678 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_BCC_CALL_REF, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4680 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 4, ENC_NA);
4682 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_BCC_ORIG_IND, "(Broadcast call reference)", ei_gsm_a_dtap_missing_mandatory_element);
4686 * [13] 8.2 GET STATUS
4688 static void
4689 dtap_bcc_get_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4691 uint32_t curr_offset;
4692 uint32_t consumed;
4693 unsigned curr_len;
4695 curr_offset = offset;
4696 curr_len = len;
4698 ELEM_OPT_TLV(0x17, GSM_A_PDU_TYPE_COMMON, DE_MID, NULL);
4699 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
4703 * [13] 8.3 IMMEDIATE SETUP
4705 static void
4706 dtap_bcc_imm_setup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4708 uint32_t curr_offset;
4709 uint32_t consumed;
4710 unsigned curr_len;
4711 uint8_t oct;
4712 proto_tree *subtree;
4714 curr_offset = offset;
4715 curr_len = len;
4718 * special dissection for Cipher Key Sequence Number
4720 oct = tvb_get_uint8(tvb, curr_offset);
4722 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
4724 subtree =
4725 proto_tree_add_subtree(tree,
4726 tvb, curr_offset, 1, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM], NULL,
4727 val_to_str_ext_const(DE_CIPH_KEY_SEQ_NUM, &gsm_common_elem_strings_ext, ""));
4729 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 1, ENC_BIG_ENDIAN);
4731 switch (oct & 0x07)
4733 case 0x07:
4734 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_ciphering_key_sequence_number, tvb, curr_offset, 1,
4735 oct, "No key is available");
4736 break;
4738 default:
4739 proto_tree_add_item(subtree, hf_gsm_a_dtap_ciphering_key_sequence_number, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4740 break;
4743 curr_offset++;
4744 curr_len--;
4746 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4747 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4748 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_BCC_CALL_REF, "(Broadcast identity)", ei_gsm_a_dtap_missing_mandatory_element);
4752 * [13] 8.3a IMMEDIATE SETUP 2
4754 static void
4755 dtap_bcc_imm_setup2(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len)
4757 uint32_t curr_offset;
4758 uint32_t consumed;
4759 unsigned curr_len;
4760 uint8_t oct;
4761 proto_tree *subtree;
4763 curr_offset = offset;
4764 curr_len = len;
4767 * special dissection for Cipher Key Sequence Number
4769 oct = tvb_get_uint8(tvb, curr_offset);
4771 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
4773 subtree =
4774 proto_tree_add_subtree(tree,
4775 tvb, curr_offset, 1, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM], NULL,
4776 val_to_str_ext_const(DE_CIPH_KEY_SEQ_NUM, &gsm_common_elem_strings_ext, ""));
4778 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 1, ENC_BIG_ENDIAN);
4780 switch (oct & 0x07)
4782 case 0x07:
4783 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_ciphering_key_sequence_number, tvb, curr_offset, 1,
4784 oct, "No key is available");
4785 break;
4787 default:
4788 proto_tree_add_item(subtree, hf_gsm_a_dtap_ciphering_key_sequence_number, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4789 break;
4792 curr_offset++;
4793 curr_len--;
4795 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4796 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_TMSI_STAT, NULL, ei_gsm_a_dtap_missing_mandatory_element)
4797 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_BCC_CALL_REF, "(Group identity)", ei_gsm_a_dtap_missing_mandatory_element);
4798 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_BCC_COMPR_OTDI, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4802 * [13] 8.4 SET PARAMETER
4804 static void
4805 dtap_bcc_set_param(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
4807 uint32_t curr_offset;
4808 uint32_t consumed;
4809 unsigned curr_len;
4811 curr_offset = offset;
4812 curr_len = len;
4814 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 4, ENC_NA);
4815 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_BCC_STATE_ATTR, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4820 * [13] 8.5 SETUP
4822 static void
4823 dtap_bcc_setup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
4825 uint32_t curr_offset;
4826 uint32_t consumed;
4827 unsigned curr_len;
4829 curr_offset = offset;
4830 curr_len = len;
4832 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_BCC_CALL_REF, "(Broadcast identity)", ei_gsm_a_dtap_missing_mandatory_element);
4833 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "(Originator-to-dispatcher information)");
4837 * [13] 8.6 STATUS
4839 static void
4840 dtap_bcc_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
4842 uint32_t curr_offset;
4843 uint32_t consumed;
4844 unsigned curr_len;
4846 curr_offset = offset;
4847 curr_len = len;
4849 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_BCC_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4850 ELEM_OPT_TV_SHORT(0xa0, GSM_A_PDU_TYPE_DTAP, DE_BCC_CALL_STATE, NULL);
4851 ELEM_OPT_TV_SHORT(0xb0, GSM_A_PDU_TYPE_DTAP, DE_BCC_STATE_ATTR, NULL);
4855 * [13] 8.7 TERMINATION
4857 static void
4858 dtap_bcc_term(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
4860 uint32_t curr_offset;
4861 uint32_t consumed;
4862 unsigned curr_len;
4864 curr_offset = offset;
4865 curr_len = len;
4867 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_BCC_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4871 * [13] 8.8 TERMINATION REJECT
4873 static void
4874 dtap_bcc_term_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
4876 uint32_t curr_offset;
4877 uint32_t consumed;
4878 unsigned curr_len;
4880 curr_offset = offset;
4881 curr_len = len;
4883 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_BCC_CAUSE, "(Reject Cause)", ei_gsm_a_dtap_missing_mandatory_element);
4887 * [13] 8.9 TERMINATION REQUEST
4889 static void
4890 dtap_bcc_term_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
4892 uint32_t curr_offset;
4893 uint32_t consumed;
4894 unsigned curr_len;
4896 curr_offset = offset;
4897 curr_len = len;
4899 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_BCC_CALL_REF, "(Broadcast call reference)", ei_gsm_a_dtap_missing_mandatory_element);
4903 * [4] 9.2.2 Authentication request
4905 static void
4906 dtap_mm_auth_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
4908 uint32_t curr_offset;
4909 uint32_t consumed;
4910 unsigned curr_len;
4911 uint8_t oct;
4912 proto_tree *subtree;
4914 curr_offset = offset;
4915 curr_len = len;
4917 is_uplink = IS_UPLINK_FALSE;
4920 * special dissection for Cipher Key Sequence Number
4922 oct = tvb_get_uint8(tvb, curr_offset);
4924 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
4926 subtree =
4927 proto_tree_add_subtree(tree,
4928 tvb, curr_offset, 1, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM], NULL,
4929 val_to_str_ext_const(DE_CIPH_KEY_SEQ_NUM, &gsm_common_elem_strings_ext, ""));
4931 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 1, ENC_BIG_ENDIAN);
4933 switch (oct & 0x07)
4935 case 0x07:
4936 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_ciphering_key_sequence_number, tvb, curr_offset, 1,
4937 oct, "No key is available");
4938 break;
4940 default:
4941 proto_tree_add_item(subtree, hf_gsm_a_dtap_ciphering_key_sequence_number, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4942 break;
4945 curr_offset++;
4946 curr_len--;
4948 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_RAND, " - UMTS challenge or GSM challenge", ei_gsm_a_dtap_missing_mandatory_element);
4950 ELEM_OPT_TLV(0x20, GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_AUTN, NULL);
4952 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
4956 * [4] 9.2.3 Authentication response
4958 static void
4959 dtap_mm_auth_resp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
4961 uint32_t curr_offset;
4962 uint32_t consumed;
4963 unsigned curr_len;
4965 curr_offset = offset;
4966 curr_len = len;
4968 is_uplink = IS_UPLINK_TRUE;
4970 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_AUTH_RESP_PARAM, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4972 ELEM_OPT_TLV(0x21, GSM_A_PDU_TYPE_DTAP, DE_AUTH_RESP_PARAM_EXT, NULL);
4974 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
4978 * [4] 9.2.3a Authentication Failure
4980 static void
4981 dtap_mm_auth_fail(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
4983 uint32_t curr_offset;
4984 uint32_t consumed;
4985 unsigned curr_len;
4987 curr_offset = offset;
4988 curr_len = len;
4990 is_uplink = IS_UPLINK_TRUE;
4992 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
4994 ELEM_OPT_TLV(0x22, GSM_A_PDU_TYPE_DTAP, DE_AUTH_FAIL_PARAM, NULL);
4996 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5000 * [3] 9.2.4 CM Re-establishment request
5002 static void
5003 dtap_mm_cm_reestab_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5005 uint32_t curr_offset;
5006 uint32_t consumed;
5007 unsigned curr_len;
5008 uint8_t oct;
5009 proto_tree *subtree;
5011 curr_offset = offset;
5012 curr_len = len;
5014 is_uplink = IS_UPLINK_TRUE;
5017 * special dissection for Cipher Key Sequence Number
5019 oct = tvb_get_uint8(tvb, curr_offset);
5021 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
5023 subtree =
5024 proto_tree_add_subtree(tree,
5025 tvb, curr_offset, 1, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM], NULL,
5026 val_to_str_ext_const(DE_CIPH_KEY_SEQ_NUM, &gsm_common_elem_strings_ext, ""));
5028 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 1, ENC_BIG_ENDIAN);
5030 switch (oct & 0x07)
5032 case 0x07:
5033 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_ciphering_key_sequence_number, tvb, curr_offset, 1,
5034 oct, "No key is available");
5035 break;
5037 default:
5038 proto_tree_add_item(subtree, hf_gsm_a_dtap_ciphering_key_sequence_number, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5039 break;
5042 curr_offset++;
5043 curr_len--;
5045 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5047 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5049 ELEM_OPT_TV(0x13, GSM_A_PDU_TYPE_COMMON, DE_LAI, NULL);
5051 ELEM_OPT_TV_SHORT(0xD0, GSM_A_PDU_TYPE_GM, DE_DEVICE_PROPERTIES, NULL);
5054 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5058 * [3] 9.2.5a CM service prompt $(CCBS)
5060 static void
5061 dtap_mm_cm_srvc_prompt(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5063 uint32_t curr_offset;
5064 uint32_t consumed;
5065 unsigned curr_len;
5067 curr_offset = offset;
5068 curr_len = len;
5070 is_uplink = IS_UPLINK_FALSE;
5072 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_PD_SAPI, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5074 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5078 * [4] 9.2.6 CM service reject
5080 static void
5081 dtap_mm_cm_srvc_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5083 uint32_t curr_offset;
5084 uint32_t consumed;
5085 unsigned curr_len;
5087 curr_offset = offset;
5088 curr_len = len;
5090 is_uplink = IS_UPLINK_FALSE;
5092 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5094 ELEM_OPT_TLV(0x36, GSM_A_PDU_TYPE_DTAP, DE_MM_TIMER, " - T3246 value");
5096 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5100 * [4] 9.2.8 Abort
5102 static void
5103 dtap_mm_abort(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5105 uint32_t curr_offset;
5106 uint32_t consumed;
5107 unsigned curr_len;
5109 curr_offset = offset;
5110 curr_len = len;
5112 is_uplink = IS_UPLINK_FALSE;
5114 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5116 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5120 * [3] 9.2.9 CM service request
5122 static const value_string gsm_a_dtap_service_type_vals[] = {
5123 { 0x00, "Reserved"},
5124 { 0x01, "Mobile originating call establishment or packet mode connection establishment"},
5125 { 0x02, "Emergency call establishment"},
5126 { 0x03, "Reserved"},
5127 { 0x04, "Short message service"},
5128 { 0x05, "Reserved"},
5129 { 0x06, "Reserved"},
5130 { 0x07, "Reserved"},
5131 { 0x08, "Supplementary service activation"},
5132 { 0x09, "Voice group call establishment"},
5133 { 0x0a, "Voice broadcast call establishment"},
5134 { 0x0b, "Location Services"},
5135 { 0x0c, "Reserved"},
5136 { 0x0d, "Reserved"},
5137 { 0x0e, "Reserved"},
5138 { 0x0f, "Reserved"},
5139 { 0, NULL }
5142 static void
5143 dtap_mm_cm_srvc_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5145 uint32_t curr_offset;
5146 uint32_t consumed;
5147 unsigned curr_len;
5148 uint8_t oct;
5149 proto_tree *subtree;
5151 curr_offset = offset;
5152 curr_len = len;
5154 is_uplink = IS_UPLINK_TRUE;
5157 * special dissection for CM Service Type
5159 oct = tvb_get_uint8(tvb, curr_offset);
5161 subtree =
5162 proto_tree_add_subtree(tree,
5163 tvb, curr_offset, 1, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM], NULL,
5164 val_to_str_ext_const(DE_CIPH_KEY_SEQ_NUM, &gsm_common_elem_strings_ext, ""));
5166 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN);
5168 switch ((oct & 0x70) >> 4)
5170 case 0x07:
5171 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_ciphering_key_sequence_number70, tvb, curr_offset, 1,
5172 oct, "No key is available");
5173 break;
5175 default:
5176 proto_tree_add_item(subtree, hf_gsm_a_dtap_ciphering_key_sequence_number70, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5177 break;
5180 subtree =
5181 proto_tree_add_subtree(tree,
5182 tvb, curr_offset, 1, ett_gsm_dtap_elem[DE_CM_SRVC_TYPE], NULL,
5183 val_to_str_ext_const(DE_CM_SRVC_TYPE, &gsm_dtap_elem_strings_ext, ""));
5185 proto_tree_add_item(subtree, hf_gsm_a_dtap_service_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5187 curr_offset++;
5188 curr_len--;
5190 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5192 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5194 ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_COMMON, DE_PRIO, NULL);
5196 ELEM_OPT_TV_SHORT(0xC0, GSM_A_PDU_TYPE_DTAP, DE_ADD_UPD_PARAMS, NULL);
5198 ELEM_OPT_TV_SHORT(0xD0, GSM_A_PDU_TYPE_GM, DE_DEVICE_PROPERTIES, NULL);
5200 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5204 * [3] 9.2.10 Identity request
5206 static const value_string gsm_a_dtap_type_of_identity_vals[] = {
5207 { 0x00, "Reserved"},
5208 { 0x01, "IMSI"},
5209 { 0x02, "IMEI"},
5210 { 0x03, "IMEISV"},
5211 { 0x04, "TMSI"},
5212 { 0x05, "P-TMSI, RAI, P-TMSI signature"},
5213 { 0x06, "Reserved"},
5214 { 0x07, "Reserved"},
5215 { 0, NULL }
5218 static void
5219 dtap_mm_id_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5221 uint32_t curr_offset;
5222 unsigned curr_len;
5223 proto_tree *subtree;
5225 curr_offset = offset;
5226 curr_len = len;
5228 is_uplink = IS_UPLINK_FALSE;
5231 * special dissection for Identity Type
5233 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
5235 subtree =
5236 proto_tree_add_subtree(tree,
5237 tvb, curr_offset, 1, ett_gsm_dtap_elem[DE_ID_TYPE], NULL,
5238 val_to_str_ext_const(DE_ID_TYPE, &gsm_dtap_elem_strings_ext, ""));
5240 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 1, ENC_BIG_ENDIAN);
5241 proto_tree_add_item(subtree, hf_gsm_a_dtap_type_of_identity, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5243 curr_offset++;
5244 curr_len--;
5246 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5250 * [3] 9.2.11 Identity response
5252 static void
5253 dtap_mm_id_resp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5255 uint32_t curr_offset;
5256 uint32_t consumed;
5257 unsigned curr_len;
5259 curr_offset = offset;
5260 curr_len = len;
5262 is_uplink = IS_UPLINK_TRUE;
5264 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5266 ELEM_OPT_TV_SHORT(0xE0, GSM_A_PDU_TYPE_GM, DE_PTMSI_TYPE, NULL);
5268 ELEM_OPT_TLV( 0x1B, GSM_A_PDU_TYPE_GM, DE_RAI_2, " - Routing area identification");
5270 ELEM_OPT_TLV( 0x19, GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG_2, " - P-TMSI signature");
5272 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5276 * [3] 9.2.12 IMSI detach indication
5278 static void
5279 dtap_mm_imsi_det_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5281 uint32_t curr_offset;
5282 uint32_t consumed;
5283 unsigned curr_len;
5285 curr_offset = offset;
5286 curr_len = len;
5288 is_uplink = IS_UPLINK_TRUE;
5290 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_1, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5292 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5294 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5298 * [3] 9.2.13 Location updating accept
5300 static void
5301 dtap_mm_loc_upd_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5303 uint32_t curr_offset;
5304 uint32_t consumed;
5305 unsigned curr_len;
5307 curr_offset = offset;
5308 curr_len = len;
5310 is_uplink = IS_UPLINK_FALSE;
5312 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_LAI, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5314 ELEM_OPT_TLV(0x17, GSM_A_PDU_TYPE_COMMON, DE_MID, NULL);
5316 ELEM_OPT_T(0xa1, GSM_A_PDU_TYPE_DTAP, DE_FOP, NULL);
5318 /* CTS permission O T 1 10.5.3.10 */
5319 ELEM_OPT_T(0xa2, GSM_A_PDU_TYPE_DTAP, DE_CTS_PERM, NULL);
5321 /* PLMN list O TLV 5-47 10.5.1.13 */
5322 ELEM_OPT_TLV(0x4a, GSM_A_PDU_TYPE_COMMON, DE_PLMN_LIST, " Equivalent");
5324 /* 34 Emergency Number List O TLV 5-50 10.5.3.13 */
5325 ELEM_OPT_TLV(0x34, GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST, NULL);
5327 ELEM_OPT_TLV(0x35, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - Per MS T3212");
5329 ELEM_OPT_TV_SHORT(0xD0, GSM_A_PDU_TYPE_GM, DE_NON_3GPP_NW_PROV_POL, NULL);
5331 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5335 * [3] 9.2.14 Location updating reject
5337 static void
5338 dtap_mm_loc_upd_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5340 uint32_t curr_offset;
5341 uint32_t consumed;
5342 unsigned curr_len;
5344 curr_offset = offset;
5345 curr_len = len;
5347 is_uplink = IS_UPLINK_FALSE;
5349 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5351 ELEM_OPT_TLV(0x36, GSM_A_PDU_TYPE_DTAP, DE_MM_TIMER, " - T3246 value");
5353 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5357 * [3] 9.2.15 Location updating request
5359 static const value_string gsm_a_dtap_updating_type_vals[] = {
5360 { 0x00, "Normal"},
5361 { 0x01, "Periodic"},
5362 { 0x02, "IMSI attach"},
5363 { 0x03, "Reserved"},
5364 { 0, NULL }
5367 static const true_false_string tfs_follow_on_request_value = {
5368 "Follow-on request pending",
5369 "No follow-on request pending"
5372 static void
5373 dtap_mm_loc_upd_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5375 uint32_t curr_offset;
5376 uint32_t consumed;
5377 unsigned curr_len;
5378 uint8_t oct;
5379 proto_tree *subtree;
5380 proto_item *item;
5382 curr_offset = offset;
5383 curr_len = len;
5385 is_uplink = IS_UPLINK_TRUE;
5388 * special dissection for Location Updating Type
5390 oct = tvb_get_uint8(tvb, curr_offset);
5392 subtree =
5393 proto_tree_add_subtree(tree,
5394 tvb, curr_offset, 1, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM], NULL,
5395 val_to_str_ext_const(DE_CIPH_KEY_SEQ_NUM, &gsm_common_elem_strings_ext, ""));
5397 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN);
5399 switch ((oct & 0x70) >> 4)
5401 case 0x07:
5402 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_ciphering_key_sequence_number70, tvb, curr_offset, 1,
5403 oct, "No key is available");
5404 break;
5406 default:
5407 proto_tree_add_item(subtree, hf_gsm_a_dtap_ciphering_key_sequence_number70, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5408 break;
5411 subtree =
5412 proto_tree_add_subtree(tree,
5413 tvb, curr_offset, 1, ett_gsm_dtap_elem[DE_LOC_UPD_TYPE], &item,
5414 val_to_str_ext_const(DE_LOC_UPD_TYPE, &gsm_dtap_elem_strings_ext, ""));
5416 proto_tree_add_item(subtree, hf_gsm_a_dtap_follow_on_request, tvb, curr_offset, 1, ENC_NA);
5418 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+5, 1, ENC_BIG_ENDIAN);
5420 proto_tree_add_item(subtree, hf_gsm_a_dtap_updating_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5422 proto_item_append_text(item, " - %s", val_to_str_const(oct & 0x03, gsm_a_dtap_updating_type_vals, "Reserved"));
5424 curr_offset++;
5425 curr_len--;
5427 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_LAI, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5429 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_1, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5431 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5433 ELEM_OPT_TLV(0x33, GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, " - Mobile station classmark for UMTS");
5435 ELEM_OPT_TV_SHORT(0xc0, GSM_A_PDU_TYPE_DTAP, DE_ADD_UPD_PARAMS, NULL);
5437 ELEM_OPT_TV_SHORT(0xD0, GSM_A_PDU_TYPE_GM, DE_DEVICE_PROPERTIES, NULL);
5439 ELEM_OPT_TV_SHORT(0xE0, GSM_A_PDU_TYPE_COMMON, DE_MS_NET_FEAT_SUP, NULL);
5441 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5446 * [4] 9.2.15a MM information
5448 void
5449 dtap_mm_mm_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5451 uint32_t curr_offset;
5452 uint32_t consumed;
5453 unsigned curr_len;
5455 curr_offset = offset;
5456 curr_len = len;
5458 is_uplink = IS_UPLINK_TRUE;
5460 ELEM_OPT_TLV(0x43, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Full Name");
5462 ELEM_OPT_TLV(0x45, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Short Name");
5464 ELEM_OPT_TV(0x46, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE, " - Local");
5466 ELEM_OPT_TV(0x47, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE_TIME, " - Universal Time and Local Time Zone");
5468 ELEM_OPT_TLV(0x48, GSM_A_PDU_TYPE_DTAP, DE_LSA_ID, NULL);
5470 ELEM_OPT_TLV(0x49, GSM_A_PDU_TYPE_DTAP, DE_DAY_SAVING_TIME, NULL);
5472 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5476 * [4] 9.2.16 MM Status
5478 static void
5479 dtap_mm_mm_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5481 uint32_t curr_offset;
5482 uint32_t consumed;
5483 unsigned curr_len;
5485 curr_offset = offset;
5486 curr_len = len;
5488 is_uplink = IS_UPLINK_TRUE;
5490 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5492 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5496 * [3] 9.2.17 TMSI reallocation command
5498 static void
5499 dtap_mm_tmsi_realloc_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5501 uint32_t curr_offset;
5502 uint32_t consumed;
5503 unsigned curr_len;
5505 curr_offset = offset;
5506 curr_len = len;
5508 is_uplink = IS_UPLINK_FALSE;
5510 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_LAI, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5512 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5514 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5517 * 9.2.18 TMSI reallocation complete
5518 * No data
5522 * 9.2.19 MM Null
5523 * No data
5527 * [4] 9.3.1 Alerting
5529 static void
5530 dtap_cc_alerting(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5532 uint32_t curr_offset;
5533 uint32_t consumed;
5534 unsigned curr_len;
5536 curr_offset = offset;
5537 curr_len = len;
5539 is_uplink = IS_UPLINK_TRUE;
5541 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, NULL);
5543 ELEM_OPT_TLV(0x1e, GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, NULL);
5545 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, NULL);
5547 /* uplink only */
5549 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, NULL);
5551 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5555 * [4] 9.3.2 Call confirmed
5557 static void
5558 dtap_cc_call_conf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5560 uint32_t curr_offset;
5561 uint32_t consumed;
5562 unsigned curr_len;
5564 curr_offset = offset;
5565 curr_len = len;
5567 is_uplink = IS_UPLINK_TRUE;
5569 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " BC repeat indicator");
5571 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 1");
5573 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 2");
5575 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, NULL);
5577 ELEM_OPT_TLV(0x15, GSM_A_PDU_TYPE_DTAP, DE_CC_CAP, NULL);
5579 ELEM_OPT_TLV(0x2d, GSM_A_PDU_TYPE_DTAP, DE_SI, NULL);
5581 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, NULL);
5583 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5587 * [4] 9.3.3 Call proceeding
5589 static void
5590 dtap_cc_call_proceed(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5592 uint32_t curr_offset;
5593 uint32_t consumed;
5594 unsigned curr_len;
5596 curr_offset = offset;
5597 curr_len = len;
5599 is_uplink = IS_UPLINK_FALSE;
5601 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " BC repeat indicator");
5603 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 1");
5605 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 2");
5607 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, NULL);
5609 ELEM_OPT_TLV(0x1e, GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, NULL);
5611 ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_COMMON, DE_PRIO, NULL);
5613 ELEM_OPT_TLV(0x2f, GSM_A_PDU_TYPE_DTAP, DE_NET_CC_CAP, NULL);
5615 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5619 * [4] 9.3.4 Congestion control
5621 static const value_string gsm_a_dtap_congestion_level_vals[] = {
5622 { 0, "Receiver ready"},
5623 { 15, "Receiver not ready"},
5624 { 0, NULL }
5627 static void
5628 dtap_cc_congestion_control(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5630 uint32_t curr_offset;
5631 uint32_t consumed;
5632 unsigned curr_len;
5633 uint8_t oct;
5634 proto_tree *subtree;
5636 curr_offset = offset;
5637 curr_len = len;
5639 is_uplink = IS_UPLINK_FALSE;
5642 * special dissection for Congestion Level
5644 oct = tvb_get_uint8(tvb, curr_offset);
5646 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 4, ENC_BIG_ENDIAN);
5648 subtree =
5649 proto_tree_add_subtree(tree,
5650 tvb, curr_offset, 1, ett_gsm_dtap_elem[DE_CONGESTION], NULL,
5651 val_to_str_ext_const(DE_CONGESTION, &gsm_dtap_elem_strings_ext, ""));
5653 proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_congestion_level, tvb, curr_offset, 1,
5654 oct, "%s", val_to_str_const(oct & 0xF, gsm_a_dtap_congestion_level_vals, "Reserved"));
5656 curr_offset++;
5657 curr_len--;
5659 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, NULL);
5661 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5665 * [4] 9.3.5 Connect
5667 static void
5668 dtap_cc_connect(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5670 uint32_t curr_offset;
5671 uint32_t consumed;
5672 unsigned curr_len;
5674 curr_offset = offset;
5675 curr_len = len;
5677 is_uplink = IS_UPLINK_TRUE;
5679 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, NULL);
5681 ELEM_OPT_TLV(0x1e, GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, NULL);
5683 ELEM_OPT_TLV(0x4c, GSM_A_PDU_TYPE_DTAP, DE_CONN_NUM, NULL);
5685 ELEM_OPT_TLV(0x4d, GSM_A_PDU_TYPE_DTAP, DE_CONN_SUB_ADDR, NULL);
5687 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, NULL);
5689 /* uplink only */
5691 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, NULL);
5693 ELEM_OPT_TLV(0x2d, GSM_A_PDU_TYPE_DTAP, DE_SI, NULL);
5695 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5699 * [4] 9.3.7 Disconnect
5701 static void
5702 dtap_cc_disconnect(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5704 uint32_t curr_offset;
5705 uint32_t consumed;
5706 unsigned curr_len;
5708 curr_offset = offset;
5709 curr_len = len;
5711 is_uplink = IS_UPLINK_TRUE;
5713 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5715 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, NULL);
5717 ELEM_OPT_TLV(0x1e, GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, NULL);
5719 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, NULL);
5721 ELEM_OPT_TLV(0x7b, GSM_A_PDU_TYPE_DTAP, DE_ALLOWED_ACTIONS, NULL);
5723 /* uplink only */
5725 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, NULL);
5727 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5731 * [4] 9.3.8 Emergency setup
5733 static void
5734 dtap_cc_emerg_setup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5736 uint32_t curr_offset;
5737 uint32_t consumed;
5738 unsigned curr_len;
5740 curr_offset = offset;
5741 curr_len = len;
5743 is_uplink = IS_UPLINK_TRUE;
5745 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, NULL);
5747 ELEM_OPT_TLV(0x2d, GSM_A_PDU_TYPE_DTAP, DE_SI, NULL);
5749 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, NULL);
5751 ELEM_OPT_TLV(0x2e, GSM_A_PDU_TYPE_DTAP, DE_SERV_CAT, " - Emergency category");
5753 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5757 * [4] 9.3.9 Facility
5759 static void
5760 dtap_cc_facility(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5762 uint32_t curr_offset;
5763 uint32_t consumed;
5764 unsigned curr_len;
5766 curr_offset = offset;
5767 curr_len = len;
5769 is_uplink = IS_UPLINK_TRUE;
5771 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_FACILITY, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5773 /* uplink only */
5775 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, NULL);
5777 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5780 * 9.3.10 Hold
5781 * No data
5784 * 9.3.11 Hold Acknowledge
5787 * [4] 9.3.12 Hold Reject
5789 static void
5790 dtap_cc_hold_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5792 uint32_t curr_offset;
5793 uint32_t consumed;
5794 unsigned curr_len;
5796 curr_offset = offset;
5797 curr_len = len;
5799 is_uplink = IS_UPLINK_FALSE;
5801 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5803 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5807 * [4] 9.3.13 Modify
5809 static void
5810 dtap_cc_modify(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5812 uint32_t curr_offset;
5813 uint32_t consumed;
5814 unsigned curr_len;
5816 curr_offset = offset;
5817 curr_len = len;
5819 is_uplink = IS_UPLINK_TRUE;
5821 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5823 ELEM_OPT_TLV(0x7c, GSM_A_PDU_TYPE_DTAP, DE_LLC, NULL);
5825 ELEM_OPT_TLV(0x7d, GSM_A_PDU_TYPE_DTAP, DE_HLC, NULL);
5827 ELEM_OPT_T(0xa3, GSM_A_PDU_TYPE_DTAP, DE_REV_CALL_SETUP_DIR, NULL);
5829 ELEM_OPT_T(0xa4, GSM_A_PDU_TYPE_DTAP, DE_NET_INIT_SERV_UPG, NULL);
5831 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5835 * [4] 9.3.14 Modify complete
5837 static void
5838 dtap_cc_modify_complete(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5840 uint32_t curr_offset;
5841 uint32_t consumed;
5842 unsigned curr_len;
5844 curr_offset = offset;
5845 curr_len = len;
5847 is_uplink = IS_UPLINK_TRUE;
5849 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5851 ELEM_OPT_TLV(0x7c, GSM_A_PDU_TYPE_DTAP, DE_LLC, NULL);
5853 ELEM_OPT_TLV(0x7d, GSM_A_PDU_TYPE_DTAP, DE_HLC, NULL);
5855 ELEM_OPT_T(0xa3, GSM_A_PDU_TYPE_DTAP, DE_REV_CALL_SETUP_DIR, NULL);
5857 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5861 * [4] 9.3.15 Modify reject
5863 static void
5864 dtap_cc_modify_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5866 uint32_t curr_offset;
5867 uint32_t consumed;
5868 unsigned curr_len;
5870 curr_offset = offset;
5871 curr_len = len;
5873 is_uplink = IS_UPLINK_FALSE;
5875 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5877 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5879 ELEM_OPT_TLV(0x7c, GSM_A_PDU_TYPE_DTAP, DE_LLC, NULL);
5881 ELEM_OPT_TLV(0x7d, GSM_A_PDU_TYPE_DTAP, DE_HLC, NULL);
5883 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5887 * [4] 9.3.16 Notify
5889 static void
5890 dtap_cc_notify(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5892 uint32_t curr_offset;
5893 uint32_t consumed;
5894 unsigned curr_len;
5896 curr_offset = offset;
5897 curr_len = len;
5899 is_uplink = IS_UPLINK_FALSE;
5901 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_NOT_IND, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5903 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5907 * [4] 9.3.17 Progress
5909 static void
5910 dtap_cc_progress(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5912 uint32_t curr_offset;
5913 uint32_t consumed;
5914 unsigned curr_len;
5916 curr_offset = offset;
5917 curr_len = len;
5919 is_uplink = IS_UPLINK_FALSE;
5921 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5923 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, NULL);
5925 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5929 * [4] 9.3.17a CC-Establishment $(CCBS)$
5931 static void
5932 dtap_cc_cc_est(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5934 uint32_t curr_offset;
5935 uint32_t consumed;
5936 unsigned curr_len;
5938 curr_offset = offset;
5939 curr_len = len;
5941 is_uplink = IS_UPLINK_FALSE;
5943 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_SETUP_CONTAINER, NULL, ei_gsm_a_dtap_missing_mandatory_element);
5945 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5949 * [4] 9.3.17b CC-Establishment confirmed $(CCBS)$
5951 static void
5952 dtap_cc_cc_est_conf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5954 uint32_t curr_offset;
5955 uint32_t consumed;
5956 unsigned curr_len;
5958 curr_offset = offset;
5959 curr_len = len;
5961 is_uplink = IS_UPLINK_TRUE;
5963 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " Repeat indicator");
5965 ELEM_MAND_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 1", ei_gsm_a_dtap_missing_mandatory_element);
5967 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 2");
5969 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, NULL);
5971 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, NULL);
5973 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
5977 * [4] 9.3.18 Release
5979 static void
5980 dtap_cc_release(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
5982 uint32_t curr_offset;
5983 uint32_t consumed;
5984 unsigned curr_len;
5986 curr_offset = offset;
5987 curr_len = len;
5989 is_uplink = IS_UPLINK_TRUE;
5991 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, NULL);
5993 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, " 2");
5995 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, NULL);
5997 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, NULL);
5999 /* uplink only */
6001 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, NULL);
6003 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6007 * [4] 9.3.18a Recall $(CCBS)$
6009 static void
6010 dtap_cc_recall(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6012 uint32_t curr_offset;
6013 uint32_t consumed;
6014 unsigned curr_len;
6016 curr_offset = offset;
6017 curr_len = len;
6019 is_uplink = IS_UPLINK_FALSE;
6021 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_RECALL_TYPE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6023 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_FACILITY, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6025 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6029 * [4] 9.3.19 Release complete
6031 static void
6032 dtap_cc_release_complete(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6034 uint32_t curr_offset;
6035 uint32_t consumed;
6036 unsigned curr_len;
6038 curr_offset = offset;
6039 curr_len = len;
6041 is_uplink = IS_UPLINK_FALSE;
6043 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, NULL);
6045 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, NULL);
6047 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, NULL);
6049 /* uplink only */
6051 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, NULL);
6053 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6057 * [4] 9.3.22 Retrieve
6059 static void
6060 dtap_cc_retrieve_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6062 uint32_t curr_offset;
6063 uint32_t consumed;
6064 unsigned curr_len;
6066 curr_offset = offset;
6067 curr_len = len;
6069 is_uplink = IS_UPLINK_FALSE;
6071 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6073 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6077 * 9.3.21 Retrieve Acknowledge
6078 * No data
6081 * 9.3.22 Retrieve Reject
6082 * No data
6085 * [4] 9.3.23 Setup
6086 * 3GPP TS 24.008 version 7.5.0 Release 7
6088 static void
6089 dtap_cc_setup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6091 uint32_t curr_offset;
6092 uint32_t consumed;
6093 unsigned curr_len;
6095 curr_offset = offset;
6096 curr_len = len;
6098 is_uplink = IS_UPLINK_TRUE;
6100 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " BC repeat indicator");
6102 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 1");
6104 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 2");
6106 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, NULL);
6108 ELEM_OPT_TLV(0x1e, GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, NULL);
6110 ELEM_OPT_TV(0x34, GSM_A_PDU_TYPE_DTAP, DE_SIGNAL, NULL);
6112 ELEM_OPT_TLV(0x5c, GSM_A_PDU_TYPE_DTAP, DE_CLG_PARTY_BCD_NUM, NULL);
6114 ELEM_OPT_TLV(0x5d, GSM_A_PDU_TYPE_DTAP, DE_CLG_PARTY_SUB_ADDR, NULL);
6116 ELEM_OPT_TLV(0x5e, GSM_A_PDU_TYPE_DTAP, DE_CLD_PARTY_BCD_NUM, NULL);
6118 ELEM_OPT_TLV(0x6d, GSM_A_PDU_TYPE_DTAP, DE_CLD_PARTY_SUB_ADDR, NULL);
6120 ELEM_OPT_TLV(0x74, GSM_A_PDU_TYPE_DTAP, DE_RED_PARTY_BCD_NUM, NULL);
6122 ELEM_OPT_TLV(0x75, GSM_A_PDU_TYPE_DTAP, DE_RED_PARTY_SUB_ADDR, NULL);
6124 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " LLC repeat indicator");
6126 ELEM_OPT_TLV(0x7c, GSM_A_PDU_TYPE_DTAP, DE_LLC, " 1");
6128 ELEM_OPT_TLV(0x7c, GSM_A_PDU_TYPE_DTAP, DE_LLC, " 2");
6130 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " HLC repeat indicator");
6132 ELEM_OPT_TLV(0x7d, GSM_A_PDU_TYPE_DTAP, DE_HLC, " 1");
6134 ELEM_OPT_TLV(0x7d, GSM_A_PDU_TYPE_DTAP, DE_HLC, " 2");
6136 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, NULL);
6138 /* downlink only */
6140 ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_COMMON, DE_PRIO, NULL);
6142 ELEM_OPT_TLV(0x19, GSM_A_PDU_TYPE_DTAP, DE_ALERT_PATTERN, NULL);
6144 ELEM_OPT_TLV(0x2f, GSM_A_PDU_TYPE_DTAP, DE_NET_CC_CAP, NULL);
6146 ELEM_OPT_TLV(0x3a, GSM_A_PDU_TYPE_DTAP, DE_CAUSE_NO_CLI, NULL);
6148 /* Backup bearer capability O TLV 3-15 10.5.4.4a */
6149 ELEM_OPT_TLV(0x41, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, NULL);
6151 /* uplink only */
6153 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, NULL);
6155 ELEM_OPT_T(0xa1, GSM_A_PDU_TYPE_DTAP, DE_CLIR_SUP, NULL);
6157 ELEM_OPT_T(0xa2, GSM_A_PDU_TYPE_DTAP, DE_CLIR_INV, NULL);
6159 ELEM_OPT_TLV(0x15, GSM_A_PDU_TYPE_DTAP, DE_CC_CAP, NULL);
6161 ELEM_OPT_TLV(0x1d, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, " $(CCBS)$ (advanced recall alignment)");
6163 ELEM_OPT_TLV(0x1b, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, " (recall alignment Not essential) $(CCBS)$");
6165 ELEM_OPT_TLV(0x2d, GSM_A_PDU_TYPE_DTAP, DE_SI, NULL);
6167 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, NULL);
6169 /*A3 Redial O T 1 10.5.4.34 */
6170 ELEM_OPT_T(0xA3, GSM_A_PDU_TYPE_DTAP, DE_REDIAL, NULL);
6172 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6176 * [4] 9.3.23a Start CC $(CCBS)$
6178 static void
6179 dtap_cc_start_cc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6181 uint32_t curr_offset;
6182 uint32_t consumed;
6183 unsigned curr_len;
6185 curr_offset = offset;
6186 curr_len = len;
6188 is_uplink = IS_UPLINK_FALSE;
6190 ELEM_OPT_TLV(0x15, GSM_A_PDU_TYPE_DTAP, DE_CC_CAP, NULL);
6192 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6196 * [4] 9.3.24 Start DTMF
6198 static void
6199 dtap_cc_start_dtmf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6201 uint32_t curr_offset;
6202 uint32_t consumed;
6203 unsigned curr_len;
6205 curr_offset = offset;
6206 curr_len = len;
6208 is_uplink = IS_UPLINK_TRUE;
6210 ELEM_MAND_TV(0x2c, GSM_A_PDU_TYPE_DTAP, DE_KEYPAD_FACILITY, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6212 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6216 * [4] 9.3.25 Start DTMF Acknowledge
6218 static void
6219 dtap_cc_start_dtmf_ack(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6221 uint32_t curr_offset;
6222 uint32_t consumed;
6223 unsigned curr_len;
6225 curr_offset = offset;
6226 curr_len = len;
6228 is_uplink = IS_UPLINK_FALSE;
6230 ELEM_MAND_TV(0x2c, GSM_A_PDU_TYPE_DTAP, DE_KEYPAD_FACILITY, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6232 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6236 * [4] 9.3.26 Start DTMF reject
6238 static void
6239 dtap_cc_start_dtmf_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6241 uint32_t curr_offset;
6242 uint32_t consumed;
6243 unsigned curr_len;
6245 curr_offset = offset;
6246 curr_len = len;
6248 is_uplink = IS_UPLINK_FALSE;
6250 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6252 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6256 * [4] 9.3.27 Status
6258 static void
6259 dtap_cc_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6261 uint32_t curr_offset;
6262 uint32_t consumed;
6263 unsigned curr_len;
6265 curr_offset = offset;
6266 curr_len = len;
6268 is_uplink = IS_UPLINK_FALSE;
6270 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6272 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_CALL_STATE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6274 ELEM_OPT_TLV(0x24, GSM_A_PDU_TYPE_DTAP, DE_AUX_STATES, NULL);
6276 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6279 * 9.3.28 Status enquiry
6280 * No data
6283 * 9.3.29 Stop DTMF
6284 * No data
6287 * Stop DTMF acknowledge
6288 * No data
6291 * [4] 9.3.31 User information
6293 static void
6294 dtap_cc_user_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6296 uint32_t curr_offset;
6297 uint32_t consumed;
6298 unsigned curr_len;
6300 curr_offset = offset;
6301 curr_len = len;
6303 is_uplink = IS_UPLINK_TRUE;
6305 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_USER_USER, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6307 ELEM_OPT_T(0xa0, GSM_A_PDU_TYPE_DTAP, DE_MORE_DATA, NULL);
6309 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6313 * 3GPP TS 24.080
6314 * [6] 2.4.2
6316 static void
6317 dtap_ss_register(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6319 uint32_t curr_offset;
6320 uint32_t consumed;
6321 unsigned curr_len;
6323 curr_offset = offset;
6324 curr_len = len;
6326 is_uplink = IS_UPLINK_TRUE;
6328 ELEM_MAND_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6330 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, NULL);
6332 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6336 * 3GPP TS 24.011
6337 * [5] 7.2.1
6339 static void
6340 dtap_sms_cp_data(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6342 uint32_t curr_offset;
6343 uint32_t consumed;
6344 unsigned curr_len;
6346 curr_offset = offset;
6347 curr_len = len;
6349 is_uplink = IS_UPLINK_TRUE;
6351 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CP_USER_DATA, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6353 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6357 * [5] 7.2.3
6359 static void
6360 dtap_sms_cp_error(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6362 uint32_t curr_offset;
6363 uint32_t consumed;
6364 unsigned curr_len;
6366 curr_offset = offset;
6367 curr_len = len;
6369 is_uplink = IS_UPLINK_TRUE;
6371 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_CP_CAUSE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6373 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6376 static void
6377 dtap_tp_close_tch_loop_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6379 uint32_t curr_offset;
6380 uint32_t consumed;
6381 unsigned curr_len;
6383 curr_len = len;
6384 curr_offset = offset;
6386 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_SUB_CHANNEL, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6388 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6391 static void
6392 dtap_tp_open_loop_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6394 uint32_t curr_offset;
6395 uint32_t consumed;
6396 unsigned curr_len;
6398 curr_len = len;
6399 curr_offset = offset;
6401 if (curr_len)
6402 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_ACK, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6404 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6407 static void
6408 dtap_tp_multi_slot_loop_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6410 uint32_t curr_offset;
6411 uint32_t consumed;
6412 unsigned curr_len;
6414 curr_len = len;
6415 curr_offset = offset;
6417 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_LOOP_TYPE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6419 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6422 static void
6423 dtap_tp_multi_slot_loop_ack(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6425 uint32_t curr_offset;
6426 uint32_t consumed;
6427 unsigned curr_len;
6429 curr_len = len;
6430 curr_offset = offset;
6432 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_LOOP_ACK, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6434 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6437 static void
6438 dtap_tp_test_interface(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6440 uint32_t curr_offset;
6441 uint32_t consumed;
6442 unsigned curr_len;
6444 curr_len = len;
6445 curr_offset = offset;
6447 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_TESTED_DEVICE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6449 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6452 static void
6453 dtap_tp_gprs_test_mode_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6455 uint32_t curr_offset;
6456 uint32_t consumed;
6457 unsigned curr_len;
6459 curr_len = len;
6460 curr_offset = offset;
6462 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_PDU_DESCRIPTION, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6464 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_MODE_FLAG, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6466 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6469 static void
6470 dtap_tp_egprs_start_radio_block_loopback_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6472 uint32_t curr_offset;
6473 uint32_t consumed;
6474 unsigned curr_len;
6476 curr_len = len;
6477 curr_offset = offset;
6479 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_EGPRS_MODE_FLAG, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6481 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6484 static void
6485 dtap_tp_reset_ms_positioning_stored_information(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6487 uint32_t curr_offset;
6488 uint32_t consumed;
6489 unsigned curr_len;
6491 curr_len = len;
6492 curr_offset = offset;
6494 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_MS_POSITIONING_TECHNOLOGY, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6496 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6499 static void
6500 dtap_tp_close_ue_test_loop(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6502 uint32_t curr_offset;
6503 uint32_t consumed;
6504 unsigned curr_len;
6506 curr_len = len;
6507 curr_offset = offset;
6509 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_UE_TEST_LOOP_MODE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6511 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6514 static void
6515 dtap_tp_reset_ue_positioning_stored_information(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6517 uint32_t curr_offset;
6518 uint32_t consumed;
6519 unsigned curr_len;
6521 curr_len = len;
6522 curr_offset = offset;
6524 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_UE_POSITIONING_TECHNOLOGY, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6526 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6529 static void
6530 dtap_tp_ue_test_loop_mode_3_rlc_sdu_counter_response(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6532 uint32_t curr_offset;
6533 uint32_t consumed;
6534 unsigned curr_len;
6536 curr_len = len;
6537 curr_offset = offset;
6539 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_RLC_SDU_COUNTER_VALUE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6541 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6544 static void
6545 dtap_tp_epc_close_ue_test_loop(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6547 uint32_t curr_offset;
6548 uint32_t consumed;
6549 unsigned curr_len;
6551 curr_len = len;
6552 curr_offset = offset;
6554 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_EPC_UE_TEST_LOOP_MODE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6556 switch (epc_test_loop_mode)
6558 case 0:
6559 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_TP_EPC_UE_TL_A_LB_SETUP, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6560 break;
6561 case 1:
6562 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_EPC_UE_TL_B_LB_SETUP, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6563 break;
6564 case 2:
6565 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_EPC_UE_TL_C_SETUP, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6566 break;
6567 case 3:
6568 ELEM_MAND_LV_E(GSM_A_PDU_TYPE_DTAP, DE_TP_EPC_UE_TL_D_SETUP, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6569 break;
6570 case 4:
6571 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_TP_EPC_UE_TL_E_SETUP, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6572 break;
6573 case 5:
6574 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_EPC_UE_TL_F_SETUP, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6575 break;
6576 case 6:
6577 case 7:
6578 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_EPC_UE_TL_GH_SETUP, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6579 break;
6580 default:
6581 break;
6584 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6587 static void
6588 dtap_tp_epc_activate_test_mode(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6590 uint32_t curr_offset;
6591 uint32_t consumed;
6592 unsigned curr_len;
6594 curr_len = len;
6595 curr_offset = offset;
6597 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_EPC_UE_TEST_LOOP_MODE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6599 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6602 static void
6603 dtap_tp_epc_reset_ue_positioning_stored_information(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6605 uint32_t curr_offset;
6606 uint32_t consumed;
6607 unsigned curr_len;
6609 curr_len = len;
6610 curr_offset = offset;
6612 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_EPC_UE_POSITIONING_TECHNOLOGY, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6614 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6617 static void
6618 dtap_tp_epc_test_loop_mode_c_mbms_packet_counter_response(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6620 uint32_t curr_offset;
6621 uint32_t consumed;
6622 unsigned curr_len;
6624 curr_len = len;
6625 curr_offset = offset;
6627 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_EPC_MBMS_PACKET_COUNTER_VALUE, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6629 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6631 static void
6632 dtap_tp_epc_update_ue_location_information(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len)
6634 uint32_t curr_offset;
6635 uint32_t consumed;
6636 unsigned curr_len;
6638 curr_len = len;
6639 curr_offset = offset;
6641 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_EPC_ELLIPSOID_POINT_WITH_ALT, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6643 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_EPC_HORIZONTAL_VELOCITY, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6645 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_EPC_GNSS_TOD_MSEC, NULL, ei_gsm_a_dtap_missing_mandatory_element);
6647 EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_dtap_extraneous_data);
6650 #define NUM_GSM_DTAP_MSG_GCC array_length(gsm_a_dtap_msg_gcc_strings)
6651 static int ett_gsm_dtap_msg_gcc[NUM_GSM_DTAP_MSG_GCC];
6652 static void (*dtap_msg_gcc[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len) = {
6653 dtap_gcc_imm_setup, /* IMMEDIATE SETUP */
6654 dtap_gcc_setup, /* SETUP */
6655 dtap_gcc_connect, /* CONNECT */
6656 dtap_gcc_term, /* TERMINATION */
6657 dtap_gcc_term_req, /* TERMINATION REQUEST */
6658 dtap_gcc_term_rej, /* TERMINATION REJECT */
6659 dtap_gcc_status, /* STATUS */
6660 dtap_gcc_get_status, /* GET STATUS */
6661 dtap_gcc_set_param, /* SET PARAMETER */
6662 NULL, /* NONE */
6665 #define NUM_GSM_DTAP_MSG_BCC array_length(gsm_a_dtap_msg_bcc_strings)
6666 static int ett_gsm_dtap_msg_bcc[NUM_GSM_DTAP_MSG_BCC];
6667 static void (*dtap_msg_bcc[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len) = {
6668 dtap_bcc_imm_setup, /* IMMEDIATE SETUP */
6669 dtap_bcc_setup, /* SETUP */
6670 dtap_bcc_connect, /* CONNECT */
6671 dtap_bcc_term, /* TERMINATION */
6672 dtap_bcc_term_req, /* TERMINATION REQUEST */
6673 dtap_bcc_term_rej, /* TERMINATION REJECT */
6674 dtap_bcc_status, /* STATUS */
6675 dtap_bcc_get_status, /* GET STATUS */
6676 dtap_bcc_set_param, /* SET PARAMETER */
6677 dtap_bcc_imm_setup2, /* IMMEDIATE SETUP 2 */
6678 NULL, /* NONE */
6681 #define NUM_GSM_DTAP_MSG_MM array_length(gsm_a_dtap_msg_mm_strings)
6682 static int ett_gsm_dtap_msg_mm[NUM_GSM_DTAP_MSG_MM];
6683 static void (*dtap_msg_mm_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len) = {
6684 dtap_mm_imsi_det_ind, /* IMSI Detach Indication */
6685 dtap_mm_loc_upd_acc, /* Location Updating Accept */
6686 dtap_mm_loc_upd_rej, /* Location Updating Reject */
6687 dtap_mm_loc_upd_req, /* Location Updating Request */
6688 NULL /* no associated data */, /* Authentication Reject */
6689 dtap_mm_auth_req, /* Authentication Request */
6690 dtap_mm_auth_resp, /* Authentication Response */
6691 dtap_mm_auth_fail, /* Authentication Failure */
6692 dtap_mm_id_req, /* Identity Request */
6693 dtap_mm_id_resp, /* Identity Response */
6694 dtap_mm_tmsi_realloc_cmd, /* TMSI Reallocation Command */
6695 NULL /* no associated data */, /* TMSI Reallocation Complete */
6696 NULL /* no associated data */, /* CM Service Accept */
6697 dtap_mm_cm_srvc_rej, /* CM Service Reject */
6698 NULL /* no associated data */, /* CM Service Abort */
6699 dtap_mm_cm_srvc_req, /* CM Service Request */
6700 dtap_mm_cm_srvc_prompt, /* CM Service Prompt */
6701 NULL, /* Reserved: was allocated in earlier phases of the protocol */
6702 dtap_mm_cm_reestab_req, /* CM Re-establishment Request */
6703 dtap_mm_abort, /* Abort */
6704 NULL /* no associated data */, /* MM Null */
6705 dtap_mm_mm_status, /* MM Status */
6706 dtap_mm_mm_info, /* MM Information */
6707 NULL, /* NONE */
6710 #define NUM_GSM_DTAP_MSG_CC array_length(gsm_a_dtap_msg_cc_strings)
6711 static int ett_gsm_dtap_msg_cc[NUM_GSM_DTAP_MSG_CC];
6712 static void (*dtap_msg_cc_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len) = {
6713 dtap_cc_alerting, /* Alerting */
6714 dtap_cc_call_conf, /* Call Confirmed */
6715 dtap_cc_call_proceed, /* Call Proceeding */
6716 dtap_cc_connect, /* Connect */
6717 NULL /* no associated data */, /* Connect Acknowledge */
6718 dtap_cc_emerg_setup, /* Emergency Setup */
6719 dtap_cc_progress, /* Progress */
6720 dtap_cc_cc_est, /* CC-Establishment */
6721 dtap_cc_cc_est_conf, /* CC-Establishment Confirmed */
6722 dtap_cc_recall, /* Recall */
6723 dtap_cc_start_cc, /* Start CC */
6724 dtap_cc_setup, /* Setup */
6725 dtap_cc_modify, /* Modify */
6726 dtap_cc_modify_complete, /* Modify Complete */
6727 dtap_cc_modify_rej, /* Modify Reject */
6728 dtap_cc_user_info, /* User Information */
6729 NULL /* no associated data */, /* Hold */
6730 NULL /* no associated data */, /* Hold Acknowledge */
6731 dtap_cc_hold_rej, /* Hold Reject */
6732 NULL /* no associated data */, /* Retrieve */
6733 NULL /* no associated data */, /* Retrieve Acknowledge */
6734 dtap_cc_retrieve_rej, /* Retrieve Reject */
6735 dtap_cc_disconnect, /* Disconnect */
6736 dtap_cc_release, /* Release */
6737 dtap_cc_release_complete, /* Release Complete */
6738 dtap_cc_congestion_control, /* Congestion Control */
6739 dtap_cc_notify, /* Notify */
6740 dtap_cc_status, /* Status */
6741 NULL /* no associated data */, /* Status Enquiry */
6742 dtap_cc_start_dtmf, /* Start DTMF */
6743 NULL /* no associated data */, /* Stop DTMF */
6744 NULL /* no associated data */, /* Stop DTMF Acknowledge */
6745 dtap_cc_start_dtmf_ack, /* Start DTMF Acknowledge */
6746 dtap_cc_start_dtmf_rej, /* Start DTMF Reject */
6747 dtap_cc_facility, /* Facility */
6748 NULL, /* NONE */
6751 #define NUM_GSM_DTAP_MSG_SMS array_length(gsm_a_dtap_msg_sms_strings)
6752 static int ett_gsm_dtap_msg_sms[NUM_GSM_DTAP_MSG_SMS];
6753 static void (*dtap_msg_sms_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len) = {
6754 dtap_sms_cp_data, /* CP-DATA */
6755 NULL /* no associated data */, /* CP-ACK */
6756 dtap_sms_cp_error, /* CP-ERROR */
6757 NULL, /* NONE */
6760 #define NUM_GSM_DTAP_MSG_SS array_length(gsm_a_dtap_msg_ss_strings)
6761 static int ett_gsm_dtap_msg_ss[NUM_GSM_DTAP_MSG_SS];
6762 static void (*dtap_msg_ss_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len) = {
6763 dtap_cc_release_complete, /* Release Complete */
6764 dtap_cc_facility, /* Facility */
6765 dtap_ss_register, /* Register */
6766 NULL, /* NONE */
6769 #define NUM_GSM_DTAP_MSG_TP array_length(gsm_a_dtap_msg_tp_strings)
6770 static int ett_gsm_dtap_msg_tp[NUM_GSM_DTAP_MSG_TP];
6771 static void (*dtap_msg_tp_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len) = {
6772 dtap_tp_close_tch_loop_cmd, /* CLOSE TCH LOOP CMD */
6773 NULL, /* CLOSE TCH LOOP ACK */
6774 dtap_tp_open_loop_cmd, /* OPEN LOOP CMD */
6775 NULL, /* ACT EMMI CMD */
6776 NULL, /* ACT EMMI ACK */
6777 NULL, /* DEACT EMMI */
6778 dtap_tp_test_interface, /* Test Interface */
6779 dtap_tp_multi_slot_loop_cmd, /* CLOSE Multi-slot LOOP CMD */
6780 dtap_tp_multi_slot_loop_ack, /* CLOSE Multi-slot LOOP ACK */
6781 NULL, /* OPEN Multi-slot LOOP CMD */
6782 NULL, /* OPEN Multi-slot LOOP ACK */
6783 dtap_tp_gprs_test_mode_cmd, /* GPRS TEST MODE CMD */
6784 dtap_tp_egprs_start_radio_block_loopback_cmd, /* EGPRS START RADIO BLOCK LOOPBACK CMD */
6785 dtap_tp_reset_ms_positioning_stored_information, /* RESET MS POSITIONING STORED INFORMATION */
6786 dtap_tp_close_ue_test_loop, /* CLOSE UE TEST LOOP */
6787 NULL, /* CLOSE UE TEST LOOP COMPLETE */
6788 NULL, /* OPEN UE TEST LOOP */
6789 NULL, /* OPEN UE TEST LOOP COMPLETE */
6790 NULL, /* ACTIVATE RB TEST MODE */
6791 NULL, /* ACTIVATE RB TEST MODE COMPLETE */
6792 NULL, /* DEACTIVATE RB TEST MODE */
6793 NULL, /* DEACTIVATE RB TEST MODE COMPLETE */
6794 dtap_tp_reset_ue_positioning_stored_information, /* RESET UE POSITIONING STORED INFORMATION */
6795 NULL, /* UE TEST LOOP MODE 3 RLC SDU COUNTER REQUEST */
6796 dtap_tp_ue_test_loop_mode_3_rlc_sdu_counter_response, /* UE TEST LOOP MODE 3 RLC SDU COUNTER RESPONSE */
6797 dtap_tp_epc_close_ue_test_loop, /* CLOSE UE TEST LOOP */
6798 NULL, /* CLOSE UE TEST LOOP COMPLETE */
6799 NULL, /* OPEN UE TEST LOOP */
6800 NULL, /* OPEN UE TEST LOOP COMPLETE */
6801 dtap_tp_epc_activate_test_mode, /* ACTIVATE TEST MODE */
6802 NULL, /* ACTIVATE TEST MODE COMPLETE */
6803 NULL, /* DEACTIVATE TEST MODE */
6804 NULL, /* DEACTIVATE TEST MODE COMPLETE */
6805 dtap_tp_epc_reset_ue_positioning_stored_information, /* RESET UE POSITIONING STORED INFORMATION */
6806 NULL, /* UE TEST LOOP MODE C MBMS PACKET COUNTER REQUEST */
6807 dtap_tp_epc_test_loop_mode_c_mbms_packet_counter_response, /* UE TEST LOOP MODE C MBMS PACKET COUNTER RESPONSE */
6808 dtap_tp_epc_update_ue_location_information, /* UPDATE UE LOCATION INFORMATION */
6809 NULL, /* UE TEST LOOP PROSE PACKET COUNTER REQUEST */
6810 NULL, /* UE TEST LOOP PROSE PACKET COUNTER RESPONSE */
6811 NULL, /* UE TEST LOOP MODE F SCPTM PACKET COUNTER REQUEST */
6812 NULL, /* UE TEST LOOP MODE F SCPTM PACKET COUNTER RESPONSE */
6813 NULL, /* NONE */
6816 /* GENERIC DISSECTOR FUNCTIONS */
6818 static int
6819 dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
6821 static gsm_a_tap_rec_t tap_rec[4];
6822 static gsm_a_tap_rec_t *tap_p;
6823 static unsigned tap_current = 0;
6825 void (*dtap_msg_fcn)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len);
6827 uint8_t oct;
6828 uint8_t pd;
6829 uint32_t offset;
6830 uint32_t len;
6831 uint32_t oct_1;
6832 int idx;
6833 proto_item *dtap_item = NULL;
6834 proto_tree *dtap_tree = NULL;
6835 proto_item *oct_1_item = NULL;
6836 proto_tree *pd_tree = NULL;
6837 const char *msg_str;
6838 int ett_tree;
6839 int ti;
6840 int hf_idx;
6841 bool nsd;
6842 sccp_msg_info_t* sccp_msg = (sccp_msg_info_t*)data;
6845 len = tvb_reported_length(tvb);
6847 if (len < 2)
6850 * too short to be DTAP
6852 call_data_dissector(tvb, pinfo, tree);
6853 return len;
6856 col_append_str(pinfo->cinfo, COL_INFO, "(DTAP) ");
6859 * set tap record pointer
6861 tap_current++;
6862 if (tap_current >= 4)
6864 tap_current = 0;
6866 tap_p = &tap_rec[tap_current];
6869 offset = 0;
6871 g_tree = tree;
6874 * get protocol discriminator
6876 oct_1 = tvb_get_uint8(tvb, offset++);
6878 if ((((oct_1 & DTAP_TI_MASK) >> 4) & DTAP_TIE_PRES_MASK) == DTAP_TIE_PRES_MASK)
6880 if (len == 2) {
6881 proto_tree_add_expert(tree, pinfo, &ei_gsm_a_dtap_ti_not_valid, tvb, offset, 1);
6882 return len;
6885 * even though we don't know if a TI should be in the message yet
6886 * we rely on the TI/SKIP indicator to be 0 to avoid taking this
6887 * octet
6889 offset++;
6892 oct = tvb_get_uint8(tvb, offset);
6894 pd = oct_1 & DTAP_PD_MASK;
6895 ti = -1;
6896 msg_str = NULL;
6897 ett_tree = -1;
6898 hf_idx = -1;
6899 dtap_msg_fcn = NULL;
6900 nsd = false;
6901 col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ",val_to_str_const(pd,gsm_a_pd_short_str_vals,"unknown"));
6904 * octet 1
6906 /* Initialize hf_idx, ett_tree and dtap_msg_fcn.
6907 ett_tree and dtap_msg_fcn will not be used if msg_str == NULL. */
6908 switch (pd)
6910 case 0:
6911 msg_str = try_val_to_str_idx((uint32_t) (oct & DTAP_GCC_IEI_MASK), gsm_a_dtap_msg_gcc_strings, &idx);
6912 if (msg_str != NULL)
6914 ett_tree = ett_gsm_dtap_msg_gcc[idx];
6915 dtap_msg_fcn = dtap_msg_gcc[idx];
6917 hf_idx = hf_gsm_a_dtap_msg_gcc_type;
6918 ti = (oct_1 & DTAP_TI_MASK) >> 4;
6919 nsd = true;
6920 break;
6921 case 1:
6922 msg_str = try_val_to_str_idx((uint32_t) (oct & DTAP_BCC_IEI_MASK), gsm_a_dtap_msg_bcc_strings, &idx);
6923 if (msg_str != NULL)
6925 ett_tree = ett_gsm_dtap_msg_bcc[idx];
6926 dtap_msg_fcn = dtap_msg_bcc[idx];
6928 hf_idx = hf_gsm_a_dtap_msg_bcc_type;
6929 ti = (oct_1 & DTAP_TI_MASK) >> 4;
6930 nsd = true;
6931 break;
6932 case 3:
6933 msg_str = try_val_to_str_idx((uint32_t) (oct & DTAP_CC_IEI_MASK), gsm_a_dtap_msg_cc_strings, &idx);
6934 if (msg_str != NULL)
6936 ett_tree = ett_gsm_dtap_msg_cc[idx];
6937 dtap_msg_fcn = dtap_msg_cc_fcn[idx];
6939 hf_idx = hf_gsm_a_dtap_msg_cc_type;
6940 ti = (oct_1 & DTAP_TI_MASK) >> 4;
6941 nsd = true;
6942 break;
6944 case 5:
6945 msg_str = try_val_to_str_idx((uint32_t) (oct & DTAP_MM_IEI_MASK), gsm_a_dtap_msg_mm_strings, &idx);
6946 if (msg_str != NULL)
6948 ett_tree = ett_gsm_dtap_msg_mm[idx];
6949 dtap_msg_fcn = dtap_msg_mm_fcn[idx];
6951 hf_idx = hf_gsm_a_dtap_msg_mm_type;
6952 nsd = true;
6953 break;
6955 case 6:
6956 get_rr_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &dtap_msg_fcn);
6957 break;
6959 case 8:
6960 get_gmm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &dtap_msg_fcn);
6961 break;
6963 case 9:
6964 msg_str = try_val_to_str_idx((uint32_t) (oct & DTAP_SMS_IEI_MASK), gsm_a_dtap_msg_sms_strings, &idx);
6965 hf_idx = hf_gsm_a_dtap_msg_sms_type;
6966 if (msg_str != NULL)
6968 ett_tree = ett_gsm_dtap_msg_sms[idx];
6969 dtap_msg_fcn = dtap_msg_sms_fcn[idx];
6971 ti = (oct_1 & DTAP_TI_MASK) >> 4;
6972 break;
6974 case 10:
6975 get_sm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &dtap_msg_fcn);
6976 ti = (oct_1 & DTAP_TI_MASK) >> 4;
6977 break;
6979 case 11:
6980 msg_str = try_val_to_str_idx((uint32_t) (oct & DTAP_SS_IEI_MASK), gsm_a_dtap_msg_ss_strings, &idx);
6981 hf_idx = hf_gsm_a_dtap_msg_ss_type;
6982 if (msg_str != NULL)
6984 ett_tree = ett_gsm_dtap_msg_ss[idx];
6985 dtap_msg_fcn = dtap_msg_ss_fcn[idx];
6987 ti = (oct_1 & DTAP_TI_MASK) >> 4;
6988 nsd = true;
6989 break;
6991 case 15:
6992 msg_str = try_val_to_str_idx((uint32_t) (oct & DTAP_TP_IEI_MASK), gsm_a_dtap_msg_tp_strings, &idx);
6993 hf_idx = hf_gsm_a_dtap_msg_tp_type;
6994 if (msg_str != NULL)
6996 ett_tree = ett_gsm_dtap_msg_tp[idx];
6997 dtap_msg_fcn = dtap_msg_tp_fcn[idx];
6999 nsd = true;
7000 break;
7002 default:
7003 /* XXX - hf_idx is still -1! this is a bug in the implementation, and I don't know how to fix it so simple return here */
7004 return len;
7007 if (sccp_msg && sccp_msg->data.co.assoc) {
7008 sccp_assoc = sccp_msg->data.co.assoc;
7010 else
7012 sccp_assoc = NULL;
7013 sccp_msg = NULL;
7017 * create the protocol tree
7019 if (msg_str == NULL)
7021 dtap_item =
7022 proto_tree_add_protocol_format(tree, proto_a_dtap, tvb, 0, len,
7023 "GSM A-I/F DTAP - Unknown DTAP Message Type (0x%02x)",
7024 oct);
7026 dtap_tree = proto_item_add_subtree(dtap_item, ett_dtap_msg);
7028 if (sccp_msg && !sccp_msg->data.co.label) {
7029 sccp_msg->data.co.label = wmem_strdup_printf(wmem_file_scope(), "DTAP (0x%02x)",oct);
7034 else
7036 dtap_item =
7037 proto_tree_add_protocol_format(tree, proto_a_dtap, tvb, 0, -1,
7038 "GSM A-I/F DTAP - %s",
7039 msg_str);
7041 dtap_tree = proto_item_add_subtree(dtap_item, ett_tree);
7043 if (sccp_msg && !sccp_msg->data.co.label) {
7044 sccp_msg->data.co.label = wmem_strdup(wmem_file_scope(), msg_str);
7047 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
7048 col_set_fence(pinfo->cinfo, COL_INFO);
7051 oct_1_item = proto_tree_add_uint(dtap_tree, hf_gsm_a_dtap_protocol_discriminator, tvb, 0, 1, pd);
7052 pd_tree = proto_item_add_subtree(oct_1_item, ett_dtap_oct_1);
7054 proto_tree_add_item(pd_tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, ENC_BIG_ENDIAN);
7056 if (ti == -1)
7058 proto_tree_add_item(pd_tree, hf_gsm_a_skip_ind, tvb, 0, 1, ENC_BIG_ENDIAN);
7060 else
7063 proto_tree_add_item(pd_tree, hf_gsm_a_dtap_ti_flag, tvb, 0, 1, ENC_NA);
7065 if ((ti & DTAP_TIE_PRES_MASK) == DTAP_TIE_PRES_MASK)
7067 /* ti is extended to next octet */
7068 proto_tree_add_uint_format_value(pd_tree, hf_gsm_a_dtap_tio, tvb, 0, 1,
7069 oct_1, "The TI value is given by the TIE in octet 2");
7071 else
7073 proto_tree_add_item(pd_tree, hf_gsm_a_dtap_tio, tvb, 0, 1, ENC_BIG_ENDIAN);
7077 if ((ti != -1) &&
7078 (ti & DTAP_TIE_PRES_MASK) == DTAP_TIE_PRES_MASK)
7080 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, 1, 1, ENC_BIG_ENDIAN);
7081 proto_tree_add_item(pd_tree, hf_gsm_a_dtap_tie, tvb, 1, 1, ENC_BIG_ENDIAN);
7085 * N(SD)
7087 if ((pinfo->p2p_dir == P2P_DIR_RECV) &&
7088 nsd)
7090 /* XXX */
7092 /* 3GPP TS 24.008 version 8.5.0 Release 8
7093 * Bits 5 to 8 of the first octet of every message belonging to the protocols "Call Control;
7094 * call related SS messages" and "Session Management"contain the transaction identifier (TI).
7095 * The transaction identifier and its use are defined in 3GPP TS 24.007 [20].
7096 * 5 = Mobility Management messages
7097 * 3 = Call Control; call related SS messages
7098 * 10 = GPRS session management messages
7099 * 11 = Non call related SS messages
7101 if ((pd == 5) || (pd == 3) || (pd == 10) || (pd == 11)) {
7102 proto_tree_add_item(dtap_tree, hf_gsm_a_seq_no, tvb, offset, 1, ENC_BIG_ENDIAN);
7105 * add DTAP message name
7107 proto_tree_add_item(dtap_tree, hf_idx, tvb, offset, 1, ENC_BIG_ENDIAN);
7108 offset++;
7110 tap_p->pdu_type = GSM_A_PDU_TYPE_DTAP;
7111 tap_p->message_type = (nsd ? (oct & 0x3f) : oct);
7112 tap_p->protocol_disc = (gsm_a_pd_str_e)pd;
7114 tap_queue_packet(gsm_a_tap, pinfo, tap_p);
7116 if (msg_str == NULL) return len;
7119 * decode elements
7121 if (dtap_msg_fcn == NULL)
7123 if (offset < len)
7125 proto_tree_add_item(dtap_tree, hf_gsm_a_dtap_message_elements, tvb, offset, len - offset, ENC_NA);
7128 else
7130 (*dtap_msg_fcn)(tvb, dtap_tree, pinfo, offset, len - offset);
7133 sccp_assoc = NULL;
7135 return len;
7139 /* Register the protocol with Wireshark */
7140 void
7141 proto_register_gsm_a_dtap(void)
7143 unsigned i;
7144 unsigned last_offset;
7146 /* Setup list of header fields */
7148 static hf_register_info hf[] = {
7149 { &hf_gsm_a_seq_no,
7150 { "Sequence number", "gsm_a.dtap.seq_no",
7151 FT_UINT8, BASE_DEC, NULL, 0xc0,
7152 NULL, HFILL }
7154 { &hf_gsm_a_dtap_msg_gcc_type,
7155 { "DTAP Group Call Control Message Type", "gsm_a.dtap.msg_gcc_type",
7156 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_gcc_strings), 0x3f,
7157 NULL, HFILL }
7159 { &hf_gsm_a_dtap_msg_bcc_type,
7160 { "DTAP Broadcast Call Control Message Type", "gsm_a.dtap.msg_bcc_type",
7161 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_bcc_strings), 0x3f,
7162 NULL, HFILL }
7164 { &hf_gsm_a_dtap_msg_mm_type,
7165 { "DTAP Mobility Management Message Type", "gsm_a.dtap.msg_mm_type",
7166 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_mm_strings), 0x3f,
7167 NULL, HFILL }
7169 { &hf_gsm_a_dtap_msg_cc_type,
7170 { "DTAP Call Control Message Type", "gsm_a.dtap.msg_cc_type",
7171 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_cc_strings), 0x3f,
7172 NULL, HFILL }
7174 { &hf_gsm_a_dtap_msg_sms_type,
7175 { "DTAP Short Message Service Message Type", "gsm_a.dtap.msg_sms_type",
7176 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_sms_strings), 0x0,
7177 NULL, HFILL }
7179 { &hf_gsm_a_dtap_msg_ss_type,
7180 { "DTAP Non call Supplementary Service Message Type", "gsm_a.dtap.msg_ss_type",
7181 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_ss_strings), 0x3f,
7182 NULL, HFILL }
7184 { &hf_gsm_a_dtap_msg_tp_type,
7185 { "DTAP Tests Procedures Message Type", "gsm_a.dtap.msg_tp_type",
7186 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_tp_strings), 0x0,
7187 NULL, HFILL }
7189 { &hf_gsm_a_dtap_elem_id,
7190 { "Element ID", "gsm_a.dtap.elem_id",
7191 FT_UINT8, BASE_HEX, NULL, 0,
7192 NULL, HFILL }
7194 { &hf_gsm_a_dtap_cld_party_bcd_num,
7195 { "Called Party BCD Number", "gsm_a.dtap.cld_party_bcd_num",
7196 FT_STRING, BASE_NONE, 0, 0,
7197 NULL, HFILL }
7199 { &hf_gsm_a_dtap_clg_party_bcd_num,
7200 { "Calling Party BCD Number", "gsm_a.dtap.clg_party_bcd_num",
7201 FT_STRING, BASE_NONE, 0, 0,
7202 NULL, HFILL }
7204 { &hf_gsm_a_dtap_conn_num,
7205 { "Connected Number", "gsm_a.dtap.conn_num",
7206 FT_STRING, BASE_NONE, 0, 0,
7207 NULL, HFILL }
7209 { &hf_gsm_a_dtap_red_party_bcd_num,
7210 { "Redirecting Party BCD Number", "gsm_a.dtap.red_party_bcd_num",
7211 FT_STRING, BASE_NONE, 0, 0,
7212 NULL, HFILL }
7214 { &hf_gsm_a_dtap_cause,
7215 { "DTAP Cause", "gsm_a.dtap.cause",
7216 FT_UINT8, BASE_HEX, 0, 0x7f,
7217 NULL, HFILL }
7219 { &hf_gsm_a_dtap_type_of_number,
7220 { "Type of number", "gsm_a.dtap.type_of_number",
7221 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_type_of_number_values), 0x70,
7222 NULL, HFILL }
7224 { &hf_gsm_a_dtap_numbering_plan_id,
7225 { "Numbering plan identification", "gsm_a.dtap.numbering_plan_id",
7226 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_numbering_plan_id_values), 0x0f,
7227 NULL, HFILL }
7229 { &hf_gsm_a_dtap_present_ind,
7230 { "Presentation indicator", "gsm_a.dtap.present_ind",
7231 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_present_ind_values), 0x60,
7232 NULL, HFILL }
7234 { &hf_gsm_a_dtap_screening_ind,
7235 { "Screening indicator", "gsm_a.dtap.screening_ind",
7236 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_screening_ind_values), 0x03,
7237 NULL, HFILL }
7239 { &hf_gsm_a_dtap_type_of_sub_addr,
7240 { "Type of subaddress", "gsm_a.dtap.type_of_sub_addr",
7241 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_type_of_sub_addr_values), 0x70,
7242 NULL, HFILL }
7244 { &hf_gsm_a_dtap_odd_even_ind,
7245 { "Odd/even indicator", "gsm_a.dtap.odd_even_ind",
7246 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_odd_even_ind_values), 0x08,
7247 NULL, HFILL }
7249 { &hf_gsm_a_dtap_lsa_id,
7250 { "LSA Identifier", "gsm_a.dtap.lsa_id",
7251 FT_UINT24, BASE_HEX, NULL, 0x0,
7252 NULL, HFILL }
7254 { &hf_gsm_a_dtap_speech_vers_ind,
7255 { "Speech version indication", "gsm_a.dtap.speech_vers_ind",
7256 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_speech_vers_ind_values), 0x0f,
7257 NULL, HFILL }
7259 { &hf_gsm_a_dtap_itc,
7260 { "Information transfer capability", "gsm_a.dtap.itc",
7261 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_itc_values), 0x07,
7262 NULL, HFILL }
7264 { &hf_gsm_a_dtap_sysid,
7265 { "System Identification (SysID)", "gsm_a.dtap.sysid",
7266 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_sysid_values), 0x0,
7267 NULL, HFILL }
7269 { &hf_gsm_a_dtap_bitmap_length,
7270 { "Bitmap Length", "gsm_a.dtap.bitmap_length",
7271 FT_UINT8, BASE_DEC, NULL, 0x0,
7272 NULL, HFILL }
7274 { &hf_gsm_a_dtap_serv_cat_b7,
7275 { "Automatically initiated eCall", "gsm_a.dtap.serv_cat_b7",
7276 FT_BOOLEAN, 8, NULL, 0x40,
7277 NULL, HFILL }
7279 { &hf_gsm_a_dtap_serv_cat_b6,
7280 { "Manually initiated eCall", "gsm_a.dtap.serv_cat_b6",
7281 FT_BOOLEAN, 8, NULL, 0x20,
7282 NULL, HFILL }
7284 { &hf_gsm_a_dtap_serv_cat_b5,
7285 { "Mountain Rescue", "gsm_a.dtap.serv_cat_b5",
7286 FT_BOOLEAN, 8, NULL, 0x10,
7287 NULL, HFILL }
7289 { &hf_gsm_a_dtap_serv_cat_b4,
7290 { "Marine Guard", "gsm_a.dtap.serv_cat_b4",
7291 FT_BOOLEAN, 8, NULL, 0x08,
7292 NULL, HFILL }
7294 { &hf_gsm_a_dtap_serv_cat_b3,
7295 { "Fire Brigade", "gsm_a.dtap.serv_cat_b3",
7296 FT_BOOLEAN, 8, NULL, 0x04,
7297 NULL, HFILL }
7299 { &hf_gsm_a_dtap_serv_cat_b2,
7300 { "Ambulance", "gsm_a.dtap.serv_cat_b2",
7301 FT_BOOLEAN, 8, NULL, 0x02,
7302 NULL, HFILL }
7304 { &hf_gsm_a_dtap_serv_cat_b1,
7305 { "Police", "gsm_a.dtap.serv_cat_b1",
7306 FT_BOOLEAN, 8, NULL, 0x01,
7307 NULL, HFILL }
7309 { &hf_gsm_a_dtap_drvcc,
7310 { "DRVCC", "gsm_a.dtap.drvcc",
7311 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_dtap_drvcc_value), 0x0,
7312 NULL, HFILL }
7314 { &hf_gsm_a_dtap_csmo,
7315 { "CSMO", "gsm_a.dtap.csmo",
7316 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_dtap_csmo_value), 0x0,
7317 NULL, HFILL }
7319 { &hf_gsm_a_dtap_csmt,
7320 { "CSMT", "gsm_a.dtap.csmt",
7321 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_dtap_csmt_value), 0x0,
7322 NULL, HFILL }
7324 { &hf_gsm_a_dtap_mm_timer_unit,
7325 { "Unit", "gsm_a.dtap.mm_timer_unit",
7326 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_mm_timer_unit_vals), 0xe0,
7327 NULL, HFILL }
7329 { &hf_gsm_a_dtap_mm_timer_value,
7330 { "Timer value", "gsm_a.dtap.mm_timer_value",
7331 FT_UINT8, BASE_DEC, NULL, 0x1f,
7332 NULL, HFILL }
7334 { &hf_gsm_a_dtap_alerting_pattern,
7335 { "Alerting Pattern", "gsm_a.dtap.alerting_pattern",
7336 FT_UINT8, BASE_DEC, VALS(gsm_a_alerting_pattern_vals), 0x0f,
7337 NULL, HFILL }
7339 { &hf_gsm_a_dtap_ccbs_activation,
7340 { "CCBS Activation", "gsm_a.dtap.ccbs_activation",
7341 FT_BOOLEAN, 8, TFS(&gsm_a_ccbs_activation_value), 0x80,
7342 NULL, HFILL }
7344 { &hf_gsm_a_dtap_stream_identifier,
7345 { "Stream Identifier", "gsm_a.dtap.stream_identifier",
7346 FT_UINT8, BASE_HEX, 0, 0x0,
7347 NULL, HFILL }
7349 { &hf_gsm_a_dtap_mcs,
7350 { "MCS", "gsm_a.dtap.mcs",
7351 FT_BOOLEAN, 8, TFS(&gsm_a_mcs_value), 0x01,
7352 NULL, HFILL }
7354 { &hf_gsm_a_dtap_cause_of_no_cli,
7355 { "Cause of no CLI", "gsm_a.dtap.cause_of_no_cli",
7356 FT_UINT8, BASE_HEX, 0, 0x0,
7357 NULL, HFILL }
7359 { &hf_gsm_a_dtap_cause_ss_diagnostics,
7360 { "Supplementary Services Diagnostics", "gsm_a.dtap.cause_ss_diagnostics",
7361 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_cause_ss_diagnostics_vals), 0x7f,
7362 NULL, HFILL }
7364 { &hf_gsm_a_dtap_codec_tdma_efr,
7365 { "TDMA EFR", "gsm_a.dtap.codec.tdma_efr",
7366 FT_BOOLEAN, 8, NULL, 0x80,
7367 NULL, HFILL }
7369 { &hf_gsm_a_dtap_codec_umts_amr_2,
7370 { "UMTS AMR 2", "gsm_a.dtap.codec.umts_amr_2",
7371 FT_BOOLEAN, 8, NULL, 0x40,
7372 NULL, HFILL }
7374 { &hf_gsm_a_dtap_codec_umts_amr,
7375 { "UMTS AMR", "gsm_a.dtap.codec.umts_amr",
7376 FT_BOOLEAN, 8, NULL, 0x20,
7377 NULL, HFILL }
7379 { &hf_gsm_a_dtap_codec_hr_amr,
7380 { "HR AMR", "gsm_a.dtap.codec.hr_amr",
7381 FT_BOOLEAN, 8, NULL, 0x10,
7382 NULL, HFILL }
7384 { &hf_gsm_a_dtap_codec_fr_amr,
7385 { "FR AMR", "gsm_a.dtap.codec.fr_amr",
7386 FT_BOOLEAN, 8, NULL, 0x08,
7387 NULL, HFILL }
7389 { &hf_gsm_a_dtap_codec_gsm_efr,
7390 { "GSM EFR", "gsm_a.dtap.codec.gsm_efr",
7391 FT_BOOLEAN, 8, NULL, 0x04,
7392 NULL, HFILL }
7394 { &hf_gsm_a_dtap_codec_gsm_hr,
7395 { "GSM HR", "gsm_a.dtap.codec.gsm_hr",
7396 FT_BOOLEAN, 8, NULL, 0x02,
7397 NULL, HFILL }
7399 { &hf_gsm_a_dtap_codec_gsm_fr,
7400 { "GSM FR", "gsm_a.dtap.codec.gsm_fr",
7401 FT_BOOLEAN, 8, NULL, 0x01,
7402 NULL, HFILL }
7404 { &hf_gsm_a_dtap_codec_umts_evs,
7405 { "UMTS EVS", "gsm_a.dtap.codec.umts_evs",
7406 FT_BOOLEAN, 8, NULL, 0x40,
7407 NULL, HFILL }
7409 { &hf_gsm_a_dtap_codec_ohr_amr_wb,
7410 { "OHR AMR-WB", "gsm_a.dtap.codec.ohr_amr_wb",
7411 FT_BOOLEAN, 8, NULL, 0x20,
7412 NULL, HFILL }
7414 { &hf_gsm_a_dtap_codec_ofr_amr_wb,
7415 { "OFR AMR-WB", "gsm_a.dtap.codec.ofr_amr_wb",
7416 FT_BOOLEAN, 8, NULL, 0x10,
7417 NULL, HFILL }
7419 { &hf_gsm_a_dtap_codec_ohr_amr,
7420 { "OHR AMR", "gsm_a.dtap.codec.ohr_amr",
7421 FT_BOOLEAN, 8, NULL, 0x08,
7422 NULL, HFILL }
7424 { &hf_gsm_a_dtap_codec_umts_amr_wb,
7425 { "UMTS AMR-WB", "gsm_a.dtap.codec.umts_amr_wb",
7426 FT_BOOLEAN, 8, NULL, 0x04,
7427 NULL, HFILL }
7429 { &hf_gsm_a_dtap_codec_fr_amr_wb,
7430 { "FR AMR-WB", "gsm_a.dtap.codec.fr_amr_wb",
7431 FT_BOOLEAN, 8, NULL, 0x02,
7432 NULL, HFILL }
7434 { &hf_gsm_a_dtap_codec_pdc_efr,
7435 { "PDC EFR", "gsm_a.dtap.codec.pdc_efr",
7436 FT_BOOLEAN, 8, NULL, 0x01,
7437 NULL, HFILL }
7439 { &hf_gsm_a_dtap_notification_description,
7440 { "Notification description", "gsm_a.dtap.notif_descr",
7441 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_notification_description_vals), 0x7f,
7442 NULL, HFILL }
7444 { &hf_gsm_a_dtap_emerg_num_info_length,
7445 { "Emergency Number Info length", "gsm_a.dtap.emerg_num_info_length",
7446 FT_UINT8, BASE_DEC, 0, 0x0,
7447 NULL, HFILL }
7449 { &hf_gsm_a_dtap_emergency_bcd_num,
7450 { "Emergency BCD Number", "gsm_a.dtap.emergency_bcd_num",
7451 FT_STRING, BASE_NONE, 0, 0,
7452 NULL, HFILL }
7454 { &hf_gsm_a_dtap_signal_value,
7455 { "Signal value", "gsm_a.dtap.signal_value",
7456 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_signal_value_vals), 0x0,
7457 NULL, HFILL }
7459 { &hf_gsm_a_dtap_recall_type,
7460 { "Recall type", "gsm_a.dtap.recall_type",
7461 FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(gsm_a_dtap_recall_type_vals), 0x07,
7462 NULL, HFILL }
7464 { &hf_gsm_a_dtap_coding_standard,
7465 { "Coding standard", "gsm_a.dtap.coding_standard",
7466 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_coding_standard_vals), 0xc0,
7467 NULL, HFILL }
7469 { &hf_gsm_a_dtap_call_state,
7470 { "Call state", "gsm_a.dtap.call_state",
7471 FT_UINT8, BASE_DEC, NULL, 0x3f,
7472 NULL, HFILL }
7474 { &hf_gsm_a_dtap_prog_coding_standard,
7475 { "Coding standard", "gsm_a.dtap.coding_standard",
7476 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_coding_standard_vals), 0x60,
7477 NULL, HFILL }
7479 { &hf_gsm_a_dtap_location,
7480 { "Location", "gsm_a.dtap.location",
7481 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_location_vals), 0x0f,
7482 NULL, HFILL }
7484 { &hf_gsm_a_dtap_progress_description,
7485 { "Progress description", "gsm_a.dtap.progress_description",
7486 FT_UINT8, BASE_DEC, NULL, 0x7f,
7487 NULL, HFILL }
7489 { &hf_gsm_a_dtap_afi,
7490 { "Authority and Format Identifier", "gsm_a.dtap.afi",
7491 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &x213_afi_value_ext, 0x0,
7492 NULL, HFILL }
7494 { &hf_gsm_a_dtap_rej_cause,
7495 { "Reject cause", "gsm_a.dtap.rej_cause",
7496 FT_UINT8, BASE_DEC, NULL, 0x0,
7497 NULL, HFILL }
7499 { &hf_gsm_a_dtap_timezone,
7500 { "Timezone", "gsm_a.dtap.timezone",
7501 FT_UINT8, BASE_HEX, NULL, 0x0,
7502 NULL, HFILL }
7504 { &hf_gsm_a_dtap_u2u_prot_discr,
7505 { "User-user protocol discriminator", "gsm_a.dtap.u2u_prot_discr",
7506 FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(gsm_a_dtap_u2u_prot_discr_vals), 0x00,
7507 NULL, HFILL }
7509 { &hf_gsm_a_dtap_mcat,
7510 { "MCAT", "gsm_a.dtap.mcat",
7511 FT_BOOLEAN, 8, TFS(&gsm_a_dtap_mcat_value), 0x08,
7512 NULL, HFILL }
7514 { &hf_gsm_a_dtap_enicm,
7515 { "ENICM", "gsm_a.dtap.enicm",
7516 FT_BOOLEAN, 8, TFS(&gsm_a_dtap_enicm_value), 0x04,
7517 NULL, HFILL }
7519 { &hf_gsm_a_dtap_rand,
7520 { "RAND value", "gsm_a.dtap.rand",
7521 FT_BYTES, FT_NONE, NULL, 0x00,
7522 NULL, HFILL }
7524 { &hf_gsm_a_dtap_autn,
7525 { "AUTN value", "gsm_a.dtap.autn",
7526 FT_BYTES, FT_NONE, NULL, 0x00,
7527 NULL, HFILL }
7529 { &hf_gsm_a_dtap_sres,
7530 { "SRES value", "gsm_a.dtap.sres",
7531 FT_BYTES, FT_NONE, NULL, 0x00,
7532 NULL, HFILL }
7534 { &hf_gsm_a_dtap_xres,
7535 { "XRES value", "gsm_a.dtap.xres",
7536 FT_BYTES, FT_NONE, NULL, 0x00,
7537 NULL, HFILL }
7539 { &hf_gsm_a_dtap_auts,
7540 { "AUTS value", "gsm_a.dtap.auts",
7541 FT_BYTES, FT_NONE, NULL, 0x00,
7542 NULL, HFILL }
7544 { &hf_gsm_a_dtap_autn_sqn_xor_ak,
7545 { "SQN xor AK", "gsm_a.dtap.autn.sqn_xor_ak",
7546 FT_BYTES, FT_NONE, NULL, 0x00,
7547 NULL, HFILL }
7549 { &hf_gsm_a_dtap_autn_amf,
7550 { "AMF", "gsm_a.dtap.autn.amf",
7551 FT_BYTES, FT_NONE, NULL, 0x00,
7552 NULL, HFILL }
7554 { &hf_gsm_a_dtap_autn_mac,
7555 { "MAC", "gsm_a.dtap.autn.mac",
7556 FT_BYTES, FT_NONE, NULL, 0x00,
7557 NULL, HFILL }
7559 { &hf_gsm_a_dtap_auts_sqn_ms_xor_ak,
7560 { "SQN_MS xor AK", "gsm_a.dtap.auts.sqn_ms_xor_ak",
7561 FT_BYTES, FT_NONE, NULL, 0x00,
7562 NULL, HFILL }
7564 { &hf_gsm_a_dtap_auts_mac_s,
7565 { "MAC-S", "gsm_a.dtap.auts.mac_s",
7566 FT_BYTES, FT_NONE, NULL, 0x00,
7567 NULL, HFILL }
7569 { &hf_gsm_a_dtap_epc_ue_tl_mode,
7570 { "UE test loop mode","gsm_a.dtap.epc.ue_tl_mode",
7571 FT_UINT8,BASE_DEC, VALS(epc_ue_test_loop_mode_vals), 0x0,
7572 NULL, HFILL }
7574 { &hf_gsm_a_dtap_epc_ue_tl_a_ul_sdu_size,
7575 { "Uplink PDCP SDU size in bits","gsm_a.dtap.epc.ue_tl_a_ul_sdu_size",
7576 FT_UINT16,BASE_DEC, NULL, 0x0,
7577 NULL, HFILL }
7579 { &hf_gsm_a_dtap_epc_ue_tl_a_drb,
7580 { "Data Radio Bearer identity number","gsm_a.dtap.epc.ue_tl_a_drb",
7581 FT_UINT8,BASE_DEC, NULL, 0x1f,
7582 NULL, HFILL }
7584 { &hf_gsm_a_dtap_epc_ue_tl_b_ip_pdu_delay,
7585 { "IP PDU delay in seconds","gsm_a.dtap.epc.ue_tl_b_ip_pdu_delay",
7586 FT_UINT8,BASE_DEC, NULL, 0x0,
7587 NULL, HFILL }
7589 { &hf_gsm_a_dtap_epc_ue_tl_c_mbsfn_area_id,
7590 { "MBSFN area identity","gsm_a.dtap.epc.ue_tl_c_mbsfn_area_id",
7591 FT_UINT8, BASE_DEC, NULL, 0x0,
7592 NULL, HFILL }
7594 { &hf_gsm_a_dtap_epc_ue_tl_c_mch_id,
7595 { "MCH identity","gsm_a.dtap.epc.ue_tl_c_mch_id",
7596 FT_UINT8, BASE_DEC, NULL, 0x0,
7597 NULL, HFILL }
7599 { &hf_gsm_a_dtap_epc_ue_tl_c_lcid,
7600 { "Logical channel identity","gsm_a.dtap.epc.ue_tl_c_lcid",
7601 FT_UINT8, BASE_DEC, NULL, 0x0,
7602 NULL, HFILL }
7604 { &hf_gsm_a_dtap_epc_ue_tl_d_discovery,
7605 { "Discovery","gsm_a.dtap.epc.ue_tl_d_discovery",
7606 FT_BOOLEAN, 8, TFS(&epc_ue_tl_d_discovery_value), 0x01,
7607 NULL, HFILL }
7609 { &hf_gsm_a_dtap_epc_ue_tl_d_prose_app_code,
7610 { "ProSe App Code (LSBs)","gsm_a.dtap.epc.ue_tl_d_prose_app_code",
7611 FT_UINT16, BASE_DEC, NULL, 0x0,
7612 NULL, HFILL }
7614 { &hf_gsm_a_dtap_epc_ue_tl_e_communication,
7615 { "Communication","gsm_a.dtap.epc.ue_tl_e_communication",
7616 FT_BOOLEAN, 8, TFS(&epc_ue_tl_e_communication_value), 0x01,
7617 NULL, HFILL }
7619 { &hf_gsm_a_dtap_epc_ue_tl_e_group_destination_id,
7620 { "Group Destination ID","gsm_a.dtap.epc.ue_tl_e_group_destination_id",
7621 FT_UINT8, BASE_DEC, NULL, 0x0,
7622 NULL, HFILL }
7624 { &hf_gsm_a_dtap_epc_ue_tl_f_sc_mtch_id,
7625 { "SC-MTCH ID","gsm_a.dtap.epc.ue_tl_f_sc_mtch_id",
7626 FT_UINT16, BASE_DEC, NULL, 0x0,
7627 NULL, HFILL }
7629 { &hf_gsm_a_dtap_epc_ue_tl_gh_ul_loopback_op_mode,
7630 { "Uplink loopback operation mode","gsm_a.dtap.epc.ue_tl_gh_ul_loopback_op_mode",
7631 FT_BOOLEAN, BASE_NONE, TFS(&epc_ue_tl_gh_communication_value), 0x0,
7632 NULL, HFILL }
7634 { &hf_gsm_a_dtap_epc_ue_tl_gh_repetitions,
7635 { "Repetitions","gsm_a.dtap.epc.ue_tl_gh_repetitions",
7636 FT_UINT8, BASE_DEC, NULL, 0x0,
7637 NULL, HFILL }
7639 { &hf_gsm_a_dtap_epc_ue_tl_gh_ul_data_delay,
7640 { "Uplink data delay","gsm_a.dtap.epc.ue_tl_gh_ul_data_delay",
7641 FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_seconds), 0x0,
7642 NULL, HFILL }
7644 { &hf_gsm_a_dtap_epc_ue_positioning_technology,
7645 { "UE positioning technology","gsm_a.dtap.epc.ue_positioning_technology",
7646 FT_UINT8, BASE_DEC, VALS(epc_ue_positioning_technology_vals), 0x0,
7647 NULL, HFILL }
7649 { &hf_gsm_a_dtap_epc_mbms_packet_counter_value,
7650 { "MBMS packet counter value","gsm_a.dtap.epc.mbms_packet_counter_value",
7651 FT_UINT32, BASE_DEC, NULL, 0x0,
7652 NULL, HFILL }
7654 { &hf_gsm_a_dtap_epc_latitude_sign,
7655 { "Latitude Sign","gsm_a.dtap.epc.latitude_sign",
7656 FT_BOOLEAN, BASE_NONE, TFS(&epc_latitude_sign_value), 0x0,
7657 NULL, HFILL }
7659 { &hf_gsm_a_dtap_epc_degrees_latitude,
7660 { "Degrees Latitude","gsm_a.dtap.epc.degrees_latitude",
7661 FT_UINT24, BASE_DEC, NULL, 0x0,
7662 NULL, HFILL }
7664 { &hf_gsm_a_dtap_epc_degrees_longitude,
7665 { "Degrees Longitude","gsm_a.dtap.epc.degrees_longitude",
7666 FT_INT24, BASE_DEC, NULL, 0x0,
7667 NULL, HFILL }
7669 { &hf_gsm_a_dtap_epc_altitude_dir,
7670 { "Altitude Direction","gsm_a.dtap.epc.altitude_direction",
7671 FT_BOOLEAN, BASE_NONE, TFS(&epc_altitude_dir_value), 0x0,
7672 NULL, HFILL }
7674 { &hf_gsm_a_dtap_epc_altitude,
7675 { "Altitude","gsm_a.dtap.epc.altitude",
7676 FT_UINT16, BASE_DEC, NULL, 0x0,
7677 NULL, HFILL }
7679 { &hf_gsm_a_dtap_epc_bearing,
7680 { "Bearing","gsm_a.dtap.epc.bearing",
7681 FT_UINT16, BASE_DEC, NULL, 0x0,
7682 NULL, HFILL }
7684 { &hf_gsm_a_dtap_epc_horizontal_speed,
7685 { "Horizontal Speed","gsm_a.dtap.epc.horizontal_speed",
7686 FT_UINT16, BASE_DEC, NULL, 0x0,
7687 NULL, HFILL }
7689 { &hf_gsm_a_dtap_epc_gnss_tod_msec,
7690 { "GNSS-TOD-msec","gsm_a.dtap.epc.gnss_tod_msec",
7691 FT_UINT24, BASE_DEC, NULL, 0x0,
7692 NULL, HFILL }
7694 { &hf_gsm_a_dtap_gcc_call_ref,
7695 { "Call Reference", "gsm_a.dtap.gcc.call_ref",
7696 FT_UINT32, BASE_DEC, NULL, 0xffffffe0,
7697 NULL, HFILL }
7699 { &hf_gsm_a_dtap_gcc_call_ref_has_priority,
7700 { "Call Reference includes priority", "gsm_a.dtap.gcc.call_ref_has_priority",
7701 FT_BOOLEAN, 32, NULL, 0x00000010,
7702 NULL, HFILL }
7704 { &hf_gsm_a_dtap_gcc_call_priority,
7705 { "Call Priority", "gsm_a.dtap.gcc.call_priority",
7706 FT_UINT32, BASE_DEC, VALS(gcc_call_ref_priority), 0x0000000e,
7707 NULL, HFILL }
7709 { &hf_gsm_a_dtap_gcc_call_state,
7710 { "Call state", "gsm_a.dtap.gcc.call_state",
7711 FT_UINT24, BASE_DEC, VALS(gcc_call_state_vals), 0x0,
7712 NULL, HFILL }
7714 { &hf_gsm_a_dtap_gcc_cause_structure,
7715 { "Cause structure", "gsm_a.dtap.gcc.cause_structure",
7716 FT_BOOLEAN, 8, TFS(&gcc_cause_structure_val), 0x80,
7717 NULL, HFILL }
7719 { &hf_gsm_a_dtap_gcc_cause,
7720 { "Cause", "gsm_a.dtap.gcc.cause",
7721 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gcc_cause_vals), 0x7f,
7722 NULL, HFILL }
7724 { &hf_gsm_a_dtap_gcc_orig_ind,
7725 { "Originator indication", "gsm_a.dtap.gcc.orig_ind",
7726 FT_BOOLEAN, 8, TFS(&gcc_orig_ind_vals), 0x01,
7727 NULL, HFILL }
7729 { &hf_gsm_a_dtap_gcc_state_attr,
7730 { "State attributes", "gsm_a.dtap.gcc.state_attr",
7731 FT_UINT8, BASE_HEX, NULL, 0x0,
7732 NULL, HFILL }
7734 { &hf_gsm_a_dtap_gcc_state_attr_da,
7735 { "DA", "gsm_a.dtap.gcc.state_attr_da",
7736 FT_BOOLEAN, 8, TFS(&gcc_state_attr_da), 0x08,
7737 NULL, HFILL }
7739 { &hf_gsm_a_dtap_gcc_state_attr_ua,
7740 { "UA", "gsm_a.dtap.gcc.state_attr_ua",
7741 FT_BOOLEAN, 8, TFS(&gcc_state_attr_ua), 0x04,
7742 NULL, HFILL }
7744 { &hf_gsm_a_dtap_gcc_state_attr_comm,
7745 { "COMM", "gsm_a.dtap.gcc.state_attr_comm",
7746 FT_BOOLEAN, 8, TFS(&gcc_state_attr_comm), 0x02,
7747 NULL, HFILL }
7749 { &hf_gsm_a_dtap_gcc_state_attr_oi,
7750 { "OI", "gsm_a.dtap.gcc.state_attr_oi",
7751 FT_BOOLEAN, 8, TFS(&gcc_state_attr_oi), 0x01,
7752 NULL, HFILL }
7754 { &hf_gsm_a_dtap_gcc_spare_1,
7755 { "Spare_1 (This field shall be ignored)", "gsm_a.dtap.gcc.spare_1",
7756 FT_UINT32, BASE_DEC, NULL, 0x00000001,
7757 NULL, HFILL }
7759 { &hf_gsm_a_dtap_gcc_spare_3,
7760 { "Spare_3 (This field shall be ignored)", "gsm_a.dtap.gcc.spare_3",
7761 FT_UINT8, BASE_DEC, NULL, 0x0e,
7762 NULL, HFILL }
7764 { &hf_gsm_a_dtap_gcc_spare_4,
7765 { "Spare_4 (This field shall be ignored)", "gsm_a.dtap.gcc.spare_4",
7766 FT_UINT32, BASE_DEC, NULL, 0x00000010,
7767 NULL, HFILL }
7769 { &hf_gsm_a_dtap_bcc_call_ref,
7770 { "Call Reference", "gsm_a.dtap.bcc.call_ref",
7771 FT_UINT32, BASE_DEC, NULL, 0xffffffe0,
7772 NULL, HFILL }
7774 { &hf_gsm_a_dtap_bcc_call_ref_has_priority,
7775 { "Call Reference includes priority", "gsm_a.dtap.bcc.call_ref_has_priority",
7776 FT_BOOLEAN, 32, NULL, 0x00000010,
7777 NULL, HFILL }
7779 { &hf_gsm_a_dtap_bcc_call_priority,
7780 { "Call Priority", "gsm_a.dtap.bcc.call_priority",
7781 FT_UINT32, BASE_DEC, VALS(bcc_call_ref_priority), 0x0000000e,
7782 NULL, HFILL }
7784 { &hf_gsm_a_dtap_bcc_call_state,
7785 { "Call state", "gsm_a.dtap.bcc.call_state",
7786 FT_UINT24, BASE_DEC|BASE_RANGE_STRING, RVALS(bcc_call_state_vals), 0x0,
7787 NULL, HFILL }
7789 { &hf_gsm_a_dtap_bcc_cause_structure,
7790 { "Cause structure", "gsm_a.dtap.bcc.cause_structure",
7791 FT_BOOLEAN, 8, TFS(&bcc_cause_structure_val), 0x80,
7792 NULL, HFILL }
7794 { &hf_gsm_a_dtap_bcc_cause,
7795 { "Cause", "gsm_a.dtap.bcc.cause",
7796 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(bcc_cause_vals), 0x7f,
7797 NULL, HFILL }
7799 { &hf_gsm_a_dtap_bcc_orig_ind,
7800 { "Originator indication", "gsm_a.dtap.bcc.orig_ind",
7801 FT_BOOLEAN, 8, TFS(&bcc_orig_ind_vals), 0x01,
7802 NULL, HFILL }
7804 { &hf_gsm_a_dtap_bcc_state_attr,
7805 { "State attributes", "gsm_a.dtap.bcc.state_attr",
7806 FT_UINT8, BASE_HEX, NULL, 0x0,
7807 NULL, HFILL }
7809 { &hf_gsm_a_dtap_bcc_state_attr_da,
7810 { "DA", "gsm_a.dtap.bcc.state_attr_da",
7811 FT_BOOLEAN, 8, TFS(&bcc_state_attr_da), 0x08,
7812 NULL, HFILL }
7814 { &hf_gsm_a_dtap_bcc_state_attr_ua,
7815 { "UA", "gsm_a.dtap.bcc.state_attr_ua",
7816 FT_BOOLEAN, 8, TFS(&bcc_state_attr_ua), 0x04,
7817 NULL, HFILL }
7819 { &hf_gsm_a_dtap_bcc_state_attr_comm,
7820 { "COMM", "gsm_a.dtap.bcc.state_attr_comm",
7821 FT_BOOLEAN, 8, TFS(&bcc_state_attr_comm), 0x02,
7822 NULL, HFILL }
7824 { &hf_gsm_a_dtap_bcc_state_attr_oi,
7825 { "OI", "gsm_a.dtap.bcc.state_attr_oi",
7826 FT_BOOLEAN, 8, TFS(&bcc_state_attr_oi), 0x01,
7827 NULL, HFILL }
7829 { &hf_gsm_a_dtap_bcc_compr_otdi,
7830 { "Compressed otdi", "gsm_a.dtap.bcc.compr_otdi",
7831 FT_BYTES, BASE_NONE, NULL, 0x0,
7832 NULL, HFILL }
7834 { &hf_gsm_a_dtap_bcc_spare_1,
7835 { "Spare_1 (This field shall be ignored)", "gsm_a.dtap.bcc.spare_1",
7836 FT_UINT32, BASE_DEC, NULL, 0x00000001,
7837 NULL, HFILL }
7839 { &hf_gsm_a_dtap_bcc_spare_3,
7840 { "Spare_3 (This field shall be ignored)", "gsm_a.dtap.bcc.spare_3",
7841 FT_UINT8, BASE_DEC, NULL, 0x0e,
7842 NULL, HFILL }
7844 { &hf_gsm_a_dtap_bcc_spare_4,
7845 { "Spare_4 (This field shall be ignored)", "gsm_a.dtap.bcc.spare_4",
7846 FT_UINT32, BASE_DEC, NULL, 0x00000010,
7847 NULL, HFILL }
7849 /* Generated from convert_proto_tree_add_text.pl */
7850 { &hf_gsm_a_dtap_coding_scheme,
7851 { "Coding Scheme", "gsm_a.dtap.coding_scheme",
7852 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_coding_scheme_vals), 0x70,
7853 NULL, HFILL }
7855 { &hf_gsm_a_dtap_add_ci,
7856 { "Add CI", "gsm_a.dtap.add_ci",
7857 FT_BOOLEAN, 8, TFS(&tfs_add_ci), 0x08,
7858 NULL, HFILL }
7860 { &hf_gsm_a_dtap_number_of_spare_bits,
7861 { "Number of spare bits in last octet", "gsm_a.dtap.number_of_spare_bits",
7862 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_number_of_spare_bits_vals), 0x07,
7863 NULL, HFILL }
7865 { &hf_gsm_a_dtap_text_string,
7866 { "Text String", "gsm_a.dtap.text_string",
7867 FT_STRING, BASE_NONE, NULL, 0x0,
7868 NULL, HFILL }
7870 { &hf_gsm_a_dtap_time_zone_time,
7871 { "Time", "gsm_a.dtap.time_zone_time",
7872 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0,
7873 NULL, HFILL }
7875 { &hf_gsm_a_dtap_dst_adjustment,
7876 { "DST Adjustment", "gsm_a.dtap.dst_adjustment",
7877 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_dst_adjustment_vals), 0x03,
7878 NULL, HFILL }
7880 { &hf_gsm_a_dtap_emergency_number_information,
7881 { "Emergency Number Information", "gsm_a.dtap.emergency_number_information",
7882 FT_UINT32, BASE_DEC, NULL, 0x0,
7883 NULL, HFILL }
7885 { &hf_gsm_a_dtap_mm_timer,
7886 { "MM Timer", "gsm_a.dtap.mm_timer",
7887 FT_UINT8, BASE_DEC, NULL, 0,
7888 NULL, HFILL }
7890 { &hf_gsm_a_dtap_hold_auxiliary_state,
7891 { "Hold auxiliary state", "gsm_a.dtap.hold_auxiliary_state",
7892 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_hold_auxiliary_state_vals), 0x0C,
7893 NULL, HFILL }
7895 { &hf_gsm_a_dtap_multi_party_auxiliary_state,
7896 { "Multi party auxiliary state", "gsm_a.dtap.multi_party_auxiliary_state",
7897 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_multi_party_auxiliary_state_vals), 0x03,
7898 NULL, HFILL }
7900 { &hf_gsm_a_dtap_radio_channel_requirement,
7901 { "Radio channel requirement", "gsm_a.dtap.radio_channel_requirement",
7902 FT_UINT8, BASE_DEC, NULL, 0x60,
7903 NULL, HFILL }
7905 { &hf_gsm_a_dtap_bearer_cap_coding_standard,
7906 { "Coding standard", "gsm_a.dtap.cap_coding_standard",
7907 FT_BOOLEAN, 8, TFS(&tfs_bearer_cap_coding_standard), 0x10,
7908 NULL, HFILL }
7910 { &hf_gsm_a_dtap_transfer_mode,
7911 { "Transfer mode", "gsm_a.dtap.transfer_mode",
7912 FT_BOOLEAN, 8, TFS(&tfs_bearer_cap_transfer_mode), 0x08,
7913 NULL, HFILL }
7915 { &hf_gsm_a_dtap_coding,
7916 { "Coding", "gsm_a.dtap.coding",
7917 FT_BOOLEAN, 8, TFS(&tfs_bearer_cap_coding), 0x40,
7918 NULL, HFILL }
7920 { &hf_gsm_a_dtap_compression,
7921 { "Compression", "gsm_a.dtap.compression",
7922 FT_BOOLEAN, 8, TFS(&tfs_possible_not_possible), 0x40,
7923 NULL, HFILL }
7925 { &hf_gsm_a_dtap_compression_up,
7926 { "Compression", "gsm_a.dtap.compression",
7927 FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x40,
7928 NULL, HFILL }
7930 { &hf_gsm_a_dtap_structure,
7931 { "Structure", "gsm_a.dtap.structure",
7932 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_structure_vals), 0x30,
7933 NULL, HFILL }
7935 { &hf_gsm_a_dtap_duplex_mode,
7936 { "Duplex mode", "gsm_a.dtap.duplex_mode",
7937 FT_BOOLEAN, 8, TFS(&tfs_full_half), 0x08,
7938 NULL, HFILL }
7940 { &hf_gsm_a_dtap_subaddress,
7941 { "Subaddress", "gsm_a.dtap.subaddress",
7942 FT_STRING, BASE_NONE, NULL, 0x0,
7943 NULL, HFILL }
7945 { &hf_gsm_a_dtap_subaddress_information,
7946 { "Subaddress information", "gsm_a.dtap.subaddress_information",
7947 FT_BYTES, BASE_NONE, NULL, 0x0,
7948 NULL, HFILL }
7950 { &hf_gsm_a_dtap_message_elements,
7951 { "Message Elements", "gsm_a.dtap.message_elements",
7952 FT_BYTES, BASE_NONE, NULL, 0x0,
7953 NULL, HFILL }
7955 { &hf_gsm_a_dtap_rpdu,
7956 { "RPDU", "gsm_a.dtap.rpdu",
7957 FT_BYTES, BASE_NONE, NULL, 0x0,
7958 NULL, HFILL }
7960 { &hf_gsm_a_dtap_configuration,
7961 { "Configuration", "gsm_a.dtap.configuration",
7962 FT_BOOLEAN, 8, TFS(&tfs_bearer_cap_configuration), 0x04,
7963 NULL, HFILL }
7965 { &hf_gsm_a_dtap_nirr,
7966 { "NIRR", "gsm_a.dtap.nirr",
7967 FT_BOOLEAN, 8, TFS(&tfs_nirr), 0x02,
7968 NULL, HFILL }
7970 { &hf_gsm_a_dtap_establishment,
7971 { "Establishment", "gsm_a.dtap.establishment",
7972 FT_BOOLEAN, 8, TFS(&tfs_bearer_cap_establishment), 0x01,
7973 NULL, HFILL }
7975 { &hf_gsm_a_dtap_access_identity,
7976 { "Access Identity", "gsm_a.dtap.access_identity",
7977 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_access_identity_vals), 0x60,
7978 NULL, HFILL }
7980 { &hf_gsm_a_dtap_rate_adaption,
7981 { "Rate Adaption", "gsm_a.dtap.rate_adaption",
7982 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_rate_adaption_vals), 0x18,
7983 NULL, HFILL }
7985 { &hf_gsm_a_dtap_signalling_access_protocol,
7986 { "Signalling Access Protocol", "gsm_a.dtap.signalling_access_protocol",
7987 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_signal_access_protocol_vals), 0x07,
7988 NULL, HFILL }
7990 { &hf_gsm_a_dtap_other_itc,
7991 { "Other ITC", "gsm_a.dtap.other_itc",
7992 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_other_itc_vals), 0x60,
7993 NULL, HFILL }
7995 { &hf_gsm_a_dtap_other_rate_adaption,
7996 { "Other Rate Adaption", "gsm_a.dtap.other_rate_adaption",
7997 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_other_rate_adaption_vals), 0x18,
7998 NULL, HFILL }
8000 { &hf_gsm_a_dtap_rate_adaption_header,
8001 { "Rate Adaption Header", "gsm_a.dtap.rate_adaption_header",
8002 FT_BOOLEAN, 8, TFS(&tfs_included_not_included), 0x40,
8003 NULL, HFILL }
8005 { &hf_gsm_a_dtap_multiple_frame_establishment_support,
8006 { "Multiple frame establishment support in data link", "gsm_a.dtap.multiple_frame_establishment_support",
8007 FT_BOOLEAN, 8, TFS(&tfs_frame_est_supported_not_supported), 0x20,
8008 NULL, HFILL }
8010 { &hf_gsm_a_dtap_mode_of_operation,
8011 { "Mode of operation", "gsm_a.dtap.mode_of_operation",
8012 FT_BOOLEAN, 8, TFS(&tfs_protocol_sensative_bit_transparent), 0x10,
8013 NULL, HFILL }
8015 { &hf_gsm_a_dtap_logical_link_identifier_negotiation,
8016 { "Logical link identifier negotiation", "gsm_a.dtap.logical_link_identifier_negotiation",
8017 FT_BOOLEAN, 8, TFS(&tfs_log_link_neg), 0x08,
8018 NULL, HFILL }
8020 { &hf_gsm_a_dtap_assignor_assignee,
8021 { "Assignor/Assignee", "gsm_a.dtap.assignor_assignee",
8022 FT_BOOLEAN, 8, TFS(&tfs_assignor_assignee), 0x04,
8023 NULL, HFILL }
8025 { &hf_gsm_a_dtap_in_out_band,
8026 { "In band/Out of band negotiation", "gsm_a.dtap.in_out_band",
8027 FT_BOOLEAN, 8, TFS(&tfs_in_out_band), 0x02,
8028 NULL, HFILL }
8030 { &hf_gsm_a_dtap_layer_1_identity,
8031 { "Layer 1 Identity", "gsm_a.dtap.layer_1_identity",
8032 FT_UINT8, BASE_DEC, NULL, 0x60,
8033 NULL, HFILL }
8035 { &hf_gsm_a_dtap_user_information_layer_1_protocol,
8036 { "User information layer 1 protocol", "gsm_a.dtap.user_information_layer_1_protocol",
8037 FT_UINT8, BASE_DEC, NULL, 0x1e,
8038 NULL, HFILL }
8040 { &hf_gsm_a_dtap_synchronous,
8041 { "Synchronous/asynchronous", "gsm_a.dtap.synchronous",
8042 FT_BOOLEAN, 8, TFS(&tfs_asynchronous_synchronous), 0x01,
8043 NULL, HFILL }
8045 { &hf_gsm_a_dtap_number_of_stop_bits,
8046 { "Number of Stop Bits", "gsm_a.dtap.number_of_stop_bits",
8047 FT_BOOLEAN, 8, TFS(&tfs_stop_bits), 0x40,
8048 NULL, HFILL }
8050 { &hf_gsm_a_dtap_negotiation,
8051 { "Negotiation", "gsm_a.dtap.negotiation",
8052 FT_BOOLEAN, 8, TFS(&tfs_negotiation), 0x20,
8053 NULL, HFILL }
8055 { &hf_gsm_a_dtap_number_of_data_bits,
8056 { "Number of data bits excluding parity bit if present", "gsm_a.dtap.number_of_data_bits",
8057 FT_BOOLEAN, 8, TFS(&tfs_parity_bits), 0x10,
8058 NULL, HFILL }
8060 { &hf_gsm_a_dtap_user_rate,
8061 { "User rate", "gsm_a.dtap.user_rate",
8062 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_user_rate_vals), 0x0F,
8063 NULL, HFILL }
8065 { &hf_gsm_a_dtap_v110_x30_rate_adaptation,
8066 { "V.110/X.30 rate adaptation Intermediate rate", "gsm_a.dtap.v110_x30_rate_adaptation",
8067 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_v110_x30_rate_adaptation_vals), 0x60,
8068 NULL, HFILL }
8070 { &hf_gsm_a_dtap_nic_on_tx,
8071 { "Network independent clock (NIC) on transmission (Tx)", "gsm_a.dtap.nic_on_tx",
8072 FT_BOOLEAN, 8, TFS(&tfs_nic_on_tx), 0x10,
8073 NULL, HFILL }
8075 { &hf_gsm_a_dtap_nic_on_rx,
8076 { "Network independent clock (NIC) on reception (Rx)", "gsm_a.dtap.nic_on_rx",
8077 FT_BOOLEAN, 8, TFS(&tfs_nic_on_rx), 0x08,
8078 NULL, HFILL }
8080 { &hf_gsm_a_dtap_parity_information,
8081 { "Parity information", "gsm_a.dtap.parity_information",
8082 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_parity_info_vals), 0x07,
8083 NULL, HFILL }
8085 { &hf_gsm_a_dtap_connection_element,
8086 { "Connection element", "gsm_a.dtap.connection_element",
8087 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_connection_element_vals), 0x60,
8088 NULL, HFILL }
8090 { &hf_gsm_a_dtap_modem_type,
8091 { "Modem type", "gsm_a.dtap.modem_type",
8092 FT_UINT8, BASE_DEC, NULL, 0x1f,
8093 NULL, HFILL }
8095 { &hf_gsm_a_dtap_other_modem_type,
8096 { "Other modem type", "gsm_a.dtap.other_modem_type",
8097 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_other_modem_type_vals), 0x60,
8098 NULL, HFILL }
8100 { &hf_gsm_a_dtap_fixed_network_user_rate,
8101 { "Fixed network user rate", "gsm_a.dtap.fixed_network_user_rate",
8102 FT_UINT8, BASE_DEC, NULL, 0x1f,
8103 NULL, HFILL }
8105 { &hf_gsm_a_dtap_acceptable_channel_codings_TCH_F14_4,
8106 { "Acceptable channel codings (TCH/F14.4)", "gsm_a.dtap.acceptable_channel_codings.TCH_F14_4",
8107 FT_BOOLEAN, 8, TFS(&tfs_acceptable_not_acceptable), 0x40,
8108 NULL, HFILL }
8110 { &hf_gsm_a_dtap_acceptable_channel_codings_spare20,
8111 { "Acceptable channel codings (Spare)", "gsm_a.dtap.acceptable_channel_codings.spare",
8112 FT_BOOLEAN, 8, NULL, 0x20,
8113 NULL, HFILL }
8115 { &hf_gsm_a_dtap_acceptable_channel_codings_TCH_F9_6,
8116 { "Acceptable channel codings (TCH/F9.6)", "gsm_a.dtap.acceptable_channel_codings.TCH_F9_6",
8117 FT_BOOLEAN, 8, TFS(&tfs_acceptable_not_acceptable), 0x10,
8118 NULL, HFILL }
8120 { &hf_gsm_a_dtap_acceptable_channel_codings_TCH_F4_8,
8121 { "Acceptable channel codings (TCH/F4.8)", "gsm_a.dtap.acceptable_channel_codings.TCH_F4_8",
8122 FT_BOOLEAN, 8, TFS(&tfs_acceptable_not_acceptable), 0x08,
8123 NULL, HFILL }
8125 { &hf_gsm_a_dtap_maximum_number_of_traffic_channels,
8126 { "Maximum number of traffic channels", "gsm_a.dtap.maximum_number_of_traffic_channels",
8127 FT_UINT8, BASE_DEC, NULL, 0x07,
8128 NULL, HFILL }
8130 { &hf_gsm_a_dtap_acceptable_channel_codings_spare78,
8131 { "Acceptable channel codings", "gsm_a.dtap.acceptable_channel_codings",
8132 FT_UINT8, BASE_DEC, NULL, 0x78,
8133 NULL, HFILL }
8135 { &hf_gsm_a_dtap_uimi,
8136 { "UIMI, User initiated modification indication",
8137 "gsm_a.dtap.uimi", FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_uimi_vals),
8138 0x70, NULL, HFILL }
8140 { &hf_gsm_a_dtap_wanted_air_interface_user_rate,
8141 { "Wanted air interface user rate", "gsm_a.dtap.wanted_air_interface_user_rate",
8142 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_wanted_air_rate_vals), 0x0F,
8143 NULL, HFILL }
8145 { &hf_gsm_a_dtap_acceptable_channel_codings_ext_TCH_F28_8,
8146 { "Acceptable channel codings extended (TCH/F28.8)", "gsm_a.dtap.acceptable_channel_codings_ext.TCH_F28_8",
8147 FT_BOOLEAN, 8, TFS(&tfs_acceptable_not_acceptable), 0x40,
8148 NULL, HFILL }
8150 { &hf_gsm_a_dtap_acceptable_channel_codings_ext_TCH_F32_0,
8151 { "Acceptable channel codings extended (TCH/F32.0)", "gsm_a.dtap.acceptable_channel_codings_ext.TCH_F32_0",
8152 FT_BOOLEAN, 8, TFS(&tfs_acceptable_not_acceptable), 0x20,
8153 NULL, HFILL }
8155 { &hf_gsm_a_dtap_acceptable_channel_codings_ext_TCH_F43_2,
8156 { "Acceptable channel codings extended (TCH/F43.2)", "gsm_a.dtap.acceptable_channel_codings_ext.TCH_F43_2",
8157 FT_BOOLEAN, 8, TFS(&tfs_acceptable_not_acceptable), 0x10,
8158 NULL, HFILL }
8160 { &hf_gsm_a_dtap_channel_coding_asymmetry_indication,
8161 { "Channel Coding Asymmetry Indication", "gsm_a.dtap.channel_coding_asymmetry_indication",
8162 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_channel_coding_asymmetry_ind_vals), 0x0c,
8163 NULL, HFILL }
8165 { &hf_gsm_a_dtap_edge_channel_codings,
8166 { "EDGE Channel Codings", "gsm_a.dtap.edge_channel_codings",
8167 FT_UINT8, BASE_DEC, NULL, 0x7c,
8168 NULL, HFILL }
8170 { &hf_gsm_a_dtap_layer_2_identity,
8171 { "Layer 2 Identity", "gsm_a.dtap.layer_2_identity",
8172 FT_UINT8, BASE_DEC, NULL, 0x60,
8173 NULL, HFILL }
8175 { &hf_gsm_a_dtap_user_information_layer_2_protocol,
8176 { "User information layer 2 protocol", "gsm_a.dtap.user_information_layer_2_protocol",
8177 FT_UINT8, BASE_DEC, NULL, 0x1f,
8178 NULL, HFILL }
8180 { &hf_gsm_a_dtap_maximum_number_of_supported_bearers,
8181 { "Maximum number of supported bearers", "gsm_a.dtap.maximum_number_of_supported_bearers",
8182 FT_UINT8, BASE_DEC, NULL, 0xf0,
8183 NULL, HFILL }
8185 { &hf_gsm_a_dtap_pcp,
8186 { "Prolonged Clearing Procedure", "gsm_a.dtap.pcp",
8187 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
8188 NULL, HFILL }
8190 { &hf_gsm_a_dtap_dtmf,
8191 { "DTMF", "gsm_a.dtap.dtmf",
8192 FT_BOOLEAN, 8, TFS(&gsm_a_dtap_dtmf_value), 0x01,
8193 NULL, HFILL }
8195 { &hf_gsm_a_dtap_max_num_of_speech_bearers,
8196 { "Maximum number of speech bearers", "gsm_a.dtap.max_num_of_speech_bearers",
8197 FT_UINT8, BASE_DEC, NULL, 0x0f,
8198 NULL, HFILL }
8200 { &hf_gsm_a_dtap_de_cause_coding_standard,
8201 { "Coding standard", "gsm_a.dtap.coding_standard",
8202 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_de_cause_coding_standard_vals), 0x60,
8203 NULL, HFILL }
8205 { &hf_gsm_a_dtap_recommendation,
8206 { "Recommendation", "gsm_a.dtap.recommendation",
8207 FT_UINT8, BASE_DEC, NULL, 0x7f,
8208 NULL, HFILL }
8210 { &hf_gsm_a_dtap_data,
8211 { "Data", "gsm_a.dtap.data",
8212 FT_BYTES, BASE_NONE, NULL, 0x0,
8213 NULL, HFILL }
8215 { &hf_gsm_a_dtap_keypad_information,
8216 { "Keypad information", "gsm_a.dtap.keypad_information",
8217 FT_CHAR, BASE_HEX, NULL, 0x7f,
8218 NULL, HFILL }
8220 { &hf_gsm_a_dtap_repeat_indicator,
8221 { "Repeat Indicator", "gsm_a.dtap.repeat_indicator",
8222 FT_UINT8, BASE_DEC, NULL, 0x0f,
8223 NULL, HFILL }
8225 { &hf_gsm_a_dtap_ss_version_indicator,
8226 { "SS Version Indicator", "gsm_a.dtap.ss_version_indicator",
8227 FT_UINT8, BASE_DEC, NULL, 0x0,
8228 NULL, HFILL }
8230 { &hf_gsm_a_dtap_cp_cause,
8231 { "Cause", "gsm_a.dtap.cp_cause",
8232 FT_UINT8, BASE_DEC, NULL, 0x0,
8233 NULL, HFILL }
8235 { &hf_gsm_a_dtap_test_loop,
8236 { "Test Loop", "gsm_a.dtap.test_loop",
8237 FT_UINT8, BASE_DEC, NULL, 0x3e,
8238 NULL, HFILL }
8240 { &hf_gsm_a_dtap_subchannel,
8241 { "Subchannel", "gsm_a.dtap.subchannel",
8242 FT_BOOLEAN, 8, TFS(&tfs_gsm_a_dtap_subchannel), 0x01,
8243 NULL, HFILL }
8245 { &hf_gsm_a_dtap_ack_element,
8246 { "Acknowledgment element", "gsm_a.dtap.ack_element",
8247 FT_UINT8, BASE_DEC, NULL, 0x0,
8248 NULL, HFILL }
8250 { &hf_gsm_a_dtap_channel_coding03,
8251 { "Channel coding", "gsm_a.dtap.channel_coding",
8252 FT_UINT8, BASE_DEC, VALS(gsm_channel_coding_vals), 0x03,
8253 NULL, HFILL }
8255 { &hf_gsm_a_dtap_channel_coding30,
8256 { "Channel coding", "gsm_a.dtap.channel_coding",
8257 FT_UINT8, BASE_DEC, VALS(gsm_channel_coding_vals), 0x30,
8258 NULL, HFILL }
8260 { &hf_gsm_a_dtap_loop_mechanism0E,
8261 { "Loop mechanism", "gsm_a.dtap.loop_mechanism",
8262 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_loop_mech_vals), 0x0e,
8263 NULL, HFILL }
8265 { &hf_gsm_a_dtap_loop_mechanism1C,
8266 { "Loop mechanism", "gsm_a.dtap.loop_mechanism",
8267 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_loop_mech_vals), 0x1c,
8268 NULL, HFILL }
8270 { &hf_gsm_a_dtap_multislot_tch,
8271 { "Multi-slot TCH loop", "gsm_a.dtap.multislot_tch",
8272 FT_BOOLEAN, 8, TFS(&tfs_multislot_tch), 0x01,
8273 NULL, HFILL }
8275 { &hf_gsm_a_dtap_tp_tested_device,
8276 { "Tested device", "gsm_a.dtap.tp_tested_device",
8277 FT_UINT8, BASE_DEC, NULL, 0x0,
8278 NULL, HFILL }
8280 { &hf_gsm_a_dtap_tp_pdu_description,
8281 { "PDUs transmitted", "gsm_a.dtap.tp_pdu_description",
8282 FT_UINT16, BASE_DEC, NULL, 0x0,
8283 NULL, HFILL }
8285 { &hf_gsm_a_dtap_mode_flag,
8286 { "Mode flag", "gsm_a.dtap.mode_flag",
8287 FT_BOOLEAN, 8, TFS(&tfs_gsm_a_dtap_mode_flag), 0x01,
8288 NULL, HFILL }
8290 { &hf_gsm_a_dtap_egprs_mode_flag,
8291 { "EGPRS Mode flag", "gsm_a.dtap.egprs_mode_flag",
8292 FT_BOOLEAN, 8, TFS(&tfs_gsm_a_dtap_egprs_mode_flag), 0x01,
8293 NULL, HFILL }
8295 { &hf_gsm_a_dtap_downlink_timeslot_offset,
8296 { "Downlink Timeslot Offset", "gsm_a.dtap.downlink_timeslot_offset",
8297 FT_UINT8, BASE_DEC, NULL, 0x0E,
8298 NULL, HFILL }
8300 { &hf_gsm_a_dtap_ms_positioning_technology,
8301 { "MS positioning technology", "gsm_a.dtap.ms_positioning_technology",
8302 FT_UINT8, BASE_DEC, VALS(gsm_positioning_technology_vals), 0x0,
8303 NULL, HFILL }
8305 { &hf_gsm_a_dtap_ue_test_loop_mode,
8306 { "UE test loop mode", "gsm_a.dtap.ue_test_loop_mode",
8307 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_ue_test_loop_mode_vals), 0x03,
8308 NULL, HFILL }
8310 { &hf_gsm_a_dtap_ue_positioning_technology,
8311 { "UE positioning technology", "gsm_a.dtap.ue_positioning_technology",
8312 FT_UINT8, BASE_DEC, VALS(gsm_positioning_technology_vals), 0x0,
8313 NULL, HFILL }
8315 { &hf_gsm_a_dtap_ciphering_key_sequence_number,
8316 { "Ciphering Key Sequence Number", "gsm_a.dtap.ciphering_key_sequence_number",
8317 FT_UINT8, BASE_DEC, NULL, 0x07,
8318 NULL, HFILL }
8320 { &hf_gsm_a_dtap_ciphering_key_sequence_number70,
8321 { "Ciphering Key Sequence Number", "gsm_a.dtap.ciphering_key_sequence_number",
8322 FT_UINT8, BASE_DEC, NULL, 0x70,
8323 NULL, HFILL }
8325 { &hf_gsm_a_dtap_service_type,
8326 { "Service Type", "gsm_a.dtap.service_type",
8327 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_service_type_vals), 0x0F,
8328 NULL, HFILL }
8330 { &hf_gsm_a_dtap_type_of_identity,
8331 { "Type of identity", "gsm_a.dtap.type_of_identity",
8332 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_type_of_identity_vals), 0x07,
8333 NULL, HFILL }
8335 { &hf_gsm_a_dtap_follow_on_request,
8336 { "Follow-On Request (FOR)", "gsm_a.dtap.follow_on_request",
8337 FT_BOOLEAN, 8, TFS(&tfs_follow_on_request_value ), 0x08,
8338 NULL, HFILL }
8340 { &hf_gsm_a_dtap_updating_type,
8341 { "Updating Type", "gsm_a.dtap.updating_type",
8342 FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_updating_type_vals), 0x03,
8343 NULL, HFILL }
8345 { &hf_gsm_a_dtap_congestion_level,
8346 { "Congestion level", "gsm_a.dtap.congestion_level",
8347 FT_UINT8, BASE_DEC, NULL, 0x0F,
8348 NULL, HFILL }
8350 { &hf_gsm_a_dtap_protocol_discriminator,
8351 { "Protocol Discriminator", "gsm_a.dtap.protocol_discriminator",
8352 FT_UINT8, BASE_DEC, VALS(protocol_discriminator_vals), 0x0,
8353 NULL, HFILL }
8355 { &hf_gsm_a_dtap_ti_flag,
8356 { "TI flag", "gsm_a.dtap.ti_flag",
8357 FT_BOOLEAN, 8, TFS(&tfs_allocated_by_receiver_sender), 0x80,
8358 NULL, HFILL }
8360 { &hf_gsm_a_dtap_tio,
8361 { "TIO", "gsm_a.dtap.tio",
8362 FT_UINT8, BASE_DEC, NULL, 0x70,
8363 NULL, HFILL }
8365 { &hf_gsm_a_dtap_tie,
8366 { "TIE", "gsm_a.dtap.tie",
8367 FT_UINT8, BASE_DEC, NULL, DTAP_TIE_MASK,
8368 NULL, HFILL }
8370 { &hf_gsm_a_dtap_timeslot_number,
8371 { "Timeslot number", "gsm_a_dtap.timeslot_number",
8372 FT_UINT8, BASE_DEC, NULL, 0xe0,
8373 NULL, HFILL }
8375 { &hf_gsm_a_dtap_uplink_rlc_sdu_size,
8376 { "Uplink RLC SDU size", "gsm_a_dtap.uplink_rlc_sdu_size",
8377 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_bit_bits), 0x0,
8378 NULL, HFILL }
8380 { &hf_gsm_a_dtap_radio_bearer,
8381 { "Radio Bearer", "gsm_a_dtap.radio_bearer",
8382 FT_UINT8, BASE_DEC, NULL, 0x1F,
8383 NULL, HFILL }
8385 { &hf_gsm_a_dtap_mbms_short_transmission_identity,
8386 { "MBMS short transmission identity", "gsm_a_dtap.mbms_short_transmission_identity",
8387 FT_UINT8, BASE_DEC, NULL, 0x0,
8388 NULL, HFILL }
8390 { &hf_gsm_a_dtap_ue_received_rlc_sdu_counter_value,
8391 { "UE received RLC SDU counter value", "gsm_a_dtap.ue_received_rlc_sdu_counter_value",
8392 FT_UINT32, BASE_DEC, NULL, 0x0,
8393 NULL, HFILL }
8395 { &hf_gsm_a_dtap_num_lb_entities,
8396 { "Number of LB entities", "gsm_a_dtap.num_lb_entities",
8397 FT_UINT32, BASE_DEC, NULL, 0x0,
8398 NULL, HFILL }
8402 /* Setup protocol subtree array */
8403 #define NUM_INDIVIDUAL_ELEMS 22
8404 int *ett[NUM_INDIVIDUAL_ELEMS +
8405 NUM_GSM_DTAP_MSG_MM + NUM_GSM_DTAP_MSG_CC +
8406 NUM_GSM_DTAP_MSG_SMS + NUM_GSM_DTAP_MSG_SS + NUM_GSM_DTAP_MSG_TP +
8407 NUM_GSM_DTAP_ELEM];
8409 static ei_register_info ei[] = {
8410 { &ei_gsm_a_dtap_autn, { "gsm_a.dtap.autn.invalid", PI_MALFORMED, PI_WARN, "AUTN length not equal to 16", EXPFILL }},
8411 { &ei_gsm_a_dtap_auts, { "gsm_a.dtap.auts.invalid", PI_MALFORMED, PI_WARN, "AUTS length not equal to 14", EXPFILL }},
8412 { &ei_gsm_a_dtap_text_string_not_multiple_of_7, { "gsm_a.dtap.text_string_not_multiple_of_7", PI_MALFORMED, PI_WARN, "Value leads to a Text String whose length is not a multiple of 7 bits", EXPFILL }},
8413 { &ei_gsm_a_dtap_not_digit, { "gsm_a.dtap.not_digit", PI_MALFORMED, PI_WARN, "BCD number contains a value that is not a digit", EXPFILL }},
8414 { &ei_gsm_a_dtap_end_mark_unexpected, { "gsm_a.dtap.end_mark_unexpected", PI_MALFORMED, PI_WARN, "\'f\' end mark present in unexpected position", EXPFILL }},
8415 { &ei_gsm_a_dtap_invalid_ia5_character, { "gsm_a.dtap.invalid_ia5_character", PI_MALFORMED, PI_WARN, "Invalid IA5 character(s) in string (value > 127)", EXPFILL }},
8416 { &ei_gsm_a_dtap_keypad_info_not_dtmf_digit, { "gsm_a.dtap.keypad_info_not_dtmf_digit", PI_MALFORMED, PI_WARN, "Keypad information contains character that is not a DTMF digit", EXPFILL }},
8417 { &ei_gsm_a_dtap_extraneous_data, { "gsm_a.dtap.extraneous_data", PI_PROTOCOL, PI_NOTE, "Extraneous Data, dissector bug or later version spec(report to wireshark.org)", EXPFILL }},
8418 { &ei_gsm_a_dtap_missing_mandatory_element, { "gsm_a.dtap.missing_mandatory_element", PI_PROTOCOL, PI_ERROR, "Missing Mandatory element, rest of dissection is suspect", EXPFILL }},
8419 { &ei_gsm_a_dtap_coding_scheme, { "gsm_a.dtap.coding_scheme.unknown", PI_PROTOCOL, PI_WARN, "Text string encoded according to an unknown Coding Scheme", EXPFILL } },
8420 { &ei_gsm_a_dtap_ti_not_valid,{ "gsm_a.dtap.ti_not_valid", PI_PROTOCOL, PI_ERROR, "If TI bits = 7, length must be > 2", EXPFILL } },
8423 expert_module_t* expert_a_dtap;
8425 ett[0] = &ett_dtap_msg;
8426 ett[1] = &ett_dtap_oct_1;
8427 ett[2] = &ett_cm_srvc_type;
8428 ett[3] = &ett_gsm_enc_info;
8429 ett[4] = &ett_bc_oct_3;
8430 ett[5] = &ett_bc_oct_3a;
8431 ett[6] = &ett_bc_oct_4;
8432 ett[7] = &ett_bc_oct_5;
8433 ett[8] = &ett_bc_oct_5a;
8434 ett[9] = &ett_bc_oct_5b;
8435 ett[10] = &ett_bc_oct_6;
8436 ett[11] = &ett_bc_oct_6a;
8437 ett[12] = &ett_bc_oct_6b;
8438 ett[13] = &ett_bc_oct_6c;
8439 ett[14] = &ett_bc_oct_6d;
8440 ett[15] = &ett_bc_oct_6e;
8441 ett[16] = &ett_bc_oct_6f;
8442 ett[17] = &ett_bc_oct_6g;
8443 ett[18] = &ett_bc_oct_7;
8444 ett[19] = &ett_epc_ue_tl_a_lb_setup;
8445 ett[20] = &ett_mm_timer;
8446 ett[21] = &ett_ue_test_loop_mode;
8448 last_offset = NUM_INDIVIDUAL_ELEMS;
8450 for (i=0; i < NUM_GSM_DTAP_MSG_MM; i++, last_offset++)
8452 ett[last_offset] = &ett_gsm_dtap_msg_mm[i];
8455 for (i=0; i < NUM_GSM_DTAP_MSG_CC; i++, last_offset++)
8457 ett[last_offset] = &ett_gsm_dtap_msg_cc[i];
8460 for (i=0; i < NUM_GSM_DTAP_MSG_SMS; i++, last_offset++)
8462 ett[last_offset] = &ett_gsm_dtap_msg_sms[i];
8465 for (i=0; i < NUM_GSM_DTAP_MSG_SS; i++, last_offset++)
8467 ett[last_offset] = &ett_gsm_dtap_msg_ss[i];
8470 for (i=0; i < NUM_GSM_DTAP_MSG_TP; i++, last_offset++)
8472 ett[last_offset] = &ett_gsm_dtap_msg_tp[i];
8475 for (i=0; i < NUM_GSM_DTAP_ELEM; i++, last_offset++)
8477 ett[last_offset] = &ett_gsm_dtap_elem[i];
8480 /* Register the protocol name and description */
8482 proto_a_dtap =
8483 proto_register_protocol("GSM A-I/F DTAP", "GSM DTAP", "gsm_a.dtap");
8485 proto_register_field_array(proto_a_dtap, hf, array_length(hf));
8487 proto_register_subtree_array(ett, array_length(ett));
8488 expert_a_dtap = expert_register_protocol(proto_a_dtap);
8489 expert_register_field_array(expert_a_dtap, ei, array_length(ei));
8492 /* subdissector code */
8493 dtap_handle = register_dissector("gsm_a_dtap", dissect_dtap, proto_a_dtap);
8494 u2u_dissector_table = register_dissector_table("gsm_a.dtap.u2u_prot_discr", "GSM User to User Signalling",
8495 proto_a_dtap, FT_UINT8, BASE_DEC);
8498 void
8499 proto_reg_handoff_gsm_a_dtap(void)
8501 dissector_add_uint("bssap.pdu_type", BSSAP_PDU_TYPE_DTAP, dtap_handle);
8502 dissector_add_uint("bssap_le.pdu_type", BSSAP_PDU_TYPE_DTAP, dtap_handle);
8503 dissector_add_uint("ranap.nas_pdu", BSSAP_PDU_TYPE_DTAP, dtap_handle);
8504 dissector_add_uint("llcgprs.sapi", 1 , dtap_handle); /* GPRS Mobility Management */
8505 dissector_add_uint("llcgprs.sapi", 7 , dtap_handle); /* SMS */
8506 dissector_add_uint("lapdm.sapi", 0 , dtap_handle); /* LAPDm: CC/RR/MM */
8507 dissector_add_uint("lapdm.sapi", 3 , dtap_handle); /* LAPDm: SMS/SS */
8509 gsm_map_handle = find_dissector_add_dependency("gsm_map", proto_a_dtap);
8510 rp_handle = find_dissector_add_dependency("gsm_a_rp", proto_a_dtap);
8515 * Editor modelines - https://www.wireshark.org/tools/modelines.html
8517 * Local variables:
8518 * c-basic-offset: 4
8519 * tab-width: 8
8520 * indent-tabs-mode: nil
8521 * End:
8523 * vi: set shiftwidth=4 tabstop=8 expandtab:
8524 * :indentSize=4:tabSize=8:noTabs=true: