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_seq_no = -1;
377 static int hf_gsm_a_dtap_msg_sms_type = -1;
378 static int hf_gsm_a_dtap_msg_ss_type = -1;
379 static int hf_gsm_a_dtap_msg_tp_type = -1;
380 int hf_gsm_a_dtap_elem_id = -1;
381 static int hf_gsm_a_cld_party_bcd_num = -1;
382 static int hf_gsm_a_clg_party_bcd_num = -1;
383 static int hf_gsm_a_dtap_cause = -1;
385 int hf_gsm_a_extension = -1;
386 static int hf_gsm_a_type_of_number = -1;
387 static int hf_gsm_a_numbering_plan_id = -1;
389 static int hf_gsm_a_lsa_id = -1;
391 /* Initialize the subtree pointers */
392 static gint ett_dtap_msg = -1;
393 static gint ett_dtap_oct_1 = -1;
394 static gint ett_cm_srvc_type = -1;
395 static gint ett_gsm_enc_info = -1;
396 static gint ett_bc_oct_3a = -1;
397 static gint ett_bc_oct_4 = -1;
398 static gint ett_bc_oct_5 = -1;
399 static gint ett_bc_oct_5a = -1;
400 static gint ett_bc_oct_5b = -1;
401 static gint ett_bc_oct_6 = -1;
402 static gint ett_bc_oct_6a = -1;
403 static gint ett_bc_oct_6b = -1;
404 static gint ett_bc_oct_6c = -1;
405 static gint ett_bc_oct_6d = -1;
406 static gint ett_bc_oct_6e = -1;
407 static gint ett_bc_oct_6f = -1;
408 static gint ett_bc_oct_6g = -1;
409 static gint ett_bc_oct_7 = -1;
411 static char a_bigbuf[1024];
413 static dissector_handle_t data_handle;
414 static dissector_handle_t gsm_map_handle;
415 static dissector_handle_t rp_handle;
417 packet_info *gsm_a_dtap_pinfo;
418 static proto_tree *g_tree;
421 * this should be set on a per message basis, if possible
423 static gint is_uplink;
425 #define NUM_GSM_DTAP_ELEM (sizeof(gsm_dtap_elem_strings)/sizeof(value_string))
426 gint ett_gsm_dtap_elem[NUM_GSM_DTAP_ELEM];
428 static dgt_set_t Dgt_mbcd = {
430 /* 0 1 2 3 4 5 6 7 8 9 a b c d e */
431 '0','1','2','3','4','5','6','7','8','9','*','#','a','b','c'
439 de_auth_param_rand(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
444 curr_offset = offset;
447 * 16 octets == 128 bits
449 #define AUTH_PARAM_RAND_LEN 16
451 proto_tree_add_text(tree,
452 tvb, curr_offset, AUTH_PARAM_RAND_LEN,
454 tvb_bytes_to_str(tvb, curr_offset, AUTH_PARAM_RAND_LEN));
456 curr_offset += AUTH_PARAM_RAND_LEN;
458 /* no length check possible */
460 return(curr_offset - offset);
467 de_auth_param_autn(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
471 curr_offset = offset;
473 proto_tree_add_text(tree,
474 tvb, curr_offset, len,
476 tvb_bytes_to_str(tvb, curr_offset, len));
480 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
482 return(curr_offset - offset);
489 de_auth_resp_param(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
494 curr_offset = offset;
497 * 4 octets == 32 bits
499 #define AUTH_PARAM_SRES_LEN 4
501 proto_tree_add_text(tree,
502 tvb, curr_offset, AUTH_PARAM_SRES_LEN,
504 tvb_bytes_to_str(tvb, curr_offset, AUTH_PARAM_SRES_LEN));
506 curr_offset += AUTH_PARAM_SRES_LEN;
508 /* no length check possible */
510 return(curr_offset - offset);
517 de_auth_resp_param_ext(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
521 curr_offset = offset;
523 proto_tree_add_text(tree,
524 tvb, curr_offset, len,
526 tvb_bytes_to_str(tvb, curr_offset, len));
530 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
532 return(curr_offset - offset);
539 de_auth_fail_param(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
543 curr_offset = offset;
545 proto_tree_add_text(tree,
546 tvb, curr_offset, len,
548 tvb_bytes_to_str(tvb, curr_offset, len));
552 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
554 return(curr_offset - offset);
561 de_network_name(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
567 curr_offset = offset;
569 oct = tvb_get_guint8(tvb, curr_offset);
571 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
573 switch ((oct & 0x70) >> 4)
575 case 0x00: str = "Cell Broadcast data coding scheme, GSM default alphabet, language unspecified, defined in 3GPP TS 03.38"; break;
576 case 0x01: str = "UCS2 (16 bit)"; break;
582 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
583 proto_tree_add_text(tree,
585 "%s : Coding Scheme: %s",
589 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
590 proto_tree_add_text(tree,
592 "%s : Add CI: The MS should %s",
595 "add the letters for the Country's Initials and a separator (e.g. a space) to the text string" :
596 "The MS should not add the letters for the Country's Initials to the text string");
600 case 1: str = "bit 8 is spare and set to '0' in octet n"; break;
601 case 2: str = "bits 7 and 8 are spare and set to '0' in octet n"; break;
602 case 3: str = "bits 6 to 8(inclusive) are spare and set to '0' in octet n"; break;
603 case 4: str = "bits 5 to 8(inclusive) are spare and set to '0' in octet n"; break;
604 case 5: str = "bits 4 to 8(inclusive) are spare and set to '0' in octet n"; break;
605 case 6: str = "bits 3 to 8(inclusive) are spare and set to '0' in octet n"; break;
606 case 7: str = "bits 2 to 8(inclusive) are spare and set to '0' in octet n"; break;
608 str = "this field carries no information about the number of spare bits in octet n";
612 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
613 proto_tree_add_text(tree,
615 "%s : Number of spare bits in last octet: %s",
621 NO_MORE_DATA_CHECK(len);
623 proto_tree_add_text(tree,
624 tvb, curr_offset, len - 1,
625 "Text string encoded according to Coding Scheme");
627 curr_offset += len - 1;
629 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
631 return(curr_offset - offset);
635 * [3] 10.5.3.6 Reject cause
638 de_rej_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
644 curr_offset = offset;
646 oct = tvb_get_guint8(tvb, curr_offset);
650 case 0x02: str = "IMSI unknown in HLR"; break;
651 case 0x03: str = "Illegal MS"; break;
652 case 0x04: str = "IMSI unknown in VLR"; break;
653 case 0x05: str = "IMEI not accepted"; break;
654 case 0x06: str = "Illegal ME"; break;
655 case 0x0b: str = "PLMN not allowed"; break;
656 case 0x0c: str = "Location Area not allowed"; break;
657 case 0x0d: str = "Roaming not allowed in this location area"; break;
658 case 0x0f: str = "No Suitable Cells In Location Area"; break;
659 case 0x11: str = "Network failure"; break;
660 case 0x14: str = "MAC failure"; break;
661 case 0x15: str = "Synch failure"; break;
662 case 0x16: str = "Congestion"; break;
663 case 0x17: str = "GSM authentication unacceptable"; break;
664 case 0x20: str = "Service option not supported"; break;
665 case 0x21: str = "Requested service option not subscribed"; break;
666 case 0x22: str = "Service option temporarily out of order"; break;
667 case 0x26: str = "Call cannot be identified"; break;
668 case 0x5f: str = "Semantically incorrect message"; break;
669 case 0x60: str = "Invalid mandatory information"; break;
670 case 0x61: str = "Message type non-existent or not implemented"; break;
671 case 0x62: str = "Message type not compatible with the protocol state"; break;
672 case 0x63: str = "Information element non-existent or not implemented"; break;
673 case 0x64: str = "Conditional IE error"; break;
674 case 0x65: str = "Message not compatible with the protocol state"; break;
675 case 0x6f: str = "Protocol error, unspecified"; break;
679 case IS_UPLINK_FALSE:
680 str = "Service option temporarily out of order";
683 str = "Protocol error, unspecified";
689 proto_tree_add_text(tree,
691 "Reject Cause value: 0x%02x (%u) %s",
698 /* no length check possible */
700 return(curr_offset - offset);
707 de_time_zone(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
713 curr_offset = offset;
715 /* 3GPP TS 23.040 version 6.6.0 Release 6
716 * 9.2.3.11 TP-Service-Centre-Time-Stamp (TP-SCTS)
718 * The Time Zone indicates the difference, expressed in quarters of an hour,
719 * between the local time and GMT. In the first of the two semi-octets,
720 * the first bit (bit 3 of the seventh octet of the TP-Service-Centre-Time-Stamp field)
721 * represents the algebraic sign of this difference (0: positive, 1: negative).
724 oct = tvb_get_guint8(tvb, curr_offset);
725 sign = (oct & 0x08)?'-':'+';
726 oct = (oct >> 4) + (oct & 0x07) * 10;
728 proto_tree_add_text(tree,
730 "Timezone: GMT %c %d hours %d minutes",
731 sign, oct / 4, oct % 4 * 15);
734 /* no length check possible */
736 return(curr_offset - offset);
743 de_time_zone_time(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
745 guint8 oct, oct2, oct3;
749 curr_offset = offset;
751 oct = tvb_get_guint8(tvb, curr_offset);
752 oct2 = tvb_get_guint8(tvb, curr_offset+1);
753 oct3 = tvb_get_guint8(tvb, curr_offset+2);
755 proto_tree_add_text(tree,
757 "Year %u%u, Month %u%u, Day %u%u",
767 oct = tvb_get_guint8(tvb, curr_offset);
768 oct2 = tvb_get_guint8(tvb, curr_offset+1);
769 oct3 = tvb_get_guint8(tvb, curr_offset+2);
771 proto_tree_add_text(tree,
773 "Hour %u%u, Minutes %u%u, Seconds %u%u",
783 /* 3GPP TS 23.040 version 6.6.0 Release 6
784 * 9.2.3.11 TP-Service-Centre-Time-Stamp (TP-SCTS)
786 * The Time Zone indicates the difference, expressed in quarters of an hour,
787 * between the local time and GMT. In the first of the two semi-octets,
788 * the first bit (bit 3 of the seventh octet of the TP-Service-Centre-Time-Stamp field)
789 * represents the algebraic sign of this difference (0: positive, 1: negative).
792 oct = tvb_get_guint8(tvb, curr_offset);
793 sign = (oct & 0x08)?'-':'+';
794 oct = (oct >> 4) + (oct & 0x07) * 10;
796 proto_tree_add_text(tree,
798 "Timezone: GMT %c %d hours %d minutes",
799 sign, oct / 4, oct % 4 * 15);
803 /* no length check possible */
805 return(curr_offset - offset);
809 * [3] 10.5.3.11 3GPP TS 24.008 version 6.8.0 Release 6
812 de_lsa_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
816 curr_offset = offset;
819 proto_tree_add_text(tree,tvb, curr_offset, len,"LSA ID not included");
821 proto_tree_add_item(tree, hf_gsm_a_lsa_id, tvb, curr_offset, 3, FALSE);
826 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
828 return(curr_offset - offset);
835 de_day_saving_time(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
841 curr_offset = offset;
843 oct = tvb_get_guint8(tvb, curr_offset);
845 other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
846 proto_tree_add_text(tree,
853 case 0: str = "No adjustment for Daylight Saving Time"; break;
854 case 1: str = "+1 hour adjustment for Daylight Saving Time"; break;
855 case 2: str = "+2 hours adjustment for Daylight Saving Time"; break;
861 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
862 proto_tree_add_text(tree,
870 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
872 return(curr_offset - offset);
879 de_aux_states(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
885 curr_offset = offset;
887 oct = tvb_get_guint8(tvb, curr_offset);
889 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
891 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
892 proto_tree_add_text(tree,
897 switch ((oct & 0x0c) >> 2)
899 case 0: str = "Idle"; break;
900 case 1: str = "Hold request"; break;
901 case 2: str = "Call held"; break;
903 str = "Retrieve request";
907 other_decode_bitfield_value(a_bigbuf, oct, 0x0c, 8);
908 proto_tree_add_text(tree,
910 "%s : Hold auxiliary state: %s",
916 case 0: str = "Idle"; break;
917 case 1: str = "MPTY request"; break;
918 case 2: str = "Call in MPTY"; break;
920 str = "Split request";
924 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
925 proto_tree_add_text(tree,
927 "%s : Multi party auxiliary state: %s",
933 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
935 return(curr_offset - offset);
942 de_bearer_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
948 guint32 saved_offset;
953 #define DE_BC_ITC_SPEECH 0x00
954 #define DE_BC_ITC_UDI 0x01
955 #define DE_BC_ITC_EX_PLMN 0x02
956 #define DE_BC_ITC_FASC_G3 0x03
957 #define DE_BC_ITC_OTHER_ITC 0x05
958 #define DE_BC_ITC_RSVD_NET 0x07
960 curr_offset = offset;
962 oct = tvb_get_guint8(tvb, curr_offset);
967 * warning, bearer cap uses extended values that
968 * are reversed from other parameters!
970 extended = (oct & 0x80) ? FALSE : TRUE;
973 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
974 proto_tree_add_text(tree,
976 "%s : Extension: %s",
978 extended ? "extended" : "not extended");
982 case IS_UPLINK_FALSE:
988 * depends on Information transfer capability
992 case DE_BC_ITC_SPEECH:
995 switch ((oct & 0x60) >> 5)
997 case 1: str = "MS supports at least full rate speech version 1 but does not support half rate speech version 1"; break;
998 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;
999 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;
1007 switch ((oct & 0x60) >> 5)
1009 case 1: str = "Full rate support only MS/fullrate speech version 1 supported"; break;
1010 case 2: str = "Dual rate support MS/half rate speech version 1 preferred, full rate speech version 1 also supported"; break;
1011 case 3: str = "Dual rate support MS/full rate speech version 1 preferred, half rate speech version 1 also supported"; break;
1020 switch ((oct & 0x60) >> 5)
1022 case 1: str = "Full rate support only MS"; break;
1023 case 2: str = "Dual rate support MS/half rate preferred"; break;
1024 case 3: str = "Dual rate support MS/full rate preferred"; break;
1034 str = "(dissect problem)";
1038 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
1039 proto_tree_add_text(tree,
1040 tvb, curr_offset, 1,
1041 "%s : Radio channel requirement: %s",
1045 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1046 proto_tree_add_text(tree,
1047 tvb, curr_offset, 1,
1048 "%s : Coding standard: %s",
1050 (oct & 0x10) ? "reserved" : "GSM standardized coding");
1052 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1053 proto_tree_add_text(tree,
1054 tvb, curr_offset, 1,
1055 "%s : Transfer mode: %s",
1057 (oct & 0x08) ? "packet" : "circuit");
1061 case DE_BC_ITC_SPEECH: str = "Speech"; break;
1062 case DE_BC_ITC_UDI: str = "Unrestricted digital information"; break;
1063 case DE_BC_ITC_EX_PLMN: str = "3.1 kHz audio, ex PLMN"; break;
1064 case DE_BC_ITC_FASC_G3: str = "Facsimile group 3"; break;
1065 case DE_BC_ITC_OTHER_ITC: str = "Other ITC (See Octet 5a)"; break;
1066 case DE_BC_ITC_RSVD_NET: str = "Reserved, to be used in the network"; break;
1072 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1073 proto_tree_add_text(tree,
1074 tvb, curr_offset, 1,
1075 "%s : Information transfer capability: %s",
1080 g_snprintf(add_string, string_len, " - (%s)", str);
1084 NO_MORE_DATA_CHECK(len);
1088 case DE_BC_ITC_SPEECH:
1092 proto_tree_add_text(tree,
1093 tvb, curr_offset, -1,
1094 "Octets 3a - Speech Versions");
1096 subtree = proto_item_add_subtree(item, ett_bc_oct_3a);
1098 saved_offset = curr_offset;
1102 oct = tvb_get_guint8(tvb, curr_offset);
1104 extended = (oct & 0x80) ? FALSE : TRUE;
1106 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1107 proto_tree_add_text(subtree,
1108 tvb, curr_offset, 1,
1109 "%s : Extension: %s",
1111 extended ? "extended" : "not extended");
1113 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1114 proto_tree_add_text(subtree,
1115 tvb, curr_offset, 1,
1116 "%s : Coding: octet used for %s",
1118 (oct & 0x40) ? "other extension of octet 3" :
1119 "extension of information transfer capability");
1121 other_decode_bitfield_value(a_bigbuf, oct, 0x30, 8);
1122 proto_tree_add_text(subtree,
1123 tvb, curr_offset, 1,
1129 case 0: str = "GSM full rate speech version 1"; break;
1130 case 2: str = "GSM full rate speech version 2"; break;
1131 case 4: str = "GSM full rate speech version 3"; break;
1132 case 1: str = "GSM half rate speech version 1"; break;
1133 case 5: str = "GSM half rate speech version 3"; break;
1135 str = "Speech version TBD";
1139 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
1140 proto_tree_add_text(subtree,
1141 tvb, curr_offset, 1,
1142 "%s : Speech version indication: %s",
1149 ((len - (curr_offset - offset)) > 0));
1151 proto_item_set_len(item, curr_offset - saved_offset);
1158 proto_tree_add_text(tree,
1159 tvb, curr_offset, 1,
1162 subtree = proto_item_add_subtree(item, ett_bc_oct_4);
1164 oct = tvb_get_guint8(tvb, curr_offset);
1166 extended = (oct & 0x80) ? FALSE : TRUE;
1168 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1169 proto_tree_add_text(subtree,
1170 tvb, curr_offset, 1,
1171 "%s : Extension: %s",
1173 extended ? "extended" : "not extended");
1175 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1176 proto_tree_add_text(subtree,
1177 tvb, curr_offset, 1,
1178 "%s : Compression: data compression %s%s",
1180 (oct & 0x40) ? "" : "not ",
1181 is_uplink ? "allowed" : "possible");
1183 switch ((oct & 0x30) >> 4)
1185 case 0x00: str = "Service data unit integrity"; break;
1186 case 0x03: str = "Unstructured"; break;
1192 other_decode_bitfield_value(a_bigbuf, oct, 0x30, 8);
1193 proto_tree_add_text(subtree,
1194 tvb, curr_offset, 1,
1195 "%s : Structure: %s",
1199 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1200 proto_tree_add_text(subtree,
1201 tvb, curr_offset, 1,
1202 "%s : Duplex mode: %s",
1204 (oct & 0x08) ? "Full" : "Half");
1206 other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
1207 proto_tree_add_text(subtree,
1208 tvb, curr_offset, 1,
1209 "%s : Configuration: %s",
1211 (oct & 0x04) ? "Reserved" : "Point-to-point");
1213 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
1214 proto_tree_add_text(subtree,
1215 tvb, curr_offset, 1,
1219 "Data up to and including 4.8 kb/s, full rate, non-transparent, 6 kb/s radio interface rate is requested" :
1220 "No meaning is associated with this value");
1222 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1223 proto_tree_add_text(subtree,
1224 tvb, curr_offset, 1,
1225 "%s : Establishment: %s",
1227 (oct & 0x01) ? "Reserved" : "Demand");
1231 NO_MORE_DATA_CHECK(len);
1236 proto_tree_add_text(tree,
1237 tvb, curr_offset, 1,
1240 subtree = proto_item_add_subtree(item, ett_bc_oct_5);
1242 oct = tvb_get_guint8(tvb, curr_offset);
1244 extended = (oct & 0x80) ? FALSE : TRUE;
1246 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1247 proto_tree_add_text(subtree,
1248 tvb, curr_offset, 1,
1249 "%s : Extension: %s",
1251 extended ? "extended" : "not extended");
1253 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
1254 proto_tree_add_text(subtree,
1255 tvb, curr_offset, 1,
1256 "%s : Access Identity: %s",
1258 (oct & 0x60) ? "Reserved" : "Octet identifier");
1260 switch ((oct & 0x18) >> 3)
1262 case 0x00: str = "No rate adaption"; break;
1263 case 0x01: str = "V.110, I.460/X.30 rate adaptation"; break;
1264 case 0x02: str = "ITU-T X.31 flag stuffing"; break;
1266 str = "Other rate adaption (see octet 5a)";
1270 other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
1271 proto_tree_add_text(subtree,
1272 tvb, curr_offset, 1,
1273 "%s : Rate Adaption: %s",
1279 case 0x01: str = "I.440/450"; break;
1280 case 0x02: str = "Reserved: was allocated in earlier phases of the protocol"; break;
1281 case 0x03: str = "Reserved: was allocated in earlier phases of the protocol"; break;
1282 case 0x04: str = "Reserved: was allocated in earlier phases of the protocol"; break;
1283 case 0x05: str = "Reserved: was allocated in earlier phases of the protocol"; break;
1284 case 0x06: str = "Reserved: was allocated in earlier phases of the protocol"; break;
1290 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1291 proto_tree_add_text(subtree,
1292 tvb, curr_offset, 1,
1293 "%s : Signalling Access Protocol: %s",
1299 NO_MORE_DATA_CHECK(len);
1301 if (!extended) goto bc_octet_6;
1306 proto_tree_add_text(tree,
1307 tvb, curr_offset, 1,
1310 subtree = proto_item_add_subtree(item, ett_bc_oct_5a);
1312 oct = tvb_get_guint8(tvb, curr_offset);
1314 extended = (oct & 0x80) ? FALSE : TRUE;
1316 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1317 proto_tree_add_text(subtree,
1318 tvb, curr_offset, 1,
1319 "%s : Extension: %s",
1321 extended ? "extended" : "not extended");
1323 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
1324 proto_tree_add_text(subtree,
1325 tvb, curr_offset, 1,
1326 "%s : Other ITC: %s",
1328 (oct & 0x60) ? "Reserved" : "Restricted digital information");
1330 switch ((oct & 0x18) >> 3)
1332 case 0x00: str = "V.120"; break;
1333 case 0x01: str = "H.223 & H.245"; break;
1334 case 0x02: str = "PIAFS"; break;
1340 other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
1341 proto_tree_add_text(subtree,
1342 tvb, curr_offset, 1,
1343 "%s : Other Rate Adaption: %s",
1347 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1348 proto_tree_add_text(subtree,
1349 tvb, curr_offset, 1,
1355 NO_MORE_DATA_CHECK(len);
1357 if (!extended) goto bc_octet_6;
1362 proto_tree_add_text(tree,
1363 tvb, curr_offset, 1,
1366 subtree = proto_item_add_subtree(item, ett_bc_oct_5b);
1368 oct = tvb_get_guint8(tvb, curr_offset);
1370 extended = (oct & 0x80) ? FALSE : TRUE;
1372 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1373 proto_tree_add_text(subtree,
1374 tvb, curr_offset, 1,
1375 "%s : Extension: %s",
1377 extended ? "extended" : "not extended");
1379 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1380 proto_tree_add_text(subtree,
1381 tvb, curr_offset, 1,
1382 "%s : Rate Adaption Header: %sincluded",
1384 (oct & 0x40) ? "" : "not ");
1386 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
1387 proto_tree_add_text(subtree,
1388 tvb, curr_offset, 1,
1389 "%s : Multiple frame establishment support in data link: %s",
1391 (oct & 0x20) ? "Supported" : "Not supported, only UI frames allowed");
1393 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1394 proto_tree_add_text(subtree,
1395 tvb, curr_offset, 1,
1396 "%s : Mode of operation: %s",
1398 (oct & 0x10) ? "Protocol sensitive" : "Bit transparent");
1400 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1401 proto_tree_add_text(subtree,
1402 tvb, curr_offset, 1,
1403 "%s : Logical link identifier negotiation: %s",
1405 (oct & 0x08) ? "Full protocol negotiation" : "Default, LLI=256 only");
1407 other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
1408 proto_tree_add_text(subtree,
1409 tvb, curr_offset, 1,
1410 "%s : Assignor/Assignee: Message originator is '%s'",
1412 (oct & 0x04) ? "assignor only" : "default assignee");
1414 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
1415 proto_tree_add_text(subtree,
1416 tvb, curr_offset, 1,
1417 "%s : In band/Out of band negotiation: Negotiation is done %s",
1420 "with USER INFORMATION messages on a temporary signalling connection" :
1421 "in-band using logical link zero");
1423 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1424 proto_tree_add_text(subtree,
1425 tvb, curr_offset, 1,
1431 NO_MORE_DATA_CHECK(len);
1438 proto_tree_add_text(tree,
1439 tvb, curr_offset, 1,
1442 subtree = proto_item_add_subtree(item, ett_bc_oct_6);
1444 oct = tvb_get_guint8(tvb, curr_offset);
1446 extended = (oct & 0x80) ? FALSE : TRUE;
1448 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1449 proto_tree_add_text(subtree,
1450 tvb, curr_offset, 1,
1451 "%s : Extension: %s",
1453 extended ? "extended" : "not extended");
1455 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
1456 proto_tree_add_text(subtree,
1457 tvb, curr_offset, 1,
1458 "%s : Layer 1 Identity: %s",
1460 ((oct & 0x60) == 0x20) ? "Octet identifier" : "Reserved");
1462 other_decode_bitfield_value(a_bigbuf, oct, 0x1e, 8);
1463 proto_tree_add_text(subtree,
1464 tvb, curr_offset, 1,
1465 "%s : User information layer 1 protocol: %s",
1467 (oct & 0x1e) ? "Reserved" : "Default layer 1 protocol");
1469 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
1470 proto_tree_add_text(subtree,
1471 tvb, curr_offset, 1,
1472 "%s : Synchronous/asynchronous: %s",
1474 (oct & 0x01) ? "Asynchronous" : "Synchronous");
1478 NO_MORE_DATA_CHECK(len);
1480 if (!extended) goto bc_octet_7;
1485 proto_tree_add_text(tree,
1486 tvb, curr_offset, 1,
1489 subtree = proto_item_add_subtree(item, ett_bc_oct_6a);
1491 oct = tvb_get_guint8(tvb, curr_offset);
1493 extended = (oct & 0x80) ? FALSE : TRUE;
1495 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1496 proto_tree_add_text(subtree,
1497 tvb, curr_offset, 1,
1498 "%s : Extension: %s",
1500 extended ? "extended" : "not extended");
1502 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1503 proto_tree_add_text(subtree,
1504 tvb, curr_offset, 1,
1505 "%s : Number of Stop Bits: %s",
1507 (oct & 0x40) ? "2" : "1");
1509 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
1510 proto_tree_add_text(subtree,
1511 tvb, curr_offset, 1,
1512 "%s : Negotiation: %s",
1514 (oct & 0x20) ? "Reserved" : "In-band negotiation not possible");
1516 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1517 proto_tree_add_text(subtree,
1518 tvb, curr_offset, 1,
1519 "%s : Number of data bits excluding parity bit if present: %s",
1521 (oct & 0x10) ? "8" : "7");
1525 case 0x01: str = "0.3 kbit/s Recommendation X.1 and V.110"; break;
1526 case 0x02: str = "1.2 kbit/s Recommendation X.1 and V.110"; break;
1527 case 0x03: str = "2.4 kbit/s Recommendation X.1 and V.110"; break;
1528 case 0x04: str = "4.8 kbit/s Recommendation X.1 and V.110"; break;
1529 case 0x05: str = "9.6 kbit/s Recommendation X.1 and V.110"; break;
1530 case 0x06: str = "12.0 kbit/s transparent (non compliance with X.1 and V.110)"; break;
1531 case 0x07: str = "Reserved: was allocated in earlier phases of the protocol"; break;
1537 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
1538 proto_tree_add_text(subtree,
1539 tvb, curr_offset, 1,
1540 "%s : User rate: %s",
1546 NO_MORE_DATA_CHECK(len);
1548 if (!extended) goto bc_octet_7;
1553 proto_tree_add_text(tree,
1554 tvb, curr_offset, 1,
1557 subtree = proto_item_add_subtree(item, ett_bc_oct_6b);
1559 oct = tvb_get_guint8(tvb, curr_offset);
1561 extended = (oct & 0x80) ? FALSE : TRUE;
1563 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1564 proto_tree_add_text(subtree,
1565 tvb, curr_offset, 1,
1566 "%s : Extension: %s",
1568 extended ? "extended" : "not extended");
1570 switch ((oct & 0x60) >> 5)
1572 case 0x02: str = "8 kbit/s"; break;
1573 case 0x03: str = "16 kbit/s"; break;
1579 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
1580 proto_tree_add_text(subtree,
1581 tvb, curr_offset, 1,
1582 "%s : V.110/X.30 rate adaptation Intermediate rate: %s",
1586 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1587 proto_tree_add_text(subtree,
1588 tvb, curr_offset, 1,
1589 "%s : Network independent clock (NIC) on transmission (Tx): %s to send data with network independent clock",
1591 (oct & 0x10) ? "requires" : "does not require");
1593 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1594 proto_tree_add_text(subtree,
1595 tvb, curr_offset, 1,
1596 "%s : Network independent clock (NIC) on reception (Rx): %s accept data with network independent clock",
1598 (oct & 0x08) ? "can" : "cannot");
1602 case 0x00: str = "Odd"; break;
1603 case 0x02: str = "Even"; break;
1604 case 0x03: str = "None"; break;
1605 case 0x04: str = "Forced to 0"; break;
1606 case 0x05: str = "Forced to 1"; break;
1612 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1613 proto_tree_add_text(subtree,
1614 tvb, curr_offset, 1,
1615 "%s : Parity information: %s",
1621 NO_MORE_DATA_CHECK(len);
1623 if (!extended) goto bc_octet_7;
1628 proto_tree_add_text(tree,
1629 tvb, curr_offset, 1,
1632 subtree = proto_item_add_subtree(item, ett_bc_oct_6c);
1634 oct = tvb_get_guint8(tvb, curr_offset);
1636 extended = (oct & 0x80) ? FALSE : TRUE;
1638 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1639 proto_tree_add_text(subtree,
1640 tvb, curr_offset, 1,
1641 "%s : Extension: %s",
1643 extended ? "extended" : "not extended");
1645 switch ((oct & 0x60) >> 5)
1647 case 0x01: str = "Non transparent (RLP)"; break;
1648 case 0x02: str = "Both, transparent preferred"; break;
1649 case 0x03: str = "Both, non transparent preferred"; break;
1651 str = "Transparent";
1655 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
1656 proto_tree_add_text(subtree,
1657 tvb, curr_offset, 1,
1658 "%s : Connection element: %s",
1664 case 0x00: str = "None"; break;
1665 case 0x01: str = "V.21"; break;
1666 case 0x02: str = "V.22"; break;
1667 case 0x03: str = "V.22 bis"; break;
1668 case 0x04: str = "Reserved: was allocated in earlier phases of the protocol"; break;
1669 case 0x05: str = "V.26 ter"; break;
1670 case 0x06: str = "V.32"; break;
1671 case 0x07: str = "Modem for undefined interface"; break;
1672 case 0x08: str = "Autobauding type 1"; break;
1678 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
1679 proto_tree_add_text(subtree,
1680 tvb, curr_offset, 1,
1681 "%s : Modem type: %s",
1687 NO_MORE_DATA_CHECK(len);
1689 if (!extended) goto bc_octet_7;
1694 proto_tree_add_text(tree,
1695 tvb, curr_offset, 1,
1698 subtree = proto_item_add_subtree(item, ett_bc_oct_6d);
1700 oct = tvb_get_guint8(tvb, curr_offset);
1702 extended = (oct & 0x80) ? FALSE : TRUE;
1704 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1705 proto_tree_add_text(subtree,
1706 tvb, curr_offset, 1,
1707 "%s : Extension: %s",
1709 extended ? "extended" : "not extended");
1711 switch ((oct & 0x60) >> 5)
1713 case 0x00: str = "No other modem type specified in this field"; break;
1714 case 0x02: str = "V.34"; break;
1720 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
1721 proto_tree_add_text(subtree,
1722 tvb, curr_offset, 1,
1723 "%s : Other modem type: %s",
1729 case 0x00: str = "Fixed network user rate not applicable/No meaning is associated with this value"; break;
1730 case 0x01: str = "9.6 kbit/s Recommendation X.1 and V.110"; break;
1731 case 0x02: str = "14.4 kbit/s Recommendation X.1 and V.110"; break;
1732 case 0x03: str = "19.2 kbit/s Recommendation X.1 and V.110"; break;
1733 case 0x04: str = "28.8 kbit/s Recommendation X.1 and V.110"; break;
1734 case 0x05: str = "38.4 kbit/s Recommendation X.1 and V.110"; break;
1735 case 0x06: str = "48.0 kbit/s Recommendation X.1 and V.110(synch)"; break;
1736 case 0x07: str = "56.0 kbit/s Recommendation X.1 and V.110(synch) /bit transparent"; break;
1737 case 0x08: str = "64.0 kbit/s bit transparent"; break;
1738 case 0x09: str = "33.6 kbit/s bit transparent"; break;
1739 case 0x0a: str = "32.0 kbit/s Recommendation I.460"; break;
1740 case 0x0b: str = "31.2 kbit/s Recommendation V.34"; break;
1746 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
1747 proto_tree_add_text(subtree,
1748 tvb, curr_offset, 1,
1749 "%s : Fixed network user rate: %s",
1755 NO_MORE_DATA_CHECK(len);
1757 if (!extended) goto bc_octet_7;
1762 proto_tree_add_text(tree,
1763 tvb, curr_offset, 1,
1766 subtree = proto_item_add_subtree(item, ett_bc_oct_6e);
1768 oct = tvb_get_guint8(tvb, curr_offset);
1770 extended = (oct & 0x80) ? FALSE : TRUE;
1772 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1773 proto_tree_add_text(subtree,
1774 tvb, curr_offset, 1,
1775 "%s : Extension: %s",
1777 extended ? "extended" : "not extended");
1779 if (is_uplink == IS_UPLINK_TRUE)
1781 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1782 proto_tree_add_text(subtree,
1783 tvb, curr_offset, 1,
1784 "%s : Acceptable channel codings: TCH/F14.4 %sacceptable",
1786 (oct & 0x40) ? "" : "not ");
1788 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
1789 proto_tree_add_text(subtree,
1790 tvb, curr_offset, 1,
1791 "%s : Acceptable channel codings: Spare",
1794 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1795 proto_tree_add_text(subtree,
1796 tvb, curr_offset, 1,
1797 "%s : Acceptable channel codings: TCH/F9.6 %sacceptable",
1799 (oct & 0x10) ? "" : "not ");
1801 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
1802 proto_tree_add_text(subtree,
1803 tvb, curr_offset, 1,
1804 "%s : Acceptable channel codings: TCH/F4.8 %sacceptable",
1806 (oct & 0x08) ? "" : "not ");
1808 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1809 proto_tree_add_text(subtree,
1810 tvb, curr_offset, 1,
1811 "%s : Maximum number of traffic channels: %u TCH",
1817 other_decode_bitfield_value(a_bigbuf, oct, 0x78, 8);
1818 proto_tree_add_text(subtree,
1819 tvb, curr_offset, 1,
1820 "%s : Acceptable channel codings: Spare",
1823 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
1824 proto_tree_add_text(subtree,
1825 tvb, curr_offset, 1,
1826 "%s : Maximum number of traffic channels: Spare",
1832 NO_MORE_DATA_CHECK(len);
1834 if (!extended) goto bc_octet_7;
1839 proto_tree_add_text(tree,
1840 tvb, curr_offset, 1,
1843 subtree = proto_item_add_subtree(item, ett_bc_oct_6f);
1845 oct = tvb_get_guint8(tvb, curr_offset);
1847 extended = (oct & 0x80) ? FALSE : TRUE;
1849 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1850 proto_tree_add_text(subtree,
1851 tvb, curr_offset, 1,
1852 "%s : Extension: %s",
1854 extended ? "extended" : "not extended");
1856 switch ((oct & 0x70) >> 4)
1858 case 0x00: str = "not allowed/required/applicable"; break;
1859 case 0x01: str = "up to 1 TCH/F allowed/may be requested"; break;
1860 case 0x02: str = "up to 2 TCH/F allowed/may be requested"; break;
1861 case 0x03: str = "up to 3 TCH/F allowed/may be requested"; break;
1862 case 0x04: str = "up to 4 TCH/F allowed/may be requested"; break;
1864 str = "up to 4 TCH/F may be requested";
1868 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
1869 proto_tree_add_text(subtree,
1870 tvb, curr_offset, 1,
1871 "%s : UIMI, User initiated modification indication: %s",
1875 if (is_uplink == IS_UPLINK_TRUE)
1879 case 0x00: str = "Air interface user rate not applicable/No meaning associated with this value"; break;
1880 case 0x01: str = "9.6 kbit/s"; break;
1881 case 0x02: str = "14.4 kbit/s"; break;
1882 case 0x03: str = "19.2 kbit/s"; break;
1883 case 0x05: str = "28.8 kbit/s"; break;
1884 case 0x06: str = "38.4 kbit/s"; break;
1885 case 0x07: str = "43.2 kbit/s"; break;
1886 case 0x08: str = "57.6 kbit/s"; break;
1887 case 0x09: str = "interpreted by the network as 38.4 kbit/s in this version of the protocol"; break;
1888 case 0x0a: str = "interpreted by the network as 38.4 kbit/s in this version of the protocol"; break;
1889 case 0x0b: str = "interpreted by the network as 38.4 kbit/s in this version of the protocol"; break;
1890 case 0x0c: str = "interpreted by the network as 38.4 kbit/s in this version of the protocol"; break;
1896 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
1897 proto_tree_add_text(subtree,
1898 tvb, curr_offset, 1,
1899 "%s : Wanted air interface user rate: %s",
1905 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
1906 proto_tree_add_text(subtree,
1907 tvb, curr_offset, 1,
1908 "%s : Wanted air interface user rate: Spare",
1914 NO_MORE_DATA_CHECK(len);
1916 if (!extended) goto bc_octet_7;
1921 proto_tree_add_text(tree,
1922 tvb, curr_offset, 1,
1925 subtree = proto_item_add_subtree(item, ett_bc_oct_6g);
1927 oct = tvb_get_guint8(tvb, curr_offset);
1929 extended = (oct & 0x80) ? FALSE : TRUE;
1931 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
1932 proto_tree_add_text(subtree,
1933 tvb, curr_offset, 1,
1934 "%s : Extension: %s",
1936 extended ? "extended" : "not extended");
1938 if (is_uplink == IS_UPLINK_TRUE)
1940 other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
1941 proto_tree_add_text(subtree,
1942 tvb, curr_offset, 1,
1943 "%s : Acceptable channel codings extended: TCH/F28.8 %sacceptable",
1945 (oct & 0x40) ? "" : "not ");
1947 other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
1948 proto_tree_add_text(subtree,
1949 tvb, curr_offset, 1,
1950 "%s : Acceptable channel codings extended: TCH/F32.0 %sacceptable",
1952 (oct & 0x20) ? "" : "not ");
1954 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1955 proto_tree_add_text(subtree,
1956 tvb, curr_offset, 1,
1957 "%s : Acceptable channel codings extended: TCH/F43.2 %sacceptable",
1959 (oct & 0x10) ? "" : "not ");
1961 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
1962 proto_tree_add_text(subtree,
1963 tvb, curr_offset, 1,
1964 "%s : Acceptable channel codings extended: TCH/F43.2 %sacceptable",
1966 (oct & 0x10) ? "" : "not ");
1968 switch ((oct & 0x0c) >> 2)
1970 case 0: str = "Channel coding symmetry preferred"; break;
1971 case 2: str = "Downlink biased channel coding asymmetry is preferred"; break;
1972 case 1: str = "Uplink biased channel coding asymmetry is preferred"; break;
1974 str = "Unused, treat as Channel coding symmetry preferred";
1978 other_decode_bitfield_value(a_bigbuf, oct, 0x0c, 8);
1979 proto_tree_add_text(subtree,
1980 tvb, curr_offset, 1,
1981 "%s : Channel Coding Asymmetry Indication: %s",
1987 other_decode_bitfield_value(a_bigbuf, oct, 0x7c, 8);
1988 proto_tree_add_text(subtree,
1989 tvb, curr_offset, 1,
1990 "%s : EDGE Channel Codings: Spare",
1994 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
1995 proto_tree_add_text(subtree,
1996 tvb, curr_offset, 1,
2002 NO_MORE_DATA_CHECK(len);
2008 proto_tree_add_text(tree,
2009 tvb, curr_offset, 1,
2012 subtree = proto_item_add_subtree(item, ett_bc_oct_7);
2013 extended = (oct & 0x80) ? FALSE : TRUE;
2014 oct = tvb_get_guint8(tvb, curr_offset);
2015 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2016 proto_tree_add_text(subtree,
2017 tvb, curr_offset, 1,
2018 "%s : Extension: %s",
2020 extended ? "extended" : "not extended");
2022 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
2023 proto_tree_add_text(subtree,
2024 tvb, curr_offset, 1,
2025 "%s : Layer 2 Identity: %s",
2027 ((oct & 0x60) == 0x40) ? "Octet identifier" : "Reserved");
2031 case 0x06: str = "Reserved: was allocated in earlier phases of the protocol"; break;
2032 case 0x08: str = "ISO 6429, codeset 0 (DC1/DC3)"; break;
2033 case 0x09: str = "Reserved: was allocated but never used in earlier phases of the protocol"; break;
2034 case 0x0a: str = "Videotex profile 1"; break;
2035 case 0x0c: str = "COPnoFlCt (Character oriented Protocol with no Flow Control mechanism)"; break;
2036 case 0x0d: str = "Reserved: was allocated in earlier phases of the protocol"; break;
2042 other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
2043 proto_tree_add_text(subtree,
2044 tvb, curr_offset, 1,
2045 "%s : User information layer 2 protocol: %s",
2051 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2053 return(curr_offset - offset);
2060 de_cc_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2063 guint32 curr_offset;
2065 curr_offset = offset;
2067 oct = tvb_get_guint8(tvb, curr_offset);
2069 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
2071 switch ((oct & 0xf0) >> 4)
2074 proto_tree_add_text(tree,
2075 tvb, curr_offset, 1,
2076 "%s : Maximum number of supported bearers: 1",
2081 proto_tree_add_text(tree,
2082 tvb, curr_offset, 1,
2083 "%s : Maximum number of supported bearers: %u",
2089 other_decode_bitfield_value(a_bigbuf, oct, 0x0c, 8);
2090 proto_tree_add_text(tree,
2091 tvb, curr_offset, 1,
2095 other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
2096 proto_tree_add_text(tree,
2097 tvb, curr_offset, 1,
2098 "%s : PCP: the mobile station %s the Prolonged Clearing Procedure",
2100 (oct & 0x02) ? "supports" : "does not support");
2102 other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
2103 proto_tree_add_text(tree,
2104 tvb, curr_offset, 1,
2108 "the mobile station supports DTMF as specified in subclause 5.5.7 of TS 24.008" :
2109 "reserved for earlier versions of the protocol");
2113 NO_MORE_DATA_CHECK(len);
2115 oct = tvb_get_guint8(tvb, curr_offset);
2117 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
2118 proto_tree_add_text(tree,
2119 tvb, curr_offset, 1,
2123 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2124 proto_tree_add_text(tree,
2125 tvb, curr_offset, 1,
2126 "%s : Maximum number of speech bearers: %u",
2132 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2134 return(curr_offset - offset);
2141 de_call_state(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2144 guint32 curr_offset;
2145 proto_tree *subtree;
2149 curr_offset = offset;
2151 oct = tvb_get_guint8(tvb, curr_offset);
2154 proto_tree_add_text(tree,
2155 tvb, curr_offset, 1,
2156 gsm_dtap_elem_strings[DE_CALL_STATE].strptr);
2158 subtree = proto_item_add_subtree(item, ett_gsm_dtap_elem[DE_CALL_STATE]);
2160 switch ((oct & 0xc0) >> 6)
2162 case 0: str = "Coding as specified in ITU-T Rec. Q.931"; break;
2163 case 1: str = "Reserved for other international standards"; break;
2164 case 2: str = "National standard"; break;
2166 str = "Standard defined for the GSM PLMNS";
2170 other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
2171 proto_tree_add_text(subtree,
2172 tvb, curr_offset, 1,
2173 "%s : Coding standard: %s",
2179 case 0x00: str = "UO - null NO - null"; break;
2180 case 0x02: str = "U0.1- MM connection pending N0.1- MM connection pending"; break;
2181 case 0x22: str = "U0.2- CC prompt present N0.2- CC connection pending"; break;
2182 case 0x23: str = "U0.3- Wait for network information N0.3- Network answer pending"; break;
2183 case 0x24: str = "U0.4- CC-Establishment present N0.4- CC-Establishment present"; break;
2184 case 0x25: str = "U0.5- CC-Establishment confirmed N0.5- CC-Establishment confirmed"; break;
2185 case 0x26: str = "U0.6- Recall present N0.6- Recall present"; break;
2186 case 0x01: str = "U1 - call initiated N1 - call initiated"; break;
2187 case 0x03: str = "U3 - mobile originating call proceeding N3 - mobile originating call proceeding"; break;
2188 case 0x04: str = "U4 - call delivered N4 - call delivered"; break;
2189 case 0x06: str = "U6 - call present N6 - call present"; break;
2190 case 0x07: str = "U7 - call received N7 - call received"; break;
2191 case 0x08: str = "U8 - connect request N8 - connect request"; break;
2192 case 0x09: str = "U9 - mobile terminating call confirmed N9 - mobile terminating call confirmed"; break;
2193 case 0x0a: str = "U10- active N10- active"; break;
2194 case 0x0b: str = "U11- disconnect request"; break;
2195 case 0x0c: str = "U12- disconnect indication N12-disconnect indication"; break;
2196 case 0x13: str = "U19- release request N19- release request"; break;
2197 case 0x1a: str = "U26- mobile originating modify N26- mobile originating modify"; break;
2198 case 0x1b: str = "U27- mobile terminating modify N27- mobile terminating modify"; break;
2199 case 0x1c: str = " N28- connect indication"; break;
2205 other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
2206 proto_tree_add_text(subtree,
2207 tvb, curr_offset, 1,
2208 "%s : Call state value: %s",
2214 /* no length check possible */
2216 return(curr_offset - offset);
2219 static const true_false_string gsm_a_extension_value = {
2224 const value_string gsm_a_type_of_number_values[] = {
2225 { 0x00, "unknown" },
2226 { 0x01, "International Number" },
2227 { 0x02, "National number" },
2228 { 0x03, "Network Specific Number" },
2229 { 0x04, "Dedicated access, short code" },
2230 { 0x05, "Reserved" },
2231 { 0x06, "Reserved" },
2232 { 0x07, "Reserved for extension" },
2236 const value_string gsm_a_numbering_plan_id_values[] = {
2237 { 0x00, "unknown" },
2238 { 0x01, "ISDN/Telephony Numbering (Rec ITU-T E.164)" },
2240 { 0x03, "Data Numbering (ITU-T Rec. X.121)" },
2241 { 0x04, "Telex Numbering (ITU-T Rec. F.69)" },
2242 { 0x08, "National Numbering" },
2243 { 0x09, "Private Numbering" },
2244 { 0x0d, "reserved for CTS (see 3GPP TS 44.056 [91])" },
2245 { 0x0f, "Reserved for extension" },
2253 de_cld_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2256 guint32 curr_offset;
2258 curr_offset = offset;
2260 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
2261 proto_tree_add_item(tree, hf_gsm_a_type_of_number , tvb, curr_offset, 1, FALSE);
2262 proto_tree_add_item(tree, hf_gsm_a_numbering_plan_id , tvb, curr_offset, 1, FALSE);
2266 NO_MORE_DATA_CHECK(len);
2268 poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
2270 my_dgt_tbcd_unpack(a_bigbuf, poctets, len - (curr_offset - offset),
2273 proto_tree_add_string_format(tree, hf_gsm_a_cld_party_bcd_num,
2274 tvb, curr_offset, len - (curr_offset - offset),
2279 if (sccp_assoc && ! sccp_assoc->called_party) {
2280 sccp_assoc->called_party = se_strdup(a_bigbuf);
2283 curr_offset += len - (curr_offset - offset);
2286 g_snprintf(add_string, string_len, " - (%s)", a_bigbuf);
2288 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2290 return(curr_offset - offset);
2297 de_cld_party_sub_addr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2300 guint32 curr_offset;
2303 curr_offset = offset;
2305 oct = tvb_get_guint8(tvb, curr_offset);
2307 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
2309 switch ((oct & 0x70) >> 4)
2311 case 0: str = "NSAP (X.213/ISO 8348 AD2)"; break;
2312 case 2: str = "User specified"; break;
2318 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
2319 proto_tree_add_text(tree,
2320 tvb, curr_offset, 1,
2321 "%s : Type of subaddress: %s",
2325 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
2326 proto_tree_add_text(tree,
2327 tvb, curr_offset, 1,
2328 "%s : Odd/Even indicator: %s",
2331 "odd number of address signals" : "even number of address signals");
2333 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2334 proto_tree_add_text(tree,
2335 tvb, curr_offset, 1,
2341 NO_MORE_DATA_CHECK(len);
2343 proto_tree_add_text(tree,
2344 tvb, curr_offset, len - (curr_offset - offset),
2345 "Subaddress information");
2347 curr_offset += len - (curr_offset - offset);
2349 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2351 return(curr_offset - offset);
2358 de_clg_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2362 guint32 curr_offset;
2365 curr_offset = offset;
2367 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
2368 proto_tree_add_item(tree, hf_gsm_a_type_of_number , tvb, curr_offset, 1, FALSE);
2369 proto_tree_add_item(tree, hf_gsm_a_numbering_plan_id , tvb, curr_offset, 1, FALSE);
2373 oct = tvb_get_guint8(tvb, curr_offset);
2375 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
2377 switch ((oct & 0x60) >> 5)
2379 case 0: str = "Presentation allowed"; break;
2380 case 1: str = "Presentation restricted"; break;
2381 case 2: str = "Number not available due to interworking"; break;
2387 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
2388 proto_tree_add_text(tree,
2389 tvb, curr_offset, 1,
2390 "%s : Presentation indicator: %s",
2394 other_decode_bitfield_value(a_bigbuf, oct, 0x1c, 8);
2395 proto_tree_add_text(tree,
2396 tvb, curr_offset, 1,
2402 case 0: str = "User-provided, not screened"; break;
2403 case 1: str = "User-provided, verified and passed"; break;
2404 case 2: str = "User-provided, verified and failed"; break;
2406 str = "Network provided";
2410 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
2411 proto_tree_add_text(tree,
2412 tvb, curr_offset, 1,
2413 "%s : Screening indicator: %s",
2419 NO_MORE_DATA_CHECK(len);
2421 poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
2423 my_dgt_tbcd_unpack(a_bigbuf, poctets, len - (curr_offset - offset),
2426 proto_tree_add_string_format(tree, hf_gsm_a_clg_party_bcd_num,
2427 tvb, curr_offset, len - (curr_offset - offset),
2432 curr_offset += len - (curr_offset - offset);
2435 g_snprintf(add_string, string_len, " - (%s)", a_bigbuf);
2437 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2439 return(curr_offset - offset);
2446 de_clg_party_sub_addr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2449 guint32 curr_offset;
2452 curr_offset = offset;
2454 oct = tvb_get_guint8(tvb, curr_offset);
2456 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
2458 switch ((oct & 0x70) >> 4)
2460 case 0: str = "NSAP (X.213/ISO 8348 AD2)"; break;
2461 case 2: str = "User specified"; break;
2467 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
2468 proto_tree_add_text(tree,
2469 tvb, curr_offset, 1,
2470 "%s : Type of subaddress: %s",
2474 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
2475 proto_tree_add_text(tree,
2476 tvb, curr_offset, 1,
2477 "%s : Odd/Even indicator: %s",
2480 "odd number of address signals" : "even number of address signals");
2482 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
2483 proto_tree_add_text(tree,
2484 tvb, curr_offset, 1,
2490 NO_MORE_DATA_CHECK(len);
2492 proto_tree_add_text(tree,
2493 tvb, curr_offset, len - (curr_offset - offset),
2494 "Subaddress information");
2496 curr_offset += len - (curr_offset - offset);
2498 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2500 return(curr_offset - offset);
2507 de_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
2511 guint32 curr_offset;
2514 curr_offset = offset;
2516 oct = tvb_get_guint8(tvb, curr_offset);
2518 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2519 proto_tree_add_text(tree,
2520 tvb, curr_offset, 1,
2521 "%s : Extension: %s",
2523 (oct & 0x80) ? "not extended" : "extended");
2525 switch ((oct & 0x60) >> 5)
2527 case 0: str = "Coding as specified in ITU-T Rec. Q.931"; break;
2528 case 1: str = "Reserved for other international standards"; break;
2529 case 2: str = "National standard"; break;
2531 str = "Standard defined for the GSM PLMNS";
2535 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
2536 proto_tree_add_text(tree,
2537 tvb, curr_offset, 1,
2538 "%s : Coding standard: %s",
2542 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
2543 proto_tree_add_text(tree,
2544 tvb, curr_offset, 1,
2550 case 0: str = "User"; break;
2551 case 1: str = "Private network serving the local user"; break;
2552 case 2: str = "Public network serving the local user"; break;
2553 case 3: str = "Transit network"; break;
2554 case 4: str = "Public network serving the remote user"; break;
2555 case 5: str = "Private network serving the remote user"; break;
2556 case 7: str = "International network"; break;
2557 case 10: str = "Network beyond interworking point"; break;
2563 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2564 proto_tree_add_text(tree,
2565 tvb, curr_offset, 1,
2566 "%s : Location: %s",
2572 oct = tvb_get_guint8(tvb, curr_offset);
2576 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
2578 other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
2579 proto_tree_add_text(tree,
2580 tvb, curr_offset, 1,
2581 "%s : Recommendation",
2586 oct = tvb_get_guint8(tvb, curr_offset);
2589 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, FALSE);
2594 case 1: str = "Unassigned (unallocated) number"; break;
2595 case 3: str = "No route to destination"; break;
2596 case 6: str = "Channel unacceptable"; break;
2597 case 8: str = "Operator determined barring"; break;
2598 case 16: str = "Normal call clearing"; break;
2599 case 17: str = "User busy"; break;
2600 case 18: str = "No user responding"; break;
2601 case 19: str = "User alerting, no answer"; break;
2602 case 21: str = "Call rejected"; break;
2603 case 22: str = "Number changed"; break;
2604 case 25: str = "Pre-emption"; break;
2605 case 26: str = "Non selected user clearing"; break;
2606 case 27: str = "Destination out of order"; break;
2607 case 28: str = "Invalid number format (incomplete number)"; break;
2608 case 29: str = "Facility rejected"; break;
2609 case 30: str = "Response to STATUS ENQUIRY"; break;
2610 case 31: str = "Normal, unspecified"; break;
2611 case 34: str = "No circuit/channel available"; break;
2612 case 38: str = "Network out of order"; break;
2613 case 41: str = "Temporary failure"; break;
2614 case 42: str = "Switching equipment congestion"; break;
2615 case 43: str = "Access information discarded"; break;
2616 case 44: str = "requested circuit/channel not available"; break;
2617 case 47: str = "Resources unavailable, unspecified"; break;
2618 case 49: str = "Quality of service unavailable"; break;
2619 case 50: str = "Requested facility not subscribed"; break;
2620 case 55: str = "Incoming calls barred within the CUG"; break;
2621 case 57: str = "Bearer capability not authorized"; break;
2622 case 58: str = "Bearer capability not presently available"; break;
2623 case 63: str = "Service or option not available, unspecified"; break;
2624 case 65: str = "Bearer service not implemented"; break;
2625 case 68: str = "ACM equal to or greater than ACMmax"; break;
2626 case 69: str = "Requested facility not implemented"; break;
2627 case 70: str = "Only restricted digital information bearer capability is available"; break;
2628 case 79: str = "Service or option not implemented, unspecified"; break;
2629 case 81: str = "Invalid transaction identifier value"; break;
2630 case 87: str = "User not member of CUG"; break;
2631 case 88: str = "Incompatible destination"; break;
2632 case 91: str = "Invalid transit network selection"; break;
2633 case 95: str = "Semantically incorrect message"; break;
2634 case 96: str = "Invalid mandatory information"; break;
2635 case 97: str = "Message type non-existent or not implemented"; break;
2636 case 98: str = "Message type not compatible with protocol state"; break;
2637 case 99: str = "Information element non-existent or not implemented"; break;
2638 case 100: str = "Conditional IE error"; break;
2639 case 101: str = "Message not compatible with protocol state"; break;
2640 case 102: str = "Recovery on timer expiry"; break;
2641 case 111: str = "Protocol error, unspecified"; break;
2642 case 127: str = "Interworking, unspecified"; break;
2644 if (cause <= 31) { str = "Treat as Normal, unspecified"; }
2645 else if ((cause >= 32) && (cause <= 47)) { str = "Treat as Resources unavailable, unspecified"; }
2646 else if ((cause >= 48) && (cause <= 63)) { str = "Treat as Service or option not available, unspecified"; }
2647 else if ((cause >= 64) && (cause <= 79)) { str = "Treat as Service or option not implemented, unspecified"; }
2648 else if ((cause >= 80) && (cause <= 95)) { str = "Treat as Semantically incorrect message"; }
2649 else if ((cause >= 96) && (cause <= 111)) { str = "Treat as Protocol error, unspecified"; }
2650 else if ((cause >= 112) && (cause <= 127)) { str = "Treat as Interworking, unspecified"; }
2654 other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
2655 proto_tree_add_uint_format(tree, hf_gsm_a_dtap_cause,
2656 tvb, curr_offset, 1, cause,
2657 "%s : Cause: (%u) %s",
2665 g_snprintf(add_string, string_len, " - (%u) %s", cause, str);
2667 NO_MORE_DATA_CHECK(len);
2669 proto_tree_add_text(tree,
2670 tvb, curr_offset, len - (curr_offset - offset),
2673 curr_offset += len - (curr_offset - offset);
2675 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2677 return(curr_offset - offset);
2681 * 10.5.4.18 Low layer compatibility
2684 de_llc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2686 guint32 curr_offset;
2688 curr_offset = offset;
2690 dissect_q931_bearer_capability_ie(tvb, offset, len, tree);
2692 curr_offset = curr_offset + len;
2693 return(curr_offset - offset);
2702 de_facility(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint fac_len, gchar *add_string _U_, int string_len _U_)
2707 gboolean ind = FALSE;
2708 guint32 component_len = 0;
2709 guint32 header_end_offset;
2711 asn1_ctx_t asn1_ctx;
2712 tvbuff_t *SS_tvb = NULL;
2713 void *save_private_data;
2714 static gint comp_type_tag;
2716 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, gsm_a_dtap_pinfo);
2718 save_private_data= gsm_a_dtap_pinfo->private_data;
2719 saved_offset = offset;
2720 gsm_a_dtap_pinfo->private_data = NULL;
2721 while ( fac_len > (offset - saved_offset)){
2723 /* Get the length of the component there can be more than one component in a facility message */
2725 header_end_offset = get_ber_identifier(tvb, offset, &class, &pc, &comp_type_tag);
2726 header_end_offset = get_ber_length(tvb, header_end_offset, &component_len, &ind);
2728 proto_tree_add_text(tree, tvb, offset+1, 1,
2729 "Indefinte length, ignoring component");
2732 header_len = header_end_offset - offset;
2733 component_len = header_len + component_len;
2735 dissect_ROS_Component(FALSE, tvb, offset, &asn1_ctx, tree, hf_ROS_component);
2736 TODO Call gsm map here
2738 SS_tvb = tvb_new_subset(tvb, offset, component_len, component_len);
2739 call_dissector(gsm_map_handle, SS_tvb, gsm_a_dtap_pinfo, tree);
2740 offset = offset + component_len;
2742 gsm_a_dtap_pinfo->private_data = save_private_data;
2750 de_keypad_facility(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
2753 guint32 curr_offset;
2755 curr_offset = offset;
2757 oct = tvb_get_guint8(tvb, curr_offset);
2759 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2760 proto_tree_add_text(tree,
2761 tvb, curr_offset, 1,
2765 other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
2766 proto_tree_add_text(tree,
2767 tvb, curr_offset, 1,
2768 "%s : Keypad information: %c",
2775 g_snprintf(add_string, string_len, " - %c", oct & 0x7f);
2777 /* no length check possible */
2779 return(curr_offset - offset);
2786 de_prog_ind(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
2789 guint32 curr_offset;
2792 curr_offset = offset;
2794 oct = tvb_get_guint8(tvb, curr_offset);
2796 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2797 proto_tree_add_text(tree,
2798 tvb, curr_offset, 1,
2799 "%s : Extension: %s",
2801 (oct & 0x80) ? "extended" : "not extended");
2803 switch ((oct & 0x60) >> 5)
2805 case 0: str = "Coding as specified in ITU-T Rec. Q.931"; break;
2806 case 1: str = "Reserved for other international standards"; break;
2807 case 2: str = "National standard"; break;
2809 str = "Standard defined for the GSM PLMNS";
2813 other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
2814 proto_tree_add_text(tree,
2815 tvb, curr_offset, 1,
2816 "%s : Coding standard: %s",
2820 other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
2821 proto_tree_add_text(tree,
2822 tvb, curr_offset, 1,
2828 case 0: str = "User"; break;
2829 case 1: str = "Private network serving the local user"; break;
2830 case 2: str = "Public network serving the local user"; break;
2831 case 4: str = "Public network serving the remote user"; break;
2832 case 5: str = "Private network serving the remote user"; break;
2833 case 10: str = "Network beyond interworking point"; break;
2839 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2840 proto_tree_add_text(tree,
2841 tvb, curr_offset, 1,
2842 "%s : Location: %s",
2848 oct = tvb_get_guint8(tvb, curr_offset);
2850 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
2851 proto_tree_add_text(tree,
2852 tvb, curr_offset, 1,
2853 "%s : Extension: %s",
2855 (oct & 0x80) ? "extended" : "not extended");
2859 case 1: str = "Call is not end-to-end PLMN/ISDN, further call progress information may be available in-band"; break;
2860 case 2: str = "Destination address in non-PLMN/ISDN"; break;
2861 case 3: str = "Origination address in non-PLMN/ISDN"; break;
2862 case 4: str = "Call has returned to the PLMN/ISDN"; break;
2863 case 8: str = "In-band information or appropriate pattern now available"; break;
2864 case 32: str = "Call is end-to-end PLMN/ISDN"; break;
2865 case 64: str = "Queueing"; break;
2871 other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
2872 proto_tree_add_text(tree,
2873 tvb, curr_offset, 1,
2874 "%s : Progress Description: %s (%d)",
2880 g_snprintf(add_string, string_len, " - %d", oct & 0x7f);
2884 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2886 return(curr_offset - offset);
2893 de_repeat_ind(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2896 guint32 curr_offset;
2899 curr_offset = offset;
2901 oct = tvb_get_guint8(tvb, curr_offset);
2905 case 1: str = "Circular for successive selection 'mode 1 alternate mode 2'"; break;
2906 case 2: str = "Support of fallback mode 1 preferred, mode 2 selected if setup of mode 1 fails"; break;
2907 case 3: str = "Reserved: was allocated in earlier phases of the protocol"; break;
2913 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
2914 proto_tree_add_text(tree,
2915 tvb, curr_offset, 1,
2922 /* no length check possible */
2924 return(curr_offset - offset);
2931 de_ss_ver_ind(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2934 guint32 curr_offset;
2937 curr_offset = offset;
2939 oct = tvb_get_guint8(tvb, curr_offset);
2943 case 0: str = "Phase 2 service, ellipsis notation, and phase 2 error handling is supported"; break;
2944 case 1: str = "SS-Protocol version 3 is supported, and phase 2 error handling is supported"; break;
2950 proto_tree_add_text(tree,
2951 tvb, curr_offset, 1,
2957 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2959 return(curr_offset - offset);
2963 * [5] 8.1.4.1 3GPP TS 24.011 version 6.1.0 Release 6
2966 de_cp_user_data(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2968 guint32 curr_offset;
2971 curr_offset = offset;
2973 proto_tree_add_text(tree, tvb, curr_offset, len,
2974 "RPDU (not displayed)");
2977 * dissect the embedded RP message
2979 rp_tvb = tvb_new_subset(tvb, curr_offset, len, len);
2981 call_dissector(rp_handle, rp_tvb, gsm_a_dtap_pinfo, g_tree);
2985 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2987 return(curr_offset - offset);
2994 de_cp_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
2997 guint32 curr_offset;
3000 curr_offset = offset;
3002 oct = tvb_get_guint8(tvb, curr_offset);
3006 case 17: str = "Network failure"; break;
3007 case 22: str = "Congestion"; break;
3008 case 81: str = "Invalid Transaction Identifier value"; break;
3009 case 95: str = "Semantically incorrect message"; break;
3010 case 96: str = "Invalid mandatory information"; break;
3011 case 97: str = "Message type non-existent or not implemented"; break;
3012 case 98: str = "Message not compatible with the short message protocol state"; break;
3013 case 99: str = "Information element non-existent or not implemented"; break;
3014 case 111: str = "Protocol error, unspecified"; break;
3016 str = "Reserved, treat as Protocol error, unspecified";
3020 proto_tree_add_text(tree,
3021 tvb, curr_offset, 1,
3029 g_snprintf(add_string, string_len, " - (%u) %s", oct, str);
3031 /* no length check possible */
3033 return(curr_offset - offset);
3037 de_tp_sub_channel(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3039 guint32 curr_offset;
3043 curr_offset = offset;
3045 oct = tvb_get_guint8(tvb, curr_offset) & 0x3f;
3046 if ((oct & 0x38) == 0x38)
3048 else if ((oct & 0x38) == 0x18)
3050 else if ((oct & 0x38) == 0x10)
3052 else if ((oct & 0x38) == 0x08)
3054 else if ((oct & 0x3c) == 0x04)
3056 else if ((oct & 0x3e) == 0x02)
3058 else if ((oct & 0x3e) == 0x00)
3063 proto_tree_add_text(tree,
3064 tvb, curr_offset, 1,
3065 "Test Loop %s",str);
3068 proto_tree_add_text(tree,
3069 tvb, curr_offset, 1,
3070 "Only one TCH active or sub-channel 0 of two half rate channels is to be looped");
3072 proto_tree_add_text(tree,
3073 tvb, curr_offset, 1,
3074 "Sub-channel 1 of two half rate channels is to be looped");
3078 return(curr_offset - offset);
3082 de_tp_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3084 guint32 curr_offset;
3087 curr_offset = offset;
3089 oct = tvb_get_guint8(tvb, curr_offset);
3091 if ((oct & 0xF0) == 0x80)
3092 proto_tree_add_text(tree,tvb, curr_offset, 1, "Acknowledgment element: %d",oct&0x01);
3094 proto_tree_add_text(tree,tvb, curr_offset, 1, "No acknowledgment element present");
3098 return(curr_offset - offset);
3102 de_tp_loop_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3104 guint32 curr_offset;
3107 curr_offset = offset;
3109 oct = tvb_get_guint8(tvb, curr_offset);
3114 proto_tree_add_text(tree, tvb, curr_offset, 1, "Channel coding not needed. The Burst-by-Burst loop is activated, type G");
3117 proto_tree_add_text(tree, tvb, curr_offset, 1, "Channel coding needed. Frame erasure is to be signalled, type H");
3120 proto_tree_add_text(tree, tvb, curr_offset, 1, "Channel coding reserved (%d)",oct & 0x03);
3127 proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot mechanism 1");
3128 proto_tree_add_text(tree, tvb, curr_offset, 1, "Timeslot number %d",(oct & 0xe0)>>5);
3131 proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot mechanism 2");
3134 proto_tree_add_text(tree, tvb, curr_offset, 1, "Loop mechanism reserved (%d)",(oct & 0x1c)>>2);
3140 return(curr_offset - offset);
3144 de_tp_loop_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3146 guint32 curr_offset;
3149 curr_offset = offset;
3151 oct = tvb_get_guint8(tvb, curr_offset);
3156 proto_tree_add_text(tree, tvb, curr_offset, 1, "Channel coding not needed. The Burst-by-Burst loop is activated, type G");
3159 proto_tree_add_text(tree, tvb, curr_offset, 1, "Channel coding needed. Frame erasure is to be signalled, type H");
3162 proto_tree_add_text(tree, tvb, curr_offset, 1, "Channel coding reserved (%d)",(oct & 0x30)>>4);
3169 proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot mechanism 1");
3172 proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot mechanism 2");
3175 proto_tree_add_text(tree, tvb, curr_offset, 1, "Loop mechanism reserved (%d)",(oct & 0x0e)>>1);
3180 proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot TCH loop was not closed due to error");
3182 proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot TCH loop was closed successfully");
3186 return(curr_offset - offset);
3190 de_tp_tested_device(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3192 guint32 curr_offset;
3195 curr_offset = offset;
3197 oct = tvb_get_guint8(tvb, curr_offset);
3202 proto_tree_add_text(tree, tvb, curr_offset, 1, "Normal operation (no tested device via DAI)");
3205 proto_tree_add_text(tree, tvb, curr_offset, 1, "Test of speech decoder / DTX functions (downlink)");
3208 proto_tree_add_text(tree, tvb, curr_offset, 1, "Test of speech encoder / DTX functions (uplink)");
3211 proto_tree_add_text(tree, tvb, curr_offset, 1, "Test of acoustic devices and A/D & D/A");
3214 proto_tree_add_text(tree, tvb, curr_offset, 1, "Tested device reserved (%d)",oct);
3220 return(curr_offset - offset);
3224 de_tp_pdu_description(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3226 guint32 curr_offset;
3229 curr_offset = offset;
3231 value = tvb_get_ntohs(tvb, curr_offset);
3236 if ((value & 0xfff) == 0)
3237 proto_tree_add_text(tree, tvb, curr_offset, 1, "Infinite number of PDUs to be transmitted in the TBF");
3239 proto_tree_add_text(tree, tvb, curr_offset, 1, "%d PDUs to be transmitted in the TBF",value & 0xfff);
3242 proto_tree_add_text(tree, tvb, curr_offset, 1, "PDU description reserved");
3244 return(curr_offset - offset);
3248 de_tp_mode_flag(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3250 guint32 curr_offset;
3253 curr_offset = offset;
3255 oct = tvb_get_guint8(tvb, curr_offset);
3258 proto_tree_add_text(tree, tvb, curr_offset, 1, "MS shall select the loop back option");
3260 proto_tree_add_text(tree, tvb, curr_offset, 1, "MS shall itself generate the pseudorandom data");
3262 proto_tree_add_text(tree, tvb, curr_offset, 1, "Downlink Timeslot Offset: timeslot number %d",(oct & 0x0e)>>1);
3266 return(curr_offset - offset);
3270 de_tp_egprs_mode_flag(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3272 guint32 curr_offset;
3275 curr_offset = offset;
3277 oct = tvb_get_guint8(tvb, curr_offset);
3280 proto_tree_add_text(tree, tvb, curr_offset, 1, "MS loops back blocks on the uplink using GMSK modulation only");
3282 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");
3284 proto_tree_add_text(tree, tvb, curr_offset, 1, "Downlink Timeslot Offset: timeslot number %d",(oct & 0x0e)>>1);
3288 return(curr_offset - offset);
3292 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_)
3294 guint32 curr_offset;
3296 guint8 lb_setup_length,i,j;
3299 curr_offset = offset;
3301 oct = tvb_get_guint8(tvb, curr_offset);
3308 proto_tree_add_text(tree, tvb, curr_offset, 1, "UE test loop mode 1 loop back (loopback of RLC SDUs or PDCP SDUs)");
3309 lb_setup_length = tvb_get_guint8(tvb, curr_offset);
3311 for (i=0,j=0; (i<lb_setup_length) && (j<4); i+=3,j++)
3313 proto_tree_add_text(tree, tvb, curr_offset, 1, "LB setup RB IE %d",j+1);
3314 value = tvb_get_ntohs(tvb, curr_offset);
3316 proto_tree_add_text(tree, tvb, curr_offset, 1, "Uplink RLC SDU size is %d bits",value);
3317 oct = tvb_get_guint8(tvb, curr_offset);
3319 proto_tree_add_text(tree, tvb, curr_offset, 1, "Radio Bearer %d",oct & 0x1f);
3324 proto_tree_add_text(tree, tvb, curr_offset, 1, "UE test loop mode 2 loop back (loopback of transport block data and CRC bits)");
3327 proto_tree_add_text(tree, tvb, curr_offset, 1, "UE test loop mode 3 RLC SDU counting (counting of received RLC SDUs)");
3328 oct = tvb_get_guint8(tvb, curr_offset);
3330 proto_tree_add_text(tree, tvb, curr_offset, 1, "MBMS short transmission identity %d",(oct & 0x1f)+1);
3333 proto_tree_add_text(tree, tvb, curr_offset, 1, "UE test loop mode reserved (%d)",oct & 0x03);
3337 return(curr_offset - offset);
3341 de_tp_ue_positioning_technology(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3343 guint32 curr_offset;
3346 curr_offset = offset;
3348 oct = tvb_get_guint8(tvb, curr_offset);
3353 proto_tree_add_text(tree, tvb, curr_offset, 1, "AGPS");
3356 proto_tree_add_text(tree, tvb, curr_offset, 1, "UE positioning technology reserved (%d)",oct);
3362 return(curr_offset - offset);
3366 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_)
3368 guint32 curr_offset;
3371 curr_offset = offset;
3373 value = tvb_get_ntohl(tvb, curr_offset);
3376 proto_tree_add_text(tree, tvb, curr_offset, 1, "UE received RLC SDU counter value %d",value);
3378 return(curr_offset - offset);
3381 guint8 (*dtap_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
3382 /* Mobility Management Information Elements 10.5.3 */
3383 de_auth_param_rand, /* Authentication Parameter RAND */
3384 de_auth_param_autn, /* Authentication Parameter AUTN (UMTS authentication challenge only) */
3385 de_auth_resp_param, /* Authentication Response Parameter */
3386 de_auth_resp_param_ext, /* Authentication Response Parameter (extension) (UMTS authentication challenge only) */
3387 de_auth_fail_param, /* Authentication Failure Parameter (UMTS authentication challenge only) */
3388 NULL /* handled inline */, /* CM Service Type */
3389 NULL /* handled inline */, /* Identity Type */
3390 NULL /* handled inline */, /* Location Updating Type */
3391 de_network_name, /* Network Name */
3392 de_rej_cause, /* Reject Cause */
3393 NULL /* no associated data */, /* Follow-on Proceed */
3394 de_time_zone, /* Time Zone */
3395 de_time_zone_time, /* Time Zone and Time */
3396 NULL /* no associated data */, /* CTS Permission */
3397 de_lsa_id, /* LSA Identifier */
3398 de_day_saving_time, /* Daylight Saving Time */
3399 NULL, /* Emergency Number List */
3400 /* Call Control Information Elements 10.5.4 */
3401 de_aux_states, /* Auxiliary States */
3402 de_bearer_cap, /* Bearer Capability */
3403 de_cc_cap, /* Call Control Capabilities */
3404 de_call_state, /* Call State */
3405 de_cld_party_bcd_num, /* Called Party BCD Number */
3406 de_cld_party_sub_addr, /* Called Party Subaddress */
3407 de_clg_party_bcd_num, /* Calling Party BCD Number */
3408 de_clg_party_sub_addr, /* Calling Party Subaddress */
3409 de_cause, /* Cause */
3410 NULL /* no associated data */, /* CLIR Suppression */
3411 NULL /* no associated data */, /* CLIR Invocation */
3412 NULL /* handled inline */, /* Congestion Level */
3413 NULL, /* Connected Number */
3414 NULL, /* Connected Subaddress */
3415 de_facility, /* Facility */
3416 NULL, /* High Layer Compatibility */
3417 de_keypad_facility, /* Keypad Facility */
3418 de_llc, /* 10.5.4.18 Low layer compatibility */
3419 NULL, /* More Data */
3420 NULL, /* Notification Indicator */
3421 de_prog_ind, /* Progress Indicator */
3422 NULL, /* Recall type $(CCBS)$ */
3423 NULL, /* Redirecting Party BCD Number */
3424 NULL, /* Redirecting Party Subaddress */
3425 de_repeat_ind, /* Repeat Indicator */
3426 NULL /* no associated data */, /* Reverse Call Setup Direction */
3427 NULL, /* SETUP Container $(CCBS)$ */
3429 de_ss_ver_ind, /* SS Version Indicator */
3430 NULL, /* User-user */
3431 NULL, /* Alerting Pattern $(NIA)$ */
3432 NULL, /* Allowed Actions $(CCBS)$ */
3433 NULL, /* Stream Identifier */
3434 NULL, /* Network Call Control Capabilities */
3435 NULL, /* Cause of No CLI */
3436 NULL, /* Immediate Modification Indicator */
3437 NULL, /* Supported Codec List */
3438 NULL, /* Service Category */
3439 /* Short Message Service Information Elements [5] 8.1.4 */
3440 de_cp_user_data, /* CP-User Data */
3441 de_cp_cause, /* CP-Cause */
3442 /* Tests procedures information elements 3GPP TS 44.014 6.4.0 and 3GPP TS 34.109 6.4.0 */
3443 de_tp_sub_channel, /* Close TCH Loop Cmd Sub-channel */
3444 de_tp_ack, /* Open Loop Cmd Ack */
3445 de_tp_loop_type, /* Close Multi-slot Loop Cmd Loop type */
3446 de_tp_loop_ack, /* Close Multi-slot Loop Ack Result */
3447 de_tp_tested_device, /* Test Interface Tested device */
3448 de_tp_pdu_description, /* GPRS Test Mode Cmd PDU description */
3449 de_tp_mode_flag, /* GPRS Test Mode Cmd Mode flag */
3450 de_tp_egprs_mode_flag, /* EGPRS Start Radio Block Loopback Cmd Mode flag */
3451 de_tp_ue_test_loop_mode, /* Close UE Test Loop Mode */
3452 de_tp_ue_positioning_technology, /* UE Positioning Technology */
3453 de_tp_rlc_sdu_counter_value, /* RLC SDU Counter Value */
3457 /* MESSAGE FUNCTIONS */
3463 dtap_mm_auth_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3465 guint32 curr_offset;
3469 proto_tree *subtree;
3472 curr_offset = offset;
3475 is_uplink = IS_UPLINK_FALSE;
3478 * special dissection for Cipher Key Sequence Number
3480 oct = tvb_get_guint8(tvb, curr_offset);
3482 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
3483 proto_tree_add_text(tree,
3484 tvb, curr_offset, 1,
3489 proto_tree_add_text(tree,
3490 tvb, curr_offset, 1,
3491 gsm_common_elem_strings[DE_CIPH_KEY_SEQ_NUM].strptr);
3493 subtree = proto_item_add_subtree(item, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM]);
3495 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
3496 proto_tree_add_text(subtree,
3497 tvb, curr_offset, 1,
3501 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
3506 proto_tree_add_text(subtree,
3507 tvb, curr_offset, 1,
3508 "%s : Ciphering Key Sequence Number: No key is available",
3513 proto_tree_add_text(subtree,
3514 tvb, curr_offset, 1,
3515 "%s : Ciphering Key Sequence Number: %u",
3524 if (curr_len <= 0) return;
3526 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_RAND);
3528 ELEM_OPT_TLV(0x20, GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_AUTN, "");
3530 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3537 dtap_mm_auth_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3539 guint32 curr_offset;
3543 curr_offset = offset;
3546 is_uplink = IS_UPLINK_TRUE;
3548 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_AUTH_RESP_PARAM);
3550 ELEM_OPT_TLV(0x21, GSM_A_PDU_TYPE_DTAP, DE_AUTH_RESP_PARAM_EXT, "");
3552 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3559 dtap_mm_auth_fail(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3561 guint32 curr_offset;
3565 curr_offset = offset;
3568 is_uplink = IS_UPLINK_TRUE;
3570 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE);
3572 ELEM_OPT_TLV(0x22, GSM_A_PDU_TYPE_DTAP, DE_AUTH_FAIL_PARAM, "");
3574 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3581 dtap_mm_cm_reestab_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3583 guint32 curr_offset;
3587 proto_tree *subtree;
3590 curr_offset = offset;
3593 is_uplink = IS_UPLINK_TRUE;
3596 * special dissection for Cipher Key Sequence Number
3598 oct = tvb_get_guint8(tvb, curr_offset);
3600 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
3601 proto_tree_add_text(tree,
3602 tvb, curr_offset, 1,
3607 proto_tree_add_text(tree,
3608 tvb, curr_offset, 1,
3609 gsm_common_elem_strings[DE_CIPH_KEY_SEQ_NUM].strptr);
3611 subtree = proto_item_add_subtree(item, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM]);
3613 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
3614 proto_tree_add_text(subtree,
3615 tvb, curr_offset, 1,
3619 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
3624 proto_tree_add_text(subtree,
3625 tvb, curr_offset, 1,
3626 "%s : Ciphering Key Sequence Number: No key is available",
3631 proto_tree_add_text(subtree,
3632 tvb, curr_offset, 1,
3633 "%s : Ciphering Key Sequence Number: %u",
3642 if (curr_len <= 0) return;
3644 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, "");
3646 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, "");
3648 ELEM_OPT_TV(0x13, GSM_A_PDU_TYPE_COMMON, DE_LAI, "");
3650 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3657 dtap_mm_cm_srvc_prompt(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3659 guint32 curr_offset;
3663 curr_offset = offset;
3666 is_uplink = IS_UPLINK_FALSE;
3668 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_PD_SAPI);
3670 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3677 dtap_mm_cm_srvc_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3679 guint32 curr_offset;
3683 curr_offset = offset;
3686 is_uplink = IS_UPLINK_FALSE;
3688 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE);
3690 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3697 dtap_mm_abort(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3699 guint32 curr_offset;
3703 curr_offset = offset;
3706 is_uplink = IS_UPLINK_FALSE;
3708 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE);
3710 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3717 dtap_mm_cm_srvc_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3719 guint32 curr_offset;
3723 proto_tree *subtree;
3727 curr_offset = offset;
3730 is_uplink = IS_UPLINK_TRUE;
3733 * special dissection for CM Service Type
3735 oct = tvb_get_guint8(tvb, curr_offset);
3738 proto_tree_add_text(tree,
3739 tvb, curr_offset, 1,
3740 gsm_common_elem_strings[DE_CIPH_KEY_SEQ_NUM].strptr);
3742 subtree = proto_item_add_subtree(item, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM]);
3744 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
3745 proto_tree_add_text(subtree,
3746 tvb, curr_offset, 1,
3750 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
3752 switch ((oct & 0x70) >> 4)
3755 proto_tree_add_text(subtree,
3756 tvb, curr_offset, 1,
3757 "%s : Ciphering Key Sequence Number: No key is available",
3762 proto_tree_add_text(subtree,
3763 tvb, curr_offset, 1,
3764 "%s : Ciphering Key Sequence Number: %u",
3771 proto_tree_add_text(tree,
3772 tvb, curr_offset, 1,
3773 gsm_dtap_elem_strings[DE_CM_SRVC_TYPE].strptr);
3775 subtree = proto_item_add_subtree(item, ett_gsm_dtap_elem[DE_CM_SRVC_TYPE]);
3779 case 0x01: str = "Mobile originating call establishment or packet mode connection establishment"; break;
3780 case 0x02: str = "Emergency call establishment"; break;
3781 case 0x04: str = "Short message service"; break;
3782 case 0x08: str = "Supplementary service activation"; break;
3783 case 0x09: str = "Voice group call establishment"; break;
3784 case 0x0a: str = "Voice broadcast call establishment"; break;
3785 case 0x0b: str = "Location Services"; break;
3791 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
3792 proto_tree_add_text(subtree,
3793 tvb, curr_offset, 1,
3794 "%s : Service Type: (%u) %s",
3802 if (curr_len <= 0) return;
3804 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, "");
3806 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, "");
3808 ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_COMMON, DE_PRIO, "");
3810 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3817 dtap_mm_id_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3820 guint32 curr_offset;
3822 proto_tree *subtree;
3826 curr_offset = offset;
3829 is_uplink = IS_UPLINK_FALSE;
3832 * special dissection for Identity Type
3834 oct = tvb_get_guint8(tvb, curr_offset);
3836 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
3837 proto_tree_add_text(tree,
3838 tvb, curr_offset, 1,
3843 proto_tree_add_text(tree,
3844 tvb, curr_offset, 1,
3845 gsm_dtap_elem_strings[DE_ID_TYPE].strptr);
3847 subtree = proto_item_add_subtree(item, ett_gsm_dtap_elem[DE_ID_TYPE]);
3849 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
3850 proto_tree_add_text(subtree,
3851 tvb, curr_offset, 1,
3857 case 1: str = "IMSI"; break;
3858 case 2: str = "IMEI"; break;
3859 case 3: str = "IMEISV"; break;
3860 case 4: str = "TMSI"; break;
3866 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
3867 proto_tree_add_text(subtree,
3868 tvb, curr_offset, 1,
3869 "%s : Type of identity: %s",
3876 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3883 dtap_mm_id_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3885 guint32 curr_offset;
3889 curr_offset = offset;
3892 is_uplink = IS_UPLINK_TRUE;
3894 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, "");
3896 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3903 dtap_mm_imsi_det_ind(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3905 guint32 curr_offset;
3909 curr_offset = offset;
3912 is_uplink = IS_UPLINK_TRUE;
3914 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_1);
3916 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, "");
3918 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3925 dtap_mm_loc_upd_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3927 guint32 curr_offset;
3931 curr_offset = offset;
3934 is_uplink = IS_UPLINK_FALSE;
3936 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_LAI);
3938 ELEM_OPT_TLV(0x17, GSM_A_PDU_TYPE_COMMON, DE_MID, "");
3940 ELEM_OPT_T(0xa1, GSM_A_PDU_TYPE_DTAP, DE_FOP, "");
3942 ELEM_OPT_T(0xa2, GSM_A_PDU_TYPE_DTAP, DE_CTS_PERM, "");
3944 ELEM_OPT_TLV(0x4a, GSM_A_PDU_TYPE_COMMON, DE_PLMN_LIST, " Equivalent");
3946 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3953 dtap_mm_loc_upd_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3955 guint32 curr_offset;
3959 curr_offset = offset;
3962 is_uplink = IS_UPLINK_FALSE;
3964 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE);
3966 EXTRANEOUS_DATA_CHECK(curr_len, 0);
3973 dtap_mm_loc_upd_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
3975 guint32 curr_offset;
3979 proto_tree *subtree;
3983 curr_offset = offset;
3986 is_uplink = IS_UPLINK_TRUE;
3989 * special dissection for Location Updating Type
3991 oct = tvb_get_guint8(tvb, curr_offset);
3994 proto_tree_add_text(tree,
3995 tvb, curr_offset, 1,
3996 gsm_common_elem_strings[DE_CIPH_KEY_SEQ_NUM].strptr);
3998 subtree = proto_item_add_subtree(item, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM]);
4000 other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
4001 proto_tree_add_text(subtree,
4002 tvb, curr_offset, 1,
4006 other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
4008 switch ((oct & 0x70) >> 4)
4011 proto_tree_add_text(subtree,
4012 tvb, curr_offset, 1,
4013 "%s : Ciphering Key Sequence Number: No key is available",
4018 proto_tree_add_text(subtree,
4019 tvb, curr_offset, 1,
4020 "%s : Ciphering Key Sequence Number: %u",
4027 proto_tree_add_text(tree,
4028 tvb, curr_offset, 1,
4029 gsm_dtap_elem_strings[DE_LOC_UPD_TYPE].strptr);
4031 subtree = proto_item_add_subtree(item, ett_gsm_dtap_elem[DE_LOC_UPD_TYPE]);
4033 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
4034 proto_tree_add_text(subtree,
4035 tvb, curr_offset, 1,
4036 "%s : Follow-On Request (FOR): %s",
4038 (oct & 0x08) ? "Follow-on request pending" : "No follow-on request pending");
4040 other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
4041 proto_tree_add_text(subtree,
4042 tvb, curr_offset, 1,
4048 case 0: str = "Normal"; break;
4049 case 1: str = "Periodic"; break;
4050 case 2: str = "IMSI attach"; break;
4056 other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
4057 proto_tree_add_text(subtree,
4058 tvb, curr_offset, 1,
4059 "%s : Updating Type: %s",
4063 proto_item_append_text(item, " - %s", str);
4068 if (curr_len <= 0) return;
4070 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_LAI);
4072 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_1);
4074 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, "");
4076 ELEM_OPT_TLV(0x33, GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, "");
4078 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4086 dtap_mm_mm_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4088 guint32 curr_offset;
4092 curr_offset = offset;
4095 is_uplink = IS_UPLINK_TRUE;
4097 ELEM_OPT_TLV(0x43, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Full Name");
4099 ELEM_OPT_TLV(0x45, GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME, " - Short Name");
4101 ELEM_OPT_TV(0x46, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE, " - Local");
4103 ELEM_OPT_TV(0x47, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE_TIME, " - Universal Time and Local Time Zone");
4105 ELEM_OPT_TLV(0x48, GSM_A_PDU_TYPE_DTAP, DE_LSA_ID, "");
4107 ELEM_OPT_TLV(0x49, GSM_A_PDU_TYPE_DTAP, DE_DAY_SAVING_TIME, "");
4109 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4116 dtap_mm_mm_status(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4118 guint32 curr_offset;
4122 curr_offset = offset;
4125 is_uplink = IS_UPLINK_TRUE;
4127 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE);
4129 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4136 dtap_mm_tmsi_realloc_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4138 guint32 curr_offset;
4142 curr_offset = offset;
4145 is_uplink = IS_UPLINK_FALSE;
4147 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_LAI);
4149 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, "");
4151 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4158 dtap_cc_alerting(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4160 guint32 curr_offset;
4164 curr_offset = offset;
4167 is_uplink = IS_UPLINK_TRUE;
4169 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4171 ELEM_OPT_TLV(0x1e, GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, "");
4173 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4177 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4179 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4186 dtap_cc_call_conf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4188 guint32 curr_offset;
4192 curr_offset = offset;
4195 is_uplink = IS_UPLINK_TRUE;
4197 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " BC repeat indicator");
4199 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 1");
4201 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 2");
4203 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4205 ELEM_OPT_TLV(0x15, GSM_A_PDU_TYPE_DTAP, DE_CC_CAP, "");
4207 ELEM_OPT_TLV(0x2d, GSM_A_PDU_TYPE_DTAP, DE_SI, "");
4209 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, "");
4211 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4218 dtap_cc_call_proceed(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4220 guint32 curr_offset;
4224 curr_offset = offset;
4227 is_uplink = IS_UPLINK_FALSE;
4229 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " BC repeat indicator");
4231 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 1");
4233 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 2");
4235 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4237 ELEM_OPT_TLV(0x1e, GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, "");
4239 ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_COMMON, DE_PRIO, "");
4241 ELEM_OPT_TLV(0x2f, GSM_A_PDU_TYPE_DTAP, DE_NET_CC_CAP, "");
4243 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4250 dtap_cc_congestion_control(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4252 guint32 curr_offset;
4256 proto_tree *subtree;
4260 curr_offset = offset;
4263 is_uplink = IS_UPLINK_FALSE;
4266 * special dissection for Congestion Level
4268 oct = tvb_get_guint8(tvb, curr_offset);
4270 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
4271 proto_tree_add_text(tree,
4272 tvb, curr_offset, 1,
4277 proto_tree_add_text(tree,
4278 tvb, curr_offset, 1,
4279 gsm_dtap_elem_strings[DE_CONGESTION].strptr);
4281 subtree = proto_item_add_subtree(item, ett_gsm_dtap_elem[DE_CONGESTION]);
4285 case 0: str = "Receiver ready"; break;
4286 case 15: str = "Receiver not ready"; break;
4292 other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
4293 proto_tree_add_text(subtree,
4294 tvb, curr_offset, 1,
4295 "%s : Congestion level: %s",
4302 if (curr_len <= 0) return;
4304 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4306 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4313 dtap_cc_connect(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4315 guint32 curr_offset;
4319 curr_offset = offset;
4322 is_uplink = IS_UPLINK_TRUE;
4324 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4326 ELEM_OPT_TLV(0x1e, GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, "");
4328 ELEM_OPT_TLV(0x4c, GSM_A_PDU_TYPE_DTAP, DE_CONN_NUM, "");
4330 ELEM_OPT_TLV(0x4d, GSM_A_PDU_TYPE_DTAP, DE_CONN_SUB_ADDR, "");
4332 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4336 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4338 ELEM_OPT_TLV(0x2d, GSM_A_PDU_TYPE_DTAP, DE_SI, "");
4340 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4347 dtap_cc_disconnect(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4349 guint32 curr_offset;
4353 curr_offset = offset;
4356 is_uplink = IS_UPLINK_TRUE;
4358 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4360 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4362 ELEM_OPT_TLV(0x1e, GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, "");
4364 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4366 ELEM_OPT_TLV(0x7b, GSM_A_PDU_TYPE_DTAP, DE_ALLOWED_ACTIONS, "");
4370 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4372 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4379 dtap_cc_emerg_setup(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4381 guint32 curr_offset;
4385 curr_offset = offset;
4388 is_uplink = IS_UPLINK_TRUE;
4390 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, "");
4392 ELEM_OPT_TLV(0x2d, GSM_A_PDU_TYPE_DTAP, DE_SI, "");
4394 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, "");
4396 ELEM_OPT_TLV(0x2e, GSM_A_PDU_TYPE_DTAP, DE_SRVC_CAT, " Emergency");
4398 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4405 dtap_cc_facility(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4407 guint32 curr_offset;
4411 curr_offset = offset;
4414 is_uplink = IS_UPLINK_TRUE;
4416 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4420 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4422 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4429 dtap_cc_hold_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4431 guint32 curr_offset;
4435 curr_offset = offset;
4438 is_uplink = IS_UPLINK_FALSE;
4440 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4442 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4449 dtap_cc_modify(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4451 guint32 curr_offset;
4455 curr_offset = offset;
4458 is_uplink = IS_UPLINK_TRUE;
4460 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, "");
4462 ELEM_OPT_TLV(0x7c, GSM_A_PDU_TYPE_DTAP, DE_LLC, "");
4464 ELEM_OPT_TLV(0x7d, GSM_A_PDU_TYPE_DTAP, DE_HLC, "");
4466 ELEM_OPT_T(0xa3, GSM_A_PDU_TYPE_DTAP, DE_REV_CALL_SETUP_DIR, "");
4468 ELEM_OPT_T(0xa4, GSM_A_PDU_TYPE_DTAP, DE_IMM_MOD_IND, "");
4470 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4477 dtap_cc_modify_complete(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4479 guint32 curr_offset;
4483 curr_offset = offset;
4486 is_uplink = IS_UPLINK_TRUE;
4488 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, "");
4490 ELEM_OPT_TLV(0x7c, GSM_A_PDU_TYPE_DTAP, DE_LLC, "");
4492 ELEM_OPT_TLV(0x7d, GSM_A_PDU_TYPE_DTAP, DE_HLC, "");
4494 ELEM_OPT_T(0xa3, GSM_A_PDU_TYPE_DTAP, DE_REV_CALL_SETUP_DIR, "");
4496 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4503 dtap_cc_modify_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4505 guint32 curr_offset;
4509 curr_offset = offset;
4512 is_uplink = IS_UPLINK_FALSE;
4514 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, "");
4516 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4518 ELEM_OPT_TLV(0x7c, GSM_A_PDU_TYPE_DTAP, DE_LLC, "");
4520 ELEM_OPT_TLV(0x7d, GSM_A_PDU_TYPE_DTAP, DE_HLC, "");
4522 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4529 dtap_cc_notify(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4531 guint32 curr_offset;
4535 curr_offset = offset;
4538 is_uplink = IS_UPLINK_FALSE;
4540 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_NOT_IND);
4542 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4549 dtap_cc_progress(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4551 guint32 curr_offset;
4555 curr_offset = offset;
4558 is_uplink = IS_UPLINK_FALSE;
4560 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, "");
4562 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4564 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4571 dtap_cc_cc_est(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4573 guint32 curr_offset;
4577 curr_offset = offset;
4580 is_uplink = IS_UPLINK_FALSE;
4582 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_SETUP_CONTAINER, "");
4584 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4591 dtap_cc_cc_est_conf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4593 guint32 curr_offset;
4597 curr_offset = offset;
4600 is_uplink = IS_UPLINK_TRUE;
4602 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " Repeat indicator");
4604 ELEM_MAND_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 1");
4606 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 2");
4608 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4610 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, "");
4612 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4619 dtap_cc_release(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4621 guint32 curr_offset;
4625 curr_offset = offset;
4628 is_uplink = IS_UPLINK_TRUE;
4630 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4632 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, " 2");
4634 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4636 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4640 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4642 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4649 dtap_cc_recall(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4651 guint32 curr_offset;
4655 curr_offset = offset;
4658 is_uplink = IS_UPLINK_FALSE;
4660 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_RECALL_TYPE);
4662 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4664 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4671 dtap_cc_release_complete(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4673 guint32 curr_offset;
4677 curr_offset = offset;
4680 is_uplink = IS_UPLINK_FALSE;
4682 ELEM_OPT_TLV(0x08, GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4684 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4686 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4690 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4692 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4699 dtap_cc_retrieve_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4701 guint32 curr_offset;
4705 curr_offset = offset;
4708 is_uplink = IS_UPLINK_FALSE;
4710 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4712 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4717 * 3GPP TS 24.008 version 7.5.0 Release 7
4720 dtap_cc_setup(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4722 guint32 curr_offset;
4726 curr_offset = offset;
4729 is_uplink = IS_UPLINK_TRUE;
4731 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " BC repeat indicator");
4733 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 1");
4735 ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, " 2");
4737 ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4739 ELEM_OPT_TLV(0x1e, GSM_A_PDU_TYPE_DTAP, DE_PROG_IND, "");
4741 ELEM_OPT_TV(0x34, GSM_A_PDU_TYPE_DTAP, DE_SIGNAL, "");
4743 ELEM_OPT_TLV(0x5c, GSM_A_PDU_TYPE_DTAP, DE_CLG_PARTY_BCD_NUM, "");
4745 ELEM_OPT_TLV(0x5d, GSM_A_PDU_TYPE_DTAP, DE_CLG_PARTY_SUB_ADDR, "");
4747 ELEM_OPT_TLV(0x5e, GSM_A_PDU_TYPE_DTAP, DE_CLD_PARTY_BCD_NUM, "");
4749 ELEM_OPT_TLV(0x6d, GSM_A_PDU_TYPE_DTAP, DE_CLD_PARTY_SUB_ADDR, "");
4751 ELEM_OPT_TLV(0x74, GSM_A_PDU_TYPE_DTAP, DE_RED_PARTY_BCD_NUM, "");
4753 ELEM_OPT_TLV(0x75, GSM_A_PDU_TYPE_DTAP, DE_RED_PARTY_SUB_ADDR, "");
4755 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " LLC repeat indicator");
4757 ELEM_OPT_TLV(0x7c, GSM_A_PDU_TYPE_DTAP, DE_LLC, " 1");
4759 ELEM_OPT_TLV(0x7c, GSM_A_PDU_TYPE_DTAP, DE_LLC, " 2");
4761 ELEM_OPT_TV_SHORT(0xd0, GSM_A_PDU_TYPE_DTAP, DE_REPEAT_IND, " HLC repeat indicator");
4763 ELEM_OPT_TLV(0x7d, GSM_A_PDU_TYPE_DTAP, DE_HLC, " 1");
4765 ELEM_OPT_TLV(0x7d, GSM_A_PDU_TYPE_DTAP, DE_HLC, " 2");
4767 ELEM_OPT_TLV(0x7e, GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4771 ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_COMMON, DE_PRIO, "");
4773 ELEM_OPT_TLV(0x19, GSM_A_PDU_TYPE_DTAP, DE_ALERT_PATTERN, "");
4775 ELEM_OPT_TLV(0x2f, GSM_A_PDU_TYPE_DTAP, DE_NET_CC_CAP, "");
4777 ELEM_OPT_TLV(0x3a, GSM_A_PDU_TYPE_DTAP, DE_CAUSE_NO_CLI, "");
4779 /* Backup bearer capability O TLV 3-15 10.5.4.4a */
4780 ELEM_OPT_TLV(0x41, GSM_A_PDU_TYPE_DTAP, DE_BEARER_CAP, "");
4784 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4786 ELEM_OPT_T(0xa1, GSM_A_PDU_TYPE_DTAP, DE_CLIR_SUP, "");
4788 ELEM_OPT_T(0xa2, GSM_A_PDU_TYPE_DTAP, DE_CLIR_INV, "");
4790 ELEM_OPT_TLV(0x15, GSM_A_PDU_TYPE_DTAP, DE_CC_CAP, "");
4792 ELEM_OPT_TLV(0x1d, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, " $(CCBS)$ (advanced recall alignment)");
4794 ELEM_OPT_TLV(0x1b, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, " (recall alignment Not essential) $(CCBS)$");
4796 ELEM_OPT_TLV(0x2d, GSM_A_PDU_TYPE_DTAP, DE_SI, "");
4798 ELEM_OPT_TLV(0x40, GSM_A_PDU_TYPE_DTAP, DE_SUP_CODEC_LIST, "");
4800 /*A3 Redial Redial O T 1 10.5.4.34
4801 * TODO add this element
4802 * ELEM_OPT_T(0xA3, GSM_A_PDU_TYPE_DTAP, DE_REDIAL, "");
4805 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4812 dtap_cc_start_cc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4814 guint32 curr_offset;
4818 curr_offset = offset;
4821 is_uplink = IS_UPLINK_FALSE;
4823 ELEM_OPT_TLV(0x15, GSM_A_PDU_TYPE_DTAP, DE_CC_CAP, "");
4825 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4832 dtap_cc_start_dtmf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4834 guint32 curr_offset;
4838 curr_offset = offset;
4841 is_uplink = IS_UPLINK_TRUE;
4843 ELEM_MAND_TV(0x2c, GSM_A_PDU_TYPE_DTAP, DE_KEYPAD_FACILITY, "");
4845 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4852 dtap_cc_start_dtmf_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4854 guint32 curr_offset;
4858 curr_offset = offset;
4861 is_uplink = IS_UPLINK_FALSE;
4863 ELEM_MAND_TV(0x2c, GSM_A_PDU_TYPE_DTAP, DE_KEYPAD_FACILITY, "");
4865 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4872 dtap_cc_start_dtmf_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4874 guint32 curr_offset;
4878 curr_offset = offset;
4881 is_uplink = IS_UPLINK_FALSE;
4883 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4885 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4892 dtap_cc_status(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4894 guint32 curr_offset;
4898 curr_offset = offset;
4901 is_uplink = IS_UPLINK_FALSE;
4903 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CAUSE, "");
4905 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_CALL_STATE);
4907 ELEM_OPT_TLV(0x24, GSM_A_PDU_TYPE_DTAP, DE_AUX_STATES, "");
4909 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4916 dtap_cc_user_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4918 guint32 curr_offset;
4922 curr_offset = offset;
4925 is_uplink = IS_UPLINK_TRUE;
4927 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_USER_USER, "");
4929 ELEM_OPT_T(0xa0, GSM_A_PDU_TYPE_DTAP, DE_MORE_DATA, "");
4931 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4938 dtap_ss_register(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4940 guint32 curr_offset;
4944 curr_offset = offset;
4947 is_uplink = IS_UPLINK_TRUE;
4949 ELEM_MAND_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_FACILITY, "");
4951 ELEM_OPT_TLV(0x7f, GSM_A_PDU_TYPE_DTAP, DE_SS_VER_IND, "");
4953 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4960 dtap_sms_cp_data(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4962 guint32 curr_offset;
4966 curr_offset = offset;
4969 is_uplink = IS_UPLINK_TRUE;
4971 ELEM_MAND_LV(GSM_A_PDU_TYPE_DTAP, DE_CP_USER_DATA, "");
4973 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4980 dtap_sms_cp_error(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4982 guint32 curr_offset;
4986 curr_offset = offset;
4989 is_uplink = IS_UPLINK_TRUE;
4991 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_CP_CAUSE);
4993 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4997 dtap_tp_close_tch_loop_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4999 guint32 curr_offset;
5004 curr_offset = offset;
5006 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_SUB_CHANNEL );
5008 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5012 dtap_tp_open_loop_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5014 guint32 curr_offset;
5019 curr_offset = offset;
5022 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_ACK );
5024 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5028 dtap_tp_multi_slot_loop_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5030 guint32 curr_offset;
5035 curr_offset = offset;
5037 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_LOOP_TYPE );
5039 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5043 dtap_tp_multi_slot_loop_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5045 guint32 curr_offset;
5050 curr_offset = offset;
5052 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_LOOP_ACK );
5054 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5058 dtap_tp_test_interface(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5060 guint32 curr_offset;
5065 curr_offset = offset;
5067 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_TESTED_DEVICE );
5069 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5073 dtap_tp_gprs_test_mode_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5075 guint32 curr_offset;
5080 curr_offset = offset;
5082 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_PDU_DESCRIPTION );
5084 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_MODE_FLAG );
5086 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5090 dtap_tp_egprs_start_radio_block_loopback_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5092 guint32 curr_offset;
5097 curr_offset = offset;
5099 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_EGPRS_MODE_FLAG );
5101 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5105 dtap_tp_close_ue_test_loop(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5107 guint32 curr_offset;
5112 curr_offset = offset;
5114 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_UE_TEST_LOOP_MODE );
5116 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5120 dtap_tp_reset_ue_positioning_ue_stored_information(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5122 guint32 curr_offset;
5127 curr_offset = offset;
5129 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_UE_POSITIONING_TECHNOLOGY );
5131 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5135 dtap_tp_ue_test_loop_mode_3_rlc_sdu_counter_response(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5137 guint32 curr_offset;
5142 curr_offset = offset;
5144 ELEM_MAND_V(GSM_A_PDU_TYPE_DTAP, DE_TP_RLC_SDU_COUNTER_VALUE );
5146 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5149 #define NUM_GSM_DTAP_MSG_MM (sizeof(gsm_a_dtap_msg_mm_strings)/sizeof(value_string))
5150 static gint ett_gsm_dtap_msg_mm[NUM_GSM_DTAP_MSG_MM];
5151 static void (*dtap_msg_mm_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
5152 dtap_mm_imsi_det_ind, /* IMSI Detach Indication */
5153 dtap_mm_loc_upd_acc, /* Location Updating Accept */
5154 dtap_mm_loc_upd_rej, /* Location Updating Reject */
5155 dtap_mm_loc_upd_req, /* Location Updating Request */
5156 NULL /* no associated data */, /* Authentication Reject */
5157 dtap_mm_auth_req, /* Authentication Request */
5158 dtap_mm_auth_resp, /* Authentication Response */
5159 dtap_mm_auth_fail, /* Authentication Failure */
5160 dtap_mm_id_req, /* Identity Request */
5161 dtap_mm_id_resp, /* Identity Response */
5162 dtap_mm_tmsi_realloc_cmd, /* TMSI Reallocation Command */
5163 NULL /* no associated data */, /* TMSI Reallocation Complete */
5164 NULL /* no associated data */, /* CM Service Accept */
5165 dtap_mm_cm_srvc_rej, /* CM Service Reject */
5166 NULL /* no associated data */, /* CM Service Abort */
5167 dtap_mm_cm_srvc_req, /* CM Service Request */
5168 dtap_mm_cm_srvc_prompt, /* CM Service Prompt */
5169 NULL, /* Reserved: was allocated in earlier phases of the protocol */
5170 dtap_mm_cm_reestab_req, /* CM Re-establishment Request */
5171 dtap_mm_abort, /* Abort */
5172 NULL /* no associated data */, /* MM Null */
5173 dtap_mm_mm_status, /* MM Status */
5174 dtap_mm_mm_info, /* MM Information */
5178 #define NUM_GSM_DTAP_MSG_CC (sizeof(gsm_a_dtap_msg_cc_strings)/sizeof(value_string))
5179 static gint ett_gsm_dtap_msg_cc[NUM_GSM_DTAP_MSG_CC];
5180 static void (*dtap_msg_cc_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
5181 dtap_cc_alerting, /* Alerting */
5182 dtap_cc_call_conf, /* Call Confirmed */
5183 dtap_cc_call_proceed, /* Call Proceeding */
5184 dtap_cc_connect, /* Connect */
5185 NULL /* no associated data */, /* Connect Acknowledge */
5186 dtap_cc_emerg_setup, /* Emergency Setup */
5187 dtap_cc_progress, /* Progress */
5188 dtap_cc_cc_est, /* CC-Establishment */
5189 dtap_cc_cc_est_conf, /* CC-Establishment Confirmed */
5190 dtap_cc_recall, /* Recall */
5191 dtap_cc_start_cc, /* Start CC */
5192 dtap_cc_setup, /* Setup */
5193 dtap_cc_modify, /* Modify */
5194 dtap_cc_modify_complete, /* Modify Complete */
5195 dtap_cc_modify_rej, /* Modify Reject */
5196 dtap_cc_user_info, /* User Information */
5197 NULL /* no associated data */, /* Hold */
5198 NULL /* no associated data */, /* Hold Acknowledge */
5199 dtap_cc_hold_rej, /* Hold Reject */
5200 NULL /* no associated data */, /* Retrieve */
5201 NULL /* no associated data */, /* Retrieve Acknowledge */
5202 dtap_cc_retrieve_rej, /* Retrieve Reject */
5203 dtap_cc_disconnect, /* Disconnect */
5204 dtap_cc_release, /* Release */
5205 dtap_cc_release_complete, /* Release Complete */
5206 dtap_cc_congestion_control, /* Congestion Control */
5207 dtap_cc_notify, /* Notify */
5208 dtap_cc_status, /* Status */
5209 NULL /* no associated data */, /* Status Enquiry */
5210 dtap_cc_start_dtmf, /* Start DTMF */
5211 NULL /* no associated data */, /* Stop DTMF */
5212 NULL /* no associated data */, /* Stop DTMF Acknowledge */
5213 dtap_cc_start_dtmf_ack, /* Start DTMF Acknowledge */
5214 dtap_cc_start_dtmf_rej, /* Start DTMF Reject */
5215 dtap_cc_facility, /* Facility */
5219 #define NUM_GSM_DTAP_MSG_SMS (sizeof(gsm_a_dtap_msg_sms_strings)/sizeof(value_string))
5220 static gint ett_gsm_dtap_msg_sms[NUM_GSM_DTAP_MSG_SMS];
5221 static void (*dtap_msg_sms_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
5222 dtap_sms_cp_data, /* CP-DATA */
5223 NULL /* no associated data */, /* CP-ACK */
5224 dtap_sms_cp_error, /* CP-ERROR */
5228 #define NUM_GSM_DTAP_MSG_SS (sizeof(gsm_a_dtap_msg_ss_strings)/sizeof(value_string))
5229 static gint ett_gsm_dtap_msg_ss[NUM_GSM_DTAP_MSG_SS];
5230 static void (*dtap_msg_ss_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
5231 dtap_cc_release_complete, /* Release Complete */
5232 dtap_cc_facility, /* Facility */
5233 dtap_ss_register, /* Register */
5237 #define NUM_GSM_DTAP_MSG_TP (sizeof(gsm_a_dtap_msg_tp_strings)/sizeof(value_string))
5238 static gint ett_gsm_dtap_msg_tp[NUM_GSM_DTAP_MSG_TP];
5239 static void (*dtap_msg_tp_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
5240 dtap_tp_close_tch_loop_cmd, /* CLOSE TCH LOOP CMD */
5241 NULL, /* CLOSE TCH LOOP ACK */
5242 dtap_tp_open_loop_cmd, /* OPEN LOOP CMD */
5243 NULL, /* ACT EMMI CMD */
5244 NULL, /* ACT EMMI ACK */
5245 NULL, /* DEACT EMMI */
5246 dtap_tp_test_interface, /* Test Interface */
5247 dtap_tp_multi_slot_loop_cmd, /* CLOSE Multi-slot LOOP CMD */
5248 dtap_tp_multi_slot_loop_ack, /* CLOSE Multi-slot LOOP ACK */
5249 NULL, /* OPEN Multi-slot LOOP CMD */
5250 NULL, /* OPEN Multi-slot LOOP ACK */
5251 dtap_tp_gprs_test_mode_cmd, /* GPRS TEST MODE CMD */
5252 dtap_tp_egprs_start_radio_block_loopback_cmd, /* EGPRS START RADIO BLOCK LOOPBACK CMD */
5253 dtap_tp_close_ue_test_loop, /* CLOSE UE TEST LOOP */
5254 NULL, /* CLOSE UE TEST LOOP COMPLETE */
5255 NULL, /* OPEN UE TEST LOOP */
5256 NULL, /* OPEN UE TEST LOOP COMPLETE */
5257 NULL, /* ACTIVATE RB TEST MODE */
5258 NULL, /* ACTIVATE RB TEST MODE COMPLETE */
5259 NULL, /* DEACTIVATE RB TEST MODE */
5260 NULL, /* DEACTIVATE RB TEST MODE COMPLETE */
5261 dtap_tp_reset_ue_positioning_ue_stored_information, /* RESET UE POSITIONING STORED INFORMATION */
5262 NULL, /* UE Test Loop Mode 3 RLC SDU Counter Request */
5263 dtap_tp_ue_test_loop_mode_3_rlc_sdu_counter_response, /* UE Test Loop Mode 3 RLC SDU Counter Response */
5267 /* GENERIC DISSECTOR FUNCTIONS */
5270 dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
5272 static gsm_a_tap_rec_t tap_rec[4];
5273 static gsm_a_tap_rec_t *tap_p;
5274 static guint tap_current=0;
5275 void (*msg_fcn)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len);
5280 guint32 oct_1, oct_2;
5282 proto_item *dtap_item = NULL;
5283 proto_tree *dtap_tree = NULL;
5284 proto_item *oct_1_item = NULL;
5285 proto_tree *pd_tree = NULL;
5286 const gchar *msg_str;
5293 len = tvb_length(tvb);
5298 * too short to be DTAP
5300 call_dissector(data_handle, tvb, pinfo, tree);
5304 if (check_col(pinfo->cinfo, COL_INFO))
5306 col_append_str(pinfo->cinfo, COL_INFO, "(DTAP) ");
5310 * set tap record pointer
5313 if (tap_current >= 4)
5317 tap_p = &tap_rec[tap_current];
5323 gsm_a_dtap_pinfo = pinfo;
5327 * get protocol discriminator
5329 oct_1 = tvb_get_guint8(tvb, offset++);
5331 if ((((oct_1 & DTAP_TI_MASK) >> 4) & DTAP_TIE_PRES_MASK) == DTAP_TIE_PRES_MASK)
5334 * eventhough we don't know if a TI should be in the message yet
5335 * we rely on the TI/SKIP indicator to be 0 to avoid taking this
5338 oct_2 = tvb_get_guint8(tvb, offset++);
5341 oct = tvb_get_guint8(tvb, offset);
5343 pd = oct_1 & DTAP_PD_MASK;
5350 if (check_col(pinfo->cinfo, COL_INFO))
5352 col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ",val_to_str(pd,gsm_a_pd_short_str_vals,"unknown"));
5361 msg_str = match_strval_idx((guint32) (oct & DTAP_CC_IEI_MASK), gsm_a_dtap_msg_cc_strings, &idx);
5362 ett_tree = ett_gsm_dtap_msg_cc[idx];
5363 hf_idx = hf_gsm_a_dtap_msg_cc_type;
5364 msg_fcn = dtap_msg_cc_fcn[idx];
5365 ti = (oct_1 & DTAP_TI_MASK) >> 4;
5370 msg_str = match_strval_idx((guint32) (oct & DTAP_MM_IEI_MASK), gsm_a_dtap_msg_mm_strings, &idx);
5371 ett_tree = ett_gsm_dtap_msg_mm[idx];
5372 hf_idx = hf_gsm_a_dtap_msg_mm_type;
5373 msg_fcn = dtap_msg_mm_fcn[idx];
5378 get_rr_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn);
5382 get_gmm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn);
5386 msg_str = match_strval_idx((guint32) (oct & DTAP_SMS_IEI_MASK), gsm_a_dtap_msg_sms_strings, &idx);
5387 ett_tree = ett_gsm_dtap_msg_sms[idx];
5388 hf_idx = hf_gsm_a_dtap_msg_sms_type;
5389 msg_fcn = dtap_msg_sms_fcn[idx];
5390 ti = (oct_1 & DTAP_TI_MASK) >> 4;
5394 get_sm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn);
5395 ti = (oct_1 & DTAP_TI_MASK) >> 4;
5399 msg_str = match_strval_idx((guint32) (oct & DTAP_SS_IEI_MASK), gsm_a_dtap_msg_ss_strings, &idx);
5400 ett_tree = ett_gsm_dtap_msg_ss[idx];
5401 hf_idx = hf_gsm_a_dtap_msg_ss_type;
5402 msg_fcn = dtap_msg_ss_fcn[idx];
5403 ti = (oct_1 & DTAP_TI_MASK) >> 4;
5408 msg_str = match_strval_idx((guint32) (oct & DTAP_TP_IEI_MASK), gsm_a_dtap_msg_tp_strings, &idx);
5409 ett_tree = ett_gsm_dtap_msg_tp[idx];
5410 hf_idx = hf_gsm_a_dtap_msg_tp_type;
5411 msg_fcn = dtap_msg_tp_fcn[idx];
5412 ti = (oct_1 & DTAP_TI_MASK) >> 4;
5417 /* 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 */
5421 sccp_msg = pinfo->sccp_info;
5423 if (sccp_msg && sccp_msg->data.co.assoc) {
5424 sccp_assoc = sccp_msg->data.co.assoc;
5431 * create the protocol tree
5433 if (msg_str == NULL)
5436 proto_tree_add_protocol_format(tree, proto_a_dtap, tvb, 0, len,
5437 "GSM A-I/F DTAP - Unknown DTAP Message Type (0x%02x)",
5440 dtap_tree = proto_item_add_subtree(dtap_item, ett_dtap_msg);
5442 if (sccp_msg && !sccp_msg->data.co.label) {
5443 sccp_msg->data.co.label = se_strdup_printf("DTAP (0x%02x)",oct);
5451 proto_tree_add_protocol_format(tree, proto_a_dtap, tvb, 0, -1,
5452 "GSM A-I/F DTAP - %s",
5455 dtap_tree = proto_item_add_subtree(dtap_item, ett_tree);
5457 if (sccp_msg && !sccp_msg->data.co.label) {
5458 sccp_msg->data.co.label = se_strdup(msg_str);
5461 if (check_col(pinfo->cinfo, COL_INFO))
5463 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
5468 proto_tree_add_text(dtap_tree,
5470 "Protocol Discriminator: %s",
5471 val_to_str(pd, protocol_discriminator_vals, "Unknown (%u)"));
5473 pd_tree = proto_item_add_subtree(oct_1_item, ett_dtap_oct_1);
5477 proto_tree_add_item(pd_tree, hf_gsm_a_skip_ind, tvb, 0, 1, FALSE);
5481 other_decode_bitfield_value(a_bigbuf, oct_1, 0x80, 8);
5482 proto_tree_add_text(pd_tree,
5486 ((oct_1 & 0x80) ? "allocated by receiver" : "allocated by sender"));
5488 if ((ti & DTAP_TIE_PRES_MASK) == DTAP_TIE_PRES_MASK)
5490 /* ti is extended to next octet */
5492 other_decode_bitfield_value(a_bigbuf, oct_1, 0x70, 8);
5493 proto_tree_add_text(pd_tree,
5495 "%s : TIO: The TI value is given by the TIE in octet 2",
5500 other_decode_bitfield_value(a_bigbuf, oct_1, 0x70, 8);
5501 proto_tree_add_text(pd_tree,
5505 ti & DTAP_TIE_PRES_MASK);
5509 proto_tree_add_item(pd_tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, FALSE);
5512 (ti & DTAP_TIE_PRES_MASK) == DTAP_TIE_PRES_MASK)
5514 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, 1, 1, FALSE);
5516 other_decode_bitfield_value(a_bigbuf, oct_2, DTAP_TIE_MASK, 8);
5517 proto_tree_add_text(pd_tree,
5521 oct_2 & DTAP_TIE_MASK);
5527 if ((pinfo->p2p_dir == P2P_DIR_RECV) &&
5532 /* In case of Mobility Management and Call Control and Call related SS messages
5533 * bit 7 and 8 is sequence number
5535 if((pd==5)||(pd==3)){
5536 proto_tree_add_item(dtap_tree, hf_gsm_a_seq_no, tvb, offset, 1, FALSE);
5539 * add DTAP message name
5541 proto_tree_add_item(dtap_tree, hf_idx, tvb, offset, 1, FALSE);
5544 tap_p->pdu_type = GSM_A_PDU_TYPE_DTAP;
5545 tap_p->message_type = (nsd ? (oct & 0x3f) : oct);
5546 tap_p->protocol_disc = pd;
5548 tap_queue_packet(gsm_a_tap, pinfo, tap_p);
5550 if (msg_str == NULL) return;
5552 if ((len - offset) <= 0) return;
5557 if (msg_fcn == NULL)
5559 proto_tree_add_text(dtap_tree,
5560 tvb, offset, len - offset,
5561 "Message Elements");
5565 (*msg_fcn)(tvb, dtap_tree, offset, len - offset);
5570 /* Register the protocol with Wireshark */
5572 proto_register_gsm_a_dtap(void)
5577 /* Setup list of header fields */
5579 static hf_register_info hf[] =
5582 { "Sequence number", "gsm_a.dtap_seq_no",
5583 FT_UINT8, BASE_DEC, NULL, 0xc0,
5586 { &hf_gsm_a_dtap_msg_mm_type,
5587 { "DTAP Mobility Management Message Type", "gsm_a.dtap_msg_mm_type",
5588 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_mm_strings), 0x3f,
5591 { &hf_gsm_a_dtap_msg_cc_type,
5592 { "DTAP Call Control Message Type", "gsm_a.dtap_msg_cc_type",
5593 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_cc_strings), 0x3f,
5596 { &hf_gsm_a_dtap_msg_sms_type,
5597 { "DTAP Short Message Service Message Type", "gsm_a.dtap_msg_sms_type",
5598 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_sms_strings), 0x0,
5601 { &hf_gsm_a_dtap_msg_ss_type,
5602 { "DTAP Non call Supplementary Service Message Type", "gsm_a.dtap_msg_ss_type",
5603 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_ss_strings), 0x0,
5606 { &hf_gsm_a_dtap_msg_tp_type,
5607 { "DTAP Tests Procedures Message Type", "gsm_a.dtap_msg_tp_type",
5608 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_tp_strings), 0x0,
5611 { &hf_gsm_a_dtap_elem_id,
5612 { "Element ID", "gsm_a_dtap.elem_id",
5613 FT_UINT8, BASE_DEC, NULL, 0,
5616 { &hf_gsm_a_cld_party_bcd_num,
5617 { "Called Party BCD Number", "gsm_a.cld_party_bcd_num",
5618 FT_STRING, BASE_DEC, 0, 0,
5621 { &hf_gsm_a_clg_party_bcd_num,
5622 { "Calling Party BCD Number", "gsm_a.clg_party_bcd_num",
5623 FT_STRING, BASE_DEC, 0, 0,
5626 { &hf_gsm_a_dtap_cause,
5627 { "DTAP Cause", "gsm_a_dtap.cause",
5628 FT_UINT8, BASE_HEX, 0, 0x0,
5631 { &hf_gsm_a_extension,
5632 { "Extension", "gsm_a.extension",
5633 FT_BOOLEAN, 8, TFS(&gsm_a_extension_value), 0x80,
5634 "Extension", HFILL }
5636 { &hf_gsm_a_type_of_number,
5637 { "Type of number", "gsm_a.type_of_number",
5638 FT_UINT8, BASE_HEX, VALS(gsm_a_type_of_number_values), 0x70,
5639 "Type of number", HFILL }
5641 { &hf_gsm_a_numbering_plan_id,
5642 { "Numbering plan identification", "gsm_a.numbering_plan_id",
5643 FT_UINT8, BASE_HEX, VALS(gsm_a_numbering_plan_id_values), 0x0f,
5644 "Numbering plan identification", HFILL }
5647 { "LSA Identifier", "gsm_a.lsa_id",
5648 FT_UINT24, BASE_HEX, NULL, 0x0,
5649 "LSA Identifier", HFILL }
5653 /* Setup protocol subtree array */
5654 #define NUM_INDIVIDUAL_ELEMS 18
5655 static gint *ett[NUM_INDIVIDUAL_ELEMS +
5656 NUM_GSM_DTAP_MSG_MM + NUM_GSM_DTAP_MSG_CC +
5657 NUM_GSM_DTAP_MSG_SMS + NUM_GSM_DTAP_MSG_SS + NUM_GSM_DTAP_MSG_TP +
5660 ett[0] = &ett_dtap_msg;
5661 ett[1] = &ett_dtap_oct_1;
5662 ett[2] = &ett_cm_srvc_type;
5663 ett[3] = &ett_gsm_enc_info;
5664 ett[4] = &ett_bc_oct_3a;
5665 ett[5] = &ett_bc_oct_4;
5666 ett[6] = &ett_bc_oct_5;
5667 ett[7] = &ett_bc_oct_5a;
5668 ett[8] = &ett_bc_oct_5b;
5669 ett[9] = &ett_bc_oct_6;
5670 ett[10] = &ett_bc_oct_6a;
5671 ett[11] = &ett_bc_oct_6b;
5672 ett[12] = &ett_bc_oct_6c;
5673 ett[13] = &ett_bc_oct_6d;
5674 ett[14] = &ett_bc_oct_6e;
5675 ett[15] = &ett_bc_oct_6f;
5676 ett[16] = &ett_bc_oct_6g;
5677 ett[17] = &ett_bc_oct_7;
5679 last_offset = NUM_INDIVIDUAL_ELEMS;
5681 for (i=0; i < NUM_GSM_DTAP_MSG_MM; i++, last_offset++)
5683 ett_gsm_dtap_msg_mm[i] = -1;
5684 ett[last_offset] = &ett_gsm_dtap_msg_mm[i];
5687 for (i=0; i < NUM_GSM_DTAP_MSG_CC; i++, last_offset++)
5689 ett_gsm_dtap_msg_cc[i] = -1;
5690 ett[last_offset] = &ett_gsm_dtap_msg_cc[i];
5693 for (i=0; i < NUM_GSM_DTAP_MSG_SMS; i++, last_offset++)
5695 ett_gsm_dtap_msg_sms[i] = -1;
5696 ett[last_offset] = &ett_gsm_dtap_msg_sms[i];
5699 for (i=0; i < NUM_GSM_DTAP_MSG_SS; i++, last_offset++)
5701 ett_gsm_dtap_msg_ss[i] = -1;
5702 ett[last_offset] = &ett_gsm_dtap_msg_ss[i];
5705 for (i=0; i < NUM_GSM_DTAP_MSG_TP; i++, last_offset++)
5707 ett_gsm_dtap_msg_tp[i] = -1;
5708 ett[last_offset] = &ett_gsm_dtap_msg_tp[i];
5711 for (i=0; i < NUM_GSM_DTAP_ELEM; i++, last_offset++)
5713 ett_gsm_dtap_elem[i] = -1;
5714 ett[last_offset] = &ett_gsm_dtap_elem[i];
5717 /* Register the protocol name and description */
5720 proto_register_protocol("GSM A-I/F DTAP", "GSM DTAP", "gsm_a_dtap");
5722 proto_register_field_array(proto_a_dtap, hf, array_length(hf));
5724 proto_register_subtree_array(ett, array_length(ett));
5726 /* subdissector code */
5727 register_dissector("gsm_a_dtap", dissect_dtap, proto_a_dtap);
5731 proto_reg_handoff_gsm_a_dtap(void)
5733 dissector_handle_t dtap_handle;
5735 dtap_handle = find_dissector("gsm_a_dtap");
5736 dissector_add("bssap.pdu_type", BSSAP_PDU_TYPE_DTAP, dtap_handle);
5737 dissector_add("ranap.nas_pdu", BSSAP_PDU_TYPE_DTAP, dtap_handle);
5738 dissector_add("llcgprs.sapi", 1 , dtap_handle); /* GPRS Mobility Management */
5739 dissector_add("llcgprs.sapi", 7 , dtap_handle); /* SMS */
5741 data_handle = find_dissector("data");
5742 gsm_map_handle = find_dissector("gsm_map");
5743 rp_handle = find_dissector("gsm_a_rp");