2 * Routines for GSM A Interface GPRS Mobilty Management and GPRS Session Management
4 * Copyright 2003, Michael Lum <mlum [AT] telostech.com>
5 * In association with Telos Technology Inc.
7 * Added the GPRS Mobility Managment Protocol and
8 * the GPRS Session Managment Protocol
9 * Copyright 2004, Rene Pilz <rene.pilz [AT] ftw.com>
10 * In association with Telecommunications Research Center
11 * Vienna (ftw.)Betriebs-GmbH within the Project Metawin.
16 * Mobile radio interface Layer 3 specification;
17 * Core network protocols;
19 * (3GPP TS 24.008 version 5.9.0 Release 5)
22 * Mobile radio interface Layer 3 specification;
23 * Core network protocols;
25 * (3GPP TS 24.008 version 6.7.0 Release 6)
26 * (3GPP TS 24.008 version 6.8.0 Release 6)
30 * Wireshark - Network traffic analyzer
31 * By Gerald Combs <gerald@wireshark.org>
32 * Copyright 1998 Gerald Combs
34 * This program is free software; you can redistribute it and/or
35 * modify it under the terms of the GNU General Public License
36 * as published by the Free Software Foundation; either version 2
37 * of the License, or (at your option) any later version.
39 * This program is distributed in the hope that it will be useful,
40 * but WITHOUT ANY WARRANTY; without even the implied warranty of
41 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 * GNU General Public License for more details.
44 * You should have received a copy of the GNU General Public License
45 * along with this program; if not, write to the Free Software
46 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
58 #include <epan/packet.h>
59 #include <epan/prefs.h>
61 #include <epan/asn1.h>
63 #include "packet-bssap.h"
64 #include "packet-sccp.h"
65 #include "packet-ber.h"
66 #include "packet-q931.h"
67 #include "packet-gsm_a_common.h"
68 #include "packet-ipv6.h"
69 #include "packet-e212.h"
70 #include "packet-ppp.h"
72 /* PROTOTYPES/FORWARDS */
74 const value_string gsm_a_dtap_msg_gmm_strings[] = {
75 { 0x01, "Attach Request" },
76 { 0x02, "Attach Accept" },
77 { 0x03, "Attach Complete" },
78 { 0x04, "Attach Reject" },
79 { 0x05, "Detach Request" },
80 { 0x06, "Detach Accept" },
81 { 0x08, "Routing Area Update Request" },
82 { 0x09, "Routing Area Update Accept" },
83 { 0x0a, "Routing Area Update Complete" },
84 { 0x0b, "Routing Area Update Reject" },
85 { 0x0c, "Service Request" },
86 { 0x0d, "Service Accept" },
87 { 0x0e, "Service Reject" },
88 { 0x10, "P-TMSI Reallocation Command" },
89 { 0x11, "P-TMSI Reallocation Complete" },
90 { 0x12, "Authentication and Ciphering Req" },
91 { 0x13, "Authentication and Ciphering Resp" },
92 { 0x14, "Authentication and Ciphering Rej" },
93 { 0x1c, "Authentication and Ciphering Failure" },
94 { 0x15, "Identity Request" },
95 { 0x16, "Identity Response" },
96 { 0x20, "GMM Status" },
97 { 0x21, "GMM Information" },
101 const value_string gsm_a_dtap_msg_sm_strings[] = {
102 { 0x41, "Activate PDP Context Request" },
103 { 0x42, "Activate PDP Context Accept" },
104 { 0x43, "Activate PDP Context Reject" },
105 { 0x44, "Request PDP Context Activation" },
106 { 0x45, "Request PDP Context Activation rej." },
107 { 0x46, "Deactivate PDP Context Request" },
108 { 0x47, "Deactivate PDP Context Accept" },
109 { 0x48, "Modify PDP Context Request(Network to MS direction)" },
110 { 0x49, "Modify PDP Context Accept (MS to network direction)" },
111 { 0x4a, "Modify PDP Context Request(MS to network direction)" },
112 { 0x4b, "Modify PDP Context Accept (Network to MS direction)" },
113 { 0x4c, "Modify PDP Context Reject" },
114 { 0x4d, "Activate Secondary PDP Context Request" },
115 { 0x4e, "Activate Secondary PDP Context Accept" },
116 { 0x4f, "Activate Secondary PDP Context Reject" },
117 { 0x50, "Reserved: was allocated in earlier phases of the protocol" },
118 { 0x51, "Reserved: was allocated in earlier phases of the protocol" },
119 { 0x52, "Reserved: was allocated in earlier phases of the protocol" },
120 { 0x53, "Reserved: was allocated in earlier phases of the protocol" },
121 { 0x54, "Reserved: was allocated in earlier phases of the protocol" },
122 { 0x55, "SM Status" },
123 { 0x56, "Activate MBMS Context Request" },
124 { 0x57, "Activate MBMS Context Accept" },
125 { 0x58, "Activate MBMS Context Reject" },
126 { 0x59, "Request MBMS Context Activation" },
127 { 0x5a, "Request MBMS Context Activation Reject" },
131 const value_string gsm_gm_elem_strings[] = {
132 /* GPRS Mobility Management Information Elements 10.5.5 */
133 { 0x00, "Attach Result" },
134 { 0x00, "Attach Type" },
135 { 0x00, "Cipher Algorithm" },
136 { 0x00, "TMSI Status" },
137 { 0x00, "Detach Type" },
138 { 0x00, "DRX Parameter" },
139 { 0x00, "Force to Standby" },
140 { 0x00, "Force to Standby" },
141 { 0x00, "P-TMSI Signature" },
142 { 0x00, "P-TMSI Signature 2" },
143 { 0x00, "Identity Type 2" },
144 { 0x00, "IMEISV Request" },
145 { 0x00, "Receive N-PDU Numbers List" },
146 { 0x00, "MS Network Capability" },
147 { 0x00, "MS Radio Access Capability" },
148 { 0x00, "GMM Cause" },
149 { 0x00, "Routing Area Identification" },
150 { 0x00, "Update Result" },
151 { 0x00, "Update Type" },
152 { 0x00, "A&C Reference Number" },
153 { 0x00, "A&C Reference Number" },
154 { 0x00, "Service Type" },
155 { 0x00, "Cell Notification" },
156 { 0x00, "PS LCS Capability" },
157 { 0x00, "Network Feature Support" },
158 { 0x00, "Inter RAT information container" },
159 /* Session Management Information Elements 10.5.6 */
160 { 0x00, "Access Point Name" },
161 { 0x00, "Network Service Access Point Identifier" },
162 { 0x00, "Protocol Configuration Options" },
163 { 0x00, "Packet Data Protocol Address" },
164 { 0x00, "Quality Of Service" },
165 { 0x00, "SM Cause" },
166 { 0x00, "Linked TI" },
167 { 0x00, "LLC Service Access Point Identifier" },
168 { 0x00, "Tear Down Indicator" },
169 { 0x00, "Packet Flow Identifier" },
170 { 0x00, "Traffic Flow Template" },
171 /* GPRS Common Information Elements 10.5.7 */
172 { 0x00, "PDP Context Status" },
173 { 0x00, "Radio Priority" },
174 { 0x00, "GPRS Timer" },
175 { 0x00, "GPRS Timer 2" },
176 { 0x00, "Radio Priority 2"},
177 { 0x00, "MBMS context status"},
178 { 0x00, "Spare Nibble"},
182 #define DTAP_GMM_IEI_MASK 0xff
183 #define DTAP_SM_IEI_MASK 0xff
185 /* Initialize the protocol and registered fields */
186 static int proto_a_gm = -1;
188 static int hf_gsm_a_dtap_msg_gmm_type = -1;
189 static int hf_gsm_a_dtap_msg_sm_type = -1;
190 int hf_gsm_a_gm_elem_id = -1;
191 static int hf_gsm_a_qos_delay_cls = -1;
192 static int hf_gsm_a_qos_qos_reliability_cls = -1;
193 static int hf_gsm_a_qos_traffic_cls = -1;
194 static int hf_gsm_a_qos_del_order = -1;
195 static int hf_gsm_a_qos_del_of_err_sdu = -1;
196 static int hf_gsm_a_qos_ber = -1;
197 static int hf_gsm_a_qos_sdu_err_rat = -1;
198 static int hf_gsm_a_qos_traff_hdl_pri = -1;
200 static int hf_gsm_a_gmm_split_on_ccch = -1;
201 static int hf_gsm_a_gmm_non_drx_timer = -1;
202 static int hf_gsm_a_gmm_cn_spec_drs_cycle_len_coef = -1;
204 static int hf_gsm_a_ptmsi_sig =-1;
205 static int hf_gsm_a_ptmsi_sig2 =-1;
207 static int hf_gsm_a_tft_op_code = -1;
208 static int hf_gsm_a_tft_e_bit = -1;
209 static int hf_gsm_a_tft_pkt_flt = -1;
210 static int hf_gsm_a_tft_ip4_address = -1;
211 static int hf_gsm_a_tft_ip4_mask = -1;
212 static int hf_gsm_a_tft_ip6_address = -1;
213 static int hf_gsm_a_tft_ip6_mask = -1;
214 static int hf_gsm_a_tft_protocol_header = -1;
215 static int hf_gsm_a_tft_port = -1;
216 static int hf_gsm_a_tft_port_low = -1;
217 static int hf_gsm_a_tft_port_high = -1;
218 static int hf_gsm_a_tft_security = -1;
219 static int hf_gsm_a_tft_traffic_mask = -1;
220 static int hf_gsm_a_gm_acc_tech_type = -1;
221 static int hf_gsm_a_gm_acc_cap_struct_len = -1;
222 static int hf_gsm_a_gm_sms_value = -1;
223 static int hf_gsm_a_gm_sm_value = -1;
224 static int hf_gsm_a_gm_sm_ext = -1;
226 /* Initialize the subtree pointers */
227 static gint ett_tc_component = -1;
228 static gint ett_tc_invoke_id = -1;
229 static gint ett_tc_linked_id = -1;
230 static gint ett_tc_opr_code = -1;
231 static gint ett_tc_err_code = -1;
232 static gint ett_tc_prob_code = -1;
233 static gint ett_tc_sequence = -1;
235 static gint ett_gmm_drx = -1;
236 static gint ett_gmm_detach_type = -1;
237 static gint ett_gmm_attach_type = -1;
238 static gint ett_gmm_context_stat = -1;
239 static gint ett_gmm_update_type = -1;
240 static gint ett_gmm_radio_cap = -1;
241 static gint ett_gmm_rai = -1;
243 static gint ett_sm_tft = -1;
245 static dissector_handle_t data_handle;
246 static dissector_handle_t rrc_irat_ho_info_handle;
248 static dissector_table_t gprs_sm_pco_subdissector_table; /* GPRS SM PCO PPP Protocols */
250 #define NUM_GSM_GM_ELEM (sizeof(gsm_gm_elem_strings)/sizeof(value_string))
251 gint ett_gsm_gm_elem[NUM_GSM_GM_ELEM];
253 const gchar pdp_str[2][20]={ "PDP-INACTIVE", "PDP-ACTIVE" };
259 de_gmm_attach_res(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
265 curr_offset = offset;
267 oct = tvb_get_guint8(tvb, curr_offset);
271 case 1: str="GPRS only attached"; break;
272 case 3: str="Combined GPRS/IMSI attached"; break;
273 default: str="reserved";
276 proto_tree_add_text(tree,
278 "Attach Result: (%u) %s",
284 /* no length check possible */
286 return(curr_offset - offset);
293 de_gmm_attach_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
298 const gchar *str_follow;
299 const gchar *str_attach;
300 proto_item *tf = NULL;
301 proto_tree *tf_tree = NULL;
303 curr_offset = offset;
305 oct = tvb_get_guint8(tvb, curr_offset);
312 case 1: str_attach="GPRS attach"; break;
313 case 2: str_attach="GPRS attach while IMSI attached"; break;
314 case 3: str_attach="Combined GPRS/IMSI attach"; break;
315 default: str_attach="reserved";
319 case 8: str_follow="Follow-on request pending"; break;
320 default: str_follow="No follow-on request pending";
323 tf = proto_tree_add_text(tree,
327 tf_tree = proto_item_add_subtree(tf, ett_gmm_attach_type );
329 proto_tree_add_text(tf_tree,
334 proto_tree_add_text(tf_tree,
340 /* The ciphering key sequence number is added here */
341 proto_tree_add_text(tree,
343 "Ciphering key sequence number: 0x%02x (%u)",
349 /* no length check possible */
351 return(curr_offset - offset);
358 de_gmm_ciph_alg(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
364 curr_offset = offset;
366 oct = tvb_get_guint8(tvb, curr_offset);
370 case 0: str="ciphering not used"; break;
371 case 1: str="GPRS Encryption Algorithm GEA/1"; break;
372 case 2: str="GPRS Encryption Algorithm GEA/2"; break;
373 case 3: str="GPRS Encryption Algorithm GEA/3"; break;
374 case 4: str="GPRS Encryption Algorithm GEA/4"; break;
375 case 5: str="GPRS Encryption Algorithm GEA/5"; break;
376 case 6: str="GPRS Encryption Algorithm GEA/6"; break;
377 case 7: str="GPRS Encryption Algorithm GEA/7"; break;
378 default: str="This should never happen";
381 proto_tree_add_text(tree,
383 "Ciphering Algorithm: (%u) %s",
389 /* no length check possible */
391 return(curr_offset - offset);
398 de_gmm_tmsi_stat(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
404 curr_offset = offset;
406 oct = tvb_get_guint8(tvb, curr_offset);
410 case 0: str="no valid TMSI available"; break;
411 case 1: str="valid TMSI available"; break;
412 default: str="This should never happen";
415 proto_tree_add_text(tree,
417 "TMSI Status: (%u) %s",
423 /* no length check possible */
425 return(curr_offset - offset);
432 de_gmm_detach_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
437 const gchar *str_power;
438 proto_item *tf = NULL;
439 proto_tree *tf_tree = NULL;
441 curr_offset = offset;
443 oct = tvb_get_guint8(tvb, curr_offset);
447 case 1: str="GPRS detach/re-attach required"; break;
448 case 2: str="IMSI detach/re-attach not required"; break;
449 case 3: str="Combined GPRS/IMSI detach/IMSI detach (after VLR failure)"; break;
450 default: str="Combined GPRS/IMSI detach/re-attach not required";
455 case 8: str_power="power switched off"; break;
456 default: str_power="normal detach"; break;
459 tf = proto_tree_add_text(tree,
463 tf_tree = proto_item_add_subtree(tf, ett_gmm_detach_type );
465 proto_tree_add_text(tf_tree,
471 proto_tree_add_text(tf_tree,
479 /* no length check possible */
481 return(curr_offset - offset);
487 * SPLIT on CCCH, octet 3 (bit 4)
488 * 0 Split pg cycle on CCCH is not supported by the mobile station
489 * 1 Split pg cycle on CCCH is supported by the mobile station
491 static const true_false_string gsm_a_gmm_split_on_ccch_value = {
492 "Split pg cycle on CCCH is supported by the mobile station",
493 "Split pg cycle on CCCH is not supported by the mobile station"
496 /* non-DRX timer, octet 3
500 static const value_string gsm_a_gmm_non_drx_timer_strings[] = {
501 { 0x00, "no non-DRX mode after transfer state" },
502 { 0x01, "max. 1 sec non-DRX mode after transfer state" },
503 { 0x02, "max. 2 sec non-DRX mode after transfer state" },
504 { 0x03, "max. 4 sec non-DRX mode after transfer state" },
505 { 0x04, "max. 8 sec non-DRX mode after transfer state" },
506 { 0x05, "max. 16 sec non-DRX mode after transfer state" },
507 { 0x06, "max. 32 sec non-DRX mode after transfer state" },
508 { 0x07, "max. 64 sec non-DRX mode after transfer state" },
512 * CN Specific DRX cycle length coefficient, octet 3
514 * 8 7 6 5 Iu mode specific
515 * 0 0 0 0 CN Specific DRX cycle length coefficient not specified by the MS, ie. the
516 * system information value 'CN domain specific DRX cycle length' is used.
517 * (Ref 3GPP TS 25.331)
518 * 0 1 1 0 CN Specific DRX cycle length coefficient 6
519 * 0 1 1 1 CN Specific DRX cycle length coefficient 7
520 * 1 0 0 0 CN Specific DRX cycle length coefficient 8
521 * 1 0 0 1 CN Specific DRX cycle length coefficient 9
522 * All other values shall be interpreted as "CN Specific DRX cycle length coefficient not
523 * specified by the MS " by this version of the protocol.
524 * NOTE: In Iu mode this field (octet 3 bits 8 to 5) is used, but was spare in earlier
525 * versions of this protocol.
527 static const value_string gsm_a_gmm_cn_spec_drs_cycle_len_coef_strings[] = {
528 { 0x00, "CN Specific DRX cycle length coefficient not specified by the MS" },
529 { 0x01, "CN Specific DRX cycle length coefficient not specified by the MS" },
530 { 0x02, "CN Specific DRX cycle length coefficient not specified by the MS" },
531 { 0x03, "CN Specific DRX cycle length coefficient not specified by the MS" },
532 { 0x04, "CN Specific DRX cycle length coefficient not specified by the MS" },
533 { 0x05, "CN Specific DRX cycle length coefficient not specified by the MS" },
534 { 0x06, "CN Specific DRX cycle length coefficient 6" },
535 { 0x07, "CN Specific DRX cycle length coefficient 7" },
536 { 0x08, "CN Specific DRX cycle length coefficient 8" },
537 { 0x09, "CN Specific DRX cycle length coefficient 9" },
538 { 0x0a, "CN Specific DRX cycle length coefficient not specified by the MS" },
539 { 0x0b, "CN Specific DRX cycle length coefficient not specified by the MS" },
540 { 0x0c, "CN Specific DRX cycle length coefficient not specified by the MS" },
541 { 0x0d, "CN Specific DRX cycle length coefficient not specified by the MS" },
542 { 0x0e, "CN Specific DRX cycle length coefficient not specified by the MS" },
543 { 0x0f, "CN Specific DRX cycle length coefficient not specified by the MS" },
547 de_gmm_drx_param(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
553 proto_item *tf = NULL;
554 proto_tree *tf_tree = NULL;
556 curr_offset = offset;
558 tf = proto_tree_add_text(tree,
562 tf_tree = proto_item_add_subtree(tf, ett_gmm_drx );
564 oct = tvb_get_guint8(tvb, curr_offset);
568 case 0: str="704"; break;
569 case 65: str="71"; break;
570 case 66: str="72"; break;
571 case 67: str="74"; break;
572 case 68: str="75"; break;
573 case 69: str="77"; break;
574 case 70: str="79"; break;
575 case 71: str="80"; break;
576 case 72: str="83"; break;
577 case 73: str="86"; break;
578 case 74: str="88"; break;
579 case 75: str="90"; break;
580 case 76: str="92"; break;
581 case 77: str="96"; break;
582 case 78: str="101"; break;
583 case 79: str="103"; break;
584 case 80: str="107"; break;
585 case 81: str="112"; break;
586 case 82: str="116"; break;
587 case 83: str="118"; break;
588 case 84: str="128"; break;
589 case 85: str="141"; break;
590 case 86: str="144"; break;
591 case 87: str="150"; break;
592 case 88: str="160"; break;
593 case 89: str="171"; break;
594 case 90: str="176"; break;
595 case 91: str="192"; break;
596 case 92: str="214"; break;
597 case 93: str="224"; break;
598 case 94: str="235"; break;
599 case 95: str="256"; break;
600 case 96: str="288"; break;
601 case 97: str="320"; break;
602 case 98: str="352"; break;
604 str_val[0]=oct/10+'0';
605 str_val[1]=oct%10+'0';
610 proto_tree_add_text(tf_tree,
612 "Split PG Cycle Code: (%u) %s",
617 proto_tree_add_item(tf_tree, hf_gsm_a_gmm_cn_spec_drs_cycle_len_coef, tvb, curr_offset, 1, FALSE);
618 proto_tree_add_item(tf_tree, hf_gsm_a_gmm_split_on_ccch, tvb, curr_offset, 1, FALSE);
619 proto_tree_add_item(tf_tree, hf_gsm_a_gmm_non_drx_timer, tvb, curr_offset, 1, FALSE);
623 /* no length check possible */
625 return(curr_offset - offset);
632 de_gmm_ftostby(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
638 curr_offset = offset;
640 oct = tvb_get_guint8(tvb, curr_offset);
644 case 1: str="Force to standby indicated"; break;
645 default: str="force to standby not indicated";
648 proto_tree_add_text(tree,
650 "Force to Standby: (%u) %s",
656 /* no length check possible */
658 return(curr_offset - offset);
665 de_gmm_ftostby_h(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
671 curr_offset = offset;
673 oct = tvb_get_guint8(tvb, curr_offset);
675 /* IMPORTANT - IT'S ASSUMED THAT THE INFORMATION IS IN THE HIGHER NIBBLE */
680 case 1: str="Force to standby indicated"; break;
681 default: str="force to standby not indicated";
684 proto_tree_add_text(tree,
686 "Force to Standby: (%u) %s",
692 /* no length check possible */
694 return(curr_offset - offset);
701 de_gmm_ptmsi_sig(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
704 proto_item *curr_item;
706 curr_offset = offset;
708 curr_item= proto_tree_add_item(tree,hf_gsm_a_ptmsi_sig,tvb,curr_offset,3,FALSE);
709 proto_item_append_text(curr_item,"%s",add_string ? add_string : "");
713 /* no length check possible */
715 return(curr_offset - offset);
722 de_gmm_ptmsi_sig2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len _U_)
725 proto_item *curr_item;
727 curr_offset = offset;
729 curr_item= proto_tree_add_item(tree,hf_gsm_a_ptmsi_sig2,tvb,curr_offset,3,FALSE);
730 proto_item_append_text(curr_item,"%s",add_string ? add_string : "");
733 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
735 return(curr_offset - offset);
742 de_gmm_ident_type2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
748 curr_offset = offset;
750 oct = tvb_get_guint8(tvb, curr_offset);
754 case 2: str="IMEI"; break;
755 case 3: str="IMEISV"; break;
756 case 4: str="TMSI"; break;
760 proto_tree_add_text(tree,
762 "Identity Type 2: (%u) %s",
768 /* no length check possible */
770 return(curr_offset - offset);
777 de_gmm_imeisv_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
783 curr_offset = offset;
785 oct = tvb_get_guint8(tvb, curr_offset);
787 /* IMPORTANT - IT'S ASSUMED THAT THE INFORMATION IS IN THE HIGHER NIBBLE */
792 case 1: str="IMEISV requested"; break;
793 default: str="IMEISV not requested";
796 proto_tree_add_text(tree,
798 "IMEISV Request: (%u) %s",
804 /* no length check possible */
806 return(curr_offset - offset);
813 de_gmm_rec_npdu_lst(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
819 curr_offset = offset;
821 if ( len == 0 ) return 0;
826 oct = tvb_get_guint8(tvb, curr_offset);
828 oct |= tvb_get_guint8(tvb, curr_offset+1);
832 proto_tree_add_text(tree,
834 "NSAPI %d: 0x%02x (%u)",
842 oct |= tvb_get_guint8(tvb, curr_offset+2);
846 proto_tree_add_text(tree,
847 tvb, curr_offset-1, 2,
848 "NSAPI %d: 0x%02x (%u)",
855 } while ( curr_len > 1 );
857 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
859 return(curr_offset - offset);
866 de_gmm_ms_net_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
873 gchar answer_gea[2][40]={ "encryption algorithm not available",
874 "encryption algorithm available" };
875 gchar answer_smdch[2][120]={ "Mobile station does not support mobile terminated point to point SMS via dedicated signalling channels",
876 "Mobile station supports mobile terminated point to point SMS via dedicated signalling channels" };
877 gchar answer_smgprs[2][100]={ "Mobile station does not support mobile terminated point to point SMS via GPRS packet data channels",
878 "Mobile station supports mobile terminated point to point SMS via GPRS packet data channels" };
879 gchar answer_ucs2[2][100]={ "the ME has a preference for the default alphabet (defined in 3GPP TS 23.038 [8b]) over UCS2",
880 "the ME has no preference between the use of the default alphabet and the use of UCS2" };
882 gchar answer_ssid[4][80]={ "default value of phase 1",
883 "capability of handling of ellipsis notation and phase 2 error handling",
884 "capability of handling of ellipsis notation and phase 2 error handling",
885 "capability of handling of ellipsis notation and phase 2 error handling" };
887 gchar answer_solsa[2][40]={ "The ME does not support SoLSA",
888 "The ME supports SoLSA" };
890 gchar answer_rev[2][80]={ "used by a mobile station not supporting R99 or later versions of the protocol",
891 "used by a mobile station supporting R99 or later versions of the protocol" };
893 gchar answer_pfc[2][80]={ "Mobile station does not support BSS packet flow procedures",
894 "Mobile station does support BSS packet flow procedures" };
896 gchar answer_lcs[2][80]={ "LCS value added location request notification capability not supported" ,
897 "LCS value added location request notification capability supported" };
899 gchar answer_ps_irat[2][80]={ "PS inter-RAT HO to UTRAN Iu mode not supported" ,
900 "PS inter-RAT HO to UTRAN Iu mode supported" };
903 curr_offset = offset;
905 if ( curr_len == 0 ){ EXTRANEOUS_DATA_CHECK(len, curr_offset - offset); return(curr_offset - offset); }
906 oct = tvb_get_guint8(tvb, curr_offset);
910 proto_tree_add_text(tree,
918 proto_tree_add_text(tree,
920 "SM capabilities via dedicated channels: (%u) %s",
922 answer_smdch[oct>>7]);
926 proto_tree_add_text(tree,
928 "SM capabilities via GPRS channels: (%u) %s",
930 answer_smgprs[oct>>7]);
934 proto_tree_add_text(tree,
936 "UCS2 support: (%u) %s",
938 answer_ucs2[oct>>7]);
942 proto_tree_add_text(tree,
944 "SS Screening Indicator: (%u) %s",
946 answer_ssid[oct>>6]);
950 proto_tree_add_text(tree,
952 "SoLSA Capability: (%u) %s",
954 answer_solsa[oct>>7]);
958 proto_tree_add_text(tree,
960 "Revision level indicator: (%u) %s",
966 if ( curr_len == 0 ){ EXTRANEOUS_DATA_CHECK(len, curr_offset - offset); return(curr_offset - offset); }
967 oct = tvb_get_guint8(tvb, curr_offset);
970 proto_tree_add_text(tree,
972 "PFC feature mode: (%u) %s",
977 for( gea_val=2; gea_val<8 ; gea_val++ )
979 proto_tree_add_text(tree,
981 "GEA%d: (%u) %s", gea_val,
987 proto_tree_add_text(tree,
989 "LCS VA capability: (%u) %s",
995 if ( curr_len == 0 ){ EXTRANEOUS_DATA_CHECK(len, curr_offset - offset); return(curr_offset - offset); }
996 oct = tvb_get_guint8(tvb, curr_offset);
999 proto_tree_add_text(tree,
1000 tvb, curr_offset, 1,
1001 "PS inter-RAT HO to UTRAN Iu mode capability: (%u) %s",
1002 oct & 0x1, /* XXX: There's only 2 entries in the ..._irat array */
1003 answer_ps_irat[oct & 0x1]); /* so we'll assume that this is a 1 bit value. */
1006 proto_tree_add_text(tree,
1007 tvb, curr_offset, 1,
1012 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
1014 return(curr_offset - offset);
1020 #define GET_DATA /* check if we have enough bits left */ \
1021 if ( curr_bits_length < bits_needed ) \
1023 /* check if oct has enougth bits */ \
1024 if ( bits_in_oct < bits_needed ) \
1027 if ( curr_len == 0 ) \
1029 proto_tree_add_text(tf_tree, \
1030 tvb, curr_offset, 1, \
1031 "Not enough data available"); \
1033 tmp_oct = tvb_get_guint8(tvb, curr_offset); \
1034 oct |= tmp_oct<<(32-8-bits_in_oct); \
1037 if ( bits_in_oct != 0 ) \
1046 /* Access Technology Type */
1048 static const value_string gsm_a_gm_acc_tech_type_vals[] = {
1050 { 0x01, "GSM E --note that GSM E covers GSM P" },
1051 { 0x02, "GSM R --note that GSM R covers GSM E and GSM P" },
1052 { 0x03, "GSM 1800" },
1053 { 0x04, "GSM 1900" },
1054 { 0x05, "GSM 450" },
1055 { 0x06, "GSM 480" },
1056 { 0x07, "GSM 850" },
1057 { 0x08, "GSM 750" },
1058 { 0x09, "GSM T 380" },
1059 { 0x0a, "GSM T 410" },
1060 { 0x0b, "GSM T 900" },
1061 { 0x0c, "GSM 710" },
1062 { 0x0d, "GSM T 810" },
1063 { 0x0f, "Indicates the presence of a list of Additional access technologies" },
1067 /* SMS_VALUE (Switch-Measure-Switch) (4 bit field) */
1069 static const value_string gsm_a_gm_sm_vals[] = {
1070 { 0x00, "1/4 timeslot (~144 microseconds)" },
1071 { 0x01, "2/4 timeslot (~288 microseconds)" },
1072 { 0x02, "3/4 timeslot (~433 microseconds)" },
1073 { 0x03, "4/4 timeslot (~577 microseconds)" },
1074 { 0x04, "5/4 timeslot (~721 microseconds)" },
1075 { 0x05, "6/4 timeslot (~865 microseconds)" },
1076 { 0x06, "7/4 timeslot (~1009 microseconds)" },
1077 { 0x07, "8/4 timeslot (~1154 microseconds)" },
1078 { 0x08, "9/4 timeslot (~1297 microseconds)" },
1079 { 0x09, "10/4 timeslot (~1441 microseconds)" },
1080 { 0x0a, "11/4 timeslot (~1586 microseconds)" },
1081 { 0x0b, "12/4 timeslot (~1730 microseconds)" },
1082 { 0x0c, "13/4 timeslot (~1874 microseconds)" },
1083 { 0x0d, "14/4 timeslot (~2018 microseconds)" },
1084 { 0x0e, "15/4 timeslot (~2163 microseconds)" },
1085 { 0x0f, "16/4 timeslot (~2307 microseconds)" },
1089 de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1091 guint32 curr_offset;
1094 proto_item *tf = NULL;
1095 proto_tree *tf_tree = NULL;
1100 guint add_ocetets; /* octets which are covered by one element -1 */
1101 guint curr_bits_length;
1105 gchar multi_slot_str[64][230] = {
1106 "Not specified", /* 00 */
1107 "Max Rx-Slot/TDMA:1 Max Tx-Slot/TDMA:1 Max-Sum-Slot/TDMA:2 Tta:3 Ttb:2 Tra:4 Trb:2 Type:1", /* 01 */
1108 "Max Rx-Slot/TDMA:2 Max Tx-Slot/TDMA:1 Max-Sum-Slot/TDMA:3 Tta:3 Ttb:2 Tra:3 Trb:1 Type:1", /* 02 */
1109 "Max Rx-Slot/TDMA:2 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:3 Tta:3 Ttb:2 Tra:3 Trb:1 Type:1", /* 03 */
1110 "Max Rx-Slot/TDMA:3 Max Tx-Slot/TDMA:1 Max-Sum-Slot/TDMA:4 Tta:3 Ttb:1 Tra:3 Trb:1 Type:1", /* 04 */
1111 "Max Rx-Slot/TDMA:2 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:4 Tta:3 Ttb:1 Tra:3 Trb:1 Type:1", /* 05 */
1112 "Max Rx-Slot/TDMA:3 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:4 Tta:3 Ttb:1 Tra:3 Trb:1 Type:1", /* 06 */
1113 "Max Rx-Slot/TDMA:3 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:4 Tta:3 Ttb:1 Tra:3 Trb:1 Type:1", /* 07 */
1114 "Max Rx-Slot/TDMA:4 Max Tx-Slot/TDMA:1 Max-Sum-Slot/TDMA:5 Tta:3 Ttb:1 Tra:2 Trb:1 Type:1", /* 08 */
1115 "Max Rx-Slot/TDMA:3 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:5 Tta:3 Ttb:1 Tra:2 Trb:1 Type:1", /* 09 */
1116 "Max Rx-Slot/TDMA:4 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:5 Tta:3 Ttb:1 Tra:2 Trb:1 Type:1", /* 10 */
1117 "Max Rx-Slot/TDMA:4 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:5 Tta:3 Ttb:1 Tra:2 Trb:1 Type:1", /* 11 */
1118 "Max Rx-Slot/TDMA:4 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:5 Tta:2 Ttb:1 Tra:2 Trb:1 Type:1", /* 12 */
1119 "Max Rx-Slot/TDMA:3 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:NA Tta:NA Ttb:a) Tra:3 Trb:a) Type:2 (a: 1 with frequency hopping, 0 otherwise)", /* 13 */
1120 "Max Rx-Slot/TDMA:4 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:NA Tta:NA Ttb:a) Tra:3 Trb:a) Type:2 (a: 1 with frequency hopping, 0 otherwise)", /* 14 */
1121 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:5 Max-Sum-Slot/TDMA:NA Tta:NA Ttb:a) Tra:3 Trb:a) Type:2 (a: 1 with frequency hopping, 0 otherwise)", /* 15 */
1122 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:6 Max-Sum-Slot/TDMA:NA Tta:NA Ttb:a) Tra:2 Trb:a) Type:2 (a: 1 with frequency hopping, 0 otherwise)", /* 16 */
1123 "Max Rx-Slot/TDMA:7 Max Tx-Slot/TDMA:7 Max-Sum-Slot/TDMA:NA Tta:NA Ttb:a) Tra:1 Trb:0 Type:2 (a: 1 with frequency hopping, 0 otherwise)", /* 17 */
1124 "Max Rx-Slot/TDMA:8 Max Tx-Slot/TDMA:8 Max-Sum-Slot/TDMA:NA Tta:NA Ttb:0 Tra:0 Trb:0 Type:2", /* 18 */
1125 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 19 */
1126 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 20 */
1127 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 21 */
1128 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 22 */
1129 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:6 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 23 */
1130 "Max Rx-Slot/TDMA:8 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 24 */
1131 "Max Rx-Slot/TDMA:8 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 25 */
1132 "Max Rx-Slot/TDMA:8 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 26 */
1133 "Max Rx-Slot/TDMA:8 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 27 */
1134 "Max Rx-Slot/TDMA:8 Max Tx-Slot/TDMA:6 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 28 */
1135 "Max Rx-Slot/TDMA:8 Max Tx-Slot/TDMA:8 Max-Sum-Slot/TDMA:NA Tta:3 Ttb:b) Tra:2 Trb:c) Type:1 (b: 1 with frequency hopping or change from Rx to Tx, 0 otherwise; c: 1 with frequency hopping or change from Tx to Rx, 0 otherwise", /* 29 */
1136 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:1 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1 Trb:1 Type:1", /* 30 */
1137 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1 Trb:1 Type:1", /* 31 */
1138 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1 Trb:1 Type:1", /* 32 */
1139 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1 Trb:1 Type:1", /* 33 */
1140 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:5 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1 Trb:1 Type:1", /* 34 */
1141 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:1 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1+to Trb:1 Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 35 */
1142 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1+to Trb:1 Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 36 */
1143 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1+to Trb:1 Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 37 */
1144 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1+to Trb:1 Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 38 */
1145 "Max Rx-Slot/TDMA:5 Max Tx-Slot/TDMA:5 Max-Sum-Slot/TDMA:6 Tta:2 Ttb:1 Tra:1+to Trb:1 Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 39 */
1146 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:1 Max-Sum-Slot/TDMA:7 Tta:1 Ttb:1 Tra:1 Trb:to Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 40 */
1147 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:2 Max-Sum-Slot/TDMA:7 Tta:1 Ttb:1 Tra:1 Trb:to Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 41 */
1148 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:3 Max-Sum-Slot/TDMA:7 Tta:1 Ttb:1 Tra:1 Trb:to Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 42 */
1149 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:4 Max-Sum-Slot/TDMA:7 Tta:1 Ttb:1 Tra:1 Trb:to Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 43 */
1150 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:5 Max-Sum-Slot/TDMA:7 Tta:1 Ttb:1 Tra:1 Trb:to Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 44 */
1151 "Max Rx-Slot/TDMA:6 Max Tx-Slot/TDMA:6 Max-Sum-Slot/TDMA:7 Tta:1 Ttb:1 Tra:1 Trb:to Type:1 (to: to = 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value))", /* 45 */
1152 "Not specified", /* 46 */
1153 "Not specified", /* 47 */
1154 "Not specified", /* 48 */
1155 "Not specified", /* 49 */
1156 "Not specified", /* 50 */
1157 "Not specified", /* 51 */
1158 "Not specified", /* 52 */
1159 "Not specified", /* 53 */
1160 "Not specified", /* 54 */
1161 "Not specified", /* 55 */
1162 "Not specified", /* 56 */
1163 "Not specified", /* 57 */
1164 "Not specified", /* 58 */
1165 "Not specified", /* 59 */
1166 "Not specified", /* 60 */
1167 "Not specified", /* 61 */
1168 "Not specified", /* 62 */
1169 "Not specified", /* 63 */
1172 guchar dtm_gprs_mslot = 0;
1173 guchar dtm_egprs_mslot = 4;
1174 gboolean finished = TRUE;
1177 curr_offset = offset;
1178 bit_offset = offset<<3;
1186 /* check for a new round */
1187 if (( curr_len*8 + bits_in_oct ) < 11 )
1190 /* now read the first 11 bits */
1191 curr_bits_length = 11;
1195 if ( curr_len != len )
1200 if (( oct>>(32-bits_needed) ) == 1 )
1202 curr_bits_length -= bits_needed;
1203 oct <<= bits_needed;
1204 bits_in_oct -= bits_needed;
1206 if (( curr_len*8 + bits_in_oct ) < 11 )
1208 curr_bits_length = 11;
1212 curr_bits_length -= bits_needed;
1213 oct <<= bits_needed;
1214 bits_in_oct -= bits_needed;
1220 tf = proto_tree_add_text(tree,
1221 tvb, curr_offset, 1,
1222 "MS RA capability %d",indx);
1224 tf_tree = proto_item_add_subtree(tf, ett_gmm_radio_cap );
1232 acc_type = oct>>(32-bits_needed);
1234 proto_tree_add_bits_item(tf_tree, hf_gsm_a_gm_acc_tech_type, tvb, bit_offset, 4, FALSE);
1237 curr_bits_length -= bits_needed;
1238 oct <<= bits_needed;
1239 bits_in_oct -= bits_needed;
1241 /* < Access capabilities struct > ::= */
1248 bits_length = curr_bits_length = oct>>(32-bits_needed);
1249 proto_tree_add_bits_item(tf_tree, hf_gsm_a_gm_acc_cap_struct_len, tvb, bit_offset, 7, FALSE);
1250 proto_item_set_len(tf, (bits_length>>3)+1);
1251 /* This is already done - length doesn't contain this field
1252 curr_bits_length -= bits_needed;
1255 oct <<= bits_needed;
1256 bits_in_oct -= bits_needed;
1258 if ( acc_type == 0x0f )
1263 * Additional access technologies:
1265 finished = TRUE; /* Break out of the loop unless proven unfinished */
1274 switch ( oct>>(32-bits_needed) )
1276 case 0x00: str="Not Present"; finished = TRUE; break;
1277 case 0x01: str="Present"; finished = FALSE; break;
1278 default: str="This should not happen";
1281 proto_tree_add_text(tf_tree,
1282 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1283 "Presence: (%u) %s",oct>>(32-bits_needed),str);
1285 curr_bits_length -= bits_needed;
1286 oct <<= bits_needed;
1287 bits_in_oct -= bits_needed;
1292 * No more valid data, get spare bits if any
1294 while ( curr_bits_length > 0 )
1296 if ( curr_bits_length > 8 )
1299 bits_needed = curr_bits_length;
1301 curr_bits_length -= bits_needed;
1302 oct <<= bits_needed;
1303 bits_in_oct -= bits_needed;
1304 bit_offset+= bits_needed;
1315 acc_type = oct>>(32-bits_needed);
1317 proto_tree_add_bits_item(tf_tree, hf_gsm_a_gm_acc_cap_struct_len, tvb, bit_offset, 7, FALSE);
1320 curr_bits_length -= bits_needed;
1321 oct <<= bits_needed;
1322 bits_in_oct -= bits_needed;
1330 value = tvb_get_bits8(tvb, bit_offset, 3);
1332 if ( acc_type == 0x04 ) /* GSM 1900 */
1336 case 0x01: str="1 W (30 dBm)"; break;
1337 case 0x02: str="0,25 W (24 dBm)"; break;
1338 case 0x03: str="2 W (33 dBm)"; break;
1339 default: str="Not specified";
1342 else if ( acc_type == 0x03 )
1349 case 0x01: str="1 W (30 dBm)"; break;
1350 case 0x02: str="0,25 W (24 dBm)"; break;
1351 case 0x03: str="4 W (36 dBm)"; break;
1352 default: str="Not specified";
1355 else if ( acc_type <= 0x08 )
1367 case 0x02: str="8 W (39 dBm)"; break;
1368 case 0x03: str="5 W (37 dBm)"; break;
1369 case 0x04: str="2 W (33 dBm)"; break;
1370 case 0x05: str="0,8 W (29 dBm)"; break;
1371 default: str="Not specified";
1375 str="Not specified??";
1377 /* decode_bits_in_field(gint bit_offset, gint no_of_bits, guint64 value)*/
1378 proto_tree_add_text(tf_tree,
1379 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1380 "%s RF Power Capability, GMSK Power Class: (%u) %s", decode_bits_in_field(bit_offset, 3, value), value, str);
1382 curr_bits_length -= bits_needed;
1383 oct <<= bits_needed;
1384 bits_in_oct -= bits_needed;
1392 value = tvb_get_bits8(tvb, bit_offset, 2);
1396 case 0x00: str="8PSK modulation not supported for uplink"; break;
1397 case 0x01: str="Power class E1"; break;
1398 case 0x02: str="Power class E2"; break;
1399 case 0x03: str="Power class E3"; break;
1400 default: str="This should not happen";
1403 proto_tree_add_text(tf_tree,
1404 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1405 "8PSK Power Class: (%u) %s",value,str);
1407 curr_bits_length -= bits_needed;
1408 oct <<= bits_needed;
1409 bits_in_oct -= bits_needed;
1411 } while (!finished);
1422 value = tvb_get_bits8(tvb, bit_offset, 3);
1424 if ( acc_type == 0x04 ) /* GSM 1900 */
1428 case 0x01: str="1 W (30 dBm)"; break;
1429 case 0x02: str="0,25 W (24 dBm)"; break;
1430 case 0x03: str="2 W (33 dBm)"; break;
1431 default: str="Not specified";
1434 else if ( acc_type == 0x03 )
1438 case 0x01: str="1 W (30 dBm)"; break;
1439 case 0x02: str="0,25 W (24 dBm)"; break;
1440 case 0x03: str="4 W (36 dBm)"; break;
1441 default: str="Not specified";
1444 else if ( acc_type <= 0x08 )
1448 case 0x02: str="8 W (39 dBm)"; break;
1449 case 0x03: str="5 W (37 dBm)"; break;
1450 case 0x04: str="2 W (33 dBm)"; break;
1451 case 0x05: str="0,8 W (29 dBm)"; break;
1452 default: str="Not specified";
1456 str="Not specified??";
1458 proto_tree_add_text(tf_tree,
1459 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1460 "%s RF Power Capability, GMSK Power Class: (%u) %s", decode_bits_in_field(bit_offset, 3, value), value,str);
1463 curr_bits_length -= bits_needed;
1464 oct <<= bits_needed;
1465 bits_in_oct -= bits_needed;
1474 if ((oct>>(32-bits_needed))==0)
1476 proto_tree_add_text(tf_tree,
1477 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1478 "A5 Bits: (%u) same values apply for parameters as in the immediately preceding Access capabilities field within this IE",oct>>(32-bits_needed));
1480 curr_bits_length -= bits_needed;
1481 oct <<= bits_needed;
1482 bits_in_oct -= bits_needed;
1488 proto_tree_add_text(tf_tree,
1489 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1490 "A5 Bits: (%u) A5 bits follows",oct>>(32-bits_needed));
1493 curr_bits_length -= bits_needed;
1494 oct <<= bits_needed;
1495 bits_in_oct -= bits_needed;
1497 for (i=1; i<= 7 ; i++ )
1506 switch ( oct>>(32-bits_needed) )
1508 case 0x00: str="encryption algorithm not available"; break;
1509 case 0x01: str="encryption algorithm available"; break;
1510 default: str="This should not happen";
1513 proto_tree_add_text(tf_tree,
1514 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1515 "A5/%d: (%u) %s",i,oct>>(32-bits_needed),str);
1517 curr_bits_length -= bits_needed;
1518 oct <<= bits_needed;
1519 bits_in_oct -= bits_needed;
1530 switch ( oct>>(32-bits_needed) )
1532 case 0x00: str="controlled early Classmark Sending option is not implemented"; break;
1533 case 0x01: str="controlled early Classmark Sending option is implemented"; break;
1534 default: str="This should not happen";
1537 proto_tree_add_text(tf_tree,
1538 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1539 "Controlled early Classmark Sending: (%u) %s",oct>>(32-bits_needed),str);
1541 curr_bits_length -= bits_needed;
1542 oct <<= bits_needed;
1543 bits_in_oct -= bits_needed;
1552 switch ( oct>>(32-bits_needed) )
1554 case 0x00: str="PS capability not present"; break;
1555 case 0x01: str="PS capability present"; break;
1556 default: str="This should not happen";
1559 proto_tree_add_text(tf_tree,
1560 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1561 "Pseudo Synchronisation: (%u) %s",oct>>(32-bits_needed),str);
1563 curr_bits_length -= bits_needed;
1564 oct <<= bits_needed;
1565 bits_in_oct -= bits_needed;
1574 switch ( oct>>(32-bits_needed) )
1576 case 0x00: str="no VGCS capability or no notifications wanted"; break;
1577 case 0x01: str="VGCS capability and notifications wanted"; break;
1578 default: str="This should not happen";
1581 proto_tree_add_text(tf_tree,
1582 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1583 "Voice Group Call Service: (%u) %s",oct>>(32-bits_needed),str);
1585 curr_bits_length -= bits_needed;
1586 oct <<= bits_needed;
1587 bits_in_oct -= bits_needed;
1596 switch ( oct>>(32-bits_needed) )
1598 case 0x00: str="no VBS capability or no notifications wanted"; break;
1599 case 0x01: str="VBS capability and notifications wanted"; break;
1600 default: str="This should not happen";
1603 proto_tree_add_text(tf_tree,
1604 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1605 "Voice Broadcast Service: (%u) %s",oct>>(32-bits_needed),str);
1607 curr_bits_length -= bits_needed;
1608 oct <<= bits_needed;
1609 bits_in_oct -= bits_needed;
1612 * Multislot capability?
1618 if ((oct>>(32-bits_needed))==0)
1620 proto_tree_add_text(tf_tree,
1621 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1622 "Multislot capability: (%u) same values apply for parameters as in the immediately preceding Access capabilities field within this IE",oct>>(32-bits_needed));
1624 curr_bits_length -= bits_needed;
1625 oct <<= bits_needed;
1626 bits_in_oct -= bits_needed;
1630 proto_tree_add_text(tf_tree,
1631 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1632 "Multislot capability: (%u) Multislot capability struct available",oct>>(32-bits_needed));
1635 curr_bits_length -= bits_needed;
1636 oct <<= bits_needed;
1637 bits_in_oct -= bits_needed;
1640 * HSCSD multislot class?
1646 if ((oct>>(32-bits_needed))==0)
1648 proto_tree_add_text(tf_tree,
1649 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1650 "HSCSD multislot class: (%u) Bits are not available",oct>>(32-bits_needed));
1652 curr_bits_length -= bits_needed;
1653 oct <<= bits_needed;
1654 bits_in_oct -= bits_needed;
1658 curr_bits_length -= bits_needed;
1659 oct <<= bits_needed;
1660 bits_in_oct -= bits_needed;
1664 * HSCSD multislot class
1670 proto_tree_add_text(tf_tree,
1671 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1672 "HSCSD multislot class: (%u) %s",oct>>(32-bits_needed),multi_slot_str[oct>>(32-bits_needed)]);
1674 curr_bits_length -= bits_needed;
1675 oct <<= bits_needed;
1676 bits_in_oct -= bits_needed;
1680 * GPRS multislot class?
1686 if ((oct>>(32-bits_needed))==0)
1688 proto_tree_add_text(tf_tree,
1689 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1690 "GPRS multislot class: (%u) Bits are not available",oct>>(32-bits_needed));
1692 curr_bits_length -= bits_needed;
1693 oct <<= bits_needed;
1694 bits_in_oct -= bits_needed;
1698 curr_bits_length -= bits_needed;
1699 oct <<= bits_needed;
1700 bits_in_oct -= bits_needed;
1704 * GPRS multislot class
1710 proto_tree_add_text(tf_tree,
1711 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1712 "GPRS multislot class: (%u) %s",oct>>(32-bits_needed),multi_slot_str[oct>>(32-bits_needed)]);
1714 curr_bits_length -= bits_needed;
1715 oct <<= bits_needed;
1716 bits_in_oct -= bits_needed;
1719 * GPRS Extended Dynamic Allocation Capability
1725 switch ( oct>>(32-bits_needed) )
1727 case 0x00: str="Extended Dynamic Allocation Capability for GPRS is not implemented"; break;
1728 case 0x01: str="Extended Dynamic Allocation Capability for GPRS is implemented"; break;
1729 default: str="This should not happen";
1731 proto_tree_add_text(tf_tree,
1732 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1733 "GPRS Extended Dynamic Allocation Capability: (%u) %s",oct>>(32-bits_needed),str);
1735 curr_bits_length -= bits_needed;
1736 oct <<= bits_needed;
1737 bits_in_oct -= bits_needed;
1747 if ((oct>>(32-bits_needed))==0)
1749 proto_tree_add_text(tf_tree,
1750 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1751 "SMS/SM values: (%u) Bits are not available",oct>>(32-bits_needed));
1753 curr_bits_length -= bits_needed;
1754 oct <<= bits_needed;
1755 bits_in_oct -= bits_needed;
1759 curr_bits_length -= bits_needed;
1760 oct <<= bits_needed;
1761 bits_in_oct -= bits_needed;
1765 * Switch-Measure-Switch value
1771 proto_tree_add_bits_item(tf_tree, hf_gsm_a_gm_sms_value, tvb, bit_offset, 4, FALSE);
1773 curr_bits_length -= bits_needed;
1774 oct <<= bits_needed;
1775 bits_in_oct -= bits_needed;
1778 * Switch-Measure value
1784 proto_tree_add_bits_item(tf_tree, hf_gsm_a_gm_sm_value, tvb, bit_offset, 4, FALSE);
1786 curr_bits_length -= bits_needed;
1787 oct <<= bits_needed;
1788 bits_in_oct -= bits_needed;
1792 * ECSD multislot class?
1798 if ((oct>>(32-bits_needed))==0)
1800 proto_tree_add_text(tf_tree,
1801 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1802 "ECSD multislot class: (%u) Bits are not available",oct>>(32-bits_needed));
1804 curr_bits_length -= bits_needed;
1805 oct <<= bits_needed;
1806 bits_in_oct -= bits_needed;
1810 curr_bits_length -= bits_needed;
1811 oct <<= bits_needed;
1812 bits_in_oct -= bits_needed;
1816 * ECSD multislot class
1822 proto_tree_add_text(tf_tree,
1823 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1824 "ECSD multislot class: (%u) %s",oct>>(32-bits_needed),multi_slot_str[oct>>(32-bits_needed)]);
1826 curr_bits_length -= bits_needed;
1827 oct <<= bits_needed;
1828 bits_in_oct -= bits_needed;
1832 * EGPRS multislot class?
1838 if ((oct>>(32-bits_needed))==0)
1840 proto_tree_add_text(tf_tree,
1841 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1842 "EGPRS multislot class: (%u) Bits are not available",oct>>(32-bits_needed));
1843 curr_bits_length -= bits_needed;
1844 oct <<= bits_needed;
1845 bits_in_oct -= bits_needed;
1850 curr_bits_length -= bits_needed;
1851 oct <<= bits_needed;
1852 bits_in_oct -= bits_needed;
1856 * EGPRS multislot class
1862 proto_tree_add_text(tf_tree,
1863 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1864 "EGPRS multislot class: (%u) %s",oct>>(32-bits_needed),multi_slot_str[oct>>(32-bits_needed)]);
1866 curr_bits_length -= bits_needed;
1867 oct <<= bits_needed;
1868 bits_in_oct -= bits_needed;
1871 * EGPRS Extended Dynamic Allocation Capability
1877 switch ( oct>>(32-bits_needed) )
1879 case 0x00: str="Extended Dynamic Allocation Capability for EGPRS is not implemented"; break;
1880 case 0x01: str="Extended Dynamic Allocation Capability for EGPRS is implemented"; break;
1881 default: str="This should not happen";
1883 proto_tree_add_text(tf_tree,
1884 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1885 "EGPRS Extended Dynamic Allocation Capability: (%u) %s",oct>>(32-bits_needed),str);
1887 curr_bits_length -= bits_needed;
1888 oct <<= bits_needed;
1889 bits_in_oct -= bits_needed;
1893 * DTM GPRS Multi Slot Class ?
1899 if ((oct>>(32-bits_needed))==0)
1901 proto_tree_add_text(tf_tree,
1902 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1903 "DTM GPRS Multi Slot Class: (%u) Bits are not available",oct>>(32-bits_needed));
1905 curr_bits_length -= bits_needed;
1906 oct <<= bits_needed;
1907 bits_in_oct -= bits_needed;
1911 curr_bits_length -= bits_needed;
1912 oct <<= bits_needed;
1913 bits_in_oct -= bits_needed;
1917 * DTM GPRS Multi Slot Class
1923 dtm_gprs_mslot = oct>>(32-bits_needed);
1925 switch ( oct>>(32-bits_needed) )
1927 case 0: str="Unused. If received, the network shall interpret this as Multislot class 5"; break;
1928 case 1: str="Multislot class 5 supported"; break;
1929 case 2: str="Multislot class 9 supported"; break;
1930 case 3: str="Multislot class 11 supported"; break;
1931 default: str="This should not happen";
1934 proto_tree_add_text(tf_tree,
1935 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1936 "DTM GPRS Multi Slot Class: (%u) %s",oct>>(32-bits_needed),str);
1938 curr_bits_length -= bits_needed;
1939 oct <<= bits_needed;
1940 bits_in_oct -= bits_needed;
1949 switch ( oct>>(32-bits_needed) )
1951 case 0x00: str="Single Slot DTM not supported"; break;
1952 case 0x01: str="Single Slot DTM supported"; break;
1953 default: str="This should not happen";
1955 proto_tree_add_text(tf_tree,
1956 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1957 "Single Slot DTM: (%u) %s",oct>>(32-bits_needed),str);
1959 curr_bits_length -= bits_needed;
1960 oct <<= bits_needed;
1961 bits_in_oct -= bits_needed;
1964 * DTM EGPRS Multi Slot Class ?
1970 dtm_egprs_mslot = oct>>(32-bits_needed);
1972 if ((oct>>(32-bits_needed))==0)
1974 proto_tree_add_text(tf_tree,
1975 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
1976 "DTM EGPRS Multi Slot Class: (%u) Bits are not available",oct>>(32-bits_needed));
1978 curr_bits_length -= bits_needed;
1979 oct <<= bits_needed;
1980 bits_in_oct -= bits_needed;
1984 curr_bits_length -= bits_needed;
1985 oct <<= bits_needed;
1986 bits_in_oct -= bits_needed;
1990 * DTM EGPRS Multi Slot Class
1996 switch ( oct>>(32-bits_needed) )
1998 case 0: str="Unused. If received, the network shall interpret this as Multislot class 5"; break;
1999 case 1: str="Multislot class 5 supported"; break;
2000 case 2: str="Multislot class 9 supported"; break;
2001 case 3: str="Multislot class 11 supported"; break;
2002 default: str="This should not happen";
2005 proto_tree_add_text(tf_tree,
2006 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2007 "DTM EGPRS Multi Slot Class: (%u) %s",oct>>(32-bits_needed),str);
2009 curr_bits_length -= bits_needed;
2010 oct <<= bits_needed;
2011 bits_in_oct -= bits_needed;
2017 * 8PSK Power Capability?
2023 if ((oct>>(32-bits_needed))==0)
2025 proto_tree_add_text(tf_tree,
2026 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2027 "8PSK Power Capability: (%u) Bits are not available",oct>>(32-bits_needed));
2029 curr_bits_length -= bits_needed;
2030 oct <<= bits_needed;
2031 bits_in_oct -= bits_needed;
2035 curr_bits_length -= bits_needed;
2036 oct <<= bits_needed;
2037 bits_in_oct -= bits_needed;
2041 * 8PSK Power Capability
2047 switch ( oct>>(32-bits_needed) )
2049 case 0x00: str="Reserved"; break;
2050 case 0x01: str="Power class E1"; break;
2051 case 0x02: str="Power class E2"; break;
2052 case 0x03: str="Power class E3"; break;
2053 default: str="This should not happen";
2056 proto_tree_add_text(tf_tree,
2057 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2058 "8PSK Power Capability: (%u) %s",oct>>(32-bits_needed),str);
2060 curr_bits_length -= bits_needed;
2061 oct <<= bits_needed;
2062 bits_in_oct -= bits_needed;
2066 * COMPACT Interference Measurement Capability
2072 switch ( oct>>(32-bits_needed) )
2074 case 0x00: str="COMPACT Interference Measurement Capability is not implemented"; break;
2075 case 0x01: str="COMPACT Interference Measurement Capability is implemented"; break;
2076 default: str="This should not happen";
2079 proto_tree_add_text(tf_tree,
2080 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2081 "COMPACT Interference Measurement Capability: (%u) %s",oct>>(32-bits_needed),str);
2083 curr_bits_length -= bits_needed;
2084 oct <<= bits_needed;
2085 bits_in_oct -= bits_needed;
2088 * Revision Level Indicator
2094 switch ( oct>>(32-bits_needed) )
2096 case 0x00: str="The ME is Release 98 or older"; break;
2097 case 0x01: str="The ME is Release 99 onwards"; break;
2098 default: str="This should not happen";
2101 proto_tree_add_text(tf_tree,
2102 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2103 "Revision Level Indicator: (%u) %s",oct>>(32-bits_needed),str);
2105 curr_bits_length -= bits_needed;
2106 oct <<= bits_needed;
2107 bits_in_oct -= bits_needed;
2110 * UMTS FDD Radio Access Technology Capability
2116 switch ( oct>>(32-bits_needed) )
2118 case 0x00: str="UMTS FDD not supported"; break;
2119 case 0x01: str="UMTS FDD supported"; break;
2120 default: str="This should not happen";
2123 proto_tree_add_text(tf_tree,
2124 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2125 "UMTS FDD Radio Access Technology Capability: (%u) %s",oct>>(32-bits_needed),str);
2127 curr_bits_length -= bits_needed;
2128 oct <<= bits_needed;
2129 bits_in_oct -= bits_needed;
2132 * UMTS 3.84 Mcps TDD Radio Access Technology Capability
2138 switch ( oct>>(32-bits_needed) )
2140 case 0x00: str="UMTS 3.84 Mcps TDD not supported"; break;
2141 case 0x01: str="UMTS 3.84 Mcps TDD supported"; break;
2142 default: str="This should not happen";
2145 proto_tree_add_text(tf_tree,
2146 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2147 "UMTS 3.84 Mcps TDD Radio Access Technology Capability: (%u) %s",oct>>(32-bits_needed),str);
2149 curr_bits_length -= bits_needed;
2150 oct <<= bits_needed;
2151 bits_in_oct -= bits_needed;
2154 * CDMA 2000 Radio Access Technology Capability
2160 switch ( oct>>(32-bits_needed) )
2162 case 0x00: str="CDMA 2000 not supported"; break;
2163 case 0x01: str="CDMA 2000 supported"; break;
2164 default: str="This should not happen";
2167 proto_tree_add_text(tf_tree,
2168 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2169 "CDMA 2000 Radio Access Technology Capability: (%u) %s",oct>>(32-bits_needed),str);
2171 curr_bits_length -= bits_needed;
2172 oct <<= bits_needed;
2173 bits_in_oct -= bits_needed;
2176 * UMTS 1.28 Mcps TDD Radio Access Technology Capability
2182 switch ( oct>>(32-bits_needed) )
2184 case 0x00: str="UMTS 1.28 Mcps TDD not supported"; break;
2185 case 0x01: str="UMTS 1.28 Mcps TDD supported"; break;
2186 default: str="This should not happen";
2189 proto_tree_add_text(tf_tree,
2190 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2191 "UMTS 1.28 Mcps TDD Radio Access Technology Capability: (%u) %s",oct>>(32-bits_needed),str);
2193 curr_bits_length -= bits_needed;
2194 oct <<= bits_needed;
2195 bits_in_oct -= bits_needed;
2198 * GERAN Feature Package 1
2204 switch ( oct>>(32-bits_needed) )
2206 case 0x00: str="GERAN feature package 1 not supported"; break;
2207 case 0x01: str="GERAN feature package 1 supported"; break;
2208 default: str="This should not happen";
2211 proto_tree_add_text(tf_tree,
2212 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2213 "GERAN Feature Package 1: (%u) %s",oct>>(32-bits_needed),str);
2215 curr_bits_length -= bits_needed;
2216 oct <<= bits_needed;
2217 bits_in_oct -= bits_needed;
2220 * Extended DTM (E)GPRS Multi Slot Class
2226 if ((oct>>(32-bits_needed))==0)
2228 proto_tree_add_text(tf_tree,
2229 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2230 "Extended DTM (E)GPRS Multi Slot Class: (%u) Bits are not available",oct>>(32-bits_needed));
2231 curr_bits_length -= bits_needed;
2232 oct <<= bits_needed;
2233 bits_in_oct -= bits_needed;
2238 curr_bits_length -= bits_needed;
2239 oct <<= bits_needed;
2240 bits_in_oct -= bits_needed;
2243 * Extended DTM GPRS Multi Slot Class
2249 switch ( (oct>>(32-bits_needed))|(dtm_gprs_mslot<<4) )
2251 case 0x00: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2252 case 0x01: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2253 case 0x02: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2254 case 0x03: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2255 case 0x10: str="Multislot class 5 supported"; break;
2256 case 0x11: str="Multislot class 6 supported"; break;
2257 case 0x12: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2258 case 0x13: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2259 case 0x20: str="Multislot class 9 supported"; break;
2260 case 0x21: str="Multislot class 10 supported"; break;
2261 case 0x22: str="Unused. If received, it shall be interpreted as Multislot class 9 supported"; break;
2262 case 0x23: str="Unused. If received, it shall be interpreted as Multislot class 9 supported"; break;
2263 case 0x30: str="Multislot class 11 supported"; break;
2264 case 0x31: str="Unused. If received, it shall be interpreted as Multislot class 11 supported"; break;
2265 case 0x32: str="Unused. If received, it shall be interpreted as Multislot class 11 supported"; break;
2266 case 0x33: str="Unused. If received, it shall be interpreted as Multislot class 11 supported"; break;
2267 default: str="This should not happen";
2270 proto_tree_add_text(tf_tree,
2271 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2272 "Extended DTM GPRS Multi Slot Class: (%u) %s",oct>>(32-bits_needed),str);
2274 curr_bits_length -= bits_needed;
2275 oct <<= bits_needed;
2276 bits_in_oct -= bits_needed;
2278 if ( dtm_egprs_mslot <= 3 )
2281 * Extended DTM EGPRS Multi Slot Class
2287 switch ( (oct>>(32-bits_needed))|(dtm_egprs_mslot<<4) )
2289 case 0x00: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2290 case 0x01: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2291 case 0x02: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2292 case 0x03: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2293 case 0x10: str="Multislot class 5 supported"; break;
2294 case 0x11: str="Multislot class 6 supported"; break;
2295 case 0x12: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2296 case 0x13: str="Unused. If received, it shall be interpreted as Multislot class 5 supported"; break;
2297 case 0x20: str="Multislot class 9 supported"; break;
2298 case 0x21: str="Multislot class 10 supported"; break;
2299 case 0x22: str="Unused. If received, it shall be interpreted as Multislot class 9 supported"; break;
2300 case 0x23: str="Unused. If received, it shall be interpreted as Multislot class 9 supported"; break;
2301 case 0x30: str="Multislot class 11 supported"; break;
2302 case 0x31: str="Unused. If received, it shall be interpreted as Multislot class 11 supported"; break;
2303 case 0x32: str="Unused. If received, it shall be interpreted as Multislot class 11 supported"; break;
2304 case 0x33: str="Unused. If received, it shall be interpreted as Multislot class 11 supported"; break;
2305 default: str="This should not happen";
2308 proto_tree_add_text(tf_tree,
2309 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2310 "Extended DTM EGPRS Multi Slot Class: (%u) %s",oct>>(32-bits_needed),str);
2312 curr_bits_length -= bits_needed;
2313 oct <<= bits_needed;
2314 bits_in_oct -= bits_needed;
2319 * Modulation based multislot class support
2325 switch ( oct>>(32-bits_needed) )
2327 case 0x00: str="Modulation based multislot class not supported"; break;
2328 case 0x01: str="Modulation based multislot class supported"; break;
2329 default: str="This should not happen";
2332 proto_tree_add_text(tf_tree,
2333 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2334 "Modulation based multislot class support: (%u) %s",oct>>(32-bits_needed),str);
2336 curr_bits_length -= bits_needed;
2337 oct <<= bits_needed;
2338 bits_in_oct -= bits_needed;
2341 * High Multislot Capability
2347 if ((oct>>(32-bits_needed))==0)
2349 proto_tree_add_text(tf_tree,
2350 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2351 "High Multislot Capability: (%u) Bits are not available",oct>>(32-bits_needed));
2353 curr_bits_length -= bits_needed;
2354 oct <<= bits_needed;
2355 bits_in_oct -= bits_needed;
2359 curr_bits_length -= bits_needed;
2360 oct <<= bits_needed;
2361 bits_in_oct -= bits_needed;
2365 * High Multislot Capability
2371 proto_tree_add_text(tf_tree,
2372 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2373 "High Multislot Capability: 0x%02x (%u)"
2374 " - This field effect all other multislot fields."
2375 " To understand the value please read TS 24.008 5.6.0"
2376 " Release 5 Chap 10.5.5.12 Page 406",
2377 oct>>(32-bits_needed),
2378 oct>>(32-bits_needed));
2380 curr_bits_length -= bits_needed;
2381 oct <<= bits_needed;
2382 bits_in_oct -= bits_needed;
2386 * GERAN Iu Mode Capability
2392 switch ( oct>>(32-bits_needed) )
2394 case 0x00: str="GERAN Iu mode not supported"; break;
2395 case 0x01: str="GERAN Iu mode supported"; break;
2396 default: str="This should not happen";
2399 proto_tree_add_text(tf_tree,
2400 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2401 "GERAN Iu Mode Capability: (%u) %s",oct>>(32-bits_needed),str);
2403 curr_bits_length -= bits_needed;
2404 oct <<= bits_needed;
2405 bits_in_oct -= bits_needed;
2408 * GMSK/8-PSK Multislot Power Profile
2414 if ((oct>>(32-bits_needed))==0)
2416 proto_tree_add_text(tf_tree,
2417 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2418 "GMSK/8-PSK Multislot Power Profile: (%u) Bits are not available",oct>>(32-bits_needed));
2420 curr_bits_length -= bits_needed;
2421 oct <<= bits_needed;
2422 bits_in_oct -= bits_needed;
2426 curr_bits_length -= bits_needed;
2427 oct <<= bits_needed;
2428 bits_in_oct -= bits_needed;
2432 * GMSK Multislot Power Profile
2438 switch ( oct>>(32-bits_needed) )
2440 case 0x00: str="GMSK_MULTISLOT_POWER_PROFILE 0"; break;
2441 case 0x01: str="GMSK_MULTISLOT_POWER_PROFILE 1"; break;
2442 case 0x02: str="GMSK_MULTISLOT_POWER_PROFILE 2"; break;
2443 case 0x03: str="GMSK_MULTISLOT_POWER_PROFILE 3"; break;
2444 default: str="This should not happen";
2447 proto_tree_add_text(tf_tree,
2448 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2449 "GMSK Multislot Power Profile: (%u) %s",oct>>(32-bits_needed),str);
2451 curr_bits_length -= bits_needed;
2452 oct <<= bits_needed;
2453 bits_in_oct -= bits_needed;
2456 * 8-PSK Multislot Power Profile
2462 switch ( oct>>(32-bits_needed) )
2464 case 0x00: str="8-PSK_MULTISLOT_POWER_PROFILE 0"; break;
2465 case 0x01: str="8-PSK_MULTISLOT_POWER_PROFILE 1"; break;
2466 case 0x02: str="8-PSK_MULTISLOT_POWER_PROFILE 2"; break;
2467 case 0x03: str="8-PSK_MULTISLOT_POWER_PROFILE 3"; break;
2468 default: str="This should not happen";
2471 proto_tree_add_text(tf_tree,
2472 tvb, curr_offset-1-add_ocetets, 1+add_ocetets,
2473 "8-PSK Multislot Power Profile: (%u) %s",oct>>(32-bits_needed),str);
2475 curr_bits_length -= bits_needed;
2476 oct <<= bits_needed;
2477 bits_in_oct -= bits_needed;
2482 * we are too long ... so jump over it
2484 while ( curr_bits_length > 0 )
2486 if ( curr_bits_length > 8 )
2489 bits_needed = curr_bits_length;
2491 curr_bits_length -= bits_needed;
2492 oct <<= bits_needed;
2493 bits_in_oct -= bits_needed;
2498 curr_offset+= curr_len;
2500 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2502 return(curr_offset - offset);
2509 de_gmm_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2512 guint32 curr_offset;
2515 curr_offset = offset;
2517 oct = tvb_get_guint8(tvb, curr_offset);
2521 /* additional causes can be found in annex g */
2522 case 0x02: str="IMSI unknown in HLR"; break;
2523 case 0x03: str="Illegal MS"; break;
2524 case 0x04: str="IMSI unknown in VLR"; break;
2525 case 0x05: str="IMEI not accepted"; break;
2526 case 0x06: str="Illegal ME"; break;
2527 case 0x07: str="GPRS services not allowed"; break;
2528 case 0x08: str="GPRS services and non-GPRS services not allowed"; break;
2529 case 0x09: str="MS identity cannot be derived by the network"; break;
2530 case 0x0a: str="Implicitly detached"; break;
2531 case 0x0b: str="PLMN not allowed"; break;
2532 case 0x0c: str="Location Area not allowed"; break;
2533 case 0x0d: str="Roaming not allowed in this location area"; break;
2534 case 0x0e: str="GPRS services not allowed in this PLMN"; break;
2535 case 0x0f: str="No Suitable Cells In Location Area"; break;
2536 case 0x10: str="MSC temporarily not reachable"; break;
2537 case 0x11: str="Network failure"; break;
2538 case 0x14: str="MAC failure"; break;
2539 case 0x15: str="Synch failure"; break;
2540 case 0x16: str="Congestion"; break;
2541 case 0x17: str="GSM authentication unacceptable"; break;
2542 case 0x20: str="Service option not supported"; break;
2543 case 0x21: str="Requested service option not subscribed"; break;
2544 case 0x22: str="Service option temporarily out of order"; break;
2545 case 0x26: str="Call cannot be identified"; break;
2546 case 0x28: str="No PDP context activated"; break;
2547 case 0x30: str="retry upon entry into a new cell"; break;
2548 case 0x31: str="retry upon entry into a new cell"; break;
2549 case 0x32: str="retry upon entry into a new cell"; break;
2550 case 0x33: str="retry upon entry into a new cell"; break;
2551 case 0x34: str="retry upon entry into a new cell"; break;
2552 case 0x35: str="retry upon entry into a new cell"; break;
2553 case 0x36: str="retry upon entry into a new cell"; break;
2554 case 0x37: str="retry upon entry into a new cell"; break;
2555 case 0x38: str="retry upon entry into a new cell"; break;
2556 case 0x39: str="retry upon entry into a new cell"; break;
2557 case 0x3a: str="retry upon entry into a new cell"; break;
2558 case 0x3b: str="retry upon entry into a new cell"; break;
2559 case 0x3c: str="retry upon entry into a new cell"; break;
2560 case 0x3d: str="retry upon entry into a new cell"; break;
2561 case 0x3e: str="retry upon entry into a new cell"; break;
2562 case 0x3f: str="retry upon entry into a new cell"; break;
2563 case 0x5f: str="Semantically incorrect message"; break;
2564 case 0x60: str="Invalid mandatory information"; break;
2565 case 0x61: str="Message type non-existent or not implemented"; break;
2566 case 0x62: str="Message type not compatible with the protocol state"; break;
2567 case 0x63: str="Information element non-existent or not implemented"; break;
2568 case 0x64: str="Conditional IE error"; break;
2569 case 0x65: str="Message not compatible with the protocol state"; break;
2570 case 0x6f: str="Protocol error, unspecified"; break;
2571 default: str="Protocol error, unspecified";
2574 proto_tree_add_text(tree,
2575 tvb, curr_offset, 1,
2576 "gmm Cause: (%u) %s",
2582 /* no length check possible */
2584 return(curr_offset - offset);
2588 * [7] 10.5.5.15 Routing area identification
2591 de_gmm_rai(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2593 proto_tree *subtree;
2599 guint32 curr_offset;
2601 curr_offset = offset;
2603 mcc = (tvb_get_guint8(tvb, curr_offset) & 0x0f) <<8;
2604 mcc |= (tvb_get_guint8(tvb, curr_offset) & 0xf0);
2605 mcc |= (tvb_get_guint8(tvb, curr_offset+1) & 0x0f);
2606 mnc = (tvb_get_guint8(tvb, curr_offset+2) & 0x0f) <<8;
2607 mnc |= (tvb_get_guint8(tvb, curr_offset+2) & 0xf0);
2608 mnc |= (tvb_get_guint8(tvb, curr_offset+1) & 0xf0) >>4;
2609 if ((mnc&0x000f) == 0x000f)
2612 lac = tvb_get_guint8(tvb, curr_offset+3);
2614 lac |= tvb_get_guint8(tvb, curr_offset+4);
2615 rac = tvb_get_guint8(tvb, curr_offset+5);
2617 item = proto_tree_add_text(tree,
2618 tvb, curr_offset, 6,
2619 "Routing area identification: %x-%x-%x-%x",
2622 subtree = proto_item_add_subtree(item, ett_gmm_rai);
2623 dissect_e212_mcc_mnc(tvb, subtree, offset);
2626 /* no length check possible */
2628 return(curr_offset - offset);
2635 de_gmm_update_res(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2638 guint32 curr_offset;
2641 curr_offset = offset;
2643 oct = tvb_get_guint8(tvb, curr_offset);
2645 /* IMPORTANT - IT'S ASSUMED THAT THE INFORMATION IS IN THE HIGHER NIBBLE */
2650 case 0: str="RA updated"; break;
2651 case 1: str="combined RA/LA updated"; break;
2652 default: str="reserved";
2655 proto_tree_add_text(tree,
2656 tvb, curr_offset, 1,
2657 "Update Result: (%u) %s",
2663 /* no length check possible */
2665 return(curr_offset - offset);
2672 de_gmm_update_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2676 guint32 curr_offset;
2677 const gchar *str_follow;
2678 const gchar *str_update;
2679 proto_item *tf = NULL;
2680 proto_tree *tf_tree = NULL;
2682 curr_offset = offset;
2684 oct = tvb_get_guint8(tvb, curr_offset);
2691 case 0: str_update="RA updating"; break;
2692 case 1: str_update="combined RA/LA updating"; break;
2693 case 2: str_update="combined RA/LA updating with IMSI attach"; break;
2694 case 3: str_update="Periodic updating"; break;
2695 default: str_update="reserved";
2699 case 8: str_follow="Follow-on request pending"; break;
2700 default: str_follow="No follow-on request pending";
2703 tf = proto_tree_add_text(tree,
2704 tvb, curr_offset, 1,
2707 tf_tree = proto_item_add_subtree(tf, ett_gmm_update_type );
2709 proto_tree_add_text(tf_tree,
2710 tvb, curr_offset, 1,
2714 proto_tree_add_text(tf_tree,
2715 tvb, curr_offset, 1,
2720 /* The ciphering key sequence number is added here */
2721 proto_tree_add_text(tree,
2722 tvb, curr_offset, 1,
2723 "Ciphering key sequence number: 0x%02x (%u)",
2729 /* no length check possible */
2731 return(curr_offset - offset);
2738 de_gmm_ac_ref_nr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2741 guint32 curr_offset;
2743 curr_offset = offset;
2745 oct = tvb_get_guint8(tvb, curr_offset);
2747 proto_tree_add_text(tree,
2748 tvb, curr_offset, 1,
2749 "A&C reference number: 0x%02x (%u)",
2755 /* no length check possible */
2757 return(curr_offset - offset);
2764 de_gmm_ac_ref_nr_h(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2767 guint32 curr_offset;
2769 curr_offset = offset;
2771 oct = tvb_get_guint8(tvb, curr_offset);
2773 /* IMPORTANT - IT'S ASSUMED THAT THE INFORMATION IS IN THE HIGHER NIBBLE */
2776 proto_tree_add_text(tree,
2777 tvb, curr_offset, 1,
2778 "A&C reference number: 0x%02x (%u)",
2784 /* no length check possible */
2786 return(curr_offset - offset);
2793 de_gmm_service_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2797 guint32 curr_offset;
2800 curr_offset = offset;
2802 oct = tvb_get_guint8(tvb, curr_offset);
2810 case 0: str="Signalling"; break;
2811 case 1: str="Data"; break;
2812 case 2: str="Paging Response"; break;
2813 case 3: str="MBMS Notification Response"; break;/* reponse->response*/
2814 default: str="reserved";
2817 /* The ciphering key sequence number is added here */
2818 proto_tree_add_text(tree,
2819 tvb, curr_offset, 1,
2820 "Ciphering key sequence number: 0x%02x (%u)",
2824 proto_tree_add_text(tree,
2825 tvb, curr_offset, 1,
2826 "Service Type: (%u) %s",
2832 /* no length check possible */
2834 return(curr_offset - offset);
2841 de_gmm_cell_notfi(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2843 guint32 curr_offset;
2845 curr_offset = offset;
2847 proto_tree_add_text(tree,
2848 tvb, curr_offset, 0,
2849 "Cell Notification");
2851 /* no length check possible */
2853 return(curr_offset - offset);
2860 de_gmm_ps_lcs_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2863 guint32 curr_offset;
2865 gchar str_otd[2][40]={ "MS assisted E-OTD not supported",
2866 "MS assisted E-OTD supported" };
2867 gchar str_gps[2][40]={ "MS assisted GPS not supported",
2868 "MS assisted GPS supported" };
2870 curr_offset = offset;
2872 oct = tvb_get_guint8(tvb, curr_offset);
2874 oct <<=3; /* move away the spare bits */
2876 proto_tree_add_text(tree,
2877 tvb, curr_offset, 1,
2882 proto_tree_add_text(tree,
2883 tvb, curr_offset, 1,
2889 proto_tree_add_text(tree,
2890 tvb, curr_offset, 1,
2895 proto_tree_add_text(tree,
2896 tvb, curr_offset, 1,
2901 proto_tree_add_text(tree,
2902 tvb, curr_offset, 1,
2909 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
2911 return(curr_offset - offset);
2918 de_gmm_net_feat_supp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2921 guint32 curr_offset;
2924 curr_offset = offset;
2926 oct = tvb_get_guint8(tvb, curr_offset);
2930 case 8: str="LCS-MOLR via PS domain not supported"; break;
2931 default: str="LCS-MOLR via PS domain supported";
2934 proto_tree_add_text(tree,
2935 tvb, curr_offset, 1,
2936 "Network Feature Support: (%u) %s",
2942 /* no length check possible */
2944 return(curr_offset - offset);
2947 /* [7] 10.5.5.24 Inter RAT information container */
2949 de_gmm_rat_info_container(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2951 guint32 curr_offset;
2952 tvbuff_t *rrc_irat_ho_info_tvb;
2954 curr_offset = offset;
2956 /* The value part of the Inter RAT information container information element is the INTER RAT HANDOVER INFO as
2957 defined in 3GPP TS 25.331 [23c]. If this field includes padding bits, they are defined in 3GPP TS 25.331 [23c].*/
2958 rrc_irat_ho_info_tvb = tvb_new_subset(tvb, curr_offset, len, len);
2959 if (rrc_irat_ho_info_handle)
2960 call_dissector(rrc_irat_ho_info_handle, rrc_irat_ho_info_tvb, gsm_a_dtap_pinfo , tree);
2962 proto_tree_add_text(tree, tvb, curr_offset, len,"INTER RAT HANDOVER INFO - Not decoded");
2972 de_gc_context_stat(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2976 guint32 curr_offset;
2977 proto_item *tf = NULL;
2978 proto_tree *tf_tree = NULL;
2980 curr_offset = offset;
2982 oct = tvb_get_guint8(tvb, curr_offset);
2984 tf = proto_tree_add_text(tree,
2985 tvb, curr_offset, 1,
2986 "PDP Context Status");
2988 tf_tree = proto_item_add_subtree(tf, ett_gmm_context_stat );
2990 oct = tvb_get_guint8(tvb, curr_offset);
2992 for ( pdp_nr=0;pdp_nr<16; pdp_nr++ )
2997 oct = tvb_get_guint8(tvb, curr_offset);
2999 proto_tree_add_text(tf_tree,
3000 tvb, curr_offset, 1,
3001 "NSAPI %d: (%u) %s",pdp_nr,
3009 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3011 return(curr_offset - offset);
3018 de_gc_radio_prio(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3021 guint32 curr_offset;
3024 curr_offset = offset;
3026 oct = tvb_get_guint8(tvb, curr_offset);
3030 case 1: str="priority level 1 (highest)"; break;
3031 case 2: str="priority level 2"; break;
3032 case 3: str="priority level 3"; break;
3033 case 4: str="priority level 4 (lowest)"; break;
3034 default: str="priority level 4 (lowest)";
3037 proto_tree_add_text(tree,
3038 tvb, curr_offset, 1,
3039 "Radio Priority (PDP or SMS): (%u) %s",
3045 return(curr_offset - offset);
3052 de_gc_timer(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3056 guint32 curr_offset;
3059 curr_offset = offset;
3061 oct = tvb_get_guint8(tvb, curr_offset);
3067 case 0: str="sec"; val*=2; break;
3068 case 1: str="min"; break;
3069 case 2: str="min"; val*=6; break;
3071 proto_tree_add_text(tree,
3072 tvb, curr_offset, 1,
3073 "GPRS Timer: timer is deactivated");
3078 proto_tree_add_text(tree,
3079 tvb, curr_offset, 1,
3080 "GPRS Timer: (%u) %u %s",
3086 /* no length check possible */
3088 return(curr_offset - offset);
3095 de_gc_timer2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len _U_)
3099 guint32 curr_offset;
3102 curr_offset = offset;
3104 oct = tvb_get_guint8(tvb, curr_offset);
3110 case 0: str="sec"; val*=2; break;
3111 case 1: str="min"; break;
3112 case 2: str="min"; val*=6; break;
3114 proto_tree_add_text(tree,
3115 tvb, curr_offset, 1,
3116 "GPRS Timer: timer is deactivated");
3121 proto_tree_add_text(tree,
3122 tvb, curr_offset, 1,
3123 "GPRS Timer: (%u) %u %s %s",
3125 str, add_string ? add_string : "");
3129 return(curr_offset - offset);
3136 de_gc_radio_prio2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3139 guint32 curr_offset;
3142 curr_offset = offset;
3144 oct = tvb_get_guint8(tvb, curr_offset);
3146 /* IMPORTANT - IT'S ASSUMED THAT THE INFORMATION IS IN THE HIGHER NIBBLE */
3151 case 1: str="priority level 1 (highest)"; break;
3152 case 2: str="priority level 2"; break;
3153 case 3: str="priority level 3"; break;
3154 case 4: str="priority level 4 (lowest)"; break;
3155 default: str="priority level 4 (lowest)";
3158 proto_tree_add_text(tree,
3159 tvb, curr_offset, 1,
3160 "Radio Priority (TOM8): (%u) %s",
3166 return(curr_offset - offset);
3170 * [8] 10.5.7.6 MBMS context status
3173 de_gc_mbms_context_stat(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3175 guint32 curr_offset;
3177 proto_item *tf = NULL;
3178 proto_tree *tf_tree = NULL;
3180 curr_offset = offset;
3182 oct = tvb_get_guint8(tvb, curr_offset);
3184 tf = proto_tree_add_text(tree,
3185 tvb, curr_offset, 1,
3186 "MBMS Context Status");
3188 tf_tree = proto_item_add_subtree(tf, ett_gmm_context_stat );
3190 for (i=0; i<len; i++)
3192 oct = tvb_get_guint8(tvb, curr_offset);
3196 proto_tree_add_text(tf_tree,
3197 tvb, curr_offset, 1,
3198 "NSAPI %d: (%u) %s",128+i*8+j,
3211 #define MAX_APN_LENGTH 50
3214 de_sm_apn(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len _U_)
3216 guint32 curr_offset;
3219 guint8 str[MAX_APN_LENGTH+1];
3221 cptr = tvb_get_ptr(tvb, offset, len);
3223 curr_offset = offset;
3225 /* init buffer and copy it */
3226 memset ( str , 0 , MAX_APN_LENGTH );
3227 memcpy ( str , cptr , len<MAX_APN_LENGTH?len:MAX_APN_LENGTH );
3230 while (( curr_len < len ) && ( curr_len < MAX_APN_LENGTH ))
3232 guint step = str[curr_len];
3237 proto_tree_add_text(tree,
3238 tvb, curr_offset, len,
3239 "APN: %s %s", str+1 , add_string ? add_string : "");
3243 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3245 return(curr_offset - offset);
3252 de_sm_nsapi(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len _U_)
3255 guint32 curr_offset;
3257 curr_offset = offset;
3259 oct = tvb_get_guint8(tvb, curr_offset);
3261 proto_tree_add_text(tree,
3262 tvb, curr_offset, 1,
3263 "NSAPI: 0x%02x (%u) %s",
3264 oct&0x0f, oct&0x0f,add_string ? add_string : "");
3268 return(curr_offset - offset);
3272 * [7] 10.5.6.3 Protocol configuration options
3275 static const value_string gsm_a_sm_pco_ms2net_prot_vals[] = {
3276 { 0x01, "P-CSCF Address Request" },
3277 { 0x02, "IM CN Subsystem Signaling Flag" },
3278 { 0x03, "DNS Server Address Request" },
3279 { 0x04, "Not Supported" },
3280 { 0x05, "MS Support of Network Requested Bearer Control indicator" },
3281 { 0x06, "Reserved" },
3282 { 0x07, "DSMIPv6 Home Agent Address Request" },
3283 { 0x08, "DSMIPv6 Home Network Prefix Request" },
3284 { 0x09, "DSMIPv6 IPv4 Home Agent Address Request" },
3285 { 0x0a, "IP address allocation via NAS signalling" },
3286 { 0x0b, "IPv4 address allocation via DHCPv4" },
3289 static const value_string gsm_a_sm_pco_net2ms_prot_vals[] = {
3290 { 0x01, "P-CSCF Address" },
3291 { 0x02, "IM CN Subsystem Signaling Flag" },
3292 { 0x03, "DNS Server Address" },
3293 { 0x04, "Policy Control rejection code" },
3294 { 0x05, "Selected Bearer Control Mode" },
3295 { 0x06, "Reserved" },
3296 { 0x07, "DSMIPv6 Home Agent Address" },
3297 { 0x08, "DSMIPv6 Home Network Prefix" },
3298 { 0x09, "DSMIPv6 IPv4 Home Agent Address" },
3303 de_sm_pco(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3305 guint32 curr_offset;
3308 struct e_in6_addr ipv6_addr;
3311 curr_offset = offset;
3313 oct = tvb_get_guint8(tvb, curr_offset);
3315 proto_tree_add_item(tree, hf_gsm_a_gm_sm_ext, tvb, curr_offset, 1, FALSE);
3316 proto_tree_add_text(tree,tvb, curr_offset, 1, "Configuration Protocol: PPP (%u)",oct&0x0f);
3320 while ( curr_len > 0 )
3325 dissector_handle_t handle = NULL;
3327 prot = tvb_get_ntohs(tvb,curr_offset);
3328 e_len = tvb_get_guint8(tvb, curr_offset+2);
3337 proto_tree_add_text(tree,tvb, curr_offset-3, 2, "Parameter: (%u) P-CSCF Address Request" , prot );
3339 proto_tree_add_text(tree,tvb, curr_offset-3, 2, "Parameter: (%u) P-CSCF Address" , prot );
3341 proto_tree_add_text(tree,tvb, curr_offset-1, 1, "Length: 0x%02x (%u)", e_len , e_len);
3344 tvb_get_ipv6(tvb, curr_offset, &ipv6_addr);
3345 proto_tree_add_text(tree,
3346 tvb, curr_offset, 16,
3347 "IPv6: %s", ip6_to_str(&ipv6_addr));
3352 proto_tree_add_text(tree,tvb, curr_offset-3, 2, "Parameter: (%u) IM CN Subsystem Signaling Flag" , prot );
3353 proto_tree_add_text(tree,tvb, curr_offset-1, 1, "Length: 0x%02x (%u)", e_len , e_len);
3358 proto_tree_add_text(tree,tvb, curr_offset-3, 2, "Parameter: (%u) DNS Server Address Request" , prot );
3360 proto_tree_add_text(tree,tvb, curr_offset-3, 2, "Parameter: (%u) DNS Server Address" , prot );
3362 proto_tree_add_text(tree,tvb, curr_offset-1, 1, "Length: 0x%02x (%u)", e_len , e_len);
3365 tvb_get_ipv6(tvb, curr_offset, &ipv6_addr);
3366 proto_tree_add_text(tree,
3367 tvb, curr_offset, 16,
3368 "IPv6: %s", ip6_to_str(&ipv6_addr));
3373 proto_tree_add_text(tree,tvb, curr_offset-3, 2, "Parameter: (%u) Policy Control rejection code" , prot );
3374 proto_tree_add_text(tree,tvb, curr_offset-1, 1, "Length: 0x%02x (%u)", e_len , e_len);
3375 oct = tvb_get_guint8(tvb, curr_offset);
3376 proto_tree_add_text(tree,tvb, curr_offset, 1, "Reject Code: 0x%02x (%u)", e_len , e_len);
3380 handle = dissector_get_port_handle ( gprs_sm_pco_subdissector_table , prot );
3381 if ( handle != NULL )
3383 proto_tree_add_text(tree,tvb, curr_offset-3, 2, "Protocol: (%u) %s" ,
3384 prot , val_to_str(prot, ppp_vals, "Unknown"));
3385 proto_tree_add_text(tree,tvb, curr_offset-1, 1, "Length: 0x%02x (%u)", e_len , e_len);
3387 * dissect the embedded message
3389 l3_tvb = tvb_new_subset(tvb, curr_offset, e_len, e_len);
3390 call_dissector(handle, l3_tvb , gsm_a_dtap_pinfo , tree );
3394 proto_tree_add_text(tree,tvb, curr_offset-3, 2, "Protocol/Parameter: (%u) unknown" , prot );
3395 proto_tree_add_text(tree,tvb, curr_offset-1, 1, "Length: 0x%02x (%u)", e_len , e_len);
3397 * dissect the embedded DATA message
3399 l3_tvb = tvb_new_subset(tvb, curr_offset, e_len, e_len);
3400 call_dissector(data_handle, l3_tvb, gsm_a_dtap_pinfo , tree);
3406 curr_offset+= e_len;
3408 curr_offset+= curr_len;
3410 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3412 return(curr_offset - offset);
3419 de_sm_pdp_addr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3421 guint32 curr_offset;
3426 struct e_in6_addr ipv6_addr;
3429 curr_offset = offset;
3431 oct = tvb_get_guint8(tvb, curr_offset);
3435 case 0x00: str="ETSI allocated address"; break;
3436 case 0x01: str="IETF allocated address"; break;
3437 case 0x0f: str="Empty PDP type"; break;
3438 default: str="reserved";
3441 proto_tree_add_text(tree,
3442 tvb, curr_offset, 1,
3443 "PDP type organisation: (%u) %s",oct&0x0f,str);
3445 oct2 = tvb_get_guint8(tvb, curr_offset+1);
3447 if (( oct&0x0f ) == 0 )
3451 case 0x00: str="Reserved, used in earlier version of this protocol"; break;
3452 case 0x01: str="PDP-type PPP"; break;
3453 default: str="reserved";
3456 else if (( oct&0x0f) == 1 )
3460 case 0x21: str="IPv4 address"; break;
3461 case 0x57: str="IPv6 address"; break;
3462 default: str="IPv4 address";
3465 else if ((oct2==0) && (( oct&0x0f) == 0x0f ))
3468 str="Not specified";
3470 proto_tree_add_text(tree,
3471 tvb, curr_offset+1, 1,
3472 "PDP type number: (%u) %s",oct2,str);
3474 if (( len == 2 ) && (( oct2 == 0x21 ) || ( oct2 == 0x57 )))
3476 proto_tree_add_text(tree,
3477 tvb, curr_offset+1, 1,
3478 "Dynamic addressing");
3480 curr_offset+= curr_len;
3482 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3484 return(curr_offset - offset);
3486 else if ( len == 2 )
3488 proto_tree_add_text(tree,
3489 tvb, curr_offset+1, 1,
3490 "No PDP address is included");
3492 curr_offset+= curr_len;
3494 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3496 return(curr_offset - offset);
3500 proto_tree_add_text(tree,
3501 tvb, curr_offset+1, 1,
3502 "Length is bogus - should be >= 2");
3504 curr_offset+= curr_len;
3506 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3508 return(curr_offset - offset);
3511 if ((( oct2 == 0x21 ) && ( len != 6 )) ||
3512 (( oct2 == 0x57 ) && ( len != 18 )))
3514 proto_tree_add_text(tree,
3515 tvb, curr_offset+2, len-2,
3516 "Can't display address");
3523 proto_tree_add_text(tree,
3524 tvb, curr_offset+2, 0,
3525 "IPv4: length is wrong");
3527 proto_tree_add_text(tree,
3528 tvb, curr_offset+2, len-2,
3529 "IPv4: %s", ip_to_str(tvb_get_ptr(tvb, offset+2, 4)));
3535 proto_tree_add_text(tree,
3536 tvb, curr_offset+2, 0,
3537 "IPv6: length is wrong");
3539 tvb_get_ipv6(tvb, curr_offset+2, &ipv6_addr);
3540 proto_tree_add_text(tree,
3541 tvb, curr_offset+2, len-2,
3542 "IPv6: %s", ip6_to_str(&ipv6_addr));
3547 curr_offset+= curr_len;
3549 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3551 return(curr_offset - offset);
3555 * [7] 10.5.6.5 3GPP TS 24.008 version 7.8.0 Release 7
3558 static const value_string gsm_a_qos_delay_cls_vals[] = {
3559 { 0x00, "Subscribed delay class (in MS to network direction)" },
3560 { 0x01, "Delay class 1" },
3561 { 0x02, "Delay class 2" },
3562 { 0x03, "Delay class 3" },
3563 { 0x04, "Delay class 4 (best effort)" },
3564 { 0x07, "Reserved" },
3568 static const value_string gsm_a_qos_reliability_vals[] = {
3569 { 0x00, "Subscribed reliability class (in MS to network direction)" },
3570 { 0x01, "Acknowledged GTP, LLC, and RLC; Protected data" },
3571 { 0x02, "Unacknowledged GTP, Ack LLC/RLC, Protected data" },
3572 { 0x03, "Unacknowledged GTP/LLC, Ack RLC, Protected data" },
3573 { 0x04, "Unacknowledged GTP/LLC/RLC, Protected data" },
3574 { 0x05, "Unacknowledged GTP/LLC/RLC, Unprotected data" },
3575 { 0x07, "Reserved" },
3578 /* Delivery of erroneous SDUs, octet 6 (see 3GPP TS 23.107) Bits 3 2 1 */
3579 const value_string gsm_a_qos_del_of_err_sdu_vals[] = {
3580 { 0, "Subscribed delivery of erroneous SDUs/Reserved" },
3581 { 1, "No detect('-')" },
3582 { 2, "Erroneous SDUs are delivered('yes')" },
3583 { 3, "Erroneous SDUs are not delivered('No')" },
3588 /* Delivery order, octet 6 (see 3GPP TS 23.107) Bits 5 4 3 */
3589 const value_string gsm_a_qos_del_order_vals[] = {
3590 { 0, "Subscribed delivery order/Reserved" },
3591 { 1, "With delivery order ('yes')" },
3592 { 2, "Without delivery order ('no')" },
3596 /* Traffic class, octet 6 (see 3GPP TS 23.107) Bits 8 7 6 */
3597 const value_string gsm_a_qos_traffic_cls_vals[] = {
3598 { 0, "Subscribed traffic class/Reserved" },
3599 { 1, "Conversational class" },
3600 { 2, "Streaming class" },
3601 { 3, "Interactive class" },
3602 { 4, "Background class" },
3607 /* Residual Bit Error Rate (BER), octet 10 (see 3GPP TS 23.107) Bits 8 7 6 5 */
3608 const value_string gsm_a_qos_ber_vals[] = {
3609 { 0, "Subscribed residual BER/Reserved" },
3623 /* SDU error ratio, octet 10 (see 3GPP TS 23.107) Bits 4 3 2 1 */
3624 const value_string gsm_a_qos_sdu_err_rat_vals[] = {
3625 { 0, "Subscribed SDU error ratio/Reserved" },
3637 /* Traffic handling priority, octet 11 (see 3GPP TS 23.107) Bits 2 1 */
3638 const value_string gsm_a_qos_traff_hdl_pri_vals[] = {
3639 { 0, "Subscribed traffic handling priority/Reserved" },
3640 { 1, "Priority level 1" },
3641 { 2, "Priority level 2" },
3642 { 3, "Priority level 3" },
3647 de_sm_qos(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3649 guint32 curr_offset;
3651 guchar oct, tmp_oct;
3655 curr_offset = offset;
3657 oct = tvb_get_guint8(tvb, curr_offset);
3659 proto_tree_add_item(tree, hf_gsm_a_qos_delay_cls, tvb, curr_offset, 1, FALSE);
3660 proto_tree_add_item(tree, hf_gsm_a_qos_qos_reliability_cls, tvb, curr_offset, 1, FALSE);
3665 if ( curr_len == 0 )
3667 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3669 return(curr_offset - offset);
3672 oct = tvb_get_guint8(tvb, curr_offset);
3676 case 0x00: str="Subscribed peak throughput/reserved"; break;
3677 case 0x01: str="Up to 1 000 octet/s"; break;
3678 case 0x02: str="Up to 2 000 octet/s"; break;
3679 case 0x03: str="Up to 4 000 octet/s"; break;
3680 case 0x04: str="Up to 8 000 octet/s"; break;
3681 case 0x05: str="Up to 16 000 octet/s"; break;
3682 case 0x06: str="Up to 32 000 octet/s"; break;
3683 case 0x07: str="Up to 64 000 octet/s"; break;
3684 case 0x08: str="Up to 128 000 octet/s"; break;
3685 case 0x09: str="Up to 256 000 octet/s"; break;
3686 case 0x0f: str="Reserved"; break;
3687 default: str="Up to 1 000 octet/s";
3690 proto_tree_add_text(tree,
3691 tvb, curr_offset, 1,
3692 "Peak throughput: (%u) %s",oct>>4,str);
3696 case 0x00: str="Subscribed precedence/reserved"; break;
3697 case 0x01: str="High priority"; break;
3698 case 0x02: str="Normal priority"; break;
3699 case 0x03: str="Low priority"; break;
3700 case 0x07: str="Reserved"; break;
3701 default: str="Normal priority";
3704 proto_tree_add_text(tree,
3705 tvb, curr_offset, 1,
3706 "Precedence class: (%u) %s",oct&7,str);
3711 if ( curr_len == 0 )
3713 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3715 return(curr_offset - offset);
3718 oct = tvb_get_guint8(tvb, curr_offset);
3722 case 0x00: str="Subscribed peak throughput/reserved"; break;
3723 case 0x01: str="100 octet/h"; break;
3724 case 0x02: str="200 octet/h"; break;
3725 case 0x03: str="500 octet/h"; break;
3726 case 0x04: str="1 000 octet/h"; break;
3727 case 0x05: str="2 000 octet/h"; break;
3728 case 0x06: str="5 000 octet/h"; break;
3729 case 0x07: str="10 000 octet/h"; break;
3730 case 0x08: str="20 000 octet/h"; break;
3731 case 0x09: str="50 000 octet/h"; break;
3732 case 0x0a: str="100 000 octet/h"; break;
3733 case 0x0b: str="200 000 octet/h"; break;
3734 case 0x0c: str="500 000 octet/h"; break;
3735 case 0x0d: str="1 000 000 octet/h"; break;
3736 case 0x0e: str="2 000 000 octet/h"; break;
3737 case 0x0f: str="5 000 000 octet/h"; break;
3738 case 0x10: str="10 000 000 octet/h"; break;
3739 case 0x11: str="20 000 000 octet/h"; break;
3740 case 0x12: str="50 000 000 octet/h"; break;
3741 case 0x1e: str="Reserved"; break;
3742 case 0x1f: str="Best effort"; break;
3743 default: str="Best effort";
3746 proto_tree_add_text(tree,
3747 tvb, curr_offset, 1,
3748 "Mean throughput: (%u) %s",oct&0x1f,str);
3753 if ( curr_len == 0 )
3755 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3757 return(curr_offset - offset);
3760 proto_tree_add_item(tree, hf_gsm_a_qos_traffic_cls, tvb, curr_offset, 1, FALSE);
3761 proto_tree_add_item(tree, hf_gsm_a_qos_del_order, tvb, curr_offset, 1, FALSE);
3762 proto_tree_add_item(tree, hf_gsm_a_qos_del_of_err_sdu, tvb, curr_offset, 1, FALSE);
3767 if ( curr_len == 0 )
3769 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3771 return(curr_offset - offset);
3774 oct = tvb_get_guint8(tvb, curr_offset);
3778 case 0x00: str="Subscribed maximum SDU size/reserved"; break;
3779 case 0x97: str="1502 octets"; break;
3780 case 0x98: str="1510 octets"; break;
3781 case 0x99: str="1520 octets"; break;
3782 case 0xff: str="Reserved"; break;
3783 default: str="Unspecified";
3786 if (( oct >= 1 ) && ( oct <= 0x96 ))
3787 proto_tree_add_text(tree,
3788 tvb, curr_offset, 1,
3789 "Maximum SDU size: (%u) %u octets",oct,oct*10);
3791 proto_tree_add_text(tree,
3792 tvb, curr_offset, 1,
3793 "Maximum SDU size: (%u) %s",oct,str);
3798 if ( curr_len == 0 )
3800 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3802 return(curr_offset - offset);
3805 oct = tvb_get_guint8(tvb, curr_offset);
3809 case 0x00: str="Subscribed maximum bit rate for uplink/reserved"; break;
3810 case 0xff: str="0kbps"; break;
3811 default: str="This should not happen - BUG";
3814 if (( oct >= 1 ) && ( oct <= 0x3f ))
3815 proto_tree_add_text(tree,
3816 tvb, curr_offset, 1,
3817 "Maximum bit rate for uplink: (%u) %ukbps",oct,oct);
3818 else if (( oct >= 0x40 ) && ( oct <= 0x7f ))
3819 proto_tree_add_text(tree,
3820 tvb, curr_offset, 1,
3821 "Maximum bit rate for uplink: (%u) %ukbps",oct,(oct-0x40)*8+64); /* - was (oct-0x40)*8 */
3822 else if (( oct >= 0x80 ) && ( oct <= 0xfe ))
3823 proto_tree_add_text(tree,
3824 tvb, curr_offset, 1,
3825 "Maximum bit rate for uplink: (%u) %ukbps",oct,(oct-0x80)*64+576); /* - was (oct-0x80)*64 */
3827 proto_tree_add_text(tree,
3828 tvb, curr_offset, 1,
3829 "Maximum bit rate for uplink: (%u) %s",oct,str);
3834 if ( curr_len == 0 )
3836 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3838 return(curr_offset - offset);
3841 oct = tvb_get_guint8(tvb, curr_offset);
3845 case 0x00: str="Subscribed maximum bit rate for uplink/reserved"; break;
3846 case 0xff: str="0kbps"; break;
3847 default: str="This should not happen - BUG";
3850 if (( oct >= 1 ) && ( oct <= 0x3f ))
3851 proto_tree_add_text(tree,
3852 tvb, curr_offset, 1,
3853 "Maximum bit rate for downlink: (%u) %ukbps",oct,oct);
3854 else if (( oct >= 0x40 ) && ( oct <= 0x7f ))
3855 proto_tree_add_text(tree,
3856 tvb, curr_offset, 1,
3857 "Maximum bit rate for downlink: (%u) %ukbps",oct,(oct-0x40)*8+64);/*same as above*/
3858 else if (( oct >= 0x80 ) && ( oct <= 0xfe ))
3859 proto_tree_add_text(tree,
3860 tvb, curr_offset, 1,
3861 "Maximum bit rate for downlink: (%u) %ukbps",oct,(oct-0x80)*64+576);/*same as above*/
3863 proto_tree_add_text(tree,
3864 tvb, curr_offset, 1,
3865 "Maximum bit rate for downlink: (%u) %s",oct,str);
3870 if ( curr_len == 0 )
3872 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3874 return(curr_offset - offset);
3878 proto_tree_add_item(tree, hf_gsm_a_qos_ber, tvb, curr_offset, 1, FALSE);
3879 proto_tree_add_item(tree, hf_gsm_a_qos_sdu_err_rat, tvb, curr_offset, 1, FALSE);
3884 if ( curr_len == 0 )
3886 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3888 return(curr_offset - offset);
3892 oct = tvb_get_guint8(tvb, curr_offset);
3896 case 0x00: str="Subscribed transfer delay/reserved"; break;
3897 case 0x3f: str="Reserved"; break;
3898 default: str="This should not happen - BUG";
3903 if (( tmp_oct >= 1 ) && ( tmp_oct <= 0x0f ))
3904 proto_tree_add_text(tree,
3905 tvb, curr_offset, 1,
3906 "Transfer Delay: (%u) %ums",oct>>2,(oct>>2)*10);
3907 else if (( tmp_oct >= 0x10 ) && ( tmp_oct <= 0x1f ))
3908 proto_tree_add_text(tree,
3909 tvb, curr_offset, 1,
3910 "Transfer Delay: (%u) %ums",oct>>2,((oct>>2)-0x10)*50+200);
3911 else if (( tmp_oct >= 0x20 ) && ( tmp_oct <= 0x3e ))
3912 proto_tree_add_text(tree,
3913 tvb, curr_offset, 1,
3914 "Transfer Delay: (%u) %ums",oct>>2,((oct>>2)-0x20)*100+1000);
3916 proto_tree_add_text(tree,
3917 tvb, curr_offset, 1,
3918 "Transfer Delay: (%u) %s",oct>>2,str);
3922 case 0x00: str="Subscribed traffic handling priority/reserved"; break;
3923 case 0x01: str="Priority level 1"; break;
3924 case 0x02: str="Priority level 2"; break;
3925 case 0x03: str="Priority level 3"; break;
3926 default: str="This should not happen - BUG";
3929 proto_tree_add_text(tree,
3930 tvb, curr_offset, 1,
3931 "Traffic Handling priority: (%u) %s",oct&0x03,str);
3936 if ( curr_len == 0 )
3938 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3940 return(curr_offset - offset);
3944 oct = tvb_get_guint8(tvb, curr_offset);
3948 case 0x00: str="Subscribed guaranteed bit rate for uplink/reserved"; break;
3949 case 0xff: str="0kbps"; break;
3950 default: str="This should not happen - BUG";
3953 if (( oct >= 1 ) && ( oct <= 0x3f ))
3954 proto_tree_add_text(tree,
3955 tvb, curr_offset, 1,
3956 "Guaranteed bit rate for uplink: (%u) %ukbps",oct,oct);
3957 else if (( oct >= 0x40 ) && ( oct <= 0x7f ))
3958 proto_tree_add_text(tree,
3959 tvb, curr_offset, 1,
3960 "Guaranteed bit rate for uplink: (%u) %ukbps",oct,(oct-0x40)*8+64);/*same as for max bit rate*/
3961 else if (( oct >= 0x80 ) && ( oct <= 0xfe ))
3962 proto_tree_add_text(tree,
3963 tvb, curr_offset, 1,
3964 "Guaranteed bit rate for uplink: (%u) %ukbps",oct,(oct-0x80)*64+576);/*same as for max bit rate*/
3966 proto_tree_add_text(tree,
3967 tvb, curr_offset, 1,
3968 "Guaranteed bit rate for uplink: (%u) %s",oct,str);
3973 if ( curr_len == 0 )
3975 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
3977 return(curr_offset - offset);
3980 oct = tvb_get_guint8(tvb, curr_offset);
3984 case 0x00: str="Subscribed guaranteed bit rate for uplink/reserved"; break;
3985 case 0xff: str="0kbps"; break;
3986 default: str="This should not happen - BUG";
3989 if (( oct >= 1 ) && ( oct <= 0x3f ))
3990 proto_tree_add_text(tree,
3991 tvb, curr_offset, 1,
3992 "Guaranteed bit rate for downlink: (%u) %ukbps",oct,oct);
3993 else if (( oct >= 0x40 ) && ( oct <= 0x7f ))
3994 proto_tree_add_text(tree,
3995 tvb, curr_offset, 1,
3996 "Guaranteed bit rate for downlink: (%u) %ukbps",oct,(oct-0x40)*8+64);/*same as above*/
3997 else if (( oct >= 0x80 ) && ( oct <= 0xfe ))
3998 proto_tree_add_text(tree,
3999 tvb, curr_offset, 1,
4000 "Guaranteed bit rate for downlink: (%u) %ukbps",oct,(oct-0x80)*64+576);/*same as above*/
4002 proto_tree_add_text(tree,
4003 tvb, curr_offset, 1,
4004 "Guaranteed bit rate for downlink: (%u) %s",oct,str);
4009 if ( curr_len == 0 )
4011 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4013 return(curr_offset - offset);
4017 oct = tvb_get_guint8(tvb, curr_offset);
4019 switch ( (oct>>4)&1 )
4021 case 0x00: str="Not optimised for signalling traffic"; break;
4022 case 0x01: str="Optimised for signalling traffic"; break;
4023 default: str="This should not happen - BUG";
4026 proto_tree_add_text(tree,
4027 tvb, curr_offset, 1,
4028 "Signalling Indication: (%u) %s",(oct>>4)&1,str);
4032 case 0x00: str="unknown"; break;
4033 case 0x01: str="speech"; break;
4034 default: str="unknown";
4037 proto_tree_add_text(tree,
4038 tvb, curr_offset, 1,
4039 "Source Statistics Descriptor: (%u) %s",oct&7,str);
4044 if ( curr_len == 0 )
4046 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4048 return(curr_offset - offset);
4053 oct = tvb_get_guint8(tvb, curr_offset);
4057 case 0x00: str="Use the value indicated by the Maximum bit rate for downlink"; break;
4058 default: str="Unspecified";
4061 if (( oct >= 1 ) && ( oct <= 0x4a ))
4062 proto_tree_add_text(tree,
4063 tvb, curr_offset, 1,
4064 "Maximum bit rate for downlink (extended): (%u) %ukbps",oct,oct*100);
4065 if (( oct >= 0x4b ) && ( oct <= 0xba ))
4066 proto_tree_add_text(tree,
4067 tvb, curr_offset, 1,
4068 "Maximum bit rate for downlink (extended): (%u) %uMbps",oct,16 + oct- 0x4a);
4069 if (( oct >= 0xbb ) && ( oct <= 0xfa ))
4070 proto_tree_add_text(tree,
4071 tvb, curr_offset, 1,
4072 "Maximum bit rate for downlink (extended): (%u) %uMbps",oct,128 + oct - 0xba * 2);
4074 proto_tree_add_text(tree,
4075 tvb, curr_offset, 1,
4076 "Maximum bit rate for downlink (extended): (%u) %s",oct,str);
4081 if ( curr_len == 0 )
4083 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4085 return(curr_offset - offset);
4089 oct = tvb_get_guint8(tvb, curr_offset);
4093 case 0x00: str="Use the value indicated by the Guaranteed bit rate for downlink"; break;
4094 default: str="Unspecified";
4097 if (( oct >= 1 ) && ( oct <= 0x4a ))
4098 proto_tree_add_text(tree,
4099 tvb, curr_offset, 1,
4100 "Guaranteed bit rate for downlink (extended): (%u) %ukbps",oct,oct*100);
4101 if (( oct >= 0x4b ) && ( oct <= 0xba ))
4102 proto_tree_add_text(tree,
4103 tvb, curr_offset, 1,
4104 "Guaranteed bit rate for downlink (extended): (%u) %uMbps",oct,16 + oct- 0x4a);
4105 if (( oct >= 0xbb ) && ( oct <= 0xfa ))
4106 proto_tree_add_text(tree,
4107 tvb, curr_offset, 1,
4108 "Guaranteed bit rate for downlink (extended): (%u) %uMbps",oct,128 + oct - 0xba * 2);
4110 proto_tree_add_text(tree,
4111 tvb, curr_offset, 1,
4112 "Guaranteed bit rate for downlink (extended): (%u) %s",oct,str);
4117 if ( curr_len == 0 )
4119 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4121 return(curr_offset - offset);
4123 /* Maximum bit rate for uplink (extended) Octet 17 */
4124 oct = tvb_get_guint8(tvb, curr_offset);
4128 case 0x00: str="Use the value indicated by the Maximum bit rate for uplink"; break;
4129 default: str="Unspecified";
4132 if (( oct >= 1 ) && ( oct <= 0x4a ))
4133 proto_tree_add_text(tree,
4134 tvb, curr_offset, 1,
4135 "Maximum bit rate for uplink (extended): (%u) %ukbps",oct,oct*100);
4136 if (( oct >= 0x4b ) && ( oct <= 0xba ))
4137 proto_tree_add_text(tree,
4138 tvb, curr_offset, 1,
4139 "Maximum bit rate for uplink (extended): (%u) %uMbps",oct,16 + oct- 0x4a);
4140 if (( oct >= 0xbb ) && ( oct <= 0xfa ))
4141 proto_tree_add_text(tree,
4142 tvb, curr_offset, 1,
4143 "Maximum bit rate for uplink (extended): (%u) %uMbps",oct,128 + oct - 0xba * 2);
4145 proto_tree_add_text(tree,
4146 tvb, curr_offset, 1,
4147 "Maximum bit rate for uplink (extended): (%u) %s",oct,str);
4152 if ( curr_len == 0 )
4154 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4156 return(curr_offset - offset);
4159 /* Guaranteed bit rate for uplink (extended) Octet 18 */
4160 oct = tvb_get_guint8(tvb, curr_offset);
4164 case 0x00: str="Use the value indicated by the Guaranteed bit rate for uplink"; break;
4165 default: str="Unspecified";
4168 if (( oct >= 1 ) && ( oct <= 0x4a ))
4169 proto_tree_add_text(tree,
4170 tvb, curr_offset, 1,
4171 "Guaranteed bit rate for uplink (extended): (%u) %ukbps",oct,oct*100);
4172 if (( oct >= 0x4b ) && ( oct <= 0xba ))
4173 proto_tree_add_text(tree,
4174 tvb, curr_offset, 1,
4175 "Guaranteed bit rate for uplink (extended): (%u) %uMbps",oct,16 + oct- 0x4a);
4176 if (( oct >= 0xbb ) && ( oct <= 0xfa ))
4177 proto_tree_add_text(tree,
4178 tvb, curr_offset, 1,
4179 "Guaranteed bit rate for uplink (extended): (%u) %uMbps",oct,128 + oct - 0xba * 2);
4181 proto_tree_add_text(tree,
4182 tvb, curr_offset, 1,
4183 "Guaranteed bit rate for uplink (extended): (%u) %s",oct,str);
4187 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4189 return(curr_offset - offset);
4193 * [8] 10.5.6.6 SM cause
4196 de_sm_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len _U_)
4199 guint32 curr_offset;
4202 curr_offset = offset;
4204 oct = tvb_get_guint8(tvb, curr_offset);
4208 case 0x08: str="Operator Determined Barring"; break;
4209 case 0x18: str="MBMS bearer capabilities insufficient for the service"; break;
4210 case 0x19: str="LLC or SNDCP failure(GSM only)"; break;
4211 case 0x1a: str="Insufficient resources"; break;
4212 case 0x1b: str="Missing or unknown APN"; break;
4213 case 0x1c: str="Unknown PDP address or PDP type"; break;
4214 case 0x1d: str="User Authentication failed"; break;
4215 case 0x1e: str="Activation rejected by GGSN"; break;
4216 case 0x1f: str="Activation rejected, unspecified"; break;
4217 case 0x20: str="Service option not supported"; break;
4218 case 0x21: str="Requested service option not subscribed"; break;
4219 case 0x22: str="Service option temporarily out of order"; break;
4220 case 0x23: str="NSAPI already used (not sent)"; break;
4221 case 0x24: str="Regular deactivation"; break;
4222 case 0x25: str="QoS not accepted"; break;
4223 case 0x26: str="Network failure"; break;
4224 case 0x27: str="Reactivation required"; break;
4225 case 0x28: str="Feature not supported"; break;
4226 case 0x29: str="Semantic error in the TFT operation"; break;
4227 case 0x2a: str="Syntactical error in the TFT operation"; break;
4228 case 0x2b: str="Unknown PDP context"; break;
4229 case 0x2e: str="PDP context without TFT already activated"; break;
4230 case 0x2f: str="Multicast group membership time-out"; break;
4231 case 0x2c: str="Semantic errors in packet filter(s)"; break;
4232 case 0x2d: str="Syntactical errors in packet filter(s)"; break;
4233 case 0x51: str="Invalid transaction identifier value"; break;
4234 case 0x5f: str="Semantically incorrect message"; break;
4235 case 0x60: str="Invalid mandatory information"; break;
4236 case 0x61: str="Message type non-existent or not implemented"; break;
4237 case 0x62: str="Message type not compatible with the protocol state"; break;
4238 case 0x63: str="Information element non-existent or not implemented"; break;
4239 case 0x64: str="Conditional IE error"; break;
4240 case 0x65: str="Message not compatible with the protocol state"; break;
4241 case 0x6f: str="Protocol error, unspecified"; break;
4242 case 0x70: str="APN restriction value incompatible with active PDP context"; break;
4243 default: str="Protocol error, unspecified"; break;
4246 proto_tree_add_text(tree,
4247 tvb, curr_offset, 1,
4248 "Cause: (%u) %s %s",
4249 oct, str,add_string ? add_string : "");
4253 return(curr_offset - offset);
4260 de_sm_linked_ti(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4262 guint32 curr_offset;
4266 gchar ti_flag[2][80]={ "The message is sent from the side that originates the TI" ,
4267 "The message is sent to the side that originates the TI" };
4270 curr_offset = offset;
4272 oct = tvb_get_guint8(tvb, curr_offset);
4274 proto_tree_add_text(tree,
4275 tvb, curr_offset, 1,
4276 "TI flag: (%u) %s",oct>>7,ti_flag[oct>>7]);
4280 oct = tvb_get_guint8(tvb, curr_offset);
4282 proto_tree_add_text(tree,
4283 tvb, curr_offset, 1,
4284 "TI value: 0x%02x (%u)",oct&0x7f,oct&0x7f);
4286 proto_tree_add_text(tree,
4287 tvb, curr_offset, 1,
4288 "ext: 0x%02x (%u)",oct>>7,oct>>7);
4293 proto_tree_add_text(tree,
4294 tvb, curr_offset, 1,
4295 "TI value: 0x%02x (%u)",(oct>>4)&7,(oct>>4)&7);
4298 curr_offset+= curr_len;
4300 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4302 return(curr_offset - offset);
4309 de_sm_sapi(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len _U_)
4312 guint32 curr_offset;
4314 curr_offset = offset;
4316 oct = tvb_get_guint8(tvb, curr_offset);
4318 proto_tree_add_text(tree,
4319 tvb, curr_offset, 1,
4320 "LLC SAPI: 0x%02x (%u) %s",
4321 oct&0x0f, oct&0x0f,add_string ? add_string : "");
4325 return(curr_offset - offset);
4332 de_sm_tear_down(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len _U_)
4335 guint32 curr_offset;
4336 gchar str[2][30] = { "tear down not requested" , "tear down requested" };
4338 curr_offset = offset;
4340 oct = tvb_get_guint8(tvb, curr_offset);
4342 proto_tree_add_text(tree,
4343 tvb, curr_offset, 1,
4344 "Tear Down Indicator: (%u) %s %s",
4345 oct&1, str[oct&1],add_string ? add_string : "");
4349 return(curr_offset - offset);
4355 /* Packet Flow Identifier value (octet 3) */
4356 static const value_string gsm_a_packet_flow_id_vals[] = {
4357 { 0, "Best Effort"},
4368 de_sm_pflow_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4370 guint32 curr_offset;
4375 curr_offset = offset;
4377 oct = tvb_get_guint8(tvb, curr_offset);
4379 proto_tree_add_text(tree,
4380 tvb, curr_offset, 1,
4381 "Packet Flow Identifier: (%u) %s",oct&0x7f,
4382 val_to_str(oct&0x7f, gsm_a_packet_flow_id_vals, "dynamically assigned (%u)"));
4384 curr_offset+= curr_len;
4386 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
4388 return(curr_offset - offset);
4392 * [7] 10.5.6.12 TFT - Traffic Flow Template
4394 /* TFT operation code (octet 3) */
4395 static const value_string gsm_a_tft_op_code_vals[] = {
4397 { 1, "Create new TFT"},
4398 { 2, "Delete existing TFT"},
4399 { 3, "Add packet filters to existing TFT"},
4400 { 4, "Replace packet filters in existing TFT"},
4401 { 5, "Delete packet filters from existing TFT"},
4402 { 6, "No TFT operation"},
4407 static const true_false_string gsm_a_tft_e_bit = {
4408 "parameters list is included",
4409 "parameters list is not included"
4414 de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4416 guint32 curr_offset;
4418 proto_item *tf = NULL;
4419 proto_tree *tf_tree = NULL;
4420 proto_tree *comp_tree = NULL;
4422 guchar pkt_fil_count;
4429 gint pack_component_type;
4432 curr_offset = offset;
4435 * parse first octet. It contain TFT operation code, E bit and Number of packet filters
4437 oct = tvb_get_guint8(tvb, curr_offset);
4440 pkt_fil_count = oct&0x0f;
4443 proto_tree_add_item(tree,hf_gsm_a_tft_op_code,tvb,curr_offset,1,FALSE);
4444 proto_tree_add_item(tree,hf_gsm_a_tft_e_bit,tvb,curr_offset,1,FALSE);
4445 proto_tree_add_item(tree,hf_gsm_a_tft_pkt_flt,tvb,curr_offset,1,FALSE);
4450 /* Packet filter list dissect */
4453 if ( op_code == 2 ) /* delete TFT contains no packet filters. so we will jump over it */
4454 count = pkt_fil_count;
4455 while ( count < pkt_fil_count )
4457 tf = proto_tree_add_text(tree,
4458 tvb, curr_offset, 1,
4459 "Packet filter %d",count); /* 0-> 7 */
4461 tf_tree = proto_item_add_subtree(tf, ett_sm_tft );
4463 if ( op_code == 5 ) /* Delete packet filters from existing TFT - just a list of identifiers */
4465 if ((curr_offset-offset)<1) {
4466 proto_tree_add_text(tf_tree,tvb, curr_offset, 1,"Not enough data");
4467 return(curr_offset-offset);
4469 oct = tvb_get_guint8(tvb, curr_offset);
4473 proto_tree_add_text(tf_tree,
4474 tvb, curr_offset-1, 1,
4475 "Packet filter identifier: 0x%02x (%u)",oct,oct );
4477 else /* create new, Add packet filters or Replace packet filters */
4480 if ((curr_offset-offset)<1) {
4481 proto_tree_add_text(tf_tree,tvb, curr_offset, 1,"Not enough data");
4482 return(curr_offset-offset);
4484 pf_identifier = tvb_get_guint8(tvb, curr_offset);
4488 proto_tree_add_text(tf_tree,
4489 tvb, curr_offset-1, 1,
4490 "Packet filter identifier: %u (%u)",pf_identifier, pf_identifier);
4492 if ((curr_offset-offset)<1) {
4493 proto_tree_add_text(tf_tree,tvb, curr_offset, 1,"Not enough data");
4494 return(curr_offset-offset);
4496 oct = tvb_get_guint8(tvb, curr_offset);
4500 proto_tree_add_text(tf_tree,
4501 tvb, curr_offset-1, 1,
4502 "Packet evaluation precedence: 0x%02x (%u)",oct,oct );
4504 if ((curr_offset-offset)<1) { proto_tree_add_text(tf_tree,tvb, curr_offset, 1,"Not enough data"); return(curr_offset-offset);}
4505 pf_length = tvb_get_guint8(tvb, curr_offset);
4509 proto_tree_add_text(tf_tree,
4510 tvb, curr_offset-1, 1,
4511 "Packet filter length: 0x%02x (%u)",pf_length,pf_length );
4512 /* New tree for component */
4514 /* Dissect Packet filter Component */
4515 /* while ( filter_len > 1 ) */
4516 /* packet filter component type identifier: */
4518 if (pf_length > 0 ){
4519 if ((curr_offset-offset)<1) {
4520 proto_tree_add_text(tf_tree,tvb, curr_offset, 1,"Not enough data");
4521 return(curr_offset-offset);
4523 pack_component_type = tvb_get_guint8(tvb, curr_offset);
4527 tf=proto_tree_add_text(tf_tree,tvb, curr_offset-1, 1,"Packet filter component type identifier: ");
4528 comp_tree = proto_item_add_subtree(tf, ett_sm_tft );
4530 switch ( pack_component_type ){
4533 str="IPv4 source address type";
4534 proto_tree_add_item(comp_tree,hf_gsm_a_tft_ip4_address,tvb,curr_offset,4,FALSE);
4537 proto_tree_add_item(comp_tree,hf_gsm_a_tft_ip4_mask,tvb,curr_offset,4,FALSE);
4543 str="IPv6 source address type";
4544 proto_tree_add_item(comp_tree,hf_gsm_a_tft_ip6_address,tvb,curr_offset,16,FALSE);
4547 proto_tree_add_item(comp_tree,hf_gsm_a_tft_ip6_mask,tvb,curr_offset,16,FALSE);
4553 str="Protocol identifier/Next header type";
4554 proto_tree_add_item(comp_tree,hf_gsm_a_tft_protocol_header,tvb,curr_offset,1,FALSE);
4560 str="Single destination port type";
4561 proto_tree_add_item(comp_tree,hf_gsm_a_tft_port,tvb,curr_offset,2,FALSE);
4566 str="Destination port range type";
4567 proto_tree_add_item(comp_tree,hf_gsm_a_tft_port_low,tvb,curr_offset,2,FALSE);
4568 proto_tree_add_item(comp_tree,hf_gsm_a_tft_port_high,tvb,curr_offset,2,FALSE);
4574 str="Single source port type";
4575 proto_tree_add_item(comp_tree,hf_gsm_a_tft_port,tvb,curr_offset,2,FALSE);
4581 str="Source port range type";
4582 proto_tree_add_item(comp_tree,hf_gsm_a_tft_port_low,tvb,curr_offset,2,FALSE);
4583 proto_tree_add_item(comp_tree,hf_gsm_a_tft_port_high,tvb,curr_offset,2,FALSE);
4589 str="Security parameter index type";
4590 proto_tree_add_item(comp_tree,hf_gsm_a_tft_security,tvb,curr_offset,4,FALSE);
4597 str="Type of service/Traffic class type";
4598 proto_tree_add_item(comp_tree,hf_gsm_a_qos_traffic_cls,tvb,curr_offset,1,FALSE);
4599 proto_tree_add_item(comp_tree,hf_gsm_a_tft_traffic_mask,tvb,curr_offset,1,FALSE);
4605 str="Flow label type";
4606 proto_tree_add_item(comp_tree,hf_gsm_a_tft_traffic_mask,tvb,curr_offset,1,FALSE);
4612 str="not specified";
4614 proto_item_append_text(tf, "(%u) %s", pack_component_type, str );
4620 /* The parameters list contains a variable number of parameters that might need to be
4621 * transferred in addition to the packet filters. If the parameters list is included, the E
4622 * bit is set to 1; otherwise, the E bit is set to 0.
4625 proto_tree_add_text(tf_tree, tvb, curr_offset, 1, "Note: Possible Authorization Token/Flow Identifier not decoded yet");
4627 return(curr_offset - offset);
4630 guint16 (*gm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
4631 /* GPRS Mobility Management Information Elements 10.5.5 */
4632 de_gmm_attach_res, /* Attach Result */
4633 de_gmm_attach_type, /* Attach Type */
4634 de_gmm_ciph_alg, /* Cipher Algorithm */
4635 de_gmm_tmsi_stat, /* TMSI Status */
4636 de_gmm_detach_type, /* Detach Type */
4637 de_gmm_drx_param, /* DRX Parameter */
4638 de_gmm_ftostby, /* Force to Standby */
4639 de_gmm_ftostby_h, /* Force to Standby - Info is in the high nibble */
4640 de_gmm_ptmsi_sig, /* P-TMSI Signature */
4641 de_gmm_ptmsi_sig2, /* P-TMSI Signature 2 */
4642 de_gmm_ident_type2, /* Identity Type 2 */
4643 de_gmm_imeisv_req, /* IMEISV Request */
4644 de_gmm_rec_npdu_lst, /* Receive N-PDU Numbers List */
4645 de_gmm_ms_net_cap, /* MS Network Capability */
4646 de_gmm_ms_radio_acc_cap,/* MS Radio Access Capability */
4647 de_gmm_cause, /* GMM Cause */
4648 de_gmm_rai, /* Routing Area Identification */
4649 de_gmm_update_res, /* Update Result */
4650 de_gmm_update_type, /* Update Type */
4651 de_gmm_ac_ref_nr, /* A&C Reference Number */
4652 de_gmm_ac_ref_nr_h, /* A&C Reference Numer - Info is in the high nibble */
4653 de_gmm_service_type, /* Service Type */
4654 de_gmm_cell_notfi, /* Cell Notification */
4655 de_gmm_ps_lcs_cap, /* PS LCS Capability */
4656 de_gmm_net_feat_supp, /* Network Feature Support */
4657 de_gmm_rat_info_container, /* Inter RAT information container */
4658 /* Session Management Information Elements 10.5.6 */
4659 de_sm_apn, /* Access Point Name */
4660 de_sm_nsapi, /* Network Service Access Point Identifier */
4661 de_sm_pco, /* Protocol Configuration Options */
4662 de_sm_pdp_addr, /* Packet Data Protocol Address */
4663 de_sm_qos, /* Quality Of Service */
4664 de_sm_cause, /* SM Cause */
4665 de_sm_linked_ti, /* Linked TI */
4666 de_sm_sapi, /* LLC Service Access Point Identifier */
4667 de_sm_tear_down, /* Tear Down Indicator */
4668 de_sm_pflow_id, /* Packet Flow Identifier */
4669 de_sm_tflow_temp, /* Traffic Flow Template */
4670 /* GPRS Common Information Elements 10.5.7 */
4671 de_gc_context_stat, /* PDP Context Status */
4672 de_gc_radio_prio, /* Radio Priority */
4673 de_gc_timer, /* GPRS Timer */
4674 de_gc_timer2, /* GPRS Timer 2 */
4675 de_gc_radio_prio2, /* Radio Priority 2 */
4676 de_gc_mbms_context_stat,/* 10.5.7.6 MBMS context status */
4680 /* MESSAGE FUNCTIONS */
4686 dtap_gmm_attach_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4688 guint32 curr_offset;
4692 curr_offset = offset;
4695 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
4697 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP, NULL);
4699 /* Included in attach type
4701 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_CIPH_KEY_SEQ_NUM );
4706 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_ATTACH_TYPE );
4708 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_DRX_PARAM );
4710 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID , NULL);
4712 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAI );
4714 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_MS_RAD_ACC_CAP , NULL);
4716 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, " - Old P-TMSI Signature");
4718 ELEM_OPT_TV( 0x17 , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER , " - Ready Timer" );
4720 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , NULL);
4722 ELEM_OPT_TLV( 0x33 , GSM_A_PDU_TYPE_GM, DE_PS_LCS_CAP , NULL);
4724 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4731 dtap_gmm_attach_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4733 guint32 curr_offset;
4737 curr_offset = offset;
4740 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
4742 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND_H );
4746 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_ATTACH_RES );
4748 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER );
4750 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAD_PRIO_2 );
4754 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAD_PRIO );
4756 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAI );
4758 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG, NULL);
4760 ELEM_OPT_TV( 0x17 , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER , " - Negotiated Ready Timer" );
4762 ELEM_OPT_TLV( 0x18 , GSM_A_PDU_TYPE_COMMON, DE_MID , " - Allocated P-TMSI" );
4764 ELEM_OPT_TLV( 0x23 , GSM_A_PDU_TYPE_COMMON, DE_MID , NULL);
4766 ELEM_OPT_TV( 0x25 , GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE , NULL);
4768 ELEM_OPT_TLV( 0x2A , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2 , " - T3302" );
4770 ELEM_OPT_T( 0x8C , GSM_A_PDU_TYPE_GM, DE_CELL_NOT , NULL);
4772 ELEM_OPT_TLV( 0x4A , GSM_A_PDU_TYPE_COMMON, DE_PLMN_LIST , NULL);
4774 ELEM_OPT_TV_SHORT( 0xB0 , GSM_A_PDU_TYPE_GM, DE_NET_FEAT_SUP , NULL);
4776 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST , NULL);
4778 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4785 dtap_gmm_attach_com(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4788 guint32 curr_offset;
4789 /* guint32 consumed; */
4792 curr_offset = offset;
4795 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
4797 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4804 dtap_gmm_attach_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4806 guint32 curr_offset;
4810 curr_offset = offset;
4813 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
4815 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE );
4817 ELEM_OPT_TLV( 0x2A , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2 , " - T3302" );
4819 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4826 dtap_gmm_detach_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4828 guint32 curr_offset;
4832 curr_offset = offset;
4835 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
4837 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND_H );
4838 /* Force to standy might be wrong - To decode it correct, we need the direction */
4842 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_DETACH_TYPE );
4844 ELEM_OPT_TV( 0x25 , GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE , NULL);
4846 ELEM_OPT_TLV( 0x18 , GSM_A_PDU_TYPE_COMMON, DE_MID , " - P-TMSI" );
4848 ELEM_OPT_TLV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG , NULL);
4850 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4857 dtap_gmm_detach_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4859 guint32 curr_offset;
4863 curr_offset = offset;
4866 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
4868 if ( curr_len != 0 )
4870 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_SPARE_NIBBLE );
4874 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND );
4877 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4884 dtap_gmm_ptmsi_realloc_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4886 guint32 curr_offset;
4890 curr_offset = offset;
4893 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
4895 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID , " - Allocated P-TMSI" );
4897 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAI );
4899 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_SPARE_NIBBLE );
4903 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND );
4905 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_COMMON, DE_MID , " - P-TMSI Signature" );
4907 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4914 dtap_gmm_ptmsi_realloc_com(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4916 guint32 curr_offset;
4917 /* guint32 consumed; */
4920 curr_offset = offset;
4923 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
4925 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4932 dtap_gmm_auth_ciph_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4934 guint32 curr_offset;
4939 curr_offset = offset;
4942 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
4944 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_IMEISV_REQ );
4948 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_CIPH_ALG );
4950 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_AC_REF_NUM_H );
4954 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND );
4956 ELEM_OPT_TV( 0x21 , GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_RAND , NULL);
4959 ELEM_OPT_TV_SHORT( 0x08 , GSM_A_PDU_TYPE_COMMON, DE_CIPH_KEY_SEQ_NUM , NULL);
4963 oct = tvb_get_guint8(tvb, curr_offset);
4964 if (( oct & 0xf0 ) == 0x80 )
4966 /* The ciphering key sequence number is added here */
4967 proto_tree_add_text(tree,
4968 tvb, curr_offset, 1,
4969 "Ciphering key sequence number: 0x%02x (%u)",
4978 if ( curr_len == 0 )
4980 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4984 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_DTAP, DE_AUTH_PARAM_AUTN , NULL);
4986 EXTRANEOUS_DATA_CHECK(curr_len, 0);
4993 dtap_gmm_auth_ciph_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
4995 guint32 curr_offset;
4999 curr_offset = offset;
5002 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
5004 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_SPARE_NIBBLE );
5008 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_AC_REF_NUM );
5010 ELEM_OPT_TV( 0x22 , GSM_A_PDU_TYPE_DTAP, DE_AUTH_RESP_PARAM , NULL);
5012 ELEM_OPT_TLV( 0x23 , GSM_A_PDU_TYPE_COMMON, DE_MID , " - IMEISV" );
5014 ELEM_OPT_TLV( 0x29 , GSM_A_PDU_TYPE_DTAP, DE_AUTH_RESP_PARAM_EXT , NULL);
5016 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5023 dtap_gmm_auth_ciph_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5025 guint32 curr_offset;
5028 curr_offset = offset;
5031 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
5033 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5040 dtap_gmm_auth_ciph_fail(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5042 guint32 curr_offset;
5046 curr_offset = offset;
5049 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
5051 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE );
5053 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_DTAP, DE_AUTH_FAIL_PARAM , NULL);
5055 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5062 dtap_gmm_ident_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5064 guint32 curr_offset;
5067 curr_offset = offset;
5070 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
5072 /* If the half octect that are about to get decoded is the LAST in the octetstream, the macro will call return BEFORE we get a chance to fix the index. The end result will be that the first half-octet will be decoded but not the last. */
5074 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_ID_TYPE_2 );
5077 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND_H );
5080 elem_v(tvb, tree, GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND_H, curr_offset);
5081 elem_v(tvb, tree, GSM_A_PDU_TYPE_GM, DE_ID_TYPE_2, curr_offset);
5086 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5093 dtap_gmm_ident_res(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5095 guint32 curr_offset;
5099 curr_offset = offset;
5102 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
5104 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID , NULL);
5106 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5113 dtap_gmm_rau_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5115 guint32 curr_offset;
5119 curr_offset = offset;
5122 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
5124 /* is included in update type
5125 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_CIPH_KEY_SEQ_NUM );
5130 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_UPD_TYPE );
5132 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAI );
5134 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_MS_RAD_ACC_CAP , NULL);
5136 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG , " - Old P-TMSI Signature" );
5138 ELEM_OPT_TV( 0x17 , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER , " - Requested Ready Timer" );
5140 ELEM_OPT_TV( 0x27 , GSM_A_PDU_TYPE_GM, DE_DRX_PARAM , NULL);
5142 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , NULL);
5144 ELEM_OPT_TLV( 0x18 , GSM_A_PDU_TYPE_COMMON, DE_MID , " - P-TMSI" );
5146 ELEM_OPT_TLV( 0x31 , GSM_A_PDU_TYPE_GM, DE_MS_NET_CAP , NULL);
5148 ELEM_OPT_TLV( 0x32 , GSM_A_PDU_TYPE_GM, DE_PDP_CONTEXT_STAT , NULL);
5150 ELEM_OPT_TLV( 0x33 , GSM_A_PDU_TYPE_GM, DE_PS_LCS_CAP , NULL);
5152 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5159 dtap_gmm_rau_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5161 guint32 curr_offset;
5165 curr_offset = offset;
5168 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
5170 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_UPD_RES );
5174 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND );
5176 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER );
5178 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAI );
5180 ELEM_OPT_TV( 0x19 , GSM_A_PDU_TYPE_GM, DE_P_TMSI_SIG , NULL);
5182 ELEM_OPT_TLV( 0x18 , GSM_A_PDU_TYPE_COMMON, DE_MID , " - Allocated P-TMSI");
5184 ELEM_OPT_TLV( 0x23 , GSM_A_PDU_TYPE_COMMON, DE_MID , NULL);
5186 ELEM_OPT_TLV( 0x26 , GSM_A_PDU_TYPE_GM, DE_REC_N_PDU_NUM_LIST , NULL);
5188 ELEM_OPT_TV( 0x17 , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER , " - Negotiated Ready Timer" );
5190 ELEM_OPT_TV( 0x25 , GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE , NULL);
5192 ELEM_OPT_TLV( 0x2A , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2 , " - T3302" );
5194 ELEM_OPT_T( 0x8C , GSM_A_PDU_TYPE_GM, DE_CELL_NOT , NULL);
5196 ELEM_OPT_TLV( 0x4A , GSM_A_PDU_TYPE_COMMON, DE_PLMN_LIST , NULL);
5198 ELEM_OPT_TLV( 0x32 , GSM_A_PDU_TYPE_GM, DE_PDP_CONTEXT_STAT , NULL);
5200 ELEM_OPT_TV_SHORT ( 0xB0 , GSM_A_PDU_TYPE_GM, DE_NET_FEAT_SUP , NULL);
5202 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_DTAP, DE_EMERGENCY_NUM_LIST , NULL);
5204 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5211 dtap_gmm_rau_com(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5213 guint32 curr_offset;
5217 curr_offset = offset;
5220 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
5222 ELEM_OPT_TLV( 0x26 , GSM_A_PDU_TYPE_GM, DE_REC_N_PDU_NUM_LIST , NULL);
5223 /* Inter RAT information container 10.5.5.24 TS 24.008 version 6.8.0 Release 6 */
5224 /*TO DO: Implement */
5225 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_RAT_INFO_CONTAINER , NULL);
5227 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5234 dtap_gmm_rau_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5236 guint32 curr_offset;
5240 curr_offset = offset;
5243 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
5245 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE );
5247 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_SPARE_NIBBLE );
5251 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_FORCE_TO_STAND );
5253 ELEM_OPT_TLV( 0x26 , GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2 , " - T3302" );
5255 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5262 dtap_gmm_status(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5264 guint32 curr_offset;
5268 curr_offset = offset;
5271 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5273 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE );
5275 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5279 * [8] 9.4.19 GMM Information
5282 dtap_gmm_information(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5284 guint32 curr_offset;
5288 curr_offset = offset;
5291 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
5293 ELEM_OPT_TLV( 0x43 , GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME , " - Full Name" );
5295 ELEM_OPT_TLV( 0x45 , GSM_A_PDU_TYPE_DTAP, DE_NETWORK_NAME , " - Short Name" );
5297 ELEM_OPT_TV( 0x46 , GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE , NULL);
5299 ELEM_OPT_TV( 0x47 , GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE_TIME , NULL);
5301 ELEM_OPT_TLV( 0x48 , GSM_A_PDU_TYPE_DTAP, DE_LSA_ID , NULL);
5303 ELEM_OPT_TLV( 0x49 , GSM_A_PDU_TYPE_DTAP, DE_DAY_SAVING_TIME , NULL);
5305 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5312 dtap_gmm_service_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5314 guint32 curr_offset;
5318 curr_offset = offset;
5321 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_RECV;
5323 /* Is included in SRVC TYPE
5324 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_CIPH_KEY_SEQ_NUM );
5329 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SRVC_TYPE );
5331 /* P-TMSI Mobile station identity 10.5.1.4 M LV 6 */
5332 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, NULL);
5334 ELEM_OPT_TLV( 0x32 , GSM_A_PDU_TYPE_GM, DE_PDP_CONTEXT_STAT , NULL);
5336 /* MBMS context status 10.5.7.6 TLV 2 - 18 */
5337 ELEM_OPT_TLV( 0x35 , GSM_A_PDU_TYPE_GM, DE_MBMS_CTX_STATUS , NULL);
5339 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5346 dtap_gmm_service_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5348 guint32 curr_offset;
5352 curr_offset = offset;
5355 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
5357 ELEM_OPT_TLV( 0x32 , GSM_A_PDU_TYPE_GM, DE_PDP_CONTEXT_STAT , NULL);
5359 /* MBMS context status 10.5.7.6 TLV 2 - 18 */
5360 ELEM_OPT_TLV( 0x35 , GSM_A_PDU_TYPE_GM, DE_MBMS_CTX_STATUS , NULL);
5362 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5369 dtap_gmm_service_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5371 guint32 curr_offset;
5375 curr_offset = offset;
5378 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_SENT;
5380 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_GMM_CAUSE );
5382 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5386 * [8] 9.5.1 Activate PDP context request
5389 dtap_sm_act_pdp_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5391 guint32 curr_offset;
5395 curr_offset = offset;
5398 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5400 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_NET_SAPI );
5402 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_LLC_SAPI );
5404 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_QOS , " - Requested QoS" );
5406 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_PD_PRO_ADDR , " - Requested PDP address" );
5408 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL);
5410 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5412 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5416 * [8] 9.5.2 Activate PDP context accept
5419 dtap_sm_act_pdp_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5421 guint32 curr_offset;
5425 curr_offset = offset;
5428 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5430 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_LLC_SAPI );
5432 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
5435 /* This is done automatically */
5436 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SPARE );
5441 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAD_PRIO );
5443 ELEM_OPT_TLV( 0x2B , GSM_A_PDU_TYPE_GM, DE_PD_PRO_ADDR , NULL);
5445 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5447 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL);
5449 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5453 * [8] 9.5.3 Activate PDP context reject
5456 dtap_sm_act_pdp_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5458 guint32 curr_offset;
5462 curr_offset = offset;
5465 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5467 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SM_CAUSE );
5469 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5471 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5475 * [8] 9.5.4 Activate Secondary PDP Context Request
5478 dtap_sm_act_sec_pdp_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5480 guint32 curr_offset;
5484 curr_offset = offset;
5487 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5489 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_NET_SAPI );
5491 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_LLC_SAPI );
5493 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_QOS , " - Requested QoS" );
5495 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_LINKED_TI , NULL);
5497 /* 3GPP TS 24.008 version 6.8.0 Release 6, 36 TFT Traffic Flow Template 10.5.6.12 O TLV 3-257 */
5498 ELEM_OPT_TLV( 0x36 , GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , NULL);
5500 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5502 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5509 dtap_sm_act_sec_pdp_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5511 guint32 curr_offset;
5515 curr_offset = offset;
5518 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5520 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_LLC_SAPI );
5522 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
5524 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAD_PRIO);
5527 /* This is done automatically */
5528 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SPARE );
5533 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL);
5535 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5537 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5541 * [8] 9.5.6 Activate Secondary PDP Context Reject
5544 dtap_sm_act_sec_pdp_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5546 guint32 curr_offset;
5550 curr_offset = offset;
5553 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5555 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SM_CAUSE );
5557 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5559 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5563 * [8] 9.5.7 Request PDP context activation
5566 dtap_sm_req_pdp_act(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5568 guint32 curr_offset;
5572 curr_offset = offset;
5575 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5577 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_PD_PRO_ADDR , " - Offered PDP address" );
5579 ELEM_OPT_TLV( 0x28 , GSM_A_PDU_TYPE_GM, DE_ACC_POINT_NAME , NULL);
5581 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5583 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5587 * [8] 9.5.8 Request PDP context activation reject
5590 dtap_sm_req_pdp_act_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5592 guint32 curr_offset;
5596 curr_offset = offset;
5599 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5601 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SM_CAUSE );
5603 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5605 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5609 * [8] 9.5.9 Modify PDP context request (Network to MS direction)
5612 dtap_sm_mod_pdp_req_net(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5614 guint32 curr_offset;
5618 curr_offset = offset;
5621 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5623 ELEM_MAND_V(GSM_A_PDU_TYPE_GM,DE_RAD_PRIO);
5625 /* This is done automatically */
5626 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SPARE );
5631 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_LLC_SAPI );
5633 ELEM_MAND_LV(GSM_A_PDU_TYPE_GM, DE_QOS , " - New QoS" );
5635 ELEM_OPT_TLV( 0x2B , GSM_A_PDU_TYPE_GM, DE_PD_PRO_ADDR , NULL);
5637 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL);
5639 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5641 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5645 * [8] 9.5.10 Modify PDP context request (MS to network direction)
5648 dtap_sm_mod_pdp_req_ms(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5650 guint32 curr_offset;
5654 curr_offset = offset;
5657 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5659 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Requested LLC SAPI" );
5661 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Requested new QoS" );
5663 ELEM_OPT_TLV( 0x31 , GSM_A_PDU_TYPE_GM, DE_TRAFFIC_FLOW_TEMPLATE , " - New TFT" );
5665 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5667 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5671 * [8] 9.5.11 Modify PDP context accept (MS to network direction)
5674 dtap_sm_mod_pdp_acc_ms(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5676 guint32 curr_offset;
5680 curr_offset = offset;
5683 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5685 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5687 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5691 * [8] 9.5.12 Modify PDP context accept (Network to MS direction)
5694 dtap_sm_mod_pdp_acc_net(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5696 guint32 curr_offset;
5700 curr_offset = offset;
5703 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5705 ELEM_OPT_TLV( 0x30 , GSM_A_PDU_TYPE_GM, DE_QOS , " - Negotiated QoS" );
5707 ELEM_OPT_TV( 0x32 , GSM_A_PDU_TYPE_GM, DE_LLC_SAPI , " - Negotiated LLC SAPI" );
5709 ELEM_OPT_TV_SHORT ( 0x80 , GSM_A_PDU_TYPE_GM , DE_RAD_PRIO , " - New radio priority" );
5711 ELEM_OPT_TLV( 0x34 , GSM_A_PDU_TYPE_GM, DE_PACKET_FLOW_ID , NULL);
5713 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5715 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5719 * [8] 9.5.13 Modify PDP Context Reject
5722 dtap_sm_mod_pdp_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5724 guint32 curr_offset;
5728 curr_offset = offset;
5731 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5733 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SM_CAUSE );
5735 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5737 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5741 * [8] 9.5.14 Deactivate PDP context request
5744 dtap_sm_deact_pdp_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5746 guint32 curr_offset;
5750 curr_offset = offset;
5753 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5755 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SM_CAUSE );
5757 ELEM_OPT_TV_SHORT( 0x90 , GSM_A_PDU_TYPE_GM , DE_TEAR_DOWN_IND , NULL);
5759 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5761 /* MBMS context status 10.5.7.6 TLV 2 - 18 */
5762 ELEM_OPT_TLV( 0x35 , GSM_A_PDU_TYPE_GM, DE_MBMS_CTX_STATUS , NULL);
5764 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5768 * [8] 9.5.15 Deactivate PDP context accept
5771 dtap_sm_deact_pdp_acc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5773 guint32 curr_offset;
5777 curr_offset = offset;
5780 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5782 ELEM_OPT_TLV( 0x27 , GSM_A_PDU_TYPE_GM, DE_PRO_CONF_OPT , NULL);
5784 /* MBMS context status 10.5.7.6 TLV 2 - 18 */
5785 ELEM_OPT_TLV( 0x35 , GSM_A_PDU_TYPE_GM, DE_MBMS_CTX_STATUS , NULL);
5787 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5791 * [8] 9.5.21 SM Status
5794 dtap_sm_status(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
5796 guint32 curr_offset;
5800 curr_offset = offset;
5803 gsm_a_dtap_pinfo->p2p_dir = P2P_DIR_UNKNOWN;
5805 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_SM_CAUSE );
5807 EXTRANEOUS_DATA_CHECK(curr_len, 0);
5811 * [8] 9.5.22 Activate MBMS Context Request
5814 /* Requested MBMS NSAPI Enhanced Network service access point identifier 10.5.6.15 M V */
5815 /* Requested LLC SAPI LLC service access point identifier 10.5.6.9 M V 1 */
5816 /* Supported MBMS bearer capabilities MBMS bearer capabilities 10.5.6.14 M LV 2 - 3 */
5817 /* Requested multicast address Packet data protocol address 10.5.6.4 M LV 3 - 19 */
5818 /* Access point name Access point name 10.5.6.1 M LV 2 - 101 */
5819 /* 35 MBMS protocol configuration options MBMS protocol configuration options 10.5.6.15 O TLV 3 - 253 */
5822 * [8] 9.5.23 Activate MBMS Context Accept
5826 * [8] 9.5.24 Activate MBMS Context Reject
5830 * [8] 9.5.25 Request MBMS Context Activation
5834 * [8] 9.5.26 Request MBMS Context Activation Reject
5837 #define NUM_GSM_DTAP_MSG_GMM (sizeof(gsm_a_dtap_msg_gmm_strings)/sizeof(value_string))
5838 static gint ett_gsm_dtap_msg_gmm[NUM_GSM_DTAP_MSG_GMM];
5839 static void (*dtap_msg_gmm_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
5840 dtap_gmm_attach_req, /* Attach Request */
5841 dtap_gmm_attach_acc, /* Attach Accept */
5842 dtap_gmm_attach_com, /* Attach Complete */
5843 dtap_gmm_attach_rej, /* Attach Reject */
5844 dtap_gmm_detach_req, /* Detach Request */
5845 dtap_gmm_detach_acc, /* Detach Accept */
5846 dtap_gmm_rau_req, /* Routing Area Update Request */
5847 dtap_gmm_rau_acc, /* Routing Area Update Accept */
5848 dtap_gmm_rau_com, /* Routing Area Update Complete */
5849 dtap_gmm_rau_rej, /* Routing Area Update Reject */
5850 dtap_gmm_service_req, /* Service Request */
5851 dtap_gmm_service_acc, /* Service Accept */
5852 dtap_gmm_service_rej, /* Service Reject */
5853 dtap_gmm_ptmsi_realloc_cmd, /* P-TMSI Reallocation Command */
5854 dtap_gmm_ptmsi_realloc_com, /* P-TMSI Reallocation Complete */
5855 dtap_gmm_auth_ciph_req, /* Authentication and Ciphering Req */
5856 dtap_gmm_auth_ciph_resp, /* Authentication and Ciphering Resp */
5857 dtap_gmm_auth_ciph_rej, /* Authentication and Ciphering Rej */
5858 dtap_gmm_auth_ciph_fail, /* Authentication and Ciphering Failure */
5859 dtap_gmm_ident_req, /* Identity Request */
5860 dtap_gmm_ident_res, /* Identity Response */
5861 dtap_gmm_status, /* GMM Status */
5862 dtap_gmm_information, /* GMM Information */
5866 #define NUM_GSM_DTAP_MSG_SM (sizeof(gsm_a_dtap_msg_sm_strings)/sizeof(value_string))
5867 static gint ett_gsm_dtap_msg_sm[NUM_GSM_DTAP_MSG_SM];
5868 static void (*dtap_msg_sm_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
5869 dtap_sm_act_pdp_req, /* Activate PDP Context Request */
5870 dtap_sm_act_pdp_acc, /* Activate PDP Context Accept */
5871 dtap_sm_act_pdp_rej, /* Activate PDP Context Reject */
5872 dtap_sm_req_pdp_act, /* Request PDP Context Activation */
5873 dtap_sm_req_pdp_act_rej, /* Request PDP Context Activation rej. */
5874 dtap_sm_deact_pdp_req, /* Deactivate PDP Context Request */
5875 dtap_sm_deact_pdp_acc, /* Deactivate PDP Context Accept */
5876 dtap_sm_mod_pdp_req_net, /* Modify PDP Context Request(Network to MS direction) */
5877 dtap_sm_mod_pdp_acc_ms, /* Modify PDP Context Accept (MS to network direction) */
5878 dtap_sm_mod_pdp_req_ms, /* Modify PDP Context Request(MS to network direction) */
5879 dtap_sm_mod_pdp_acc_net, /* Modify PDP Context Accept (Network to MS direction) */
5880 dtap_sm_mod_pdp_rej, /* Modify PDP Context Reject */
5881 dtap_sm_act_sec_pdp_req, /* Activate Secondary PDP Context Request */
5882 dtap_sm_act_sec_pdp_acc, /* Activate Secondary PDP Context Accept */
5883 dtap_sm_act_sec_pdp_rej, /* Activate Secondary PDP Context Reject */
5884 NULL, /* Reserved: was allocated in earlier phases of the protocol */
5885 NULL, /* Reserved: was allocated in earlier phases of the protocol */
5886 NULL, /* Reserved: was allocated in earlier phases of the protocol */
5887 NULL, /* Reserved: was allocated in earlier phases of the protocol */
5888 NULL, /* Reserved: was allocated in earlier phases of the protocol */
5889 dtap_sm_status, /* SM Status */
5890 /* Activate MBMS Context Request */
5891 /* Activate MBMS Context Accept */
5892 /* Activate MBMS Context Reject */
5893 /* Request MBMS Context Activation */
5894 /* Request MBMS Context Activation Reject */
5898 void get_gmm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn)
5902 *msg_str = match_strval_idx((guint32) (oct & DTAP_GMM_IEI_MASK), gsm_a_dtap_msg_gmm_strings, &idx);
5903 *ett_tree = ett_gsm_dtap_msg_gmm[idx];
5904 *hf_idx = hf_gsm_a_dtap_msg_gmm_type;
5905 *msg_fcn = dtap_msg_gmm_fcn[idx];
5910 void get_sm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn)
5914 *msg_str = match_strval_idx((guint32) (oct & DTAP_SM_IEI_MASK), gsm_a_dtap_msg_sm_strings, &idx);
5915 *ett_tree = ett_gsm_dtap_msg_sm[idx];
5916 *hf_idx = hf_gsm_a_dtap_msg_sm_type;
5917 *msg_fcn = dtap_msg_sm_fcn[idx];
5922 /* Register the protocol with Wireshark */
5924 proto_register_gsm_a_gm(void)
5929 /* Setup list of header fields */
5931 static hf_register_info hf[] =
5933 { &hf_gsm_a_dtap_msg_gmm_type,
5934 { "DTAP GPRS Mobility Management Message Type", "gsm_a.dtap_msg_gmm_type",
5935 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_gmm_strings), 0x0,
5938 { &hf_gsm_a_dtap_msg_sm_type,
5939 { "DTAP GPRS Session Management Message Type", "gsm_a.dtap_msg_sm_type",
5940 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_sm_strings), 0x0,
5943 { &hf_gsm_a_gm_elem_id,
5944 { "Element ID", "gsm_a_gm.elem_id",
5945 FT_UINT8, BASE_DEC, NULL, 0,
5948 { &hf_gsm_a_qos_delay_cls,
5949 { "Quality of Service Delay class", "gsm_a.qos.delay_cls",
5950 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_delay_cls_vals), 0x38,
5953 { &hf_gsm_a_qos_qos_reliability_cls,
5954 { "Reliability class", "gsm_a.qos.delay_cls",
5955 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_delay_cls_vals), 0x07,
5958 { &hf_gsm_a_qos_traffic_cls,
5959 { "Traffic class", "gsm_a.qos.traffic_cls",
5960 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_traffic_cls_vals), 0xe0,
5963 { &hf_gsm_a_qos_del_order,
5964 { "Delivery order", "gsm_a.qos.del_order",
5965 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_traffic_cls_vals), 0x18,
5968 { &hf_gsm_a_qos_del_of_err_sdu,
5969 { "Delivery of erroneous SDUs", "gsm_a.qos.del_of_err_sdu",
5970 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_del_of_err_sdu_vals), 0x03,
5973 { &hf_gsm_a_qos_ber,
5974 { "Residual Bit Error Rate (BER)", "gsm_a.qos.ber",
5975 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_ber_vals), 0xf0,
5978 { &hf_gsm_a_qos_sdu_err_rat,
5979 { "SDU error ratio", "gsm_a.qos.sdu_err_rat",
5980 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_sdu_err_rat_vals), 0x0f,
5983 { &hf_gsm_a_qos_traff_hdl_pri,
5984 { "Traffic handling priority", "gsm_a.qos.traff_hdl_pri",
5985 FT_UINT8, BASE_DEC, VALS(gsm_a_qos_traff_hdl_pri_vals), 0x03,
5988 { &hf_gsm_a_gmm_split_on_ccch,
5989 { "SPLIT on CCCH","gsm_a.gmm.split_on_ccch",
5990 FT_BOOLEAN,8, TFS(&gsm_a_gmm_split_on_ccch_value), 0x08,
5993 { &hf_gsm_a_gmm_non_drx_timer,
5994 { "Non-DRX timer","gsm_a.gmm.non_drx_timer",
5995 FT_UINT8,BASE_DEC, VALS(gsm_a_gmm_non_drx_timer_strings), 0x07,
5998 { &hf_gsm_a_gmm_cn_spec_drs_cycle_len_coef,
5999 { "CN Specific DRX cycle length coefficient","gsm_a.gmm.cn_spec_drs_cycle_len_coef",
6000 FT_UINT8,BASE_DEC, VALS(gsm_a_gmm_cn_spec_drs_cycle_len_coef_strings), 0xf0,
6003 { &hf_gsm_a_tft_op_code,
6004 { "TFT operation code", "gsm_a.tft.op_code",
6005 FT_UINT8, BASE_DEC, VALS(gsm_a_tft_op_code_vals), 0xe0,
6008 { &hf_gsm_a_tft_e_bit,
6009 { "E bit","gsm_a.tft.e_bit",
6010 FT_BOOLEAN,8, TFS(&gsm_a_tft_e_bit), 0x10,
6013 { &hf_gsm_a_tft_pkt_flt,
6014 { "Number of packet filters", "gsm_a.tft.pkt_flt",
6015 FT_UINT8, BASE_DEC, NULL, 0x0f,
6018 { &hf_gsm_a_tft_ip4_address,
6019 { "IPv4 adress", "gsm_a.tft.ip4_address",
6020 FT_IPv4, BASE_NONE, NULL, 0x0,
6023 { &hf_gsm_a_tft_ip4_mask,
6024 { "IPv4 address mask", "gsm_a.tft.ip4_mask",
6025 FT_IPv4, BASE_NONE, NULL, 0x0,
6028 { &hf_gsm_a_tft_ip6_address,
6029 { "IPv6 adress", "gsm_a.tft.ip6_address",
6030 FT_IPv6, BASE_NONE, NULL, 0x0,
6033 { &hf_gsm_a_tft_ip6_mask,
6034 { "IPv6 adress mask", "gsm_a.tft.ip6_mask",
6035 FT_IPv6, BASE_NONE, NULL, 0x0,
6038 { &hf_gsm_a_tft_protocol_header,
6039 { "Protocol/header", "gsm_a.tft.protocol_header",
6040 FT_UINT8, BASE_HEX, NULL, 0x0,
6043 { &hf_gsm_a_tft_port,
6044 { "Port", "gsm_a.tft.port",
6045 FT_UINT16, BASE_DEC, NULL, 0x0,
6048 { &hf_gsm_a_tft_port_low,
6049 { "Low limit port", "gsm_a.tft.port_low",
6050 FT_UINT16, BASE_DEC, NULL, 0x0,
6053 { &hf_gsm_a_tft_port_high,
6054 { "High limit port", "gsm_a.tft.port_high",
6055 FT_UINT16, BASE_DEC, NULL, 0x0,
6058 { &hf_gsm_a_tft_security,
6059 { "IPSec security parameter index", "gsm_a.tft.security",
6060 FT_UINT32, BASE_HEX, NULL, 0x0,
6063 { &hf_gsm_a_tft_traffic_mask,
6064 { "Mask field", "gsm_a.tft.traffic_mask",
6065 FT_UINT8, BASE_HEX, NULL, 0x0,
6068 { &hf_gsm_a_ptmsi_sig,
6069 { "P-TMSI Signature", "gsm_a.ptmsi_sig",
6070 FT_UINT24, BASE_HEX, NULL, 0x0,
6073 { &hf_gsm_a_ptmsi_sig2,
6074 { "P-TMSI Signature 2", "gsm_a.ptmsi_sig2",
6075 FT_UINT24, BASE_HEX, NULL, 0x0,
6078 { &hf_gsm_a_gm_acc_tech_type,
6079 { "Access Technology Type", "gsm_a.gm.acc_tech_type",
6080 FT_UINT8, BASE_DEC, VALS(gsm_a_gm_acc_tech_type_vals), 0x0,
6083 { &hf_gsm_a_gm_acc_cap_struct_len,
6084 { "Length in bits", "gsm_a.gm.acc_cap_struct_len",
6085 FT_UINT8, BASE_HEX_DEC,NULL, 0x0,
6088 { &hf_gsm_a_gm_sms_value,
6089 { "SMS_VALUE (Switch-Measure-Switch)", "gsm_a.gm.sms",
6090 FT_UINT8, BASE_DEC, VALS(gsm_a_gm_sm_vals), 0x0,
6093 { &hf_gsm_a_gm_sm_value,
6094 { "(SM_VALUE) Switch-Measure", "gsm_a.gm.sm",
6095 FT_UINT8, BASE_DEC, VALS(gsm_a_gm_sm_vals), 0x0,
6098 { &hf_gsm_a_gm_sm_ext,
6099 { "Ext", "gsm_a.gm.sm.ext",
6100 FT_UINT8, BASE_HEX, NULL, 0x80,
6105 /* Setup protocol subtree array */
6106 #define NUM_INDIVIDUAL_ELEMS 15
6107 gint *ett[NUM_INDIVIDUAL_ELEMS +
6108 NUM_GSM_DTAP_MSG_GMM + NUM_GSM_DTAP_MSG_SM +
6111 ett[0] = &ett_tc_component;
6112 ett[1] = &ett_tc_invoke_id;
6113 ett[2] = &ett_tc_linked_id;
6114 ett[3] = &ett_tc_opr_code;
6115 ett[4] = &ett_tc_err_code;
6116 ett[5] = &ett_tc_prob_code;
6117 ett[6] = &ett_tc_sequence;
6118 ett[7] = &ett_gmm_drx;
6119 ett[8] = &ett_gmm_detach_type;
6120 ett[9] = &ett_gmm_attach_type;
6121 ett[10] = &ett_gmm_context_stat;
6122 ett[11] = &ett_gmm_update_type;
6123 ett[12] = &ett_gmm_radio_cap;
6124 ett[13] = &ett_gmm_rai;
6125 ett[14] = &ett_sm_tft;
6127 last_offset = NUM_INDIVIDUAL_ELEMS;
6129 for (i=0; i < NUM_GSM_DTAP_MSG_GMM; i++, last_offset++)
6131 ett_gsm_dtap_msg_gmm[i] = -1;
6132 ett[last_offset] = &ett_gsm_dtap_msg_gmm[i];
6135 for (i=0; i < NUM_GSM_DTAP_MSG_SM; i++, last_offset++)
6137 ett_gsm_dtap_msg_sm[i] = -1;
6138 ett[last_offset] = &ett_gsm_dtap_msg_sm[i];
6141 for (i=0; i < NUM_GSM_GM_ELEM; i++, last_offset++)
6143 ett_gsm_gm_elem[i] = -1;
6144 ett[last_offset] = &ett_gsm_gm_elem[i];
6148 proto_register_protocol("GSM A-I/F GPRS Mobility and Session Management", "GSM Management", "gsm_a_gm");
6150 proto_register_field_array(proto_a_gm, hf, array_length(hf));
6152 proto_register_subtree_array(ett, array_length(ett));
6154 /* subdissector code */
6155 gprs_sm_pco_subdissector_table = register_dissector_table("sm_pco.protocol",
6156 "GPRS SM PCO PPP protocol", FT_UINT16, BASE_HEX);
6160 proto_reg_handoff_gsm_a_gm(void)
6162 data_handle = find_dissector("data");
6163 rrc_irat_ho_info_handle = find_dissector("rrc.irat.irat_ho_info");