checkAPIs.pl: support for new-style dissectors in check_hf_entries
[metze/wireshark/wip.git] / epan / dissectors / packet-gsm_a_rr.c
1 /* packet-gsm_a_rr.c
2  * Routines for GSM A Interface (actually A-bis really) RR dissection - A.K.A. GSM layer 3 Radio Resource Protocol
3  *
4  * Copyright 2003, Michael Lum <mlum [AT] telostech.com>
5  * In association with Telos Technology Inc.
6  *
7  * Added Dissection of Radio Resource Management Information Elements
8  * and other enhancements and fixes.
9  * Copyright 2005 - 2006, Anders Broman [AT] ericsson.com
10  *
11  * Added Dissection of E-UTRAN Description struct in
12  * Cell selection indicator after release of all TCH and SDCCH IE
13  * Lars Sundstrom X [AT] ericsson.com and Kjell Jansson [AT] ericsson.com
14  * On Behalf of Ericsson AB
15  *
16  * Title        3GPP            Other
17  *
18  *   Reference [3]
19  *   Mobile radio interface Layer 3 specification;
20  *   Core network protocols;
21  *   Stage 3
22  *   (3GPP TS 24.008 version 4.7.0 Release 4)
23  *   (ETSI TS 124 008 V6.8.0 (2005-03))
24  *
25  *   Reference [4]
26  *   Mobile radio interface layer 3 specification;
27  *   Radio Resource Control Protocol
28  *   (GSM 04.18 version 8.4.1 Release 1999)
29  *   (3GPP TS 04.18 version 8.26.0 Release 1999)
30  *
31  * Wireshark - Network traffic analyzer
32  * By Gerald Combs <gerald@wireshark.org>
33  * Copyright 1998 Gerald Combs
34  *
35  * SPDX-License-Identifier: GPL-2.0-or-later
36  */
37
38 #include "config.h"
39
40 #include <epan/packet.h>
41 #include <epan/tap.h>
42 #include <epan/expert.h>
43 #include "packet-ber.h"
44 #include "packet-gsm_a_common.h"
45 #include "packet-ppp.h"
46
47 #include "packet-gsm_a_rr.h"
48
49 void proto_register_gsm_a_rr(void);
50 void proto_reg_handoff_gsm_a_rr(void);
51
52 static dissector_handle_t rrc_irat_ho_info_handle;
53 static dissector_handle_t rrc_irat_ho_to_utran_cmd_handle;
54
55 #define PADDING_BYTE 0x2B
56
57 /* 3GPP TS 44.018 version 11.2.0 Release 11 */
58 const value_string gsm_a_dtap_msg_rr_strings[] = {
59     { 0x3c, "Reserved" },
60     { 0x3b, "Additional Assignment" },
61     { 0x3f, "Immediate Assignment" },
62     { 0x39, "Immediate Assignment Extended" },
63     { 0x3a, "Immediate Assignment Reject" },
64     { 0x6a, "EC-Immediate Assignment Type 1"},
65
66     { 0x48, "DTM Assignment Failure" },
67     { 0x49, "DTM Reject" },
68     { 0x4a, "DTM Request" },
69     { 0x4b, "Packet Assignment" },
70     { 0x4c, "DTM Assignment Command" },
71     { 0x4d, "DTM Information" },
72     { 0x4e, "Packet Notification" },
73
74     { 0x35, "Ciphering Mode Command" },
75     { 0x32, "Ciphering Mode Complete" },
76
77     { 0x30, "Configuration Change Command" },
78     { 0x31, "Configuration Change Ack." },
79     { 0x33, "Configuration Change Reject" },
80
81     { 0x2e, "Assignment Command" },
82     { 0x29, "Assignment Complete" },
83     { 0x2f, "Assignment Failure" },
84     { 0x2b, "Handover Command" },
85     { 0x2c, "Handover Complete" },
86     { 0x28, "Handover Failure" },
87     { 0x2d, "Physical Information" },
88
89     { 0x08, "RR-cell Change Order" },
90     { 0x23, "PDCH Assignment Command" },
91
92     { 0x0d, "Channel Release" },
93     { 0x0a, "Partial Release" },
94     { 0x0f, "Partial Release Complete" },
95
96     { 0x21, "Paging Request Type 1" },
97     { 0x22, "Paging Request Type 2" },
98     { 0x24, "Paging Request Type 3" },
99     { 0x27, "Paging Response" },
100     { 0x20, "Notification/NCH" },
101     { 0x25, "Reserved" },
102     { 0x26, "Notification/Response" },
103
104     { 0x0b, "Reserved" },
105
106 #if 0
107 /* ETSI TS 101 503 V8.5.0 Seems to give Other def for this Messages??? */
108     { 0xc0, "Utran Classmark Change" }, CONFLICTS WITH Handover To UTRAN Command
109     { 0xc1, "UE RAB Preconfiguration" },
110     { 0xc2, "cdma2000 Classmark Change" },
111 #endif
112
113     /* ETSI TS 101 503 V8.5.0 */
114     { 0x60, "Utran Classmark Change" },
115     { 0x62, "cdma2000 Classmark Change" },
116     { 0x63, "Inter System to UTRAN Handover Command" },
117     { 0x64, "Inter System to cdma2000 Handover Command" },
118     { 0x18, "System Information Type 8" },
119     { 0x19, "System Information Type 1" },
120     { 0x1a, "System Information Type 2" },
121     { 0x1b, "System Information Type 3" },
122     { 0x1c, "System Information Type 4" },
123     { 0x1d, "System Information Type 5" },
124     { 0x1e, "System Information Type 6" },
125     { 0x1f, "System Information Type 7" },
126
127     { 0x02, "System Information Type 2bis" },
128     { 0x03, "System Information Type 2ter" },
129     { 0x07, "System Information Type 2quater" },
130     { 0x05, "System Information Type 5bis" },
131     { 0x06, "System Information Type 5ter" },
132     { 0x04, "System Information Type 9" },
133     { 0x00, "System Information Type 13" },
134
135     { 0x3d, "System Information Type 16" },
136     { 0x3e, "System Information Type 17" },
137
138     { 0x40, "System Information Type 18" },
139     { 0x41, "System Information Type 19" },
140     { 0x42, "System Information Type 20" },
141     { 0x46, "System Information Type 21" },
142
143     { 0x10, "Channel Mode Modify" },
144     { 0x12, "RR Status" },
145     { 0x17, "Channel Mode Modify Acknowledge" },
146     { 0x14, "Frequency Redefinition" },
147     { 0x15, "Measurement Report" },
148     { 0x16, "Classmark Change" },
149     { 0x13, "Classmark Enquiry" },
150     { 0x36, "Extended Measurement Report" },
151     { 0x37, "Extended Measurement Order" },
152     { 0x34, "GPRS Suspension Request" },
153
154     { 0x09, "VGCS Uplink Grant" },
155     { 0x0e, "Uplink Release" },
156     { 0x0c, "Reserved" },
157     { 0x2a, "Uplink Busy" },
158     { 0x11, "Talker Indication" },
159
160     { 0xc0, "UTRAN Classmark Change/Handover To UTRAN Command" }, /* spec conflict */
161
162     { 0x38, "Application Information" },
163
164     {    0, NULL }
165 };
166
167 const value_string gsm_a_dtap_msg_rr_ec_ccch_strings[] = {
168     /* Channel establishment messages */
169     { 0x01, "EC-Immediate Assignment Type 2" },
170     { 0x02, "EC-Immediate Assignment Reject" },
171     { 0x03, "EC-Dummy" },
172     { 0x04, "EC-Downlink Assignment" },
173     { 0x09, "EC-Paging Request" },
174
175     {    0, NULL }
176 };
177
178 static const value_string gsm_rr_elem_strings[] = {
179     /* Radio Resource Management Information Elements 10.5.2, most are from 10.5.1 */
180     { DE_RR_BA_RANGE, "BA Range" },                                     /* [3]  10.5.2.1a BA Range */
181     { DE_RR_CELL_CH_DSC, "Cell Channel Description" },                  /* [3]  10.5.2.1b */
182     { DE_RR_BA_LIST_PREF, "BA List Pref" },                             /* [3]  10.5.2.1c BA List Pref */
183     { DE_RR_UTRAN_FREQ_LIST, "UTRAN Frequency List" },                  /* [3]  10.5.2.1d UTRAN Frequency List */
184     { DE_RR_CELL_SELECT_INDIC, "Cell Selection Indicator after Release of all TCH and SDCCH" }, /* [3]  10.5.2.1e   Cell selection indicator after release of all TCH and SDCCH IE */
185     { DE_RR_CELL_DSC, "Cell Description" },                             /* 10.5.2.2  */
186     { DE_RR_CELL_OPT_BCCH, "Cell Options (BCCH)" },                     /* [3]  10.5.2.3    Cell Options (BCCH) */
187     { DE_RR_CELL_OPT_SACCH, "Cell Options (SACCH)" },                   /* [3]  10.5.2.3a   Cell Options (SACCH) */
188     { DE_RR_CELL_SEL_PARAM, "Cell Selection Parameters" },              /* [3]  10.5.2.4    Cell Selection Parameters */
189 /* [3]  10.5.2.4a   (void) */
190     { DE_RR_CH_DSC, "Channel Description" },                            /* 10.5.2.5  */
191     { DE_RR_CH_DSC2, "Channel Description 2" },                         /* 10.5.2.5a */
192     { DE_RR_CH_DSC3, "Channel Description 3" },                         /* 10.5.2.5c */
193     { DE_RR_CH_MODE, "Channel Mode" },                                  /* [3]  10.5.2.6 */
194     { DE_RR_CH_MODE2, "Channel Mode 2" },                               /* [3]  10.5.2.7 */
195     { DE_RR_UTRAN_CM, "UTRAN Classmark" },                              /* [3]  10.5.2.7a   */
196 /* [3]  10.5.2.7b   (void) */
197     { DE_RR_CM_ENQ_MASK, "Classmark Enquiry Mask" },                    /* [3]  10.5.2.7c */
198 /* [3]  10.5.2.7d   GERAN Iu Mode Classmark information element */
199     { DE_RR_CHNL_NEEDED, "Channel Needed"},                             /* [3]  10.5.2.8    */
200     /* [3]  10.5.2.8a   (void) */
201     { DE_RR_CHNL_REQ_DESC2, "Channel Request Description 2"},           /* [3]  10.5.2.8b   Channel Request Description 2 */
202     /* Pos 20 */
203     { DE_RR_CIP_MODE_SET, "Cipher Mode Setting" },                      /* [3]  10.5.2.9    */
204     { DE_RR_CIP_MODE_RESP, "Cipher Mode Response" },                    /* [3]  10.5.2.10   */
205     { DE_RR_CTRL_CH_DESC, "Control Channel Description" },              /* [3]  10.5.2.11   Control Channel Description */
206     { DE_RR_DTM_INFO_DETAILS, "DTM Information Details" },              /* [3]  10.5.2.11a  DTM Information Details */
207     { DE_RR_DYN_ARFCN_MAP, "Dynamic ARFCN Mapping" },                   /* [3]  10.5.2.11b  */
208     { DE_RR_FREQ_CH_SEQ, "Frequency Channel Sequence" },                /* [3]  10.5.2.12   */
209     { DE_RR_FREQ_LIST, "Frequency List" },                              /* 10.5.2.13        */
210     { DE_RR_FREQ_SHORT_LIST, "Frequency Short List" },                  /* 10.5.2.14        */
211     { DE_RR_FREQ_SHORT_LIST2, "Frequency Short List 2" },               /* 10.5.2.14a       */
212 /* [3]  10.5.2.14b  Group Channel Description */
213     { DE_RR_GPRS_RESUMPTION, "GPRS Resumption" },                       /* [3]  10.5.2.14c  GPRS Resumption */
214     { DE_RR_GPRS_BROADCAST_INFORMATION, "GPRS Broadcast Information" }, /* [3]  10.5.2.14d  GPRS broadcast information */
215 /* [3]  10.5.2.14e  Enhanced DTM CS Release Indication */
216     { DE_RR_HO_REF, "Handover Reference" },                             /* 10.5.2.15        */
217     { DE_RR_IA_REST_OCT, "IA Rest Octets" },                            /* [3] 10.5.2.16    */
218     { DE_RR_IAR_REST_OCT, "IAR Rest Octets" },                          /* [3] 10.5.2.17 IAR Rest Octets */
219     { DE_RR_IAX_REST_OCT, "IAX Rest Octets" },                          /* [3] 10.5.2.18 IAX Rest Octets */
220     { DE_RR_L2_PSEUDO_LEN, "L2 Pseudo Length" },                        /* [3] 10.5.2.19    */
221     { DE_RR_MEAS_RES, "Measurement Results" },                          /* [3] 10.5.2.20 Measurement Results */
222 /*
223  * [3] 10.5.2.20a GPRS Measurement Results
224  */
225     { DE_RR_MOB_ALL, "Mobile Allocation" },                             /* [3] 10.5.2.21    */
226     { DE_RR_MOB_TIME_DIFF, "Mobile Time Difference" },                  /* [3] 10.5.2.21a   */
227     { DE_RR_MULTIRATE_CONF, "MultiRate configuration" },                /* [3] 10.5.2.21aa  */
228     /* Pos 30 */
229     { DE_RR_MULT_ALL, "Multislot Allocation" },                         /* [3] 10.5.2.21b   */
230     /*
231      * [3] 10.5.2.21c NC mode
232      */
233     { DE_RR_NEIGH_CELL_DESC, "Neighbour Cell Description" },            /* [3] 10.5.2.22 Neighbour Cell Description */
234     { DE_RR_NEIGH_CELL_DESC2, "Neighbour Cell Description 2" },         /* [3] 10.5.2.22a Neighbour Cell Description 2 */
235 /*
236  * [3] 10.5.2.22b (void)
237  * [3] 10.5.2.22c NT/N Rest Octets */
238     { DE_RR_P1_REST_OCT, "P1 Rest Octets" },                            /* [3] 10.5.2.23 P1 Rest Octets */
239     { DE_RR_P2_REST_OCT, "P2 Rest Octets" },                            /* [3] 10.5.2.24 P2 Rest Octets */
240     { DE_RR_P3_REST_OCT, "P3 Rest Octets" },                            /* [3] 10.5.2.25 P3 Rest Octets */
241     { DE_RR_PACKET_CH_DESC, "Packet Channel Description" },             /* [3] 10.5.2.25a   */
242     { DE_RR_DED_MOD_OR_TBF, "Dedicated mode or TBF" },                  /* [3] 10.5.2.25b */
243     { DE_RR_PKT_UL_ASS, "Packet Uplink Assignment" },                   /* [3] 10.5.2.25c RR Packet Uplink Assignment */
244     { DE_RR_PKT_DL_ASS, "Packet Downlink Assignment" },                 /* [3] 10.5.2.25d RR Packet Downlink Assignment */
245     { DE_RR_PKT_DL_ASS_TYPE2, "Packet Downlink Assignment Type 2" },    /* [3] 110.5.2.25e RR Packet Downlink Assignment Type 2 */
246     { DE_RR_PAGE_MODE, "Page Mode" },                                   /* [3] 10.5.2.26  */
247     { DE_RR_NCC_PERM, "NCC Permitted" },                                /* [3] 10.5.2.27 NCC Permitted */
248     { DE_RR_POW_CMD, "Power Command" },                                 /* 10.5.2.28 */
249     { DE_RR_POW_CMD_AND_ACC_TYPE, "Power Command and access type" },    /* 10.5.2.28a */
250     { DE_RR_RACH_CTRL_PARAM, "RACH Control Parameters" },               /* [3] 10.5.2.29 RACH Control Parameters */
251     { DE_RR_REQ_REF, "Request Reference" },                             /* [3] 10.5.2.30 Request Reference */
252     { DE_RR_CAUSE, "RR Cause" },                                        /* 10.5.2.31 */
253     { DE_RR_SYNC_IND, "Synchronization Indication" },                   /* 10.5.2.39 */
254     { DE_RR_SI1_REST_OCT, "SI 1 Rest Octets" },                         /* [3] 10.5.2.32 */
255 /* [3] 10.5.2.33 SI 2bis Rest Octets */
256     { DE_RR_SI2TER_REST_OCT, "SI 2ter Rest Octets" },                   /* [3] 10.5.2.33a */
257     { DE_RR_SI2QUATER_REST_OCT, "SI 2quater Rest Octets" },             /* [3] 10.5.2.33b */
258     { DE_RR_SI3_REST_OCT, "SI 3 Rest Octets" },                         /* [3] 10.5.2.34 */
259     { DE_RR_SI4_REST_OCT, "SI 4 Rest Octets" },                         /* [3] 10.5.2.35 */
260     { DE_RR_SI6_REST_OCT, "SI 6 Rest Octets" },                         /* [3] 10.5.2.35a */
261 /* [3] 10.5.2.36 SI 7 Rest Octets
262  * [3] 10.5.2.37 SI 8 Rest Octets
263  * [3] 10.5.2.37a SI 9 Rest Octets
264  */
265     { DE_RR_SI13_REST_OCT, "SI 13 Rest Octets" },                       /* [3] 10.5.2.37b */
266 /* [3] 10.5.2.37c (void)
267  * [3] 10.5.2.37d (void)
268  * [3] 10.5.2.37e SI 16 Rest Octets
269  * [3] 10.5.2.37f SI 17 Rest Octets
270  * [3] 10.5.2.37g SI 19 Rest Octets
271  * [3] 10.5.2.37h SI 18 Rest Octets
272  * [3] 10.5.2.37i SI 20 Rest Octets */
273     { DE_RR_SI21_REST_OCT, "SI 21 Rest Octets" },                       /* [3] 10.5.2.37m */
274     { DE_RR_STARTING_TIME, "Starting Time" },                           /* [3] 10.5.2.38 Starting Time  */
275     { DE_RR_TIMING_ADV, "Timing Advance" },                             /* [3] 10.5.2.40 Timing Advance */
276     { DE_RR_TIME_DIFF, "Time Difference" },                             /* [3] 10.5.2.41 Time Difference */
277     { DE_RR_TLLI, "TLLI" },                                             /* [3] 10.5.2.41a TLLI  */
278     { DE_RR_TMSI_PTMSI, "TMSI/P-TMSI" },                                /* [3] 10.5.2.42 TMSI/P-TMSI */
279     { DE_RR_VGCS_TAR_MODE_IND, "VGCS target mode Indication" },         /* [3] 10.5.2.42a */
280     /* Pos 40 */
281     { DE_RR_VGCS_CIP_PAR, "VGCS Ciphering Parameters" },                /* [3] 10.5.2.42b */
282     { DE_RR_WAIT_IND, "Wait Indication" },                              /* [3] 10.5.2.43 Wait Indication */
283 /* [3] 10.5.2.44 SI10 rest octets $(ASCI)$ */
284     { DE_RR_EXT_MEAS_RESULT, "Extended Measurement Results" },          /* [3] 10.5.2.45 Extended Measurement Results */
285     { DE_RR_EXT_MEAS_FREQ_LIST, "Extended Measurement Frequency List" },/* [3] 10.5.2.46 Extended Measurement Frequency List */
286     { DE_RR_SUS_CAU, "Suspension Cause" },                              /* [3] 10.5.2.47                                */
287     { DE_RR_APDU_ID, "APDU ID" },                                       /* [3] 10.5.2.48 APDU ID */
288     { DE_RR_APDU_FLAGS, "APDU Flags" },                                 /* [3] 10.5.2.49 APDU Flags */
289     { DE_RR_APDU_DATA, "APDU Data" },                                   /* [3] 10.5.2.50 APDU Data */
290     { DE_RR_HO_TO_UTRAN_CMD, "Handover to UTRAN Command" },             /* [3] 10.5.2.51 Handover To UTRAN Command */
291 /* [3] 10.5.2.52 Handover To cdma2000 Command
292  * [3] 10.5.2.53 (void)
293  * [3] 10.5.2.54 (void)
294  * [3] 10.5.2.55 (void)
295  * [3] 10.5.2.56 3G Target Cell */
296     { DE_RR_SERV_SUP, "Service Support" },                              /* [3] 10.5.2.57    */
297     /* 10.5.2.58 MBMS p-t-m Channel Description */
298     { DE_RR_DED_SERV_INF, "Dedicated Service Information" },            /* [3] 10.5.2.59    */
299 /*
300  * 10.5.2.60 MPRACH Description
301  * 10.5.2.61 Restriction Timer
302  * 10.5.2.62 MBMS Session Identity
303  * 10.5.2.63 Reduced group or broadcast call reference
304  * 10.5.2.64 Talker Priority status
305  * 10.5.2.65 Talker Identity
306  * 10.5.2.66 Token
307  * 10.5.2.67 PS Cause
308  * 10.5.2.68 VGCS AMR Configuration
309  */
310     { DE_RR_CARRIER_IND, "Carrier Indication" },                        /* 10.5.2.69 Carrier Indication */
311 /*
312  * 10.5.2.70 SI10bis Rest Octets
313  * 10.5.2.71 SI10ter Rest Octets
314  * 10.5.2.72 Application Data
315  * 10.5.2.73 Data Identity
316  * 10.5.2.74 Uplink Access Indication
317  * 10.5.2.75 Individual priorities
318  */
319     { DE_RR_FEATURE_INDICATOR, "Feature Indicator" },                   /* 10.5.2.76 Feature Indicator */
320 /*
321  * 10.5.2.77 (void)
322  * 10.5.2.78 IPA Rest Octets
323  * 10.5.2.79 DL-DCCH-Message
324  * 10.5.2.80 CN to MS transparent information
325  * 10.5.2.81 PLMN Index
326  * 10.5.2.82 Extended TSC Set
327  */
328     { DE_RR_EC_REQUEST_REFERENCE, "EC Request Reference" },             /* 10.5.2.83 EC Request reference */
329     { DE_RR_EC_PKT_CH_DSC1, "EC Packet Channel Description Type 1" },   /* 10.5.2.84 EC Packet Channel Description Type 1 */
330     { DE_RR_EC_PKT_CH_DSC2, "EC Packet Channel Description Type 2" },   /* 10.5.2.85 EC Packet Channel Description Type 2 */
331     { DE_RR_EC_FUA, "EC Fixed Uplink Allocation"},                      /* 10.5.2.86 EC Fixed Uplink Allocation */
332     {    0, NULL }
333 };
334 value_string_ext gsm_rr_elem_strings_ext = VALUE_STRING_EXT_INIT(gsm_rr_elem_strings);
335
336 const value_string gsm_rr_rest_octets_elem_strings[] = {
337     /* RR Rest Octets information elements */
338     { 0, "UTRAN FDD Description" },
339     { 0, "UTRAN TDD Description" },
340     { 0, "3G Measurement Parameters Description" },
341     { 0, "3G Additional Measurement Parameters Description" },
342     { 0, "Measurement Parameters Description" },
343     { 0, "GPRS Real Time Difference Description" },
344     { 0, "GPRS BSIC Description" },
345     { 0, "GPRS Report Priority Description" },
346     { 0, "GPRS Measurement Parameters Description" },
347     { 0, "NC Measurement Parameters" },
348     { 0, "SI2q Extension Information" },
349     { 0, "CCN Support Description" },
350     { 0, "3G Neighbour Cell Description" },
351     { 0, "FDD Cell Information Field" },
352     { 0, "TDD Cell Information Field" },
353     { 0, "GPRS 3G Measurement Parameters Description" },
354     { 0, "3G Additional Measurement Parameters Description 2" },
355     { 0, "Priority and E-UTRAN Parameters Description" },
356     { 0, "Serving Cell Priority Parameters Description" },
357     { 0, "3G Priority Parameters Description" },
358     { 0, "UTRAN Priority Parameters" },
359     { 0, "E-UTRAN Parameters Description" },
360     { 0, "E-UTRAN Neighbour Cells" },
361     { 0, "E-UTRAN Not Allowed Cells" },
362     { 0, "E-UTRAN PCID to TA mapping" },
363     { 0, "3G CSG Description" },
364     { 0, "E-UTRAN CSG Description" },
365     { 0, "Optional Selection Parameters" },
366     { 0, "GPRS Indicator" },
367     { 0, "SI4 Rest Octets_O" },
368     { 0, "SI4 Rest Octets_S" },
369     { 0, "LSA Parameters" },
370     { 0, "LSA ID Information" },
371     { 0, "PCH and NCH Info" },
372     { 0, "VBS/VGCS Options" },
373     { 0, "GPRS Mobile Allocation" },
374     { 0, "GPRS Cell Options" },
375     { 0, "GPRS Cell Options Extension Information" },
376     { 0, "GPRS Power Control Parameters" },
377     { 0, "PBCCH Description" },
378     { 0, "GSM Description" },
379     { 0, "Real Time Difference Description" },
380     { 0, "BSIC Description" },
381     { 0, "Report Priority Description" },
382     { 0, "CDMA2000 Description" },
383     { 0, "Serving cell data" },
384     { 0, "Repeated Invalid BSIC Information" },
385     { 0, "Bitmap Type Reporting" },
386     { 0, "3G Supplementary Parameters Description" },
387     { 0, "UTRAN Measurement Control Parameters" },
388     { 0, "EGPRS Packet Uplink Assignment" },
389     { 0, "Multiple Blocks Packet Downlink Assignment" },
390     { 0, "Temporary Mobile Group Identity (TMGI)" },
391     { 0, "Packet Timing Advance" },
392     { 0, "Packet Uplink Assignment" },
393     { 0, "Packet Downlink Assignment" },
394     { 0, "Second Part Packet Assignment" },
395     { 0, "REPORTING QUANTITY" },
396     { 0, "E-UTRAN Measurement Report" },
397     { 0, "E-UTRAN Description" },
398     { 0, "EAB Parameters" },
399     { 0, NULL }
400 };
401
402
403 /* RR cause value (octet 2) TS 44.018 6.11.0*/
404 static const value_string gsm_a_rr_RR_cause_vals[] = {
405     {    0, "Normal event"},
406     {    1, "Abnormal release, unspecified"},
407     {    2, "Abnormal release, channel unacceptable"},
408     {    3, "Abnormal release, timer expired"},
409     {    4, "Abnormal release, no activity on the radio path"},
410     {    5, "Preemptive release"},
411     {    6, "UTRAN configuration unknown"},
412     {    8, "Handover impossible, timing advance out of range"},
413     {    9, "Channel mode unacceptable"},
414     {   10, "Frequency not implemented"},
415     {   13, "Originator or talker leaving group call area"},
416     {   12, "Lower layer failure"},
417     { 0x41, "Call already cleared"},
418     { 0x5f, "Semantically incorrect message"},
419     { 0x60, "Invalid mandatory information"},
420     { 0x61, "Message type non-existent or not implemented"},
421     { 0x62, "Message type not compatible with protocol state"},
422     { 0x64, "Conditional IE error"},
423     { 0x65, "No cell allocation available"},
424     { 0x6f, "Protocol error unspecified"},
425     { 0, NULL }
426 };
427
428 static const value_string gsm_a_rr_algorithm_identifier_vals[] = {
429     { 0, "Cipher with algorithm A5/1"},
430     { 1, "Cipher with algorithm A5/2"},
431     { 2, "Cipher with algorithm A5/3"},
432     { 3, "Cipher with algorithm A5/4"},
433     { 4, "Cipher with algorithm A5/5"},
434     { 5, "Cipher with algorithm A5/6"},
435     { 6, "Cipher with algorithm A5/7"},
436     { 7, "Reserved"},
437     { 0, NULL }
438 };
439
440 static const value_string gsm_a_rr_ec_cc_vals[] = {
441     {0x00, "Coverage Class 1"},
442     {0x01, "Coverage Class 2"},
443     {0x02, "Coverage Class 3"},
444     {0x03, "Coverage Class 4"},
445     {0, NULL }
446 };
447
448 #define DTAP_PD_MASK            0x0f
449 #define DTAP_SKIP_MASK          0xf0
450 #define DTAP_TI_MASK            DTAP_SKIP_MASK
451 #define DTAP_TIE_PRES_MASK      0x07                    /* after TI shifted to right */
452 #define DTAP_TIE_MASK           0x7f
453
454 #define DTAP_RR_IEI_MASK        0xff
455
456 /* Initialize the protocol and registered fields */
457 static int proto_a_rr = -1;
458 static int proto_a_ccch = -1;
459 static int proto_a_ec_ccch = -1;
460 static int proto_a_sacch = -1;
461
462 static int hf_gsm_a_dtap_msg_rr_type = -1;
463 static int hf_gsm_a_dtap_msg_rr_ec_ccch_type = -1;
464
465 int hf_gsm_a_rr_elem_id = -1;
466
467 static int hf_gsm_a_rr_short_pd_msg_type = -1;
468 static int hf_gsm_a_rr_short_pd = -1;
469 static int hf_gsm_a_rr_short_l2_header = -1;
470
471
472 static int hf_gsm_a_rr_bcc = -1;
473 static int hf_gsm_a_rr_ncc = -1;
474 static int hf_gsm_a_rr_bcch_arfcn = -1;
475 static int hf_gsm_a_rr_range_nb = -1;
476 static int hf_gsm_a_rr_range_lower = -1;
477 static int hf_gsm_a_rr_range_higher = -1;
478 static int hf_gsm_a_rr_ba_freq = -1;
479 static int hf_gsm_a_rr_ho_ref_val = -1;
480 static int hf_gsm_a_rr_L2_pseudo_len = -1;
481 static int hf_gsm_a_rr_ba_used = -1;
482 static int hf_gsm_a_rr_dtx_used = -1;
483 static int hf_gsm_a_rr_3g_ba_used = -1;
484 static int hf_gsm_a_rr_meas_valid = -1;
485 static int hf_gsm_a_rr_rxlev_full_serv_cell = -1;
486 static int hf_gsm_a_rr_rxlev_sub_serv_cell = -1;
487 static int hf_gsm_a_rr_si23_ba_used = -1;
488 static int hf_gsm_a_rr_rxqual_full_serv_cell = -1;
489 static int hf_gsm_a_rr_rxqual_sub_serv_cell = -1;
490 static int hf_gsm_a_rr_no_ncell_m = -1;
491 static int hf_gsm_a_rr_rxlev_ncell = -1;
492 static int hf_gsm_a_rr_bcch_freq_ncell = -1;
493 static int hf_gsm_a_rr_bsic_ncell = -1;
494 static int hf_gsm_a_rr_mobile_time_difference = -1;
495 static int hf_gsm_a_rr_pow_cmd_atc = -1;
496 static int hf_gsm_a_rr_pow_cmd_epc = -1;
497 static int hf_gsm_a_rr_page_mode = -1;
498 static int hf_gsm_a_rr_dedicated_mode_or_tbf = -1;
499 static int hf_gsm_a_rr_pow_cmd_fpcepc = -1;
500 static int hf_gsm_a_rr_pow_cmd_powlev = -1;
501 static int hf_gsm_a_rr_sync_ind_nci = -1;
502 static int hf_gsm_a_rr_sync_ind_rot = -1;
503 static int hf_gsm_a_rr_sync_ind_si = -1;
504 static int hf_gsm_a_rr_format_id = -1;
505 static int hf_gsm_a_rr_format_id2 = -1;
506 static int hf_gsm_a_rr_channel_mode = -1;
507 static int hf_gsm_a_rr_channel_mode2 = -1;
508 static int hf_gsm_a_rr_sc = -1;
509 static int hf_gsm_a_rr_algorithm_id = -1;
510 static int hf_gsm_a_rr_cr = -1;
511 static int hf_gsm_a_rr_multirate_speech_ver = -1;
512 static int hf_gsm_a_rr_NCSB = -1;
513 static int hf_gsm_a_rr_ICMI = -1;
514 static int hf_gsm_a_rr_start_mode = -1;
515 static int hf_gsm_a_rr_timing_adv = -1;
516 static int hf_gsm_a_rr_time_diff = -1;
517 static int hf_gsm_a_rr_tlli = -1;
518 static int hf_gsm_a_rr_tmsi_ptmsi = -1;
519 static int hf_gsm_a_rr_target_mode = -1;
520 static int hf_gsm_a_rr_wait_indication = -1;
521 static int hf_gsm_a_rr_seq_code = -1;
522 static int hf_gsm_a_rr_group_cipher_key_number = -1;
523 static int hf_gsm_a_rr_MBMS_multicast = -1;
524 static int hf_gsm_a_rr_MBMS_broadcast = -1;
525 static int hf_gsm_a_rr_last_segment = -1;
526 static int hf_gsm_a_rr_carrier_ind = -1;
527 static int hf_gsm_a_rr_ra = -1;
528 static int hf_gsm_a_rr_T1prim = -1;
529 static int hf_gsm_a_rr_T3 = -1;
530 static int hf_gsm_a_rr_T2 = -1;
531 static int hf_gsm_a_rr_tbf_T1prim = -1;
532 static int hf_gsm_a_rr_tbf_T3 = -1;
533 static int hf_gsm_a_rr_tbf_T2 = -1;
534 static int hf_gsm_a_rr_rfn = -1;
535 static int hf_gsm_a_rr_RR_cause = -1;
536 static int hf_gsm_a_rr_cm_cng_msg_req = -1;
537 static int hf_gsm_a_rr_utran_cm_cng_msg_req = -1;
538 static int hf_gsm_a_rr_cdma200_cm_cng_msg_req = -1;
539 static int hf_gsm_a_rr_geran_iu_cm_cng_msg_req = -1;
540 int hf_gsm_a_rr_chnl_needed_ch1 = -1;
541 static int hf_gsm_a_rr_chnl_needed_ch2 = -1;
542 static int hf_gsm_a_rr_chnl_needed_ch3 = -1;
543 static int hf_gsm_a_rr_chnl_needed_ch4 = -1;
544 static int hf_gsm_a_rr_pkt_estab_cause = -1;
545 static int hf_gsm_a_rr_peak_throughput_class = -1;
546 static int hf_gsm_a_rr_radio_priority = -1;
547 static int hf_gsm_a_rr_llc_pdu_type = -1;
548 static int hf_gsm_a_rr_rlc_octet_count = -1;
549 static int hf_gsm_a_rr_rlc_non_pers_mode_cap = -1;
550 static int hf_gsm_a_rr_reduced_latency_cap = -1;
551 static int hf_gsm_a_rr_ul_egprs2 = -1;
552 static int hf_gsm_a_rr_dl_egprs2 = -1;
553 static int hf_gsm_a_rr_emst_ms_cap = -1;
554 static int hf_gsm_a_rr_suspension_cause = -1;
555 static int hf_gsm_a_rr_apdu_id = -1;
556 static int hf_gsm_a_rr_apdu_flags_cr = -1;
557 static int hf_gsm_a_rr_apdu_flags_fs = -1;
558 static int hf_gsm_a_rr_apdu_flags_ls = -1;
559 static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b8 = -1;
560 static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b7 = -1;
561 static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b6 = -1;
562 static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b5 = -1;
563 static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b4 = -1;
564 static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b3 = -1;
565 static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b2 = -1;
566 static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b1 = -1;
567 static int hf_gsm_a_rr_set_of_amr_codec_modes_v2_b5 = -1;
568 static int hf_gsm_a_rr_set_of_amr_codec_modes_v2_b4 = -1;
569 static int hf_gsm_a_rr_set_of_amr_codec_modes_v2_b3 = -1;
570 static int hf_gsm_a_rr_set_of_amr_codec_modes_v2_b2 = -1;
571 static int hf_gsm_a_rr_set_of_amr_codec_modes_v2_b1 = -1;
572 static int hf_gsm_a_rr_amr_threshold = -1;
573 static int hf_gsm_a_rr_amr_hysteresis = -1;
574 static int hf_gsm_a_rr_pwrc = -1;
575 static int hf_gsm_a_rr_dtx_bcch = -1;
576 static int hf_gsm_a_rr_dtx_sacch = -1;
577 static int hf_gsm_a_rr_radio_link_timeout = -1;
578 static int hf_gsm_a_rr_cell_reselect_hyst = -1;
579 static int hf_gsm_a_rr_ms_txpwr_max_cch = -1;
580 static int hf_gsm_a_rr_acs = -1;
581 static int hf_gsm_a_rr_neci = -1;
582 static int hf_gsm_a_rr_rxlev_access_min = -1;
583 static int hf_gsm_a_rr_mscr = -1;
584 static int hf_gsm_a_rr_att = -1;
585 static int hf_gsm_a_rr_ccch_conf = -1;
586 static int hf_gsm_a_rr_cbq3 = -1;
587 static int hf_gsm_a_rr_bs_pa_mfrms = -1;
588 static int hf_gsm_a_rr_bs_ag_blks_res = -1;
589 int hf_gsm_a_rr_t3212 = -1;
590 static int hf_gsm_a_rr_gsm_band = -1;
591 static int hf_gsm_a_rr_arfcn_first = -1;
592 static int hf_gsm_a_rr_band_offset = -1;
593 static int hf_gsm_a_rr_arfcn_range = -1;
594 static int hf_gsm_a_rr_lowest_arfcn = -1;
595 static int hf_gsm_a_rr_inc_skip_arfcn = -1;
596 static int hf_gsm_a_rr_gprs_resumption_ack = -1;
597 static int hf_gsm_a_rr_ext_ind = -1;
598 static int hf_gsm_a_rr_ba_ind = -1;
599 static int hf_gsm_a_rr_multiband_reporting = -1;
600 static int hf_gsm_a_rr_ncc_permitted = -1;
601 static int hf_gsm_a_rr_max_retrans = -1;
602 static int hf_gsm_a_rr_tx_integer = -1;
603 static int hf_gsm_a_rr_cell_barr_access = -1;
604 static int hf_gsm_a_rr_re = -1;
605 static int hf_gsm_a_rr_acc = -1;
606 static int hf_gsm_a_rr_nch_position = -1;
607 static int hf_gsm_a_rr_si2ter_mp_change_mark = -1;
608 static int hf_gsm_a_rr_si2ter_3g_change_mark = -1;
609 static int hf_gsm_a_rr_si2ter_index = -1;
610 static int hf_gsm_a_rr_si2ter_count = -1;
611 static int hf_gsm_a_rr_fdd_uarfcn = -1;
612 static int hf_gsm_a_rr_bandwidth_fdd = -1;
613 static int hf_gsm_a_rr_tdd_uarfcn = -1;
614 static int hf_gsm_a_rr_bandwidth_tdd = -1;
615 static int hf_gsm_a_rr_arfcn = -1;
616 static int hf_gsm_a_rr_bsic = -1;
617 static int hf_gsm_a_rr_qsearch_i = -1;
618 static int hf_gsm_a_rr_fdd_qoffset = -1;
619 static int hf_gsm_a_rr_fdd_qmin = -1;
620 static int hf_gsm_a_rr_tdd_qoffset = -1;
621 static int hf_gsm_a_rr_fdd_qmin_offset = -1;
622 static int hf_gsm_a_rr_fdd_rscpmin = -1;
623 static int hf_gsm_a_rr_3g_ba_ind = -1;
624 static int hf_gsm_a_rr_mp_change_mark = -1;
625 static int hf_gsm_a_rr_si2quater_index = -1;
626 static int hf_gsm_a_rr_si2quater_count = -1;
627 static int hf_gsm_a_rr_si21_change_mark = -1;
628 static int hf_gsm_a_rr_si21_index = -1;
629 static int hf_gsm_a_rr_si21_count = -1;
630 static int hf_gsm_a_rr_gsm_report_type = -1;
631 static int hf_gsm_a_rr_serving_band_reporting = -1;
632 static int hf_gsm_a_rr_frequency_scrolling = -1;
633 static int hf_gsm_a_rr_rep_priority = -1;
634 static int hf_gsm_a_rr_report_type = -1;
635 static int hf_gsm_a_rr_reporting_rate = -1;
636 static int hf_gsm_a_rr_invalid_bsic_reporting = -1;
637 static int hf_gsm_a_rr_scale_ord = -1;
638 static int hf_gsm_a_rr_900_reporting_offset = -1;
639 static int hf_gsm_a_rr_900_reporting_threshold = -1;
640 static int hf_gsm_a_rr_1800_reporting_offset = -1;
641 static int hf_gsm_a_rr_1800_reporting_threshold = -1;
642 static int hf_gsm_a_rr_400_reporting_offset = -1;
643 static int hf_gsm_a_rr_400_reporting_threshold = -1;
644 static int hf_gsm_a_rr_1900_reporting_offset = -1;
645 static int hf_gsm_a_rr_1900_reporting_threshold = -1;
646 static int hf_gsm_a_rr_850_reporting_offset = -1;
647 static int hf_gsm_a_rr_850_reporting_threshold = -1;
648 static int hf_gsm_a_rr_network_control_order = -1;
649 static int hf_gsm_a_rr_nc_non_drx_period = -1;
650 static int hf_gsm_a_rr_nc_reporting_period_i = -1;
651 static int hf_gsm_a_rr_nc_reporting_period_t = -1;
652 static int hf_gsm_a_rr_index_start_3g = -1;
653 static int hf_gsm_a_rr_absolute_index_start_emr = -1;
654 static int hf_gsm_a_rr_qsearch_c_initial = -1;
655 static int hf_gsm_a_rr_fdd_rep_quant = -1;
656 static int hf_gsm_a_rr_fdd_multirat_reporting = -1;
657 static int hf_gsm_a_rr_tdd_multirat_reporting = -1;
658 static int hf_gsm_a_rr_qsearch_p = -1;
659 static int hf_gsm_a_rr_3g_search_prio = -1;
660 static int hf_gsm_a_rr_fdd_reporting_offset = -1;
661 static int hf_gsm_a_rr_fdd_reporting_threshold_rscp = -1;
662 static int hf_gsm_a_rr_fdd_reporting_threshold_ecn0 = -1;
663 static int hf_gsm_a_rr_tdd_reporting_offset = -1;
664 static int hf_gsm_a_rr_tdd_reporting_threshold_rscp = -1;
665 static int hf_gsm_a_rr_tdd_reporting_threshold_ecn0 = -1;
666 static int hf_gsm_a_rr_fdd_reporting_threshold_2 = -1;
667 static int hf_gsm_a_rr_3g_ccn_active = -1;
668 static int hf_gsm_a_rr_700_reporting_offset = -1;
669 static int hf_gsm_a_rr_700_reporting_threshold = -1;
670 static int hf_gsm_a_rr_810_reporting_offset = -1;
671 static int hf_gsm_a_rr_810_reporting_threshold = -1;
672 static int hf_gsm_a_rr_cbq = -1;
673 static int hf_gsm_a_rr_cell_reselect_offset = -1;
674 static int hf_gsm_a_rr_temporary_offset = -1;
675 static int hf_gsm_a_rr_penalty_time = -1;
676 static int hf_gsm_a_rr_gprs_ra_colour = -1;
677 static int hf_gsm_a_rr_si13_position = -1;
678 static int hf_gsm_a_rr_power_offset = -1;
679 static int hf_gsm_a_rr_si2quater_position = -1;
680 static int hf_gsm_a_rr_si13alt_position = -1;
681 static int hf_gsm_a_rr_si21_position = -1;
682 static int hf_gsm_a_rr_prio_thr = -1;
683 static int hf_gsm_a_rr_lsa_offset = -1;
684 static int hf_gsm_a_rr_cell_id = -1;
685 static int hf_gsm_a_rr_paging_channel_restructuring = -1;
686 static int hf_gsm_a_rr_nln_sacch = -1;
687 static int hf_gsm_a_rr_nln_status_sacch = -1;
688 static int hf_gsm_a_rr_nln_pch = -1;
689 static int hf_gsm_a_rr_nln_status_pch = -1;
690 static int hf_gsm_a_rr_vbs_vgcs_inband_notifications = -1;
691 static int hf_gsm_a_rr_vbs_vgcs_inband_pagings = -1;
692 static int hf_gsm_a_rr_rac = -1;
693 static int hf_gsm_a_rr_max_lapdm = -1;
694 static int hf_gsm_a_rr_gprs_ms_txpwr_max_ccch = -1;
695 static int hf_gsm_a_rr_dedicated_mode_mbms_notification_support = -1;
696 static int hf_gsm_a_rr_mnci_support = -1;
697 static int hf_gsm_a_rr_amr_config = -1;
698 static int hf_gsm_a_rr_bcch_change_mark = -1;
699 static int hf_gsm_a_rr_si_change_field = -1;
700 static int hf_gsm_a_rr_si13_change_mark = -1;
701 static int hf_gsm_a_rr_hsn = -1;
702 static int hf_gsm_a_rr_rfl_number = -1;
703 static int hf_gsm_a_rr_arfcn_index = -1;
704 static int hf_gsm_a_rr_ma_length = -1;
705 static int hf_gsm_a_rr_psi1_repeat_period = -1;
706 static int hf_gsm_a_rr_pbcch_pb = -1;
707 static int hf_gsm_a_rr_pbcch_tsc = -1;
708 static int hf_gsm_a_rr_pbcch_tn = -1;
709 static int hf_gsm_a_rr_spgc_ccch_sup = -1;
710 static int hf_gsm_a_rr_priority_access_thr = -1;
711 static int hf_gsm_a_rr_nmo = -1;
712 static int hf_gsm_a_rr_t3168 = -1;
713 static int hf_gsm_a_rr_t3192 = -1;
714 static int hf_gsm_a_rr_drx_timer_max = -1;
715 static int hf_gsm_a_rr_access_burst_type = -1;
716 static int hf_gsm_a_rr_control_ack_type = -1;
717 static int hf_gsm_a_rr_bs_cv_max = -1;
718 static int hf_gsm_a_rr_pan_dec = -1;
719 static int hf_gsm_a_rr_pan_inc = -1;
720 static int hf_gsm_a_rr_pan_max = -1;
721 static int hf_gsm_a_rr_egprs_packet_channel_request = -1;
722 static int hf_gsm_a_rr_bep_period = -1;
723 static int hf_gsm_a_rr_pfc_feature_mode = -1;
724 static int hf_gsm_a_rr_dtm_support = -1;
725 static int hf_gsm_a_rr_bss_paging_coordination = -1;
726 static int hf_gsm_a_rr_ccn_active = -1;
727 static int hf_gsm_a_rr_nw_ext_utbf = -1;
728 static int hf_gsm_a_rr_multiple_tbf_capability = -1;
729 static int hf_gsm_a_rr_ext_utbf_no_data = -1;
730 static int hf_gsm_a_rr_dtm_enhancements_capability = -1;
731 static int hf_gsm_a_rr_reduced_latency_access = -1;
732 static int hf_gsm_a_rr_alpha = -1;
733 static int hf_gsm_a_rr_t_avg_w = -1;
734 static int hf_gsm_a_rr_t_avg_t = -1;
735 static int hf_gsm_a_rr_pc_meas_chan = -1;
736 static int hf_gsm_a_rr_n_avg_i = -1;
737 static int hf_gsm_a_rr_sgsnr = -1;
738 static int hf_gsm_a_rr_si_status_ind = -1;
739 static int hf_gsm_a_rr_lb_ms_txpwr_max_cch = -1;
740 static int hf_gsm_a_rr_si2n_support = -1;
741 static int hf_gsm_a_rr_mi_index = -1;
742 static int hf_gsm_a_rr_mi_count = -1;
743 static int hf_gsm_a_rr_3g_wait = -1;
744 static int hf_gsm_a_rr_qsearch_c = -1;
745 static int hf_gsm_a_rr_bsic_seen = -1;
746 static int hf_gsm_a_rr_scale = -1;
747 static int hf_gsm_a_rr_mean_bep_gmsk = -1;
748 static int hf_gsm_a_rr_mean_cv_bep = -1;
749 static int hf_gsm_a_rr_nbr_rcvd_blocks = -1;
750 static int hf_gsm_a_rr_reporting_quantity = -1;
751 static int hf_gsm_a_rr_extended_ra = -1;
752 static int hf_gsm_a_rr_access_tech_type = -1;
753 static int hf_gsm_a_rr_tfi_assignment = -1;
754 static int hf_gsm_a_rr_polling = -1;
755 static int hf_gsm_a_rr_usf = -1;
756 static int hf_gsm_a_rr_usf_granularity = -1;
757 static int hf_gsm_a_rr_p0 = -1;
758 static int hf_gsm_a_rr_pr_mode = -1;
759 static int hf_gsm_a_rr_egprs_mcs = -1;
760 static int hf_gsm_a_rr_tlli_block_channel_coding = -1;
761 static int hf_gsm_a_rr_bep_period2 = -1;
762 static int hf_gsm_a_rr_resegment = -1;
763 static int hf_gsm_a_rr_egprs_window_size = -1;
764 static int hf_gsm_a_rr_gamma = -1;
765 static int hf_gsm_a_rr_timing_adv_index = -1;
766 static int hf_gsm_a_rr_timing_adv_timeslot_num = -1;
767 static int hf_gsm_a_rr_tbf_starting_time = -1;
768 static int hf_gsm_a_rr_num_of_radio_block_allocated = -1;
769 static int hf_gsm_a_rr_pfi = -1;
770 static int hf_gsm_a_rr_mbms_service_id = -1;
771 static int hf_gsm_a_rr_ms_id = -1;
772 static int hf_gsm_a_rr_gprs_cs = -1;
773 static int hf_gsm_a_rr_rlc_mode = -1;
774 static int hf_gsm_a_rr_ta_valid = -1;
775 static int hf_gsm_a_rr_link_quality_meas_mode = -1;
776 static int hf_gsm_a_rr_emr_bitmap_length = -1;
777 static int hf_gsm_a_rr_eutran_mr_n_eutran = -1;
778 static int hf_gsm_a_rr_eutran_mr_freq_idx = -1;
779 static int hf_gsm_a_rr_eutran_mr_cell_id = -1;
780 static int hf_gsm_a_rr_eutran_mr_rpt_quantity = -1;
781 static int hf_gsm_a_rr_ma_channel_set = -1;
782 static int hf_n_range_orig_arfcn = -1;
783 static int hf_gsm_a_rr_reported_timeslots = -1;
784 static int hf_gsm_a_rr_tsh = -1;
785 static int hf_gsm_a_rr_rtti_usf_mode = -1;
786 static int hf_gsm_a_rr_pdch_pair_indic = -1;
787 static int hf_gsm_a_rr_additional_usf = -1;
788 static int hf_gsm_a_rr_usf_2 = -1;
789 static int hf_gsm_a_rr_additional_usf_2 = -1;
790 static int hf_gsm_a_rr_npm_transfer_time = -1;
791 static int hf_gsm_a_rr_event_based_fanr = -1;
792 static int hf_gsm_a_rr_dl_egprs_level = -1;
793 static int hf_gsm_a_rr_eab_auth_mask = -1;
794 static int hf_gsm_a_eab_subcategory = -1;
795
796 /* Generated from convert_proto_tree_add_text.pl */
797 static int hf_gsm_a_rr_cell_parameter = -1;
798 static int hf_gsm_a_rr_len_indicator_ms_id = -1;
799 static int hf_gsm_a_rr_neighbour_cell_list_index = -1;
800 static int hf_gsm_a_rr_mcc = -1;
801 static int hf_gsm_a_rr_pcid_pattern = -1;
802 static int hf_gsm_a_rr_where = -1;
803 static int hf_gsm_a_rr_ba_index_start_bsic = -1;
804 static int hf_gsm_a_rr_bitmap = -1;
805 static int hf_gsm_a_rr_extension_length = -1;
806 static int hf_gsm_a_rr_scrambling_code = -1;
807 static int hf_gsm_a_rr_mnc = -1;
808 static int hf_gsm_a_rr_nr_of_fdd_cells = -1;
809 static int hf_gsm_a_rr_ba_index_start_rtd_present = -1;
810 static int hf_gsm_a_rr_sync_case_tstd = -1;
811 static int hf_gsm_a_rr_hopping_channel_maio = -1;
812 static int hf_gsm_a_rr_hopping_channel_ma_num_ind = -1;
813 static int hf_gsm_a_rr_hopping_channel_change_mark_1 = -1;
814 static int hf_gsm_a_rr_hopping_channel = -1;
815 static int hf_gsm_a_rr_rxlev_carrier = -1;
816 static int hf_gsm_a_rr_mobile_network_code = -1;
817 static int hf_gsm_a_rr_packet_channel_type = -1;
818 static int hf_gsm_a_rr_timeslot = -1;
819 static int hf_gsm_a_rr_lsa_id = -1;
820 static int hf_gsm_a_rr_ciphering_key_seq_num = -1;
821 static int hf_gsm_a_rr_diversity = -1;
822 static int hf_gsm_a_rr_maio = -1;
823 static int hf_gsm_a_rr_mobile_country_code = -1;
824 static int hf_gsm_a_rr_short_lsa_id = -1;
825 static int hf_gsm_a_rr_number_remaining_bsic = -1;
826 static int hf_gsm_a_rr_number_cells = -1;
827 static int hf_gsm_a_rr_padding = -1;
828 static int hf_gsm_a_rr_training_sequence = -1;
829 static int hf_gsm_a_rr_psc_pattern_present = -1;
830 static int hf_gsm_a_rr_nr_of_tdd_cells = -1;
831 static int hf_gsm_a_rr_message_elements = -1;
832 static int hf_gsm_a_rr_bitmap_length = -1;
833 static int hf_gsm_a_rr_diversity_tdd = -1;
834 static int hf_gsm_a_rr_spare = -1;
835 static int hf_gsm_a_rr_single_channel_arfcn = -1;
836 static int hf_gsm_a_rr_rtd_index = -1;
837 static int hf_gsm_a_rr_arfcn_list = -1;
838 static int hf_gsm_a_rr_da_list = -1;
839 static int hf_gsm_a_rr_ua_list = -1;
840 static int hf_gsm_a_rr_field_bit_long = -1;
841 static int hf_gsm_a_rr_ma_bitmap = -1;
842 static int hf_gsm_a_rr_inc_arfcn_bitmap = -1;
843 static int hf_gsm_a_rr_ccn_supported = -1;
844 static int hf_gsm_a_rr_pbcch_use_bcch = -1;
845 static int hf_gsm_a_rr_ia_rest_oct_reserved = -1;
846 static int hf_gsm_a_rr_tch_facch_sacchm = -1;
847 static int hf_gsm_a_rr_tch_facch_sacchf = -1;
848 static int hf_gsm_a_rr_tch_facch_sacchm_bi = -1;
849 static int hf_gsm_a_rr_tch_acch = -1;
850 static int hf_gsm_a_rr_sdcch4_sdcchc4_cbch = -1;
851 static int hf_gsm_a_rr_sdcch8_sdcchc8_cbch = -1;
852 static int hf_gsm_a_rr_tch_facchf_sacchm_bi = -1;
853 static int hf_gsm_a_rr_tch_facchf_sacchm_uni = -1;
854 static int hf_gsm_a_rr_tchf_acchs = -1;
855 static int hf_gsm_a_rr_unknown_channel_info = -1;
856 static int hf_gsm_a_rr_subchannel = -1;
857 static int hf_gsm_a_rr_w_elements = -1;
858
859
860 /* gsm_rr_csn_flag() fields */
861 static int hf_gsm_a_rr_fdd_repeat_freq = -1;
862 static int hf_gsm_a_rr_tdd_repeat_freq = -1;
863 static int hf_gsm_a_rr_repeat_range_limit = -1;
864 static int hf_gsm_a_rr_repeat_ba_frequency = -1;
865 static int hf_gsm_a_rr_repeat_gsm_desc = -1;
866 static int hf_gsm_a_rr_band_indicator = -1;
867 static int hf_gsm_a_rr_repeat_utran_fdd_desc = -1;
868 static int hf_gsm_a_rr_bandwidth_fdd_present = -1;
869 static int hf_gsm_a_rr_fdd_cell_info_present = -1;
870 static int hf_gsm_a_rr_fdd_indic0 = -1;
871 static int hf_gsm_a_rr_repeat_utran_tdd_desc = -1;
872 static int hf_gsm_a_rr_bandwidth_tdd_present = -1;
873 static int hf_gsm_a_rr_tdd_cell_info_present = -1;
874 static int hf_gsm_a_rr_tdd_indic0 = -1;
875 static int hf_gsm_a_rr_pfi_present = -1;
876 static int hf_gsm_a_rr_msms_procedures = -1;
877 static int hf_gsm_a_rr_repeat_dynamic_arfcn_mapping = -1;
878 static int hf_gsm_a_rr_pan_bits_present = -1;
879 static int hf_gsm_a_rr_optional_extensions_present = -1;
880 static int hf_gsm_a_rr_egprs_supported = -1;
881 static int hf_gsm_a_rr_access_tech_req = -1;
882 static int hf_gsm_a_rr_repeated_umts_tdd_neighbour_cells = -1;
883 static int hf_gsm_a_rr_cdma2000_reporting_threshold = -1;
884 static int hf_gsm_a_rr_ccn_support_description = -1;
885 static int hf_gsm_a_rr_eutran_tdd_measurement_report_offset_present = -1;
886 static int hf_gsm_a_rr_3g_wait_present = -1;
887 static int hf_gsm_a_rr_packet_discriminator_bit = -1;
888 static int hf_gsm_a_rr_3g_measurement_control_parameters_description = -1;
889 static int hf_gsm_a_rr_bts_power_control_mode = -1;
890 static int hf_gsm_a_rr_fdd_reporting_threshold_2_present = -1;
891 static int hf_gsm_a_rr_gprs_measurement_parameters_description = -1;
892 static int hf_gsm_a_rr_repeated_earfcn = -1;
893 static int hf_gsm_a_rr_repeated_pcid_group = -1;
894 static int hf_gsm_a_rr_repeating_pcid_group = -1;
895 static int hf_gsm_a_rr_tfi_allocation_type = -1;
896 static int hf_gsm_a_rr_fdd_cell_info_param_value0 = -1;
897 static int hf_gsm_a_rr_bsic_description = -1;
898 static int hf_gsm_a_rr_maio_present = -1;
899 static int hf_gsm_a_rr_eutran_pcid_bitmap_group_present = -1;
900 static int hf_gsm_a_rr_repeated_utran_frequency_index = -1;
901 static int hf_gsm_a_rr_timing_adv_present = -1;
902 static int hf_gsm_a_rr_eutran_tdd_reporting = -1;
903 static int hf_gsm_a_rr_eutran_reporting = -1;
904 static int hf_gsm_a_rr_eutran_csg_description = -1;
905 static int hf_gsm_a_rr_pcid_pattern_present = -1;
906 static int hf_gsm_a_rr_later_r97_version_reserved_bit = -1;
907 static int hf_gsm_a_rr_utran_fdd_description_earlier_version_bit_reserved1 = -1;
908 static int hf_gsm_a_rr_3g_priority_parameters_description = -1;
909 static int hf_gsm_a_rr_serving_cell_priority_parameters_description = -1;
910 static int hf_gsm_a_rr_850_reporting_present = -1;
911 static int hf_gsm_a_rr_tfi_assignment_present = -1;
912 static int hf_gsm_a_rr_p0_present = -1;
913 static int hf_gsm_a_rr_early_r97_version_reserved_bit = -1;
914 static int hf_gsm_a_rr_tdd_reporting_parameters = -1;
915 static int hf_gsm_a_rr_eutran_tdd_reporting_present = -1;
916 static int hf_gsm_a_rr_repeated_eutran_neighbour_cells = -1;
917 static int hf_gsm_a_rr_eutran_tdd_reporting_offset_present = -1;
918 static int hf_gsm_a_rr_bitmap_type_reporting = -1;
919 static int hf_gsm_a_rr_gprs_mobile_allocation = -1;
920 static int hf_gsm_a_rr_default_utran_priority_parameters = -1;
921 static int hf_gsm_a_rr_tfi_multiblock = -1;
922 static int hf_gsm_a_rr_hopping_case = -1;
923 static int hf_gsm_a_rr_repeated_umts_tdd_neighbour_cells_earlier_version_bit_reserved = -1;
924 static int hf_gsm_a_rr_gprs_3g_measurement_parameters_description = -1;
925 static int hf_gsm_a_rr_nc_measurement_parameters = -1;
926 static int hf_gsm_a_rr_lb_ms_txpwr_max_cch_present = -1;
927 static int hf_gsm_a_rr_810_reporting = -1;
928 static int hf_gsm_a_rr_thresh_utran_low_present = -1;
929 static int hf_gsm_a_rr_pbcch = -1;
930 static int hf_gsm_a_rr_packet_downlink_assignment = -1;
931 static int hf_gsm_a_rr_repeated_csg_pci_split = -1;
932 static int hf_gsm_a_rr_700_reporting = -1;
933 static int hf_gsm_a_rr_fdd_reporting_parameters = -1;
934 static int hf_gsm_a_rr_compressed_inter_rat_handover_info = -1;
935 static int hf_gsm_a_rr_rtd12 = -1;
936 static int hf_gsm_a_rr_utran_tdd_description = -1;
937 static int hf_gsm_a_rr_3g_csg_desc_technology = -1;
938 static int hf_gsm_a_rr_reporting_quantity_present = -1;
939 static int hf_gsm_a_rr_absolute_index_start_emr_present = -1;
940 static int hf_gsm_a_rr_downlink_uplink = -1;
941 static int hf_gsm_a_rr_extended_ra_present = -1;
942 static int hf_gsm_a_rr_downlink_uplink_discriminator_bit = -1;
943 static int hf_gsm_a_rr_timing_advance_index_timeslot = -1;
944 static int hf_gsm_a_rr_3g_reporting_quantity = -1;
945 static int hf_gsm_a_rr_additional_rtd = -1;
946 static int hf_gsm_a_rr_repeated_umts_fdd_neighbour_cells = -1;
947 static int hf_gsm_a_rr_1800_reporting_present = -1;
948 static int hf_gsm_a_rr_repeated_eutran_pcid_ta_mapping = -1;
949 static int hf_gsm_a_rr_arfcn_index_list = -1;
950 static int hf_gsm_a_rr_tdd_multirat_reporting_present = -1;
951 static int hf_gsm_a_rr_eutran_reporting_quantity = -1;
952 static int hf_gsm_a_rr_repeated_eutran_not_allowed_cells = -1;
953 static int hf_gsm_a_rr_si13_change_mark_present = -1;
954 static int hf_gsm_a_rr_eutran_fdd_reporting_present = -1;
955 static int hf_gsm_a_rr_hopping_flag = -1;
956 static int hf_gsm_a_call_prio_present = -1;
957 static int hf_gsm_a_rr_repeated_umts_fdd_neighbour_cells_earlier_version_bit_reserved = -1;
958 static int hf_gsm_a_rr_fdd_multirat_reporting_present = -1;
959 static int hf_gsm_a_rr_repeated_eutran_measurement_control_parameters = -1;
960 static int hf_gsm_a_rr_timing_adv_index_present = -1;
961 static int hf_gsm_a_rr_real_time_difference_description = -1;
962 static int hf_gsm_a_rr_tdd_cell_info_param_value0 = -1;
963 static int hf_gsm_a_rr_gprs_report_priority_description = -1;
964 static int hf_gsm_a_rr_eutran_fdd_reporting_threshold_2_present = -1;
965 static int hf_gsm_a_rr_timing_advance_index = -1;
966 static int hf_gsm_a_rr_utran_fdd_description = -1;
967 static int hf_gsm_a_rr_repeated_rtd = -1;
968 static int hf_gsm_a_rr_fdd_reporting_offset_present = -1;
969 static int hf_gsm_a_rr_mcc_mnc_parameters = -1;
970 static int hf_gsm_a_rr_packet_uplink_assignment = -1;
971 static int hf_gsm_a_rr_utran_frequency_index_present = -1;
972 static int hf_gsm_a_rr_earlier_version_reserved_bit = -1;
973 static int hf_gsm_a_rr_psc_present = -1;
974 static int hf_gsm_a_rr_serving_cell_data = -1;
975 static int hf_gsm_a_rr_utran_tdd_description_earlier_version_bit_reserved2 = -1;
976 static int hf_gsm_a_rr_repeated_rtd_frequency = -1;
977 static int hf_gsm_a_rr_pr_mode_present = -1;
978 static int hf_gsm_a_rr_eutran_default_measurement_control_eutran_present = -1;
979 static int hf_gsm_a_rr_3g_additional_measurement_parameters_description_2 = -1;
980 static int hf_gsm_a_rr_e_utran_measurement_report = -1;
981 static int hf_gsm_a_rr_3g_neighbour_cell_description = -1;
982 static int hf_gsm_a_rr_400_reporting_present = -1;
983 static int hf_gsm_a_rr_gamma_present = -1;
984 static int hf_gsm_a_rr_additional_lsa_id = -1;
985 static int hf_gsm_a_rr_tdd_information = -1;
986 static int hf_gsm_a_rr_utran_priority_present = -1;
987 static int hf_gsm_a_rr_utran_qrxlevmin_present = -1;
988 static int hf_gsm_a_rr_repeated_csg_fdd_uarfcn = -1;
989 static int hf_gsm_a_rr_arfcn_present = -1;
990 static int hf_gsm_a_rr_cdma2000_multirat_reporting = -1;
991 static int hf_gsm_a_rr_si13alt_position_present = -1;
992 static int hf_gsm_a_rr_3g_csg_description = -1;
993 static int hf_gsm_a_rr_rtd = -1;
994 static int hf_gsm_a_rr_tbf_starting_time_present = -1;
995 static int hf_gsm_a_rr_eutran_fdd_reporting = -1;
996 static int hf_gsm_a_rr_nc_periods = -1;
997 static int hf_gsm_a_rr_index_start_3g_present = -1;
998 static int hf_gsm_a_rr_repeated_pcid = -1;
999 static int hf_gsm_a_rr_repeated_invalid_bsic_information = -1;
1000 static int hf_gsm_a_rr_repeated_utran_measurement_control_parameters_struct = -1;
1001 static int hf_gsm_a_rr_repeated_utran_priority_parameters = -1;
1002 static int hf_gsm_a_rr_measurement_parameters_description = -1;
1003 static int hf_gsm_a_rr_bep_period2_present = -1;
1004 static int hf_gsm_a_rr_serving_reporting_present = -1;
1005 static int hf_gsm_a_rr_alpha_present = -1;
1006 static int hf_gsm_a_rr_psc_pattern = -1;
1007 static int hf_gsm_a_rr_second_packet_assignment_discriminator_bit = -1;
1008 static int hf_gsm_a_rr_lsa_id_type = -1;
1009 static int hf_gsm_a_rr_fdd_parameters = -1;
1010 static int hf_gsm_a_rr_gprs_real_time_difference_description = -1;
1011 static int hf_gsm_a_rr_repeated_eutran_frequency_index = -1;
1012 static int hf_gsm_a_rr_3g_additional_measurement_parameters_description = -1;
1013 static int hf_gsm_a_rr_eutran_measurement_parameters_description = -1;
1014 static int hf_gsm_a_rr_mbms_assignment = -1;
1015 static int hf_gsm_a_rr_ms_parameters = -1;
1016 static int hf_gsm_a_rr_utran_fdd_description_earlier_version_bit_reserved2 = -1;
1017 static int hf_gsm_a_rr_3g_measurement_parameters_description = -1;
1018 static int hf_gsm_a_rr_eutran_priority_present = -1;
1019 static int hf_gsm_a_rr_1900_reporting_present = -1;
1020 static int hf_gsm_a_rr_3g_measurement_control_parameters_description_struct = -1;
1021 static int hf_gsm_a_rr_eutran_parameters_description = -1;
1022 static int hf_gsm_a_rr_rtd6 = -1;
1023 static int hf_gsm_a_rr_thresh_eutran_low_present = -1;
1024 static int hf_gsm_a_rr_allocation_type = -1;
1025 static int hf_gsm_a_rr_additional_rtd_struct = -1;
1026 static int hf_gsm_a_rr_additional_information_for_3x_auxiliary_pilot = -1;
1027 static int hf_gsm_a_rr_fdd_information = -1;
1028 static int hf_gsm_a_rr_future_extensions_of_the_2g_parameters = -1;
1029 static int hf_gsm_a_rr_ba_index_start_rtd = -1;
1030 static int hf_gsm_a_rr_utran_tdd_description_earlier_version_bit_reserved1 = -1;
1031 static int hf_gsm_a_rr_eutran_fdd_reporting_threshold = -1;
1032 static int hf_gsm_a_rr_measurement_control_parameters_description = -1;
1033 static int hf_gsm_a_rr_eutran_measurement_bandwidth_present = -1;
1034 static int hf_gsm_a_rr_eutran_tdd_reporting_threshold_2_present = -1;
1035 static int hf_gsm_a_rr_eutran_earfcn_present = -1;
1036 static int hf_gsm_a_rr_eutran_qrxlevmin_present = -1;
1037 static int hf_gsm_a_rr_ba_index_start_bsic_present = -1;
1038 static int hf_gsm_a_rr_gprs_bsic_description = -1;
1039 static int hf_gsm_a_rr_group_channel_description = -1;
1040 static int hf_gsm_a_rr_cdma2000_description = -1;
1041 static int hf_gsm_a_rr_si_2quater_extension_information = -1;
1042 static int hf_gsm_a_rr_3g_supplementary_parameters_description = -1;
1043 static int hf_gsm_a_rr_multiband_reporting_present = -1;
1044 static int hf_gsm_a_rr_report_priority_description = -1;
1045 static int hf_gsm_a_rr_tdd_reporting_offset_present = -1;
1046 static int hf_gsm_a_rr_amr_config_present = -1;
1047 static int hf_gsm_a_rr_900_reporting_present = -1;
1048 static int hf_gsm_a_rr_rfl_number_present = -1;
1049 static int hf_gsm_a_rr_eutran_fdd_reporting_offset_present = -1;
1050 static int hf_gsm_a_rr_repeated_csg_psc_split_struct = -1;
1051 static int hf_gsm_a_rr_gprs_eutran_measurement_parameters_description = -1;
1052 static int hf_gsm_a_rr_tdd_parameters = -1;
1053 static int hf_gsm_a_rr_repeat_eutran_desc = -1;
1054 static int hf_gsm_a_rr_peo_dsc_and_rcc_present = -1;
1055 static int hf_gsm_a_rr_c1_delta_present = -1;
1056 static int hf_gsm_a_rr_ul_xtti_tbf_assignment = -1;
1057 static int hf_gsm_a_rr_dl_xtti_tbf_assignment = -1;
1058 static int hf_gsm_a_rr_fanr_act_state = -1;
1059 static int hf_gsm_a_rr_encoding_selection = -1;
1060 static int hf_gsm_a_rr_nof_pdch_pairs = -1;
1061 static int hf_gsm_a_rr_npm_transfer_time_present = -1;
1062 static int hf_gsm_a_rr_eab_parameters = -1;
1063
1064 /* gsm_rr_csn_HL_flag() fields */
1065 static int hf_gsm_a_rr_selection_parameters = -1;
1066 static int hf_gsm_a_rr_break_indicator = -1;
1067 static int hf_gsm_a_rr_si13_contents = -1;
1068 static int hf_gsm_a_rr_additions_in_rel_9 = -1;
1069 static int hf_gsm_a_rr_lsa_id_information = -1;
1070 static int hf_gsm_a_rr_si2quater_indicator = -1;
1071 static int hf_gsm_a_rr_si21_indicator = -1;
1072 static int hf_gsm_a_rr_additions_in_rel_4 = -1;
1073 static int hf_gsm_a_call_prio4 = -1;
1074 static int hf_gsm_a_rr_gprs_ms_txpwr_max_ccch_present = -1;
1075 static int hf_gsm_a_rr_vbs_vgcs_options = -1;
1076 static int hf_gsm_a_rr_si4_rest_octets_s = -1;
1077 static int hf_gsm_a_call_prio1 = -1;
1078 static int hf_gsm_a_rr_si2ter_mp_change_mark_present = -1;
1079 static int hf_gsm_a_rr_gprs_indicator = -1;
1080 static int hf_gsm_a_rr_nln_pch_present = -1;
1081 static int hf_gsm_a_rr_early_classmark_sending = -1;
1082 static int hf_gsm_a_rr_chnl_needed_ch3and4 = -1;
1083 static int hf_gsm_a_rr_additions_in_rel_5 = -1;
1084 static int hf_gsm_a_rr_group_call_information = -1;
1085 static int hf_gsm_a_rr_lsa_parameters = -1;
1086 static int hf_gsm_a_rr_first_discriminator_bit = -1;
1087 static int hf_gsm_a_rr_packet_paging_procedure_3 = -1;
1088 static int hf_gsm_a_rr_packet_paging_procedure_1 = -1;
1089 static int hf_gsm_a_rr_chnl_needed_ch3_present = -1;
1090 static int hf_gsm_a_rr_power_offset_present = -1;
1091 static int hf_gsm_a_call_prio2 = -1;
1092 static int hf_gsm_a_rr_additions_in_rel_6 = -1;
1093 static int hf_gsm_a_rr_packet_paging_procedure_2 = -1;
1094 static int hf_gsm_a_rr_3g_early_classmark_sending_restriction = -1;
1095 static int hf_gsm_a_rr_scheduling_if_and_where = -1;
1096 static int hf_gsm_a_rr_packet_page_indication_1 = -1;
1097 static int hf_gsm_a_rr_cbq3_present = -1;
1098 static int hf_gsm_a_rr_second_discriminator_bit = -1;
1099 static int hf_gsm_a_call_prio3 = -1;
1100 static int hf_gsm_a_rr_additions_in_release_6_present = -1;
1101 static int hf_gsm_a_rr_system_information_type_2ter = -1;
1102 static int hf_gsm_a_rr_a_compressed_inter_rat_handover_info = -1;
1103 static int hf_gsm_a_rr_additions_in_rel_8 = -1;
1104 static int hf_gsm_a_rr_dtm = -1;
1105 static int hf_gsm_a_rr_pch_and_nch_info = -1;
1106 static int hf_gsm_a_rr_cell_id_present = -1;
1107 static int hf_gsm_a_rr_additions_in_r99 = -1;
1108 static int hf_gsm_a_rr_mbms_procedures = -1;
1109 static int hf_gsm_a_rr_nch_position_present = -1;
1110 static int hf_gsm_a_rr_additions_in_rel_7 = -1;
1111 static int hf_gsm_a_rr_packet_page_indication_2 = -1;
1112 static int hf_gsm_a_rr_multiple_tbf_procedures = -1;
1113 static int hf_gsm_a_rr_additions_in_rel_10 = -1;
1114 static int hf_gsm_a_rr_additions_in_rel_13 = -1;
1115 static int hf_gsm_a_rr_si_change_alt = -1;
1116
1117 /* Additions in Rel-8 */
1118 static int hf_gsm_a_rr_3g_priority_param_desc_utran_start = -1;
1119 static int hf_gsm_a_rr_3g_priority_param_desc_utran_stop = -1;
1120 static int hf_gsm_a_rr_3g_priority_param_desc_default_utran_prio = -1;
1121 static int hf_gsm_a_rr_3g_priority_param_desc_default_threshold_utran = -1;
1122 static int hf_gsm_a_rr_3g_priority_param_desc_default_utran_qrxlevmin = -1;
1123 static int hf_gsm_a_rr_utran_frequency_index = -1;
1124 static int hf_gsm_a_rr_utran_priority = -1;
1125 static int hf_gsm_a_rr_thresh_utran_high = -1;
1126 static int hf_gsm_a_rr_thresh_utran_low = -1;
1127 static int hf_gsm_a_rr_utran_qrxlevmin = -1;
1128 static int hf_gsm_a_rr_eutran_ccn_active = -1;
1129 static int hf_gsm_a_rr_eutran_start = -1;
1130 static int hf_gsm_a_rr_eutran_stop = -1;
1131 static int hf_gsm_a_rr_qsearch_c_eutran_initial = -1;
1132 static int hf_gsm_a_rr_eutran_multirat_reporting = -1;
1133 static int hf_gsm_a_rr_eutran_fdd_reporting_threshold_rsrp = -1;
1134 static int hf_gsm_a_rr_eutran_fdd_reporting_threshold_rsrq = -1;
1135 static int hf_gsm_a_rr_eutran_fdd_reporting_threshold_2 = -1;
1136 static int hf_gsm_a_rr_eutran_fdd_reporting_offset = -1;
1137 static int hf_gsm_a_rr_eutran_tdd_reporting_threshold_rsrp = -1;
1138 static int hf_gsm_a_rr_eutran_tdd_reporting_threshold_rsrq = -1;
1139 static int hf_gsm_a_rr_eutran_tdd_reporting_threshold_2 = -1;
1140 static int hf_gsm_a_rr_eutran_tdd_reporting_offset = -1;
1141 static int hf_gsm_a_rr_eutran_fdd_measurement_report_offset = -1;
1142 static int hf_gsm_a_rr_eutran_tdd_measurement_report_offset = -1;
1143 static int hf_gsm_a_rr_reporting_granularity = -1;
1144 static int hf_gsm_a_rr_eutran_default_measurement_control_eutran = -1;
1145 static int hf_gsm_a_rr_eutran_measurement_control_eutran = -1;
1146 static int hf_gsm_a_rr_qsearch_p_eutran = -1;
1147 static int hf_gsm_a_rr_serving_cell_priority_param_geran_priority = -1;
1148 static int hf_gsm_a_rr_serving_cell_priority_param_thresh_prio_search = -1;
1149 static int hf_gsm_a_rr_serving_cell_priority_param_thresh_gsm_low = -1;
1150 static int hf_gsm_a_rr_serving_cell_priority_param_h_prio = -1;
1151 static int hf_gsm_a_rr_serving_cell_priority_param_t_reselection = -1;
1152 static int hf_gsm_a_rr_eutran_earfcn = -1;
1153 static int hf_gsm_a_rr_eutran_measurement_bandwidth = -1;
1154 static int hf_gsm_a_rr_eutran_priority = -1;
1155 static int hf_gsm_a_rr_thresh_eutran_high = -1;
1156 static int hf_gsm_a_rr_thresh_eutran_low = -1;
1157 static int hf_gsm_a_rr_eutran_qrxlevmin = -1;
1158 static int hf_gsm_a_rr_eutran_pcid_present = -1;
1159 static int hf_gsm_a_rr_eutran_pcid = -1;
1160 static int hf_gsm_a_rr_eutran_pcid_bitmap_group = -1;
1161 static int hf_gsm_a_rr_eutran_pcid_pattern_length = -1;
1162 /* static int hf_gsm_a_rr_eutran_pcid_pattern = -1; */
1163 static int hf_gsm_a_rr_eutran_pcid_pattern_sense = -1;
1164 static int hf_gsm_a_rr_eutran_frequency_index = -1;
1165 static int hf_gsm_a_rr_psc = -1;
1166 static int hf_gsm_a_rr_utran_psc_pattern_length = -1;
1167 static int hf_gsm_a_rr_utran_psc_pattern_sense = -1;
1168 static int hf_gsm_a_rr_utran_csg_fdd_uarfcn = -1;
1169 static int hf_gsm_a_rr_utran_csg_tdd_uarfcn = -1;
1170 static int hf_gsm_a_rr_csg_earfcn = -1;
1171 static int hf_gsm_a_rr_3g_control_param_desc_meas_ctrl_utran = -1;
1172 static int hf_gsm_a_rr_peo_bcch_change_mark = -1;
1173 static int hf_gsm_a_rr_feat_ind_cs_ir = -1;
1174 static int hf_gsm_a_rr_feat_ind_ps_ir = -1;
1175
1176 /* Additions for EC-GSM-IoT rel. 13 */
1177 static int hf_gsm_a_rr_ec_qhfi = -1;
1178 static int hf_gsm_a_rr_ec_dl_cc = -1;
1179 static int hf_gsm_a_rr_ec_ul_cc = -1;
1180 static int hf_gsm_a_rr_tsc_set = -1;
1181 static int hf_gsm_a_rr_ec_tsc = -1;
1182 static int hf_gsm_a_rr_ec_ma_number = -1;
1183
1184 static int hf_gsm_a_rr_ec_enhanced_access_burst = -1;
1185 static int hf_gsm_a_rr_ec_starting_ul_timeslot = -1;
1186 static int hf_gsm_a_rr_ec_starting_dl_timeslot = -1;
1187 static int hf_gsm_a_rr_ec_starting_dl_timeslot_offset = -1;
1188 static int hf_gsm_a_rr_ec_starting_ul_timeslot_offset = -1;
1189 static int hf_gsm_a_rr_ec_overlaid_cdma_code = -1;
1190 static int hf_gsm_a_rr_ec_mcs_exist = -1;
1191 static int hf_gsm_a_rr_ec_start_first_ul_data_block = -1;
1192 static int hf_gsm_a_rr_ec_fua_gap_list = -1;
1193 static int hf_gsm_a_rr_ec_start_fn_next_data_block_exist = -1;
1194 static int hf_gsm_a_rr_ec_start_fn_next_data_block = -1;
1195
1196 static int hf_gsm_a_rr_ec_used_dl_cc = -1;
1197 static int hf_gsm_a_rr_ec_page_extension_exist = -1;
1198 static int hf_gsm_a_rr_ec_page_extension = -1;
1199 static int hf_gsm_a_rr_ec_last_tdma_frame = -1;
1200 static int hf_gsm_a_rr_ec_echoed_random_bits = -1;
1201
1202 static int hf_gsm_a_rr_ec_wait_timer = -1;
1203 static int hf_gsm_a_rr_ec_req_ref_2_present = -1;
1204 static int hf_gsm_a_rr_ec_req_ref_3_present = -1;
1205
1206 static int hf_gsm_a_rr_ec_ptmsi_imsi_select = -1;
1207 static int hf_gsm_a_rr_ec_imsi_digits = -1;
1208 static int hf_gsm_a_rr_ec_imsi = -1;
1209 static int hf_gsm_a_rr_ec_mobile_identity_2_exist = -1;
1210
1211 static int hf_gsm_a_rr_ec_cc1_timeslot_multiplier = -1;
1212 static int hf_gsm_a_rr_ec_alpha_enable = -1;
1213
1214 static int hf_gsm_a_rr_rcc = -1;
1215 static int hf_gsm_a_rr_implicit_reject_cs = -1;
1216 static int hf_gsm_a_rr_implicit_reject_ps = -1;
1217 static int hf_gsm_a_rr_peo_dsc = -1;
1218 static int hf_gsm_a_rr_c1_delta_min = -1;
1219 static int hf_gsm_a_rr_c1_delta_max = -1;
1220
1221 /* Initialize the subtree pointers */
1222 static gint ett_ccch_msg = -1;
1223 static gint ett_ec_ccch_msg = -1;
1224 static gint ett_ccch_oct_1 = -1;
1225 static gint ett_sacch_msg = -1;
1226
1227 static expert_field ei_gsm_a_rr_ie_overrun = EI_INIT;
1228 static expert_field ei_gsm_a_rr_ie_underrun = EI_INIT;
1229 static expert_field ei_gsm_a_rr_data_not_dissected = EI_INIT;
1230 static expert_field ei_gsm_a_rr_unknown_version = EI_INIT;
1231 static expert_field ei_gsm_a_rr_extraneous_data = EI_INIT;
1232 static expert_field ei_gsm_a_rr_missing_mandatory_element = EI_INIT;
1233
1234 static dissector_handle_t rrlp_dissector;
1235
1236
1237 #define NUM_GSM_RR_ELEM (sizeof(gsm_rr_elem_strings)/sizeof(value_string))
1238 gint ett_gsm_rr_elem[NUM_GSM_RR_ELEM];
1239
1240 typedef enum
1241 {
1242     /* RR Rest Octets information elements */
1243     DE_RR_REST_OCTETS_UTRAN_FDD_DESC,
1244     DE_RR_REST_OCTETS_UTRAN_TDD_DESC,
1245     DE_RR_REST_OCTETS_3G_MEAS_PARAM_DESC,
1246     DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC,
1247     DE_RR_REST_OCTETS_MEAS_PARAM_DESC,
1248     DE_RR_REST_OCTETS_GPRS_RTD_DESC,
1249     DE_RR_REST_OCTETS_GPRS_BSIC_DESC,
1250     DE_RR_REST_OCTETS_GPRS_REPORT_PRIO_DESC,
1251     DE_RR_REST_OCTETS_GPRS_MEAS_PARAM_DESC,
1252     DE_RR_REST_OCTETS_NC_MEAS_PARAM,
1253     DE_RR_REST_OCTETS_SI2Q_EXT_INFO,
1254     DE_RR_REST_OCTETS_CCN_SUPPORT_DESC,
1255     DE_RR_REST_OCTETS_3G_NEIGH_CELL_DESC,
1256     DE_RR_REST_OCTETS_FDD_CELL_INFORMATION_FIELD,
1257     DE_RR_REST_OCTETS_TDD_CELL_INFORMATION_FIELD,
1258     DE_RR_REST_OCTETS_GPRS_3G_MEAS_PARAM_DESC,
1259     DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC2,
1260     DE_RR_REST_OCTETS_PRIORITY_AND_EUTRAN_PARAM_DESC,
1261     DE_RR_REST_OCTETS_SERVING_CELL_PRIORITY_PARAM_DESC,
1262     DE_RR_REST_OCTETS_3G_PRIORITY_PARAM_DESC,
1263     DE_RR_REST_OCTETS_UTRAN_PRIO_PARAM,
1264     DE_RR_REST_OCTETS_EUTRAN_PARAM_DESC,
1265     DE_RR_REST_OCTETS_EUTRAN_NEIGHBOUR_CELLS,
1266     DE_RR_REST_OCTETS_EUTRAN_NOT_ALLOWED_CELLS,
1267     DE_RR_REST_OCTETS_EUTRAN_PCID_TO_TA_MAPPING,
1268     DE_RR_REST_OCTETS_3G_CSG_DESC,
1269     DE_RR_REST_OCTETS_EUTRAN_CSG_DESC,
1270     DE_RR_REST_OCTETS_OPTIONAL_SEL_PARAM,
1271     DE_RR_REST_OCTETS_GPRS_INDICATOR,
1272     DE_RR_REST_OCTETS_SI4_REST_OCTETS_O,
1273     DE_RR_REST_OCTETS_SI4_REST_OCTETS_S,
1274     DE_RR_REST_OCTETS_LSA_PARAMETERS,
1275     DE_RR_REST_OCTETS_LSA_ID_INFO,
1276     DE_RR_REST_OCTETS_PCH_AND_NCH_INFO,
1277     DE_RR_REST_OCTETS_VBS_VGCS_OPTIONS,
1278     DE_RR_REST_OCTETS_GPRS_MOBILE_ALLOC,
1279     DE_RR_REST_OCTETS_GPRS_CELL_OPTIONS,
1280     DE_RR_REST_OCTETS_GPRS_CELL_OPTIONS_EXT_INFO,
1281     DE_RR_REST_OCTETS_GPRS_POWER_CONTROL_PARAMS,
1282     DE_RR_REST_OCTETS_PBCCH_DESC,
1283     DE_RR_REST_OCTETS_GSM_DESC,
1284     DE_RR_REST_OCTETS_RTD_DESC,
1285     DE_RR_REST_OCTETS_BSIC_DESC,
1286     DE_RR_REST_OCTETS_REPORT_PRIO_DESC,
1287     DE_RR_REST_OCTETS_CDMA2000_DESC,
1288     DE_RR_REST_OCTETS_SERVING_CELL_DATA,
1289     DE_RR_REST_OCTETS_REPEAT_INV_BSIC_INFO,
1290     DE_RR_REST_OCTETS_BITMAP_TYPE_REPORTING,
1291     DE_RR_REST_OCTETS_3G_SUPPLEMENTARY_PARAM_DESC,
1292     DE_RR_REST_OCTETS_UTRAN_MEASUREMENT_CONTROL_PARAM_DESC,
1293     DE_RR_REST_OCTETS_EGPRS_PACKET_UPLINK_ASSIGNMENT,
1294     DE_RR_REST_OCTETS_MULTIPLE_BLOCKS_PACKET_DOWNLINK_ASSIGNMENT,
1295     DE_RR_REST_OCTETS_TMGI,
1296     DE_RR_REST_OCTETS_PACKET_TIMING_ADVANCE,
1297     DE_RR_REST_OCTETS_PACKET_UPLINK_ASSIGNMENT,
1298     DE_RR_REST_OCTETS_PACKET_DOWNLINK_ASSIGNMENT,
1299     DE_RR_REST_OCTETS_SECOND_PART_PACKET_ASSIGNMENT,
1300     DE_RR_REST_OCTETS_REPORTING_QUANTITY,
1301     DE_RR_REST_OCTETS_EUTRAN_MEASUREMENT_REPORT,
1302     DE_RR_REST_OCTETS_EUTRAN_DESC,
1303     DE_RR_REST_OCTETS_EAB_PARAM_DESC,
1304     DE_RR_REST_OCTETS_NONE
1305 }
1306 rr_rest_octets_elem_idx_t;
1307
1308 #define NUM_GSM_RR_REST_OCTETS_ELEM (sizeof(gsm_rr_rest_octets_elem_strings)/sizeof(value_string))
1309 gint ett_gsm_rr_rest_octets_elem[NUM_GSM_RR_REST_OCTETS_ELEM];
1310
1311 /* True/False flags specifically for gsm_rr_csn_flag */
1312 static const true_false_string tfs_tfi_multi_block_allocation_present = {"TFI Assignment Present", "Multi Block Allocation Present"};
1313 static const true_false_string tfs_fixed_dynamic_allocation = {"Fixed Allocation (not to be used after Rel-4)", "Dynamic Allocation (mandatory after Rel-4)"};
1314 static const true_false_string tfs_mode_b_mode_a = {"Mode B (not to be used after Rel-4)", "Mode A (mandatory after Rel-4)"};
1315 static const true_false_string tfs_downlink_assignment = {"Default 0 bit", "Reserved Value"};
1316 static const true_false_string tfs_non_distribution_distribution = {"(Non-distribution)", "(Distribution)"};
1317 static const true_false_string tfs_normal_single_block = {"Normal", "Single Block"};
1318 static const true_false_string tfs_early_r97_version_later_than_r97_version = {"Early R97 version", "Later than R97 version"};
1319 static const true_false_string tfs_later_than_r97_version_early_r97_version = {"Later than R97 version", "Early R97 version"};
1320 static const true_false_string tfs_earlier_version_current_version = {"Earlier version", "Current version"};
1321 static const true_false_string tfs_downlink_uplink_discriminator_bit = {"Reserved for future use", "EGPRS Packet Uplink Assignment or Multiple blocks Packet Downlink Assignment"};
1322 static const true_false_string tfs_downlink_uplink_assign = {"Multiple blocks Packet Downlink Assignment", "EGPRS Packet Uplink Assignment"};
1323 static const true_false_string tfs_second_part_packet_assignment = {"Second Part Packet Assignment", "Packet Assignment"};
1324 static const true_false_string tfs_packet_downlink_uplink_assignment = {"Packet Downlink Assignment", "Packet Uplink Assignment"};
1325 static const true_false_string tfs_shall_be_shall_not_be_used = {"Shall be used", "Shall not be used"};
1326 static const true_false_string tfs_current_version_earlier_version = {"Current version", "Earlier version"};
1327 static const true_false_string tfs_member_not_member_of_set = {"is a member of the set", "is not a member of the set"};
1328 static const true_false_string tfs_not_present_present = {"Not Present", "Present"};
1329 static const true_false_string tfs_rsrq_rsrp = {"RSRQ", "RSRP"};
1330 static const true_false_string tfs_3_bit_6_bit = {"3 bit", "6 bit"};
1331 static const true_false_string tfs_tdd_fdd = {"TDD", "FDD"};
1332 static const true_false_string tfs_ec_no_rscp = {"Ec/No", "RSCP"};
1333 static const true_false_string tfs_short_lsa_id_lsa_id = {"Short LSA ID", "LSA ID"};
1334 static const true_false_string tfs_present_not_present_in_cell = {"Present In Cell", "Not Present In Cell"};
1335 static const true_false_string tfs_ec_ptmsi_imsi = {"IMSI", "P-TMSI"};
1336
1337 /* this function is used for dissecting the 0/1 presence flags in CSN.1 coded IEs */
1338 static gboolean gsm_rr_csn_flag(tvbuff_t *tvb, proto_tree *tree, gint bit_offset, int hf_bit)
1339 {
1340     guint8 bit_mask        = 0x80 >> (bit_offset % 8);
1341     guint8 value           = tvb_get_guint8(tvb, bit_offset >> 3);
1342
1343     proto_tree_add_bits_item(tree, hf_bit, tvb, bit_offset, 1, ENC_NA);
1344     return ((value & bit_mask) != 0);
1345 }
1346
1347 static const true_false_string tfs_break_indicator = {"Additional parameters \"SI4 Rest Octets_S\" are sent in SYSTEM INFORMATION TYPE 7 and 8",
1348                                                       "Additional parameters \"SI4 Rest Octets_S\" are not sent in SYSTEM INFORMATION TYPE 7 and 8"};
1349 static const true_false_string tfs_for_gprs_for_rr_connection_establishment = {"For GPRS", "For RR connection establishment"};
1350 static const true_false_string tfs_3g_early_classmark_sending_restriction = {"The sending of UTRAN,CDMA2000 and GERAN IU MODE CLASSMARK CHANGE messages are controlled by the Early Classmark Sending Control parameter",
1351                                                                              "Neither UTRAN, CDMA2000 nor GERAN IU MODE CLASSMARK CHANGE message shall be sent with the Early classmark sending"};
1352 static const true_false_string tfs_supported_in_serving_cell_not_supported_in_serving_cell = {"Supported in Serving cell", "Not Supported in Serving cell"};
1353
1354 static gint de_rr_eutran_not_allowed_cells(tvbuff_t *tvb, proto_tree *tree, gint bit_offset);
1355
1356 /* this function is used for dissecting the H/L presence flags in CSN.1 coded IEs"
1357    If truncation ( 44.018 section 8.9) is allowed, truncation_length is set to the actual bit length of the CSN.1 string,
1358    otherwise it is set to 0 */
1359 static gboolean gsm_rr_csn_HL_flag(tvbuff_t *tvb, proto_tree *tree, guint truncation_length, guint bit_offset, int hf_bit)
1360 {
1361     guint8 bit_mask        = 0x80 >> (bit_offset % 8);
1362     guint8 value           = PADDING_BYTE;
1363     char   bits_str[]      = {".... .... = "};
1364     guint8 offset_in_octet = bit_offset % 8;
1365     proto_item* ti;
1366
1367     if (truncation_length)
1368     {
1369        if (bit_offset < truncation_length)
1370        {
1371           /* there should be some real data to fetch */
1372           value = tvb_get_guint8(tvb, bit_offset >> 3)^PADDING_BYTE;
1373        }
1374        else
1375        {
1376           /* implicit L bit */
1377           ti = proto_tree_add_boolean(tree, hf_bit, tvb, truncation_length>>3, 1, FALSE);
1378           proto_item_prepend_text(ti, "(implicit L bit)");
1379           return FALSE;
1380        }
1381     }
1382     else
1383     {
1384        /* if truncation_length == 0, then don't check for truncation*/
1385        value = tvb_get_guint8(tvb, bit_offset >> 3)^PADDING_BYTE;
1386     }
1387
1388     if (value & bit_mask)
1389     {
1390         bits_str[offset_in_octet + (offset_in_octet / 4)] = 'H';
1391         ti = proto_tree_add_boolean(tree, hf_bit, tvb, bit_offset>>3, 1, TRUE);
1392         proto_item_prepend_text(ti, "%s", bits_str);
1393         return TRUE;
1394     }
1395     else
1396     {
1397         bits_str[offset_in_octet + (offset_in_octet / 4)] = 'L';
1398         ti = proto_tree_add_boolean(tree, hf_bit, tvb, bit_offset>>3, 1, FALSE);
1399         proto_item_prepend_text(ti, "%s", bits_str);
1400         return FALSE;
1401     }
1402 }
1403
1404 /*
1405 10.5.2 Radio Resource management information elements
1406  * [3] 10.5.2.1a BA Range
1407  */
1408 static guint16
1409 de_rr_ba_range(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1410 {
1411     guint32 curr_offset;
1412     gint    bit_offset;
1413     guint8  value;
1414
1415     curr_offset = offset;
1416     proto_tree_add_item(tree, hf_gsm_a_rr_range_nb, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1417     value = tvb_get_guint8(tvb, curr_offset);
1418     curr_offset += 1;
1419     bit_offset = curr_offset << 3;
1420     while (value)
1421     {
1422         proto_tree_add_bits_item(tree, hf_gsm_a_rr_range_lower, tvb, bit_offset, 10, ENC_BIG_ENDIAN);
1423         bit_offset += 10;
1424         proto_tree_add_bits_item(tree, hf_gsm_a_rr_range_higher, tvb, bit_offset, 10, ENC_BIG_ENDIAN);
1425         bit_offset += 10;
1426         value -= 1;
1427     }
1428
1429     curr_offset += len - 1;
1430     return (curr_offset - offset);
1431 }
1432
1433 /*
1434  * [3] 10.5.2.1b Cell Channel Description
1435  */
1436
1437 #define ARFCN_MAX 1024 /* total number of ARFCNs defined */
1438
1439 static void display_channel_list(guint8 *list, tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
1440 {
1441     int         arfcn;
1442     proto_item *ti = NULL;
1443
1444     ti = proto_tree_add_bytes_format(tree, hf_gsm_a_rr_arfcn_list, tvb, offset, len, NULL, "List of ARFCNs =");
1445     for (arfcn=0; arfcn<ARFCN_MAX; arfcn++) {
1446         if (list[arfcn])
1447             proto_item_append_text(ti, " %d", arfcn);
1448     }
1449
1450     return;
1451 }
1452
1453 /**
1454  * Checks that the remaining "rest octets" all contain the default padding value.
1455  * If not, it can be assumed that there is a protocol extension
1456  * that we don't handle,
1457  * or a malformed PDU.
1458  *
1459  * len:        total length of buffer
1460  * bit_offset: bit offset in TVB of first bit to be examined
1461  */
1462 static void gsm_rr_csn_padding_bits(proto_tree* tree, tvbuff_t* tvb, guint16 bit_offset, guint8 octet_len)
1463 {
1464     guint    i;
1465     gboolean non_padding_found = FALSE;
1466     guint8   octet_offset      = bit_offset >> 3;
1467
1468     if ((octet_len << 3) > bit_offset)
1469     {
1470         /* there is spare room, check the first padding octet */
1471         guint8 bit_mask = 0xFF >> (bit_offset & 0x07);
1472         if ((tvb_get_guint8(tvb, octet_offset) & bit_mask) != (PADDING_BYTE & bit_mask))
1473         {
1474                non_padding_found = TRUE;
1475         }
1476         else
1477         {
1478            for (i=octet_offset+1; (i<octet_len) && !non_padding_found; i++)
1479            {
1480                if (tvb_get_guint8(tvb, i) != PADDING_BYTE)
1481                    non_padding_found = TRUE;
1482            }
1483         }
1484
1485         if (non_padding_found)
1486         {
1487             /* there is something here we don't understand */
1488             proto_tree_add_bytes_format_value(tree, hf_gsm_a_rr_padding, tvb, octet_offset, -1, NULL, "Unknown extension detected or malformed PDU (Not decoded)");
1489         }
1490         else
1491         {
1492             proto_tree_add_bytes_format_value(tree, hf_gsm_a_rr_padding, tvb, octet_offset, -1, NULL, "default padding");
1493         }
1494     }
1495     else
1496     {
1497        proto_tree_add_bytes_format(tree, hf_gsm_a_rr_padding, tvb, 0, 0, NULL, "No space for padding bits");
1498     }
1499 }
1500
1501 static gint greatest_power_of_2_lesser_or_equal_to(gint idx)
1502 {
1503     gint j = 1;
1504     do {
1505         j <<= 1;
1506     } while (j <= idx);
1507     j >>= 1;
1508     return j;
1509 }
1510
1511 gint f_k(gint k, gint *w, gint range)
1512 {
1513     gint idx, n, j;
1514
1515     idx    = k;
1516     range -= 1;
1517     range  = range/greatest_power_of_2_lesser_or_equal_to(idx);
1518     n      = w[idx]-1;
1519
1520     while (idx>1) {
1521         j = greatest_power_of_2_lesser_or_equal_to(idx);
1522         range = 2*range+1;
1523         if ((2*idx) < 3*j){ /* left child */
1524             idx -= j/2;
1525             n = (n+w[idx]-1+((range-1)/2)+1)%range;
1526         }
1527         else { /* right child */
1528             idx -= j;
1529             n = (n+w[idx]-1+1)%range;
1530         }
1531     }
1532
1533     return (n+1)%1024;
1534 }
1535
1536 static void dissect_channel_list_n_range(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gint range)
1537 {
1538     gint        curr_offset = offset, bit_offset, f0, arfcn_orig, w[64], wsize, i;
1539     gint        octet, nwi  = 1, jwi=0, imax, iused, arfcn;
1540     guint8      list[1024];
1541     proto_tree *subtree;
1542
1543     memset((void*)list,0,sizeof(list));
1544
1545     subtree = proto_tree_add_subtree_format(tree,tvb, curr_offset, len,
1546                                             ett_gsm_rr_elem[DE_RR_NEIGH_CELL_DESC], NULL, "Range %d format", range);
1547
1548     octet = tvb_get_guint8(tvb, curr_offset);
1549     if (range == 1024) {
1550         f0 = (octet>>2)&1;
1551         if (f0)
1552             list[0] = 1;
1553         arfcn_orig = 0;
1554         wsize = 10;
1555         imax = 16;
1556         bit_offset = curr_offset*8 + 6;
1557     }
1558     else {
1559         bit_offset = curr_offset*8 + 7;
1560         arfcn_orig = (gint) tvb_get_bits(tvb, bit_offset, 10, FALSE);
1561         proto_tree_add_bits_item(subtree, hf_n_range_orig_arfcn, tvb, bit_offset, 10, ENC_BIG_ENDIAN);
1562         bit_offset+=10;
1563
1564         list[arfcn_orig] = 1;
1565
1566         switch (range) {
1567         case 512:
1568             wsize=9;
1569             imax = 17;
1570             break;
1571         case 256:
1572             wsize=8;
1573             imax = 21;
1574             break;
1575         case 128:
1576             wsize=7;
1577             imax = 28;
1578             break;
1579         default:
1580             DISSECTOR_ASSERT_NOT_REACHED();
1581         }
1582     }
1583     iused = imax;   /* in case the list is actually full */
1584
1585     /* extract the variable size w[] elements */
1586     for (i=1; i<=imax; i++) {
1587         w[i] = (gint) tvb_get_bits(tvb, bit_offset, wsize, FALSE);
1588         proto_tree_add_bytes_format(subtree, hf_gsm_a_rr_w_elements, tvb, bit_offset>>3, ((bit_offset+wsize-1)>>3) - (bit_offset>>3) + 1 , NULL, "%s W(%d): %d",
1589                             decode_bits_in_field(bit_offset, wsize, w[i]),
1590                             i,
1591                             w[i]);
1592         bit_offset += wsize;
1593         curr_offset = bit_offset>>3;
1594
1595         if ((iused == imax) && (w[i] == 0) ) {
1596             iused = i - 1;
1597         }
1598         if ((curr_offset-offset)>len) {
1599             iused = i - 1;
1600             break;
1601         }
1602         if (++jwi == nwi) {       /* check if the number of wi at this wsize has been extracted */
1603             jwi = 0;            /* reset the count of wi at this size */
1604             nwi <<= 1;          /* get twice as many of the next size */
1605             wsize--;            /* make the next size 1 bit smaller */
1606         }
1607     }
1608
1609     for (i=1; i<=iused; i++) {
1610         arfcn = (f_k(i, w, range) + arfcn_orig)%1024;
1611         list[arfcn] = 1;
1612     }
1613
1614     display_channel_list(list, tvb, tree, offset, curr_offset-offset);
1615
1616     return;
1617 }
1618
1619 static guint16
1620 dissect_arfcn_list_core(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_, guint8 format)
1621 {
1622     guint32     curr_offset, byte;
1623     guint8      oct,bit;
1624     guint16     arfcn;
1625     proto_item *item;
1626
1627     curr_offset = offset;
1628
1629     if ((format & 0xc0) == 0x00)
1630     {
1631         /* bit map 0 */
1632         item = proto_tree_add_bytes_format(tree, hf_gsm_a_rr_arfcn_list, tvb, curr_offset, len, NULL, "List of ARFCNs =");
1633         bit = 4;
1634         arfcn = 125;
1635         for (byte = 0; byte <= len-1; byte++)
1636         {
1637             oct = tvb_get_guint8(tvb, curr_offset);
1638             while (bit-- != 0)
1639             {
1640                 arfcn--;
1641                 if (((oct >> bit) & 1) == 1)
1642                 {
1643                     proto_item_append_text(item," %d",arfcn);
1644                 }
1645             }
1646             bit = 8;
1647             curr_offset++;
1648         }
1649     }
1650     else if ((format & 0xc8) == 0x80)
1651     {
1652         /* 1024 range */
1653         dissect_channel_list_n_range(tvb, tree, pinfo, curr_offset, len, 1024);
1654         curr_offset = curr_offset + len;
1655     }
1656     else if ((format & 0xce) == 0x88)
1657     {
1658         /* 512 range */
1659         dissect_channel_list_n_range(tvb, tree, pinfo, curr_offset, len, 512);
1660         curr_offset = curr_offset + len;
1661     }
1662     else if ((format & 0xce) == 0x8a)
1663     {
1664         /* 256 range */
1665         dissect_channel_list_n_range(tvb, tree, pinfo, curr_offset, len, 256);
1666         curr_offset = curr_offset + len;
1667     }
1668     else if ((format & 0xce) == 0x8c)
1669     {
1670         /* 128 range */
1671         dissect_channel_list_n_range(tvb, tree, pinfo, curr_offset, len, 128);
1672         curr_offset = curr_offset + len;
1673     }
1674     else if ((format & 0xce) == 0x8e)
1675     {
1676         /* variable bit map */
1677         arfcn = ((format & 0x01) << 9) | (tvb_get_guint8(tvb, curr_offset+1) << 1) | ((tvb_get_guint8(tvb, curr_offset + 2) & 0x80) >> 7);
1678         item = proto_tree_add_bytes_format(tree, hf_gsm_a_rr_arfcn_list, tvb, curr_offset, len, NULL, "List of ARFCNs = %d",arfcn);
1679         curr_offset = curr_offset + 2;
1680         bit = 7;
1681         for (byte = 0; byte <= len-3; byte++)
1682         {
1683             oct = tvb_get_guint8(tvb, curr_offset);
1684             while (bit-- != 0)
1685             {
1686                 arfcn++;
1687                 if (((oct >> bit) & 1) == 1)
1688                 {
1689                     proto_item_append_text(item," %d",arfcn);
1690                 }
1691             }
1692             bit = 8;
1693             curr_offset++;
1694         }
1695     }
1696
1697     return(curr_offset - offset);
1698 }
1699
1700 /*
1701  * Format ID is in bits:
1702  * 128 127 124 123 122 (hf_gsm_a_rr_format_id)
1703  */
1704 static guint16
1705 dissect_arfcn_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1706 {
1707     guint32 curr_offset;
1708     guint8  oct;
1709
1710     curr_offset = offset;
1711
1712     oct = tvb_get_guint8(tvb, curr_offset);
1713
1714     /* FORMAT-ID, Format Identifier (part of octet 3)*/
1715     proto_tree_add_item(tree, hf_gsm_a_rr_format_id, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1716
1717     curr_offset += dissect_arfcn_list_core(tvb, tree, pinfo, offset, len, add_string, string_len, oct);
1718
1719     return(curr_offset - offset);
1720 }
1721
1722 /*
1723  * Format ID is in bits:
1724  * 128 124 123 122 (hf_gsm_a_rr_format_id2)
1725  */
1726 static guint16
1727 dissect_arfcn_list2(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1728 {
1729     guint32 curr_offset;
1730     guint8  oct;
1731
1732     curr_offset = offset;
1733
1734     /* Turn bit 127 off, in order to reuse the ARFCN dissection code */
1735     oct = tvb_get_guint8(tvb, curr_offset) & 0xbf;
1736
1737     /* FORMAT-ID, Format Identifier (part of octet 3)*/
1738     proto_tree_add_item(tree, hf_gsm_a_rr_format_id2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1739
1740     curr_offset += dissect_arfcn_list_core(tvb, tree, pinfo, offset, len, add_string, string_len, oct);
1741
1742     return(curr_offset - offset);
1743 }
1744
1745 static guint16
1746 de_rr_cell_ch_dsc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1747 {
1748     return dissect_arfcn_list(tvb, tree, pinfo, offset, 16, add_string, string_len);
1749 }
1750 /*
1751  * [3] 10.5.2.1c BA List Pref
1752  */
1753 static guint16
1754 de_rr_ba_list_pref(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1755 {
1756     guint bit_offset;
1757
1758     bit_offset = offset << 3;
1759     while (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_repeat_range_limit))
1760     {
1761         proto_tree_add_bits_item(tree, hf_gsm_a_rr_range_lower, tvb, bit_offset, 10, ENC_BIG_ENDIAN);
1762         bit_offset += 10;
1763         proto_tree_add_bits_item(tree, hf_gsm_a_rr_range_higher, tvb, bit_offset, 10, ENC_BIG_ENDIAN);
1764         bit_offset += 10;
1765     }
1766     while (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_repeat_ba_frequency))
1767     {
1768         proto_tree_add_bits_item(tree, hf_gsm_a_rr_ba_freq, tvb, bit_offset, 10, ENC_BIG_ENDIAN);
1769         bit_offset += 10;
1770     }
1771
1772     if (((bit_offset + 7) >> 3) > (offset + len))
1773     {
1774        expert_add_info(pinfo, proto_tree_get_parent(tree), &ei_gsm_a_rr_ie_overrun);
1775     }
1776     else if ((bit_offset >> 3) < (offset + len))
1777     {
1778        expert_add_info(pinfo, proto_tree_get_parent(tree), &ei_gsm_a_rr_ie_underrun);
1779     }
1780     return len;
1781 }
1782
1783 /*
1784  * [3] 10.5.2.1d UTRAN Frequency List
1785  */
1786 static guint16
1787 de_rr_utran_freq_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1788 {
1789     guint bit_offset;
1790
1791     /* < UTRAN Freq List >::=
1792      * < LENGTH OF UTRAN FREQ LIST : bit (8) > -- length following in octets
1793      * { 1 < FDD_ARFCN > : bit (14) } ** 0 -- FDD frequencies
1794      * { 1 < TDD_ARFCN > : bit (14) } ** 0 -- TDD frequencies
1795      * <spare bit>**;
1796      * Spare bits in the end of the field are used to fill the last octet.
1797      */
1798     bit_offset = offset << 3;
1799     while (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_fdd_repeat_freq))
1800     {
1801         proto_tree_add_bits_item(tree, hf_gsm_a_rr_fdd_uarfcn, tvb, bit_offset, 14, ENC_BIG_ENDIAN);
1802         bit_offset += 14;
1803     }
1804     while (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_tdd_repeat_freq))
1805     {
1806         proto_tree_add_bits_item(tree, hf_gsm_a_rr_tdd_uarfcn, tvb, bit_offset, 14, ENC_BIG_ENDIAN);
1807         bit_offset += 14;
1808     }
1809
1810     if (((bit_offset + 7) >> 3) > (offset + len))
1811     {
1812        expert_add_info(pinfo, proto_tree_get_parent(tree), &ei_gsm_a_rr_ie_overrun);
1813     }
1814     else if ((bit_offset >> 3) < (offset + len))
1815     {
1816        expert_add_info(pinfo, proto_tree_get_parent(tree), &ei_gsm_a_rr_ie_underrun);
1817     }
1818     return (len);
1819 }
1820
1821 /*
1822  * [3] 10.5.2.1e Cell selection indicator after release of all TCH and SDCCH
1823  */
1824 static const guint8
1825 convert_n_to_p[32] = {   0, 10, 19, 28, 36, 44, 52, 60, 67, 74, 81, 88, 95, 102, 109, 116,
1826                        122,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,   0,   0,   0};
1827
1828 static const guint8
1829 convert_n_to_q[32] = {   0,   9,  17,  25,  32, 39, 46, 53, 59, 65, 71, 77, 83, 89, 95, 101,
1830                        106, 111, 116, 121, 126,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,   0};
1831 static const true_false_string tfs_1900_1800 = { "1900", "1800" };
1832
1833 static guint16
1834 de_rr_cell_select_indic(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1835 {
1836     proto_tree *subtree, *subtree2;
1837     proto_item *item;
1838     guint32     curr_offset;
1839     gint        bit_offset, bit_offset_sav, idx, xdd_cell_info, wsize, nwi, jwi, w[64], i, iused, xdd_indic0;
1840     guint8      value;
1841
1842     curr_offset = offset;
1843     bit_offset  = curr_offset << 3;
1844     value = tvb_get_bits8(tvb,bit_offset,3);
1845     bit_offset += 3;
1846     switch (value)
1847     {
1848     case 0: /* GSM Description */
1849         bit_offset_sav = bit_offset;
1850         subtree = proto_tree_add_subtree(tree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_GSM_DESC], &item,
1851                                    gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_GSM_DESC].strptr);
1852         while (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_repeat_gsm_desc))
1853         {
1854             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_band_indicator, tvb, bit_offset++, 1, ENC_NA);
1855             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_arfcn, tvb, bit_offset, 10, ENC_BIG_ENDIAN);
1856             bit_offset += 10;
1857             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bsic, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
1858             bit_offset += 6;
1859         }
1860         proto_item_set_len(item,((bit_offset>>3) - (bit_offset_sav>>3) + 1));
1861         break;
1862     case 1: /* UTRAN FDD Description */
1863         bit_offset_sav = bit_offset;
1864         subtree = proto_tree_add_subtree(tree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_UTRAN_FDD_DESC], &item,
1865                                    gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_FDD_DESC].strptr);
1866         while (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_repeat_utran_fdd_desc))
1867         {
1868             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_bandwidth_fdd_present))
1869             {
1870                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bandwidth_fdd, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1871                 bit_offset += 3;
1872             }
1873             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_fdd_uarfcn, tvb, bit_offset, 14, ENC_BIG_ENDIAN);
1874             bit_offset += 14;
1875             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_fdd_cell_info_present))
1876             {
1877                 xdd_indic0 = gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_fdd_indic0);
1878                 idx = tvb_get_bits8(tvb,bit_offset,5);
1879                 proto_tree_add_uint(subtree, hf_gsm_a_rr_nr_of_fdd_cells, tvb, bit_offset>>3, 1, idx);
1880                 bit_offset += 5;
1881                 idx = convert_n_to_p[idx];
1882                 subtree2 = proto_tree_add_subtree(subtree,tvb, bit_offset>>3, (idx>>3)+1,
1883                                             ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_FDD_CELL_INFORMATION_FIELD], NULL,
1884                                             gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_FDD_DESC].strptr);
1885                 proto_tree_add_bytes_format(subtree2, hf_gsm_a_rr_field_bit_long, tvb, bit_offset>>3, (idx>>3)+1, NULL, "Field is %d bits long", idx);
1886                 if (xdd_indic0)
1887                 {
1888                     proto_tree_add_uint(subtree2, hf_gsm_a_rr_scrambling_code, tvb, bit_offset>>3, 0, 0);
1889                     proto_tree_add_uint(subtree2, hf_gsm_a_rr_diversity, tvb, bit_offset>>3, 0, 0);
1890                 }
1891                 if (idx)
1892                 {
1893                     wsize = 10;
1894                     nwi = 1;
1895                     jwi = 0;
1896                     i = 1;
1897
1898                     while (idx > 0)
1899                     {
1900                         w[i] = tvb_get_bits(tvb, bit_offset, wsize, ENC_BIG_ENDIAN);
1901                         bit_offset += wsize;
1902                         idx -= wsize;
1903                         if (w[i] == 0)
1904                         {
1905                             idx = 0;
1906                             break;
1907                         }
1908                         if (++jwi == nwi)
1909                         {
1910                             jwi = 0;
1911                             nwi <<= 1;
1912                             wsize--;
1913                         }
1914                         i++;
1915                     }
1916                     if (idx < 0)
1917                     {
1918                         bit_offset += idx;
1919                     }
1920                     iused = i-1;
1921
1922                     for (i=1; i <= iused; i++)
1923                     {
1924                         xdd_cell_info = f_k(i, w, 1024);
1925                         proto_tree_add_uint(subtree2, hf_gsm_a_rr_scrambling_code, tvb, bit_offset>>3, 0, xdd_cell_info & 0x01FF);
1926                         proto_tree_add_uint(subtree2, hf_gsm_a_rr_diversity, tvb, bit_offset>>3, 0, (xdd_cell_info >> 9) & 0x01);
1927                     }
1928                 }
1929             }
1930         }
1931         proto_item_set_len(item,((bit_offset>>3) - (bit_offset_sav>>3) + 1));
1932         break;
1933     case 2: /* UTRAN TDD Description */
1934         bit_offset_sav = bit_offset;
1935         subtree = proto_tree_add_subtree(tree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_UTRAN_TDD_DESC], &item,
1936                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_TDD_DESC].strptr);
1937
1938         while (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_repeat_utran_tdd_desc))
1939         {
1940             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_bandwidth_tdd_present))
1941             {
1942                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bandwidth_tdd, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
1943                 bit_offset += 3;
1944             }
1945             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tdd_uarfcn, tvb, bit_offset, 14, ENC_BIG_ENDIAN);
1946             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_tdd_cell_info_present))
1947             {
1948                 xdd_indic0 = gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_tdd_indic0);
1949                 idx = tvb_get_bits8(tvb,bit_offset,5);
1950                 proto_tree_add_uint(subtree, hf_gsm_a_rr_nr_of_tdd_cells, tvb, bit_offset>>3, 1, idx);
1951                 bit_offset += 5;
1952                 idx = convert_n_to_q[idx];
1953                 subtree2 = proto_tree_add_subtree(subtree,tvb, bit_offset>>3, (idx>>3)+1,
1954                                             ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_TDD_CELL_INFORMATION_FIELD], NULL,
1955                                             gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_TDD_DESC].strptr);
1956                 proto_tree_add_bytes_format(subtree2, hf_gsm_a_rr_field_bit_long, tvb, bit_offset>>3, (idx>>3)+1, NULL, "Field is %d bits long", idx);
1957                 if (xdd_indic0)
1958                 {
1959                     proto_tree_add_uint(subtree2, hf_gsm_a_rr_cell_parameter, tvb, bit_offset>>3, 0, 0);
1960                     proto_tree_add_uint(subtree2, hf_gsm_a_rr_sync_case_tstd, tvb, bit_offset>>3, 0, 0);
1961                     proto_tree_add_uint(subtree2, hf_gsm_a_rr_diversity_tdd, tvb, bit_offset>>3, 0, 0);
1962                 }
1963                 if (idx)
1964                 {
1965                     wsize = 9;
1966                     nwi = 1;
1967                     jwi = 0;
1968                     i = 1;
1969
1970                     while (idx > 0)
1971                     {
1972                         w[i] = tvb_get_bits(tvb, bit_offset, wsize, ENC_BIG_ENDIAN);
1973                         bit_offset += wsize;
1974                         idx -= wsize;
1975                         if (w[i]  ==  0)
1976                         {
1977                             idx = 0;
1978                             break;
1979                         }
1980                         if (++jwi == nwi)
1981                         {
1982                             jwi = 0;
1983                             nwi <<= 1;
1984                             wsize--;
1985                         }
1986                         i++;
1987                     }
1988                     if (idx < 0)
1989                     {
1990                         bit_offset += idx;
1991                     }
1992                     iused = i-1;
1993
1994                     for (i=1; i <= iused; i++)
1995                     {
1996                         xdd_cell_info = f_k(i, w, 512);
1997                         proto_tree_add_uint(subtree2, hf_gsm_a_rr_cell_parameter, tvb, bit_offset>>3, 0, xdd_cell_info & 0x07F);
1998                         proto_tree_add_uint(subtree2, hf_gsm_a_rr_sync_case_tstd, tvb, bit_offset>>3, 0, (xdd_cell_info >> 7) & 0x01);
1999                         proto_tree_add_uint(subtree2, hf_gsm_a_rr_diversity_tdd, tvb, bit_offset>>3, 0, (xdd_cell_info >> 8) & 0x01);
2000                     }
2001                 }
2002             }
2003         }
2004         proto_item_set_len(item,((bit_offset>>3) - (bit_offset_sav>>3) + 1));
2005         break;
2006       case 3: /* E-UTRAN Description */
2007
2008         bit_offset_sav = bit_offset;
2009         subtree = proto_tree_add_subtree(tree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EUTRAN_DESC], &item,
2010                                          gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EUTRAN_DESC].strptr);
2011
2012         while (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_repeat_eutran_desc))
2013         {
2014             /* EARFCN */
2015             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_earfcn, tvb, bit_offset, 16, ENC_BIG_ENDIAN);
2016             bit_offset += 16;
2017
2018             /* Measurement Bandwidth */
2019             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_eutran_measurement_bandwidth_present))
2020             {
2021                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_measurement_bandwidth, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2022                 bit_offset += 3;
2023             }
2024
2025             /* Repeated E-UTRAN Not Allowed Cells */
2026             while (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_repeated_eutran_not_allowed_cells))
2027             {
2028                 bit_offset += de_rr_eutran_not_allowed_cells(tvb, subtree, bit_offset);
2029             }
2030
2031             /* TARGET PCID */
2032             if (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_eutran_pcid_present))
2033             {
2034                 proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_pcid, tvb, bit_offset, 9, ENC_BIG_ENDIAN);
2035                 bit_offset += 9;
2036             }
2037         }
2038         proto_item_set_len(item,((bit_offset>>3) - (bit_offset_sav>>3) + 1));
2039         break;
2040
2041     default:
2042         break;
2043     }
2044
2045     curr_offset += len;
2046     return (curr_offset - offset);
2047 }
2048
2049 /*
2050  * [3] 10.5.2.2 Cell Description
2051  */
2052 guint16
2053 de_rr_cell_dsc(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2054 {
2055     guint32 curr_offset;
2056     guint16 bcch_arfcn;
2057
2058     curr_offset = offset;
2059
2060     proto_tree_add_item(subtree, hf_gsm_a_rr_ncc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2061     proto_tree_add_item(subtree, hf_gsm_a_rr_bcc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2062     bcch_arfcn = (tvb_get_guint8(tvb,curr_offset) & 0xc0) << 2;
2063     bcch_arfcn = bcch_arfcn | tvb_get_guint8(tvb,curr_offset+1);
2064     proto_tree_add_uint(subtree, hf_gsm_a_rr_bcch_arfcn , tvb, curr_offset, 2, bcch_arfcn );
2065
2066     curr_offset = curr_offset + 2;
2067
2068     return(curr_offset - offset);
2069 }
2070
2071 /*
2072  * [3] 10.5.2.3 Cell Options (BCCH)
2073  */
2074 static const value_string gsm_a_rr_dtx_bcch_vals[] = {
2075     { 0x00, "The MSs may use uplink discontinuous transmission" },
2076     { 0x01, "The MSs shall use uplink discontinuous transmission" },
2077     { 0x02, "The MSs shall not use uplink discontinuous transmission" },
2078     { 0x03, "Reserved" },
2079     {    0, NULL } };
2080
2081 static const value_string gsm_a_rr_radio_link_timeout_vals[] = {
2082     { 0x00, "4" },
2083     { 0x01, "8" },
2084     { 0x02, "12" },
2085     { 0x03, "16" },
2086     { 0x04, "20" },
2087     { 0x05, "24" },
2088     { 0x06, "28" },
2089     { 0x07, "32" },
2090     { 0x08, "36" },
2091     { 0x09, "40" },
2092     { 0x0A, "44" },
2093     { 0x0B, "48" },
2094     { 0x0C, "52" },
2095     { 0x0D, "56" },
2096     { 0x0E, "60" },
2097     { 0x0F, "64" },
2098     {    0, NULL } };
2099
2100 static guint16
2101 de_rr_cell_opt_bcch(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2102 {
2103     guint32 curr_offset;
2104
2105     curr_offset = offset;
2106
2107     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pwrc, tvb, (curr_offset<<3)+1, 1, ENC_BIG_ENDIAN);
2108     proto_tree_add_item(subtree, hf_gsm_a_rr_dtx_bcch, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2109     proto_tree_add_item(subtree, hf_gsm_a_rr_radio_link_timeout, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2110
2111     curr_offset = curr_offset + 1;
2112
2113     return(curr_offset - offset);
2114 }
2115
2116 /*
2117  * [3] 10.5.2.3a Cell Options (SACCH)
2118  */
2119 static const value_string gsm_a_rr_dtx_sacch_vals[] = {
2120     { 0x00, "The MS may use uplink discontinuous transmission on a TCH-F. The MS shall not use uplink discontinuous transmission on TCH-H" },
2121     { 0x01, "The MS shall use uplink discontinuous transmission on a TCH-F. The MS shall not use uplink discontinuous transmission on TCH-H" },
2122     { 0x02, "The MS shall not use uplink discontinuous transmission on a TCH-F. The MS shall not use uplink discontinuous transmission on TCH-H" },
2123     { 0x03, "The MS shall use uplink discontinuous transmission on a TCH-F. The MS may use uplink discontinuous transmission on TCH-H" },
2124     { 0x04, "The MS may use uplink discontinuous transmission on a TCH-F. The MS may use uplink discontinuous transmission on TCH-H" },
2125     { 0x05, "The MS shall use uplink discontinuous transmission on a TCH-F. The MS shall use uplink discontinuous transmission on TCH-H" },
2126     { 0x06, "The MS shall not use uplink discontinuous transmission on a TCH-F. The MS shall use uplink discontinuous transmission on TCH-H" },
2127     { 0x07, "The MS may use uplink discontinuous transmission on a TCH-F. The MS shall use uplink discontinuous transmission on TCH-H" },
2128     {    0, NULL } };
2129
2130 static const crumb_spec_t gsm_a_rr_dtx_sacch_crumbs[] = {
2131     { 0, 1}, /* B8 */
2132     { 2, 2}, /* B6 - B5 */
2133     { 0, 0}
2134 };
2135
2136 static guint16
2137 de_rr_cell_opt_sacch(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2138 {
2139     guint32 curr_offset;
2140
2141     curr_offset = offset;
2142
2143
2144     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pwrc, tvb, (curr_offset<<3)+1, 1, ENC_BIG_ENDIAN);
2145     /* DTX is a split field in bits 8, 6 and 5 */
2146     proto_tree_add_split_bits_item_ret_val(subtree, hf_gsm_a_rr_dtx_sacch, tvb, (curr_offset<<3), gsm_a_rr_dtx_sacch_crumbs, NULL);
2147     proto_tree_add_item(subtree, hf_gsm_a_rr_radio_link_timeout, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2148
2149     curr_offset = curr_offset + 1;
2150
2151     return(curr_offset - offset);
2152 }
2153
2154 /*
2155  * [3] 10.5.2.4 Cell Selection Parameters
2156  */
2157 static guint16
2158 de_rr_cell_sel_param(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2159 {
2160     guint32 curr_offset;
2161
2162     curr_offset = offset;
2163
2164     proto_tree_add_item(subtree, hf_gsm_a_rr_cell_reselect_hyst, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2165     proto_tree_add_item(subtree, hf_gsm_a_rr_ms_txpwr_max_cch, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2166
2167     curr_offset = curr_offset + 1;
2168
2169     proto_tree_add_item(subtree, hf_gsm_a_rr_acs, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2170     proto_tree_add_item(subtree, hf_gsm_a_rr_neci, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2171     proto_tree_add_item(subtree, hf_gsm_a_rr_rxlev_access_min, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2172
2173     curr_offset = curr_offset + 1;
2174
2175     return(curr_offset - offset);
2176 }
2177
2178 /*
2179  * [3] 10.5.2.4a MAC Mode and Channel Coding Requested
2180  * [3] 10.5.2.5 Channel Description
2181  */
2182 guint16
2183 de_rr_ch_dsc(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2184 {
2185     guint32      curr_offset;
2186     guint8       oct8,subchannel;
2187     guint16      arfcn, hsn, maio;
2188     int hf_subchannel;
2189
2190     curr_offset = offset;
2191
2192     /* Octet 2 */
2193     oct8 = tvb_get_guint8(tvb, curr_offset);
2194
2195     if ((oct8 & 0xf8) == 0x08)
2196     {
2197         proto_tree_add_item(subtree, hf_gsm_a_rr_tchf_acchs, tvb, curr_offset, 1, ENC_NA);
2198     }
2199     else
2200     {
2201         if ((oct8 & 0xf0) == 0x10)
2202         {
2203             hf_subchannel = hf_gsm_a_rr_tch_acch;
2204             subchannel = ((oct8 & 0x08)>>3);
2205         }
2206         else if ((oct8 & 0xe0) == 0x20)
2207         {
2208             hf_subchannel = hf_gsm_a_rr_sdcch4_sdcchc4_cbch;
2209             subchannel = ((oct8 & 0x18)>>3);
2210         }
2211         else if ((oct8 & 0xc0) == 0x40)
2212         {
2213             hf_subchannel = hf_gsm_a_rr_sdcch8_sdcchc8_cbch;
2214             subchannel = ((oct8 & 0x38)>>3);
2215         } else {
2216             hf_subchannel = hf_gsm_a_rr_unknown_channel_info;
2217             subchannel = oct8;
2218         }
2219
2220         proto_tree_add_item(subtree, hf_subchannel, tvb, curr_offset, 1, ENC_NA);
2221         proto_tree_add_uint(subtree, hf_gsm_a_rr_subchannel, tvb, curr_offset, 1, subchannel);
2222     }
2223
2224     proto_tree_add_item(subtree, hf_gsm_a_rr_timeslot, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2225
2226     curr_offset +=1;
2227
2228     /* Octet 3 */
2229     oct8 = tvb_get_guint8(tvb, curr_offset);
2230     proto_tree_add_item(subtree, hf_gsm_a_rr_training_sequence, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2231
2232     proto_tree_add_item(subtree, hf_gsm_a_rr_hopping_channel, tvb, curr_offset, 1, ENC_NA);
2233     if ((oct8 & 0x10) == 0x10)
2234     {
2235         /* Hopping sequence */
2236         maio = ((oct8 & 0x0f)<<2) | ((tvb_get_guint8(tvb,curr_offset+1) & 0xc0) >> 6);
2237         hsn = (tvb_get_guint8(tvb,curr_offset+1) & 0x3f);
2238
2239         proto_tree_add_uint(subtree, hf_gsm_a_rr_hopping_channel_maio, tvb, curr_offset, 2, maio);
2240         proto_tree_add_uint(subtree, hf_gsm_a_rr_hsn, tvb, curr_offset, 2, hsn);
2241     }
2242     else
2243     {
2244         /* single ARFCN */
2245         arfcn = ((oct8 & 0x03) << 8) | tvb_get_guint8(tvb,curr_offset+1);
2246
2247         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_spare, tvb, (curr_offset<<3)+2, 2, ENC_NA);
2248         proto_tree_add_uint(subtree, hf_gsm_a_rr_single_channel_arfcn, tvb, curr_offset, 2, arfcn);
2249     }
2250
2251     curr_offset = curr_offset + 2;
2252
2253     return(curr_offset - offset);
2254 }
2255 /*
2256  * [3] 10.5.2.5a Channel Description 2
2257  */
2258 static guint16
2259 de_rr_ch_dsc2(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2260 {
2261     guint32      curr_offset;
2262     guint8       oct8,subchannel;
2263     guint16      arfcn, hsn, maio;
2264     int hf_subchannel;
2265
2266     curr_offset = offset;
2267
2268     /* Octet 2 */
2269     oct8 = tvb_get_guint8(tvb, curr_offset);
2270
2271     if ((oct8 & 0xf8) == 0x0)
2272     {
2273         proto_tree_add_item(subtree, hf_gsm_a_rr_tch_facch_sacchm, tvb, curr_offset, 1, ENC_NA);
2274     }
2275     else if ((oct8 & 0xf8) == 0x08)
2276     {
2277         proto_tree_add_item(subtree, hf_gsm_a_rr_tch_facch_sacchf, tvb, curr_offset, 1, ENC_NA);
2278     }
2279     else if ((oct8 & 0xf8) == 0xf0)
2280     {
2281         proto_tree_add_item(subtree, hf_gsm_a_rr_tch_facch_sacchm_bi, tvb, curr_offset, 1, ENC_NA);
2282     }
2283     else
2284     {
2285         if ((oct8 & 0xf0) == 0x10)
2286         {
2287             hf_subchannel = hf_gsm_a_rr_tch_acch;
2288             subchannel = ((oct8 & 0x08)>>3);
2289         }
2290         else if ((oct8 & 0xe0) == 0x20)
2291         {
2292             hf_subchannel = hf_gsm_a_rr_sdcch4_sdcchc4_cbch;
2293             subchannel = ((oct8 & 0x18)>>3);
2294         }
2295         else if ((oct8 & 0xc0) == 0x40)
2296         {
2297             hf_subchannel = hf_gsm_a_rr_sdcch8_sdcchc8_cbch;
2298             subchannel = ((oct8 % 0x38)>>3);
2299         }
2300         else if ((oct8 & 0xc0) == 0x80)
2301         {
2302             hf_subchannel = hf_gsm_a_rr_tch_facchf_sacchm_bi;
2303             subchannel = ((oct8 % 0x38)>>3);
2304         }
2305         else if ((oct8 & 0xe0) == 0xc0)
2306         {
2307             hf_subchannel = hf_gsm_a_rr_tch_facchf_sacchm_uni;
2308             subchannel = ((oct8 % 0x38)>>3);
2309         } else {
2310             hf_subchannel = hf_gsm_a_rr_unknown_channel_info;
2311             subchannel = oct8;
2312         }
2313         proto_tree_add_item(subtree, hf_subchannel, tvb, curr_offset, 1, ENC_NA);
2314         proto_tree_add_uint(subtree, hf_gsm_a_rr_subchannel, tvb, curr_offset, 1, subchannel);
2315     }
2316
2317     proto_tree_add_item(subtree, hf_gsm_a_rr_timeslot, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2318
2319     curr_offset +=1;
2320
2321     /* Octet 3 */
2322     oct8 = tvb_get_guint8(tvb, curr_offset);
2323     proto_tree_add_item(subtree, hf_gsm_a_rr_training_sequence, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2324
2325     proto_tree_add_item(subtree, hf_gsm_a_rr_hopping_channel, tvb, curr_offset, 1, ENC_NA);
2326     if ((oct8 & 0x10) == 0x10)
2327     {
2328         /* Hopping sequence */
2329         maio = ((oct8 & 0x0f)<<2) | ((tvb_get_guint8(tvb,curr_offset+1) & 0xc0) >> 6);
2330         hsn = (tvb_get_guint8(tvb,curr_offset+1) & 0x3f);
2331
2332         proto_tree_add_uint(subtree, hf_gsm_a_rr_hopping_channel_maio, tvb, curr_offset, 2, maio);
2333         proto_tree_add_uint(subtree, hf_gsm_a_rr_hsn, tvb, curr_offset, 2, hsn);
2334     }
2335     else
2336     {
2337         /* single ARFCN */
2338         arfcn = ((oct8 & 0x03) << 8) | tvb_get_guint8(tvb,curr_offset+1);
2339
2340         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_spare, tvb, (curr_offset<<3)+2, 2, ENC_NA);
2341         proto_tree_add_uint(subtree, hf_gsm_a_rr_single_channel_arfcn, tvb, curr_offset, 2, arfcn);
2342     }
2343
2344     curr_offset = curr_offset + 2;
2345
2346     return(curr_offset - offset);
2347 }
2348
2349 /*
2350  * [3] 10.5.2.5c Channel Description 3
2351  */
2352 static guint16
2353 de_rr_ch_dsc3(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2354 {
2355     guint32      curr_offset;
2356     guint8       oct8;
2357     guint16      arfcn, hsn, maio;
2358
2359     curr_offset = offset;
2360
2361     /* Octet 2 */
2362     oct8 = tvb_get_guint8(tvb, curr_offset);
2363     proto_tree_add_item(subtree, hf_gsm_a_rr_training_sequence, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2364
2365     proto_tree_add_item(subtree, hf_gsm_a_rr_hopping_channel, tvb, curr_offset, 1, ENC_NA);
2366     if ((oct8 & 0x10) == 0x10)
2367     {
2368         /* Hopping sequence */
2369         maio = ((oct8 & 0x0f)<<2) | ((tvb_get_guint8(tvb,curr_offset+1) & 0xc0) >> 6);
2370         hsn = (tvb_get_guint8(tvb,curr_offset+1) & 0x3f);
2371
2372         proto_tree_add_uint(subtree, hf_gsm_a_rr_hopping_channel_maio, tvb, curr_offset, 2, maio);
2373         proto_tree_add_uint(subtree, hf_gsm_a_rr_hsn, tvb, curr_offset, 2, hsn);
2374     }
2375     else
2376     {
2377         /* single ARFCN */
2378         arfcn = ((oct8 & 0x03) << 8) | tvb_get_guint8(tvb,curr_offset+1);
2379
2380         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_spare, tvb, (curr_offset<<3)+2, 2, ENC_NA);
2381         proto_tree_add_uint(subtree, hf_gsm_a_rr_single_channel_arfcn, tvb, curr_offset, 2, arfcn);
2382     }
2383
2384     curr_offset = curr_offset + 2;
2385
2386     return(curr_offset - offset);
2387 }
2388
2389 /*
2390  * [3] 10.5.2.6 Channel Mode
2391  */
2392 /* Channel Mode  */
2393 static const value_string gsm_a_rr_channel_mode_vals[] = {
2394     { 0x00, "signalling only"},
2395     { 0x01, "speech full rate or half rate version 1(GSM FR or GSM HR)"},
2396     { 0x21, "speech full rate or half rate version 2(GSM EFR)"},
2397     { 0x41, "speech full rate or half rate version 3(FR AMR or HR AMR)"},
2398     { 0x81, "speech full rate or half rate version 4(OFR AMR-WB or OHR AMR-WB)"},
2399     { 0x82, "speech full rate or half rate version 5(FR AMR-WB )"},
2400     { 0x83, "speech full rate or half rate version 6(OHR AMR )"},
2401     { 0x61, "data, 43.5 kbit/s (downlink)+14.5 kbps (uplink)"},
2402     { 0x62, "data, 29.0 kbit/s (downlink)+14.5 kbps (uplink)"},
2403     { 0x64, "data, 43.5 kbit/s (downlink)+29.0 kbps (uplink)"},
2404     { 0x67, "data, 14.5 kbit/s (downlink)+43.5 kbps (uplink)"},
2405     { 0x65, "data, 14.5 kbit/s (downlink)+29.0 kbps (uplink)"},
2406     { 0x66, "data, 29.0 kbit/s (downlink)+43.5 kbps (uplink)"},
2407     { 0x27, "data, 43.5 kbit/s radio interface rate"},
2408     { 0x63, "data, 32.0 kbit/s radio interface rate"},
2409     { 0x43, "data, 29.0 kbit/s radio interface rate"},
2410     { 0x0f, "data, 14.5 kbit/s radio interface rate"},
2411     { 0x03, "data, 12.0 kbit/s radio interface rate"},
2412     { 0x0b, "data, 6.0 kbit/s radio interface rate"},
2413     { 0x13, "data, 3.6 kbit/s radio interface rate"},
2414     {    0, NULL }
2415 };
2416
2417 guint16
2418 de_rr_ch_mode(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2419 {
2420     guint32 curr_offset;
2421
2422     curr_offset = offset;
2423
2424     proto_tree_add_item(tree, hf_gsm_a_rr_channel_mode, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2425
2426     curr_offset = curr_offset + 1;
2427
2428     return(curr_offset - offset);
2429 }
2430 /*
2431  * [3] 10.5.2.7 Channel Mode 2
2432  */
2433
2434 static const value_string gsm_a_rr_channel_mode2_vals[] = {
2435     { 0x00, "signalling only"},
2436     { 0x05, "speech half rate version 1(GSM HR)"},
2437     { 0x25, "speech half rate version 2(GSM EFR)"},
2438     { 0x45, "speech half rate version 3(HR AMR)"},
2439     { 0x85, "speech half rate version 4(OHR AMR-WB)"},
2440     { 0x06, "speech half rate version 6(OHR AMR )"},
2441     { 0x0f, "data, 6.0 kbit/s radio interface rate"},
2442     { 0x17, "data, 3.6 kbit/s radio interface rate"},
2443     {    0, NULL }
2444 };
2445
2446 static guint16
2447 de_rr_ch_mode2(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2448 {
2449     guint32 curr_offset;
2450
2451     curr_offset = offset;
2452
2453     proto_tree_add_item(tree, hf_gsm_a_rr_channel_mode2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2454
2455     curr_offset = curr_offset + 1;
2456
2457     return(curr_offset - offset);
2458 }
2459 /*
2460  * [3] 10.5.2.7a UTRAN Classmark information element
2461  */
2462 static guint16
2463 de_rr_utran_cm(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2464 {
2465     guint32   curr_offset;
2466     tvbuff_t *rrc_irat_ho_info_tvb;
2467
2468     curr_offset = offset;
2469     if (len)
2470     {
2471         rrc_irat_ho_info_tvb = tvb_new_subset_length(tvb, curr_offset, len);
2472         if (rrc_irat_ho_info_handle)
2473             call_dissector(rrc_irat_ho_info_handle, rrc_irat_ho_info_tvb, pinfo, tree);
2474     }
2475
2476     curr_offset += len;
2477     return(curr_offset - offset);
2478 }
2479
2480 /*
2481  * [3] 10.5.2.7b (void)
2482  */
2483
2484 /*
2485  * [3] 10.5.2.7c Classmark Enquiry Mask
2486  * Bit 8:
2487  * 0    CLASSMARK CHANGE message is requested
2488  * 1    CLASSMARK CHANGE message is not requested
2489  * Bits 7-5 . 5
2490  * 000  UTRAN CLASSMARK CHANGE message including status on predefined configurations (i.e. Sequence Description) is requested
2491  * 111  UTRAN CLASSMARK CHANGE message including status on predefined configurations (i.e. Sequence Description) is not requested.
2492  * All other values shall not be sent. If received, they shall be interpreted as '000'.
2493  * Bit 4:
2494  * 0    CDMA2000 CLASSMARK CHANGE message requested
2495  * 1    CDMA2000 CLASSMARK CHANGE message not requested.
2496  * Bit 3:
2497  * 0    GERAN IU MODE CLASSMARK CHANGE message requested
2498  * 1    GERAN IU MODE CLASSMARK CHANGE message not requested.
2499  * Bits 2 - 1: spare(0).
2500  */
2501 static const true_false_string gsm_a_msg_req_value  = {
2502     "message is not requested",
2503     "message is requested"
2504 };
2505
2506 static const value_string gsm_a_rr_utran_cm_cng_msg_req_vals[] = {
2507     { 0x0, "message including status on predefined configurations (i.e. Sequence Description) is requested"},
2508     { 0x1, "message including status on predefined configurations (i.e. Sequence Description) is requested"},
2509     { 0x2, "message including status on predefined configurations (i.e. Sequence Description) is requested"},
2510     { 0x3, "message including status on predefined configurations (i.e. Sequence Description) is requested"},
2511     { 0x4, "message including status on predefined configurations (i.e. Sequence Description) is requested"},
2512     { 0x5, "message including status on predefined configurations (i.e. Sequence Description) is requested"},
2513     { 0x6, "message including status on predefined configurations (i.e. Sequence Description) is requested"},
2514     { 0x7, "message including status on predefined configurations (i.e. Sequence Description) is not requested."},
2515     {   0, NULL }
2516 };
2517 guint16
2518 de_rr_cm_enq_mask(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2519 {
2520     guint32 curr_offset;
2521
2522     curr_offset = offset;
2523
2524     proto_tree_add_item(tree, hf_gsm_a_rr_cm_cng_msg_req, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2525     proto_tree_add_item(tree, hf_gsm_a_rr_utran_cm_cng_msg_req, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2526     proto_tree_add_item(tree, hf_gsm_a_rr_cdma200_cm_cng_msg_req, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2527     proto_tree_add_item(tree, hf_gsm_a_rr_geran_iu_cm_cng_msg_req, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2528
2529     curr_offset = curr_offset + 1;
2530
2531     return(curr_offset - offset);
2532 }
2533 /*
2534  * [3] 10.5.2.8 Channel Needed
2535  */
2536 static const value_string gsm_a_rr_channel_needed_vals[] = {
2537     { 0x00, "Any channel"},
2538     { 0x01, "SDCCH"},
2539     { 0x02, "TCH/F (Full rate)"},
2540     { 0x03, "TCH/H or TCH/F (Dual rate)"},
2541     {    0, NULL }
2542 };
2543 guint16
2544 de_rr_chnl_needed(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2545 {
2546     guint32 curr_offset;
2547     gint    bit_offset;
2548
2549     curr_offset = offset;
2550     if (RIGHT_NIBBLE == len)
2551         bit_offset = 4;
2552     else
2553         bit_offset = 0;
2554
2555     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_chnl_needed_ch1, tvb, (curr_offset<<3)+bit_offset+2, 2, ENC_BIG_ENDIAN);
2556     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_chnl_needed_ch2, tvb, (curr_offset<<3)+bit_offset, 2, ENC_BIG_ENDIAN);
2557
2558     curr_offset = curr_offset + 1;
2559
2560     return(curr_offset - offset);
2561 }
2562 /*
2563  * [3] 10.5.2.8a Channel Request Description
2564  */
2565
2566  /*
2567  * [3] 10.5.2.8b Channel Request Description 2
2568  */
2569 static const value_string gsm_a_rr_pkt_estab_cause_vals[] = {
2570     { 0x00, "User Data"},
2571     { 0x01, "Page Response"},
2572     { 0x02, "Cell Update"},
2573     { 0x03, "Mobility Management procedure"},
2574     {    0, NULL }
2575 };
2576 static const value_string gsm_a_rr_radio_priority_vals[] = {
2577     { 0x00, "1"},
2578     { 0x01, "2"},
2579     { 0x02, "3"},
2580     { 0x03, "4"},
2581     {    0, NULL }
2582 };
2583 static const true_false_string gsm_a_rr_llc_pdu_type_value = {
2584     "LLC PDU is not SACK or ACK",
2585     "LLC PDU is SACK or ACK"
2586 };
2587 static const true_false_string gsm_a_rr_reduced_latency_cap_value = {
2588     "The mobile station supports Reduced TTI configurations and Fast Ack/Nack Reporting",
2589     "The mobile station does not support Reduced TTI configurations and Fast Ack/Nack Reporting"
2590 };
2591 static const value_string gsm_a_rr_egprs2_vals[] = {
2592     { 0x00, "The mobile station does not support either EGPRS2-A or EGPRS2-B"},
2593     { 0x01, "The mobile station supports EGPRS2-A"},
2594     { 0x02, "The mobile station supports both EGPRS2-A and EGPRS2-B"},
2595     {    0, NULL }
2596 };
2597 static guint16
2598 de_rr_chnl_req_desc2(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2599 {
2600     guint32 bit_offset = offset << 3;
2601
2602     proto_tree_add_bits_item(tree, hf_gsm_a_rr_pkt_estab_cause, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2603     bit_offset += 2;
2604     proto_tree_add_bits_item(tree, hf_gsm_a_rr_peak_throughput_class, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2605     bit_offset += 4;
2606     proto_tree_add_bits_item(tree, hf_gsm_a_rr_radio_priority, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2607     bit_offset += 2;
2608     proto_tree_add_bits_item(tree, hf_gsm_a_rr_rlc_mode, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2609     bit_offset += 1;
2610     proto_tree_add_bits_item(tree, hf_gsm_a_rr_llc_pdu_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2611     bit_offset += 1;
2612     proto_tree_add_bits_item(tree, hf_gsm_a_rr_rlc_octet_count, tvb, bit_offset, 16, ENC_BIG_ENDIAN);
2613     bit_offset += 16;
2614     if (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_pfi_present)) {
2615         proto_tree_add_bits_item(tree, hf_gsm_a_rr_pfi, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
2616         bit_offset += 7;
2617     }
2618     gsm_rr_csn_HL_flag(tvb, tree, 0, bit_offset++, hf_gsm_a_rr_multiple_tbf_procedures);
2619     bit_offset += 1;
2620     if (gsm_rr_csn_HL_flag(tvb, tree, (offset+len)<<3, bit_offset++, hf_gsm_a_rr_additions_in_rel_7)) {
2621         proto_tree_add_bits_item(tree, hf_gsm_a_rr_rlc_non_pers_mode_cap, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2622         bit_offset += 1;
2623         proto_tree_add_bits_item(tree, hf_gsm_a_rr_reduced_latency_cap, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2624         bit_offset += 1;
2625         proto_tree_add_bits_item(tree, hf_gsm_a_rr_ul_egprs2, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2626         bit_offset += 2;
2627         proto_tree_add_bits_item(tree, hf_gsm_a_rr_dl_egprs2, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2628         bit_offset += 2;
2629         if (gsm_rr_csn_HL_flag(tvb, tree, (offset+len)<<3, bit_offset++, hf_gsm_a_rr_additions_in_rel_9)) {
2630             proto_tree_add_bits_item(tree, hf_gsm_a_rr_emst_ms_cap, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2631             /*bit_offset += 1;*/
2632         }
2633     }
2634
2635     return len;
2636 }
2637
2638 /*
2639  * [3] 10.5.2.9 Cipher Mode Setting
2640  */
2641 /* SC (octet 1) */
2642 static const value_string gsm_a_rr_sc_vals[] = {
2643     { 0, "No ciphering"},
2644     { 1, "Start ciphering"},
2645     { 0, NULL }
2646 };
2647 /* algorithm identifier
2648  * If SC=1 then:
2649  * bits
2650  * 4 3 2
2651  */
2652 guint16
2653 de_rr_cip_mode_set(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2654 {
2655     guint32 curr_offset;
2656     gint    bit_offset;
2657     guint64 value;
2658
2659     curr_offset = offset;
2660
2661     /* Cipher Mode Setting
2662      * Note: The coding of fields SC and algorithm identifier is defined in [44.018]
2663      * as part of the Cipher Mode Setting IE.
2664      */
2665     if (RIGHT_NIBBLE == len)
2666         bit_offset = 4;
2667     else
2668         bit_offset = 0;
2669
2670     proto_tree_add_bits_ret_val(tree, hf_gsm_a_rr_sc, tvb, (curr_offset<<3)+bit_offset+3, 1, &value, ENC_BIG_ENDIAN);
2671     if (value == 1){ /* Start ciphering */
2672         /* algorithm identifier */
2673         proto_tree_add_bits_item(tree, hf_gsm_a_rr_algorithm_id, tvb, (curr_offset<<3)+bit_offset, 3, ENC_BIG_ENDIAN);
2674     }
2675     curr_offset = curr_offset + 1;
2676
2677     return(curr_offset - offset);
2678 }
2679 /*
2680  * [3] 10.5.2.10 Cipher Response
2681  */
2682 /* CR (octet 1) */
2683 static const value_string gsm_a_rr_cr_vals[] = {
2684     { 0, "IMEISV shall not be included"},
2685     { 1, "IMEISV shall be included"},
2686     { 0, NULL }
2687 };
2688
2689 static guint16
2690 de_rr_cip_mode_resp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2691 {
2692     guint32 curr_offset;
2693     gint    bit_offset;
2694
2695     curr_offset = offset;
2696     if (RIGHT_NIBBLE == len)
2697         bit_offset = 4;
2698     else
2699         bit_offset = 0;
2700
2701     /* Cipher Mode Response
2702      * Note: The coding of field CR is defined in [44.018]
2703      * as part of the Cipher Mode Response IE.
2704      */
2705     proto_tree_add_bits_item(tree, hf_gsm_a_rr_cr, tvb, (curr_offset<<3)+bit_offset+3, 1, ENC_BIG_ENDIAN);
2706     curr_offset = curr_offset + 1;
2707
2708     return(curr_offset - offset);
2709 }
2710 /* [3] 10.5.2.11 Control Channel Description */
2711
2712 static const value_string gsm_a_rr_mscr_vals[] = {
2713     { 0, "MSC is Release '98 or older"},
2714     { 1, "MSC is Release '99 onwards"},
2715     { 0, NULL }
2716 };
2717
2718 static const value_string gsm_a_rr_att_vals[] = {
2719     { 0, "MSs in the cell are not allowed to apply IMSI attach and detach procedure"},
2720     { 1, "MSs in the cell shall apply IMSI attach and detach procedure"},
2721     { 0, NULL }
2722 };
2723
2724 static const value_string gsm_a_rr_ccch_conf_vals[] = {
2725     { 0, "1 basic physical channel used for CCCH, not combined with SDCCHs"},
2726     { 1, "1 basic physical channel used for CCCH, combined with SDCCHs"},
2727     { 2, "2 basic physical channels used for CCCH, not combined with SDCCHs"},
2728     { 3, "Reserved"},
2729     { 4, "3 basic physical channels used for CCCH, not combined with SDCCHs"},
2730     { 5, "Reserved"},
2731     { 6, "4 basic physical channels used for CCCH, not combined with SDCCHs"},
2732     { 7, "Reserved"},
2733     { 0, NULL }
2734 };
2735
2736 static const value_string gsm_a_rr_cbq3_vals[] = {
2737     { 0, "Iu mode not supported"},
2738     { 1, "Iu mode capable MSs barred"},
2739     { 2, "Iu mode supported, cell not barred"},
2740     { 3, "Iu mode supported, cell not barred"},
2741     { 0, NULL }
2742 };
2743
2744 static guint16
2745 de_rr_ctrl_ch_desc(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2746 {
2747     guint8  oct;
2748     guint32 curr_offset;
2749
2750     curr_offset = offset;
2751
2752     proto_tree_add_item(subtree, hf_gsm_a_rr_mscr, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2753     proto_tree_add_item(subtree, hf_gsm_a_rr_att, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2754     proto_tree_add_item(subtree, hf_gsm_a_rr_bs_ag_blks_res, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2755     proto_tree_add_item(subtree, hf_gsm_a_rr_ccch_conf, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2756
2757     curr_offset = curr_offset + 1;
2758     oct = tvb_get_guint8(tvb, curr_offset);
2759
2760     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_cbq3, tvb, (curr_offset<<3)+1, 2, ENC_BIG_ENDIAN);
2761     proto_tree_add_uint(subtree, hf_gsm_a_rr_bs_pa_mfrms, tvb, curr_offset, 1, (oct&0x07)+2);
2762
2763     curr_offset = curr_offset + 1;
2764
2765     proto_tree_add_item(subtree, hf_gsm_a_rr_t3212, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2766
2767     curr_offset = curr_offset + 1;
2768
2769     return(curr_offset - offset);
2770 }
2771
2772 /* [3] 10.5.2.11a  DTM Information Details
2773  */
2774 static const true_false_string tfs_supported_not_supported_by_cell = { "Supported by cell", "Not supported by cell" };
2775
2776 static guint16
2777 de_rr_dtm_info_details(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2778 {
2779     guint32 bit_offset = offset << 3;
2780
2781     proto_tree_add_bits_item(tree, hf_gsm_a_rr_max_lapdm, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2782     bit_offset += 3;
2783     proto_tree_add_bits_item(tree, hf_gsm_a_rr_gprs_ms_txpwr_max_ccch, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2784     bit_offset += 5;
2785     proto_tree_add_bits_item(tree, hf_gsm_a_rr_cell_id, tvb, bit_offset, 16, ENC_BIG_ENDIAN);
2786     bit_offset += 16;
2787     if (gsm_rr_csn_HL_flag(tvb, tree, (offset+len)<<3, bit_offset++, hf_gsm_a_rr_additions_in_rel_6)) {
2788         if (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_msms_procedures)) {
2789             proto_tree_add_bits_item(tree, hf_gsm_a_rr_dedicated_mode_mbms_notification_support, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2790             bit_offset += 1;
2791             proto_tree_add_bits_item(tree, hf_gsm_a_rr_mnci_support, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2792             /*bit_offset += 1;*/
2793         }
2794     }
2795
2796     return len;
2797 }
2798
2799 /*
2800  * [3] 10.5.2.11b  Dynamic ARFCN Mapping
2801  */
2802 static const value_string gsm_a_rr_gsm_band_vals[] = {
2803     {  0, "GSM 750"},
2804     {  1, "DCS 1800"},
2805     {  2, "PCS 1900"},
2806     {  3, "GSM T 380"},
2807     {  4, "GSM T 410"},
2808     {  5, "GSM T 900"},
2809     {  6, "GSM 710"},
2810     {  7, "GSM T 810"},
2811     {  8, "Reserved"},
2812     {  9, "Reserved"},
2813     { 10, "Reserved"},
2814     { 11, "Reserved"},
2815     { 12, "Reserved"},
2816     { 13, "Reserved"},
2817     { 14, "Reserved"},
2818     { 15, "Reserved"},
2819     {  0, NULL }
2820 };
2821
2822
2823 static guint16
2824 de_rr_dyn_arfcn_map(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2825 {
2826     guint bit_offset;
2827
2828     bit_offset = offset << 3;
2829
2830     while (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_repeat_dynamic_arfcn_mapping))
2831     {
2832         proto_tree_add_bits_item(tree, hf_gsm_a_rr_gsm_band, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2833         bit_offset += 4;
2834         proto_tree_add_bits_item(tree, hf_gsm_a_rr_arfcn_first, tvb, bit_offset, 10, ENC_BIG_ENDIAN);
2835         bit_offset += 10;
2836         proto_tree_add_bits_item(tree, hf_gsm_a_rr_band_offset, tvb, bit_offset, 10, ENC_BIG_ENDIAN);
2837         bit_offset += 10;
2838         proto_tree_add_bits_item(tree, hf_gsm_a_rr_arfcn_range, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
2839         bit_offset += 7;
2840     }
2841
2842     if (((bit_offset + 7) >> 3) > (offset + len))
2843     {
2844        expert_add_info(pinfo, proto_tree_get_parent(tree), &ei_gsm_a_rr_ie_overrun);
2845     }
2846     else if ((bit_offset >> 3) < (offset + len))
2847     {
2848        expert_add_info(pinfo, proto_tree_get_parent(tree), &ei_gsm_a_rr_ie_underrun);
2849     }
2850     return(len);
2851 }
2852 /*
2853  * [3] 10.5.2.12 Frequency Channel Sequence
2854  */
2855 static guint16
2856 de_rr_freq_ch_seq(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2857 {
2858     guint32 curr_offset;
2859     gint    bit_offset, i;
2860
2861     curr_offset = offset;
2862
2863     proto_tree_add_item(tree, hf_gsm_a_rr_lowest_arfcn, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2864     curr_offset += 1;
2865     bit_offset = curr_offset << 3;
2866     for (i=0; i<16; i++)
2867     {
2868         proto_tree_add_bits_item(tree, hf_gsm_a_rr_inc_skip_arfcn, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2869         bit_offset += 4;
2870     }
2871
2872     curr_offset = curr_offset + 8;
2873
2874     return(curr_offset - offset);
2875 }
2876
2877 /*
2878  * [3] 10.5.2.13 Frequency List
2879  */
2880 /*
2881  * [3] 10.5.2.13 Frequency List
2882  *
2883  * Bit Bit Bit Bit Bit format notation
2884  * 8 7  4 3 2
2885  * 0 0  X X X bit map 0
2886  * 1 0  0 X X 1024 range
2887  * 1 0  1 0 0 512 range
2888  * 1 0  1 0 1 256 range
2889  * 1 0  1 1 0 128 range
2890  * 1 0  1 1 1 variable bit map
2891  */
2892 /* The mask 0xce (1100 1110) will produce the result 0110 0111*/
2893 static const value_string gsm_a_rr_freq_list_format_id_vals[] = {
2894     { 0x00, "bit map 0"},
2895     { 0x02, "bit map 0"},
2896     { 0x04, "bit map 0"},
2897     { 0x06, "bit map 0"},
2898     { 0x08, "bit map 0"},
2899     { 0x0a, "bit map 0"},
2900     { 0x0c, "bit map 0"},
2901     { 0x0e, "bit map 0"},
2902     { 0x40, "1024 range"},
2903     { 0x41, "1024 range"},
2904     { 0x42, "1024 range"},
2905     { 0x43, "1024 range"},
2906     { 0x44, "512 range"},
2907     { 0x45, "256 range"},
2908     { 0x46, "128 range"},
2909     { 0x47, "variable bit map"},
2910     { 0x00, NULL }
2911 };
2912
2913 static guint16
2914 de_rr_freq_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2915 {
2916     return dissect_arfcn_list(tvb, tree, pinfo, offset, len, add_string, string_len);
2917 }
2918 /*
2919  * [3] 10.5.2.14 Frequency Short List
2920  *
2921  *The Frequency Short List information element is a type 3 information element of 10 octet length.
2922  *
2923  * This element is encoded exactly as the Frequency List information element,
2924  * except that it has a fixed length instead of a variable length and does
2925  * not contain a length indicator and that it shall not be encoded in bitmap 0 format.
2926  */
2927
2928  static guint16
2929 de_rr_freq_short_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2930  {
2931      return dissect_arfcn_list(tvb, tree, pinfo, offset, 9, add_string, string_len);
2932  }
2933
2934 /*
2935  * [3] 10.5.2.14a Frequency Short List 2
2936  *
2937  * The Frequency Short List information element is a type 3 information element of 8 octet length.
2938  *
2939  * This element is encoded exactly as the Frequency List information element,
2940  * except that it has a fixed length instead of a variable length and does
2941  * not contain a length indicator and that it shall not be encoded in bitmap 0 format.
2942  */
2943 static guint16
2944 de_rr_freq_short_list2(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2945 {
2946     return dissect_arfcn_list(tvb, tree, pinfo, offset, 8, add_string, string_len);
2947 }
2948 /*
2949  * [3] 10.5.2.14b Group Channel Description
2950  */
2951
2952 /*
2953  * [3] 10.5.2.14c GPRS Resumption
2954  */
2955 static const true_false_string gsm_a_rr_gprs_resumption_ack_value  = {
2956     "Resumption of GPRS services successfully acknowledged",
2957     "Resumption of GPRS services not successfully acknowledged"
2958 };
2959
2960 static guint16
2961 de_rr_gprs_resumption(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2962 {
2963     guint32 curr_offset;
2964
2965     curr_offset = offset;
2966
2967     proto_tree_add_item(tree, hf_gsm_a_rr_gprs_resumption_ack, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2968     curr_offset += 1;
2969
2970     return (curr_offset - offset);
2971 }
2972
2973 /*
2974  * [3] 10.5.2.14d GPRS broadcast information
2975  */
2976 #define GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(x) \
2977     {                                                \
2978         curr_bit_offset += x;                        \
2979         value -= x;                                  \
2980         if (value <= 0)                              \
2981         {                                            \
2982             goto end;                                \
2983         }                                            \
2984     }
2985
2986 static gint
2987 de_rr_rest_oct_gprs_cell_options(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
2988 {
2989     proto_tree *subtree, *subtree2;
2990     proto_item *item, *item2;
2991     gint        curr_bit_offset, curr_bit_offset_sav;
2992     gint16      value;
2993
2994     curr_bit_offset = bit_offset;
2995
2996     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1,
2997                     ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_GPRS_CELL_OPTIONS], &item,
2998                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_GPRS_CELL_OPTIONS].strptr);
2999     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nmo, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
3000     curr_bit_offset += 2;
3001     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_t3168, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
3002     curr_bit_offset += 3;
3003     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_t3192, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
3004     curr_bit_offset += 3;
3005     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_drx_timer_max, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
3006     curr_bit_offset += 3;
3007     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_access_burst_type, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3008     curr_bit_offset += 1;
3009     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_control_ack_type, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3010     curr_bit_offset += 1;
3011     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bs_cv_max, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3012     curr_bit_offset += 4;
3013     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_pan_bits_present))
3014     {
3015         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pan_dec, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
3016         curr_bit_offset += 3;
3017         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pan_inc, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
3018         curr_bit_offset += 3;
3019         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pan_max, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
3020         curr_bit_offset += 3;
3021     }
3022     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_optional_extensions_present))
3023     { /* Optional extension information */
3024         curr_bit_offset_sav = curr_bit_offset;
3025         subtree2 = proto_tree_add_subtree(subtree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_GPRS_CELL_OPTIONS_EXT_INFO], &item2,
3026                                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_GPRS_CELL_OPTIONS_EXT_INFO].strptr);
3027         value = (gint16)tvb_get_bits8(tvb,curr_bit_offset,6);
3028         proto_tree_add_uint(subtree2, hf_gsm_a_rr_extension_length, tvb, curr_bit_offset>>3, 1, value);
3029         curr_bit_offset += 6;
3030         value += 1;
3031         proto_item_set_len(item2,((curr_bit_offset+value)>>3) - (curr_bit_offset_sav>>3)+1);
3032         if (gsm_rr_csn_flag(tvb, subtree2, curr_bit_offset, hf_gsm_a_rr_egprs_supported))
3033         {
3034             GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3035             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_egprs_packet_channel_request, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3036             GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3037             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_bep_period, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3038             GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(4);
3039         }
3040         else
3041         {
3042             GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3043         }
3044         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_pfc_feature_mode, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3045         GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3046         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_dtm_support, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3047         GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3048         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_bss_paging_coordination, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3049         GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3050         /* Rel 4 extension */
3051         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_ccn_active, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3052         GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3053         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_nw_ext_utbf, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3054         GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3055         /* Rel 6 extension */
3056         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_multiple_tbf_capability, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3057         GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3058         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_ext_utbf_no_data, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3059         GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3060         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_dtm_enhancements_capability, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3061         GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3062         if (gsm_rr_csn_flag(tvb, subtree2, curr_bit_offset, hf_gsm_a_rr_msms_procedures))
3063         {
3064             GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3065             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_dedicated_mode_mbms_notification_support, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3066             GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3067             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_mnci_support, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3068             GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3069         }
3070         else
3071         {
3072             GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3073         }
3074         /* Rel 7 extension */
3075         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_reduced_latency_access, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3076         GPRS_CELL_OPTIONS_CHECK_REMAINING_EXT_LEN(1);
3077         /* Remaining (undecoded?) extensions */
3078         curr_bit_offset += value;
3079     }
3080     end:
3081         proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
3082
3083         return (curr_bit_offset - bit_offset);
3084 }
3085
3086 static gint
3087 de_rr_rest_oct_gprs_power_control_parameters(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
3088 {
3089     proto_tree *subtree;
3090     proto_item *item;
3091     gint        curr_bit_offset;
3092
3093     curr_bit_offset = bit_offset;
3094
3095     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_GPRS_POWER_CONTROL_PARAMS], &item,
3096         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_GPRS_POWER_CONTROL_PARAMS].strptr);
3097     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_alpha, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3098     curr_bit_offset += 4;
3099     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_t_avg_w, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3100     curr_bit_offset += 5;
3101     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_t_avg_t, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3102     curr_bit_offset += 5;
3103     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pc_meas_chan, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3104     curr_bit_offset += 1;
3105     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_n_avg_i, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3106     curr_bit_offset += 4;
3107     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
3108
3109     return (curr_bit_offset - bit_offset);
3110 }
3111
3112 static guint16
3113 de_rr_gprs_broadcast_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len , gchar *add_string _U_, int string_len _U_)
3114 {
3115     guint32 curr_offset;
3116     gint    bit_offset;
3117
3118     curr_offset = offset;
3119     bit_offset = curr_offset << 3;
3120
3121     bit_offset += de_rr_rest_oct_gprs_cell_options(tvb, tree, bit_offset);
3122     /*bit_offset += */de_rr_rest_oct_gprs_power_control_parameters(tvb, tree, bit_offset);
3123     curr_offset += len;
3124
3125     return (curr_offset - offset);
3126 }
3127
3128 /*
3129  * [3] 10.5.2.15 Handover Reference
3130  */
3131 static guint16
3132 de_rr_ho_ref(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3133 {
3134     guint32 curr_offset;
3135
3136     curr_offset = offset;
3137
3138     /* Handover reference value */
3139     proto_tree_add_item(subtree, hf_gsm_a_rr_ho_ref_val, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3140
3141     curr_offset = curr_offset + 1;
3142
3143     return(curr_offset - offset);
3144 }
3145
3146 static const value_string gsm_a_access_tech_type_vals[] = {
3147     { 0, "GSM P"},
3148     { 1, "GSM E --note that GSM E covers GSM P"},
3149     { 2, "GSM R --note that GSM R covers GSM E and GSM P"},
3150     { 3, "GSM 1800"},
3151     { 4, "GSM 1900"},
3152     { 5, "GSM 450"},
3153     { 6, "GSM 480"},
3154     { 7, "GSM 850"},
3155     { 8, "GSM 750"},
3156     { 9, "GSM T 380"},
3157     { 10, "GSM T 410"},
3158     { 11, "GSM T 900"},
3159     { 12, "GSM 710"},
3160     { 13, "GSM T 810"},
3161     { 14, "reserved"},
3162     { 15, "Indicates the presence of a list of Additional access technologies"},
3163     { 0, NULL }
3164 };
3165
3166
3167 static const value_string gsm_a_egprs_mcs_vals[] = {
3168     { 0, "MCS-1"},
3169     { 1, "MCS-2"},
3170     { 2, "MCS-3"},
3171     { 3, "MCS-4"},
3172     { 4, "MCS-5"},
3173     { 5, "MCS-6"},
3174     { 6, "MCS-7"},
3175     { 7, "MCS-8"},
3176     { 8, "MCS-9"},
3177     { 9, "MCS-5-7"},
3178     { 10, "MCS-6-9"},
3179     { 11, "reserved"},
3180     { 0, NULL }
3181 };
3182
3183 static const value_string gsm_a_gprs_cs_vals[] = {
3184     { 0, "CS-1"},
3185     { 1, "CS-2"},
3186     { 2, "CS-3"},
3187     { 3, "CS-4"},
3188     { 0, NULL }
3189 };
3190
3191
3192 static const true_false_string gsm_a_tlli_block_channel_coding_vals = {
3193     "mobile station shall use coding scheme as specified by the corresponding CHANNEL CODING COMMAND or EGPRS CHANNEL CODING COMMAND field",
3194     "mobile station shall use CS-1 in GPRS TBF mode or MCS-1 in EGPRS TBF mode"
3195 };
3196
3197 static const true_false_string gsm_a_resegment_vals = {
3198     "Retransmitted RLC data blocks shall be re-segmented according to commanded MCS",
3199     "Retransmitted RLC data blocks shall not be re-segmented"
3200 };
3201
3202 static const true_false_string gsm_a_polling_vals = {
3203     "MS shall send a PACKET CONTROL ACKNOWLEDGEMENT message in the uplink block specified by TBF Starting Time, on the assigned PDCH",
3204     "no action is required from MS"
3205 };
3206
3207 static const true_false_string gsm_a_usf_granularity_vals = {
3208     "the mobile station shall transmit four consecutive RLC/MAC blocks",
3209     "the mobile station shall transmit one RLC/MAC block"
3210 };
3211
3212 static const true_false_string gsm_a_rlc_mode_vals = {
3213     "RLC unacknowledged mode",
3214     "RLC acknowledged mode"
3215 };
3216
3217 static const true_false_string gsm_a_ta_valid_vals = {
3218     "the timing advance value is valid",
3219     "the timing advance value is not valid"
3220 };
3221
3222
3223
3224 static const value_string gsm_a_egprs_windows_size_vals[] = {
3225     { 0, "64"},
3226     { 1, "96"},
3227     { 2, "128"},
3228     { 3, "160"},
3229     { 4, "192"},
3230     { 5, "224"},
3231     { 6, "256"},
3232     { 7, "288"},
3233     { 8, "320"},
3234     { 9, "352"},
3235     { 10, "384"},
3236     { 11, "416"},
3237     { 12, "448"},
3238     { 13, "480"},
3239     { 14, "512"},
3240     { 15, "544"},
3241     { 16, "576"},
3242     { 17, "608"},
3243     { 18, "640"},
3244     { 19, "672"},
3245     { 20, "704"},
3246     { 21, "736"},
3247     { 22, "768"},
3248     { 23, "800"},
3249     { 24, "832"},
3250     { 25, "864"},
3251     { 26, "896"},
3252     { 27, "928"},
3253     { 28, "960"},
3254     { 29, "992"},
3255     { 30, "1024"},
3256     { 31, "reserved"},
3257     { 0, NULL }
3258 };
3259
3260 static const value_string gsm_a_rr_gamma_vals[] = {
3261     {  0, "0 dB"},
3262     {  1, "2 dB"},
3263     {  2, "4 dB"},
3264     {  3, "6 dB"},
3265     {  4, "8 dB"},
3266     {  5, "10 dB"},
3267     {  6, "12 dB"},
3268     {  7, "14 dB"},
3269     {  8, "16 dB"},
3270     {  9, "18 dB"},
3271     { 10, "20 dB"},
3272     { 11, "22 dB"},
3273     { 12, "24 dB"},
3274     { 13, "26 dB"},
3275     { 14, "28 dB"},
3276     { 15, "30 dB"},
3277     { 16, "32 dB"},
3278     { 17, "34 dB"},
3279     { 18, "36 dB"},
3280     { 19, "38 dB"},
3281     { 20, "40 dB"},
3282     { 21, "42 dB"},
3283     { 22, "44 dB"},
3284     { 23, "46 dB"},
3285     { 24, "48 dB"},
3286     { 25, "50 dB"},
3287     { 26, "52 dB"},
3288     { 27, "54 dB"},
3289     { 28, "56 dB"},
3290     { 29, "58 dB"},
3291     { 30, "60 dB"},
3292     { 31, "62 dB"},
3293     {  0, NULL }
3294 };
3295
3296
3297
3298 static const value_string gsm_a_link_quality_meas_mode_vals[] = {
3299     {  0, "The MS shall not report either interference measurements or per slot BEP measurements"},
3300     {  1, "The MS shall report available interference measurements for timeslots 0 through 7"},
3301     {  2, "The MS shall report mean BEP on each assigned time slot ... No interference measurements shall be reported..."},
3302     {  3, "The MS shall report mean BEP on each assigned time slot ... In addition to mean BEP, the MS shall report interference measurements for no more than four time slots..."},
3303     {  0, NULL }
3304 };
3305
3306 static const true_false_string gsm_a_rr_ul_xtti_tbf_assignment_vals = {
3307     "An uplink BTTI TBF is assigned",
3308     "An uplink RTTI TBF is assigned"
3309      };
3310
3311 static const true_false_string gsm_a_rr_dl_xtti_tbf_assignment_vals = {
3312     "An downlink BTTI TBF is assigned",
3313     "An downlink RTTI TBF is assigned"
3314      };
3315
3316 static const true_false_string gsm_a_rr_fanr_act_state_vals = {
3317     "FANR is not activated for the assigned TBF",
3318     "FANR is activated for the assigned TBF"
3319      };
3320
3321 static const true_false_string gsm_a_rr_encoding_selection_vals = {
3322     "SSN - based encoding is selected",
3323     "Time - based encoding is selected"
3324      };
3325
3326 static const true_false_string gsm_a_rr_nof_pdch_pairs_vals = {
3327     "One PDCH Pair assigned",
3328     "Two PDCH Pairs assigned"
3329      };
3330
3331 static const value_string gsm_a_rr_rtti_usf_mode_vals[] = {
3332     { 0, "BTTI USF Mode is used" },
3333     { 1, "RTTI USF Mode is used" },
3334     { 0, NULL }
3335 };
3336
3337 static const value_string gsm_a_rr_pdch_pair_indic_vals[] = {
3338     { 0x0, "uplink PDCH pair: [i, i + 1] | downlink PDCH pair: [i, i + 1]" },
3339     { 0x1, "uplink PDCH pair: [i, i + 1] | downlink PDCH pair: [i - 1, i]" },
3340     { 0x2, "uplink PDCH pair: [i, i + 1] | downlink PDCH pair: [i - 2, i]" },
3341     { 0x3, "uplink PDCH pair: [i, i + 2] | downlink PDCH pair: [i - 1, i]" },
3342     { 0x4, "uplink PDCH pairs: [i, i + 1], [i + 2, i + 3] | downlink PDCH pairs: [i, i + 1], [i + 2, i + 3]" },
3343     { 0x5, "not used" },
3344     { 0x6, "not used" },
3345     { 0x7, "not used" },
3346     { 0, NULL }
3347 };
3348
3349 static const value_string gsm_a_rr_egprs_level_vals[] = {
3350     { 0x0, "EGPRS" },
3351     { 0x1, "EGPRS2 - A" },
3352     { 0x2, "EGPRS2 - B" },
3353     { 0x3, "reserved" },
3354     { 0, NULL }
3355 };
3356
3357 static const value_string gsm_a_rr_event_based_fanr_vals[] = {
3358     { 0, "The MS shall not use event - based FANR" },
3359     { 1, "The MS shall use event - based FANR" },
3360     { 0, NULL }
3361 };
3362
3363 static guint16
3364 de_tbf_starting_time(tvbuff_t *tvb, proto_tree *tree, guint32 bit_offset)
3365 {
3366     proto_item *item;
3367     guint32     curr_bit_offset;
3368     guint16     rfn, t;
3369     guint64     t1, t2, t3;
3370
3371     curr_bit_offset = bit_offset;
3372
3373     proto_tree_add_bits_ret_val(tree, hf_gsm_a_rr_tbf_T1prim, tvb, curr_bit_offset, 5, &t1, ENC_BIG_ENDIAN);
3374     curr_bit_offset += 5;
3375     proto_tree_add_bits_ret_val(tree, hf_gsm_a_rr_tbf_T3, tvb, curr_bit_offset, 6, &t3, ENC_BIG_ENDIAN);
3376     curr_bit_offset += 6;
3377     proto_tree_add_bits_ret_val(tree, hf_gsm_a_rr_tbf_T2, tvb, curr_bit_offset, 5, &t2, ENC_BIG_ENDIAN);
3378     curr_bit_offset += 5;
3379
3380
3381     /* great care needed with signed/unsigned - -1 in unsigned is 0xffff, which mod(26) is not what you think !!! */
3382     t = (26 + t3 - t2) % 26;
3383     rfn = (guint16)((51 * t) + t3 + (51 * 26 * t1));
3384
3385     item = proto_tree_add_uint(tree, hf_gsm_a_rr_tbf_starting_time, tvb, bit_offset >> 3, ((curr_bit_offset - bit_offset) >> 3) + 1, rfn);
3386     PROTO_ITEM_SET_GENERATED(item);
3387     return(curr_bit_offset - bit_offset);
3388 }
3389
3390 static gint
3391 de_rr_ia_rest_oct_egprs_packet_uplink_assignment(tvbuff_t *tvb, proto_tree *tree, gint bit_offset, guint bit_len)
3392 {
3393     proto_tree *subtree;
3394     proto_item *item;
3395     guint       curr_bit_offset;
3396
3397     curr_bit_offset = bit_offset;
3398
3399     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EGPRS_PACKET_UPLINK_ASSIGNMENT], &item,
3400         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EGPRS_PACKET_UPLINK_ASSIGNMENT].strptr);
3401     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_extended_ra, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3402     curr_bit_offset += 5;
3403     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_access_tech_req))
3404     {
3405         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_access_tech_type, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3406         curr_bit_offset += 4;
3407     }
3408
3409     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_tfi_multiblock))
3410     {
3411         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tfi_assignment, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3412         curr_bit_offset += 5;
3413         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_polling, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3414         curr_bit_offset += 1;
3415         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_tfi_allocation_type))
3416         {
3417            gint8 bitmap_len = tvb_get_bits8(tvb, curr_bit_offset, 5);
3418            gint32 bitmap;
3419            proto_tree_add_uint(tree, hf_gsm_a_rr_bitmap_length, tvb, curr_bit_offset>>3, 1+((curr_bit_offset+5)>>3) - (curr_bit_offset>>3), bitmap_len);
3420            curr_bit_offset += 5;
3421            bitmap = tvb_get_bits32(tvb, curr_bit_offset, bitmap_len, ENC_BIG_ENDIAN);
3422            proto_tree_add_uint(tree, hf_gsm_a_rr_bitmap, tvb, curr_bit_offset>>3, 1+((curr_bit_offset+bitmap_len)>>3) - (curr_bit_offset>>3), bitmap);
3423            curr_bit_offset += bitmap_len;
3424            if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_p0_present))
3425            {
3426                proto_tree_add_bits_item(subtree, hf_gsm_a_rr_p0, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3427                curr_bit_offset += 4;
3428                proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pr_mode, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3429                curr_bit_offset += 1;
3430            }
3431         }
3432         else
3433         {
3434            proto_tree_add_bits_item(subtree, hf_gsm_a_rr_usf, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
3435            curr_bit_offset += 3;
3436            proto_tree_add_bits_item(subtree, hf_gsm_a_rr_usf_granularity, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3437            curr_bit_offset += 1;
3438            if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_p0_present))
3439            {
3440                proto_tree_add_bits_item(subtree, hf_gsm_a_rr_p0, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3441                curr_bit_offset += 4;
3442                proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pr_mode, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3443                curr_bit_offset += 1;
3444            }
3445         }
3446
3447         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_egprs_mcs, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3448         curr_bit_offset += 4;
3449         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tlli_block_channel_coding, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3450         curr_bit_offset += 1;
3451         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_bep_period2_present))
3452         {
3453             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bep_period2, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3454             curr_bit_offset += 4;
3455         }
3456         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_resegment, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3457         curr_bit_offset += 1;
3458         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_egprs_window_size, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3459         curr_bit_offset += 5;
3460         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_alpha_present))
3461         {
3462             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_alpha, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3463             curr_bit_offset += 4;
3464         }
3465         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_gamma, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3466         curr_bit_offset += 5;
3467         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_timing_adv_index_present))
3468         {
3469             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_timing_adv_index, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3470             curr_bit_offset += 4;
3471         }
3472         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_tbf_starting_time_present))
3473         {
3474             curr_bit_offset += de_tbf_starting_time(tvb, subtree, curr_bit_offset);
3475         }
3476         /* Null breakpoint */
3477         if (curr_bit_offset < bit_len)
3478              {
3479             if (gsm_rr_csn_HL_flag(tvb, subtree, 0, curr_bit_offset++, hf_gsm_a_rr_additions_in_rel_7))
3480                  {
3481                 if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_ul_xtti_tbf_assignment))
3482                      {
3483                     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_fanr_act_state))
3484                          {
3485                         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_encoding_selection))
3486                              {
3487                             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_reported_timeslots, tvb, curr_bit_offset, 8, ENC_BIG_ENDIAN);
3488                             curr_bit_offset += 8;
3489                             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tsh, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
3490                             curr_bit_offset += 2;
3491                             }
3492                         }
3493                     }
3494                 else
3495                      {
3496                     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rtti_usf_mode, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3497                     curr_bit_offset += 1;
3498                     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pdch_pair_indic, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
3499                     curr_bit_offset += 3;
3500
3501                     if (hf_gsm_a_rr_rtti_usf_mode > 0)
3502                          {
3503                         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_additional_usf, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
3504                         curr_bit_offset += 3;
3505                         }
3506                     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_nof_pdch_pairs))
3507                          {
3508                         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_usf_2, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
3509                         curr_bit_offset += 3;
3510
3511                         if (hf_gsm_a_rr_rtti_usf_mode > 0)
3512                              {
3513                             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_additional_usf_2, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
3514                             curr_bit_offset += 3;
3515                             }
3516                         }
3517                     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_encoding_selection))
3518                          {
3519                         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_reported_timeslots, tvb, curr_bit_offset, 8, ENC_BIG_ENDIAN);
3520                         curr_bit_offset += 8;
3521                         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tsh, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
3522                         curr_bit_offset += 2;
3523                         }
3524                     }
3525                 }
3526             }
3527     }
3528     else  /*  Multi Block Allocation */
3529     {
3530         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_alpha_present))
3531         {
3532             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_alpha, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3533             curr_bit_offset += 4;
3534         }
3535         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_gamma, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3536         curr_bit_offset += 5;
3537         curr_bit_offset += de_tbf_starting_time(tvb, subtree, curr_bit_offset);
3538         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_num_of_radio_block_allocated, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
3539         curr_bit_offset += 2;
3540         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_p0_present))
3541         {
3542             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_p0, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3543             curr_bit_offset += 4;
3544             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bts_power_control_mode, tvb, curr_bit_offset++, 1, ENC_NA);
3545             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pr_mode, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3546             curr_bit_offset += 1;
3547         }
3548
3549         /* Null breakpoint */
3550         if (curr_bit_offset < bit_len)
3551         {
3552            if (gsm_rr_csn_HL_flag(tvb,subtree, 0,curr_bit_offset++, hf_gsm_a_rr_additions_in_rel_7))
3553            {
3554                if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_pfi_present))
3555                {
3556                    proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pfi, tvb, curr_bit_offset, 7, ENC_BIG_ENDIAN);
3557                    curr_bit_offset += 7;
3558                }
3559            }
3560         }
3561     }
3562     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
3563
3564     return (curr_bit_offset - bit_offset);
3565 }
3566
3567
3568 static gint
3569 de_rr_ia_rest_oct_tmgi(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
3570 {
3571     proto_tree *subtree;
3572     proto_item *item;
3573     gint        curr_bit_offset;
3574     guint16     value16;
3575     gchar       mcc[4];
3576     gchar       mnc[4];
3577
3578     curr_bit_offset = bit_offset;
3579
3580     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_TMGI], &item,
3581                                                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_TMGI].strptr);
3582
3583     if (0 == gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_mcc_mnc_parameters))   /*  without MCC and MNC parameters */
3584     {
3585         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_mbms_service_id, tvb, curr_bit_offset, 24, ENC_BIG_ENDIAN);
3586         curr_bit_offset += 24;
3587     }
3588     else   /* with MCC and MNC parameters */
3589     {
3590         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_mbms_service_id, tvb, curr_bit_offset, 24, ENC_BIG_ENDIAN);
3591         curr_bit_offset += 24;
3592
3593         value16 = tvb_get_bits16(tvb,curr_bit_offset,12,ENC_BIG_ENDIAN);
3594         mcc[0] = '0' + ((value16>>8)&0xf);
3595         mcc[1] = '0' + ((value16>>4)&0xf);
3596         mcc[2] = '0' + ((value16   )&0xf);
3597         mcc[3] = '\0';
3598         proto_tree_add_string(tree, hf_gsm_a_rr_mobile_country_code, tvb, curr_bit_offset>>3, 12, mcc);
3599         curr_bit_offset += 12;
3600
3601         value16 = tvb_get_bits16(tvb,curr_bit_offset,12,ENC_BIG_ENDIAN);
3602         mnc[0] = '0' + ((value16>>8)&0xf);
3603         mnc[1] = '0' + ((value16>>4)&0xf);
3604         mnc[2] = '0' + ((value16   )&0xf);
3605         mnc[3] = '\0';
3606         proto_tree_add_string(tree, hf_gsm_a_rr_mobile_network_code, tvb, curr_bit_offset>>3, 12, mnc);
3607         curr_bit_offset += 12;
3608     }
3609     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
3610
3611     return (curr_bit_offset - bit_offset);
3612 }
3613
3614
3615
3616 static gint
3617 de_rr_ia_rest_oct_packet_timing_advance(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
3618 {
3619     proto_tree *subtree;
3620     proto_item *item;
3621     gint        curr_bit_offset;
3622
3623
3624     curr_bit_offset = bit_offset;
3625
3626     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_PACKET_TIMING_ADVANCE], &item,
3627                                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_PACKET_TIMING_ADVANCE].strptr);
3628
3629     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_timing_adv_present))
3630     {
3631         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_timing_adv, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
3632         curr_bit_offset += 6;
3633     }
3634
3635     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_timing_advance_index_timeslot))
3636     {
3637         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_timing_adv_index, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3638         curr_bit_offset += 4;
3639         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_timing_adv_timeslot_num, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
3640         curr_bit_offset += 3;
3641     }
3642     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
3643
3644     return (curr_bit_offset - bit_offset);
3645 }
3646
3647
3648
3649 static gint
3650 de_rr_ia_rest_oct_multiple_blocks_packet_downlink_assignment(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
3651 {
3652     proto_tree *subtree;
3653     proto_item *item;
3654     gint        curr_bit_offset;
3655     guint8      value;
3656
3657     curr_bit_offset = bit_offset;
3658
3659     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_MULTIPLE_BLOCKS_PACKET_DOWNLINK_ASSIGNMENT], &item,
3660                                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_MULTIPLE_BLOCKS_PACKET_DOWNLINK_ASSIGNMENT].strptr);
3661
3662     curr_bit_offset += de_tbf_starting_time(tvb, subtree, curr_bit_offset);
3663     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_num_of_radio_block_allocated, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3664     curr_bit_offset += 4;
3665
3666     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_packet_downlink_assignment))
3667     {
3668         if (0 == gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_mbms_assignment))
3669         {/* MBMS Assignment (Distribution) */
3670             curr_bit_offset += de_rr_ia_rest_oct_tmgi(tvb, tree, curr_bit_offset);
3671         }
3672         else   /* MBMS Assignment (Non-distribution) */
3673         {
3674             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tlli, tvb, curr_bit_offset, 32, ENC_BIG_ENDIAN);
3675             curr_bit_offset += 32;
3676             if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_ms_parameters))
3677             {
3678                 value = tvb_get_bits8(tvb,curr_bit_offset,2);
3679                 proto_tree_add_uint(tree, hf_gsm_a_rr_len_indicator_ms_id, tvb, curr_bit_offset>>3, 2, value);
3680                 curr_bit_offset += 2;
3681
3682                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ms_id, tvb, curr_bit_offset, value+1, ENC_BIG_ENDIAN);
3683                 curr_bit_offset += value+1;
3684                 curr_bit_offset += de_rr_ia_rest_oct_packet_timing_advance(tvb, tree, curr_bit_offset);
3685                 if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_alpha_present))
3686                 {
3687                     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_alpha, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3688                     curr_bit_offset += 4;
3689                     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_gamma_present))
3690                     {
3691                         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_gamma, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3692                         curr_bit_offset += 5;
3693                     }
3694                 }
3695             }
3696         }
3697     }
3698     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
3699
3700     return (curr_bit_offset - bit_offset);
3701 }
3702
3703
3704
3705
3706 static gint
3707 de_rr_ia_rest_oct_packet_uplink_assignment(tvbuff_t *tvb, proto_tree *tree, gint bit_offset, guint bit_len)
3708 {
3709     proto_tree *subtree;
3710     proto_item *item;
3711     guint       curr_bit_offset;
3712
3713     curr_bit_offset = bit_offset;
3714
3715     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_PACKET_UPLINK_ASSIGNMENT], &item,
3716                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_PACKET_UPLINK_ASSIGNMENT].strptr);
3717
3718     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_packet_uplink_assignment))
3719     {
3720         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tfi_assignment, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3721         curr_bit_offset += 5;
3722         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_polling, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3723         curr_bit_offset += 1;
3724         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_allocation_type))
3725         {
3726            gint8 bitmap_len = tvb_get_bits8(tvb, curr_bit_offset, 5);
3727            gint32 bitmap;
3728            proto_tree_add_uint(tree, hf_gsm_a_rr_bitmap_length, tvb, curr_bit_offset>>3, 1+((curr_bit_offset+5)>>3) - (curr_bit_offset>>3), bitmap_len);
3729            curr_bit_offset += 5;
3730            bitmap = tvb_get_bits32(tvb, curr_bit_offset, bitmap_len, ENC_BIG_ENDIAN);
3731            proto_tree_add_uint(tree, hf_gsm_a_rr_bitmap, tvb, curr_bit_offset>>3, 1+((curr_bit_offset+bitmap_len)>>3) - (curr_bit_offset>>3), bitmap);
3732            curr_bit_offset += bitmap_len;
3733            if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_p0_present))
3734            {
3735                proto_tree_add_bits_item(subtree, hf_gsm_a_rr_p0, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3736                curr_bit_offset += 4;
3737                proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pr_mode, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3738                curr_bit_offset += 1;
3739            }
3740         }
3741         else
3742         {
3743            proto_tree_add_bits_item(subtree, hf_gsm_a_rr_usf, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
3744            curr_bit_offset += 3;
3745            proto_tree_add_bits_item(subtree, hf_gsm_a_rr_usf_granularity, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3746            curr_bit_offset += 1;
3747            if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_p0_present))
3748            {
3749                proto_tree_add_bits_item(subtree, hf_gsm_a_rr_p0, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3750                curr_bit_offset += 4;
3751                proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pr_mode, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3752                curr_bit_offset += 1;
3753            }
3754         }
3755         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_gprs_cs, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
3756         curr_bit_offset += 2;
3757         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tlli_block_channel_coding, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3758         curr_bit_offset += 1;
3759         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_alpha_present))
3760         {
3761             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_alpha, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3762             curr_bit_offset += 4;
3763         }
3764         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_gamma, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3765         curr_bit_offset += 5;
3766         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_timing_advance_index))
3767         {
3768             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_timing_adv_index, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3769             curr_bit_offset += 4;
3770         }
3771         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_tbf_starting_time_present))
3772         {
3773            curr_bit_offset += de_tbf_starting_time(tvb, subtree, curr_bit_offset);
3774         }
3775     }
3776     else  /* Single Block Allocation */
3777     {
3778        if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_alpha_present))
3779         {
3780             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_alpha, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3781             curr_bit_offset += 4;
3782         }
3783         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_gamma, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3784         curr_bit_offset += 5;
3785         /* fixed bits '01' */
3786         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_early_r97_version_reserved_bit, tvb, curr_bit_offset++, 1, ENC_NA);
3787         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_later_r97_version_reserved_bit, tvb, curr_bit_offset++, 1, ENC_NA);
3788         curr_bit_offset += de_tbf_starting_time(tvb, subtree, curr_bit_offset);
3789         if (gsm_rr_csn_HL_flag(tvb,subtree, 0,curr_bit_offset++, hf_gsm_a_rr_p0_present))
3790         {
3791             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_p0, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3792             curr_bit_offset += 4;
3793             /* The value '1' was allocated in an earlier version of the protocol and shall not be used */
3794             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_earlier_version_reserved_bit, tvb, curr_bit_offset++, 1, ENC_NA);
3795             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pr_mode, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3796             curr_bit_offset += 1;
3797         }
3798     }
3799
3800     /* Null breakpoint */
3801     if (curr_bit_offset < bit_len)
3802     {
3803        if (gsm_rr_csn_HL_flag(tvb,subtree, 0,curr_bit_offset++, hf_gsm_a_rr_additions_in_r99))
3804        {
3805            if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_extended_ra_present))
3806            {
3807                proto_tree_add_bits_item(subtree, hf_gsm_a_rr_extended_ra, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3808                curr_bit_offset += 5;
3809            }
3810        }
3811     }
3812
3813     /* Null breakpoint */
3814     if (curr_bit_offset < bit_len)
3815     {
3816        if (gsm_rr_csn_HL_flag(tvb,subtree, 0,curr_bit_offset++, hf_gsm_a_rr_additions_in_rel_6))
3817        {
3818            if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_pfi_present))
3819            {
3820                proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pfi, tvb, curr_bit_offset, 7, ENC_BIG_ENDIAN);
3821                curr_bit_offset += 7;
3822            }
3823        }
3824     }
3825     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
3826
3827     return (curr_bit_offset - bit_offset);
3828 }
3829
3830
3831 static gint
3832 de_rr_ia_rest_oct_packet_downlink_assignment(tvbuff_t *tvb, proto_tree *tree, guint bit_offset, guint bit_len)
3833 {
3834     proto_tree *subtree;
3835     proto_item *item;
3836     guint       curr_bit_offset;
3837
3838     curr_bit_offset = bit_offset;
3839
3840     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_PACKET_DOWNLINK_ASSIGNMENT], &item,
3841                                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_PACKET_DOWNLINK_ASSIGNMENT].strptr);
3842
3843     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tlli, tvb, curr_bit_offset, 32, ENC_BIG_ENDIAN);
3844     curr_bit_offset += 32;
3845
3846     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_tfi_assignment_present))
3847     {
3848         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tfi_assignment, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3849         curr_bit_offset += 5;
3850         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rlc_mode, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3851         curr_bit_offset += 1;
3852         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_alpha_present))
3853         {
3854             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_alpha, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3855             curr_bit_offset += 4;
3856         }
3857         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_gamma, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3858         curr_bit_offset += 5;
3859         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_polling, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3860         curr_bit_offset += 1;
3861         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ta_valid, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3862         curr_bit_offset += 1;
3863     }
3864     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_timing_advance_index))
3865     {
3866         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_timing_adv_index, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3867         curr_bit_offset += 4;
3868     }
3869     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_tbf_starting_time_present))
3870     {
3871        curr_bit_offset += de_tbf_starting_time(tvb, subtree, curr_bit_offset);
3872     }
3873     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_p0_present))
3874     {
3875         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_p0, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3876         curr_bit_offset += 4;
3877         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pr_mode_present, tvb, curr_bit_offset++, 1, ENC_NA);
3878         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pr_mode, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3879         curr_bit_offset += 1;
3880     }
3881
3882     /* Null breakpoint */
3883     if (curr_bit_offset < bit_len)
3884     {
3885        if (gsm_rr_csn_HL_flag(tvb,subtree, 0,curr_bit_offset++, hf_gsm_a_rr_additions_in_r99))
3886        {
3887            proto_tree_add_bits_item(subtree, hf_gsm_a_rr_egprs_window_size, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3888            curr_bit_offset += 5;
3889            proto_tree_add_bits_item(subtree, hf_gsm_a_rr_link_quality_meas_mode, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
3890            curr_bit_offset += 2;
3891            if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_bep_period2_present))
3892            {
3893                proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bep_period2, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
3894                curr_bit_offset += 4;
3895            }
3896        }
3897     }
3898
3899     /* Null breakpoint */
3900     if (curr_bit_offset < bit_len)
3901     {
3902        if (gsm_rr_csn_HL_flag(tvb,subtree, 0, curr_bit_offset++, hf_gsm_a_rr_additions_in_rel_6))
3903        {
3904            if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_pfi_present))
3905            {
3906                proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pfi, tvb, curr_bit_offset, 7, ENC_BIG_ENDIAN);
3907                curr_bit_offset += 7;
3908            }
3909        }
3910     }
3911
3912     /* Null breakpoint */
3913     if (curr_bit_offset < bit_len)
3914     {
3915         if (gsm_rr_csn_HL_flag(tvb, subtree, 0, curr_bit_offset++, hf_gsm_a_rr_additions_in_rel_7))
3916         {
3917
3918             if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_npm_transfer_time_present))
3919             {
3920                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_npm_transfer_time, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3921                 curr_bit_offset += 5;
3922             }
3923
3924             if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_dl_xtti_tbf_assignment))
3925             {
3926                 if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_fanr_act_state))
3927                 {
3928                     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_event_based_fanr, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3929                     curr_bit_offset += 1;
3930                 }
3931             }
3932             else
3933             {
3934                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_event_based_fanr, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
3935                 curr_bit_offset += 1;
3936                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pdch_pair_indic, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
3937                 curr_bit_offset += 3;
3938             }
3939
3940             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_dl_egprs_level, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
3941             curr_bit_offset += 2;
3942         }
3943     }
3944
3945     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
3946
3947     return (curr_bit_offset - bit_offset);
3948 }
3949
3950 static gint
3951 de_rr_ia_rest_oct_second_part_packet_assignment(tvbuff_t *tvb, proto_tree *tree, guint bit_offset, guint bit_len)
3952 {
3953     proto_tree *subtree;
3954     proto_item *item;
3955     guint       curr_bit_offset;
3956
3957     curr_bit_offset = bit_offset;
3958
3959     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_SECOND_PART_PACKET_ASSIGNMENT], &item,
3960                                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_SECOND_PART_PACKET_ASSIGNMENT].strptr);
3961
3962     /* Null breakpoint */
3963     if (curr_bit_offset < bit_len)
3964     {
3965        if (gsm_rr_csn_HL_flag(tvb,subtree, 0,curr_bit_offset++, hf_gsm_a_rr_additions_in_r99))
3966        {
3967            if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_extended_ra_present))
3968            {
3969                proto_tree_add_bits_item(subtree, hf_gsm_a_rr_extended_ra, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
3970                curr_bit_offset += 5;
3971            }
3972        }
3973     }
3974     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
3975
3976     return (curr_bit_offset - bit_offset);
3977 }
3978
3979
3980 /*
3981  * [3] 10.5.2.16 IA Rest Octets
3982  */
3983
3984 static const value_string gsm_a_rr_implicit_reject_cs_vals[] = {
3985     {0, "An implicit reject is not indicated for the CS domain"},
3986     {1, "An implicit reject is indicated for the CS domain"},
3987     {0, NULL}
3988 };
3989
3990 static const value_string gsm_a_rr_implicit_reject_ps_vals[] = {
3991     {0, "An implicit reject is not indicated for the PS domain"},
3992     {1, "An implicit reject is indicated for the PS domain"},
3993     {0, NULL}
3994 };
3995
3996 static guint16
3997 de_rr_ia_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3998 {
3999     proto_item *item;
4000     guint32     curr_offset;
4001     gint        bit_offset;
4002     gint        length;
4003     guint64     ma_length;
4004     guint8      tvb_len = tvb_reported_length(tvb);
4005     guint16     bit_len = tvb_len << 3;
4006
4007     curr_offset = offset;
4008
4009     bit_offset = curr_offset << 3;
4010     if (0 == gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_first_discriminator_bit))
4011     {
4012         if (0 == gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_second_discriminator_bit))
4013         {
4014            /* LL */
4015            gsm_rr_csn_HL_flag(tvb, subtree, 0,bit_offset++, hf_gsm_a_rr_a_compressed_inter_rat_handover_info);
4016
4017            if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_13))
4018             {
4019                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_implicit_reject_ps, tvb, bit_offset++, 1, ENC_BIG_ENDIAN);
4020                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_peo_bcch_change_mark, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
4021                 bit_offset += 2;
4022                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rcc, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4023                 bit_offset += 3;
4024             }
4025         }
4026         else   /* LH */
4027         {
4028             if (0 == gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_downlink_uplink_discriminator_bit))
4029             {
4030                 if (0 == gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_downlink_uplink))
4031                 {
4032                     bit_offset += de_rr_ia_rest_oct_egprs_packet_uplink_assignment(tvb, subtree, bit_offset, bit_len);
4033                 }
4034                 else
4035                 {
4036                     bit_offset += de_rr_ia_rest_oct_multiple_blocks_packet_downlink_assignment(tvb, subtree, bit_offset);
4037                 }
4038             }
4039             else
4040             {
4041                 proto_tree_add_item(subtree, hf_gsm_a_rr_ia_rest_oct_reserved, tvb, bit_offset>>3, 1, ENC_NA);
4042             }
4043             if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_13))
4044             {
4045                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_implicit_reject_ps, tvb, bit_offset++, 1, ENC_BIG_ENDIAN);
4046                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_peo_bcch_change_mark, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
4047                 bit_offset += 2;
4048                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rcc, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4049                 bit_offset += 3;
4050          }
4051
4052         }
4053     }
4054     else
4055     {
4056         if (0 == gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_second_discriminator_bit))
4057         {
4058            /* HL */
4059             proto_tree_add_bits_ret_val(subtree, hf_gsm_a_rr_ma_length, tvb, bit_offset, 6, &ma_length, ENC_BIG_ENDIAN);
4060             bit_offset += 6;
4061             /* Frequency Parameters, before time */
4062             if (ma_length>0)
4063             {
4064                 /* two '0' bits */
4065                 bit_offset += 2;
4066                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_maio, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
4067                 bit_offset += 6;
4068                 length = (gint)ma_length;
4069                 item = proto_tree_add_bytes_format(subtree, hf_gsm_a_rr_ma_bitmap, tvb, bit_offset>>3, (length>>3)-1, NULL, "MA Bitmap: ");
4070                 length = (length-1)*8;
4071                 while (length)
4072                 {
4073                     proto_item_append_text(item,"%d",tvb_get_bits8(tvb,bit_offset,1));
4074                     bit_offset += 1;
4075                     length -= 1;
4076                 }
4077             }
4078             gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_a_compressed_inter_rat_handover_info);
4079
4080             if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_13))
4081             {
4082                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_implicit_reject_ps, tvb, bit_offset++, 1, ENC_BIG_ENDIAN);
4083                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_peo_bcch_change_mark, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
4084                 bit_offset += 2;
4085                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rcc, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4086                 bit_offset += 3;
4087             }
4088         }
4089         else   /* HH */
4090         {
4091             if (0 == gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_second_packet_assignment_discriminator_bit))
4092             {
4093                 if (0 == gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_packet_discriminator_bit))
4094                 {
4095                       /* 00  < Packet Uplink Assignment > */
4096                     bit_offset += de_rr_ia_rest_oct_packet_uplink_assignment(tvb, subtree, bit_offset, bit_len);
4097                 }
4098                 else  /*  01     < Packet Downlink Assignment >  */
4099                 {
4100                     bit_offset += de_rr_ia_rest_oct_packet_downlink_assignment(tvb, subtree, bit_offset, bit_len);
4101                 }
4102             }
4103             else  /*  1       < Second Part Packet Assignment >   */
4104             {
4105                 bit_offset += de_rr_ia_rest_oct_second_part_packet_assignment(tvb, subtree, bit_offset, bit_len);
4106             }
4107             if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_10))
4108             {
4109                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_implicit_reject_cs, tvb, bit_offset++, 1, ENC_BIG_ENDIAN);
4110                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_implicit_reject_ps, tvb, bit_offset++, 1, ENC_BIG_ENDIAN);
4111             }
4112
4113             if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_13))
4114             {
4115                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_peo_bcch_change_mark, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
4116                 bit_offset += 2;
4117                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rcc, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4118                 bit_offset += 3;
4119             }
4120         }
4121     }
4122     gsm_rr_csn_padding_bits(subtree, tvb, bit_offset, tvb_len);
4123     return tvb_len - offset;
4124 }
4125
4126 /*
4127  * [3] 10.5.2.17 IAR Rest Octets
4128  */
4129
4130 static guint16
4131 de_rr_iar_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4132 {
4133     guint32 curr_bit_offset;
4134     guint8  i;
4135     guint8  ra_count = 0;
4136     guint8  tvb_len = tvb_reported_length(tvb);
4137
4138     curr_bit_offset = offset << 3;
4139
4140     for (i = 0; i < 4; i++)
4141     {
4142         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_extended_ra_present))
4143         {
4144             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_extended_ra, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
4145             curr_bit_offset += 5;
4146             ra_count += 1;
4147         }
4148     }
4149     if (ra_count < 4){
4150         if (gsm_rr_csn_HL_flag(tvb, subtree, 0, curr_bit_offset++, hf_gsm_a_rr_additions_in_rel_13))
4151         {
4152             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rcc, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
4153             curr_bit_offset += 3;
4154         }
4155     }
4156
4157     gsm_rr_csn_padding_bits(subtree, tvb, curr_bit_offset, tvb_len);
4158     return tvb_len - offset;
4159 }
4160
4161 /*
4162  * [3] 10.5.2.18 IAX Rest Octets
4163  */
4164 static guint16
4165 de_rr_iax_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4166 {
4167     guint32 curr_bit_offset;
4168     guint8  tvb_len = tvb_reported_length(tvb);
4169
4170     curr_bit_offset = offset<<3;
4171
4172     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_compressed_inter_rat_handover_info, tvb, curr_bit_offset++, 1, ENC_NA);
4173
4174     if (gsm_rr_csn_HL_flag(tvb, subtree, 0, curr_bit_offset++, hf_gsm_a_rr_additions_in_rel_13))
4175     {
4176         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rcc, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
4177         curr_bit_offset += 3;
4178     }
4179
4180     gsm_rr_csn_padding_bits(subtree, tvb, curr_bit_offset, tvb_len);
4181     return tvb_len - offset;
4182 }
4183
4184 /*
4185  * [3] 10.5.2.19 L2 Pseudo Length
4186  */
4187 static guint16
4188 de_rr_l2_pseudo_len(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4189 {
4190     guint32 curr_offset;
4191
4192     curr_offset = offset;
4193
4194     /* L2 Pseudo Length value */
4195     proto_tree_add_item(subtree, hf_gsm_a_rr_L2_pseudo_len, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4196
4197     curr_offset = curr_offset + 1;
4198
4199     return(curr_offset - offset);
4200 }
4201
4202 /*
4203  *
4204  * 44.018 10.5.2.20 Measurement Results
4205  */
4206 static const true_false_string gsm_a_rr_dtx_vals  = {
4207     "DTX was used",
4208     "DTX was not used"
4209 };
4210
4211
4212 static const true_false_string gsm_a_rr_mv_vals  = {
4213     "The measurement results are not valid",
4214     "The measurement results are valid"
4215 };
4216
4217 static const value_string gsm_a_rr_ncell_vals [] = {
4218     {0, "No neighbour cell measurement result"},
4219     {1, "1 neighbour cell measurement result"},
4220     {2, "2 neighbour cell measurement result"},
4221     {3, "3 neighbour cell measurement result"},
4222     {4, "4 neighbour cell measurement result"},
4223     {5, "5 neighbour cell measurement result"},
4224     {6, "6 neighbour cell measurement result"},
4225     {7, "Neighbour cell information not available for serving cell"},
4226     {0, NULL}
4227 };
4228 /*
4229 < Measurement Results Contents > ::=
4230     { < BA_USED : bit (1) >
4231         < DTX_USED : bit (1) >
4232         < RXLEV_FULL_SERVING_CELL : bit (6) >
4233         < 3G_BA_USED : bit (1) >
4234         < MEAS_VALID : bit (1) >
4235         < RXLEV_SUB_SERVING_CELL : bit (6) >
4236         < SI23_BA_USED : bit (1) >
4237         < RXQUAL_FULL_SERVING_CELL : bit (3) >
4238         < RXQUAL_SUB_SERVING_CELL : bit (3) >
4239         {
4240             < NO_NCELL_M : { bit (3) := 111 } >
4241             0**                 -- Padding with zeroes
4242         } |
4243         {
4244             < NO_NCELL_M : { bit (3) exclude 111 } >
4245             { < NCELL Report : < NCELL Report struct >> } * val (NO_NCELL_M)
4246             { null | 0**                        -- Padding with zeroes
4247                 | 1 < UTRAN_CSG_Measurement_Report : < UTRAN_CSG_Measurement_Report IE > >
4248                 { null | 0** }  -- Padding with zeroes
4249             }
4250         }
4251     } & octet (16) ;
4252 < NCELL Report struct > ::=
4253     < RXLEV-NCELL: bit (6) >
4254     < BCCH-FREQ-NCELL : bit (5) >
4255     < BSIC-NCELL : bit (6) > ;
4256
4257 */
4258 guint16
4259 de_rr_meas_res(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4260 {
4261     guint32 curr_offset;
4262     gint    bit_offset;
4263     guint64 no_ncell_m;
4264
4265     curr_offset = offset;
4266
4267     bit_offset = curr_offset << 3;
4268     /* 2nd octet */
4269     /* BA-USED */
4270     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ba_used, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4271     bit_offset++;
4272     /* DTX USED */
4273     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_dtx_used, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4274     bit_offset++;
4275     /* RXLEV-FULL-SERVING-CELL */
4276     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rxlev_full_serv_cell, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
4277     bit_offset += 6;
4278     curr_offset++;
4279
4280     /* 3rd octet */
4281     /* 3G-BA-USED */
4282     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_ba_used, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4283     bit_offset++;
4284     /* MEAS-VALID */
4285     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_meas_valid, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4286     bit_offset++;
4287     /* RXLEV-SUB-SERVING-CELL */
4288     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rxlev_sub_serv_cell, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
4289     bit_offset += 6;
4290
4291     curr_offset++;
4292
4293     /* 4th octet */
4294     /* SI23_BA_USED */
4295     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si23_ba_used, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4296     bit_offset++;
4297     /* RXQUAL-FULL-SERVING-CELL */
4298     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rxqual_full_serv_cell, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4299     bit_offset += 3;
4300
4301     /* RXQUAL-SUB-SERVING-CELL */
4302     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rxqual_sub_serv_cell, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4303     bit_offset += 3;
4304     /* NO-NCELL-M */
4305     proto_tree_add_bits_ret_val(subtree, hf_gsm_a_rr_no_ncell_m, tvb, bit_offset, 3, &no_ncell_m, ENC_BIG_ENDIAN);
4306     bit_offset += 3;
4307     if (no_ncell_m == 7) /* No neighbour cell information available) */
4308         no_ncell_m = 0;
4309     while (no_ncell_m)
4310     {
4311         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rxlev_ncell, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
4312         bit_offset += 6;
4313         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bcch_freq_ncell, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
4314         bit_offset += 5;
4315         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bsic_ncell, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
4316         bit_offset += 6;
4317         no_ncell_m -= 1;
4318     }
4319
4320     return(len);
4321 }
4322
4323 /*
4324  * [3] 10.5.2.20a GPRS Measurement Results
4325  */
4326 /*
4327  * [3] 10.5.2.21 Mobile Allocation
4328  */
4329 static guint16
4330 de_rr_mob_all(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4331 {
4332     guint32     curr_offset;
4333     proto_item *item;
4334     gint        i, j;
4335     guint8      value;
4336
4337     curr_offset = offset;
4338
4339     item = proto_tree_add_bytes_format(tree, hf_gsm_a_rr_inc_arfcn_bitmap, tvb, curr_offset, len, NULL,
4340                                         "Bitmap of increasing ARFCNs included in the Mobile Allocation: ");
4341     for(i=len; i>0; i--)
4342     {
4343         value = tvb_get_guint8(tvb,curr_offset+i-1);
4344         for (j=0; j<8; j++)
4345         {
4346             proto_item_append_text(item,"%d",(value>>j)&0x01);
4347         }
4348     }
4349
4350     curr_offset = curr_offset + len;
4351     return(curr_offset - offset);
4352 }
4353
4354 /*
4355  * [3] 10.5.2.21a Mobile Time Difference
4356  */
4357 static guint16
4358 de_rr_mob_time_diff(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4359 {
4360     guint32 curr_offset;
4361
4362     curr_offset = offset;
4363
4364     proto_tree_add_item(tree, hf_gsm_a_rr_mobile_time_difference, tvb, curr_offset, len, ENC_BIG_ENDIAN);
4365
4366     curr_offset = curr_offset + len;
4367     return(curr_offset - offset);
4368
4369 }
4370 /*
4371  * [3] 10.5.2.21aa MultiRate configuration
4372  */
4373 /*    Multirate speech version Octet 3 Bits 8 7 6 */
4374 static const value_string multirate_speech_ver_vals[] = {
4375     { 1, "Adaptive Multirate speech version 1"},
4376     { 2, "Adaptive Multirate speech version 2"},
4377     { 0, NULL }
4378 };
4379 /* Bit 5  NSCB: Noise Suppression Control Bit */
4380 static const value_string NSCB_vals[] = {
4381     { 0, "Noise Suppression can be used (default)"},
4382     { 1, "Noise Suppression shall be turned off"},
4383     { 0, NULL }
4384 };
4385 /* Bit 4 ICMI: Initial Codec Mode Indicator */
4386 static const value_string ICMI_vals[] = {
4387     { 0, "The initial codec mode is defined by the implicit rule provided in 3GPP TS 05.09"},
4388     { 1, "The initial codec mode is defined by the Start Mode field"},
4389     { 0, NULL }
4390 };
4391 /*
4392 Table 10.5.2.21aa.2: Set of adaptive multirate codec modes field (octet 4)
4393 for the Multirate speech version 1
4394 */
4395 static const true_false_string gsm_a_rr_set_of_amr_codec_modes  = {
4396     "is part of the subset",
4397     "is not part of the subset"
4398 };
4399
4400 static const value_string gsm_a_rr_amr_threshold_vals[] = {
4401     {  0, "0.0 dB"},
4402     {  1, "0.5 dB"},
4403     {  2, "1.0 dB"},
4404     {  3, "1.5 dB"},
4405     {  4, "2.0 dB"},
4406     {  5, "2.5 dB"},
4407     {  6, "3.0 dB"},
4408     {  7, "3.5 dB"},
4409     {  8, "4.0 dB"},
4410     {  9, "4.5 dB"},
4411     { 10, "5.0 dB"},
4412     { 11, "5.5 dB"},
4413     { 12, "6.0 dB"},
4414     { 13, "6.5 dB"},
4415     { 14, "7.0 dB"},
4416     { 15, "7.5 dB"},
4417     { 16, "8.0 dB"},
4418     { 17, "8.5 dB"},
4419     { 18, "9.0 dB"},
4420     { 19, "9.5 dB"},
4421     { 20, "10.0 dB"},
4422     { 21, "10.5 dB"},
4423     { 22, "11.0 dB"},
4424     { 23, "11.5 dB"},
4425     { 24, "12.0 dB"},
4426     { 25, "12.5 dB"},
4427     { 26, "13.0 dB"},
4428     { 27, "13.5 dB"},
4429     { 28, "14.0 dB"},
4430     { 29, "14.5 dB"},
4431     { 30, "15.0 dB"},
4432     { 31, "15.5 dB"},
4433     { 32, "16.0 dB"},
4434     { 33, "16.5 dB"},
4435     { 34, "17.0 dB"},
4436     { 35, "17.5 dB"},
4437     { 36, "18.0 dB"},
4438     { 37, "18.5 dB"},
4439     { 38, "19.0 dB"},
4440     { 39, "19.5 dB"},
4441     { 40, "20.0 dB"},
4442     { 41, "20.5 dB"},
4443     { 42, "21.0 dB"},
4444     { 43, "21.5 dB"},
4445     { 44, "22.0 dB"},
4446     { 45, "22.5 dB"},
4447     { 46, "23.0 dB"},
4448     { 47, "23.5 dB"},
4449     { 48, "24.0 dB"},
4450     { 49, "24.5 dB"},
4451     { 50, "25.0 dB"},
4452     { 51, "25.5 dB"},
4453     { 52, "26.0 dB"},
4454     { 53, "26.5 dB"},
4455     { 54, "27.0 dB"},
4456     { 55, "27.5 dB"},
4457     { 56, "28.0 dB"},
4458     { 57, "28.5 dB"},
4459     { 58, "29.0 dB"},
4460     { 59, "29.5 dB"},
4461     { 60, "30.0 dB"},
4462     { 61, "30.5 dB"},
4463     { 62, "31.0 dB"},
4464     { 63, "31.5 dB"},
4465     { 0, NULL }
4466 };
4467
4468 static value_string_ext gsm_a_rr_amr_threshold_vals_ext = VALUE_STRING_EXT_INIT(gsm_a_rr_amr_threshold_vals);
4469
4470 static const value_string gsm_a_rr_amr_hysteresis_vals[] = {
4471     {  0, "0.0 dB"},
4472     {  1, "0.5 dB"},
4473     {  2, "1.0 dB"},
4474     {  3, "1.5 dB"},
4475     {  4, "2.0 dB"},
4476     {  5, "2.5 dB"},
4477     {  6, "3.0 dB"},
4478     {  7, "3.5 dB"},
4479     {  8, "4.0 dB"},
4480     {  9, "4.5 dB"},
4481     { 10, "5.0 dB"},
4482     { 11, "5.5 dB"},
4483     { 12, "6.0 dB"},
4484     { 13, "6.5 dB"},
4485     { 14, "7.0 dB"},
4486     { 15, "7.5 dB"},
4487     { 0, NULL }
4488 };
4489
4490 guint16
4491 de_rr_multirate_conf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4492 {
4493     guint32 curr_offset;
4494     guint8  oct;
4495     gint    bit_offset, remaining_length, nb_of_params;
4496     proto_item* ver_item;
4497
4498     curr_offset = offset;
4499
4500     ver_item = proto_tree_add_item(tree, hf_gsm_a_rr_multirate_speech_ver, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4501     proto_tree_add_item(tree, hf_gsm_a_rr_NCSB, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4502     proto_tree_add_item(tree, hf_gsm_a_rr_ICMI, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4503     /* The initial codec mode is coded as in 3GPP TS 45.009 */
4504     proto_tree_add_item(tree, hf_gsm_a_rr_start_mode, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4505     oct = ( tvb_get_guint8(tvb,curr_offset) &0xe0 ) >> 5;
4506     curr_offset++;
4507     switch ( oct){
4508     case 1:
4509         /* Adaptive Multirate speech version 1 */
4510         /* Set of AMR codec modes */
4511         proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b8, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4512         proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b7, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4513         proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b6, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4514         proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4515         proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4516         proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4517         proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4518         proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4519         curr_offset++;
4520
4521         remaining_length = len-2;
4522         break;
4523     case 2:
4524         /* Adaptive Multirate speech version 2 */
4525         proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v2_b5, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4526         proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v2_b4, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4527         proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v2_b3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4528         proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v2_b2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4529         proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v2_b1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4530         curr_offset++;
4531
4532         remaining_length = len-2;
4533         break;
4534     default:
4535         expert_add_info(pinfo, ver_item, &ei_gsm_a_rr_unknown_version);
4536         proto_tree_add_expert_format(tree, pinfo, &ei_gsm_a_rr_data_not_dissected, tvb, curr_offset, len-1, "Data (Not decoded)");
4537         remaining_length = 0;
4538         break;
4539     }
4540
4541     if (remaining_length)
4542     {
4543         bit_offset = (curr_offset<<3) + 2;
4544         nb_of_params = remaining_length - 1;
4545         while (nb_of_params)
4546         {
4547             proto_tree_add_bits_item(tree, hf_gsm_a_rr_amr_threshold, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
4548             bit_offset += 6;
4549             proto_tree_add_bits_item(tree, hf_gsm_a_rr_amr_hysteresis, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4550             bit_offset += 4;
4551             nb_of_params -= 1;
4552         }
4553     }
4554
4555     curr_offset = offset + len;
4556     return(curr_offset - offset);
4557
4558 }
4559 /*
4560  * [3] 10.5.2.21b Multislot Allocation
4561  */
4562 static guint16
4563 de_rr_mult_all(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4564 {
4565     proto_item *item;
4566     guint32     curr_offset;
4567     guint8      oct;
4568     guint8      i;
4569
4570     curr_offset = offset;
4571
4572     oct = tvb_get_guint8(tvb, curr_offset);
4573     item = proto_tree_add_uint_format(tree, hf_gsm_a_rr_da_list, tvb, curr_offset, 1, oct, "List of DA:");
4574
4575     curr_offset++;
4576     for( i=0;i<7;i++ )
4577     {
4578         if( (oct>>i) & 1 )
4579         {
4580             proto_item_append_text(item," DA%d",i+1);
4581         }
4582     }
4583
4584     if( oct & 0x80 )  /* octet 3a present */
4585     {
4586         oct = tvb_get_guint8(tvb, curr_offset);
4587         item = proto_tree_add_uint_format(tree, hf_gsm_a_rr_ua_list, tvb, curr_offset, 1, oct, "List of UA:");
4588         curr_offset++;
4589         for( i=0;i<7;i++ )
4590         {
4591             if( (oct>>i) & 1 )
4592             {
4593                 proto_item_append_text(item," UA%d",i+1);
4594             }
4595         }
4596     }
4597
4598     while ( curr_offset < offset + len )
4599     {
4600         proto_tree_add_item(tree, hf_gsm_a_rr_ma_channel_set, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4601         curr_offset++;
4602     }
4603
4604     return(curr_offset - offset);
4605
4606 }
4607 /*
4608  * [3] 10.5.2.21c NC mode
4609  */
4610
4611  /*
4612  * [3] 10.5.2.22 Neighbour Cell Description
4613  */
4614 static const value_string gsm_a_rr_ext_ind_vals[] = {
4615     { 0, "The information element carries the complete BA"},
4616     { 1, "The information element carries only a part of the BA"},
4617     { 0, NULL }
4618 };
4619 static guint16
4620 de_rr_neigh_cell_desc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4621 {
4622     guint32 curr_offset;
4623
4624     curr_offset = offset;
4625
4626     proto_tree_add_item(tree, hf_gsm_a_rr_ext_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4627     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ba_ind, tvb, (curr_offset<<3)+3, 1, ENC_BIG_ENDIAN);
4628
4629     return dissect_arfcn_list(tvb, tree, pinfo, offset, 16, add_string, string_len);
4630 }
4631
4632  /*
4633  * [3] 10.5.2.22a Neighbour Cell Description 2
4634  */
4635 static guint16
4636 de_rr_neigh_cell_desc2(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4637 {
4638     guint32 curr_offset;
4639
4640     curr_offset = offset;
4641
4642     proto_tree_add_bits_item(tree, hf_gsm_a_rr_multiband_reporting, tvb, (curr_offset<<3)+1, 2, ENC_BIG_ENDIAN);
4643     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ba_ind, tvb, (curr_offset<<3)+3, 1, ENC_BIG_ENDIAN);
4644
4645     return dissect_arfcn_list2(tvb, tree, pinfo, offset, 16, add_string, string_len);
4646 }
4647
4648 /*
4649  * [3] 10.5.2.22b (void)
4650  * [3] 10.5.2.22c NT/N Rest Octets
4651  */
4652
4653 /*
4654  * [3] 10.5.2.23 P1 Rest Octets
4655  */
4656 static guint16
4657 de_rr_p1_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4658 {
4659     proto_item *item2;
4660     guint32     curr_offset, value;
4661     gint        bit_offset, bit_offset_sav;
4662     guint8      tvb_len = tvb_reported_length(tvb);
4663     guint16     bit_len = tvb_len << 3;
4664
4665     curr_offset = offset;
4666     bit_offset = curr_offset << 3;
4667
4668     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_rr_nln_pch_present))
4669     {
4670         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nln_pch, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
4671         bit_offset += 2;
4672         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nln_status_pch, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4673         bit_offset += 1;
4674     }
4675     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_call_prio1))
4676     {
4677         item2 = proto_tree_add_bits_item(subtree, hf_gsm_a_call_prio, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4678         bit_offset += 3;
4679         proto_item_append_text(item2, " for Mobile Identity 1");
4680     }
4681     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_call_prio2))
4682     {
4683         item2 = proto_tree_add_bits_item(subtree, hf_gsm_a_call_prio, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4684         bit_offset += 3;
4685         proto_item_append_text(item2, " for Mobile Identity 2");
4686     }
4687     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_rr_group_call_information))
4688     { /* Group Call Information */
4689         bit_offset_sav = bit_offset;
4690         bit_offset += 36;
4691         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_group_channel_description))
4692         { /* Group Channel Description */
4693             bit_offset += 24;
4694             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_hopping_case))
4695             { /* Hopping case */
4696                 if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_hopping_flag))
4697                 {
4698                     bit_offset += 64;
4699                 }
4700                 else
4701                 {
4702                     value = tvb_get_bits8(tvb,bit_offset,8);
4703                     bit_offset += 8 + (value<<3);
4704                 }
4705             }
4706         }
4707         proto_tree_add_expert_format(subtree, pinfo, &ei_gsm_a_rr_data_not_dissected, tvb, bit_offset_sav>>3, (bit_offset-bit_offset_sav)>>3,
4708                     "Group Call Information: Data(Not decoded)");
4709     }
4710     gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_rr_packet_page_indication_1);
4711     gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_rr_packet_page_indication_2);
4712
4713     /* Truncation allowed (see 44.018 section 8.9) */
4714
4715     gsm_rr_csn_padding_bits(subtree, tvb, bit_offset, tvb_len);
4716     return tvb_len - offset;
4717 }
4718
4719 /*
4720  * [3] 10.5.2.24 P2 Rest Octets
4721  */
4722 static guint16
4723 de_rr_p2_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4724
4725 {
4726     proto_item *item2;
4727     guint32     curr_offset;
4728     gint        bit_offset;
4729     guint8      tvb_len = tvb_reported_length(tvb);
4730     guint16     bit_len = tvb_len << 3;
4731
4732     curr_offset = offset;
4733     bit_offset = curr_offset << 3;
4734
4735     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_rr_chnl_needed_ch3_present))
4736     {
4737         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_chnl_needed_ch3, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
4738         bit_offset += 2;
4739     }
4740     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len ,bit_offset++, hf_gsm_a_rr_nln_pch_present))
4741     {
4742         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nln_pch, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
4743         bit_offset += 2;
4744         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nln_status_pch, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4745         bit_offset += 1;
4746     }
4747     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_call_prio1))
4748     {
4749        item2 = proto_tree_add_bits_item(subtree, hf_gsm_a_call_prio, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4750        bit_offset += 3;
4751        proto_item_append_text(item2, " for Mobile Identity 1");
4752     }
4753     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_call_prio2))
4754     {
4755         item2 = proto_tree_add_bits_item(subtree, hf_gsm_a_call_prio, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4756         bit_offset += 3;
4757         proto_item_append_text(item2, " for Mobile Identity 2");
4758     }
4759     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_call_prio3))
4760     {
4761         item2 = proto_tree_add_bits_item(subtree, hf_gsm_a_call_prio, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4762         bit_offset += 3;
4763         proto_item_append_text(item2, " for Mobile Identity 3");
4764     }
4765     gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_rr_packet_paging_procedure_1);
4766     gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_rr_packet_paging_procedure_2);
4767     gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_rr_packet_paging_procedure_3);
4768
4769
4770     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_rr_additions_in_release_6_present))
4771     { /* Additions in release 6 */
4772         bit_offset += 1;
4773         proto_tree_add_expert_format(subtree, pinfo, &ei_gsm_a_rr_data_not_dissected, tvb, bit_offset>>3, -1, "Additions in Release 6: Data (Not decoded)");
4774     }
4775
4776     /* Truncation allowed (see 44.018 section 8.9 */
4777     gsm_rr_csn_padding_bits(subtree, tvb, bit_offset, tvb_len);
4778     return tvb_len - offset;
4779 }
4780
4781 /*
4782  * [3] 10.5.2.25 P3 Rest Octets
4783  */
4784 static guint16
4785 de_rr_p3_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4786 {
4787     proto_item *item2;
4788     guint32     curr_offset;
4789     gint        bit_offset;
4790     guint8      tvb_len = tvb_reported_length(tvb);
4791     guint16     bit_len = tvb_len << 3;
4792
4793     curr_offset = offset;
4794     bit_offset = curr_offset << 3;
4795
4796     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_rr_chnl_needed_ch3and4))
4797     {
4798         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_chnl_needed_ch3, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
4799         bit_offset += 2;
4800         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_chnl_needed_ch4, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
4801         bit_offset += 2;
4802     }
4803     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_rr_nln_pch_present))
4804     {
4805         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nln_pch, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
4806         bit_offset += 2;
4807         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nln_status_pch, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4808         bit_offset += 1;
4809     }
4810     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_call_prio1))
4811     {
4812         item2 = proto_tree_add_bits_item(subtree, hf_gsm_a_call_prio, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4813         bit_offset += 3;
4814         proto_item_append_text(item2, " for Mobile Identity 1");
4815     }
4816     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_call_prio2))
4817     {
4818         item2 = proto_tree_add_bits_item(subtree, hf_gsm_a_call_prio, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4819         bit_offset += 3;
4820         proto_item_append_text(item2, " for Mobile Identity 2");
4821     }
4822     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_call_prio3))
4823     {
4824         item2 = proto_tree_add_bits_item(subtree, hf_gsm_a_call_prio, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4825         bit_offset += 3;
4826         proto_item_append_text(item2, " for Mobile Identity 3");
4827     }
4828     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_call_prio4))
4829     {
4830         item2 = proto_tree_add_bits_item(subtree, hf_gsm_a_call_prio, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4831         bit_offset += 3;
4832         proto_item_append_text(item2, " for Mobile Identity 4");
4833     }
4834
4835     /* Truncation allowed (see 44.018 section 8.9 */
4836     gsm_rr_csn_padding_bits(subtree, tvb, bit_offset, tvb_len);
4837     return tvb_len - offset;
4838 }
4839
4840 /*
4841  * [3] 10.5.2.25a Packet Channel Description C V 3
4842  */
4843 static guint16
4844 de_rr_packet_ch_desc(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4845 {
4846     guint32      curr_offset = offset;
4847     guint8       oct8, second_oct8;
4848
4849     /* Octet 2 */
4850     /* Channel Type */
4851     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_packet_channel_type, tvb, (curr_offset<<3), 5, ENC_NA);
4852     /* TN */
4853     proto_tree_add_item(subtree, hf_gsm_a_rr_timeslot, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4854
4855     curr_offset +=1;
4856
4857     /* Octet 3 */
4858     oct8 = tvb_get_guint8(tvb, curr_offset);
4859     proto_tree_add_item(subtree, hf_gsm_a_rr_training_sequence, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4860     if ((oct8 & 0x10) == 0x10)
4861     {
4862         /* Hopping sequence */
4863         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_hopping_channel_maio, tvb, (curr_offset<<3)+4, 6, ENC_NA);
4864         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_hsn, tvb, (curr_offset<<3)+10, 6, ENC_NA);
4865
4866         curr_offset = curr_offset + 2;
4867     }
4868     else
4869     {
4870         if ((oct8 & 0x08) == 0x08)
4871         {
4872             second_oct8 = tvb_get_guint8(tvb, curr_offset+1);
4873
4874             /* indirect encoding of hopping RF channel configuration */
4875             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_spare, tvb, (curr_offset<<3)+5, 1, ENC_NA);
4876             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_hopping_channel_maio, tvb, (curr_offset<<3)+6, 6, ENC_NA);
4877             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_hopping_channel_ma_num_ind, tvb, (curr_offset<<3)+12, 1, ENC_NA);
4878
4879             if( (second_oct8 & 0x04) == 0x04 )
4880             {
4881                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_hopping_channel_change_mark_1, tvb, (curr_offset<<3)+14, 2, ENC_NA);
4882             }
4883             else
4884             {
4885                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_spare, tvb, (curr_offset<<3)+14, 2, ENC_NA);
4886             }
4887             curr_offset = curr_offset + 2;
4888         }
4889         else
4890         {
4891             /* non-hopping RF channel configuraion */
4892             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_spare, tvb, (curr_offset<<3)+5, 1, ENC_NA);
4893             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_single_channel_arfcn, tvb, (curr_offset<<3)+6, 10, ENC_NA);
4894             curr_offset = curr_offset + 2;
4895         }
4896     }
4897
4898     return(curr_offset - offset);
4899
4900 }
4901 /*
4902  * [3] 10.5.2.25b Dedicated mode or TBF
4903  */
4904
4905 static const value_string gsm_a_rr_dedicated_mode_or_tbf_vals[] = {
4906     { 0, "This message assigns a dedicated mode resource"},
4907     { 1, "This message assigns an uplink TBF or is the second message of two in a two-message assignment of an uplink or downlink TBF"},
4908     { 2, "Not used"},
4909     { 3, "This message assigns a downlink TBF to the mobile station identified in the IA Rest Octets IE"},
4910     { 4, "Not used"},
4911     { 5, "This message is the first message of two in a two-message assignment of an uplink TBF"},
4912     { 6, "Not used"},
4913     { 7, "This message is the first message of two in a two-message assignment of a downlink TBF to the mobile station identified in the IA Rest Octets IE"},
4914     { 0, NULL }
4915 };
4916 static guint16
4917 de_rr_ded_mod_or_tbf(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4918 {
4919     guint32 curr_offset;
4920
4921     curr_offset = offset;
4922
4923     proto_tree_add_item(subtree, hf_gsm_a_rr_dedicated_mode_or_tbf, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4924
4925     curr_offset += 1;
4926
4927     return(curr_offset - offset);
4928 }
4929 /*
4930  * [3] 10.5.2.25c RR Packet Uplink Assignment
4931  */
4932 static guint16
4933 de_rr_pkt_ul_ass(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4934 {
4935     guint32 curr_offset = offset;
4936
4937     proto_tree_add_expert(subtree, pinfo, &ei_gsm_a_rr_data_not_dissected, tvb, curr_offset, len);
4938
4939     return len;
4940 }
4941
4942 /*
4943  * [3] 10.5.2.25d RR Packet Downlink Assignment
4944  */
4945 static guint16
4946 de_rr_pkt_dl_ass(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4947 {
4948     guint32 curr_offset = offset;
4949
4950     proto_tree_add_expert(subtree, pinfo, &ei_gsm_a_rr_data_not_dissected, tvb, curr_offset, len);
4951
4952     return len;
4953 }
4954
4955 /*
4956  * [3] 10.5.2.25e RR Packet Downlink Assignment Type 2
4957  */
4958 static guint16
4959 de_rr_pkt_dl_ass_type2(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4960 {
4961     guint32 curr_offset = offset;
4962
4963     proto_tree_add_expert(subtree, pinfo, &ei_gsm_a_rr_data_not_dissected, tvb, curr_offset, len);
4964
4965     return len;
4966 }
4967
4968 /*
4969  * [3] 10.5.2.26 Page Mode
4970  */
4971
4972 static const value_string gsm_a_rr_page_mode_vals[] = {
4973     { 0, "Normal paging"},
4974     { 1, "Extended paging"},
4975     { 2, "Paging reorganization"},
4976     { 3, "Same as before"},
4977     { 0, NULL }
4978 };
4979 static guint16
4980 de_rr_page_mode(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
4981 {
4982     guint32 curr_offset;
4983
4984     curr_offset = offset;
4985
4986     proto_tree_add_item(subtree, hf_gsm_a_rr_page_mode, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
4987
4988     curr_offset += 1;
4989
4990     return(curr_offset - offset);
4991 }
4992 /*
4993  * [3] 10.5.2.26a (void)
4994  * [3] 10.5.2.26b (void)
4995  * [3] 10.5.2.26c (void)
4996  * [3] 10.5.2.26d (void)
4997  */
4998 /*
4999  * [3] 10.5.2.27 NCC Permitted
5000  */
5001 static guint16
5002 de_rr_ncc_perm(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
5003 {
5004     guint32 curr_offset;
5005
5006     curr_offset = offset;
5007
5008     proto_tree_add_item(subtree, hf_gsm_a_rr_ncc_permitted, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5009
5010     curr_offset = curr_offset + 1;
5011
5012     return(curr_offset - offset);
5013 }
5014 /*
5015  * [3] 10.5.2.28 Power Command
5016  *
5017  *
5018  * ATC (Access Type Control) (octet 2)Bit 8
5019  * 0    Sending of Handover access is mandatory
5020  * 1    Sending of Handover access is optional
5021  */
5022 static const true_false_string gsm_a_rr_pow_cmd_atc_value  = {
5023     "Sending of Handover access is optional",
5024     "Sending of Handover access is mandatory"
5025 };
5026 /*
5027  *  The EPC mode field (octet 2) indicates whether the assigned channel(s)
5028  *  shall be in enhanced power control (EPC) mode. It is only valid for channels
5029  *  on which EPC may be used. It is coded as follows:
5030 */
5031 static const true_false_string gsm_a_rr_pow_cmd_epc_value  = {
5032     "Channel(s) in EPC mode",
5033     "Channel(s) not in EPC mode"
5034 };
5035 /*
5036  * FPC_EPC (octet 2)
5037  * The FPC_EPC field (octet 2) has different interpretation depending
5038  *              on the channel mode     of the assigned channel (s) and the value
5039  *              of the EPC mode field.
5040  * If the channel mode is such that fast power control (FPC) may be
5041  *              used, the FPC_EPC field indicates whether Fast Measurement
5042  *              Reporting and Power Control mechanism is used.
5043  *              It is coded as follows:
5044  * Value 0      FPC not in use
5045  *       1      FPC in use
5046  * If the channel mode is such that EPC may be used and the EPC mode
5047  *              field indicates that the channel is in EPC mode, the FPC_EPC
5048  *              field indicates whether EPC shall be used for uplink power control.
5049  * It is coded as follows:
5050  * Value 0      EPC not in use for uplink power control
5051  *       1      EPC in use for uplink power control
5052  *
5053  */
5054 static const true_false_string gsm_a_rr_pow_cmd_fpcepc_value  = {
5055     "FPC in use/EPC in use for uplink power control",
5056     "FPC not in use/C not in use for uplink power control"
5057 };
5058
5059 /*
5060  * Power level (octet 2)The power level field is coded as the binaryRepresentation
5061  * of the "power control level", see 3GPP TS 3GPP TS 45.005. This value shall be used
5062  * by the mobile station According to 3GPP TS 45.008.Range: 0 to 31.
5063  */
5064
5065 static guint16
5066 de_rr_pow_cmd(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
5067 {
5068     guint32 curr_offset;
5069
5070     curr_offset = offset;
5071
5072     proto_tree_add_item(subtree, hf_gsm_a_b8spare, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5073     /*EPC mode */
5074     proto_tree_add_item(subtree, hf_gsm_a_rr_pow_cmd_epc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5075     /*FPC_EPC*/
5076     proto_tree_add_item(subtree, hf_gsm_a_rr_pow_cmd_fpcepc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5077     /*POWER LEVEL*/
5078     proto_tree_add_item(subtree, hf_gsm_a_rr_pow_cmd_powlev, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5079
5080     curr_offset = curr_offset + 1;
5081
5082     return(curr_offset - offset);
5083 }
5084
5085 /*
5086  * [3] 10.5.2.28a Power Command and access type
5087  */
5088 static guint16
5089 de_rr_pow_cmd_and_acc_type(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
5090 {
5091     guint32 curr_offset;
5092
5093     curr_offset = offset;
5094
5095     /*ATC */
5096     proto_tree_add_item(subtree, hf_gsm_a_rr_pow_cmd_atc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5097     /*EPC mode */
5098     proto_tree_add_item(subtree, hf_gsm_a_rr_pow_cmd_epc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5099     /*FPC_EPC*/
5100     proto_tree_add_item(subtree, hf_gsm_a_rr_pow_cmd_fpcepc, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5101     /*POWER LEVEL*/
5102     proto_tree_add_item(subtree, hf_gsm_a_rr_pow_cmd_powlev, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5103
5104     curr_offset = curr_offset + 1;
5105
5106     return(curr_offset - offset);
5107 }
5108 /*
5109  * [3] 10.5.2.29 RACH Control Parameters
5110  */
5111
5112 static const value_string gsm_a_rr_max_retrans_vals[] = {
5113     {  0, "Maximum 1 retransmission"},
5114     {  1, "Maximum 2 retransmissions"},
5115     {  2, "Maximum 4 retransmissions"},
5116     {  3, "Maximum 7 retransmissions"},
5117     {  0, NULL }
5118 };
5119
5120 static const value_string gsm_a_rr_tx_integer_vals[] = {
5121     {  0, "3 slots used to spread transmission"},
5122     {  1, "4 slots used to spread transmission"},
5123     {  2, "5 slots used to spread transmission"},
5124     {  3, "6 slots used to spread transmission"},
5125     {  4, "7 slots used to spread transmission"},
5126     {  5, "8 slots used to spread transmission"},
5127     {  6, "9 slots used to spread transmission"},
5128     {  7, "10 slots used to spread transmission"},
5129     {  8, "11 slots used to spread transmission"},
5130     {  9, "12 slots used to spread transmission"},
5131     { 10, "14 slots used to spread transmission"},
5132     { 11, "16 slots used to spread transmission"},
5133     { 12, "20 slots used to spread transmission"},
5134     { 13, "25 slots used to spread transmission"},
5135     { 14, "32 slots used to spread transmission"},
5136     { 15, "50 slots used to spread transmission"},
5137     {  0, NULL }
5138 };
5139 static const value_string gsm_a_rr_cell_barr_access_vals[] = {
5140     {  0, "The cell is not barred"},
5141     {  1, "The cell is barred"},
5142     {  0, NULL }
5143 };
5144 static const value_string gsm_a_rr_re_vals[] = {
5145     {  0, "Call Reestablishment allowed in the cell"},
5146     {  1, "Call Reestablishment not allowed in the cell"},
5147     {  0, NULL }
5148 };
5149
5150 static guint16
5151 de_rr_rach_ctrl_param(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
5152 {
5153     guint32 curr_offset;
5154
5155     curr_offset = offset;
5156
5157     proto_tree_add_item(subtree, hf_gsm_a_rr_max_retrans, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5158     proto_tree_add_item(subtree, hf_gsm_a_rr_tx_integer, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5159     proto_tree_add_item(subtree, hf_gsm_a_rr_cell_barr_access, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5160     proto_tree_add_item(subtree, hf_gsm_a_rr_re, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5161     curr_offset = curr_offset + 1;
5162
5163     proto_tree_add_item(subtree, hf_gsm_a_rr_acc, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
5164
5165     curr_offset = curr_offset + 2;
5166
5167     return(curr_offset - offset);
5168 }
5169 /*
5170  * [3] 10.5.2.30 Request Reference M V 3
5171  */
5172 static guint16 reduced_frame_number(guint16 fn)
5173 {
5174     /* great care needed with signed/unsigned - -1 in unsigned is 0xffff, which mod(26) is not what you think !!! */
5175     gint16  t2, t3, t;
5176     guint16 frame, t1;
5177
5178     t1 = (fn >> 11) & 0x1f;
5179     t2 = (fn >> 0) & 0x1f;
5180     t3 = (fn >> 5) & 0x3f;
5181
5182     t = (t3-t2)%26;
5183     if (t<0)
5184         t += 26;
5185
5186     frame = 51*(unsigned)t+(unsigned)t3+51*26*t1;
5187
5188     return frame;
5189 }
5190
5191 static guint16
5192 de_rr_req_ref(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
5193 {
5194     proto_item *item;
5195     guint32     curr_offset;
5196     guint16     rfn;
5197     guint16     fn;
5198
5199     curr_offset = offset;
5200
5201     proto_tree_add_item(subtree, hf_gsm_a_rr_ra, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5202     curr_offset++;
5203     fn = tvb_get_ntohs(tvb,curr_offset);
5204     rfn = reduced_frame_number(fn);
5205     proto_tree_add_item(subtree, hf_gsm_a_rr_T1prim, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5206     proto_tree_add_item(subtree, hf_gsm_a_rr_T3, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
5207     curr_offset++;
5208     proto_tree_add_item(subtree, hf_gsm_a_rr_T2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5209     curr_offset++;
5210     item = proto_tree_add_uint(subtree, hf_gsm_a_rr_rfn, tvb, curr_offset-2, 2, rfn);
5211     PROTO_ITEM_SET_GENERATED(item);
5212
5213     return(curr_offset - offset);
5214 }
5215 /*
5216  * [3] 10.5.2.31
5217  */
5218 guint16
5219 de_rr_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
5220 {
5221     guint32 curr_offset;
5222
5223     curr_offset = offset;
5224
5225     proto_tree_add_item(tree, hf_gsm_a_rr_RR_cause, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
5226
5227     curr_offset++;
5228
5229     return(curr_offset - offset);
5230 }
5231
5232 /*
5233  * [3] 10.5.2.32 SI 1 Rest Octets
5234  */
5235 static const value_string gsm_a_rr_nch_position_vals[] = {
5236     { 0, "No of blocks = 1 and Number of first block = 0"},
5237     { 1, "No of blocks = 1 and Number of first block = 1"},
5238     { 2, "No of blocks = 1 and Number of first block = 2"},
5239     { 3, "No of blocks = 1 and Number of first block = 3"},
5240     { 4, "No of blocks = 1 and Number of first block = 4"},
5241     { 5, "No of blocks = 1 and Number of first block = 5"},
5242     { 6, "No of blocks = 1 and Number of first block = 6"},
5243     { 7, "No of blocks = 1 and Number of first block = 0"},
5244     { 8, "No of blocks = 2 and Number of first block = 1"},
5245     { 9, "No of blocks = 2 and Number of first block = 2"},
5246     {10, "No of blocks = 2 and Number of first block = 3"},
5247     {11, "No of blocks = 2 and Number of first block = 4"},
5248     {12, "No of blocks = 2 and Number of first block = 5"},
5249     {13, "No of blocks = 3 and Number of first block = 0"},
5250     {14, "No of blocks = 3 and Number of first block = 1"},
5251     {15, "No of blocks = 3 and Number of first block = 2"},
5252     {16, "No of blocks = 3 and Number of first block = 3"},
5253     {17, "No of blocks = 3 and Number of first block = 4"},
5254     {18, "No of blocks = 4 and Number of first block = 0"},
5255     {19, "No of blocks = 4 and Number of first block = 1"},
5256     {20, "No of blocks = 4 and Number of first block = 2"},
5257     {21, "No of blocks = 4 and Number of first block = 3"},
5258     {22, "No of blocks = 5 and Number of first block = 0"},
5259     {23, "No of blocks = 5 and Number of first block = 1"},
5260     {24, "No of blocks = 5 and Number of first block = 2"},
5261     {25, "No of blocks = 6 and Number of first block = 0"},
5262     {26, "No of blocks = 6 and Number of first block = 1"},
5263     {27, "No of blocks = 7 and Number of first block = 0"},
5264     {28, "Reserved"},
5265     {29, "Reserved"},
5266     {30, "Reserved"},
5267     {31, "Reserved"},
5268     { 0, NULL }
5269 };
5270
5271 static guint16
5272 de_rr_si1_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
5273 {
5274     guint32 curr_offset;
5275     gint    bit_offset;
5276     guint8  tvb_len = tvb_reported_length(tvb);
5277
5278     curr_offset = offset;
5279     bit_offset = curr_offset << 3;
5280
5281     if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_nch_position_present))
5282     {
5283         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nch_position, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
5284         bit_offset += 5;
5285     }
5286     gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_band_indicator);
5287
5288     gsm_rr_csn_padding_bits(subtree, tvb, bit_offset, tvb_len);
5289     return tvb_len - offset;
5290 }
5291
5292 /*
5293  * [3] 10.5.2.33 SI 2bis Rest Octets
5294  */
5295
5296 /*
5297  * [3] 10.5.2.33a SI 2ter Rest Octets
5298  */
5299 static const value_string gsm_a_rr_qsearch_x_vals[] = {
5300     { 0, "-98 dBm"},
5301     { 1, "-94 dBm"},
5302     { 2, "-90 dBm"},
5303     { 3, "-86 dBm"},
5304     { 4, "-82 dBm"},
5305     { 5, "-78 dBm"},
5306     { 6, "-74 dBm"},
5307     { 7, "Always"},
5308     { 8, "-78 dBm"},
5309     { 9, "-74 dBm"},
5310     {10, "-70 dBm"},
5311     {11, "-66 dBm"},
5312     {12, "-62 dBm"},
5313     {13, "-58 dBm"},
5314     {14, "-54 dBm"},
5315     {15, "Never"},
5316     { 0, NULL }
5317 };
5318
5319 static const value_string gsm_a_rr_xdd_qoffset_vals[] = {
5320     { 0, "always select a cell if acceptable"},
5321     { 1, "-28 dB"},
5322     { 2, "-24 dB"},
5323     { 3, "-20 dB"},
5324     { 4, "-16 dB"},
5325     { 5, "-12 dB"},
5326     { 6, "-8 dB"},
5327     { 7, "-4 dB"},
5328     { 8, "0 dB"},
5329     { 9, "4 dB"},
5330     {10, "8 dB"},
5331     {11, "12 dB"},
5332     {12, "16 dB"},
5333     {13, "20 dB"},
5334     {14, "24 dB"},
5335     {15, "28 dB"},
5336     { 0, NULL }
5337 };
5338
5339 static const value_string gsm_a_rr_fdd_qmin_vals[] = {
5340     { 0, "-20 dB"},
5341     { 1, "-6 dB"},
5342     { 2, "-18 dB"},
5343     { 3, "-8 dB"},
5344     { 4, "-16 dB"},
5345     { 5, "-10 dB"},
5346     { 6, "-14 dB"},
5347     { 7, "-12 dB"},
5348     { 0, NULL }
5349 };
5350
5351 static const value_string gsm_a_rr_fdd_qmin_offset_vals[] = {
5352     { 0, "0 dB"},
5353     { 1, "2 dB"},
5354     { 2, "4 dB"},
5355     { 3, "6 dB"},
5356     { 4, "8 dB"},
5357     { 5, "10 dB"},
5358     { 6, "12 dB"},
5359     { 7, "14 dB"},
5360     { 0, NULL }
5361 };
5362
5363 static const value_string gsm_a_rr_fdd_rscpmin_vals[] = {
5364     { 0, "-114 dBm"},
5365     { 1, "-112 dBm"},
5366     { 2, "-110 dBm"},
5367     { 3, "-108 dBm"},
5368     { 4, "-106 dBm"},
5369     { 5, "-104 dBm"},
5370     { 6, "-102 dBm"},
5371     { 7, "-100 dBm"},
5372     { 8, "-98 dBm"},
5373     { 9, "-96 dBm"},
5374     {10, "-94 dBm"},
5375     {11, "-92 dBm"},
5376     {12, "-90 dBm"},
5377     {13, "-88 dBm"},
5378     {14, "-86 dBm"},
5379     {15, "-84 dBm"},
5380     { 0, NULL }
5381 };
5382
5383 static guint16
5384 de_rr_si2ter_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
5385 {
5386     proto_tree *subtree2;
5387     proto_item *item2;
5388     guint32     curr_offset;
5389     gint        bit_offset, bit_offset_sav;
5390     guint8      tvb_len = tvb_reported_length(tvb);
5391     guint16     bit_len = tvb_len << 3;
5392
5393     curr_offset = offset;
5394     bit_offset = curr_offset<<3;
5395
5396     if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_si2ter_mp_change_mark_present))
5397     {
5398         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2ter_mp_change_mark, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
5399         bit_offset += 1;
5400         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2ter_3g_change_mark, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
5401         bit_offset += 1;
5402         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2ter_index, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
5403         bit_offset += 3;
5404         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2ter_count, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
5405         bit_offset += 3;
5406         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_utran_fdd_description))
5407         { /* UTRAN FDD Description */
5408             bit_offset_sav = bit_offset;
5409             subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_UTRAN_FDD_DESC], &item2,
5410                                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_FDD_DESC].strptr);
5411             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_utran_fdd_description_earlier_version_bit_reserved1, tvb, bit_offset++, 1, ENC_NA);
5412             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_utran_fdd_description_earlier_version_bit_reserved2, tvb, bit_offset++, 1, ENC_NA);
5413             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_uarfcn, tvb, bit_offset, 14, ENC_BIG_ENDIAN);
5414             bit_offset += 14;
5415             if (gsm_rr_csn_flag(tvb, subtree2, bit_offset++, hf_gsm_a_rr_bandwidth_fdd_present))
5416             {
5417                 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_bandwidth_fdd, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
5418                 bit_offset += 3;
5419             }
5420             proto_item_set_len(item2,(bit_offset>>3) - (bit_offset_sav>>3)+1);
5421         }
5422         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_utran_tdd_description))
5423         { /* UTRAN TDD Description */
5424             bit_offset_sav = bit_offset;
5425             subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_UTRAN_TDD_DESC], &item2,
5426                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_TDD_DESC].strptr);
5427             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_utran_tdd_description_earlier_version_bit_reserved1, tvb, bit_offset++, 1, ENC_NA);
5428             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_utran_tdd_description_earlier_version_bit_reserved2, tvb, bit_offset++, 1, ENC_NA);
5429             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_tdd_uarfcn, tvb, bit_offset, 14, ENC_BIG_ENDIAN);
5430             bit_offset += 14;
5431             if (gsm_rr_csn_flag(tvb, subtree2, bit_offset++, hf_gsm_a_rr_bandwidth_tdd_present))
5432             {
5433                 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_bandwidth_tdd, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
5434                 bit_offset += 3;
5435             }
5436             proto_item_set_len(item2,(bit_offset>>3) - (bit_offset_sav>>3)+1);
5437         }
5438         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_3g_measurement_parameters_description))
5439         { /* 3G Measurement Parameters Description */
5440             bit_offset_sav = bit_offset;
5441             subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_MEAS_PARAM_DESC], &item2,
5442                                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_MEAS_PARAM_DESC].strptr);
5443             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_qsearch_i, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
5444             bit_offset += 4;
5445             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_fdd_parameters))
5446             {
5447                 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_qoffset, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
5448                 bit_offset += 4;
5449                 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_qmin, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
5450                 bit_offset += 3;
5451             }
5452             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_tdd_parameters))
5453             {
5454                 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_tdd_qoffset, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
5455                 bit_offset += 4;
5456             }
5457             proto_item_set_len(item2,(bit_offset>>3) - (bit_offset_sav>>3)+1);
5458         }
5459         /* Null breakpoint */
5460         if (bit_len - bit_offset > 0)
5461         {
5462             /* There is still room left in the Rest Octets IE */
5463             if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_5))
5464             { /* Additions in release R5 */
5465                 if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_3g_additional_measurement_parameters_description))
5466                 { /* 3G Additional Measurement Parameters Description */
5467                     bit_offset_sav = bit_offset;
5468                     subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC], &item2,
5469                                                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC].strptr);
5470                     proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_qmin_offset, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
5471                     bit_offset += 3;
5472                     proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_rscpmin, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
5473                     bit_offset += 4;
5474                     proto_item_set_len(item2,(bit_offset>>3) - (bit_offset_sav>>3)+1);
5475                 }
5476             }
5477         }
5478     }
5479     gsm_rr_csn_padding_bits(subtree, tvb, bit_offset, tvb_len);
5480     return tvb_len - offset;
5481 }
5482
5483 /*
5484  * [3] 10.5.2.33b SI 2quater Rest Octets
5485  */
5486 static const true_false_string gsm_a_rr_gsm_report_type_value = {
5487     "The MS shall use the Measurement Report message for reporting",
5488     "The MS shall use the Enhanced Measurement Report message for reporting if at least one BSIC is allocated to each BA (list) frequency. Otherwise, the Measurement Report message shall be used"
5489 };
5490
5491 static const true_false_string gsm_a_rr_frequency_scrolling_value = {
5492     "Next BSIC in the structure relates to the subsequent frequency in the BA(list)",
5493     "Next BSIC in the structure relates to the same frequency in the BA(list)"
5494 };
5495
5496 static const true_false_string gsm_a_rr_rep_priority_value = {
5497     "High reporting priority",
5498     "Normal reporting priority"
5499 };
5500
5501 static const true_false_string gsm_a_rr_report_type_value = {
5502     "The MS shall use the PACKET MEASUREMENT REPORT message for reporting",
5503     "The MS shall use the PACKET ENHANCED MEASUREMENT REPORT message for reporting"
5504 };
5505
5506 static const true_false_string gsm_a_rr_reporting_rate_value = {
5507     "Reduced reporting rate allowed",
5508     "Normal reporting rate"
5509 };
5510
5511 static const true_false_string gsm_a_rr_invalid_bsic_reporting_value = {
5512     "Report on cells with invalid BSIC and allowed NCC part of BSIC is allowed",
5513     "Report on cells with invalid BSIC and allowed NCC part of BSIC is not allowed"
5514 };
5515
5516 static const value_string gsm_a_rr_scale_ord_vals[] = {
5517     { 0, "An offset of 0 dB shall be used for the reported RXLEV values"},
5518     { 1, "An offset of 10 dB shall be used for the reported RXLEV values"},
5519     { 2, "An automatic offset shall be used for the reported RXLEV values"},
5520     { 0, NULL }
5521 };
5522
5523 static const value_string gsm_a_rr_xxx_reporting_offset_vals[] = {
5524     { 0, "Apply an offset of 0 dB to the reported value when prioritising the cells for reporting"},
5525     { 1, "Apply an offset of 6 dB to the reported value when prioritising the cells for reporting"},
5526     { 2, "Apply an offset of 12 dB to the reported value when prioritising the cells for reporting"},
5527     { 3, "Apply an offset of 18 dB to the reported value when prioritising the cells for reporting"},
5528     { 4, "Apply an offset of 24 dB to the reported value when prioritising the cells for reporting"},
5529     { 5, "Apply an offset of 30 dB to the reported value when prioritising the cells for reporting"},
5530     { 6, "Apply an offset of 36 dB to the reported value when prioritising the cells for reporting"},
5531     { 7, "Apply an offset of 42 dB to the reported value when prioritising the cells for reporting"},
5532     { 0, NULL }
5533 };
5534
5535 /* The TS 45.008 is not that clear, but it should be understood: threshold = minimum reported value + 6 * resolution
5536  * The minimum reported value, resolution is, for the different access technologies:
5537  *  GSM:        -111 dBm, 1 dBm
5538  *  WCDMA/RSCP: -116 dBm, 1 dBm
5539  *  WCDMA/EcN0: -24.5 dB, 0.5 dB
5540  *  LTE/RSRP:   -140 dBm, 1 dB
5541  *  LTE/RSRQ:   -19.5 dB, 0.5 dB
5542  */
5543 static const value_string gsm_a_rr_gsm_reporting_threshold_vals[] = {
5544     { 0, "Apply priority reporting if the reported value is above -111 dBm"},
5545     { 1, "Apply priority reporting if the reported value is above -105 dBm"},
5546     { 2, "Apply priority reporting if the reported value is above -99 dBm"},
5547     { 3, "Apply priority reporting if the reported value is above -93 dBm"},
5548     { 4, "Apply priority reporting if the reported value is above -87 dBm"},
5549     { 5, "Apply priority reporting if the reported value is above -81 dBm"},
5550     { 6, "Apply priority reporting if the reported value is above -75 dBm"},
5551     { 7, "Never apply priority reporting"},
5552     { 0, NULL }
5553 };
5554
5555 static const value_string gsm_a_rr_wcdma_rscp_reporting_threshold_vals[] = {
5556     { 0, "Apply priority reporting if the reported value is above -116 dBm"},
5557     { 1, "Apply priority reporting if the reported value is above -110 dBm"},
5558     { 2, "Apply priority reporting if the reported value is above -104 dBm"},
5559     { 3, "Apply priority reporting if the reported value is above -98 dBm"},
5560     { 4, "Apply priority reporting if the reported value is above -92 dBm"},
5561     { 5, "Apply priority reporting if the reported value is above -86 dBm"},
5562     { 6, "Apply priority reporting if the reported value is above -80 dBm"},
5563     { 7, "Never apply priority reporting"},
5564     { 0, NULL }
5565 };
5566
5567 static const value_string gsm_a_rr_wcdma_ecn0_reporting_threshold_vals[] = {
5568     { 0, "Apply priority reporting if the reported value is above -24.5 dB"},
5569     { 1, "Apply priority reporting if the reported value is above -21.5 dB"},
5570     { 2, "Apply priority reporting if the reported value is above -17.5 dB"},
5571     { 3, "Apply priority reporting if the reported value is above -14.5 dB"},
5572     { 4, "Apply priority reporting if the reported value is above -11.5 dB"},
5573     { 5, "Apply priority reporting if the reported value is above -8.5 dB"},
5574     { 6, "Apply priority reporting if the reported value is above -5.5 dB"},
5575     { 7, "Never apply priority reporting"},
5576     { 0, NULL }
5577 };
5578
5579 static const value_string gsm_a_rr_lte_rsrp_reporting_threshold_vals[] = {
5580     { 0, "Apply priority reporting if the reported value is above -140 dBm"},
5581     { 1, "Apply priority reporting if the reported value is above -134 dBm"},
5582     { 2, "Apply priority reporting if the reported value is above -128 dBm"},
5583     { 3, "Apply priority reporting if the reported value is above -122 dBm"},
5584     { 4, "Apply priority reporting if the reported value is above -116 dBm"},
5585     { 5, "Apply priority reporting if the reported value is above -110 dBm"},
5586     { 6, "Apply priority reporting if the reported value is above -104 dBm"},
5587     { 7, "Never apply priority reporting"},
5588     { 0, NULL }
5589 };
5590
5591 static const value_string gsm_a_rr_lte_rsrq_reporting_threshold_vals[] = {
5592     { 0, "Apply priority reporting if the reported value is above -19.5 dB"},
5593     { 1, "Apply priority reporting if the reported value is above -16.5 dB"},
5594     { 2, "Apply priority reporting if the reported value is above -13.5 dB"},
5595     { 3, "Apply priority reporting if the reported value is above -10.5 dB"},
5596     { 4, "Apply priority reporting if the reported value is above -7.5 dB"},
5597     { 5, "Apply priority reporting if the reported value is above -4.5 dB"},
5598     { 6, "Apply priority reporting if the reported value is above -1.5 dB"},
5599     { 7, "Never apply priority reporting"},
5600     { 0, NULL }
5601 };
5602
5603 static const value_string gsm_a_rr_network_control_order_vals[] = {
5604     { 0, "NC0"},
5605     { 1, "NC1"},
5606     { 2, "NC2"},
5607     { 3, "NC0"},
5608     { 0, NULL }
5609 };
5610
5611 static const value_string gsm_a_rr_nc_non_drx_period_vals[] = {
5612     { 0, "No non-DRX mode after a measurement report has been sent"},
5613     { 1, "0,24 s"},
5614     { 2, "0,48 s"},
5615     { 3, "0.72 s"},
5616     { 4, "0.96 s"},
5617     { 5, "1.20 s"},
5618     { 6, "1.44 s"},
5619     { 7, "1.92 s"},
5620     { 0, NULL }
5621 };
5622
5623 static const value_string gsm_a_rr_nc_reporting_period_x_vals[] = {
5624     { 0, "0.48 s"},
5625     { 1, "0.96 s"},
5626     { 2, "1.92 s"},
5627     { 3, "3.84 s"},
5628     { 4, "7.68 s"},
5629     { 5, "15.36 s"},
5630     { 6, "30.72 s"},
5631     { 7, "61.44 s"},
5632     { 0, NULL }
5633 };
5634
5635 static const true_false_string gsm_a_rr_qsearch_c_initial_value = {
5636     "Always",
5637     "use Qsearch I"
5638 };
5639
5640 static const true_false_string gsm_a_rr_fdd_rep_quant_value = {
5641     "Ec/No",
5642     "RSCP"
5643 };
5644
5645 static const true_false_string gsm_a_rr_3g_search_prio_value = {
5646     "3G cells may be searched when BSIC decoding is required",
5647     "3G cells may not be searched when BSIC decoding is required"
5648 };
5649
5650 static const true_false_string gsm_a_rr_3g_ccn_active_value = {
5651     "CCN towards 3G cells is enabled in the cell",
5652     "CCN towards 3G cells is disabled in the cell"
5653 };
5654
5655 static gint
5656 de_rr_si2quater_meas_info_utran_fdd_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
5657 {
5658     proto_tree *subtree, *subtree2;
5659     proto_item *item, *item2;
5660     gint        curr_bit_offset, idx;
5661     gint        xdd_cell_info, wsize, nwi, jwi, w[64], i, iused, xdd_indic0;
5662
5663     curr_bit_offset = bit_offset;
5664
5665     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_UTRAN_FDD_DESC], &item,
5666                             gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_FDD_DESC].strptr);
5667     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_bandwidth_fdd_present))
5668     {
5669         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bandwidth_fdd, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
5670         curr_bit_offset += 3;
5671     }
5672     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_umts_fdd_neighbour_cells))
5673     {
5674         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_repeated_umts_fdd_neighbour_cells_earlier_version_bit_reserved, tvb, curr_bit_offset++, 1, ENC_NA);
5675         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_fdd_uarfcn, tvb, curr_bit_offset, 14, ENC_BIG_ENDIAN);
5676         curr_bit_offset += 14;
5677         xdd_indic0 = gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_fdd_cell_info_param_value0);
5678         idx = tvb_get_bits8(tvb,curr_bit_offset,5);
5679         proto_tree_add_uint(subtree, hf_gsm_a_rr_nr_of_fdd_cells, tvb, curr_bit_offset>>3, 1, idx);
5680         curr_bit_offset += 5;
5681         idx = convert_n_to_p[idx];
5682         subtree2 = proto_tree_add_subtree(subtree,tvb, curr_bit_offset>>3, (idx>>3)+1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_FDD_CELL_INFORMATION_FIELD], &item2,
5683                                             gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_FDD_DESC].strptr);
5684         proto_tree_add_bytes_format(subtree2, hf_gsm_a_rr_field_bit_long, tvb, curr_bit_offset>>3, (idx>>3)+1, NULL, "Field is %d bits long", idx);
5685         if (xdd_indic0)
5686         {
5687             proto_tree_add_uint(subtree2, hf_gsm_a_rr_scrambling_code, tvb, curr_bit_offset>>3, 0, 0);
5688             proto_tree_add_uint(subtree2, hf_gsm_a_rr_diversity, tvb, curr_bit_offset>>3, 0, 0);
5689         }
5690         if (idx)
5691         {
5692             wsize = 10;
5693             nwi = 1;
5694             jwi = 0;
5695             i = 1;
5696
5697             while (idx > 0)
5698             {
5699                 w[i] = tvb_get_bits(tvb, curr_bit_offset, wsize, ENC_BIG_ENDIAN);
5700                 curr_bit_offset += wsize;
5701                 idx -= wsize;
5702                 if (w[i] == 0)
5703                 {
5704                     idx = 0;
5705                     break;
5706                 }
5707                 if (++jwi == nwi)
5708                 {
5709                     jwi = 0;
5710                     nwi <<= 1;
5711                     wsize--;
5712                 }
5713                 i++;
5714             }
5715             if (idx < 0)
5716             {
5717                 curr_bit_offset += idx;
5718             }
5719             iused = i-1;
5720
5721             for (i=1; i <= iused; i++)
5722             {
5723                 xdd_cell_info = f_k(i, w, 1024);
5724                 proto_tree_add_uint(subtree2, hf_gsm_a_rr_scrambling_code, tvb, curr_bit_offset>>3, 0, xdd_cell_info & 0x01FF);
5725                 proto_tree_add_uint(subtree2, hf_gsm_a_rr_diversity, tvb, curr_bit_offset>>3, 0, (xdd_cell_info >> 9) & 0x01);
5726             }
5727         }
5728     }
5729     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
5730
5731     return (curr_bit_offset - bit_offset);
5732 }
5733
5734 static gint
5735 de_rr_si2quater_meas_info_utran_tdd_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
5736 {
5737     proto_tree *subtree, *subtree2;
5738     proto_item *item;
5739     gint        curr_bit_offset, idx;
5740     gint        xdd_cell_info, wsize, nwi, jwi, w[64], i, iused, xdd_indic0;
5741
5742     curr_bit_offset = bit_offset;
5743
5744     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_UTRAN_TDD_DESC], &item,
5745                                 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_TDD_DESC].strptr);
5746     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_bandwidth_tdd_present))
5747     {
5748         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bandwidth_tdd, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
5749         curr_bit_offset += 3;
5750     }
5751     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_umts_tdd_neighbour_cells))
5752     {
5753         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_repeated_umts_tdd_neighbour_cells_earlier_version_bit_reserved, tvb, curr_bit_offset++, 1, ENC_NA);
5754         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tdd_uarfcn, tvb, curr_bit_offset, 14, ENC_BIG_ENDIAN);
5755         curr_bit_offset += 14;
5756         xdd_indic0 = gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_tdd_cell_info_param_value0);
5757         idx = tvb_get_bits8(tvb,curr_bit_offset,5);
5758         proto_tree_add_uint(subtree, hf_gsm_a_rr_nr_of_tdd_cells, tvb, curr_bit_offset>>3, 1, idx);
5759         curr_bit_offset += 5;
5760         idx = convert_n_to_q[idx];
5761         subtree2 = proto_tree_add_subtree(subtree,tvb, curr_bit_offset>>3, (idx>>3)+1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_TDD_CELL_INFORMATION_FIELD], &item,
5762                                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_TDD_DESC].strptr);
5763         proto_tree_add_bytes_format(subtree2, hf_gsm_a_rr_field_bit_long, tvb, curr_bit_offset>>3, (idx>>3)+1, NULL, "Field is %d bits long", idx);
5764         if (xdd_indic0)
5765         {
5766             proto_tree_add_uint(subtree2, hf_gsm_a_rr_cell_parameter, tvb, curr_bit_offset>>3, 0, 0);
5767             proto_tree_add_uint(subtree2, hf_gsm_a_rr_sync_case_tstd, tvb, curr_bit_offset>>3, 0, 0);
5768             proto_tree_add_uint(subtree2, hf_gsm_a_rr_diversity_tdd, tvb, curr_bit_offset>>3, 0, 0);
5769         }
5770         if (idx)
5771         {
5772             wsize = 9;
5773             nwi = 1;
5774             jwi = 0;
5775             i = 1;
5776
5777             while (idx > 0)
5778             {
5779                 w[i] = tvb_get_bits(tvb, curr_bit_offset, wsize, ENC_BIG_ENDIAN);
5780                 curr_bit_offset += wsize;
5781                 idx -= wsize;
5782                 if (w[i] == 0)
5783                 {
5784                     idx = 0;
5785                     break;
5786                 }
5787                 if (++jwi == nwi)
5788                 {
5789                     jwi = 0;
5790                     nwi <<= 1;
5791                     wsize--;
5792                 }
5793                 i++;
5794             }
5795             if (idx < 0)
5796             {
5797                 curr_bit_offset += idx;
5798             }
5799             iused = i-1;
5800
5801             for (i=1; i <= iused; i++)
5802             {
5803                 xdd_cell_info = f_k(i, w, 512);
5804                 proto_tree_add_uint(subtree2, hf_gsm_a_rr_cell_parameter, tvb, curr_bit_offset>>3, 0, xdd_cell_info & 0x07F);
5805                 proto_tree_add_uint(subtree2, hf_gsm_a_rr_sync_case_tstd, tvb, curr_bit_offset>>3, 0, (xdd_cell_info >> 7) & 0x01);
5806                 proto_tree_add_uint(subtree2, hf_gsm_a_rr_diversity_tdd, tvb, curr_bit_offset>>3, 0, (xdd_cell_info >> 8) & 0x01);
5807             }
5808         }
5809     }
5810     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
5811
5812     return (curr_bit_offset - bit_offset);
5813 }
5814
5815 static gint
5816 de_rr_rtd_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset, rr_rest_octets_elem_idx_t id)
5817 {
5818     proto_tree *subtree;
5819     proto_item *item;
5820     gint        curr_bit_offset, idx;
5821     guint8      value;
5822
5823     curr_bit_offset = bit_offset;
5824
5825     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[id], &item,
5826                                     gsm_rr_rest_octets_elem_strings[id].strptr);
5827     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_rtd6))
5828     {
5829         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_ba_index_start_rtd_present))
5830         {
5831             idx = tvb_get_bits8(tvb,curr_bit_offset,5);
5832             proto_tree_add_uint(subtree, hf_gsm_a_rr_ba_index_start_rtd, tvb, curr_bit_offset>>3, 1, idx);
5833             curr_bit_offset += 5;
5834         }
5835         else
5836             idx = 0;
5837
5838         value = gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_rtd);
5839         while (value == 0)
5840         { /* all the RTDs on the first frequency */
5841             proto_tree_add_uint_format(subtree, hf_gsm_a_rr_rtd_index, tvb, curr_bit_offset>>3, 1, tvb_get_bits8(tvb,curr_bit_offset,6),
5842                 "RTD index %d: %d TDMA frame(s) modulo 51 TDMA frames", idx, tvb_get_bits8(tvb,curr_bit_offset,6));
5843             curr_bit_offset += 6;
5844             value = gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_additional_rtd);
5845         }
5846
5847         value = gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_additional_rtd_struct);
5848         while(value == 0)
5849         { /* all other frequencies */
5850             idx += 1;
5851             value = gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_rtd);
5852             while (value == 0)
5853             { /* all the RTDs on the first frequency */
5854                 proto_tree_add_uint_format(subtree, hf_gsm_a_rr_rtd_index, tvb, curr_bit_offset>>3, 1, tvb_get_bits8(tvb,curr_bit_offset,6),
5855                             "RTD index %d: %d TDMA frame(s) modulo 51 TDMA frames", idx, tvb_get_bits8(tvb,curr_bit_offset,6));
5856                 curr_bit_offset += 6;
5857                 value = gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_additional_rtd);
5858             }
5859             value = gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_additional_rtd_struct);
5860         }
5861     }
5862     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_rtd12))
5863     {
5864        if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_rtd12))
5865        {
5866            if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_ba_index_start_rtd_present))
5867            {
5868                idx = tvb_get_bits8(tvb,curr_bit_offset,5);
5869                proto_tree_add_uint(subtree, hf_gsm_a_rr_ba_index_start_rtd, tvb, curr_bit_offset>>3, 1, idx);
5870                curr_bit_offset += 5;
5871            }
5872            else
5873                idx = 0;
5874
5875            while (0 == gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_rtd))
5876            { /* all the RTDs on the first frequency */
5877                proto_tree_add_uint_format(subtree, hf_gsm_a_rr_rtd_index, tvb, curr_bit_offset>>3, 2, tvb_get_bits16(tvb,curr_bit_offset,12,ENC_BIG_ENDIAN),
5878                         "RTD index %d: %d/64 TDMA frame(s) modulo 51 TDMA frames", idx, tvb_get_bits16(tvb,curr_bit_offset,12,ENC_BIG_ENDIAN));
5879                curr_bit_offset += 12;
5880            }
5881
5882            while(0 == gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_rtd_frequency))
5883            { /* all other frequencies */
5884                idx += 1;
5885                while (0 == gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_rtd))
5886                { /* all the RTDs on the first frequency */
5887                    proto_tree_add_uint_format(subtree, hf_gsm_a_rr_rtd_index, tvb, curr_bit_offset>>3, 2, tvb_get_bits16(tvb,curr_bit_offset,12,ENC_BIG_ENDIAN),
5888                         "RTD index %d: %d/64 TDMA frame(s) modulo 51 TDMA frames", idx, tvb_get_bits16(tvb,curr_bit_offset,12,ENC_BIG_ENDIAN));
5889                    curr_bit_offset += 12;
5890                }
5891            }
5892        }
5893     }
5894     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
5895
5896     return (curr_bit_offset - bit_offset);
5897 }
5898
5899 static gint
5900 de_rr_bsic_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset, rr_rest_octets_elem_idx_t id)
5901 {
5902     proto_tree *subtree;
5903     proto_item *item;
5904     gint        curr_bit_offset, idx;
5905
5906     curr_bit_offset = bit_offset;
5907     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[id], &item, gsm_rr_rest_octets_elem_strings[id].strptr);
5908     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_ba_index_start_bsic_present))
5909     {
5910         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ba_index_start_bsic, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
5911         curr_bit_offset += 5;
5912     }
5913     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bsic, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
5914     curr_bit_offset += 6;
5915     idx = tvb_get_bits8(tvb,curr_bit_offset,7);
5916     proto_tree_add_uint(subtree, hf_gsm_a_rr_number_remaining_bsic, tvb, curr_bit_offset>>3, 1, idx);
5917     curr_bit_offset += 7;
5918     while (idx)
5919     {
5920         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_frequency_scrolling, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
5921         curr_bit_offset += 1;
5922         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bsic, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
5923         curr_bit_offset += 6;
5924         idx -= 1;
5925     }
5926     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
5927
5928     return(curr_bit_offset - bit_offset);
5929 }
5930
5931 static gint
5932 de_rr_report_priority_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset, rr_rest_octets_elem_idx_t id)
5933 {
5934     proto_tree *subtree;
5935     proto_item *item;
5936     gint        curr_bit_offset, idx;
5937
5938     curr_bit_offset = bit_offset;
5939
5940     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[id], &item,
5941                                 gsm_rr_rest_octets_elem_strings[id].strptr);
5942     idx = tvb_get_bits8(tvb,curr_bit_offset,7);
5943     proto_tree_add_uint(subtree, hf_gsm_a_rr_number_cells, tvb, curr_bit_offset>>3, 1, idx);
5944     curr_bit_offset += 7;
5945     while (idx)
5946     {
5947         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rep_priority, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
5948         curr_bit_offset += 1;
5949         idx -= 1;
5950     }
5951     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
5952
5953     return(curr_bit_offset - bit_offset);
5954 }
5955
5956 static gint
5957 de_rr_meas_param_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset, rr_rest_octets_elem_idx_t id)
5958 {
5959     proto_tree *subtree;
5960     proto_item *item;
5961     gint        curr_bit_offset;
5962
5963     curr_bit_offset = bit_offset;
5964     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[id], &item, gsm_rr_rest_octets_elem_strings[id].strptr);
5965     if (id == DE_RR_REST_OCTETS_GPRS_MEAS_PARAM_DESC)
5966     {
5967         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_report_type, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
5968         curr_bit_offset += 1;
5969         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_reporting_rate, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
5970         curr_bit_offset +=1;
5971         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_invalid_bsic_reporting, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
5972         curr_bit_offset +=1;
5973     }
5974     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_multiband_reporting_present))
5975     {
5976         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_multiband_reporting, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
5977         curr_bit_offset += 2;
5978     }
5979     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_serving_reporting_present))
5980     {
5981         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_serving_band_reporting, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
5982         curr_bit_offset += 2;
5983     }
5984     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_scale_ord, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
5985     curr_bit_offset += 2;
5986     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_900_reporting_present))
5987     {
5988         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_900_reporting_offset, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
5989         curr_bit_offset += 3;
5990         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_900_reporting_threshold, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
5991         curr_bit_offset += 3;
5992     }
5993     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_1800_reporting_present))
5994     {
5995         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_1800_reporting_offset, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
5996         curr_bit_offset += 3;
5997         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_1800_reporting_threshold, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
5998         curr_bit_offset += 3;
5999     }
6000     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_400_reporting_present))
6001     {
6002         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_400_reporting_offset, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6003         curr_bit_offset += 3;
6004         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_400_reporting_threshold, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6005         curr_bit_offset += 3;
6006     }
6007     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_1900_reporting_present))
6008     {
6009         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_1900_reporting_offset, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6010         curr_bit_offset += 3;
6011         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_1900_reporting_threshold, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6012         curr_bit_offset += 3;
6013     }
6014     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_850_reporting_present))
6015     {
6016         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_850_reporting_offset, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6017         curr_bit_offset += 3;
6018         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_850_reporting_threshold, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6019         curr_bit_offset += 3;
6020     }
6021     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
6022
6023     return(curr_bit_offset - bit_offset);
6024 }
6025
6026 static gint
6027 de_rr_3g_add_meas_param_desc2(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
6028 {
6029     proto_tree *subtree;
6030     proto_item *item;
6031     gint        curr_bit_offset;
6032
6033     curr_bit_offset = bit_offset;
6034     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC2], &item,
6035                                 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC2].strptr);
6036     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_fdd_reporting_threshold_2_present))
6037     {
6038         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_fdd_reporting_threshold_2, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
6039         curr_bit_offset += 6;
6040     }
6041     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
6042
6043     return(curr_bit_offset - bit_offset);
6044 }
6045
6046 /* Additions in Rel-8 */
6047 static const true_false_string priority_utran_start = {
6048     "This is the first instance of the message",
6049     "This is not the first instance of the message"
6050 };
6051
6052 static const true_false_string priority_utran_stop = {
6053     "This is the last instance of the message",
6054     "This is not the last instance of the message"
6055 };
6056
6057 static const true_false_string eutran_ccn_active = {
6058     "CCN towards E-UTRAN cells is enabled in the cell",
6059     "The broadcast E-UTRAN_CCN_ACTIVE parameter shall apply if applicable. Otherwise, CCN towards E-UTRAN cells is disabled in the cell"
6060 };
6061
6062 #if 0
6063 static const true_false_string eutran_rep_quant = {
6064     "RSRQ",
6065     "RSRP"
6066 };
6067 #endif
6068
6069 static const value_string gsm_a_rr_pcid_psc_pattern_length[] = {
6070     { 0, "1"},
6071     { 1, "2"},
6072     { 2, "3"},
6073     { 3, "4"},
6074     { 4, "5"},
6075     { 5, "6"},
6076     { 6, "7"},
6077     { 7, "8"},
6078     { 0, NULL }
6079 };
6080
6081 static const value_string gsm_a_rr_eutran_measurement_bandwidth[] = {
6082     { 0, "NRB = 6"},
6083     { 1, "NRB = 15"},
6084     { 2, "NRB = 25"},
6085     { 3, "NRB = 50"},
6086     { 4, "NRB = 75"},
6087     { 5, "NRB = 100"},
6088     { 6, "Reserved for future use"},
6089     { 7, "Reserved for future use"},
6090     { 0, NULL }
6091 };
6092
6093 static const value_string gsm_a_rr_serving_cell_thresh_gsm_low[] = {
6094     { 0, "0 dB"},
6095     { 1, "2 dB"},
6096     { 2, "4 dB"},
6097     { 3, "6 dB"},
6098     { 4, "8 dB"},
6099     { 5, "10 dB"},
6100     { 6, "12 dB"},
6101     { 7, "14 dB"},
6102     { 8, "16 dB"},
6103     { 9, "18 dB"},
6104     {10, "20 dB"},
6105     {11, "22 dB"},
6106     {12, "24 dB"},
6107     {13, "26 dB"},
6108     {14, "28 dB"},
6109     {15, "Always allowed"},
6110     { 0, NULL }
6111 };
6112
6113 static const value_string gsm_a_rr_serving_cell_thresh_priority_search[] = {
6114     { 0, "-98 dBm"},
6115     { 1, "-95 dBm"},
6116     { 2, "-92 dBm"},
6117     { 3, "-89 dBm"},
6118     { 4, "-86 dBm"},
6119     { 5, "-83 dBm"},
6120     { 6, "-80 dBm"},
6121     { 7, "-77 dBm"},
6122     { 8, "-74 dBm"},
6123     { 9, "-71 dBm"},
6124     {10, "-68 dBm"},
6125     {11, "-65 dBm"},
6126     {12, "-62 dBm"},
6127     {13, "-59 dBm"},
6128     {14, "-56 dBm"},
6129     {15, "Always search"},
6130     { 0, NULL }
6131 };
6132
6133 static const value_string gsm_a_rr_utran_qrxlevmin[] = {
6134     { 0, "-119 dBm"},
6135     { 1, "-117 dBm"},
6136     { 2, "-115 dBm"},
6137     { 3, "-113 dBm"},
6138     { 4, "-111 dBm"},
6139     { 5, "-109 dBm"},
6140     { 6, "-107 dBm"},
6141     { 7, "-105 dBm"},
6142     { 8, "-103 dBm"},
6143     { 9, "-101 dBm"},
6144     {10, "-99 dBm"},
6145     {11, "-97 dBm"},
6146     {12, "-95 dBm"},
6147     {13, "-93 dBm"},
6148     {14, "-91 dBm"},
6149     {15, "-89 dBm"},
6150     {16, "-87 dBm"},
6151     {17, "-85 dBm"},
6152     {18, "-83 dBm"},
6153     {19, "-81 dBm"},
6154     {20, "-79 dBm"},
6155     {21, "-77 dBm"},
6156     {22, "-75 dBm"},
6157     {23, "-73 dBm"},
6158     {24, "-71 dBm"},
6159     {25, "-69 dBm"},
6160     {26, "-67 dBm"},
6161     {27, "-65 dBm"},
6162     {28, "-63 dBm"},
6163     {29, "-61 dBm"},
6164     {30, "-59 dBm"},
6165     {31, "-57 dBm"},
6166     { 0, NULL }
6167 };
6168
6169 static const value_string gsm_a_rr_thresh_utran_eutran_high_low[] = {
6170     { 0, "0 dB"},
6171     { 1, "2 dB"},
6172     { 2, "4 dB"},
6173     { 3, "6 dB"},
6174     { 4, "8 dB"},
6175     { 5, "10 dB"},
6176     { 6, "12 dB"},
6177     { 7, "14 dB"},
6178     { 8, "16 dB"},
6179     { 9, "18 dB"},
6180     {10, "20 dB"},
6181     {11, "22 dB"},
6182     {12, "24 dB"},
6183     {13, "26 dB"},
6184     {14, "28 dB"},
6185     {15, "30 dB"},
6186     {16, "32 dB"},
6187     {17, "34 dB"},
6188     {18, "36 dB"},
6189     {19, "38 dB"},
6190     {20, "40 dB"},
6191     {21, "42 dB"},
6192     {22, "44 dB"},
6193     {23, "46 dB"},
6194     {24, "48 dB"},
6195     {25, "50 dB"},
6196     {26, "52 dB"},
6197     {27, "54 dB"},
6198     {28, "56 dB"},
6199     {29, "58 dB"},
6200     {30, "60 dB"},
6201     {31, "62 dB"},
6202     { 0, NULL }
6203 };
6204
6205 static const value_string gsm_a_rr_eutran_qrxlevmin[] = {
6206     { 0, "-140 dBm"},
6207     { 1, "-138 dBm"},
6208     { 2, "-136 dBm"},
6209     { 3, "-134 dBm"},
6210     { 4, "-132 dBm"},
6211     { 5, "-130 dBm"},
6212     { 6, "-128 dBm"},
6213     { 7, "-126 dBm"},
6214     { 8, "-124 dBm"},
6215     { 9, "-122 dBm"},
6216     {10, "-120 dBm"},
6217     {11, "-118 dBm"},
6218     {12, "-116 dBm"},
6219     {13, "-114 dBm"},
6220     {14, "-112 dBm"},
6221     {15, "-110 dBm"},
6222     {16, "-108 dBm"},
6223     {17, "-106 dBm"},
6224     {18, "-104 dBm"},
6225     {19, "-102 dBm"},
6226     {20, "-100 dBm"},
6227     {21, "-98 dBm"},
6228     {22, "-96 dBm"},
6229     {23, "-94 dBm"},
6230     {24, "-92 dBm"},
6231     {25, "-90 dBm"},
6232     {26, "-88 dBm"},
6233     {27, "-86 dBm"},
6234     {28, "-84 dBm"},
6235     {29, "-82 dBm"},
6236     {30, "-80 dBm"},
6237     {31, "-78 dBm"},
6238     { 0, NULL }
6239 };
6240
6241 static const value_string gsm_a_rr_serving_cell_priority_param_h_prio[] = {
6242     { 0, "disabled"},
6243     { 1, "5 dB"},
6244     { 2, "4 dB"},
6245     { 3, "3 dB"},
6246     { 0, NULL }
6247 };
6248
6249 static const value_string gsm_a_rr_serving_cell_priority_param_t_reselection[] = {
6250     { 0, "5 s"},
6251     { 1, "10 s"},
6252     { 2, "15 s"},
6253     { 3, "20 s"},
6254     { 0, NULL }
6255 };
6256
6257 static const value_string gsm_a_rr_qsearch_c_eutran_initial[] = {
6258     { 0, "search if signal is below -98 dBm"},
6259     { 1, "search if signal is below -94 dBm"},
6260     { 2, "search if signal is below -90 dBm"},
6261     { 3, "search if signal is below -86 dBm"},
6262     { 4, "search if signal is below -82 dBm"},
6263     { 5, "search if signal is below -78 dBm"},
6264     { 6, "search if signal is below -74 dBm"},
6265     { 7, "always search"},
6266     { 8, "search is signal is above -78 dBm"},
6267     { 9, "search is signal is above -74 dBm"},
6268     {10, "search is signal is above -70 dBm"},
6269     {11, "search is signal is above -66 dBm"},
6270     {12, "search is signal is above -62 dBm"},
6271     {13, "search is signal is above -58 dBm"},
6272     {14, "search is signal is above -54 dBm"},
6273     {15, "never search"},
6274     { 0, NULL }
6275 };
6276
6277 static const true_false_string gsm_a_rr_pcid_pattern_sense = {
6278     "The group of identified cells are the one not belonging to the PCID_BITMAP_GROUP",
6279     "The group of identified cells are the one identified by the PCID_BITMAP_GROUP"
6280 };
6281
6282 static const true_false_string measurement_control_utran = {
6283     "Frequency-specific search enabled: use Qsearch_C_E-UTRAN if received, otherwise use Qsearch_C_EUTRAN_Initial",
6284     "Frequency-specific search enabled: Never search"
6285 };
6286
6287 static const true_false_string measurement_control_eutran = {
6288     "Frequency-specific search enabled: use Qsearch_C if received, otherwise use Qsearch_C_Initial",
6289     "Frequency-specific search enabled: Never search"
6290 };
6291
6292 static gint
6293 de_rr_3g_priority_param_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
6294 {
6295     proto_tree *subtree;
6296     proto_item *item;
6297     gint        curr_bit_offset;
6298
6299     curr_bit_offset = bit_offset;
6300     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_PRIORITY_PARAM_DESC], &item,
6301                                 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_PRIORITY_PARAM_DESC].strptr);
6302
6303     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_priority_param_desc_utran_start, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
6304     curr_bit_offset += 1;
6305     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_priority_param_desc_utran_stop, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
6306     curr_bit_offset += 1;
6307
6308     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_default_utran_priority_parameters))
6309     {
6310         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_priority_param_desc_default_utran_prio, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6311         curr_bit_offset += 3;
6312         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_priority_param_desc_default_threshold_utran, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
6313         curr_bit_offset += 5;
6314         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_priority_param_desc_default_utran_qrxlevmin, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
6315         curr_bit_offset += 5;
6316     }
6317     /* Repeated UTRAN Priority Parameters */
6318     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_utran_priority_parameters))
6319     {
6320         proto_tree *subtree_rep_utran_prio;
6321         proto_item *item_rep_utran_prio;
6322         gint rep_utran_prio_bit_offset = curr_bit_offset;
6323
6324         subtree_rep_utran_prio = proto_tree_add_subtree(subtree, tvb, curr_bit_offset>>3, 1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_UTRAN_PRIO_PARAM], &item_rep_utran_prio,
6325                                                 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_PRIO_PARAM].strptr);
6326
6327         while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_utran_frequency_index_present))
6328         {
6329             proto_tree_add_bits_item(subtree_rep_utran_prio, hf_gsm_a_rr_utran_frequency_index, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
6330             curr_bit_offset += 5;
6331         }
6332
6333         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_utran_priority_present))
6334         {
6335             proto_tree_add_bits_item(subtree_rep_utran_prio, hf_gsm_a_rr_utran_priority, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6336             curr_bit_offset += 3;
6337         }
6338         proto_tree_add_bits_item(subtree_rep_utran_prio, hf_gsm_a_rr_thresh_utran_high, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
6339         curr_bit_offset += 5;
6340
6341         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_thresh_utran_low_present))
6342         {
6343             proto_tree_add_bits_item(subtree_rep_utran_prio, hf_gsm_a_rr_thresh_utran_low, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
6344             curr_bit_offset += 5;
6345         }
6346
6347         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_utran_qrxlevmin_present))
6348         {
6349             proto_tree_add_bits_item(subtree_rep_utran_prio, hf_gsm_a_rr_utran_qrxlevmin, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
6350             curr_bit_offset += 5;
6351         }
6352         proto_item_set_len(item_rep_utran_prio, (curr_bit_offset>>3) - (rep_utran_prio_bit_offset>>3)+1);
6353     }
6354     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
6355
6356     return(curr_bit_offset - bit_offset);
6357 }
6358
6359 static gint
6360 de_rr_eutran_neighbour_cells(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
6361 {
6362     proto_tree *subtree;
6363     proto_item *item;
6364     gint        curr_bit_offset;
6365
6366     curr_bit_offset = bit_offset;
6367     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EUTRAN_NEIGHBOUR_CELLS], &item,
6368                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EUTRAN_NEIGHBOUR_CELLS].strptr);
6369
6370     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_eutran_earfcn_present))
6371     {
6372         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_earfcn, tvb, curr_bit_offset, 16, ENC_BIG_ENDIAN);
6373         curr_bit_offset += 16;
6374
6375         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_eutran_measurement_bandwidth_present))
6376         {
6377             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_measurement_bandwidth, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6378             curr_bit_offset += 3;
6379         }
6380     }
6381
6382     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_eutran_priority_present))
6383     {
6384         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_priority, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6385         curr_bit_offset += 3;
6386     }
6387     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_thresh_eutran_high, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
6388     curr_bit_offset += 5;
6389
6390     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_thresh_eutran_low_present))
6391     {
6392         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_thresh_eutran_low, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
6393         curr_bit_offset += 5;
6394     }
6395
6396     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_eutran_qrxlevmin_present))
6397     {
6398         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_qrxlevmin, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
6399         curr_bit_offset += 5;
6400     }
6401     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
6402
6403     return(curr_bit_offset - bit_offset);
6404 }
6405
6406 static gint
6407 de_rr_eutran_neighbour_cells_mi(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
6408 {
6409     proto_tree *subtree;
6410     proto_item *item;
6411     gint        curr_bit_offset;
6412
6413     curr_bit_offset = bit_offset;
6414     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EUTRAN_NEIGHBOUR_CELLS], &item,
6415                                             gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EUTRAN_NEIGHBOUR_CELLS].strptr);
6416
6417     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_earfcn, tvb, curr_bit_offset, 16, ENC_BIG_ENDIAN);
6418     curr_bit_offset += 16;
6419     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_earfcn))
6420     {
6421        proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_earfcn, tvb, curr_bit_offset, 16, ENC_BIG_ENDIAN);
6422        curr_bit_offset += 16;
6423     }
6424     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_eutran_measurement_bandwidth_present))
6425     {
6426         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_measurement_bandwidth, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6427         curr_bit_offset += 3;
6428     }
6429     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
6430
6431     return(curr_bit_offset - bit_offset);
6432 }
6433
6434 static gint
6435 de_rr_eutran_pcid(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
6436 {
6437     gint        curr_bit_offset = bit_offset;
6438     proto_item *item;
6439
6440     while (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_repeated_pcid))
6441     {
6442         proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_pcid, tvb, curr_bit_offset, 9, ENC_BIG_ENDIAN);
6443         curr_bit_offset += 9;
6444     }
6445
6446     if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_eutran_pcid_bitmap_group_present))
6447     {
6448         gint i;
6449         guint8 bitmap = tvb_get_bits8(tvb,curr_bit_offset,6);
6450         item = proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_pcid_bitmap_group, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
6451         if (bitmap > 0)
6452         {
6453             proto_item_append_text(item, ": Cells IDs addressed by the bitmap:");
6454         }
6455         for (i = 0; i < 6; i++)
6456         {
6457             if ((1 << i) & bitmap)
6458             {
6459                 if ( i != 0)
6460                 {
6461                     proto_item_append_text(item, ",");
6462                 }
6463                 proto_item_append_text(item, " %d to %d",i*84, (i+1)*84 - 1);
6464             }
6465         }
6466         curr_bit_offset += 6;
6467     }
6468     while (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_pcid_pattern_present))
6469     {
6470         gint pcid_pattern_length;
6471         gint pcid_pattern;
6472         gint pattern_lower_bound, pattern_upper_bound;
6473         gint i;
6474
6475         pcid_pattern_length = tvb_get_bits8(tvb,curr_bit_offset,3) + 1;
6476         proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_pcid_pattern_length, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6477         curr_bit_offset += 3;
6478         pcid_pattern = tvb_get_bits8(tvb,curr_bit_offset, pcid_pattern_length);
6479
6480         item = proto_tree_add_uint(tree, hf_gsm_a_rr_pcid_pattern, tvb, curr_bit_offset>>3, 1, pcid_pattern);
6481
6482         pattern_lower_bound = pcid_pattern << (9 - pcid_pattern_length);
6483         pattern_upper_bound = pattern_lower_bound;
6484         for (i = 0; i < (9-pcid_pattern_length); i++)
6485         {
6486             pattern_upper_bound |= 1 << i;
6487         }
6488         proto_item_append_text(item, ": Cells IDs addressed by the pattern: %d to %d", pattern_lower_bound, pattern_upper_bound);
6489
6490         curr_bit_offset += pcid_pattern_length;
6491         proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_pcid_pattern_sense, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
6492         curr_bit_offset += 1;
6493     }
6494
6495     return(curr_bit_offset - bit_offset);
6496 }
6497
6498 static gint
6499 de_rr_eutran_not_allowed_cells(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
6500 {
6501     proto_tree *subtree;
6502     proto_item *item;
6503     gint        curr_bit_offset;
6504
6505     curr_bit_offset = bit_offset;
6506     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EUTRAN_NOT_ALLOWED_CELLS], &item,
6507                                 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EUTRAN_NOT_ALLOWED_CELLS].strptr);
6508
6509     /* dissect PCID group */
6510     curr_bit_offset += de_rr_eutran_pcid(tvb, subtree, curr_bit_offset);
6511
6512     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_eutran_frequency_index))
6513     {
6514         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_frequency_index, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6515         curr_bit_offset += 3;
6516     }
6517     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
6518
6519     return(curr_bit_offset - bit_offset);
6520 }
6521
6522 static gint
6523 de_rr_eutran_pcid_to_ta_mapping(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
6524 {
6525     proto_tree *subtree;
6526     proto_item *item;
6527     gint        curr_bit_offset;
6528
6529     curr_bit_offset = bit_offset;
6530     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EUTRAN_PCID_TO_TA_MAPPING], &item,
6531                                 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EUTRAN_PCID_TO_TA_MAPPING].strptr);
6532
6533     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeating_pcid_group))
6534     {
6535         /* dissect PCID group */
6536         curr_bit_offset += de_rr_eutran_pcid(tvb, subtree, curr_bit_offset);
6537     }
6538     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
6539
6540     return(curr_bit_offset - bit_offset);
6541 }
6542
6543 static gint
6544 de_rr_eutran_measurement_param_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
6545 {
6546     gint        curr_bit_offset;
6547     proto_item *item;
6548     guint8      rep_quant, rep_thresh;
6549
6550     curr_bit_offset = bit_offset;
6551
6552     /* E-UTRAN Measurement Parameters Description */
6553     proto_tree_add_bits_item(tree, hf_gsm_a_rr_qsearch_c_eutran_initial, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
6554     curr_bit_offset += 4;
6555     rep_quant = gsm_rr_csn_flag(tvb, tree, curr_bit_offset, hf_gsm_a_rr_eutran_reporting_quantity);
6556     curr_bit_offset += 1;
6557     proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_multirat_reporting, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
6558     curr_bit_offset += 2;
6559
6560
6561     if (!gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_eutran_reporting))
6562     {
6563         if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_eutran_fdd_reporting_present))
6564         {
6565             if (rep_quant == 0)
6566             {
6567                 proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_fdd_reporting_threshold_rsrp, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6568             }
6569             else
6570             {
6571                 proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_fdd_reporting_threshold_rsrq, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6572             }
6573             curr_bit_offset += 3;
6574
6575             if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_eutran_fdd_reporting_threshold_2_present))
6576             {
6577                 item = proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_fdd_reporting_threshold_2, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
6578                 rep_thresh = tvb_get_bits8(tvb,curr_bit_offset, 6);
6579                 if (rep_quant == 0)
6580                 {
6581                     proto_item_append_text(item, " (%.1f dB)", (gfloat)rep_thresh/2 - 19.5);
6582                 }
6583                 else
6584                 {
6585                     proto_item_append_text(item, " (%d dBm)", rep_thresh - 140);
6586                 }
6587                 curr_bit_offset += 6;
6588             }
6589             if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_eutran_fdd_reporting_offset_present))
6590             {
6591                 proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_fdd_reporting_offset, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6592
6593                 curr_bit_offset += 3;
6594             }
6595         }
6596
6597         if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_eutran_tdd_reporting_present))
6598         {
6599             if (rep_quant == 0)
6600             {
6601                 proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_tdd_reporting_threshold_rsrp, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6602             }
6603             else
6604             {
6605                 proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_tdd_reporting_threshold_rsrq, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6606             }
6607             curr_bit_offset += 3;
6608
6609             if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_eutran_tdd_reporting_threshold_2_present))
6610             {
6611                 item = proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_tdd_reporting_threshold_2, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
6612                 rep_thresh = tvb_get_bits8(tvb,curr_bit_offset, 6);
6613                 if (rep_quant == 0)
6614                 {
6615                     proto_item_append_text(item, " (%.1f dB)", (gfloat)rep_thresh/2 - 19.5);
6616                 }
6617                 else
6618                 {
6619                     proto_item_append_text(item, " (%d dBm)", rep_thresh - 140);
6620                 }
6621                 curr_bit_offset += 6;
6622             }
6623             if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_eutran_tdd_reporting_offset_present))
6624             {
6625                 proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_tdd_reporting_offset, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6626
6627                 curr_bit_offset += 3;
6628             }
6629         }
6630     }
6631     else
6632     {
6633         if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_eutran_fdd_reporting_threshold))
6634         {
6635             item = proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_fdd_measurement_report_offset, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
6636             rep_thresh = tvb_get_bits8(tvb,curr_bit_offset, 6);
6637             if (rep_quant == 0)
6638             {
6639                 proto_item_append_text(item, " (%d dBm)", rep_thresh - 140);
6640             }
6641             else
6642             {
6643                 proto_item_append_text(item, " (%.1f dB)", (gfloat)rep_thresh/2 - 19.5);
6644             }
6645             curr_bit_offset += 6;
6646
6647             if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_eutran_fdd_reporting_threshold_2_present))
6648             {
6649                 item = proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_fdd_reporting_threshold_2, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
6650                 rep_thresh = tvb_get_bits8(tvb,curr_bit_offset, 6);
6651                 if (rep_quant == 0)
6652                 {
6653                     proto_item_append_text(item, " (%.1f dB)", (gfloat)rep_thresh/2 - 19.5);
6654                 }
6655                 else
6656                 {
6657                     proto_item_append_text(item, " (%d dBm)", rep_thresh - 140);
6658                 }
6659                 curr_bit_offset += 6;
6660             }
6661             if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_eutran_fdd_reporting_offset_present))
6662             {
6663                 proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_fdd_reporting_offset, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6664                 curr_bit_offset += 3;
6665             }
6666         }
6667
6668         if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_eutran_tdd_measurement_report_offset_present))
6669         {
6670             item = proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_tdd_measurement_report_offset, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
6671             rep_thresh = tvb_get_bits8(tvb,curr_bit_offset, 6);
6672             if (rep_quant == 0)
6673             {
6674                 proto_item_append_text(item, " (%d dBm)", rep_thresh - 140);
6675             }
6676             else
6677             {
6678                 proto_item_append_text(item, " (%.1f dB)", (gfloat)rep_thresh/2 - 19.5);
6679             }
6680             curr_bit_offset += 6;
6681
6682             if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_eutran_tdd_reporting_threshold_2_present))
6683             {
6684                 item = proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_tdd_reporting_threshold_2, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
6685                 rep_thresh = tvb_get_bits8(tvb,curr_bit_offset, 6);
6686                 if (rep_quant == 0)
6687                 {
6688                     proto_item_append_text(item, " (%.1f dB)", (gfloat)rep_thresh/2 - 19.5);
6689                 }
6690                 else
6691                 {
6692                     proto_item_append_text(item, " (%d dBm)", rep_thresh - 140);
6693                 }
6694                 curr_bit_offset += 6;
6695             }
6696             if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_eutran_tdd_reporting_offset_present))
6697             {
6698                 proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_tdd_reporting_offset, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6699                 curr_bit_offset += 3;
6700             }
6701         }
6702         item = proto_tree_add_bits_item(tree, hf_gsm_a_rr_reporting_granularity, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
6703         if (rep_quant == 0)
6704         {
6705             proto_item_append_text(item, " (%d dB step)", 2 + tvb_get_bits8(tvb,curr_bit_offset,1));
6706         }
6707         else
6708         {
6709             proto_item_append_text(item, " (%d dB step)", 1 + tvb_get_bits8(tvb,curr_bit_offset,1));
6710         }
6711         curr_bit_offset += 1;
6712     }
6713
6714     return(curr_bit_offset - bit_offset);
6715 }
6716
6717 static gint
6718 de_rr_eutran_param_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
6719 {
6720     proto_tree *subtree;
6721     proto_item *item;
6722     gint        curr_bit_offset;
6723     guint8      rep_quant = 0, rep_thresh = 0;
6724
6725     curr_bit_offset = bit_offset;
6726     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EUTRAN_PARAM_DESC], &item,
6727                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EUTRAN_PARAM_DESC].strptr);
6728
6729     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_ccn_active, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
6730     curr_bit_offset += 1;
6731     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_start, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
6732     curr_bit_offset += 1;
6733     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_stop, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
6734     curr_bit_offset += 1;
6735
6736     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_eutran_measurement_parameters_description))
6737     {
6738         /* E-UTRAN Measurement Parameters Description */
6739         curr_bit_offset += de_rr_eutran_measurement_param_desc(tvb, subtree, curr_bit_offset);
6740     }
6741
6742     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_gprs_eutran_measurement_parameters_description))
6743     {
6744         /* GPRS E-UTRAN Measurement Parameters Description */
6745         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_qsearch_p_eutran, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
6746         curr_bit_offset += 4;
6747         rep_quant = gsm_rr_csn_flag(tvb, subtree, curr_bit_offset, hf_gsm_a_rr_eutran_reporting_quantity);
6748         curr_bit_offset++;
6749         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_multirat_reporting, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
6750         curr_bit_offset += 2;
6751
6752         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_eutran_fdd_reporting))
6753         {
6754             if (rep_quant == 0)
6755             {
6756                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_fdd_reporting_threshold_rsrp, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6757             }
6758             else
6759             {
6760                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_fdd_reporting_threshold_rsrq, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6761             }
6762             curr_bit_offset += 3;
6763
6764             if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_eutran_fdd_reporting_threshold_2_present))
6765             {
6766                 item = proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_fdd_reporting_threshold_2, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
6767                 rep_thresh = tvb_get_bits8(tvb,curr_bit_offset, 6);
6768                 if (rep_quant == 0)
6769                 {
6770                     proto_item_append_text(item, " (%.1f dB)", (gfloat)rep_thresh/2 - 19.5);
6771                 }
6772                 else
6773                 {
6774                     proto_item_append_text(item, " (%d dBm)", rep_thresh - 140);
6775                 }
6776                 curr_bit_offset += 6;
6777             }
6778             if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_eutran_fdd_reporting_offset_present))
6779             {
6780                 item = proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_fdd_reporting_offset, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6781                 curr_bit_offset += 3;
6782             }
6783         }
6784
6785         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_eutran_tdd_reporting))
6786         {
6787             if (rep_quant == 0)
6788             {
6789                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_tdd_reporting_threshold_rsrp, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6790             }
6791             else
6792             {
6793                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_tdd_reporting_threshold_rsrq, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6794             }
6795             curr_bit_offset += 3;
6796
6797             if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_eutran_tdd_reporting_threshold_2_present))
6798             {
6799                 item = proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_tdd_reporting_threshold_2, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
6800                 rep_thresh = tvb_get_bits8(tvb,curr_bit_offset, 6);
6801                 if (rep_quant == 0)
6802                 {
6803                     proto_item_append_text(item, " (%.1f dB)", (gfloat)rep_thresh/2 - 19.5);
6804                 }
6805                 else
6806                 {
6807                     proto_item_append_text(item, " (%d dBm)", rep_thresh - 140);
6808                 }
6809                 curr_bit_offset += 6;
6810             }
6811             if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_eutran_tdd_reporting_offset_present))
6812             {
6813                 item = proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_tdd_reporting_offset, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6814                 curr_bit_offset += 3;
6815             }
6816         }
6817     }
6818
6819     /* Repeated E-UTRAN Neighbour Cells */
6820     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_eutran_neighbour_cells))
6821     {
6822         curr_bit_offset += de_rr_eutran_neighbour_cells(tvb, subtree, curr_bit_offset);
6823     }
6824
6825     /* Repeated E-UTRAN Not Allowed Cells */
6826     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_eutran_not_allowed_cells))
6827     {
6828         curr_bit_offset += de_rr_eutran_not_allowed_cells(tvb, subtree, curr_bit_offset);
6829     }
6830
6831     /* Repeated E-UTRAN PCID to TA mapping */
6832     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_eutran_pcid_ta_mapping))
6833     {
6834         curr_bit_offset += de_rr_eutran_pcid_to_ta_mapping(tvb, subtree, curr_bit_offset);
6835     }
6836     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
6837
6838     return(curr_bit_offset - bit_offset);
6839 }
6840
6841 static gint
6842 de_rr_eutran_param_desc_mi(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
6843 {
6844     proto_tree *subtree;
6845     proto_item *item;
6846     gint        curr_bit_offset;
6847
6848     curr_bit_offset = bit_offset;
6849     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EUTRAN_PARAM_DESC], &item,
6850                                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EUTRAN_PARAM_DESC].strptr);
6851
6852     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_start, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
6853     curr_bit_offset += 1;
6854     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_stop, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
6855     curr_bit_offset += 1;
6856
6857     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_eutran_measurement_parameters_description))
6858     {
6859         /* E-UTRAN Measurement Parameters Description */
6860         curr_bit_offset += de_rr_eutran_measurement_param_desc(tvb, subtree, curr_bit_offset);
6861     }
6862
6863     /* Repeated E-UTRAN Neighbour Cells */
6864     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_eutran_neighbour_cells))
6865     {
6866         curr_bit_offset += de_rr_eutran_neighbour_cells_mi(tvb, subtree, curr_bit_offset);
6867     }
6868
6869     /* Repeated E-UTRAN Not Allowed Cells */
6870     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_eutran_not_allowed_cells))
6871     {
6872         curr_bit_offset += de_rr_eutran_not_allowed_cells(tvb, subtree, curr_bit_offset);
6873     }
6874
6875     /* Measurement Control Parameters Description */
6876     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_measurement_control_parameters_description))
6877     {
6878         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_eutran_default_measurement_control_eutran_present))
6879         {
6880             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_default_measurement_control_eutran, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
6881             curr_bit_offset += 1;
6882         }
6883         while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_eutran_measurement_control_parameters))
6884         {
6885             while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_eutran_frequency_index))
6886             {
6887                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_frequency_index, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6888                 curr_bit_offset += 3;
6889             }
6890             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_measurement_control_eutran, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
6891             curr_bit_offset += 1;
6892         }
6893     }
6894     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
6895
6896     return(curr_bit_offset - bit_offset);
6897 }
6898
6899 static gint
6900 de_rr_priority_and_eutran_param_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
6901 {
6902     proto_tree *subtree;
6903     proto_item *item;
6904     gint        curr_bit_offset;
6905
6906     curr_bit_offset = bit_offset;
6907     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_PRIORITY_AND_EUTRAN_PARAM_DESC], &item,
6908                                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_PRIORITY_AND_EUTRAN_PARAM_DESC].strptr);
6909
6910     /* Serving Cell Priority Parameters Description */
6911     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_serving_cell_priority_parameters_description))
6912     {
6913         proto_tree *subtree_serv;
6914         proto_item *item_serv;
6915         gint serv_bit_offset = curr_bit_offset;
6916
6917         subtree_serv = proto_tree_add_subtree(subtree, tvb, curr_bit_offset>>3, ((curr_bit_offset+15)>>3)-(curr_bit_offset>>3) + 1,
6918                             ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_SERVING_CELL_PRIORITY_PARAM_DESC], &item_serv,
6919                             gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_SERVING_CELL_PRIORITY_PARAM_DESC].strptr);
6920
6921         proto_tree_add_bits_item(subtree_serv, hf_gsm_a_rr_serving_cell_priority_param_geran_priority, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6922         curr_bit_offset += 3;
6923         proto_tree_add_bits_item(subtree_serv, hf_gsm_a_rr_serving_cell_priority_param_thresh_prio_search, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
6924         curr_bit_offset += 4;
6925         proto_tree_add_bits_item(subtree_serv, hf_gsm_a_rr_serving_cell_priority_param_thresh_gsm_low, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
6926         curr_bit_offset += 4;
6927         proto_tree_add_bits_item(subtree_serv, hf_gsm_a_rr_serving_cell_priority_param_h_prio, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
6928         curr_bit_offset += 2;
6929         proto_tree_add_bits_item(subtree_serv, hf_gsm_a_rr_serving_cell_priority_param_t_reselection, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
6930         curr_bit_offset += 2;
6931         proto_item_set_len(item_serv, (curr_bit_offset>>3) - (serv_bit_offset>>3)+1);
6932     }
6933
6934     /* 3G Priority Parameters Description */
6935     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_3g_priority_parameters_description))
6936     {
6937         curr_bit_offset += de_rr_3g_priority_param_desc(tvb, subtree, curr_bit_offset);
6938     }
6939
6940     /* E-UTRAN Parameters Description */
6941     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_eutran_parameters_description))
6942     {
6943         curr_bit_offset += de_rr_eutran_param_desc(tvb, subtree, curr_bit_offset);
6944     }
6945     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
6946
6947     return (curr_bit_offset - bit_offset);
6948 }
6949
6950 static gint
6951 de_rr_3g_csg_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
6952 {
6953     proto_tree *subtree;
6954     proto_item *item;
6955     gint        curr_bit_offset;
6956
6957     curr_bit_offset = bit_offset;
6958     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_CSG_DESC], &item,
6959                             gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_CSG_DESC].strptr);
6960
6961     while (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_repeated_csg_psc_split_struct))
6962     {
6963         /* CSG_PSC_SPLIT struct */
6964         while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_psc_present))
6965         {
6966             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_psc, tvb, curr_bit_offset, 9, ENC_BIG_ENDIAN);
6967             curr_bit_offset += 9;
6968         }
6969         while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_psc_pattern_present))
6970         {
6971             gint psc_pattern_length;
6972             gint psc_pattern;
6973
6974             psc_pattern_length = tvb_get_bits8(tvb,curr_bit_offset,3) + 1;
6975             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_utran_psc_pattern_length, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
6976             curr_bit_offset += 3;
6977             psc_pattern = tvb_get_bits8(tvb,curr_bit_offset, psc_pattern_length);
6978
6979             item = proto_tree_add_uint(tree, hf_gsm_a_rr_psc_pattern, tvb, curr_bit_offset>>3, 1, psc_pattern);
6980
6981             curr_bit_offset += psc_pattern_length;
6982             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_utran_psc_pattern_sense, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
6983             curr_bit_offset += 1;
6984         }
6985
6986         while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_utran_frequency_index))
6987         {
6988             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_utran_frequency_index, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
6989             curr_bit_offset += 5;
6990         }
6991     }
6992
6993     while(gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_csg_fdd_uarfcn))
6994     {
6995         /* CSG_FDD_UARFCN */
6996         if (!gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_3g_csg_desc_technology))
6997         {
6998             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_utran_csg_fdd_uarfcn, tvb, curr_bit_offset, 14, ENC_BIG_ENDIAN);
6999             curr_bit_offset += 14;
7000         }
7001         else
7002         {
7003             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_utran_csg_tdd_uarfcn, tvb, curr_bit_offset, 14, ENC_BIG_ENDIAN);
7004             curr_bit_offset += 14;
7005         }
7006     }
7007     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
7008
7009     return(curr_bit_offset - bit_offset);
7010 }
7011
7012 static gint
7013 de_rr_eutran_csg_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
7014 {
7015     proto_tree *subtree;
7016     proto_item *item;
7017     gint        curr_bit_offset;
7018
7019     curr_bit_offset = bit_offset;
7020     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EUTRAN_CSG_DESC], &item,
7021                                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EUTRAN_CSG_DESC].strptr);
7022
7023     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_pcid_group))
7024     {
7025         /* dissect PCID group */
7026         curr_bit_offset += de_rr_eutran_pcid(tvb, subtree, curr_bit_offset);
7027     }
7028
7029     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_earfcn))
7030     {
7031         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_csg_earfcn, tvb, curr_bit_offset, 16, ENC_BIG_ENDIAN);
7032         curr_bit_offset += 16;
7033     }
7034     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
7035
7036     return(curr_bit_offset - bit_offset);
7037 }
7038
7039 static gint
7040 de_rr_eutran_csg_desc_mi(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
7041 {
7042     proto_tree *subtree;
7043     proto_item *item;
7044     gint        curr_bit_offset;
7045
7046     curr_bit_offset = bit_offset;
7047     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EUTRAN_CSG_DESC], &item,
7048                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EUTRAN_CSG_DESC].strptr);
7049
7050     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_csg_pci_split))
7051     {
7052         /* dissect PCID group */
7053         curr_bit_offset += de_rr_eutran_pcid(tvb, subtree, curr_bit_offset);
7054     }
7055     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
7056
7057     return(curr_bit_offset - bit_offset);
7058 }
7059
7060 static gint
7061 de_rr_utran_measurement_control_param_mi(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
7062 {
7063     proto_tree *subtree;
7064     proto_item *item;
7065     gint        curr_bit_offset;
7066
7067     curr_bit_offset = bit_offset;
7068     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_UTRAN_MEASUREMENT_CONTROL_PARAM_DESC], &item,
7069                                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_MEASUREMENT_CONTROL_PARAM_DESC].strptr);
7070
7071     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_utran_frequency_index))
7072     {
7073         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_utran_frequency_index, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
7074         curr_bit_offset += 5;
7075     }
7076     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_control_param_desc_meas_ctrl_utran, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
7077     curr_bit_offset += 1;
7078
7079     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
7080
7081     return(curr_bit_offset - bit_offset);
7082 }
7083
7084 static gint
7085 de_rr_3g_supplementary_param_desc_mi(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
7086 {
7087     proto_tree *subtree;
7088     proto_item *item;
7089     gint        curr_bit_offset;
7090
7091     curr_bit_offset = bit_offset;
7092     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_SUPPLEMENTARY_PARAM_DESC], &item,
7093                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_SUPPLEMENTARY_PARAM_DESC].strptr);
7094
7095     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_priority_param_desc_utran_start, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
7096     curr_bit_offset += 1;
7097     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_priority_param_desc_utran_stop, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
7098     curr_bit_offset += 1;
7099
7100     /* 3G Measurement Control Parameters Description */
7101     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_3g_measurement_control_parameters_description))
7102     {
7103         /* 3G Measurement Control Parameters Description struct */
7104         if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_3g_measurement_control_parameters_description_struct))
7105         {
7106             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_control_param_desc_meas_ctrl_utran, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
7107             curr_bit_offset += 1;
7108         }
7109         while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_repeated_utran_measurement_control_parameters_struct))
7110         {
7111             curr_bit_offset += de_rr_utran_measurement_control_param_mi(tvb, subtree, curr_bit_offset);
7112         }
7113     }
7114     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
7115
7116     return(curr_bit_offset - bit_offset);
7117 }
7118
7119 static guint16
7120 de_rr_si2quater_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
7121 {
7122     proto_tree  *subtree2, *subtree3;
7123     proto_item  *item2, *item3;
7124     guint32      curr_offset;
7125     gint         bit_offset, bit_offset_sav, idx;
7126     guint8       value;
7127     guint8       tvb_len = tvb_reported_length(tvb);
7128     guint16      bit_len = tvb_len << 3;
7129
7130     curr_offset = offset;
7131     bit_offset  = curr_offset << 3;
7132
7133     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ba_ind, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7134     bit_offset += 1;
7135     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_ba_ind, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7136     bit_offset += 1;
7137     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_mp_change_mark, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7138     bit_offset += 1;
7139     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2quater_index, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
7140     bit_offset += 4;
7141     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2quater_count, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
7142     bit_offset += 4;
7143     if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_measurement_parameters_description))
7144     { /* Measurement Parameters Description */
7145         bit_offset_sav = bit_offset;
7146         subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_MEAS_PARAM_DESC], &item2,
7147                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_MEAS_PARAM_DESC].strptr);
7148         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_gsm_report_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7149         bit_offset += 1;
7150         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_serving_band_reporting, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
7151         bit_offset += 2;
7152         proto_item_set_len(item2, (bit_offset>>3) - (bit_offset_sav>>3)+1);
7153     }
7154     if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_gprs_real_time_difference_description))
7155     { /* GPRS Real Time Difference Description */
7156         bit_offset += de_rr_rtd_desc(tvb, subtree, bit_offset, DE_RR_REST_OCTETS_GPRS_RTD_DESC);
7157     }
7158     if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_gprs_bsic_description))
7159     { /* GPRS BSIC Description */
7160         bit_offset += de_rr_bsic_desc(tvb, subtree, bit_offset, DE_RR_REST_OCTETS_GPRS_BSIC_DESC);
7161     }
7162     if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_gprs_report_priority_description))
7163     { /* GPRS Report Priority Description */
7164         bit_offset += de_rr_report_priority_desc(tvb, subtree, bit_offset, DE_RR_REST_OCTETS_GPRS_REPORT_PRIO_DESC);
7165     }
7166     if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_gprs_measurement_parameters_description))
7167     { /* GPRS Measurement Parameters Description */
7168         bit_offset += de_rr_meas_param_desc(tvb, subtree, bit_offset, DE_RR_REST_OCTETS_GPRS_MEAS_PARAM_DESC);
7169     }
7170     if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_nc_measurement_parameters))
7171     { /* NC Measurement Parameters */
7172         bit_offset_sav = bit_offset;
7173         subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_NC_MEAS_PARAM], &item2,
7174                             gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_NC_MEAS_PARAM].strptr);
7175         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_network_control_order, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
7176         bit_offset += 2;
7177         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_nc_periods))
7178         {
7179             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_nc_non_drx_period, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7180             bit_offset += 3;
7181             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_nc_reporting_period_i, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7182             bit_offset += 3;
7183             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_nc_reporting_period_t, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7184             bit_offset += 3;
7185         }
7186         proto_item_set_len(item2, (bit_offset>>3) - (bit_offset_sav>>3)+1);
7187     }
7188     if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_si_2quater_extension_information))
7189     { /* SI 2quater Extension Information */
7190         bit_offset_sav = bit_offset;
7191         subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_SI2Q_EXT_INFO], &item2,
7192                                 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_SI2Q_EXT_INFO].strptr);
7193         idx = tvb_get_bits8(tvb,bit_offset,8);
7194         proto_tree_add_uint(subtree2, hf_gsm_a_rr_extension_length, tvb, bit_offset>>3, 1, idx);
7195         bit_offset += 8;
7196         proto_item_set_len(item2,((bit_offset+idx+1)>>3) - (bit_offset_sav>>3)+1);
7197         if (gsm_rr_csn_flag(tvb, subtree2, bit_offset++, hf_gsm_a_rr_ccn_support_description))
7198         { /* CCN Support Description */
7199             bit_offset_sav = bit_offset;
7200             subtree3 = proto_tree_add_subtree(subtree2, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_CCN_SUPPORT_DESC], &item3,
7201                                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_CCN_SUPPORT_DESC].strptr);
7202             value = tvb_get_bits8(tvb,bit_offset,7);
7203             proto_tree_add_uint(subtree3, hf_gsm_a_rr_number_cells, tvb, bit_offset>>3, 1, value);
7204             bit_offset += 7;
7205             idx -= 7;
7206             item2 = proto_tree_add_bytes_format(subtree3, hf_gsm_a_rr_ccn_supported, tvb, bit_offset>>3, (value>>3)+1, NULL, "CCN Supported: ");
7207             while (value)
7208             {
7209                 proto_item_append_text(item2,"%d",tvb_get_bits8(tvb,bit_offset,1));
7210                 bit_offset += 1;
7211                 value -= 1;
7212                 idx -= 1;
7213             }
7214             proto_item_set_len(item3, (bit_offset>>3) - (bit_offset_sav>>3)+1);
7215         }
7216         bit_offset += idx;
7217     }
7218     if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_3g_neighbour_cell_description))
7219     { /* 3G Neighbour Cell Description */
7220         bit_offset_sav = bit_offset;
7221         subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_NEIGH_CELL_DESC], &item2,
7222                                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_NEIGH_CELL_DESC].strptr);
7223         if (gsm_rr_csn_flag(tvb, subtree2, bit_offset++, hf_gsm_a_rr_index_start_3g))
7224         {
7225             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_index_start_3g, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
7226             bit_offset += 7;
7227         }
7228         if (gsm_rr_csn_flag(tvb, subtree2, bit_offset++, hf_gsm_a_rr_absolute_index_start_emr))
7229         {
7230             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_absolute_index_start_emr, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
7231             bit_offset += 7;
7232         }
7233         if (gsm_rr_csn_flag(tvb, subtree2, bit_offset++, hf_gsm_a_rr_utran_fdd_description))
7234         { /* UTRAN FDD Description */
7235             bit_offset += de_rr_si2quater_meas_info_utran_fdd_desc(tvb, subtree2, bit_offset);
7236         }
7237         if (gsm_rr_csn_flag(tvb, subtree2, bit_offset++, hf_gsm_a_rr_utran_tdd_description))
7238         { /* UTRAN TDD Description */
7239             bit_offset += de_rr_si2quater_meas_info_utran_tdd_desc(tvb, subtree2, bit_offset);
7240         }
7241         proto_item_set_len(item2, (bit_offset>>3) - (bit_offset_sav>>3)+1);
7242     }
7243     if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_3g_measurement_parameters_description))
7244     { /* 3G Measurement Parameters Description */
7245         bit_offset_sav = bit_offset;
7246         subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_MEAS_PARAM_DESC], &item2,
7247                                 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_MEAS_PARAM_DESC].strptr);
7248         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_qsearch_i, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
7249         bit_offset += 4;
7250         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_qsearch_c_initial, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7251         bit_offset += 1;
7252         if (gsm_rr_csn_flag(tvb, subtree2, bit_offset++, hf_gsm_a_rr_fdd_information))
7253         {
7254             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_qoffset, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
7255             bit_offset += 4;
7256             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_rep_quant, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7257             bit_offset += 1;
7258             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_multirat_reporting, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
7259             bit_offset += 2;
7260             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_qmin, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7261             bit_offset += 3;
7262         }
7263         if (gsm_rr_csn_flag(tvb, subtree2, bit_offset++, hf_gsm_a_rr_tdd_information))
7264         {
7265             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_tdd_qoffset, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
7266             bit_offset += 4;
7267             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_tdd_multirat_reporting, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
7268             bit_offset += 2;
7269         }
7270         proto_item_set_len(item2, (bit_offset>>3) - (bit_offset_sav>>3)+1);
7271     }
7272     if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_gprs_3g_measurement_parameters_description))
7273     { /* GPRS 3G Measurement Parameters Description */
7274         guint8 reporting_quant = 0;
7275         bit_offset_sav = bit_offset;
7276         subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_GPRS_3G_MEAS_PARAM_DESC], &item2,
7277                                 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_GPRS_3G_MEAS_PARAM_DESC].strptr);
7278         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_qsearch_p, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
7279         bit_offset += 4;
7280         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_3g_search_prio, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7281         bit_offset += 1;
7282         if (gsm_rr_csn_flag(tvb, subtree2, bit_offset++, hf_gsm_a_rr_fdd_parameters))
7283         {
7284             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_rep_quant, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7285             reporting_quant = gsm_rr_csn_flag(tvb, subtree2, bit_offset++, hf_gsm_a_rr_reporting_quantity_present);
7286             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_multirat_reporting, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
7287             bit_offset += 2;
7288         }
7289         if (gsm_rr_csn_flag(tvb, subtree2, bit_offset++, hf_gsm_a_rr_fdd_reporting_parameters))
7290         {
7291             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_reporting_offset, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7292             bit_offset += 3;
7293             if (reporting_quant == 0)
7294             {
7295               proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_reporting_threshold_rscp, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7296             }
7297             else
7298             {
7299               proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_reporting_threshold_ecn0, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7300             }
7301             bit_offset += 3;
7302         }
7303         if (gsm_rr_csn_flag(tvb, subtree2, bit_offset++, hf_gsm_a_rr_tdd_multirat_reporting_present))
7304         {
7305             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_tdd_multirat_reporting, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
7306             bit_offset += 2;
7307         }
7308         if (gsm_rr_csn_flag(tvb, subtree2, bit_offset++, hf_gsm_a_rr_tdd_reporting_parameters))
7309         {
7310             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_tdd_reporting_offset, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7311             bit_offset += 3;
7312             if (reporting_quant == 0)
7313             {
7314               proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_tdd_reporting_threshold_rscp, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7315             }
7316             else
7317             {
7318               proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_tdd_reporting_threshold_ecn0, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7319             }
7320             bit_offset += 3;
7321         }
7322         proto_item_set_len(item2, (bit_offset>>3) - (bit_offset_sav>>3)+1);
7323     }
7324     /* Null breakpoint */
7325     if (bit_len - bit_offset > 0)
7326     {
7327         /* There is still room left in the Rest Octets IE */
7328         if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_5))
7329         { /* Additions in Rel-5 */
7330             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_3g_additional_measurement_parameters_description))
7331             { /* 3G Additional Measurement Parameters Description */
7332                 bit_offset_sav = bit_offset;
7333                 subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC], &item2,
7334                                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC].strptr);
7335                 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_qmin_offset, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7336                 bit_offset += 3;
7337                 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_rscpmin, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
7338                 bit_offset += 4;
7339                 proto_item_set_len(item2, (bit_offset>>3) - (bit_offset_sav>>3)+1);
7340             }
7341             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_3g_additional_measurement_parameters_description_2))
7342             { /* 3G Additional Measurement Parameters Description 2 */
7343                 bit_offset += de_rr_3g_add_meas_param_desc2(tvb, subtree, bit_offset);
7344             }
7345             /* Null breakpoint */
7346             if (bit_len - bit_offset > 0)
7347             {
7348                 /* There is still room left in the Rest Octets IE */
7349                 if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_6))
7350                 { /* Additions in Rel-6 */
7351                     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_ccn_active, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7352                     bit_offset += 1;
7353
7354                     /* Null breakpoint */
7355                     if (bit_len - bit_offset > 0)
7356                     {
7357                         /* There is still room left in the Rest Octets IE */
7358                         if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_7))
7359                         { /* Additions in Rel-7 */
7360                             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_700_reporting))
7361                             {
7362                                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_700_reporting_offset, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7363                                 bit_offset += 3;
7364                                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_700_reporting_threshold, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7365                                 bit_offset += 3;
7366                             }
7367                             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_810_reporting))
7368                             {
7369                                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_810_reporting_offset, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7370                                 bit_offset += 3;
7371                                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_810_reporting_threshold, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7372                                 bit_offset += 3;
7373                             }
7374
7375                             /* Null breakpoint */
7376                             if (bit_len - bit_offset > 0)
7377                             {
7378                               /* There is still room left in the Rest Octets IE */
7379                               if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_8))
7380                               { /* Additions in Rel-8 */
7381                                 if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_3g_supplementary_parameters_description))
7382                                 {
7383                                   bit_offset += de_rr_priority_and_eutran_param_desc(tvb, subtree, bit_offset);
7384                                 }
7385                                 if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_3g_csg_description))
7386                                 {
7387                                   bit_offset += de_rr_3g_csg_desc(tvb, subtree, bit_offset);
7388                                 }
7389                                 if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_eutran_csg_description))
7390                                 {
7391                                   bit_offset += de_rr_eutran_csg_desc(tvb, subtree, bit_offset);
7392                                 }
7393                               }
7394                             }
7395                         }
7396                     }
7397                 }
7398             }
7399         }
7400     }
7401     gsm_rr_csn_padding_bits(subtree, tvb, bit_offset, tvb_len);
7402     return tvb_len - offset;
7403 }
7404
7405 /*
7406  * [3] 10.5.2.34 SI 3 Rest Octets
7407  */
7408 static const value_string gsm_a_rr_temporary_offset_vals[] = {
7409     { 0, "0 dB"},
7410     { 1, "10 dB"},
7411     { 2, "20 dB"},
7412     { 3, "30 dB"},
7413     { 4, "40 dB"},
7414     { 5, "50 dB"},
7415     { 6, "60 dB"},
7416     { 7, "infinity"},
7417     { 0, NULL }
7418 };
7419
7420 static const value_string gsm_a_rr_cell_reselect_offset_vals[] = {
7421     { 0, "0 dB"},
7422     { 1, "2 dB"},
7423     { 2, "4 dB"},
7424     { 3, "6 dB"},
7425     { 4, "8 dB"},
7426     { 5, "10 dB"},
7427     { 6, "12 dB"},
7428     { 7, "14 dB"},
7429     { 8, "16 dB"},
7430     { 9, "18 dB"},
7431     {10, "20 dB"},
7432     {11, "22 dB"},
7433     {12, "24 dB"},
7434     {13, "26 dB"},
7435     {14, "28 dB"},
7436     {15, "30 dB"},
7437     {16, "32 dB"},
7438     {17, "34 dB"},
7439     {18, "36 dB"},
7440     {19, "38 dB"},
7441     {20, "40 dB"},
7442     {21, "42 dB"},
7443     {22, "44 dB"},
7444     {23, "46 dB"},
7445     {24, "48 dB"},
7446     {25, "50 dB"},
7447     {26, "52 dB"},
7448     {27, "54 dB"},
7449     {28, "56 dB"},
7450     {29, "58 dB"},
7451     {30, "60 dB"},
7452     {31, "62 dB"},
7453     {32, "64 dB"},
7454     {33, "66 dB"},
7455     {34, "68 dB"},
7456     {35, "70 dB"},
7457     {36, "72 dB"},
7458     {37, "74 dB"},
7459     {38, "76 dB"},
7460     {39, "78 dB"},
7461     {40, "80 dB"},
7462     {41, "82 dB"},
7463     {42, "84 dB"},
7464     {43, "86 dB"},
7465     {44, "88 dB"},
7466     {45, "90 dB"},
7467     {46, "92 dB"},
7468     {47, "94 dB"},
7469     {48, "96 dB"},
7470     {49, "98 dB"},
7471     {50, "100 dB"},
7472     {51, "102 dB"},
7473     {52, "104 dB"},
7474     {53, "106 dB"},
7475     {54, "108 dB"},
7476     {55, "110 dB"},
7477     {56, "112 dB"},
7478     {57, "114 dB"},
7479     {58, "116 dB"},
7480     {59, "118 dB"},
7481     {60, "120 dB"},
7482     {61, "122 dB"},
7483     {62, "124 dB"},
7484     {63, "126 dB"},
7485     { 0, NULL }
7486 };
7487
7488 static const value_string gsm_a_rr_penalty_time_vals[] = {
7489     { 0, "20 s"},
7490     { 1, "40 s"},
7491     { 2, "60 s"},
7492     { 3, "80 s"},
7493     { 4, "100 s"},
7494     { 5, "120 s"},
7495     { 6, "140 s"},
7496     { 7, "160 s"},
7497     { 8, "180 s"},
7498     { 9, "200 s"},
7499     {10, "220 s"},
7500     {11, "240 s"},
7501     {12, "260 s"},
7502     {13, "280 s"},
7503     {14, "300 s"},
7504     {15, "320 s"},
7505     {16, "340 s"},
7506     {17, "360 s"},
7507     {18, "380 s"},
7508     {19, "400 s"},
7509     {20, "420 s"},
7510     {21, "440 s"},
7511     {22, "460 s"},
7512     {23, "480 s"},
7513     {24, "500 s"},
7514     {25, "520 s"},
7515     {26, "540 s"},
7516     {27, "560 s"},
7517     {28, "580 s"},
7518     {29, "600 s"},
7519     {30, "620 s"},
7520     {31, "Cell Reselect Offset is subtracted from C2 and Temporary Offset is ignored"},
7521     { 0, NULL }
7522 };
7523
7524 static gint
7525 de_rr_rest_oct_opt_sel_param(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
7526 {
7527     proto_tree *subtree;
7528     proto_item *item;
7529     gint        curr_bit_offset;
7530
7531     curr_bit_offset = bit_offset;
7532
7533     if (gsm_rr_csn_HL_flag(tvb, tree, 0, curr_bit_offset++, hf_gsm_a_rr_selection_parameters))
7534     { /* Selection Parameters */
7535         subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_OPTIONAL_SEL_PARAM], &item,
7536                             gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_OPTIONAL_SEL_PARAM].strptr);
7537         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_cbq, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
7538         curr_bit_offset += 1;
7539         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_cell_reselect_offset, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
7540         curr_bit_offset += 6;
7541         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_temporary_offset, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
7542         curr_bit_offset += 3;
7543         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_penalty_time, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
7544         curr_bit_offset += 5;
7545         proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
7546     }
7547
7548     return (curr_bit_offset - bit_offset);
7549 }
7550
7551 static const value_string gsm_a_rr_si13_position_vals[] = {
7552     { 0, "SYSTEM INFORMATION TYPE 13 message is sent on BCCH Norm"},
7553     { 1, "SYSTEM INFORMATION TYPE 13 message is sent on BCCH Ext"},
7554     { 0, NULL }
7555 };
7556
7557 static gint
7558 de_rr_rest_oct_gprs_indicator(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
7559 {
7560     proto_tree *subtree;
7561     gint        curr_bit_offset;
7562
7563     curr_bit_offset = bit_offset;
7564
7565     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, 1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_GPRS_INDICATOR], NULL,
7566                             gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_GPRS_INDICATOR].strptr);
7567     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_gprs_ra_colour, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
7568     curr_bit_offset += 3;
7569     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si13_position, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
7570     curr_bit_offset += 1;
7571
7572     return (curr_bit_offset - bit_offset);
7573 }
7574
7575 static const value_string gsm_a_rr_power_offset_vals[] = {
7576     { 0, "0 dB"},
7577     { 1, "2 dB"},
7578     { 2, "4 dB"},
7579     { 3, "8 dB"},
7580     { 0, NULL }
7581 };
7582
7583 static const true_false_string gsm_a_rr_si2quater_position_value = {
7584     "SYSTEM INFORMATION TYPE 2 quater message is sent on BCCH Ext",
7585     "SYSTEM INFORMATION TYPE 2 quater message is sent on BCCH Norm"
7586 };
7587
7588 static const true_false_string gsm_a_rr_si13alt_position_value = {
7589     "If Iu mode is supported in the cell, SYSTEM INFORMATION TYPE 13alt message is sent on BCCH Ext",
7590     "If Iu mode is supported in the cell, SYSTEM INFORMATION TYPE 13alt message is sent on BCCH Norm"
7591 };
7592
7593 static const true_false_string gsm_a_rr_si21_position_value = {
7594     "SYSTEM INFORMATION TYPE 21 message is sent on BCCH Ext",
7595     "SYSTEM INFORMATION TYPE 21 message is sent on BCCH Norm"
7596     };
7597
7598 static guint16
7599 de_rr_si3_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
7600 {
7601     guint32  curr_offset;
7602     gint     bit_offset;
7603     gboolean gprs_indicator;
7604     guint8   tvb_len = tvb_reported_length(tvb);
7605
7606     curr_offset = offset;
7607     bit_offset = curr_offset << 3;
7608
7609     bit_offset += de_rr_rest_oct_opt_sel_param(tvb, subtree, bit_offset);
7610
7611     if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_power_offset_present))
7612     { /* Optional Power Offset */
7613         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_power_offset, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
7614         bit_offset += 2;
7615     }
7616     gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_system_information_type_2ter);
7617     gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_early_classmark_sending);
7618     if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_scheduling_if_and_where))
7619     { /* Scheduling if and where */
7620         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_where, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7621         bit_offset += 3;
7622     }
7623     gprs_indicator = gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_gprs_indicator);
7624     if (gprs_indicator)
7625     { /* GPRS indicator */
7626         bit_offset += de_rr_rest_oct_gprs_indicator(tvb, subtree, bit_offset);
7627     }
7628     gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_3g_early_classmark_sending_restriction);
7629     if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_si2quater_indicator))
7630     { /* SI2quater Indicator */
7631         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2quater_position, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7632         bit_offset += 1;
7633     }
7634     if (gprs_indicator == FALSE)
7635     {
7636         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si13alt_position, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7637         bit_offset += 1;
7638     }
7639     if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_si21_indicator))
7640         { /* SI21 Indicator */
7641         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si21_position, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7642         bit_offset += 1;
7643     }
7644     gsm_rr_csn_padding_bits(subtree, tvb, bit_offset, tvb_len);
7645     return tvb_len - offset;
7646 }
7647
7648 /*
7649  * [3] 10.5.2.32 SI 4 Rest Octets
7650  */
7651 static const value_string gsm_a_rr_prio_thr_vals[] = {
7652     { 0, "0 dB"},
7653     { 1, "6 dB"},
7654     { 2, "12 dB"},
7655     { 3, "18 dB"},
7656     { 4, "24 dB"},
7657     { 5, "30 dB"},
7658     { 6, "36 dB"},
7659     { 7, "Infinite"},
7660     { 0, NULL }
7661 };
7662
7663 static const value_string gsm_a_rr_lsa_offset_vals[] = {
7664     { 0, "0 dB"},
7665     { 1, "4 dB"},
7666     { 2, "8 dB"},
7667     { 3, "16 dB"},
7668     { 4, "24 dB"},
7669     { 5, "32 dB"},
7670     { 6, "48 dB"},
7671     { 7, "64 dB"},
7672     { 0, NULL }
7673 };
7674
7675 static guint16
7676 de_rr_si4_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
7677 {
7678     proto_tree *subtree2, *subtree3;
7679     proto_item *item2, *item3;
7680     guint32     curr_offset;
7681     gint        bit_offset, bit_offset_sav;
7682     guint8      tvb_len = tvb_reported_length(tvb);
7683     guint16     bit_len = tvb_len << 3;
7684
7685     curr_offset = offset;
7686     bit_offset = curr_offset << 3;
7687
7688     subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_SI4_REST_OCTETS_O], &item2,
7689                             gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_SI4_REST_OCTETS_O].strptr);
7690
7691     bit_offset += de_rr_rest_oct_opt_sel_param(tvb, subtree2, bit_offset);
7692
7693     if (gsm_rr_csn_HL_flag(tvb, subtree2, bit_len, bit_offset++, hf_gsm_a_rr_power_offset_present))
7694     { /* Optional Power Offset */
7695         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_power_offset, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
7696         bit_offset += 2;
7697     }
7698     if (gsm_rr_csn_HL_flag(tvb, subtree2, bit_len, bit_offset++, hf_gsm_a_rr_gprs_indicator))
7699     {
7700         bit_offset += de_rr_rest_oct_gprs_indicator(tvb, subtree2, bit_offset);
7701     }
7702     proto_item_set_len(item2,(bit_offset>>3) + 1 - curr_offset);
7703
7704     if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_rr_si4_rest_octets_s))
7705     { /* SI4 Rest Octets_S */
7706         bit_offset_sav = bit_offset;
7707         subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_SI4_REST_OCTETS_S], &item2,
7708                                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_SI4_REST_OCTETS_S].strptr);
7709
7710         if (gsm_rr_csn_HL_flag(tvb, subtree2, bit_len, bit_offset++, hf_gsm_a_rr_lsa_parameters))
7711         { /* LSA Parameters */
7712             subtree3 = proto_tree_add_subtree(subtree2, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_LSA_PARAMETERS], &item3,
7713                                 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_LSA_PARAMETERS].strptr);
7714             proto_tree_add_bits_item(subtree3, hf_gsm_a_rr_prio_thr, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7715             bit_offset += 3;
7716             proto_tree_add_bits_item(subtree3, hf_gsm_a_rr_lsa_offset, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7717             bit_offset += 3;
7718             if (gsm_rr_csn_flag(tvb,subtree3, bit_offset++, hf_gsm_a_rr_mcc_mnc_parameters))
7719             {
7720                 proto_tree_add_bits_item(subtree3, hf_gsm_a_rr_mcc, tvb, bit_offset, 12, ENC_BIG_ENDIAN);
7721                 bit_offset += 12;
7722                 proto_tree_add_bits_item(subtree3, hf_gsm_a_rr_mnc, tvb, bit_offset, 12, ENC_BIG_ENDIAN);
7723                 bit_offset += 12;
7724             }
7725             proto_item_set_len(item2, (bit_offset>>3) - (bit_offset_sav>>3)+1);
7726         }
7727
7728         if (gsm_rr_csn_HL_flag(tvb, subtree2, bit_len, bit_offset++, hf_gsm_a_rr_cell_id_present))
7729         { /* Cell Identity */
7730             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_cell_id, tvb, bit_offset, 16, ENC_BIG_ENDIAN);
7731             bit_offset += 16;
7732         }
7733
7734         if (gsm_rr_csn_HL_flag(tvb, subtree2, bit_len, bit_offset++, hf_gsm_a_rr_lsa_id_information))
7735         { /* LSA ID information */
7736             subtree3 = proto_tree_add_subtree(subtree2, tvb, bit_offset>>3, len, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_LSA_ID_INFO], &item3,
7737                                                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_LSA_ID_INFO].strptr);
7738             do
7739             {
7740                 if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_lsa_id_type))
7741                 {
7742                     proto_tree_add_bits_item(subtree3, hf_gsm_a_rr_short_lsa_id, tvb, bit_offset, 10, ENC_BIG_ENDIAN);
7743                     bit_offset += 10;
7744                 }
7745                 else
7746                 {
7747                     proto_tree_add_bits_item(subtree3, hf_gsm_a_rr_lsa_id, tvb, bit_offset, 24, ENC_BIG_ENDIAN);
7748                     bit_offset += 24;
7749                 }
7750             } while (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_additional_lsa_id));
7751         }
7752         if (gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_rr_cbq3_present))
7753         {
7754             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_cbq3, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
7755             bit_offset += 3;
7756         }
7757         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_si13alt_position_present))
7758         {
7759             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si13alt_position, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7760             bit_offset += 1;
7761         }
7762         proto_item_set_len(item2, (bit_offset>>3) - (bit_offset_sav>>3)+1);
7763     }
7764     else
7765     { /* Break indicator */
7766         gsm_rr_csn_HL_flag(tvb, subtree, bit_len, bit_offset++, hf_gsm_a_rr_break_indicator);
7767     }
7768     /* Truncation allowed (see 44.018 section 8.9 */
7769     gsm_rr_csn_padding_bits(subtree, tvb, bit_offset, tvb_len);
7770     return tvb_len - offset;
7771 }
7772
7773 /*
7774  * [3] 10.5.2.35a SI 6 Rest Octets
7775  */
7776 static const true_false_string gsm_a_rr_paging_channel_restructuring_value = {
7777     "Paging channel is restructured",
7778     "Paging channel is not restructured"
7779 };
7780
7781 static const true_false_string gsm_a_rr_vbs_vgcs_inband_notifications_value = {
7782     "The mobile shall be notified on incoming high priority VBS/VGCS calls through NOTIFICATION/FACCH, the mobile need not to inspect the NCH",
7783     "The network does not provide notification on FACCH so that the mobile should inspect the NCH for notifications"
7784 };
7785
7786 static const true_false_string gsm_a_rr_vbs_vgcs_inband_pagings_value = {
7787     "The mobile shall be notified on incoming high priority point-to-point calls through NOTIFICATION/FACCH, the mobile need not to inspect the PCH",
7788     "The network does not provide paging information on FACCH so that the mobile should inspect the PCH for pagings"
7789 };
7790
7791 static const value_string gsm_a_rr_max_lapdm_vals[] = {
7792     { 0, "Any message segmented in up to 5 LAPDm frames"},
7793     { 1, "Any message segmented in up to 6 LAPDm frames"},
7794     { 2, "Any message segmented in up to 7 LAPDm frames"},
7795     { 3, "Any message segmented in up to 8 LAPDm frames"},
7796     { 4, "Any message segmented in up to 9 LAPDm frames"},
7797     { 5, "Any message segmented in up to 10 LAPDm frames"},
7798     { 6, "Any message segmented in up to 11 LAPDm frames"},
7799     { 7, "Any message segmented in up to 12 LAPDm frames"},
7800     { 0, NULL }
7801 };
7802
7803 static const true_false_string gsm_a_rr_dedicated_mode_mbms_notification_support_value = {
7804     "The cell supports the Dedicated Mode MBMS Notification procedures",
7805     "The cell does not support the Dedicated Mode MBMS Notification procedures"
7806 };
7807
7808 static const true_false_string gsm_a_rr_mnci_support_value = {
7809     "The cell supports the distribution of MBMS NEIGHBOURING CELL INFORMATION messages",
7810     "The cell does not support the distribution of MBMS NEIGHBOURING CELL INFORMATION messages"
7811 };
7812
7813 static guint16
7814 de_rr_si6_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
7815 {
7816     proto_tree *subtree2;
7817     proto_item *item2;
7818     guint32     curr_offset;
7819     gint        bit_offset, bit_offset_sav;
7820     guint8      value;
7821     guint8      tvb_len = tvb_reported_length(tvb);
7822
7823     curr_offset = offset;
7824     bit_offset = curr_offset << 3;
7825
7826     if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_pch_and_nch_info))
7827     { /* PCH and NCH Info */
7828         bit_offset_sav = bit_offset;
7829         subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_PCH_AND_NCH_INFO], &item2,
7830                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_PCH_AND_NCH_INFO].strptr);
7831         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_paging_channel_restructuring, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7832         bit_offset += 1;
7833         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_nln_sacch, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
7834         bit_offset += 2;
7835         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_call_prio_present))
7836         {
7837             proto_tree_add_bits_item(subtree2, hf_gsm_a_call_prio, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7838             bit_offset += 3;
7839         }
7840         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_nln_status_sacch, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7841         bit_offset += 1;
7842         proto_item_set_len(item2, (bit_offset>>3) - (bit_offset_sav>>3)+1);
7843     }
7844     if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_vbs_vgcs_options))
7845     { /* VBS/VGCS options */
7846         bit_offset_sav = bit_offset;
7847         subtree2 = proto_tree_add_subtree(subtree, tvb,bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_VBS_VGCS_OPTIONS], &item2,
7848                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_VBS_VGCS_OPTIONS].strptr);
7849         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_vbs_vgcs_inband_notifications, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7850         bit_offset += 1;
7851         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_vbs_vgcs_inband_pagings, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7852         bit_offset += 1;
7853         proto_item_set_len(item2, (bit_offset>>3) - (bit_offset_sav>>3)+1);
7854     }
7855     value = gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_dtm);
7856     if (value == TRUE)
7857     {
7858         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rac, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
7859         bit_offset += 8;
7860         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_max_lapdm, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
7861         bit_offset += 3;
7862     }
7863     gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_band_indicator);
7864     if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_gprs_ms_txpwr_max_ccch_present))
7865     {
7866         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_gprs_ms_txpwr_max_ccch, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
7867         bit_offset += 5;
7868     }
7869     if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_mbms_procedures))
7870     { /* MBMS Procedures */
7871         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_dedicated_mode_mbms_notification_support, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7872         bit_offset += 1;
7873         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_mnci_support, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
7874         bit_offset += 1;
7875     }
7876     if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_7))
7877     { /* Additions in Release 7 */
7878         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_amr_config_present))
7879         {
7880             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_amr_config, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
7881             bit_offset += 4;
7882         }
7883     }
7884     gsm_rr_csn_padding_bits(subtree, tvb, bit_offset, tvb_len);
7885     return tvb_len - offset;
7886 }
7887
7888 /* [3] 10.5.2.36 SI 7 Rest Octets
7889  * [3] 10.5.2.37 SI 8 Rest Octets
7890  * [3] 10.5.2.37a SI 9 Rest Octets
7891  */
7892
7893 /*
7894  * [3] 10.5.2.37b SI 13 Rest Octets
7895  */
7896 static const value_string gsm_a_rr_si_change_field_vals[] = {
7897     {  0, "Update of unspecified SI message or SI messages"},
7898     {  1, "Update of SI1 message"},
7899     {  2, "Update of SI2, SI2 bis or SI2 ter message or any instance of SI2quater messages"},
7900     {  3, "Update of SI3, SI4, SI7, SI8, SI16 or SI17 message"},
7901     {  4, "Update of SI9 message"},
7902     {  5, "Update of SI18 or SI20 message"},
7903     {  6, "Update of SI19 message"},
7904     {  7, "Update of SI15 message"},
7905     {  8, "Update of SI2n message"},
7906     {  9, "Update of unknown SI message type"},
7907     { 10, "Update of unknown SI message type"},
7908     { 11, "Update of unknown SI message type"},
7909     { 12, "Update of unknown SI message type"},
7910     { 13, "Update of unknown SI message type"},
7911     { 14, "Update of unknown SI message type"},
7912     { 15, "Update of unknown SI message type"},
7913     {  0, NULL }
7914 };
7915
7916 static const value_string gsm_a_rr_psi1_repeat_period_vals[] = {
7917     {  0, "1 multiframe"},
7918     {  1, "2 multiframes"},
7919     {  2, "3 multiframes"},
7920     {  3, "4 multiframes"},
7921     {  4, "5 multiframes"},
7922     {  5, "6 multiframes"},
7923     {  6, "7 multiframes"},
7924     {  7, "8 multiframes"},
7925     {  8, "9 multiframes"},
7926     {  9, "10 multiframes"},
7927     { 10, "11 multiframes"},
7928     { 11, "12 multiframes"},
7929     { 12, "13 multiframes"},
7930     { 13, "14 multiframes"},
7931     { 14, "15 multiframes"},
7932     { 15, "16 multiframes"},
7933     {  0, NULL }
7934 };
7935
7936 static const value_string gsm_a_rr_pbcch_pb_vals[] = {
7937     {  0, "0 dB"},
7938     {  1, "-2 dB"},
7939     {  2, "-4 dB"},
7940     {  3, "-6 dB"},
7941     {  4, "-8 dB"},
7942     {  5, "-10 dB"},
7943     {  6, "-12 dB"},
7944     {  7, "-14 dB"},
7945     {  8, "-16 dB"},
7946     {  9, "-18 dB"},
7947     { 10, "-20 dB"},
7948     { 11, "-22 dB"},
7949     { 12, "-24 dB"},
7950     { 13, "-26 dB"},
7951     { 14, "-28 dB"},
7952     { 15, "-30 dB"},
7953     {  0, NULL }
7954 };
7955
7956 static const true_false_string gsm_a_rr_spgc_ccch_sup_value = {
7957     "SPLIT_PG_CYCLE is supported on CCCH in this cell",
7958     "SPLIT_PG_CYCLE is not supported on CCCH in this cell"
7959 };
7960
7961 static const value_string gsm_a_rr_priority_access_thr_vals[] = {
7962     {  0, "Packet access is not allowed in the cell"},
7963     {  1, "Packet access is not allowed in the cell"},
7964     {  2, "Packet access is not allowed in the cell"},
7965     {  3, "Packet access is allowed for priority level 1"},
7966     {  4, "Packet access is allowed for priority level 1 to 2"},
7967     {  5, "Packet access is allowed for priority level 1 to 3"},
7968     {  6, "Packet access is allowed for priority level 1 to 4"},
7969     {  7, "Packet access is allowed for priority level 1 to 4"},
7970     {  0, NULL }
7971 };
7972
7973 static gint
7974 de_rr_rest_oct_gprs_mobile_allocation(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
7975 {
7976     proto_tree *subtree;
7977     proto_item *item;
7978     gint        curr_bit_offset;
7979     guint8      value;
7980     guint64     ma_length;
7981
7982     curr_bit_offset = bit_offset;
7983
7984     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_GPRS_MOBILE_ALLOC], &item,
7985                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_GPRS_MOBILE_ALLOC].strptr);
7986     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_hsn, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
7987     curr_bit_offset += 6;
7988     while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_rfl_number_present))
7989     {
7990         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rfl_number, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
7991         curr_bit_offset += 4;
7992     }
7993     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_gprs_mobile_allocation))
7994     {
7995         while (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_arfcn_index_list))
7996         {
7997             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_arfcn_index, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
7998             curr_bit_offset += 6;
7999         }
8000     }
8001     else
8002     {
8003         proto_tree_add_bits_ret_val(subtree, hf_gsm_a_rr_ma_length, tvb, curr_bit_offset, 6, &ma_length, ENC_BIG_ENDIAN);
8004         curr_bit_offset += 6;
8005         value = (gint)ma_length + 1;
8006         item = proto_tree_add_bytes_format(subtree, hf_gsm_a_rr_ma_bitmap, tvb, curr_bit_offset>>3, (value>>3)+1, NULL, "MA Bitmap: ");
8007         while (value)
8008         {
8009             proto_item_append_text(item,"%d",tvb_get_bits8(tvb,curr_bit_offset,1));
8010             curr_bit_offset += 1;
8011             value -= 1;
8012         }
8013     }
8014     proto_item_set_len(item,((curr_bit_offset>>3) - (bit_offset>>3) + 1));
8015
8016     return (curr_bit_offset - bit_offset);
8017 }
8018
8019 static const value_string gsm_a_rr_nmo_vals[] = {
8020     { 0, "Network Mode of Operation I"},
8021     { 1, "Network Mode of Operation II"},
8022     { 2, "Network Mode of Operation III"},
8023     { 3, "Reserved"},
8024     { 0, NULL }
8025 };
8026
8027 static const value_string gsm_a_rr_t3168_vals[] = {
8028     { 0, "500 ms"},
8029     { 1, "1000 ms"},
8030     { 2, "1500 ms"},
8031     { 3, "2000 ms"},
8032     { 4, "2500 ms"},
8033     { 5, "3000 ms"},
8034     { 6, "3500 ms"},
8035     { 7, "4000 ms"},
8036     { 0, NULL }
8037 };
8038
8039 static const value_string gsm_a_rr_t3192_vals[] = {
8040     { 0, "500 ms"},
8041     { 1, "1000 ms"},
8042     { 2, "1500 ms"},
8043     { 3, "0 ms"},
8044     { 4, "80 ms"},
8045     { 5, "120 ms"},
8046     { 6, "160 ms"},
8047     { 7, "200 ms"},
8048     { 0, NULL }
8049 };
8050
8051 static const value_string gsm_a_rr_drx_timer_max_vals[] = {
8052     { 0, "0 s"},
8053     { 1, "1 s"},
8054     { 2, "2 s"},
8055     { 3, "4 s"},
8056     { 4, "8 s"},
8057     { 5, "16 s"},
8058     { 6, "32 s"},
8059     { 7, "64 s"},
8060     { 0, NULL }
8061 };
8062
8063 static const true_false_string gsm_a_rr_access_burst_type_value = {
8064     "11-bit format shall be used",
8065     "8-bit format shall be used"
8066 };
8067
8068 static const true_false_string gsm_a_rr_control_ack_type_value = {
8069     "Default format is RLC/MAC control block",
8070     "Default format is four access bursts"
8071 };
8072
8073 static const value_string gsm_a_rr_pan_max_vals[] = {
8074     { 0, "maximum value allowed for counter N3102 is 4"},
8075     { 1, "maximum value allowed for counter N3102 is 8"},
8076     { 2, "maximum value allowed for counter N3102 is 12"},
8077     { 3, "maximum value allowed for counter N3102 is 16"},
8078     { 4, "maximum value allowed for counter N3102 is 20"},
8079     { 5, "maximum value allowed for counter N3102 is 24"},
8080     { 6, "maximum value allowed for counter N3102 is 28"},
8081     { 7, "maximum value allowed for counter N3102 is 32"},
8082     { 0, NULL }
8083 };
8084
8085 static const true_false_string gsm_a_rr_egprs_packet_channel_request_value = {
8086     "Use two phase packet access with PACKET CHANNEL REQUEST message for uplink TBF establishment on the PRACH",
8087     "Use EGPRS PACKET CHANNEL REQUEST message for uplink TBF establishment on the PRACH"
8088 };
8089
8090 static const value_string gsm_a_rr_bep_period_vals[] = {
8091     {  0, "1"},
8092     {  1, "2"},
8093     {  2, "3"},
8094     {  3, "4"},
8095     {  4, "5"},
8096     {  5, "7"},
8097     {  6, "10"},
8098     {  7, "12"},
8099     {  8, "15"},
8100     {  9, "20"},
8101     { 10, "25"},
8102     { 11, "Reserved"},
8103     { 12, "Reserved"},
8104     { 13, "Reserved"},
8105     { 14, "Reserved"},
8106     { 15, "Reserved"},
8107     {  0, NULL }
8108 };
8109
8110 static const true_false_string gsm_a_rr_pfc_feature_mode_value = {
8111     "The network supports packet flow context procedures",
8112     "The network does not support packet flow context procedures"
8113 };
8114
8115 static const true_false_string gsm_a_rr_dtm_support_value = {
8116     "The cell supports DTM procedures",
8117     "The cell does not support DTM procedures"
8118 };
8119
8120 static const true_false_string gsm_a_rr_bss_paging_coordination_value = {
8121     "The cell supports Circuit-Switched paging coordination",
8122     "The cell does not support Circuit-Switched paging coordination"
8123 };
8124
8125 static const true_false_string gsm_a_rr_ccn_active_value = {
8126     "CCN is enabled in the cell",
8127     "CCN is disabled in the cell"
8128 };
8129
8130 static const true_false_string gsm_a_rr_nw_ext_utbf_value = {
8131     "The extended uplink TBF mode is supported by the network",
8132     "The extended uplink TBF mode is not supported by the network"
8133 };
8134
8135 static const true_false_string gsm_a_rr_multiple_tbf_capability_value = {
8136     "The cell supports multiple TBF procedures",
8137     "The cell does not support multiple TBF procedures"
8138 };
8139
8140 static const true_false_string gsm_a_rr_ext_utbf_no_data_value = {
8141     "The mobile station may refrain from sending a PACKET UPLINK DUMMY CONTROL BLOCK message when there is no other RLC/MAC block ready to send in an uplink radio block allocated by the network",
8142     "The mobile station shall send a PACKET UPLINK DUMMY CONTROL BLOCK message when there is no other RLC/MAC block ready to send in an uplink radio block allocated by the network"
8143 };
8144
8145 static const true_false_string gsm_a_rr_dtm_enhancements_capability_value = {
8146     "The cell supports enhanced DTM CS establishment and enhanced DTM CS release procedures",
8147     "The cell does not support enhanced DTM CS establishment and enhanced DTM CS release procedures"
8148 };
8149
8150 static const true_false_string gsm_a_rr_reduced_latency_access_value = {
8151     "The cell supports \"One Phase Access Request by Reduced Latency MS\"",
8152     "The cell does not support \"One Phase Access Request by Reduced Latency MS\""
8153 };
8154
8155 static const value_string gsm_a_rr_alpha_vals[] = {
8156     {  0, "0.0"},
8157     {  1, "0.1"},
8158     {  2, "0.2"},
8159     {  3, "0.3"},
8160     {  4, "0.4"},
8161     {  5, "0.5"},
8162     {  6, "0.6"},
8163     {  7, "0.7"},
8164     {  8, "0.8"},
8165     {  9, "0.9"},
8166     { 10, "1.0"},
8167     { 11, "1.0"},
8168     { 12, "1.0"},
8169     { 13, "1.0"},
8170     { 14, "1.0"},
8171     { 15, "1.0"},
8172     {  0, NULL }
8173 };
8174
8175 static const value_string gsm_a_rr_t_avg_x_vals[] = {
8176     {  0, "2^(0/2) / 6 multiframes"},
8177     {  1, "2^(1/2) / 6 multiframes"},
8178     {  2, "2^(2/2) / 6 multiframes"},
8179     {  3, "2^(3/2) / 6 multiframes"},
8180     {  4, "2^(4/2) / 6 multiframes"},
8181     {  5, "2^(5/2) / 6 multiframes"},
8182     {  6, "2^(6/2) / 6 multiframes"},
8183     {  7, "2^(7/2) / 6 multiframes"},
8184     {  8, "2^(8/2) / 6 multiframes"},
8185     {  9, "2^(9/2) / 6 multiframes"},
8186     { 10, "2^(10/2) / 6 multiframes"},
8187     { 11, "2^(11/2) / 6 multiframes"},
8188     { 12, "2^(12/2) / 6 multiframes"},
8189     { 13, "2^(13/2) / 6 multiframes"},
8190     { 14, "2^(14/2) / 6 multiframes"},
8191     { 15, "2^(15/2) / 6 multiframes"},
8192     { 16, "2^(16/2) / 6 multiframes"},
8193     { 17, "2^(17/2) / 6 multiframes"},
8194     { 18, "2^(18/2) / 6 multiframes"},
8195     { 19, "2^(19/2) / 6 multiframes"},
8196     { 20, "2^(20/2) / 6 multiframes"},
8197     { 21, "2^(21/2) / 6 multiframes"},
8198     { 22, "2^(22/2) / 6 multiframes"},
8199     { 23, "2^(23/2) / 6 multiframes"},
8200     { 24, "2^(24/2) / 6 multiframes"},
8201     { 25, "2^(25/2) / 6 multiframes"},
8202     { 26, "2^(25/2) / 6 multiframes"},
8203     { 27, "2^(25/2) / 6 multiframes"},
8204     { 28, "2^(25/2) / 6 multiframes"},
8205     { 29, "2^(25/2) / 6 multiframes"},
8206     { 30, "2^(25/2) / 6 multiframes"},
8207     { 31, "2^(25/2) / 6 multiframes"},
8208     {  0, NULL }
8209 };
8210
8211 static const true_false_string gsm_a_rr_pc_meas_chan_value = {
8212     "Downlink measurements for power control shall be made on PDCH",
8213     "Downlink measurements for power control shall be made on BCCH"
8214 };
8215
8216 static const value_string gsm_a_rr_n_avg_i_vals[] = {
8217     {  0, "2^(0/2)"},
8218     {  1, "2^(1/2)"},
8219     {  2, "2^(2/2)"},
8220     {  3, "2^(3/2)"},
8221     {  4, "2^(4/2)"},
8222     {  5, "2^(5/2)"},
8223     {  6, "2^(6/2)"},
8224     {  7, "2^(7/2)"},
8225     {  8, "2^(8/2)"},
8226     {  9, "2^(9/2)"},
8227     { 10, "2^(10/2)"},
8228     { 11, "2^(11/2)"},
8229     { 12, "2^(12/2)"},
8230     { 13, "2^(13/2)"},
8231     { 14, "2^(14/2)"},
8232     { 15, "2^(15/2)"},
8233     {  0, NULL }
8234 };
8235
8236 static const true_false_string gsm_a_rr_sgsnr_value = {
8237     "SGSN is Release '99 onwards",
8238     "SGSN is Release '98 or older"
8239 };
8240
8241 static const true_false_string gsm_a_rr_si_status_ind_value = {
8242     "The network supports the PACKET SI STATUS message",
8243     "The network does not support the PACKET SI STATUS message"
8244 };
8245
8246 static const value_string gsm_a_rr_lb_ms_txpwr_max_cch_vals[] = {
8247     {  0, "43 dBm"},
8248     {  1, "41 dBm"},
8249     {  2, "39 dBm"},
8250     {  3, "37 dBm"},
8251     {  4, "35 dBm"},
8252     {  5, "33 dBm"},
8253     {  6, "31 dBm"},
8254     {  7, "29 dBm"},
8255     {  8, "27 dBm"},
8256     {  9, "25 dBm"},
8257     { 10, "23 dBm"},
8258     { 11, "21 dBm"},
8259     { 12, "19 dBm"},
8260     { 13, "17 dBm"},
8261     { 14, "15 dBm"},
8262     { 15, "13 dBm"},
8263     { 16, "11 dBm"},
8264     { 17, "9 dBm"},
8265     { 18, "7 dBm"},
8266     { 19, "5 dBm"},
8267     { 20, "5 dBm"},
8268     { 21, "5 dBm"},
8269     { 22, "5 dBm"},
8270     { 23, "5 dBm"},
8271     { 24, "5 dBm"},
8272     { 25, "5 dBm"},
8273     { 26, "5 dBm"},
8274     { 27, "5 dBm"},
8275     { 28, "5 dBm"},
8276     { 29, "5 dBm"},
8277     { 30, "5 dBm"},
8278     { 31, "5 dBm"},
8279     {  0, NULL }
8280 };
8281
8282 static const value_string gsm_a_rr_si2n_support_vals[] = {
8283     { 0, "SI2n is not supported"},
8284     { 1, "SI2n is supported on PACCH"},
8285     { 2, "SI2n is supported on PACCH and broadcast on BCCH"},
8286     { 3, "SI2n is supported on PACCH and broadcast on BCCH Ext"},
8287     { 0, NULL }
8288 };
8289
8290 static const value_string gsm_a_rr_peo_dsc_vals[] = {
8291     { 0, "DSC = 4" },
8292     { 1, "DSC = 6" },
8293     { 2, "DSC = 8" },
8294     { 3, "DSC = 10" },
8295     { 0, NULL }
8296 };
8297
8298 static const value_string gsm_a_rr_c1_delta_min_vals[] = {
8299     { 0, "3 dB" },
8300     { 1, "6 dB" },
8301     { 2, "9 dB" },
8302     { 3, "12 dB" },
8303     { 0, NULL }
8304 };
8305
8306 static const value_string gsm_a_rr_c1_delta_max_vals[] = {
8307     { 0, "3 dB" },
8308     { 1, "6 dB" },
8309     { 2, "9 dB" },
8310     { 3, "12 dB" },
8311     { 4, "15 dB" },
8312     { 5, "18 dB" },
8313     { 6, "21 dB" },
8314     { 7, "24 dB" },
8315     { 0, NULL }
8316 };
8317
8318 static const true_false_string gsm_si_change_alt_value = {
8319     "A mobile station supporting network sharing should not attempt to re-read the SI2quater message",
8320     "A mobile station supporting network sharing shall fully take into account a change of system information \nsignalled by the SI_CHANGE_FIELD value '2', SI2quater included"
8321     };
8322
8323 static guint16
8324 de_rr_si13_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8325 {
8326     proto_tree *subtree2;
8327     proto_item *item2;
8328     guint       bit_offset, bit_offset_sav;
8329     guint8      tvb_len = tvb_reported_length(tvb);
8330     guint16     bit_len = tvb_len << 3;
8331     bit_offset          = offset << 3;
8332
8333     if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_si13_contents))
8334     {
8335         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bcch_change_mark, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
8336         bit_offset += 3;
8337         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si_change_field, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
8338         bit_offset += 4;
8339         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_si13_change_mark_present))
8340         {
8341             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si13_change_mark, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
8342             bit_offset += 2;
8343             bit_offset += de_rr_rest_oct_gprs_mobile_allocation(tvb, subtree, bit_offset);
8344         }
8345         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_pbcch))
8346         { /* PBCCH present in the cell */
8347             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_psi1_repeat_period, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
8348             bit_offset += 4;
8349             bit_offset_sav = bit_offset;
8350             subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_PBCCH_DESC], &item2,
8351                                             gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_PBCCH_DESC].strptr);
8352             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_pbcch_pb, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
8353             bit_offset += 4;
8354             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_pbcch_tsc, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
8355             bit_offset += 3;
8356             proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_pbcch_tn, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
8357             bit_offset += 3;
8358             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_maio_present))
8359             {
8360                 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_maio, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
8361                 bit_offset += 6;
8362             }
8363             else
8364             {
8365                 if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_arfcn_present))
8366                 {
8367                     proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_arfcn, tvb, bit_offset, 10, ENC_BIG_ENDIAN);
8368                     bit_offset += 10;
8369                 }
8370                 else
8371                     proto_tree_add_item(subtree2, hf_gsm_a_rr_pbcch_use_bcch, tvb, bit_offset>>3, 1, ENC_NA);
8372             }
8373             proto_item_set_len(item2, (bit_offset>>3) - (bit_offset_sav>>3)+1);
8374         }
8375         else
8376         { /* PBCCH not present in the cell */
8377             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rac, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
8378             bit_offset += 8;
8379             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_spgc_ccch_sup, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
8380             bit_offset += 1;
8381             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_priority_access_thr, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
8382             bit_offset += 3;
8383             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_network_control_order, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
8384             bit_offset += 2;
8385             bit_offset += de_rr_rest_oct_gprs_cell_options(tvb, subtree, bit_offset);
8386             bit_offset += de_rr_rest_oct_gprs_power_control_parameters(tvb, subtree, bit_offset);
8387         }
8388
8389         /* Null breakpoint */
8390         if (bit_offset < bit_len)
8391         {
8392            if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_additions_in_r99))
8393            { /* Additions in release 99 */
8394                proto_tree_add_bits_item(subtree, hf_gsm_a_rr_sgsnr, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
8395                bit_offset += 1;
8396
8397                /* Null breakpoint */
8398                if (bit_offset < bit_len)
8399                {
8400                   if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_4))
8401                   { /* Additions in release Rel-4 */
8402                       proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si_status_ind, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
8403                       bit_offset += 1;
8404
8405                       /* Null breakpoint */
8406                       if (bit_offset < bit_len)
8407                       {
8408                          if (gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_6))
8409                          { /* Additions in release Rel-6 */
8410                             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_lb_ms_txpwr_max_cch_present))
8411                             {
8412                                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_lb_ms_txpwr_max_cch, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
8413                                 bit_offset += 5;
8414                             }
8415                             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2n_support, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
8416                             bit_offset += 2;
8417
8418                             (void)gsm_rr_csn_HL_flag(tvb, subtree, 0, bit_offset++, hf_gsm_a_rr_si_change_alt);
8419
8420                             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_peo_dsc_and_rcc_present))
8421                             {
8422                                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_peo_dsc, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
8423                                 bit_offset += 2;
8424                                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rcc, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
8425                                 bit_offset += 3;
8426                             }
8427
8428                             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_c1_delta_present))
8429                             {
8430                                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_c1_delta_min, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
8431                                 bit_offset += 2;
8432                                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_c1_delta_max, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
8433                                 bit_offset += 3;
8434                             }
8435                          }
8436                       }
8437                   }
8438                }
8439            }
8440         }
8441     }
8442     gsm_rr_csn_padding_bits(subtree, tvb, bit_offset, tvb_len);
8443     return tvb_len - offset;
8444 }
8445
8446 /* [3] 10.5.2.37c (void)
8447  * [3] 10.5.2.37d (void)
8448  * [3] 10.5.2.37e SI 16 Rest Octets
8449  * [3] 10.5.2.37f SI 17 Rest Octets
8450  * [3] 10.5.2.37g SI 19 Rest Octets
8451  * [3] 10.5.2.37h SI 18 Rest Octets
8452  * [3] 10.5.2.37i SI 20 Rest Octets
8453  */
8454
8455  /*
8456   * [3] 10.5.2.37m SI 21 Rest Octets
8457   */
8458 static guint16
8459 de_rr_si21_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8460 {
8461     proto_tree  *subtree2;
8462     proto_item *item2;
8463     guint32  curr_offset;
8464     gint     bit_offset, bit_offset_sav;
8465     guint8   tvb_len = tvb_reported_length(tvb);
8466
8467     curr_offset = offset;
8468     bit_offset = curr_offset << 3;
8469
8470     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si21_change_mark, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
8471     bit_offset += 2;
8472     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si21_index, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
8473     bit_offset += 3;
8474     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si21_count, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
8475     bit_offset += 3;
8476     if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_eab_parameters))
8477     {
8478         bit_offset_sav = bit_offset;
8479         subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset >> 3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EAB_PARAM_DESC], &item2,
8480             gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EAB_PARAM_DESC].strptr);
8481
8482         /* EAB Authorization mask */
8483         proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_eab_auth_mask, tvb, bit_offset, 10, ENC_BIG_ENDIAN);
8484         bit_offset += 10;
8485         /* EAB Subcategory */
8486         proto_tree_add_bits_item(subtree2, hf_gsm_a_eab_subcategory, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
8487         bit_offset += 2;
8488
8489         proto_item_set_len(item2, (bit_offset >> 3) - (bit_offset_sav >> 3) + 1);
8490     }
8491     gsm_rr_csn_padding_bits(subtree, tvb, bit_offset, tvb_len);
8492     return tvb_len - offset;
8493 }
8494
8495 /*
8496  * [3] 10.5.2.38 Starting Time
8497  */
8498 static guint16
8499 de_rr_starting_time(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8500 {
8501     proto_item *item;
8502     guint32     curr_offset;
8503     guint16     rfn, fn;
8504
8505     curr_offset = offset;
8506
8507     fn = tvb_get_ntohs(tvb,curr_offset);
8508     rfn = reduced_frame_number(fn);
8509     proto_tree_add_item(tree, hf_gsm_a_rr_T1prim, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
8510     proto_tree_add_item(tree, hf_gsm_a_rr_T3, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
8511     curr_offset++;
8512     proto_tree_add_item(tree, hf_gsm_a_rr_T2, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
8513     curr_offset++;
8514     item = proto_tree_add_uint(tree, hf_gsm_a_rr_rfn, tvb, curr_offset-2, 2, rfn);
8515     PROTO_ITEM_SET_GENERATED(item);
8516     return(curr_offset - offset);
8517 }
8518 /*
8519  * [3] 10.5.2.39 Synchronization Indication
8520  */
8521 /*
8522  * ROT: Report Observed Time Difference (Octet1 bit 3) */
8523
8524 static const true_false_string sm_a_rr_sync_ind_rot_value  = {
8525     "Mobile Time Difference IE shall be included in the HANDOVER COMPLETE message",
8526     "Mobile Time Difference IE shall not be included in the HANDOVER COMPLETE message"
8527 };
8528
8529 /* SI: Synchronization indication (octet 1)Bit2 1 */
8530
8531 static const value_string gsm_a_rr_sync_ind_si_vals[] = {
8532     { 0, "Non-synchronized"},
8533     { 1, "Synchronized"},
8534     { 2, "Pre-synchronised"},
8535     { 3, "Pseudo-synchronised"},
8536     { 0, NULL }
8537 };
8538 /* NCI: Normal cell indication (octet 1, bit 4) */
8539
8540 static const true_false_string gsm_a_rr_sync_ind_nci_value = {
8541     "Out of range timing advance shall trigger a handover failure procedure",
8542     "Out of range timing advance is ignored"
8543 };
8544 static guint16
8545 de_rr_sync_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8546 {
8547     guint32 curr_offset;
8548
8549     curr_offset = offset;
8550
8551     /*NCI */
8552     proto_tree_add_item(tree, hf_gsm_a_rr_sync_ind_nci, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
8553     /*ROT */
8554     proto_tree_add_item(tree, hf_gsm_a_rr_sync_ind_rot, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
8555     /*SI*/
8556     proto_tree_add_item(tree, hf_gsm_a_rr_sync_ind_si, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
8557
8558     curr_offset = curr_offset + 1;
8559
8560     return(curr_offset - offset);
8561 }
8562
8563 /*
8564  * [3] 10.5.2.40 Timing Advance
8565  */
8566 static guint16
8567 de_rr_timing_adv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8568 {
8569     guint32 curr_offset;
8570
8571     curr_offset = offset;
8572
8573     proto_tree_add_item(tree, hf_gsm_a_rr_timing_adv, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
8574     curr_offset = curr_offset + 1;
8575
8576     return(curr_offset - offset);
8577 }
8578
8579 /*
8580  * [3] 10.5.2.41 Time Difference
8581  */
8582 static guint16
8583 de_rr_time_diff(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8584 {
8585     guint32 curr_offset;
8586
8587     curr_offset = offset;
8588
8589     proto_tree_add_item(tree, hf_gsm_a_rr_time_diff, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
8590     curr_offset = curr_offset + 1;
8591
8592     return(curr_offset - offset);
8593 }
8594 /*
8595  * [3] 10.5.2.41a TLLI
8596  * The TLLI is encoded as a binary number with a length of 4 octets. TLLI is defined in 3GPP TS 23.003
8597  */
8598 guint16
8599 de_rr_tlli(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8600 {
8601     guint32 curr_offset, tlli;
8602
8603     curr_offset = offset;
8604
8605     tlli = tvb_get_ntohl(tvb, curr_offset);
8606     proto_tree_add_item(tree, hf_gsm_a_rr_tlli, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
8607     curr_offset = curr_offset + 4;
8608     if(add_string)
8609         g_snprintf(add_string, string_len, " - 0x%x", tlli);
8610
8611     return(curr_offset - offset);
8612 }
8613
8614 /*
8615  * [3] 10.5.2.42 TMSI/P-TMSI
8616  */
8617 static guint16
8618 de_rr_tmsi_ptmsi(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8619 {
8620     proto_tree *subtree;
8621     guint32     curr_offset;
8622
8623     curr_offset = offset;
8624
8625     subtree = proto_tree_add_subtree(tree, tvb, curr_offset, 3, ett_gsm_rr_elem[DE_RR_TMSI_PTMSI], NULL,
8626                                val_to_str_ext_const(DE_RR_TMSI_PTMSI, &gsm_rr_elem_strings_ext, ""));
8627
8628     proto_tree_add_item(subtree, hf_gsm_a_rr_tmsi_ptmsi, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
8629     curr_offset = curr_offset + 4;
8630
8631     return(curr_offset - offset);
8632 }
8633
8634 /*
8635  * [3] 10.5.2.42a VGCS target mode Indication
8636  */
8637 /*
8638 Target mode (octet 3)
8639 Bit  8 7
8640      0 0    dedicated mode
8641      0 1    group transmit mode
8642      Other values are reserved for future use.
8643 */
8644 static const value_string gsm_a_rr_target_mode_vals[] _U_ = {
8645     { 0, "Dedicated mode"},
8646     { 1, "Group transmit mode"},
8647     { 0, NULL }
8648 };
8649 static guint16
8650 de_rr_vgcs_tar_mode_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8651 {
8652     guint32 curr_offset;
8653
8654     curr_offset = offset;
8655
8656     proto_tree_add_item(tree, hf_gsm_a_rr_target_mode, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
8657     proto_tree_add_item(tree, hf_gsm_a_rr_group_cipher_key_number, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
8658     curr_offset = curr_offset + 1;
8659
8660     return(curr_offset - offset);
8661 }
8662
8663 /*
8664  * [3] 10.5.2.42b      VGCS Ciphering Parameters
8665  */
8666 static guint16
8667 de_rr_vgcs_cip_par(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8668 {
8669     guint32 curr_offset;
8670
8671     curr_offset = offset;
8672
8673     proto_tree_add_expert_format(tree, pinfo, &ei_gsm_a_rr_data_not_dissected, tvb, curr_offset, len, "Data (Not decoded)");
8674
8675     curr_offset = curr_offset + 2;
8676
8677     return(curr_offset - offset);
8678 }
8679 /*
8680  * [3] 10.5.2.43 Wait Indication
8681  */
8682 static guint16
8683 de_rr_wait_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8684 {
8685     guint32 curr_offset;
8686
8687     curr_offset = offset;
8688
8689     proto_tree_add_item(tree, hf_gsm_a_rr_wait_indication, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
8690
8691     curr_offset = curr_offset + 1;
8692
8693     return(curr_offset - offset);
8694 }
8695
8696 /*
8697  * [3] 10.5.2.44 SI10 rest octets $(ASCI)$
8698  */
8699
8700 /*
8701  * [3] 10.5.2.45 Extended Measurement Results
8702  */
8703 static guint16
8704 de_rr_ext_meas_result(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
8705 {
8706     guint32 curr_offset;
8707     gint    bit_offset, i;
8708     guint8  value;
8709
8710     curr_offset = offset;
8711     bit_offset  = curr_offset << 3;
8712
8713     proto_tree_add_bits_item(tree, hf_gsm_a_rr_seq_code, tvb,bit_offset, 1, ENC_BIG_ENDIAN);
8714     bit_offset += 1;
8715     proto_tree_add_bits_item(tree, hf_gsm_a_rr_dtx_used, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
8716     bit_offset += 1;
8717     for (i=0; i<21; i++)
8718     {
8719         value = tvb_get_bits8(tvb,bit_offset,6);
8720         proto_tree_add_uint_format(tree, hf_gsm_a_rr_rxlev_carrier, tvb, bit_offset>>3, 1,
8721                 value, "RXLEV carrier %d: %s (%d)", i, val_to_str_ext_const(value, &gsm_a_rr_rxlev_vals_ext, "Unknown"), value);
8722         bit_offset += 6;
8723     }
8724
8725     curr_offset = offset + len;
8726
8727     return(curr_offset - offset);
8728 }
8729
8730 /*
8731  * [3] 10.5.2.46 Extended Measurement Frequency List
8732  */
8733 static guint16
8734 de_rr_ext_meas_freq_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8735 {
8736    guint32 curr_offset;
8737
8738    curr_offset = offset;
8739
8740    proto_tree_add_bits_item(tree, hf_gsm_a_rr_seq_code, tvb,(curr_offset<<3)+3, 1, ENC_BIG_ENDIAN);
8741
8742    return dissect_arfcn_list(tvb, tree, pinfo, offset, 16, add_string, string_len);
8743 }
8744
8745 /*
8746  * [3] 10.5.2.47 Suspension Cause
8747  */
8748 /*Suspension cause value (octet 2)*/
8749 static const value_string gsm_a_rr_suspension_cause_vals[] = {
8750     { 0, "Emergency call, mobile originating call or call re-establishment"},
8751     { 1, "Location Area Update"},
8752     { 2, "MO Short message service"},
8753     { 3, "Other procedure which can be completed with an SDCCH"},
8754     { 4, "MO Voice broadcast or group call"},
8755     { 5, "Mobile terminating CS connection"},
8756     { 6, "DTM not supported in the cell"},
8757     { 0, NULL }
8758 };
8759 guint16
8760 de_rr_sus_cau(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8761 {
8762     guint32 curr_offset;
8763
8764     curr_offset = offset;
8765
8766     proto_tree_add_item(tree, hf_gsm_a_rr_suspension_cause, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
8767
8768     curr_offset = curr_offset + 1;
8769
8770     return(curr_offset - offset);
8771 }
8772 /*
8773  * [3] 10.5.2.48 APDU ID
8774  */
8775 static const value_string gsm_a_rr_apdu_id_vals[] = {
8776     { 0, "RRLP (GSM 04.31) LCS" },
8777     { 0, NULL },
8778 };
8779 static guint16
8780 de_rr_apdu_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8781 {
8782     proto_tree_add_item(tree, hf_gsm_a_rr_apdu_id, tvb, offset, 1, ENC_BIG_ENDIAN);
8783
8784     return 0;
8785 }
8786
8787 /*
8788  * [3] 10.5.2.49 APDU Flags
8789  * Please note that value 1 means "not".
8790  */
8791 static const true_false_string gsm_a_rr_apdu_flags_cr_value = {
8792     "Not Command or Final Response",
8793     "Command or Final Response",
8794 };
8795 static const true_false_string gsm_a_rr_apdu_flags_fs_value = {
8796     "Not first or only segment",
8797     "First or only segment",
8798 };
8799 static const true_false_string gsm_a_rr_apdu_flags_ls_value = {
8800     "Not last or only segment",
8801     "Last or only segment",
8802 };
8803
8804 static guint16
8805 de_rr_apdu_flags(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8806 {
8807     proto_tree_add_item(tree, hf_gsm_a_rr_apdu_flags_cr, tvb, offset, 1, ENC_BIG_ENDIAN);
8808     proto_tree_add_item(tree, hf_gsm_a_rr_apdu_flags_fs, tvb, offset, 1, ENC_BIG_ENDIAN);
8809     proto_tree_add_item(tree, hf_gsm_a_rr_apdu_flags_ls, tvb, offset, 1, ENC_BIG_ENDIAN);
8810
8811     return 1;
8812 }
8813
8814 /*
8815  * [3] 10.5.2.50 APDU Data
8816  */
8817 static guint16
8818 de_rr_apdu_data(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
8819 {
8820     tvbuff_t *sub_tvb;
8821
8822     sub_tvb = tvb_new_subset_length(tvb, offset, len);
8823
8824     if (rrlp_dissector)
8825         call_dissector(rrlp_dissector, sub_tvb,pinfo, tree);
8826
8827     return len;
8828 }
8829
8830 /*
8831  * [3] 10.5.2.51 Handover To UTRAN Command
8832  */
8833 static guint16
8834 de_rr_ho_to_utran_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
8835 {
8836     guint32 curr_offset;
8837     tvbuff_t *rrc_irat_ho_to_utran_cmd_tvb;
8838
8839     curr_offset = offset;
8840     if (len)
8841     {
8842         rrc_irat_ho_to_utran_cmd_tvb = tvb_new_subset_length(tvb, curr_offset, len);
8843         if (rrc_irat_ho_to_utran_cmd_handle)
8844             call_dissector(rrc_irat_ho_to_utran_cmd_handle, rrc_irat_ho_to_utran_cmd_tvb, pinfo, tree);
8845     }
8846
8847     curr_offset += len;
8848     return(curr_offset - offset);
8849 }
8850
8851
8852 /*
8853  * [3] 10.5.2.52 Handover To cdma2000 Command
8854  * [3] 10.5.2.53 (void)
8855  * [3] 10.5.2.54 (void)
8856  * [3] 10.5.2.55 (void)
8857  * [3] 10.5.2.56 3G Target Cell
8858  */
8859 /*
8860  * 10.5.2.57 Service Support
8861  */
8862 static const true_false_string gsm_a_rr_MBMS_multicast_value  = {
8863     "mobile station requires notification of multicast MBMS services",
8864     "mobile station does not require notification of multicast MBMS services"
8865 };
8866 static const true_false_string gsm_a_rr_MBMS_broadcast_value  = {
8867     "mobile station requires notification of broadcast MBMS services",
8868     "mobile station does not require notification of broadcast MBMS services"
8869 };
8870 static guint16
8871 de_rr_serv_sup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8872 {
8873     guint32 curr_offset;
8874
8875     curr_offset = offset;
8876     /* bit 1
8877      * 0 mobile station does not require notification of broadcast MBMS services
8878      * 1 mobile station requires notification of broadcast MBMS services
8879      * bit 2
8880      * 0 mobile station does not require notification of multicast MBMS services
8881      * 1 mobile station requires notification of multicast MBMS services
8882      */
8883     /* MBMS Multicast */
8884     proto_tree_add_item(tree, hf_gsm_a_rr_MBMS_multicast, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
8885
8886     /* MBMS Broadcast */
8887     proto_tree_add_item(tree, hf_gsm_a_rr_MBMS_broadcast, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
8888     curr_offset++;
8889
8890     return(curr_offset - offset);
8891 }
8892
8893 /*
8894  * [3] 10.5.2.59       Dedicated Service Information
8895  */
8896 /*
8897 Last Segment (octet 2)
8898 bit 1
8899   0  mobile station shall not perform Service Information Sending procedure on new cell.
8900   1  mobile station shall perform Service Information Sending procedure on new cell.
8901 */
8902 static const true_false_string gsm_a_rr_last_segment_value  = {
8903     "Mobile station shall perform Service Information Sending procedure on new cell.",
8904     "mobile station shall not perform Service Information Sending procedure on new cell."
8905 };
8906 static guint16
8907 de_rr_ded_serv_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8908 {
8909     guint32 curr_offset;
8910
8911     curr_offset = offset;
8912
8913     proto_tree_add_item(tree, hf_gsm_a_rr_last_segment, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
8914
8915     curr_offset = curr_offset + 3;
8916
8917     return(curr_offset - offset);
8918 }
8919
8920 /*
8921  * [3] 10.5.2.69        Carrier Indication
8922  */
8923 static const true_false_string gsm_a_rr_carrier_ind_value  = {
8924     "Carrier 2",
8925     "Carrier 1"
8926 };
8927
8928 static guint16
8929 de_rr_carrier_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8930 {
8931     proto_tree *subtree;
8932     guint32     curr_offset;
8933
8934     curr_offset = offset;
8935
8936     subtree = proto_tree_add_subtree(tree, tvb, curr_offset, 3, ett_gsm_rr_elem[DE_RR_CARRIER_IND], NULL,
8937                                val_to_str_ext_const(DE_RR_CARRIER_IND, &gsm_rr_elem_strings_ext, ""));
8938
8939     proto_tree_add_item(subtree, hf_gsm_a_rr_carrier_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
8940
8941     curr_offset += 1;
8942
8943     return(curr_offset - offset);
8944 }
8945
8946 /*
8947  * [3] 10.5.2.76 Feature Indicator
8948  */
8949 static const true_false_string gsm_a_rr_feat_ind_cs_ir = {
8950     "An implicit reject is indicated for the CS domain",
8951     "An implicit reject is not indicated for the CS domain"
8952 };
8953
8954 static const true_false_string gsm_a_rr_feat_ind_ps_ir = {
8955     "An implicit reject is indicated for the PS domain",
8956     "An implicit reject is not indicated for the PS domain"
8957 };
8958
8959 static guint16
8960 de_rr_feature_indicator(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
8961 {
8962     guint32 curr_offset;
8963
8964     curr_offset = offset;
8965
8966     proto_tree_add_bits_item(tree, hf_gsm_a_rr_peo_bcch_change_mark, tvb, curr_offset << 3, 2, ENC_BIG_ENDIAN);
8967     proto_tree_add_bits_item(tree, hf_gsm_a_rr_feat_ind_cs_ir, tvb, (curr_offset<<3)+2, 1, ENC_BIG_ENDIAN);
8968     proto_tree_add_bits_item(tree, hf_gsm_a_rr_feat_ind_ps_ir, tvb, (curr_offset<<3)+3, 1, ENC_BIG_ENDIAN);
8969
8970     curr_offset += 1;
8971
8972     return(curr_offset - offset);
8973 }
8974
8975  /*
8976   * 10.5.2.83 EC Request reference
8977   */
8978 static guint16
8979 de_rr_ec_request_reference(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 bit_offset, gchar *add_string)
8980 {
8981     proto_tree *subtree;
8982     guint32     curr_bit_offset = bit_offset;
8983
8984     subtree = proto_tree_add_subtree_format(tree, tvb, curr_bit_offset>>3, 2, ett_gsm_rr_elem[DE_RR_EC_REQUEST_REFERENCE], NULL,
8985                              "%s%s", val_to_str_ext_const(DE_RR_EC_REQUEST_REFERENCE, &gsm_rr_elem_strings_ext, ""),
8986                              (add_string == NULL) || (add_string[0] == '\0') ? "" : add_string);
8987
8988     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_last_tdma_frame, tvb, curr_bit_offset, 10, ENC_BIG_ENDIAN);
8989     curr_bit_offset += 10;
8990
8991     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_echoed_random_bits, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
8992     curr_bit_offset += 3;
8993
8994     return curr_bit_offset-bit_offset; /*Bits!*/
8995 }
8996
8997 /*
8998  * [3] 10.5.2.84        EC Packet Channel Description type 1
8999  */
9000 static void
9001 gsm_a_rr_ec_ma_number_fmt(gchar *s, guint32 v)
9002 {
9003     g_snprintf(s, ITEM_LABEL_LENGTH, "EC-EGPRS Mobile Allocation set %u (%u)", v+1, v);
9004 }
9005
9006 static guint16
9007 de_rr_ec_pkt_ch_dsc1(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
9008 {
9009     guint32     curr_offset;
9010     guint32     bit_offset;
9011
9012     curr_offset = offset;
9013     bit_offset  = curr_offset << 3;
9014
9015     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_qhfi, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
9016     bit_offset += 2;
9017     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_dl_cc, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
9018     bit_offset += 2;
9019     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_ul_cc, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
9020     bit_offset += 2;
9021     proto_tree_add_bits_item(tree, hf_gsm_a_rr_tsc_set, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
9022     bit_offset += 1;
9023     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_tsc, tvb, bit_offset, 3, ENC_BIG_ENDIAN); /*FIXME: use same tsc variable as other msgs (doesn't work with bits_item)*/
9024     bit_offset += 3;
9025     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_ma_number, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
9026
9027     return 2;
9028
9029 }
9030
9031 /*
9032  * [3] 10.5.2.85        EC Packet Channel Description type 2
9033  */
9034 static guint16
9035 de_rr_ec_pkt_ch_dsc2(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 bit_offset)
9036 {
9037     proto_tree *subtree;
9038     guint32     curr_bit_offset = bit_offset;
9039
9040     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, 2, ett_gsm_rr_elem[DE_RR_EC_PKT_CH_DSC2], NULL,
9041                              val_to_str_ext_const(DE_RR_EC_PKT_CH_DSC2, &gsm_rr_elem_strings_ext, ""));
9042
9043     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_qhfi, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
9044     curr_bit_offset += 2;
9045     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_dl_cc, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
9046     curr_bit_offset += 2;
9047     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_ul_cc, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
9048     curr_bit_offset += 2;
9049     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tsc_set, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
9050     curr_bit_offset += 1;
9051     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_tsc, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN); /*FIXME: use same tsc variable as other msgs (doesn't work with bits_item)*/
9052     curr_bit_offset += 3;
9053     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_ma_number, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
9054     curr_bit_offset += 5;
9055
9056     return curr_bit_offset-bit_offset; /*Bits!*/
9057 }
9058
9059 /*
9060  * [3] 10.5.2.86        EC Fixed Uplink Allocation
9061  */
9062 static guint16
9063 de_rr_ec_fua(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
9064 {
9065     guint32     bit_offset;
9066
9067     bit_offset  = offset << 3;
9068
9069     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_enhanced_access_burst, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
9070     bit_offset +=1;
9071
9072     if (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_timing_adv_present))
9073     { /* Timing Advance Description */
9074         proto_tree_add_bits_item(tree, hf_gsm_a_rr_timing_adv, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
9075         bit_offset += 6;
9076     }
9077
9078     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_starting_ul_timeslot, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
9079     bit_offset += 3;
9080     proto_tree_add_bits_item(tree, hf_gsm_a_rr_tfi_assignment, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
9081     bit_offset += 5;
9082     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_starting_dl_timeslot_offset, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
9083     bit_offset += 2;
9084
9085     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_overlaid_cdma_code, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
9086     bit_offset += 2;
9087
9088     if (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_ec_mcs_exist))
9089     { /* MCS Description */
9090         proto_tree_add_bits_item(tree, hf_gsm_a_rr_egprs_mcs, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
9091         bit_offset += 4;
9092     }
9093
9094     proto_tree_add_bits_item(tree, hf_gsm_a_rr_gamma, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
9095     bit_offset += 5;
9096
9097     if (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_p0_present))
9098     {
9099         proto_tree_add_bits_item(tree, hf_gsm_a_rr_p0, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
9100         bit_offset += 4;
9101         proto_tree_add_bits_item(tree, hf_gsm_a_rr_pr_mode, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
9102         bit_offset += 1;
9103     }
9104
9105     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_start_first_ul_data_block, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
9106     bit_offset += 4;
9107
9108     while(gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_ec_fua_gap_list))
9109     {
9110         if (!gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_ec_start_fn_next_data_block_exist))
9111         {
9112             proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_start_fn_next_data_block, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
9113             bit_offset += 3;
9114         }
9115         else
9116         {
9117             proto_tree_add_uint(tree, hf_gsm_a_rr_ec_start_fn_next_data_block, tvb, (bit_offset>>3), 0, 0);
9118         }
9119     }
9120
9121     return len;
9122 }
9123
9124 guint16 (*rr_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len) = {
9125     /* Radio Resource Management  Information Elements 10.5.2, most are from 10.5.1 */
9126
9127     de_rr_ba_range,                             /* [3]  10.5.2.1a       BA Range */
9128     de_rr_cell_ch_dsc,                          /* [3]  10.5.2.1b       Cell Channel Description        */
9129     de_rr_ba_list_pref,                         /* [3]  10.5.2.1c       BA List Pref                    */
9130     de_rr_utran_freq_list,                      /* [3]  10.5.2.1d       UTRAN Frequency List            */
9131     de_rr_cell_select_indic,                    /* [3]  10.5.2.1e       Cell selection indicator after release of all TCH and SDCCH IE */
9132     de_rr_cell_dsc,                             /* 10.5.2.2   RR Cell Description                       */
9133     de_rr_cell_opt_bcch,                        /* [3]  10.5.2.3        Cell Options (BCCH)             */
9134     de_rr_cell_opt_sacch,                       /* [3]  10.5.2.3a       Cell Options (SACCH)            */
9135     de_rr_cell_sel_param,                       /* [3]  10.5.2.4        Cell Selection Parameters       */
9136 /*
9137  * [3]  10.5.2.4a       (void)
9138  */
9139     de_rr_ch_dsc,                               /* [3]  10.5.2.5        Channel Description             */
9140     de_rr_ch_dsc2,                              /* [3]  10.5.2.5a   RR Channel Description 2            */
9141     de_rr_ch_dsc3,                              /* [3]  10.5.2.5c   RR Channel Description 3            */
9142     de_rr_ch_mode,                              /* [3]  10.5.2.6        Channel Mode                    */
9143     de_rr_ch_mode2,                             /* [3]  10.5.2.7        Channel Mode 2                  */
9144     de_rr_utran_cm,                             /* [3]  10.5.2.7a       UTRAN Classmark */
9145 /* [3]  10.5.2.7b       (void) */
9146
9147     de_rr_cm_enq_mask,                          /* [3]  10.5.2.7c       Classmark Enquiry Mask          */
9148 /* [3]  10.5.2.7d       GERAN Iu Mode Classmark information element                                     */
9149     de_rr_chnl_needed,                          /* [3]  10.5.2.8        Channel Needed
9150                                                  * [3]  10.5.2.8a       (void) */
9151     de_rr_chnl_req_desc2,                       /* [3]  10.5.2.8b       Channel Request Description 2   */
9152     /* Pos 20 */
9153     de_rr_cip_mode_set,                         /* [3]  10.5.2.9        Cipher Mode Setting             */
9154     de_rr_cip_mode_resp,                        /* [3]  10.5.2.10       Cipher Response */
9155     de_rr_ctrl_ch_desc,                         /* [3]  10.5.2.11       Control Channel Description     */
9156     de_rr_dtm_info_details,                     /* [3]  10.5.2.11a      DTM Information Details */
9157     de_rr_dyn_arfcn_map,                        /* [3]  10.5.2.11b      Dynamic ARFCN Mapping           */
9158     de_rr_freq_ch_seq,                          /* [3]  10.5.2.12       Frequency Channel Sequence      */
9159     de_rr_freq_list,                            /* [3]  10.5.2.13       Frequency List                  */
9160     de_rr_freq_short_list,                      /* [3]  10.5.2.14       Frequency Short List            */
9161     de_rr_freq_short_list2,                     /* [3]  10.5.2.14a      Frequency Short List 2          */
9162 /* [3]  10.5.2.14b      Group Channel Description */
9163     de_rr_gprs_resumption,                      /* [3]  10.5.2.14c      GPRS Resumption                 */
9164     de_rr_gprs_broadcast_info,                  /* [3]  10.5.2.14d      GPRS broadcast information      */
9165 /* [3]  10.5.2.14e      Enhanced DTM CS Release Indication */
9166     de_rr_ho_ref,                               /* 10.5.2.15  Handover Reference                        */
9167     de_rr_ia_rest_oct,                          /* [3] 10.5.2.16 IA Rest Octets                         */
9168     de_rr_iar_rest_oct,                         /* [3] 10.5.2.17 IAR Rest Octets                        */
9169     de_rr_iax_rest_oct,                         /* [3] 10.5.2.18 IAX Rest Octets                        */
9170     de_rr_l2_pseudo_len,                        /*[3] 10.5.2.19 L2 Pseudo Length                        */
9171     de_rr_meas_res,                             /* [3] 10.5.2.20 Measurement Results                    */
9172 /*
9173  * [3] (void)
9174  */
9175     de_rr_mob_all,                              /* [3] 10.5.2.21 Mobile Allocation                      */
9176     de_rr_mob_time_diff,                        /* [3] 10.5.2.21a Mobile Time Difference                */
9177     de_rr_multirate_conf,                       /* [3] 10.5.2.21aa MultiRate configuration              */
9178     /* Pos 30 */
9179     de_rr_mult_all,                             /* [3] 10.5.2.21b Multislot Allocation                  */
9180 /*
9181  * [3] 10.5.2.21c (void)
9182  */
9183     de_rr_neigh_cell_desc,                      /* [3] 10.5.2.22 Neighbour Cell Description             */
9184     de_rr_neigh_cell_desc2,                     /* [3] 10.5.2.22a Neighbour Cell Description 2          */
9185 /*
9186  * [3] 10.5.2.22b (void)
9187  * [3] 10.5.2.22c NT/N Rest Octets */
9188     de_rr_p1_rest_oct,                          /* [3] 10.5.2.23 P1 Rest Octets                         */
9189     de_rr_p2_rest_oct,                          /* [3] 10.5.2.24 P2 Rest Octets                         */
9190     de_rr_p3_rest_oct,                          /* [3] 10.5.2.25 P3 Rest Octets                         */
9191     de_rr_packet_ch_desc,                       /* [3] 10.5.2.25a Packet Channel Description            */
9192     de_rr_ded_mod_or_tbf,                       /* [3] 10.5.2.25b Dedicated mode or TBF                 */
9193     de_rr_pkt_ul_ass,                           /* [3] 10.5.2.25c RR Packet Uplink Assignment           */
9194     de_rr_pkt_dl_ass,                           /* [3] 10.5.2.25d RR Packet Downlink Assignment         */
9195     de_rr_pkt_dl_ass_type2,                     /* [3] 10.5.2.25e RR Packet Downlink Assignment Type 2  */
9196     de_rr_page_mode,                            /* [3] 10.5.2.26 Page Mode                              */
9197 /*
9198  * [3] 10.5.2.26a (void)
9199  * [3] 10.5.2.26b (void)
9200  * [3] 10.5.2.26c (void)
9201  * [3] 10.5.2.26d (void)
9202  */
9203     de_rr_ncc_perm,                             /* [3] 10.5.2.27 NCC Permitted                          */
9204     de_rr_pow_cmd,                              /* 10.5.2.28  Power Command                             */
9205     de_rr_pow_cmd_and_acc_type,                 /* 10.5.2.28a Power Command and access type             */
9206     de_rr_rach_ctrl_param,                      /* [3] 10.5.2.29 RACH Control Parameters                */
9207     de_rr_req_ref,                              /* [3] 10.5.2.30 Request Reference                      */
9208     de_rr_cause,                                /* 10.5.2.31  RR Cause                                  */
9209     de_rr_sync_ind,                             /* 10.5.2.39  Synchronization Indication                */
9210     de_rr_si1_rest_oct,                         /* [3] 10.5.2.32 SI1 Rest Octets                        */
9211 /* [3] 10.5.2.33 SI 2bis Rest Octets */
9212     de_rr_si2ter_rest_oct,                      /* [3] 10.5.2.33a SI 2ter Rest Octets                   */
9213     de_rr_si2quater_rest_oct,                   /* [3] 10.5.2.33b SI 2quater Rest Octets                */
9214     de_rr_si3_rest_oct,                         /* [3] 10.5.2.34 SI3 Rest Octets                        */
9215     de_rr_si4_rest_oct,                         /* [3] 10.5.2.35 SI4 Rest Octets                        */
9216     de_rr_si6_rest_oct,                         /* [3] 10.5.2.35b SI6 Rest Octets                       */
9217 /* [3] 10.5.2.36 SI 7 Rest Octets
9218  * [3] 10.5.2.37 SI 8 Rest Octets
9219  * [3] 10.5.2.37a SI 9 Rest Octets
9220  */
9221     de_rr_si13_rest_oct,                        /* [3] 10.5.2.37a SI13 Rest Octets                      */
9222 /* [3] 10.5.2.37c (void)
9223  * [3] 10.5.2.37d (void)
9224  * [3] 10.5.2.37e SI 16 Rest Octets
9225  * [3] 10.5.2.37f SI 17 Rest Octets
9226  * [3] 10.5.2.37g SI 19 Rest Octets
9227  * [3] 10.5.2.37h SI 18 Rest Octets
9228  * [3] 10.5.2.37i SI 20 Rest Octets */
9229     de_rr_si21_rest_oct,                        /* [3] 10.5.2.37m SI21 Rest Octets                      */
9230     de_rr_starting_time,                        /* [3] 10.5.2.38 Starting Time                          */
9231     de_rr_timing_adv,                           /* [3] 10.5.2.40 Timing Advance                         */
9232     de_rr_time_diff,                            /* [3] 10.5.2.41 Time Difference                        */
9233     de_rr_tlli,                                 /* [3] 10.5.2.41a TLLI                                  */
9234     de_rr_tmsi_ptmsi,                           /* [3] 10.5.2.42 TMSI/P-TMSI                            */
9235     de_rr_vgcs_tar_mode_ind,                    /* [3] 10.5.2.42a VGCS target mode Indication           */
9236     /* Pos 40 */
9237     de_rr_vgcs_cip_par,                         /* [3] 10.5.2.42b       VGCS Ciphering Parameters       */
9238     de_rr_wait_ind,                             /* [3] 10.5.2.43 Wait Indication                        */
9239 /* [3] 10.5.2.44 SI10 rest octets $(ASCI)$ */
9240     de_rr_ext_meas_result,                      /* [3] 10.5.2.45 Extended Measurement Results           */
9241     de_rr_ext_meas_freq_list,                   /* [3] 10.5.2.46 Extended Measurement Frequency List    */
9242     de_rr_sus_cau,                              /* [3] 10.5.2.47 Suspension Cause                       */
9243     de_rr_apdu_id,                              /* [3] 10.5.2.48 APDU ID                                */
9244     de_rr_apdu_flags,                           /* [3] 10.5.2.49 APDU Flags                             */
9245     de_rr_apdu_data,                            /* [3] 10.5.2.50 APDU Data */
9246     de_rr_ho_to_utran_cmd,                      /* [3] 10.5.2.51 Handover To UTRAN Command              */
9247 /* [3] 10.5.2.52 Handover To cdma2000 Command
9248  * [3] 10.5.2.53 (void)
9249  * [3] 10.5.2.54 (void)
9250  * [3] 10.5.2.55 (void)
9251  * [3] 10.5.2.56 3G Target Cell
9252  * 10.5.2.57 Service Support */
9253     de_rr_serv_sup,                             /* 10.5.2.57            Service Support                 */
9254 /*
9255  * 10.5.2.58 MBMS p-t-m Channel Description
9256  */
9257     de_rr_ded_serv_inf,                         /* [3] 10.5.2.59        Dedicated Service Information   */
9258 /*
9259  * 10.5.2.60 MPRACH Description
9260  * 10.5.2.61 Restriction Timer
9261  * 10.5.2.62 MBMS Session Identity
9262  * 10.5.2.63 Reduced group or broadcast call reference
9263  * 10.5.2.64 Talker Priority status
9264  * 10.5.2.65 Talker Identity
9265  * 10.5.2.66 Token
9266  * 10.5.2.67 PS Cause
9267  * 10.5.2.68 VGCS AMR Configuration
9268  */
9269     de_rr_carrier_ind,                          /* 10.5.2.69 Carrier Indication                         */
9270 /*
9271  * 10.5.2.70 SI10bis Rest Octets
9272  * 10.5.2.71 SI10ter Rest Octets
9273  * 10.5.2.72 Application Data
9274  * 10.5.2.73 Data Identity
9275  * 10.5.2.74 Uplink Access Indication
9276  * 10.5.2.75 Individual priorities
9277  */
9278     de_rr_feature_indicator,                    /* 10.5.2.76 Feature Indicator                          */
9279 /*
9280  * 10.5.2.77 (void)
9281  * 10.5.2.78 IPA Rest Octets
9282  * 10.5.2.79 DL-DCCH-Message
9283  * 10.5.2.80 CN to MS transparent information
9284  * 10.5.2.81 PLMN Index
9285  * 10.5.2.82 Extended TSC Set
9286  */
9287     NULL,                                       /* 10.5.2.83 EC Request reference */
9288     de_rr_ec_pkt_ch_dsc1,                       /* 10.5.2.84 EC Packet Channel Description  Type 1      */
9289     NULL,                                       /* 10.5.2.85 EC Packet Channel Description  Type 1      */
9290     de_rr_ec_fua,                               /* 10.5.2.86 EC Fixed Uplink Allocation                 */
9291     NULL,       /* NONE */
9292 };
9293
9294 /* MESSAGE FUNCTIONS */
9295
9296 /*
9297  * 9.1.1 Additional Assignment
9298  */
9299 static void
9300 dtap_rr_add_ass(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9301 {
9302     guint32 curr_offset;
9303     guint32 consumed;
9304     guint   curr_len;
9305
9306     curr_offset = offset;
9307     curr_len = len;
9308
9309     /* Channel Description  10.5.2.5  M V 3 */
9310     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, NULL, ei_gsm_a_rr_missing_mandatory_element);
9311
9312     /* Mobile Allocation  10.5.2.21  C TLV 3-10 */
9313     ELEM_OPT_TLV(0x72, GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, NULL);
9314
9315     /* Starting Time  10.5.2.38  O TV 3 */
9316     ELEM_OPT_TV(0x7c, GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, NULL);
9317
9318     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
9319 }
9320
9321 /*
9322  * 9.1.2 Assignment command
9323  */
9324 static void
9325 dtap_rr_ass_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9326 {
9327     guint32 curr_offset;
9328     guint32 consumed;
9329     guint   curr_len;
9330
9331     curr_offset = offset;
9332     curr_len = len;
9333
9334     /* Channel Description 2                    10.5.2.5a       M V 3 */
9335     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC2, " - Description of the First Channel, after time", ei_gsm_a_rr_missing_mandatory_element);
9336
9337     /* Power Command                            10.5.2.28       M V 1 */
9338     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_POW_CMD, NULL, ei_gsm_a_rr_missing_mandatory_element);
9339
9340     /* 05 Frequency List                        10.5.2.13       C TLV 4-132 */
9341     ELEM_OPT_TLV(0x05, GSM_A_PDU_TYPE_RR, DE_RR_FREQ_LIST, " - Frequency List, after time");
9342
9343     /* 62 Cell Channel Description              10.5.2.1b       O TV 17 */
9344     ELEM_OPT_TV(0x62, GSM_A_PDU_TYPE_RR, DE_RR_CELL_CH_DSC, NULL);
9345
9346     /* 10 Multislot Allocation                  10.5.2.21b      C TLV 3-12 */
9347     ELEM_OPT_TLV(0x10,GSM_A_PDU_TYPE_RR, DE_RR_MULT_ALL, " - Description of the multislot configuration");
9348
9349     /* 63 Channel Mode                          10.5.2.6        O TV 2 */
9350     ELEM_OPT_TV(0x63,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of the First Channel(Channel Set 1)");
9351
9352     /* 11 Channel Mode                          10.5.2.6        O TV 2 */
9353     ELEM_OPT_TV(0x11,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 2");
9354
9355     /* 13 Channel Mode                          10.5.2.6        O TV 2 */
9356     ELEM_OPT_TV(0x13,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 3");
9357
9358     /* 14 Channel Mode                          10.5.2.6        O TV 2 */
9359     ELEM_OPT_TV(0x14,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 4");
9360
9361     /* 15 Channel Mode                          10.5.2.6        O TV 2 */
9362     ELEM_OPT_TV(0x15,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 5");
9363
9364     /* 16 Channel Mode                          10.5.2.6        O TV 2 */
9365     ELEM_OPT_TV(0x16,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 6");
9366
9367     /* 17 Channel Mode                          10.5.2.6        O TV 2 */
9368     ELEM_OPT_TV(0x17,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 7");
9369
9370     /* 18 Channel Mode                          10.5.2.6        O TV 2 */
9371     ELEM_OPT_TV(0x18,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 8");
9372
9373     /* 64 Channel Description           10.5.2.5        O TV 4 */
9374     ELEM_OPT_TV(0x64,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, "Description of the Second Channel, after time");
9375
9376     /* 66  Channel Mode 2                       10.5.2.7        O TV 2 */
9377     ELEM_OPT_TV(0x66,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE2, " - Mode of the Second Channel");
9378
9379     /* 72 Mobile Allocation                     10.5.2.21       C TLV 3-10 */
9380     ELEM_OPT_TLV(0x72,GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, " - Mobile Allocation, after time");
9381
9382     /* 7C Starting Time                         10.5.2.38       O TV 3 */
9383     ELEM_OPT_TV(0x7C,GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, NULL);
9384
9385     /* 19 Frequency List                        10.5.2.13       C TLV 4-132 */
9386     ELEM_OPT_TLV(0x19, GSM_A_PDU_TYPE_RR, DE_RR_FREQ_LIST, " - Frequency List, before time");
9387
9388     /* 1C Channel Description 2                 10.5.2.5a       O TV 4 */
9389     ELEM_OPT_TV(0x1c,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC2, " - Description of the First Channel, before time");
9390
9391     /* 1D Channel Description                   10.5.2.5        O TV 4 */
9392     ELEM_OPT_TV(0x1d,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, " - Description of the Second Channel, before time");
9393
9394     /* 1E Frequency channel sequence            10.5.2.12  C TV 10 */
9395     ELEM_OPT_TV(0x1e,GSM_A_PDU_TYPE_RR, DE_RR_FREQ_CH_SEQ, " - Frequency channel sequence before time");
9396
9397     /* 21 Mobile Allocation                     10.5.2.21       C TLV 3-10 */
9398     ELEM_OPT_TLV(0x21,GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, " - Mobile Allocation, before time");
9399
9400     /* 9- Cipher Mode Setting                   10.5.2.9        O TV 1 */
9401     ELEM_OPT_TV_SHORT(0x90,GSM_A_PDU_TYPE_RR, DE_RR_CIP_MODE_SET, NULL);
9402     /* 01 VGCS target mode Indication VGCS target mode Indication 10.5.2.42a O TLV 3 */
9403     ELEM_OPT_TLV(0x01,GSM_A_PDU_TYPE_RR, DE_RR_VGCS_TAR_MODE_IND, NULL);
9404
9405     /* 03 Multi-Rate configuration,     MultiRate configuration 10.5.2.21aa     O TLV 4-8 */
9406     ELEM_OPT_TLV(0x03,GSM_A_PDU_TYPE_RR, DE_RR_MULTIRATE_CONF, NULL);
9407
9408     /* 04 VGCS Ciphering Parameters VGCS Ciphering Parameters 10.5.2.42b O TLV 3-15     */
9409     ELEM_OPT_TLV(0x04,GSM_A_PDU_TYPE_RR, DE_RR_VGCS_CIP_PAR, NULL);
9410
9411     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
9412
9413 }
9414
9415 /*
9416  * 9.1.3 Assignment complete
9417  */
9418 static void
9419 dtap_rr_ass_comp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9420 {
9421     guint32 curr_offset;
9422     guint32 consumed;
9423     guint   curr_len;
9424
9425     curr_offset = offset;
9426     curr_len = len;
9427
9428     /* RR Cause RR Cause 10.5.2.31 M V 1 */
9429     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE, NULL, ei_gsm_a_rr_missing_mandatory_element);
9430
9431     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
9432
9433 }
9434
9435 /*
9436  * 9.1.4 Assignment failure
9437  */
9438 static void
9439 dtap_rr_ass_fail(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9440 {
9441     guint32 curr_offset;
9442     guint32 consumed;
9443     guint   curr_len;
9444
9445     curr_offset = offset;
9446     curr_len = len;
9447
9448     /* RR Cause RR Cause 10.5.2.31 M V 1 */
9449     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE, NULL, ei_gsm_a_rr_missing_mandatory_element);
9450
9451     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
9452
9453 }
9454
9455 /*
9456  * 9.1.5 Channel Mode Modify
9457  */
9458 static void
9459 dtap_rr_ch_mode_mod(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9460 {
9461     guint32 curr_offset;
9462     guint32 consumed;
9463     guint   curr_len;
9464
9465     curr_offset = offset;
9466     curr_len = len;
9467
9468     /* Channel Description 2    10.5.2.5a       M V 3 */
9469     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC2, NULL, ei_gsm_a_rr_missing_mandatory_element);
9470
9471     /* Channel Mode             10.5.2.6        M V 1 */
9472     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, NULL, ei_gsm_a_rr_missing_mandatory_element);
9473
9474     /* 01 VGCS target mode Indication VGCS target mode Indication 10.5.2.42a O TLV 3 */
9475     ELEM_OPT_TLV(0x01,GSM_A_PDU_TYPE_RR, DE_RR_VGCS_TAR_MODE_IND, NULL);
9476
9477     /* 03 Multi-Rate configuration,     MultiRate configuration 10.5.2.21aa     O TLV 4-8 */
9478     ELEM_OPT_TLV(0x03,GSM_A_PDU_TYPE_RR, DE_RR_MULTIRATE_CONF, NULL);
9479
9480     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
9481
9482 }
9483
9484 /*
9485  * 9.1.6 Channel Mode Modify Acknowledge
9486  */
9487 static void
9488 dtap_rr_ch_mode_mod_ack(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9489 {
9490     guint32 curr_offset;
9491     guint32 consumed;
9492     guint   curr_len;
9493
9494     curr_offset = offset;
9495     curr_len = len;
9496
9497     /* Channel Description 2    10.5.2.5a       M V 3 */
9498     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC2, NULL, ei_gsm_a_rr_missing_mandatory_element);
9499
9500     /* Channel Mode             10.5.2.6        M V 1 */
9501     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, NULL, ei_gsm_a_rr_missing_mandatory_element);
9502
9503     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
9504
9505 }
9506
9507 /*
9508  * 9.1.7 Channel Release
9509  */
9510 static void
9511 dtap_rr_ch_rel(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9512 {
9513     guint32 curr_offset;
9514     guint32 consumed;
9515     guint   curr_len;
9516
9517     curr_offset = offset;
9518     curr_len = len;
9519
9520     /* RR Cause RR Cause 10.5.2.31 M V 1 */
9521     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE, NULL, ei_gsm_a_rr_missing_mandatory_element);
9522
9523     /* 73 BA Range BA Range 10.5.2.1a O TLV 6-7 */
9524     ELEM_OPT_TLV(0x73, GSM_A_PDU_TYPE_RR, DE_RR_BA_RANGE, NULL);
9525
9526     /* 74 Group Channel Description Group Channel Description 10.5.2.14b O TLV 5-13 */
9527     /* ELEM_OPT_TLV(0x74, GSM_A_PDU_TYPE_RR, DE_GRP_CH_DESC, NULL); */
9528
9529     /* 8x Group Cipher Key Number Group Cipher Key Number 10.5.1.10 C TV 1 */
9530     /* ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_RR, DE_GRP_CIP_KEY_NUM, NULL); */
9531
9532     /* Cx GPRS Resumption GPRS Resumption 10.5.2.14c O TV 1 */
9533     ELEM_OPT_TV_SHORT(0xC0, GSM_A_PDU_TYPE_RR, DE_RR_GPRS_RESUMPTION, NULL);
9534
9535     /* 75 BA List Pref BA List Pref 10.5.2.1c O TLV 3-? */
9536     ELEM_OPT_TLV(0x75, GSM_A_PDU_TYPE_RR, DE_RR_BA_LIST_PREF, NULL);
9537
9538     /* 76 UTRAN Freq List 10.5.2.1d O TLV 3-? */
9539     ELEM_OPT_TLV(0x76, GSM_A_PDU_TYPE_RR, DE_RR_UTRAN_FREQ_LIST, NULL);
9540
9541     /* 62 Cell Channel Description Cell Channel Description 10.5.2.1b O TV 17 */
9542     ELEM_OPT_TV(0x62, GSM_A_PDU_TYPE_RR, DE_RR_CELL_CH_DSC, NULL);
9543
9544     /* 77 Cell selection indicator after release of all TCH and SDCCH 10.5.2.1e O TLV 4-? */
9545     ELEM_OPT_TLV(0x77, GSM_A_PDU_TYPE_RR, DE_RR_CELL_SELECT_INDIC, NULL);
9546
9547     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
9548
9549 }
9550
9551 /*
9552  * 9.1.8 Channel Request
9553  */
9554 /* This message is NOT follow the basic format, and is only found on RACH - ignored here */
9555
9556 /*
9557  * 9.1.9 Ciphering Mode Command
9558  */
9559 static void
9560 dtap_rr_cip_mode_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9561 {
9562     guint32 curr_offset;
9563     guint   curr_len;
9564
9565     curr_offset = offset;
9566     curr_len = len;
9567
9568     /* Ciphering Mode Setting           10.5.2.9        M V 0.5 */
9569     /* Cipher Response                  10.5.2.10       M V 0.5 */
9570     ELEM_MAND_VV_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_CIP_MODE_SET,
9571                        GSM_A_PDU_TYPE_RR, DE_RR_CIP_MODE_RESP, ei_gsm_a_rr_missing_mandatory_element);
9572
9573     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
9574
9575 }
9576 /*
9577  * 9.1.10 Ciphering Mode Complete
9578  */
9579 void
9580 dtap_rr_cip_mode_cpte(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9581 {
9582     guint32 curr_offset;
9583     guint32 consumed;
9584     guint   curr_len;
9585
9586     curr_offset = offset;
9587     curr_len = len;
9588
9589     /* Mobile Equipment Identity                10.5.1.4        O TLV */
9590     ELEM_OPT_TLV(0x17, GSM_A_PDU_TYPE_COMMON, DE_MID, "Mobile Equipment Identity");
9591
9592     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
9593
9594 }
9595
9596 /*
9597  * 9.1.11 Classmark change
9598  */
9599 static void
9600 dtap_rr_mm_cm_change(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9601 {
9602     guint32 curr_offset;
9603     guint32 consumed;
9604     guint   curr_len;
9605
9606     curr_offset = offset;
9607     curr_len = len;
9608
9609     /* Mobile Station Classmark 2               10.5.1.6        M LV 4 */
9610     ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, NULL, ei_gsm_a_rr_missing_mandatory_element);
9611     /* 20 Mobile Station Classmark 3            10.5.1.7        C TLV 3-34 */
9612     ELEM_OPT_TLV(0x20, GSM_A_PDU_TYPE_COMMON, DE_MS_CM_3, NULL);
9613
9614     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
9615
9616 }
9617
9618 /*
9619  * 9.1.11 UTRAN Classmark Change
9620  */
9621 static void
9622 dtap_rr_utran_classmark_change(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9623 {
9624     guint32 curr_offset;
9625     guint32 consumed;
9626     guint   curr_len;
9627
9628     curr_offset = offset;
9629     curr_len = len;
9630
9631     /* UTRAN Classmark          10.5.2.7a       M LV 2-? */
9632     ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_UTRAN_CM, NULL, ei_gsm_a_rr_missing_mandatory_element);
9633
9634     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
9635 }
9636
9637 /*
9638  * 9.1.12 Classmark enquiry
9639  */
9640 static void
9641 dtap_rr_cm_enq(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9642 {
9643     guint32 curr_offset;
9644     guint32 consumed;
9645     guint   curr_len;
9646
9647     curr_offset = offset;
9648     curr_len = len;
9649
9650     /* 10 Classmark Enquiry Mask        10.5.2.7c       O TLV 3 */
9651     ELEM_OPT_TLV(0x10, GSM_A_PDU_TYPE_RR, DE_RR_CM_ENQ_MASK, NULL);
9652
9653     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
9654
9655 }
9656
9657 /*
9658  * 9.1.12b Configuration change command
9659  */
9660 static void
9661 dtap_rr_conf_change_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9662 {
9663     guint32 curr_offset;
9664     guint32 consumed;
9665     guint   curr_len;
9666
9667     curr_offset = offset;
9668     curr_len = len;
9669
9670     /* Multislot Allocation  10.5.2.21b  M LV 2-11 */
9671     ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_MULT_ALL, NULL, ei_gsm_a_rr_missing_mandatory_element);
9672
9673     /* Channel Mode  10.5.2.6  O TV 2 */
9674     ELEM_OPT_TV(0x63,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 1");
9675
9676     /* Channel Mode  10.5.2.6  O TV 2 */
9677     ELEM_OPT_TV(0x11,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 2");
9678
9679     /* Channel Mode  10.5.2.6  O TV 2 */
9680     ELEM_OPT_TV(0x13,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 3");
9681
9682     /* Channel Mode  10.5.2.6  O TV 2 */
9683     ELEM_OPT_TV(0x14,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 4");
9684
9685     /* Channel Mode  10.5.2.6  O TV 2 */
9686     ELEM_OPT_TV(0x15,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 5");
9687
9688     /* Channel Mode  10.5.2.6  O TV 2 */
9689     ELEM_OPT_TV(0x16,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 6");
9690
9691     /* Channel Mode  10.5.2.6  O TV 2 */
9692     ELEM_OPT_TV(0x17,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 7");
9693
9694     /* Channel Mode  10.5.2.6  O TV 2 */
9695     ELEM_OPT_TV(0x18,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 8");
9696
9697     EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_rr_extraneous_data);
9698 }
9699
9700 /*
9701  * 9.1.12c      Configuration change acknowledge
9702  */
9703 /* empty message */
9704
9705 /*
9706  * 9.1.12d      Configuration change reject
9707  */
9708 static void
9709 dtap_rr_conf_change_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9710 {
9711     guint32 curr_offset;
9712     guint32 consumed;
9713     guint   curr_len;
9714
9715     curr_offset = offset;
9716     curr_len = len;
9717
9718     /* RR Cause  10.5.2.31  M V 1 */
9719     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE, NULL, ei_gsm_a_rr_missing_mandatory_element);
9720
9721     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
9722 }
9723
9724 /*
9725  * 9.1.12e DTM Assignment Command
9726  */
9727 static void
9728 dtap_rr_dtm_ass_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9729 {
9730     guint32 curr_offset;
9731     guint32 consumed;
9732     guint   curr_len;
9733
9734     curr_offset = offset;
9735     curr_len = len;
9736
9737     /* CS Power Command 10.5.2.28 M V 1 */
9738     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_POW_CMD, NULL, ei_gsm_a_rr_missing_mandatory_element);
9739
9740     /* Description of the CS Channel 10.5.2.5 M V 3 */
9741     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, NULL, ei_gsm_a_rr_missing_mandatory_element);
9742
9743     /* GPRS broadcast information 10.5.2.14d M LV 7 - n */
9744     ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_GPRS_BROADCAST_INFORMATION, NULL, ei_gsm_a_rr_missing_mandatory_element);
9745
9746     /* 10 Cell Channel Description 10.5.2.1b O TV 17 */
9747     ELEM_OPT_TV(0x10, GSM_A_PDU_TYPE_RR, DE_RR_CELL_CH_DSC, NULL);
9748
9749     /* 11 Channel mode Channel mode 10.5.2.6 O TV 2 */
9750     ELEM_OPT_TV(0x11,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, NULL);
9751     /* 12 Frequency List Frequency List 10.5.2.13 C TLV 4 - 132 */
9752     ELEM_OPT_TLV(0x12, GSM_A_PDU_TYPE_RR, DE_RR_FREQ_LIST, NULL);
9753     /* 13 Mobile Allocation Mobile Allocation 10.5.2.21 C TLV 3 - 10 */
9754     ELEM_OPT_TLV(0x13, GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, NULL);
9755
9756     /* 15 Description of the Uplink Packet Channel Assignment RR Packet Uplink Assignment 10.5.2.25c O TLV 3 - n */
9757     ELEM_OPT_TLV(0x15, GSM_A_PDU_TYPE_RR, DE_RR_PKT_UL_ASS, NULL);
9758
9759     /* 16 Description of the Downlink Packet Channel Assignment RR Packet Downlink Assignment 10.5.2.25d O TLV 3 - n */
9760     ELEM_OPT_TLV(0x16, GSM_A_PDU_TYPE_RR, DE_RR_PKT_DL_ASS, NULL);
9761
9762     /* 17 Multi-Rate configuration MultiRate configuration 10.5.2.21aa O TLV 4-8  */
9763     ELEM_OPT_TLV(0x17,GSM_A_PDU_TYPE_RR, DE_RR_MULTIRATE_CONF, NULL);
9764
9765     /* 9- Ciphering Mode Setting Ciphering Mode Setting 10.5.2.9 O TV 1 */
9766     ELEM_OPT_TV_SHORT(0x90,GSM_A_PDU_TYPE_RR, DE_RR_CIP_MODE_SET, NULL);
9767
9768     /* 18 Mobile Allocation C2 Mobile Allocation 10.5.2.21 C TLV 3 - 10 */
9769     ELEM_OPT_TLV(0x18, GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, " - C2");
9770
9771     /* 19 Frequency List C2 Frequency List 10.5.2.13 C TLV 4 - 132 */
9772     ELEM_OPT_TLV(0x19, GSM_A_PDU_TYPE_RR, DE_RR_FREQ_LIST, " - C2");
9773
9774     /* 20 Description of the Downlink Packet Channel Assignment Type 2 RR Packet Downlink Assignment Type 2 10.5.2.25e C TLV 3 n */
9775     ELEM_OPT_TLV(0x20, GSM_A_PDU_TYPE_RR, DE_RR_PKT_DL_ASS_TYPE2, NULL);
9776
9777     /* 21 Channel Description C2 Channel Description 3 10.5.2.5c O TV 3 */
9778     ELEM_OPT_TV(0x21,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC3, " - Channel Description C2");
9779
9780     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
9781 }
9782
9783 /*
9784  * 9.1.12f DTM Assignment Failure
9785  */
9786 static void
9787 dtap_rr_dtm_ass_fail(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9788 {
9789     guint32 curr_offset;
9790     guint32 consumed;
9791     guint   curr_len;
9792
9793     curr_offset = offset;
9794     curr_len = len;
9795
9796     /* RR Cause RR Cause 10.5.2.31 M V 1 */
9797     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE, NULL, ei_gsm_a_rr_missing_mandatory_element);
9798
9799     EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_rr_extraneous_data);
9800 }
9801
9802 /*
9803  * 9.1.12g DTM Information
9804  */
9805 static void
9806 dtap_rr_dtm_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9807 {
9808     guint32 curr_offset;
9809     guint32 consumed;
9810     guint   curr_len;
9811
9812     curr_offset = offset;
9813     curr_len = len;
9814
9815     /* Routeing Area Identification 10.5.5.15 M V 6 */
9816     ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAI, NULL, ei_gsm_a_rr_missing_mandatory_element);
9817
9818     /* DTM Information Details 10.5.2.11a M LV 4-n */
9819     ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_DTM_INFO_DETAILS, NULL, ei_gsm_a_rr_missing_mandatory_element);
9820
9821     EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_rr_extraneous_data);
9822 }
9823
9824 /*
9825  * 9.1.12h DTM Reject
9826  */
9827 static void
9828 dtap_rr_dtm_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9829 {
9830     guint32 curr_offset;
9831     guint32 consumed;
9832     guint   curr_len;
9833
9834     curr_offset = offset;
9835     curr_len = len;
9836
9837     /* Wait indication 10.5.2.43 M V 1 */
9838     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_WAIT_IND, " - DTM Wait Indication", ei_gsm_a_rr_missing_mandatory_element);
9839
9840     EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_rr_extraneous_data);
9841 }
9842
9843 /*
9844  * 9.1.12i DTM Request
9845  */
9846 static void
9847 dtap_rr_dtm_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9848 {
9849     guint32 curr_offset;
9850     guint32 consumed;
9851     guint   curr_len;
9852
9853     curr_offset = offset;
9854     curr_len = len;
9855
9856     /* TLLI 10.5.2.41a M V 4 */
9857     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TLLI, NULL, ei_gsm_a_rr_missing_mandatory_element);
9858
9859     /* Channel Request Description 2 M LV 5-n */
9860     ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_CHNL_REQ_DESC2, NULL, ei_gsm_a_rr_missing_mandatory_element);
9861
9862     EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_rr_extraneous_data);
9863 }
9864
9865 /*
9866  * 9.1.13 Frequency Redefinition
9867  */
9868 static void
9869 dtap_rr_freq_redef(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9870 {
9871     guint32 curr_offset;
9872     guint32 consumed;
9873     guint   curr_len;
9874
9875     curr_offset = offset;
9876     curr_len = len;
9877
9878     /* Channel Description  10.5.2.5  M V 3 */
9879     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, NULL, ei_gsm_a_rr_missing_mandatory_element);
9880
9881     /* Mobile Allocation  10.5.2.21  M LV 1-9 */
9882     ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, NULL, ei_gsm_a_rr_missing_mandatory_element);
9883
9884     /* Starting Time  10.5.2.38  M V 2 */
9885     ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, NULL, ei_gsm_a_rr_missing_mandatory_element);
9886
9887     /* Cell Channel Description  10.5.2.1b  O TV 17 */
9888     ELEM_OPT_TV(0x62,GSM_A_PDU_TYPE_RR, DE_RR_CELL_CH_DSC, NULL);
9889
9890     /* Carrier Indication  10.5.2.69  O TV 1 */
9891     ELEM_OPT_TV_SHORT(0x90,GSM_A_PDU_TYPE_RR, DE_RR_CARRIER_IND,NULL);
9892
9893     /* Mobile Allocation  10.5.2.21  O TLV 1-9 */
9894     ELEM_OPT_TLV(0x11, GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, " - Mobile Allocation C2");
9895
9896     /* Channel Description 3  10.5.2.5c  O TV 3 */
9897     ELEM_OPT_TV(0x12,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC3, " - Channel Description C2");
9898
9899     EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_rr_extraneous_data);
9900 }
9901
9902 /*
9903  * 9.1.13b GPRS suspension request
9904  */
9905 static void
9906 dtap_rr_gprs_sus_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9907 {
9908     guint32 curr_offset;
9909     guint32 consumed;
9910     guint   curr_len;
9911
9912     curr_offset = offset;
9913     curr_len = len;
9914
9915     /* TLLI                                                             10.5.2.41a      M V 4 */
9916     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TLLI, NULL, ei_gsm_a_rr_missing_mandatory_element);
9917
9918     /* Routeing Area Identification                     10.5.5.15       M V 6 */
9919     ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAI, NULL, ei_gsm_a_rr_missing_mandatory_element);
9920     /* Suspension cause                                 10.5.2.47       M V 1 */
9921     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SUS_CAU, NULL, ei_gsm_a_rr_missing_mandatory_element);
9922
9923     /* 01 Service Support                               10.5.2.57       O TV 2 */
9924     ELEM_OPT_TV_SHORT(0x01,GSM_A_PDU_TYPE_RR, DE_RR_SERV_SUP,NULL);
9925
9926     EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_rr_extraneous_data);
9927
9928 }
9929
9930 /*
9931  * 9.1.14 Handover Access
9932  */
9933 /* This message does NOT follow the basic format, and is only found on DCH during initial handover access */
9934
9935 /* 3GPP TS 24.008 version 4.7.0 Release 4
9936  * [3] 9.1.15
9937  */
9938 void
9939 dtap_rr_ho_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
9940 {
9941     guint32 curr_offset;
9942     guint32 consumed;
9943     guint   curr_len;
9944
9945     curr_offset = offset;
9946     curr_len = len;
9947
9948     /* Mandatory Elements
9949      * Cell description 10.5.2.2
9950      */
9951     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CELL_DSC, NULL, ei_gsm_a_rr_missing_mandatory_element);
9952
9953     /* Description of the first channel,after time
9954      * Channel Description 2 10.5.2.5a
9955      */
9956     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC2, " - Description of the first channel, after time", ei_gsm_a_rr_missing_mandatory_element);
9957
9958     /* Handover Reference 10.5.2.15 */
9959     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_HO_REF, NULL, ei_gsm_a_rr_missing_mandatory_element);
9960
9961     /* Power Command and Access type 10.5.2.28a */
9962     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_POW_CMD_AND_ACC_TYPE, NULL, ei_gsm_a_rr_missing_mandatory_element);
9963
9964     /* optional elements */
9965
9966     /* Synchronization Indication 10.5.2.39 */
9967     ELEM_OPT_TV_SHORT(0xD0,GSM_A_PDU_TYPE_RR, DE_RR_SYNC_IND,NULL);
9968
9969     /* Frequency Short List 10.5.2.14 */
9970     ELEM_OPT_TV(0x02,GSM_A_PDU_TYPE_RR, DE_RR_FREQ_SHORT_LIST," - Frequency Short List, after time");
9971
9972     /* Frequency List 10.5.2.13 */
9973     ELEM_OPT_TLV(0x05, GSM_A_PDU_TYPE_RR, DE_RR_FREQ_LIST, " - Frequency List, after time");
9974
9975     /* Cell Channel Description 10.5.2.1b */
9976     ELEM_OPT_TV(0x62,GSM_A_PDU_TYPE_RR, DE_RR_CELL_CH_DSC, NULL);
9977
9978     /* Multislot Allocation 10.5.2.21b */
9979     ELEM_OPT_TLV(0x10,GSM_A_PDU_TYPE_RR, DE_RR_MULT_ALL, NULL);
9980
9981     /* Mode of the First Channel(Channel Set 1)) Channel Mode 10.5.2.6*/
9982     ELEM_OPT_TV(0x63,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of the First Channel(Channel Set 1))");
9983
9984     /* Mode of Channel Set 2 Channel Mode 10.5.2.6*/
9985     ELEM_OPT_TV(0x11,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 2");
9986
9987     /* Mode of Channel Set 3 Channel Mode 10.5.2.6*/
9988     ELEM_OPT_TV(0x13,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 3");
9989
9990     /* Mode of Channel Set 4 Channel Mode 10.5.2.6*/
9991     ELEM_OPT_TV(0x14,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 4");
9992
9993     /* Mode of Channel Set 5 Channel Mode 10.5.2.6*/
9994     ELEM_OPT_TV(0x15,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 5");
9995
9996     /* Mode of Channel Set 6 Channel Mode 10.5.2.6*/
9997     ELEM_OPT_TV(0x16,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 6");
9998
9999     /* Mode of Channel Set 7 Channel Mode 10.5.2.6*/
10000     ELEM_OPT_TV(0x17,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 7");
10001
10002     /* Mode of Channel Set 8 Channel Mode 10.5.2.6*/
10003     ELEM_OPT_TV(0x18,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 8");
10004
10005     /* Description of the Second Channel, after time, Channel Description 10.5.2.5 */
10006     ELEM_OPT_TV(0x64,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, " - Description of the Second Channel, after time");
10007
10008     /* Mode of the Second Channel, Channel Mode 2 10.5.2.7 */
10009     ELEM_OPT_TV(0x66,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE2, " - Mode of the Second Channel");
10010
10011     /* Frequency Channel Sequence, after time, Frequency Channel Sequence 10.5.2.12 */
10012     ELEM_OPT_TV(0x69,GSM_A_PDU_TYPE_RR, DE_RR_FREQ_CH_SEQ, " - Frequency Channel Sequence, after time");
10013
10014     /* Mobile Allocation, after time, Mobile Allocation 10.5.2.21 */
10015     ELEM_OPT_TLV(0x72,GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, " - Mobile Allocation, after time");
10016
10017     /* Starting Time 10.5.2.38 */
10018     ELEM_OPT_TV(0x7C,GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, NULL);
10019
10020     /* Real Time Difference, Time Difference 10.5.2.41 */
10021     ELEM_OPT_TV(0x7B,GSM_A_PDU_TYPE_RR, DE_RR_TIME_DIFF, " - Real Time Difference");
10022
10023     /* Timing Advance, Timing Advance 10.5.2.40 */
10024     ELEM_OPT_TV(0x7D,GSM_A_PDU_TYPE_RR, DE_RR_TIMING_ADV, NULL);
10025
10026     /* Frequency Short List, before time, Frequency Short List 10.5.2.14 */
10027     ELEM_OPT_TV(0x12,GSM_A_PDU_TYPE_RR, DE_RR_FREQ_SHORT_LIST, " - Frequency Short List, before time");
10028
10029     /* Frequency List, before time,     Frequency List 10.5.2.13 */
10030     ELEM_OPT_TLV(0x19,GSM_A_PDU_TYPE_RR, DE_RR_FREQ_LIST, " - Frequency List, before time");
10031
10032     /* Description of the First Channel, before time,   Channel Description 2 10.5.2.5a*/
10033     ELEM_OPT_TV(0x1c,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC2, " - Description of the First Channel, before time");
10034
10035     /* Description of the Second Channel, before time,  Channel Description 10.5.2.5*/
10036     ELEM_OPT_TV(0x1d,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, " - Description of the Second Channel, before time");
10037
10038     /* Frequency channel sequence before time,  Frequency channel sequence 10.5.2.12*/
10039     ELEM_OPT_TV(0x1e,GSM_A_PDU_TYPE_RR, DE_RR_FREQ_CH_SEQ, " - Frequency channel sequence before time");
10040
10041     /* Mobile Allocation, before time,  Mobile Allocation 10.5.2.21 */
10042     ELEM_OPT_TLV(0x21,GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, " - Mobile Allocation, before time");
10043
10044     /* Cipher Mode Setting,     Cipher Mode Setting 10.5.2.9 */
10045     ELEM_OPT_TV_SHORT(0x90,GSM_A_PDU_TYPE_RR, DE_RR_CIP_MODE_SET, NULL);
10046
10047     /* VGCS target mode Indication,     VGCS target mode Indication 10.5.2.42a */
10048     ELEM_OPT_TLV(0x01,GSM_A_PDU_TYPE_RR, DE_RR_VGCS_TAR_MODE_IND, NULL);
10049
10050     /* Multi-Rate configuration,        MultiRate configuration 10.5.2.21a */
10051     ELEM_OPT_TLV(0x03,GSM_A_PDU_TYPE_RR, DE_RR_MULTIRATE_CONF, NULL);
10052
10053     /* Dynamic ARFCN Mapping,   Dynamic ARFCN Mapping 10.5.2.11b */
10054     ELEM_OPT_TLV(0x76,GSM_A_PDU_TYPE_RR, DE_RR_DYN_ARFCN_MAP, NULL);
10055
10056     /* VGCS Ciphering Parameters,       VGCS Ciphering Parameters 10.5.2.42b */
10057     ELEM_OPT_TLV(0x04,GSM_A_PDU_TYPE_RR, DE_RR_VGCS_CIP_PAR, NULL);
10058
10059     /* Dedicated Service Information,   Dedicated Service Information 10.5.2.59 */
10060     ELEM_OPT_TV(0x51,GSM_A_PDU_TYPE_RR, DE_RR_DED_SERV_INF, NULL);
10061
10062     EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_rr_extraneous_data);
10063
10064 }
10065
10066 /*
10067  * 9.1.15a Inter System To UTRAN Handover Command
10068  */
10069 static void
10070 dtap_rr_inter_syst_to_utran_ho_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10071 {
10072     guint32 curr_offset;
10073     guint32 consumed;
10074     guint   curr_len;
10075
10076     curr_offset = offset;
10077     curr_len = len;
10078
10079     /* UTRAN Classmark          10.5.2.51       M LV 2-? */
10080     ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_HO_TO_UTRAN_CMD, NULL, ei_gsm_a_rr_missing_mandatory_element);
10081
10082     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
10083 }
10084
10085 /* 3GPP TS 24.008 version 4.7.0 Release 4
10086  * [3] 9.1.16
10087  */
10088 static void
10089 dtap_rr_ho_cpte(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10090 {
10091     guint32 curr_offset;
10092     guint32 consumed;
10093     guint   curr_len;
10094
10095     curr_offset = offset;
10096     curr_len = len;
10097
10098     /* RR Cause RR Cause 10.5.2.31 M V 1 */
10099     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE, NULL, ei_gsm_a_rr_missing_mandatory_element);
10100
10101     /* 77 Mobile Observed Time Difference       Mobile Time Difference 10.5.2.21a */
10102     ELEM_OPT_TLV(0x77,GSM_A_PDU_TYPE_RR, DE_RR_MOB_TIME_DIFF, " - Mobile Observed Time Difference");
10103
10104     EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_rr_extraneous_data);
10105
10106 }
10107
10108 /*
10109  * 9.1.17 Handover failure
10110  */
10111 static void
10112 dtap_rr_ho_fail(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10113 {
10114     guint32 curr_offset;
10115     guint32 consumed;
10116     guint   curr_len;
10117
10118     curr_offset = offset;
10119     curr_len = len;
10120
10121     /* RR Cause RR Cause 10.5.2.31 M V 1 */
10122     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE, NULL, ei_gsm_a_rr_missing_mandatory_element);
10123
10124     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
10125
10126 }
10127
10128 /*
10129  * 9.1.18 Immediate assignment See 3GPP TS 44.018
10130  */
10131 static void
10132 dtap_rr_imm_ass(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10133 {
10134     guint32 curr_offset;
10135     guint32 consumed;
10136     guint   curr_len;
10137     guint8  oct;
10138
10139     curr_offset = offset;
10140     curr_len = len;
10141
10142     oct = tvb_get_guint8(tvb, curr_offset);
10143
10144     /* NOTE: The order of the mandatory information elements should be chosen so that
10145      * information elements with 1/2 octet of content (type 1) go together in succession.
10146      * The first type 1 information element occupies bits 1 to 4 of octet N,
10147      * the second bits 5 to 8 of octet N, the third bits 1 to 4 of octet N+1 etc.
10148      * If the number of type 1 information elements is odd then bits 5 to 8 of the last octet
10149      *  occupied by these information elements should be treated as spare bits,
10150      * i.e. coded with a "0" in each.
10151      */
10152
10153     /* Page Mode                        10.5.2.26       M V 1/2 */
10154     /* Dedicated mode or TBF            10.5.2.25b      M V 1/2 */
10155     ELEM_MAND_VV_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_PAGE_MODE,
10156                        GSM_A_PDU_TYPE_RR, DE_RR_DED_MOD_OR_TBF, ei_gsm_a_rr_missing_mandatory_element);
10157
10158     if((oct&0x10) == 0){
10159         /* Channel Description                  10.5.2.5        C V 3m */
10160         ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, NULL, ei_gsm_a_rr_missing_mandatory_element);
10161     }else{
10162         /* Packet Channel Description   10.5.2.25a      C V 3
10163          * If the Dedicated mode or TBF IE indicates that the message assigns a Temporary Block Flow (TBF),
10164          * the mobile station shall consider this information element present in the message.
10165          * If the Dedicated mode or TBF IE indicates that this message is the first of two in a two-message
10166          * assignment of an uplink or downlink TBF, the mobile station shall ignore the contents
10167          * of this information element and regard it as an unnecessary IE.
10168          */
10169         if((oct&0x04) == 0){
10170             ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_PACKET_CH_DESC, NULL, ei_gsm_a_rr_missing_mandatory_element);
10171         }
10172     }
10173     /* Request Reference                        10.5.2.30       M V 3   */
10174     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF, NULL, ei_gsm_a_rr_missing_mandatory_element);
10175
10176     /* Timing Advance                           10.5.2.40       M V 1   */
10177     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TIMING_ADV, NULL, ei_gsm_a_rr_missing_mandatory_element);
10178     /* Mobile Allocation                        10.5.2.21       M LV 1-9 */
10179     ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, NULL, ei_gsm_a_rr_missing_mandatory_element);
10180     /* 7C Starting Time                         10.5.2.38       O TV 3  */
10181     ELEM_OPT_TV(0x7C,GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, NULL);
10182     /* IA Rest Octets                           10.5.2.16       M V 0-11 */
10183     if(tvb_reported_length_remaining(tvb,curr_offset) > 0)
10184         ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_IA_REST_OCT, NULL, ei_gsm_a_rr_missing_mandatory_element);
10185
10186 }
10187
10188 /*
10189  * 9.1.19 Immediate assignment extended
10190  */
10191 static void
10192 dtap_rr_imm_ass_ext(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10193 {
10194     guint32 curr_offset;
10195     guint32 consumed;
10196     guint   curr_len;
10197
10198     curr_offset = offset;
10199     curr_len = len;
10200
10201     /* Page Mode                                                10.5.2.26       M V 1/2 */
10202     /* Feature Indicator                                        10.5.2.76       M V 1/2 */
10203     ELEM_MAND_VV_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_PAGE_MODE,
10204                        GSM_A_PDU_TYPE_RR, DE_RR_FEATURE_INDICATOR, ei_gsm_a_rr_missing_mandatory_element);
10205     /* Channel Description 1    Channel Description             10.5.2.5        M V 3 */
10206     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, " - Channel Description 1", ei_gsm_a_rr_missing_mandatory_element);
10207     /* Request Reference 1      Request Reference               10.5.2.30       M V 3   */
10208     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF, " - Request Reference 1", ei_gsm_a_rr_missing_mandatory_element);
10209     /* Timing Advance 1 Timing Advance                          10.5.2.40       M V 1   */
10210     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TIMING_ADV, " - Timing Advance 1", ei_gsm_a_rr_missing_mandatory_element);
10211     /* Channel Description 2    Channel Description             10.5.2.5        M V 3 */
10212     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, " - Channel Description 2", ei_gsm_a_rr_missing_mandatory_element);
10213     /* Request Reference 2      Request Reference               10.5.2.30       M V 3   */
10214     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF, " - Request Reference 2", ei_gsm_a_rr_missing_mandatory_element);
10215     /* Timing Advance 2 Timing Advance                          10.5.2.40       M V 1   */
10216     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TIMING_ADV, " - Timing Advance 2", ei_gsm_a_rr_missing_mandatory_element);
10217     /* Mobile Allocation                                        10.5.2.21       M LV 1-9 */
10218     ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, NULL, ei_gsm_a_rr_missing_mandatory_element);
10219     /* 7C Starting Time                                         10.5.2.38       O TV 3  */
10220     ELEM_OPT_TV(0x7C,GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, NULL);
10221     /* IAX Rest Octets                                          10.5.2.18       M V 0-4 */
10222     if(tvb_reported_length_remaining(tvb,curr_offset) > 0)
10223         ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_IAX_REST_OCT, NULL, ei_gsm_a_rr_missing_mandatory_element);
10224
10225 }
10226
10227 /*
10228  * 9.1.20 Immediate assignment reject
10229  */
10230 static void
10231 dtap_rr_imm_ass_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10232 {
10233     guint32 curr_offset;
10234     guint32 consumed;
10235     guint   curr_len;
10236
10237     curr_offset = offset;
10238     curr_len = len;
10239
10240     /* Page Mode                                        10.5.2.26       M V 1/2 */
10241     /* Feature Indicator                                        10.5.2.76       M V 1/2 */
10242     ELEM_MAND_VV_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_PAGE_MODE,
10243                        GSM_A_PDU_TYPE_RR, DE_RR_FEATURE_INDICATOR, ei_gsm_a_rr_missing_mandatory_element);
10244     /* Request Reference 1      Request Reference               10.5.2.30       M V 3   */
10245     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF, " - Request Reference 1", ei_gsm_a_rr_missing_mandatory_element);
10246     /* Wait Indication 1        Wait Indication                 10.5.2.43       M V 1   */
10247     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_WAIT_IND, " - Wait Indication 1", ei_gsm_a_rr_missing_mandatory_element);
10248     /* Request Reference 2      Request Reference               10.5.2.30       M V 3   */
10249     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF, " - Request Reference 2", ei_gsm_a_rr_missing_mandatory_element);
10250     /* Wait Indication 2        Wait Indication                 10.5.2.43       M V 1   */
10251     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_WAIT_IND, " - Wait Indication 2", ei_gsm_a_rr_missing_mandatory_element);
10252     /* Request Reference 3      Request Reference               10.5.2.30       M V 3   */
10253     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF, " - Request Reference 3", ei_gsm_a_rr_missing_mandatory_element);
10254     /* Wait Indication 3        Wait Indication                 10.5.2.43       M V 1   */
10255     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_WAIT_IND, " - Wait Indication 3", ei_gsm_a_rr_missing_mandatory_element);
10256     /* Request Reference 4      Request Reference               10.5.2.30       M V 3   */
10257     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF, " - Request Reference 4", ei_gsm_a_rr_missing_mandatory_element);
10258     /* Wait Indication 4        Wait Indication                 10.5.2.43       M V 1   */
10259     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_WAIT_IND, " - Wait Indication 4", ei_gsm_a_rr_missing_mandatory_element);
10260     /* IAR Rest Octets                          10.5.2.19       M V 3 */
10261     if(tvb_reported_length_remaining(tvb,curr_offset) > 0)
10262         ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_IAR_REST_OCT, NULL, ei_gsm_a_rr_missing_mandatory_element);
10263
10264 }
10265
10266 /*
10267  * 9.1.21 Measurement report
10268  */
10269 static void
10270 dtap_rr_meas_rep(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10271 {
10272     guint32 curr_offset;
10273     guint32 consumed;
10274     guint   curr_len;
10275
10276     curr_offset = offset;
10277     curr_len = len;
10278
10279     /* Measurement Results 10.5.2.20 M V 16 */
10280     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_MEAS_RES, NULL, ei_gsm_a_rr_missing_mandatory_element);
10281 }
10282
10283 /*
10284  * 9.1.21f Packet Assignment
10285  */
10286 static void
10287 dtap_rr_pkt_assign(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10288 {
10289     guint32 curr_offset;
10290     guint32 consumed;
10291     guint   curr_len;
10292
10293     curr_offset = offset;
10294     curr_len = len;
10295
10296     /* GPRS broadcast information 10.5.2.14d M LV 7-n */
10297     ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_GPRS_BROADCAST_INFORMATION, NULL, ei_gsm_a_rr_missing_mandatory_element);
10298
10299     /* 0x22 RR Packet Uplink Assignment 10.5.2.25c O TLV 3-n */
10300     ELEM_OPT_TLV(0x22, GSM_A_PDU_TYPE_RR, DE_RR_PKT_UL_ASS, NULL);
10301
10302     /* 0x23 RR Packet Downlink Assignment 10.5.2.25d O TLV 3-n */
10303     ELEM_OPT_TLV(0x23, GSM_A_PDU_TYPE_RR, DE_RR_PKT_DL_ASS, NULL);
10304
10305     /* 0x12 Frequency List 10.5.2.13 C TLV 4-132 */
10306     ELEM_OPT_TLV(0x12, GSM_A_PDU_TYPE_RR, DE_RR_FREQ_LIST, " - Frequency List C2");
10307
10308     /* 0x13 Mobile Allocation 10.5.2.21 C TLV 3-10 */
10309     ELEM_OPT_TLV(0x13, GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, " - Mobile Allocation C2");
10310
10311     /* 0x14 Channel Description 3 10.5.2.5c O TV 3 */
10312     ELEM_OPT_TV(0x14, GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC3, " - Channel Description C2");
10313
10314     /* 0x24 RR Packet Downlink Assignment Type 2 10.5.2.25e C TLV 3-n */
10315     ELEM_OPT_TLV(0x24, GSM_A_PDU_TYPE_RR, DE_RR_PKT_DL_ASS_TYPE2, NULL);
10316
10317     EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_rr_extraneous_data);
10318 }
10319
10320 /*
10321  * 9.1.21g Packet Notification
10322  */
10323 static void
10324 dtap_rr_pkt_notif(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10325 {
10326     guint32 curr_offset;
10327     guint32 consumed;
10328     guint   curr_len;
10329
10330     curr_offset = offset;
10331     curr_len = len;
10332
10333     /* 0x10 P-TMSI 10.5.2.42 C TV 5 */
10334     ELEM_OPT_TV(0x10, GSM_A_PDU_TYPE_RR, DE_RR_TMSI_PTMSI, " - Packet TMSI");
10335
10336     /* 0x11 Mobile Identity 10.5.1.4 C TLV 3-11 */
10337     ELEM_OPT_TLV(0x11, GSM_A_PDU_TYPE_COMMON, DE_MID, NULL);
10338
10339     EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_rr_extraneous_data);
10340 }
10341
10342 /*
10343  * 9.1.22 Paging Request Type 1
10344  */
10345 static void
10346 dtap_rr_paging_req_type_1(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10347 {
10348     guint32 curr_offset;
10349     guint32 consumed;
10350     guint   curr_len;
10351
10352     curr_offset = offset;
10353     curr_len = len;
10354
10355     /* RR Page Mode 10.5.2.26 M V 1/2 */
10356     /* RR Channel Needed 10.5.2.8 M V 1/2 */
10357     ELEM_MAND_VV_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_PAGE_MODE,
10358                        GSM_A_PDU_TYPE_RR, DE_RR_CHNL_NEEDED, ei_gsm_a_rr_missing_mandatory_element);
10359
10360     /* RR Mobile Identity 10.5.1.4 M LV 2-9 */
10361     ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, " - Mobile Identity 1", ei_gsm_a_rr_missing_mandatory_element);
10362
10363     /* RR Mobile Identity 10.5.1.4 O TLV 3-10 */
10364     ELEM_OPT_TLV(0x17, GSM_A_PDU_TYPE_COMMON, DE_MID, " - Mobile Identity 2");
10365
10366     /* RR P1 Rest Octets 10.5.2.23 M V 0-17 */
10367     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_P1_REST_OCT, NULL, ei_gsm_a_rr_missing_mandatory_element);
10368
10369 }
10370
10371 /*
10372  * 9.1.23 Paging Request Type 2
10373  */
10374 static void
10375 dtap_rr_paging_req_type_2(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10376 {
10377     guint32 curr_offset;
10378     guint32 consumed;
10379     guint   curr_len;
10380
10381     curr_offset = offset;
10382     curr_len = len;
10383
10384     /* RR Page Mode 10.5.2.26 M V 1/2 */
10385     /* RR Channel Needed 10.5.2.8 M V 1/2 */
10386     ELEM_MAND_VV_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_PAGE_MODE,
10387                        GSM_A_PDU_TYPE_RR, DE_RR_CHNL_NEEDED, ei_gsm_a_rr_missing_mandatory_element);
10388
10389     /* RR TMSI/P-TMSI 10.5.2.42 M V 4 */
10390     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TMSI_PTMSI, " - Mobile Identity 1", ei_gsm_a_rr_missing_mandatory_element);
10391
10392     /* RR TMSI/P-TMSI 10.5.2.42 M V 4 */
10393     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TMSI_PTMSI, " - Mobile Identity 2", ei_gsm_a_rr_missing_mandatory_element);
10394
10395     /* RR Mobile Identity 10.5.1.4 O TLV 3-10 */
10396     ELEM_OPT_TLV(0x17, GSM_A_PDU_TYPE_COMMON, DE_MID, " - Mobile Identity 3");
10397
10398     /* RR P2 Rest Octets 10.5.2.24 M V 1-11 */
10399     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_P2_REST_OCT, NULL, ei_gsm_a_rr_missing_mandatory_element);
10400
10401 }
10402
10403 /*
10404  * 9.1.24 Paging Request Type 3
10405  */
10406 static void
10407 dtap_rr_paging_req_type_3(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10408 {
10409     guint32 curr_offset;
10410     guint32 consumed;
10411     guint   curr_len;
10412
10413     curr_offset = offset;
10414     curr_len = len;
10415
10416     /* RR Page Mode 10.5.2.26 M V 1/2 */
10417     /* RR Channel Needed 10.5.2.8 M V 1/2 */
10418     ELEM_MAND_VV_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_PAGE_MODE,
10419                        GSM_A_PDU_TYPE_RR, DE_RR_CHNL_NEEDED, ei_gsm_a_rr_missing_mandatory_element);
10420
10421     /* RR TMSI/P-TMSI 10.5.2.42 M V 4 */
10422     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TMSI_PTMSI, " - Mobile Identity 1", ei_gsm_a_rr_missing_mandatory_element);
10423
10424     /* RR TMSI/P-TMSI 10.5.2.42 M V 4 */
10425     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TMSI_PTMSI, " - Mobile Identity 2", ei_gsm_a_rr_missing_mandatory_element);
10426
10427     /* RR TMSI/P-TMSI 10.5.2.42 M V 4 */
10428     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TMSI_PTMSI, " - Mobile Identity 3", ei_gsm_a_rr_missing_mandatory_element);
10429
10430     /* RR TMSI/P-TMSI 10.5.2.42 M V 4 */
10431     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TMSI_PTMSI, " - Mobile Identity 4", ei_gsm_a_rr_missing_mandatory_element);
10432
10433     /* RR P3 Rest Octets 10.5.2.25 M V 3 */
10434     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_P3_REST_OCT, NULL, ei_gsm_a_rr_missing_mandatory_element);
10435
10436 }
10437
10438 /*
10439  * [4] 9.1.25 Paging response
10440  */
10441 static void
10442 dtap_rr_paging_resp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10443 {
10444     guint32     curr_offset;
10445     guint32     consumed;
10446     guint       curr_len;
10447     guint8      oct;
10448     proto_tree *subtree;
10449
10450     curr_offset = offset;
10451     curr_len = len;
10452
10453     /*
10454      * special dissection for Cipher Key Sequence Number
10455      */
10456     oct = tvb_get_guint8(tvb, curr_offset);
10457
10458     proto_tree_add_bits_item(tree, hf_gsm_a_rr_spare, tvb, (curr_offset<<3)+4, 4, ENC_NA);
10459
10460     subtree = proto_tree_add_subtree(tree,
10461                             tvb, curr_offset, 1, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM], NULL,
10462                             val_to_str_ext_const(DE_CIPH_KEY_SEQ_NUM, &gsm_common_elem_strings_ext, ""));
10463
10464     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_spare, tvb, (curr_offset<<3)+3, 1, ENC_NA);
10465
10466     switch (oct & 0x07)
10467     {
10468     case 0x07:
10469         proto_tree_add_uint_format_value(subtree, hf_gsm_a_rr_ciphering_key_seq_num,
10470                             tvb, curr_offset, 1, oct, "No key is available");
10471         break;
10472
10473     default:
10474         proto_tree_add_uint(subtree, hf_gsm_a_rr_ciphering_key_seq_num, tvb, curr_offset, 1, oct);
10475         break;
10476     }
10477
10478     curr_offset++;
10479     curr_len--;
10480
10481     ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, NULL, ei_gsm_a_rr_missing_mandatory_element);
10482
10483     ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, NULL, ei_gsm_a_rr_missing_mandatory_element);
10484
10485     ELEM_OPT_TV_SHORT(0xC0, GSM_A_PDU_TYPE_DTAP, DE_ADD_UPD_PARAMS, NULL);
10486
10487     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
10488 }
10489
10490 /*
10491  * [4] 9.1.26 Partial Release
10492  */
10493 static void
10494 dtap_rr_partial_rel(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10495 {
10496     guint32 curr_offset;
10497     guint32 consumed;
10498     guint   curr_len;
10499
10500     curr_offset = offset;
10501     curr_len = len;
10502
10503     /* Channel Description  10.5.2.5  M V 3 */
10504     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, NULL, ei_gsm_a_rr_missing_mandatory_element);
10505
10506     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
10507 }
10508
10509 /*
10510  * [4] 9.1.27 Partial Release Complete
10511  */
10512 /* empty message */
10513
10514 /*
10515  * [4] 9.1.28 Physical Information
10516  */
10517 static void
10518 dtap_rr_phy_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10519 {
10520     guint32 curr_offset;
10521     guint32 consumed;
10522     guint   curr_len;
10523
10524     curr_offset = offset;
10525     curr_len = len;
10526
10527     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TIMING_ADV, NULL, ei_gsm_a_rr_missing_mandatory_element);
10528
10529     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
10530 }
10531
10532 /*
10533  * [4] 9.1.29
10534  */
10535 static void
10536 dtap_rr_rr_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10537 {
10538     guint32 curr_offset;
10539     guint32 consumed;
10540     guint   curr_len;
10541
10542     curr_offset = offset;
10543     curr_len = len;
10544
10545     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE, NULL, ei_gsm_a_rr_missing_mandatory_element);
10546
10547     EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_gsm_a_rr_extraneous_data);
10548 }
10549
10550 /*
10551  * [4] 9.1.31
10552  */
10553 static void
10554 dtap_rr_sys_info_1(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10555 {
10556     guint32 curr_offset;
10557     guint32 consumed;
10558     guint   curr_len;
10559
10560     curr_offset = offset;
10561     curr_len = len;
10562
10563     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CELL_CH_DSC, NULL, ei_gsm_a_rr_missing_mandatory_element);
10564
10565     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_RACH_CTRL_PARAM, NULL, ei_gsm_a_rr_missing_mandatory_element);
10566
10567     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SI1_REST_OCT, NULL, ei_gsm_a_rr_missing_mandatory_element);
10568 }
10569
10570 /*
10571  * [4] 9.1.32
10572  */
10573 static void
10574 dtap_rr_sys_info_2(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10575 {
10576     guint32 curr_offset;
10577     guint32 consumed;
10578     guint   curr_len;
10579
10580     curr_offset = offset;
10581     curr_len = len;
10582
10583     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NEIGH_CELL_DESC, " - BCCH Frequency List", ei_gsm_a_rr_missing_mandatory_element);
10584
10585     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NCC_PERM, NULL, ei_gsm_a_rr_missing_mandatory_element);
10586
10587     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_RACH_CTRL_PARAM, NULL, ei_gsm_a_rr_missing_mandatory_element);
10588 }
10589
10590 /*
10591  * [4] 9.1.33
10592  */
10593 static void
10594 dtap_rr_sys_info_2bis(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10595 {
10596     guint32 curr_offset;
10597     guint32 consumed;
10598     guint   curr_len;
10599
10600     curr_offset = offset;
10601     curr_len = len;
10602
10603     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NEIGH_CELL_DESC, " - Extended BCCH Frequency List", ei_gsm_a_rr_missing_mandatory_element);
10604
10605     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_RACH_CTRL_PARAM, NULL, ei_gsm_a_rr_missing_mandatory_element);
10606 }
10607
10608 /*
10609  * [4] 9.1.34
10610  */
10611 static void
10612 dtap_rr_sys_info_2ter(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10613 {
10614     guint32 curr_offset;
10615     guint32 consumed;
10616     guint   curr_len;
10617
10618     curr_offset = offset;
10619     curr_len = len;
10620
10621     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NEIGH_CELL_DESC2, " - Extended BCCH Frequency List", ei_gsm_a_rr_missing_mandatory_element);
10622
10623     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SI2TER_REST_OCT, NULL, ei_gsm_a_rr_missing_mandatory_element);
10624 }
10625
10626 /*
10627  * [4] 9.1.34a
10628  */
10629 static void
10630 dtap_rr_sys_info_2quater(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10631 {
10632     guint32 curr_offset;
10633     guint32 consumed;
10634     guint   curr_len;
10635
10636     curr_offset = offset;
10637     curr_len = len;
10638
10639     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SI2QUATER_REST_OCT, NULL, ei_gsm_a_rr_missing_mandatory_element);
10640 }
10641
10642 /*
10643  * [4] 9.1.35
10644  */
10645 static void
10646 dtap_rr_sys_info_3(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10647 {
10648     guint32 curr_offset;
10649     guint32 consumed;
10650     guint   curr_len;
10651
10652     curr_offset = offset;
10653     curr_len = len;
10654
10655     ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_CELL_ID, NULL, ei_gsm_a_rr_missing_mandatory_element);
10656
10657     ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_LAI, NULL, ei_gsm_a_rr_missing_mandatory_element);
10658
10659     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CTRL_CH_DESC, NULL, ei_gsm_a_rr_missing_mandatory_element);
10660
10661     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CELL_OPT_BCCH, NULL, ei_gsm_a_rr_missing_mandatory_element);
10662
10663     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CELL_SEL_PARAM, NULL, ei_gsm_a_rr_missing_mandatory_element);
10664
10665     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_RACH_CTRL_PARAM, NULL, ei_gsm_a_rr_missing_mandatory_element);
10666
10667     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SI3_REST_OCT, NULL, ei_gsm_a_rr_missing_mandatory_element);
10668 }
10669
10670 /*
10671  * [4] 9.1.36
10672  */
10673 static void
10674 dtap_rr_sys_info_4(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10675 {
10676     guint32 curr_offset;
10677     guint32 consumed;
10678     guint   curr_len;
10679
10680     curr_offset = offset;
10681     curr_len = len;
10682
10683     ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_LAI, NULL, ei_gsm_a_rr_missing_mandatory_element);
10684
10685     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CELL_SEL_PARAM, NULL, ei_gsm_a_rr_missing_mandatory_element);
10686
10687     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_RACH_CTRL_PARAM, NULL, ei_gsm_a_rr_missing_mandatory_element);
10688
10689     ELEM_OPT_TV(0x64, GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, " - CBCH");
10690
10691     ELEM_OPT_TLV(0x72, GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, " - CBCH");
10692
10693     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SI4_REST_OCT, NULL, ei_gsm_a_rr_missing_mandatory_element);
10694 }
10695
10696 /*
10697  * [4] 9.1.37
10698  */
10699 static void
10700 dtap_rr_sys_info_5(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10701 {
10702     guint32 curr_offset;
10703     guint32 consumed;
10704     guint   curr_len;
10705
10706     curr_offset = offset;
10707     curr_len = len;
10708
10709     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NEIGH_CELL_DESC, " - BCCH Frequency List", ei_gsm_a_rr_missing_mandatory_element);
10710 }
10711
10712 /*
10713  * [4] 9.1.38
10714  */
10715 static void
10716 dtap_rr_sys_info_5bis(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10717 {
10718     guint32 curr_offset;
10719     guint32 consumed;
10720     guint   curr_len;
10721
10722     curr_offset = offset;
10723     curr_len = len;
10724
10725     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NEIGH_CELL_DESC, " - Extended BCCH Frequency List", ei_gsm_a_rr_missing_mandatory_element);
10726 }
10727
10728 /*
10729  * [4] 9.1.39
10730  */
10731 static void
10732 dtap_rr_sys_info_5ter(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10733 {
10734     guint32 curr_offset;
10735     guint32 consumed;
10736     guint   curr_len;
10737
10738     curr_offset = offset;
10739     curr_len = len;
10740
10741     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NEIGH_CELL_DESC2, " - Extended BCCH Frequency List", ei_gsm_a_rr_missing_mandatory_element);
10742 }
10743
10744 /*
10745  * [4] 9.1.40
10746  */
10747 static void
10748 dtap_rr_sys_info_6(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10749 {
10750     guint32 curr_offset;
10751     guint32 consumed;
10752     guint   curr_len;
10753
10754     curr_offset = offset;
10755     curr_len = len;
10756
10757     ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_CELL_ID, NULL, ei_gsm_a_rr_missing_mandatory_element);
10758
10759     ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_LAI, NULL, ei_gsm_a_rr_missing_mandatory_element);
10760
10761     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CELL_OPT_SACCH, NULL, ei_gsm_a_rr_missing_mandatory_element);
10762
10763     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NCC_PERM, NULL, ei_gsm_a_rr_missing_mandatory_element);
10764
10765     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SI6_REST_OCT, NULL, ei_gsm_a_rr_missing_mandatory_element);
10766 }
10767
10768 /*
10769  * [4] 9.1.43a
10770  */
10771 static void
10772 dtap_rr_sys_info_13(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10773 {
10774     guint32 curr_offset;
10775     guint32 consumed;
10776     guint   curr_len;
10777
10778     curr_offset = offset;
10779     curr_len = len;
10780
10781     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SI13_REST_OCT, NULL, ei_gsm_a_rr_missing_mandatory_element);
10782 }
10783
10784 /*
10785  * [4] 9.1.43b
10786  */
10787 static void
10788 dtap_rr_sys_info_21(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10789 {
10790     guint32 curr_offset;
10791     guint32 consumed;
10792     guint   curr_len;
10793
10794     curr_offset = offset;
10795     curr_len = len;
10796
10797     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SI21_REST_OCT, NULL, ei_gsm_a_rr_missing_mandatory_element);
10798 }
10799
10800 /*
10801  * [4] 9.1.44 Talker indication
10802  */
10803 static void
10804 dtap_rr_talker_indication(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10805 {
10806     guint32 curr_offset;
10807     guint32 consumed;
10808     guint   curr_len;
10809
10810     curr_offset = offset;
10811     curr_len = len;
10812
10813     /* Mobile Station Classmark 2 10.5.1.6 M LV */
10814     ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, NULL, ei_gsm_a_rr_missing_mandatory_element);
10815
10816     /* Mobile identity 10.5.1.4 M LV */
10817     ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, NULL, ei_gsm_a_rr_missing_mandatory_element);
10818
10819     /* Ciphering Key Sequence Number 10.5.1.2 O TV 1 */
10820     ELEM_OPT_TV_SHORT(0xD0,GSM_A_PDU_TYPE_COMMON, DE_CIPH_KEY_SEQ_NUM,NULL);
10821 }
10822
10823 /*
10824  * [4] 9.1.48 Uplink release
10825  */
10826 static void
10827 dtap_rr_upl_rel(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10828 {
10829     guint32 curr_offset;
10830     guint32 consumed;
10831     guint   curr_len;
10832
10833     curr_offset = offset;
10834     curr_len = len;
10835
10836     /* RR Cause 10.5.2.31 M V 1 */
10837     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE, NULL, ei_gsm_a_rr_missing_mandatory_element);
10838 }
10839
10840 /*
10841  * [4] 9.1.49 VGCS uplink grant
10842  */
10843 static void
10844 dtap_rr_vgcs_upl_grant(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10845 {
10846     guint32 curr_offset;
10847     guint32 consumed;
10848     guint   curr_len;
10849
10850     curr_offset = offset;
10851     curr_len = len;
10852
10853     /* Request reference 10.5.2.30 M V 3 */
10854     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF, NULL, ei_gsm_a_rr_missing_mandatory_element);
10855
10856     /* Timing advance 10.5.2.40 M V 1 */
10857     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TIMING_ADV, NULL, ei_gsm_a_rr_missing_mandatory_element);
10858 }
10859
10860 /*
10861  * [4] 9.1.51 Extended Measurement Order
10862  */
10863 static void
10864 dtap_rr_ext_meas_order(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10865 {
10866     guint32 curr_offset;
10867     guint32 consumed;
10868     guint   curr_len;
10869
10870     curr_offset = offset;
10871     curr_len = len;
10872
10873     /* Extended Measurement Frequency List  10.5.2.46  M V 16 */
10874     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_EXT_MEAS_FREQ_LIST, NULL, ei_gsm_a_rr_missing_mandatory_element);
10875 }
10876
10877 /*
10878  * [4] 9.1.52 Extended Measurement Report
10879  */
10880 static void
10881 dtap_rr_ext_meas_report(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10882 {
10883     guint32 curr_offset;
10884     guint32 consumed;
10885     guint   curr_len;
10886
10887     curr_offset = offset;
10888     curr_len = len;
10889
10890     /* Extended Measurement Result  10.5.2.45  M V 16 */
10891     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_EXT_MEAS_RESULT, NULL, ei_gsm_a_rr_missing_mandatory_element);
10892 }
10893
10894 /*
10895  * 9.1.53 Application Information
10896  */
10897 static void
10898 dtap_rr_app_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
10899 {
10900     guint32 curr_offset;
10901     guint32 consumed;
10902     guint   curr_len;
10903
10904     curr_offset = offset;
10905     curr_len    = len;
10906
10907     /*
10908      * APDU ID IE (10.5.2.48) M V 1/2
10909      * APDU Flags (10.5.2.49) M V 1/2
10910      */
10911     ELEM_MAND_VV_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_APDU_ID,
10912                        GSM_A_PDU_TYPE_RR, DE_RR_APDU_FLAGS,
10913                        ei_gsm_a_rr_missing_mandatory_element);
10914
10915     ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_APDU_DATA, NULL, ei_gsm_a_rr_missing_mandatory_element);
10916 }
10917
10918 /*
10919  * [4] 9.1.54 Measurement Information
10920  */
10921 static const value_string gsm_a_rr_3g_wait_vals[] = {
10922     { 0, "1 instance that contain 3G Neighbour Cell Description shall be received"},
10923     { 1, "2 instances that contain 3G Neighbour Cell Description shall be received"},
10924     { 2, "3 instances that contain 3G Neighbour Cell Description shall be received"},
10925     { 3, "4 instances that contain 3G Neighbour Cell Description shall be received"},
10926     { 4, "5 instances that contain 3G Neighbour Cell Description shall be received"},
10927     { 5, "6 instances that contain 3G Neighbour Cell Description shall be received"},
10928     { 6, "7 instances that contain 3G Neighbour Cell Description shall be received"},
10929     { 7, "8 instances that contain 3G Neighbour Cell Description shall be received"},
10930     { 0, NULL }
10931 };
10932
10933
10934 static void
10935 sacch_rr_meas_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_)
10936 {
10937     proto_tree *subtree = NULL, *subtree2 = NULL;
10938     proto_item *item, *item2;
10939     guint32     curr_offset;
10940     gint        bit_offset, bit_offset_sav, bit_offset_sav2;
10941     guint8      value, idx;
10942     guint8      tvb_len = tvb_reported_length(tvb);
10943     guint16     bit_len = tvb_len << 3;
10944
10945     curr_offset = offset;
10946     bit_offset = curr_offset << 3;
10947
10948     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ba_ind, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
10949     bit_offset += 1;
10950     proto_tree_add_bits_item(tree, hf_gsm_a_rr_3g_ba_ind, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
10951     bit_offset += 1;
10952     proto_tree_add_bits_item(tree, hf_gsm_a_rr_mp_change_mark, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
10953     bit_offset += 1;
10954     proto_tree_add_bits_item(tree, hf_gsm_a_rr_mi_index, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
10955     bit_offset += 4;
10956     proto_tree_add_bits_item(tree, hf_gsm_a_rr_mi_count, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
10957     bit_offset += 4;
10958     proto_tree_add_bits_item(tree, hf_gsm_a_rr_pwrc, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
10959     bit_offset += 1;
10960     proto_tree_add_bits_item(tree, hf_gsm_a_rr_gsm_report_type, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
10961     bit_offset += 1;
10962     proto_tree_add_bits_item(tree, hf_gsm_a_rr_reporting_rate, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
10963     bit_offset +=1;
10964     proto_tree_add_bits_item(tree, hf_gsm_a_rr_invalid_bsic_reporting, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
10965     bit_offset +=1;
10966     if (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_real_time_difference_description))
10967     { /* Real Time Difference Description */
10968         bit_offset += de_rr_rtd_desc(tvb, tree, bit_offset, DE_RR_REST_OCTETS_RTD_DESC);
10969     }
10970     if (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_bsic_description))
10971     { /* BSIC Description */
10972         bit_offset += de_rr_bsic_desc(tvb, tree, bit_offset, DE_RR_REST_OCTETS_BSIC_DESC);
10973     }
10974     if (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_report_priority_description))
10975     { /* Report Priority Description */
10976         bit_offset += de_rr_report_priority_desc(tvb, tree, bit_offset, DE_RR_REST_OCTETS_REPORT_PRIO_DESC);
10977     }
10978     if (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_measurement_parameters_description))
10979     { /* Measurement Parameters Description */
10980         bit_offset += de_rr_meas_param_desc(tvb, tree, bit_offset, DE_RR_REST_OCTETS_MEAS_PARAM_DESC);
10981     }
10982     if (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_future_extensions_of_the_2g_parameters))
10983     {  /* used for future extensions of the 2G parameters */
10984         value = tvb_get_bits8(tvb,bit_offset,8);
10985         bit_offset += 8 + value + 1;
10986     }
10987     if (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_3g_neighbour_cell_description))
10988     { /* 3G Neighbour Cell Description */
10989         bit_offset_sav = bit_offset;
10990         subtree = proto_tree_add_subtree(tree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_NEIGH_CELL_DESC], &item,
10991                             gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_NEIGH_CELL_DESC].strptr);
10992         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_3g_wait_present))
10993         {
10994             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_wait, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
10995             bit_offset += 3;
10996         }
10997         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_index_start_3g_present))
10998         {
10999             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_index_start_3g, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
11000             bit_offset += 7;
11001         }
11002         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_absolute_index_start_emr_present))
11003         {
11004             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_absolute_index_start_emr, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
11005             bit_offset += 7;
11006         }
11007         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_utran_fdd_description))
11008         { /* UTRAN FDD Description */
11009             bit_offset += de_rr_si2quater_meas_info_utran_fdd_desc(tvb, subtree, bit_offset);
11010         }
11011         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_utran_tdd_description))
11012         { /* UTRAN TDD Description */
11013             bit_offset += de_rr_si2quater_meas_info_utran_tdd_desc(tvb, subtree, bit_offset);
11014         }
11015         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_cdma2000_description))
11016         { /* CDMA2000 Description */
11017             bit_offset_sav2 = bit_offset;
11018             subtree2 = proto_tree_add_subtree(subtree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_CDMA2000_DESC], &item2,
11019                                             gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_CDMA2000_DESC].strptr);
11020             bit_offset += 16; /* cdma2000 frequency band + cdma2000 frequency */
11021             idx = tvb_get_bits8(tvb,bit_offset,5); /* number_cdma2000_cells */
11022             bit_offset += 5;
11023             while (idx)
11024             {
11025                 bit_offset += 9; /* Pilot PN offset */
11026                 if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_additional_information_for_3x_auxiliary_pilot))
11027                 {
11028                     value = tvb_get_bits8(tvb,bit_offset,3);
11029                     switch (value)
11030                     {
11031                     case 0:
11032                         bit_offset += 5; /* TD_MODE + TD_POWER_LEVEL */
11033                         break;
11034                     case 1:
11035                         bit_offset += 2; /* QOF */
11036                         bit_offset += tvb_get_bits8(tvb,bit_offset,3) + 3 + 6; /* WALSH_LEN_A + bit(val(WALSH_LEN_A)+6) */
11037                         break;
11038                     case 2:
11039                         bit_offset += 2; /* QOF */
11040                         bit_offset += tvb_get_bits8(tvb,bit_offset,3) + 3 + 6; /* WALSH_LEN_B + bit(val(WALSH_LEN_B)+6) */
11041                         bit_offset += 4; /* AUX_TD_POWER_LEVEL + TD_MODE */
11042                         break;
11043                     case 3:
11044                         bit_offset += 8; /* SR3_PRIM_PILOT + SR3_PILOT_POWER1 + SR3_PILOT_POWER2 */
11045                         break;
11046                     case 6:
11047                         bit_offset += 10; /* SR3_PRIM_PILOT + SR3_PILOT_POWER1 + SR3_PILOT_POWER2 + QOF */
11048                         bit_offset += tvb_get_bits8(tvb,bit_offset,3) + 3 + 6; /* WALSH_LEN_C + bit(val(WALSH_LEN_C)+6) */
11049                         if (tvb_get_bits8(tvb,bit_offset,1))
11050                         {
11051                             bit_offset += 3; /* 1 + QOF1 */
11052                             bit_offset += tvb_get_bits8(tvb,bit_offset,3) + 3 + 6; /* WALSH_LENGTH1 + bit(val(WALSH_LENGTH1)+6) */
11053                         }
11054                         else
11055                             bit_offset += 1;
11056                         if (tvb_get_bits8(tvb,bit_offset,1))
11057                         {
11058                             bit_offset += 3; /* 1 + QOF2 */
11059                             bit_offset += tvb_get_bits8(tvb,bit_offset,3) + 3 + 6; /* WALSH_LENGTH2 + bit(val(WALSH_LENGTH2)+6) */
11060                         }
11061                         else
11062                             bit_offset += 1;
11063                         break;
11064                     default:
11065                         /* decoding sequence is unknown ! */
11066                         return;
11067                     }
11068                 }
11069                 idx -= 1;
11070             }
11071             proto_tree_add_expert_format(subtree2, pinfo, &ei_gsm_a_rr_data_not_dissected, tvb, bit_offset_sav2>>3, ((bit_offset-bit_offset_sav2)>>3)+1, "Data (Not decoded)");
11072             proto_item_set_len(item2, (bit_offset>>3) - (bit_offset_sav>>3)+1);
11073         }
11074         proto_item_set_len(item, (bit_offset>>3) - (bit_offset_sav>>3)+1);
11075     }
11076     if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_3g_measurement_parameters_description))
11077     { /* 3G Measurement Parameters Description */
11078         guint8 reporting_quant = 0;
11079         bit_offset_sav = bit_offset;
11080         subtree = proto_tree_add_subtree(tree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_MEAS_PARAM_DESC], &item,
11081                                     gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_MEAS_PARAM_DESC].strptr);
11082         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_qsearch_c, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
11083         bit_offset += 4;
11084         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_search_prio, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
11085         bit_offset += 1;
11086         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_fdd_rep_quant, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
11087         reporting_quant = gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_3g_reporting_quantity);
11088         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_fdd_multirat_reporting_present))
11089         {
11090             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_fdd_multirat_reporting, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
11091             bit_offset += 2;
11092         }
11093         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_fdd_reporting_offset_present))
11094         {
11095             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_fdd_reporting_offset, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
11096             bit_offset += 3;
11097             if (reporting_quant == 0)
11098             {
11099               proto_tree_add_bits_item(subtree, hf_gsm_a_rr_fdd_reporting_threshold_rscp, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
11100             }
11101             else
11102             {
11103               proto_tree_add_bits_item(subtree, hf_gsm_a_rr_fdd_reporting_threshold_ecn0, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
11104             }
11105             bit_offset += 3;
11106         }
11107         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_tdd_multirat_reporting_present))
11108         {
11109             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tdd_multirat_reporting, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
11110             bit_offset += 2;
11111         }
11112         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_tdd_reporting_offset_present))
11113         {
11114             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tdd_reporting_offset, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
11115             bit_offset += 3;
11116             if (reporting_quant == 0)
11117             {
11118               proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tdd_reporting_threshold_rscp, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
11119             }
11120             else
11121             {
11122               proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tdd_reporting_threshold_ecn0, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
11123             }
11124             bit_offset += 3;
11125         }
11126         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_cdma2000_multirat_reporting))
11127             bit_offset += 2; /* CDMA2000 Multirat Reporting */
11128         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_cdma2000_reporting_threshold))
11129             bit_offset += 6; /* CDMA2000 Reporting Offset + CDMA2000 Reporting Threshold */
11130         proto_item_set_len(item, (bit_offset>>3) - (bit_offset_sav>>3)+1);
11131     }
11132
11133     /* Null breakpoint */
11134     if (bit_len - bit_offset > 0)
11135     {
11136         /* There is still room left in the Rest Octets IE */
11137         if (gsm_rr_csn_HL_flag(tvb, tree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_5))
11138         { /* Additions in Rel-5 */
11139             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_3g_additional_measurement_parameters_description_2))
11140             { /* 3G Additional Measurement Parameters Description 2 */
11141                 bit_offset += de_rr_3g_add_meas_param_desc2(tvb, tree, bit_offset);
11142             }
11143
11144             /* Null breakpoint */
11145             if (bit_len - bit_offset > 0)
11146             {
11147                 /* There is still room left in the Rest Octets IE */
11148                 if (gsm_rr_csn_HL_flag(tvb, tree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_7))
11149                 { /* Additions in Rel-7 */
11150                     if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_700_reporting))
11151                     {
11152                         proto_tree_add_bits_item(tree, hf_gsm_a_rr_700_reporting_offset, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
11153                         bit_offset += 3;
11154                         proto_tree_add_bits_item(tree, hf_gsm_a_rr_700_reporting_threshold, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
11155                         bit_offset += 3;
11156                     }
11157                     if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_810_reporting))
11158                     {
11159                         proto_tree_add_bits_item(tree, hf_gsm_a_rr_810_reporting_offset, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
11160                         bit_offset += 3;
11161                         proto_tree_add_bits_item(tree, hf_gsm_a_rr_810_reporting_threshold, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
11162                         bit_offset += 3;
11163                     }
11164
11165                     /* Null breakpoint */
11166                     if (bit_len - bit_offset > 0)
11167                     {
11168                       /* There is still room left in the Rest Octets IE */
11169                        /* Additions in Rel-8 */
11170                       if (gsm_rr_csn_HL_flag(tvb, tree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_8))
11171                       { /* Additions in Rel-8 */
11172                         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_3g_supplementary_parameters_description))
11173                         {
11174                           bit_offset += de_rr_3g_supplementary_param_desc_mi(tvb, tree, bit_offset);
11175                         }
11176                         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_eutran_parameters_description))
11177                         {
11178                           bit_offset += de_rr_eutran_param_desc_mi(tvb, tree, bit_offset);
11179                         }
11180                         if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_eutran_csg_description))
11181                         {
11182                           bit_offset += de_rr_eutran_csg_desc_mi(tvb, tree, bit_offset);
11183                         }
11184                       }
11185                     }
11186                 }
11187             }
11188         }
11189     }
11190     gsm_rr_csn_padding_bits(tree, tvb, bit_offset, tvb_len);
11191 }
11192
11193 static guint32
11194 sacch_rr_eutran_meas_report(tvbuff_t *tvb, proto_tree *tree, guint32 bit_offset, guint len_in_bit _U_)
11195 {
11196     proto_tree *subtree;
11197     gint        curr_bit_offset;
11198     gint8       n_eutran;
11199
11200     curr_bit_offset = bit_offset;
11201
11202     subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EUTRAN_MEASUREMENT_REPORT], NULL,
11203                 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EUTRAN_MEASUREMENT_REPORT].strptr);
11204
11205     n_eutran = tvb_get_bits8(tvb,curr_bit_offset,2);
11206     n_eutran += 1;
11207     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_mr_n_eutran, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
11208     curr_bit_offset += 2;
11209
11210     while ( (n_eutran > 0) && (curr_bit_offset - bit_offset < len_in_bit) )
11211     {
11212         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_mr_freq_idx, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
11213         curr_bit_offset += 3;
11214         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_mr_cell_id, tvb, curr_bit_offset, 9, ENC_BIG_ENDIAN);
11215         curr_bit_offset += 9;
11216         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_mr_rpt_quantity, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
11217         curr_bit_offset += 6;
11218         n_eutran -= 1;
11219     }
11220
11221     return curr_bit_offset - bit_offset;
11222 }
11223
11224 /*
11225  * [4] 9.1.55 Enhanced Measurement Information
11226  */
11227 static const true_false_string gsm_a_rr_bsic_seen_value = {
11228     "One Cell or more with invalid BSIC and allowed NCC part of BSIC is seen",
11229     "No cell with invalid BSIC and allowed NCC part of BSIC is seen"
11230 };
11231
11232 static const true_false_string gsm_a_rr_scale_value = {
11233     "+10 dB",
11234     "0 dB"
11235 };
11236
11237 static const value_string gsm_a_rr_mean_bep_gmsk_vals[] = {
11238     {  0, "log10(BEP) > -0.60"},
11239     {  1, "-0.70 < log10(BEP) < -0.60"},
11240     {  2, "-0.80 < log10(BEP) < -0.70"},
11241     {  3, "-0.90 < log10(BEP) < -0.80"},
11242     {  4, "-1.00 < log10(BEP) < -0.90"},
11243     {  5, "-1.10 < log10(BEP) < -1.00"},
11244     {  6, "-1.20 < log10(BEP) < -1.10"},
11245     {  7, "-1.30 < log10(BEP) < -1.20"},
11246     {  8, "-1.40 < log10(BEP) < -1.30"},
11247     {  9, "-1.50 < log10(BEP) < -1.40"},
11248     { 10, "-1.60 < log10(BEP) < -1.50"},
11249     { 11, "-1.70 < log10(BEP) < -1.60"},
11250     { 12, "-1.80 < log10(BEP) < -1.70"},
11251     { 13, "-1.90 < log10(BEP) < -1.80"},
11252     { 14, "-2.00 < log10(BEP) < -1.90"},
11253     { 15, "-2.10 < log10(BEP) < -2.00"},
11254     { 16, "-2.20 < log10(BEP) < -2.10"},
11255     { 17, "-2.30 < log10(BEP) < -2.20"},
11256     { 18, "-2.40 < log10(BEP) < -2.30"},
11257     { 19, "-2.50 < log10(BEP) < -2.40"},
11258     { 20, "-2.60 < log10(BEP) < -2.50"},
11259     { 21, "-2.70 < log10(BEP) < -2.60"},
11260     { 22, "-2.80 < log10(BEP) < -2.70"},
11261     { 23, "-2.90 < log10(BEP) < -2.80"},
11262     { 24, "-3.00 < log10(BEP) < -2.90"},
11263     { 25, "-3.10 < log10(BEP) < -3.00"},
11264     { 26, "-3.20 < log10(BEP) < -3.10"},
11265     { 27, "-3.30 < log10(BEP) < -3.20"},
11266     { 28, "-3.40 < log10(BEP) < -3.30"},
11267     { 29, "-3.50 < log10(BEP) < -3.40"},
11268     { 30, "-3.60 < log10(BEP) < -3.50"},
11269     { 31, "log10(BEP) < -3.60"},
11270     {  0, NULL }
11271 };
11272
11273 static const value_string gsm_a_rr_cv_bep_vals[] = {
11274     {  0, "1.75 < CV BEP < 2.00"},
11275     {  1, "1.50 < CV BEP < 1.75"},
11276     {  2, "1.25 < CV BEP < 1.50"},
11277     {  3, "1.00 < CV BEP < 1.25"},
11278     {  4, "0.75 < CV BEP < 1.00"},
11279     {  5, "0.50 < CV BEP < 0.75"},
11280     {  6, "0.25 < CV BEP < 0.50"},
11281     {  7, "0.00 < CV BEP < 0.25"},
11282     {  0, NULL }
11283 };
11284
11285 static void
11286 sacch_rr_enh_meas_report(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
11287 {
11288     proto_tree *subtree;
11289     proto_item *item;
11290     guint32     curr_offset;
11291     guint       bit_offset, bit_offset_sav;
11292     guint8      tvb_len = tvb_reported_length(tvb);
11293     guint16     bit_len = tvb_len << 3;
11294     guint8      idx;
11295
11296     curr_offset = offset;
11297     bit_offset = curr_offset << 3;
11298
11299     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ba_used, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
11300     bit_offset += 1;
11301     proto_tree_add_bits_item(tree, hf_gsm_a_rr_3g_ba_used, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
11302     bit_offset += 1;
11303     proto_tree_add_bits_item(tree, hf_gsm_a_rr_bsic_seen, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
11304     bit_offset += 1;
11305     proto_tree_add_bits_item(tree, hf_gsm_a_rr_scale, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
11306     bit_offset += 1;
11307     if (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_serving_cell_data))
11308     { /* Serving cell data */
11309         bit_offset_sav = bit_offset;
11310         subtree = proto_tree_add_subtree(tree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_SERVING_CELL_DATA], &item,
11311                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_SERVING_CELL_DATA].strptr);
11312         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_dtx_used, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
11313         bit_offset += 1;
11314         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rxlev_full_serv_cell, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
11315         bit_offset += 6;
11316         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rxqual_full_serv_cell, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
11317         bit_offset += 3;
11318         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_mean_bep_gmsk, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
11319         bit_offset += 5;
11320         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_mean_cv_bep, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
11321         bit_offset += 3;
11322         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nbr_rcvd_blocks, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
11323         bit_offset += 5;
11324         proto_item_set_len(item, (bit_offset>>3) - (bit_offset_sav>>3)+1);
11325     }
11326     while (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_repeated_invalid_bsic_information))
11327     { /* Repeated Invalid BSIC Information */
11328         bit_offset_sav = bit_offset;
11329         subtree = proto_tree_add_subtree(tree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_REPEAT_INV_BSIC_INFO], &item,
11330                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_REPEAT_INV_BSIC_INFO].strptr);
11331         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bcch_freq_ncell, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
11332         bit_offset += 5;
11333         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bsic_ncell, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
11334         bit_offset += 6;
11335         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rxlev_ncell, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
11336         bit_offset += 6;
11337         proto_item_set_len(item, (bit_offset>>3) - (bit_offset_sav>>3)+1);
11338     }
11339     if (gsm_rr_csn_flag(tvb, tree, bit_offset++, hf_gsm_a_rr_bitmap_type_reporting))
11340     { /* Bitmap Type Reporting */
11341         subtree = proto_tree_add_subtree(tree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_BITMAP_TYPE_REPORTING], NULL,
11342                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_BITMAP_TYPE_REPORTING].strptr);
11343         idx = 0;
11344         while (((guint)(bit_offset>>3) <= (offset + len)) && (idx < 96))
11345         {
11346             if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_reporting_quantity_present))
11347             {
11348                 proto_tree_add_uint(subtree, hf_gsm_a_rr_neighbour_cell_list_index, tvb, bit_offset>>3, 1, idx);
11349                 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_reporting_quantity, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
11350                 bit_offset += 6;
11351             }
11352             idx += 1;
11353         }
11354     }
11355     /* Null breakpoint */
11356     if (bit_offset < bit_len)
11357     {
11358        if (gsm_rr_csn_HL_flag(tvb, tree, 0, bit_offset++, hf_gsm_a_rr_additions_in_rel_8))
11359        {
11360            gint8  bitmap_length;
11361            bit_offset_sav = bit_offset;
11362            subtree = proto_tree_add_subtree(tree, tvb, bit_offset>>3, -1, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_REPORTING_QUANTITY], &item,
11363                                         gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_REPORTING_QUANTITY].strptr);
11364
11365            bitmap_length = tvb_get_bits8(tvb,bit_offset,7);
11366            bitmap_length += 1;
11367            proto_tree_add_bits_item(subtree, hf_gsm_a_rr_emr_bitmap_length, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
11368            bit_offset += 7;
11369
11370            /* REPORTING_QUANTITY */
11371            idx = 0;
11372            while ((guint)(bit_offset>>3) <= (offset + len) && (idx < bitmap_length) )
11373            {
11374               if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_reporting_quantity_present))
11375                {
11376                    proto_tree_add_uint(subtree, hf_gsm_a_rr_neighbour_cell_list_index, tvb, bit_offset>>3, 1, idx);
11377                    proto_tree_add_bits_item(subtree, hf_gsm_a_rr_reporting_quantity, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
11378                    bit_offset += 6;
11379                }
11380                idx += 1;
11381            }
11382
11383            /* E-UTRAN Measurement Report */
11384            if (gsm_rr_csn_flag(tvb, subtree, bit_offset++, hf_gsm_a_rr_e_utran_measurement_report))
11385            {
11386                bit_offset += sacch_rr_eutran_meas_report(tvb, subtree, bit_offset, len*8-(bit_offset-offset*8));
11387            }
11388            proto_item_set_len(item, (bit_offset>>3) - (bit_offset_sav>>3)+1);
11389        }
11390     }
11391     gsm_rr_csn_padding_bits(tree, tvb, bit_offset, tvb_len);
11392 }
11393
11394 /*
11395  * [4] 9.1.59 EC-Immediate Assignment Type 1
11396  */
11397 static void
11398 dtap_rr_ec_imm_ass_type_1(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
11399 {
11400     guint32 curr_offset;
11401     guint32 consumed;
11402     guint   curr_len;
11403
11404     curr_offset = offset;
11405     curr_len = len;
11406
11407     /* Page Mode                                                10.5.2.26       M V 1/2 */
11408     /* Feature indicator                                        10.5.2.76       M V 1/2 */
11409     ELEM_MAND_VV_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_PAGE_MODE,
11410                        GSM_A_PDU_TYPE_RR, DE_RR_FEATURE_INDICATOR, ei_gsm_a_rr_missing_mandatory_element);
11411
11412     /* Request Reference 1      Request Reference               10.5.2.30       M V 3   */
11413     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF, NULL, ei_gsm_a_rr_missing_mandatory_element);
11414     /* EC Channel Description   EC Channel Description          10.5.2.84       M V 2 */
11415     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_EC_PKT_CH_DSC1, NULL, ei_gsm_a_rr_missing_mandatory_element);
11416     /* Timing Advance 1 Timing Advance                          10.5.2.86       M V 3-14   */
11417     ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_EC_FUA, NULL, ei_gsm_a_rr_missing_mandatory_element);
11418
11419 }
11420
11421
11422 /*
11423  * [4] 9.1.60 EC-Immediate Assignment Type 2
11424  */
11425 static void
11426 dtap_rr_ec_imm_ass_type_2(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_)
11427 {
11428     proto_tree *subtree;
11429     guint32     curr_offset;
11430     guint32     curr_bit_offset;
11431
11432     curr_offset = offset;
11433     curr_bit_offset  = curr_offset << 3;
11434
11435     curr_bit_offset += 4; /* Skip msgtype */
11436
11437     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_used_dl_cc, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
11438     curr_bit_offset += 2;
11439
11440     if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_ec_page_extension_exist))
11441     {
11442         proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_page_extension, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
11443         curr_bit_offset += 4;
11444     }
11445
11446     curr_bit_offset += de_rr_ec_request_reference(tvb, tree, pinfo, curr_bit_offset, NULL);
11447
11448     curr_bit_offset += de_rr_ec_pkt_ch_dsc2(tvb, tree, pinfo, curr_bit_offset);
11449
11450     /*TODO: reuse legacy FN - use subtree there?*/
11451     /*de_rr_ec_fua(tvb, tree, pinfo, (1<<31)|curr_bit_offset, len, NULL, 0);*/
11452     subtree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_gsm_rr_elem[DE_RR_EC_FUA], NULL,
11453                                val_to_str_ext_const(DE_RR_EC_FUA, &gsm_rr_elem_strings_ext, ""));
11454
11455     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_enhanced_access_burst, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
11456     curr_bit_offset +=1;
11457
11458     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_timing_adv_present))
11459     {
11460         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_timing_adv, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
11461         curr_bit_offset += 6;
11462     }
11463
11464     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_starting_ul_timeslot, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
11465     curr_bit_offset += 3;
11466     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tfi_assignment, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
11467     curr_bit_offset += 5;
11468     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_starting_dl_timeslot_offset, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
11469     curr_bit_offset += 2;
11470     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_overlaid_cdma_code, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
11471     curr_bit_offset += 2;
11472
11473     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_ec_mcs_exist))
11474     { /* MCS Description */
11475         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_egprs_mcs, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
11476         curr_bit_offset += 4;
11477     }
11478
11479     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_gamma, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
11480     curr_bit_offset += 5;
11481     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_alpha_enable, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
11482     curr_bit_offset += 1;
11483
11484     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_p0_present))
11485     {
11486         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_p0, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
11487         curr_bit_offset += 4;
11488         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pr_mode, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
11489         curr_bit_offset += 1;
11490     }
11491
11492     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_start_first_ul_data_block, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
11493     curr_bit_offset += 4;
11494
11495     while(gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_ec_fua_gap_list))
11496     {
11497         if (!gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_ec_start_fn_next_data_block_exist))
11498         {
11499             proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_start_fn_next_data_block, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
11500             curr_bit_offset += 3;
11501         }
11502         else
11503         {
11504             proto_tree_add_uint(subtree, hf_gsm_a_rr_ec_start_fn_next_data_block, tvb, (curr_bit_offset>>3), 0, 0);
11505         }
11506     }
11507
11508 }
11509
11510
11511 /*
11512  * [4] 9.1.61 EC-Immediate Assignment Reject
11513  */
11514 static void
11515 dtap_rr_ec_imm_ass_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_)
11516 {
11517     guint32     curr_offset;
11518     guint32     curr_bit_offset;
11519
11520     curr_offset = offset;
11521     curr_bit_offset  = curr_offset << 3;
11522
11523     curr_bit_offset += 4; /* Skip msgtype */
11524
11525     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_used_dl_cc, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
11526     curr_bit_offset += 2;
11527
11528     if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_ec_page_extension_exist))
11529     {
11530         proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_page_extension, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
11531         curr_bit_offset += 4;
11532     }
11533
11534     curr_bit_offset += de_rr_ec_request_reference(tvb, tree, pinfo, curr_bit_offset, " - 1");
11535
11536     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_wait_timer, tvb, curr_bit_offset, 8, ENC_BIG_ENDIAN);
11537     curr_bit_offset += 8;
11538
11539     if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_ec_req_ref_2_present))
11540     {
11541         curr_bit_offset += de_rr_ec_request_reference(tvb, tree, pinfo, curr_bit_offset, " - 2");
11542         proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_wait_timer, tvb, curr_bit_offset, 8, ENC_BIG_ENDIAN);
11543         curr_bit_offset += 8;
11544     }
11545
11546     if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_ec_req_ref_3_present))
11547     {
11548         curr_bit_offset += de_rr_ec_request_reference(tvb, tree, pinfo, curr_bit_offset, " - 3");
11549         proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_wait_timer, tvb, curr_bit_offset, 8, ENC_BIG_ENDIAN);
11550     }
11551
11552 }
11553
11554 /*
11555  * [4] 9.1.62 EC-Dummy
11556  */
11557 static void
11558 dtap_rr_ec_dummy(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_)
11559 {
11560     guint32     curr_bit_offset;
11561     curr_bit_offset  = offset << 3;
11562
11563     curr_bit_offset += 4; /* Skip msgtype */
11564
11565     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_used_dl_cc, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
11566 }
11567
11568 /*
11569  * [4] 9.1.63 EC-Paging Request
11570  */
11571 static const gchar digits[16] = {
11572     /*  0   1   2   3   4   5   6   7   8   9   a   b   c   d   e  f*/
11573        '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?','?'
11574 };
11575
11576 static guint32
11577 dtap_rr_ec_paging_imsi(tvbuff_t *tvb, proto_tree *tree, guint32 curr_bit_offset)
11578 {
11579     guint64 imsi_digits;
11580     guint8 i;
11581     wmem_strbuf_t *imsi_str;
11582     guint32 sav_bit_offset;
11583
11584     proto_tree_add_bits_ret_val(tree, hf_gsm_a_rr_ec_imsi_digits, tvb, curr_bit_offset, 4, &imsi_digits, ENC_BIG_ENDIAN);
11585     curr_bit_offset += 4;
11586     sav_bit_offset = curr_bit_offset;
11587     imsi_str = wmem_strbuf_sized_new(wmem_packet_scope(), (gsize)imsi_digits+2, 0);
11588     for (i = 0; i <= (guint8)imsi_digits; i++) {
11589         wmem_strbuf_append_c(imsi_str, digits[tvb_get_bits8(tvb, curr_bit_offset, 4)]);
11590         curr_bit_offset += 4;
11591     }
11592     proto_tree_add_string(tree, hf_gsm_a_rr_ec_imsi, tvb, sav_bit_offset,
11593                           (curr_bit_offset-sav_bit_offset+7)>>3, wmem_strbuf_finalize(imsi_str));
11594     return curr_bit_offset;
11595 }
11596
11597 static void
11598 dtap_rr_ec_paging_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_)
11599 {
11600     guint32     curr_bit_offset;
11601     curr_bit_offset  = offset << 3;
11602
11603     curr_bit_offset += 4; /* Skip msgtype */
11604
11605     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_used_dl_cc, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
11606     curr_bit_offset += 2;
11607
11608     if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_ec_page_extension_exist))
11609     {
11610         proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_page_extension, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
11611         curr_bit_offset += 4;
11612     }
11613
11614     if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_ec_ptmsi_imsi_select))
11615     { /* IMSI */
11616         curr_bit_offset = dtap_rr_ec_paging_imsi(tvb, tree, curr_bit_offset);
11617     }
11618     else
11619     { /* P-TMSI*/
11620         proto_tree_add_bits_item(tree, hf_gsm_a_rr_tmsi_ptmsi, tvb, curr_bit_offset, 32, ENC_BIG_ENDIAN);
11621         curr_bit_offset += 32;
11622     }
11623
11624     if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_ec_mobile_identity_2_exist))
11625     { /* Mobile identity 2 */
11626         if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_ec_ptmsi_imsi_select))
11627         { /* IMSI */
11628             dtap_rr_ec_paging_imsi(tvb, tree, curr_bit_offset);
11629         }
11630         else
11631         { /* P-TMSI*/
11632             proto_tree_add_bits_item(tree, hf_gsm_a_rr_tmsi_ptmsi, tvb, curr_bit_offset, 32, ENC_BIG_ENDIAN);
11633         }
11634     }
11635
11636 }
11637
11638 /*
11639  * [4] 9.1.64 EC-Downlink Assignment
11640  */
11641 static void
11642 dtap_rr_ec_dl_ass(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_)
11643 {
11644     proto_tree* subtree;
11645     guint32     curr_offset;
11646     guint32     curr_bit_offset;
11647
11648     curr_offset = offset;
11649     curr_bit_offset  = curr_offset << 3;
11650
11651     curr_bit_offset += 4; /* Skip msgtype */
11652
11653     proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_used_dl_cc, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
11654     curr_bit_offset += 2;
11655
11656     if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_ec_page_extension_exist))
11657     {
11658         proto_tree_add_bits_item(tree, hf_gsm_a_rr_ec_page_extension, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
11659         curr_bit_offset += 4;
11660     }
11661
11662     proto_tree_add_bits_item(tree, hf_gsm_a_rr_tlli, tvb, curr_bit_offset, 32, ENC_BIG_ENDIAN);
11663     curr_bit_offset += 32;
11664
11665     curr_bit_offset += de_rr_ec_pkt_ch_dsc2(tvb, tree, pinfo, curr_bit_offset);
11666
11667     /* FIXME:where to put "ett"? subtree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_gsm_rr_elem[DE_RR_EC_FUA], NULL,
11668                                      "EC Downlink Allocation"); */
11669     subtree = tree;
11670
11671     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_timing_adv, tvb, curr_bit_offset, 6, ENC_BIG_ENDIAN);
11672     curr_bit_offset += 6;
11673
11674     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_starting_dl_timeslot, tvb, curr_bit_offset, 3, ENC_BIG_ENDIAN);
11675     curr_bit_offset += 3;
11676
11677     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tfi_assignment, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
11678     curr_bit_offset += 5;
11679
11680     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_cc1_timeslot_multiplier, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
11681     curr_bit_offset += 2;
11682
11683     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_starting_ul_timeslot_offset, tvb, curr_bit_offset, 2, ENC_BIG_ENDIAN);
11684     curr_bit_offset += 2;
11685
11686     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_gamma, tvb, curr_bit_offset, 5, ENC_BIG_ENDIAN);
11687     curr_bit_offset += 5;
11688
11689     proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ec_alpha_enable, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
11690     curr_bit_offset += 1;
11691
11692     if (gsm_rr_csn_flag(tvb, subtree, curr_bit_offset++, hf_gsm_a_rr_p0_present))
11693     {
11694         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_p0, tvb, curr_bit_offset, 4, ENC_BIG_ENDIAN);
11695         curr_bit_offset += 4;
11696         proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pr_mode, tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
11697     }
11698
11699 }
11700
11701 #define NUM_GSM_DTAP_MSG_RR (sizeof(gsm_a_dtap_msg_rr_strings)/sizeof(value_string))
11702 static gint ett_gsm_dtap_msg_rr[NUM_GSM_DTAP_MSG_RR];
11703 static void (*dtap_msg_rr_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) = {
11704     NULL,       /* Reserved */
11705     dtap_rr_add_ass,            /* Additional Assignment */
11706     dtap_rr_imm_ass,            /* 9.1.18 Immediate assignment  */
11707     dtap_rr_imm_ass_ext,        /* Immediate Assignment Extended */
11708     dtap_rr_imm_ass_rej,        /* Immediate Assignment Reject */
11709     dtap_rr_ec_imm_ass_type_1,  /* EC-Immediate Assignment Type 1 */
11710
11711     dtap_rr_dtm_ass_fail,       /* DTM Assignment Failure */
11712     dtap_rr_dtm_rej,            /* DTM Reject */
11713     dtap_rr_dtm_req,            /* DTM Request */
11714     dtap_rr_pkt_assign,         /* Packet Assignment */
11715     dtap_rr_dtm_ass_cmd,        /* DTM Assignment Command */
11716     dtap_rr_dtm_info,           /* DTM Information */
11717     dtap_rr_pkt_notif,          /* Packet Notification */
11718
11719     dtap_rr_cip_mode_cmd,       /* Ciphering Mode Command */
11720     dtap_rr_cip_mode_cpte,      /* Ciphering Mode Complete */
11721
11722     dtap_rr_conf_change_cmd,    /* Configuration Change Command */
11723     NULL,                       /* Configuration Change Ack. */
11724     dtap_rr_conf_change_rej,    /* Configuration Change Reject */
11725
11726     dtap_rr_ass_cmd,            /* 9.1.2 Assignment Command */
11727     dtap_rr_ass_comp,           /* Assignment Complete */
11728     dtap_rr_ass_fail,           /* Assignment Failure */
11729     dtap_rr_ho_cmd,             /* Handover Command */
11730     dtap_rr_ho_cpte,            /* Handover Complete */
11731     dtap_rr_ho_fail,            /* Handover Failure */
11732     dtap_rr_phy_info,           /* Physical Information */
11733
11734     NULL,                       /* RR-cell Change Order */
11735     NULL,                       /* PDCH Assignment Command */
11736
11737     dtap_rr_ch_rel,             /* Channel Release */
11738     dtap_rr_partial_rel,        /* Partial Release */
11739     NULL,                       /* Partial Release Complete */
11740
11741     dtap_rr_paging_req_type_1,  /* Paging Request Type 1 */
11742     dtap_rr_paging_req_type_2,  /* Paging Request Type 2 */
11743     dtap_rr_paging_req_type_3,  /* Paging Request Type 3 */
11744     dtap_rr_paging_resp,        /* Paging Response */
11745     NULL,                       /* Notification/NCH */
11746     NULL,                       /* Reserved */
11747     NULL,                       /* Notification/Response */
11748
11749     NULL,                       /* Reserved */
11750
11751     dtap_rr_utran_classmark_change,     /* Utran Classmark Change  */
11752     NULL,                       /* cdma2000 Classmark Change */
11753     dtap_rr_inter_syst_to_utran_ho_cmd, /* Inter System to UTRAN Handover Command */
11754     NULL,                       /* Inter System to cdma2000 Handover Command */
11755
11756     NULL,                       /* System Information Type 8 */
11757     dtap_rr_sys_info_1,         /* System Information Type 1 */
11758     dtap_rr_sys_info_2,         /* System Information Type 2 */
11759     dtap_rr_sys_info_3,         /* System Information Type 3 */
11760     dtap_rr_sys_info_4,         /* System Information Type 4 */
11761     dtap_rr_sys_info_5,         /* System Information Type 5 */
11762     dtap_rr_sys_info_6,         /* System Information Type 6 */
11763     NULL,                       /* System Information Type 7 */
11764
11765     dtap_rr_sys_info_2bis,      /* System Information Type 2bis */
11766     dtap_rr_sys_info_2ter,      /* System Information Type 2ter */
11767     dtap_rr_sys_info_2quater,   /* System Information Type 2quater */
11768     dtap_rr_sys_info_5bis,      /* System Information Type 5bis */
11769     dtap_rr_sys_info_5ter,      /* System Information Type 5ter */
11770     NULL,                       /* System Information Type 9 */
11771     dtap_rr_sys_info_13,        /* System Information Type 13 */
11772
11773     NULL,                       /* System Information Type 16 */
11774     NULL,                       /* System Information Type 17 */
11775
11776     NULL,                       /* System Information Type 18 */
11777     NULL,                       /* System Information Type 19 */
11778     NULL,                       /* System Information Type 20 */
11779     dtap_rr_sys_info_21,        /* System Information Type 21 */
11780
11781     dtap_rr_ch_mode_mod,        /* Channel Mode Modify */
11782     dtap_rr_rr_status,          /* RR Status */
11783     dtap_rr_ch_mode_mod_ack,    /* Channel Mode Modify Acknowledge */
11784     dtap_rr_freq_redef,         /* Frequency Redefinition */
11785     dtap_rr_meas_rep,           /* 9.1.21 Measurement report */
11786     dtap_rr_mm_cm_change,       /* 9.1.11 Classmark Change */
11787     dtap_rr_cm_enq,             /* Classmark Enquiry */
11788     dtap_rr_ext_meas_report,    /* Extended Measurement Report */
11789     dtap_rr_ext_meas_order,     /* Extended Measurement Order */
11790     dtap_rr_gprs_sus_req,       /* 9.1.13b GPRS Suspension Request */
11791
11792     dtap_rr_vgcs_upl_grant,     /* VGCS Uplink Grant */
11793     dtap_rr_upl_rel,            /* Uplink Release */
11794     NULL,                       /* Reserved */
11795     NULL,                       /* Uplink Busy */
11796     dtap_rr_talker_indication,  /* Talker Indication */
11797
11798     NULL,                       /* UTRAN Classmark Change/Handover To UTRAN Command */  /* spec conflict */
11799
11800     dtap_rr_app_inf,            /* Application Information */
11801     NULL                       /* NONE */
11802
11803 };
11804
11805 void get_rr_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p)
11806 {
11807     gint idx;
11808
11809     *msg_str = try_val_to_str_idx((guint32) (oct & DTAP_RR_IEI_MASK), gsm_a_dtap_msg_rr_strings, &idx);
11810     *hf_idx = hf_gsm_a_dtap_msg_rr_type;
11811     if (*msg_str != NULL) {
11812         *ett_tree = ett_gsm_dtap_msg_rr[idx];
11813         *msg_fcn_p  = dtap_msg_rr_fcn[idx];
11814     }
11815
11816     return;
11817 }
11818 /* This is more or less a copy of the dissect_dtap() code just adding
11819  * L2 Pseudo Length decoding first
11820  * The code should probably be cleaned up.
11821  * The name CCCH might not be correct!
11822  */
11823 static int
11824 dissect_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
11825 {
11826
11827     static gsm_a_tap_rec_t  tap_rec[4];
11828     static gsm_a_tap_rec_t *tap_p;
11829     static guint            tap_current = 0;
11830
11831     void                  (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len);
11832     guint8                  oct;
11833     guint8                  pd;
11834     guint32                 offset;
11835     guint32                 len;
11836     guint32                 oct_1;
11837     proto_item             *ccch_item   = NULL;
11838     proto_tree             *ccch_tree   = NULL;
11839     proto_item             *oct_1_item  = NULL;
11840     proto_tree             *pd_tree     = NULL;
11841     const gchar            *msg_str;
11842     gint                    ett_tree;
11843     int                     hf_idx;
11844
11845     len = tvb_reported_length(tvb);
11846
11847     if (len < 3){
11848         /*
11849          * too short to be CCCH
11850          */
11851         call_data_dissector(tvb, pinfo, tree);
11852         return tvb_captured_length(tvb);
11853     }
11854
11855     col_append_str(pinfo->cinfo, COL_INFO, "(CCCH) ");
11856     /*
11857      * set tap record pointer
11858      */
11859     tap_current++;
11860     if (tap_current >= 4)
11861     {
11862         tap_current = 0;
11863     }
11864     tap_p = &tap_rec[tap_current];
11865
11866     offset = 0;
11867
11868     /* Skip pseudo hdr here - it is dissected later */
11869     offset += 1;
11870
11871     /*
11872      * get protocol discriminator
11873      */
11874     oct_1 = tvb_get_guint8(tvb, offset++);
11875
11876     if ((((oct_1 & DTAP_TI_MASK) >> 4) & DTAP_TIE_PRES_MASK) == DTAP_TIE_PRES_MASK){
11877         /*
11878          * even though we don't know if a TI should be in the message yet
11879          * we rely on the TI/SKIP indicator to be 0 to avoid taking this
11880          * octet
11881          */
11882         offset++;
11883     }
11884
11885     oct = tvb_get_guint8(tvb, offset);
11886
11887     pd = oct_1 & DTAP_PD_MASK;
11888     msg_str = NULL;
11889     ett_tree = -1;
11890     hf_idx = -1;
11891     msg_fcn_p = NULL;
11892     col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ",val_to_str(pd,gsm_a_pd_short_str_vals,"Unknown (%u)"));
11893
11894     /*
11895      * octet 1
11896      */
11897     switch (pd){
11898     case 6:
11899         get_rr_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p);
11900         break;
11901
11902     default:
11903         /* XXX - hf_idx is still -1! this is a bug in the implementation, and I don't know how to fix it so simple return here */
11904         return tvb_captured_length(tvb);
11905     }
11906
11907     /*
11908      * create the protocol tree
11909      */
11910     if (msg_str == NULL){
11911         ccch_item = proto_tree_add_protocol_format(tree, proto_a_ccch, tvb, 0, len,
11912                                                    "GSM CCCH - Message Type (0x%02x)",
11913                                                    oct);
11914
11915         ccch_tree = proto_item_add_subtree(ccch_item, ett_ccch_msg);
11916     }else{
11917         ccch_item = proto_tree_add_protocol_format(tree, proto_a_ccch, tvb, 0, -1,
11918                                                    "GSM CCCH - %s", msg_str);
11919
11920         ccch_tree = proto_item_add_subtree(ccch_item, ett_tree);
11921
11922         col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
11923     }
11924
11925     /*  L2 Pseudo Length 10.5.2.19 */
11926     /* note: dissected out of sequence! */
11927     elem_v(tvb, ccch_tree, pinfo, GSM_A_PDU_TYPE_RR, DE_RR_L2_PSEUDO_LEN, 0, NULL);
11928
11929     oct_1_item = proto_tree_add_item(ccch_tree, hf_gsm_a_L3_protocol_discriminator, tvb, 1, 1, ENC_BIG_ENDIAN);
11930     pd_tree = proto_item_add_subtree(oct_1_item, ett_ccch_oct_1);
11931
11932     proto_tree_add_item(pd_tree, hf_gsm_a_L3_protocol_discriminator, tvb, 1, 1, ENC_BIG_ENDIAN);
11933
11934     proto_tree_add_item(pd_tree, hf_gsm_a_skip_ind, tvb, 1, 1, ENC_BIG_ENDIAN);
11935
11936     /*
11937      * add DTAP message name
11938      */
11939     proto_tree_add_uint_format(ccch_tree, hf_idx, tvb, offset, 1, oct,
11940                                "Message Type: %s",msg_str ? msg_str : "(Unknown)");
11941
11942     offset++;
11943
11944     tap_p->pdu_type = GSM_A_PDU_TYPE_DTAP;
11945     tap_p->message_type = oct;
11946     tap_p->protocol_disc = (gsm_a_pd_str_e)pd;
11947
11948     tap_queue_packet(gsm_a_tap, pinfo, tap_p);
11949
11950     if (msg_str == NULL)
11951         return offset;
11952
11953     if (offset >= len)
11954         return offset;
11955
11956     /*
11957      * decode elements
11958      */
11959     if (msg_fcn_p == NULL){
11960         proto_tree_add_item(ccch_tree, hf_gsm_a_rr_message_elements, tvb, offset, len - offset, ENC_NA);
11961     }else{
11962         (*msg_fcn_p)(tvb, ccch_tree, pinfo, offset, len - offset);
11963     }
11964     return tvb_captured_length(tvb);
11965 }
11966
11967
11968 #define NUM_GSM_DTAP_EC_CCCH_MSG_RR (sizeof(gsm_a_dtap_msg_rr_ec_ccch_strings)/sizeof(value_string))
11969 static gint ett_gsm_dtap_ec_ccch_msg_rr[NUM_GSM_DTAP_EC_CCCH_MSG_RR];
11970 static void (*dtap_msg_rr_ec_ccch_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) = {
11971   dtap_rr_ec_imm_ass_type_2,                  /* EC-Immediate Assignment Type 2 */
11972   dtap_rr_ec_imm_ass_rej,                     /* EC-Immediate Assignment Reject */
11973   dtap_rr_ec_dummy,                           /* EC-Dummy */
11974   dtap_rr_ec_dl_ass,                          /* EC-Downlink Assignment */
11975   dtap_rr_ec_paging_req,                      /* EC-Paging Request */
11976 };
11977
11978 static void
11979 get_rr_ec_ccch_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p)
11980 {
11981     gint idx;
11982
11983     *msg_str = try_val_to_str_idx((guint32) (oct & DTAP_RR_IEI_MASK), gsm_a_dtap_msg_rr_ec_ccch_strings, &idx);
11984     *hf_idx = hf_gsm_a_dtap_msg_rr_ec_ccch_type;
11985     if (*msg_str != NULL) {
11986         *ett_tree = ett_gsm_dtap_ec_ccch_msg_rr[idx];
11987         *msg_fcn_p  = dtap_msg_rr_ec_ccch_fcn[idx];
11988     }
11989
11990     return;
11991 }
11992
11993 static int
11994 dissect_ec_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
11995 {
11996
11997     void                  (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len);
11998     guint8                  msgtype;
11999     guint32                 offset;
12000     guint32                 len;
12001     proto_item             *ec_ccch_item   = NULL;
12002     proto_tree             *ec_ccch_tree   = NULL;
12003     const gchar            *msg_str;
12004     gint                    ett_tree;
12005     int                     hf_idx;
12006     len = tvb_reported_length(tvb);
12007
12008     col_append_str(pinfo->cinfo, COL_INFO, "(EC-CCCH) (RR) ");
12009
12010     offset = 0;
12011     msgtype = tvb_get_bits8(tvb, offset, 4);
12012
12013     msg_str = NULL;
12014     ett_tree = -1;
12015     hf_idx = -1;
12016     msg_fcn_p = NULL;
12017
12018     get_rr_ec_ccch_msg_params(msgtype, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p);
12019
12020     /*
12021      * create the protocol tree
12022      */
12023     if (msg_str == NULL){
12024         ec_ccch_item = proto_tree_add_protocol_format(tree, proto_a_ec_ccch, tvb, 0, len,
12025                                                    "GSM EC-CCCH - Message Type (0x%02x)",
12026                                                    msgtype);
12027
12028         ec_ccch_tree = proto_item_add_subtree(ec_ccch_item, ett_ec_ccch_msg);
12029     }else{
12030         ec_ccch_item = proto_tree_add_protocol_format(tree, proto_a_ec_ccch, tvb, 0, -1,
12031                                                    "GSM EC-CCCH - %s", msg_str);
12032
12033         ec_ccch_tree = proto_item_add_subtree(ec_ccch_item, ett_tree);
12034
12035         col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
12036     }
12037
12038     /*
12039      * add DTAP message name
12040      */
12041     proto_tree_add_uint_format(ec_ccch_tree, hf_idx, tvb, offset, 1, msgtype,
12042                                "Message Type: %s",msg_str ? msg_str : "(Unknown)");
12043     /*
12044      * decode elements
12045      */
12046     if (msg_fcn_p == NULL){
12047         proto_tree_add_item(ec_ccch_tree, hf_gsm_a_rr_message_elements, tvb, offset, len - offset, ENC_NA);
12048     }else{
12049         (*msg_fcn_p)(tvb, ec_ccch_tree, pinfo, offset, len - offset);
12050     }
12051     return tvb_captured_length(tvb);
12052 }
12053
12054
12055 const value_string gsm_a_rr_short_pd_msg_strings[] = {
12056     { 0x00, "System Information Type 10" },
12057     { 0x01, "Notification/FACCH" },
12058     { 0x02, "Uplink Free" },
12059     { 0x04, "Enhanced Measurement Report" },
12060     { 0x05, "Measurement Information" },
12061     { 0x06, "VBS/VGCS Reconfigure" },
12062     { 0x07, "VBS/VGCS Reconfigure2" },
12063     { 0x08, "VGCS Additional Information" },
12064     { 0x09, "VGCS SMS Information" },
12065     {    0, NULL }
12066 };
12067
12068 #define NUM_GSM_SACCH_MSG_RR (sizeof(gsm_a_rr_short_pd_msg_strings)/sizeof(value_string))
12069 static gint ett_gsm_sacch_msg_rr[NUM_GSM_SACCH_MSG_RR];
12070 static void (*sacch_msg_rr_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len) = {
12071     NULL,                       /* System Information Type 10 */
12072     NULL,                       /* Notification/FACCH */
12073     NULL,                       /* Uplink Free  */
12074     sacch_rr_enh_meas_report,   /* Enhanced Measurement Report */
12075     sacch_rr_meas_info,         /* Measurement Information */
12076     NULL,                       /* VBS/VGCS Reconfigure */
12077     NULL,                       /* VBS/VGCS Reconfigure2 */
12078     NULL,                       /* VGCS Additional Information */
12079     NULL,                       /* VGCS SMS Information */
12080     NULL,                       /* NONE */
12081 };
12082
12083 static void
12084 get_rr_short_pd_msg_params(guint8 mess_type, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p)
12085 {
12086     gint idx;
12087
12088     *msg_str = try_val_to_str_idx((guint32) mess_type, gsm_a_rr_short_pd_msg_strings, &idx);
12089     *hf_idx = hf_gsm_a_rr_short_pd_msg_type;
12090     if (*msg_str != NULL) {
12091         *ett_tree = ett_gsm_sacch_msg_rr[idx];
12092         *msg_fcn_p = sacch_msg_rr_fcn[idx];
12093     }
12094 }
12095
12096 const value_string short_protocol_discriminator_vals[] = {
12097     {0x0, "Radio Resources Management messages"},
12098     {  0, NULL }
12099 };
12100
12101 static int
12102 dissect_sacch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
12103 {
12104     static gsm_a_tap_rec_t  tap_rec[4];
12105     static gsm_a_tap_rec_t *tap_p;
12106     static guint            tap_current        = 0;
12107
12108     void                  (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len);
12109     guint8                  oct, short_pd, mess_type;
12110     guint32                 offset, bit_offset = 0;
12111     guint32                 len;
12112     proto_item             *sacch_item         = NULL;
12113     proto_tree             *sacch_tree         = NULL;
12114     const gchar            *msg_str;
12115     gint                    ett_tree;
12116     int                     hf_idx;
12117
12118     len = tvb_reported_length(tvb);
12119
12120     col_append_str(pinfo->cinfo, COL_INFO, "(SACCH) ");
12121
12122     /*
12123      * set tap record pointer
12124      */
12125     tap_current++;
12126     if (tap_current >= 4)
12127     {
12128         tap_current = 0;
12129     }
12130     tap_p = &tap_rec[tap_current];
12131
12132     offset = 0;
12133
12134     oct = tvb_get_guint8(tvb, offset);
12135
12136     msg_str = NULL;
12137     ett_tree = -1;
12138     hf_idx = -1;
12139     msg_fcn_p = NULL;
12140
12141     short_pd = (oct & 0x80) >> 7;
12142     mess_type = (oct & 0x7c) >> 2;
12143
12144     if (short_pd == 0)
12145     {
12146         col_append_str(pinfo->cinfo, COL_INFO, "(RR) ");
12147         get_rr_short_pd_msg_params(mess_type, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p);
12148     }
12149     else
12150     {
12151         col_append_str(pinfo->cinfo, COL_INFO, "(Unknown) ");
12152     }
12153
12154     /*
12155      * create the protocol tree
12156      */
12157     if (msg_str == NULL){
12158         sacch_item = proto_tree_add_protocol_format(tree, proto_a_sacch, tvb, 0, len,
12159                                                     "GSM SACCH - Message Type (0x%02x)", mess_type);
12160
12161         sacch_tree = proto_item_add_subtree(sacch_item, ett_sacch_msg);
12162     }else{
12163         sacch_item = proto_tree_add_protocol_format(tree, proto_a_sacch, tvb, 0, -1,
12164                                                     "GSM SACCH - %s", msg_str);
12165
12166         sacch_tree = proto_item_add_subtree(sacch_item, ett_tree);
12167
12168         col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
12169     }
12170
12171     if (short_pd == 0)
12172        proto_tree_add_bits_item(sacch_tree, hf_gsm_a_rr_short_pd, tvb, offset * 8 + bit_offset++, 1, ENC_BIG_ENDIAN);
12173
12174     if (hf_idx == -1)
12175         return 1;
12176
12177     /*
12178      * add SACCH message name
12179      */
12180     proto_tree_add_bits_item(sacch_tree, hf_gsm_a_rr_short_pd_msg_type, tvb, offset * 8 + bit_offset, 5, ENC_BIG_ENDIAN);
12181     bit_offset += 5;
12182
12183     proto_tree_add_bits_item(sacch_tree, hf_gsm_a_rr_short_l2_header, tvb, offset * 8 + bit_offset, 2, ENC_BIG_ENDIAN);
12184     offset++;
12185
12186     tap_p->pdu_type = GSM_A_PDU_TYPE_SACCH;
12187     tap_p->message_type = mess_type;
12188     tap_p->protocol_disc = (gsm_a_pd_str_e)short_pd;
12189
12190     tap_queue_packet(gsm_a_tap, pinfo, tap_p);
12191
12192     if (msg_str == NULL)
12193         return offset;
12194
12195     /*
12196      * decode elements
12197      */
12198     if (msg_fcn_p == NULL){
12199         proto_tree_add_item(sacch_tree, hf_gsm_a_rr_message_elements, tvb, offset, len - offset, ENC_NA);
12200     }else{
12201         (*msg_fcn_p)(tvb, sacch_tree, pinfo, offset, len - offset);
12202     }
12203     return tvb_captured_length(tvb);
12204 }
12205
12206 /* Register the protocol with Wireshark */
12207 void
12208 proto_register_gsm_a_rr(void)
12209 {
12210     guint i;
12211     guint last_offset;
12212
12213     /* Setup list of header fields */
12214
12215     static hf_register_info hf[] =
12216         {
12217             { &hf_gsm_a_dtap_msg_rr_type,
12218               { "DTAP Radio Resources Management Message Type", "gsm_a.dtap.msg_rr_type",
12219                 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_rr_strings), 0x0,
12220                 NULL, HFILL }
12221             },
12222             { &hf_gsm_a_rr_elem_id,
12223               { "Element ID",   "gsm_a.rr.elem_id",
12224                 FT_UINT8, BASE_HEX, NULL, 0,
12225                 NULL, HFILL }
12226             },
12227             { &hf_gsm_a_rr_bcc,
12228               { "BCC","gsm_a.rr.bcc",
12229                 FT_UINT8,BASE_DEC,  NULL, 0x07,
12230                 NULL, HFILL }
12231             },
12232             { &hf_gsm_a_rr_ncc,
12233               { "NCC","gsm_a.rr.ncc",
12234                 FT_UINT8,BASE_DEC,  NULL, 0x38,
12235                 NULL, HFILL }
12236             },
12237             { &hf_gsm_a_rr_bcch_arfcn,
12238               { "BCCH ARFCN(RF channel number)","gsm_a.rr.bcch_arfcn",
12239                 FT_UINT16,BASE_DEC,  NULL, 0x0,
12240                 NULL, HFILL }
12241             },
12242             { &hf_gsm_a_rr_range_nb,
12243               { "Number of Ranges","gsm_a.rr.range_nb",
12244                 FT_UINT8, BASE_DEC,  NULL, 0xff,
12245                 NULL, HFILL }
12246             },
12247             { &hf_gsm_a_rr_range_lower,
12248               { "Range Lower","gsm_a.rr.range_lower",
12249                 FT_UINT16, BASE_DEC,  NULL, 0x0000,
12250                 "ARFCN used as the lower limit of a range of frequencies to be used by the mobile station in cell selection (Range Lower)", HFILL }
12251             },
12252             { &hf_gsm_a_rr_range_higher,
12253               { "Range Higher","gsm_a.rr.range_higher",
12254                 FT_UINT16, BASE_DEC,  NULL, 0x0000,
12255                 "ARFCN used as the higher limit of a range of frequencies to be used by the mobile station in cell selection (Range Higher)", HFILL }
12256             },
12257             { &hf_gsm_a_rr_ba_freq,
12258               { "BA Freq","gsm_a.rr.ba_freq",
12259                 FT_UINT16, BASE_DEC,  NULL, 0x0000,
12260                 "ARFCN indicating a single frequency to be used by the mobile station in cell selection and reselection (BA Freq)", HFILL }
12261             },
12262             { &hf_gsm_a_rr_ho_ref_val,
12263               { "Handover reference value","gsm_a.rr.ho_ref_val",
12264                 FT_UINT8,BASE_DEC,  NULL, 0x0,
12265                 NULL, HFILL }
12266             },
12267             { &hf_gsm_a_rr_L2_pseudo_len,
12268               { "L2 Pseudo Length value","gsm_a.rr.l2_pseudo_len",
12269                 FT_UINT8, BASE_DEC, NULL, 0xfc,
12270                 NULL, HFILL }
12271             },
12272             { &hf_gsm_a_rr_ba_used,
12273               { "BA-USED","gsm_a.rr.ba_used",
12274                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12275                 NULL, HFILL }
12276             },
12277             { &hf_gsm_a_rr_dtx_used,
12278               { "DTX-USED","gsm_a.rr.dtx_used",
12279                 FT_BOOLEAN, BASE_NONE,  TFS(&gsm_a_rr_dtx_vals), 0x0,
12280                 NULL, HFILL }
12281             },
12282             { &hf_gsm_a_rr_3g_ba_used,
12283               { "3G-BA-USED","gsm_a.rr.3g_ba_used",
12284                 FT_UINT8, BASE_DEC, NULL, 0x00,
12285                 NULL, HFILL }
12286             },
12287             { &hf_gsm_a_rr_meas_valid,
12288               { "MEAS-VALID","gsm_a.rr.meas_valid",
12289                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_mv_vals), 0x0,
12290                 NULL, HFILL }
12291             },
12292             { &hf_gsm_a_rr_rxlev_full_serv_cell,
12293               { "RXLEV-FULL-SERVING-CELL","gsm_a.rr.rxlev_full_serv_cell",
12294                 FT_UINT8,BASE_DEC|BASE_EXT_STRING,  &gsm_a_rr_rxlev_vals_ext, 0x00,
12295                 NULL, HFILL }
12296             },
12297             { &hf_gsm_a_rr_rxlev_sub_serv_cell,
12298               { "RXLEV-SUB-SERVING-CELL","gsm_a.rr.rxlev_sub_serv_cell",
12299                 FT_UINT8,BASE_DEC|BASE_EXT_STRING,  &gsm_a_rr_rxlev_vals_ext, 0x00,
12300                 NULL, HFILL }
12301             },
12302             { &hf_gsm_a_rr_si23_ba_used,
12303               { "SI23_BA_USED","gsm_a.rr.si23_ba_used",
12304                 FT_UINT8,BASE_DEC,  NULL, 0x00,
12305                 NULL, HFILL }
12306             },
12307             { &hf_gsm_a_rr_rxqual_full_serv_cell,
12308               { "RXQUAL-FULL-SERVING-CELL","gsm_a.rr.rxqual_full_serv_cell",
12309                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_rxqual_vals), 0x00,
12310                 NULL, HFILL }
12311             },
12312             { &hf_gsm_a_rr_rxqual_sub_serv_cell,
12313               { "RXQUAL-SUB-SERVING-CELL","gsm_a.rr.rxqual_sub_serv_cell",
12314                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_rxqual_vals), 0x0,
12315                 NULL, HFILL }
12316             },
12317             { &hf_gsm_a_rr_no_ncell_m,
12318               { "NO-NCELL-M","gsm_a.rr.no_ncell_m",
12319                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_ncell_vals), 0x00,
12320                 NULL, HFILL }
12321             },
12322             { &hf_gsm_a_rr_rxlev_ncell,
12323               { "RXLEV-NCELL","gsm_a.rr.rxlev_ncell",
12324                 FT_UINT8,BASE_DEC, NULL, 0x00,
12325                 NULL, HFILL }
12326             },
12327             { &hf_gsm_a_rr_bcch_freq_ncell,
12328               { "BCCH-FREQ-NCELL","gsm_a.rr.bcch_freq_ncell",
12329                 FT_UINT8,BASE_DEC, NULL, 0x00,
12330                 NULL, HFILL }
12331             },
12332             { &hf_gsm_a_rr_bsic_ncell,
12333               { "BSIC-NCELL","gsm_a.rr.bsic_ncell",
12334                 FT_UINT8,BASE_DEC, NULL, 0x00,
12335                 NULL, HFILL }
12336             },
12337             { &hf_gsm_a_rr_mobile_time_difference,
12338               { "Mobile Timing Difference value (in half bit periods)","gsm_a.rr.mobile_time_difference",
12339                 FT_UINT32,BASE_DEC, NULL, 0xFFFFF8,
12340                 NULL, HFILL }
12341             },
12342             { &hf_gsm_a_rr_pow_cmd_atc,
12343               { "ATC","gsm_a.rr.pow_cmd_atc",
12344                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_pow_cmd_atc_value), 0x80,
12345                 NULL, HFILL }
12346             },
12347             { &hf_gsm_a_rr_page_mode,
12348               { "Page Mode","gsm_a.rr.page_mode",
12349                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_page_mode_vals), 0x0F,
12350                 NULL, HFILL }
12351             },
12352             { &hf_gsm_a_rr_dedicated_mode_or_tbf,
12353               { "Dedicated mode or TBF","gsm_a.rr.dedicated_mode_or_tbf",
12354                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_dedicated_mode_or_tbf_vals), 0xF0,
12355                 NULL, HFILL }
12356             },
12357             { &hf_gsm_a_rr_pow_cmd_epc,
12358               { "EPC_mode","gsm_a.rr.pow_cmd_epc",
12359                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_pow_cmd_epc_value), 0x40,
12360                 NULL, HFILL }
12361             },
12362             { &hf_gsm_a_rr_pow_cmd_fpcepc,
12363               { "FPC_EPC","gsm_a.rr.pow_cmd_fpcepc",
12364                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_pow_cmd_fpcepc_value), 0x20,
12365                 NULL, HFILL }
12366             },
12367             { &hf_gsm_a_rr_pow_cmd_powlev,
12368               { "POWER LEVEL","gsm_a.rr.pow_cmd_pow",
12369                 FT_UINT8,BASE_DEC,  NULL, 0x1f,
12370                 NULL, HFILL }
12371             },
12372             { &hf_gsm_a_rr_sync_ind_nci,
12373               { "Normal cell indication(NCI)","gsm_a.rr.sync_ind_nci",
12374                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_sync_ind_nci_value), 0x08,
12375                 NULL, HFILL }
12376             },
12377             { &hf_gsm_a_rr_sync_ind_rot,
12378               { "Report Observed Time Difference(ROT)","gsm_a.rr.sync_ind_rot",
12379                 FT_BOOLEAN,8,  TFS(&sm_a_rr_sync_ind_rot_value), 0x04,
12380                 NULL, HFILL }
12381             },
12382             { &hf_gsm_a_rr_sync_ind_si,
12383               { "Synchronization indication(SI)","gsm_a.rr.sync_ind_si",
12384                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_sync_ind_si_vals), 0x03,
12385                 NULL, HFILL }
12386             },
12387             { &hf_gsm_a_rr_format_id,
12388               { "Format Identifier","gsm_a.rr.format_id",
12389                 FT_UINT8,BASE_HEX,  VALS(gsm_a_rr_freq_list_format_id_vals), 0xce,
12390                 NULL, HFILL }
12391             },
12392             { &hf_gsm_a_rr_format_id2,
12393               { "Format Identifier","gsm_a.rr.format_id",
12394                 FT_UINT8,BASE_HEX,  VALS(gsm_a_rr_freq_list_format_id_vals), 0x8e,
12395                 NULL, HFILL }
12396             },
12397             { &hf_gsm_a_rr_channel_mode,
12398               { "Channel Mode","gsm_a.rr.channel_mode",
12399                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_channel_mode_vals), 0x0,
12400                 NULL, HFILL }
12401             },
12402             { &hf_gsm_a_rr_channel_mode2,
12403               { "Channel Mode 2","gsm_a.rr.channel_mode2",
12404                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_channel_mode2_vals), 0x0,
12405                 NULL, HFILL }
12406             },
12407             { &hf_gsm_a_rr_sc,
12408               { "SC","gsm_a.rr.SC",
12409                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_sc_vals), 0x00,
12410                 NULL, HFILL }
12411             },
12412             { &hf_gsm_a_rr_algorithm_id,
12413               { "Algorithm identifier","gsm_a.rr.algorithm_identifier",
12414                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_algorithm_identifier_vals), 0x00,
12415                 NULL, HFILL }
12416             },
12417             { &hf_gsm_a_rr_cr,
12418               { "CR","gsm_a.rr.CR",
12419                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_cr_vals), 0x00,
12420                 NULL, HFILL }
12421             },
12422             { &hf_gsm_a_rr_multirate_speech_ver,
12423               { "Multirate speech version","gsm_a.rr.multirate_speech_ver",
12424                 FT_UINT8,BASE_DEC,  VALS(multirate_speech_ver_vals), 0xe0,
12425                 NULL, HFILL }
12426             },
12427             { &hf_gsm_a_rr_NCSB,
12428               { "NSCB: Noise Suppression Control Bit","gsm_a.rr.NCSB",
12429                 FT_UINT8,BASE_DEC,  VALS(NSCB_vals), 0x10,
12430                 NULL, HFILL }
12431             },
12432             { &hf_gsm_a_rr_ICMI,
12433               { "ICMI: Initial Codec Mode Indicator","gsm_a.rr.ICMI",
12434                 FT_UINT8,BASE_DEC,  VALS(ICMI_vals), 0x8,
12435                 NULL, HFILL }
12436             },
12437             { &hf_gsm_a_rr_start_mode,
12438               { "Start Mode","gsm_a.rr.start_mode",
12439                 FT_UINT8,BASE_DEC,  NULL, 0x3,
12440                 NULL, HFILL }
12441             },
12442             { &hf_gsm_a_rr_timing_adv,
12443               { "Timing advance value","gsm_a.rr.timing_adv",
12444                 FT_UINT8,BASE_DEC,  NULL, 0x0,
12445                 NULL, HFILL }
12446             },
12447             { &hf_gsm_a_rr_time_diff,
12448               { "Time difference value","gsm_a.rr.time_diff",
12449                 FT_UINT8,BASE_DEC,  NULL, 0x0,
12450                 NULL, HFILL }
12451             },
12452             { &hf_gsm_a_rr_tlli,
12453               { "TLLI","gsm_a.rr.tlli",
12454                 FT_UINT32,BASE_HEX,  NULL, 0x0,
12455                 NULL, HFILL }
12456             },
12457             { &hf_gsm_a_rr_tmsi_ptmsi,
12458               { "TMSI/P-TMSI Value","gsm_a.rr.tmsi_ptmsi",
12459                 FT_UINT32,BASE_HEX,  NULL, 0x0,
12460                 NULL, HFILL }
12461             },
12462             { &hf_gsm_a_rr_target_mode,
12463               { "Target mode","gsm_a.rr.target_mode",
12464                 FT_UINT8,BASE_DEC,  NULL, 0xc0,
12465                 NULL, HFILL }
12466             },
12467             { &hf_gsm_a_rr_wait_indication,
12468               { "Wait Indication","gsm_a.rr.wait_indication",
12469                 FT_UINT8,BASE_DEC,  NULL, 0x00,
12470                 NULL, HFILL }
12471             },
12472             { &hf_gsm_a_rr_seq_code,
12473               { "Sequence Code","gsm_a.rr.seq_code",
12474                 FT_UINT8, BASE_DEC, NULL, 0x00,
12475                 NULL, HFILL }
12476             },
12477
12478             { &hf_gsm_a_rr_group_cipher_key_number,
12479               { "Group cipher key number","gsm_a.rr.Group_cipher_key_number",
12480                 FT_UINT8,BASE_DEC,  NULL, 0x3c,
12481                 NULL, HFILL }
12482             },
12483             { &hf_gsm_a_rr_MBMS_broadcast,
12484               { "MBMS Broadcast","gsm_a.rr.MBMS_broadcast",
12485                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_MBMS_broadcast_value), 0x01,
12486                 NULL, HFILL }
12487             },
12488             { &hf_gsm_a_rr_MBMS_multicast,
12489               { "MBMS Multicast","gsm_a.rr.MBMS_multicast",
12490                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_MBMS_multicast_value), 0x02,
12491                 NULL, HFILL }
12492             },
12493             { &hf_gsm_a_rr_last_segment,
12494               { "Last Segment","gsm_a.rr.last_segment",
12495                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_last_segment_value), 0x01,
12496                 NULL, HFILL }
12497             },
12498             { &hf_gsm_a_rr_carrier_ind,
12499               { "Carrier Indication","gsm_a.rr.carrier_ind",
12500                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_carrier_ind_value), 0x01,
12501                 NULL, HFILL }
12502             },
12503             { &hf_gsm_a_rr_ra,
12504               { "Random Access Information (RA)", "gsm_a.rr.ra",
12505                 FT_UINT8, BASE_DEC, NULL, 0x0,
12506                 NULL, HFILL }
12507             },
12508             { &hf_gsm_a_rr_T1prim,
12509               { "T1'",             "gsm_a.rr.T1prim",
12510                 FT_UINT8, BASE_DEC, NULL, 0xf8,
12511                 NULL, HFILL }
12512             },
12513             { &hf_gsm_a_rr_T3,
12514               { "T3",              "gsm_a.rr.T3",
12515                 FT_UINT16, BASE_DEC, NULL, 0x07e0,
12516                 NULL, HFILL }
12517             },
12518             { &hf_gsm_a_rr_T2,
12519               { "T2",              "gsm_a.rr.T2",
12520                 FT_UINT8, BASE_DEC, NULL, 0x1f,
12521                 NULL, HFILL }
12522             },
12523             { &hf_gsm_a_rr_tbf_T1prim,
12524               { "T1' (TBF)",             "gsm_a.rr.tbf.T1prim",
12525                 FT_UINT8, BASE_DEC, NULL, 0x00,
12526                 NULL, HFILL }
12527             },
12528             { &hf_gsm_a_rr_tbf_T3,
12529               { "T3 (TBF)",              "gsm_a.rr.tbf.T3",
12530                 FT_UINT16, BASE_DEC, NULL, 0x00,
12531                 NULL, HFILL }
12532             },
12533             { &hf_gsm_a_rr_tbf_T2,
12534               { "T2 (TBF)",              "gsm_a.rr.tbf.T2",
12535                 FT_UINT8, BASE_DEC, NULL, 0x00,
12536                 NULL, HFILL }
12537             },
12538             { &hf_gsm_a_rr_rfn,
12539               { "RFN",             "gsm_a.rr.rfn",
12540                 FT_UINT16, BASE_DEC, NULL, 0x0,
12541                 "Reduced Frame Number", HFILL }
12542             },
12543             { &hf_gsm_a_rr_RR_cause,
12544               { "RR cause value","gsm_a.rr.RRcause",
12545                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_RR_cause_vals), 0x0,
12546                 NULL, HFILL }
12547             },
12548             { &hf_gsm_a_rr_cm_cng_msg_req,
12549               { "CLASSMARK CHANGE","gsm_a.rr.cm_cng_msg_req",
12550                 FT_BOOLEAN,8,  TFS(&gsm_a_msg_req_value), 0x80,
12551                 NULL, HFILL }
12552             },
12553             { &hf_gsm_a_rr_utran_cm_cng_msg_req,
12554               { "UTRAN CLASSMARK CHANGE","gsm_a.rr.utran_cm_cng_msg_req",
12555                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_utran_cm_cng_msg_req_vals), 0x70,
12556                 NULL, HFILL }
12557             },
12558             { &hf_gsm_a_rr_cdma200_cm_cng_msg_req,
12559               { "CDMA2000 CLASSMARK CHANGE","gsm_a.rr.cdma200_cm_cng_msg_req",
12560                 FT_BOOLEAN,8,  TFS(&gsm_a_msg_req_value), 0x08,
12561                 NULL, HFILL }
12562             },
12563             { &hf_gsm_a_rr_geran_iu_cm_cng_msg_req,
12564               { "GERAN IU MODE CLASSMARK CHANGE","gsm_a.rr.geran_iu_cm_cng_msg_req",
12565                 FT_BOOLEAN,8,  TFS(&gsm_a_msg_req_value), 0x04,
12566                 NULL, HFILL }
12567             },
12568             { &hf_gsm_a_rr_chnl_needed_ch1,
12569               { "Channel 1","gsm_a.rr.chnl_needed_ch1",
12570                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_channel_needed_vals), 0x00,
12571                 NULL, HFILL }
12572             },
12573             { &hf_gsm_a_rr_chnl_needed_ch2,
12574               { "Channel 2","gsm_a.rr.chnl_needed_ch2",
12575                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_channel_needed_vals), 0x00,
12576                 NULL, HFILL }
12577             },
12578             { &hf_gsm_a_rr_chnl_needed_ch3,
12579               { "Channel 3","gsm_a.rr.chnl_needed_ch3",
12580                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_channel_needed_vals), 0x00,
12581                 NULL, HFILL }
12582             },
12583             { &hf_gsm_a_rr_chnl_needed_ch4,
12584               { "Channel 4","gsm_a.rr.chnl_needed_ch4",
12585                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_channel_needed_vals), 0x00,
12586                 NULL, HFILL }
12587             },
12588             { &hf_gsm_a_rr_pkt_estab_cause,
12589               { "PACKET_ESTABLISHMENT_CAUSE","gsm_a.rr.pkt_estab_cause",
12590                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_pkt_estab_cause_vals), 0x00,
12591                 NULL, HFILL }
12592             },
12593             { &hf_gsm_a_rr_peak_throughput_class,
12594               { "PEAK_THROUGHPUT_CLASS","gsm_a.rr.peak_throughput_class",
12595                 FT_UINT8, BASE_DEC, NULL, 0x00,
12596                 NULL, HFILL }
12597             },
12598             { &hf_gsm_a_rr_radio_priority,
12599               { "RADIO_PRIORITY","gsm_a.rr.radio_priority",
12600                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_radio_priority_vals), 0x00,
12601                 NULL, HFILL }
12602             },
12603             { &hf_gsm_a_rr_llc_pdu_type,
12604               { "LLC_PDU_TYPE","gsm_a.rr.llc_pdu_type",
12605                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_llc_pdu_type_value), 0x00,
12606                 NULL, HFILL }
12607             },
12608             { &hf_gsm_a_rr_rlc_octet_count,
12609               { "RLC_OCTET_COUNT","gsm_a.rr.rlc_octet_count",
12610                 FT_UINT16, BASE_DEC, NULL, 0x00,
12611                 NULL, HFILL }
12612             },
12613             { &hf_gsm_a_rr_rlc_non_pers_mode_cap,
12614               { "RLC Non-persistent Mode Capability","gsm_a.rr.rlc_non_pers_mode_cap",
12615                 FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x00,
12616                 NULL, HFILL }
12617             },
12618             { &hf_gsm_a_rr_reduced_latency_cap,
12619               { "Reduced Latency Capability","gsm_a.rr.reduced_latency_cap",
12620                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_reduced_latency_cap_value), 0x00,
12621                 NULL, HFILL }
12622             },
12623             { &hf_gsm_a_rr_ul_egprs2,
12624               { "Uplink EGPRS2","gsm_a.rr.ul_egprs2",
12625                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_egprs2_vals), 0x00,
12626                 NULL, HFILL }
12627             },
12628             { &hf_gsm_a_rr_dl_egprs2,
12629               { "Downlink EGPRS2","gsm_a.rr.dl_egprs2",
12630                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_egprs2_vals), 0x00,
12631                 NULL, HFILL }
12632             },
12633             { &hf_gsm_a_rr_emst_ms_cap,
12634               { "EMST_MS_Capability","gsm_a.rr.emst_ms_cap",
12635                 FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x00,
12636                 NULL, HFILL }
12637             },
12638             { &hf_gsm_a_rr_suspension_cause,
12639               { "Suspension cause value","gsm_a.rr.suspension_cause",
12640                 FT_UINT8,BASE_DEC,  VALS(gsm_a_rr_suspension_cause_vals), 0x0,
12641                 NULL, HFILL }
12642             },
12643             { &hf_gsm_a_rr_apdu_id,
12644               { "APDU ID","gsm_a.rr.apdu_id",
12645                 FT_UINT8,BASE_HEX,  VALS(gsm_a_rr_apdu_id_vals), 0x0f,
12646                 NULL, HFILL }
12647             },
12648             { &hf_gsm_a_rr_apdu_flags_cr,
12649               { "C/R", "gsm_a.rr.apdu_flags_cr",
12650                 FT_BOOLEAN, 8, TFS(&gsm_a_rr_apdu_flags_cr_value), 0x10,
12651                 NULL, HFILL }
12652             },
12653             { &hf_gsm_a_rr_apdu_flags_fs,
12654               { "First Segment", "gsm_a.rr.apdu_flags_fs",
12655                 FT_BOOLEAN, 8, TFS(&gsm_a_rr_apdu_flags_fs_value), 0x20,
12656                 NULL, HFILL }
12657             },
12658             { &hf_gsm_a_rr_apdu_flags_ls,
12659               { "Last Segment", "gsm_a.rr.apdu_flags_ls",
12660                 FT_BOOLEAN, 8, TFS(&gsm_a_rr_apdu_flags_ls_value), 0x40,
12661                 NULL, HFILL }
12662             },
12663             { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b8,
12664               { "12,2 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b8",
12665                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x80,
12666                 NULL, HFILL }
12667             },
12668             { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b7,
12669               { "10,2 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b7",
12670                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x40,
12671                 NULL, HFILL }
12672             },
12673             { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b6,
12674               { "7,95 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b6",
12675                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x20,
12676                 NULL, HFILL }
12677             },
12678             { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b5,
12679               { "7,40 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b5",
12680                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x10,
12681                 NULL, HFILL }
12682             },
12683             { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b4,
12684               { "6,70 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b4",
12685                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x08,
12686                 NULL, HFILL }
12687             },
12688             { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b3,
12689               { "5,90 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b3",
12690                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x04,
12691                 NULL, HFILL }
12692             },
12693             { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b2,
12694               { "5,15 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b2",
12695                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x02,
12696                 NULL, HFILL }
12697             },
12698             { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b1,
12699               { "4,75 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b1",
12700                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x01,
12701                 NULL, HFILL }
12702             },
12703             { &hf_gsm_a_rr_set_of_amr_codec_modes_v2_b5,
12704               { "23,85 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v2b5",
12705                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x10,
12706                 NULL, HFILL }
12707             },
12708             { &hf_gsm_a_rr_set_of_amr_codec_modes_v2_b4,
12709               { "15,85 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v2b4",
12710                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x08,
12711                 NULL, HFILL }
12712             },
12713             { &hf_gsm_a_rr_set_of_amr_codec_modes_v2_b3,
12714               { "12,65 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v2b3",
12715                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x04,
12716                 NULL, HFILL }
12717             },
12718             { &hf_gsm_a_rr_set_of_amr_codec_modes_v2_b2,
12719               { "8,85 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v2b2",
12720                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x02,
12721                 NULL, HFILL }
12722             },
12723             { &hf_gsm_a_rr_set_of_amr_codec_modes_v2_b1,
12724               { "6,60 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v2b1",
12725                 FT_BOOLEAN,8,  TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x01,
12726                 NULL, HFILL }
12727             },
12728             { &hf_gsm_a_rr_amr_threshold,
12729               { "AMR Threshold", "gsm_a.rr.amr_threshold",
12730                 FT_UINT8, BASE_DEC|BASE_EXT_STRING,  &gsm_a_rr_amr_threshold_vals_ext, 0x00,
12731                 NULL, HFILL }
12732             },
12733             { &hf_gsm_a_rr_amr_hysteresis,
12734               { "AMR Hysteresis", "gsm_a.rr.amr_hysteresis",
12735                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_amr_hysteresis_vals), 0x00,
12736                 NULL, HFILL }
12737             },
12738             { &hf_gsm_a_rr_pwrc,
12739               { "PWRC", "gsm_a.rr.pwrc",
12740                 FT_BOOLEAN, BASE_NONE,  NULL, 0x0,
12741                 "Power Control Indicator (PWRC)", HFILL }
12742             },
12743             { &hf_gsm_a_rr_dtx_bcch,
12744               { "DTX (BCCH)", "gsm_a.rr.dtx_bcch",
12745                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_dtx_bcch_vals), 0x30,
12746                 "Discontinuous Transmission (DTX-BCCH)", HFILL }
12747             },
12748             { &hf_gsm_a_rr_dtx_sacch,
12749               { "DTX (SACCH)", "gsm_a.rr.dtx_sacch",
12750                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_dtx_sacch_vals), 0x00,
12751                 "Discontinuous Transmission (DTX-SACCH)", HFILL }
12752             },
12753             { &hf_gsm_a_rr_radio_link_timeout,
12754               { "Radio Link Timeout", "gsm_a.rr.radio_link_timeout",
12755                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_radio_link_timeout_vals), 0x0f,
12756                 "Radio Link Timeout (s)", HFILL }
12757             },
12758             { &hf_gsm_a_rr_cell_reselect_hyst,
12759               { "Cell Reselection Hysteresis", "gsm_a.rr.cell_reselect_hyst",
12760                 FT_UINT8, BASE_DEC,  NULL, 0xe0,
12761                 "Cell Reselection Hysteresis (dB)", HFILL }
12762             },
12763             { &hf_gsm_a_rr_ms_txpwr_max_cch,
12764               { "MS TXPWR MAX CCH", "gsm_a.rr.ms_txpwr_max_cch",
12765                 FT_UINT8, BASE_DEC,  NULL, 0x1f,
12766                 NULL, HFILL }
12767             },
12768             { &hf_gsm_a_rr_acs,
12769               { "ACS", "gsm_a.rr.acs",
12770                 FT_BOOLEAN, 8,  NULL, 0x80,
12771                 "Additional Reselect Param Indicator (ACS)", HFILL }
12772             },
12773             { &hf_gsm_a_rr_neci,
12774               { "NECI", "gsm_a.rr.neci",
12775                 FT_UINT8, BASE_DEC,  NULL, 0x40,
12776                 "New Establishment Cause Indicator (NECI)", HFILL }
12777             },
12778             { &hf_gsm_a_rr_rxlev_access_min,
12779               { "RXLEV-ACCESS-MIN", "gsm_a.rr.rxlev_access_min",
12780                 FT_UINT8, BASE_DEC|BASE_EXT_STRING,  &gsm_a_rr_rxlev_vals_ext, 0x3f,
12781                 NULL, HFILL }
12782             },
12783             { &hf_gsm_a_rr_mscr,
12784               { "MSCR", "gsm_a.rr.mscr",
12785                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_mscr_vals), 0x80,
12786                 "MSC Release Indicator (MSCR)", HFILL }
12787             },
12788             { &hf_gsm_a_rr_att,
12789               { "ATT", "gsm_a.rr.att",
12790                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_att_vals), 0x40,
12791                 "Attach Indicator (ATT)", HFILL }
12792             },
12793             { &hf_gsm_a_rr_bs_ag_blks_res,
12794               { "BS_AG_BLKS_RES", "gsm_a.rr.bs_ag_blks_res",
12795                 FT_UINT8, BASE_DEC,  NULL, 0x38,
12796                 "Access Grant Reserved Blocks (BS_AG_BLKS_RES)", HFILL }
12797             },
12798             { &hf_gsm_a_rr_ccch_conf,
12799               { "CCCH-CONF", "gsm_a.rr.ccch_conf",
12800                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_ccch_conf_vals), 0x07,
12801                 NULL, HFILL }
12802             },
12803             { &hf_gsm_a_rr_cbq3,
12804               { "CBQ3", "gsm_a.rr.cbq3",
12805                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_cbq3_vals), 0x00,
12806                 "Cell Bar Qualify 3", HFILL }
12807             },
12808             { &hf_gsm_a_rr_bs_pa_mfrms,
12809               { "BS-PA-MFRMS", "gsm_a.rr.bs_pa_mfrms",
12810                 FT_UINT8, BASE_DEC,  NULL, 0x07,
12811                 NULL, HFILL }
12812             },
12813             { &hf_gsm_a_rr_t3212,
12814               { "T3212", "gsm_a.rr.t3212",
12815                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12816                 "Periodic Update period (T3212) (deci-hours)", HFILL }
12817             },
12818             { &hf_gsm_a_rr_gsm_band,
12819               { "GSM Band", "gsm_a.rr.gsm_band",
12820                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_gsm_band_vals), 0x00,
12821                 NULL, HFILL }
12822             },
12823             { &hf_gsm_a_rr_arfcn_first,
12824               { "ARFCN First", "gsm_a.rr.arfcn_first",
12825                 FT_UINT16, BASE_DEC,  NULL, 0x00,
12826                 NULL, HFILL }
12827             },
12828             { &hf_gsm_a_rr_band_offset,
12829               { "Band Offset", "gsm_a.rr.band_offset",
12830                 FT_UINT16, BASE_DEC,  NULL, 0x00,
12831                 NULL, HFILL }
12832             },
12833             { &hf_gsm_a_rr_arfcn_range,
12834               { "ARFCN Range", "gsm_a.rr.arfcn_range",
12835                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12836                 NULL, HFILL }
12837             },
12838             { &hf_gsm_a_rr_lowest_arfcn,
12839               { "Lowest ARFCN", "gsm_a.rr.lowest_arfcn",
12840                 FT_UINT8, BASE_DEC,  NULL, 0x7f,
12841                 NULL, HFILL }
12842             },
12843             { &hf_gsm_a_rr_inc_skip_arfcn,
12844               { "Increment skip ARFCN", "gsm_a.rr.inc_skip_arfcn",
12845                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12846                 NULL, HFILL }
12847             },
12848             { &hf_gsm_a_rr_gprs_resumption_ack,
12849               { "Ack", "gsm_a.rr.gprs_resumption_ack",
12850                 FT_BOOLEAN, 8,  TFS(&gsm_a_rr_gprs_resumption_ack_value), 0x01,
12851                 "GPRS Resumption Ack bit", HFILL }
12852             },
12853             { &hf_gsm_a_rr_ext_ind,
12854               { "EXT-IND", "gsm_a.rr.ext_ind",
12855                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_ext_ind_vals), 0x20,
12856                 "Extension Indication (EXT-IND)", HFILL }
12857             },
12858             { &hf_gsm_a_rr_ba_ind,
12859               { "BA-IND", "gsm_a.rr.ba_ind",
12860                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12861                 "BCCH Allocation Indication (BA-IND)", HFILL }
12862             },
12863             { &hf_gsm_a_rr_multiband_reporting,
12864               { "Multiband Reporting", "gsm_a.rr.multiband_reporting",
12865                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12866                 "Number of cells to be reported in each band if Multiband Reporting", HFILL }
12867             },
12868             { &hf_gsm_a_rr_ncc_permitted,
12869               { "NCC Permitted", "gsm_a.rr.ncc_permitted",
12870                 FT_UINT8, BASE_HEX,  NULL, 0xff,
12871                 NULL, HFILL }
12872             },
12873             { &hf_gsm_a_rr_max_retrans,
12874               { "Max retrans", "gsm_a.rr.max_retrans",
12875                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_max_retrans_vals), 0xc0,
12876                 "Maximum number of retransmissions", HFILL }
12877             },
12878             { &hf_gsm_a_rr_tx_integer,
12879               { "Tx-integer", "gsm_a.rr.tx_integer",
12880                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_tx_integer_vals), 0x3c,
12881                 "Number of Slots to spread Transmission (Tx-integer)", HFILL }
12882             },
12883             { &hf_gsm_a_rr_cell_barr_access,
12884               { "CELL_BARR_ACCESS", "gsm_a.rr.cell_barr_access",
12885                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_cell_barr_access_vals), 0x02,
12886                 "Cell Barred for Access (CELL_BARR_ACCESS)", HFILL }
12887             },
12888             { &hf_gsm_a_rr_re,
12889               { "RE", "gsm_a.rr.re",
12890                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_re_vals), 0x01,
12891                 "Call re-establishment allowed (RE)", HFILL }
12892             },
12893             { &hf_gsm_a_rr_acc,
12894               { "ACC", "gsm_a.rr.acc",
12895                 FT_UINT16, BASE_HEX,  NULL, 0xffff,
12896                 "Access Control Class N barred (ACC)", HFILL }
12897             },
12898             { &hf_gsm_a_rr_nch_position,
12899               { "NCH Position", "gsm_a.rr.nch_position",
12900                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_nch_position_vals), 0x00,
12901                 NULL, HFILL }
12902             },
12903             { &hf_gsm_a_rr_si2ter_mp_change_mark,
12904               { "SI2ter Measurement Parameter Change Mark", "gsm_a.rr.si2ter_mp_change_mark",
12905                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12906                 NULL, HFILL }
12907             },
12908             { &hf_gsm_a_rr_si2ter_3g_change_mark,
12909               { "SI2ter 3G Change Mark", "gsm_a.rr.si2ter_3g_change_mark",
12910                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12911                 NULL, HFILL }
12912             },
12913             { &hf_gsm_a_rr_si2ter_index,
12914               { "SI2ter Index", "gsm_a.rr.si2ter_index",
12915                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12916                 NULL, HFILL }
12917             },
12918             { &hf_gsm_a_rr_si2ter_count,
12919               { "SI2ter Count", "gsm_a.rr.si2ter_count",
12920                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12921                 NULL, HFILL }
12922             },
12923             { &hf_gsm_a_rr_fdd_uarfcn,
12924               { "FDD UARFCN", "gsm_a.rr.fdd_uarfcn",
12925                 FT_UINT16, BASE_DEC,  NULL, 0x0000,
12926                 NULL, HFILL }
12927             },
12928             { &hf_gsm_a_rr_bandwidth_fdd,
12929               { "Bandwidth FDD", "gsm_a.rr.bandwidth_fdd",
12930                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12931                 NULL, HFILL }
12932             },
12933             { &hf_gsm_a_rr_tdd_uarfcn,
12934               { "TDD UARFCN", "gsm_a.rr.tdd_uarfcn",
12935                 FT_UINT16, BASE_DEC,  NULL, 0x0000,
12936                 NULL, HFILL }
12937             },
12938             { &hf_gsm_a_rr_bandwidth_tdd,
12939               { "Bandwidth TDD", "gsm_a.rr.bandwidth_tdd",
12940                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12941                 NULL, HFILL }
12942             },
12943             { &hf_gsm_a_rr_arfcn,
12944               { "ARFCN", "gsm_a.rr.arfcn",
12945                 FT_UINT16, BASE_DEC,  NULL, 0x0000,
12946                 "Absolute Radio Frequency Channel Number (ARFCN)", HFILL }
12947             },
12948             { &hf_gsm_a_rr_bsic,
12949               { "BSIC", "gsm_a.rr.bsic",
12950                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12951                 "Base Station Identify Code (BSIC)", HFILL }
12952             },
12953             { &hf_gsm_a_rr_qsearch_i,
12954               { "Qsearch I", "gsm_a.rr.qsearch_i",
12955                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_qsearch_x_vals), 0x00,
12956                 "Search for 3G cells if signal level is below (0 7) or above (8 15) threshold (Qsearch I)", HFILL }
12957             },
12958             { &hf_gsm_a_rr_fdd_qoffset,
12959               { "FDD Qoffset", "gsm_a.rr.fdd_qoffset",
12960                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_xdd_qoffset_vals), 0x00,
12961                 "Offset to RLA_C for cell re selection to FDD access technology (FDD Qoffset)", HFILL }
12962             },
12963             { &hf_gsm_a_rr_fdd_qmin,
12964               { "FDD Qmin", "gsm_a.rr.fdd_qmin",
12965                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_fdd_qmin_vals), 0x00,
12966                 "Minimum threshold for Ec/No for UTRAN FDD cell re-selection (FDD Qmin)", HFILL }
12967             },
12968             { &hf_gsm_a_rr_tdd_qoffset,
12969               { "TDD Qoffset", "gsm_a.rr.tdd_qoffset",
12970                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_xdd_qoffset_vals), 0x00,
12971                 "Offset to RLA_C for cell re selection to TDD access technology (TDD Qoffset)", HFILL }
12972             },
12973             { &hf_gsm_a_rr_fdd_qmin_offset,
12974               { "FDD Qmin Offset", "gsm_a.rr.fdd_qmin_offset",
12975                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_fdd_qmin_offset_vals), 0x00,
12976                 "Offset to FDD Qmin value (FDD Qmin Offset)", HFILL }
12977             },
12978             { &hf_gsm_a_rr_fdd_rscpmin,
12979               { "FDD RSCPmin", "gsm_a.rr.fdd_rscpmin",
12980                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_fdd_rscpmin_vals), 0x00,
12981                 "Minimum threshold of RSCP for UTRAN FDD cell re-selection (FDD RSCPmin)", HFILL }
12982             },
12983             { &hf_gsm_a_rr_3g_ba_ind,
12984               { "3G BA-IND", "gsm_a.rr.3g_ba_ind",
12985                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12986                 "3G BCCH Allocation Indication (3G BA-IND)", HFILL }
12987             },
12988             { &hf_gsm_a_rr_mp_change_mark,
12989               { "Measurement Parameter Change Mark", "gsm_a.rr.mp_change_mark",
12990                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12991                 NULL, HFILL }
12992             },
12993             { &hf_gsm_a_rr_si2quater_index,
12994               { "SI2quater Index", "gsm_a.rr.si2quater_index",
12995                 FT_UINT8, BASE_DEC,  NULL, 0x00,
12996                 NULL, HFILL }
12997             },
12998             { &hf_gsm_a_rr_si2quater_count,
12999               { "SI2quater Count", "gsm_a.rr.si2quater_count",
13000                 FT_UINT8, BASE_DEC,  NULL, 0x00,
13001                 NULL, HFILL }
13002             },
13003             { &hf_gsm_a_rr_si21_change_mark,
13004               { "SI21 Change Mark", "gsm_a.rr.si21_change_mark",
13005                 FT_UINT8, BASE_DEC,  NULL, 0x00,
13006                 NULL, HFILL }
13007             },
13008             { &hf_gsm_a_rr_si21_index,
13009               { "SI21 Index", "gsm_a.rr.si21_index",
13010                 FT_UINT8, BASE_DEC,  NULL, 0x00,
13011                 NULL, HFILL }
13012             },
13013             { &hf_gsm_a_rr_si21_count,
13014               { "SI21 Count", "gsm_a.rr.si21_count",
13015                 FT_UINT8, BASE_DEC,  NULL, 0x00,
13016                 NULL, HFILL }
13017             },
13018             { &hf_gsm_a_rr_eab_auth_mask,
13019               { "EAB Authorization Mask", "gsm_a.rr.eab_auth_mask",
13020                 FT_UINT8, BASE_DEC,  NULL, 0x00,
13021                 NULL, HFILL }
13022             },
13023             { &hf_gsm_a_eab_subcategory,
13024               { "EAB Subcategory", "gsm_a.rr.eab_subcategory",
13025                 FT_UINT8, BASE_DEC,  NULL, 0x00,
13026                 NULL, HFILL }
13027             },
13028             { &hf_gsm_a_rr_gsm_report_type,
13029               { "Report Type", "gsm_a.rr.gsm_report_type",
13030                 FT_BOOLEAN, BASE_NONE,  TFS(&gsm_a_rr_gsm_report_type_value), 0x0,
13031                 "Report type the MS shall use (Report Type)", HFILL }
13032             },
13033             { &hf_gsm_a_rr_serving_band_reporting,
13034               { "Serving Band Reporting", "gsm_a.rr.serving_band_reporting",
13035                 FT_UINT8, BASE_DEC, NULL, 0x00,
13036                 "Number of cells reported from the GSM serving frequency band (Serving Band Reporting)", HFILL }
13037             },
13038             { &hf_gsm_a_rr_frequency_scrolling,
13039               { "Frequency Scrolling", "gsm_a.rr.frequency_scrolling",
13040                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_frequency_scrolling_value), 0x0,
13041                 NULL, HFILL }
13042             },
13043             { &hf_gsm_a_rr_rep_priority,
13044               { "Rep Priority", "gsm_a.rr.rep_priority",
13045                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_rep_priority_value), 0x0,
13046                 "Reporting Priority", HFILL }
13047             },
13048             { &hf_gsm_a_rr_report_type,
13049               { "Report Type", "gsm_a.rr.report_type",
13050                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_report_type_value), 0x0,
13051                 NULL, HFILL }
13052             },
13053             { &hf_gsm_a_rr_reporting_rate,
13054               { "Reporting Rate", "gsm_a.rr.reporting_rate",
13055                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_reporting_rate_value), 0x0,
13056                 NULL, HFILL }
13057             },
13058             { &hf_gsm_a_rr_invalid_bsic_reporting,
13059               { "Invalid BSIC Reporting", "gsm_a.rr.invalid_bsic_reporting",
13060                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_invalid_bsic_reporting_value), 0x0,
13061                 NULL, HFILL }
13062             },
13063             { &hf_gsm_a_rr_scale_ord,
13064               { "Scale Ord", "gsm_a.rr.scale_ord",
13065                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_scale_ord_vals), 0x00,
13066                 "Offset used for the reported RXLEV values (Scale Ord)", HFILL }
13067             },
13068             { &hf_gsm_a_rr_900_reporting_offset,
13069               { "900 Reporting Offset", "gsm_a.rr.900_reporting_offset",
13070                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
13071                 "Offset to the reported value when prioritising the cells for reporting for GSM frequency band 900 (900 Reporting Offset)", HFILL }
13072             },
13073             { &hf_gsm_a_rr_900_reporting_threshold,
13074               { "900 Reporting Threshold", "gsm_a.rr.900_reporting_threshold",
13075                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_gsm_reporting_threshold_vals), 0x00,
13076                 "Apply priority reporting if the reported value is above threshold for GSM frequency band 900 (900 Reporting Threshold)", HFILL }
13077             },
13078             { &hf_gsm_a_rr_1800_reporting_offset,
13079               { "1800 Reporting Offset", "gsm_a.rr.1800_reporting_offset",
13080                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
13081                 "Offset to the reported value when prioritising the cells for reporting for GSM frequency band 1800 (1800 Reporting Offset)", HFILL }
13082             },
13083             { &hf_gsm_a_rr_1800_reporting_threshold,
13084               { "1800 Reporting Threshold", "gsm_a.rr.1800_reporting_threshold",
13085                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_gsm_reporting_threshold_vals), 0x00,
13086                 "Apply priority reporting if the reported value is above threshold for GSM frequency band 1800 (1800 Reporting Threshold)", HFILL }
13087             },
13088             { &hf_gsm_a_rr_400_reporting_offset,
13089               { "400 Reporting Offset", "gsm_a.rr.400_reporting_offset",
13090                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
13091                 "Offset to the reported value when prioritising the cells for reporting for GSM frequency band 400 (400 Reporting Offset)", HFILL }
13092             },
13093             { &hf_gsm_a_rr_400_reporting_threshold,
13094               { "400 Reporting Threshold", "gsm_a.rr.400_reporting_threshold",
13095                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_gsm_reporting_threshold_vals), 0x00,
13096                 "Apply priority reporting if the reported value is above threshold for GSM frequency band 400 (400 Reporting Threshold)", HFILL }
13097             },
13098             { &hf_gsm_a_rr_1900_reporting_offset,
13099               { "1900 Reporting Offset", "gsm_a.rr.1900_reporting_offset",
13100                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
13101                 "Offset to the reported value when prioritising the cells for reporting for GSM frequency band 1900 (1900 Reporting Offset)", HFILL }
13102             },
13103             { &hf_gsm_a_rr_1900_reporting_threshold,
13104               { "1900 Reporting Threshold", "gsm_a.rr.1900_reporting_threshold",
13105                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_gsm_reporting_threshold_vals), 0x00,
13106                 "Apply priority reporting if the reported value is above threshold for GSM frequency band 1900 (1900 Reporting Threshold)", HFILL }
13107             },
13108             { &hf_gsm_a_rr_850_reporting_offset,
13109               { "850 Reporting Offset", "gsm_a.rr.850_reporting_offset",
13110                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
13111                 "Offset to the reported value when prioritising the cells for reporting for GSM frequency band 850 (850 Reporting Offset)", HFILL }
13112             },
13113             { &hf_gsm_a_rr_850_reporting_threshold,
13114               { "850 Reporting Threshold", "gsm_a.rr.900_reporting_threshold",
13115                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_gsm_reporting_threshold_vals), 0x00,
13116                 "Apply priority reporting if the reported value is above threshold for GSM frequency band 850 (850 Reporting Threshold)", HFILL }
13117             },
13118             { &hf_gsm_a_rr_network_control_order,
13119               { "Network Control Order", "gsm_a.rr.network_control_order",
13120                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_network_control_order_vals), 0x00,
13121                 NULL, HFILL }
13122             },
13123             { &hf_gsm_a_rr_nc_non_drx_period,
13124               { "NC Non DRX Period", "gsm_a.rr.nc_non_drx_period",
13125                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_nc_non_drx_period_vals), 0x00,
13126                 NULL, HFILL }
13127             },
13128             { &hf_gsm_a_rr_nc_reporting_period_i,
13129               { "NC Reporting Period I", "gsm_a.rr.nc_reporting_period_i",
13130                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_nc_reporting_period_x_vals), 0x00,
13131                 "NC Reporting Period in Packet Idle mode (NC Reporting Period I)", HFILL }
13132             },
13133             { &hf_gsm_a_rr_nc_reporting_period_t,
13134               { "NC Reporting Period T", "gsm_a.rr.nc_reporting_period_t",
13135                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_nc_reporting_period_x_vals), 0x00,
13136                 "NC Reporting Period in Packet Transfer mode (NC Reporting Period T)", HFILL }
13137             },
13138             { &hf_gsm_a_rr_index_start_3g,
13139               { "Index Start 3G", "gsm_a.rr.index_start_3g",
13140                 FT_UINT8, BASE_DEC, NULL, 0x00,
13141                 NULL, HFILL }
13142             },
13143             { &hf_gsm_a_rr_absolute_index_start_emr,
13144               { "Absolute Index Start EMR", "gsm_a.rr.absolute_index_start_emr",
13145                 FT_UINT8, BASE_DEC, NULL, 0x00,
13146                 NULL, HFILL }
13147             },
13148             { &hf_gsm_a_rr_qsearch_c_initial,
13149               { "QSearch C Initial", "gsm_a.rr.qsearch_c_initial",
13150                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_qsearch_c_initial_value), 0x0,
13151                 "Qsearch value to be used in connected mode before Qsearch C is received (QSearch C Initial)", HFILL }
13152             },
13153             { &hf_gsm_a_rr_fdd_rep_quant,
13154               { "FDD Rep Quant", "gsm_a.rr.fdd_rep_quant",
13155                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_fdd_rep_quant_value), 0x0,
13156                 "FDD Reporting Quantity (FDD Rep Quant)", HFILL }
13157             },
13158             { &hf_gsm_a_rr_fdd_multirat_reporting,
13159               { "FDD Multirat Reporting", "gsm_a.rr.fdd_multirat_reporting",
13160                 FT_UINT8, BASE_DEC, NULL, 0x00,
13161                 "Number of cells from the FDD access technology that shall be included in the list of strongest cells or in the measurement report (FDD Multirat Reporting)", HFILL }
13162             },
13163             { &hf_gsm_a_rr_tdd_multirat_reporting,
13164               { "TDD Multirat Reporting", "gsm_a.rr.tdd_multirat_reporting",
13165                 FT_UINT8, BASE_DEC, NULL, 0x00,
13166                 "Number of cells from the TDD access technology that shall be included in the list of strongest cells or in the measurement report (TDD Multirat Reporting)", HFILL }
13167             },
13168             { &hf_gsm_a_rr_qsearch_p,
13169               { "Qsearch P", "gsm_a.rr.qsearch_p",
13170                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_qsearch_x_vals), 0x00,
13171                 "Search for 3G cells if signal level below threshold (Qsearch P)", HFILL }
13172             },
13173             { &hf_gsm_a_rr_3g_search_prio,
13174               { "3G Search Prio (ignored in Rel-8)", "gsm_a.rr.3g_search_prio",
13175                 FT_BOOLEAN, BASE_NONE,  TFS(&gsm_a_rr_3g_search_prio_value), 0x0,
13176                 NULL, HFILL }
13177             },
13178             { &hf_gsm_a_rr_fdd_reporting_offset,
13179               { "FDD Reporting Offset", "gsm_a.rr.fdd_reporting_offset",
13180                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
13181                 "Offset to the reported value when prioritising the cells for reporting for FDD access technology (FDD Reporting Offset)", HFILL }
13182             },
13183             { &hf_gsm_a_rr_fdd_reporting_threshold_rscp,
13184               { "FDD Reporting Threshold RSCP", "gsm_a.rr.fdd_reporting_threshold_rscp",
13185                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_wcdma_rscp_reporting_threshold_vals), 0x00,
13186                 "Apply priority reporting if the reported value is above threshold for FDD access technology (FDD Reporting Threshold)", HFILL }
13187             },
13188             { &hf_gsm_a_rr_fdd_reporting_threshold_ecn0,
13189               { "FDD Reporting Threshold EcN0", "gsm_a.rr.fdd_reporting_threshold_ecn0",
13190                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_wcdma_ecn0_reporting_threshold_vals), 0x00,
13191                 "Apply priority reporting if the reported value is above threshold for FDD access technology (FDD Reporting Threshold)", HFILL }
13192             },
13193             { &hf_gsm_a_rr_tdd_reporting_offset,
13194               { "TDD Reporting Offset", "gsm_a.rr.tdd_reporting_offset",
13195                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
13196                 "Offset to the reported value when prioritising the cells for reporting for TDD access technology (TDD Reporting Offset)", HFILL }
13197             },
13198             { &hf_gsm_a_rr_tdd_reporting_threshold_rscp,
13199               { "TDD Reporting Threshold RSCP", "gsm_a.rr.tdd_reporting_threshold_rscp",
13200                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_wcdma_rscp_reporting_threshold_vals), 0x00,
13201                 "Apply priority reporting if the reported value is above threshold for TDD access technology (TDD Reporting Threshold)", HFILL }
13202             },
13203             { &hf_gsm_a_rr_tdd_reporting_threshold_ecn0,
13204               { "TDD Reporting Threshold EcN0", "gsm_a.rr.tdd_reporting_threshold_ecn0",
13205                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_wcdma_ecn0_reporting_threshold_vals), 0x00,
13206                 "Apply priority reporting if the reported value is above threshold for TDD access technology (TDD Reporting Threshold)", HFILL }
13207             },
13208             { &hf_gsm_a_rr_fdd_reporting_threshold_2,
13209               { "FDD Reporting Threshold 2", "gsm_a.rr.fdd_reporting_threshold_2",
13210                 FT_UINT8, BASE_DEC,  NULL, 0x00,
13211                 "Reporting threshold for the CPICH parameter (Ec/No or RSCP) that is not reported according to FDD_REP_QUANT (FDD Reporting Threshold 2)", HFILL }
13212             },
13213             { &hf_gsm_a_rr_3g_ccn_active,
13214               { "3G CCN Active", "gsm_a.rr.3g_ccn_active",
13215                 FT_BOOLEAN, BASE_NONE,  TFS(&gsm_a_rr_3g_ccn_active_value), 0x0,
13216                 NULL, HFILL }
13217             },
13218             { &hf_gsm_a_rr_700_reporting_offset,
13219               { "700 Reporting Offset", "gsm_a.rr.700_reporting_offset",
13220                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
13221                 "Offset to the reported value when prioritising the cells for reporting for GSM frequency band 700 (700 Reporting Offset)", HFILL }
13222             },
13223             { &hf_gsm_a_rr_700_reporting_threshold,
13224               { "700 Reporting Threshold", "gsm_a.rr.700_reporting_threshold",
13225                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_gsm_reporting_threshold_vals), 0x00,
13226                 "Apply priority reporting if the reported value is above threshold for GSM frequency band 700 (700 Reporting Threshold)", HFILL }
13227             },
13228             { &hf_gsm_a_rr_810_reporting_offset,
13229               { "810 Reporting Offset", "gsm_a.rr.810_reporting_offset",
13230                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
13231                 "Offset to the reported value when prioritising the cells for reporting for GSM frequency band 810 (810 Reporting Offset)", HFILL }
13232             },
13233             { &hf_gsm_a_rr_810_reporting_threshold,
13234               { "810 Reporting Threshold", "gsm_a.rr.810_reporting_threshold",
13235                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_gsm_reporting_threshold_vals), 0x00,
13236                 "Apply priority reporting if the reported value is above threshold for GSM frequency band 810 (810 Reporting Threshold)", HFILL }
13237             },
13238             { &hf_gsm_a_rr_cbq,
13239               { "CBQ", "gsm_a.rr.cbq",
13240                 FT_UINT8, BASE_DEC,  NULL, 0x00,
13241                 "Cell Bar Qualify", HFILL }
13242             },
13243             { &hf_gsm_a_rr_cell_reselect_offset,
13244               { "Cell Reselect Offset", "gsm_a.rr.cell_reselect_offset",
13245                 FT_UINT8, BASE_DEC,  VALS(gsm_a_rr_cell_reselect_offset_vals), 0x00,
13246                 "Offset to the C2 reselection criterion (Cell Reselect Offset)", HFILL }
13247             },
13248             { &hf_gsm_a_rr_temporary_offset,
13249               { "Temporary Offset", "gsm_a.rr.temporary_offset",
13250                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_temporary_offset_vals), 0x0,
13251                 "Negative offset to C2 for the duration of Penalty Time (Temporary Offset)", HFILL }
13252             },
13253             { &hf_gsm_a_rr_penalty_time,
13254               { "Penalty Time", "gsm_a.rr.penalty_time",
13255                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_penalty_time_vals), 0x0,
13256                 "Duration for which the temporary offset is applied (Penalty Time)", HFILL }
13257             },
13258             { &hf_gsm_a_rr_gprs_ra_colour,
13259               { "GPRS RA Colour", "gsm_a.rr.gprs_ra_colour",
13260                 FT_UINT8, BASE_DEC, NULL, 0x0,
13261                 NULL, HFILL }
13262             },
13263             { &hf_gsm_a_rr_si13_position,
13264               { "SI13 Position", "gsm_a.rr.si13_position",
13265                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_si13_position_vals), 0x0,
13266                 NULL, HFILL }
13267             },
13268             { &hf_gsm_a_rr_power_offset,
13269               { "Power Offset", "gsm_a.rr.power_offset",
13270                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_power_offset_vals), 0x0,
13271                 "Power offset used in conjunction with the MS TXPWR MAX CCH parameter by the class 3 DCS 1800 MS (Power Offset)", HFILL }
13272             },
13273             { &hf_gsm_a_rr_si2quater_position,
13274               { "SI2quater Position", "gsm_a.rr.si2quater_position",
13275                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_si2quater_position_value), 0x0,
13276                 NULL, HFILL }
13277             },
13278             { &hf_gsm_a_rr_si13alt_position,
13279               { "SI13alt Position", "gsm_a.rr.si13alt_position",
13280                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_si13alt_position_value), 0x0,
13281                 NULL, HFILL }
13282             },
13283             { &hf_gsm_a_rr_si21_position,
13284               { "SI21 Position", "gsm_a.rr.si21_position",
13285                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_si21_position_value), 0x0,
13286                 NULL, HFILL }
13287             },
13288             { &hf_gsm_a_rr_prio_thr,
13289               { "Prio Thr", "gsm_a.rr.prio_thr",
13290                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_prio_thr_vals), 0x0,
13291                 "Prio signal strength threshold is related to RXLEV ACCESS_MIN (Prio Thr)", HFILL }
13292             },
13293             { &hf_gsm_a_rr_lsa_offset,
13294               { "LSA Offset", "gsm_a.rr.lsa_offset",
13295                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_lsa_offset_vals), 0x0,
13296                 "Offset to be used for LSA cell re selection between cells with the same LSA priorities (LSA Offset)", HFILL }
13297             },
13298             { &hf_gsm_a_rr_cell_id,
13299               { "Cell Identity", "gsm_a.rr.cell_id",
13300                 FT_UINT16, BASE_HEX_DEC, 0, 0x0,
13301                 NULL, HFILL }
13302             },
13303             { &hf_gsm_a_rr_paging_channel_restructuring,
13304               { "Paging Channel Restructuring", "gsm_a.rr.paging_channel_restructuring",
13305                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_paging_channel_restructuring_value), 0x0,
13306                 NULL, HFILL }
13307             },
13308             { &hf_gsm_a_rr_nln_sacch,
13309               { "NLN (SACCH)", "gsm_a.rr.nln_sacch",
13310                 FT_UINT8, BASE_DEC, NULL, 0x0,
13311                 NULL, HFILL }
13312             },
13313             { &hf_gsm_a_rr_nln_status_sacch,
13314               { "NLN Status (SACCH)", "gsm_a.rr.nln_status_sacch",
13315                 FT_UINT8, BASE_DEC, NULL, 0x0,
13316                 NULL, HFILL }
13317             },
13318             { &hf_gsm_a_rr_nln_pch,
13319               { "NLN (PCH)", "gsm_a.rr.nln_pch",
13320                 FT_UINT8, BASE_DEC, NULL, 0x0,
13321                 NULL, HFILL }
13322             },
13323             { &hf_gsm_a_rr_nln_status_pch,
13324               { "NLN Status (PCH)", "gsm_a.rr.nln_status_pch",
13325                 FT_UINT8, BASE_DEC, NULL, 0x0,
13326                 NULL, HFILL }
13327             },
13328             { &hf_gsm_a_rr_vbs_vgcs_inband_notifications,
13329               { "Inband Notifications", "gsm_a.rr.vbs_vgcs_inband_notifications",
13330                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_vbs_vgcs_inband_notifications_value), 0x0,
13331                 NULL, HFILL }
13332             },
13333             { &hf_gsm_a_rr_vbs_vgcs_inband_pagings,
13334               { "Inband Pagings", "gsm_a.rr.vbs_vgcs_inband_pagings",
13335                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_vbs_vgcs_inband_pagings_value), 0x0,
13336                 NULL, HFILL }
13337             },
13338             { &hf_gsm_a_rr_rac,
13339               { "RAC", "gsm_a.rr.rac",
13340                 FT_UINT8, BASE_DEC, NULL, 0x0,
13341                 "Routeing Area Code", HFILL }
13342             },
13343             { &hf_gsm_a_rr_max_lapdm,
13344               { "Max LAPDm", "gsm_a.rr.max_lapdm",
13345                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_max_lapdm_vals), 0x0,
13346                 "Maximum number of LAPDm frames on which a layer 3 can be segmented into and be sent on the main DCCH (Max LAPDm)", HFILL }
13347             },
13348             { &hf_gsm_a_rr_gprs_ms_txpwr_max_ccch,
13349               { "GPRS MS TxPwr Max CCH", "gsm_a.rr.gprs_ms_txpwr_max_cch",
13350                 FT_UINT8, BASE_DEC,  NULL, 0x00,
13351                 NULL, HFILL }
13352             },
13353             { &hf_gsm_a_rr_dedicated_mode_mbms_notification_support,
13354               { "Dedicated Mode MBMS Notification Support", "gsm_a.rr.dedicated_mode_mbms_notification_support",
13355                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_dedicated_mode_mbms_notification_support_value), 0x0,
13356                 NULL, HFILL }
13357             },
13358             { &hf_gsm_a_rr_mnci_support,
13359               { "MNCI Support", "gsm_a.rr.mnci_support",
13360                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_mnci_support_value), 0x0,
13361                 "MBMS Neighbouring Cell Information Support (MNCI Support)", HFILL }
13362             },
13363             { &hf_gsm_a_rr_amr_config,
13364               { "AMR Configuration", "gsm_a.rr.amr_config",
13365                 FT_UINT8, BASE_DEC, NULL, 0x0,
13366                 NULL, HFILL }
13367             },
13368             { &hf_gsm_a_rr_bcch_change_mark,
13369               { "BCCH Change Mark", "gsm_a.rr.bcch_change_mark",
13370                 FT_UINT8, BASE_DEC, NULL, 0x0,
13371                 NULL, HFILL }
13372             },
13373             { &hf_gsm_a_rr_si_change_field,
13374               { "SI Change Field", "gsm_a.rr.si_change_field",
13375                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_si_change_field_vals), 0x0,
13376                 NULL, HFILL }
13377             },
13378             { &hf_gsm_a_rr_si13_change_mark,
13379               { "SI13 Change Mark", "gsm_a.rr.si13_change_mark",
13380                 FT_UINT8, BASE_DEC, NULL, 0x0,
13381                 NULL, HFILL }
13382             },
13383             { &hf_gsm_a_rr_hsn,
13384               { "HSN", "gsm_a.rr.hsn",
13385                 FT_UINT8, BASE_DEC, NULL, 0x0,
13386                 "Hopping Sequence Number (HSN)", HFILL }
13387             },
13388             { &hf_gsm_a_rr_rfl_number,
13389               { "RFL Number", "gsm_a.rr.rfl_number",
13390                 FT_UINT8, BASE_DEC, NULL, 0x0,
13391                 "Radio Frequency List Number (RFL Number)", HFILL }
13392             },
13393             { &hf_gsm_a_rr_arfcn_index,
13394               { "ARFCN Index", "gsm_a.rr.arfcn_index",
13395                 FT_UINT8, BASE_DEC, NULL, 0x0,
13396                 NULL, HFILL }
13397             },
13398             { &hf_gsm_a_rr_ma_length,
13399               { "MA Length", "gsm_a.rr.ma_length",
13400                 FT_UINT8, BASE_DEC, NULL, 0x0,
13401                 "Mobile Allocation Length (MA Length)", HFILL }
13402             },
13403             { &hf_gsm_a_rr_psi1_repeat_period,
13404               { "PSI1 Repeat Period", "gsm_a.rr.psi1_repeat_period",
13405                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_psi1_repeat_period_vals), 0x0,
13406                 NULL, HFILL }
13407             },
13408             { &hf_gsm_a_rr_pbcch_pb,
13409               { "Pb", "gsm_a.rr.pbcch_pb",
13410                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_pbcch_pb_vals), 0x0,
13411                 "Power reduction on PBCCH/PCCCH (Pb)", HFILL }
13412             },
13413             { &hf_gsm_a_rr_pbcch_tsc,
13414               { "TSC", "gsm_a.rr.pbcch_tsc",
13415                 FT_UINT8, BASE_DEC, NULL, 0x0,
13416                 "Training Sequence Code for PBCCH (TSC)", HFILL }
13417             },
13418             { &hf_gsm_a_rr_pbcch_tn,
13419               { "TN", "gsm_a.rr.pbcch_tn",
13420                 FT_UINT8, BASE_DEC, NULL, 0x0,
13421                 "Timeslot Number for PCCH (TN)", HFILL }
13422             },
13423             { &hf_gsm_a_rr_spgc_ccch_sup,
13424               { "SPGC CCCH Sup", "gsm_a.rr.spgc_ccch_sup",
13425                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_spgc_ccch_sup_value), 0x0,
13426                 "Split PG Cycle Code on CCCH Support (SPGC CCCH Sup)", HFILL }
13427             },
13428             { &hf_gsm_a_rr_priority_access_thr,
13429               { "Priority Access Thr", "gsm_a.rr.priority_access_thr",
13430                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_priority_access_thr_vals), 0x0,
13431                 "Priority Access Threshold for packet access (Priority Access Thr)", HFILL }
13432             },
13433             { &hf_gsm_a_rr_nmo,
13434               { "NMO", "gsm_a.rr.nmo",
13435                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_nmo_vals), 0x0,
13436                 "Network mode of Operation (NMO)", HFILL }
13437             },
13438             { &hf_gsm_a_rr_t3168,
13439               { "T3168", "gsm_a.rr.t3168",
13440                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_t3168_vals), 0x0,
13441                 NULL, HFILL }
13442             },
13443             { &hf_gsm_a_rr_t3192,
13444               { "T3192", "gsm_a.rr.t3192",
13445                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_t3192_vals), 0x0,
13446                 NULL, HFILL }
13447             },
13448             { &hf_gsm_a_rr_drx_timer_max,
13449               { "DRX Timer Max", "gsm_a.rr.drx_timer_max",
13450                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_drx_timer_max_vals), 0x0,
13451                 "Discontinuous Reception Timer Max (DRX Timer Max)", HFILL }
13452             },
13453             { &hf_gsm_a_rr_access_burst_type,
13454               { "Access Burst Type", "gsm_a.rr.access_burst_type",
13455                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_access_burst_type_value), 0x0,
13456                 "Format used in the PACKET CHANNEL REQUEST message, the PS HANDOVER ACCESS message, the PTCCH uplink block and in the PACKET CONTROL ACKNOWLEDGMENT message (Access Burst Type)", HFILL }
13457             },
13458             { &hf_gsm_a_rr_control_ack_type,
13459               { "Control Ack Type", "gsm_a.rr.control_ack_type",
13460                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_control_ack_type_value), 0x0,
13461                 "Default format of the PACKET CONTROL ACKNOWLEDGMENT message (Control Ack Type)", HFILL }
13462             },
13463             { &hf_gsm_a_rr_bs_cv_max,
13464               { "BS CV Max", "gsm_a.rr.bs_cv_max",
13465                 FT_UINT8, BASE_DEC, NULL, 0x0,
13466                 "Base Station Countdown Value Maximum (BS CV Max)", HFILL }
13467             },
13468             { &hf_gsm_a_rr_pan_dec,
13469               { "PAN Dec", "gsm_a.rr.pan_dec",
13470                 FT_UINT8, BASE_DEC, NULL, 0x0,
13471                 NULL, HFILL }
13472             },
13473             { &hf_gsm_a_rr_pan_inc,
13474               { "PAN Inc", "gsm_a.rr.pan_inc",
13475                 FT_UINT8, BASE_DEC, NULL, 0x0,
13476                 NULL, HFILL }
13477             },
13478             { &hf_gsm_a_rr_pan_max,
13479               { "PAN Max", "gsm_a.rr.pan_max",
13480                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_pan_max_vals), 0x0,
13481                 NULL, HFILL }
13482             },
13483             { &hf_gsm_a_rr_egprs_packet_channel_request,
13484               { "EGPRS Packet Channel Request", "gsm_a.rr.egprs_packet_channel_request",
13485                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_egprs_packet_channel_request_value), 0x0,
13486                 NULL, HFILL }
13487             },
13488             { &hf_gsm_a_rr_bep_period,
13489               { "BEP Period", "gsm_a.rr.bep_period",
13490                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_bep_period_vals), 0x0,
13491                 NULL, HFILL }
13492             },
13493             { &hf_gsm_a_rr_pfc_feature_mode,
13494               { "PFC Feature Mode", "gsm_a.rr.pfc_feature_mode",
13495                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_pfc_feature_mode_value), 0x0,
13496                 "Packet Flow Context Feature Mode (PFC Feature Mode)", HFILL }
13497             },
13498             { &hf_gsm_a_rr_dtm_support,
13499               { "DTM Support", "gsm_a.rr.dtm_support",
13500                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_dtm_support_value), 0x0,
13501                 "Dual Transfer Mode Support (DTM Support)", HFILL }
13502             },
13503             { &hf_gsm_a_rr_bss_paging_coordination,
13504               { "BSS Paging Coordination", "gsm_a.rr.bss_paging_coordination",
13505                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_bss_paging_coordination_value), 0x0,
13506                 NULL, HFILL }
13507             },
13508             { &hf_gsm_a_rr_ccn_active,
13509               { "CCN Active", "gsm_a.rr.ccn_active",
13510                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_ccn_active_value), 0x0,
13511                 NULL, HFILL }
13512             },
13513             { &hf_gsm_a_rr_nw_ext_utbf,
13514               { "NW Ext UTBF", "gsm_a.rr.nw_ext_utbf",
13515                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_nw_ext_utbf_value), 0x0,
13516                 "Network Extended Uplink TBF (NW Ext UTBF)", HFILL }
13517             },
13518             { &hf_gsm_a_rr_multiple_tbf_capability,
13519               { "Multiple TBF Capability", "gsm_a.rr.multiple_tbf_capability",
13520                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_multiple_tbf_capability_value), 0x0,
13521                 NULL, HFILL }
13522             },
13523             { &hf_gsm_a_rr_ext_utbf_no_data,
13524               { "Ext UTBF No Data", "gsm_a.rr.ext_utbf_no_data",
13525                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_ext_utbf_no_data_value), 0x0,
13526                 NULL, HFILL }
13527             },
13528             { &hf_gsm_a_rr_dtm_enhancements_capability,
13529               { "DTM Enhancements Capability", "gsm_a.rr.dtm_enhancements_capability",
13530                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_dtm_enhancements_capability_value), 0x0,
13531                 NULL, HFILL }
13532             },
13533             { &hf_gsm_a_rr_reduced_latency_access,
13534               { "Reduced Latency Access", "gsm_a.rr.reduced_latency_access",
13535                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_reduced_latency_access_value), 0x0,
13536                 NULL, HFILL }
13537             },
13538             { &hf_gsm_a_rr_alpha,
13539               { "Alpha", "gsm_a.rr.alpha",
13540                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_alpha_vals), 0x0,
13541                 "Alpha parameter for GPR MS output power control (Alpha)", HFILL }
13542             },
13543             { &hf_gsm_a_rr_t_avg_w,
13544               { "T Avg W", "gsm_a.rr.t_avg_w",
13545                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_t_avg_x_vals), 0x0,
13546                 "Signal strength filter period for power control in packet idle mode", HFILL }
13547             },
13548             { &hf_gsm_a_rr_t_avg_t,
13549               { "T Avg T", "gsm_a.rr.t_avg_t",
13550                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_t_avg_x_vals), 0x0,
13551                 "Signal strength filter period for power control in packet transfer mode", HFILL }
13552             },
13553             { &hf_gsm_a_rr_pc_meas_chan,
13554               { "PC Meas Chan", "gsm_a.rr.pc_meas_chan",
13555                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_pc_meas_chan_value), 0x0,
13556                 "Channel used to measure the received power level on the downlink for the purpose of the uplink power control (PC Meas Chan)", HFILL }
13557             },
13558             { &hf_gsm_a_rr_n_avg_i,
13559               { "N Avg I", "gsm_a.rr.n_avg_i",
13560                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_n_avg_i_vals), 0x0,
13561                 "Interfering signal strength filter constant for power control (N Avg I)", HFILL }
13562             },
13563             { &hf_gsm_a_rr_sgsnr,
13564               { "SGSNR", "gsm_a.rr.sgsnr",
13565                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_sgsnr_value), 0x0,
13566                 "SGSN Release (SGSNR)", HFILL }
13567             },
13568             { &hf_gsm_a_rr_si_status_ind,
13569               { "SI Status Ind", "gsm_a.rr.si_status_ind",
13570                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_si_status_ind_value), 0x0,
13571                 NULL, HFILL }
13572             },
13573             { &hf_gsm_a_rr_lb_ms_txpwr_max_cch,
13574               { "LB MS TxPwr Max CCCH", "gsm_a.rr.lb_ms_txpwr_max_cch",
13575                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_lb_ms_txpwr_max_cch_vals), 0x0,
13576                 "Maximum TX power level an MS is allowed to use on all other than DCS 1800 and PCS 1900 frequency bands when accessing the system until otherwise commanded (LB MS TxPwr Max CCCH)", HFILL }
13577             },
13578             { &hf_gsm_a_rr_si2n_support,
13579               { "SI2n Support", "gsm_a.rr.si2n_support",
13580                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_si2n_support_vals), 0x0,
13581                 NULL, HFILL }
13582             },
13583             { &hf_gsm_a_rr_mi_index,
13584               { "Measurement Information Index", "gsm_a.rr.mi_index",
13585                 FT_UINT8, BASE_DEC, NULL, 0x0,
13586                 NULL, HFILL }
13587             },
13588             { &hf_gsm_a_rr_mi_count,
13589               { "Measurement Information Count", "gsm_a.rr.mi_count",
13590                 FT_UINT8, BASE_DEC, NULL, 0x0,
13591                 NULL, HFILL }
13592             },
13593             { &hf_gsm_a_rr_3g_wait,
13594               { "3G Wait", "gsm_a.rr.3g_wait",
13595                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_3g_wait_vals), 0x0,
13596                 NULL, HFILL }
13597             },
13598             { &hf_gsm_a_rr_qsearch_c,
13599               { "Qsearch C", "gsm_a.rr.qsearch_c",
13600                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_qsearch_x_vals), 0x00,
13601                 "Search for 3G cells if signal level is below (0 7) or above (8 15) threshold (Qsearch C)", HFILL }
13602             },
13603             { &hf_gsm_a_rr_bsic_seen,
13604               { "BSIC Seen", "gsm_a.rr.bsic_seen",
13605                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_bsic_seen_value), 0x0,
13606                 NULL, HFILL }
13607             },
13608             { &hf_gsm_a_rr_scale,
13609               { "Scale", "gsm_a.rr.scale",
13610                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_scale_value), 0x0,
13611                 "Offset applied for the reported RXLEV values (Scale)", HFILL }
13612             },
13613             { &hf_gsm_a_rr_mean_bep_gmsk,
13614               { "Mean BEP GMSK", "gsm_a.rr.mean_bep_gmsk",
13615                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_mean_bep_gmsk_vals), 0x00,
13616                 "Mean Bit Error Probability in GMSK (Mean BEP GMSK)", HFILL }
13617             },
13618             { &hf_gsm_a_rr_mean_cv_bep,
13619               { "CV BEP", "gsm_a.rr.cv_bep",
13620                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_cv_bep_vals), 0x00,
13621                 "Coefficient of Variation of the Bit Error Probability (CV BEP)", HFILL }
13622             },
13623             { &hf_gsm_a_rr_nbr_rcvd_blocks,
13624               { "Nb Rcvd Blocks", "gsm_a.rr.nbr_rcvd_blocks",
13625                 FT_UINT8, BASE_DEC, NULL, 0x00,
13626                 "Number of correctly decoded blocks that were completed during the measurement report period (Nb Rcvd Blocks)", HFILL }
13627             },
13628             { &hf_gsm_a_rr_reporting_quantity,
13629               { "Reporting Quantity", "gsm_a.rr.reporting_quantity",
13630                 FT_UINT8, BASE_DEC, NULL, 0x00,
13631                 NULL, HFILL }
13632             },
13633             { &hf_gsm_a_rr_3g_priority_param_desc_utran_start,
13634               { "UTRAN Start", "gsm_a.rr.3g_priority.utran_start",
13635                 FT_BOOLEAN, BASE_NONE, TFS(&priority_utran_start), 0x00,
13636                 NULL, HFILL }
13637             },
13638             { &hf_gsm_a_rr_3g_priority_param_desc_utran_stop,
13639               { "UTRAN Stop", "gsm_a.rr.3g_priority.utran_stop",
13640                 FT_BOOLEAN, BASE_NONE, TFS(&priority_utran_stop), 0x00,
13641                 NULL, HFILL }
13642             },
13643             { &hf_gsm_a_rr_3g_priority_param_desc_default_utran_prio,
13644               { "DEFAULT_UTRAN_PRIORITY", "gsm_a.rr.3g_priority.default_utran_prio",
13645                 FT_UINT8, BASE_DEC, NULL, 0x00,
13646                 NULL, HFILL }
13647             },
13648             { &hf_gsm_a_rr_3g_priority_param_desc_default_threshold_utran,
13649               { "DEFAULT_THRESH_UTRAN", "gsm_a.rr.3g_priority.default_threshold_utran",
13650                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_thresh_utran_eutran_high_low), 0x00,
13651                 NULL, HFILL }
13652             },
13653             { &hf_gsm_a_rr_3g_priority_param_desc_default_utran_qrxlevmin,
13654               { "DEFAULT_UTRAN_QRXLEVMIN", "gsm_a.rr.3g_priority.default_utran_qrxlevmin",
13655                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_utran_qrxlevmin), 0x00,
13656                 NULL, HFILL }
13657             },
13658             { &hf_gsm_a_rr_utran_frequency_index,
13659               { "UTRAN Frequency Index", "gsm_a.rr.3g_priority.utran_frequency_index",
13660                 FT_UINT8, BASE_DEC, NULL, 0x00,
13661                 NULL, HFILL }
13662             },
13663             { &hf_gsm_a_rr_utran_priority,
13664               { "UTRAN_PRIORITY", "gsm_a.rr.3g_priority.utran_priority",
13665                 FT_UINT8, BASE_DEC, NULL, 0x00,
13666                 NULL, HFILL }
13667             },
13668             { &hf_gsm_a_rr_thresh_utran_high,
13669               { "THRESH_UTRAN_high", "gsm_a.rr.3g_priority.thres_utran_high",
13670                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_thresh_utran_eutran_high_low), 0x00,
13671                 NULL, HFILL }
13672             },
13673             { &hf_gsm_a_rr_thresh_utran_low,
13674               { "THRESH_UTRAN_low", "gsm_a.rr.3g_priority.thres_utran_low",
13675                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_thresh_utran_eutran_high_low), 0x00,
13676                 NULL, HFILL }
13677             },
13678             { &hf_gsm_a_rr_utran_qrxlevmin,
13679               { "UTRAN_QRXLEVMIN", "gsm_a.rr.3g_priority.utran_qrxlevmin",
13680                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_utran_qrxlevmin), 0x00,
13681                 NULL, HFILL }
13682             },
13683             { &hf_gsm_a_rr_eutran_ccn_active,
13684               { "E-UTRAN_CCN_ACTIVE", "gsm_a.rr.3g_priority.eutran_ccn_active",
13685                 FT_BOOLEAN, BASE_NONE, TFS(&eutran_ccn_active), 0x00,
13686                 NULL, HFILL }
13687             },
13688             { &hf_gsm_a_rr_eutran_start,
13689               { "E-UTRAN Start", "gsm_a.rr.3g_priority.eutran_start",
13690                 FT_BOOLEAN, BASE_NONE, TFS(&priority_utran_start), 0x00,
13691                 NULL, HFILL }
13692             },
13693             { &hf_gsm_a_rr_eutran_stop,
13694               { "E-UTRAN Stop", "gsm_a.rr.3g_priority.utran_stop",
13695                 FT_BOOLEAN, BASE_NONE, TFS(&priority_utran_stop), 0x00,
13696                 NULL, HFILL }
13697             },
13698             { &hf_gsm_a_rr_qsearch_c_eutran_initial,
13699               { "Qsearch_C_E-UTRAN_Initial", "gsm_a.rr.qsearch_c_eutran_initial",
13700                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_qsearch_c_eutran_initial), 0x00,
13701                 NULL, HFILL }
13702             },
13703             { &hf_gsm_a_rr_eutran_multirat_reporting,
13704               { "E-UTRAN_MULTIRAT_REPORTING (nb of E-UTRAN cells to be included in measurement report)", "gsm_a.rr.eutran_multirat_reporting",
13705                 FT_UINT8, BASE_DEC, NULL, 0x00,
13706                 NULL, HFILL }
13707             },
13708             { &hf_gsm_a_rr_eutran_fdd_reporting_threshold_rsrp,
13709               { "E-UTRAN_FDD_REPORTING_THRESHOLD", "gsm_a.rr.eutran_fdd_reporting_threshold_rsrp",
13710                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_lte_rsrp_reporting_threshold_vals), 0x00,
13711                 NULL, HFILL }
13712             },
13713             { &hf_gsm_a_rr_eutran_fdd_reporting_threshold_rsrq,
13714               { "E-UTRAN_FDD_REPORTING_THRESHOLD", "gsm_a.rr.eutran_fdd_reporting_threshold_rsrq",
13715                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_lte_rsrq_reporting_threshold_vals), 0x00,
13716                 NULL, HFILL }
13717             },
13718             { &hf_gsm_a_rr_eutran_fdd_reporting_threshold_2,
13719               { "E-UTRAN_FDD_REPORTING_THRESHOLD_2", "gsm_a.rr.eutran_fdd_reporting_threshold_2",
13720                 FT_UINT8, BASE_DEC, NULL, 0x00,
13721                 NULL, HFILL }
13722             },
13723             { &hf_gsm_a_rr_eutran_fdd_reporting_offset,
13724               { "E-UTRAN_FDD_REPORTING_OFFSET", "gsm_a.rr.eutran_fdd_reporting_offset",
13725                 FT_UINT8, BASE_DEC, NULL, 0x00,
13726                 NULL, HFILL }
13727             },
13728             { &hf_gsm_a_rr_eutran_tdd_reporting_threshold_rsrp,
13729               { "E-UTRAN_TDD_REPORTING_THRESHOLD", "gsm_a.rr.eutran_tdd_reporting_threshold_rsrp",
13730                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_lte_rsrp_reporting_threshold_vals), 0x00,
13731                 NULL, HFILL }
13732             },
13733             { &hf_gsm_a_rr_eutran_tdd_reporting_threshold_rsrq,
13734               { "E-UTRAN_TDD_REPORTING_THRESHOLD", "gsm_a.rr.eutran_tdd_reporting_threshold_rsrq",
13735                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_lte_rsrq_reporting_threshold_vals), 0x00,
13736                 NULL, HFILL }
13737             },
13738             { &hf_gsm_a_rr_eutran_tdd_reporting_threshold_2,
13739               { "E-UTRAN_TDD_REPORTING_THRESHOLD_2", "gsm_a.rr.eutran_tdd_reporting_threshold_2",
13740                 FT_UINT8, BASE_DEC, NULL, 0x00,
13741                 NULL, HFILL }
13742             },
13743             { &hf_gsm_a_rr_eutran_tdd_reporting_offset,
13744               { "E-UTRAN_TDD_REPORTING_OFFSET", "gsm_a.rr.eutran_tdd_reporting_offset",
13745                 FT_UINT8, BASE_DEC, NULL, 0x00,
13746                 NULL, HFILL }
13747             },
13748             { &hf_gsm_a_rr_eutran_fdd_measurement_report_offset,
13749               { "E-UTRAN_FDD_MEASUREMENT_REPORT_OFFSET", "gsm_a.rr.eutran_fdd_measurement_report_offset",
13750                 FT_UINT8, BASE_DEC, NULL, 0x00,
13751                 NULL, HFILL }
13752             },
13753             { &hf_gsm_a_rr_eutran_tdd_measurement_report_offset,
13754               { "E-UTRAN_TDD_MEASUREMENT_REPORT_OFFSET", "gsm_a.rr.eutran_tdd_measurement_report_offset",
13755                 FT_UINT8, BASE_DEC, NULL, 0x00,
13756                 NULL, HFILL }
13757             },
13758             { &hf_gsm_a_rr_reporting_granularity,
13759               { "REPORTING_GRANULARITY", "gsm_a.rr.reporting_granularity",
13760                 FT_UINT8, BASE_DEC, NULL, 0x00,
13761                 NULL, HFILL }
13762             },
13763             { &hf_gsm_a_rr_eutran_default_measurement_control_eutran,
13764               { "DEFAULT_Measurement_Control_E-UTRAN", "gsm_a.rr.eutran_default_measurement_control_eutran",
13765                 FT_UINT8, BASE_DEC, NULL, 0x00,
13766                 NULL, HFILL }
13767             },
13768             { &hf_gsm_a_rr_eutran_measurement_control_eutran,
13769               { "Measurement_Control_E-UTRAN", "gsm_a.rr.eutran_measurement_control_eutran",
13770                 FT_BOOLEAN, BASE_NONE, TFS(&measurement_control_eutran), 0x00,
13771                 NULL, HFILL }
13772             },
13773             { &hf_gsm_a_rr_qsearch_p_eutran,
13774               { "Qsearch_P_E-UTRAN", "gsm_a.rr.qsearch_p_eutran",
13775                 FT_UINT8, BASE_DEC, NULL, 0x00,
13776                 NULL, HFILL }
13777             },
13778             { &hf_gsm_a_rr_serving_cell_priority_param_geran_priority,
13779               { "GERAN_PRIORITY", "gsm_a.rr.serving_cell_priority_param_geran_priority",
13780                 FT_UINT8, BASE_DEC, NULL, 0x00,
13781                 NULL, HFILL }
13782             },
13783             { &hf_gsm_a_rr_serving_cell_priority_param_thresh_prio_search,
13784               { "THRESH_Priority_Search", "gsm_a.rr.serving_cell_priority_param_thresh_prio_search",
13785                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_serving_cell_thresh_priority_search), 0x00,
13786                 NULL, HFILL }
13787             },
13788             { &hf_gsm_a_rr_serving_cell_priority_param_thresh_gsm_low,
13789               { "THRESH_GSM_low", "gsm_a.rr.serving_cell_priority_param_thresh_gsm_low",
13790                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_serving_cell_thresh_gsm_low), 0x00,
13791                 NULL, HFILL }
13792             },
13793             { &hf_gsm_a_rr_serving_cell_priority_param_h_prio,
13794               { "H_PRIO", "gsm_a.rr.serving_cell_priority_param_h_prio",
13795                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_serving_cell_priority_param_h_prio), 0x00,
13796                 NULL, HFILL }
13797             },
13798             { &hf_gsm_a_rr_serving_cell_priority_param_t_reselection,
13799               { "T_Reselection", "gsm_a.rr.serving_cell_priority_param_t_reselection",
13800                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_serving_cell_priority_param_t_reselection), 0x00,
13801                 NULL, HFILL }
13802             },
13803             { &hf_gsm_a_rr_eutran_earfcn,
13804               { "EARFCN", "gsm_a.rr.earfcn",
13805                 FT_UINT16, BASE_DEC, NULL, 0x00,
13806                 NULL, HFILL }
13807             },
13808             { &hf_gsm_a_rr_eutran_measurement_bandwidth,
13809               { "Measurement Bandwidth", "gsm_a.rr.eutran_measurement_bandwidth",
13810                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_eutran_measurement_bandwidth), 0x00,
13811                 NULL, HFILL }
13812             },
13813             { &hf_gsm_a_rr_eutran_priority,
13814               { "E-UTRAN_PRIORITY", "gsm_a.rr.eutran_priority",
13815                 FT_UINT8, BASE_DEC, NULL, 0x00,
13816                 NULL, HFILL }
13817             },
13818             { &hf_gsm_a_rr_thresh_eutran_high,
13819               { "THRESH_EUTRAN_high", "gsm_a.rr.thresh_eutran_high",
13820                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_thresh_utran_eutran_high_low), 0x00,
13821                 NULL, HFILL }
13822             },
13823             { &hf_gsm_a_rr_thresh_eutran_low,
13824               { "THRESH_EUTRAN_low", "gsm_a.rr.thresh_eutran_low",
13825                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_thresh_utran_eutran_high_low), 0x00,
13826                 NULL, HFILL }
13827             },
13828             { &hf_gsm_a_rr_eutran_qrxlevmin,
13829               { "E-UTRAN_QRXLEVMIN", "gsm_a.rr.eutran_qrxlevmin",
13830                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_eutran_qrxlevmin), 0x00,
13831                 NULL, HFILL }
13832             },
13833             { &hf_gsm_a_rr_eutran_pcid,
13834               { "PCID", "gsm_a.rr.pcid",
13835                 FT_UINT16, BASE_DEC, NULL, 0x00,
13836                 NULL, HFILL }
13837             },
13838             { &hf_gsm_a_rr_eutran_pcid_bitmap_group,
13839               { "PCID_BITMAP_GROUP", "gsm_a.rr.pcid_bitmap_group",
13840                 FT_UINT8, BASE_DEC, NULL, 0x00,
13841                 NULL, HFILL }
13842             },
13843             { &hf_gsm_a_rr_eutran_pcid_pattern_length,
13844               { "PCID_Pattern_length", "gsm_a.rr.pcid_pattern_length",
13845                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_pcid_psc_pattern_length), 0x00,
13846                 NULL, HFILL }
13847             },
13848 #if 0
13849             { &hf_gsm_a_rr_eutran_pcid_pattern,
13850               { "PCID_Pattern", "gsm_a.rr.pcid_pattern",
13851                 FT_UINT8, BASE_DEC, NULL, 0x00,
13852                 NULL, HFILL }
13853             },
13854 #endif
13855             { &hf_gsm_a_rr_eutran_pcid_pattern_sense,
13856               { "PCID_pattern_sense", "gsm_a.rr.pcid_pattern_sense",
13857                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_pcid_pattern_sense), 0x00,
13858                 NULL, HFILL }
13859             },
13860             { &hf_gsm_a_rr_eutran_frequency_index,
13861               { "E-UTRAN_FREQUENCY_INDEX", "gsm_a.rr.eutran_frequency_index",
13862                 FT_UINT8, BASE_DEC, NULL, 0x00,
13863                 NULL, HFILL }
13864             },
13865             { &hf_gsm_a_rr_psc,
13866               { "PSC", "gsm_a.rr.psc",
13867                 FT_UINT16, BASE_DEC, NULL, 0x00,
13868                 NULL, HFILL }
13869             },
13870             { &hf_gsm_a_rr_utran_psc_pattern_length,
13871               { "PSC_Pattern_length", "gsm_a.rr.psc_pattern_length",
13872                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_pcid_psc_pattern_length), 0x00,
13873                 NULL, HFILL }
13874             },
13875             { &hf_gsm_a_rr_utran_psc_pattern_sense,
13876               { "PSC_pattern_sense", "gsm_a.rr.psc_pattern_sense",
13877                 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
13878                 NULL, HFILL }
13879             },
13880             { &hf_gsm_a_rr_utran_csg_fdd_uarfcn,
13881               { "CSG FDD UARFCN", "gsm_a.rr.utran_csg_fdd_uarfcn",
13882                 FT_UINT16, BASE_DEC,  NULL, 0x0000,
13883                 NULL, HFILL }
13884             },
13885             { &hf_gsm_a_rr_utran_csg_tdd_uarfcn,
13886               { "CSG TDD UARFCN", "gsm_a.rr.utran_csg_tdd_uarfcn",
13887                 FT_UINT16, BASE_DEC,  NULL, 0x0000,
13888                 NULL, HFILL }
13889             },
13890             { &hf_gsm_a_rr_csg_earfcn,
13891               { "CSG_EARFCN", "gsm_a.rr.csg_earfcn",
13892                 FT_UINT16, BASE_DEC, NULL, 0x00,
13893                 NULL, HFILL }
13894             },
13895             { &hf_gsm_a_rr_3g_control_param_desc_meas_ctrl_utran,
13896               { "PCID_pattern_sense", "gsm_a.rr.meas_ctrl_utran",
13897                 FT_BOOLEAN, BASE_NONE, TFS(&measurement_control_utran), 0x00,
13898                 NULL, HFILL }
13899             },
13900             { &hf_gsm_a_rr_extended_ra,
13901               { "Extended_RA", "gsm_a.rr.extended_ra",
13902                 FT_UINT8, BASE_DEC, NULL, 0x00,
13903                 NULL, HFILL }
13904             },
13905             { &hf_gsm_a_rr_access_tech_type,
13906               { "Access_Technology_Type", "gsm_a.rr.access_tech_type",
13907                 FT_UINT8, BASE_DEC, VALS(gsm_a_access_tech_type_vals), 0x00,
13908                 NULL, HFILL }
13909             },
13910             { &hf_gsm_a_rr_tfi_assignment,
13911               { "TFI_Assignment", "gsm_a.rr.tfi_assignment",
13912                 FT_UINT8, BASE_DEC, NULL, 0x00,
13913                 NULL, HFILL }
13914             },
13915             { &hf_gsm_a_rr_polling,
13916               { "Polling", "gsm_a.rr.polling",
13917                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_polling_vals), 0x00,
13918                 NULL, HFILL }
13919             },
13920             { &hf_gsm_a_rr_usf,
13921               { "USF", "gsm_a.rr.usf",
13922                 FT_UINT8, BASE_DEC, NULL, 0x00,
13923                 NULL, HFILL }
13924             },
13925             { &hf_gsm_a_rr_usf_granularity,
13926               { "USF_granularity", "gsm_a.rr.usf_granularity",
13927                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_usf_granularity_vals), 0x00,
13928                 NULL, HFILL }
13929             },
13930             { &hf_gsm_a_rr_p0,
13931               { "P0", "gsm_a.rr.p0",
13932                 FT_UINT8, BASE_DEC, NULL, 0x00,
13933                 NULL, HFILL }
13934             },
13935             { &hf_gsm_a_rr_pr_mode,
13936               { "pr_mode", "gsm_a.rr.pr_mode",
13937                 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
13938                 NULL, HFILL }
13939             },
13940             { &hf_gsm_a_rr_egprs_mcs,
13941               { "Egprs_Modulation_and_Coding_Scheme", "gsm_a.rr.egprs_mcs",
13942                 FT_UINT8, BASE_DEC, VALS(gsm_a_egprs_mcs_vals), 0x00,
13943                 NULL, HFILL }
13944             },
13945             { &hf_gsm_a_rr_tlli_block_channel_coding,
13946               { "TLLI_Block_Channel_Coding", "gsm_a.rr.tlli_block_cs",
13947                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_tlli_block_channel_coding_vals), 0x00,
13948                 NULL, HFILL }
13949             },
13950             { &hf_gsm_a_rr_bep_period2,
13951               { "Bep_Period2", "gsm_a.rr.bep_period2",
13952                 FT_UINT8, BASE_DEC, NULL, 0x00,
13953                 NULL, HFILL }
13954             },
13955             { &hf_gsm_a_rr_resegment,
13956               { "Resegment", "gsm_a.rr.resegment",
13957                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_resegment_vals), 0x00,
13958                 NULL, HFILL }
13959             },
13960             { &hf_gsm_a_rr_egprs_window_size,
13961               { "Egprs_Windows_Size", "gsm_a.rr.egprs_win_size",
13962                 FT_UINT8, BASE_DEC, VALS(gsm_a_egprs_windows_size_vals), 0x00,
13963                 NULL, HFILL }
13964             },
13965             { &hf_gsm_a_rr_gamma,
13966               { "Gamma", "gsm_a.rr.gamma",
13967                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_gamma_vals), 0x00,
13968                 NULL, HFILL }
13969             },
13970             { &hf_gsm_a_rr_timing_adv_index,
13971               { "Timing_Advance_Index", "gsm_a.rr.timing_adv_idx",
13972                 FT_UINT8, BASE_DEC, NULL, 0x00,
13973                 NULL, HFILL }
13974             },
13975             { &hf_gsm_a_rr_tbf_starting_time,
13976               { "TBF_Starting_Time", "gsm_a.rr.tvf_start_time",
13977                 FT_UINT16, BASE_DEC, NULL, 0x00,
13978                 NULL, HFILL }
13979             },
13980             { &hf_gsm_a_rr_num_of_radio_block_allocated,
13981               { "Number_of_Radio_Block_Allocated", "gsm_a.rr.num_of_radio_blk_allocated",
13982                 FT_UINT8, BASE_DEC, NULL, 0x00,
13983                 NULL, HFILL }
13984             },
13985             { &hf_gsm_a_rr_pfi,
13986               { "PFI", "gsm_a.rr.pfi",
13987                 FT_UINT8, BASE_DEC, NULL, 0x00,
13988                 NULL, HFILL }
13989             },
13990             { &hf_gsm_a_rr_mbms_service_id,
13991               { "MBMS_Service_ID", "gsm_a.rr.mbms_service_id",
13992                 FT_UINT32, BASE_DEC, NULL, 0x00,
13993                 NULL, HFILL }
13994             },
13995             { &hf_gsm_a_rr_ms_id,
13996               { "MS_ID", "gsm_a.rr.ms_id",
13997                 FT_UINT8, BASE_DEC, NULL, 0x00,
13998                 NULL, HFILL }
13999             },
14000             { &hf_gsm_a_rr_timing_adv_timeslot_num,
14001               { "Timing_Advance_Timeslot_Number", "gsm_a.rr.timing_adv_ts",
14002                 FT_UINT8, BASE_DEC, NULL, 0x00,
14003                 NULL, HFILL }
14004             },
14005             { &hf_gsm_a_rr_gprs_cs,
14006               { "Channel_Coding_Command", "gsm_a.rr.gprs_cs",
14007                 FT_UINT8, BASE_DEC, VALS(gsm_a_gprs_cs_vals), 0x00,
14008                 NULL, HFILL }
14009             },
14010             { &hf_gsm_a_rr_rlc_mode,
14011               { "RLC_Mode", "gsm_a.rr.rlc_mode",
14012                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rlc_mode_vals), 0x00,
14013                 NULL, HFILL }
14014             },
14015             { &hf_gsm_a_rr_ta_valid,
14016               { "TA_Valid", "gsm_a.rr.ta_valid",
14017                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_ta_valid_vals), 0x00,
14018                 NULL, HFILL }
14019             },
14020             { &hf_gsm_a_rr_link_quality_meas_mode,
14021               { "Link_Quality_Measure_Mode", "gsm_a.rr.link_qual_meas_mode",
14022                 FT_UINT8, BASE_DEC, VALS(gsm_a_link_quality_meas_mode_vals), 0x00,
14023                 NULL, HFILL }
14024             },
14025             { &hf_gsm_a_rr_emr_bitmap_length,
14026               { "BITMAP_LENGTH", "gsm_a.rr.emr_bitmap_len",
14027                 FT_UINT8, BASE_DEC, NULL, 0x00,
14028                 NULL, HFILL }
14029             },
14030             { &hf_gsm_a_rr_eutran_mr_n_eutran,
14031               { "N_E-UTRAN", "gsm_a.rr.eutran_mr_n_eutran",
14032                 FT_UINT8, BASE_DEC, NULL, 0x00,
14033                 NULL, HFILL }
14034             },
14035             { &hf_gsm_a_rr_eutran_mr_freq_idx,
14036               { "E-UTRAN_FREQUENCY_INDEX", "gsm_a.rr.eutran_mr_freq_idx",
14037                 FT_UINT8, BASE_DEC, NULL, 0x00,
14038                 NULL, HFILL }
14039             },
14040             { &hf_gsm_a_rr_eutran_mr_cell_id,
14041               { "CELL IDENTITY", "gsm_a.rr.eutran_mr_cell_id",
14042                 FT_UINT16, BASE_DEC, NULL, 0x00,
14043                 NULL, HFILL }
14044             },
14045             { &hf_gsm_a_rr_eutran_mr_rpt_quantity,
14046               { "REPORTING_QUANTITY", "gsm_a.rr.eutran_mr_rpt_quantity",
14047                 FT_UINT8, BASE_DEC, NULL, 0x00,
14048                 NULL, HFILL }
14049             },
14050             { &hf_gsm_a_rr_ma_channel_set,
14051               { "Channel Set", "gsm_a.rr.ma_channel_set",
14052                 FT_UINT8, BASE_HEX, NULL, 0x00,
14053                 NULL, HFILL }
14054             },
14055             { &hf_n_range_orig_arfcn,
14056               { "ORIG-ARFCN", "gsm_a.rr.orig_arfcn",
14057                 FT_UINT16, BASE_DEC, NULL, 0x00,
14058                 NULL, HFILL }
14059             },
14060             { &hf_gsm_a_rr_peo_bcch_change_mark,
14061               { "PEO BCCH CHANGE MARK", "gsm_a.rr.peo_bcch_change_mark",
14062                 FT_UINT8, BASE_DEC, NULL, 0x00,
14063                 NULL, HFILL }
14064             },
14065             { &hf_gsm_a_rr_feat_ind_cs_ir,
14066               { "CS IR","gsm_a.rr.feature_indicator.cs_ir",
14067                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_feat_ind_cs_ir), 0x00,
14068                 NULL, HFILL }
14069             },
14070             { &hf_gsm_a_rr_feat_ind_ps_ir,
14071               { "pS IR","gsm_a.rr.feature_indicator.cs_ir",
14072                 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_feat_ind_ps_ir), 0x00,
14073                 NULL, HFILL }
14074             },
14075             /* ---> EC <---*/
14076             { &hf_gsm_a_rr_ec_qhfi,
14077               { "QUARTER_HYPERFRAME_INDICATOR", "gsm_a.rr.ec_quarter_hyperframe_indicator",
14078                 FT_UINT8, BASE_DEC, NULL, 0x00,
14079                 NULL, HFILL }
14080             },
14081             { &hf_gsm_a_rr_ec_dl_cc,
14082               { "DL_COVERAGE_CLASS", "gsm_a.rr.ec_dl_cc",
14083                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_ec_cc_vals), 0x00,
14084                 NULL, HFILL }
14085             },
14086             { &hf_gsm_a_rr_ec_ul_cc,
14087               { "UL_COVERAGE_CLASS", "gsm_a.rr.ec_ul_cc",
14088                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_ec_cc_vals), 0x00,
14089                 NULL, HFILL }
14090             },
14091             { &hf_gsm_a_rr_tsc_set,
14092               { "TSC Set", "gsm_a.rr.tsc_set",
14093                 FT_UINT8, BASE_DEC, NULL, 0x00,
14094                 NULL, HFILL }
14095             },
14096             { &hf_gsm_a_rr_ec_tsc,
14097               { "TSC (EC)", "gsm_a.rr.ec_tsc",
14098                 FT_UINT8, BASE_DEC, NULL, 0x00,
14099                 NULL, HFILL }
14100             },
14101             { &hf_gsm_a_rr_ec_ma_number,
14102               { "MA_NUMBER", "gsm_a.rr.ma_number",
14103                 FT_UINT8, BASE_CUSTOM, CF_FUNC(gsm_a_rr_ec_ma_number_fmt), 0x00,
14104                 NULL, HFILL }
14105             },
14106             { &hf_gsm_a_rr_ec_enhanced_access_burst,
14107               { "ENHANCED_ACCESS_BURST", "gsm_a.rr.ec_enhanced_access_burst",
14108                 FT_BOOLEAN, BASE_NONE, TFS(&tfs_shall_be_shall_not_be_used), 0x0,
14109                 NULL, HFILL
14110               }
14111             },
14112             { &hf_gsm_a_rr_ec_starting_ul_timeslot,
14113               { "STARTING_UL_TIMESLOT", "gsm_a.rr.ec_starting_ul_timeslot",
14114                 FT_UINT8, BASE_DEC, NULL, 0x0,
14115                 NULL, HFILL
14116               }
14117             },
14118             { &hf_gsm_a_rr_ec_starting_dl_timeslot,
14119               { "STARTING_DL_TIMESLOT", "gsm_a.rr.ec_starting_dl_timeslot",
14120                 FT_UINT8, BASE_DEC, NULL, 0x0,
14121                 NULL, HFILL
14122               }
14123             },
14124             { &hf_gsm_a_rr_ec_starting_dl_timeslot_offset,
14125               { "STARTING_DL_TIMESLOT_OFFSET", "gsm_a.rr.ec_starting_dl_timeslot_offset",
14126                 FT_UINT8, BASE_DEC, NULL, 0x0,
14127                 NULL, HFILL
14128               }
14129             },
14130             { &hf_gsm_a_rr_ec_starting_ul_timeslot_offset,
14131               { "STARTING_UL_TIMESLOT_OFFSET", "gsm_a.rr.ec_starting_ul_timeslot_offset",
14132                 FT_UINT8, BASE_DEC, NULL, 0x0,
14133                 NULL, HFILL
14134               }
14135             },
14136             { &hf_gsm_a_rr_ec_overlaid_cdma_code,
14137               { "OVERLAID_CDMA_CODE", "gsm_a.rr.ec_overlaid_cdma_code",
14138                 FT_UINT8, BASE_DEC, NULL, 0x0,
14139                 NULL, HFILL
14140               }
14141             },
14142             { &hf_gsm_a_rr_ec_mcs_exist,
14143               { "MCS Exist (EC)", "gsm_a.rr.ec_mcs_exist",
14144                 FT_UINT8, BASE_DEC, NULL, 0x0,
14145                 NULL, HFILL
14146               }
14147             },
14148             { &hf_gsm_a_rr_ec_start_first_ul_data_block,
14149               { "START_FIRST_UL_DATA_BLOCK", "gsm_a.rr.ec_start_first_ul_data_block",
14150                 FT_UINT8, BASE_DEC, NULL, 0x0,
14151                 NULL, HFILL
14152               }
14153             },
14154             { &hf_gsm_a_rr_ec_fua_gap_list,
14155               { "FUA_GAP List", "gsm_a.rr.ec_fua_gap_list",
14156                 FT_UINT8, BASE_DEC, NULL, 0x0,
14157                 NULL, HFILL
14158               }
14159             },
14160             { &hf_gsm_a_rr_ec_start_fn_next_data_block_exist,
14161               { "START_FN_NEXT_DATA_BLOCK Present", "gsm_a.rr.ec_start_fn_next_data_block_exist",
14162                 FT_UINT8, BASE_DEC, NULL, 0x0,
14163                 NULL, HFILL
14164               }
14165             },
14166             { &hf_gsm_a_rr_ec_start_fn_next_data_block,
14167               { "START_FN_NEXT_DATA_BLOCK", "gsm_a.rr.ec_start_fn_next_data_block",
14168                 FT_UINT8, BASE_DEC, NULL, 0x0,
14169                 NULL, HFILL
14170               }
14171             },
14172             { &hf_gsm_a_dtap_msg_rr_ec_ccch_type,
14173               { "DTAP Radio Resources Management Message Type (EC)", "gsm_a.dtap.msg_rr_ec_ccch_type",
14174                 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_rr_ec_ccch_strings), 0x0,
14175                 NULL, HFILL }
14176             },
14177
14178             { &hf_gsm_a_rr_ec_used_dl_cc,
14179               { "USED_DL_COVERAGE_CLASS", "gsm_a.rr.ec_used_dl_cc",
14180                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_ec_cc_vals), 0x0,
14181                 NULL, HFILL
14182               }
14183             },
14184             { &hf_gsm_a_rr_ec_page_extension_exist,
14185               { "EC_PAGE_EXTENSION Exist", "gsm_a.rr.ec_page_extension_exist",
14186                 FT_UINT8, BASE_DEC, NULL, 0x0,
14187                 NULL, HFILL
14188               }
14189             },
14190             { &hf_gsm_a_rr_ec_page_extension,
14191               { "EC_PAGE_EXTENSION", "gsm_a.rr.ec_page_extension",
14192                 FT_UINT8, BASE_DEC, NULL, 0x0,
14193                 NULL, HFILL
14194               }
14195             },
14196             { &hf_gsm_a_rr_ec_last_tdma_frame,
14197               { "Last TDMA Frame", "gsm_a.rr.ec_last_tdma_frame",
14198                 FT_UINT16, BASE_DEC, NULL, 0x0,
14199                 NULL, HFILL
14200               }
14201             },
14202             { &hf_gsm_a_rr_ec_echoed_random_bits,
14203               { "Echoed Random Bits", "gsm_a.rr.ec_echoed_random_bits",
14204                 FT_UINT8, BASE_DEC, NULL, 0x0,
14205                 NULL, HFILL
14206               }
14207             },
14208             { &hf_gsm_a_rr_ec_wait_timer,
14209               { "EC-Wait Timer", "gsm_a.rr.ec_wait_timer",
14210                 FT_UINT8, BASE_DEC, NULL, 0x0,
14211                 NULL, HFILL
14212               }
14213             },
14214             { &hf_gsm_a_rr_ec_req_ref_2_present,
14215               { "EC Request Reference 2 Exist", "gsm_a.rr.ec_request_reference_2_exist",
14216                 FT_UINT8, BASE_DEC, NULL, 0x0,
14217                 NULL, HFILL
14218               }
14219             },
14220             { &hf_gsm_a_rr_ec_req_ref_3_present,
14221               { "EC Request Reference 3 Exist", "gsm_a.rr.ec_request_reference_3_exist",
14222                 FT_UINT8, BASE_DEC, NULL, 0x0,
14223                 NULL, HFILL
14224               }
14225             },
14226             { &hf_gsm_a_rr_ec_ptmsi_imsi_select,
14227               { "Mobile Identity", "gsm_a.rr.ec_ptmsi_imsi_select",
14228                 FT_BOOLEAN, BASE_NONE, TFS(&tfs_ec_ptmsi_imsi), 0x0,
14229                 NULL, HFILL
14230               }
14231             },
14232             { &hf_gsm_a_rr_ec_imsi_digits,
14233               { "Number of IMSI Digits", "gsm_a.rr.ec_imsi_digits",
14234                 FT_UINT8, BASE_DEC, NULL, 0x0,
14235                 NULL, HFILL
14236               }
14237             },
14238             { &hf_gsm_a_rr_ec_imsi,
14239               { "IMSI", "gsm_a.rr.ec_imsi",
14240                 FT_STRING, STR_ASCII, NULL, 0x0,
14241                 NULL, HFILL
14242               }
14243             },
14244             { &hf_gsm_a_rr_ec_mobile_identity_2_exist,
14245               { "EC Mobile Identity 2 Exist", "gsm_a.rr.ec_mobile_identity_2_exist",
14246                 FT_UINT8, BASE_DEC, NULL, 0x0,
14247                 NULL, HFILL
14248               }
14249             },
14250             { &hf_gsm_a_rr_ec_cc1_timeslot_multiplier,
14251               { "EC CC1 Timeslot Multiplier", "gsm_a.rr.ec_cc1_ts_multiplier",
14252                 FT_UINT8, BASE_DEC, NULL, 0x0,
14253                 NULL, HFILL
14254               }
14255             },
14256             { &hf_gsm_a_rr_ec_alpha_enable,
14257               { "EC ALPHA Enable", "gsm_a.rr.ec_alpha_enable",
14258                 FT_UINT8, BASE_DEC, NULL, 0x0,
14259                 NULL, HFILL
14260               }
14261             },
14262             { &hf_gsm_a_rr_rcc,
14263               { "RCC", "gsm_a.rr_rcc",
14264                 FT_UINT8, BASE_DEC, NULL, 0x00,
14265                 NULL, HFILL
14266               }
14267             },
14268             { &hf_gsm_a_rr_implicit_reject_cs,
14269                 { "Implicit Reject CS", "gsm_a.rr.implicit_reject_cs",
14270                   FT_UINT8, BASE_DEC, VALS(gsm_a_rr_implicit_reject_cs_vals), 0x00,
14271                   NULL, HFILL }
14272               },
14273             { &hf_gsm_a_rr_implicit_reject_ps,
14274                 { "Implicit Reject PS", "gsm_a.rr.implicit_reject_ps",
14275                   FT_UINT8, BASE_DEC, VALS(gsm_a_rr_implicit_reject_ps_vals), 0x00,
14276                   NULL, HFILL }
14277               },
14278             { &hf_gsm_a_rr_peo_dsc,
14279               { "PEO DSC", "gsm_a.rr.peo_dsc",
14280                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_peo_dsc_vals), 0x00,
14281                 NULL, HFILL }
14282             },
14283             { &hf_gsm_a_rr_c1_delta_min,
14284               { "C1 DELTA MIN value", "gsm_a.rr.c1_delta_min",
14285                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_c1_delta_min_vals), 0x00,
14286                 NULL, HFILL }
14287             },
14288             { &hf_gsm_a_rr_c1_delta_max,
14289               { "C1 DELTA MAX value", "gsm_a.rr.c1_delta_max",
14290                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_c1_delta_max_vals), 0x00,
14291                 NULL, HFILL }
14292             },
14293             { &hf_gsm_a_rr_reported_timeslots,
14294               { "REPORTED TIMESLOTS", "gsm_a.rr.reported_timeslots",
14295                 FT_UINT8, BASE_DEC, NULL, 0x00,
14296                 NULL, HFILL
14297               }
14298             },
14299             { &hf_gsm_a_rr_tsh,
14300               { "TSH", "gsm_a.rr.tsh",
14301                 FT_UINT8, BASE_DEC, NULL, 0x00,
14302                 NULL, HFILL
14303               }
14304             },
14305             { &hf_gsm_a_rr_rtti_usf_mode,
14306               { "RTTI USF Mode", "gsm_a.rr.rtti_usf_mode",
14307                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_rtti_usf_mode_vals), 0x00,
14308                 NULL, HFILL
14309               }
14310             },
14311             { &hf_gsm_a_rr_pdch_pair_indic,
14312               { "PDCH PAIR INDICATION", "gsm_a.rr.pdch_pair_indic",
14313                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_pdch_pair_indic_vals), 0x00,
14314                 NULL, HFILL
14315               }
14316             },
14317             { &hf_gsm_a_rr_additional_usf,
14318               { "Additional USF", "gsm_a.rr.additional_usf",
14319                 FT_UINT8, BASE_DEC, NULL, 0x00,
14320                 NULL, HFILL
14321               }
14322             },
14323             { &hf_gsm_a_rr_usf_2,
14324               { "USF2", "gsm_a.rr.usf_2",
14325                 FT_UINT8, BASE_DEC, NULL, 0x00,
14326                 NULL, HFILL
14327               }
14328             },
14329             { &hf_gsm_a_rr_additional_usf_2,
14330               { "Additional USF2", "gsm_a.rr.additional_usf_2",
14331                 FT_UINT8, BASE_DEC, NULL, 0x00,
14332                 NULL, HFILL
14333               }
14334             },
14335             { &hf_gsm_a_rr_npm_transfer_time,
14336               { "NPM Transfer Time", "gsm_a.rr.npm_transfer_time",
14337                 FT_UINT8, BASE_DEC, NULL, 0x00,
14338                 NULL, HFILL
14339               }
14340             },
14341             { &hf_gsm_a_rr_event_based_fanr,
14342               { "EVENT BASED FANR", "gsm_a.rr.event_base_fanr",
14343                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_event_based_fanr_vals), 0x00,
14344                 NULL, HFILL
14345               }
14346             },
14347             { &hf_gsm_a_rr_dl_egprs_level,
14348               { "Downlink EGPRS Level", "gsm_a.rr.dl_egprs_level",
14349                 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_egprs_level_vals), 0x00,
14350                 NULL, HFILL
14351               }
14352             },
14353
14354             /* Generated from convert_proto_tree_add_text.pl */
14355             { &hf_gsm_a_rr_padding, { "Padding Bits", "gsm_a.rr.padding_bits", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
14356             { &hf_gsm_a_rr_nr_of_fdd_cells, { "Nr of FDD Cells", "gsm_a.rr.nr_of_fdd_cells", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14357             { &hf_gsm_a_rr_scrambling_code, { "Scrambling Code", "gsm_a.rr.scrambling_code", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14358             { &hf_gsm_a_rr_diversity, { "Diversity", "gsm_a.rr.diversity", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14359             { &hf_gsm_a_rr_nr_of_tdd_cells, { "Nr of TDD Cells", "gsm_a.rr.nr_of_tdd_cells", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14360             { &hf_gsm_a_rr_cell_parameter, { "Cell Parameter", "gsm_a.rr.cell_parameter", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14361             { &hf_gsm_a_rr_sync_case_tstd, { "Sync Case TSTD", "gsm_a.rr.sync_case_tstd", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14362             { &hf_gsm_a_rr_diversity_tdd, { "Diversity TDD", "gsm_a.rr.diversity_tdd", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14363             { &hf_gsm_a_rr_packet_channel_type, { "Channel Type", "gsm_a.rr.packet_channel_type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14364             { &hf_gsm_a_rr_timeslot, { "Timeslot", "gsm_a.rr.timeslot", FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL }},
14365             { &hf_gsm_a_rr_training_sequence, { "Training Sequence", "gsm_a.rr.training_sequence", FT_UINT8, BASE_DEC, NULL, 0xE0, NULL, HFILL }},
14366             { &hf_gsm_a_rr_hopping_channel, { "Hopping Channel", "gsm_a.rr.hopping_channel", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10, NULL, HFILL }},
14367             { &hf_gsm_a_rr_hopping_channel_maio, { "Hopping channel MAIO", "gsm_a.rr.hopping_channel_maio", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14368             { &hf_gsm_a_rr_hopping_channel_ma_num_ind, { "Hopping channel MA_NUMBER_IND", "gsm_a.rr.hopping_channel_ma_num_ind", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14369             { &hf_gsm_a_rr_hopping_channel_change_mark_1, { "CHANGE_MARK_1", "gsm_a.rr.hopping_channel_change_mark_1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14370             { &hf_gsm_a_rr_extension_length, { "Extension Length", "gsm_a.rr.extension_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14371             { &hf_gsm_a_rr_bitmap_length, { "Bitmap length", "gsm_a.rr.bitmap_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14372             { &hf_gsm_a_rr_bitmap, { "Bitmap", "gsm_a.rr.bitmap", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14373             { &hf_gsm_a_rr_mobile_country_code, { "Mobile Country Code (MCC)", "gsm_a.rr.mobile_country_code", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
14374             { &hf_gsm_a_rr_mobile_network_code, { "Mobile Network Code (MNC)", "gsm_a.rr.mobile_network_code", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
14375             { &hf_gsm_a_rr_len_indicator_ms_id, { "Length Indicator of MS ID", "gsm_a.rr.len_indicator_ms_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14376             { &hf_gsm_a_rr_maio, { "MAIO", "gsm_a.rr.maio", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14377             { &hf_gsm_a_rr_ba_index_start_rtd, { "BA Index Start RTD", "gsm_a.rr.ba_index_start_rtd", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14378             { &hf_gsm_a_rr_ba_index_start_bsic, { "BA Index Start BSIC", "gsm_a.rr.ba_index_start_bsic", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14379             { &hf_gsm_a_rr_number_remaining_bsic, { "Number Remaining BSIC", "gsm_a.rr.number_remaining_bsic", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14380             { &hf_gsm_a_rr_number_cells, { "Number Cells", "gsm_a.rr.number_cells", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14381             { &hf_gsm_a_rr_pcid_pattern, { "PCID_Pattern", "gsm_a.rr.pcid_pattern", FT_UINT8, BASE_DEC, NULL, 0xFF, NULL, HFILL }},
14382             { &hf_gsm_a_rr_psc_pattern, { "PSC_Pattern", "gsm_a.rr.psc_pattern", FT_UINT8, BASE_DEC, NULL, 0xFF, NULL, HFILL }},
14383             { &hf_gsm_a_rr_where, { "Where", "gsm_a.rr.where", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14384             { &hf_gsm_a_rr_mcc, { "MCC", "gsm_a.rr.mcc", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14385             { &hf_gsm_a_rr_mnc, { "MNC", "gsm_a.rr.mnc", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14386             { &hf_gsm_a_rr_short_lsa_id, { "Short LSA ID", "gsm_a.rr.short_lsa_id", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14387             { &hf_gsm_a_rr_lsa_id, { "LSA ID", "gsm_a.rr.lsa_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14388             { &hf_gsm_a_rr_rxlev_carrier, { "RXLEV carrier", "gsm_a.rr.rxlev_carrier", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gsm_a_rr_rxlev_vals_ext, 0x0, NULL, HFILL }},
14389             { &hf_gsm_a_rr_ciphering_key_seq_num, { "Ciphering Key Sequence Number", "gsm_a.rr.ciphering_key_seq_num", FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL }},
14390             { &hf_gsm_a_rr_neighbour_cell_list_index, { "Neighbour Cell List index", "gsm_a.rr.neighbour_cell_list_index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14391             { &hf_gsm_a_rr_message_elements, { "Message Elements", "gsm_a.rr.message_elements", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
14392             { &hf_gsm_a_rr_spare, { "Spare", "gsm_a.rr.spare", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
14393             { &hf_gsm_a_rr_single_channel_arfcn, { "Single channel ARFCN", "gsm_a.rr.single_channel_arfcn", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14394             { &hf_gsm_a_rr_rtd_index, { "RTD index", "gsm_a.rr.rtd_index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14395             { &hf_gsm_a_rr_arfcn_list, { "List of ARFCNs", "gsm_a.rr.arfcn_list", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
14396             { &hf_gsm_a_rr_da_list, { "List of DA", "gsm_a.rr.da_list", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
14397             { &hf_gsm_a_rr_ua_list, { "List of UA", "gsm_a.rr.ua_list", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
14398             { &hf_gsm_a_rr_ma_bitmap, { "MA Bitmap", "gsm_a.rr.ma_bitmap", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
14399             { &hf_gsm_a_rr_inc_arfcn_bitmap, { "Bitmap of increasing ARFCNs included in the Mobile Allocation", "gsm_a.rr.inc_arfcn_bitmap", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
14400             { &hf_gsm_a_rr_ccn_supported, { "CCN Supported", "gsm_a.rr.ccn_supported", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
14401             { &hf_gsm_a_rr_pbcch_use_bcch, { "PBCCH shall use the BCCH carrier", "gsm_a.rr.pbcch_use_bcch", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
14402             { &hf_gsm_a_rr_ia_rest_oct_reserved, { "Reserved for future use (however the value 7C for the first octet shall not be used)", "gsm_a.rr.ia_rest_oct_reserved", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
14403             { &hf_gsm_a_rr_tch_facch_sacchm, { "TCH/F + FACCH/F and SACCH/M", "gsm_a.rr.tch_facch_sacchm", FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL }},
14404             { &hf_gsm_a_rr_tch_facch_sacchf, { "TCH/F + FACCH/F and SACCH/F", "gsm_a.rr.tch_facch_sacchf", FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL }},
14405             { &hf_gsm_a_rr_tch_facch_sacchm_bi, { "TCH/F + FACCH/F and SACCH/M + bi- and unidirectional channels", "gsm_a.rr.tch_facch_sacchm_bi", FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL }},
14406             { &hf_gsm_a_rr_tch_acch, { "TCH/H + ACCHs", "gsm_a.rr.tch_acch", FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL }},
14407             { &hf_gsm_a_rr_sdcch4_sdcchc4_cbch, { "SDCCH/4 + SACCH/C4 or CBCH (SDCCH/4)", "gsm_a.rr.sdcch4_sdcchc4_cbch", FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL }},
14408             { &hf_gsm_a_rr_sdcch8_sdcchc8_cbch, { "SDCCH/8 + SACCH/C8 or CBCH (SDCCH/8)", "gsm_a.rr.sdcch8_sdcchc8_cbch", FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL }},
14409             { &hf_gsm_a_rr_tch_facchf_sacchm_bi, { "TCH/F + FACCH/F and SACCH/M + bidirectional channels at timeslot", "gsm_a.rr.tch_facchf_sacchm_bi", FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL }},
14410             { &hf_gsm_a_rr_tch_facchf_sacchm_uni, { "TCH/F + FACCH/F and SACCH/M + unidirectional channels at timeslot", "gsm_a.rr.tch_facchf_sacchm_uni", FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL }},
14411             { &hf_gsm_a_rr_unknown_channel_info, { "Unknown channel information", "gsm_a.rr.unknown_channel_info", FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL }},
14412             { &hf_gsm_a_rr_tchf_acchs, { "TCH/F + ACCHs", "gsm_a.rr.tchf_acchs", FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL }},
14413             { &hf_gsm_a_rr_subchannel, { "Subchannel", "gsm_a.rr.tch_facch_sacchm", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
14414             { &hf_gsm_a_rr_w_elements, { "W elements", "gsm_a.rr.w_elements", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
14415             { &hf_gsm_a_rr_field_bit_long, { "Field is X bits long", "gsm_a.rr.field_bit_long", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
14416
14417             /* gsm_rr_csn_flag() fields */
14418             { &hf_gsm_a_rr_fdd_repeat_freq, { "Repeating FDD Frequency", "gsm_a.rr.fdd_repeat_freq", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14419             { &hf_gsm_a_rr_tdd_repeat_freq, { "Repeating TDD Frequency", "gsm_a.rr.tdd_repeat_freq", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14420             { &hf_gsm_a_rr_repeat_range_limit, { "Repeating Range Limits", "gsm_a.rr.repeat_range_limit", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14421             { &hf_gsm_a_rr_repeat_ba_frequency, { "Repeating BA Frequency", "gsm_a.rr.repeat_ba_frequency", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14422             { &hf_gsm_a_rr_band_indicator, { "Band Indicator", "gsm_a.rr.band_indicator", FT_BOOLEAN, BASE_NONE, TFS(&tfs_1900_1800), 0x00, NULL, HFILL }},
14423             { &hf_gsm_a_rr_repeat_gsm_desc, { "Repeating GSM Description struct", "gsm_a.rr.repeat_gsm_desc", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14424             { &hf_gsm_a_rr_repeat_utran_fdd_desc, { "Repeating UTRAN FDD Description struct", "gsm_a.rr.repeat_utran_fdd_desc", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14425             { &hf_gsm_a_rr_bandwidth_fdd_present, { "Bandwidth FDD", "gsm_a.rr.bandwidth_fdd_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14426             { &hf_gsm_a_rr_fdd_cell_info_present, { "FDD Cell Information", "gsm_a.rr.fdd_cell_info_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14427             { &hf_gsm_a_rr_fdd_indic0, { "FDD Indic0", "gsm_a.rr.fdd_indic0", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }},
14428             { &hf_gsm_a_rr_repeat_utran_tdd_desc, { "Repeating UTRAN TDD Description struct", "gsm_a.rr.repeat_utran_tdd_desc", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14429             { &hf_gsm_a_rr_bandwidth_tdd_present, { "Bandwidth TDD", "gsm_a.rr.bandwidth_tdd_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14430             { &hf_gsm_a_rr_tdd_cell_info_present, { "TDD Cell Information", "gsm_a.rr.tdd_cell_info_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14431             { &hf_gsm_a_rr_tdd_indic0, { "TDD Indic0", "gsm_a.rr.tdd_indic0", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }},
14432             { &hf_gsm_a_rr_pfi_present, { "PFI", "gsm_a.rr.pfi_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported_by_cell), 0x00, NULL, HFILL }},
14433             { &hf_gsm_a_rr_msms_procedures, { "MBMS procedures", "gsm_a.rr.msms_procedures", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14434             { &hf_gsm_a_rr_repeat_dynamic_arfcn_mapping, { "Repeating Dynamic ARFCN Mapping", "gsm_a.rr.repeat_dynamic_arfcn_mapping", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14435             { &hf_gsm_a_rr_pan_bits_present, { "PAN bits", "gsm_a.rr.pan_bits_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14436             { &hf_gsm_a_rr_optional_extensions_present, { "Optional Extensions", "gsm_a.rr.optional_extensions_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14437             { &hf_gsm_a_rr_egprs_supported, { "EGPRS", "gsm_a.rr.egprs_supported", FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported_by_cell), 0x00, NULL, HFILL }},
14438             { &hf_gsm_a_rr_access_tech_req, { "MBMS procedures", "gsm_a.rr.access_tech_req", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14439             { &hf_gsm_a_rr_tfi_multiblock, { "TFI/Multiblock", "gsm_a.rr.tfi_multiblock", FT_BOOLEAN, BASE_NONE, TFS(&tfs_tfi_multi_block_allocation_present), 0x00, NULL, HFILL }},
14440             { &hf_gsm_a_rr_tfi_allocation_type, { "Allocation Type", "gsm_a.rr.tfi_allocation_type", FT_BOOLEAN, BASE_NONE, TFS(&tfs_fixed_dynamic_allocation), 0x00, NULL, HFILL }},
14441             { &hf_gsm_a_rr_p0_present, { "P0", "gsm_a.rr.p0_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14442             { &hf_gsm_a_rr_bep_period2_present, { "BEP_PERIOD2", "gsm_a.rr.bep_period2.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14443             { &hf_gsm_a_rr_alpha_present, { "Alpha", "gsm_a.rr.alpha_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14444             { &hf_gsm_a_rr_timing_adv_index_present, { "Timing Advance Index", "gsm_a.rr.timing_adv_index.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14445             { &hf_gsm_a_rr_tbf_starting_time_present, { "TBF Starting Time", "gsm_a.rr.tbf_starting_time.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14446             { &hf_gsm_a_rr_bts_power_control_mode, { "BTS Power Control Mode", "gsm_a.rr.bts_power_control_mode", FT_BOOLEAN, BASE_NONE, TFS(&tfs_mode_b_mode_a), 0x00, NULL, HFILL }},
14447             { &hf_gsm_a_rr_mcc_mnc_parameters, { "MCC and MNC Parameters", "gsm_a.rr.mcc_mnc_parameters", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14448             { &hf_gsm_a_rr_timing_adv_present, { "Timing Advance Value", "gsm_a.rr.timing_adv.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14449             { &hf_gsm_a_rr_timing_advance_index_timeslot, { "Timing Advance Index and Timeslot", "gsm_a.rr.timing_advance_index_timeslot", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14450             { &hf_gsm_a_rr_packet_downlink_assignment, { "Packet Downlink Assignment", "gsm_a.rr.packet_downlink_assignment", FT_BOOLEAN, BASE_NONE, TFS(&tfs_downlink_assignment), 0x00, NULL, HFILL }},
14451             { &hf_gsm_a_rr_mbms_assignment, { "MBMS Assignment", "gsm_a.rr.mbms_assignment", FT_BOOLEAN, BASE_NONE, TFS(&tfs_non_distribution_distribution), 0x00, NULL, HFILL }},
14452             { &hf_gsm_a_rr_ms_parameters, { "MS Parameters", "gsm_a.rr.ms_parameters", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14453             { &hf_gsm_a_rr_gamma_present, { "Gamma", "gsm_a.rr.gamma.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14454             { &hf_gsm_a_rr_packet_uplink_assignment, { "Packet Uplink Assignment", "gsm_a.rr.packet_uplink_assignment", FT_BOOLEAN, BASE_NONE, TFS(&tfs_normal_single_block), 0x00, NULL, HFILL }},
14455             { &hf_gsm_a_rr_allocation_type, { "Allocation Type", "gsm_a.rr.allocation_type", FT_BOOLEAN, BASE_NONE, TFS(&tfs_fixed_dynamic_allocation), 0x00, NULL, HFILL }},
14456             { &hf_gsm_a_rr_timing_advance_index, { "Timing Advance Index", "gsm_a.rr.timing_advance_index", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14457             { &hf_gsm_a_rr_early_r97_version_reserved_bit, { "Bit reserved for earlier version of protocol", "gsm_a.rr.early_r97_version_reserved_bit", FT_BOOLEAN, BASE_NONE, TFS(&tfs_early_r97_version_later_than_r97_version), 0x00, NULL, HFILL }},
14458             { &hf_gsm_a_rr_later_r97_version_reserved_bit, { "Bit reserved for earlier version of protocol", "gsm_a.rr.later_r97_version_reserved_bit", FT_BOOLEAN, BASE_NONE, TFS(&tfs_later_than_r97_version_early_r97_version), 0x00, NULL, HFILL }},
14459             { &hf_gsm_a_rr_earlier_version_reserved_bit, { "Bit reserved for earlier version of protocol", "gsm_a.rr.earlier_version_reserved_bit", FT_BOOLEAN, BASE_NONE, TFS(&tfs_earlier_version_current_version), 0x00, NULL, HFILL }},
14460             { &hf_gsm_a_rr_extended_ra_present, { "Extended RA", "gsm_a.rr.extended_ra.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14461             { &hf_gsm_a_rr_tfi_assignment_present, { "TFI Assignment (etc)", "gsm_a.rr.tfi_assignment.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14462             { &hf_gsm_a_rr_pr_mode_present, { "BTS Power Control Mode", "gsm_a.rr.pr_mode.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_fixed_dynamic_allocation), 0x00, NULL, HFILL }},
14463             { &hf_gsm_a_rr_downlink_uplink_discriminator_bit, { "Discriminator bit", "gsm_a.rr.downlink_uplink_discriminator_bit", FT_BOOLEAN, BASE_NONE, TFS(&tfs_downlink_uplink_discriminator_bit), 0x00, NULL, HFILL }},
14464             { &hf_gsm_a_rr_downlink_uplink, { "Downlink/Uplink", "gsm_a.rr.downlink_uplink", FT_BOOLEAN, BASE_NONE, TFS(&tfs_downlink_uplink_assign), 0x00, NULL, HFILL }},
14465             { &hf_gsm_a_rr_second_packet_assignment_discriminator_bit, { "Discriminator Bit", "gsm_a.rr.second_packet_assignment_discriminator_bit", FT_BOOLEAN, BASE_NONE, TFS(&tfs_second_part_packet_assignment), 0x00, NULL, HFILL }},
14466             { &hf_gsm_a_rr_packet_discriminator_bit, { "Discriminator Bit", "gsm_a.rr.packet_discriminator_bit", FT_BOOLEAN, BASE_NONE, TFS(&tfs_packet_downlink_uplink_assignment), 0x00, NULL, HFILL }},
14467             { &hf_gsm_a_rr_compressed_inter_rat_handover_info, { "A compressed version of the INTER RAT HANDOVER INFO message", "gsm_a.rr.compressed_inter_rat_handover_info", FT_BOOLEAN, BASE_NONE, TFS(&tfs_shall_be_shall_not_be_used), 0x00, NULL, HFILL }},
14468             { &hf_gsm_a_rr_group_channel_description, { "Group Channel Description", "gsm_a.rr.group_channel_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14469             { &hf_gsm_a_rr_hopping_case, { "Hopping case", "gsm_a.rr.hopping_case", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14470             { &hf_gsm_a_rr_hopping_flag, { "Hopping flag", "gsm_a.rr.hopping_flag", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14471             { &hf_gsm_a_rr_utran_fdd_description, { "UTRAN FDD Description", "gsm_a.rr.utran_fdd_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14472             { &hf_gsm_a_rr_utran_fdd_description_earlier_version_bit_reserved1, { "Bit reserved for earlier version of protocol", "gsm_a.rr.utran_fdd_description_earlier_version_bit_reserved1", FT_BOOLEAN, BASE_NONE, TFS(&tfs_earlier_version_current_version), 0x00, NULL, HFILL }},
14473             { &hf_gsm_a_rr_utran_fdd_description_earlier_version_bit_reserved2, { "Bit reserved for earlier version of protocol", "gsm_a.rr.utran_fdd_description_earlier_version_bit_reserved2", FT_BOOLEAN, BASE_NONE, TFS(&tfs_current_version_earlier_version), 0x00, NULL, HFILL }},
14474             { &hf_gsm_a_rr_utran_tdd_description, { "UTRAN TDD Description", "gsm_a.rr.utran_tdd_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14475             { &hf_gsm_a_rr_utran_tdd_description_earlier_version_bit_reserved1, { "Bit reserved for earlier version of protocol", "gsm_a.rr.utran_tdd_description_earlier_version_bit_reserved1", FT_BOOLEAN, BASE_NONE, TFS(&tfs_earlier_version_current_version), 0x00, NULL, HFILL }},
14476             { &hf_gsm_a_rr_utran_tdd_description_earlier_version_bit_reserved2, { "Bit reserved for earlier version of protocol", "gsm_a.rr.utran_tdd_description_earlier_version_bit_reserved2", FT_BOOLEAN, BASE_NONE, TFS(&tfs_current_version_earlier_version), 0x00, NULL, HFILL }},
14477             { &hf_gsm_a_rr_3g_measurement_parameters_description, { "3G Measurement Parameters Description", "gsm_a.rr.3g_measurement_parameters_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14478             { &hf_gsm_a_rr_fdd_parameters, { "FDD Parameters", "gsm_a.rr.fdd_parameters", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14479             { &hf_gsm_a_rr_tdd_parameters, { "TDD Parameters", "gsm_a.rr.tdd_parameters", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14480             { &hf_gsm_a_rr_3g_additional_measurement_parameters_description, { "3G Additional Measurement Parameters Description", "gsm_a.rr.3g_additional_measurement_parameters_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14481             { &hf_gsm_a_rr_repeated_umts_fdd_neighbour_cells, { "Repeated UMTS FDD Neighbour Cells", "gsm_a.rr.repeated_umts_fdd_neighbour_cells", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14482             { &hf_gsm_a_rr_repeated_umts_fdd_neighbour_cells_earlier_version_bit_reserved, { "Bit reserved for earlier version of protocol", "gsm_a.rr.repeated_umts_fdd_neighbour_cells_earlier_version_bit_reserved", FT_BOOLEAN, BASE_NONE, TFS(&tfs_earlier_version_current_version), 0x00, NULL, HFILL }},
14483             { &hf_gsm_a_rr_fdd_cell_info_param_value0, { "The FDD_CELL_INFORMATION parameter value '0000000000'", "gsm_a.rr.fdd_cell_info_param_value0", FT_BOOLEAN, BASE_NONE, TFS(&tfs_member_not_member_of_set), 0x00, NULL, HFILL }},
14484             { &hf_gsm_a_rr_repeated_umts_tdd_neighbour_cells, { "Repeated UMTS TDD Neighbour Cells", "gsm_a.rr.repeated_umts_tdd_neighbour_cells", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14485             { &hf_gsm_a_rr_repeated_umts_tdd_neighbour_cells_earlier_version_bit_reserved, { "Bit reserved for earlier version of protocol", "gsm_a.rr.repeated_umts_tdd_neighbour_cells_earlier_version_bit_reserved", FT_BOOLEAN, BASE_NONE, TFS(&tfs_earlier_version_current_version), 0x00, NULL, HFILL }},
14486             { &hf_gsm_a_rr_tdd_cell_info_param_value0, { "the TDD_CELL_INFORMATION parameter value '0000000000'", "gsm_a.rr.tdd_cell_info_param_value0", FT_BOOLEAN, BASE_NONE, TFS(&tfs_member_not_member_of_set), 0x00, NULL, HFILL }},
14487             { &hf_gsm_a_rr_rtd6, { "RTD6", "gsm_a.rr.rtd6", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14488             { &hf_gsm_a_rr_ba_index_start_rtd_present, { "BA Index Start RTD", "gsm_a.rr.ba_index_start_rtd.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14489             { &hf_gsm_a_rr_rtd, { "RTD", "gsm_a.rr.rtd", FT_BOOLEAN, BASE_NONE, TFS(&tfs_not_present_present), 0x00, NULL, HFILL }},
14490             { &hf_gsm_a_rr_additional_rtd, { "additional RTD", "gsm_a.rr.additional_rtd", FT_BOOLEAN, BASE_NONE, TFS(&tfs_not_present_present), 0x00, NULL, HFILL }},
14491             { &hf_gsm_a_rr_additional_rtd_struct, { "additional RTD struct", "gsm_a.rr.additional_rtd_struct", FT_BOOLEAN, BASE_NONE, TFS(&tfs_not_present_present), 0x00, NULL, HFILL }},
14492             { &hf_gsm_a_rr_rtd12, { "RTD12", "gsm_a.rr.rtd12", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14493             { &hf_gsm_a_rr_repeated_rtd, { "Repeated RTD", "gsm_a.rr.repeated_rtd", FT_BOOLEAN, BASE_NONE, TFS(&tfs_not_present_present), 0x00, NULL, HFILL }},
14494             { &hf_gsm_a_rr_repeated_rtd_frequency, { "Repeated RTD Frequency", "gsm_a.rr.repeated_rtd_frequency", FT_BOOLEAN, BASE_NONE, TFS(&tfs_not_present_present), 0x00, NULL, HFILL }},
14495             { &hf_gsm_a_rr_ba_index_start_bsic_present, { "BA Index Start BSIC", "gsm_a.rr.ba_index_start_bsic.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14496             { &hf_gsm_a_rr_multiband_reporting_present, { "Multiband Reporting", "gsm_a.rr.multiband_reporting.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14497             { &hf_gsm_a_rr_serving_reporting_present, { "Serving Reporting", "gsm_a.rr.serving_reporting.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14498             { &hf_gsm_a_rr_900_reporting_present, { "900 Reporting", "gsm_a.rr.900_reporting.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14499             { &hf_gsm_a_rr_1800_reporting_present, { "1800 Reporting", "gsm_a.rr.1800_reporting.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14500             { &hf_gsm_a_rr_400_reporting_present, { "400 Reporting", "gsm_a.rr.400_reporting.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14501             { &hf_gsm_a_rr_1900_reporting_present, { "1900 Reporting", "gsm_a.rr.1900_reporting.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14502             { &hf_gsm_a_rr_850_reporting_present, { "850 Reporting", "gsm_a.rr.850_reporting.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14503             { &hf_gsm_a_rr_fdd_reporting_threshold_2_present, { "FDD Reporting Threshold2", "gsm_a.rr.fdd_reporting_threshold_2.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14504             { &hf_gsm_a_rr_default_utran_priority_parameters, { "Default UTRAN Priority Parameters", "gsm_a.rr.default_utran_priority_parameters", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14505             { &hf_gsm_a_rr_repeated_utran_priority_parameters, { "Repeated UTRAN Priority Parameters", "gsm_a.rr.repeated_utran_priority_parameters", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14506             { &hf_gsm_a_rr_utran_frequency_index_present, { "UTRAN Frequency Index", "gsm_a.rr.utran_frequency_index.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14507             { &hf_gsm_a_rr_utran_priority_present, { "UTRAN Priority", "gsm_a.rr.utran_priority.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14508             { &hf_gsm_a_rr_thresh_utran_low_present, { "Threshold UTRAN Low", "gsm_a.rr.thresh_utran_low.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14509             { &hf_gsm_a_rr_utran_qrxlevmin_present, { "UTRAN Qrxlev Min", "gsm_a.rr.utran_qrxlevmin.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14510             { &hf_gsm_a_rr_eutran_earfcn_present, { "E-UTRAN Neighbour Cells Struct", "gsm_a.rr.eutran_earfcn.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14511             { &hf_gsm_a_rr_eutran_measurement_bandwidth_present, { "Measurement Bandwidth", "gsm_a.rr.eutran_measurement_bandwidth.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14512             { &hf_gsm_a_rr_eutran_priority_present, { "E-UTRAN Priority", "gsm_a.rr.eutran_priority.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14513             { &hf_gsm_a_rr_thresh_eutran_low_present, { "Threshold E-UTRAN Low", "gsm_a.rr.thresh_eutran_low.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14514             { &hf_gsm_a_rr_eutran_qrxlevmin_present, { "E-UTRAN Qrxlev Min", "gsm_a.rr.eutran_qrxlevmin.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14515             { &hf_gsm_a_rr_repeated_earfcn, { "Repeated EARFCN", "gsm_a.rr.repeated_earfcn", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14516             { &hf_gsm_a_rr_repeated_pcid, { "Repeated PCID", "gsm_a.rr.repeated_pcid", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14517             { &hf_gsm_a_rr_eutran_pcid_present, { "TARGET PCID", "gsm_a.rr.repeated_eutran_pcid_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14518             { &hf_gsm_a_rr_eutran_pcid_bitmap_group_present, { "PCID Bitmap Group", "gsm_a.rr.eutran_pcid_bitmap_group.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14519             { &hf_gsm_a_rr_pcid_pattern_present, { "PCID Pattern", "gsm_a.rr.pcid_pattern.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14520             { &hf_gsm_a_rr_repeated_eutran_frequency_index, { "Repeated E-UTRAN Frequency Index", "gsm_a.rr.repeated_eutran_frequency_index", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14521             { &hf_gsm_a_rr_repeating_pcid_group, { "Repeating PCID group", "gsm_a.rr.repeating_pcid_group", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14522             { &hf_gsm_a_rr_eutran_reporting_quantity, { "E-UTRAN Reporting Quantity", "gsm_a.rr.eutran_reporting_quantity", FT_BOOLEAN, BASE_NONE, TFS(&tfs_rsrq_rsrp), 0x00, NULL, HFILL }},
14523             { &hf_gsm_a_rr_eutran_reporting, { "Reporting", "gsm_a.rr.eutran_reporting", FT_BOOLEAN, BASE_NONE, TFS(&tfs_3_bit_6_bit), 0x00, NULL, HFILL }},
14524             { &hf_gsm_a_rr_eutran_fdd_reporting_present, { "E-UTRAN FDD FDD 3 bit Reporting", "gsm_a.rr.eutran_fdd_reporting.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14525             { &hf_gsm_a_rr_eutran_fdd_reporting_threshold_2_present, { "E-UTRAN FDD Reporting Threshold2", "gsm_a.rr.eutran_fdd_reporting_threshold_2.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14526             { &hf_gsm_a_rr_eutran_fdd_reporting_offset_present, { "E-EUTRAN FDD Reporting Offset", "gsm_a.rr.eutran_fdd_reporting_offset.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14527             { &hf_gsm_a_rr_eutran_tdd_reporting_present, { "E-UTRAN TDD TDD 3 bit Reporting", "gsm_a.rr.eutran_tdd_reporting.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14528             { &hf_gsm_a_rr_eutran_tdd_reporting_threshold_2_present, { "E-UTRAN TDD Reporting Threshold2", "gsm_a.rr.eutran_tdd_reporting_threshold_2.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14529             { &hf_gsm_a_rr_eutran_tdd_reporting_offset_present, { "E-EUTRAN TDD Reporting Offset", "gsm_a.rr.eutran_tdd_reporting_offset.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14530             { &hf_gsm_a_rr_eutran_fdd_reporting_threshold, { "E-EUTRAN FDD Reporting Threshold", "gsm_a.rr.eutran_fdd_reporting_threshold", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14531             { &hf_gsm_a_rr_eutran_tdd_measurement_report_offset_present, { "E-UTRAN TDD Reporting Offset", "gsm_a.rr.eutran_tdd_measurement_report_offset.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14532             { &hf_gsm_a_rr_eutran_measurement_parameters_description, { "E-UTRAN Measurement Parameters Description", "gsm_a.rr.eutran_measurement_parameters_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14533             { &hf_gsm_a_rr_gprs_eutran_measurement_parameters_description, { "GPRS E-UTRAN Measurement Parameters Description", "gsm_a.rr.gprs_eutran_measurement_parameters_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14534             { &hf_gsm_a_rr_eutran_fdd_reporting, { "E-UTRAN FDD Reporting", "gsm_a.rr.eutran_fdd_reporting", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14535             { &hf_gsm_a_rr_eutran_tdd_reporting, { "E-UTRAN TDD Reporting", "gsm_a.rr.eutran_tdd_reporting", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14536             { &hf_gsm_a_rr_repeated_eutran_neighbour_cells, { "Repeated E-UTRAN Neighbour Cells", "gsm_a.rr.repeated_eutran_neighbour_cells", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14537             { &hf_gsm_a_rr_repeated_eutran_not_allowed_cells, { "Repeated E-UTRAN Not Allowed Cells", "gsm_a.rr.repeated_eutran_not_allowed_cells", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14538             { &hf_gsm_a_rr_repeated_eutran_pcid_ta_mapping, { "Repeated E-UTRAN PCID to TA mapping", "gsm_a.rr.repeated_eutran_pcid_ta_mapping", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14539             { &hf_gsm_a_rr_measurement_control_parameters_description, { "Measurement Control Parameters Description", "gsm_a.rr.measurement_control_parameters_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14540             { &hf_gsm_a_rr_eutran_default_measurement_control_eutran_present, { "Default Measurement Control E-UTRAN", "gsm_a.rr.eutran_default_measurement_control_eutran.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14541             { &hf_gsm_a_rr_repeated_eutran_measurement_control_parameters, { "Repeated E-UTRAN Measurement Control Parameters", "gsm_a.rr.repeated_eutran_measurement_control_parameters", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14542             { &hf_gsm_a_rr_serving_cell_priority_parameters_description, { "Serving Cell Priority Parameters Description", "gsm_a.rr.serving_cell_priority_parameters_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14543             { &hf_gsm_a_rr_3g_priority_parameters_description, { "3G Priority Parameters Description", "gsm_a.rr.3g_priority_parameters_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14544             { &hf_gsm_a_rr_eutran_parameters_description, { "E-UTRAN Parameters Description", "gsm_a.rr.eutran_parameters_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14545             { &hf_gsm_a_rr_repeated_csg_psc_split_struct, { "Repeated CSG_PSC_SPLIT struct", "gsm_a.rr.repeated_csg_psc_split_struct", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14546             { &hf_gsm_a_rr_psc_present, { "PSC", "gsm_a.rr.psc_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14547             { &hf_gsm_a_rr_psc_pattern_present, { "PSC Pattern", "gsm_a.rr.psc_pattern.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14548             { &hf_gsm_a_rr_repeated_utran_frequency_index, { "Repeated UTRAN Frequency Index", "gsm_a.rr.repeated_utran_frequency_index", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14549             { &hf_gsm_a_rr_repeated_csg_fdd_uarfcn, { "Repeated CSG FDD UARFCN", "gsm_a.rr.repeated_csg_fdd_uarfcn", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14550             { &hf_gsm_a_rr_3g_csg_desc_technology, { "Technology", "gsm_a.rr.3g_csg_desc_technology", FT_BOOLEAN, BASE_NONE, TFS(&tfs_tdd_fdd), 0x00, NULL, HFILL }},
14551             { &hf_gsm_a_rr_repeated_pcid_group, { "Repeated PCID group", "gsm_a.rr.repeated_pcid_group", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14552             { &hf_gsm_a_rr_repeated_csg_pci_split, { "Repeated CSG PCI Split", "gsm_a.rr.repeated_csg_pci_split", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14553             { &hf_gsm_a_rr_3g_measurement_control_parameters_description, { "3G Measurement Control Parameters Description", "gsm_a.rr.3g_measurement_control_parameters_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14554             { &hf_gsm_a_rr_3g_measurement_control_parameters_description_struct, { "3G Measurement Control Parameters Description struct", "gsm_a.rr.3g_measurement_control_parameters_description_struct", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14555             { &hf_gsm_a_rr_repeated_utran_measurement_control_parameters_struct, { "Repeated UTRAN Measurement Control Parameters struct", "gsm_a.rr.repeated_utran_measurement_control_parameters_struct", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14556             { &hf_gsm_a_rr_measurement_parameters_description, { "Measurement Parameters Description", "gsm_a.rr.measurement_parameters_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14557             { &hf_gsm_a_rr_gprs_real_time_difference_description, { "GPRS Real Time Difference Description", "gsm_a.rr.gprs_real_time_difference_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14558             { &hf_gsm_a_rr_gprs_bsic_description, { "GPRS BSIC Description", "gsm_a.rr.gprs_bsic_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14559             { &hf_gsm_a_rr_gprs_report_priority_description, { "GPRS Report Priority Description", "gsm_a.rr.gprs_report_priority_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14560             { &hf_gsm_a_rr_gprs_measurement_parameters_description, { "GPRS Measurement Parameters Description", "gsm_a.rr.gprs_measurement_parameters_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14561             { &hf_gsm_a_rr_nc_measurement_parameters, { "NC Measurement Parameters", "gsm_a.rr.nc_measurement_parameters", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14562             { &hf_gsm_a_rr_nc_periods, { "NC Periods", "gsm_a.rr.nc_periods", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14563             { &hf_gsm_a_rr_si_2quater_extension_information, { "SI 2quater Extension Information", "gsm_a.rr.si_2quater_extension_information", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14564             { &hf_gsm_a_rr_ccn_support_description, { "CCN Support Description", "gsm_a.rr.ccn_support_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14565             { &hf_gsm_a_rr_3g_neighbour_cell_description, { "3G Neighbour Cell Description", "gsm_a.rr.3g_neighbour_cell_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14566             { &hf_gsm_a_rr_absolute_index_start_emr_present, { "Absolute Index Start EMR", "gsm_a.rr.absolute_index_start_emr.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14567             { &hf_gsm_a_rr_fdd_information, { "FDD Information", "gsm_a.rr.fdd_information", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14568             { &hf_gsm_a_rr_tdd_information, { "TDD Information", "gsm_a.rr.tdd_information", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14569             { &hf_gsm_a_rr_gprs_3g_measurement_parameters_description, { "GPRS 3G Measurement Parameters Description", "gsm_a.rr.gprs_3g_measurement_parameters_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14570             { &hf_gsm_a_rr_reporting_quantity_present, { "Reporting Quantity", "gsm_a.rr.reporting_quantity.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_ec_no_rscp), 0x00, NULL, HFILL }},
14571             { &hf_gsm_a_rr_fdd_reporting_parameters, { "FDD Reporting Parameters", "gsm_a.rr.fdd_reporting_parameters", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14572             { &hf_gsm_a_rr_tdd_multirat_reporting_present, { "TDD Multirat Reporting", "gsm_a.rr.tdd_multirat_reporting.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14573             { &hf_gsm_a_rr_tdd_reporting_parameters, { "TDD Reporting Parameters", "gsm_a.rr.tdd_reporting_parameters", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14574             { &hf_gsm_a_rr_3g_additional_measurement_parameters_description_2, { "3G Additional Measurement Parameters Description 2", "gsm_a.rr.3g_additional_measurement_parameters_description_2", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14575             { &hf_gsm_a_rr_700_reporting, { "700 Reporting", "gsm_a.rr.700_reporting", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14576             { &hf_gsm_a_rr_810_reporting, { "810 Reporting", "gsm_a.rr.810_reporting", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14577             { &hf_gsm_a_rr_3g_supplementary_parameters_description, { "3G Supplementary Parameters Description", "gsm_a.rr.3g_supplementary_parameters_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14578             { &hf_gsm_a_rr_3g_csg_description, { "3G CSG Description", "gsm_a.rr.3g_csg_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14579             { &hf_gsm_a_rr_lsa_id_type, { "Type", "gsm_a.rr.lsa_id_type", FT_BOOLEAN, BASE_NONE, TFS(&tfs_short_lsa_id_lsa_id), 0x00, NULL, HFILL }},
14580             { &hf_gsm_a_rr_additional_lsa_id, { "Additional LSA ID", "gsm_a.rr.additional_lsa_id", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14581             { &hf_gsm_a_rr_si13alt_position_present, { "SI3 alt position", "gsm_a.rr.si13alt_position.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14582             { &hf_gsm_a_call_prio_present, { "Call Priority", "gsm_a.call_prio.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14583             { &hf_gsm_a_rr_amr_config_present, { "AMR Config", "gsm_a.rr.amr_config.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14584             { &hf_gsm_a_rr_rfl_number_present, { "RFL number list", "gsm_a.rr.rfl_number.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14585             { &hf_gsm_a_rr_gprs_mobile_allocation, { "MA", "gsm_a.rr.gprs_mobile_allocation", FT_BOOLEAN, BASE_NONE, TFS(&tfs_not_present_present), 0x00, NULL, HFILL }},
14586             { &hf_gsm_a_rr_arfcn_index_list, { "ARFCN index list", "gsm_a.rr.arfcn_index_list", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14587             { &hf_gsm_a_rr_si13_change_mark_present, { "SI13 Change Mark", "gsm_a.rr.si13_change_mark.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14588             { &hf_gsm_a_rr_pbcch, { "PBCCH", "gsm_a.rr.pbcch", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present_in_cell), 0x00, NULL, HFILL }},
14589             { &hf_gsm_a_rr_maio_present, { "MAIO", "gsm_a.rr.maio.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14590             { &hf_gsm_a_rr_arfcn_present, { "ARFCN", "gsm_a.rr.arfcn.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14591             { &hf_gsm_a_rr_lb_ms_txpwr_max_cch_present, { "LB MS TXPWR MAX CCH", "gsm_a.rr.lb_ms_txpwr_max_cch.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14592             { &hf_gsm_a_rr_real_time_difference_description, { "Real Time Difference Description", "gsm_a.rr.real_time_difference_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14593             { &hf_gsm_a_rr_bsic_description, { "BSIC Description", "gsm_a.rr.bsic_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14594             { &hf_gsm_a_rr_report_priority_description, { "Report Priority Description", "gsm_a.rr.report_priority_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14595             { &hf_gsm_a_rr_future_extensions_of_the_2g_parameters, { "Future extensions of the 2G parameters", "gsm_a.rr.future_extensions_of_the_2g_parameters", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14596             { &hf_gsm_a_rr_3g_wait_present, { "3G Wait", "gsm_a.rr.3g_wait.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14597             { &hf_gsm_a_rr_index_start_3g_present, { "Index Start 3G", "gsm_a.rr.index_start_3g.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14598             { &hf_gsm_a_rr_cdma2000_description, { "CDMA2000 Description", "gsm_a.rr.cdma2000_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14599             { &hf_gsm_a_rr_additional_information_for_3x_auxiliary_pilot, { "Additional information for 3X Auxiliary Pilot", "gsm_a.rr.additional_information_for_3x_auxiliary_pilot", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14600             { &hf_gsm_a_rr_3g_reporting_quantity, { "3G Reporting Quantity", "gsm_a.rr.3g_reporting_quantity", FT_BOOLEAN, BASE_NONE, TFS(&tfs_ec_no_rscp), 0x00, NULL, HFILL }},
14601             { &hf_gsm_a_rr_fdd_multirat_reporting_present, { "FDD Multirat Reporting", "gsm_a.rr.fdd_multirat_reporting.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14602             { &hf_gsm_a_rr_fdd_reporting_offset_present, { "FDD Reporting Offset", "gsm_a.rr.fdd_reporting_offset.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14603             { &hf_gsm_a_rr_tdd_reporting_offset_present, { "TDD Reporting Offset", "gsm_a.rr.tdd_reporting_offset.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14604             { &hf_gsm_a_rr_cdma2000_multirat_reporting, { "CDMA2000 Multirat Reporting", "gsm_a.rr.cdma2000_multirat_reporting", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14605             { &hf_gsm_a_rr_cdma2000_reporting_threshold, { "CDMA2000 Reporting Threshold", "gsm_a.rr.cdma2000_reporting_threshold", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14606             { &hf_gsm_a_rr_eutran_csg_description, { "E-UTRAN CSG Description", "gsm_a.rr.eutran_csg_description", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14607             { &hf_gsm_a_rr_serving_cell_data, { "Serving cell data", "gsm_a.rr.serving_cell_data", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14608             { &hf_gsm_a_rr_repeated_invalid_bsic_information, { "Repeated Invalid BSIC Information", "gsm_a.rr.repeated_invalid_bsic_information", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14609             { &hf_gsm_a_rr_bitmap_type_reporting, { "Bitmap Type Reporting", "gsm_a.rr.bitmap_type_reporting", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14610             { &hf_gsm_a_rr_e_utran_measurement_report, { "E-UTRAN Measurement Report", "gsm_a.rr.e_utran_measurement_report", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14611             { &hf_gsm_a_rr_repeat_eutran_desc, { "Repeating E-UTRAN Description struct", "gsm_a.rr.repeat_eutran_desc", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14612             { &hf_gsm_a_rr_peo_dsc_and_rcc_present, { "PEO DSC and RCC", "gsm_a.rr.peo_dsc_and_rcc_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL } },
14613             { &hf_gsm_a_rr_c1_delta_present, { "C1 DELTA", "gsm_a.rr.c1_delta_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL } },
14614             { &hf_gsm_a_rr_ul_xtti_tbf_assignment, { "TTI mode for uplink TBF", "gsm_a.rr.ul_xtti_tbf_assignment", FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_ul_xtti_tbf_assignment_vals), 0x00, NULL, HFILL } },
14615             { &hf_gsm_a_rr_dl_xtti_tbf_assignment, { "TTI mode for downlink TBF", "gsm_a.rr.dl_xtti_tbf_assignment", FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_dl_xtti_tbf_assignment_vals), 0x00, NULL, HFILL } },
14616             { &hf_gsm_a_rr_fanr_act_state, { "FANR state", "gsm_a.rr.fanr_act_state", FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_fanr_act_state_vals), 0x00, NULL, HFILL } },
14617             { &hf_gsm_a_rr_encoding_selection, { "Selected encoding", "gsm_a.rr.encoding_selection", FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_encoding_selection_vals), 0x00, NULL, HFILL } },
14618             { &hf_gsm_a_rr_nof_pdch_pairs, { "Number of assigned PDCH pairs", "gsm_a.rr.nof_pdch_pairs", FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_nof_pdch_pairs_vals), 0x00, NULL, HFILL } },
14619             { &hf_gsm_a_rr_npm_transfer_time_present, { "NPM Transfer Time", "gsm_a.rr.npm_transfer_time_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL } },
14620             { &hf_gsm_a_rr_eab_parameters,{ "EAB parameters structure", "gsm_a.rr.eab_parameters", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL } },
14621             /* gsm_rr_csn_HL_flag() fields */
14622             { &hf_gsm_a_rr_selection_parameters, { "Selection Parameters", "gsm_a.rr.selection_parameters", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14623             { &hf_gsm_a_rr_break_indicator, { "Break Indicator", "gsm_a.rr.break_indicator", FT_BOOLEAN, BASE_NONE, TFS(&tfs_break_indicator), 0x00, NULL, HFILL }},
14624             { &hf_gsm_a_rr_multiple_tbf_procedures, { "Multiple TBF Capability procedures in A/Gb mode", "gsm_a.rr.multiple_tbf_capability", FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x00, NULL, HFILL }},
14625             { &hf_gsm_a_rr_additions_in_rel_7, { "Additions in Rel-7", "gsm_a.rr.additions_in_rel_7", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14626             { &hf_gsm_a_rr_additions_in_rel_9, { "Additions in Rel-9", "gsm_a.rr.additions_in_rel_9", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14627             { &hf_gsm_a_rr_additions_in_rel_6, { "Additions in Rel-6", "gsm_a.rr.additions_in_rel_6", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14628             { &hf_gsm_a_rr_additions_in_rel_10, { "Additions in Rel-10", "gsm_a.rr.additions_in_rel_10", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL } },
14629             { &hf_gsm_a_rr_additions_in_rel_13, { "Additions in Rel-13", "gsm_a.rr.additions_in_rel_13", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL } },
14630             { &hf_gsm_a_rr_additions_in_r99, { "Additions in R99", "gsm_a.rr.additions_in_r99", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14631             { &hf_gsm_a_rr_first_discriminator_bit, { "First Discriminator Bit", "gsm_a.rr.first_discriminator_bit", FT_BOOLEAN, BASE_NONE, TFS(&tfs_high_low), 0x00, NULL, HFILL }},
14632             { &hf_gsm_a_rr_second_discriminator_bit, { "Second Discriminator Bit", "gsm_a.rr.second_discriminator_bit", FT_BOOLEAN, BASE_NONE, TFS(&tfs_high_low), 0x00, NULL, HFILL }},
14633             { &hf_gsm_a_rr_a_compressed_inter_rat_handover_info, { "A compressed version of the INTER RAT HANDOVER INFO message", "gsm_a.rr.a_compressed_inter_rat_handover_info", FT_BOOLEAN, BASE_NONE, TFS(&tfs_shall_be_shall_not_be_used), 0x00, NULL, HFILL }},
14634             { &hf_gsm_a_rr_nln_pch_present, { "NLN(PCH)", "gsm_a.rr.nln_pch.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14635             { &hf_gsm_a_call_prio1, { "Priority 1", "gsm_a.call_prio1.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14636             { &hf_gsm_a_call_prio2, { "Priority 2", "gsm_a.call_prio2.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14637             { &hf_gsm_a_rr_group_call_information, { "Group Call Information", "gsm_a.rr.group_call_information", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14638             { &hf_gsm_a_rr_packet_page_indication_1, { "Packet Page Indication 1", "gsm_a.rr.packet_page_indication_1", FT_BOOLEAN, BASE_NONE, TFS(&tfs_for_gprs_for_rr_connection_establishment), 0x00, NULL, HFILL }},
14639             { &hf_gsm_a_rr_packet_page_indication_2, { "Packet Page Indication 2", "gsm_a.rr.packet_page_indication_2", FT_BOOLEAN, BASE_NONE, TFS(&tfs_for_gprs_for_rr_connection_establishment), 0x00, NULL, HFILL }},
14640             { &hf_gsm_a_rr_chnl_needed_ch3_present, { "Channel Needed 3", "gsm_a.rr.chnl_needed_ch3.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14641             { &hf_gsm_a_call_prio3, { "Priority 3", "gsm_a.call_prio3.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14642             { &hf_gsm_a_rr_packet_paging_procedure_1, { "Packet Paging Procedure 1", "gsm_a.rr.packet_paging_procedure_1", FT_BOOLEAN, BASE_NONE, TFS(&tfs_for_gprs_for_rr_connection_establishment), 0x00, NULL, HFILL }},
14643             { &hf_gsm_a_rr_packet_paging_procedure_2, { "Packet Paging Procedure 2", "gsm_a.rr.packet_paging_procedure_2", FT_BOOLEAN, BASE_NONE, TFS(&tfs_for_gprs_for_rr_connection_establishment), 0x00, NULL, HFILL }},
14644             { &hf_gsm_a_rr_packet_paging_procedure_3, { "Packet Paging Procedure 3", "gsm_a.rr.packet_paging_procedure_3", FT_BOOLEAN, BASE_NONE, TFS(&tfs_for_gprs_for_rr_connection_establishment), 0x00, NULL, HFILL }},
14645             { &hf_gsm_a_rr_additions_in_release_6_present, { "Additions in release 6", "gsm_a.rr.additions_in_release_6.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14646             { &hf_gsm_a_rr_chnl_needed_ch3and4, { "Channel Needed 3 & 4", "gsm_a.rr.chnl_needed_ch3and4", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14647             { &hf_gsm_a_call_prio4, { "Priority 4", "gsm_a.call_prio4.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14648             { &hf_gsm_a_rr_nch_position_present, { "NCH position", "gsm_a.rr.nch_position.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14649             { &hf_gsm_a_rr_si2ter_mp_change_mark_present, { "MP Changemark", "gsm_a.rr.si2ter_mp_change_mark.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14650             { &hf_gsm_a_rr_additions_in_rel_5, { "Additions in Rel-5", "gsm_a.rr.additions_in_rel_5", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14651             { &hf_gsm_a_rr_additions_in_rel_8, { "Additions in Rel-8", "gsm_a.rr.additions_in_rel_8", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14652             { &hf_gsm_a_rr_power_offset_present, { "Optional Power Offset", "gsm_a.rr.power_offset.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14653             { &hf_gsm_a_rr_system_information_type_2ter, { "SYSTEM INFORMATION TYPE 2ter", "gsm_a.rr.system_information_type_2ter", FT_BOOLEAN, BASE_NONE, TFS(&tfs_available_not_available), 0x00, NULL, HFILL }},
14654             { &hf_gsm_a_rr_early_classmark_sending, { "Early Classmark Sending", "gsm_a.rr.early_classmark_sending", FT_BOOLEAN, BASE_NONE, TFS(&tfs_allowed_not_allowed), 0x00, NULL, HFILL }},
14655             { &hf_gsm_a_rr_scheduling_if_and_where, { "Scheduling if and where", "gsm_a.rr.scheduling_if_and_where", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14656             { &hf_gsm_a_rr_gprs_indicator, { "GPRS Indicator", "gsm_a.rr.gprs_indicator", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14657             { &hf_gsm_a_rr_3g_early_classmark_sending_restriction, { "3G Early Classmark Sending Restriction", "gsm_a.rr.3g_early_classmark_sending_restriction", FT_BOOLEAN, BASE_NONE, TFS(&tfs_3g_early_classmark_sending_restriction), 0x00, NULL, HFILL }},
14658             { &hf_gsm_a_rr_si2quater_indicator, { "SI2quater Indicator", "gsm_a.rr.si2quater_indicator", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14659             { &hf_gsm_a_rr_si21_indicator,{ "SI21 Indicator", "gsm_a.rr.si21_indicator", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL } },
14660             { &hf_gsm_a_rr_si4_rest_octets_s, { "SI4 Rest Octets_S", "gsm_a.rr.si4_rest_octets_s", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14661             { &hf_gsm_a_rr_lsa_parameters, { "LSA Parameters", "gsm_a.rr.lsa_parameters", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14662             { &hf_gsm_a_rr_cell_id_present, { "Cell Identity", "gsm_a.rr.cell_id.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14663             { &hf_gsm_a_rr_lsa_id_information, { "LSA ID information", "gsm_a.rr.lsa_id_information", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14664             { &hf_gsm_a_rr_cbq3_present, { "CBQ3", "gsm_a.rr.cbq3.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14665             { &hf_gsm_a_rr_pch_and_nch_info, { "PCH and NCH Info", "gsm_a.rr.pch_and_nch_info", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14666             { &hf_gsm_a_rr_vbs_vgcs_options, { "VBS/VGCS options", "gsm_a.rr.vbs_vgcs_options", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14667             { &hf_gsm_a_rr_dtm, { "DTM", "gsm_a.rr.dtm", FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_in_serving_cell_not_supported_in_serving_cell), 0x00, NULL, HFILL }},
14668             { &hf_gsm_a_rr_gprs_ms_txpwr_max_ccch_present, { "GPRS MS PWR MAX CCCH", "gsm_a.rr.gprs_ms_txpwr_max_ccch.present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14669             { &hf_gsm_a_rr_mbms_procedures, { "MBMS Procedures", "gsm_a.rr.mbms_procedures", FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x00, NULL, HFILL }},
14670             { &hf_gsm_a_rr_si13_contents, { "SI13 contents", "gsm_a.rr.si13_contents", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14671             { &hf_gsm_a_rr_additions_in_rel_4, { "Additions in Rel-4", "gsm_a.rr.additions_in_rel_4", FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x00, NULL, HFILL }},
14672             { &hf_gsm_a_rr_si_change_alt, { "SI CHANGE ALT", "gsm_a.rr.si_change_alt", FT_BOOLEAN, BASE_NONE, TFS(&gsm_si_change_alt_value), 0x00, NULL, HFILL } },
14673
14674         };
14675
14676     static hf_register_info hf_rr_short_pd[] =
14677         {
14678            { &hf_gsm_a_rr_short_pd,
14679              { "Radio Resources Short Protocol Discriminator", "gsm_a.rr.short_pd",
14680                FT_UINT8, BASE_HEX, NULL, 0x0,
14681                NULL, HFILL }
14682            },
14683             { &hf_gsm_a_rr_short_pd_msg_type,
14684               { "Radio Resources Short PD Message Type", "gsm_a.rr.short_pd_type",
14685                 FT_UINT8, BASE_HEX, VALS(gsm_a_rr_short_pd_msg_strings), 0x0,
14686                 NULL, HFILL }
14687             },
14688             { &hf_gsm_a_rr_short_l2_header,
14689               { "Radio Resources Short L2 Header", "gsm_a.rr.short_l2_header",
14690                 FT_UINT8, BASE_HEX, NULL, 0x0,
14691                 NULL, HFILL }
14692             }
14693         };
14694
14695     /* Setup protocol subtree array */
14696 #define NUM_INDIVIDUAL_ELEMS    4
14697     gint *ett[NUM_INDIVIDUAL_ELEMS +
14698               NUM_GSM_DTAP_MSG_RR +
14699               NUM_GSM_RR_ELEM +
14700               NUM_GSM_RR_REST_OCTETS_ELEM +
14701               NUM_GSM_SACCH_MSG_RR];
14702
14703     static ei_register_info ei[] = {
14704         { &ei_gsm_a_rr_ie_overrun, { "gsm_a.rr.ie_overrun", PI_MALFORMED, PI_ERROR, "IE over-runs stated length", EXPFILL }},
14705         { &ei_gsm_a_rr_ie_underrun, { "gsm_a.rr.ie_underrun", PI_COMMENTS_GROUP, PI_NOTE, "IE under-runs stated length", EXPFILL }},
14706         { &ei_gsm_a_rr_data_not_dissected, { "gsm_a.rr.data_not_dissected", PI_UNDECODED, PI_WARN, "Not dissected yet", EXPFILL }},
14707         { &ei_gsm_a_rr_unknown_version, { "gsm_a.rr.unknown_version", PI_PROTOCOL, PI_WARN, "Unknown version", EXPFILL }},
14708         { &ei_gsm_a_rr_extraneous_data, { "gsm_a.rr.extraneous_data", PI_PROTOCOL, PI_NOTE, "Extraneous Data, dissector bug or later version spec(report to wireshark.org)", EXPFILL }},
14709         { &ei_gsm_a_rr_missing_mandatory_element, { "gsm_a.rr.missing_mandatory_element", PI_PROTOCOL, PI_ERROR, "Missing Mandatory element, rest of dissection is suspect", EXPFILL }},
14710     };
14711
14712     expert_module_t* expert_a_rr;
14713
14714     ett[0] = &ett_ccch_msg;
14715     ett[1] = &ett_ccch_oct_1;
14716     ett[2] = &ett_sacch_msg;
14717     ett[3] = &ett_ec_ccch_msg;
14718
14719     last_offset = NUM_INDIVIDUAL_ELEMS;
14720
14721     for (i=0; i < NUM_GSM_DTAP_MSG_RR; i++, last_offset++)
14722     {
14723         ett_gsm_dtap_msg_rr[i] = -1;
14724         ett[last_offset] = &ett_gsm_dtap_msg_rr[i];
14725     }
14726
14727     for (i=0; i < NUM_GSM_RR_ELEM; i++, last_offset++)
14728     {
14729         ett_gsm_rr_elem[i] = -1;
14730         ett[last_offset] = &ett_gsm_rr_elem[i];
14731     }
14732
14733     for (i=0; i < NUM_GSM_RR_REST_OCTETS_ELEM; i++, last_offset++)
14734     {
14735         ett_gsm_rr_rest_octets_elem[i] = -1;
14736         ett[last_offset] = &ett_gsm_rr_rest_octets_elem[i];
14737     }
14738
14739     for (i=0; i < NUM_GSM_SACCH_MSG_RR; i++, last_offset++)
14740     {
14741         ett_gsm_sacch_msg_rr[i] = -1;
14742         ett[last_offset] = &ett_gsm_sacch_msg_rr[i];
14743     }
14744
14745     /* Register the protocol name and description */
14746     proto_a_rr =
14747         proto_register_protocol("GSM A-I/F Radio Resource Management", "GSM RR", "gsm_a.rr");
14748
14749     proto_register_field_array(proto_a_rr, hf, array_length(hf));
14750     expert_a_rr = expert_register_protocol(proto_a_rr);
14751     expert_register_field_array(expert_a_rr, ei, array_length(ei));
14752
14753     /* Register the protocol name and description */
14754     proto_a_ccch =
14755         proto_register_protocol("GSM CCCH", "GSM CCCH", "gsm_a.ccch");
14756
14757     /* subdissector code */
14758     register_dissector("gsm_a_ccch", dissect_ccch, proto_a_ccch);
14759
14760     /* Register the protocol name and description */
14761     proto_a_sacch =
14762         proto_register_protocol("GSM SACCH", "GSM SACCH", "gsm_a.sacch");
14763
14764     proto_register_field_array(proto_a_sacch, hf_rr_short_pd, array_length(hf_rr_short_pd));
14765
14766     /* subdissector code */
14767     register_dissector("gsm_a_sacch", dissect_sacch, proto_a_sacch);
14768     /* Register the protocol name and description */
14769
14770     proto_a_ec_ccch =
14771         proto_register_protocol("GSM EC-CCCH", "GSM EC-CCCH", "gsm_a.ec_ccch");
14772     /* subdissector code */
14773     register_dissector("gsm_a_ec_ccch", dissect_ec_ccch, proto_a_ec_ccch);
14774
14775     /* subtree array (for both sub-dissectors) */
14776     proto_register_subtree_array(ett, array_length(ett));
14777 }
14778
14779 void
14780 proto_reg_handoff_gsm_a_rr(void)
14781 {
14782     rrc_irat_ho_info_handle = find_dissector_add_dependency("rrc.irat.irat_ho_info", proto_a_rr);
14783     rrc_irat_ho_to_utran_cmd_handle = find_dissector_add_dependency("rrc.irat.ho_to_utran_cmd", proto_a_rr);
14784     rrlp_dissector = find_dissector("rrlp");
14785 }
14786
14787
14788 /*
14789  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
14790  *
14791  * Local variables:
14792  * c-basic-offset: 4
14793  * tab-width: 8
14794  * indent-tabs-mode: nil
14795  * End:
14796  *
14797  * vi: set shiftwidth=4 tabstop=8 expandtab:
14798  * :indentSize=4:tabSize=8:noTabs=true:
14799  */