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 Managment Protocol and
11 * the GPRS Session Managment 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 othere enhancements and fixes.
18 * Copyright 2005 - 2006, Anders Broman [AT] ericsson.com
19 * Small bugfixes, mainly in Qos and TFT by Nils Ljungberg and Stefan Boman [AT] ericsson.com
24 * Mobile radio interface Layer 3 specification;
25 * Core network protocols;
27 * (3GPP TS 24.008 version 4.7.0 Release 4)
28 * (ETSI TS 124 008 V6.8.0 (2005-03))
31 * Mobile radio interface layer 3 specification;
32 * Radio Resource Control Protocol
33 * (GSM 04.18 version 8.4.1 Release 1999)
34 * (3GPP TS 04.18 version 8.26.0 Release 1999)
37 * Point-to-Point (PP) Short Message Service (SMS)
38 * support on mobile radio interface
39 * (3GPP TS 24.011 version 4.1.1 Release 4)
42 * Mobile radio Layer 3 supplementary service specification;
44 * (3GPP TS 24.080 version 4.3.0 Release 4)
47 * Mobile radio interface Layer 3 specification;
48 * Core network protocols;
50 * (3GPP TS 24.008 version 5.9.0 Release 5)
53 * Mobile radio interface Layer 3 specification;
54 * Core network protocols;
56 * (3GPP TS 24.008 version 6.7.0 Release 6)
57 * (3GPP TS 24.008 version 6.8.0 Release 6)
61 * Wireshark - Network traffic analyzer
62 * By Gerald Combs <gerald@wireshark.org>
63 * Copyright 1998 Gerald Combs
65 * This program is free software; you can redistribute it and/or
66 * modify it under the terms of the GNU General Public License
67 * as published by the Free Software Foundation; either version 2
68 * of the License, or (at your option) any later version.
70 * This program is distributed in the hope that it will be useful,
71 * but WITHOUT ANY WARRANTY; without even the implied warranty of
72 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
73 * GNU General Public License for more details.
75 * You should have received a copy of the GNU General Public License
76 * along with this program; if not, write to the Free Software
77 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
89 #include <epan/packet.h>
90 #include <epan/prefs.h>
92 #include <epan/emem.h>
93 #include <epan/asn1.h>
95 #include "packet-bssap.h"
96 #include "packet-sccp.h"
97 #include "packet-ber.h"
98 #include "packet-q931.h"
99 #include "packet-gsm_a_common.h"
100 #include "packet-ipv6.h"
101 #include "packet-e212.h"
102 #include "packet-ppp.h"
104 /* PROTOTYPES/FORWARDS */
106 const value_string gsm_a_dtap_msg_mm_strings[] = {
107 { 0x01, "IMSI Detach Indication" },
108 { 0x02, "Location Updating Accept" },
109 { 0x04, "Location Updating Reject" },
110 { 0x08, "Location Updating Request" },
111 { 0x11, "Authentication Reject" },
112 { 0x12, "Authentication Request" },
113 { 0x14, "Authentication Response" },
114 { 0x1c, "Authentication Failure" },
115 { 0x18, "Identity Request" },
116 { 0x19, "Identity Response" },
117 { 0x1a, "TMSI Reallocation Command" },
118 { 0x1b, "TMSI Reallocation Complete" },
119 { 0x21, "CM Service Accept" },
120 { 0x22, "CM Service Reject" },
121 { 0x23, "CM Service Abort" },
122 { 0x24, "CM Service Request" },
123 { 0x25, "CM Service Prompt" },
124 { 0x26, "Reserved: was allocated in earlier phases of the protocol" },
125 { 0x28, "CM Re-establishment Request" },
128 { 0x31, "MM Status" },
129 { 0x32, "MM Information" },
133 const value_string gsm_a_dtap_msg_cc_strings[] = {
134 { 0x01, "Alerting" },
135 { 0x08, "Call Confirmed" },
136 { 0x02, "Call Proceeding" },
138 { 0x0f, "Connect Acknowledge" },
139 { 0x0e, "Emergency Setup" },
140 { 0x03, "Progress" },
141 { 0x04, "CC-Establishment" },
142 { 0x06, "CC-Establishment Confirmed" },
144 { 0x09, "Start CC" },
147 { 0x1f, "Modify Complete" },
148 { 0x13, "Modify Reject" },
149 { 0x10, "User Information" },
151 { 0x19, "Hold Acknowledge" },
152 { 0x1a, "Hold Reject" },
153 { 0x1c, "Retrieve" },
154 { 0x1d, "Retrieve Acknowledge" },
155 { 0x1e, "Retrieve Reject" },
156 { 0x25, "Disconnect" },
158 { 0x2a, "Release Complete" },
159 { 0x39, "Congestion Control" },
162 { 0x34, "Status Enquiry" },
163 { 0x35, "Start DTMF" },
164 { 0x31, "Stop DTMF" },
165 { 0x32, "Stop DTMF Acknowledge" },
166 { 0x36, "Start DTMF Acknowledge" },
167 { 0x37, "Start DTMF Reject" },
168 { 0x3a, "Facility" },
172 const value_string gsm_a_dtap_msg_sms_strings[] = {
175 { 0x10, "CP-ERROR" },
179 const value_string gsm_a_dtap_msg_ss_strings[] = {
180 { 0x2a, "Release Complete" },
181 { 0x3a, "Facility" },
182 { 0x3b, "Register" },
186 const value_string gsm_a_dtap_msg_tp_strings[] = {
187 { 0x00, "Close TCH Loop Cmd" },
188 { 0x01, "Close TCH Loop Ack" },
189 { 0x06, "Open Loop Cmd" },
190 { 0x0c, "Act EMMI Cmd" },
191 { 0x0d, "Act EMMI Ack" },
192 { 0x10, "Deact EMMI" },
193 { 0x14, "Test Interface" },
194 { 0x20, "Close Multi-slot Loop Cmd" },
195 { 0x21, "Close Multi-slot Loop Ack" },
196 { 0x22, "Open Multi-slot Loop Cmd" },
197 { 0x23, "Open Multi-slot Loop Ack" },
198 { 0x24, "GPRS Test Mode Cmd" },
199 { 0x25, "EGPRS Start Radio Block Loopback Cmd" },
200 { 0x40, "Close UE Test Loop" },
201 { 0x41, "Close UE Test Loop Complete" },
202 { 0x42, "Open UE Test Loop" },
203 { 0x43, "Open UE Test Loop Complete" },
204 { 0x44, "Activate RB Test Mode" },
205 { 0x45, "Activate RB Test Mode Complete" },
206 { 0x46, "Deactivate RB Test Mode" },
207 { 0x47, "Deactivate RB Test Mode Complete" },
208 { 0x48, "Reset UE Positioning Stored Information" },
209 { 0x49, "UE Test Loop Mode 3 RLC SDU Counter Request" },
210 { 0x4A, "UE Test Loop Mode 3 RLC SDU Counter Response" },
214 const value_string gsm_dtap_elem_strings[] = {
215 /* Mobility Management Information Elements 10.5.3 */
216 { 0x00, "Authentication Parameter RAND" },
217 { 0x00, "Authentication Parameter AUTN (UMTS authentication challenge only)" },
218 { 0x00, "Authentication Response Parameter" },
219 { 0x00, "Authentication Response Parameter (extension) (UMTS authentication challenge only)" },
220 { 0x00, "Authentication Failure Parameter (UMTS authentication challenge only)" },
221 { 0x00, "CM Service Type" },
222 { 0x00, "Identity Type" },
223 { 0x00, "Location Updating Type" },
224 { 0x00, "Network Name" },
225 { 0x00, "Reject Cause" },
226 { 0x00, "Follow-on Proceed" },
227 { 0x00, "Time Zone" },
228 { 0x00, "Time Zone and Time" },
229 { 0x00, "CTS Permission" },
230 { 0x00, "LSA Identifier" },
231 { 0x00, "Daylight Saving Time" },
232 { 0x00, "Emergency Number List" },
233 /* Call Control Information Elements 10.5.4 */
234 { 0x00, "Auxiliary States" }, /* 10.5.4.4 Auxiliary states */
235 { 0x00, "Bearer Capability" }, /* 10.5.4.4a Backup bearer capability */
236 { 0x00, "Call Control Capabilities" },
237 { 0x00, "Call State" },
238 { 0x00, "Called Party BCD Number" },
239 { 0x00, "Called Party Subaddress" },
240 { 0x00, "Calling Party BCD Number" },
241 { 0x00, "Calling Party Subaddress" },
243 { 0x00, "CLIR Suppression" },
244 { 0x00, "CLIR Invocation" },
245 { 0x00, "Congestion Level" },
246 { 0x00, "Connected Number" },
247 { 0x00, "Connected Subaddress" },
248 { 0x00, "Facility" },
249 { 0x00, "High Layer Compatibility" },
250 { 0x00, "Keypad Facility" },
251 { 0x00, "Low Layer Compatibility" },
252 { 0x00, "More Data" },
253 { 0x00, "Notification Indicator" },
254 { 0x00, "Progress Indicator" },
255 { 0x00, "Recall type $(CCBS)$" },
256 { 0x00, "Redirecting Party BCD Number" },
257 { 0x00, "Redirecting Party Subaddress" },
258 { 0x00, "Repeat Indicator" },
259 { 0x00, "Reverse Call Setup Direction" },
260 { 0x00, "SETUP Container $(CCBS)$" },
262 { 0x00, "SS Version Indicator" },
263 { 0x00, "User-user" },
264 { 0x00, "Alerting Pattern $(NIA)$" }, /* 10.5.4.26 Alerting Pattern $(NIA)$ */
265 { 0x00, "Allowed Actions $(CCBS)$" },
266 { 0x00, "Stream Identifier" },
267 { 0x00, "Network Call Control Capabilities" },
268 { 0x00, "Cause of No CLI" },
269 { 0x00, "Immediate Modification Indicator" }, /* 10.5.4.30 Cause of No CLI */
271 { 0x00, "Supported Codec List" }, /* 10.5.4.32 Supported codec list */
272 { 0x00, "Service Category" }, /* 10.5.4.33 Service category */
273 /* 10.5.4.34 Redial */
274 /* 10.5.4.35 Network-initiated Service Upgrade indicator */
275 /* Short Message Service Information Elements [5] 8.1.4 */
276 { 0x00, "CP-User Data" },
277 { 0x00, "CP-Cause" },
278 /* Short Message Service Information Elements [5] 8.2 */
279 { 0x00, "RP-Message Reference" },
280 { 0x00, "RP-Origination Address" },
281 { 0x00, "RP-Destination Address" },
282 { 0x00, "RP-User Data" },
283 { 0x00, "RP-Cause" },
284 /* Tests procedures information elements 3GPP TS 44.014 6.4.0 and 3GPP TS 34.109 6.4.0 */
285 { 0x00, "Close TCH Loop Cmd Sub-channel"},
286 { 0x00, "Open Loop Cmd Ack"},
287 { 0x00, "Close Multi-slot Loop Cmd Loop type"},
288 { 0x00, "Close Multi-slot Loop Ack Result"},
289 { 0x00, "Test Interface Tested device"},
290 { 0x00, "GPRS Test Mode Cmd PDU description"},
291 { 0x00, "GPRS Test Mode Cmd Mode flag"},
292 { 0x00, "EGPRS Start Radio Block Loopback Cmd Mode flag"},
293 { 0x00, "Close UE Test Loop Mode"},
294 { 0x00, "UE Positioning Technology"},
295 { 0x00, "RLC SDU Counter Value"},
299 const gchar *gsm_a_pd_str[] = {
300 "Group Call Control",
301 "Broadcast Call Control",
302 "Reserved: was allocated in earlier phases of the protocol",
303 "Call Control; call related SS messages",
304 "GPRS Transparent Transport Protocol (GTTP)",
305 "Mobility Management messages",
306 "Radio Resources Management messages",
308 "GPRS Mobility Management messages",
310 "GPRS Session Management messages",
311 "Non call related SS messages",
314 "Reserved for extension of the PD to one octet length",
315 "Special conformance testing functions"
317 /* L3 Protocol discriminator values according to TS 24 007 (6.4.0) */
318 const value_string protocol_discriminator_vals[] = {
319 {0x0, "Group call control"},
320 {0x1, "Broadcast call control"},
321 {0x2, "Reserved: was allocated in earlier phases of the protocol"},
322 {0x3, "Call Control; call related SS messages"},
323 {0x4, "GPRS Transparent Transport Protocol (GTTP)"},
324 {0x5, "Mobility Management messages"},
325 {0x6, "Radio Resources Management messages"},
327 {0x8, "GPRS mobility management messages"},
328 {0x9, "SMS messages"},
329 {0xa, "GPRS session management messages"},
330 {0xb, "Non call related SS messages"},
331 {0xc, "Location services specified in 3GPP TS 44.071 [8a]"},
333 {0xe, "Reserved for extension of the PD to one octet length "},
334 {0xf, "Special conformance testing functions"},
338 const value_string gsm_a_pd_short_str_vals[] = {
339 {0x0, "GCC"}, /* Group Call Control */
340 {0x1, "BCC"}, /* Broadcast Call Control */
341 {0x2, "Reserved"}, /* : was allocated in earlier phases of the protocol */
342 {0x3, "CC"}, /* Call Control; call related SS messages */
343 {0x4, "GTTP"}, /* GPRS Transparent Transport Protocol (GTTP) */
344 {0x5, "MM"}, /* Mobility Management messages */
345 {0x6, "RR"}, /* Radio Resources Management messages */
347 {0x8, "GMM"}, /* GPRS Mobility Management messages */
349 {0xa, "SM"}, /* GPRS Session Management messages */
351 {0xc, "LS"}, /* Location Services */
353 {0xe, "Reserved"}, /* for extension of the PD to one octet length */
354 {0xf, "TP"}, /* for tests procedures described in 3GPP TS 44.014 6.4.0 and 3GPP TS 34.109 6.4.0.*/
359 #define DTAP_PD_MASK 0x0f
360 #define DTAP_SKIP_MASK 0xf0
361 #define DTAP_TI_MASK DTAP_SKIP_MASK
362 #define DTAP_TIE_PRES_MASK 0x07 /* after TI shifted to right */
363 #define DTAP_TIE_MASK 0x7f
365 #define DTAP_MM_IEI_MASK 0x3f
366 #define DTAP_CC_IEI_MASK 0x3f
367 #define DTAP_SMS_IEI_MASK 0xff
368 #define DTAP_SS_IEI_MASK 0x3f
369 #define DTAP_TP_IEI_MASK 0xff
371 /* Initialize the protocol and registered fields */
372 static int proto_a_dtap = -1;
374 static int hf_gsm_a_dtap_msg_mm_type = -1;
375 static int hf_gsm_a_dtap_msg_cc_type = -1;
376 static int hf_gsm_a_dtap_msg_sms_type = -1;
377 static int hf_gsm_a_dtap_msg_ss_type = -1;
378 static int hf_gsm_a_dtap_msg_tp_type = -1;
379 int hf_gsm_a_dtap_elem_id = -1;
380 static int hf_gsm_a_cld_party_bcd_num = -1;
381 static int hf_gsm_a_clg_party_bcd_num = -1;
382 static int hf_gsm_a_dtap_cause = -1;
384 int hf_gsm_a_extension = -1;
385 static int hf_gsm_a_type_of_number = -1;
386 static int hf_gsm_a_numbering_plan_id = -1;
388 static int hf_gsm_a_lsa_id = -1;
390 /* Initialize the subtree pointers */
391 static gint ett_dtap_msg = -1;
392 static gint ett_dtap_oct_1 = -1;
393 static gint ett_cm_srvc_type = -1;
394 static gint ett_gsm_enc_info = -1;
395 static gint ett_bc_oct_3a = -1;
396 static gint ett_bc_oct_4 = -1;
397 static gint ett_bc_oct_5 = -1;
398 static gint ett_bc_oct_5a = -1;
399 static gint ett_bc_oct_5b = -1;
400 static gint ett_bc_oct_6 = -1;
401 static gint ett_bc_oct_6a = -1;
402 static gint ett_bc_oct_6b = -1;
403 static gint ett_bc_oct_6c = -1;
404 static gint ett_bc_oct_6d = -1;
405 static gint ett_bc_oct_6e = -1;
406 static gint ett_bc_oct_6f = -1;
407 static gint ett_bc_oct_6g = -1;
408 static gint ett_bc_oct_7 = -1;
410 static char a_bigbuf[1024];
412 static dissector_handle_t data_handle;
413 static dissector_handle_t gsm_map_handle;
414 static dissector_handle_t gsm_bsslap_handle = NULL;
415 static dissector_handle_t dtap_handle;
416 static dissector_handle_t rp_handle;
418 packet_info *gsm_a_dtap_pinfo;
419 static proto_tree *g_tree;
422 * this should be set on a per message basis, if possible
424 static gint is_uplink;
426 #define NUM_GSM_DTAP_ELEM (sizeof(gsm_dtap_elem_strings)/sizeof(value_string))
427 gint ett_gsm_dtap_elem[NUM_GSM_DTAP_ELEM];
429 static dgt_set_t Dgt_mbcd = {
431 /* 0 1 2 3 4 5 6 7 8 9 a b c d e */
432 '0','1','2','3','4','5','6','7','8','9','*','#','a','b','c'
440 de_auth_param_rand(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
445 curr_offset = offset;
448 * 16 octets == 128 bits
450 #define AUTH_PARAM_RAND_LEN 16
452 proto_tree_add_text(tree,
453 tvb, curr_offset, AUTH_PARAM_RAND_LEN,
455 tvb_bytes_to_str(tvb, curr_offset, AUTH_PARAM_RAND_LEN));
457 curr_offset += AUTH_PARAM_RAND_LEN;
459 /* no length check possible */
461 return(curr_offset - offset);
468 de_auth_param_autn(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
472 curr_offset = offset;
474 proto_tree_add_text(tree,
475 tvb, curr_offset, len,
477 tvb_bytes_to_str(tvb, curr_offset, len));
481 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
483 return(curr_offset - offset);
490 de_auth_resp_param(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
495 curr_offset = offset;
498 * 4 octets == 32 bits
500 #define AUTH_PARAM_SRES_LEN 4
502 proto_tree_add_text(tree,
503 tvb, curr_offset, AUTH_PARAM_SRES_LEN,
505 tvb_bytes_to_str(tvb, curr_offset, AUTH_PARAM_SRES_LEN));
507 curr_offset += AUTH_PARAM_SRES_LEN;
509 /* no length check possible */
511 return(curr_offset - offset);
518 de_auth_resp_param_ext(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
522 curr_offset = offset;
524 proto_tree_add_text(tree,
525 tvb, curr_offset, len,
527 tvb_bytes_to_str(tvb, curr_offset, len));
531 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
533 return(curr_offset - offset);
540 de_auth_fail_param(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
544 curr_offset = offset;
546 proto_tree_add_text(tree,
547 tvb, curr_offset, len,
549 tvb_bytes_to_str(tvb, curr_offset, len));
553 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
555 return(curr_offset - offset);
562 de_network_name(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
568 curr_offset = offset;
570 oct = tvb_get_guint8(tvb, curr_offset);
572 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
574 switch ((oct & 0x70) >> 4)
576 case 0x00: str = "Cell Broadcast data coding scheme, GSM default alphabet, language unspecified, defined in 3GPP TS 03.38"; break;
577 case 0x01: str = "UCS2 (16 bit)"; break;
583 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
584 proto_tree_add_text(tree,
586 "%s : Coding Scheme: %s",
590 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
591 proto_tree_add_text(tree,
593 "%s : Add CI: The MS should %s",
596 "add the letters for the Country's Initials and a separator (e.g. a space) to the text string" :
597 "The MS should not add the letters for the Country's Initials to the text string");
601 case 1: str = "bit 8 is spare and set to '0' in octet n"; break;
602 case 2: str = "bits 7 and 8 are spare and set to '0' in octet n"; break;
603 case 3: str = "bits 6 to 8(inclusive) are spare and set to '0' in octet n"; break;
604 case 4: str = "bits 5 to 8(inclusive) are spare and set to '0' in octet n"; break;
605 case 5: str = "bits 4 to 8(inclusive) are spare and set to '0' in octet n"; break;
606 case 6: str = "bits 3 to 8(inclusive) are spare and set to '0' in octet n"; break;
607 case 7: str = "bits 2 to 8(inclusive) are spare and set to '0' in octet n"; break;
609 str = "this field carries no information about the number of spare bits in octet n";
613 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
614 proto_tree_add_text(tree,
616 "%s : Number of spare bits in last octet: %s",
622 NO_MORE_DATA_CHECK(len);
624 proto_tree_add_text(tree,
625 tvb, curr_offset, len - 1,
626 "Text string encoded according to Coding Scheme");
628 curr_offset += len - 1;
630 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
632 return(curr_offset - offset);
636 * [3] 10.5.3.6 Reject cause
639 de_rej_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
645 curr_offset = offset;
647 oct = tvb_get_guint8(tvb, curr_offset);
651 case 0x02: str = "IMSI unknown in HLR"; break;
652 case 0x03: str = "Illegal MS"; break;
653 case 0x04: str = "IMSI unknown in VLR"; break;
654 case 0x05: str = "IMEI not accepted"; break;
655 case 0x06: str = "Illegal ME"; break;
656 case 0x0b: str = "PLMN not allowed"; break;
657 case 0x0c: str = "Location Area not allowed"; break;
658 case 0x0d: str = "Roaming not allowed in this location area"; break;
659 case 0x0f: str = "No Suitable Cells In Location Area"; break;
660 case 0x11: str = "Network failure"; break;
661 case 0x14: str = "MAC failure"; break;
662 case 0x15: str = "Synch failure"; break;
663 case 0x16: str = "Congestion"; break;
664 case 0x17: str = "GSM authentication unacceptable"; break;
665 case 0x20: str = "Service option not supported"; break;
666 case 0x21: str = "Requested service option not subscribed"; break;
667 case 0x22: str = "Service option temporarily out of order"; break;
668 case 0x26: str = "Call cannot be identified"; break;
669 case 0x5f: str = "Semantically incorrect message"; break;
670 case 0x60: str = "Invalid mandatory information"; break;
671 case 0x61: str = "Message type non-existent or not implemented"; break;
672 case 0x62: str = "Message type not compatible with the protocol state"; break;
673 case 0x63: str = "Information element non-existent or not implemented"; break;
674 case 0x64: str = "Conditional IE error"; break;
675 case 0x65: str = "Message not compatible with the protocol state"; break;
676 case 0x6f: str = "Protocol error, unspecified"; break;
680 case IS_UPLINK_FALSE:
681 str = "Service option temporarily out of order";
684 str = "Protocol error, unspecified";
690 proto_tree_add_text(tree,
692 "Reject Cause value: 0x%02x (%u) %s",
699 /* no length check possible */
701 return(curr_offset - offset);
708 de_time_zone(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
714 curr_offset = offset;
716 /* 3GPP TS 23.040 version 6.6.0 Release 6
717 * 9.2.3.11 TP-Service-Centre-Time-Stamp (TP-SCTS)
719 * The Time Zone indicates the difference, expressed in quarters of an hour,
720 * between the local time and GMT. In the first of the two semi-octets,
721 * the first bit (bit 3 of the seventh octet of the TP-Service-Centre-Time-Stamp field)
722 * represents the algebraic sign of this difference (0: positive, 1: negative).
725 oct = tvb_get_guint8(tvb, curr_offset);
726 sign = (oct & 0x08)?'-':'+';
727 oct = (oct >> 4) + (oct & 0x07) * 10;
729 proto_tree_add_text(tree,
731 "Timezone: GMT %c %d hours %d minutes",
732 sign, oct / 4, oct % 4 * 15);
735 /* no length check possible */
737 return(curr_offset - offset);
744 de_time_zone_time(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
746 guint8 oct, oct2, oct3;
750 curr_offset = offset;
752 oct = tvb_get_guint8(tvb, curr_offset);
753 oct2 = tvb_get_guint8(tvb, curr_offset+1);
754 oct3 = tvb_get_guint8(tvb, curr_offset+2);
756 proto_tree_add_text(tree,
758 "Year %u%u, Month %u%u, Day %u%u",
768 oct = tvb_get_guint8(tvb, curr_offset);
769 oct2 = tvb_get_guint8(tvb, curr_offset+1);
770 oct3 = tvb_get_guint8(tvb, curr_offset+2);
772 proto_tree_add_text(tree,
774 "Hour %u%u, Minutes %u%u, Seconds %u%u",
784 /* 3GPP TS 23.040 version 6.6.0 Release 6
785 * 9.2.3.11 TP-Service-Centre-Time-Stamp (TP-SCTS)
787 * The Time Zone indicates the difference, expressed in quarters of an hour,
788 * between the local time and GMT. In the first of the two semi-octets,
789 * the first bit (bit 3 of the seventh octet of the TP-Service-Centre-Time-Stamp field)
790 * represents the algebraic sign of this difference (0: positive, 1: negative).
793 oct = tvb_get_guint8(tvb, curr_offset);
794 sign = (oct & 0x08)?'-':'+';
795 oct = (oct >> 4) + (oct & 0x07) * 10;
797 proto_tree_add_text(tree,
799 "Timezone: GMT %c %d hours %d minutes",
800 sign, oct / 4, oct % 4 * 15);
804 /* no length check possible */
806 return(curr_offset - offset);
810 * [3] 10.5.3.11 3GPP TS 24.008 version 6.8.0 Release 6
813 de_lsa_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
817 curr_offset = offset;
820 proto_tree_add_text(tree,tvb, curr_offset, len,"LSA ID not included");
822 proto_tree_add_item(tree, hf_gsm_a_lsa_id, tvb, curr_offset, 3, FALSE);
827 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
829 return(curr_offset - offset);
836 de_day_saving_time(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
842 curr_offset = offset;
844 oct = tvb_get_guint8(tvb, curr_offset);
846 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
847 proto_tree_add_text(tree,
854 case 0: str = "No adjustment for Daylight Saving Time"; break;
855 case 1: str = "+1 hour adjustment for Daylight Saving Time"; break;
856 case 2: str = "+2 hours adjustment for Daylight Saving Time"; break;
862 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
863 proto_tree_add_text(tree,
871 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
873 return(curr_offset - offset);
880 de_aux_states(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
886 curr_offset = offset;
888 oct = tvb_get_guint8(tvb, curr_offset);
890 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
892 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
893 proto_tree_add_text(tree,
898 switch ((oct & 0x0c) >> 2)
900 case 0: str = "Idle"; break;
901 case 1: str = "Hold request"; break;
902 case 2: str = "Call held"; break;
904 str = "Retrieve request";
908 other_decode_bitfield_value(a_bigbuf, oct, 0x0c, 8);
909 proto_tree_add_text(tree,
911 "%s : Hold auxiliary state: %s",
917 case 0: str = "Idle"; break;
918 case 1: str = "MPTY request"; break;
919 case 2: str = "Call in MPTY"; break;
921 str = "Split request";
925 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
926 proto_tree_add_text(tree,
928 "%s : Multi party auxiliary state: %s",
934 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
936 return(curr_offset - offset);
943 de_bearer_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
949 guint32 saved_offset;
954 #define DE_BC_ITC_SPEECH 0x00
955 #define DE_BC_ITC_UDI 0x01
956 #define DE_BC_ITC_EX_PLMN 0x02
957 #define DE_BC_ITC_FASC_G3 0x03
958 #define DE_BC_ITC_OTHER_ITC 0x05
959 #define DE_BC_ITC_RSVD_NET 0x07
961 curr_offset = offset;
963 oct = tvb_get_guint8(tvb, curr_offset);
968 * warning, bearer cap uses extended values that
969 * are reversed from other parameters!
971 extended = (oct & 0x80) ? FALSE : TRUE;
974 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
975 proto_tree_add_text(tree,
977 "%s : Extension: %s",
979 extended ? "extended" : "not extended");
983 case IS_UPLINK_FALSE:
989 * depends on Information transfer capability
993 case DE_BC_ITC_SPEECH:
996 switch ((oct & 0x60) >> 5)
998 case 1: str = "MS supports at least full rate speech version 1 but does not support half rate speech version 1"; break;
999 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;
1000 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;
1008 switch ((oct & 0x60) >> 5)
1010 case 1: str = "Full rate support only MS/fullrate speech version 1 supported"; break;
1011 case 2: str = "Dual rate support MS/half rate speech version 1 preferred, full rate speech version 1 also supported"; break;
1012 case 3: str = "Dual rate support MS/full rate speech version 1 preferred, half rate speech version 1 also supported"; break;
1021 switch ((oct & 0x60) >> 5)
1023 case 1: str = "Full rate support only MS"; break;
1024 case 2: str = "Dual rate support MS/half rate preferred"; break;
1025 case 3: str = "Dual rate support MS/full rate preferred"; break;
1035 str = "(dissect problem)";
1039 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
1040 proto_tree_add_text(tree,
1041 tvb, curr_offset, 1,
1042 "%s : Radio channel requirement: %s",
1046 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1047 proto_tree_add_text(tree,
1048 tvb, curr_offset, 1,
1049 "%s : Coding standard: %s",
1051 (oct & 0x10) ? "reserved" : "GSM standardized coding");
1053 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1054 proto_tree_add_text(tree,
1055 tvb, curr_offset, 1,
1056 "%s : Transfer mode: %s",
1058 (oct & 0x08) ? "packet" : "circuit");
1062 case DE_BC_ITC_SPEECH: str = "Speech"; break;
1063 case DE_BC_ITC_UDI: str = "Unrestricted digital information"; break;
1064 case DE_BC_ITC_EX_PLMN: str = "3.1 kHz audio, ex PLMN"; break;
1065 case DE_BC_ITC_FASC_G3: str = "Facsimile group 3"; break;
1066 case DE_BC_ITC_OTHER_ITC: str = "Other ITC (See Octet 5a)"; break;
1067 case DE_BC_ITC_RSVD_NET: str = "Reserved, to be used in the network"; break;
1073 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1074 proto_tree_add_text(tree,
1075 tvb, curr_offset, 1,
1076 "%s : Information transfer capability: %s",
1081 g_snprintf(add_string, string_len, " - (%s)", str);
1085 NO_MORE_DATA_CHECK(len);
1089 case DE_BC_ITC_SPEECH:
1093 proto_tree_add_text(tree,
1094 tvb, curr_offset, -1,
1095 "Octets 3a - Speech Versions");
1097 subtree = proto_item_add_subtree(item, ett_bc_oct_3a);
1099 saved_offset = curr_offset;
1103 oct = tvb_get_guint8(tvb, curr_offset);
1105 extended = (oct & 0x80) ? FALSE : TRUE;
1107 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1108 proto_tree_add_text(subtree,
1109 tvb, curr_offset, 1,
1110 "%s : Extension: %s",
1112 extended ? "extended" : "not extended");
1114 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1115 proto_tree_add_text(subtree,
1116 tvb, curr_offset, 1,
1117 "%s : Coding: octet used for %s",
1119 (oct & 0x40) ? "other extension of octet 3" :
1120 "extension of information transfer capability");
1122 other_decode_bitfield_value(a_bigbuf, oct, 0x30, 8);
1123 proto_tree_add_text(subtree,
1124 tvb, curr_offset, 1,
1130 case 0: str = "GSM full rate speech version 1"; break;
1131 case 2: str = "GSM full rate speech version 2"; break;
1132 case 4: str = "GSM full rate speech version 3"; break;
1133 case 1: str = "GSM half rate speech version 1"; break;
1134 case 5: str = "GSM half rate speech version 3"; break;
1136 str = "Speech version TBD";
1140 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
1141 proto_tree_add_text(subtree,
1142 tvb, curr_offset, 1,
1143 "%s : Speech version indication: %s",
1150 ((len - (curr_offset - offset)) > 0));
1152 proto_item_set_len(item, curr_offset - saved_offset);
1159 proto_tree_add_text(tree,
1160 tvb, curr_offset, 1,
1163 subtree = proto_item_add_subtree(item, ett_bc_oct_4);
1165 oct = tvb_get_guint8(tvb, curr_offset);
1167 extended = (oct & 0x80) ? FALSE : TRUE;
1169 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1170 proto_tree_add_text(subtree,
1171 tvb, curr_offset, 1,
1172 "%s : Extension: %s",
1174 extended ? "extended" : "not extended");
1176 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1177 proto_tree_add_text(subtree,
1178 tvb, curr_offset, 1,
1179 "%s : Compression: data compression %s%s",
1181 (oct & 0x40) ? "" : "not ",
1182 is_uplink ? "allowed" : "possible");
1184 switch ((oct & 0x30) >> 4)
1186 case 0x00: str = "Service data unit integrity"; break;
1187 case 0x03: str = "Unstructured"; break;
1193 other_decode_bitfield_value(a_bigbuf, oct, 0x30, 8);
1194 proto_tree_add_text(subtree,
1195 tvb, curr_offset, 1,
1196 "%s : Structure: %s",
1200 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1201 proto_tree_add_text(subtree,
1202 tvb, curr_offset, 1,
1203 "%s : Duplex mode: %s",
1205 (oct & 0x08) ? "Full" : "Half");
1207 other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
1208 proto_tree_add_text(subtree,
1209 tvb, curr_offset, 1,
1210 "%s : Configuration: %s",
1212 (oct & 0x04) ? "Reserved" : "Point-to-point");
1214 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
1215 proto_tree_add_text(subtree,
1216 tvb, curr_offset, 1,
1220 "Data up to and including 4.8 kb/s, full rate, non-transparent, 6 kb/s radio interface rate is requested" :
1221 "No meaning is associated with this value");
1223 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1224 proto_tree_add_text(subtree,
1225 tvb, curr_offset, 1,
1226 "%s : Establishment: %s",
1228 (oct & 0x01) ? "Reserved" : "Demand");
1232 NO_MORE_DATA_CHECK(len);
1237 proto_tree_add_text(tree,
1238 tvb, curr_offset, 1,
1241 subtree = proto_item_add_subtree(item, ett_bc_oct_5);
1243 oct = tvb_get_guint8(tvb, curr_offset);
1245 extended = (oct & 0x80) ? FALSE : TRUE;
1247 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1248 proto_tree_add_text(subtree,
1249 tvb, curr_offset, 1,
1250 "%s : Extension: %s",
1252 extended ? "extended" : "not extended");
1254 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
1255 proto_tree_add_text(subtree,
1256 tvb, curr_offset, 1,
1257 "%s : Access Identity: %s",
1259 (oct & 0x60) ? "Reserved" : "Octet identifier");
1261 switch ((oct & 0x18) >> 3)
1263 case 0x00: str = "No rate adaption"; break;
1264 case 0x01: str = "V.110, I.460/X.30 rate adaptation"; break;
1265 case 0x02: str = "ITU-T X.31 flag stuffing"; break;
1267 str = "Other rate adaption (see octet 5a)";
1271 other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
1272 proto_tree_add_text(subtree,
1273 tvb, curr_offset, 1,
1274 "%s : Rate Adaption: %s",
1280 case 0x01: str = "I.440/450"; break;
1281 case 0x02: str = "Reserved: was allocated in earlier phases of the protocol"; break;
1282 case 0x03: str = "Reserved: was allocated in earlier phases of the protocol"; break;
1283 case 0x04: str = "Reserved: was allocated in earlier phases of the protocol"; break;
1284 case 0x05: str = "Reserved: was allocated in earlier phases of the protocol"; break;
1285 case 0x06: str = "Reserved: was allocated in earlier phases of the protocol"; break;
1291 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1292 proto_tree_add_text(subtree,
1293 tvb, curr_offset, 1,
1294 "%s : Signalling Access Protocol: %s",
1300 NO_MORE_DATA_CHECK(len);
1302 if (!extended) goto bc_octet_6;
1307 proto_tree_add_text(tree,
1308 tvb, curr_offset, 1,
1311 subtree = proto_item_add_subtree(item, ett_bc_oct_5a);
1313 oct = tvb_get_guint8(tvb, curr_offset);
1315 extended = (oct & 0x80) ? FALSE : TRUE;
1317 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1318 proto_tree_add_text(subtree,
1319 tvb, curr_offset, 1,
1320 "%s : Extension: %s",
1322 extended ? "extended" : "not extended");
1324 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
1325 proto_tree_add_text(subtree,
1326 tvb, curr_offset, 1,
1327 "%s : Other ITC: %s",
1329 (oct & 0x60) ? "Reserved" : "Restricted digital information");
1331 switch ((oct & 0x18) >> 3)
1333 case 0x00: str = "V.120"; break;
1334 case 0x01: str = "H.223 & H.245"; break;
1335 case 0x02: str = "PIAFS"; break;
1341 other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
1342 proto_tree_add_text(subtree,
1343 tvb, curr_offset, 1,
1344 "%s : Other Rate Adaption: %s",
1348 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1349 proto_tree_add_text(subtree,
1350 tvb, curr_offset, 1,
1356 NO_MORE_DATA_CHECK(len);
1358 if (!extended) goto bc_octet_6;
1363 proto_tree_add_text(tree,
1364 tvb, curr_offset, 1,
1367 subtree = proto_item_add_subtree(item, ett_bc_oct_5b);
1369 oct = tvb_get_guint8(tvb, curr_offset);
1371 extended = (oct & 0x80) ? FALSE : TRUE;
1373 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1374 proto_tree_add_text(subtree,
1375 tvb, curr_offset, 1,
1376 "%s : Extension: %s",
1378 extended ? "extended" : "not extended");
1380 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1381 proto_tree_add_text(subtree,
1382 tvb, curr_offset, 1,
1383 "%s : Rate Adaption Header: %sincluded",
1385 (oct & 0x40) ? "" : "not ");
1387 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
1388 proto_tree_add_text(subtree,
1389 tvb, curr_offset, 1,
1390 "%s : Multiple frame establishment support in data link: %s",
1392 (oct & 0x20) ? "Supported" : "Not supported, only UI frames allowed");
1394 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1395 proto_tree_add_text(subtree,
1396 tvb, curr_offset, 1,
1397 "%s : Mode of operation: %s",
1399 (oct & 0x10) ? "Protocol sensitive" : "Bit transparent");
1401 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1402 proto_tree_add_text(subtree,
1403 tvb, curr_offset, 1,
1404 "%s : Logical link identifier negotiation: %s",
1406 (oct & 0x08) ? "Full protocol negotiation" : "Default, LLI=256 only");
1408 other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
1409 proto_tree_add_text(subtree,
1410 tvb, curr_offset, 1,
1411 "%s : Assignor/Assignee: Message originator is '%s'",
1413 (oct & 0x04) ? "assignor only" : "default assignee");
1415 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
1416 proto_tree_add_text(subtree,
1417 tvb, curr_offset, 1,
1418 "%s : In band/Out of band negotiation: Negotiation is done %s",
1421 "with USER INFORMATION messages on a temporary signalling connection" :
1422 "in-band using logical link zero");
1424 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1425 proto_tree_add_text(subtree,
1426 tvb, curr_offset, 1,
1432 NO_MORE_DATA_CHECK(len);
1439 proto_tree_add_text(tree,
1440 tvb, curr_offset, 1,
1443 subtree = proto_item_add_subtree(item, ett_bc_oct_6);
1445 oct = tvb_get_guint8(tvb, curr_offset);
1447 extended = (oct & 0x80) ? FALSE : TRUE;
1449 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1450 proto_tree_add_text(subtree,
1451 tvb, curr_offset, 1,
1452 "%s : Extension: %s",
1454 extended ? "extended" : "not extended");
1456 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
1457 proto_tree_add_text(subtree,
1458 tvb, curr_offset, 1,
1459 "%s : Layer 1 Identity: %s",
1461 ((oct & 0x60) == 0x20) ? "Octet identifier" : "Reserved");
1463 other_decode_bitfield_value(a_bigbuf, oct, 0x1e, 8);
1464 proto_tree_add_text(subtree,
1465 tvb, curr_offset, 1,
1466 "%s : User information layer 1 protocol: %s",
1468 (oct & 0x1e) ? "Reserved" : "Default layer 1 protocol");
1470 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1471 proto_tree_add_text(subtree,
1472 tvb, curr_offset, 1,
1473 "%s : Synchronous/asynchronous: %s",
1475 (oct & 0x01) ? "Asynchronous" : "Synchronous");
1479 NO_MORE_DATA_CHECK(len);
1481 if (!extended) goto bc_octet_7;
1486 proto_tree_add_text(tree,
1487 tvb, curr_offset, 1,
1490 subtree = proto_item_add_subtree(item, ett_bc_oct_6a);
1492 oct = tvb_get_guint8(tvb, curr_offset);
1494 extended = (oct & 0x80) ? FALSE : TRUE;
1496 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1497 proto_tree_add_text(subtree,
1498 tvb, curr_offset, 1,
1499 "%s : Extension: %s",
1501 extended ? "extended" : "not extended");
1503 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1504 proto_tree_add_text(subtree,
1505 tvb, curr_offset, 1,
1506 "%s : Number of Stop Bits: %s",
1508 (oct & 0x40) ? "2" : "1");
1510 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
1511 proto_tree_add_text(subtree,
1512 tvb, curr_offset, 1,
1513 "%s : Negotiation: %s",
1515 (oct & 0x20) ? "Reserved" : "In-band negotiation not possible");
1517 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1518 proto_tree_add_text(subtree,
1519 tvb, curr_offset, 1,
1520 "%s : Number of data bits excluding parity bit if present: %s",
1522 (oct & 0x10) ? "8" : "7");
1526 case 0x01: str = "0.3 kbit/s Recommendation X.1 and V.110"; break;
1527 case 0x02: str = "1.2 kbit/s Recommendation X.1 and V.110"; break;
1528 case 0x03: str = "2.4 kbit/s Recommendation X.1 and V.110"; break;
1529 case 0x04: str = "4.8 kbit/s Recommendation X.1 and V.110"; break;
1530 case 0x05: str = "9.6 kbit/s Recommendation X.1 and V.110"; break;
1531 case 0x06: str = "12.0 kbit/s transparent (non compliance with X.1 and V.110)"; break;
1532 case 0x07: str = "Reserved: was allocated in earlier phases of the protocol"; break;
1538 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
1539 proto_tree_add_text(subtree,
1540 tvb, curr_offset, 1,
1541 "%s : User rate: %s",
1547 NO_MORE_DATA_CHECK(len);
1549 if (!extended) goto bc_octet_7;
1554 proto_tree_add_text(tree,
1555 tvb, curr_offset, 1,
1558 subtree = proto_item_add_subtree(item, ett_bc_oct_6b);
1560 oct = tvb_get_guint8(tvb, curr_offset);
1562 extended = (oct & 0x80) ? FALSE : TRUE;
1564 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1565 proto_tree_add_text(subtree,
1566 tvb, curr_offset, 1,
1567 "%s : Extension: %s",
1569 extended ? "extended" : "not extended");
1571 switch ((oct & 0x60) >> 5)
1573 case 0x02: str = "8 kbit/s"; break;
1574 case 0x03: str = "16 kbit/s"; break;
1580 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
1581 proto_tree_add_text(subtree,
1582 tvb, curr_offset, 1,
1583 "%s : V.110/X.30 rate adaptation Intermediate rate: %s",
1587 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1588 proto_tree_add_text(subtree,
1589 tvb, curr_offset, 1,
1590 "%s : Network independent clock (NIC) on transmission (Tx): %s to send data with network independent clock",
1592 (oct & 0x10) ? "requires" : "does not require");
1594 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1595 proto_tree_add_text(subtree,
1596 tvb, curr_offset, 1,
1597 "%s : Network independent clock (NIC) on reception (Rx): %s accept data with network independent clock",
1599 (oct & 0x08) ? "can" : "cannot");
1603 case 0x00: str = "Odd"; break;
1604 case 0x02: str = "Even"; break;
1605 case 0x03: str = "None"; break;
1606 case 0x04: str = "Forced to 0"; break;
1607 case 0x05: str = "Forced to 1"; break;
1613 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1614 proto_tree_add_text(subtree,
1615 tvb, curr_offset, 1,
1616 "%s : Parity information: %s",
1622 NO_MORE_DATA_CHECK(len);
1624 if (!extended) goto bc_octet_7;
1629 proto_tree_add_text(tree,
1630 tvb, curr_offset, 1,
1633 subtree = proto_item_add_subtree(item, ett_bc_oct_6c);
1635 oct = tvb_get_guint8(tvb, curr_offset);
1637 extended = (oct & 0x80) ? FALSE : TRUE;
1639 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1640 proto_tree_add_text(subtree,
1641 tvb, curr_offset, 1,
1642 "%s : Extension: %s",
1644 extended ? "extended" : "not extended");
1646 switch ((oct & 0x60) >> 5)
1648 case 0x01: str = "Non transparent (RLP)"; break;
1649 case 0x02: str = "Both, transparent preferred"; break;
1650 case 0x03: str = "Both, non transparent preferred"; break;
1652 str = "Transparent";
1656 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
1657 proto_tree_add_text(subtree,
1658 tvb, curr_offset, 1,
1659 "%s : Connection element: %s",
1665 case 0x00: str = "None"; break;
1666 case 0x01: str = "V.21"; break;
1667 case 0x02: str = "V.22"; break;
1668 case 0x03: str = "V.22 bis"; break;
1669 case 0x04: str = "Reserved: was allocated in earlier phases of the protocol"; break;
1670 case 0x05: str = "V.26 ter"; break;
1671 case 0x06: str = "V.32"; break;
1672 case 0x07: str = "Modem for undefined interface"; break;
1673 case 0x08: str = "Autobauding type 1"; break;
1679 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
1680 proto_tree_add_text(subtree,
1681 tvb, curr_offset, 1,
1682 "%s : Modem type: %s",
1688 NO_MORE_DATA_CHECK(len);
1690 if (!extended) goto bc_octet_7;
1695 proto_tree_add_text(tree,
1696 tvb, curr_offset, 1,
1699 subtree = proto_item_add_subtree(item, ett_bc_oct_6d);
1701 oct = tvb_get_guint8(tvb, curr_offset);
1703 extended = (oct & 0x80) ? FALSE : TRUE;
1705 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1706 proto_tree_add_text(subtree,
1707 tvb, curr_offset, 1,
1708 "%s : Extension: %s",
1710 extended ? "extended" : "not extended");
1712 switch ((oct & 0x60) >> 5)
1714 case 0x00: str = "No other modem type specified in this field"; break;
1715 case 0x02: str = "V.34"; break;
1721 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
1722 proto_tree_add_text(subtree,
1723 tvb, curr_offset, 1,
1724 "%s : Other modem type: %s",
1730 case 0x00: str = "Fixed network user rate not applicable/No meaning is associated with this value"; break;
1731 case 0x01: str = "9.6 kbit/s Recommendation X.1 and V.110"; break;
1732 case 0x02: str = "14.4 kbit/s Recommendation X.1 and V.110"; break;
1733 case 0x03: str = "19.2 kbit/s Recommendation X.1 and V.110"; break;
1734 case 0x04: str = "28.8 kbit/s Recommendation X.1 and V.110"; break;
1735 case 0x05: str = "38.4 kbit/s Recommendation X.1 and V.110"; break;
1736 case 0x06: str = "48.0 kbit/s Recommendation X.1 and V.110(synch)"; break;
1737 case 0x07: str = "56.0 kbit/s Recommendation X.1 and V.110(synch) /bit transparent"; break;
1738 case 0x08: str = "64.0 kbit/s bit transparent"; break;
1739 case 0x09: str = "33.6 kbit/s bit transparent"; break;
1740 case 0x0a: str = "32.0 kbit/s Recommendation I.460"; break;
1741 case 0x0b: str = "31.2 kbit/s Recommendation V.34"; break;
1747 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
1748 proto_tree_add_text(subtree,
1749 tvb, curr_offset, 1,
1750 "%s : Fixed network user rate: %s",
1756 NO_MORE_DATA_CHECK(len);
1758 if (!extended) goto bc_octet_7;
1763 proto_tree_add_text(tree,
1764 tvb, curr_offset, 1,
1767 subtree = proto_item_add_subtree(item, ett_bc_oct_6e);
1769 oct = tvb_get_guint8(tvb, curr_offset);
1771 extended = (oct & 0x80) ? FALSE : TRUE;
1773 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1774 proto_tree_add_text(subtree,
1775 tvb, curr_offset, 1,
1776 "%s : Extension: %s",
1778 extended ? "extended" : "not extended");
1780 if (is_uplink == IS_UPLINK_TRUE)
1782 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1783 proto_tree_add_text(subtree,
1784 tvb, curr_offset, 1,
1785 "%s : Acceptable channel codings: TCH/F14.4 %sacceptable",
1787 (oct & 0x40) ? "" : "not ");
1789 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
1790 proto_tree_add_text(subtree,
1791 tvb, curr_offset, 1,
1792 "%s : Acceptable channel codings: Spare",
1795 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1796 proto_tree_add_text(subtree,
1797 tvb, curr_offset, 1,
1798 "%s : Acceptable channel codings: TCH/F9.6 %sacceptable",
1800 (oct & 0x10) ? "" : "not ");
1802 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1803 proto_tree_add_text(subtree,
1804 tvb, curr_offset, 1,
1805 "%s : Acceptable channel codings: TCH/F4.8 %sacceptable",
1807 (oct & 0x08) ? "" : "not ");
1809 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1810 proto_tree_add_text(subtree,
1811 tvb, curr_offset, 1,
1812 "%s : Maximum number of traffic channels: %u TCH",
1818 other_decode_bitfield_value(a_bigbuf, oct, 0x78, 8);
1819 proto_tree_add_text(subtree,
1820 tvb, curr_offset, 1,
1821 "%s : Acceptable channel codings: Spare",
1824 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1825 proto_tree_add_text(subtree,
1826 tvb, curr_offset, 1,
1827 "%s : Maximum number of traffic channels: Spare",
1833 NO_MORE_DATA_CHECK(len);
1835 if (!extended) goto bc_octet_7;
1840 proto_tree_add_text(tree,
1841 tvb, curr_offset, 1,
1844 subtree = proto_item_add_subtree(item, ett_bc_oct_6f);
1846 oct = tvb_get_guint8(tvb, curr_offset);
1848 extended = (oct & 0x80) ? FALSE : TRUE;
1850 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1851 proto_tree_add_text(subtree,
1852 tvb, curr_offset, 1,
1853 "%s : Extension: %s",
1855 extended ? "extended" : "not extended");
1857 switch ((oct & 0x70) >> 4)
1859 case 0x00: str = "not allowed/required/applicable"; break;
1860 case 0x01: str = "up to 1 TCH/F allowed/may be requested"; break;
1861 case 0x02: str = "up to 2 TCH/F allowed/may be requested"; break;
1862 case 0x03: str = "up to 3 TCH/F allowed/may be requested"; break;
1863 case 0x04: str = "up to 4 TCH/F allowed/may be requested"; break;
1865 str = "up to 4 TCH/F may be requested";
1869 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
1870 proto_tree_add_text(subtree,
1871 tvb, curr_offset, 1,
1872 "%s : UIMI, User initiated modification indication: %s",
1876 if (is_uplink == IS_UPLINK_TRUE)
1880 case 0x00: str = "Air interface user rate not applicable/No meaning associated with this value"; break;
1881 case 0x01: str = "9.6 kbit/s"; break;
1882 case 0x02: str = "14.4 kbit/s"; break;
1883 case 0x03: str = "19.2 kbit/s"; break;
1884 case 0x05: str = "28.8 kbit/s"; break;
1885 case 0x06: str = "38.4 kbit/s"; break;
1886 case 0x07: str = "43.2 kbit/s"; break;
1887 case 0x08: str = "57.6 kbit/s"; break;
1888 case 0x09: str = "interpreted by the network as 38.4 kbit/s in this version of the protocol"; break;
1889 case 0x0a: str = "interpreted by the network as 38.4 kbit/s in this version of the protocol"; break;
1890 case 0x0b: str = "interpreted by the network as 38.4 kbit/s in this version of the protocol"; break;
1891 case 0x0c: str = "interpreted by the network as 38.4 kbit/s in this version of the protocol"; break;
1897 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
1898 proto_tree_add_text(subtree,
1899 tvb, curr_offset, 1,
1900 "%s : Wanted air interface user rate: %s",
1906 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
1907 proto_tree_add_text(subtree,
1908 tvb, curr_offset, 1,
1909 "%s : Wanted air interface user rate: Spare",
1915 NO_MORE_DATA_CHECK(len);
1917 if (!extended) goto bc_octet_7;
1922 proto_tree_add_text(tree,
1923 tvb, curr_offset, 1,
1926 subtree = proto_item_add_subtree(item, ett_bc_oct_6g);
1928 oct = tvb_get_guint8(tvb, curr_offset);
1930 extended = (oct & 0x80) ? FALSE : TRUE;
1932 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1933 proto_tree_add_text(subtree,
1934 tvb, curr_offset, 1,
1935 "%s : Extension: %s",
1937 extended ? "extended" : "not extended");
1939 if (is_uplink == IS_UPLINK_TRUE)
1941 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1942 proto_tree_add_text(subtree,
1943 tvb, curr_offset, 1,
1944 "%s : Acceptable channel codings extended: TCH/F28.8 %sacceptable",
1946 (oct & 0x40) ? "" : "not ");
1948 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
1949 proto_tree_add_text(subtree,
1950 tvb, curr_offset, 1,
1951 "%s : Acceptable channel codings extended: TCH/F32.0 %sacceptable",
1953 (oct & 0x20) ? "" : "not ");
1955 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1956 proto_tree_add_text(subtree,
1957 tvb, curr_offset, 1,
1958 "%s : Acceptable channel codings extended: TCH/F43.2 %sacceptable",
1960 (oct & 0x10) ? "" : "not ");
1962 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1963 proto_tree_add_text(subtree,
1964 tvb, curr_offset, 1,
1965 "%s : Acceptable channel codings extended: TCH/F43.2 %sacceptable",
1967 (oct & 0x10) ? "" : "not ");
1969 switch ((oct & 0x0c) >> 2)
1971 case 0: str = "Channel coding symmetry preferred"; break;
1972 case 2: str = "Downlink biased channel coding asymmetry is preferred"; break;
1973 case 1: str = "Uplink biased channel coding asymmetry is preferred"; break;
1975 str = "Unused, treat as Channel coding symmetry preferred";
1979 other_decode_bitfield_value(a_bigbuf, oct, 0x0c, 8);
1980 proto_tree_add_text(subtree,
1981 tvb, curr_offset, 1,
1982 "%s : Channel Coding Asymmetry Indication: %s",
1988 other_decode_bitfield_value(a_bigbuf, oct, 0x7c, 8);
1989 proto_tree_add_text(subtree,
1990 tvb, curr_offset, 1,
1991 "%s : EDGE Channel Codings: Spare",
1995 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
1996 proto_tree_add_text(subtree,
1997 tvb, curr_offset, 1,
2003 NO_MORE_DATA_CHECK(len);
2009 proto_tree_add_text(tree,
2010 tvb, curr_offset, 1,
2013 subtree = proto_item_add_subtree(item, ett_bc_oct_7);
2014 extended = (oct & 0x80) ? FALSE : TRUE;
2015 oct = tvb_get_guint8(tvb, curr_offset);
2016 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2017 proto_tree_add_text(subtree,
2018 tvb, curr_offset, 1,
2019 "%s : Extension: %s",
2021 extended ? "extended" : "not extended");
2023 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
2024 proto_tree_add_text(subtree,
2025 tvb, curr_offset, 1,
2026 "%s : Layer 2 Identity: %s",
2028 ((oct & 0x60) == 0x40) ? "Octet identifier" : "Reserved");
2032 case 0x06: str = "Reserved: was allocated in earlier phases of the protocol"; break;
2033 case 0x08: str = "ISO 6429, codeset 0 (DC1/DC3)"; break;
2034 case 0x09: str = "Reserved: was allocated but never used in earlier phases of the protocol"; break;
2035 case 0x0a: str = "Videotex profile 1"; break;
2036 case 0x0c: str = "COPnoFlCt (Character oriented Protocol with no Flow Control mechanism)"; break;
2037 case 0x0d: str = "Reserved: was allocated in earlier phases of the protocol"; break;
2043 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
2044 proto_tree_add_text(subtree,
2045 tvb, curr_offset, 1,
2046 "%s : User information layer 2 protocol: %s",
2052 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2054 return(curr_offset - offset);
2061 de_cc_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2064 guint32 curr_offset;
2066 curr_offset = offset;
2068 oct = tvb_get_guint8(tvb, curr_offset);
2070 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
2072 switch ((oct & 0xf0) >> 4)
2075 proto_tree_add_text(tree,
2076 tvb, curr_offset, 1,
2077 "%s : Maximum number of supported bearers: 1",
2082 proto_tree_add_text(tree,
2083 tvb, curr_offset, 1,
2084 "%s : Maximum number of supported bearers: %u",
2090 other_decode_bitfield_value(a_bigbuf, oct, 0x0c, 8);
2091 proto_tree_add_text(tree,
2092 tvb, curr_offset, 1,
2096 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
2097 proto_tree_add_text(tree,
2098 tvb, curr_offset, 1,
2099 "%s : PCP: the mobile station %s the Prolonged Clearing Procedure",
2101 (oct & 0x02) ? "supports" : "does not support");
2103 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
2104 proto_tree_add_text(tree,
2105 tvb, curr_offset, 1,
2109 "the mobile station supports DTMF as specified in subclause 5.5.7 of TS 24.008" :
2110 "reserved for earlier versions of the protocol");
2114 NO_MORE_DATA_CHECK(len);
2116 oct = tvb_get_guint8(tvb, curr_offset);
2118 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
2119 proto_tree_add_text(tree,
2120 tvb, curr_offset, 1,
2124 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2125 proto_tree_add_text(tree,
2126 tvb, curr_offset, 1,
2127 "%s : Maximum number of speech bearers: %u",
2133 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2135 return(curr_offset - offset);
2142 de_call_state(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2145 guint32 curr_offset;
2146 proto_tree *subtree;
2150 curr_offset = offset;
2152 oct = tvb_get_guint8(tvb, curr_offset);
2155 proto_tree_add_text(tree,
2156 tvb, curr_offset, 1,
2157 gsm_dtap_elem_strings[DE_CALL_STATE].strptr);
2159 subtree = proto_item_add_subtree(item, ett_gsm_dtap_elem[DE_CALL_STATE]);
2161 switch ((oct & 0xc0) >> 6)
2163 case 0: str = "Coding as specified in ITU-T Rec. Q.931"; break;
2164 case 1: str = "Reserved for other international standards"; break;
2165 case 2: str = "National standard"; break;
2167 str = "Standard defined for the GSM PLMNS";
2171 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
2172 proto_tree_add_text(subtree,
2173 tvb, curr_offset, 1,
2174 "%s : Coding standard: %s",
2180 case 0x00: str = "UO - null NO - null"; break;
2181 case 0x02: str = "U0.1- MM connection pending N0.1- MM connection pending"; break;
2182 case 0x22: str = "U0.2- CC prompt present N0.2- CC connection pending"; break;
2183 case 0x23: str = "U0.3- Wait for network information N0.3- Network answer pending"; break;
2184 case 0x24: str = "U0.4- CC-Establishment present N0.4- CC-Establishment present"; break;
2185 case 0x25: str = "U0.5- CC-Establishment confirmed N0.5- CC-Establishment confirmed"; break;
2186 case 0x26: str = "U0.6- Recall present N0.6- Recall present"; break;
2187 case 0x01: str = "U1 - call initiated N1 - call initiated"; break;
2188 case 0x03: str = "U3 - mobile originating call proceeding N3 - mobile originating call proceeding"; break;
2189 case 0x04: str = "U4 - call delivered N4 - call delivered"; break;
2190 case 0x06: str = "U6 - call present N6 - call present"; break;
2191 case 0x07: str = "U7 - call received N7 - call received"; break;
2192 case 0x08: str = "U8 - connect request N8 - connect request"; break;
2193 case 0x09: str = "U9 - mobile terminating call confirmed N9 - mobile terminating call confirmed"; break;
2194 case 0x0a: str = "U10- active N10- active"; break;
2195 case 0x0b: str = "U11- disconnect request"; break;
2196 case 0x0c: str = "U12- disconnect indication N12-disconnect indication"; break;
2197 case 0x13: str = "U19- release request N19- release request"; break;
2198 case 0x1a: str = "U26- mobile originating modify N26- mobile originating modify"; break;
2199 case 0x1b: str = "U27- mobile terminating modify N27- mobile terminating modify"; break;
2200 case 0x1c: str = " N28- connect indication"; break;
2206 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
2207 proto_tree_add_text(subtree,
2208 tvb, curr_offset, 1,
2209 "%s : Call state value: %s",
2215 /* no length check possible */
2217 return(curr_offset - offset);
2220 static const true_false_string gsm_a_extension_value = {
2225 const value_string gsm_a_type_of_number_values[] = {
2226 { 0x00, "unknown" },
2227 { 0x01, "International Number" },
2228 { 0x02, "National number" },
2229 { 0x03, "Network Specific Number" },
2230 { 0x04, "Dedicated access, short code" },
2231 { 0x05, "Reserved" },
2232 { 0x06, "Reserved" },
2233 { 0x07, "Reserved for extension" },
2237 const value_string gsm_a_numbering_plan_id_values[] = {
2238 { 0x00, "unknown" },
2239 { 0x01, "ISDN/Telephony Numbering (Rec ITU-T E.164)" },
2241 { 0x03, "Data Numbering (ITU-T Rec. X.121)" },
2242 { 0x04, "Telex Numbering (ITU-T Rec. F.69)" },
2243 { 0x08, "National Numbering" },
2244 { 0x09, "Private Numbering" },
2245 { 0x0d, "reserved for CTS (see 3GPP TS 44.056 [91])" },
2246 { 0x0f, "Reserved for extension" },
2254 de_cld_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2257 guint32 curr_offset;
2259 curr_offset = offset;
2261 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
2262 proto_tree_add_item(tree, hf_gsm_a_type_of_number , tvb, curr_offset, 1, FALSE);
2263 proto_tree_add_item(tree, hf_gsm_a_numbering_plan_id , tvb, curr_offset, 1, FALSE);
2267 NO_MORE_DATA_CHECK(len);
2269 poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
2271 my_dgt_tbcd_unpack(a_bigbuf, poctets, len - (curr_offset - offset),
2274 proto_tree_add_string_format(tree, hf_gsm_a_cld_party_bcd_num,
2275 tvb, curr_offset, len - (curr_offset - offset),
2280 if (sccp_assoc && ! sccp_assoc->called_party) {
2281 sccp_assoc->called_party = se_strdup(a_bigbuf);
2284 curr_offset += len - (curr_offset - offset);
2287 g_snprintf(add_string, string_len, " - (%s)", a_bigbuf);
2289 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2291 return(curr_offset - offset);
2298 de_cld_party_sub_addr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2301 guint32 curr_offset;
2304 curr_offset = offset;
2306 oct = tvb_get_guint8(tvb, curr_offset);
2308 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
2310 switch ((oct & 0x70) >> 4)
2312 case 0: str = "NSAP (X.213/ISO 8348 AD2)"; break;
2313 case 2: str = "User specified"; break;
2319 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
2320 proto_tree_add_text(tree,
2321 tvb, curr_offset, 1,
2322 "%s : Type of subaddress: %s",
2326 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
2327 proto_tree_add_text(tree,
2328 tvb, curr_offset, 1,
2329 "%s : Odd/Even indicator: %s",
2332 "odd number of address signals" : "even number of address signals");
2334 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2335 proto_tree_add_text(tree,
2336 tvb, curr_offset, 1,
2342 NO_MORE_DATA_CHECK(len);
2344 proto_tree_add_text(tree,
2345 tvb, curr_offset, len - (curr_offset - offset),
2346 "Subaddress information");
2348 curr_offset += len - (curr_offset - offset);
2350 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2352 return(curr_offset - offset);
2359 de_clg_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2363 guint32 curr_offset;
2366 curr_offset = offset;
2368 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
2369 proto_tree_add_item(tree, hf_gsm_a_type_of_number , tvb, curr_offset, 1, FALSE);
2370 proto_tree_add_item(tree, hf_gsm_a_numbering_plan_id , tvb, curr_offset, 1, FALSE);
2374 oct = tvb_get_guint8(tvb, curr_offset);
2376 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
2378 switch ((oct & 0x60) >> 5)
2380 case 0: str = "Presentation allowed"; break;
2381 case 1: str = "Presentation restricted"; break;
2382 case 2: str = "Number not available due to interworking"; break;
2388 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
2389 proto_tree_add_text(tree,
2390 tvb, curr_offset, 1,
2391 "%s : Presentation indicator: %s",
2395 other_decode_bitfield_value(a_bigbuf, oct, 0x1c, 8);
2396 proto_tree_add_text(tree,
2397 tvb, curr_offset, 1,
2403 case 0: str = "User-provided, not screened"; break;
2404 case 1: str = "User-provided, verified and passed"; break;
2405 case 2: str = "User-provided, verified and failed"; break;
2407 str = "Network provided";
2411 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
2412 proto_tree_add_text(tree,
2413 tvb, curr_offset, 1,
2414 "%s : Screening indicator: %s",
2420 NO_MORE_DATA_CHECK(len);
2422 poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
2424 my_dgt_tbcd_unpack(a_bigbuf, poctets, len - (curr_offset - offset),
2427 proto_tree_add_string_format(tree, hf_gsm_a_clg_party_bcd_num,
2428 tvb, curr_offset, len - (curr_offset - offset),
2433 curr_offset += len - (curr_offset - offset);
2436 g_snprintf(add_string, string_len, " - (%s)", a_bigbuf);
2438 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2440 return(curr_offset - offset);
2447 de_clg_party_sub_addr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2450 guint32 curr_offset;
2453 curr_offset = offset;
2455 oct = tvb_get_guint8(tvb, curr_offset);
2457 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
2459 switch ((oct & 0x70) >> 4)
2461 case 0: str = "NSAP (X.213/ISO 8348 AD2)"; break;
2462 case 2: str = "User specified"; break;
2468 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
2469 proto_tree_add_text(tree,
2470 tvb, curr_offset, 1,
2471 "%s : Type of subaddress: %s",
2475 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
2476 proto_tree_add_text(tree,
2477 tvb, curr_offset, 1,
2478 "%s : Odd/Even indicator: %s",
2481 "odd number of address signals" : "even number of address signals");
2483 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2484 proto_tree_add_text(tree,
2485 tvb, curr_offset, 1,
2491 NO_MORE_DATA_CHECK(len);
2493 proto_tree_add_text(tree,
2494 tvb, curr_offset, len - (curr_offset - offset),
2495 "Subaddress information");
2497 curr_offset += len - (curr_offset - offset);
2499 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2501 return(curr_offset - offset);
2508 de_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2512 guint32 curr_offset;
2515 curr_offset = offset;
2517 oct = tvb_get_guint8(tvb, curr_offset);
2519 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2520 proto_tree_add_text(tree,
2521 tvb, curr_offset, 1,
2522 "%s : Extension: %s",
2524 (oct & 0x80) ? "not extended" : "extended");
2526 switch ((oct & 0x60) >> 5)
2528 case 0: str = "Coding as specified in ITU-T Rec. Q.931"; break;
2529 case 1: str = "Reserved for other international standards"; break;
2530 case 2: str = "National standard"; break;
2532 str = "Standard defined for the GSM PLMNS";
2536 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
2537 proto_tree_add_text(tree,
2538 tvb, curr_offset, 1,
2539 "%s : Coding standard: %s",
2543 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
2544 proto_tree_add_text(tree,
2545 tvb, curr_offset, 1,
2551 case 0: str = "User"; break;
2552 case 1: str = "Private network serving the local user"; break;
2553 case 2: str = "Public network serving the local user"; break;
2554 case 3: str = "Transit network"; break;
2555 case 4: str = "Public network serving the remote user"; break;
2556 case 5: str = "Private network serving the remote user"; break;
2557 case 7: str = "International network"; break;
2558 case 10: str = "Network beyond interworking point"; break;
2564 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2565 proto_tree_add_text(tree,
2566 tvb, curr_offset, 1,
2567 "%s : Location: %s",
2573 oct = tvb_get_guint8(tvb, curr_offset);
2577 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
2579 other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
2580 proto_tree_add_text(tree,
2581 tvb, curr_offset, 1,
2582 "%s : Recommendation",
2587 oct = tvb_get_guint8(tvb, curr_offset);
2590 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
2595 case 1: str = "Unassigned (unallocated) number"; break;
2596 case 3: str = "No route to destination"; break;
2597 case 6: str = "Channel unacceptable"; break;
2598 case 8: str = "Operator determined barring"; break;
2599 case 16: str = "Normal call clearing"; break;
2600 case 17: str = "User busy"; break;
2601 case 18: str = "No user responding"; break;
2602 case 19: str = "User alerting, no answer"; break;
2603 case 21: str = "Call rejected"; break;
2604 case 22: str = "Number changed"; break;
2605 case 25: str = "Pre-emption"; break;
2606 case 26: str = "Non selected user clearing"; break;
2607 case 27: str = "Destination out of order"; break;
2608 case 28: str = "Invalid number format (incomplete number)"; break;
2609 case 29: str = "Facility rejected"; break;
2610 case 30: str = "Response to STATUS ENQUIRY"; break;
2611 case 31: str = "Normal, unspecified"; break;
2612 case 34: str = "No circuit/channel available"; break;
2613 case 38: str = "Network out of order"; break;
2614 case 41: str = "Temporary failure"; break;
2615 case 42: str = "Switching equipment congestion"; break;
2616 case 43: str = "Access information discarded"; break;
2617 case 44: str = "requested circuit/channel not available"; break;
2618 case 47: str = "Resources unavailable, unspecified"; break;
2619 case 49: str = "Quality of service unavailable"; break;
2620 case 50: str = "Requested facility not subscribed"; break;
2621 case 55: str = "Incoming calls barred within the CUG"; break;
2622 case 57: str = "Bearer capability not authorized"; break;
2623 case 58: str = "Bearer capability not presently available"; break;
2624 case 63: str = "Service or option not available, unspecified"; break;
2625 case 65: str = "Bearer service not implemented"; break;
2626 case 68: str = "ACM equal to or greater than ACMmax"; break;
2627 case 69: str = "Requested facility not implemented"; break;
2628 case 70: str = "Only restricted digital information bearer capability is available"; break;
2629 case 79: str = "Service or option not implemented, unspecified"; break;
2630 case 81: str = "Invalid transaction identifier value"; break;
2631 case 87: str = "User not member of CUG"; break;
2632 case 88: str = "Incompatible destination"; break;
2633 case 91: str = "Invalid transit network selection"; break;
2634 case 95: str = "Semantically incorrect message"; break;
2635 case 96: str = "Invalid mandatory information"; break;
2636 case 97: str = "Message type non-existent or not implemented"; break;
2637 case 98: str = "Message type not compatible with protocol state"; break;
2638 case 99: str = "Information element non-existent or not implemented"; break;
2639 case 100: str = "Conditional IE error"; break;
2640 case 101: str = "Message not compatible with protocol state"; break;
2641 case 102: str = "Recovery on timer expiry"; break;
2642 case 111: str = "Protocol error, unspecified"; break;
2643 case 127: str = "Interworking, unspecified"; break;
2645 if (cause <= 31) { str = "Treat as Normal, unspecified"; }
2646 else if ((cause >= 32) && (cause <= 47)) { str = "Treat as Resources unavailable, unspecified"; }
2647 else if ((cause >= 48) && (cause <= 63)) { str = "Treat as Service or option not available, unspecified"; }
2648 else if ((cause >= 64) && (cause <= 79)) { str = "Treat as Service or option not implemented, unspecified"; }
2649 else if ((cause >= 80) && (cause <= 95)) { str = "Treat as Semantically incorrect message"; }
2650 else if ((cause >= 96) && (cause <= 111)) { str = "Treat as Protocol error, unspecified"; }
2651 else if ((cause >= 112) && (cause <= 127)) { str = "Treat as Interworking, unspecified"; }
2655 other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
2656 proto_tree_add_uint_format(tree, hf_gsm_a_dtap_cause,
2657 tvb, curr_offset, 1, cause,
2658 "%s : Cause: (%u) %s",
2666 g_snprintf(add_string, string_len, " - (%u) %s", cause, str);
2668 NO_MORE_DATA_CHECK(len);
2670 proto_tree_add_text(tree,
2671 tvb, curr_offset, len - (curr_offset - offset),
2674 curr_offset += len - (curr_offset - offset);
2676 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2678 return(curr_offset - offset);
2682 * 10.5.4.18 Low layer compatibility
2685 de_llc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2687 guint32 curr_offset;
2689 curr_offset = offset;
2691 dissect_q931_bearer_capability_ie(tvb, offset, len, tree);
2693 curr_offset = curr_offset + len;
2694 return(curr_offset - offset);
2703 de_facility(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint fac_len, gchar *add_string _U_, int string_len _U_)
2708 gboolean ind = FALSE;
2709 guint32 component_len = 0;
2710 guint32 header_end_offset;
2712 asn1_ctx_t asn1_ctx;
2713 tvbuff_t *SS_tvb = NULL;
2714 void *save_private_data;
2715 static gint comp_type_tag;
2717 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, gsm_a_dtap_pinfo);
2719 save_private_data= gsm_a_dtap_pinfo->private_data;
2720 saved_offset = offset;
2721 gsm_a_dtap_pinfo->private_data = NULL;
2722 while ( fac_len > (offset - saved_offset)){
2724 /* Get the length of the component there can be more than one component in a facility message */
2726 header_end_offset = get_ber_identifier(tvb, offset, &class, &pc, &comp_type_tag);
2727 header_end_offset = get_ber_length(tvb, header_end_offset, &component_len, &ind);
2729 proto_tree_add_text(tree, tvb, offset+1, 1,
2730 "Indefinte length, ignoring component");
2733 header_len = header_end_offset - offset;
2734 component_len = header_len + component_len;
2736 dissect_ROS_Component(FALSE, tvb, offset, &asn1_ctx, tree, hf_ROS_component);
2737 TODO Call gsm map here
2739 SS_tvb = tvb_new_subset(tvb, offset, component_len, component_len);
2740 call_dissector(gsm_map_handle, SS_tvb, gsm_a_dtap_pinfo, tree);
2741 offset = offset + component_len;
2743 gsm_a_dtap_pinfo->private_data = save_private_data;
2751 de_keypad_facility(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
2754 guint32 curr_offset;
2756 curr_offset = offset;
2758 oct = tvb_get_guint8(tvb, curr_offset);
2760 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2761 proto_tree_add_text(tree,
2762 tvb, curr_offset, 1,
2766 other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
2767 proto_tree_add_text(tree,
2768 tvb, curr_offset, 1,
2769 "%s : Keypad information: %c",
2776 g_snprintf(add_string, string_len, " - %c", oct & 0x7f);
2778 /* no length check possible */
2780 return(curr_offset - offset);
2787 de_prog_ind(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
2790 guint32 curr_offset;
2793 curr_offset = offset;
2795 oct = tvb_get_guint8(tvb, curr_offset);
2797 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2798 proto_tree_add_text(tree,
2799 tvb, curr_offset, 1,
2800 "%s : Extension: %s",
2802 (oct & 0x80) ? "extended" : "not extended");
2804 switch ((oct & 0x60) >> 5)
2806 case 0: str = "Coding as specified in ITU-T Rec. Q.931"; break;
2807 case 1: str = "Reserved for other international standards"; break;
2808 case 2: str = "National standard"; break;
2810 str = "Standard defined for the GSM PLMNS";
2814 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
2815 proto_tree_add_text(tree,
2816 tvb, curr_offset, 1,
2817 "%s : Coding standard: %s",
2821 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
2822 proto_tree_add_text(tree,
2823 tvb, curr_offset, 1,
2829 case 0: str = "User"; break;
2830 case 1: str = "Private network serving the local user"; break;
2831 case 2: str = "Public network serving the local user"; break;
2832 case 4: str = "Public network serving the remote user"; break;
2833 case 5: str = "Private network serving the remote user"; break;
2834 case 10: str = "Network beyond interworking point"; break;
2840 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2841 proto_tree_add_text(tree,
2842 tvb, curr_offset, 1,
2843 "%s : Location: %s",
2849 oct = tvb_get_guint8(tvb, curr_offset);
2851 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2852 proto_tree_add_text(tree,
2853 tvb, curr_offset, 1,
2854 "%s : Extension: %s",
2856 (oct & 0x80) ? "extended" : "not extended");
2860 case 1: str = "Call is not end-to-end PLMN/ISDN, further call progress information may be available in-band"; break;
2861 case 2: str = "Destination address in non-PLMN/ISDN"; break;
2862 case 3: str = "Origination address in non-PLMN/ISDN"; break;
2863 case 4: str = "Call has returned to the PLMN/ISDN"; break;
2864 case 8: str = "In-band information or appropriate pattern now available"; break;
2865 case 32: str = "Call is end-to-end PLMN/ISDN"; break;
2866 case 64: str = "Queueing"; break;
2872 other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
2873 proto_tree_add_text(tree,
2874 tvb, curr_offset, 1,
2875 "%s : Progress Description: %s (%d)",
2881 g_snprintf(add_string, string_len, " - %d", oct & 0x7f);
2885 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2887 return(curr_offset - offset);
2894 de_repeat_ind(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2897 guint32 curr_offset;
2900 curr_offset = offset;
2902 oct = tvb_get_guint8(tvb, curr_offset);
2906 case 1: str = "Circular for successive selection 'mode 1 alternate mode 2'"; break;
2907 case 2: str = "Support of fallback mode 1 preferred, mode 2 selected if setup of mode 1 fails"; break;
2908 case 3: str = "Reserved: was allocated in earlier phases of the protocol"; break;
2914 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2915 proto_tree_add_text(tree,
2916 tvb, curr_offset, 1,
2923 /* no length check possible */
2925 return(curr_offset - offset);
2932 de_ss_ver_ind(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2935 guint32 curr_offset;
2938 curr_offset = offset;
2940 oct = tvb_get_guint8(tvb, curr_offset);
2944 case 0: str = "Phase 2 service, ellipsis notation, and phase 2 error handling is supported"; break;
2945 case 1: str = "SS-Protocol version 3 is supported, and phase 2 error handling is supported"; break;
2951 proto_tree_add_text(tree,
2952 tvb, curr_offset, 1,
2958 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2960 return(curr_offset - offset);
2964 * [5] 8.1.4.1 3GPP TS 24.011 version 6.1.0 Release 6
2967 de_cp_user_data(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2969 guint32 curr_offset;
2972 curr_offset = offset;
2974 proto_tree_add_text(tree, tvb, curr_offset, len,
2975 "RPDU (not displayed)");
2978 * dissect the embedded RP message
2980 rp_tvb = tvb_new_subset(tvb, curr_offset, len, len);
2982 call_dissector(rp_handle, rp_tvb, gsm_a_dtap_pinfo, g_tree);
2986 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2988 return(curr_offset - offset);
2995 de_cp_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
2998 guint32 curr_offset;
3001 curr_offset = offset;
3003 oct = tvb_get_guint8(tvb, curr_offset);
3007 case 17: str = "Network failure"; break;
3008 case 22: str = "Congestion"; break;
3009 case 81: str = "Invalid Transaction Identifier value"; break;
3010 case 95: str = "Semantically incorrect message"; break;
3011 case 96: str = "Invalid mandatory information"; break;
3012 case 97: str = "Message type non-existent or not implemented"; break;
3013 case 98: str = "Message not compatible with the short message protocol state"; break;
3014 case 99: str = "Information element non-existent or not implemented"; break;
3015 case 111: str = "Protocol error, unspecified"; break;
3017 str = "Reserved, treat as Protocol error, unspecified";
3021 proto_tree_add_text(tree,
3022 tvb, curr_offset, 1,
3030 g_snprintf(add_string, string_len, " - (%u) %s", oct, str);
3032 /* no length check possible */
3034 return(curr_offset - offset);
3038 de_tp_sub_channel(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3040 guint32 curr_offset;
3044 curr_offset = offset;
3046 oct = tvb_get_guint8(tvb, curr_offset) & 0x3f;
3047 if ((oct & 0x38) == 0x38)
3049 else if ((oct & 0x38) == 0x18)
3051 else if ((oct & 0x38) == 0x10)
3053 else if ((oct & 0x38) == 0x08)
3055 else if ((oct & 0x3c) == 0x04)
3057 else if ((oct & 0x3e) == 0x02)
3059 else if ((oct & 0x3e) == 0x00)
3064 proto_tree_add_text(tree,
3065 tvb, curr_offset, 1,
3066 "Test Loop %s",str);
3069 proto_tree_add_text(tree,
3070 tvb, curr_offset, 1,
3071 "Only one TCH active or sub-channel 0 of two half rate channels is to be looped");
3073 proto_tree_add_text(tree,
3074 tvb, curr_offset, 1,
3075 "Sub-channel 1 of two half rate channels is to be looped");
3079 return(curr_offset - offset);
3083 de_tp_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3085 guint32 curr_offset;
3088 curr_offset = offset;
3090 oct = tvb_get_guint8(tvb, curr_offset);
3092 if ((oct & 0xF0) == 0x80)
3093 proto_tree_add_text(tree,tvb, curr_offset, 1, "Acknowledgment element: %d",oct&0x01);
3095 proto_tree_add_text(tree,tvb, curr_offset, 1, "No acknowledgment element present");
3099 return(curr_offset - offset);
3103 de_tp_loop_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3105 guint32 curr_offset;
3108 curr_offset = offset;
3110 oct = tvb_get_guint8(tvb, curr_offset);
3115 proto_tree_add_text(tree, tvb, curr_offset, 1, "Channel coding not needed. The Burst-by-Burst loop is activated, type G");
3118 proto_tree_add_text(tree, tvb, curr_offset, 1, "Channel coding needed. Frame erasure is to be signalled, type H");
3121 proto_tree_add_text(tree, tvb, curr_offset, 1, "Channel coding reserved (%d)",oct & 0x03);
3128 proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot mechanism 1");
3129 proto_tree_add_text(tree, tvb, curr_offset, 1, "Timeslot number %d",(oct & 0xe0)>>5);
3132 proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot mechanism 2");
3135 proto_tree_add_text(tree, tvb, curr_offset, 1, "Loop mechanism reserved (%d)",(oct & 0x1c)>>2);
3141 return(curr_offset - offset);
3145 de_tp_loop_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3147 guint32 curr_offset;
3150 curr_offset = offset;
3152 oct = tvb_get_guint8(tvb, curr_offset);
3157 proto_tree_add_text(tree, tvb, curr_offset, 1, "Channel coding not needed. The Burst-by-Burst loop is activated, type G");
3160 proto_tree_add_text(tree, tvb, curr_offset, 1, "Channel coding needed. Frame erasure is to be signalled, type H");
3163 proto_tree_add_text(tree, tvb, curr_offset, 1, "Channel coding reserved (%d)",(oct & 0x30)>>4);
3170 proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot mechanism 1");
3173 proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot mechanism 2");
3176 proto_tree_add_text(tree, tvb, curr_offset, 1, "Loop mechanism reserved (%d)",(oct & 0x0e)>>1);
3181 proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot TCH loop was not closed due to error");
3183 proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot TCH loop was closed successfully");
3187 return(curr_offset - offset);
3191 de_tp_tested_device(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3193 guint32 curr_offset;
3196 curr_offset = offset;
3198 oct = tvb_get_guint8(tvb, curr_offset);
3203 proto_tree_add_text(tree, tvb, curr_offset, 1, "Normal operation (no tested device via DAI)");
3206 proto_tree_add_text(tree, tvb, curr_offset, 1, "Test of speech decoder / DTX functions (downlink)");
3209 proto_tree_add_text(tree, tvb, curr_offset, 1, "Test of speech encoder / DTX functions (uplink)");
3212 proto_tree_add_text(tree, tvb, curr_offset, 1, "Test of acoustic devices and A/D & D/A");
3215 proto_tree_add_text(tree, tvb, curr_offset, 1, "Tested device reserved (%d)",oct);
3221 return(curr_offset - offset);
3225 de_tp_pdu_description(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3227 guint32 curr_offset;
3230 curr_offset = offset;
3232 value = tvb_get_ntohs(tvb, curr_offset);
3237 if ((value & 0xfff) == 0)
3238 proto_tree_add_text(tree, tvb, curr_offset, 1, "Infinite number of PDUs to be transmitted in the TBF");
3240 proto_tree_add_text(tree, tvb, curr_offset, 1, "%d PDUs to be transmitted in the TBF",value & 0xfff);
3243 proto_tree_add_text(tree, tvb, curr_offset, 1, "PDU description reserved");
3245 return(curr_offset - offset);
3249 de_tp_mode_flag(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3251 guint32 curr_offset;
3254 curr_offset = offset;
3256 oct = tvb_get_guint8(tvb, curr_offset);
3259 proto_tree_add_text(tree, tvb, curr_offset, 1, "MS shall select the loop back option");
3261 proto_tree_add_text(tree, tvb, curr_offset, 1, "MS shall itself generate the pseudorandom data");
3263 proto_tree_add_text(tree, tvb, curr_offset, 1, "Downlink Timeslot Offset: timeslot number %d",(oct & 0x0e)>>1);
3267 return(curr_offset - offset);
3271 de_tp_egprs_mode_flag(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3273 guint32 curr_offset;
3276 curr_offset = offset;
3278 oct = tvb_get_guint8(tvb, curr_offset);
3281 proto_tree_add_text(tree, tvb, curr_offset, 1, "MS loops back blocks on the uplink using GMSK modulation only");
3283 proto_tree_add_text(tree, tvb, curr_offset, 1, "MS loops back blocks on the uplink using either GMSK or 8-PSK modulation following the detected received modulation");
3285 proto_tree_add_text(tree, tvb, curr_offset, 1, "Downlink Timeslot Offset: timeslot number %d",(oct & 0x0e)>>1);
3289 return(curr_offset - offset);
3293 de_tp_ue_test_loop_mode(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3295 guint32 curr_offset;
3297 guint8 lb_setup_length,i,j;
3300 curr_offset = offset;
3302 oct = tvb_get_guint8(tvb, curr_offset);
3309 proto_tree_add_text(tree, tvb, curr_offset, 1, "UE test loop mode 1 loop back (loopback of RLC SDUs or PDCP SDUs)");
3310 lb_setup_length = tvb_get_guint8(tvb, curr_offset);
3312 for (i=0,j=0; (i<lb_setup_length) && (j<4); i+=3,j++)
3314 proto_tree_add_text(tree, tvb, curr_offset, 1, "LB setup RB IE %d",j+1);
3315 value = tvb_get_ntohs(tvb, curr_offset);
3317 proto_tree_add_text(tree, tvb, curr_offset, 1, "Uplink RLC SDU size is %d bits",value);
3318 oct = tvb_get_guint8(tvb, curr_offset);
3320 proto_tree_add_text(tree, tvb, curr_offset, 1, "Radio Bearer %d",oct & 0x1f);
3325 proto_tree_add_text(tree, tvb, curr_offset, 1, "UE test loop mode 2 loop back (loopback of transport block data and CRC bits)");
3328 proto_tree_add_text(tree, tvb, curr_offset, 1, "UE test loop mode 3 RLC SDU counting (counting of received RLC SDUs)");
3329 oct = tvb_get_guint8(tvb, curr_offset);
3331 proto_tree_add_text(tree, tvb, curr_offset, 1, "MBMS short transmission identity %d",(oct & 0x1f)+1);
3334 proto_tree_add_text(tree, tvb, curr_offset, 1, "UE test loop mode reserved (%d)",oct & 0x03);
3338 return(curr_offset - offset);
3342 de_tp_ue_positioning_technology(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3344 guint32 curr_offset;
3347 curr_offset = offset;
3349 oct = tvb_get_guint8(tvb, curr_offset);
3354 proto_tree_add_text(tree, tvb, curr_offset, 1, "AGPS");
3357 proto_tree_add_text(tree, tvb, curr_offset, 1, "UE positioning technology reserved (%d)",oct);
3363 return(curr_offset - offset);
3367 de_tp_rlc_sdu_counter_value(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3369 guint32 curr_offset;
3372 curr_offset = offset;
3374 value = tvb_get_ntohl(tvb, curr_offset);
3377 proto_tree_add_text(tree, tvb, curr_offset, 1, "UE received RLC SDU counter value %d",value);
3379 return(curr_offset - offset);
3382 guint8 (*dtap_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
3383 /* Mobility Management Information Elements 10.5.3 */
3384 de_auth_param_rand, /* Authentication Parameter RAND */
3385 de_auth_param_autn, /* Authentication Parameter AUTN (UMTS authentication challenge only) */
3386 de_auth_resp_param, /* Authentication Response Parameter */
3387 de_auth_resp_param_ext, /* Authentication Response Parameter (extension) (UMTS authentication challenge only) */
3388 de_auth_fail_param, /* Authentication Failure Parameter (UMTS authentication challenge only) */
3389 NULL /* handled inline */, /* CM Service Type */
3390 NULL /* handled inline */, /* Identity Type */
3391 NULL /* handled inline */, /* Location Updating Type */
3392 de_network_name, /* Network Name */
3393 de_rej_cause, /* Reject Cause */
3394 NULL /* no associated data */, /* Follow-on Proceed */
3395 de_time_zone, /* Time Zone */
3396 de_time_zone_time, /* Time Zone and Time */
3397 NULL /* no associated data */, /* CTS Permission */
3398 de_lsa_id, /* LSA Identifier */
3399 de_day_saving_time, /* Daylight Saving Time */
3400 NULL, /* Emergency Number List */
3401 /* Call Control Information Elements 10.5.4 */
3402 de_aux_states, /* Auxiliary States */
3403 de_bearer_cap, /* Bearer Capability */
3404 de_cc_cap, /* Call Control Capabilities */
3405 de_call_state, /* Call State */
3406 de_cld_party_bcd_num, /* Called Party BCD Number */
3407 de_cld_party_sub_addr, /* Called Party Subaddress */
3408 de_clg_party_bcd_num, /* Calling Party BCD Number */
3409 de_clg_party_sub_addr, /* Calling Party Subaddress */
3410 de_cause, /* Cause */
3411 NULL /* no associated data */, /* CLIR Suppression */
3412 NULL /* no associated data */, /* CLIR Invocation */
3413 NULL /* handled inline */, /* Congestion Level */
3414 NULL, /* Connected Number */
3415 NULL, /* Connected Subaddress */
3416 de_facility, /* Facility */
3417 NULL, /* High Layer Compatibility */
3418 de_keypad_facility, /* Keypad Facility */
3419 de_llc, /* 10.5.4.18 Low layer compatibility */
3420 NULL, /* More Data */
3421 NULL, /* Notification Indicator */
3422 de_prog_ind, /* Progress Indicator */
3423 NULL, /* Recall type $(CCBS)$ */
3424 NULL, /* Redirecting Party BCD Number */
3425 NULL, /* Redirecting Party Subaddress */
3426 de_repeat_ind, /* Repeat Indicator */
3427 NULL /* no associated data */, /* Reverse Call Setup Direction */
3428 NULL, /* SETUP Container $(CCBS)$ */
3430 de_ss_ver_ind, /* SS Version Indicator */
3431 NULL, /* User-user */
3432 NULL, /* Alerting Pattern $(NIA)$ */
3433 NULL, /* Allowed Actions $(CCBS)$ */
3434 NULL, /* Stream Identifier */
3435 NULL, /* Network Call Control Capabilities */
3436 NULL, /* Cause of No CLI */
3437 NULL, /* Immediate Modification Indicator */
3438 NULL, /* Supported Codec List */
3439 NULL, /* Service Category */
3440 /* Short Message Service Information Elements [5] 8.1.4 */
3441 de_cp_user_data, /* CP-User Data */
3442 de_cp_cause, /* CP-Cause */
3443 /* Tests procedures information elements 3GPP TS 44.014 6.4.0 and 3GPP TS 34.109 6.4.0 */
3444 de_tp_sub_channel, /* Close TCH Loop Cmd Sub-channel */
3445 de_tp_ack, /* Open Loop Cmd Ack */
3446 de_tp_loop_type, /* Close Multi-slot Loop Cmd Loop type */
3447 de_tp_loop_ack, /* Close Multi-slot Loop Ack Result */
3448 de_tp_tested_device, /* Test Interface Tested device */
3449 de_tp_pdu_description, /* GPRS Test Mode Cmd PDU description */
3450 de_tp_mode_flag, /* GPRS Test Mode Cmd Mode flag */
3451 de_tp_egprs_mode_flag, /* EGPRS Start Radio Block Loopback Cmd Mode flag */
3452 de_tp_ue_test_loop_mode, /* Close UE Test Loop Mode */
3453 de_tp_ue_positioning_technology, /* UE Positioning Technology */
3454 de_tp_rlc_sdu_counter_value, /* RLC SDU Counter Value */
3458 /* MESSAGE FUNCTIONS */
3464 dtap_mm_auth_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3466 guint32 curr_offset;
3470 proto_tree *subtree;
3473 curr_offset = offset;
3476 is_uplink = IS_UPLINK_FALSE;
3479 * special dissection for Cipher Key Sequence Number
3481 oct = tvb_get_guint8(tvb, curr_offset);
3483 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
3484 proto_tree_add_text(tree,
3485 tvb, curr_offset, 1,
3490 proto_tree_add_text(tree,
3491 tvb, curr_offset, 1,
3492 gsm_common_elem_strings[DE_CIPH_KEY_SEQ_NUM].strptr);
3494 subtree = proto_item_add_subtree(item, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM]);
3496 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
3497 proto_tree_add_text(subtree,
3498 tvb, curr_offset, 1,
3502 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
3507 proto_tree_add_text(subtree,
3508 tvb, curr_offset, 1,
3509 "%s : Ciphering Key Sequence Number: No key is available",
3514 proto_tree_add_text(subtree,
3515 tvb, curr_offset, 1,
3516 "%s : Ciphering Key Sequence Number: %u",
3525 if (curr_len <= 0) return;
3527 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_RAND);
3529 ELEM_OPT_TLV(0x20, GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_AUTN, "");
3531 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3538 dtap_mm_auth_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3540 guint32 curr_offset;
3544 curr_offset = offset;
3547 is_uplink = IS_UPLINK_TRUE;
3549 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_AUTH_RESP_PARAM);
3551 ELEM_OPT_TLV(0x21, GSM_A_PDU_TYPE_DTAP, DE_AUTH_RESP_PARAM_EXT, "");
3553 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3560 dtap_mm_auth_fail(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3562 guint32 curr_offset;
3566 curr_offset = offset;
3569 is_uplink = IS_UPLINK_TRUE;
3571 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE);
3573 ELEM_OPT_TLV(0x22, GSM_A_PDU_TYPE_DTAP, DE_AUTH_FAIL_PARAM, "");
3575 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3582 dtap_mm_cm_reestab_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3584 guint32 curr_offset;
3588 proto_tree *subtree;
3591 curr_offset = offset;
3594 is_uplink = IS_UPLINK_TRUE;
3597 * special dissection for Cipher Key Sequence Number
3599 oct = tvb_get_guint8(tvb, curr_offset);
3601 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
3602 proto_tree_add_text(tree,
3603 tvb, curr_offset, 1,
3608 proto_tree_add_text(tree,
3609 tvb, curr_offset, 1,
3610 gsm_common_elem_strings[DE_CIPH_KEY_SEQ_NUM].strptr);
3612 subtree = proto_item_add_subtree(item, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM]);
3614 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
3615 proto_tree_add_text(subtree,
3616 tvb, curr_offset, 1,
3620 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
3625 proto_tree_add_text(subtree,
3626 tvb, curr_offset, 1,
3627 "%s : Ciphering Key Sequence Number: No key is available",
3632 proto_tree_add_text(subtree,
3633 tvb, curr_offset, 1,
3634 "%s : Ciphering Key Sequence Number: %u",
3643 if (curr_len <= 0) return;
3645 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, "");
3647 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, "");
3649 ELEM_OPT_TV(0x13, GSM_A_PDU_TYPE_COMMON, DE_LAI, "");
3651 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3658 dtap_mm_cm_srvc_prompt(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3660 guint32 curr_offset;
3664 curr_offset = offset;
3667 is_uplink = IS_UPLINK_FALSE;
3669 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_PD_SAPI);
3671 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3678 dtap_mm_cm_srvc_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3680 guint32 curr_offset;
3684 curr_offset = offset;
3687 is_uplink = IS_UPLINK_FALSE;
3689 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE);
3691 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3698 dtap_mm_abort(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3700 guint32 curr_offset;
3704 curr_offset = offset;
3707 is_uplink = IS_UPLINK_FALSE;
3709 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE);
3711 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3718 dtap_mm_cm_srvc_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3720 guint32 curr_offset;
3724 proto_tree *subtree;
3728 curr_offset = offset;
3731 is_uplink = IS_UPLINK_TRUE;
3734 * special dissection for CM Service Type
3736 oct = tvb_get_guint8(tvb, curr_offset);
3739 proto_tree_add_text(tree,
3740 tvb, curr_offset, 1,
3741 gsm_common_elem_strings[DE_CIPH_KEY_SEQ_NUM].strptr);
3743 subtree = proto_item_add_subtree(item, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM]);
3745 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3746 proto_tree_add_text(subtree,
3747 tvb, curr_offset, 1,
3751 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
3753 switch ((oct & 0x70) >> 4)
3756 proto_tree_add_text(subtree,
3757 tvb, curr_offset, 1,
3758 "%s : Ciphering Key Sequence Number: No key is available",
3763 proto_tree_add_text(subtree,
3764 tvb, curr_offset, 1,
3765 "%s : Ciphering Key Sequence Number: %u",
3772 proto_tree_add_text(tree,
3773 tvb, curr_offset, 1,
3774 gsm_dtap_elem_strings[DE_CM_SRVC_TYPE].strptr);
3776 subtree = proto_item_add_subtree(item, ett_gsm_dtap_elem[DE_CM_SRVC_TYPE]);
3780 case 0x01: str = "Mobile originating call establishment or packet mode connection establishment"; break;
3781 case 0x02: str = "Emergency call establishment"; break;
3782 case 0x04: str = "Short message service"; break;
3783 case 0x08: str = "Supplementary service activation"; break;
3784 case 0x09: str = "Voice group call establishment"; break;
3785 case 0x0a: str = "Voice broadcast call establishment"; break;
3786 case 0x0b: str = "Location Services"; break;
3792 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3793 proto_tree_add_text(subtree,
3794 tvb, curr_offset, 1,
3795 "%s : Service Type: (%u) %s",
3803 if (curr_len <= 0) return;
3805 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, "");
3807 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, "");
3809 ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_COMMON, DE_PRIO, "");
3811 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3818 dtap_mm_id_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3821 guint32 curr_offset;
3823 proto_tree *subtree;
3827 curr_offset = offset;
3830 is_uplink = IS_UPLINK_FALSE;
3833 * special dissection for Identity Type
3835 oct = tvb_get_guint8(tvb, curr_offset);
3837 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
3838 proto_tree_add_text(tree,
3839 tvb, curr_offset, 1,
3844 proto_tree_add_text(tree,
3845 tvb, curr_offset, 1,
3846 gsm_dtap_elem_strings[DE_ID_TYPE].strptr);
3848 subtree = proto_item_add_subtree(item, ett_gsm_dtap_elem[DE_ID_TYPE]);
3850 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
3851 proto_tree_add_text(subtree,
3852 tvb, curr_offset, 1,
3858 case 1: str = "IMSI"; break;
3859 case 2: str = "IMEI"; break;
3860 case 3: str = "IMEISV"; break;
3861 case 4: str = "TMSI"; break;
3867 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
3868 proto_tree_add_text(subtree,
3869 tvb, curr_offset, 1,
3870 "%s : Type of identity: %s",
3877 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3884 dtap_mm_id_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3886 guint32 curr_offset;
3890 curr_offset = offset;
3893 is_uplink = IS_UPLINK_TRUE;
3895 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, "");
3897 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3904 dtap_mm_imsi_det_ind(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3906 guint32 curr_offset;
3910 curr_offset = offset;
3913 is_uplink = IS_UPLINK_TRUE;
3915 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_1);
3917 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, "");
3919 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3926 dtap_mm_loc_upd_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3928 guint32 curr_offset;
3932 curr_offset = offset;
3935 is_uplink = IS_UPLINK_FALSE;
3937 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_LAI);
3939 ELEM_OPT_TLV(0x17, GSM_A_PDU_TYPE_COMMON, DE_MID, "");
3941 ELEM_OPT_T(0xa1, GSM_A_PDU_TYPE_DTAP, DE_FOP, "");
3943 ELEM_OPT_T(0xa2, GSM_A_PDU_TYPE_DTAP, DE_CTS_PERM, "");
3945 ELEM_OPT_TLV(0x4a, GSM_A_PDU_TYPE_COMMON, DE_PLMN_LIST, " Equivalent");
3947 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3954 dtap_mm_loc_upd_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3956 guint32 curr_offset;
3960 curr_offset = offset;
3963 is_uplink = IS_UPLINK_FALSE;
3965 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE);
3967 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3974 dtap_mm_loc_upd_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3976 guint32 curr_offset;
3980 proto_tree *subtree;
3984 curr_offset = offset;
3987 is_uplink = IS_UPLINK_TRUE;
3990 * special dissection for Location Updating Type
3992 oct = tvb_get_guint8(tvb, curr_offset);
3995 proto_tree_add_text(tree,
3996 tvb, curr_offset, 1,
3997 gsm_common_elem_strings[DE_CIPH_KEY_SEQ_NUM].strptr);
3999 subtree = proto_item_add_subtree(item, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM]);
4001 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
4002 proto_tree_add_text(subtree,
4003 tvb, curr_offset, 1,
4007 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
4009 switch ((oct & 0x70) >> 4)
4012 proto_tree_add_text(subtree,
4013 tvb, curr_offset, 1,
4014 "%s : Ciphering Key Sequence Number: No key is available",
4019 proto_tree_add_text(subtree,
4020 tvb, curr_offset, 1,
4021 "%s : Ciphering Key Sequence Number: %u",
4028 proto_tree_add_text(tree,
4029 tvb, curr_offset, 1,
4030 gsm_dtap_elem_strings[DE_LOC_UPD_TYPE].strptr);
4032 subtree = proto_item_add_subtree(item, ett_gsm_dtap_elem[DE_LOC_UPD_TYPE]);
4034 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
4035 proto_tree_add_text(subtree,
4036 tvb, curr_offset, 1,
4037 "%s : Follow-On Request (FOR): %s",
4039 (oct & 0x08) ? "Follow-on request pending" : "No follow-on request pending");
4041 other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
4042 proto_tree_add_text(subtree,
4043 tvb, curr_offset, 1,
4049 case 0: str = "Normal"; break;
4050 case 1: str = "Periodic"; break;
4051 case 2: str = "IMSI attach"; break;
4057 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
4058 proto_tree_add_text(subtree,
4059 tvb, curr_offset, 1,
4060 "%s : Updating Type: %s",
4064 proto_item_append_text(item, " - %s", str);
4069 if (curr_len <= 0) return;
4071 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_LAI);
4073 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_1);
4075 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, "");
4077 ELEM_OPT_TLV(0x33, GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, "");
4079 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4087 dtap_mm_mm_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4089 guint32 curr_offset;
4093 curr_offset = offset;
4096 is_uplink = IS_UPLINK_TRUE;
4098 ELEM_OPT_TLV(0x43, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Full Name");
4100 ELEM_OPT_TLV(0x45, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Short Name");
4102 ELEM_OPT_TV(0x46, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE, " - Local");
4104 ELEM_OPT_TV(0x47, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE_TIME, " - Universal Time and Local Time Zone");
4106 ELEM_OPT_TLV(0x48, GSM_A_PDU_TYPE_DTAP, DE_LSA_ID, "");
4108 ELEM_OPT_TLV(0x49, GSM_A_PDU_TYPE_DTAP, DE_DAY_SAVING_TIME, "");
4110 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4117 dtap_mm_mm_status(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4119 guint32 curr_offset;
4123 curr_offset = offset;
4126 is_uplink = IS_UPLINK_TRUE;
4128 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE);
4130 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4137 dtap_mm_tmsi_realloc_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4139 guint32 curr_offset;
4143 curr_offset = offset;
4146 is_uplink = IS_UPLINK_FALSE;
4148 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_LAI);
4150 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, "");
4152 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4159 dtap_cc_alerting(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4161 guint32 curr_offset;
4165 curr_offset = offset;
4168 is_uplink = IS_UPLINK_TRUE;
4170 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4172 ELEM_OPT_TLV(0x1e, GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, "");
4174 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4178 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4180 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4187 dtap_cc_call_conf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4189 guint32 curr_offset;
4193 curr_offset = offset;
4196 is_uplink = IS_UPLINK_TRUE;
4198 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " BC repeat indicator");
4200 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 1");
4202 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 2");
4204 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4206 ELEM_OPT_TLV(0x15, GSM_A_PDU_TYPE_DTAP, DE_CC_CAP, "");
4208 ELEM_OPT_TLV(0x2d, GSM_A_PDU_TYPE_DTAP, DE_SI, "");
4210 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, "");
4212 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4219 dtap_cc_call_proceed(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4221 guint32 curr_offset;
4225 curr_offset = offset;
4228 is_uplink = IS_UPLINK_FALSE;
4230 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " BC repeat indicator");
4232 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 1");
4234 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 2");
4236 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4238 ELEM_OPT_TLV(0x1e, GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, "");
4240 ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_COMMON, DE_PRIO, "");
4242 ELEM_OPT_TLV(0x2f, GSM_A_PDU_TYPE_DTAP, DE_NET_CC_CAP, "");
4244 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4251 dtap_cc_congestion_control(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4253 guint32 curr_offset;
4257 proto_tree *subtree;
4261 curr_offset = offset;
4264 is_uplink = IS_UPLINK_FALSE;
4267 * special dissection for Congestion Level
4269 oct = tvb_get_guint8(tvb, curr_offset);
4271 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
4272 proto_tree_add_text(tree,
4273 tvb, curr_offset, 1,
4278 proto_tree_add_text(tree,
4279 tvb, curr_offset, 1,
4280 gsm_dtap_elem_strings[DE_CONGESTION].strptr);
4282 subtree = proto_item_add_subtree(item, ett_gsm_dtap_elem[DE_CONGESTION]);
4286 case 0: str = "Receiver ready"; break;
4287 case 15: str = "Receiver not ready"; break;
4293 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4294 proto_tree_add_text(subtree,
4295 tvb, curr_offset, 1,
4296 "%s : Congestion level: %s",
4303 if (curr_len <= 0) return;
4305 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4307 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4314 dtap_cc_connect(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4316 guint32 curr_offset;
4320 curr_offset = offset;
4323 is_uplink = IS_UPLINK_TRUE;
4325 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4327 ELEM_OPT_TLV(0x1e, GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, "");
4329 ELEM_OPT_TLV(0x4c, GSM_A_PDU_TYPE_DTAP, DE_CONN_NUM, "");
4331 ELEM_OPT_TLV(0x4d, GSM_A_PDU_TYPE_DTAP, DE_CONN_SUB_ADDR, "");
4333 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4337 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4339 ELEM_OPT_TLV(0x2d, GSM_A_PDU_TYPE_DTAP, DE_SI, "");
4341 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4348 dtap_cc_disconnect(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4350 guint32 curr_offset;
4354 curr_offset = offset;
4357 is_uplink = IS_UPLINK_TRUE;
4359 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4361 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4363 ELEM_OPT_TLV(0x1e, GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, "");
4365 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4367 ELEM_OPT_TLV(0x7b, GSM_A_PDU_TYPE_DTAP, DE_ALLOWED_ACTIONS, "");
4371 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4373 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4380 dtap_cc_emerg_setup(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4382 guint32 curr_offset;
4386 curr_offset = offset;
4389 is_uplink = IS_UPLINK_TRUE;
4391 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, "");
4393 ELEM_OPT_TLV(0x2d, GSM_A_PDU_TYPE_DTAP, DE_SI, "");
4395 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, "");
4397 ELEM_OPT_TLV(0x2e, GSM_A_PDU_TYPE_DTAP, DE_SRVC_CAT, " Emergency");
4399 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4406 dtap_cc_facility(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4408 guint32 curr_offset;
4412 curr_offset = offset;
4415 is_uplink = IS_UPLINK_TRUE;
4417 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4421 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4423 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4430 dtap_cc_hold_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4432 guint32 curr_offset;
4436 curr_offset = offset;
4439 is_uplink = IS_UPLINK_FALSE;
4441 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4443 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4450 dtap_cc_modify(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4452 guint32 curr_offset;
4456 curr_offset = offset;
4459 is_uplink = IS_UPLINK_TRUE;
4461 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, "");
4463 ELEM_OPT_TLV(0x7c, GSM_A_PDU_TYPE_DTAP, DE_LLC, "");
4465 ELEM_OPT_TLV(0x7d, GSM_A_PDU_TYPE_DTAP, DE_HLC, "");
4467 ELEM_OPT_T(0xa3, GSM_A_PDU_TYPE_DTAP, DE_REV_CALL_SETUP_DIR, "");
4469 ELEM_OPT_T(0xa4, GSM_A_PDU_TYPE_DTAP, DE_IMM_MOD_IND, "");
4471 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4478 dtap_cc_modify_complete(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4480 guint32 curr_offset;
4484 curr_offset = offset;
4487 is_uplink = IS_UPLINK_TRUE;
4489 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, "");
4491 ELEM_OPT_TLV(0x7c, GSM_A_PDU_TYPE_DTAP, DE_LLC, "");
4493 ELEM_OPT_TLV(0x7d, GSM_A_PDU_TYPE_DTAP, DE_HLC, "");
4495 ELEM_OPT_T(0xa3, GSM_A_PDU_TYPE_DTAP, DE_REV_CALL_SETUP_DIR, "");
4497 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4504 dtap_cc_modify_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4506 guint32 curr_offset;
4510 curr_offset = offset;
4513 is_uplink = IS_UPLINK_FALSE;
4515 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, "");
4517 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4519 ELEM_OPT_TLV(0x7c, GSM_A_PDU_TYPE_DTAP, DE_LLC, "");
4521 ELEM_OPT_TLV(0x7d, GSM_A_PDU_TYPE_DTAP, DE_HLC, "");
4523 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4530 dtap_cc_notify(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4532 guint32 curr_offset;
4536 curr_offset = offset;
4539 is_uplink = IS_UPLINK_FALSE;
4541 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_NOT_IND);
4543 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4550 dtap_cc_progress(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4552 guint32 curr_offset;
4556 curr_offset = offset;
4559 is_uplink = IS_UPLINK_FALSE;
4561 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, "");
4563 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4565 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4572 dtap_cc_cc_est(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4574 guint32 curr_offset;
4578 curr_offset = offset;
4581 is_uplink = IS_UPLINK_FALSE;
4583 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_SETUP_CONTAINER, "");
4585 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4592 dtap_cc_cc_est_conf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4594 guint32 curr_offset;
4598 curr_offset = offset;
4601 is_uplink = IS_UPLINK_TRUE;
4603 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " Repeat indicator");
4605 ELEM_MAND_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 1");
4607 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 2");
4609 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4611 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, "");
4613 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4620 dtap_cc_release(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4622 guint32 curr_offset;
4626 curr_offset = offset;
4629 is_uplink = IS_UPLINK_TRUE;
4631 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4633 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, " 2");
4635 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4637 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4641 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4643 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4650 dtap_cc_recall(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4652 guint32 curr_offset;
4656 curr_offset = offset;
4659 is_uplink = IS_UPLINK_FALSE;
4661 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_RECALL_TYPE);
4663 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4665 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4672 dtap_cc_release_complete(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4674 guint32 curr_offset;
4678 curr_offset = offset;
4681 is_uplink = IS_UPLINK_FALSE;
4683 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4685 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4687 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4691 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4693 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4700 dtap_cc_retrieve_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4702 guint32 curr_offset;
4706 curr_offset = offset;
4709 is_uplink = IS_UPLINK_FALSE;
4711 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4713 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4718 * 3GPP TS 24.008 version 7.5.0 Release 7
4721 dtap_cc_setup(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4723 guint32 curr_offset;
4727 curr_offset = offset;
4730 is_uplink = IS_UPLINK_TRUE;
4732 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " BC repeat indicator");
4734 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 1");
4736 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 2");
4738 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4740 ELEM_OPT_TLV(0x1e, GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, "");
4742 ELEM_OPT_TV(0x34, GSM_A_PDU_TYPE_DTAP, DE_SIGNAL, "");
4744 ELEM_OPT_TLV(0x5c, GSM_A_PDU_TYPE_DTAP, DE_CLG_PARTY_BCD_NUM, "");
4746 ELEM_OPT_TLV(0x5d, GSM_A_PDU_TYPE_DTAP, DE_CLG_PARTY_SUB_ADDR, "");
4748 ELEM_OPT_TLV(0x5e, GSM_A_PDU_TYPE_DTAP, DE_CLD_PARTY_BCD_NUM, "");
4750 ELEM_OPT_TLV(0x6d, GSM_A_PDU_TYPE_DTAP, DE_CLD_PARTY_SUB_ADDR, "");
4752 ELEM_OPT_TLV(0x74, GSM_A_PDU_TYPE_DTAP, DE_RED_PARTY_BCD_NUM, "");
4754 ELEM_OPT_TLV(0x75, GSM_A_PDU_TYPE_DTAP, DE_RED_PARTY_SUB_ADDR, "");
4756 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " LLC repeat indicator");
4758 ELEM_OPT_TLV(0x7c, GSM_A_PDU_TYPE_DTAP, DE_LLC, " 1");
4760 ELEM_OPT_TLV(0x7c, GSM_A_PDU_TYPE_DTAP, DE_LLC, " 2");
4762 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " HLC repeat indicator");
4764 ELEM_OPT_TLV(0x7d, GSM_A_PDU_TYPE_DTAP, DE_HLC, " 1");
4766 ELEM_OPT_TLV(0x7d, GSM_A_PDU_TYPE_DTAP, DE_HLC, " 2");
4768 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4772 ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_COMMON, DE_PRIO, "");
4774 ELEM_OPT_TLV(0x19, GSM_A_PDU_TYPE_DTAP, DE_ALERT_PATTERN, "");
4776 ELEM_OPT_TLV(0x2f, GSM_A_PDU_TYPE_DTAP, DE_NET_CC_CAP, "");
4778 ELEM_OPT_TLV(0x3a, GSM_A_PDU_TYPE_DTAP, DE_CAUSE_NO_CLI, "");
4780 /* Backup bearer capability O TLV 3-15 10.5.4.4a */
4781 ELEM_OPT_TLV(0x41, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, "");
4785 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4787 ELEM_OPT_T(0xa1, GSM_A_PDU_TYPE_DTAP, DE_CLIR_SUP, "");
4789 ELEM_OPT_T(0xa2, GSM_A_PDU_TYPE_DTAP, DE_CLIR_INV, "");
4791 ELEM_OPT_TLV(0x15, GSM_A_PDU_TYPE_DTAP, DE_CC_CAP, "");
4793 ELEM_OPT_TLV(0x1d, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, " $(CCBS)$ (advanced recall alignment)");
4795 ELEM_OPT_TLV(0x1b, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, " (recall alignment Not essential) $(CCBS)$");
4797 ELEM_OPT_TLV(0x2d, GSM_A_PDU_TYPE_DTAP, DE_SI, "");
4799 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, "");
4801 /*A3 Redial Redial O T 1 10.5.4.34
4802 * TODO add this element
4803 * ELEM_OPT_T(0xA3, GSM_A_PDU_TYPE_DTAP, DE_REDIAL, "");
4806 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4813 dtap_cc_start_cc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4815 guint32 curr_offset;
4819 curr_offset = offset;
4822 is_uplink = IS_UPLINK_FALSE;
4824 ELEM_OPT_TLV(0x15, GSM_A_PDU_TYPE_DTAP, DE_CC_CAP, "");
4826 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4833 dtap_cc_start_dtmf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4835 guint32 curr_offset;
4839 curr_offset = offset;
4842 is_uplink = IS_UPLINK_TRUE;
4844 ELEM_MAND_TV(0x2c, GSM_A_PDU_TYPE_DTAP, DE_KEYPAD_FACILITY, "");
4846 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4853 dtap_cc_start_dtmf_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4855 guint32 curr_offset;
4859 curr_offset = offset;
4862 is_uplink = IS_UPLINK_FALSE;
4864 ELEM_MAND_TV(0x2c, GSM_A_PDU_TYPE_DTAP, DE_KEYPAD_FACILITY, "");
4866 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4873 dtap_cc_start_dtmf_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4875 guint32 curr_offset;
4879 curr_offset = offset;
4882 is_uplink = IS_UPLINK_FALSE;
4884 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4886 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4893 dtap_cc_status(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4895 guint32 curr_offset;
4899 curr_offset = offset;
4902 is_uplink = IS_UPLINK_FALSE;
4904 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4906 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_CALL_STATE);
4908 ELEM_OPT_TLV(0x24, GSM_A_PDU_TYPE_DTAP, DE_AUX_STATES, "");
4910 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4917 dtap_cc_user_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4919 guint32 curr_offset;
4923 curr_offset = offset;
4926 is_uplink = IS_UPLINK_TRUE;
4928 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4930 ELEM_OPT_T(0xa0, GSM_A_PDU_TYPE_DTAP, DE_MORE_DATA, "");
4932 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4939 dtap_ss_register(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4941 guint32 curr_offset;
4945 curr_offset = offset;
4948 is_uplink = IS_UPLINK_TRUE;
4950 ELEM_MAND_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4952 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4954 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4961 dtap_sms_cp_data(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4963 guint32 curr_offset;
4967 curr_offset = offset;
4970 is_uplink = IS_UPLINK_TRUE;
4972 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CP_USER_DATA, "");
4974 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4981 dtap_sms_cp_error(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4983 guint32 curr_offset;
4987 curr_offset = offset;
4990 is_uplink = IS_UPLINK_TRUE;
4992 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_CP_CAUSE);
4994 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4998 dtap_tp_close_tch_loop_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5000 guint32 curr_offset;
5005 curr_offset = offset;
5007 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_SUB_CHANNEL );
5009 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5013 dtap_tp_open_loop_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5015 guint32 curr_offset;
5020 curr_offset = offset;
5023 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_ACK );
5025 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5029 dtap_tp_multi_slot_loop_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5031 guint32 curr_offset;
5036 curr_offset = offset;
5038 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_LOOP_TYPE );
5040 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5044 dtap_tp_multi_slot_loop_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5046 guint32 curr_offset;
5051 curr_offset = offset;
5053 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_LOOP_ACK );
5055 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5059 dtap_tp_test_interface(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5061 guint32 curr_offset;
5066 curr_offset = offset;
5068 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_TESTED_DEVICE );
5070 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5074 dtap_tp_gprs_test_mode_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5076 guint32 curr_offset;
5081 curr_offset = offset;
5083 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_PDU_DESCRIPTION );
5085 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_MODE_FLAG );
5087 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5091 dtap_tp_egprs_start_radio_block_loopback_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5093 guint32 curr_offset;
5098 curr_offset = offset;
5100 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_EGPRS_MODE_FLAG );
5102 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5106 dtap_tp_close_ue_test_loop(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5108 guint32 curr_offset;
5113 curr_offset = offset;
5115 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_UE_TEST_LOOP_MODE );
5117 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5121 dtap_tp_reset_ue_positioning_ue_stored_information(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5123 guint32 curr_offset;
5128 curr_offset = offset;
5130 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_UE_POSITIONING_TECHNOLOGY );
5132 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5136 dtap_tp_ue_test_loop_mode_3_rlc_sdu_counter_response(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5138 guint32 curr_offset;
5143 curr_offset = offset;
5145 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_RLC_SDU_COUNTER_VALUE );
5147 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5150 #define NUM_GSM_DTAP_MSG_MM (sizeof(gsm_a_dtap_msg_mm_strings)/sizeof(value_string))
5151 static gint ett_gsm_dtap_msg_mm[NUM_GSM_DTAP_MSG_MM];
5152 static void (*dtap_msg_mm_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
5153 dtap_mm_imsi_det_ind, /* IMSI Detach Indication */
5154 dtap_mm_loc_upd_acc, /* Location Updating Accept */
5155 dtap_mm_loc_upd_rej, /* Location Updating Reject */
5156 dtap_mm_loc_upd_req, /* Location Updating Request */
5157 NULL /* no associated data */, /* Authentication Reject */
5158 dtap_mm_auth_req, /* Authentication Request */
5159 dtap_mm_auth_resp, /* Authentication Response */
5160 dtap_mm_auth_fail, /* Authentication Failure */
5161 dtap_mm_id_req, /* Identity Request */
5162 dtap_mm_id_resp, /* Identity Response */
5163 dtap_mm_tmsi_realloc_cmd, /* TMSI Reallocation Command */
5164 NULL /* no associated data */, /* TMSI Reallocation Complete */
5165 NULL /* no associated data */, /* CM Service Accept */
5166 dtap_mm_cm_srvc_rej, /* CM Service Reject */
5167 NULL /* no associated data */, /* CM Service Abort */
5168 dtap_mm_cm_srvc_req, /* CM Service Request */
5169 dtap_mm_cm_srvc_prompt, /* CM Service Prompt */
5170 NULL, /* Reserved: was allocated in earlier phases of the protocol */
5171 dtap_mm_cm_reestab_req, /* CM Re-establishment Request */
5172 dtap_mm_abort, /* Abort */
5173 NULL /* no associated data */, /* MM Null */
5174 dtap_mm_mm_status, /* MM Status */
5175 dtap_mm_mm_info, /* MM Information */
5179 #define NUM_GSM_DTAP_MSG_CC (sizeof(gsm_a_dtap_msg_cc_strings)/sizeof(value_string))
5180 static gint ett_gsm_dtap_msg_cc[NUM_GSM_DTAP_MSG_CC];
5181 static void (*dtap_msg_cc_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
5182 dtap_cc_alerting, /* Alerting */
5183 dtap_cc_call_conf, /* Call Confirmed */
5184 dtap_cc_call_proceed, /* Call Proceeding */
5185 dtap_cc_connect, /* Connect */
5186 NULL /* no associated data */, /* Connect Acknowledge */
5187 dtap_cc_emerg_setup, /* Emergency Setup */
5188 dtap_cc_progress, /* Progress */
5189 dtap_cc_cc_est, /* CC-Establishment */
5190 dtap_cc_cc_est_conf, /* CC-Establishment Confirmed */
5191 dtap_cc_recall, /* Recall */
5192 dtap_cc_start_cc, /* Start CC */
5193 dtap_cc_setup, /* Setup */
5194 dtap_cc_modify, /* Modify */
5195 dtap_cc_modify_complete, /* Modify Complete */
5196 dtap_cc_modify_rej, /* Modify Reject */
5197 dtap_cc_user_info, /* User Information */
5198 NULL /* no associated data */, /* Hold */
5199 NULL /* no associated data */, /* Hold Acknowledge */
5200 dtap_cc_hold_rej, /* Hold Reject */
5201 NULL /* no associated data */, /* Retrieve */
5202 NULL /* no associated data */, /* Retrieve Acknowledge */
5203 dtap_cc_retrieve_rej, /* Retrieve Reject */
5204 dtap_cc_disconnect, /* Disconnect */
5205 dtap_cc_release, /* Release */
5206 dtap_cc_release_complete, /* Release Complete */
5207 dtap_cc_congestion_control, /* Congestion Control */
5208 dtap_cc_notify, /* Notify */
5209 dtap_cc_status, /* Status */
5210 NULL /* no associated data */, /* Status Enquiry */
5211 dtap_cc_start_dtmf, /* Start DTMF */
5212 NULL /* no associated data */, /* Stop DTMF */
5213 NULL /* no associated data */, /* Stop DTMF Acknowledge */
5214 dtap_cc_start_dtmf_ack, /* Start DTMF Acknowledge */
5215 dtap_cc_start_dtmf_rej, /* Start DTMF Reject */
5216 dtap_cc_facility, /* Facility */
5220 #define NUM_GSM_DTAP_MSG_SMS (sizeof(gsm_a_dtap_msg_sms_strings)/sizeof(value_string))
5221 static gint ett_gsm_dtap_msg_sms[NUM_GSM_DTAP_MSG_SMS];
5222 static void (*dtap_msg_sms_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
5223 dtap_sms_cp_data, /* CP-DATA */
5224 NULL /* no associated data */, /* CP-ACK */
5225 dtap_sms_cp_error, /* CP-ERROR */
5229 #define NUM_GSM_DTAP_MSG_SS (sizeof(gsm_a_dtap_msg_ss_strings)/sizeof(value_string))
5230 static gint ett_gsm_dtap_msg_ss[NUM_GSM_DTAP_MSG_SS];
5231 static void (*dtap_msg_ss_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
5232 dtap_cc_release_complete, /* Release Complete */
5233 dtap_cc_facility, /* Facility */
5234 dtap_ss_register, /* Register */
5238 #define NUM_GSM_DTAP_MSG_TP (sizeof(gsm_a_dtap_msg_tp_strings)/sizeof(value_string))
5239 static gint ett_gsm_dtap_msg_tp[NUM_GSM_DTAP_MSG_TP];
5240 static void (*dtap_msg_tp_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
5241 dtap_tp_close_tch_loop_cmd, /* CLOSE TCH LOOP CMD */
5242 NULL, /* CLOSE TCH LOOP ACK */
5243 dtap_tp_open_loop_cmd, /* OPEN LOOP CMD */
5244 NULL, /* ACT EMMI CMD */
5245 NULL, /* ACT EMMI ACK */
5246 NULL, /* DEACT EMMI */
5247 dtap_tp_test_interface, /* Test Interface */
5248 dtap_tp_multi_slot_loop_cmd, /* CLOSE Multi-slot LOOP CMD */
5249 dtap_tp_multi_slot_loop_ack, /* CLOSE Multi-slot LOOP ACK */
5250 NULL, /* OPEN Multi-slot LOOP CMD */
5251 NULL, /* OPEN Multi-slot LOOP ACK */
5252 dtap_tp_gprs_test_mode_cmd, /* GPRS TEST MODE CMD */
5253 dtap_tp_egprs_start_radio_block_loopback_cmd, /* EGPRS START RADIO BLOCK LOOPBACK CMD */
5254 dtap_tp_close_ue_test_loop, /* CLOSE UE TEST LOOP */
5255 NULL, /* CLOSE UE TEST LOOP COMPLETE */
5256 NULL, /* OPEN UE TEST LOOP */
5257 NULL, /* OPEN UE TEST LOOP COMPLETE */
5258 NULL, /* ACTIVATE RB TEST MODE */
5259 NULL, /* ACTIVATE RB TEST MODE COMPLETE */
5260 NULL, /* DEACTIVATE RB TEST MODE */
5261 NULL, /* DEACTIVATE RB TEST MODE COMPLETE */
5262 dtap_tp_reset_ue_positioning_ue_stored_information, /* RESET UE POSITIONING STORED INFORMATION */
5263 NULL, /* UE Test Loop Mode 3 RLC SDU Counter Request */
5264 dtap_tp_ue_test_loop_mode_3_rlc_sdu_counter_response, /* UE Test Loop Mode 3 RLC SDU Counter Response */
5268 /* GENERIC DISSECTOR FUNCTIONS */
5271 dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
5273 static gsm_a_tap_rec_t tap_rec[4];
5274 static gsm_a_tap_rec_t *tap_p;
5275 static guint tap_current=0;
5276 void (*msg_fcn)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len);
5281 guint32 oct_1, oct_2;
5283 proto_item *dtap_item = NULL;
5284 proto_tree *dtap_tree = NULL;
5285 proto_item *oct_1_item = NULL;
5286 proto_tree *pd_tree = NULL;
5287 const gchar *msg_str;
5294 len = tvb_length(tvb);
5299 * too short to be DTAP
5301 call_dissector(data_handle, tvb, pinfo, tree);
5305 if (check_col(pinfo->cinfo, COL_INFO))
5307 col_append_str(pinfo->cinfo, COL_INFO, "(DTAP) ");
5311 * set tap record pointer
5314 if (tap_current >= 4)
5318 tap_p = &tap_rec[tap_current];
5324 gsm_a_dtap_pinfo = pinfo;
5328 * get protocol discriminator
5330 oct_1 = tvb_get_guint8(tvb, offset++);
5332 if ((((oct_1 & DTAP_TI_MASK) >> 4) & DTAP_TIE_PRES_MASK) == DTAP_TIE_PRES_MASK)
5335 * eventhough we don't know if a TI should be in the message yet
5336 * we rely on the TI/SKIP indicator to be 0 to avoid taking this
5339 oct_2 = tvb_get_guint8(tvb, offset++);
5342 oct = tvb_get_guint8(tvb, offset);
5344 pd = oct_1 & DTAP_PD_MASK;
5351 if (check_col(pinfo->cinfo, COL_INFO))
5353 col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ",val_to_str(pd,gsm_a_pd_short_str_vals,"unknown"));
5362 msg_str = match_strval_idx((guint32) (oct & DTAP_CC_IEI_MASK), gsm_a_dtap_msg_cc_strings, &idx);
5363 ett_tree = ett_gsm_dtap_msg_cc[idx];
5364 hf_idx = hf_gsm_a_dtap_msg_cc_type;
5365 msg_fcn = dtap_msg_cc_fcn[idx];
5366 ti = (oct_1 & DTAP_TI_MASK) >> 4;
5371 msg_str = match_strval_idx((guint32) (oct & DTAP_MM_IEI_MASK), gsm_a_dtap_msg_mm_strings, &idx);
5372 ett_tree = ett_gsm_dtap_msg_mm[idx];
5373 hf_idx = hf_gsm_a_dtap_msg_mm_type;
5374 msg_fcn = dtap_msg_mm_fcn[idx];
5379 get_rr_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn);
5383 get_gmm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn);
5387 msg_str = match_strval_idx((guint32) (oct & DTAP_SMS_IEI_MASK), gsm_a_dtap_msg_sms_strings, &idx);
5388 ett_tree = ett_gsm_dtap_msg_sms[idx];
5389 hf_idx = hf_gsm_a_dtap_msg_sms_type;
5390 msg_fcn = dtap_msg_sms_fcn[idx];
5391 ti = (oct_1 & DTAP_TI_MASK) >> 4;
5395 get_sm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn);
5396 ti = (oct_1 & DTAP_TI_MASK) >> 4;
5400 msg_str = match_strval_idx((guint32) (oct & DTAP_SS_IEI_MASK), gsm_a_dtap_msg_ss_strings, &idx);
5401 ett_tree = ett_gsm_dtap_msg_ss[idx];
5402 hf_idx = hf_gsm_a_dtap_msg_ss_type;
5403 msg_fcn = dtap_msg_ss_fcn[idx];
5404 ti = (oct_1 & DTAP_TI_MASK) >> 4;
5409 msg_str = match_strval_idx((guint32) (oct & DTAP_TP_IEI_MASK), gsm_a_dtap_msg_tp_strings, &idx);
5410 ett_tree = ett_gsm_dtap_msg_tp[idx];
5411 hf_idx = hf_gsm_a_dtap_msg_tp_type;
5412 msg_fcn = dtap_msg_tp_fcn[idx];
5413 ti = (oct_1 & DTAP_TI_MASK) >> 4;
5418 /* 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 */
5422 sccp_msg = pinfo->sccp_info;
5424 if (sccp_msg && sccp_msg->data.co.assoc) {
5425 sccp_assoc = sccp_msg->data.co.assoc;
5432 * create the protocol tree
5434 if (msg_str == NULL)
5437 proto_tree_add_protocol_format(tree, proto_a_dtap, tvb, 0, len,
5438 "GSM A-I/F DTAP - Unknown DTAP Message Type (0x%02x)",
5441 dtap_tree = proto_item_add_subtree(dtap_item, ett_dtap_msg);
5443 if (sccp_msg && !sccp_msg->data.co.label) {
5444 sccp_msg->data.co.label = se_strdup_printf("DTAP (0x%02x)",oct);
5452 proto_tree_add_protocol_format(tree, proto_a_dtap, tvb, 0, -1,
5453 "GSM A-I/F DTAP - %s",
5456 dtap_tree = proto_item_add_subtree(dtap_item, ett_tree);
5458 if (sccp_msg && !sccp_msg->data.co.label) {
5459 sccp_msg->data.co.label = se_strdup(msg_str);
5462 if (check_col(pinfo->cinfo, COL_INFO))
5464 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
5469 proto_tree_add_text(dtap_tree,
5471 "Protocol Discriminator: %s",
5472 val_to_str(pd, protocol_discriminator_vals, "Unknown (%u)"));
5474 pd_tree = proto_item_add_subtree(oct_1_item, ett_dtap_oct_1);
5478 proto_tree_add_item(pd_tree, hf_gsm_a_skip_ind, tvb, 0, 1, FALSE);
5482 other_decode_bitfield_value(a_bigbuf, oct_1, 0x80, 8);
5483 proto_tree_add_text(pd_tree,
5487 ((oct_1 & 0x80) ? "allocated by receiver" : "allocated by sender"));
5489 if ((ti & DTAP_TIE_PRES_MASK) == DTAP_TIE_PRES_MASK)
5491 /* ti is extended to next octet */
5493 other_decode_bitfield_value(a_bigbuf, oct_1, 0x70, 8);
5494 proto_tree_add_text(pd_tree,
5496 "%s : TIO: The TI value is given by the TIE in octet 2",
5501 other_decode_bitfield_value(a_bigbuf, oct_1, 0x70, 8);
5502 proto_tree_add_text(pd_tree,
5506 ti & DTAP_TIE_PRES_MASK);
5510 proto_tree_add_item(pd_tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, FALSE);
5513 (ti & DTAP_TIE_PRES_MASK) == DTAP_TIE_PRES_MASK)
5515 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, 1, 1, FALSE);
5517 other_decode_bitfield_value(a_bigbuf, oct_2, DTAP_TIE_MASK, 8);
5518 proto_tree_add_text(pd_tree,
5522 oct_2 & DTAP_TIE_MASK);
5528 if ((pinfo->p2p_dir == P2P_DIR_RECV) &&
5535 * add DTAP message name
5537 proto_tree_add_uint_format(dtap_tree, hf_idx,
5538 tvb, offset, 1, oct,
5539 "Message Type %s",msg_str ? msg_str : "(Unknown)");
5543 tap_p->pdu_type = GSM_A_PDU_TYPE_DTAP;
5544 tap_p->message_type = (nsd ? (oct & 0x3f) : oct);
5545 tap_p->protocol_disc = pd;
5547 tap_queue_packet(gsm_a_tap, pinfo, tap_p);
5549 if (msg_str == NULL) return;
5551 if ((len - offset) <= 0) return;
5556 if (msg_fcn == NULL)
5558 proto_tree_add_text(dtap_tree,
5559 tvb, offset, len - offset,
5560 "Message Elements");
5564 (*msg_fcn)(tvb, dtap_tree, offset, len - offset);
5569 /* Register the protocol with Wireshark */
5571 proto_register_gsm_a_dtap(void)
5576 /* Setup list of header fields */
5578 static hf_register_info hf[] =
5580 { &hf_gsm_a_dtap_msg_mm_type,
5581 { "DTAP Mobility Management Message Type", "gsm_a.dtap_msg_mm_type",
5582 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_mm_strings), 0x0,
5585 { &hf_gsm_a_dtap_msg_cc_type,
5586 { "DTAP Call Control Message Type", "gsm_a.dtap_msg_cc_type",
5587 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_cc_strings), 0x0,
5590 { &hf_gsm_a_dtap_msg_sms_type,
5591 { "DTAP Short Message Service Message Type", "gsm_a.dtap_msg_sms_type",
5592 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_sms_strings), 0x0,
5595 { &hf_gsm_a_dtap_msg_ss_type,
5596 { "DTAP Non call Supplementary Service Message Type", "gsm_a.dtap_msg_ss_type",
5597 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_ss_strings), 0x0,
5600 { &hf_gsm_a_dtap_msg_tp_type,
5601 { "DTAP Tests Procedures Message Type", "gsm_a.dtap_msg_tp_type",
5602 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_tp_strings), 0x0,
5605 { &hf_gsm_a_dtap_elem_id,
5606 { "Element ID", "gsm_a_dtap.elem_id",
5607 FT_UINT8, BASE_DEC, NULL, 0,
5610 { &hf_gsm_a_cld_party_bcd_num,
5611 { "Called Party BCD Number", "gsm_a.cld_party_bcd_num",
5612 FT_STRING, BASE_DEC, 0, 0,
5615 { &hf_gsm_a_clg_party_bcd_num,
5616 { "Calling Party BCD Number", "gsm_a.clg_party_bcd_num",
5617 FT_STRING, BASE_DEC, 0, 0,
5620 { &hf_gsm_a_dtap_cause,
5621 { "DTAP Cause", "gsm_a_dtap.cause",
5622 FT_UINT8, BASE_HEX, 0, 0x0,
5625 { &hf_gsm_a_extension,
5626 { "Extension", "gsm_a.extension",
5627 FT_BOOLEAN, 8, TFS(&gsm_a_extension_value), 0x80,
5628 "Extension", HFILL }
5630 { &hf_gsm_a_type_of_number,
5631 { "Type of number", "gsm_a.type_of_number",
5632 FT_UINT8, BASE_HEX, VALS(gsm_a_type_of_number_values), 0x70,
5633 "Type of number", HFILL }
5635 { &hf_gsm_a_numbering_plan_id,
5636 { "Numbering plan identification", "gsm_a.numbering_plan_id",
5637 FT_UINT8, BASE_HEX, VALS(gsm_a_numbering_plan_id_values), 0x0f,
5638 "Numbering plan identification", HFILL }
5641 { "LSA Identifier", "gsm_a.lsa_id",
5642 FT_UINT24, BASE_HEX, NULL, 0x0,
5643 "LSA Identifier", HFILL }
5647 /* Setup protocol subtree array */
5648 #define NUM_INDIVIDUAL_ELEMS 18
5649 static gint *ett[NUM_INDIVIDUAL_ELEMS +
5650 NUM_GSM_DTAP_MSG_MM + NUM_GSM_DTAP_MSG_CC +
5651 NUM_GSM_DTAP_MSG_SMS + NUM_GSM_DTAP_MSG_SS + NUM_GSM_DTAP_MSG_TP +
5654 ett[0] = &ett_dtap_msg;
5655 ett[1] = &ett_dtap_oct_1;
5656 ett[2] = &ett_cm_srvc_type;
5657 ett[3] = &ett_gsm_enc_info;
5658 ett[4] = &ett_bc_oct_3a;
5659 ett[5] = &ett_bc_oct_4;
5660 ett[6] = &ett_bc_oct_5;
5661 ett[7] = &ett_bc_oct_5a;
5662 ett[8] = &ett_bc_oct_5b;
5663 ett[9] = &ett_bc_oct_6;
5664 ett[10] = &ett_bc_oct_6a;
5665 ett[11] = &ett_bc_oct_6b;
5666 ett[12] = &ett_bc_oct_6c;
5667 ett[13] = &ett_bc_oct_6d;
5668 ett[14] = &ett_bc_oct_6e;
5669 ett[15] = &ett_bc_oct_6f;
5670 ett[16] = &ett_bc_oct_6g;
5671 ett[17] = &ett_bc_oct_7;
5673 last_offset = NUM_INDIVIDUAL_ELEMS;
5675 for (i=0; i < NUM_GSM_DTAP_MSG_MM; i++, last_offset++)
5677 ett_gsm_dtap_msg_mm[i] = -1;
5678 ett[last_offset] = &ett_gsm_dtap_msg_mm[i];
5681 for (i=0; i < NUM_GSM_DTAP_MSG_CC; i++, last_offset++)
5683 ett_gsm_dtap_msg_cc[i] = -1;
5684 ett[last_offset] = &ett_gsm_dtap_msg_cc[i];
5687 for (i=0; i < NUM_GSM_DTAP_MSG_SMS; i++, last_offset++)
5689 ett_gsm_dtap_msg_sms[i] = -1;
5690 ett[last_offset] = &ett_gsm_dtap_msg_sms[i];
5693 for (i=0; i < NUM_GSM_DTAP_MSG_SS; i++, last_offset++)
5695 ett_gsm_dtap_msg_ss[i] = -1;
5696 ett[last_offset] = &ett_gsm_dtap_msg_ss[i];
5699 for (i=0; i < NUM_GSM_DTAP_MSG_TP; i++, last_offset++)
5701 ett_gsm_dtap_msg_tp[i] = -1;
5702 ett[last_offset] = &ett_gsm_dtap_msg_tp[i];
5705 for (i=0; i < NUM_GSM_DTAP_ELEM; i++, last_offset++)
5707 ett_gsm_dtap_elem[i] = -1;
5708 ett[last_offset] = &ett_gsm_dtap_elem[i];
5711 /* Register the protocol name and description */
5714 proto_register_protocol("GSM A-I/F DTAP", "GSM DTAP", "gsm_a_dtap");
5716 proto_register_field_array(proto_a_dtap, hf, array_length(hf));
5718 proto_register_subtree_array(ett, array_length(ett));
5720 /* subdissector code */
5721 register_dissector("gsm_a_dtap", dissect_dtap, proto_a_dtap);
5725 proto_reg_handoff_gsm_a_dtap(void)
5728 dtap_handle = find_dissector("gsm_a_dtap");
5729 rp_handle = find_dissector("gsm_a_rp");
5731 dissector_add("bssap.pdu_type", BSSAP_PDU_TYPE_DTAP, dtap_handle);
5732 dissector_add("ranap.nas_pdu", BSSAP_PDU_TYPE_DTAP, dtap_handle);
5733 dissector_add("llcgprs.sapi", 1 , dtap_handle); /* GPRS Mobility Management */
5734 dissector_add("llcgprs.sapi", 7 , dtap_handle); /* SMS */
5735 data_handle = find_dissector("data");
5736 gsm_map_handle = find_dissector("gsm_map");
5737 gsm_bsslap_handle = find_dissector("gsm_bsslap");