blob: cc36a99374403d343b752edcb30e714b2d83de49 [file] [log] [blame]
Harald Welte74bdce82009-08-20 00:59:30 +09001/* 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 othere enhancements and fixes.
9 * Copyright 2005 - 2006, Anders Broman [AT] ericsson.com
10 *
11 * Title 3GPP Other
12 *
13 * Reference [3]
14 * Mobile radio interface Layer 3 specification;
15 * Core network protocols;
16 * Stage 3
17 * (3GPP TS 24.008 version 4.7.0 Release 4)
18 * (ETSI TS 124 008 V6.8.0 (2005-03))
19 *
20 * Reference [4]
21 * Mobile radio interface layer 3 specification;
22 * Radio Resource Control Protocol
23 * (GSM 04.18 version 8.4.1 Release 1999)
24 * (3GPP TS 04.18 version 8.26.0 Release 1999)
25 *
26 * $Id: packet-gsm_a_rr.c 29403 2009-08-13 12:17:20Z krj $
27 *
28 * Wireshark - Network traffic analyzer
29 * By Gerald Combs <gerald@wireshark.org>
30 * Copyright 1998 Gerald Combs
31 *
32 * This program is free software; you can redistribute it and/or
33 * modify it under the terms of the GNU General Public License
34 * as published by the Free Software Foundation; either version 2
35 * of the License, or (at your option) any later version.
36 *
37 * This program is distributed in the hope that it will be useful,
38 * but WITHOUT ANY WARRANTY; without even the implied warranty of
39 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 * GNU General Public License for more details.
41 *
42 * You should have received a copy of the GNU General Public License
43 * along with this program; if not, write to the Free Software
44 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
45 */
46
47#ifdef HAVE_CONFIG_H
48# include "config.h"
49#endif
50
51#include <stdio.h>
52#include <stdlib.h>
53
54#include <string.h>
55
56#include <epan/packet.h>
57#include <epan/prefs.h>
58#include <epan/tap.h>
59#include <epan/asn1.h>
60
61#include "packet-bssap.h"
62#include "packet-sccp.h"
63#include "packet-ber.h"
64#include "packet-q931.h"
65#include "packet-gsm_a_common.h"
66#include "packet-ipv6.h"
67#include "packet-e212.h"
68#include "packet-ppp.h"
69
70static dissector_handle_t rrc_irat_ho_info_handle;
71static dissector_handle_t rrc_irat_ho_to_utran_cmd_handle;
72static packet_info *rr_apdu_pinfo;
73
74#define PADDING_BYTE 0x2B
75
76gboolean gsm_a_rr_is_bit_high(tvbuff_t *tvb, gint bit_offset)
77{
78 guint8 bit_mask = 0x80 >> (bit_offset & 0x07);
79 if ((tvb_get_guint8(tvb,bit_offset >> 3) & bit_mask) != (PADDING_BYTE & bit_mask))
80 return TRUE;
81 return FALSE;
82}
83
84/* PROTOTYPES/FORWARDS */
85
86const value_string gsm_a_dtap_msg_rr_strings[] = {
87 { 0x3c, "Reserved" },
88 { 0x3b, "Additional Assignment" },
89 { 0x3f, "Immediate Assignment" },
90 { 0x39, "Immediate Assignment Extended" },
91 { 0x3a, "Immediate Assignment Reject" },
92
93 { 0x48, "DTM Assignment Failure" },
94 { 0x49, "DTM Reject" },
95 { 0x4a, "DTM Request" },
96 { 0x4b, "Main DCCH Assignment Command" },
97 { 0x4c, "Packet Assignment Command" },
98
99 { 0x35, "Ciphering Mode Command" },
100 { 0x32, "Ciphering Mode Complete" },
101
102 { 0x30, "Configuration Change Command" },
103 { 0x31, "Configuration Change Ack." },
104 { 0x33, "Configuration Change Reject" },
105
106 { 0x2e, "Assignment Command" },
107 { 0x29, "Assignment Complete" },
108 { 0x2f, "Assignment Failure" },
109 { 0x2b, "Handover Command" },
110 { 0x2c, "Handover Complete" },
111 { 0x28, "Handover Failure" },
112 { 0x2d, "Physical Information" },
113 { 0x4d, "DTM Assignment Command" },
114
115 { 0x08, "RR-cell Change Order" },
116 { 0x23, "PDCH Assignment Command" },
117
118 { 0x0d, "Channel Release" },
119 { 0x0a, "Partial Release" },
120 { 0x0f, "Partial Release Complete" },
121
122 { 0x21, "Paging Request Type 1" },
123 { 0x22, "Paging Request Type 2" },
124 { 0x24, "Paging Request Type 3" },
125 { 0x27, "Paging Response" },
126 { 0x20, "Notification/NCH" },
127 { 0x25, "Reserved" },
128 { 0x26, "Notification/Response" },
129
130 { 0x0b, "Reserved" },
131
132#if 0
133/* ETSI TS 101 503 V8.5.0 Seems to give Other def for this Messages??? */
134 { 0xc0, "Utran Classmark Change" }, CONFLICTS WITH Handover To UTRAN Command
135 { 0xc1, "UE RAB Preconfiguration" },
136 { 0xc2, "cdma2000 Classmark Change" },
137#endif
138
139 /* ETSI TS 101 503 V8.5.0 */
140 { 0x60, "Utran Classmark Change" },
141 { 0x62, "cdma2000 Classmark Change" },
142 { 0x63, "Inter System to UTRAN Handover Command" },
143 { 0x64, "Inter System to cdma2000 Handover Command" },
144 { 0x18, "System Information Type 8" },
145 { 0x19, "System Information Type 1" },
146 { 0x1a, "System Information Type 2" },
147 { 0x1b, "System Information Type 3" },
148 { 0x1c, "System Information Type 4" },
149 { 0x1d, "System Information Type 5" },
150 { 0x1e, "System Information Type 6" },
151 { 0x1f, "System Information Type 7" },
152
153 { 0x02, "System Information Type 2bis" },
154 { 0x03, "System Information Type 2ter" },
155 { 0x07, "System Information Type 2quater" },
156 { 0x05, "System Information Type 5bis" },
157 { 0x06, "System Information Type 5ter" },
158 { 0x04, "System Information Type 9" },
159 { 0x00, "System Information Type 13" },
160
161 { 0x3d, "System Information Type 16" },
162 { 0x3e, "System Information Type 17" },
163
164 { 0x40, "System Information Type 18" },
165 { 0x41, "System Information Type 19" },
166 { 0x42, "System Information Type 20" },
167
168 { 0x10, "Channel Mode Modify" },
169 { 0x12, "RR Status" },
170 { 0x17, "Channel Mode Modify Acknowledge" },
171 { 0x14, "Frequency Redefinition" },
172 { 0x15, "Measurement Report" },
173 { 0x16, "Classmark Change" },
174 { 0x13, "Classmark Enquiry" },
175 { 0x36, "Extended Measurement Report" },
176 { 0x37, "Extended Measurement Order" },
177 { 0x34, "GPRS Suspension Request" },
178
179 { 0x09, "VGCS Uplink Grant" },
180 { 0x0e, "Uplink Release" },
181 { 0x0c, "Reserved" },
182 { 0x2a, "Uplink Busy" },
183 { 0x11, "Talker Indication" },
184
185 { 0xc0, "UTRAN Classmark Change/Handover To UTRAN Command" }, /* spec conflict */
186
187 { 0x38, "Application Information" },
188
189 { 0, NULL }
190};
191
192const value_string gsm_rr_elem_strings[] = {
193 /* Radio Resource Management Information Elements 10.5.2, most are from 10.5.1 */
194 { 0x00, "BA Range" }, /* [3] 10.5.2.1a BA Range */
195 { 0x00, "Cell Channel Description" }, /* [3] 10.5.2.1b */
196 { 0x00, "BA List Pref" }, /* [3] 10.5.2.1c BA List Pref */
197 { 0x00, "UTRAN Frequency List" }, /* [3] 10.5.2.1d UTRAN Frequency List */
198 { 0x00, "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 */
199 { 0x00, "Cell Description" }, /* 10.5.2.2 */
200 { 0x00, "Cell Options (BCCH)" }, /* [3] 10.5.2.3 Cell Options (BCCH) */
201 { 0x00, "Cell Options (SACCH)" }, /* [3] 10.5.2.3a Cell Options (SACCH) */
202 { 0x00, "Cell Selection Parameters" }, /* [3] 10.5.2.4 Cell Selection Parameters */
203/* [3] 10.5.2.4a (void) */
204 { 0x00, "Channel Description" }, /* 10.5.2.5 */
205 { 0x00, "Channel Description 2" }, /* 10.5.2.5a */
206 { 0x00, "Channel Description 3" }, /* 10.5.2.5c */
207 { 0x00, "Channel Mode" }, /* [3] 10.5.2.6 */
208 { 0x00, "Channel Mode 2" }, /* [3] 10.5.2.7 */
209 { 0x00, "UTRAN Classmark" }, /* [3] 10.5.2.7a */
210/* [3] 10.5.2.7b (void) */
211 { 0x00, "Classmark Enquiry Mask" }, /* [3] 10.5.2.7c */
212/* [3] 10.5.2.7d GERAN Iu Mode Classmark information element */
213 { 0x00, "Channel Needed"}, /* [3] 10.5.2.8 */
214 /* [3] 10.5.2.8a (void) */
215 /* [3] 10.5.2.8b Channel Request Description 2 */
216 /* Pos 20 */
217 { 0x00, "Cipher Mode Setting" }, /* [3] 10.5.2.9 */
218 { 0x00, "Cipher Mode Response" }, /* [3] 10.5.2.10 */
219 { 0x00, "Control Channel Description" }, /* [3] 10.5.2.11 Control Channel Description */
220/* [3] 10.5.2.11a DTM Information Details */
221 { 0x00, "Dynamic ARFCN Mapping" }, /* [3] 10.5.2.11b */
222 { 0x00, "Frequency Channel Sequence" }, /* [3] 10.5.2.12 */
223 { 0x00, "Frequency List" }, /* 10.5.2.13 */
224 { 0x00, "Frequency Short List" }, /* 10.5.2.14 */
225 { 0x00, "Frequency Short List2" }, /* 10.5.2.14a */
226/* [3] 10.5.2.14b Group Channel Description */
227 { 0x00, "GPRS Resumption" }, /* [3] 10.5.2.14c GPRS Resumption */
228 { 0x00, "GPRS Broadcast Information" }, /* [3] 10.5.2.14d GPRS broadcast information */
229/* [3] 10.5.2.14e Enhanced DTM CS Release Indication */
230 { 0x00, "Handover Reference" }, /* 10.5.2.15 */
231 { 0x00, "IA Rest Octets" }, /* [3] 10.5.2.16 */
232 { 0x00, "IAR Rest Octets" }, /* [3] 10.5.2.17 IAR Rest Octets */
233 { 0x00, "IAX Rest Octets" }, /* [3] 10.5.2.18 IAX Rest Octets */
234 { 0x00, "L2 Pseudo Length" }, /* [3] 10.5.2.19 */
235 { 0x00, "Measurement Results" }, /* [3] 10.5.2.20 Measurement Results */
236/*
237 * [3] 10.5.2.20a GPRS Measurement Results
238 */
239 { 0x00, "Mobile Allocation" }, /* [3] 10.5.2.21 */
240 { 0x00, "Mobile Time Difference" }, /* [3] 10.5.2.21a */
241 { 0x00, "MultiRate configuration" }, /* [3] 10.5.2.21aa */
242 /* Pos 30 */
243 { 0x00, "Multislot Allocation" }, /* [3] 10.5.2.21b */
244 /*
245 * [3] 10.5.2.21c NC mode
246 */
247 { 0x00, "Neighbour Cell Description" }, /* [3] 10.5.2.22 Neighbour Cell Description */
248 { 0x00, "Neighbour Cell Description 2" }, /* [3] 10.5.2.22a Neighbour Cell Description 2 */
249/*
250 * [3] 10.5.2.22b (void)
251 * [3] 10.5.2.22c NT/N Rest Octets */
252 { 0x00, "P1 Rest Octets" }, /* [3] 10.5.2.23 P1 Rest Octets */
253 { 0x00, "P2 Rest Octets" }, /* [3] 10.5.2.24 P2 Rest Octets */
254 { 0x00, "P3 Rest Octets" }, /* [3] 10.5.2.25 P3 Rest Octets */
255 { 0x00, "Packet Channel Description" }, /* [3] 10.5.2.25a */
256 { 0x00, "Dedicated mode or TBF" }, /* [3] 10.5.2.25b */
257 /* [3] 10.5.2.25c RR Packet Uplink Assignment
258 * [3] 10.5.2.25d RR Packet Downlink Assignment */
259 { 0x00, "Page Mode" }, /* [3] 10.5.2.26 */
260/*
261 * [3] 10.5.2.26a (void)
262 * [3] 10.5.2.26b (void)
263 * [3] 10.5.2.26c (void)
264 * [3] 10.5.2.26d (void)
265 */
266 { 0x00, "NCC Permitted" }, /* [3] 10.5.2.27 NCC Permitted */
267 { 0x00, "Power Command" }, /* 10.5.2.28 */
268 { 0x00, "Power Command and access type" }, /* 10.5.2.28a */
269 { 0x00, "RACH Control Parameters" }, /* [3] 10.5.2.29 RACH Control Parameters */
270 { 0x00, "Request Reference" }, /* [3] 10.5.2.30 Request Reference */
271 { 0x00, "RR Cause" }, /* 10.5.2.31 */
272 { 0x00, "Synchronization Indication" }, /* 10.5.2.39 */
273 { 0x00, "SI 1 Rest Octets" }, /* [3] 10.5.2.32 */
274/* [3] 10.5.2.33 SI 2bis Rest Octets */
275 { 0x00, "SI 2ter Rest Octets" }, /* [3] 10.5.2.33a */
276 { 0x00, "SI 2quater Rest Octets" }, /* [3] 10.5.2.33b */
277 { 0x00, "SI 3 Rest Octets" }, /* [3] 10.5.2.34 */
278 { 0x00, "SI 4 Rest Octets" }, /* [3] 10.5.2.35 */
279 { 0x00, "SI 6 Rest Octets" }, /* [3] 10.5.2.35a */
280/* [3] 10.5.2.36 SI 7 Rest Octets
281 * [3] 10.5.2.37 SI 8 Rest Octets
282 * [3] 10.5.2.37a SI 9 Rest Octets
283 */
284 { 0x00, "SI 13 Rest Octets" }, /* [3] 10.5.2.37b */
285/* [3] 10.5.2.37c (void)
286 * [3] 10.5.2.37d (void)
287 * [3] 10.5.2.37e SI 16 Rest Octets
288 * [3] 10.5.2.37f SI 17 Rest Octets
289 * [3] 10.5.2.37g SI 19 Rest Octets
290 * [3] 10.5.2.37h SI 18 Rest Octets
291 * [3] 10.5.2.37i SI 20 Rest Octets */
292 { 0x00, "Starting Time" }, /* [3] 10.5.2.38 Starting Time */
293 { 0x00, "Timing Advance" }, /* [3] 10.5.2.40 Timing Advance */
294 { 0x00, "Time Difference" }, /* [3] 10.5.2.41 Time Difference */
295 { 0x00, "TLLI" }, /* [3] 10.5.2.41a TLLI */
296 { 0x00, "TMSI/P-TMSI" }, /* [3] 10.5.2.42 TMSI/P-TMSI */
297 { 0x00, "VGCS target mode Indication" }, /* [3] 10.5.2.42a */
298 /* Pos 40 */
299 { 0x00, "VGCS Ciphering Parameters" }, /* [3] 10.5.2.42b */
300 { 0x00, "Wait Indication" }, /* [3] 10.5.2.43 Wait Indication */
301/* [3] 10.5.2.44 SI10 rest octets $(ASCI)$ */
302 { 0x00, "Extended Measurement Results" }, /* [3] 10.5.2.45 Extended Measurement Results */
303 { 0x00, "Extended Measurement Frequency List" }, /* [3] 10.5.2.46 Extended Measurement Frequency List */
304 { 0x00, "Suspension Cause" }, /* [3] 10.5.2.47 */
305/* [3] 10.5.2.48 APDU ID
306 * [3] 10.5.2.49 APDU Flags
307 * [3] 10.5.2.50 APDU Data */
308 { 0x00, "Handover to UTRAN Command" }, /* [3] 10.5.2.51 Handover To UTRAN Command */
309/* [3] 10.5.2.52 Handover To cdma2000 Command
310 * [3] 10.5.2.53 (void)
311 * [3] 10.5.2.54 (void)
312 * [3] 10.5.2.55 (void)
313 * [3] 10.5.2.56 3G Target Cell */
314 { 0x00, "Service Support" }, /* [3] 10.5.2.57 */
315 /* 10.5.2.58 MBMS p-t-m Channel Description */
316 { 0x00, "Dedicated Service Information" }, /* [3] 10.5.2.59 */
317/*
318 * 10.5.2.60 MPRACH Description
319 * 10.5.2.61 Restriction Timer
320 * 10.5.2.62 MBMS Session Identity
321 * 10.5.2.63 Reduced group or broadcast call reference
322 * 10.5.2.64 Talker Priority status
323 * 10.5.2.65 Talker Identity
324 * 10.5.2.66 Token
325 * 10.5.2.67 PS Cause
326 * 10.5.2.68 VGCS AMR Configuration
327 */
328 { 0x00, "Carrier Indication" }, /* 10.5.2.69 Carrier Indication */
329 { 0, NULL }
330};
331
332const value_string gsm_rr_rest_octets_elem_strings[] = {
333 /* RR Rest Octets information elements */
334 { 0, "UTRAN FDD Description" },
335 { 0, "UTRAN TDD Description" },
336 { 0, "3G Measurement Parameters Description" },
337 { 0, "3G Additional Measurement Parameters Description" },
338 { 0, "Measurement Parameters Description" },
339 { 0, "GPRS Real Time Difference Description" },
340 { 0, "GPRS BSIC Description" },
341 { 0, "GPRS Report Priority Description" },
342 { 0, "GPRS Measurement Parameters Description" },
343 { 0, "NC Measurement Parameters" },
344 { 0, "SI2q Extension Information" },
345 { 0, "CCN Support Description" },
346 { 0, "3G Neighbour Cell Description" },
347 { 0, "FDD Cell Information Field" },
348 { 0, "TDD Cell Information Field" },
349 { 0, "GPRS 3G Measurement Parameters Description" },
350 { 0, "3G Additional Measurement Parameters Description 2" },
351 { 0, "Optional Selection Parameters" },
352 { 0, "GPRS Indicator" },
353 { 0, "SI4 Rest Octets_O" },
354 { 0, "SI4 Rest Octets_S" },
355 { 0, "LSA Parameters" },
356 { 0, "LSA ID Information" },
357 { 0, "PCH and NCH Info" },
358 { 0, "VBS/VGCS Options" },
359 { 0, "GPRS Mobile Allocation" },
360 { 0, "GPRS Cell Options" },
361 { 0, "GPRS Cell Options Extension Information" },
362 { 0, "GPRS Power Control Parameters" },
363 { 0, "PBCCH Description" },
364 { 0, "GSM Description" },
365 { 0, "Real Time Difference Description" },
366 { 0, "BSIC Description" },
367 { 0, "Report Priority Description" },
368 { 0, "CDMA2000 Description" },
369 { 0, "Serving cell data" },
370 { 0, "Repeated Invalid BSIC Information" },
371 { 0, "Bitmap Type Reporting" },
372 { 0, NULL }
373};
374
375
376/* RR cause value (octet 2) TS 44.018 6.11.0*/
377static const value_string gsm_a_rr_RR_cause_vals[] = {
378 { 0, "Normal event"},
379 { 1, "Abnormal release, unspecified"},
380 { 2, "Abnormal release, channel unacceptable"},
381 { 3, "Abnormal release, timer expired"},
382 { 4, "Abnormal release, no activity on the radio path"},
383 { 5, "Preemptive release"},
384 { 6, "UTRAN configuration unknown"},
385 { 8, "Handover impossible, timing advance out of range"},
386 { 9, "Channel mode unacceptable"},
387 { 10, "Frequency not implemented"},
388 { 13, "Originator or talker leaving group call area"},
389 { 12, "Lower layer failure"},
390 { 0x41, "Call already cleared"},
391 { 0x5f, "Semantically incorrect message"},
392 { 0x60, "Invalid mandatory information"},
393 { 0x61, "Message type non-existent or not implemented"},
394 { 0x62, "Message type not compatible with protocol state"},
395 { 0x64, "Conditional IE error"},
396 { 0x65, "No cell allocation available"},
397 { 0x6f, "Protocol error unspecified"},
398 { 0, NULL }
399};
400
401static const value_string gsm_a_algorithm_identifier_vals[] = {
402 { 0, "Cipher with algorithm A5/1"},
403 { 1, "Cipher with algorithm A5/2"},
404 { 2, "Cipher with algorithm A5/3"},
405 { 3, "Cipher with algorithm A5/4"},
406 { 4, "Cipher with algorithm A5/5"},
407 { 5, "Cipher with algorithm A5/6"},
408 { 6, "Cipher with algorithm A5/7"},
409 { 7, "Reserved"},
410 { 0, NULL }
411};
412
413
414#define DTAP_PD_MASK 0x0f
415#define DTAP_SKIP_MASK 0xf0
416#define DTAP_TI_MASK DTAP_SKIP_MASK
417#define DTAP_TIE_PRES_MASK 0x07 /* after TI shifted to right */
418#define DTAP_TIE_MASK 0x7f
419
420#define DTAP_RR_IEI_MASK 0xff
421
422/* Initialize the protocol and registered fields */
423static int proto_a_ccch = -1;
424static int proto_a_sacch = -1;
425static int rrlp_dissector = -1;
426
427static int hf_gsm_a_dtap_msg_rr_type = -1;
428int hf_gsm_a_rr_elem_id = -1;
429
430static int hf_gsm_a_sacch_msg_rr_type = -1;
431
432static int hf_gsm_a_bcc = -1;
433static int hf_gsm_a_ncc = -1;
434static int hf_gsm_a_bcch_arfcn = -1;
435static int hf_gsm_a_rr_range_nb = -1;
436static int hf_gsm_a_rr_range_lower = -1;
437static int hf_gsm_a_rr_range_higher = -1;
438static int hf_gsm_a_rr_ba_list_pref_length = -1;
439static int hf_gsm_a_rr_ba_freq = -1;
440static int hf_gsm_a_rr_utran_freq_list_length = -1;
441static int hf_gsm_a_rr_ho_ref_val = -1;
442static int hf_gsm_a_rr_L2_pseudo_len = -1;
443static int hf_gsm_a_rr_ba_used = -1;
444static int hf_gsm_a_rr_dtx_used = -1;
445static int hf_gsm_a_rr_3g_ba_used = -1;
446static int hf_gsm_a_rr_meas_valid = -1;
447static int hf_gsm_a_rr_rxlev_full_serv_cell = -1;
448static int hf_gsm_a_rr_rxlev_sub_serv_cell = -1;
449static int hf_gsm_a_rr_rxqual_full_serv_cell = -1;
450static int hf_gsm_a_rr_rxqual_sub_serv_cell = -1;
451static int hf_gsm_a_rr_no_ncell_m = -1;
452static int hf_gsm_a_rr_rxlev_ncell = -1;
453static int hf_gsm_a_rr_bcch_freq_ncell = -1;
454static int hf_gsm_a_rr_bsic_ncell = -1;
455static int hf_gsm_a_rr_mobile_time_difference = -1;
456static int hf_gsm_a_rr_pow_cmd_atc = -1;
457static int hf_gsm_a_rr_pow_cmd_epc = -1;
458static int hf_gsm_a_rr_page_mode = -1;
459static int hf_gsm_a_rr_dedicated_mode_or_tbf = -1;
460static int hf_gsm_a_rr_pow_cmd_fpcepc = -1;
461static int hf_gsm_a_rr_pow_cmd_powlev = -1;
462static int hf_gsm_a_rr_sync_ind_nci = -1;
463static int hf_gsm_a_rr_sync_ind_rot = -1;
464static int hf_gsm_a_rr_sync_ind_si = -1;
465static int hf_gsm_a_rr_format_id = -1;
466static int hf_gsm_a_rr_channel_mode = -1;
467static int hf_gsm_a_rr_channel_mode2 = -1;
468static int hf_gsm_a_rr_sc = -1;
469static int hf_gsm_a_algorithm_id = -1;
470static int hf_gsm_a_rr_cr = -1;
471static int hf_gsm_a_rr_multirate_speech_ver = -1;
472static int hf_gsm_a_rr_NCSB = -1;
473static int hf_gsm_a_rr_ICMI = -1;
474static int hf_gsm_a_rr_start_mode = -1;
475static int hf_gsm_a_rr_timing_adv = -1;
476static int hf_gsm_a_rr_time_diff = -1;
477static int hf_gsm_a_rr_tlli = -1;
478static int hf_gsm_a_rr_tmsi_ptmsi = -1;
479static int hf_gsm_a_rr_target_mode = -1;
480static int hf_gsm_a_rr_wait_indication = -1;
481static int hf_gsm_a_rr_seq_code = -1;
482static int hf_gsm_a_rr_group_cipher_key_number = -1;
483static int hf_gsm_a_rr_MBMS_multicast = -1;
484static int hf_gsm_a_rr_MBMS_broadcast = -1;
485static int hf_gsm_a_rr_last_segment = -1;
486static int hf_gsm_a_rr_carrier_ind = -1;
487static int hf_gsm_a_rr_ra = -1;
488static int hf_gsm_a_rr_T1prim = -1;
489static int hf_gsm_a_rr_T3 = -1;
490static int hf_gsm_a_rr_T2 = -1;
491static int hf_gsm_a_rr_rfn = -1;
492static int hf_gsm_a_rr_RR_cause = -1;
493static int hf_gsm_a_rr_cm_cng_msg_req = -1;
494static int hf_gsm_a_rr_utran_cm_cng_msg_req = -1;
495static int hf_gsm_a_rr_cdma200_cm_cng_msg_req = -1;
496static int hf_gsm_a_rr_geran_iu_cm_cng_msg_req = -1;
497int hf_gsm_a_rr_chnl_needed_ch1 = -1;
498static int hf_gsm_a_rr_chnl_needed_ch2 = -1;
499static int hf_gsm_a_rr_chnl_needed_ch3 = -1;
500static int hf_gsm_a_rr_chnl_needed_ch4 = -1;
501static int hf_gsm_a_rr_suspension_cause = -1;
502static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b8 = -1;
503static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b7 = -1;
504static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b6 = -1;
505static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b5 = -1;
506static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b4 = -1;
507static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b3 = -1;
508static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b2 = -1;
509static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b1 = -1;
510static int hf_gsm_a_rr_set_of_amr_codec_modes_v2_b5 = -1;
511static int hf_gsm_a_rr_set_of_amr_codec_modes_v2_b4 = -1;
512static int hf_gsm_a_rr_set_of_amr_codec_modes_v2_b3 = -1;
513static int hf_gsm_a_rr_set_of_amr_codec_modes_v2_b2 = -1;
514static int hf_gsm_a_rr_set_of_amr_codec_modes_v2_b1 = -1;
515static int hf_gsm_a_rr_amr_threshold = -1;
516static int hf_gsm_a_rr_amr_hysteresis = -1;
517static int hf_gsm_a_rr_pwrc = -1;
518static int hf_gsm_a_rr_dtx_bcch = -1;
519static int hf_gsm_a_rr_dtx_sacch = -1;
520static int hf_gsm_a_rr_radio_link_timeout = -1;
521static int hf_gsm_a_rr_cell_reselect_hyst = -1;
522static int hf_gsm_a_rr_ms_txpwr_max_cch = -1;
523static int hf_gsm_a_rr_acs = -1;
524static int hf_gsm_a_rr_neci = -1;
525static int hf_gsm_a_rr_rxlev_access_min = -1;
526static int hf_gsm_a_rr_mscr = -1;
527static int hf_gsm_a_rr_att = -1;
528static int hf_gsm_a_rr_ccch_conf = -1;
529static int hf_gsm_a_rr_cbq3 = -1;
530static int hf_gsm_a_rr_bs_pa_mfrms = -1;
531static int hf_gsm_a_rr_bs_ag_blks_res = -1;
532static int hf_gsm_a_rr_t3212 = -1;
533static int hf_gsm_a_rr_dyn_arfcn_length = -1;
534static int hf_gsm_a_rr_gsm_band = -1;
535static int hf_gsm_a_rr_arfcn_first = -1;
536static int hf_gsm_a_rr_band_offset = -1;
537static int hf_gsm_a_rr_arfcn_range = -1;
538static int hf_gsm_a_rr_lowest_arfcn = -1;
539static int hf_gsm_a_rr_inc_skip_arfcn = -1;
540static int hf_gsm_a_rr_gprs_resumption_ack = -1;
541static int hf_gsm_a_rr_ext_ind = -1;
542static int hf_gsm_a_rr_ba_ind = -1;
543static int hf_gsm_a_rr_multiband_reporting = -1;
544static int hf_gsm_a_rr_ncc_permitted = -1;
545static int hf_gsm_a_rr_max_retrans = -1;
546static int hf_gsm_a_rr_tx_integer = -1;
547static int hf_gsm_a_rr_cell_barr_access = -1;
548static int hf_gsm_a_rr_re = -1;
549static int hf_gsm_a_rr_acc = -1;
550static int hf_gsm_a_rr_nch_position = -1;
551static int hf_gsm_a_rr_si2ter_mp_change_mark = -1;
552static int hf_gsm_a_rr_si2ter_3g_change_mark = -1;
553static int hf_gsm_a_rr_si2ter_index = -1;
554static int hf_gsm_a_rr_si2ter_count = -1;
555static int hf_gsm_a_rr_fdd_uarfcn = -1;
556static int hf_gsm_a_rr_bandwidth_fdd = -1;
557static int hf_gsm_a_rr_tdd_uarfcn = -1;
558static int hf_gsm_a_rr_bandwidth_tdd = -1;
559static int hf_gsm_a_rr_arfcn = -1;
560static int hf_gsm_a_rr_bsic = -1;
561static int hf_gsm_a_rr_qsearch_i = -1;
562static int hf_gsm_a_rr_fdd_qoffset = -1;
563static int hf_gsm_a_rr_fdd_qmin = -1;
564static int hf_gsm_a_rr_tdd_qoffset = -1;
565static int hf_gsm_a_rr_fdd_qmin_offset = -1;
566static int hf_gsm_a_rr_fdd_rscpmin = -1;
567static int hf_gsm_a_rr_3g_ba_ind = -1;
568static int hf_gsm_a_rr_mp_change_mark = -1;
569static int hf_gsm_a_rr_si2quater_index = -1;
570static int hf_gsm_a_rr_si2quater_count = -1;
571static int hf_gsm_a_rr_gsm_report_type = -1;
572static int hf_gsm_a_rr_serving_band_reporting = -1;
573static int hf_gsm_a_rr_frequency_scrolling = -1;
574static int hf_gsm_a_rr_rep_priority = -1;
575static int hf_gsm_a_rr_report_type = -1;
576static int hf_gsm_a_rr_reporting_rate = -1;
577static int hf_gsm_a_rr_invalid_bsic_reporting = -1;
578static int hf_gsm_a_rr_scale_ord = -1;
579static int hf_gsm_a_rr_900_reporting_offset = -1;
580static int hf_gsm_a_rr_900_reporting_threshold = -1;
581static int hf_gsm_a_rr_1800_reporting_offset = -1;
582static int hf_gsm_a_rr_1800_reporting_threshold = -1;
583static int hf_gsm_a_rr_400_reporting_offset = -1;
584static int hf_gsm_a_rr_400_reporting_threshold = -1;
585static int hf_gsm_a_rr_1900_reporting_offset = -1;
586static int hf_gsm_a_rr_1900_reporting_threshold = -1;
587static int hf_gsm_a_rr_850_reporting_offset = -1;
588static int hf_gsm_a_rr_850_reporting_threshold = -1;
589static int hf_gsm_a_rr_network_control_order = -1;
590static int hf_gsm_a_rr_nc_non_drx_period = -1;
591static int hf_gsm_a_rr_nc_reporting_period_i = -1;
592static int hf_gsm_a_rr_nc_reporting_period_t = -1;
593static int hf_gsm_a_rr_index_start_3g = -1;
594static int hf_gsm_a_rr_absolute_index_start_emr = -1;
595static int hf_gsm_a_rr_qsearch_c_initial = -1;
596static int hf_gsm_a_rr_fdd_rep_quant = -1;
597static int hf_gsm_a_rr_fdd_multirat_reporting = -1;
598static int hf_gsm_a_rr_tdd_multirat_reporting = -1;
599static int hf_gsm_a_rr_qsearch_p = -1;
600static int hf_gsm_a_rr_3g_search_prio = -1;
601static int hf_gsm_a_rr_fdd_reporting_offset = -1;
602static int hf_gsm_a_rr_fdd_reporting_threshold = -1;
603static int hf_gsm_a_rr_tdd_reporting_offset = -1;
604static int hf_gsm_a_rr_tdd_reporting_threshold = -1;
605static int hf_gsm_a_rr_fdd_reporting_threshold_2 = -1;
606static int hf_gsm_a_rr_3g_ccn_active = -1;
607static int hf_gsm_a_rr_700_reporting_offset = -1;
608static int hf_gsm_a_rr_700_reporting_threshold = -1;
609static int hf_gsm_a_rr_810_reporting_offset = -1;
610static int hf_gsm_a_rr_810_reporting_threshold = -1;
611static int hf_gsm_a_rr_cbq = -1;
612static int hf_gsm_a_rr_cell_reselect_offset = -1;
613static int hf_gsm_a_rr_temporary_offset = -1;
614static int hf_gsm_a_rr_penalty_time = -1;
615static int hf_gsm_a_rr_si13_position = -1;
616static int hf_gsm_a_rr_power_offset = -1;
617static int hf_gsm_a_rr_si2quater_position = -1;
618static int hf_gsm_a_rr_si13alt_position = -1;
619static int hf_gsm_a_rr_prio_thr = -1;
620static int hf_gsm_a_rr_lsa_offset = -1;
621static int hf_gsm_a_rr_paging_channel_restructuring = -1;
622static int hf_gsm_a_rr_nln_sacch = -1;
623static int hf_gsm_a_rr_nln_status_sacch = -1;
624static int hf_gsm_a_rr_nln_pch = -1;
625static int hf_gsm_a_rr_nln_status_pch = -1;
626static int hf_gsm_a_rr_vbs_vgcs_inband_notifications = -1;
627static int hf_gsm_a_rr_vbs_vgcs_inband_pagings = -1;
628static int hf_gsm_a_rr_rac = -1;
629static int hf_gsm_a_rr_max_lapdm = -1;
630static int hf_gsm_a_rr_gprs_ms_txpwr_max_ccch = -1;
631static int hf_gsm_a_rr_dedicated_mode_mbms_notification_support = -1;
632static int hf_gsm_a_rr_mnci_support = -1;
633static int hf_gsm_a_rr_amr_config = -1;
634static int hf_gsm_a_rr_bcch_change_mark = -1;
635static int hf_gsm_a_rr_si_change_field = -1;
636static int hf_gsm_a_rr_si13_change_mark = -1;
637static int hf_gsm_a_rr_hsn = -1;
638static int hf_gsm_a_rr_rfl_number = -1;
639static int hf_gsm_a_rr_arfcn_index = -1;
640static int hf_gsm_a_rr_ma_length = -1;
641static int hf_gsm_a_rr_psi1_repeat_period = -1;
642static int hf_gsm_a_rr_pbcch_pb = -1;
643static int hf_gsm_a_rr_pbcch_tsc = -1;
644static int hf_gsm_a_rr_pbcch_tn = -1;
645static int hf_gsm_a_rr_spgc_ccch_sup = -1;
646static int hf_gsm_a_rr_priority_access_thr = -1;
647static int hf_gsm_a_rr_nmo = -1;
648static int hf_gsm_a_rr_t3168 = -1;
649static int hf_gsm_a_rr_t3192 = -1;
650static int hf_gsm_a_rr_drx_timer_max = -1;
651static int hf_gsm_a_rr_access_burst_type = -1;
652static int hf_gsm_a_rr_control_ack_type = -1;
653static int hf_gsm_a_rr_bs_cv_max = -1;
654static int hf_gsm_a_rr_pan_dec = -1;
655static int hf_gsm_a_rr_pan_inc = -1;
656static int hf_gsm_a_rr_pan_max = -1;
657static int hf_gsm_a_rr_egprs_packet_channel_request = -1;
658static int hf_gsm_a_rr_bep_period = -1;
659static int hf_gsm_a_rr_pfc_feature_mode = -1;
660static int hf_gsm_a_rr_dtm_support = -1;
661static int hf_gsm_a_rr_bss_paging_coordination = -1;
662static int hf_gsm_a_rr_ccn_active = -1;
663static int hf_gsm_a_rr_nw_ext_utbf = -1;
664static int hf_gsm_a_rr_multiple_tbf_capability = -1;
665static int hf_gsm_a_rr_ext_utbf_no_data = -1;
666static int hf_gsm_a_rr_dtm_enhancements_capability = -1;
667static int hf_gsm_a_rr_reduced_latency_access = -1;
668static int hf_gsm_a_rr_alpha = -1;
669static int hf_gsm_a_rr_t_avg_w = -1;
670static int hf_gsm_a_rr_t_avg_t = -1;
671static int hf_gsm_a_rr_pc_meas_chan = -1;
672static int hf_gsm_a_rr_n_avg_i = -1;
673static int hf_gsm_a_rr_sgsnr = -1;
674static int hf_gsm_a_rr_si_status_ind = -1;
675static int hf_gsm_a_rr_lb_ms_txpwr_max_cch = -1;
676static int hf_gsm_a_rr_si2n_support = -1;
677static int hf_gsm_a_rr_mi_index = -1;
678static int hf_gsm_a_rr_mi_count = -1;
679static int hf_gsm_a_rr_3g_wait = -1;
680static int hf_gsm_a_rr_qsearch_c = -1;
681static int hf_gsm_a_rr_bsic_seen = -1;
682static int hf_gsm_a_rr_scale = -1;
683static int hf_gsm_a_rr_mean_bep_gmsk = -1;
684static int hf_gsm_a_rr_mean_cv_bep = -1;
685static int hf_gsm_a_rr_nbr_rcvd_blocks = -1;
686static int hf_gsm_a_rr_reporting_quantity = -1;
687
688/* Initialize the subtree pointers */
689static gint ett_ccch_msg = -1;
690static gint ett_ccch_oct_1 = -1;
691static gint ett_sacch_msg = -1;
692
693static char a_bigbuf[1024];
694
695static dissector_handle_t data_handle;
696
697
698
699#define NUM_GSM_RR_ELEM (sizeof(gsm_rr_elem_strings)/sizeof(value_string))
700gint ett_gsm_rr_elem[NUM_GSM_RR_ELEM];
701
702typedef enum
703{
704 /* RR Rest Octets information elements */
705 DE_RR_REST_OCTETS_UTRAN_FDD_DESC,
706 DE_RR_REST_OCTETS_UTRAN_TDD_DESC,
707 DE_RR_REST_OCTETS_3G_MEAS_PARAM_DESC,
708 DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC,
709 DE_RR_REST_OCTETS_MEAS_PARAM_DESC,
710 DE_RR_REST_OCTETS_GPRS_RTD_DESC,
711 DE_RR_REST_OCTETS_GPRS_BSIC_DESC,
712 DE_RR_REST_OCTETS_GPRS_REPORT_PRIO_DESC,
713 DE_RR_REST_OCTETS_GPRS_MEAS_PARAM_DESC,
714 DE_RR_REST_OCTETS_NC_MEAS_PARAM,
715 DE_RR_REST_OCTETS_SI2Q_EXT_INFO,
716 DE_RR_REST_OCTETS_CCN_SUPPORT_DESC,
717 DE_RR_REST_OCTETS_3G_NEIGH_CELL_DESC,
718 DE_RR_REST_OCTETS_FDD_CELL_INFORMATION_FIELD,
719 DE_RR_REST_OCTETS_TDD_CELL_INFORMATION_FIELD,
720 DE_RR_REST_OCTETS_GPRS_3G_MEAS_PARAM_DESC,
721 DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC2,
722 DE_RR_REST_OCTETS_OPTIONAL_SEL_PARAM,
723 DE_RR_REST_OCTETS_GPRS_INDICATOR,
724 DE_RR_REST_OCTETS_SI4_REST_OCTETS_O,
725 DE_RR_REST_OCTETS_SI4_REST_OCTETS_S,
726 DE_RR_REST_OCTETS_LSA_PARAMETERS,
727 DE_RR_REST_OCTETS_LSA_ID_INFO,
728 DE_RR_REST_OCTETS_PCH_AND_NCH_INFO,
729 DE_RR_REST_OCTETS_VBS_VGCS_OPTIONS,
730 DE_RR_REST_OCTETS_GPRS_MOBILE_ALLOC,
731 DE_RR_REST_OCTETS_GPRS_CELL_OPTIONS,
732 DE_RR_REST_OCTETS_GPRS_CELL_OPTIONS_EXT_INFO,
733 DE_RR_REST_OCTETS_GPRS_POWER_CONTROL_PARAMS,
734 DE_RR_REST_OCTETS_PBCCH_DESC,
735 DE_RR_REST_OCTETS_GSM_DESC,
736 DE_RR_REST_OCTETS_RTD_DESC,
737 DE_RR_REST_OCTETS_BSIC_DESC,
738 DE_RR_REST_OCTETS_REPORT_PRIO_DESC,
739 DE_RR_REST_OCTETS_CDMA2000_DESC,
740 DE_RR_REST_OCTETS_SERVING_CELL_DATA,
741 DE_RR_REST_OCTETS_REPEAT_INV_BSIC_INFO,
742 DE_RR_REST_OCTETS_BITMAP_TYPE_REPORTING,
743 DE_RR_REST_OCTETS_NONE
744}
745rr_rest_octets_elem_idx_t;
746
747#define NUM_GSM_RR_REST_OCTETS_ELEM (sizeof(gsm_rr_rest_octets_elem_strings)/sizeof(value_string))
748gint ett_gsm_rr_rest_octets_elem[NUM_GSM_RR_REST_OCTETS_ELEM];
749
750/*
75110.5.2 Radio Resource management information elements
752 * [3] 10.5.2.1a BA Range
753 */
754guint16
755de_rr_ba_range(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
756{
757 guint32 curr_offset;
758 gint bit_offset;
759 guint8 value;
760
761 curr_offset = offset;
762 proto_tree_add_item(tree, hf_gsm_a_rr_range_nb, tvb, curr_offset, 1, FALSE);
763 value = tvb_get_guint8(tvb, curr_offset);
764 curr_offset += 1;
765 bit_offset = curr_offset << 3;
766 while (value)
767 {
768 proto_tree_add_bits_item(tree, hf_gsm_a_rr_range_lower, tvb, bit_offset, 10, FALSE);
769 bit_offset += 10;
770 proto_tree_add_bits_item(tree, hf_gsm_a_rr_range_higher, tvb, bit_offset, 10, FALSE);
771 bit_offset += 10;
772 value -= 1;
773 }
774
775 curr_offset += len - 1;
776 return (curr_offset - offset);
777}
778
779/*
780 * [3] 10.5.2.1b Cell Channel Description
781 */
782
783#define ARFCN_MAX 1024 /* total number of ARFCNs defined */
784
785static void display_channel_list(guint8 *list, tvbuff_t *tvb, proto_tree *tree, guint32 offset)
786{
787 int arfcn;
788 proto_item *ti=NULL;
789
790 ti = proto_tree_add_text(tree, tvb, 0, offset, "List of ARFCNs =");
791 for (arfcn=0; arfcn<ARFCN_MAX; arfcn++) {
792 if (list[arfcn])
793 proto_item_append_text(ti, " %d", arfcn);
794 }
795
796 return;
797}
798
799static gint greatest_power_of_2_lesser_or_equal_to(gint index)
800{
801 gint j = 1;
802 do {
803 j<<=1;
804 } while (j<=index);
805 j >>= 1;
806 return j;
807}
808
809static gint f_k(gint k, gint *w, gint range)
810{
811 gint index, n, j;
812
813 index = k;
814 range -= 1;
815 range = range/greatest_power_of_2_lesser_or_equal_to(index);
816 n = w[index]-1;
817
818 while (index>1) {
819 j = greatest_power_of_2_lesser_or_equal_to(index);
820 range = 2*range+1;
821 if ((2*index) < 3*j){ /* left child */
822 index -= j/2;
823 n = (n+w[index]-1+((range-1)/2)+1)%range;
824 }
825 else { /* right child */
826 index -= j;
827 n = (n+w[index]-1+1)%range;
828 }
829 }
830
831 return (n+1)%1024;
832}
833
834static void dissect_channel_list_n_range(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gint range)
835{
836 gint curr_offset=offset, f0, arfcn_orig, bits, w[64], wsize, i, wi;
837 gint octet, nwi=1, jwi=0, wbits, imax, iused, arfcn;
838 guint8 list[1024];
839
840 memset((void*)list,0,sizeof(list));
841
842 octet = tvb_get_guint8(tvb, curr_offset++);
843 if (range==1024) {
844 f0 = (octet>>2)&1;
845 if (f0)
846 list[0] = 1;
847 bits = 2;
848 arfcn_orig = 0;
849 wsize = 10;
850 imax = 16;
851 }
852 else {
853 arfcn_orig = (octet&1);
854 arfcn_orig = (arfcn_orig << 8) + tvb_get_guint8(tvb, curr_offset++);
855 octet = tvb_get_guint8(tvb, curr_offset++);
856 arfcn_orig = (arfcn_orig << 1) + (octet>>7);
857 list[arfcn_orig] = 1;
858 bits = 7;
859 switch (range) {
860 case 512:
861 wsize=9;
862 imax = 17;
863 break;
864 case 256:
865 wsize=8;
866 imax = 21;
867 break;
868 case 128:
869 wsize=7;
870 imax = 28;
871 break;
872 default:
873 wsize=0;
874 imax = 0;
875 DISSECTOR_ASSERT_NOT_REACHED();
876 }
877 }
878 iused = imax; /* in case the list is actually full */
879
880 /* extract the variable size w[] elements */
881 for (i=1; i<=imax; i++) {
882 wi = octet & ~(0xff<<bits); /* mask "bits" low bits to start wi from existing octet */
883 wbits = bits;
884 if (wsize>wbits) { /* need to extract more bits from the next octet */
885 octet = tvb_get_guint8(tvb, curr_offset++);
886 wi = (wi << 8) + octet;
887 bits = 8;
888 wbits += 8;
889 }
890
891 if (wbits>wsize) { /* now we have too many bits - save some */
892 bits = wbits - wsize;
893 wi >>= bits;
894 }
895 else /* just right number of bits */
896 bits = 0;
897
898 w[i] = wi;
899 if ((w[i]==0) || ((curr_offset-offset)>len)) {
900 iused = i - 1;
901 break; /* all remaining elements must also be zero */
902 }
903
904 if (++jwi==nwi) { /* check if the number of wi at this wsize has been extracted */
905 jwi = 0; /* reset the count of wi at this size */
906 nwi <<= 1; /* get twice as many of the next size */
907 wsize--; /* make the next size 1 bit smaller */
908 }
909 }
910
911 for (i=1; i<=iused; i++) {
912 arfcn = (f_k(i, w, range) + arfcn_orig)%1024;
913 list[arfcn] = 1;
914 }
915
916 display_channel_list(list, tvb, tree, offset);
917
918 return;
919}
920
921static guint16
922dissect_arfcn_list(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
923{
924 guint32 curr_offset;
925 guint8 oct,bit,byte;
926 guint16 arfcn;
927 proto_item *item;
928
929 curr_offset = offset;
930
931 oct = tvb_get_guint8(tvb, curr_offset);
932
933 /* FORMAT-ID, Format Identifier (part of octet 3)*/
934 proto_tree_add_item(tree, hf_gsm_a_rr_format_id, tvb, curr_offset, 1, FALSE);
935
936 if ((oct & 0xc0) == 0x00)
937 {
938 /* bit map 0 */
939 item = proto_tree_add_text(tree,tvb, curr_offset, len, "List of ARFCNs =");
940 bit = 4;
941 arfcn = 125;
942 for (byte = 0;byte <= len-1;byte++)
943 {
944 oct = tvb_get_guint8(tvb, curr_offset);
945 while (bit-- != 0)
946 {
947 arfcn--;
948 if (((oct >> bit) & 1) == 1)
949 {
950 proto_item_append_text(item," %d",arfcn);
951 }
952 }
953 bit = 8;
954 curr_offset++;
955 }
956 }
957 else if ((oct & 0xc8) == 0x80)
958 {
959 /* 1024 range */
960 dissect_channel_list_n_range(tvb, tree, curr_offset, len, 1024);
961 curr_offset = curr_offset + len;
962 }
963 else if ((oct & 0xce) == 0x88)
964 {
965 /* 512 range */
966 dissect_channel_list_n_range(tvb, tree, curr_offset, len, 512);
967 curr_offset = curr_offset + len;
968 }
969 else if ((oct & 0xce) == 0x8a)
970 {
971 /* 256 range */
972 dissect_channel_list_n_range(tvb, tree, curr_offset, len, 256);
973 curr_offset = curr_offset + len;
974 }
975 else if ((oct & 0xce) == 0x8c)
976 {
977 /* 128 range */
978 dissect_channel_list_n_range(tvb, tree, curr_offset, len, 128);
979 curr_offset = curr_offset + len;
980 }
981 else if ((oct & 0xce) == 0x8e)
982 {
983 /* variable bit map */
984 arfcn = ((oct & 0x01) << 9) | (tvb_get_guint8(tvb, curr_offset+1) << 1) | ((tvb_get_guint8(tvb, curr_offset + 2) & 0x80) >> 7);
985 item = proto_tree_add_text(tree,tvb,curr_offset,len,"List of ARFCNs = %d",arfcn);
986 curr_offset = curr_offset + 2;
987 bit = 7;
988 for (byte = 0;byte <= len-3;byte++)
989 {
990 oct = tvb_get_guint8(tvb, curr_offset);
991 while (bit-- != 0)
992 {
993 arfcn++;
994 if (((oct >> bit) & 1) == 1)
995 {
996 proto_item_append_text(item," %d",arfcn);
997 }
998 }
999 bit = 8;
1000 curr_offset++;
1001 }
1002 }
1003
1004 return(curr_offset - offset);
1005}
1006
1007guint16
1008de_rr_cell_ch_dsc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1009{
1010 return dissect_arfcn_list(tvb, tree, offset, 16, add_string, string_len);
1011}
1012/*
1013 * [3] 10.5.2.1c BA List Pref
1014 */
1015guint16
1016de_rr_ba_list_pref(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1017{
1018 guint32 curr_offset;
1019 gint bit_offset;
1020 guint8 value;
1021
1022 curr_offset = offset;
1023 proto_tree_add_item(tree, hf_gsm_a_rr_ba_list_pref_length, tvb, curr_offset, 1, FALSE);
1024 curr_offset += 1;
1025 bit_offset = curr_offset << 3;
1026 value = tvb_get_bits8(tvb,bit_offset,1);
1027 bit_offset += 1;
1028 while (value)
1029 {
1030 proto_tree_add_bits_item(tree, hf_gsm_a_rr_range_lower, tvb, bit_offset, 10, FALSE);
1031 bit_offset += 10;
1032 proto_tree_add_bits_item(tree, hf_gsm_a_rr_range_higher, tvb, bit_offset, 10, FALSE);
1033 bit_offset += 10;
1034 value = tvb_get_bits8(tvb,bit_offset,1);
1035 bit_offset += 1;
1036 }
1037 value = tvb_get_bits8(tvb,bit_offset,1);
1038 bit_offset += 1;
1039 while (value)
1040 {
1041 proto_tree_add_bits_item(tree, hf_gsm_a_rr_ba_freq, tvb, bit_offset, 10, FALSE);
1042 bit_offset += 10;
1043 value = tvb_get_bits8(tvb,bit_offset,1);
1044 bit_offset += 1;
1045 }
1046
1047 curr_offset += len - 1;
1048 return (curr_offset - offset);
1049}
1050
1051/*
1052 * [3] 10.5.2.1d UTRAN Frequency List
1053 */
1054guint16
1055de_rr_utran_freq_list(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1056{
1057 guint32 curr_offset;
1058 gint bit_offset;
1059 guint8 value;
1060
1061 curr_offset = offset;
1062 proto_tree_add_item(tree, hf_gsm_a_rr_utran_freq_list_length, tvb, curr_offset, 1, FALSE);
1063 curr_offset += 1;
1064 bit_offset = curr_offset << 3;
1065 value = tvb_get_bits8(tvb,bit_offset,1);
1066 bit_offset += 1;
1067 while (value)
1068 {
1069 proto_tree_add_bits_item(tree, hf_gsm_a_rr_fdd_uarfcn, tvb, bit_offset, 14, FALSE);
1070 bit_offset += 14;
1071 value = tvb_get_bits8(tvb,bit_offset,1);
1072 bit_offset += 1;
1073 }
1074 value = tvb_get_bits8(tvb,bit_offset,1);
1075 bit_offset += 1;
1076 while (value)
1077 {
1078 proto_tree_add_bits_item(tree, hf_gsm_a_rr_tdd_uarfcn, tvb, bit_offset, 14, FALSE);
1079 bit_offset += 14;
1080 value = tvb_get_bits8(tvb,bit_offset,1);
1081 bit_offset += 1;
1082 }
1083
1084 curr_offset += len - 1;
1085 return (curr_offset - offset);
1086}
1087
1088/*
1089 * [3] 10.5.2.1e Cell selection indicator after release of all TCH and SDCCH
1090 */
1091static const guint8
1092convert_n_to_p[32] = { 0, 10, 19, 28, 26, 44, 52, 60, 67, 74, 81, 88, 95, 102, 109, 116,
1093 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
1094
1095static const guint8
1096convert_n_to_q[32] = { 0, 9, 17, 25, 32, 39, 46, 53, 59, 65, 71, 77, 83, 89, 95, 101,
1097 106, 111, 116, 121, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
1098
1099guint16
1100de_rr_cell_select_indic(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1101{
1102 proto_tree *subtree, *subtree2;
1103 proto_item *item, *item2;
1104 guint32 curr_offset;
1105 gint bit_offset, bit_offset_sav, idx, xdd_cell_info, wsize, nwi, jwi, w[64], i, iused, xdd_indic0;
1106 guint8 value, length;
1107
1108 curr_offset = offset;
1109 length = tvb_get_guint8(tvb, curr_offset);
1110 curr_offset += 1;
1111 bit_offset = curr_offset << 3;
1112 value = tvb_get_bits8(tvb,bit_offset,3);
1113 bit_offset += 3;
1114 switch (value)
1115 {
1116 case 0: /* GSM Description */
1117 bit_offset_sav = bit_offset;
1118 item = proto_tree_add_text(tree, tvb, bit_offset>>3, -1, "%s",
1119 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_GSM_DESC].strptr);
1120 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_GSM_DESC]);
1121 value = tvb_get_bits8(tvb,bit_offset,1);
1122 bit_offset += 1;
1123 while (value)
1124 {
1125 proto_tree_add_text(subtree,tvb, bit_offset>>3, 1, "Band Indicator: %s",tvb_get_bits8(tvb,bit_offset,1) ? "1900" : "1800");
1126 bit_offset += 1;
1127 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_arfcn, tvb, bit_offset, 10, FALSE);
1128 bit_offset += 10;
1129 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bsic, tvb, bit_offset, 6, FALSE);
1130 bit_offset += 6;
1131 value = tvb_get_bits8(tvb,bit_offset,1);
1132 bit_offset += 1;
1133 }
1134 proto_item_set_len(item,((bit_offset-bit_offset_sav)>>3)+1);
1135 break;
1136 case 1: /* UTRAN FDD Description */
1137 bit_offset_sav = bit_offset;
1138 item = proto_tree_add_text(tree, tvb, bit_offset>>3, -1, "%s",
1139 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_FDD_DESC].strptr);
1140 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_UTRAN_FDD_DESC]);
1141 value = tvb_get_bits8(tvb,bit_offset,1);
1142 bit_offset += 1;
1143 while (value)
1144 {
1145 if (tvb_get_bits8(tvb,bit_offset,1))
1146 {
1147 bit_offset += 1;
1148 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bandwidth_fdd, tvb, bit_offset, 3, FALSE);
1149 bit_offset += 3;
1150 }
1151 else
1152 bit_offset += 1;
1153 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_fdd_uarfcn, tvb, bit_offset, 14, FALSE);
1154 bit_offset += 14;
1155 if (tvb_get_bits8(tvb,bit_offset,1))
1156 {
1157 bit_offset += 1;
1158 xdd_indic0 = tvb_get_bits8(tvb,bit_offset,1);
1159 proto_tree_add_text(subtree,tvb, bit_offset>>3, 1, "FDD Indic0: %d", xdd_indic0);
1160 bit_offset += 1;
1161 idx = tvb_get_bits8(tvb,bit_offset,5);
1162 proto_tree_add_text(subtree,tvb, bit_offset>>3, 1, "Nr of FDD Cells : %d", idx);
1163 bit_offset += 5;
1164 idx = convert_n_to_p[idx];
1165 item2 = proto_tree_add_text(subtree,tvb, bit_offset>>3, (idx>>3)+1, "%s",
1166 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_FDD_DESC].strptr);
1167 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_FDD_CELL_INFORMATION_FIELD]);
1168 proto_tree_add_text(subtree2,tvb, bit_offset>>3, (idx>>3)+1, "Field is %d bits long", idx);
1169 if (xdd_indic0)
1170 {
1171 proto_tree_add_text(subtree2,tvb, bit_offset>>3, 0, "Scrambling Code: %d", 0);
1172 proto_tree_add_text(subtree2,tvb, bit_offset>>3, 0, "Diversity: %d", 0);
1173 }
1174 if (idx)
1175 {
1176 wsize = 10;
1177 nwi = 1;
1178 jwi = 0;
1179 i = 1;
1180
1181 while (idx > 0)
1182 {
1183 w[i] = tvb_get_bits16(tvb, bit_offset, wsize, FALSE);
1184 bit_offset += wsize;
1185 idx -= wsize;
1186 if (w[i] == 0)
1187 {
1188 idx = 0;
1189 break;
1190 }
1191 if (++jwi==nwi)
1192 {
1193 jwi = 0;
1194 nwi <<= 1;
1195 wsize--;
1196 }
1197 i++;
1198 }
1199 if (idx < 0)
1200 {
1201 bit_offset += idx;
1202 }
1203 iused = i-1;
1204
1205 for (i=1; i <= iused; i++)
1206 {
1207 xdd_cell_info = f_k(i, w, 1024);
1208 proto_tree_add_text(subtree2,tvb, bit_offset>>3, 0,
1209 "Scrambling Code: %d", xdd_cell_info & 0x01FF);
1210 proto_tree_add_text(subtree2,tvb, bit_offset>>3, 0,
1211 "Diversity: %d", (xdd_cell_info >> 9) & 0x01);
1212 }
1213 }
1214 }
1215 else
1216 bit_offset += 1;
1217 value = tvb_get_bits8(tvb,bit_offset,1);
1218 bit_offset += 1;
1219 }
1220 proto_item_set_len(item,((bit_offset-bit_offset_sav)>>3)+1);
1221 break;
1222 case 2: /* UTRAN TDD Description */
1223 bit_offset_sav = bit_offset;
1224 item = proto_tree_add_text(tree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_TDD_DESC].strptr);
1225 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_UTRAN_TDD_DESC]);
1226 value = tvb_get_bits8(tvb,bit_offset,1);
1227 bit_offset += 1;
1228 while (value)
1229 {
1230 if (tvb_get_bits8(tvb,bit_offset,1))
1231 {
1232 bit_offset += 1;
1233 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bandwidth_tdd, tvb, bit_offset, 3, FALSE);
1234 bit_offset += 3;
1235 }
1236 else
1237 bit_offset += 1;
1238 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tdd_uarfcn, tvb, bit_offset, 14, FALSE);
1239 bit_offset += 14;
1240 if (tvb_get_bits8(tvb,bit_offset,1))
1241 {
1242 bit_offset += 1;
1243 xdd_indic0 = tvb_get_bits8(tvb,bit_offset,1);
1244 proto_tree_add_text(subtree,tvb, bit_offset>>3, 1, "TDD Indic0: %d", xdd_indic0);
1245 bit_offset += 1;
1246 idx = tvb_get_bits8(tvb,bit_offset,5);
1247 proto_tree_add_text(subtree,tvb, bit_offset>>3, 1, "Nr of TDD Cells : %d", idx);
1248 bit_offset += 5;
1249 idx = convert_n_to_q[idx];
1250 item2 = proto_tree_add_text(subtree,tvb, bit_offset>>3, (idx>>3)+1, "%s",
1251 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_TDD_DESC].strptr);
1252 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_TDD_CELL_INFORMATION_FIELD]);
1253 proto_tree_add_text(subtree2,tvb, bit_offset>>3, (idx>>3)+1, "Field is %d bits long", idx);
1254 if (xdd_indic0)
1255 {
1256 proto_tree_add_text(subtree2,tvb, bit_offset>>3, 0, "Cell Parameter: %d", 0);
1257 proto_tree_add_text(subtree2,tvb, bit_offset>>3, 0, "Sync Case TSTD: %d", 0);
1258 proto_tree_add_text(subtree2,tvb, bit_offset>>3, 0, "Diversity TDD: %d", 0);
1259 }
1260 if (idx)
1261 {
1262 wsize = 9;
1263 nwi = 1;
1264 jwi = 0;
1265 i = 1;
1266
1267 while (idx > 0)
1268 {
1269 w[i] = tvb_get_bits16(tvb, bit_offset, wsize, FALSE);
1270 bit_offset += wsize;
1271 idx -= wsize;
1272 if (w[i] == 0)
1273 {
1274 idx = 0;
1275 break;
1276 }
1277 if (++jwi==nwi)
1278 {
1279 jwi = 0;
1280 nwi <<= 1;
1281 wsize--;
1282 }
1283 i++;
1284 }
1285 if (idx < 0)
1286 {
1287 bit_offset += idx;
1288 }
1289 iused = i-1;
1290
1291 for (i=1; i <= iused; i++)
1292 {
1293 xdd_cell_info = f_k(i, w, 512);
1294 proto_tree_add_text(subtree2,tvb, bit_offset>>3, 0,
1295 "Cell Parameter: %d", xdd_cell_info & 0x07F);
1296 proto_tree_add_text(subtree2,tvb, bit_offset>>3, 0,
1297 "Sync Case TSTD: %d", (xdd_cell_info >> 7) & 0x01);
1298 proto_tree_add_text(subtree2,tvb, bit_offset>>3, 0,
1299 "Diversity TDD: %d", (xdd_cell_info >> 8) & 0x01);
1300 }
1301 }
1302 }
1303 else
1304 bit_offset += 1;
1305 value = tvb_get_bits8(tvb,bit_offset,1);
1306 bit_offset += 1;
1307 }
1308 proto_item_set_len(item,((bit_offset-bit_offset_sav)>>3)+1);
1309 break;
1310 default:
1311 break;
1312 }
1313
1314 curr_offset += length;
1315 return (curr_offset - offset);
1316}
1317
1318/*
1319 * [3] 10.5.2.2 Cell Description
1320 */
1321guint16
1322de_rr_cell_dsc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1323{
1324 proto_tree *subtree;
1325 proto_item *item;
1326 guint8 oct;
1327 guint32 curr_offset;
1328 guint16 bcch_arfcn;
1329
1330 curr_offset = offset;
1331
1332 oct = tvb_get_guint8(tvb, curr_offset);
1333 item =
1334 proto_tree_add_text(tree,
1335 tvb, curr_offset, 2, "%s",
1336 gsm_rr_elem_strings[DE_RR_CELL_DSC].strptr);
1337
1338 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_CELL_DSC]);
1339
1340 proto_tree_add_item(subtree, hf_gsm_a_ncc, tvb, curr_offset, 1, FALSE);
1341 proto_tree_add_item(subtree, hf_gsm_a_bcc, tvb, curr_offset, 1, FALSE);
1342 bcch_arfcn = (tvb_get_guint8(tvb,curr_offset) & 0xc0) << 2;
1343 bcch_arfcn = bcch_arfcn | tvb_get_guint8(tvb,curr_offset+1);
1344 proto_tree_add_uint(subtree, hf_gsm_a_bcch_arfcn , tvb, curr_offset, 2, bcch_arfcn );
1345
1346 curr_offset = curr_offset + 2;
1347
1348 return(curr_offset - offset);
1349}
1350
1351/*
1352 * [3] 10.5.2.3 Cell Options (BCCH)
1353 */
1354static const value_string gsm_a_rr_dtx_bcch_vals[] = {
1355 { 0x00, "The MSs may use uplink discontinuous transmission" },
1356 { 0x01, "The MSs shall use uplink discontinuous transmission" },
1357 { 0x02, "The MSs shall not use uplink discontinuous transmission" },
1358 { 0x03, "Reserved" },
1359 { 0, NULL } };
1360
1361static const value_string gsm_a_rr_radio_link_timeout_vals[] = {
1362 { 0x00, "4" },
1363 { 0x01, "8" },
1364 { 0x02, "12" },
1365 { 0x03, "16" },
1366 { 0x04, "20" },
1367 { 0x05, "24" },
1368 { 0x06, "28" },
1369 { 0x07, "32" },
1370 { 0x08, "36" },
1371 { 0x09, "40" },
1372 { 0x0A, "44" },
1373 { 0x0B, "48" },
1374 { 0x0C, "52" },
1375 { 0x0D, "56" },
1376 { 0x0E, "60" },
1377 { 0x0F, "64" },
1378 { 0, NULL } };
1379
1380static guint16
1381de_rr_cell_opt_bcch(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1382{
1383 proto_tree *subtree;
1384 proto_item *item;
1385 guint32 curr_offset;
1386
1387 curr_offset = offset;
1388
1389 item = proto_tree_add_text(tree, tvb, curr_offset, 1, "%s",
1390 gsm_rr_elem_strings[DE_RR_CELL_OPT_BCCH].strptr);
1391
1392 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_CELL_OPT_BCCH]);
1393
1394 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pwrc, tvb, (curr_offset<<3)+1, 1, FALSE);
1395 proto_tree_add_item(subtree, hf_gsm_a_rr_dtx_bcch, tvb, curr_offset, 1, FALSE);
1396 proto_tree_add_item(subtree, hf_gsm_a_rr_radio_link_timeout, tvb, curr_offset, 1, FALSE);
1397
1398 curr_offset = curr_offset + 1;
1399
1400 return(curr_offset - offset);
1401}
1402
1403/*
1404 * [3] 10.5.2.3a Cell Options (SACCH)
1405 */
1406static const value_string gsm_a_rr_dtx_sacch_vals[] = {
1407 { 0x00, "The MS may use uplink discontinuous transmission on a TCH-F. The MS shall not use uplink discontinuous transmission on TCH-H" },
1408 { 0x01, "The MS shall use uplink discontinuous transmission on a TCH-F. The MS shall not use uplink discontinuous transmission on TCH-H" },
1409 { 0x02, "The MS shall not use uplink discontinuous transmission on a TCH-F. The MS shall not use uplink discontinuous transmission on TCH-H" },
1410 { 0x03, "The MS shall use uplink discontinuous transmission on a TCH-F. The MS may use uplink discontinuous transmission on TCH-H" },
1411 { 0x04, "The MS may use uplink discontinuous transmission on a TCH-F. The MS may use uplink discontinuous transmission on TCH-H" },
1412 { 0x05, "The MS shall use uplink discontinuous transmission on a TCH-F. The MS shall use uplink discontinuous transmission on TCH-H" },
1413 { 0x06, "The MS shall not use uplink discontinuous transmission on a TCH-F. The MS shall use uplink discontinuous transmission on TCH-H" },
1414 { 0x07, "The MS may use uplink discontinuous transmission on a TCH-F. The MS shall use uplink discontinuous transmission on TCH-H" },
1415 { 0, NULL } };
1416
1417static guint16
1418de_rr_cell_opt_sacch(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1419{
1420 proto_tree *subtree;
1421 proto_item *item;
1422 guint8 oct;
1423 guint8 dtx;
1424 guint32 curr_offset;
1425
1426 curr_offset = offset;
1427
1428 oct = tvb_get_guint8(tvb, curr_offset);
1429 dtx = ((oct&0x80)>>5)|((oct&0x30)>>4); /* DTX is a split filed in bits 8, 6 and 5 */
1430 item = proto_tree_add_text(tree, tvb, curr_offset, 1, "%s",
1431 gsm_rr_elem_strings[DE_RR_CELL_OPT_SACCH].strptr);
1432
1433 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_CELL_OPT_SACCH]);
1434
1435 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pwrc, tvb, (curr_offset<<3)+1, 1, FALSE);
1436 proto_tree_add_uint(subtree, hf_gsm_a_rr_dtx_sacch, tvb, curr_offset, 1, dtx);
1437 proto_tree_add_item(subtree, hf_gsm_a_rr_radio_link_timeout, tvb, curr_offset, 1, FALSE);
1438
1439 curr_offset = curr_offset + 1;
1440
1441 return(curr_offset - offset);
1442}
1443
1444/*
1445 * [3] 10.5.2.4 Cell Selection Parameters
1446 */
1447static guint16
1448de_rr_cell_sel_param(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1449{
1450 proto_tree *subtree;
1451 proto_item *item;
1452 guint8 oct;
1453 guint32 curr_offset;
1454
1455 curr_offset = offset;
1456
1457 oct = tvb_get_guint8(tvb, curr_offset);
1458 item = proto_tree_add_text(tree, tvb, curr_offset, 2, "%s",
1459 gsm_rr_elem_strings[DE_RR_CELL_SEL_PARAM].strptr);
1460
1461 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_CELL_SEL_PARAM]);
1462
1463 proto_tree_add_item(subtree, hf_gsm_a_rr_cell_reselect_hyst, tvb, curr_offset, 1, FALSE);
1464 proto_tree_add_item(subtree, hf_gsm_a_rr_ms_txpwr_max_cch, tvb, curr_offset, 1, FALSE);
1465
1466 curr_offset = curr_offset + 1;
1467
1468 proto_tree_add_item(subtree, hf_gsm_a_rr_acs, tvb, curr_offset, 1, FALSE);
1469 proto_tree_add_item(subtree, hf_gsm_a_rr_neci, tvb, curr_offset, 1, FALSE);
1470 proto_tree_add_item(subtree, hf_gsm_a_rr_rxlev_access_min, tvb, curr_offset, 1, FALSE);
1471
1472 curr_offset = curr_offset + 1;
1473
1474 return(curr_offset - offset);
1475}
1476
1477/*
1478 * [3] 10.5.2.4a MAC Mode and Channel Coding Requested
1479 * [3] 10.5.2.5 Channel Description
1480 */
1481guint16
1482de_rr_ch_dsc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1483{
1484 guint32 curr_offset;
1485 guint8 oct8,subchannel;
1486 guint16 arfcn, hsn, maio;
1487 proto_tree *subtree;
1488 proto_item *item;
1489 const gchar *str;
1490
1491 curr_offset = offset;
1492
1493 item = proto_tree_add_text(tree,tvb, curr_offset, 3, "%s", gsm_rr_elem_strings[DE_RR_CH_DSC].strptr);
1494
1495 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_CH_DSC]);
1496
1497 /* Octet 2 */
1498 oct8 = tvb_get_guint8(tvb, curr_offset);
1499
1500 if ((oct8 & 0xf8) == 0x08)
1501 {
1502 str = "TCH/F + ACCHs";
1503 other_decode_bitfield_value(a_bigbuf, oct8, 0xf8, 8);
1504 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = %s",a_bigbuf,str);
1505 }
1506 else
1507 {
1508 if ((oct8 & 0xf0) == 0x10)
1509 {
1510 str = "TCH/H + ACCHs, Subchannel";
1511 subchannel = ((oct8 & 0x08)>>3);
1512 }
1513 else if ((oct8 & 0xe0) == 0x20)
1514 {
1515 str = "SDCCH/4 + SACCH/C4 or CBCH (SDCCH/4), Subchannel";
1516 subchannel = ((oct8 & 0x18)>>3);
1517 }
1518 else if ((oct8 & 0xc0) == 0x40)
1519 {
1520 str = "SDCCH/8 + SACCH/C8 or CBCH (SDCCH/8), Subchannel";
1521 subchannel = ((oct8 % 0x38)>>3);
1522 } else {
1523 str = "Unknown channel information";
1524 subchannel = oct8;
1525 }
1526
1527 other_decode_bitfield_value(a_bigbuf, oct8, 0xf8, 8);
1528 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = %s %d",a_bigbuf,str,subchannel);
1529 }
1530
1531 other_decode_bitfield_value(a_bigbuf, oct8, 0x07, 8);
1532 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Timeslot: %d",a_bigbuf,(oct8 & 0x07));
1533
1534 curr_offset +=1;
1535
1536 /* Octet 3 */
1537 oct8 = tvb_get_guint8(tvb, curr_offset);
1538 other_decode_bitfield_value(a_bigbuf, oct8, 0xe0, 8);
1539 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Training Sequence: %d",a_bigbuf,((oct8 & 0xe0)>>5));
1540
1541
1542 if ((oct8 & 0x10) == 0x10)
1543 {
1544 /* Hopping sequence */
1545 maio = ((oct8 & 0x0f)<<2) | ((tvb_get_guint8(tvb,curr_offset+1) & 0xc0) >> 6);
1546 hsn = (tvb_get_guint8(tvb,curr_offset+1) & 0x3f);
1547 str = "Yes";
1548
1549 other_decode_bitfield_value(a_bigbuf, oct8, 0x10, 8);
1550 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Hopping channel: %s",a_bigbuf,str);
1551 proto_tree_add_text(subtree,tvb, curr_offset, 2,"Hopping channel: MAIO %d",maio);
1552 proto_tree_add_text(subtree,tvb, curr_offset, 2,"Hopping channel: HSN %d",hsn);
1553 }
1554 else
1555 {
1556 /* single ARFCN */
1557 arfcn = ((oct8 & 0x03) << 8) | tvb_get_guint8(tvb,curr_offset+1);
1558 str = "No";
1559
1560 other_decode_bitfield_value(a_bigbuf, oct8, 0x10, 8);
1561 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Hopping channel: %s",a_bigbuf,str);
1562 other_decode_bitfield_value(a_bigbuf, oct8, 0x0c, 8);
1563 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Spare",a_bigbuf);
1564 proto_tree_add_text(subtree,tvb, curr_offset, 2,"Single channel : ARFCN %d",arfcn);
1565 }
1566
1567 curr_offset = curr_offset + 2;
1568
1569 return(curr_offset - offset);
1570}
1571/*
1572 * [3] 10.5.2.5a Channel Description 2
1573 */
1574static guint16
1575de_rr_ch_dsc2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1576{
1577 guint32 curr_offset;
1578 guint8 oct8,subchannel;
1579 guint16 arfcn, hsn, maio;
1580 proto_tree *subtree;
1581 proto_item *item;
1582 const gchar *str;
1583
1584 curr_offset = offset;
1585
1586 item = proto_tree_add_text(tree,tvb, curr_offset, 3, "%s", gsm_rr_elem_strings[DE_RR_CH_DSC2].strptr);
1587
1588 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_CH_DSC2]);
1589
1590 /* Octet 2 */
1591 oct8 = tvb_get_guint8(tvb, curr_offset);
1592
1593 if ((oct8 & 0xf8) == 0x0)
1594 {
1595 str = "TCH/F + FACCH/F and SACCH/M";
1596 other_decode_bitfield_value(a_bigbuf, oct8, 0xf8, 8);
1597 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = %s",a_bigbuf,str);
1598 }
1599 else if ((oct8 & 0xf8) == 0x08)
1600 {
1601 str = "TCH/F + FACCH/F and SACCH/F";
1602 other_decode_bitfield_value(a_bigbuf, oct8, 0xf8, 8);
1603 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = %s",a_bigbuf,str);
1604 }
1605 else if ((oct8 & 0xf8) == 0xf0)
1606 {
1607 str = "TCH/F + FACCH/F and SACCH/M + bi- and unidirectional channels";
1608 other_decode_bitfield_value(a_bigbuf, oct8, 0xf8, 8);
1609 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = %s",a_bigbuf,str);
1610 }
1611 else
1612 {
1613 if ((oct8 & 0xf0) == 0x10)
1614 {
1615 str = "TCH/H + ACCHs, Subchannel";
1616 subchannel = ((oct8 & 0x08)>>3);
1617 }
1618 else if ((oct8 & 0xe0) == 0x20)
1619 {
1620 str = "SDCCH/4 + SACCH/C4 or CBCH (SDCCH/4), Subchannel";
1621 subchannel = ((oct8 & 0x18)>>3);
1622 }
1623 else if ((oct8 & 0xc0) == 0x40)
1624 {
1625 str = "SDCCH/8 + SACCH/C8 or CBCH (SDCCH/8), Subchannel";
1626 subchannel = ((oct8 % 0x38)>>3);
1627 }
1628 else if ((oct8 & 0xc0) == 0x80)
1629 {
1630 str = "TCH/F + FACCH/F and SACCH/M + bidirectional channels at timeslot";
1631 subchannel = ((oct8 % 0x38)>>3);
1632 }
1633 else if ((oct8 & 0xe0) == 0xc0)
1634 {
1635 str = "TCH/F + FACCH/F and SACCH/M + unidirectional channels at timeslot";
1636 subchannel = ((oct8 % 0x38)>>3);
1637 } else {
1638 str = "Unknown channel information";
1639 subchannel = oct8;
1640 }
1641 other_decode_bitfield_value(a_bigbuf, oct8, 0xf8, 8);
1642 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = %s %d",a_bigbuf,str,subchannel);
1643 }
1644
1645 other_decode_bitfield_value(a_bigbuf, oct8, 0x07, 8);
1646 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Timeslot: %d",a_bigbuf,(oct8 & 0x07));
1647
1648 curr_offset +=1;
1649
1650 /* Octet 3 */
1651 oct8 = tvb_get_guint8(tvb, curr_offset);
1652 other_decode_bitfield_value(a_bigbuf, oct8, 0xe0, 8);
1653 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Training Sequence: %d",a_bigbuf,((oct8 & 0xe0)>>5));
1654
1655 if ((oct8 & 0x10) == 0x10)
1656 {
1657 /* Hopping sequence */
1658 maio = ((oct8 & 0x0f)<<2) | ((tvb_get_guint8(tvb,curr_offset+1) & 0xc0) >> 6);
1659 hsn = (tvb_get_guint8(tvb,curr_offset+1) & 0x3f);
1660 str = "Yes";
1661
1662 other_decode_bitfield_value(a_bigbuf, oct8, 0x10, 8);
1663 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Hopping channel: %s",a_bigbuf,str);
1664 proto_tree_add_text(subtree,tvb, curr_offset, 2,"Hopping channel: MAIO %d",maio);
1665 proto_tree_add_text(subtree,tvb, curr_offset, 2,"Hopping channel: HSN %d",hsn);
1666 }
1667 else
1668 {
1669 /* single ARFCN */
1670 arfcn = ((oct8 & 0x03) << 8) | tvb_get_guint8(tvb,curr_offset+1);
1671 str = "No";
1672
1673 other_decode_bitfield_value(a_bigbuf, oct8, 0x10, 8);
1674 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Hopping channel: %s",a_bigbuf,str);
1675 other_decode_bitfield_value(a_bigbuf, oct8, 0x0c, 8);
1676 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Spare",a_bigbuf);
1677 proto_tree_add_text(subtree,tvb, curr_offset, 2,"Single channel : ARFCN %d",arfcn);
1678 }
1679
1680 curr_offset = curr_offset + 2;
1681
1682 return(curr_offset - offset);
1683}
1684
1685/*
1686 * [3] 10.5.2.5c Channel Description 3
1687 */
1688static guint16
1689de_rr_ch_dsc3(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1690{
1691 guint32 curr_offset;
1692 guint8 oct8;
1693 guint16 arfcn, hsn, maio;
1694 proto_tree *subtree;
1695 proto_item *item;
1696 const gchar *str;
1697
1698 curr_offset = offset;
1699
1700 item = proto_tree_add_text(tree,tvb, curr_offset, 3, "%s", gsm_rr_elem_strings[DE_RR_CH_DSC3].strptr);
1701
1702 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_CH_DSC3]);
1703
1704 /* Octet 2 */
1705 oct8 = tvb_get_guint8(tvb, curr_offset);
1706 other_decode_bitfield_value(a_bigbuf, oct8, 0xe0, 8);
1707 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Training Sequence: %d",a_bigbuf,((oct8 & 0xe0)>>5));
1708
1709 if ((oct8 & 0x10) == 0x10)
1710 {
1711 /* Hopping sequence */
1712 maio = ((oct8 & 0x0f)<<2) | ((tvb_get_guint8(tvb,curr_offset+1) & 0xc0) >> 6);
1713 hsn = (tvb_get_guint8(tvb,curr_offset+1) & 0x3f);
1714 str = "Yes";
1715
1716 other_decode_bitfield_value(a_bigbuf, oct8, 0x10, 8);
1717 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Hopping channel: %s",a_bigbuf,str);
1718 proto_tree_add_text(subtree,tvb, curr_offset, 2,"Hopping channel: MAIO %d",maio);
1719 proto_tree_add_text(subtree,tvb, curr_offset, 2,"Hopping channel: HSN %d",hsn);
1720 }
1721 else
1722 {
1723 /* single ARFCN */
1724 arfcn = ((oct8 & 0x03) << 8) | tvb_get_guint8(tvb,curr_offset+1);
1725 str = "No";
1726
1727 other_decode_bitfield_value(a_bigbuf, oct8, 0x10, 8);
1728 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Hopping channel: %s",a_bigbuf,str);
1729 other_decode_bitfield_value(a_bigbuf, oct8, 0x0c, 8);
1730 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Spare",a_bigbuf);
1731 proto_tree_add_text(subtree,tvb, curr_offset, 2,"Single channel : ARFCN %d",arfcn);
1732 }
1733
1734 curr_offset = curr_offset + 2;
1735
1736 return(curr_offset - offset);
1737}
1738
1739/*
1740 * [3] 10.5.2.6 Channel Mode
1741 */
1742/* Channel Mode */
1743static const value_string gsm_a_rr_channel_mode_vals[] = {
1744 { 0x00, "signalling only"},
1745 { 0x01, "speech full rate or half rate version 1(GSM FR or GSM HR)"},
1746 { 0x21, "speech full rate or half rate version 2(GSM EFR)"},
1747 { 0x41, "speech full rate or half rate version 3(FR AMR or HR AMR)"},
1748 { 0x81, "speech full rate or half rate version 4(OFR AMR-WB or OHR AMR-WB)"},
1749 { 0x82, "speech full rate or half rate version 5(FR AMR-WB )"},
1750 { 0x83, "speech full rate or half rate version 6(OHR AMR )"},
1751 { 0x61, "data, 43.5 kbit/s (downlink)+14.5 kbps (uplink)"},
1752 { 0x62, "data, 29.0 kbit/s (downlink)+14.5 kbps (uplink)"},
1753 { 0x64, "data, 43.5 kbit/s (downlink)+29.0 kbps (uplink)"},
1754 { 0x67, "data, 14.5 kbit/s (downlink)+43.5 kbps (uplink)"},
1755 { 0x65, "data, 14.5 kbit/s (downlink)+29.0 kbps (uplink)"},
1756 { 0x66, "data, 29.0 kbit/s (downlink)+43.5 kbps (uplink)"},
1757 { 0x27, "data, 43.5 kbit/s radio interface rate"},
1758 { 0x63, "data, 32.0 kbit/s radio interface rate"},
1759 { 0x43, "data, 29.0 kbit/s radio interface rate"},
1760 { 0x0f, "data, 14.5 kbit/s radio interface rate"},
1761 { 0x03, "data, 12.0 kbit/s radio interface rate"},
1762 { 0x0b, "data, 6.0 kbit/s radio interface rate"},
1763 { 0x13, "data, 3.6 kbit/s radio interface rate"},
1764 { 0, NULL }
1765};
1766
1767guint16
1768de_rr_ch_mode(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1769{
1770 guint32 curr_offset;
1771
1772 curr_offset = offset;
1773
1774 proto_tree_add_item(tree, hf_gsm_a_rr_channel_mode, tvb, curr_offset, 1, FALSE);
1775
1776 curr_offset = curr_offset + 1;
1777
1778 return(curr_offset - offset);
1779}
1780/*
1781 * [3] 10.5.2.7 Channel Mode 2
1782 */
1783
1784static const value_string gsm_a_rr_channel_mode2_vals[] = {
1785 { 0x00, "signalling only"},
1786 { 0x05, "speech half rate version 1(GSM HR)"},
1787 { 0x25, "speech half rate version 2(GSM EFR)"},
1788 { 0x45, "speech half rate version 3(HR AMR)"},
1789 { 0x85, "speech half rate version 4(OHR AMR-WB)"},
1790 { 0x06, "speech half rate version 6(OHR AMR )"},
1791 { 0x0f, "data, 6.0 kbit/s radio interface rate"},
1792 { 0x17, "data, 3.6 kbit/s radio interface rate"},
1793 { 0, NULL }
1794};
1795
1796static guint16
1797de_rr_ch_mode2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1798{
1799 guint32 curr_offset;
1800
1801 curr_offset = offset;
1802
1803 proto_tree_add_item(tree, hf_gsm_a_rr_channel_mode2, tvb, curr_offset, 1, FALSE);
1804
1805 curr_offset = curr_offset + 1;
1806
1807 return(curr_offset - offset);
1808}
1809/*
1810 * [3] 10.5.2.7a UTRAN Classmark information element
1811 */
1812static guint16
1813de_rr_utran_cm(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1814{
1815 guint32 curr_offset;
1816 tvbuff_t *rrc_irat_ho_info_tvb;
1817 static packet_info p_info;
1818
1819 curr_offset = offset;
1820 if (len)
1821 {
1822 rrc_irat_ho_info_tvb = tvb_new_subset(tvb, curr_offset, len, len);
1823 if (rrc_irat_ho_info_handle)
1824 call_dissector(rrc_irat_ho_info_handle, rrc_irat_ho_info_tvb, &p_info, tree);
1825 }
1826
1827 curr_offset += len;
1828 return(curr_offset - offset);
1829}
1830
1831/*
1832 * [3] 10.5.2.7b (void)
1833 */
1834
1835/*
1836 * [3] 10.5.2.7c Classmark Enquiry Mask
1837 * Bit 8:
1838 * 0 CLASSMARK CHANGE message is requested
1839 * 1 CLASSMARK CHANGE message is not requested
1840 * Bits 7-5 . 5
1841 * 000 UTRAN CLASSMARK CHANGE message including status on predefined configurations (i.e. Sequence Description) is requested
1842 * 111 UTRAN CLASSMARK CHANGE message including status on predefined configurations (i.e. Sequence Description) is not requested.
1843 * All other values shall not be sent. If received, they shall be interpreted as '000'.
1844 * Bit 4:
1845 * 0 CDMA2000 CLASSMARK CHANGE message requested
1846 * 1 CDMA2000 CLASSMARK CHANGE message not requested.
1847 * Bit 3:
1848 * 0 GERAN IU MODE CLASSMARK CHANGE message requested
1849 * 1 GERAN IU MODE CLASSMARK CHANGE message not requested.
1850 * Bits 2 - 1: spare(0).
1851 */
1852static const true_false_string gsm_a_msg_req_value = {
1853 "message is not requested",
1854 "message is requested"
1855};
1856
1857static const value_string gsm_a_rr_utran_cm_cng_msg_req_vals[] = {
1858 { 0x0, "message including status on predefined configurations (i.e. Sequence Description) is requested"},
1859 { 0x1, "message including status on predefined configurations (i.e. Sequence Description) is requested"},
1860 { 0x2, "message including status on predefined configurations (i.e. Sequence Description) is requested"},
1861 { 0x3, "message including status on predefined configurations (i.e. Sequence Description) is requested"},
1862 { 0x4, "message including status on predefined configurations (i.e. Sequence Description) is requested"},
1863 { 0x5, "message including status on predefined configurations (i.e. Sequence Description) is requested"},
1864 { 0x6, "message including status on predefined configurations (i.e. Sequence Description) is requested"},
1865 { 0x7, "message including status on predefined configurations (i.e. Sequence Description) is not requested."},
1866 { 0, NULL }
1867};
1868guint16
1869de_rr_cm_enq_mask(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1870{
1871 guint32 curr_offset;
1872
1873 curr_offset = offset;
1874
1875 proto_tree_add_item(tree, hf_gsm_a_rr_cm_cng_msg_req, tvb, curr_offset, 1, FALSE);
1876 proto_tree_add_item(tree, hf_gsm_a_rr_utran_cm_cng_msg_req, tvb, curr_offset, 1, FALSE);
1877 proto_tree_add_item(tree, hf_gsm_a_rr_cdma200_cm_cng_msg_req, tvb, curr_offset, 1, FALSE);
1878 proto_tree_add_item(tree, hf_gsm_a_rr_geran_iu_cm_cng_msg_req, tvb, curr_offset, 1, FALSE);
1879
1880 curr_offset = curr_offset + 1;
1881
1882 return(curr_offset - offset);
1883}
1884/*
1885 * [3] 10.5.2.8 Channel Needed
1886 */
1887static const value_string gsm_a_rr_channel_needed_vals[] = {
1888 { 0x00, "Any channel"},
1889 { 0x01, "SDCCH"},
1890 { 0x02, "TCH/F (Full rate)"},
1891 { 0x03, "TCH/H or TCH/F (Dual rate)"},
1892 { 0, NULL }
1893};
1894guint16
1895de_rr_chnl_needed(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
1896{
1897 proto_tree *subtree;
1898 proto_item *item;
1899 guint32 curr_offset;
1900 gint bit_offset;
1901
1902 curr_offset = offset;
1903 if (UPPER_NIBBLE==len)
1904 bit_offset = 4;
1905 else
1906 bit_offset = 0;
1907
1908 item = proto_tree_add_text(tree, tvb, curr_offset, 3, "%s",
1909 gsm_rr_elem_strings[DE_RR_CHNL_NEEDED].strptr);
1910
1911 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_CHNL_NEEDED]);
1912
1913 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_chnl_needed_ch1, tvb, (curr_offset<<3)+bit_offset+2, 2, FALSE);
1914 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_chnl_needed_ch2, tvb, (curr_offset<<3)+bit_offset, 2, FALSE);
1915
1916 curr_offset = curr_offset + 1;
1917
1918 return(curr_offset - offset);
1919}
1920/*
1921 * [3] 10.5.2.8a Channel Request Description
1922 * [3] 10.5.2.8b Channel Request Description 2
1923 */
1924/*
1925 * [3] 10.5.2.9 Cipher Mode Setting
1926 */
1927/* SC (octet 1) */
1928static const value_string gsm_a_rr_sc_vals[] = {
1929 { 0, "No ciphering"},
1930 { 1, "Start ciphering"},
1931 { 0, NULL }
1932};
1933/* algorithm identifier
1934 * If SC=1 then:
1935 * bits
1936 * 4 3 2
1937 */
1938guint16
1939de_rr_cip_mode_set(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1940{
1941 guint32 curr_offset;
1942 gint bit_offset;
1943 guint64 value;
1944
1945 curr_offset = offset;
1946
1947 /* Cipher Mode Setting
1948 * Note: The coding of fields SC and algorithm identifier is defined in [44.018]
1949 * as part of the Cipher Mode Setting IE.
1950 */
1951 if (UPPER_NIBBLE==len)
1952 bit_offset = 4;
1953 else
1954 bit_offset = 0;
1955
1956 proto_tree_add_bits_ret_val(tree, hf_gsm_a_rr_sc, tvb, (curr_offset<<3)+bit_offset+3, 1, &value, FALSE);
1957 if (value == 1){ /* Start ciphering */
1958 /* algorithm identifier */
1959 proto_tree_add_bits_item(tree, hf_gsm_a_algorithm_id, tvb, (curr_offset<<3)+bit_offset, 3, FALSE);
1960 }
1961 curr_offset = curr_offset + 1;
1962
1963 return(curr_offset - offset);
1964}
1965/*
1966 * [3] 10.5.2.10 Cipher Response
1967 */
1968/* CR (octet 1) */
1969static const value_string gsm_a_rr_cr_vals[] = {
1970 { 0, "IMEISV shall not be included"},
1971 { 1, "IMEISV shall be included"},
1972 { 0, NULL }
1973};
1974
1975static guint16
1976de_rr_cip_mode_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
1977{
1978 guint32 curr_offset;
1979 gint bit_offset;
1980
1981 curr_offset = offset;
1982 if (UPPER_NIBBLE==len)
1983 bit_offset = 4;
1984 else
1985 bit_offset = 0;
1986
1987 /* Cipher Mode Response
1988 * Note: The coding of field CR is defined in [44.018]
1989 * as part of the Cipher Mode Response IE.
1990 */
1991 proto_tree_add_bits_item(tree, hf_gsm_a_rr_cr, tvb, (curr_offset<<3)+bit_offset+3, 1, FALSE);
1992 curr_offset = curr_offset + 1;
1993
1994 return(curr_offset - offset);
1995}
1996/* [3] 10.5.2.11 Control Channel Description */
1997
1998static const value_string gsm_a_rr_mscr_vals[] = {
1999 { 0, "MSC is Release '98 or older"},
2000 { 1, "MSC is Release '99 onwards"},
2001 { 0, NULL }
2002};
2003
2004static const value_string gsm_a_rr_att_vals[] = {
2005 { 0, "MSs in the cell are not allowed to apply IMSI attach and detach procedure"},
2006 { 1, "MSs in the cell shall apply IMSI attach and detach procedure"},
2007 { 0, NULL }
2008};
2009
2010static const value_string gsm_a_rr_ccch_conf_vals[] = {
2011 { 0, "1 basic physical channel used for CCCH, not combined with SDCCHs"},
2012 { 1, "1 basic physical channel used for CCCH, combined with SDCCHs"},
2013 { 2, "2 basic physical channels used for CCCH, not combined with SDCCHs"},
2014 { 3, "Reserved"},
2015 { 4, "3 basic physical channels used for CCCH, not combined with SDCCHs"},
2016 { 5, "Reserved"},
2017 { 6, "4 basic physical channels used for CCCH, not combined with SDCCHs"},
2018 { 7, "Reserved"},
2019 { 0, NULL }
2020};
2021
2022static const value_string gsm_a_rr_cbq3_vals[] = {
2023 { 0, "Iu mode not supported"},
2024 { 1, "Iu mode capable MSs barred"},
2025 { 2, "Iu mode supported, cell not barred"},
2026 { 3, "Iu mode supported, cell not barred"},
2027 { 0, NULL }
2028};
2029
2030static guint16
2031de_rr_ctrl_ch_desc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2032{
2033 proto_tree *subtree;
2034 proto_item *item;
2035 guint8 oct;
2036 guint32 curr_offset;
2037
2038 curr_offset = offset;
2039
2040 item = proto_tree_add_text(tree, tvb, curr_offset, 3, "%s",
2041 gsm_rr_elem_strings[DE_RR_CTRL_CH_DESC].strptr);
2042
2043 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_CTRL_CH_DESC]);
2044
2045 proto_tree_add_item(subtree, hf_gsm_a_rr_mscr, tvb, curr_offset, 1, FALSE);
2046 proto_tree_add_item(subtree, hf_gsm_a_rr_att, tvb, curr_offset, 1, FALSE);
2047 proto_tree_add_item(subtree, hf_gsm_a_rr_bs_ag_blks_res, tvb, curr_offset, 1, FALSE);
2048 proto_tree_add_item(subtree, hf_gsm_a_rr_ccch_conf, tvb, curr_offset, 1, FALSE);
2049
2050 curr_offset = curr_offset + 1;
2051 oct = tvb_get_guint8(tvb, curr_offset);
2052
2053 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_cbq3, tvb, (curr_offset<<3)+1, 2, FALSE);
2054 proto_tree_add_uint(subtree, hf_gsm_a_rr_bs_pa_mfrms, tvb, curr_offset, 1, (oct&0x07)+2);
2055
2056 curr_offset = curr_offset + 1;
2057
2058 proto_tree_add_item(subtree, hf_gsm_a_rr_t3212, tvb, curr_offset, 1, FALSE);
2059
2060 curr_offset = curr_offset + 1;
2061
2062 return(curr_offset - offset);
2063}
2064
2065/* [3] 10.5.2.11a DTM Information Details
2066 */
2067/*
2068 * [3] 10.5.2.11b Dynamic ARFCN Mapping
2069 */
2070static const value_string gsm_a_rr_gsm_band_vals[] = {
2071 { 0, "GSM 750"},
2072 { 1, "DCS 1800"},
2073 { 2, "PCS 1900"},
2074 { 3, "GSM T 380"},
2075 { 4, "GSM T 410"},
2076 { 5, "GSM T 900"},
2077 { 6, "GSM 710"},
2078 { 7, "GSM T 810"},
2079 { 8, "Reserved"},
2080 { 9, "Reserved"},
2081 { 10, "Reserved"},
2082 { 11, "Reserved"},
2083 { 12, "Reserved"},
2084 { 13, "Reserved"},
2085 { 14, "Reserved"},
2086 { 15, "Reserved"},
2087 { 0, NULL }
2088};
2089
2090
2091static guint16
2092de_rr_dyn_arfcn_map(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2093{
2094 guint32 curr_offset;
2095 gint bit_offset;
2096 guint64 length;
2097 guint value;
2098
2099 curr_offset = offset;
2100 bit_offset = curr_offset << 3;
2101
2102 proto_tree_add_bits_ret_val(tree, hf_gsm_a_rr_dyn_arfcn_length, tvb, bit_offset, 8, &length, FALSE);
2103 value = tvb_get_bits8(tvb,bit_offset,1);
2104 bit_offset += 1;
2105 while (value && length)
2106 {
2107 proto_tree_add_bits_item(tree, hf_gsm_a_rr_gsm_band, tvb, bit_offset, 4, FALSE);
2108 bit_offset += 4;
2109 proto_tree_add_bits_item(tree, hf_gsm_a_rr_arfcn_first, tvb, bit_offset, 10, FALSE);
2110 bit_offset += 10;
2111 proto_tree_add_bits_item(tree, hf_gsm_a_rr_band_offset, tvb, bit_offset, 10, FALSE);
2112 bit_offset += 10;
2113 proto_tree_add_bits_item(tree, hf_gsm_a_rr_arfcn_range, tvb, bit_offset, 7, FALSE);
2114 bit_offset += 7;
2115 value = tvb_get_bits8(tvb,bit_offset,1);
2116 bit_offset += 1;
2117 length -= 4;
2118 }
2119
2120 curr_offset = curr_offset + len;
2121
2122 return(curr_offset - offset);
2123}
2124/*
2125 * [3] 10.5.2.12 Frequency Channel Sequence
2126 */
2127static guint16
2128de_rr_freq_ch_seq(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2129{
2130 guint32 curr_offset;
2131 gint bit_offset, i;
2132
2133 curr_offset = offset;
2134
2135 proto_tree_add_item(tree, hf_gsm_a_rr_lowest_arfcn, tvb, curr_offset, 1, FALSE);
2136 curr_offset += 1;
2137 bit_offset = curr_offset << 3;
2138 for (i=0; i<16; i++)
2139 {
2140 proto_tree_add_bits_item(tree, hf_gsm_a_rr_inc_skip_arfcn, tvb, bit_offset, 4, FALSE);
2141 bit_offset += 4;
2142 }
2143
2144 curr_offset = curr_offset + 8;
2145
2146 return(curr_offset - offset);
2147}
2148
2149/*
2150 * [3] 10.5.2.13 Frequency List
2151 */
2152/*
2153 * [3] 10.5.2.13 Frequency List
2154 *
2155 * Bit Bit Bit Bit Bit format notation
2156 * 8 7 4 3 2
2157 * 0 0 X X X bit map 0
2158 * 1 0 0 X X 1024 range
2159 * 1 0 1 0 0 512 range
2160 * 1 0 1 0 1 256 range
2161 * 1 0 1 1 0 128 range
2162 * 1 0 1 1 1 variable bit map
2163 */
2164/* The mask 0xce (1100 1110) will produce the result 0110 0111*/
2165static const value_string gsm_a_rr_freq_list_format_id_vals[] = {
2166 { 0x00, "bit map 0"},
2167 { 0x02, "bit map 0"},
2168 { 0x04, "bit map 0"},
2169 { 0x06, "bit map 0"},
2170 { 0x08, "bit map 0"},
2171 { 0x0a, "bit map 0"},
2172 { 0x0c, "bit map 0"},
2173 { 0x0e, "bit map 0"},
2174 { 0x40, "1024 range"},
2175 { 0x41, "1024 range"},
2176 { 0x42, "1024 range"},
2177 { 0x43, "1024 range"},
2178 { 0x44, "512 range"},
2179 { 0x45, "256 range"},
2180 { 0x46, "128 range"},
2181 { 0x47, "variable bit map"},
2182 { 0x00, NULL }
2183};
2184static guint16
2185de_rr_freq_list(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2186{
2187 return dissect_arfcn_list(tvb, tree, offset, len, add_string, string_len);
2188}
2189/*
2190 * [3] 10.5.2.14 Frequency Short List
2191 *
2192 *The Frequency Short List information element is a type 3 information element of 10 octet length.
2193 *
2194 * This element is encoded exactly as the Frequency List information element,
2195 * except that it has a fixed length instead of a variable length and does
2196 * not contain a length indicator and that it shall not be encoded in bitmap 0 format.
2197 */
2198
2199 static guint16
2200de_rr_freq_short_list(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2201 {
2202 return dissect_arfcn_list(tvb, tree, offset, 9, add_string, string_len);
2203 }
2204
2205/*
2206 * [3] 10.5.2.14a Frequency Short List 2
2207 *
2208 * The Frequency Short List information element is a type 3 information element of 8 octet length.
2209 *
2210 * This element is encoded exactly as the Frequency List information element,
2211 * except that it has a fixed length instead of a variable length and does
2212 * not contain a length indicator and that it shall not be encoded in bitmap 0 format.
2213 */
2214static guint16
2215de_rr_freq_short_list2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2216{
2217 return dissect_arfcn_list(tvb, tree, offset, 8, add_string, string_len);
2218}
2219/*
2220 * [3] 10.5.2.14b Group Channel Description
2221 */
2222
2223/*
2224 * [3] 10.5.2.14c GPRS Resumption
2225 */
2226static const true_false_string gsm_a_rr_gprs_resumption_ack_value = {
2227 "Resumption of GPRS services successfully acknowledged",
2228 "Resumption of GPRS services not successfully acknowledged"
2229};
2230
2231static guint16
2232de_rr_gprs_resumption(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2233{
2234 guint32 curr_offset;
2235
2236 curr_offset = offset;
2237
2238 proto_tree_add_item(tree, hf_gsm_a_rr_gprs_resumption_ack, tvb, curr_offset, 1, FALSE);
2239 curr_offset += 1;
2240
2241 return (curr_offset - offset);
2242}
2243
2244/*
2245 * [3] 10.5.2.14d GPRS broadcast information
2246 */
2247
2248static gint
2249de_rr_rest_oct_gprs_cell_options(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
2250{
2251 proto_tree *subtree, *subtree2;
2252 proto_item *item, *item2;
2253 gint curr_bit_offset, curr_bit_offset_sav;
2254 guint8 value;
2255
2256 curr_bit_offset = bit_offset;
2257
2258 item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_GPRS_CELL_OPTIONS].strptr);
2259 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_GPRS_CELL_OPTIONS]);
2260 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nmo, tvb, curr_bit_offset, 2, FALSE);
2261 curr_bit_offset += 2;
2262 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_t3168, tvb, curr_bit_offset, 3, FALSE);
2263 curr_bit_offset += 3;
2264 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_t3192, tvb, curr_bit_offset, 3, FALSE);
2265 curr_bit_offset += 3;
2266 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_drx_timer_max, tvb, curr_bit_offset, 3, FALSE);
2267 curr_bit_offset += 3;
2268 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_access_burst_type, tvb, curr_bit_offset, 1, FALSE);
2269 curr_bit_offset += 1;
2270 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_control_ack_type, tvb, curr_bit_offset, 1, FALSE);
2271 curr_bit_offset += 1;
2272 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bs_cv_max, tvb, curr_bit_offset, 4, FALSE);
2273 curr_bit_offset += 4;
2274 if (tvb_get_bits8(tvb,curr_bit_offset,1))
2275 {
2276 curr_bit_offset += 1;
2277 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pan_dec, tvb, curr_bit_offset, 3, FALSE);
2278 curr_bit_offset += 3;
2279 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pan_inc, tvb, curr_bit_offset, 3, FALSE);
2280 curr_bit_offset += 3;
2281 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pan_max, tvb, curr_bit_offset, 3, FALSE);
2282 curr_bit_offset += 3;
2283 }
2284 else
2285 curr_bit_offset += 1;
2286 if (tvb_get_bits8(tvb,curr_bit_offset,1))
2287 { /* Optional extension information */
2288 curr_bit_offset += 1;
2289 curr_bit_offset_sav = curr_bit_offset;
2290 item2 = proto_tree_add_text(subtree, tvb, curr_bit_offset>>3, -1, "%s",
2291 gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_GPRS_CELL_OPTIONS_EXT_INFO].strptr);
2292 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_GPRS_CELL_OPTIONS_EXT_INFO]);
2293 value = tvb_get_bits8(tvb,curr_bit_offset,6);
2294 proto_tree_add_text(subtree2,tvb, curr_bit_offset>>3, 1, "Extension Length: %d", value);
2295 curr_bit_offset += 6;
2296 value += 1;
2297 proto_item_set_len(item2,((curr_bit_offset+value-curr_bit_offset_sav)>>3)+1);
2298 if (tvb_get_bits8(tvb,curr_bit_offset,1))
2299 {
2300 curr_bit_offset += 1;
2301 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_egprs_packet_channel_request, tvb, curr_bit_offset, 1, FALSE);
2302 curr_bit_offset += 1;
2303 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_bep_period, tvb, curr_bit_offset, 4, FALSE);
2304 curr_bit_offset += 4;
2305 value -= 5;
2306 }
2307 else
2308 curr_bit_offset += 1;
2309 value -= 1;
2310 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_pfc_feature_mode, tvb, curr_bit_offset, 1, FALSE);
2311 curr_bit_offset += 1;
2312 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_dtm_support, tvb, curr_bit_offset, 1, FALSE);
2313 curr_bit_offset += 1;
2314 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_bss_paging_coordination, tvb, curr_bit_offset, 1, FALSE);
2315 curr_bit_offset += 1;
2316 value -= 3;
2317 if (value > 0)
2318 { /* Rel 4 extension */
2319 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_ccn_active, tvb, curr_bit_offset, 1, FALSE);
2320 curr_bit_offset += 1;
2321 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_nw_ext_utbf, tvb, curr_bit_offset, 1, FALSE);
2322 curr_bit_offset += 1;
2323 value -= 2;
2324 if (value > 0)
2325 { /* Rel 6 extension */
2326 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_multiple_tbf_capability, tvb, curr_bit_offset, 1, FALSE);
2327 curr_bit_offset += 1;
2328 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_ext_utbf_no_data, tvb, curr_bit_offset, 1, FALSE);
2329 curr_bit_offset += 1;
2330 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_dtm_enhancements_capability, tvb, curr_bit_offset, 1, FALSE);
2331 curr_bit_offset += 1;
2332 value -= 3;
2333 if (tvb_get_bits8(tvb,curr_bit_offset,1))
2334 {
2335 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_dedicated_mode_mbms_notification_support, tvb, bit_offset, 1, FALSE);
2336 bit_offset += 1;
2337 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_mnci_support, tvb, bit_offset, 1, FALSE);
2338 bit_offset += 1;
2339 value -= 2;
2340 }
2341 else
2342 bit_offset += 1;
2343 value -= 1;
2344 if (value > 0)
2345 { /* Rel 7 extension */
2346 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_reduced_latency_access, tvb, bit_offset, 1, FALSE);
2347 bit_offset += 1;
2348 value -= 1;
2349 }
2350 }
2351 }
2352 curr_bit_offset += value;
2353 }
2354 else
2355 curr_bit_offset += 1;
2356 proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
2357
2358 return (curr_bit_offset - bit_offset);
2359}
2360
2361static gint
2362de_rr_rest_oct_gprs_power_control_parameters(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
2363{
2364 proto_tree *subtree;
2365 proto_item *item;
2366 gint curr_bit_offset;
2367
2368 curr_bit_offset = bit_offset;
2369
2370 item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_GPRS_POWER_CONTROL_PARAMS].strptr);
2371 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_GPRS_POWER_CONTROL_PARAMS]);
2372 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_alpha, tvb, curr_bit_offset, 4, FALSE);
2373 curr_bit_offset += 4;
2374 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_t_avg_w, tvb, curr_bit_offset, 5, FALSE);
2375 curr_bit_offset += 5;
2376 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_t_avg_t, tvb, curr_bit_offset, 5, FALSE);
2377 curr_bit_offset += 5;
2378 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_pc_meas_chan, tvb, curr_bit_offset, 1, FALSE);
2379 curr_bit_offset += 1;
2380 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_n_avg_i, tvb, curr_bit_offset, 4, FALSE);
2381 curr_bit_offset += 4;
2382 proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
2383
2384 return (curr_bit_offset - bit_offset);
2385}
2386
2387static guint16
2388de_rr_gprs_broadcast_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len , gchar *add_string _U_, int string_len _U_)
2389{
2390 guint32 curr_offset;
2391 gint bit_offset;
2392
2393 curr_offset = offset;
2394 bit_offset = curr_offset << 3;
2395
2396 bit_offset += de_rr_rest_oct_gprs_cell_options(tvb, tree, bit_offset);
2397 bit_offset += de_rr_rest_oct_gprs_power_control_parameters(tvb, tree, bit_offset);
2398 curr_offset += len;
2399
2400 return (curr_offset - offset);
2401}
2402
2403/*
2404 * [3] 10.5.2.15 Handover Reference
2405 */
2406static guint16
2407de_rr_ho_ref(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2408{
2409 proto_tree *subtree;
2410 proto_item *item;
2411 guint32 curr_offset;
2412
2413 curr_offset = offset;
2414
2415 item =
2416 proto_tree_add_text(tree,
2417 tvb, curr_offset, 1, "%s",
2418 gsm_rr_elem_strings[DE_RR_HO_REF].strptr);
2419
2420 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_HO_REF]);
2421
2422 /* Handover reference value */
2423 proto_tree_add_item(subtree, hf_gsm_a_rr_ho_ref_val, tvb, curr_offset, 1, FALSE);
2424
2425 curr_offset = curr_offset + 1;
2426
2427 return(curr_offset - offset);
2428}
2429/*
2430 * [3] 10.5.2.16 IA Rest Octets
2431 */
2432
2433static guint16
2434de_rr_ia_rest_oct(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2435{
2436 proto_tree *subtree;
2437 proto_item *item;
2438 guint32 curr_offset;
2439
2440 len = tvb_length_remaining(tvb,offset);
2441 if (len==0)
2442 return 0;
2443
2444 curr_offset = offset;
2445
2446 item =
2447 proto_tree_add_text(tree,
2448 tvb, curr_offset, len, "%s",
2449 gsm_rr_elem_strings[DE_RR_IA_REST_OCT].strptr);
2450
2451 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_IA_REST_OCT]);
2452
2453 proto_tree_add_text(subtree,tvb, curr_offset, len ,"Data(Not decoded)");
2454
2455 curr_offset = curr_offset + len;
2456
2457 return curr_offset-offset;
2458}
2459
2460/*
2461 * [3] 10.5.2.17 IAR Rest Octets
2462 */
2463
2464static guint16
2465de_rr_iar_rest_oct(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2466{
2467 proto_tree *subtree;
2468 proto_item *item;
2469 guint32 curr_offset;
2470
2471 len = 3;
2472 curr_offset = offset;
2473
2474 item =
2475 proto_tree_add_text(tree,
2476 tvb, curr_offset, 3, "%s",
2477 gsm_rr_elem_strings[DE_RR_IAR_REST_OCT].strptr);
2478
2479 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_IAR_REST_OCT]);
2480
2481 proto_tree_add_text(subtree,tvb, curr_offset, len ,"Data(Not decoded)");
2482
2483 curr_offset = curr_offset + len;
2484
2485 return curr_offset-offset;
2486}
2487
2488/*
2489 * [3] 10.5.2.18 IAX Rest Octets
2490 */
2491static guint16
2492de_rr_iax_rest_oct(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2493{
2494 proto_tree *subtree;
2495 proto_item *item;
2496 guint32 curr_offset;
2497
2498 len = tvb_length_remaining(tvb,offset);
2499 if (len==0)
2500 return 0;
2501
2502 curr_offset = offset;
2503
2504 item =
2505 proto_tree_add_text(tree,
2506 tvb, curr_offset, len, "%s",
2507 gsm_rr_elem_strings[DE_RR_IAX_REST_OCT].strptr);
2508
2509 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_IAX_REST_OCT]);
2510
2511 proto_tree_add_text(subtree,tvb, curr_offset, len ,"Data(Not decoded)");
2512
2513 curr_offset = curr_offset + len;
2514
2515 return curr_offset-offset;
2516}
2517
2518/*
2519 * [3] 10.5.2.19 L2 Pseudo Length
2520 */
2521static guint16
2522de_rr_l2_pseudo_len(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2523{
2524 proto_tree *subtree;
2525 proto_item *item;
2526 guint32 curr_offset;
2527
2528 curr_offset = offset;
2529
2530 item = proto_tree_add_text(tree,tvb, curr_offset, 1, "%s", gsm_rr_elem_strings[DE_RR_L2_PSEUDO_LEN].strptr);
2531
2532 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_L2_PSEUDO_LEN]);
2533
2534 /* L2 Pseudo Length value */
2535 proto_tree_add_item(subtree, hf_gsm_a_rr_L2_pseudo_len, tvb, curr_offset, 1, FALSE);
2536
2537 curr_offset = curr_offset + 1;
2538
2539 return(curr_offset - offset);
2540}
2541
2542/*
2543 * [3] 10.5.2.20 Measurement Results
2544 */
2545static const true_false_string gsm_a_rr_dtx_vals = {
2546 "DTX was used",
2547 "DTX was not used"
2548};
2549
2550static const value_string gsm_a_rr_rxlev_vals [] = {
2551 { 0, "< -110 dBm"},
2552 { 1, "-110 <= x < -109 dBm"},
2553 { 2, "-109 <= x < -108 dBm"},
2554 { 3, "-108 <= x < -107 dBm"},
2555 { 4, "-107 <= x < -106 dBm"},
2556 { 5, "-106 <= x < -105 dBm"},
2557 { 6, "-105 <= x < -104 dBm"},
2558 { 7, "-104 <= x < -103 dBm"},
2559 { 8, "-103 <= x < -102 dBm"},
2560 { 9, "-102 <= x < -101 dBm"},
2561 {10, "-101 <= x < -100 dBm"},
2562 {11, "-100 <= x < -99 dBm"},
2563 {12, "-99 <= x < -98 dBm"},
2564 {13, "-98 <= x < -97 dBm"},
2565 {14, "-97 <= x < -96 dBm"},
2566 {15, "-96 <= x < -95 dBm"},
2567 {16, "-95 <= x < -94 dBm"},
2568 {17, "-94 <= x < -93 dBm"},
2569 {18, "-93 <= x < -92 dBm"},
2570 {19, "-92 <= x < -91 dBm"},
2571 {20, "-91 <= x < -90 dBm"},
2572 {21, "-90 <= x < -89 dBm"},
2573 {22, "-89 <= x < -88 dBm"},
2574 {23, "-88 <= x < -87 dBm"},
2575 {24, "-87 <= x < -86 dBm"},
2576 {25, "-86 <= x < -85 dBm"},
2577 {26, "-85 <= x < -84 dBm"},
2578 {27, "-84 <= x < -83 dBm"},
2579 {28, "-83 <= x < -82 dBm"},
2580 {29, "-82 <= x < -81 dBm"},
2581 {30, "-81 <= x < -80 dBm"},
2582 {31, "-80 <= x < -79 dBm"},
2583 {32, "-79 <= x < -78 dBm"},
2584 {33, "-78 <= x < -77 dBm"},
2585 {34, "-77 <= x < -76 dBm"},
2586 {35, "-76 <= x < -75 dBm"},
2587 {36, "-75 <= x < -74 dBm"},
2588 {37, "-74 <= x < -73 dBm"},
2589 {38, "-73 <= x < -72 dBm"},
2590 {39, "-72 <= x < -71 dBm"},
2591 {40, "-71 <= x < -70 dBm"},
2592 {41, "-70 <= x < -69 dBm"},
2593 {42, "-69 <= x < -68 dBm"},
2594 {43, "-68 <= x < -67 dBm"},
2595 {44, "-67 <= x < -66 dBm"},
2596 {45, "-66 <= x < -65 dBm"},
2597 {46, "-65 <= x < -64 dBm"},
2598 {47, "-64 <= x < -63 dBm"},
2599 {48, "-63 <= x < -62 dBm"},
2600 {49, "-62 <= x < -61 dBm"},
2601 {50, "-61 <= x < -60 dBm"},
2602 {51, "-60 <= x < -59 dBm"},
2603 {52, "-59 <= x < -58 dBm"},
2604 {53, "-58 <= x < -57 dBm"},
2605 {54, "-57 <= x < -56 dBm"},
2606 {55, "-56 <= x < -55 dBm"},
2607 {56, "-55 <= x < -54 dBm"},
2608 {57, "-54 <= x < -53 dBm"},
2609 {58, "-53 <= x < -52 dBm"},
2610 {59, "-52 <= x < -51 dBm"},
2611 {60, "-51 <= x < -50 dBm"},
2612 {61, "-50 <= x < -49 dBm"},
2613 {62, "-49 <= x < -48 dBm"},
2614 {63, ">= -48 dBm"},
2615 { 0, NULL}
2616};
2617
2618static const true_false_string gsm_a_rr_mv_vals = {
2619 "The measurement results are valid",
2620 "The measurement results are not valid"
2621};
2622
2623static const value_string gsm_a_rr_rxqual_vals [] = {
2624 {0, "BER < 0.2%, Mean value 0.14%"},
2625 {1, "0.2% <= BER < 0.4%, Mean value 0.28%"},
2626 {2, "0.4% <= BER < 0.8%, Mean value 0.57%"},
2627 {3, "0.8% <= BER < 1.6%, Mean value 1.13%"},
2628 {4, "1.6% <= BER < 3.2%, Mean value 2.26%"},
2629 {5, "3.2% <= BER < 6.4%, Mean value 4.53%"},
2630 {6, "6.4% <= BER < 12.8%, Mean value 9.05%"},
2631 {7, "BER > 12.8%, Mean value 18.10%"},
2632 {0, NULL}
2633};
2634
2635static const value_string gsm_a_rr_ncell_vals [] = {
2636 {0, "No neighbour cell measurement result"},
2637 {1, "1 neighbour cell measurement result"},
2638 {2, "2 neighbour cell measurement result"},
2639 {3, "3 neighbour cell measurement result"},
2640 {4, "4 neighbour cell measurement result"},
2641 {5, "5 neighbour cell measurement result"},
2642 {6, "6 neighbour cell measurement result"},
2643 {7, "Neighbour cell information not available for serving cell"},
2644 {0, NULL}
2645};
2646
2647guint16
2648de_rr_meas_res(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2649{
2650 proto_tree *subtree;
2651 proto_item *item;
2652 guint32 curr_offset;
2653 gint bit_offset;
2654 guint64 no_ncell_m;
2655
2656 curr_offset = offset;
2657
2658 item =
2659 proto_tree_add_text(tree,
2660 tvb, curr_offset, 16, "%s",
2661 gsm_rr_elem_strings[DE_RR_MEAS_RES].strptr);
2662 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_MEAS_RES]);
2663
2664 /* 2nd octet */
2665 /* BA-USED */
2666 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ba_used, tvb, curr_offset<<3, 1, FALSE);
2667 /* DTX USED */
2668 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_dtx_used, tvb, (curr_offset<<3)+1, 1, FALSE);
2669 /* RXLEV-FULL-SERVING-CELL */
2670 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rxlev_full_serv_cell, tvb, (curr_offset<<3)+2, 6, FALSE);
2671 curr_offset++;
2672
2673 /* 3rd octet */
2674 /* 3G-BA-USED */
2675 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_ba_used, tvb, curr_offset<<3, 1, FALSE);
2676 /* MEAS-VALID */
2677 proto_tree_add_item(subtree, hf_gsm_a_rr_meas_valid, tvb, curr_offset, 1, FALSE);
2678 /* RXLEV-SUB-SERVING-CELL */
2679 proto_tree_add_item(subtree, hf_gsm_a_rr_rxlev_sub_serv_cell, tvb, curr_offset, 1, FALSE);
2680
2681 curr_offset++;
2682
2683 /* 4th octet */
2684 /* RXQUAL-FULL-SERVING-CELL */
2685 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rxqual_full_serv_cell, tvb, (curr_offset<<3)+1, 3, FALSE);
2686
2687 /* RXQUAL-SUB-SERVING-CELL */
2688 proto_tree_add_item(subtree, hf_gsm_a_rr_rxqual_sub_serv_cell, tvb, curr_offset, 1, FALSE);
2689 /* NO-NCELL-M */
2690 bit_offset = (curr_offset << 3) + 7;
2691 proto_tree_add_bits_ret_val(subtree, hf_gsm_a_rr_no_ncell_m, tvb, bit_offset, 3, &no_ncell_m, FALSE);
2692 bit_offset += 3;
2693 if (no_ncell_m == 7) /* No neighbour cell information available) */
2694 no_ncell_m = 0;
2695 while (no_ncell_m)
2696 {
2697 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rxlev_ncell, tvb, bit_offset, 6, FALSE);
2698 bit_offset += 6;
2699 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bcch_freq_ncell, tvb, bit_offset, 5, FALSE);
2700 bit_offset += 5;
2701 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bsic_ncell, tvb, bit_offset, 6, FALSE);
2702 bit_offset += 6;
2703 no_ncell_m -= 1;
2704 }
2705
2706 return(len);
2707}
2708
2709/*
2710 * [3] 10.5.2.20a GPRS Measurement Results
2711 */
2712/*
2713 * [3] 10.5.2.21 Mobile Allocation
2714 */
2715static guint16
2716de_rr_mob_all(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2717{
2718 guint32 curr_offset;
2719 proto_item *item;
2720 gint i, j;
2721 guint8 value;
2722
2723 curr_offset = offset;
2724
2725 item = proto_tree_add_text(tree, tvb, curr_offset, len, "Bitmap of increasing ARFCNs included in the Mobile Allocation: ");
2726 for(i=len; i>0; i--)
2727 {
2728 value = tvb_get_guint8(tvb,curr_offset+i-1);
2729 for (j=0; j<8; j++)
2730 {
2731 proto_item_append_text(item,"%d",(value>>j)&0x01);
2732 }
2733 }
2734
2735 curr_offset = curr_offset + len;
2736 return(curr_offset - offset);
2737}
2738
2739/*
2740 * [3] 10.5.2.21a Mobile Time Difference
2741 */
2742static guint16
2743de_rr_mob_time_diff(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2744{
2745 guint32 curr_offset;
2746
2747 curr_offset = offset;
2748
2749 proto_tree_add_item(tree, hf_gsm_a_rr_mobile_time_difference, tvb, curr_offset, len, FALSE);
2750
2751 curr_offset = curr_offset + len;
2752 return(curr_offset - offset);
2753
2754}
2755/*
2756 * [3] 10.5.2.21aa MultiRate configuration
2757 */
2758/* Multirate speech version Octet 3 Bits 8 7 6 */
2759static const value_string multirate_speech_ver_vals[] = {
2760 { 1, "Adaptive Multirate speech version 1"},
2761 { 2, "Adaptive Multirate speech version 2"},
2762 { 0, NULL }
2763};
2764/* Bit 5 NSCB: Noise Suppression Control Bit */
2765static const value_string NSCB_vals[] = {
2766 { 0, "Noise Suppression can be used (default)"},
2767 { 1, "Noise Suppression shall be turned off"},
2768 { 0, NULL }
2769};
2770/* Bit 4 ICMI: Initial Codec Mode Indicator */
2771static const value_string ICMI_vals[] = {
2772 { 0, "The initial codec mode is defined by the implicit rule provided in 3GPP TS 05.09"},
2773 { 1, "The initial codec mode is defined by the Start Mode field"},
2774 { 0, NULL }
2775};
2776/*
2777Table 10.5.2.21aa.2: Set of adaptive multirate codec modes field (octet 4)
2778for the Multirate speech version 1
2779*/
2780static const true_false_string gsm_a_rr_set_of_amr_codec_modes = {
2781 "is part of the subset",
2782 "is not part of the subset"
2783};
2784
2785static const value_string gsm_a_rr_amr_threshold_vals[] = {
2786 { 0, "0.0 dB"},
2787 { 1, "0.5 dB"},
2788 { 2, "1.0 dB"},
2789 { 3, "1.5 dB"},
2790 { 4, "2.0 dB"},
2791 { 5, "2.5 dB"},
2792 { 6, "3.0 dB"},
2793 { 7, "3.5 dB"},
2794 { 8, "4.0 dB"},
2795 { 9, "4.5 dB"},
2796 { 10, "5.0 dB"},
2797 { 11, "5.5 dB"},
2798 { 12, "6.0 dB"},
2799 { 13, "6.5 dB"},
2800 { 14, "7.0 dB"},
2801 { 15, "7.5 dB"},
2802 { 16, "8.0 dB"},
2803 { 17, "8.5 dB"},
2804 { 18, "9.0 dB"},
2805 { 19, "9.5 dB"},
2806 { 20, "10.0 dB"},
2807 { 21, "10.5 dB"},
2808 { 22, "11.0 dB"},
2809 { 23, "11.5 dB"},
2810 { 24, "12.0 dB"},
2811 { 25, "12.5 dB"},
2812 { 26, "13.0 dB"},
2813 { 27, "13.5 dB"},
2814 { 28, "14.0 dB"},
2815 { 29, "14.5 dB"},
2816 { 30, "15.0 dB"},
2817 { 31, "15.5 dB"},
2818 { 32, "16.0 dB"},
2819 { 33, "16.5 dB"},
2820 { 34, "17.0 dB"},
2821 { 35, "17.5 dB"},
2822 { 36, "18.0 dB"},
2823 { 37, "18.5 dB"},
2824 { 38, "19.0 dB"},
2825 { 39, "19.5 dB"},
2826 { 40, "20.0 dB"},
2827 { 41, "20.5 dB"},
2828 { 42, "21.0 dB"},
2829 { 43, "21.5 dB"},
2830 { 44, "22.0 dB"},
2831 { 45, "22.5 dB"},
2832 { 46, "23.0 dB"},
2833 { 47, "23.5 dB"},
2834 { 48, "24.0 dB"},
2835 { 49, "24.5 dB"},
2836 { 50, "25.0 dB"},
2837 { 51, "25.5 dB"},
2838 { 52, "26.0 dB"},
2839 { 53, "26.5 dB"},
2840 { 54, "27.0 dB"},
2841 { 55, "27.5 dB"},
2842 { 56, "28.0 dB"},
2843 { 57, "28.5 dB"},
2844 { 58, "29.0 dB"},
2845 { 59, "29.5 dB"},
2846 { 60, "30.0 dB"},
2847 { 61, "30.5 dB"},
2848 { 62, "31.0 dB"},
2849 { 63, "31.5 dB"},
2850 { 0, NULL }
2851};
2852
2853static const value_string gsm_a_rr_amr_hysteresis_vals[] = {
2854 { 0, "0.0 dB"},
2855 { 1, "0.5 dB"},
2856 { 2, "1.0 dB"},
2857 { 3, "1.5 dB"},
2858 { 4, "2.0 dB"},
2859 { 5, "2.5 dB"},
2860 { 6, "3.0 dB"},
2861 { 7, "3.5 dB"},
2862 { 8, "4.0 dB"},
2863 { 9, "4.5 dB"},
2864 { 10, "5.0 dB"},
2865 { 11, "5.5 dB"},
2866 { 12, "6.0 dB"},
2867 { 13, "6.5 dB"},
2868 { 14, "7.0 dB"},
2869 { 15, "7.5 dB"},
2870 { 0, NULL }
2871};
2872
2873guint16
2874de_rr_multirate_conf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2875{
2876 guint32 curr_offset;
2877 guint8 oct;
2878 gint bit_offset, remaining_length, nb_of_params;
2879
2880 curr_offset = offset;
2881
2882 proto_tree_add_item(tree, hf_gsm_a_rr_multirate_speech_ver, tvb, curr_offset, 1, FALSE);
2883 proto_tree_add_item(tree, hf_gsm_a_rr_NCSB, tvb, curr_offset, 1, FALSE);
2884 proto_tree_add_item(tree, hf_gsm_a_rr_ICMI, tvb, curr_offset, 1, FALSE);
2885 /* The initial codec mode is coded as in 3GPP TS 45.009 */
2886 proto_tree_add_item(tree, hf_gsm_a_rr_start_mode, tvb, curr_offset, 1, FALSE);
2887 oct = ( tvb_get_guint8(tvb,curr_offset) &0xe0 ) >> 5;
2888 curr_offset++;
2889 switch ( oct){
2890 case 1:
2891 /* Adaptive Multirate speech version 1 */
2892 /* Set of AMR codec modes */
2893 proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b8, tvb, curr_offset, 1, FALSE);
2894 proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b7, tvb, curr_offset, 1, FALSE);
2895 proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b6, tvb, curr_offset, 1, FALSE);
2896 proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b5, tvb, curr_offset, 1, FALSE);
2897 proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b4, tvb, curr_offset, 1, FALSE);
2898 proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b3, tvb, curr_offset, 1, FALSE);
2899 proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b2, tvb, curr_offset, 1, FALSE);
2900 proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v1_b1, tvb, curr_offset, 1, FALSE);
2901 curr_offset++;
2902
2903 remaining_length = len-2;
2904 break;
2905 case 2:
2906 /* Adaptive Multirate speech version 2 */
2907 proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v2_b5, tvb, curr_offset, 1, FALSE);
2908 proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v2_b4, tvb, curr_offset, 1, FALSE);
2909 proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v2_b3, tvb, curr_offset, 1, FALSE);
2910 proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v2_b2, tvb, curr_offset, 1, FALSE);
2911 proto_tree_add_item(tree, hf_gsm_a_rr_set_of_amr_codec_modes_v2_b1, tvb, curr_offset, 1, FALSE);
2912 curr_offset++;
2913
2914 remaining_length = len-2;
2915 break;
2916 default:
2917 proto_tree_add_text(tree,tvb,offset,1,"Unknown version");
2918 proto_tree_add_text(tree,tvb, curr_offset, len-1 ,"Data(Not decoded)");
2919 remaining_length = 0;
2920 break;
2921 }
2922
2923 if (remaining_length)
2924 {
2925 bit_offset = (curr_offset<<3) + 2;
2926 nb_of_params = remaining_length - 1;
2927 while (nb_of_params)
2928 {
2929 proto_tree_add_bits_item(tree, hf_gsm_a_rr_amr_threshold, tvb, bit_offset, 6, FALSE);
2930 bit_offset += 6;
2931 proto_tree_add_bits_item(tree, hf_gsm_a_rr_amr_hysteresis, tvb, bit_offset, 4, FALSE);
2932 bit_offset += 4;
2933 nb_of_params -= 1;
2934 }
2935 }
2936
2937 curr_offset = offset + len;
2938 return(curr_offset - offset);
2939
2940}
2941/*
2942 * [3] 10.5.2.21b Multislot Allocation
2943 */
2944static guint16
2945de_rr_mult_all(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
2946{
2947 guint32 curr_offset;
2948
2949 curr_offset = offset;
2950
2951 proto_tree_add_text(tree,tvb, curr_offset, len ,"Data(Not decoded)");
2952
2953 curr_offset = curr_offset + len;
2954 return(curr_offset - offset);
2955
2956}
2957/*
2958 * [3] 10.5.2.21c NC mode
2959 */
2960
2961 /*
2962 * [3] 10.5.2.22 Neighbour Cell Description
2963 */
2964static const value_string gsm_a_rr_ext_ind_vals[] = {
2965 { 0, "The information element carries the complete BA"},
2966 { 1, "The information element carries only a part of the BA"},
2967 { 0, NULL }
2968};
2969static guint16
2970de_rr_neigh_cell_desc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2971{
2972 guint32 curr_offset;
2973
2974 curr_offset = offset;
2975
2976 proto_tree_add_item(tree, hf_gsm_a_rr_ext_ind, tvb, curr_offset, 1, FALSE);
2977 proto_tree_add_bits_item(tree, hf_gsm_a_rr_ba_ind, tvb, (curr_offset<<3)+3, 1, FALSE);
2978
2979 return dissect_arfcn_list(tvb, tree, offset, 16, add_string, string_len);
2980}
2981
2982 /*
2983 * [3] 10.5.2.22a Neighbour Cell Description 2
2984 */
2985static guint16
2986de_rr_neigh_cell_desc2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
2987{
2988 guint32 curr_offset;
2989
2990 curr_offset = offset;
2991
2992 proto_tree_add_bits_item(tree, hf_gsm_a_rr_multiband_reporting, tvb, (curr_offset<<3)+1, 2, FALSE);
2993 proto_tree_add_bits_item(tree, hf_gsm_a_rr_ba_ind, tvb, (curr_offset<<3)+3, 1, FALSE);
2994
2995 return dissect_arfcn_list(tvb, tree, offset, 16, add_string, string_len);
2996}
2997
2998/*
2999 * [3] 10.5.2.22b (void)
3000 * [3] 10.5.2.22c NT/N Rest Octets
3001 */
3002
3003/*
3004 * [3] 10.5.2.23 P1 Rest Octets
3005 */
3006static guint16
3007de_rr_p1_rest_oct(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3008{
3009 proto_tree *subtree;
3010 proto_item *item, *item2;
3011 guint32 curr_offset, value;
3012 gint bit_offset, bit_offset_sav, i;
3013
3014 curr_offset = offset;
3015 bit_offset = curr_offset << 3;
3016 len = tvb_length_remaining(tvb,offset);
3017
3018 item = proto_tree_add_text(tree, tvb, curr_offset, len, "%s",
3019 gsm_rr_elem_strings[DE_RR_P1_REST_OCT].strptr);
3020
3021 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_P1_REST_OCT]);
3022
3023 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3024 {
3025 bit_offset += 1;
3026 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nln_pch, tvb, bit_offset, 2, FALSE);
3027 bit_offset += 2;
3028 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nln_status_pch, tvb, bit_offset, 1, FALSE);
3029 bit_offset += 1;
3030 }
3031 else
3032 bit_offset += 1;
3033 for (i=1; i<=2; i++)
3034 {
3035 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3036 {
3037 bit_offset += 1;
3038 item2 = proto_tree_add_bits_item(subtree, hf_gsm_a_call_prio, tvb, bit_offset, 3, FALSE);
3039 bit_offset += 3;
3040 proto_item_append_text(item2, " for Mobile Identity %d", i);
3041 }
3042 else
3043 bit_offset += 1;
3044 }
3045 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3046 { /* Group Call Information */
3047 bit_offset += 1;
3048 bit_offset_sav = bit_offset;
3049 bit_offset += 36;
3050 if (tvb_get_bits8(tvb,bit_offset,1))
3051 { /* Group Channel Description */
3052 bit_offset += 24+1;
3053 if (tvb_get_bits8(tvb,bit_offset,1))
3054 { /* Hopping case */
3055 bit_offset += 1;
3056 if (tvb_get_bits8(tvb,bit_offset,1))
3057 {
3058 bit_offset += 64+1;
3059 }
3060 else
3061 {
3062 bit_offset += 1;
3063 value = tvb_get_bits8(tvb,bit_offset,8);
3064 bit_offset += 8 + (value<<3);
3065 }
3066 }
3067 else
3068 bit_offset += 1;
3069 }
3070 else
3071 bit_offset += 1;
3072 proto_tree_add_text(subtree,tvb, bit_offset_sav>>3, (bit_offset-bit_offset_sav)>>3,"Group Call Information: Data(Not decoded)");
3073 }
3074 else
3075 bit_offset += 1;
3076 for (i=1; i<=2; i++)
3077 {
3078 item2 = proto_tree_add_text(subtree,tvb, bit_offset>>3, 1, "Packet Page Indication %d: ", i);
3079 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3080 proto_item_append_text(item2, "Packet paging procedure");
3081 else
3082 proto_item_append_text(item2, "Paging procedure for RR connection establishment");
3083 bit_offset += 1;
3084 }
3085 if (((curr_offset + len)<<3) - bit_offset > 0)
3086 {
3087 /* There is still room left in the Rest Octets IE */
3088 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3089 { /* Additions in release 6 */
3090 bit_offset += 1;
3091 proto_tree_add_text(subtree, tvb, bit_offset>>3, -1,"Additions in Release 6: Data(Not decoded)");
3092 }
3093 else
3094 bit_offset += 1;
3095 }
3096
3097 curr_offset = curr_offset + len;
3098
3099 return (curr_offset - offset);
3100}
3101
3102/*
3103 * [3] 10.5.2.24 P2 Rest Octets
3104 */
3105static guint16
3106de_rr_p2_rest_oct(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3107
3108{
3109 proto_tree *subtree;
3110 proto_item *item, *item2;
3111 guint32 curr_offset;
3112 gint bit_offset, i;
3113
3114 curr_offset = offset;
3115 bit_offset = curr_offset << 3;
3116 len = tvb_length_remaining(tvb,offset);
3117
3118 item = proto_tree_add_text(tree, tvb, curr_offset, len, "%s",
3119 gsm_rr_elem_strings[DE_RR_P2_REST_OCT].strptr);
3120
3121 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_P2_REST_OCT]);
3122
3123 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3124 {
3125 bit_offset += 1;
3126 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_chnl_needed_ch3, tvb, bit_offset, 2, FALSE);
3127 bit_offset += 2;
3128 }
3129 else
3130 bit_offset += 1;
3131 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3132 {
3133 bit_offset += 1;
3134 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nln_pch, tvb, bit_offset, 2, FALSE);
3135 bit_offset += 2;
3136 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nln_status_pch, tvb, bit_offset, 1, FALSE);
3137 bit_offset += 1;
3138 }
3139 else
3140 bit_offset += 1;
3141 for (i=1; i<=3; i++)
3142 {
3143 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3144 {
3145 bit_offset += 1;
3146 item2 = proto_tree_add_bits_item(subtree, hf_gsm_a_call_prio, tvb, bit_offset, 3, FALSE);
3147 bit_offset += 3;
3148 proto_item_append_text(item2, " for Mobile Identity %d", i);
3149 }
3150 else
3151 bit_offset += 1;
3152 }
3153 item2 = proto_tree_add_text(subtree,tvb, bit_offset>>3, 1, "Packet Page Indication 3: ");
3154 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3155 proto_item_append_text(item2, "Packet paging procedure");
3156 else
3157 proto_item_append_text(item2, "Paging procedure for RR connection establishment");
3158 bit_offset += 1;
3159 if (((curr_offset + len)<<3) - bit_offset > 0)
3160 {
3161 /* There is still room left in the Rest Octets IE */
3162 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3163 { /* Additions in release 6 */
3164 bit_offset += 1;
3165 proto_tree_add_text(subtree, tvb, bit_offset>>3, -1,"Additions in Release 6: Data(Not decoded)");
3166 }
3167 else
3168 bit_offset += 1;
3169 }
3170
3171 curr_offset = curr_offset + len;
3172
3173 return (curr_offset - offset);
3174}
3175
3176/*
3177 * [3] 10.5.2.25 P3 Rest Octets
3178 */
3179static guint16
3180de_rr_p3_rest_oct(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3181{
3182 proto_tree *subtree;
3183 proto_item *item, *item2;
3184 guint32 curr_offset;
3185 gint bit_offset, i;
3186
3187 curr_offset = offset;
3188 bit_offset = curr_offset << 3;
3189 len = 3;
3190
3191 item = proto_tree_add_text(tree, tvb, curr_offset, len, "%s",
3192 gsm_rr_elem_strings[DE_RR_P3_REST_OCT].strptr);
3193
3194 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_P3_REST_OCT]);
3195
3196 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3197 {
3198 bit_offset += 1;
3199 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_chnl_needed_ch3, tvb, bit_offset, 2, FALSE);
3200 bit_offset += 2;
3201 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_chnl_needed_ch4, tvb, bit_offset, 2, FALSE);
3202 bit_offset += 2;
3203 }
3204 else
3205 bit_offset += 1;
3206 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3207 {
3208 bit_offset += 1;
3209 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nln_pch, tvb, bit_offset, 2, FALSE);
3210 bit_offset += 2;
3211 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nln_status_pch, tvb, bit_offset, 1, FALSE);
3212 bit_offset += 1;
3213 }
3214 else
3215 bit_offset += 1;
3216 for (i=1; i<=4; i++)
3217 {
3218 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3219 {
3220 bit_offset += 1;
3221 item2 = proto_tree_add_bits_item(subtree, hf_gsm_a_call_prio, tvb, bit_offset, 3, FALSE);
3222 bit_offset += 3;
3223 proto_item_append_text(item2, " for Mobile Identity %d", i);
3224 }
3225 else
3226 bit_offset += 1;
3227 }
3228
3229 curr_offset = curr_offset + len;
3230
3231 return (curr_offset - offset);
3232}
3233
3234/*
3235 * [3] 10.5.2.25a Packet Channel Description C V 3
3236 */
3237static guint16
3238de_rr_packet_ch_desc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3239{
3240 guint32 curr_offset;
3241 guint8 oct8;
3242 guint16 arfcn, hsn, maio;
3243 proto_tree *subtree;
3244 proto_item *item;
3245 const gchar *str;
3246
3247 curr_offset = offset;
3248
3249 item = proto_tree_add_text(tree,tvb,curr_offset,3, "%s", gsm_rr_elem_strings[DE_RR_PACKET_CH_DESC].strptr);
3250 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_PACKET_CH_DESC]);
3251
3252 /* Octet 2 */
3253 oct8 = tvb_get_guint8(tvb, curr_offset);
3254 /* Channel Type */
3255 str = "Spare bits (ignored by receiver)";
3256 other_decode_bitfield_value(a_bigbuf, oct8, 0xf8, 8);
3257 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = %s",a_bigbuf,str);
3258 /* TN */
3259 other_decode_bitfield_value(a_bigbuf, oct8, 0x07, 8);
3260 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Timeslot: %d",a_bigbuf,(oct8 & 0x07));
3261
3262 curr_offset +=1;
3263
3264 /* Octet 3 */
3265 oct8 = tvb_get_guint8(tvb, curr_offset);
3266 other_decode_bitfield_value(a_bigbuf, oct8, 0xe0, 8);
3267 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Training Sequence: %d",a_bigbuf,((oct8 & 0xe0)>>5));
3268
3269 if ((oct8 & 0x10) == 0x10)
3270 {
3271 /* Hopping sequence */
3272 maio = ((oct8 & 0x0f)<<2) | ((tvb_get_guint8(tvb,curr_offset+1) & 0xc0) >> 6);
3273 hsn = (tvb_get_guint8(tvb,curr_offset+1) & 0x3f);
3274 str = "Yes";
3275
3276 other_decode_bitfield_value(a_bigbuf, oct8, 0x10, 8);
3277 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Hopping channel: %s",a_bigbuf,str);
3278 proto_tree_add_text(subtree,tvb, curr_offset, 2,"Hopping channel: MAIO %d",maio);
3279 proto_tree_add_text(subtree,tvb, curr_offset, 2,"Hopping channel: HSN %d",hsn);
3280 }
3281 else
3282 {
3283 /* single ARFCN */
3284 arfcn = ((oct8 & 0x03) << 8) | tvb_get_guint8(tvb,curr_offset+1);
3285 str = "No";
3286 other_decode_bitfield_value(a_bigbuf, oct8, 0x10, 8);
3287 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Hopping channel: %s",a_bigbuf,str);
3288 other_decode_bitfield_value(a_bigbuf, oct8, 0x0c, 8);
3289 proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = Spare",a_bigbuf);
3290 proto_tree_add_text(subtree,tvb, curr_offset, 2,"Single channel : ARFCN %d",arfcn);
3291 }
3292
3293 curr_offset = curr_offset + 2;
3294 return(curr_offset - offset);
3295
3296}
3297/*
3298 * [3] 10.5.2.25b Dedicated mode or TBF
3299 */
3300
3301static const value_string gsm_a_rr_dedicated_mode_or_tbf_vals[] = {
3302 { 0, "This message assigns a dedicated mode resource"},
3303 { 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"},
3304 { 2, "Not used"},
3305 { 3, "This message assigns a downlink TBF to the mobile station identified in the IA Rest Octets IE"},
3306 { 4, "Not used"},
3307 { 5, "This message is the first message of two in a two-message assignment of an uplink TBF"},
3308 { 6, "Not used"},
3309 { 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"},
3310 { 0, NULL }
3311};
3312static guint16
3313de_rr_ded_mod_or_tbf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3314{
3315 proto_tree *subtree;
3316 proto_item *item;
3317 guint32 curr_offset;
3318
3319 curr_offset = offset;
3320
3321 item =
3322 proto_tree_add_text(tree,
3323 tvb, curr_offset, 1, "%s",
3324 gsm_rr_elem_strings[DE_RR_DED_MOD_OR_TBF].strptr);
3325
3326 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_DED_MOD_OR_TBF]);
3327
3328 proto_tree_add_item(subtree, hf_gsm_a_rr_dedicated_mode_or_tbf, tvb, curr_offset, 1, FALSE);
3329
3330 curr_offset += 1;
3331
3332 return(curr_offset - offset);
3333}
3334/*
3335 * [3] 10.5.2.25c RR Packet Uplink Assignment
3336 * [3] 10.5.2.25d RR Packet Downlink Assignment
3337 */
3338/*
3339 * [3] 10.5.2.26 Page Mode
3340 */
3341
3342static const value_string gsm_a_rr_page_mode_vals[] = {
3343 { 0, "Normal paging"},
3344 { 1, "Extended paging"},
3345 { 2, "Paging reorganization"},
3346 { 3, "Same as before"},
3347 { 0, NULL }
3348};
3349static guint16
3350de_rr_page_mode(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3351{
3352 proto_tree *subtree;
3353 proto_item *item;
3354 guint32 curr_offset;
3355
3356 curr_offset = offset;
3357
3358 item =
3359 proto_tree_add_text(tree,
3360 tvb, curr_offset, 1, "%s",
3361 gsm_rr_elem_strings[DE_RR_PAGE_MODE].strptr);
3362
3363 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_PAGE_MODE]);
3364
3365 proto_tree_add_item(subtree, hf_gsm_a_rr_page_mode, tvb, curr_offset, 1, FALSE);
3366
3367 curr_offset += 1;
3368
3369 return(curr_offset - offset);
3370}
3371/*
3372 * [3] 10.5.2.26a (void)
3373 * [3] 10.5.2.26b (void)
3374 * [3] 10.5.2.26c (void)
3375 * [3] 10.5.2.26d (void)
3376 */
3377/*
3378 * [3] 10.5.2.27 NCC Permitted
3379 */
3380static guint16
3381de_rr_ncc_perm(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3382{
3383 proto_tree *subtree;
3384 proto_item *item;
3385 guint32 curr_offset;
3386
3387 curr_offset = offset;
3388
3389 item = proto_tree_add_text(tree, tvb, curr_offset, 1, "%s",
3390 gsm_rr_elem_strings[DE_RR_NCC_PERM].strptr);
3391
3392 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_NCC_PERM]);
3393
3394 proto_tree_add_item(subtree, hf_gsm_a_rr_ncc_permitted, tvb, curr_offset, 1, FALSE);
3395
3396 curr_offset = curr_offset + 1;
3397
3398 return(curr_offset - offset);
3399}
3400/*
3401 * [3] 10.5.2.28 Power Command
3402 *
3403 *
3404 * ATC (Access Type Control) (octet 2)Bit 8
3405 * 0 Sending of Handover access is mandatory
3406 * 1 Sending of Handover access is optional
3407 */
3408static const true_false_string gsm_a_rr_pow_cmd_atc_value = {
3409 "Sending of Handover access is optional",
3410 "Sending of Handover access is mandatory"
3411};
3412/*
3413 * The EPC mode field (octet 2) indicates whether the assigned channel(s)
3414 * shall be in enhanced power control (EPC) mode. It is only valid for channels
3415 * on which EPC may be used. It is coded as follows:
3416*/
3417static const true_false_string gsm_a_rr_pow_cmd_epc_value = {
3418 "Channel(s) in EPC mode",
3419 "Channel(s) not in EPC mode"
3420};
3421/*
3422 * FPC_EPC (octet 2)
3423 * The FPC_EPC field (octet 2) has different interpretation depending
3424 * on the channel mode of the assigned channel (s) and the value
3425 * of the EPC mode field.
3426 * If the channel mode is such that fast power control (FPC) may be
3427 * used, the FPC_EPC field indicates whether Fast Measurement
3428 * Reporting and Power Control mechanism is used.
3429 * It is coded as follows:
3430 * Value 0 FPC not in use
3431 * 1 FPC in use
3432 * If the channel mode is such that EPC may be used and the EPC mode
3433 * field indicates that the channel is in EPC mode, the FPC_EPC
3434 * field indicates whether EPC shall be used for uplink power control.
3435 * It is coded as follows:
3436 * Value 0 EPC not in use for uplink power control
3437 * 1 EPC in use for uplink power control
3438 *
3439 */
3440static const true_false_string gsm_a_rr_pow_cmd_fpcepc_value = {
3441 "FPC in use/EPC in use for uplink power control",
3442 "FPC not in use/C not in use for uplink power control"
3443};
3444
3445/*
3446 * Power level (octet 2)The power level field is coded as the binaryRepresentation
3447 * of the "power control level", see 3GPP TS 3GPP TS 45.005. This value shall be used
3448 * by the mobile station According to 3GPP TS 45.008.Range: 0 to 31.
3449 */
3450
3451static guint16
3452de_rr_pow_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3453{
3454 proto_tree *subtree;
3455 proto_item *item;
3456 guint32 curr_offset;
3457
3458 curr_offset = offset;
3459
3460 item =
3461 proto_tree_add_text(tree,
3462 tvb, curr_offset, 1, "%s",
3463 gsm_rr_elem_strings[DE_RR_POW_CMD].strptr);
3464
3465 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_POW_CMD]);
3466
3467 proto_tree_add_item(subtree, hf_gsm_a_b8spare, tvb, curr_offset, 1, FALSE);
3468 /*EPC mode */
3469 proto_tree_add_item(subtree, hf_gsm_a_rr_pow_cmd_epc, tvb, curr_offset, 1, FALSE);
3470 /*FPC_EPC*/
3471 proto_tree_add_item(subtree, hf_gsm_a_rr_pow_cmd_fpcepc, tvb, curr_offset, 1, FALSE);
3472 /*POWER LEVEL*/
3473 proto_tree_add_item(subtree, hf_gsm_a_rr_pow_cmd_powlev, tvb, curr_offset, 1, FALSE);
3474
3475 curr_offset = curr_offset + 1;
3476
3477 return(curr_offset - offset);
3478}
3479
3480/*
3481 * [3] 10.5.2.28a Power Command and access type
3482 */
3483static guint16
3484de_rr_pow_cmd_and_acc_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3485{
3486 proto_tree *subtree;
3487 proto_item *item;
3488 guint32 curr_offset;
3489
3490 curr_offset = offset;
3491
3492 item =
3493 proto_tree_add_text(tree,
3494 tvb, curr_offset, 1, "%s",
3495 gsm_rr_elem_strings[DE_RR_POW_CMD_AND_ACC_TYPE].strptr);
3496
3497 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_POW_CMD_AND_ACC_TYPE]);
3498
3499 /*ATC */
3500 proto_tree_add_item(subtree, hf_gsm_a_rr_pow_cmd_atc, tvb, curr_offset, 1, FALSE);
3501 /*EPC mode */
3502 proto_tree_add_item(subtree, hf_gsm_a_rr_pow_cmd_epc, tvb, curr_offset, 1, FALSE);
3503 /*FPC_EPC*/
3504 proto_tree_add_item(subtree, hf_gsm_a_rr_pow_cmd_fpcepc, tvb, curr_offset, 1, FALSE);
3505 /*POWER LEVEL*/
3506 proto_tree_add_item(subtree, hf_gsm_a_rr_pow_cmd_powlev, tvb, curr_offset, 1, FALSE);
3507
3508 curr_offset = curr_offset + 1;
3509
3510 return(curr_offset - offset);
3511}
3512/*
3513 * [3] 10.5.2.29 RACH Control Parameters
3514 */
3515
3516static const value_string gsm_a_rr_max_retrans_vals[] = {
3517 { 0, "Maximum 1 retransmission"},
3518 { 1, "Maximum 2 retransmissions"},
3519 { 2, "Maximum 4 retransmissions"},
3520 { 3, "Maximum 7 retransmissions"},
3521 { 0, NULL }
3522};
3523
3524static const value_string gsm_a_rr_tx_integer_vals[] = {
3525 { 0, "3 slots used to spread transmission"},
3526 { 1, "4 slots used to spread transmission"},
3527 { 2, "5 slots used to spread transmission"},
3528 { 3, "6 slots used to spread transmission"},
3529 { 4, "7 slots used to spread transmission"},
3530 { 5, "8 slots used to spread transmission"},
3531 { 6, "9 slots used to spread transmission"},
3532 { 7, "10 slots used to spread transmission"},
3533 { 8, "11 slots used to spread transmission"},
3534 { 9, "12 slots used to spread transmission"},
3535 { 10, "14 slots used to spread transmission"},
3536 { 11, "16 slots used to spread transmission"},
3537 { 12, "20 slots used to spread transmission"},
3538 { 13, "25 slots used to spread transmission"},
3539 { 14, "32 slots used to spread transmission"},
3540 { 15, "50 slots used to spread transmission"},
3541 { 0, NULL }
3542};
3543static const value_string gsm_a_rr_cell_barr_access_vals[] = {
3544 { 0, "The cell is not barred"},
3545 { 1, "The cell is barred"},
3546 { 0, NULL }
3547};
3548static const value_string gsm_a_rr_re_vals[] = {
3549 { 0, "Call Reestablishment allowed in the cell"},
3550 { 1, "Call Reestablishment not allowed in the cell"},
3551 { 0, NULL }
3552};
3553
3554static guint16
3555de_rr_rach_ctrl_param(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3556{
3557 proto_tree *subtree;
3558 proto_item *item;
3559 guint32 curr_offset;
3560
3561 curr_offset = offset;
3562
3563 item = proto_tree_add_text(tree, tvb, curr_offset, 3, "%s",
3564 gsm_rr_elem_strings[DE_RR_RACH_CTRL_PARAM].strptr);
3565
3566 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_RACH_CTRL_PARAM]);
3567
3568 proto_tree_add_item(subtree, hf_gsm_a_rr_max_retrans, tvb, curr_offset, 1, FALSE);
3569 proto_tree_add_item(subtree, hf_gsm_a_rr_tx_integer, tvb, curr_offset, 1, FALSE);
3570 proto_tree_add_item(subtree, hf_gsm_a_rr_cell_barr_access, tvb, curr_offset, 1, FALSE);
3571 proto_tree_add_item(subtree, hf_gsm_a_rr_re, tvb, curr_offset, 1, FALSE);
3572 curr_offset = curr_offset + 1;
3573
3574 proto_tree_add_item(subtree, hf_gsm_a_rr_acc, tvb, curr_offset, 2, FALSE);
3575
3576 curr_offset = curr_offset + 2;
3577
3578 return(curr_offset - offset);
3579}
3580/*
3581 * [3] 10.5.2.30 Request Reference M V 3
3582 */
3583static guint16 reduced_frame_number(guint16 fn)
3584{
3585 /* great care needed with signed/unsigned - -1 in unsigned is 0xffff, which mod(26) is not what you think !!! */
3586 gint16 t2, t3, t;
3587 guint16 frame, t1;
3588
3589 t1 = (fn >> 11) & 0x1f;
3590 t2 = (fn >> 0) & 0x1f;
3591 t3 = (fn >> 5) & 0x3f;
3592
3593 t = (t3-t2)%26;
3594 if (t<0)
3595 t += 26;
3596
3597 frame = 51*(unsigned)t+(unsigned)t3+51*26*t1;
3598
3599 return frame;
3600}
3601
3602static guint16
3603de_rr_req_ref(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3604{
3605 proto_tree *subtree;
3606 proto_item *item;
3607 guint32 curr_offset;
3608 guint16 rfn;
3609 guint16 fn;
3610
3611 curr_offset = offset;
3612
3613 item =
3614 proto_tree_add_text(tree,
3615 tvb, curr_offset, 3, "%s",
3616 gsm_rr_elem_strings[DE_RR_REQ_REF].strptr);
3617
3618 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_REQ_REF]);
3619
3620 proto_tree_add_item(subtree, hf_gsm_a_rr_ra, tvb, curr_offset, 1, FALSE);
3621 curr_offset++;
3622 fn = tvb_get_ntohs(tvb,curr_offset);
3623 rfn = reduced_frame_number(fn);
3624 proto_tree_add_item(subtree, hf_gsm_a_rr_T1prim, tvb, curr_offset, 1, FALSE);
3625 proto_tree_add_item(subtree, hf_gsm_a_rr_T3, tvb, curr_offset, 2, FALSE);
3626 curr_offset++;
3627 proto_tree_add_item(subtree, hf_gsm_a_rr_T2, tvb, curr_offset, 1, FALSE);
3628 curr_offset++;
3629 item = proto_tree_add_uint(subtree, hf_gsm_a_rr_rfn, tvb, curr_offset-2, 2, rfn);
3630 PROTO_ITEM_SET_GENERATED(item);
3631
3632 return(curr_offset - offset);
3633}
3634/*
3635 * [3] 10.5.2.31
3636 */
3637guint16
3638de_rr_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
3639{
3640 guint32 curr_offset;
3641
3642 curr_offset = offset;
3643
3644 proto_tree_add_item(tree, hf_gsm_a_rr_RR_cause, tvb, curr_offset, 1, FALSE);
3645
3646 curr_offset++;
3647
3648 return(curr_offset - offset);
3649}
3650
3651/*
3652 * [3] 10.5.2.32 SI 1 Rest Octets
3653 */
3654static const value_string gsm_a_rr_nch_position_vals[] = {
3655 { 0, "No of blocks = 1 and Number of first block = 0"},
3656 { 1, "No of blocks = 1 and Number of first block = 1"},
3657 { 2, "No of blocks = 1 and Number of first block = 2"},
3658 { 3, "No of blocks = 1 and Number of first block = 3"},
3659 { 4, "No of blocks = 1 and Number of first block = 4"},
3660 { 5, "No of blocks = 1 and Number of first block = 5"},
3661 { 6, "No of blocks = 1 and Number of first block = 6"},
3662 { 7, "No of blocks = 1 and Number of first block = 0"},
3663 { 8, "No of blocks = 2 and Number of first block = 1"},
3664 { 9, "No of blocks = 2 and Number of first block = 2"},
3665 {10, "No of blocks = 2 and Number of first block = 3"},
3666 {11, "No of blocks = 2 and Number of first block = 4"},
3667 {12, "No of blocks = 2 and Number of first block = 5"},
3668 {13, "No of blocks = 3 and Number of first block = 0"},
3669 {14, "No of blocks = 3 and Number of first block = 1"},
3670 {15, "No of blocks = 3 and Number of first block = 2"},
3671 {16, "No of blocks = 3 and Number of first block = 3"},
3672 {17, "No of blocks = 3 and Number of first block = 4"},
3673 {18, "No of blocks = 4 and Number of first block = 0"},
3674 {19, "No of blocks = 4 and Number of first block = 1"},
3675 {20, "No of blocks = 4 and Number of first block = 2"},
3676 {21, "No of blocks = 4 and Number of first block = 3"},
3677 {22, "No of blocks = 5 and Number of first block = 0"},
3678 {23, "No of blocks = 5 and Number of first block = 1"},
3679 {24, "No of blocks = 5 and Number of first block = 2"},
3680 {25, "No of blocks = 6 and Number of first block = 0"},
3681 {26, "No of blocks = 6 and Number of first block = 1"},
3682 {27, "No of blocks = 7 and Number of first block = 0"},
3683 {28, "Reserved"},
3684 {29, "Reserved"},
3685 {30, "Reserved"},
3686 {31, "Reserved"},
3687 { 0, NULL }
3688};
3689
3690static guint16
3691de_rr_si1_rest_oct(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3692{
3693 proto_tree *subtree;
3694 proto_item *item;
3695 guint32 curr_offset;
3696 gint bit_offset;
3697
3698 len = 1;
3699 curr_offset = offset;
3700 bit_offset = curr_offset << 3;
3701
3702 item = proto_tree_add_text(tree, tvb, curr_offset, len, "%s",
3703 gsm_rr_elem_strings[DE_RR_SI1_REST_OCT].strptr);
3704
3705 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_SI1_REST_OCT]);
3706
3707 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3708 {
3709 bit_offset += 1;
3710 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nch_position, tvb, bit_offset, 5, FALSE);
3711 bit_offset += 5;
3712 }
3713 else
3714 {
3715 proto_tree_add_text(subtree,tvb, bit_offset>>3, 1, "NCH position: not present");
3716 bit_offset += 1;
3717 }
3718 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3719 proto_tree_add_text(subtree,tvb, bit_offset>>3, 1, "Band Indicator: 1900");
3720 else
3721 proto_tree_add_text(subtree,tvb, bit_offset>>3, 1, "Band Indicator: 1800");
3722 bit_offset += 1;
3723
3724 curr_offset = curr_offset + len;
3725
3726 return curr_offset-offset;
3727}
3728
3729/*
3730 * [3] 10.5.2.33 SI 2bis Rest Octets
3731 */
3732
3733/*
3734 * [3] 10.5.2.33a SI 2ter Rest Octets
3735 */
3736static const value_string gsm_a_rr_qsearch_x_vals[] = {
3737 { 0, "-98 dBm"},
3738 { 1, "-94 dBm"},
3739 { 2, "-90 dBm"},
3740 { 3, "-86 dBm"},
3741 { 4, "-82 dBm"},
3742 { 5, "-78 dBm"},
3743 { 6, "-74 dBm"},
3744 { 7, "Always"},
3745 { 8, "-78 dBm"},
3746 { 9, "-74 dBm"},
3747 {10, "-70 dBm"},
3748 {11, "-66 dBm"},
3749 {12, "-62 dBm"},
3750 {13, "-58 dBm"},
3751 {14, "-54 dBm"},
3752 {15, "Never"},
3753 { 0, NULL }
3754};
3755
3756static const value_string gsm_a_rr_xdd_qoffset_vals[] = {
3757 { 0, "always select a cell if acceptable"},
3758 { 1, "-28 dB"},
3759 { 2, "-24 dB"},
3760 { 3, "-20 dB"},
3761 { 4, "-16 dB"},
3762 { 5, "-12 dB"},
3763 { 6, "-8 dB"},
3764 { 7, "-4 dB"},
3765 { 8, "0 dB"},
3766 { 9, "4 dB"},
3767 {10, "8 dB"},
3768 {11, "12 dB"},
3769 {12, "16 dB"},
3770 {13, "20 dB"},
3771 {14, "24 dB"},
3772 {15, "28 dB"},
3773 { 0, NULL }
3774};
3775
3776static const value_string gsm_a_rr_fdd_qmin_vals[] = {
3777 { 0, "-20 dB"},
3778 { 1, "-6 dB"},
3779 { 2, "-18 dB"},
3780 { 3, "-8 dB"},
3781 { 4, "-16 dB"},
3782 { 5, "-10 dB"},
3783 { 6, "-14 dB"},
3784 { 7, "-12 dB"},
3785 { 0, NULL }
3786};
3787
3788static const value_string gsm_a_rr_fdd_qmin_offset_vals[] = {
3789 { 0, "0 dB"},
3790 { 1, "2 dB"},
3791 { 2, "4 dB"},
3792 { 3, "6 dB"},
3793 { 4, "8 dB"},
3794 { 5, "10 dB"},
3795 { 6, "12 dB"},
3796 { 7, "14 dB"},
3797 { 0, NULL }
3798};
3799
3800static const value_string gsm_a_rr_fdd_rscpmin_vals[] = {
3801 { 0, "-114 dBm"},
3802 { 1, "-112 dBm"},
3803 { 2, "-110 dBm"},
3804 { 3, "-108 dBm"},
3805 { 4, "-106 dBm"},
3806 { 5, "-104 dBm"},
3807 { 6, "-102 dBm"},
3808 { 7, "-100 dBm"},
3809 { 8, "-98 dBm"},
3810 { 9, "-96 dBm"},
3811 {10, "-94 dBm"},
3812 {11, "-92 dBm"},
3813 {12, "-90 dBm"},
3814 {13, "-88 dBm"},
3815 {14, "-86 dBm"},
3816 {15, "-84 dBm"},
3817 { 0, NULL }
3818};
3819
3820static guint16
3821de_rr_si2ter_rest_oct(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
3822{
3823 proto_tree *subtree, *subtree2;
3824 proto_item *item, *item2;
3825 guint32 curr_offset;
3826 gint bit_offset, bit_offset_sav;
3827 guint8 value;
3828
3829 len = 4;
3830 curr_offset = offset;
3831 bit_offset = curr_offset<<3;
3832
3833 item = proto_tree_add_text(tree, tvb, curr_offset, len, "%s",
3834 gsm_rr_elem_strings[DE_RR_SI2TER_REST_OCT].strptr);
3835
3836 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_SI2TER_REST_OCT]);
3837
3838 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3839 {
3840 bit_offset += 1;
3841 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2ter_mp_change_mark, tvb, bit_offset, 1, FALSE);
3842 bit_offset += 1;
3843 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2ter_3g_change_mark, tvb, bit_offset, 1, FALSE);
3844 bit_offset += 1;
3845 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2ter_index, tvb, bit_offset, 3, FALSE);
3846 bit_offset += 3;
3847 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2ter_count, tvb, bit_offset, 3, FALSE);
3848 bit_offset += 3;
3849 value = tvb_get_bits8(tvb,bit_offset,1);
3850 bit_offset += 1;
3851 if (value)
3852 { /* UTRAN FDD Description */
3853 bit_offset_sav = bit_offset;
3854 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_FDD_DESC].strptr);
3855 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_UTRAN_FDD_DESC]);
3856 bit_offset += 2; /* skip '01' bits */
3857 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_uarfcn, tvb, bit_offset, 14, FALSE);
3858 bit_offset += 14;
3859 value = tvb_get_bits8(tvb,bit_offset,1);
3860 bit_offset += 1;
3861 if (value)
3862 {
3863 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_bandwidth_fdd, tvb, bit_offset, 3, FALSE);
3864 bit_offset += 3;
3865 }
3866 proto_item_set_len(item2,((bit_offset-bit_offset_sav)>>3)+1);
3867 }
3868 value = tvb_get_bits8(tvb,bit_offset,1);
3869 bit_offset += 1;
3870 if (value)
3871 { /* UTRAN TDD Description */
3872 bit_offset_sav = bit_offset;
3873 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_TDD_DESC].strptr);
3874 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_UTRAN_TDD_DESC]);
3875 bit_offset += 2; /* skip '01' bits */
3876 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_tdd_uarfcn, tvb, bit_offset, 14, FALSE);
3877 bit_offset += 14;
3878 value = tvb_get_bits8(tvb,bit_offset,1);
3879 bit_offset += 1;
3880 if (value)
3881 {
3882 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_bandwidth_tdd, tvb, bit_offset, 3, FALSE);
3883 bit_offset += 3;
3884 }
3885 proto_item_set_len(item2,((bit_offset-bit_offset_sav)>>3)+1);
3886 }
3887 value = tvb_get_bits8(tvb,bit_offset,1);
3888 bit_offset += 1;
3889 if (value)
3890 { /* 3G Measurement Parameters Description */
3891 bit_offset_sav = bit_offset;
3892 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_MEAS_PARAM_DESC].strptr);
3893 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_MEAS_PARAM_DESC]);
3894 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_qsearch_i, tvb, bit_offset, 4, FALSE);
3895 bit_offset += 4;
3896 value = tvb_get_bits8(tvb,bit_offset,1);
3897 bit_offset += 1;
3898 if (value)
3899 {
3900 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_qoffset, tvb, bit_offset, 4, FALSE);
3901 bit_offset += 4;
3902 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_qmin, tvb, bit_offset, 3, FALSE);
3903 bit_offset += 3;
3904 }
3905 value = tvb_get_bits8(tvb,bit_offset,1);
3906 bit_offset += 1;
3907 if (value)
3908 {
3909 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_tdd_qoffset, tvb, bit_offset, 4, FALSE);
3910 bit_offset += 4;
3911 }
3912 proto_item_set_len(item2,((bit_offset-bit_offset_sav)>>3)+1);
3913 }
3914 if (((curr_offset + len)<<3) - bit_offset > 0)
3915 {
3916 /* There is still room left in the Rest Octets IE */
3917 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
3918 { /* Additions in release R5 */
3919 bit_offset += 1;
3920 value = tvb_get_bits8(tvb,bit_offset,1);
3921 bit_offset += 1;
3922 if (value)
3923 { /* 3G Additional Measurement Parameters Description */
3924 bit_offset_sav = bit_offset;
3925 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC].strptr);
3926 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC]);
3927 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_qmin_offset, tvb, bit_offset, 3, FALSE);
3928 bit_offset += 3;
3929 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_rscpmin, tvb, bit_offset, 4, FALSE);
3930 bit_offset += 4;
3931 proto_item_set_len(item2,((bit_offset-bit_offset_sav)>>3)+1);
3932 }
3933 }
3934 else
3935 bit_offset += 1;
3936 }
3937 }
3938 else
3939 {
3940 bit_offset += 1;
3941 proto_tree_add_text(subtree,tvb, curr_offset, len ,"Empty");
3942 }
3943
3944 curr_offset = curr_offset + len;
3945
3946 return curr_offset-offset;
3947}
3948
3949/*
3950 * [3] 10.5.2.33b SI 2quater Rest Octets
3951 */
3952static const true_false_string gsm_a_rr_gsm_report_type_value = {
3953 "The MS shall use the Measurement Report message for reporting",
3954 "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"
3955};
3956
3957static const true_false_string gsm_a_rr_frequency_scrolling_value = {
3958 "Next BSIC in the structure relates to the subsequent frequency in the BA(list)",
3959 "Next BSIC in the structure relates to the same frequency in the BA(list)"
3960};
3961
3962static const true_false_string gsm_a_rr_rep_priority_value = {
3963 "High reporting priority",
3964 "Normal reporting priority"
3965};
3966
3967static const true_false_string gsm_a_rr_report_type_value = {
3968 "The MS shall use the PACKET MEASUREMENT REPORT message for reporting",
3969 "The MS shall use the PACKET ENHANCED MEASUREMENT REPORT message for reporting"
3970};
3971
3972static const true_false_string gsm_a_rr_reporting_rate_value = {
3973 "Reduced reporting rate allowed",
3974 "Normal reporting rate"
3975};
3976
3977static const true_false_string gsm_a_rr_invalid_bsic_reporting_value = {
3978 "Report on cells with invalid BSIC and allowed NCC part of BSIC is allowed",
3979 "Report on cells with invalid BSIC and allowed NCC part of BSIC is not allowed"
3980};
3981
3982static const value_string gsm_a_rr_scale_ord_vals[] = {
3983 { 0, "An offset of 0 dB shall be used for the reported RXLEV values"},
3984 { 1, "An offset of 10 dB shall be used for the reported RXLEV values"},
3985 { 2, "An automatic offset shall be used for the reported RXLEV values"},
3986 { 0, NULL }
3987};
3988
3989static const value_string gsm_a_rr_xxx_reporting_offset_vals[] = {
3990 { 0, "Apply an offset of 0 dB to the reported value when prioritising the cells for reporting"},
3991 { 1, "Apply an offset of 6 dB to the reported value when prioritising the cells for reporting"},
3992 { 2, "Apply an offset of 12 dB to the reported value when prioritising the cells for reporting"},
3993 { 3, "Apply an offset of 18 dB to the reported value when prioritising the cells for reporting"},
3994 { 4, "Apply an offset of 24 dB to the reported value when prioritising the cells for reporting"},
3995 { 5, "Apply an offset of 30 dB to the reported value when prioritising the cells for reporting"},
3996 { 6, "Apply an offset of 36 dB to the reported value when prioritising the cells for reporting"},
3997 { 7, "Apply an offset of 42 dB to the reported value when prioritising the cells for reporting"},
3998 { 0, NULL }
3999};
4000
4001static const value_string gsm_a_rr_xxx_reporting_threshold_vals[] = {
4002 { 0, "Apply priority reporting if the reported value is above 0 dB"},
4003 { 1, "Apply priority reporting if the reported value is above 6 dB"},
4004 { 2, "Apply priority reporting if the reported value is above 12 dB"},
4005 { 3, "Apply priority reporting if the reported value is above 18 dB"},
4006 { 4, "Apply priority reporting if the reported value is above 24 dB"},
4007 { 5, "Apply priority reporting if the reported value is above 30 dB"},
4008 { 6, "Apply priority reporting if the reported value is above 36 dB"},
4009 { 7, "Never apply priority reporting"},
4010 { 0, NULL }
4011};
4012
4013static const value_string gsm_a_rr_network_control_order_vals[] = {
4014 { 0, "NC0"},
4015 { 1, "NC1"},
4016 { 2, "NC2"},
4017 { 3, "NC0"},
4018 { 0, NULL }
4019};
4020
4021static const value_string gsm_a_rr_nc_non_drx_period_vals[] = {
4022 { 0, "No non-DRX mode after a measurement report has been sent"},
4023 { 1, "0,24 s"},
4024 { 2, "0,48 s"},
4025 { 3, "0.72 s"},
4026 { 4, "0.96 s"},
4027 { 5, "1.20 s"},
4028 { 6, "1.44 s"},
4029 { 7, "1.92 s"},
4030 { 0, NULL }
4031};
4032
4033static const value_string gsm_a_rr_nc_reporting_period_x_vals[] = {
4034 { 0, "0.48 s"},
4035 { 1, "0.96 s"},
4036 { 2, "1.92 s"},
4037 { 3, "3.84 s"},
4038 { 4, "7.68 s"},
4039 { 5, "15.36 s"},
4040 { 6, "30.72 s"},
4041 { 7, "61.44 s"},
4042 { 0, NULL }
4043};
4044
4045static const true_false_string gsm_a_rr_qsearch_c_initial_value = {
4046 "Always",
4047 "use Qsearch I"
4048};
4049
4050static const true_false_string gsm_a_rr_fdd_rep_quant_value = {
4051 "Ec/No",
4052 "RSCP"
4053};
4054
4055static const true_false_string gsm_a_rr_3g_search_prio_value = {
4056 "3G cells may be searched when BSIC decoding is required",
4057 "3G cells may not be searched when BSIC decoding is required"
4058};
4059
4060static const true_false_string gsm_a_rr_3g_ccn_active_value = {
4061 "CCN towards 3G cells is enabled in the cell",
4062 "CCN towards 3G cells is disabled in the cell"
4063};
4064
4065static gint
4066de_rr_si2quater_meas_info_utran_fdd_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
4067{
4068 proto_tree *subtree, *subtree2;
4069 proto_item *item, *item2;
4070 gint curr_bit_offset, idx;
4071 gint xdd_cell_info, wsize, nwi, jwi, w[64], i, iused, xdd_indic0;
4072 guint8 value;
4073
4074 curr_bit_offset = bit_offset;
4075
4076 item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_FDD_DESC].strptr);
4077 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_UTRAN_FDD_DESC]);
4078 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4079 curr_bit_offset += 1;
4080 if (value)
4081 {
4082 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bandwidth_fdd, tvb, curr_bit_offset, 3, FALSE);
4083 curr_bit_offset += 3;
4084 }
4085 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4086 curr_bit_offset += 1;
4087 while (value)
4088 {
4089 curr_bit_offset += 1; /* skip a 0 bit */
4090 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_fdd_uarfcn, tvb, curr_bit_offset, 14, FALSE);
4091 curr_bit_offset += 14;
4092 xdd_indic0 = tvb_get_bits8(tvb,curr_bit_offset,1);
4093 proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, 1, "FDD Indic0: %d", xdd_indic0);
4094 curr_bit_offset += 1;
4095 idx = tvb_get_bits8(tvb,curr_bit_offset,5);
4096 proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, 1, "Nr of FDD Cells : %d", idx);
4097 curr_bit_offset += 5;
4098 idx = convert_n_to_p[idx];
4099 item2 = proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, (idx>>3)+1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_FDD_DESC].strptr);
4100 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_FDD_CELL_INFORMATION_FIELD]);
4101 proto_tree_add_text(subtree2,tvb, curr_bit_offset>>3, (idx>>3)+1, "Field is %d bits long", idx);
4102 if (xdd_indic0)
4103 {
4104 proto_tree_add_text(subtree2,tvb, curr_bit_offset>>3, 0, "Scrambling Code: %d", 0);
4105 proto_tree_add_text(subtree2,tvb, curr_bit_offset>>3, 0, "Diversity: %d", 0);
4106 }
4107 if (idx)
4108 {
4109 wsize = 10;
4110 nwi = 1;
4111 jwi = 0;
4112 i = 1;
4113
4114 while (idx > 0)
4115 {
4116 w[i] = tvb_get_bits16(tvb, curr_bit_offset, wsize, FALSE);
4117 curr_bit_offset += wsize;
4118 idx -= wsize;
4119 if (w[i] == 0)
4120 {
4121 idx = 0;
4122 break;
4123 }
4124 if (++jwi==nwi)
4125 {
4126 jwi = 0;
4127 nwi <<= 1;
4128 wsize--;
4129 }
4130 i++;
4131 }
4132 if (idx < 0)
4133 {
4134 curr_bit_offset += idx;
4135 }
4136 iused = i-1;
4137
4138 for (i=1; i <= iused; i++)
4139 {
4140 xdd_cell_info = f_k(i, w, 1024);
4141 proto_tree_add_text(subtree2,tvb, curr_bit_offset>>3, 0, "Scrambling Code: %d", xdd_cell_info & 0x01FF);
4142 proto_tree_add_text(subtree2,tvb, curr_bit_offset>>3, 0, "Diversity: %d", (xdd_cell_info >> 9) & 0x01);
4143 }
4144 }
4145 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4146 curr_bit_offset += 1;
4147 }
4148 proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
4149
4150 return (curr_bit_offset - bit_offset);
4151}
4152
4153static gint
4154de_rr_si2quater_meas_info_utran_tdd_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
4155{
4156 proto_tree *subtree, *subtree2;
4157 proto_item *item, *item2;
4158 gint curr_bit_offset, idx;
4159 gint xdd_cell_info, wsize, nwi, jwi, w[64], i, iused, xdd_indic0;
4160 guint8 value;
4161
4162 curr_bit_offset = bit_offset;
4163
4164 item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_TDD_DESC].strptr);
4165 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_UTRAN_TDD_DESC]);
4166 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4167 curr_bit_offset += 1;
4168 if (value)
4169 {
4170 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bandwidth_tdd, tvb, curr_bit_offset, 3, FALSE);
4171 curr_bit_offset += 3;
4172 }
4173 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4174 curr_bit_offset += 1;
4175 while (value)
4176 {
4177 curr_bit_offset += 1; /* skip a 0 bit */
4178 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tdd_uarfcn, tvb, curr_bit_offset, 14, FALSE);
4179 curr_bit_offset += 14;
4180 xdd_indic0 = tvb_get_bits8(tvb,curr_bit_offset,1);
4181 proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, 1, "TDD Indic0: %d", xdd_indic0);
4182 curr_bit_offset += 1;
4183 idx = tvb_get_bits8(tvb,curr_bit_offset,5);
4184 proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, 1, "Nr of TDD Cells : %d", idx);
4185 curr_bit_offset += 5;
4186 idx = convert_n_to_q[idx];
4187 item2 = proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, (idx>>3)+1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_TDD_DESC].strptr);
4188 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_TDD_CELL_INFORMATION_FIELD]);
4189 proto_tree_add_text(subtree2,tvb, curr_bit_offset>>3, (idx>>3)+1, "Field is %d bits long", idx);
4190 if (xdd_indic0)
4191 {
4192 proto_tree_add_text(subtree2,tvb, curr_bit_offset>>3, 0, "Cell Parameter: %d", 0);
4193 proto_tree_add_text(subtree2,tvb, curr_bit_offset>>3, 0, "Sync Case TSTD: %d", 0);
4194 proto_tree_add_text(subtree2,tvb, curr_bit_offset>>3, 0, "Diversity TDD: %d", 0);
4195 }
4196 if (idx)
4197 {
4198 wsize = 9;
4199 nwi = 1;
4200 jwi = 0;
4201 i = 1;
4202
4203 while (idx > 0)
4204 {
4205 w[i] = tvb_get_bits16(tvb, curr_bit_offset, wsize, FALSE);
4206 curr_bit_offset += wsize;
4207 idx -= wsize;
4208 if (w[i] == 0)
4209 {
4210 idx = 0;
4211 break;
4212 }
4213 if (++jwi==nwi)
4214 {
4215 jwi = 0;
4216 nwi <<= 1;
4217 wsize--;
4218 }
4219 i++;
4220 }
4221 if (idx < 0)
4222 {
4223 curr_bit_offset += idx;
4224 }
4225 iused = i-1;
4226
4227 for (i=1; i <= iused; i++)
4228 {
4229 xdd_cell_info = f_k(i, w, 512);
4230 proto_tree_add_text(subtree2,tvb, curr_bit_offset>>3, 0, "Cell Parameter: %d", xdd_cell_info & 0x07F);
4231 proto_tree_add_text(subtree2,tvb, curr_bit_offset>>3, 0, "Sync Case TSTD: %d", (xdd_cell_info >> 7) & 0x01);
4232 proto_tree_add_text(subtree2,tvb, curr_bit_offset>>3, 0, "Diversity TDD: %d", (xdd_cell_info >> 8) & 0x01);
4233 }
4234 }
4235 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4236 curr_bit_offset += 1;
4237 }
4238 proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
4239
4240 return (curr_bit_offset - bit_offset);
4241}
4242
4243static gint
4244de_rr_rtd_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset, rr_rest_octets_elem_idx_t id)
4245{
4246 proto_tree *subtree;
4247 proto_item *item;
4248 gint curr_bit_offset, idx;
4249 guint8 value;
4250
4251 curr_bit_offset = bit_offset;
4252
4253 item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[id].strptr);
4254 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[id]);
4255 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4256 curr_bit_offset += 1;
4257 if (value)
4258 {
4259 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4260 curr_bit_offset += 1;
4261 if (value)
4262 {
4263 idx = tvb_get_bits8(tvb,curr_bit_offset,5);
4264 proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, 1, "BA Index Start RTD: %d", idx);
4265 curr_bit_offset += 5;
4266 }
4267 else
4268 idx = 0;
4269 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4270 curr_bit_offset += 1;
4271 while (value == 0)
4272 {
4273 proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, 1, "RTD index %d: %d TDMA frame(s) modulo 51 TDMA frames", idx, tvb_get_bits8(tvb,curr_bit_offset,6));
4274 curr_bit_offset += 6;
4275 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4276 curr_bit_offset += 1;
4277 }
4278 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4279 curr_bit_offset += 1;
4280 while (value == 0)
4281 {
4282 idx += 1;
4283 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4284 curr_bit_offset += 1;
4285 while (value == 0)
4286 {
4287 proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, 1, "RTD index %d: %d TDMA frame(s) modulo 51 TDMA frames", idx, tvb_get_bits8(tvb,curr_bit_offset,6));
4288 curr_bit_offset += 6;
4289 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4290 curr_bit_offset += 1;
4291 }
4292 }
4293 }
4294 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4295 curr_bit_offset += 1;
4296 if (value)
4297 {
4298 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4299 curr_bit_offset += 1;
4300 if (value)
4301 {
4302 idx = tvb_get_bits8(tvb,curr_bit_offset,5);
4303 proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, 1, "BA Index Start RTD: %d", idx);
4304 curr_bit_offset += 5;
4305 }
4306 else
4307 idx = 0;
4308 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4309 curr_bit_offset += 1;
4310 while (value == 0)
4311 {
4312 proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, 2, "RTD index %d: %d/64 TDMA frame(s) modulo 51 TDMA frames", idx, tvb_get_bits16(tvb,curr_bit_offset,12,FALSE));
4313 curr_bit_offset += 12;
4314 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4315 curr_bit_offset += 1;
4316 }
4317 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4318 curr_bit_offset += 1;
4319 while (value == 0)
4320 {
4321 idx += 1;
4322 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4323 curr_bit_offset += 1;
4324 while (value == 0)
4325 {
4326 proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, 2, "RTD index %d: %d/64 TDMA frame(s) modulo 51 TDMA frames", idx, tvb_get_bits16(tvb,curr_bit_offset,12,FALSE));
4327 curr_bit_offset += 12;
4328 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4329 curr_bit_offset += 1;
4330 }
4331 }
4332 }
4333 proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
4334
4335 return (curr_bit_offset - bit_offset);
4336}
4337
4338static gint
4339de_rr_bsic_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset, rr_rest_octets_elem_idx_t id)
4340{
4341 proto_tree *subtree;
4342 proto_item *item;
4343 gint curr_bit_offset, idx;
4344 guint8 value;
4345
4346 curr_bit_offset = bit_offset;
4347 item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[id].strptr);
4348 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[id]);
4349 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4350 curr_bit_offset += 1;
4351 if (value)
4352 {
4353 proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, 1, "BA Index Start BSIC: %d", tvb_get_bits8(tvb,curr_bit_offset,5));
4354 curr_bit_offset += 5;
4355 }
4356 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bsic, tvb, bit_offset, 6, FALSE);
4357 curr_bit_offset += 6;
4358 idx = tvb_get_bits8(tvb,curr_bit_offset,7);
4359 proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, 1, "Number Remaining BSIC: %d", idx);
4360 curr_bit_offset += 7;
4361 while (idx)
4362 {
4363 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_frequency_scrolling, tvb, curr_bit_offset, 1, FALSE);
4364 curr_bit_offset += 1;
4365 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bsic, tvb, bit_offset, 6, FALSE);
4366 curr_bit_offset += 6;
4367 idx -= 1;
4368 }
4369 proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
4370
4371 return(curr_bit_offset - bit_offset);
4372}
4373
4374static gint
4375de_rr_report_priority_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset, rr_rest_octets_elem_idx_t id)
4376{
4377 proto_tree *subtree;
4378 proto_item *item;
4379 gint curr_bit_offset, idx;
4380
4381 curr_bit_offset = bit_offset;
4382
4383 item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[id].strptr);
4384 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[id]);
4385 idx = tvb_get_bits8(tvb,curr_bit_offset,7);
4386 proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, 1, "Number Cells: %d", idx);
4387 curr_bit_offset += 7;
4388 while (idx)
4389 {
4390 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rep_priority, tvb, curr_bit_offset, 1, FALSE);
4391 curr_bit_offset += 1;
4392 idx -= 1;
4393 }
4394 proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
4395
4396 return(curr_bit_offset - bit_offset);
4397}
4398
4399static gint
4400de_rr_meas_param_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset, rr_rest_octets_elem_idx_t id)
4401{
4402 proto_tree *subtree;
4403 proto_item *item;
4404 gint curr_bit_offset;
4405 guint8 value;
4406
4407 curr_bit_offset = bit_offset;
4408 item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[id].strptr);
4409 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[id]);
4410 if (id == DE_RR_REST_OCTETS_GPRS_MEAS_PARAM_DESC)
4411 {
4412 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_report_type, tvb, curr_bit_offset, 1, FALSE);
4413 curr_bit_offset += 1;
4414 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_reporting_rate, tvb, curr_bit_offset, 1, FALSE);
4415 curr_bit_offset +=1;
4416 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_invalid_bsic_reporting, tvb, curr_bit_offset, 1, FALSE);
4417 curr_bit_offset +=1;
4418 }
4419 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4420 curr_bit_offset += 1;
4421 if (value)
4422 {
4423 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_multiband_reporting, tvb, curr_bit_offset, 2, FALSE);
4424 curr_bit_offset += 2;
4425 }
4426 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4427 curr_bit_offset += 1;
4428 if (value)
4429 {
4430 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_serving_band_reporting, tvb, curr_bit_offset, 2, FALSE);
4431 curr_bit_offset += 2;
4432 }
4433 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_scale_ord, tvb, curr_bit_offset, 2, FALSE);
4434 curr_bit_offset += 2;
4435 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4436 curr_bit_offset += 1;
4437 if (value)
4438 {
4439 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_900_reporting_offset, tvb, curr_bit_offset, 3, FALSE);
4440 curr_bit_offset += 3;
4441 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_900_reporting_threshold, tvb, curr_bit_offset, 3, FALSE);
4442 curr_bit_offset += 3;
4443 }
4444 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4445 curr_bit_offset += 1;
4446 if (value)
4447 {
4448 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_1800_reporting_offset, tvb, curr_bit_offset, 3, FALSE);
4449 curr_bit_offset += 3;
4450 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_1800_reporting_threshold, tvb, curr_bit_offset, 3, FALSE);
4451 curr_bit_offset += 3;
4452 }
4453 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4454 curr_bit_offset += 1;
4455 if (value)
4456 {
4457 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_400_reporting_offset, tvb, curr_bit_offset, 3, FALSE);
4458 curr_bit_offset += 3;
4459 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_400_reporting_threshold, tvb, curr_bit_offset, 3, FALSE);
4460 curr_bit_offset += 3;
4461 }
4462 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4463 curr_bit_offset += 1;
4464 if (value)
4465 {
4466 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_1900_reporting_offset, tvb, curr_bit_offset, 3, FALSE);
4467 curr_bit_offset += 3;
4468 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_1900_reporting_threshold, tvb, curr_bit_offset, 3, FALSE);
4469 curr_bit_offset += 3;
4470 }
4471 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4472 curr_bit_offset += 1;
4473 if (value)
4474 {
4475 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_850_reporting_offset, tvb, curr_bit_offset, 3, FALSE);
4476 curr_bit_offset += 3;
4477 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_850_reporting_threshold, tvb, curr_bit_offset, 3, FALSE);
4478 curr_bit_offset += 3;
4479 }
4480 proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
4481
4482 return(curr_bit_offset - bit_offset);
4483}
4484
4485static gint
4486de_rr_3g_add_meas_param_desc2(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
4487{
4488 proto_tree *subtree;
4489 proto_item *item;
4490 gint curr_bit_offset;
4491 guint8 value;
4492
4493 curr_bit_offset = bit_offset;
4494 item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC2].strptr);
4495 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC2]);
4496 value = tvb_get_bits8(tvb,curr_bit_offset,1);
4497 curr_bit_offset += 1;
4498 if (value)
4499 {
4500 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_fdd_reporting_threshold_2, tvb, curr_bit_offset, 6, FALSE);
4501 curr_bit_offset += 6;
4502 }
4503 proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
4504
4505 return(curr_bit_offset - bit_offset);
4506}
4507
4508static guint16
4509de_rr_si2quater_rest_oct(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
4510{
4511 proto_tree *subtree, *subtree2, *subtree3;
4512 proto_item *item, *item2, *item3;
4513 guint32 curr_offset;
4514 gint bit_offset, bit_offset_sav, idx;
4515 guint8 value;
4516
4517 len = 20;
4518 curr_offset = offset;
4519 bit_offset = curr_offset<<3;
4520
4521 item = proto_tree_add_text(tree, tvb, curr_offset, len, "%s",
4522 gsm_rr_elem_strings[DE_RR_SI2QUATER_REST_OCT].strptr);
4523
4524 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_SI2QUATER_REST_OCT]);
4525
4526 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_ba_ind, tvb, bit_offset, 1, FALSE);
4527 bit_offset += 1;
4528 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_ba_ind, tvb, bit_offset, 1, FALSE);
4529 bit_offset += 1;
4530 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_mp_change_mark, tvb, bit_offset, 1, FALSE);
4531 bit_offset += 1;
4532 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2quater_index, tvb, bit_offset, 4, FALSE);
4533 bit_offset += 4;
4534 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2quater_count, tvb, bit_offset, 4, FALSE);
4535 bit_offset += 4;
4536 value = tvb_get_bits8(tvb,bit_offset,1);
4537 bit_offset += 1;
4538 if (value)
4539 { /* Measurement Parameters Description */
4540 bit_offset_sav = bit_offset;
4541 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_MEAS_PARAM_DESC].strptr);
4542 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_MEAS_PARAM_DESC]);
4543 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_gsm_report_type, tvb, bit_offset, 1, FALSE);
4544 bit_offset += 1;
4545 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_serving_band_reporting, tvb, bit_offset, 2, FALSE);
4546 bit_offset += 2;
4547 proto_item_set_len(item2,((bit_offset-bit_offset_sav)>>3)+1);
4548 }
4549 value = tvb_get_bits8(tvb,bit_offset,1);
4550 bit_offset += 1;
4551 if (value)
4552 { /* GPRS Real Time Difference Description */
4553 bit_offset += de_rr_rtd_desc(tvb, subtree, bit_offset, DE_RR_REST_OCTETS_GPRS_RTD_DESC);
4554
4555 }
4556 value = tvb_get_bits8(tvb,bit_offset,1);
4557 bit_offset += 1;
4558 if (value)
4559 { /* GPRS BSIC Description */
4560 bit_offset += de_rr_bsic_desc(tvb, subtree, bit_offset, DE_RR_REST_OCTETS_GPRS_BSIC_DESC);
4561 }
4562 value = tvb_get_bits8(tvb,bit_offset,1);
4563 bit_offset += 1;
4564 if (value)
4565 { /* GPRS Report Priority Description */
4566 bit_offset += de_rr_report_priority_desc(tvb, subtree, bit_offset, DE_RR_REST_OCTETS_GPRS_REPORT_PRIO_DESC);
4567 }
4568 value = tvb_get_bits8(tvb,bit_offset,1);
4569 bit_offset += 1;
4570 if (value)
4571 { /* GPRS Measurement Parameters Description */
4572 bit_offset += de_rr_meas_param_desc(tvb, subtree, bit_offset, DE_RR_REST_OCTETS_GPRS_MEAS_PARAM_DESC);
4573 }
4574 value = tvb_get_bits8(tvb,bit_offset,1);
4575 bit_offset += 1;
4576 if (value)
4577 { /* NC Measurement Parameters */
4578 bit_offset_sav = bit_offset;
4579 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_NC_MEAS_PARAM].strptr);
4580 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_NC_MEAS_PARAM]);
4581 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_network_control_order, tvb, bit_offset, 2, FALSE);
4582 bit_offset += 2;
4583 value = tvb_get_bits8(tvb,bit_offset,1);
4584 bit_offset += 1;
4585 if (value)
4586 {
4587 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_nc_non_drx_period, tvb, bit_offset, 3, FALSE);
4588 bit_offset += 3;
4589 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_nc_reporting_period_i, tvb, bit_offset, 3, FALSE);
4590 bit_offset += 3;
4591 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_nc_reporting_period_t, tvb, bit_offset, 3, FALSE);
4592 bit_offset += 3;
4593 }
4594 proto_item_set_len(item2,((bit_offset-bit_offset_sav)>>3)+1);
4595 }
4596 value = tvb_get_bits8(tvb,bit_offset,1);
4597 bit_offset += 1;
4598 if (value)
4599 { /* SI 2quater Extension Information */
4600 bit_offset_sav = bit_offset;
4601 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_SI2Q_EXT_INFO].strptr);
4602 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_SI2Q_EXT_INFO]);
4603 idx = tvb_get_bits8(tvb,bit_offset,8);
4604 proto_tree_add_text(subtree2,tvb, bit_offset>>3, 1, "Extension Length: %d", idx);
4605 bit_offset += 8;
4606 proto_item_set_len(item2,((bit_offset+idx+1-bit_offset_sav)>>3)+1);
4607 value = tvb_get_bits8(tvb,bit_offset,1);
4608 bit_offset += 1;
4609 if (value)
4610 { /* CCN Support Description */
4611 bit_offset_sav = bit_offset;
4612 item3 = proto_tree_add_text(subtree2, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_CCN_SUPPORT_DESC].strptr);
4613 subtree3 = proto_item_add_subtree(item3, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_CCN_SUPPORT_DESC]);
4614 value = tvb_get_bits8(tvb,bit_offset,7);
4615 proto_tree_add_text(subtree3,tvb, bit_offset>>3, 1, "Number Cells: %d", value);
4616 bit_offset += 7;
4617 idx -= 7;
4618 item2 = proto_tree_add_text(subtree3,tvb, bit_offset>>3, (value>>3)+1, "CCN Supported: ");
4619 while (value)
4620 {
4621 proto_item_append_text(item2,"%d",tvb_get_bits8(tvb,bit_offset,1));
4622 bit_offset += 1;
4623 value -= 1;
4624 idx -= 1;
4625 }
4626 proto_item_set_len(item3,((bit_offset+-bit_offset_sav)>>3)+1);
4627 }
4628 bit_offset += idx;
4629 }
4630 value = tvb_get_bits8(tvb,bit_offset,1);
4631 bit_offset += 1;
4632 if (value)
4633 { /* 3G Neighbour Cell Description */
4634 bit_offset_sav = bit_offset;
4635 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_NEIGH_CELL_DESC].strptr);
4636 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_NEIGH_CELL_DESC]);
4637 value = tvb_get_bits8(tvb,bit_offset,1);
4638 bit_offset += 1;
4639 if (value)
4640 {
4641 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_index_start_3g, tvb, bit_offset, 7, FALSE);
4642 bit_offset += 7;
4643 }
4644 value = tvb_get_bits8(tvb,bit_offset,1);
4645 bit_offset += 1;
4646 if (value)
4647 {
4648 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_absolute_index_start_emr, tvb, bit_offset, 7, FALSE);
4649 bit_offset += 7;
4650 }
4651 value = tvb_get_bits8(tvb,bit_offset,1);
4652 bit_offset += 1;
4653 if (value)
4654 { /* UTRAN FDD Description */
4655 bit_offset += de_rr_si2quater_meas_info_utran_fdd_desc(tvb, subtree2, bit_offset);
4656 }
4657 value = tvb_get_bits8(tvb,bit_offset,1);
4658 bit_offset += 1;
4659 if (value)
4660 { /* UTRAN TDD Description */
4661 bit_offset += de_rr_si2quater_meas_info_utran_tdd_desc(tvb, subtree2, bit_offset);
4662 }
4663 proto_item_set_len(item2,((bit_offset-bit_offset_sav)>>3)+1);
4664 }
4665 value = tvb_get_bits8(tvb,bit_offset,1);
4666 bit_offset += 1;
4667 if (value)
4668 { /* 3G Measurement Parameters Description */
4669 bit_offset_sav = bit_offset;
4670 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_MEAS_PARAM_DESC].strptr);
4671 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_MEAS_PARAM_DESC]);
4672 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_qsearch_i, tvb, bit_offset, 4, FALSE);
4673 bit_offset += 4;
4674 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_qsearch_c_initial, tvb, bit_offset, 1, FALSE);
4675 bit_offset += 1;
4676 value = tvb_get_bits8(tvb,bit_offset,1);
4677 bit_offset += 1;
4678 if (value)
4679 {
4680 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_qoffset, tvb, bit_offset, 4, FALSE);
4681 bit_offset += 4;
4682 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_rep_quant, tvb, bit_offset, 1, FALSE);
4683 bit_offset += 1;
4684 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_multirat_reporting, tvb, bit_offset, 2, FALSE);
4685 bit_offset += 2;
4686 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_qmin, tvb, bit_offset, 3, FALSE);
4687 bit_offset += 3;
4688 }
4689 value = tvb_get_bits8(tvb,bit_offset,1);
4690 bit_offset += 1;
4691 if (value)
4692 {
4693 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_tdd_qoffset, tvb, bit_offset, 4, FALSE);
4694 bit_offset += 4;
4695 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_tdd_multirat_reporting, tvb, bit_offset, 2, FALSE);
4696 bit_offset += 2;
4697 }
4698 proto_item_set_len(item2,((bit_offset-bit_offset_sav)>>3)+1);
4699 }
4700 value = tvb_get_bits8(tvb,bit_offset,1);
4701 bit_offset += 1;
4702 if (value)
4703 { /* GPRS 3G Measurement Parameters Description */
4704 bit_offset_sav = bit_offset;
4705 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_GPRS_3G_MEAS_PARAM_DESC].strptr);
4706 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_GPRS_3G_MEAS_PARAM_DESC]);
4707 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_qsearch_p, tvb, bit_offset, 4, FALSE);
4708 bit_offset += 4;
4709 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_3g_search_prio, tvb, bit_offset, 1, FALSE);
4710 bit_offset += 1;
4711 value = tvb_get_bits8(tvb,bit_offset,1);
4712 bit_offset += 1;
4713 if (value)
4714 {
4715 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_rep_quant, tvb, bit_offset, 1, FALSE);
4716 bit_offset += 1;
4717 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_multirat_reporting, tvb, bit_offset, 2, FALSE);
4718 bit_offset += 2;
4719 }
4720 value = tvb_get_bits8(tvb,bit_offset,1);
4721 bit_offset += 1;
4722 if (value)
4723 {
4724 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_reporting_offset, tvb, bit_offset, 3, FALSE);
4725 bit_offset += 3;
4726 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_reporting_threshold, tvb, bit_offset, 3, FALSE);
4727 bit_offset += 3;
4728 }
4729 value = tvb_get_bits8(tvb,bit_offset,1);
4730 bit_offset += 1;
4731 if (value)
4732 {
4733 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_tdd_multirat_reporting, tvb, bit_offset, 2, FALSE);
4734 bit_offset += 2;
4735 }
4736 value = tvb_get_bits8(tvb,bit_offset,1);
4737 bit_offset += 1;
4738 if (value)
4739 {
4740 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_tdd_reporting_offset, tvb, bit_offset, 3, FALSE);
4741 bit_offset += 3;
4742 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_tdd_reporting_threshold, tvb, bit_offset, 3, FALSE);
4743 bit_offset += 3;
4744 }
4745 proto_item_set_len(item2,((bit_offset-bit_offset_sav)>>3)+1);
4746 }
4747 if (((curr_offset + len)<<3) - bit_offset > 0)
4748 {
4749 /* There is still room left in the Rest Octets IE */
4750 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
4751 { /* Additions in Rel-5 */
4752 bit_offset += 1;
4753 value = tvb_get_bits8(tvb,bit_offset,1);
4754 bit_offset += 1;
4755 if (value)
4756 { /* 3G Additional Measurement Parameters Description */
4757 bit_offset_sav = bit_offset;
4758 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC].strptr);
4759 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_ADD_MEAS_PARAM_DESC]);
4760 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_qmin_offset, tvb, bit_offset, 3, FALSE);
4761 bit_offset += 3;
4762 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_fdd_rscpmin, tvb, bit_offset, 4, FALSE);
4763 bit_offset += 4;
4764 proto_item_set_len(item2,((bit_offset-bit_offset_sav)>>3)+1);
4765 }
4766 value = tvb_get_bits8(tvb,bit_offset,1);
4767 bit_offset += 1;
4768 if (value)
4769 { /* 3G Additional Measurement Parameters Description 2 */
4770 bit_offset += de_rr_3g_add_meas_param_desc2(tvb, subtree, bit_offset);
4771 }
4772 if (((curr_offset + len)<<3) - bit_offset > 0)
4773 {
4774 /* There is still room left in the Rest Octets IE */
4775 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
4776 { /* Additions in Rel-6 */
4777 bit_offset += 1;
4778 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_ccn_active, tvb, bit_offset, 1, FALSE);
4779 bit_offset += 1;
4780 if (((curr_offset + len)<<3) - bit_offset > 0)
4781 {
4782 /* There is still room left in the Rest Octets IE */
4783 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
4784 { /* Additions in Rel-7 */
4785 bit_offset += 1;
4786 value = tvb_get_bits8(tvb,bit_offset,1);
4787 bit_offset += 1;
4788 if (value)
4789 {
4790 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_700_reporting_offset, tvb, bit_offset, 3, FALSE);
4791 bit_offset += 3;
4792 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_700_reporting_threshold, tvb, bit_offset, 3, FALSE);
4793 bit_offset += 3;
4794 }
4795 value = tvb_get_bits8(tvb,bit_offset,1);
4796 bit_offset += 1;
4797 if (value)
4798 {
4799 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_810_reporting_offset, tvb, bit_offset, 3, FALSE);
4800 bit_offset += 3;
4801 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_810_reporting_threshold, tvb, bit_offset, 3, FALSE);
4802 bit_offset += 3;
4803 }
4804 }
4805 else
4806 bit_offset += 1;
4807 }
4808 }
4809 else
4810 bit_offset += 1;
4811 }
4812 }
4813 else bit_offset += 1;
4814 }
4815
4816 curr_offset = curr_offset + len;
4817
4818 return curr_offset-offset;
4819}
4820
4821/*
4822 * [3] 10.5.2.34 SI 3 Rest Octets
4823 */
4824static const value_string gsm_a_rr_temporary_offset_vals[] = {
4825 { 0, "0 dB"},
4826 { 1, "10 dB"},
4827 { 2, "20 dB"},
4828 { 3, "30 dB"},
4829 { 4, "40 dB"},
4830 { 5, "50 dB"},
4831 { 6, "60 dB"},
4832 { 7, "infinity"},
4833 { 0, NULL }
4834};
4835
4836static const value_string gsm_a_rr_cell_reselect_offset_vals[] = {
4837 { 0, "0 dB"},
4838 { 1, "2 dB"},
4839 { 2, "4 dB"},
4840 { 3, "6 dB"},
4841 { 4, "8 dB"},
4842 { 5, "10 dB"},
4843 { 6, "12 dB"},
4844 { 7, "14 dB"},
4845 { 8, "16 dB"},
4846 { 9, "18 dB"},
4847 {10, "20 dB"},
4848 {11, "22 dB"},
4849 {12, "24 dB"},
4850 {13, "26 dB"},
4851 {14, "28 dB"},
4852 {15, "30 dB"},
4853 {16, "32 dB"},
4854 {17, "34 dB"},
4855 {18, "36 dB"},
4856 {19, "38 dB"},
4857 {20, "40 dB"},
4858 {21, "42 dB"},
4859 {22, "44 dB"},
4860 {23, "46 dB"},
4861 {24, "48 dB"},
4862 {25, "50 dB"},
4863 {26, "52 dB"},
4864 {27, "54 dB"},
4865 {28, "56 dB"},
4866 {29, "58 dB"},
4867 {30, "60 dB"},
4868 {31, "62 dB"},
4869 {32, "64 dB"},
4870 {33, "66 dB"},
4871 {34, "68 dB"},
4872 {35, "70 dB"},
4873 {36, "72 dB"},
4874 {37, "74 dB"},
4875 {38, "76 dB"},
4876 {39, "78 dB"},
4877 {40, "80 dB"},
4878 {41, "82 dB"},
4879 {42, "84 dB"},
4880 {43, "86 dB"},
4881 {44, "88 dB"},
4882 {45, "90 dB"},
4883 {46, "92 dB"},
4884 {47, "94 dB"},
4885 {48, "96 dB"},
4886 {49, "98 dB"},
4887 {50, "100 dB"},
4888 {51, "102 dB"},
4889 {52, "104 dB"},
4890 {53, "106 dB"},
4891 {54, "108 dB"},
4892 {55, "110 dB"},
4893 {56, "112 dB"},
4894 {57, "114 dB"},
4895 {58, "116 dB"},
4896 {59, "118 dB"},
4897 {60, "120 dB"},
4898 {61, "122 dB"},
4899 {62, "124 dB"},
4900 {63, "126 dB"},
4901 { 0, NULL }
4902};
4903
4904static const value_string gsm_a_rr_penalty_time_vals[] = {
4905 { 0, "20 s"},
4906 { 1, "40 s"},
4907 { 2, "60 s"},
4908 { 3, "80 s"},
4909 { 4, "100 s"},
4910 { 5, "120 s"},
4911 { 6, "140 s"},
4912 { 7, "160 s"},
4913 { 8, "180 s"},
4914 { 9, "200 s"},
4915 {10, "220 s"},
4916 {11, "240 s"},
4917 {12, "260 s"},
4918 {13, "280 s"},
4919 {14, "300 s"},
4920 {15, "320 s"},
4921 {16, "340 s"},
4922 {17, "360 s"},
4923 {18, "380 s"},
4924 {19, "400 s"},
4925 {20, "420 s"},
4926 {21, "440 s"},
4927 {22, "460 s"},
4928 {23, "480 s"},
4929 {24, "500 s"},
4930 {25, "520 s"},
4931 {26, "540 s"},
4932 {27, "560 s"},
4933 {28, "580 s"},
4934 {29, "600 s"},
4935 {30, "620 s"},
4936 {31, "Cell Reselect Offset is subtracted from C2 and Temporary Offset is ignored"},
4937 { 0, NULL }
4938};
4939
4940static gint
4941de_rr_rest_oct_opt_sel_param(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
4942{
4943 proto_tree *subtree;
4944 proto_item *item;
4945 gint curr_bit_offset;
4946
4947 curr_bit_offset = bit_offset;
4948
4949 if (gsm_a_rr_is_bit_high(tvb,curr_bit_offset) == TRUE)
4950 { /* Selection Parameters */
4951 curr_bit_offset += 1;
4952 item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_OPTIONAL_SEL_PARAM].strptr);
4953 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_OPTIONAL_SEL_PARAM]);
4954 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_cbq, tvb, curr_bit_offset, 1, FALSE);
4955 curr_bit_offset += 1;
4956 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_cell_reselect_offset, tvb, curr_bit_offset, 6, FALSE);
4957 curr_bit_offset += 6;
4958 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_temporary_offset, tvb, curr_bit_offset, 3, FALSE);
4959 curr_bit_offset += 3;
4960 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_penalty_time, tvb, curr_bit_offset, 5, FALSE);
4961 curr_bit_offset += 5;
4962 proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
4963 }
4964 else
4965 curr_bit_offset += 1;
4966
4967 return (curr_bit_offset - bit_offset);
4968}
4969
4970static const value_string gsm_a_rr_si13_position_vals[] = {
4971 { 0, "SYSTEM INFORMATION TYPE 13 message is sent on BCCH Norm"},
4972 { 1, "SYSTEM INFORMATION TYPE 13 message is sent on BCCH Ext"},
4973 { 0, NULL }
4974};
4975
4976static gint
4977de_rr_rest_oct_gprs_indicator(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
4978{
4979 proto_tree *subtree;
4980 proto_item *item;
4981 gint curr_bit_offset;
4982
4983 curr_bit_offset = bit_offset;
4984
4985 item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, 1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_GPRS_INDICATOR].strptr);
4986 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_GPRS_INDICATOR]);
4987 proto_tree_add_text(subtree, tvb, curr_bit_offset>>3, 1, "RA Colour: %d",tvb_get_bits8(tvb,curr_bit_offset,3));
4988 curr_bit_offset += 3;
4989 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si13_position, tvb, curr_bit_offset, 1, FALSE);
4990 curr_bit_offset += 1;
4991
4992 return (curr_bit_offset - bit_offset);
4993}
4994
4995static const value_string gsm_a_rr_power_offset_vals[] = {
4996 { 0, "0 dB"},
4997 { 1, "2 dB"},
4998 { 2, "4 dB"},
4999 { 3, "8 dB"},
5000 { 0, NULL }
5001};
5002
5003static const true_false_string gsm_a_rr_si2quater_position_value = {
5004 "SYSTEM INFORMATION TYPE 2 quater message is sent on BCCH Ext",
5005 "SYSTEM INFORMATION TYPE 2 quater message is sent on BCCH Norm"
5006};
5007
5008static const true_false_string gsm_a_rr_si13alt_position_value = {
5009 "If Iu mode is supported in the cell, SYSTEM INFORMATION TYPE 13alt message is sent on BCCH Ext",
5010 "If Iu mode is supported in the cell, SYSTEM INFORMATION TYPE 13alt message is sent on BCCH Norm"
5011};
5012
5013static guint16
5014de_rr_si3_rest_oct(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
5015{
5016 proto_tree *subtree;
5017 proto_item *item;
5018 guint32 curr_offset;
5019 gint bit_offset;
5020 gboolean gprs_indicator;
5021
5022 len = 4;
5023 curr_offset = offset;
5024 bit_offset = curr_offset << 3;
5025
5026 item = proto_tree_add_text(tree, tvb, curr_offset, len, "%s",
5027 gsm_rr_elem_strings[DE_RR_SI3_REST_OCT].strptr);
5028
5029 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_SI3_REST_OCT]);
5030
5031 bit_offset += de_rr_rest_oct_opt_sel_param(tvb, subtree, bit_offset);
5032
5033 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5034 { /* Optional Power Offset */
5035 bit_offset += 1;
5036 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_power_offset, tvb, bit_offset, 2, FALSE);
5037 bit_offset += 2;
5038 }
5039 else
5040 bit_offset += 1;
5041 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5042 proto_tree_add_text(subtree, tvb, bit_offset>>3, 1, "SYSTEM INFORMATION TYPE 2ter message is available");
5043 else
5044 proto_tree_add_text(subtree, tvb, bit_offset>>3, 1, "SYSTEM INFORMATION TYPE 2ter message is not available");
5045 bit_offset += 1;
5046 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5047 proto_tree_add_text(subtree, tvb, bit_offset>>3, 1, "Early Classmark Sending is allowed");
5048 else
5049 proto_tree_add_text(subtree, tvb, bit_offset>>3, 1, "Early Classmark Sending is forbidden");
5050 bit_offset += 1;
5051 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5052 { /* Scheduling if and where */
5053 bit_offset += 1;
5054 proto_tree_add_text(subtree, tvb, bit_offset>>3, 1, "Where: %d",tvb_get_bits8(tvb,bit_offset,3));
5055 bit_offset += 3;
5056 }
5057 else
5058 bit_offset += 1;
5059 gprs_indicator = gsm_a_rr_is_bit_high(tvb,bit_offset);
5060 if (gprs_indicator == TRUE)
5061 { /* GPRS indicator */
5062 bit_offset += 1;
5063 bit_offset += de_rr_rest_oct_gprs_indicator(tvb, subtree, bit_offset);
5064 }
5065 else
5066 bit_offset += 1;
5067 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5068 proto_tree_add_text(subtree, tvb, bit_offset>>3, 1, "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");
5069 else
5070 proto_tree_add_text(subtree, tvb, bit_offset>>3, 1, "3G Early Classmark Sending Restriction: Neither UTRAN, CDMA2000 nor GERAN IU MODE CLASSMARK CHANGE message shall be sent with the Early classmark sending");
5071 bit_offset += 1;
5072 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5073 { /* SI2quater Indicator */
5074 bit_offset += 1;
5075 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2quater_position, tvb, bit_offset, 1, FALSE);
5076 bit_offset += 1;
5077 }
5078 else
5079 bit_offset += 1;
5080 if (gprs_indicator == FALSE)
5081 {
5082 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si13alt_position, tvb, bit_offset, 1, FALSE);
5083 bit_offset += 1;
5084 }
5085
5086 curr_offset = curr_offset + len;
5087
5088 return curr_offset-offset;
5089}
5090
5091/*
5092 * [3] 10.5.2.32 SI 4 Rest Octets
5093 */
5094static const value_string gsm_a_rr_prio_thr_vals[] = {
5095 { 0, "0 dB"},
5096 { 1, "6 dB"},
5097 { 2, "12 dB"},
5098 { 3, "18 dB"},
5099 { 4, "24 dB"},
5100 { 5, "30 dB"},
5101 { 6, "36 dB"},
5102 { 7, "Infinite"},
5103 { 0, NULL }
5104};
5105
5106static const value_string gsm_a_rr_lsa_offset_vals[] = {
5107 { 0, "0 dB"},
5108 { 1, "4 dB"},
5109 { 2, "8 dB"},
5110 { 3, "16 dB"},
5111 { 4, "24 dB"},
5112 { 5, "32 dB"},
5113 { 6, "48 dB"},
5114 { 7, "64 dB"},
5115 { 0, NULL }
5116};
5117
5118static guint16
5119de_rr_si4_rest_oct(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
5120{
5121 proto_tree *subtree, *subtree2, *subtree3;
5122 proto_item *item, *item2, *item3;
5123 guint32 curr_offset;
5124 gint bit_offset, bit_offset_sav, bit_offset_sav2;
5125 guint value;
5126
5127 len = tvb_length_remaining(tvb,offset);
5128 if (len==0)
5129 return 0;
5130
5131 curr_offset = offset;
5132 bit_offset = curr_offset << 3;
5133
5134 item = proto_tree_add_text(tree, tvb, curr_offset, len, "%s",
5135 gsm_rr_elem_strings[DE_RR_SI4_REST_OCT].strptr);
5136
5137 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_SI4_REST_OCT]);
5138
5139 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_SI4_REST_OCTETS_O].strptr);
5140
5141 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_SI4_REST_OCTETS_O]);
5142
5143 bit_offset += de_rr_rest_oct_opt_sel_param(tvb, subtree2, bit_offset);
5144
5145 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5146 { /* Optional Power Offset */
5147 bit_offset += 1;
5148 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_power_offset, tvb, bit_offset, 2, FALSE);
5149 bit_offset += 2;
5150 }
5151 else
5152 bit_offset += 1;
5153 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5154 {
5155 bit_offset += 1;
5156 bit_offset += de_rr_rest_oct_gprs_indicator(tvb, subtree2, bit_offset);
5157 }
5158 else
5159 bit_offset += 1;
5160 proto_item_set_len(item2,(bit_offset>>3)+1-curr_offset);
5161 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5162 { /* SI4 Rest Octets_S */
5163 bit_offset += 1;
5164 bit_offset_sav = bit_offset;
5165 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_SI4_REST_OCTETS_S].strptr);
5166 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_SI4_REST_OCTETS_S]);
5167 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5168 { /* LSA Parameters */
5169 bit_offset += 1;
5170 bit_offset_sav2 = bit_offset;
5171 item3 = proto_tree_add_text(subtree2, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_LSA_PARAMETERS].strptr);
5172 subtree3 = proto_item_add_subtree(item3, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_LSA_PARAMETERS]);
5173 proto_tree_add_bits_item(subtree3, hf_gsm_a_rr_prio_thr, tvb, bit_offset, 3, FALSE);
5174 bit_offset += 3;
5175 proto_tree_add_bits_item(subtree3, hf_gsm_a_rr_lsa_offset, tvb, bit_offset, 3, FALSE);
5176 bit_offset += 3;
5177 value = tvb_get_bits8(tvb,bit_offset,1);
5178 bit_offset += 1;
5179 if (value)
5180 {
5181 proto_tree_add_text(subtree3, tvb, bit_offset>>3, 2, "MCC: %d", tvb_get_bits16(tvb,bit_offset,12,FALSE));
5182 bit_offset += 12;
5183 proto_tree_add_text(subtree3, tvb, bit_offset>>3, 2, "MNC: %d", tvb_get_bits16(tvb,bit_offset,12,FALSE));
5184 bit_offset += 12;
5185 }
5186 proto_item_set_len(item2,((bit_offset-bit_offset_sav2)>>3)+1);
5187 }
5188 else
5189 bit_offset += 1;
5190 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5191 { /* Cell Identity */
5192 bit_offset += 1;
5193 value = tvb_get_bits16(tvb, bit_offset, 16, FALSE);
5194 proto_tree_add_uint(subtree2, hf_gsm_a_bssmap_cell_ci, tvb, bit_offset>>3, 2, value);
5195 bit_offset += 16;
5196 }
5197 else
5198 bit_offset += 1;
5199 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5200 { /* LSA ID information */
5201 bit_offset += 1;
5202 bit_offset_sav2 = bit_offset;
5203 item3 = proto_tree_add_text(subtree2, tvb, bit_offset>>3, len, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_LSA_ID_INFO].strptr);
5204 subtree3 = proto_item_add_subtree(item3, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_LSA_ID_INFO]);
5205 do
5206 {
5207 value = tvb_get_bits8(tvb,bit_offset,1);
5208 bit_offset += 1;
5209 if (value)
5210 {
5211 proto_tree_add_text(subtree3, tvb, bit_offset>>3, 3, "Short LSA ID: %d",tvb_get_bits16(tvb,bit_offset,10,FALSE));
5212 bit_offset += 10;
5213 }
5214 else
5215 {
5216 proto_tree_add_text(subtree3, tvb, bit_offset>>3, 3, "LSA ID: %d",tvb_get_bits32(tvb,bit_offset,24,FALSE));
5217 bit_offset += 24;
5218 }
5219 value = tvb_get_bits8(tvb,bit_offset,1);
5220 bit_offset += 1;
5221 } while (value);
5222 }
5223 else
5224 bit_offset += 1;
5225 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5226 {
5227 bit_offset += 1;
5228 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_cbq3, tvb, (curr_offset<<3)+1, 2, FALSE);
5229 bit_offset += 3;
5230 }
5231 else
5232 bit_offset += 1;
5233 value = tvb_get_bits8(tvb,bit_offset,1);
5234 bit_offset += 1;
5235 if (value)
5236 {
5237 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si13alt_position, tvb, bit_offset, 1, FALSE);
5238 bit_offset += 1;
5239 }
5240 proto_item_set_len(item2,((bit_offset-bit_offset_sav)>>3)+1);
5241 }
5242 else
5243 { /* Break indicator */
5244 bit_offset += 1;
5245 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5246 proto_tree_add_text(subtree, tvb, bit_offset>>3, 1, "Break Indicator: Additional parameters \"SI4 Rest Octets_S\" are sent in SYSTEM INFORMATION TYPE 7 and 8");
5247 else
5248 proto_tree_add_text(subtree, tvb, bit_offset>>3, 1, "Break Indicator: Additional parameters \"SI4 Rest Octets_S\" are not sent in SYSTEM INFORMATION TYPE 7 and 8");
5249 bit_offset += 1;
5250 }
5251
5252 curr_offset = curr_offset + len;
5253
5254 return curr_offset-offset;
5255}
5256
5257/*
5258 * [3] 10.5.2.35a SI 6 Rest Octets
5259 */
5260static const true_false_string gsm_a_rr_paging_channel_restructuring_value = {
5261 "Paging channel is restructured",
5262 "Paging channel is not restructured"
5263};
5264
5265static const true_false_string gsm_a_rr_vbs_vgcs_inband_notifications_value = {
5266 "The mobile shall be notified on incoming high priority VBS/VGCS calls through NOTIFICATION/FACCH, the mobile need not to inspect the NCH",
5267 "The network does not provide notification on FACCH so that the mobile should inspect the NCH for notifications"
5268};
5269
5270static const true_false_string gsm_a_rr_vbs_vgcs_inband_pagings_value = {
5271 "The mobile shall be notified on incoming high priority point-to-point calls through NOTIFICATION/FACCH, the mobile need not to inspect the PCH",
5272 "The network does not provide paging information on FACCH so that the mobile should inspect the PCH for pagings"
5273};
5274
5275static const value_string gsm_a_rr_max_lapdm_vals[] = {
5276 { 0, "Any message segmented in up to 5 LAPDm frames"},
5277 { 1, "Any message segmented in up to 6 LAPDm frames"},
5278 { 2, "Any message segmented in up to 7 LAPDm frames"},
5279 { 3, "Any message segmented in up to 8 LAPDm frames"},
5280 { 4, "Any message segmented in up to 9 LAPDm frames"},
5281 { 5, "Any message segmented in up to 10 LAPDm frames"},
5282 { 6, "Any message segmented in up to 11 LAPDm frames"},
5283 { 7, "Any message segmented in up to 12 LAPDm frames"},
5284 { 0, NULL }
5285};
5286
5287static const true_false_string gsm_a_rr_dedicated_mode_mbms_notification_support_value = {
5288 "The cell supports the Dedicated Mode MBMS Notification procedures",
5289 "The cell does not support the Dedicated Mode MBMS Notification procedures"
5290};
5291
5292static const true_false_string gsm_a_rr_mnci_support_value = {
5293 "The cell supports the distribution of MBMS NEIGHBOURING CELL INFORMATION messages",
5294 "The cell does not support the distribution of MBMS NEIGHBOURING CELL INFORMATION messages"
5295};
5296
5297static guint16
5298de_rr_si6_rest_oct(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
5299{
5300 proto_tree *subtree, *subtree2;
5301 proto_item *item, *item2;
5302 guint32 curr_offset;
5303 gint bit_offset, bit_offset_sav;
5304 guint8 value;
5305
5306 len = 7;
5307 curr_offset = offset;
5308 bit_offset = curr_offset << 3;
5309
5310 item = proto_tree_add_text(tree, tvb, curr_offset, len, "%s",
5311 gsm_rr_elem_strings[DE_RR_SI6_REST_OCT].strptr);
5312
5313 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_SI6_REST_OCT]);
5314
5315 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5316 { /* PCH and NCH Info */
5317 bit_offset += 1;
5318 bit_offset_sav = bit_offset;
5319 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_PCH_AND_NCH_INFO].strptr);
5320 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_PCH_AND_NCH_INFO]);
5321 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_paging_channel_restructuring, tvb, bit_offset, 1, FALSE);
5322 bit_offset += 1;
5323 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_nln_sacch, tvb, bit_offset, 2, FALSE);
5324 bit_offset += 2;
5325 value = tvb_get_bits8(tvb,bit_offset,1);
5326 bit_offset += 1;
5327 if (value)
5328 {
5329 proto_tree_add_bits_item(subtree2, hf_gsm_a_call_prio, tvb, bit_offset, 3, FALSE);
5330 bit_offset += 3;
5331 }
5332 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_nln_status_sacch, tvb, bit_offset, 1, FALSE);
5333 bit_offset += 1;
5334 proto_item_set_len(item2,((bit_offset-bit_offset_sav)>>3)+1);
5335 }
5336 else
5337 bit_offset += 1;
5338 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5339 { /* VBS/VGCS options */
5340 bit_offset += 1;
5341 bit_offset_sav = bit_offset;
5342 item2 = proto_tree_add_text(subtree, tvb,bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_VBS_VGCS_OPTIONS].strptr);
5343 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_VBS_VGCS_OPTIONS]);
5344 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_vbs_vgcs_inband_notifications, tvb, bit_offset, 1, FALSE);
5345 bit_offset += 1;
5346 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_vbs_vgcs_inband_pagings, tvb, bit_offset, 1, FALSE);
5347 bit_offset += 1;
5348 proto_item_set_len(item2,((bit_offset-bit_offset_sav)>>3)+1);
5349 }
5350 else
5351 bit_offset += 1;
5352 value = gsm_a_rr_is_bit_high(tvb,bit_offset);
5353 if (value == TRUE)
5354 {
5355 proto_tree_add_text(subtree, tvb, bit_offset>>3, 1, "DTM is supported in the serving cell");
5356 bit_offset += 1;
5357 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rac, tvb, bit_offset, 8, FALSE);
5358 bit_offset += 8;
5359 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_max_lapdm, tvb, bit_offset, 3, FALSE);
5360 bit_offset += 3;
5361 }
5362 else
5363 {
5364 proto_tree_add_text(subtree, tvb, bit_offset>>3, 1, "DTM is not supported in the serving cell");
5365 bit_offset += 1;
5366 }
5367 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5368 proto_tree_add_text(subtree, tvb, bit_offset>>3, 1, "Band Indicator: 1900");
5369 else
5370 proto_tree_add_text(subtree, tvb, bit_offset>>3, 1, "Band Indicator: 1800");
5371 bit_offset += 1;
5372 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5373 {
5374 bit_offset += 1;
5375 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_gprs_ms_txpwr_max_ccch, tvb, bit_offset, 5, FALSE);
5376 bit_offset += 5;
5377 }
5378 else
5379 bit_offset += 1;
5380 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5381 { /* MBMS Procedures */
5382 bit_offset += 1;
5383 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_dedicated_mode_mbms_notification_support, tvb, bit_offset, 1, FALSE);
5384 bit_offset += 1;
5385 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_mnci_support, tvb, bit_offset, 1, FALSE);
5386 bit_offset += 1;
5387 }
5388 else
5389 bit_offset += 1;
5390 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5391 { /* Additions in Release 7 */
5392 bit_offset += 1;
5393 value = tvb_get_bits8(tvb,bit_offset,1);
5394 bit_offset += 1;
5395 if (value)
5396 {
5397 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_amr_config, tvb, bit_offset, 4, FALSE);
5398 bit_offset += 4;
5399 }
5400 }
5401 else
5402 bit_offset += 1;
5403
5404 curr_offset = curr_offset + len;
5405
5406 return curr_offset-offset;
5407}
5408
5409/* [3] 10.5.2.36 SI 7 Rest Octets
5410 * [3] 10.5.2.37 SI 8 Rest Octets
5411 * [3] 10.5.2.37a SI 9 Rest Octets
5412 */
5413
5414/*
5415 * [3] 10.5.2.37b SI 13 Rest Octets
5416 */
5417static const value_string gsm_a_rr_si_change_field_vals[] = {
5418 { 0, "Update of unspecified SI message or SI messages"},
5419 { 1, "Update of SI1 message"},
5420 { 2, "Update of SI2, SI2 bis or SI2 ter message or any instance of SI2quater messages"},
5421 { 3, "Update of SI3, SI4, SI7, SI8, SI16 or SI17 message"},
5422 { 4, "Update of SI9 message"},
5423 { 5, "Update of SI18 or SI20 message"},
5424 { 6, "Update of SI19 message"},
5425 { 7, "Update of SI15 message"},
5426 { 8, "Update of SI2n message"},
5427 { 9, "Update of unknown SI message type"},
5428 { 10, "Update of unknown SI message type"},
5429 { 11, "Update of unknown SI message type"},
5430 { 12, "Update of unknown SI message type"},
5431 { 13, "Update of unknown SI message type"},
5432 { 14, "Update of unknown SI message type"},
5433 { 15, "Update of unknown SI message type"},
5434 { 0, NULL }
5435};
5436
5437static const value_string gsm_a_rr_psi1_repeat_period_vals[] = {
5438 { 0, "1 multiframe"},
5439 { 1, "2 multiframes"},
5440 { 2, "3 multiframes"},
5441 { 3, "4 multiframes"},
5442 { 4, "5 multiframes"},
5443 { 5, "6 multiframes"},
5444 { 6, "7 multiframes"},
5445 { 7, "8 multiframes"},
5446 { 8, "9 multiframes"},
5447 { 9, "10 multiframes"},
5448 { 10, "11 multiframes"},
5449 { 11, "12 multiframes"},
5450 { 12, "13 multiframes"},
5451 { 13, "14 multiframes"},
5452 { 14, "15 multiframes"},
5453 { 15, "16 multiframes"},
5454 { 0, NULL }
5455};
5456
5457static const value_string gsm_a_rr_pbcch_pb_vals[] = {
5458 { 0, "0 dB"},
5459 { 1, "-2 dB"},
5460 { 2, "-4 dB"},
5461 { 3, "-6 dB"},
5462 { 4, "-8 dB"},
5463 { 5, "-10 dB"},
5464 { 6, "-12 dB"},
5465 { 7, "-14 dB"},
5466 { 8, "-16 dB"},
5467 { 9, "-18 dB"},
5468 { 10, "-20 dB"},
5469 { 11, "-22 dB"},
5470 { 12, "-24 dB"},
5471 { 13, "-26 dB"},
5472 { 14, "-28 dB"},
5473 { 15, "-30 dB"},
5474 { 0, NULL }
5475};
5476
5477static const true_false_string gsm_a_rr_spgc_ccch_sup_value = {
5478 "SPLIT_PG_CYCLE is supported on CCCH in this cell",
5479 "SPLIT_PG_CYCLE is not supported on CCCH in this cell"
5480};
5481
5482static const value_string gsm_a_rr_priority_access_thr_vals[] = {
5483 { 0, "Packet access is not allowed in the cell"},
5484 { 1, "Packet access is not allowed in the cell"},
5485 { 2, "Packet access is not allowed in the cell"},
5486 { 3, "Packet access is allowed for priority level 1"},
5487 { 4, "Packet access is allowed for priority level 1 to 2"},
5488 { 5, "Packet access is allowed for priority level 1 to 3"},
5489 { 6, "Packet access is allowed for priority level 1 to 4"},
5490 { 7, "Packet access is allowed for priority level 1 to 4"},
5491 { 0, NULL }
5492};
5493
5494static gint
5495de_rr_rest_oct_gprs_mobile_allocation(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
5496{
5497 proto_tree *subtree;
5498 proto_item *item;
5499 gint curr_bit_offset;
5500 guint8 value;
5501 guint64 ma_length;
5502
5503 curr_bit_offset = bit_offset;
5504
5505 item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_GPRS_MOBILE_ALLOC].strptr);
5506 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_GPRS_MOBILE_ALLOC]);
5507 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_hsn, tvb, curr_bit_offset, 6, FALSE);
5508 curr_bit_offset += 6;
5509 while (tvb_get_bits8(tvb,curr_bit_offset,1))
5510 {
5511 curr_bit_offset += 1;
5512 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rfl_number, tvb, curr_bit_offset, 4, FALSE);
5513 curr_bit_offset += 4;
5514 }
5515 curr_bit_offset += 1;
5516 if (tvb_get_bits8(tvb,curr_bit_offset,1))
5517 {
5518 curr_bit_offset += 1;
5519 while (tvb_get_bits8(tvb,curr_bit_offset,1))
5520 {
5521 curr_bit_offset += 1;
5522 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_arfcn_index, tvb, curr_bit_offset, 6, FALSE);
5523 curr_bit_offset += 6;
5524 }
5525 curr_bit_offset += 1;
5526 }
5527 else
5528 {
5529 curr_bit_offset += 1;
5530 proto_tree_add_bits_ret_val(subtree, hf_gsm_a_rr_ma_length, tvb, curr_bit_offset, 6, &ma_length, FALSE);
5531 curr_bit_offset += 6;
5532 value = (gint)ma_length + 1;
5533 item = proto_tree_add_text(subtree,tvb, curr_bit_offset>>3, (value>>3)+1, "MA Bitmap: ");
5534 while (value)
5535 {
5536 proto_item_append_text(item,"%d",tvb_get_bits8(tvb,curr_bit_offset,1));
5537 curr_bit_offset += 1;
5538 value -= 1;
5539 }
5540 }
5541 proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
5542
5543 return (curr_bit_offset - bit_offset);
5544}
5545
5546static const value_string gsm_a_rr_nmo_vals[] = {
5547 { 0, "Network Mode of Operation I"},
5548 { 1, "Network Mode of Operation II"},
5549 { 2, "Network Mode of Operation III"},
5550 { 3, "Reserved"},
5551 { 0, NULL }
5552};
5553
5554static const value_string gsm_a_rr_t3168_vals[] = {
5555 { 0, "500 ms"},
5556 { 1, "1000 ms"},
5557 { 2, "1500 ms"},
5558 { 3, "2000 ms"},
5559 { 4, "2500 ms"},
5560 { 5, "3000 ms"},
5561 { 6, "3500 ms"},
5562 { 7, "4000 ms"},
5563 { 0, NULL }
5564};
5565
5566static const value_string gsm_a_rr_t3192_vals[] = {
5567 { 0, "500 ms"},
5568 { 1, "1000 ms"},
5569 { 2, "1500 ms"},
5570 { 3, "0 ms"},
5571 { 4, "80 ms"},
5572 { 5, "120 ms"},
5573 { 6, "160 ms"},
5574 { 7, "200 ms"},
5575 { 0, NULL }
5576};
5577
5578static const value_string gsm_a_rr_drx_timer_max_vals[] = {
5579 { 0, "0 s"},
5580 { 1, "1 s"},
5581 { 2, "2 s"},
5582 { 3, "4 s"},
5583 { 4, "8 s"},
5584 { 5, "16 s"},
5585 { 6, "32 s"},
5586 { 7, "64 s"},
5587 { 0, NULL }
5588};
5589
5590static const true_false_string gsm_a_rr_access_burst_type_value = {
5591 "11-bit format shall be used",
5592 "8-bit format shall be used"
5593};
5594
5595static const true_false_string gsm_a_rr_control_ack_type_value = {
5596 "Default format is RLC/MAC control block",
5597 "Default format is four access bursts"
5598};
5599
5600static const value_string gsm_a_rr_pan_max_vals[] = {
5601 { 0, "maximum value allowed for counter N3102 is 4"},
5602 { 1, "maximum value allowed for counter N3102 is 8"},
5603 { 2, "maximum value allowed for counter N3102 is 12"},
5604 { 3, "maximum value allowed for counter N3102 is 16"},
5605 { 4, "maximum value allowed for counter N3102 is 20"},
5606 { 5, "maximum value allowed for counter N3102 is 24"},
5607 { 6, "maximum value allowed for counter N3102 is 28"},
5608 { 7, "maximum value allowed for counter N3102 is 32"},
5609 { 0, NULL }
5610};
5611
5612static const true_false_string gsm_a_rr_egprs_packet_channel_request_value = {
5613 "Use two phase packet access with PACKET CHANNEL REQUEST message for uplink TBF establishment on the PRACH",
5614 "Use EGPRS PACKET CHANNEL REQUEST message for uplink TBF establishment on the PRACH"
5615};
5616
5617static const value_string gsm_a_rr_bep_period_vals[] = {
5618 { 0, "1"},
5619 { 1, "2"},
5620 { 2, "3"},
5621 { 3, "4"},
5622 { 4, "5"},
5623 { 5, "7"},
5624 { 6, "10"},
5625 { 7, "12"},
5626 { 8, "15"},
5627 { 9, "20"},
5628 { 10, "25"},
5629 { 11, "Reserved"},
5630 { 12, "Reserved"},
5631 { 13, "Reserved"},
5632 { 14, "Reserved"},
5633 { 15, "Reserved"},
5634 { 0, NULL }
5635};
5636
5637static const true_false_string gsm_a_rr_pfc_feature_mode_value = {
5638 "The network supports packet flow context procedures",
5639 "The network does not support packet flow context procedures"
5640};
5641
5642static const true_false_string gsm_a_rr_dtm_support_value = {
5643 "The cell supports DTM procedures",
5644 "The cell does not support DTM procedures"
5645};
5646
5647static const true_false_string gsm_a_rr_bss_paging_coordination_value = {
5648 "The cell supports Circuit-Switched paging coordination",
5649 "The cell does not support Circuit-Switched paging coordination"
5650};
5651
5652static const true_false_string gsm_a_rr_ccn_active_value = {
5653 "CCN is enabled in the cell",
5654 "CCN is disabled in the cell"
5655};
5656
5657static const true_false_string gsm_a_rr_nw_ext_utbf_value = {
5658 "The extended uplink TBF mode is supported by the network",
5659 "The extended uplink TBF mode is not supported by the network"
5660};
5661
5662static const true_false_string gsm_a_rr_multiple_tbf_capability_value = {
5663 "The cell supports multiple TBF procedures",
5664 "The cell does not support multiple TBF procedures"
5665};
5666
5667static const true_false_string gsm_a_rr_ext_utbf_no_data_value = {
5668 "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",
5669 "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"
5670};
5671
5672static const true_false_string gsm_a_rr_dtm_enhancements_capability_value = {
5673 "The cell supports enhanced DTM CS establishment and enhanced DTM CS release procedures",
5674 "The cell does not support enhanced DTM CS establishment and enhanced DTM CS release procedures"
5675};
5676
5677static const true_false_string gsm_a_rr_reduced_latency_access_value = {
5678 "The cell supports \"One Phase Access Request by Reduced Latency MS\"",
5679 "The cell does not support \"One Phase Access Request by Reduced Latency MS\""
5680};
5681
5682static const value_string gsm_a_rr_alpha_vals[] = {
5683 { 0, "0.0"},
5684 { 1, "0.1"},
5685 { 2, "0.2"},
5686 { 3, "0.3"},
5687 { 4, "0.4"},
5688 { 5, "0.5"},
5689 { 6, "0.6"},
5690 { 7, "0.7"},
5691 { 8, "0.8"},
5692 { 9, "0.9"},
5693 { 10, "1.0"},
5694 { 11, "1.0"},
5695 { 12, "1.0"},
5696 { 13, "1.0"},
5697 { 14, "1.0"},
5698 { 15, "1.0"},
5699 { 0, NULL }
5700};
5701
5702static const value_string gsm_a_rr_t_avg_x_vals[] = {
5703 { 0, "2^(0/2) / 6 multiframes"},
5704 { 1, "2^(1/2) / 6 multiframes"},
5705 { 2, "2^(2/2) / 6 multiframes"},
5706 { 3, "2^(3/2) / 6 multiframes"},
5707 { 4, "2^(4/2) / 6 multiframes"},
5708 { 5, "2^(5/2) / 6 multiframes"},
5709 { 6, "2^(6/2) / 6 multiframes"},
5710 { 7, "2^(7/2) / 6 multiframes"},
5711 { 8, "2^(8/2) / 6 multiframes"},
5712 { 9, "2^(9/2) / 6 multiframes"},
5713 { 10, "2^(10/2) / 6 multiframes"},
5714 { 11, "2^(11/2) / 6 multiframes"},
5715 { 12, "2^(12/2) / 6 multiframes"},
5716 { 13, "2^(13/2) / 6 multiframes"},
5717 { 14, "2^(14/2) / 6 multiframes"},
5718 { 15, "2^(15/2) / 6 multiframes"},
5719 { 16, "2^(16/2) / 6 multiframes"},
5720 { 17, "2^(17/2) / 6 multiframes"},
5721 { 18, "2^(18/2) / 6 multiframes"},
5722 { 19, "2^(19/2) / 6 multiframes"},
5723 { 20, "2^(20/2) / 6 multiframes"},
5724 { 21, "2^(21/2) / 6 multiframes"},
5725 { 22, "2^(22/2) / 6 multiframes"},
5726 { 23, "2^(23/2) / 6 multiframes"},
5727 { 24, "2^(24/2) / 6 multiframes"},
5728 { 25, "2^(25/2) / 6 multiframes"},
5729 { 26, "2^(25/2) / 6 multiframes"},
5730 { 27, "2^(25/2) / 6 multiframes"},
5731 { 28, "2^(25/2) / 6 multiframes"},
5732 { 29, "2^(25/2) / 6 multiframes"},
5733 { 30, "2^(25/2) / 6 multiframes"},
5734 { 31, "2^(25/2) / 6 multiframes"},
5735 { 0, NULL }
5736};
5737
5738static const true_false_string gsm_a_rr_pc_meas_chan_value = {
5739 "Downlink measurements for power control shall be made on PDCH",
5740 "Downlink measurements for power control shall be made on BCCH"
5741};
5742
5743static const value_string gsm_a_rr_n_avg_i_vals[] = {
5744 { 0, "2^(0/2)"},
5745 { 1, "2^(1/2)"},
5746 { 2, "2^(2/2)"},
5747 { 3, "2^(3/2)"},
5748 { 4, "2^(4/2)"},
5749 { 5, "2^(5/2)"},
5750 { 6, "2^(6/2)"},
5751 { 7, "2^(7/2)"},
5752 { 8, "2^(8/2)"},
5753 { 9, "2^(9/2)"},
5754 { 10, "2^(10/2)"},
5755 { 11, "2^(11/2)"},
5756 { 12, "2^(12/2)"},
5757 { 13, "2^(13/2)"},
5758 { 14, "2^(14/2)"},
5759 { 15, "2^(15/2)"},
5760 { 0, NULL }
5761};
5762
5763static const true_false_string gsm_a_rr_sgsnr_value = {
5764 "SGSN is Release '99 onwards",
5765 "SGSN is Release '98 or older"
5766};
5767
5768static const true_false_string gsm_a_rr_si_status_ind_value = {
5769 "The network supports the PACKET SI STATUS message",
5770 "The network does not support the PACKET SI STATUS message"
5771};
5772
5773static const value_string gsm_a_rr_lb_ms_txpwr_max_cch_vals[] = {
5774 { 0, "43 dBm"},
5775 { 1, "41 dBm"},
5776 { 2, "39 dBm"},
5777 { 3, "37 dBm"},
5778 { 4, "35 dBm"},
5779 { 5, "33 dBm"},
5780 { 6, "31 dBm"},
5781 { 7, "29 dBm"},
5782 { 8, "27 dBm"},
5783 { 9, "25 dBm"},
5784 { 10, "23 dBm"},
5785 { 11, "21 dBm"},
5786 { 12, "19 dBm"},
5787 { 13, "17 dBm"},
5788 { 14, "15 dBm"},
5789 { 15, "13 dBm"},
5790 { 16, "11 dBm"},
5791 { 17, "9 dBm"},
5792 { 18, "7 dBm"},
5793 { 19, "5 dBm"},
5794 { 20, "5 dBm"},
5795 { 21, "5 dBm"},
5796 { 22, "5 dBm"},
5797 { 23, "5 dBm"},
5798 { 24, "5 dBm"},
5799 { 25, "5 dBm"},
5800 { 26, "5 dBm"},
5801 { 27, "5 dBm"},
5802 { 28, "5 dBm"},
5803 { 29, "5 dBm"},
5804 { 30, "5 dBm"},
5805 { 31, "5 dBm"},
5806 { 0, NULL }
5807};
5808
5809static const value_string gsm_a_rr_si2n_support_vals[] = {
5810 { 0, "SI2n is not supported"},
5811 { 1, "SI2n is supported on PACCH"},
5812 { 2, "SI2n is supported on PACCH and broadcast on BCCH"},
5813 { 3, "SI2n is supported on PACCH and broadcast on BCCH Ext"},
5814 { 0, NULL }
5815};
5816
5817static guint16
5818de_rr_si13_rest_oct(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
5819{
5820 proto_tree *subtree, *subtree2;
5821 proto_item *item, *item2;
5822 guint32 curr_offset;
5823 gint bit_offset, bit_offset_sav;
5824 guint8 value;
5825
5826 len = 20;
5827 curr_offset = offset;
5828 bit_offset = curr_offset << 3;
5829
5830 item = proto_tree_add_text(tree, tvb, curr_offset, len, "%s",
5831 gsm_rr_elem_strings[DE_RR_SI13_REST_OCT].strptr);
5832
5833 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_SI13_REST_OCT]);
5834
5835 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5836 {
5837 bit_offset += 1;
5838 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bcch_change_mark, tvb, bit_offset, 3, FALSE);
5839 bit_offset += 3;
5840 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si_change_field, tvb, bit_offset, 4, FALSE);
5841 bit_offset += 4;
5842 value = tvb_get_bits8(tvb,bit_offset,1);
5843 bit_offset += 1;
5844 if (value)
5845 {
5846 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si13_change_mark, tvb, bit_offset, 2, FALSE);
5847 bit_offset += 2;
5848 bit_offset += de_rr_rest_oct_gprs_mobile_allocation(tvb, subtree, bit_offset);
5849 }
5850 value = tvb_get_bits8(tvb,bit_offset,1);
5851 bit_offset += 1;
5852 if (value)
5853 { /* PBCCH present in the cell */
5854 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_psi1_repeat_period, tvb, bit_offset, 4, FALSE);
5855 bit_offset += 4;
5856 bit_offset_sav = bit_offset;
5857 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_PBCCH_DESC].strptr);
5858 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_PBCCH_DESC]);
5859 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_pbcch_pb, tvb, bit_offset, 4, FALSE);
5860 bit_offset += 4;
5861 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_pbcch_tsc, tvb, bit_offset, 3, FALSE);
5862 bit_offset += 3;
5863 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_pbcch_tn, tvb, bit_offset, 3, FALSE);
5864 bit_offset += 3;
5865 value = tvb_get_bits8(tvb,bit_offset,1);
5866 bit_offset += 1;
5867 if (value)
5868 {
5869 proto_tree_add_text(subtree2, tvb, bit_offset>>3, 1, "MAIO: %d", tvb_get_bits8(tvb,bit_offset,6));
5870 bit_offset += 6;
5871 }
5872 else
5873 {
5874 value = tvb_get_bits8(tvb,bit_offset,1);
5875 bit_offset += 1;
5876 if (value)
5877 {
5878 proto_tree_add_bits_item(subtree2, hf_gsm_a_rr_arfcn, tvb, bit_offset, 10, FALSE);
5879 bit_offset += 10;
5880 }
5881 else
5882 proto_tree_add_text(subtree2, tvb, bit_offset>>3, 1, "PBCCH shall use the BCCH carrier");
5883 }
5884 proto_item_set_len(item2,((bit_offset-bit_offset_sav)>>3)+1);
5885 }
5886 else
5887 { /* PBCCH not present in the cell */
5888 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rac, tvb, bit_offset, 8, FALSE);
5889 bit_offset += 8;
5890 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_spgc_ccch_sup, tvb, bit_offset, 1, FALSE);
5891 bit_offset += 1;
5892 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_priority_access_thr, tvb, bit_offset, 3, FALSE);
5893 bit_offset += 3;
5894 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_network_control_order, tvb, bit_offset, 2, FALSE);
5895 bit_offset += 2;
5896 bit_offset += de_rr_rest_oct_gprs_cell_options(tvb, subtree, bit_offset);
5897 bit_offset += de_rr_rest_oct_gprs_power_control_parameters(tvb, subtree, bit_offset);
5898 }
5899 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5900 { /* Additions in release 99 */
5901 bit_offset += 1;
5902 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_sgsnr, tvb, bit_offset, 1, FALSE);
5903 bit_offset += 1;
5904 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5905 { /* Additions in release Rel-4 */
5906 bit_offset += 1;
5907 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si_status_ind, tvb, bit_offset, 1, FALSE);
5908 bit_offset += 1;
5909 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
5910 { /* Additions in release Rel-6 */
5911 bit_offset += 1;
5912 value = tvb_get_bits8(tvb,bit_offset,1);
5913 bit_offset += 1;
5914 if (value)
5915 {
5916 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_lb_ms_txpwr_max_cch, tvb, bit_offset, 5, FALSE);
5917 bit_offset += 5;
5918 }
5919 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_si2n_support, tvb, bit_offset, 2, FALSE);
5920 bit_offset += 2;
5921 }
5922 else
5923 bit_offset += 1;
5924 }
5925 else
5926 bit_offset += 1;
5927 }
5928 else
5929 bit_offset += 1;
5930 }
5931 else
5932 {
5933 bit_offset += 1;
5934 proto_tree_add_text(subtree,tvb, curr_offset, len ,"Empty");
5935 }
5936
5937 curr_offset = curr_offset + len;
5938
5939 return curr_offset-offset;
5940}
5941
5942/* [3] 10.5.2.37c (void)
5943 * [3] 10.5.2.37d (void)
5944 * [3] 10.5.2.37e SI 16 Rest Octets
5945 * [3] 10.5.2.37f SI 17 Rest Octets
5946 * [3] 10.5.2.37g SI 19 Rest Octets
5947 * [3] 10.5.2.37h SI 18 Rest Octets
5948 * [3] 10.5.2.37i SI 20 Rest Octets
5949 */
5950/*
5951 * [3] 10.5.2.38 Starting Time
5952 */
5953static guint16
5954de_rr_starting_time(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
5955{
5956 proto_item *item;
5957 guint32 curr_offset;
5958 guint16 rfn, fn;
5959
5960 curr_offset = offset;
5961
5962 fn = tvb_get_ntohs(tvb,curr_offset);
5963 rfn = reduced_frame_number(fn);
5964 proto_tree_add_item(tree, hf_gsm_a_rr_T1prim, tvb, curr_offset, 1, FALSE);
5965 proto_tree_add_item(tree, hf_gsm_a_rr_T3, tvb, curr_offset, 2, FALSE);
5966 curr_offset++;
5967 proto_tree_add_item(tree, hf_gsm_a_rr_T2, tvb, curr_offset, 1, FALSE);
5968 curr_offset++;
5969 item = proto_tree_add_uint(tree, hf_gsm_a_rr_rfn, tvb, curr_offset-2, 2, rfn);
5970 PROTO_ITEM_SET_GENERATED(item);
5971 return(curr_offset - offset);
5972}
5973/*
5974 * [3] 10.5.2.39 Synchronization Indication
5975 */
5976/*
5977 * ROT: Report Observed Time Difference (Octet1 bit 3) */
5978
5979static const true_false_string sm_a_rr_sync_ind_rot_value = {
5980 "Mobile Time Difference IE shall be included in the HANDOVER COMPLETE message",
5981 "Mobile Time Difference IE shall not be included in the HANDOVER COMPLETE message"
5982};
5983
5984/* SI: Synchronization indication (octet 1)Bit2 1 */
5985
5986static const value_string gsm_a_rr_sync_ind_si_vals[] = {
5987 { 0, "Non-synchronized"},
5988 { 1, "Synchronized"},
5989 { 2, "Pre-synchronised"},
5990 { 3, "Pseudo-synchronised"},
5991 { 0, NULL }
5992};
5993/* NCI: Normal cell indication (octet 1, bit 4) */
5994
5995static const true_false_string gsm_a_rr_sync_ind_nci_value = {
5996 "Out of range timing advance shall trigger a handover failure procedure",
5997 "Out of range timing advance is ignored"
5998};
5999static guint16
6000de_rr_sync_ind(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
6001{
6002 guint32 curr_offset;
6003
6004 curr_offset = offset;
6005
6006 /*NCI */
6007 proto_tree_add_item(tree, hf_gsm_a_rr_sync_ind_nci, tvb, curr_offset, 1, FALSE);
6008 /*ROT */
6009 proto_tree_add_item(tree, hf_gsm_a_rr_sync_ind_rot, tvb, curr_offset, 1, FALSE);
6010 /*SI*/
6011 proto_tree_add_item(tree, hf_gsm_a_rr_sync_ind_si, tvb, curr_offset, 1, FALSE);
6012
6013 curr_offset = curr_offset + 1;
6014
6015 return(curr_offset - offset);
6016}
6017
6018/*
6019 * [3] 10.5.2.40 Timing Advance
6020 */
6021static guint16
6022de_rr_timing_adv(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
6023{
6024 guint32 curr_offset;
6025
6026 curr_offset = offset;
6027
6028 proto_tree_add_item(tree, hf_gsm_a_rr_timing_adv, tvb, curr_offset, 1, FALSE);
6029 curr_offset = curr_offset + 1;
6030
6031 return(curr_offset - offset);
6032}
6033
6034/*
6035 * [3] 10.5.2.41 Time Difference
6036 */
6037static guint16
6038de_rr_time_diff(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
6039{
6040 guint32 curr_offset;
6041
6042 curr_offset = offset;
6043
6044 proto_tree_add_item(tree, hf_gsm_a_rr_time_diff, tvb, curr_offset, 1, FALSE);
6045 curr_offset = curr_offset + 1;
6046
6047 return(curr_offset - offset);
6048}
6049/*
6050 * [3] 10.5.2.41a TLLI
6051 * The TLLI is encoded as a binary number with a length of 4 octets. TLLI is defined in 3GPP TS 23.003
6052 */
6053guint16
6054de_rr_tlli(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
6055{
6056 guint32 curr_offset;
6057
6058 curr_offset = offset;
6059
6060 proto_tree_add_item(tree, hf_gsm_a_rr_tlli, tvb, curr_offset, 4, FALSE);
6061 curr_offset = curr_offset + 4;
6062
6063 return(curr_offset - offset);
6064}
6065
6066/*
6067 * [3] 10.5.2.42 TMSI/P-TMSI
6068 */
6069guint16
6070de_rr_tmsi_ptmsi(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
6071{
6072 proto_tree *subtree;
6073 proto_item *item;
6074 guint32 curr_offset;
6075
6076 curr_offset = offset;
6077
6078 item = proto_tree_add_text(tree, tvb, curr_offset, 3, "%s",
6079 gsm_rr_elem_strings[DE_RR_TMSI_PTMSI].strptr);
6080
6081 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_TMSI_PTMSI]);
6082
6083 proto_tree_add_item(subtree, hf_gsm_a_rr_tmsi_ptmsi, tvb, curr_offset, 4, FALSE);
6084 curr_offset = curr_offset + 4;
6085
6086 return(curr_offset - offset);
6087}
6088
6089/*
6090 * [3] 10.5.2.42a VGCS target mode Indication
6091 */
6092/*
6093Target mode (octet 3)
6094Bit 8 7
6095 0 0 dedicated mode
6096 0 1 group transmit mode
6097 Other values are reserved for future use.
6098*/
6099static const value_string gsm_a_rr_target_mode_vals[] _U_ = {
6100 { 0, "Dedicated mode"},
6101 { 1, "Group transmit mode"},
6102 { 0, NULL }
6103};
6104static guint16
6105de_rr_vgcs_tar_mode_ind(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
6106{
6107 guint32 curr_offset;
6108
6109 curr_offset = offset;
6110
6111 proto_tree_add_item(tree, hf_gsm_a_rr_target_mode, tvb, curr_offset, 1, FALSE);
6112 proto_tree_add_item(tree, hf_gsm_a_rr_group_cipher_key_number, tvb, curr_offset, 1, FALSE);
6113 curr_offset = curr_offset + 1;
6114
6115 return(curr_offset - offset);
6116}
6117
6118/*
6119 * [3] 10.5.2.42b VGCS Ciphering Parameters
6120 */
6121static guint16
6122de_rr_vgcs_cip_par(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
6123{
6124 guint32 curr_offset;
6125
6126 curr_offset = offset;
6127
6128 proto_tree_add_text(tree,tvb, curr_offset, len ,"Data(Not decoded)");
6129
6130 curr_offset = curr_offset + 2;
6131
6132 return(curr_offset - offset);
6133}
6134/*
6135 * [3] 10.5.2.43 Wait Indication
6136 */
6137static guint16
6138de_rr_wait_ind(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
6139{
6140 guint32 curr_offset;
6141
6142 curr_offset = offset;
6143
6144 proto_tree_add_item(tree, hf_gsm_a_rr_wait_indication, tvb, curr_offset, 1, FALSE);
6145
6146 curr_offset = curr_offset + 1;
6147
6148 return(curr_offset - offset);
6149}
6150
6151/*
6152 * [3] 10.5.2.44 SI10 rest octets $(ASCI)$
6153 */
6154
6155/*
6156 * [3] 10.5.2.45 Extended Measurement Results
6157 */
6158static guint16
6159de_rr_ext_meas_result(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
6160{
6161 guint32 curr_offset;
6162 gint bit_offset, i;
6163 guint8 value;
6164
6165 curr_offset = offset;
6166 len = 16;
6167 bit_offset = curr_offset << 3;
6168
6169 proto_tree_add_bits_item(tree, hf_gsm_a_rr_seq_code, tvb,bit_offset, 1, FALSE);
6170 bit_offset += 1;
6171 proto_tree_add_bits_item(tree, hf_gsm_a_rr_dtx_used, tvb, bit_offset, 1, FALSE);
6172 bit_offset += 1;
6173 for (i=0; i<21; i++)
6174 {
6175 value = tvb_get_bits8(tvb,bit_offset,6);
6176 proto_tree_add_text(tree, tvb, bit_offset>>3, 1, "RXLEV carrier %d: %s (%d)",i,gsm_a_rr_rxlev_vals[value].strptr,value);
6177 bit_offset += 6;
6178 }
6179
6180 curr_offset = offset + len;
6181
6182 return(curr_offset - offset);
6183}
6184
6185/*
6186 * [3] 10.5.2.46 Extended Measurement Frequency List
6187 */
6188static guint16
6189de_rr_ext_meas_freq_list(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
6190{
6191 guint32 curr_offset;
6192
6193 curr_offset = offset;
6194
6195 proto_tree_add_bits_item(tree, hf_gsm_a_rr_seq_code, tvb,(curr_offset<<3)+3, 1, FALSE);
6196
6197 return dissect_arfcn_list(tvb, tree, offset, 16, add_string, string_len);
6198}
6199
6200/*
6201 * [3] 10.5.2.47 Suspension Cause
6202 */
6203/*Suspension cause value (octet 2)*/
6204static const value_string gsm_a_rr_suspension_cause_vals[] = {
6205 { 0, "Emergency call, mobile originating call or call re-establishment"},
6206 { 1, "Location Area Update"},
6207 { 2, "MO Short message service"},
6208 { 3, "Other procedure which can be completed with an SDCCH"},
6209 { 4, "MO Voice broadcast or group call"},
6210 { 5, "Mobile terminating CS connection"},
6211 { 6, "DTM not supported in the cell"},
6212 { 0, NULL }
6213};
6214guint16
6215de_rr_sus_cau(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
6216{
6217 guint32 curr_offset;
6218
6219 curr_offset = offset;
6220
6221 proto_tree_add_item(tree, hf_gsm_a_rr_suspension_cause, tvb, curr_offset, 1, FALSE);
6222
6223 curr_offset = curr_offset + 1;
6224
6225 return(curr_offset - offset);
6226}
6227/*
6228 * [3] 10.5.2.48 APDU ID
6229 * [3] 10.5.2.49 APDU Flags
6230 * [3] 10.5.2.50 APDU Data
6231 */
6232
6233/*
6234 * [3] 10.5.2.51 Handover To UTRAN Command
6235 */
6236static guint16
6237de_rr_ho_to_utran_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
6238{
6239 guint32 curr_offset;
6240 tvbuff_t *rrc_irat_ho_to_utran_cmd_tvb;
6241 static packet_info p_info;
6242
6243 curr_offset = offset;
6244 if (len)
6245 {
6246 rrc_irat_ho_to_utran_cmd_tvb = tvb_new_subset(tvb, curr_offset, len, len);
6247 if (rrc_irat_ho_to_utran_cmd_handle)
6248 call_dissector(rrc_irat_ho_to_utran_cmd_handle, rrc_irat_ho_to_utran_cmd_tvb, &p_info, tree);
6249 }
6250
6251 curr_offset += len;
6252 return(curr_offset - offset);
6253}
6254
6255
6256/*
6257 * [3] 10.5.2.52 Handover To cdma2000 Command
6258 * [3] 10.5.2.53 (void)
6259 * [3] 10.5.2.54 (void)
6260 * [3] 10.5.2.55 (void)
6261 * [3] 10.5.2.56 3G Target Cell
6262 */
6263/*
6264 * 10.5.2.57 Service Support
6265 */
6266static const true_false_string gsm_a_rr_MBMS_multicast_value = {
6267 "mobile station requires notification of multicast MBMS services",
6268 "mobile station does not require notification of multicast MBMS services"
6269};
6270static const true_false_string gsm_a_rr_MBMS_broadcast_value = {
6271 "mobile station requires notification of broadcast MBMS services",
6272 "mobile station does not require notification of broadcast MBMS services"
6273};
6274static guint16
6275de_rr_serv_sup(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
6276{
6277 guint32 curr_offset;
6278
6279 curr_offset = offset;
6280 /* bit 1
6281 * 0 mobile station does not require notification of broadcast MBMS services
6282 * 1 mobile station requires notification of broadcast MBMS services
6283 * bit 2
6284 * 0 mobile station does not require notification of multicast MBMS services
6285 * 1 mobile station requires notification of multicast MBMS services
6286 */
6287 /* MBMS Multicast */
6288 proto_tree_add_item(tree, hf_gsm_a_rr_MBMS_multicast, tvb, curr_offset, 1, FALSE);
6289
6290 /* MBMS Broadcast */
6291 proto_tree_add_item(tree, hf_gsm_a_rr_MBMS_broadcast, tvb, curr_offset, 1, FALSE);
6292 curr_offset++;
6293
6294 return(curr_offset - offset);
6295}
6296
6297/*
6298 * [3] 10.5.2.59 Dedicated Service Information
6299 */
6300/*
6301Last Segment (octet 2)
6302bit 1
6303 0 mobile station shall not perform Service Information Sending procedure on new cell.
6304 1 mobile station shall perform Service Information Sending procedure on new cell.
6305*/
6306static const true_false_string gsm_a_rr_last_segment_value = {
6307 "Mobile station shall perform Service Information Sending procedure on new cell.",
6308 "mobile station shall not perform Service Information Sending procedure on new cell."
6309};
6310static guint16
6311de_rr_ded_serv_inf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
6312{
6313 guint32 curr_offset;
6314
6315 curr_offset = offset;
6316
6317 proto_tree_add_item(tree, hf_gsm_a_rr_last_segment, tvb, curr_offset, 1, FALSE);
6318
6319 curr_offset = curr_offset + 3;
6320
6321 return(curr_offset - offset);
6322}
6323
6324/*
6325 * [3] 10.5.2.69 Carrier Indication
6326 */
6327static const true_false_string gsm_a_rr_carrier_ind_value = {
6328 "Carrier 2",
6329 "Carrier 1"
6330};
6331
6332static guint16
6333de_rr_carrier_ind(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
6334{
6335 proto_tree *subtree;
6336 proto_item *item;
6337 guint32 curr_offset;
6338
6339 curr_offset = offset;
6340
6341 item = proto_tree_add_text(tree, tvb, curr_offset, 3, "%s",
6342 gsm_rr_elem_strings[DE_RR_CARRIER_IND].strptr);
6343
6344 subtree = proto_item_add_subtree(item, ett_gsm_rr_elem[DE_RR_CARRIER_IND]);
6345
6346 proto_tree_add_item(tree, hf_gsm_a_rr_carrier_ind, tvb, curr_offset, 1, FALSE);
6347
6348 curr_offset += 1;
6349
6350 return(curr_offset - offset);
6351}
6352
6353guint16 (*rr_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
6354 /* Radio Resource Management Information Elements 10.5.2, most are from 10.5.1 */
6355
6356 de_rr_ba_range, /* [3] 10.5.2.1a BA Range */
6357 de_rr_cell_ch_dsc, /* [3] 10.5.2.1b Cell Channel Description */
6358 de_rr_ba_list_pref, /* [3] 10.5.2.1c BA List Pref */
6359 de_rr_utran_freq_list, /* [3] 10.5.2.1d UTRAN Frequency List */
6360 de_rr_cell_select_indic, /* [3] 10.5.2.1e Cell selection indicator after release of all TCH and SDCCH IE */
6361 de_rr_cell_dsc, /* 10.5.2.2 RR Cell Description */
6362 de_rr_cell_opt_bcch, /* [3] 10.5.2.3 Cell Options (BCCH) */
6363 de_rr_cell_opt_sacch, /* [3] 10.5.2.3a Cell Options (SACCH) */
6364 de_rr_cell_sel_param, /* [3] 10.5.2.4 Cell Selection Parameters */
6365/*
6366 * [3] 10.5.2.4a (void)
6367 */
6368 de_rr_ch_dsc, /* [3] 10.5.2.5 Channel Description */
6369 de_rr_ch_dsc2, /* [3] 10.5.2.5a RR Channel Description 2 */
6370 de_rr_ch_dsc3, /* [3] 10.5.2.5c RR Channel Description 3 */
6371 de_rr_ch_mode, /* [3] 10.5.2.6 Channel Mode */
6372 de_rr_ch_mode2, /* [3] 10.5.2.7 Channel Mode 2 */
6373 de_rr_utran_cm, /* [3] 10.5.2.7a UTRAN Classmark */
6374/* [3] 10.5.2.7b (void) */
6375
6376 de_rr_cm_enq_mask, /* [3] 10.5.2.7c Classmark Enquiry Mask */
6377/* [3] 10.5.2.7d GERAN Iu Mode Classmark information element */
6378 de_rr_chnl_needed, /* [3] 10.5.2.8 Channel Needed
6379 * [3] 10.5.2.8a (void)
6380 * [3] 10.5.2.8b Channel Request Description 2 */
6381 /* Pos 20 */
6382 de_rr_cip_mode_set, /* [3] 10.5.2.9 Cipher Mode Setting */
6383 de_rr_cip_mode_resp, /* [3] 10.5.2.10 Cipher Response */
6384 de_rr_ctrl_ch_desc, /* [3] 10.5.2.11 Control Channel Description */
6385/* [3] 10.5.2.11a DTM Information Details */
6386 de_rr_dyn_arfcn_map, /* [3] 10.5.2.11b Dynamic ARFCN Mapping */
6387 de_rr_freq_ch_seq, /* [3] 10.5.2.12 Frequency Channel Sequence */
6388 de_rr_freq_list, /* [3] 10.5.2.13 Frequency List */
6389 de_rr_freq_short_list, /* [3] 10.5.2.14 Frequency Short List */
6390 de_rr_freq_short_list2, /* [3] 10.5.2.14a Frequency Short List 2 */
6391/* [3] 10.5.2.14b Group Channel Description */
6392 de_rr_gprs_resumption, /* [3] 10.5.2.14c GPRS Resumption */
6393 de_rr_gprs_broadcast_info, /* [3] 10.5.2.14d GPRS broadcast information */
6394/* [3] 10.5.2.14e Enhanced DTM CS Release Indication */
6395 de_rr_ho_ref, /* 10.5.2.15 Handover Reference */
6396 de_rr_ia_rest_oct, /* [3] 10.5.2.16 IA Rest Octets */
6397 de_rr_iar_rest_oct, /* [3] 10.5.2.17 IAR Rest Octets */
6398 de_rr_iax_rest_oct, /* [3] 10.5.2.18 IAX Rest Octets */
6399 de_rr_l2_pseudo_len, /*[3] 10.5.2.19 L2 Pseudo Length */
6400 de_rr_meas_res, /* [3] 10.5.2.20 Measurement Results */
6401/*
6402 * [3] (void)
6403 */
6404 de_rr_mob_all, /* [3] 10.5.2.21 Mobile Allocation */
6405 de_rr_mob_time_diff, /* [3] 10.5.2.21a Mobile Time Difference */
6406 de_rr_multirate_conf, /* [3] 10.5.2.21aa MultiRate configuration */
6407 /* Pos 30 */
6408 de_rr_mult_all, /* [3] 10.5.2.21b Multislot Allocation */
6409/*
6410 * [3] 10.5.2.21c (void)
6411 */
6412 de_rr_neigh_cell_desc, /* [3] 10.5.2.22 Neighbour Cell Description */
6413 de_rr_neigh_cell_desc2, /* [3] 10.5.2.22a Neighbour Cell Description 2 */
6414/*
6415 * [3] 10.5.2.22b (void)
6416 * [3] 10.5.2.22c NT/N Rest Octets */
6417 de_rr_p1_rest_oct, /* [3] 10.5.2.23 P1 Rest Octets */
6418 de_rr_p2_rest_oct, /* [3] 10.5.2.24 P2 Rest Octets */
6419 de_rr_p3_rest_oct, /* [3] 10.5.2.25 P3 Rest Octets */
6420 de_rr_packet_ch_desc, /* [3] 10.5.2.25a Packet Channel Description */
6421 de_rr_ded_mod_or_tbf, /* [3] 10.5.2.25b Dedicated mode or TBF */
6422/* [3] 10.5.2.25c RR Packet Uplink Assignment
6423 * [3] 10.5.2.25d RR Packet Downlink Assignment
6424 */
6425 de_rr_page_mode, /* [3] 10.5.2.26 Page Mode */
6426/*
6427 * [3] 10.5.2.26a (void)
6428 * [3] 10.5.2.26b (void)
6429 * [3] 10.5.2.26c (void)
6430 * [3] 10.5.2.26d (void)
6431 */
6432 de_rr_ncc_perm, /* [3] 10.5.2.27 NCC Permitted */
6433 de_rr_pow_cmd, /* 10.5.2.28 Power Command */
6434 de_rr_pow_cmd_and_acc_type, /* 10.5.2.28a Power Command and access type */
6435 de_rr_rach_ctrl_param, /* [3] 10.5.2.29 RACH Control Parameters */
6436 de_rr_req_ref, /* [3] 10.5.2.30 Request Reference */
6437 de_rr_cause, /* 10.5.2.31 RR Cause */
6438 de_rr_sync_ind, /* 10.5.2.39 Synchronization Indication */
6439 de_rr_si1_rest_oct, /* [3] 10.5.2.32 SI1 Rest Octets */
6440/* [3] 10.5.2.33 SI 2bis Rest Octets */
6441 de_rr_si2ter_rest_oct, /* [3] 10.5.2.33a SI 2ter Rest Octets */
6442 de_rr_si2quater_rest_oct, /* [3] 10.5.2.33b SI 2quater Rest Octets */
6443 de_rr_si3_rest_oct, /* [3] 10.5.2.34 SI3 Rest Octets */
6444 de_rr_si4_rest_oct, /* [3] 10.5.2.35 SI4 Rest Octets */
6445 de_rr_si6_rest_oct, /* [3] 10.5.2.35b SI6 Rest Octets */
6446/* [3] 10.5.2.36 SI 7 Rest Octets
6447 * [3] 10.5.2.37 SI 8 Rest Octets
6448 * [3] 10.5.2.37a SI 9 Rest Octets
6449 */
6450 de_rr_si13_rest_oct, /* [3] 10.5.2.37a SI13 Rest Octets */
6451/* [3] 10.5.2.37c (void)
6452 * [3] 10.5.2.37d (void)
6453 * [3] 10.5.2.37e SI 16 Rest Octets
6454 * [3] 10.5.2.37f SI 17 Rest Octets
6455 * [3] 10.5.2.37g SI 19 Rest Octets
6456 * [3] 10.5.2.37h SI 18 Rest Octets
6457 * [3] 10.5.2.37i SI 20 Rest Octets */
6458 de_rr_starting_time, /* [3] 10.5.2.38 Starting Time */
6459 de_rr_timing_adv, /* [3] 10.5.2.40 Timing Advance */
6460 de_rr_time_diff, /* [3] 10.5.2.41 Time Difference */
6461 de_rr_tlli, /* [3] 10.5.2.41a TLLI */
6462 de_rr_tmsi_ptmsi, /* [3] 10.5.2.42 TMSI/P-TMSI */
6463 de_rr_vgcs_tar_mode_ind, /* [3] 10.5.2.42a VGCS target mode Indication */
6464 /* Pos 40 */
6465 de_rr_vgcs_cip_par, /* [3] 10.5.2.42b VGCS Ciphering Parameters */
6466 de_rr_wait_ind, /* [3] 10.5.2.43 Wait Indication */
6467/* [3] 10.5.2.44 SI10 rest octets $(ASCI)$ */
6468 de_rr_ext_meas_result, /* [3] 10.5.2.45 Extended Measurement Results */
6469 de_rr_ext_meas_freq_list, /* [3] 10.5.2.46 Extended Measurement Frequency List */
6470 de_rr_sus_cau, /* [3] 10.5.2.47 Suspension Cause */
6471/* [3] 10.5.2.48 APDU ID
6472 * [3] 10.5.2.49 APDU Flags
6473 * [3] 10.5.2.50 APDU Data */
6474 de_rr_ho_to_utran_cmd, /* [3] 10.5.2.51 Handover To UTRAN Command */
6475/* [3] 10.5.2.52 Handover To cdma2000 Command
6476 * [3] 10.5.2.53 (void)
6477 * [3] 10.5.2.54 (void)
6478 * [3] 10.5.2.55 (void)
6479 * [3] 10.5.2.56 3G Target Cell
6480 * 10.5.2.57 Service Support */
6481 de_rr_serv_sup, /* 10.5.2.57 Service Support */
6482/*
6483 * 10.5.2.58 MBMS p-t-m Channel Description
6484 */
6485 de_rr_ded_serv_inf, /* [3] 10.5.2.59 Dedicated Service Information */
6486/*
6487 * 10.5.2.60 MPRACH Description
6488 * 10.5.2.61 Restriction Timer
6489 * 10.5.2.62 MBMS Session Identity
6490 * 10.5.2.63 Reduced group or broadcast call reference
6491 * 10.5.2.64 Talker Priority status
6492 * 10.5.2.65 Talker Identity
6493 * 10.5.2.66 Token
6494 * 10.5.2.67 PS Cause
6495 * 10.5.2.68 VGCS AMR Configuration
6496 */
6497 de_rr_carrier_ind, /* 10.5.2.69 Carrier Indication */
6498 NULL, /* NONE */
6499};
6500
6501/* MESSAGE FUNCTIONS */
6502
6503/*
6504 * 9.1.1 Additional Assignment
6505 */
6506static void
6507dtap_rr_add_ass(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6508{
6509 guint32 curr_offset;
6510 guint32 consumed;
6511 guint curr_len;
6512
6513 curr_offset = offset;
6514 curr_len = len;
6515
6516 /* Channel Description 10.5.2.5 M V 3 */
6517 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC);
6518
6519 /* Mobile Allocation 10.5.2.21 C TLV 3-10 */
6520 ELEM_OPT_TLV(0x72, GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, NULL);
6521
6522 /* Starting Time 10.5.2.38 O TV 3 */
6523 ELEM_OPT_TV(0x7c, GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, NULL);
6524
6525 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6526}
6527
6528/*
6529 * 9.1.2 Assignment command
6530 */
6531static void
6532dtap_rr_ass_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6533{
6534 guint32 curr_offset;
6535 guint32 consumed;
6536 guint curr_len;
6537
6538 curr_offset = offset;
6539 curr_len = len;
6540
6541 /* Channel Description 2 10.5.2.5a M V 3 */
6542 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC2);
6543
6544 /* Power Command 10.5.2.28 M V 1 */
6545 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_POW_CMD);
6546
6547 /* 05 Frequency List 10.5.2.13 C TLV 4-132 */
6548 ELEM_OPT_TLV(0x05, GSM_A_PDU_TYPE_RR, DE_RR_FREQ_LIST, " - Frequency List, after time");
6549
6550 /* 62 Cell Channel Description 10.5.2.1b O TV 17 */
6551 ELEM_OPT_TV(0x62, GSM_A_PDU_TYPE_RR, DE_RR_CELL_CH_DSC, NULL);
6552
6553 /* 10 Multislot Allocation 10.5.2.21b C TLV 3-12 */
6554 ELEM_OPT_TLV(0x10,GSM_A_PDU_TYPE_RR, DE_RR_MULT_ALL, " - Description of the multislot configuration");
6555
6556 /* 63 Channel Mode 10.5.2.6 O TV 2 */
6557 ELEM_OPT_TV(0x63,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of the First Channel(Channel Set 1)");
6558
6559 /* 11 Channel Mode 10.5.2.6 O TV 2 */
6560 ELEM_OPT_TV(0x11,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 2");
6561
6562 /* 13 Channel Mode 10.5.2.6 O TV 2 */
6563 ELEM_OPT_TV(0x13,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 3");
6564
6565 /* 14 Channel Mode 10.5.2.6 O TV 2 */
6566 ELEM_OPT_TV(0x14,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 4");
6567
6568 /* 15 Channel Mode 10.5.2.6 O TV 2 */
6569 ELEM_OPT_TV(0x15,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 5");
6570
6571 /* 16 Channel Mode 10.5.2.6 O TV 2 */
6572 ELEM_OPT_TV(0x16,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 6");
6573
6574 /* 17 Channel Mode 10.5.2.6 O TV 2 */
6575 ELEM_OPT_TV(0x17,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 7");
6576
6577 /* 18 Channel Mode 10.5.2.6 O TV 2 */
6578 ELEM_OPT_TV(0x18,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 8");
6579
6580 /* 64 Channel Description 10.5.2.5 O TV 4 */
6581 ELEM_OPT_TV(0x64,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, "Description of the Second Channel, after time");
6582
6583 /* 66 Channel Mode 2 10.5.2.7 O TV 2 */
6584 ELEM_OPT_TV(0x66,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE2, " - Mode of the Second Channel");
6585
6586 /* 72 Mobile Allocation 10.5.2.21 C TLV 3-10 */
6587 ELEM_OPT_TLV(0x72,GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, " - Mobile Allocation, after time");
6588
6589 /* 7C Starting Time 10.5.2.38 O TV 3 */
6590 ELEM_OPT_TV(0x7C,GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, NULL);
6591
6592 /* 19 Frequency List 10.5.2.13 C TLV 4-132 */
6593 ELEM_OPT_TLV(0x19, GSM_A_PDU_TYPE_RR, DE_RR_FREQ_LIST, " - Frequency List, before time");
6594
6595 /* 1C Channel Description 2 10.5.2.5a O TV 4 */
6596 ELEM_OPT_TV(0x1c,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC2, " - Description of the First Channel, before time");
6597
6598 /* 1D Channel Description 10.5.2.5 O TV 4 */
6599 ELEM_OPT_TV(0x1d,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, " - Description of the Second Channel, before time");
6600
6601 /* 1E Frequency channel sequence 10.5.2.12 C TV 10 */
6602 ELEM_OPT_TV(0x1e,GSM_A_PDU_TYPE_RR, DE_RR_FREQ_CH_SEQ, " - Frequency channel sequence before time");
6603
6604 /* 21 Mobile Allocation 10.5.2.21 C TLV 3-10 */
6605 ELEM_OPT_TLV(0x21,GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, " - Mobile Allocation, before time");
6606
6607 /* 9- Cipher Mode Setting 10.5.2.9 O TV 1 */
6608 ELEM_OPT_TV_SHORT(0x90,GSM_A_PDU_TYPE_RR, DE_RR_CIP_MODE_SET, NULL);
6609 /* 01 VGCS target mode Indication VGCS target mode Indication 10.5.2.42a O TLV 3 */
6610 ELEM_OPT_TLV(0x01,GSM_A_PDU_TYPE_RR, DE_RR_VGCS_TAR_MODE_IND, NULL);
6611
6612 /* 03 Multi-Rate configuration, MultiRate configuration 10.5.2.21aa O TLV 4-8 */
6613 ELEM_OPT_TLV(0x03,GSM_A_PDU_TYPE_RR, DE_RR_MULTIRATE_CONF, NULL);
6614
6615 /* 04 VGCS Ciphering Parameters VGCS Ciphering Parameters 10.5.2.42b O TLV 3-15 */
6616 ELEM_OPT_TLV(0x04,GSM_A_PDU_TYPE_RR, DE_RR_VGCS_CIP_PAR, NULL);
6617
6618 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6619
6620}
6621
6622/*
6623 * 9.1.3 Assignment complete
6624 */
6625static void
6626dtap_rr_ass_comp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6627{
6628 guint32 curr_offset;
6629 guint32 consumed;
6630 guint curr_len;
6631
6632 curr_offset = offset;
6633 curr_len = len;
6634
6635 /* RR Cause RR Cause 10.5.2.31 M V 1 */
6636 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE);
6637
6638 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6639
6640}
6641
6642/*
6643 * 9.1.4 Assignment failure
6644 */
6645static void
6646dtap_rr_ass_fail(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6647{
6648 guint32 curr_offset;
6649 guint32 consumed;
6650 guint curr_len;
6651
6652 curr_offset = offset;
6653 curr_len = len;
6654
6655 /* RR Cause RR Cause 10.5.2.31 M V 1 */
6656 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE);
6657
6658 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6659
6660}
6661
6662/*
6663 * 9.1.5 Channel Mode Modify
6664 */
6665static void
6666dtap_rr_ch_mode_mod(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6667{
6668 guint32 curr_offset;
6669 guint32 consumed;
6670 guint curr_len;
6671
6672 curr_offset = offset;
6673 curr_len = len;
6674
6675 /* Channel Description 2 10.5.2.5a M V 3 */
6676 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC2);
6677
6678 /* Channel Mode 10.5.2.6 M V 1 */
6679 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE);
6680
6681 /* 01 VGCS target mode Indication VGCS target mode Indication 10.5.2.42a O TLV 3 */
6682 ELEM_OPT_TLV(0x01,GSM_A_PDU_TYPE_RR, DE_RR_VGCS_TAR_MODE_IND, NULL);
6683
6684 /* 03 Multi-Rate configuration, MultiRate configuration 10.5.2.21aa O TLV 4-8 */
6685 ELEM_OPT_TLV(0x03,GSM_A_PDU_TYPE_RR, DE_RR_MULTIRATE_CONF, NULL);
6686
6687 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6688
6689}
6690
6691/*
6692 * 9.1.6 Channel Mode Modify Acknowledge
6693 */
6694static void
6695dtap_rr_ch_mode_mod_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6696{
6697 guint32 curr_offset;
6698 guint32 consumed;
6699 guint curr_len;
6700
6701 curr_offset = offset;
6702 curr_len = len;
6703
6704 /* Channel Description 2 10.5.2.5a M V 3 */
6705 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC2);
6706
6707 /* Channel Mode 10.5.2.6 M V 1 */
6708 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE);
6709
6710 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6711
6712}
6713
6714/*
6715 * 9.1.7 Channel Release
6716 */
6717static void
6718dtap_rr_ch_rel(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6719{
6720 guint32 curr_offset;
6721 guint32 consumed;
6722 guint curr_len;
6723
6724 curr_offset = offset;
6725 curr_len = len;
6726
6727 /* RR Cause RR Cause 10.5.2.31 M V 1 */
6728 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE);
6729
6730 /* 73 BA Range BA Range 10.5.2.1a O TLV 6-7 */
6731 ELEM_OPT_TLV(0x73, GSM_A_PDU_TYPE_RR, DE_RR_BA_RANGE, NULL);
6732
6733 /* 74 Group Channel Description Group Channel Description 10.5.2.14b O TLV 5-13 */
6734 /* ELEM_OPT_TLV(0x74, GSM_A_PDU_TYPE_RR, DE_GRP_CH_DESC, NULL); */
6735
6736 /* 8x Group Cipher Key Number Group Cipher Key Number 10.5.1.10 C TV 1 */
6737 /* ELEM_OPT_TV_SHORT(0x80, GSM_A_PDU_TYPE_RR, DE_GRP_CIP_KEY_NUM, NULL); */
6738
6739 /* Cx GPRS Resumption GPRS Resumption 10.5.2.14c O TV 1 */
6740 ELEM_OPT_TV_SHORT(0xC0, GSM_A_PDU_TYPE_RR, DE_RR_GPRS_RESUMPTION, NULL);
6741
6742 /* 75 BA List Pref BA List Pref 10.5.2.1c O TLV 3-? */
6743 ELEM_OPT_TLV(0x75, GSM_A_PDU_TYPE_RR, DE_RR_BA_LIST_PREF, NULL);
6744
6745 /* 76 UTRAN Freq List 10.5.2.1d O TLV 3-? */
6746 ELEM_OPT_TLV(0x76, GSM_A_PDU_TYPE_RR, DE_RR_UTRAN_FREQ_LIST, NULL);
6747
6748 /* 62 Cell Channel Description Cell Channel Description 10.5.2.1b O TV 17 */
6749 ELEM_OPT_TV(0x62, GSM_A_PDU_TYPE_RR, DE_RR_CELL_CH_DSC, NULL);
6750
6751 /* 62 Cell selection indicator after release of all TCH and SDCCH 10.5.2.1e O TLV 4-? */
6752 ELEM_OPT_TLV(0x77, GSM_A_PDU_TYPE_RR, DE_RR_CELL_SELECT_INDIC, NULL);
6753
6754 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6755
6756}
6757
6758/*
6759 * 9.1.8 Channel Request
6760 */
6761/* This message is NOT follow the basic format, and is only found on RACH - ignored here */
6762
6763/*
6764 * 9.1.9 Ciphering Mode Command
6765 */
6766static void
6767dtap_rr_cip_mode_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6768{
6769 guint32 curr_offset;
6770 guint32 consumed;
6771 guint curr_len;
6772
6773 curr_offset = offset;
6774 curr_len = len;
6775 lower_nibble = FALSE;
6776
6777 /* Ciphering Mode Setting 10.5.2.9 M V 0.5 */
6778 ELEM_MAND_V_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_CIP_MODE_SET);
6779 /* Cipher Response 10.5.2.10 M V 0.5 */
6780 ELEM_MAND_V_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_CIP_MODE_RESP);
6781
6782 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6783
6784}
6785/*
6786 * 9.1.10 Ciphering Mode Complete
6787 */
6788static void
6789dtap_rr_cip_mode_cpte(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6790{
6791 guint32 curr_offset;
6792 guint32 consumed;
6793 guint curr_len;
6794
6795 curr_offset = offset;
6796 curr_len = len;
6797 lower_nibble = FALSE;
6798
6799 /* Mobile Equipment Identity 10.5.1.4 O TLV */
6800 ELEM_OPT_TLV(0x17, GSM_A_PDU_TYPE_COMMON, DE_MID, "Mobile Equipment Identity");
6801
6802 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6803
6804}
6805
6806/*
6807 * 9.1.11 Classmark change
6808 */
6809static void
6810dtap_rr_mm_cm_change(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6811{
6812 guint32 curr_offset;
6813 guint32 consumed;
6814 guint curr_len;
6815
6816 curr_offset = offset;
6817 curr_len = len;
6818
6819 /* Mobile Station Classmark 2 10.5.1.6 M LV 4 */
6820 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, NULL);
6821 /* 20 Mobile Station Classmark 3 10.5.1.7 C TLV 3-34 */
6822 ELEM_OPT_TLV(0x20, GSM_A_PDU_TYPE_COMMON, DE_MS_CM_3, NULL);
6823
6824 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6825
6826}
6827
6828/*
6829 * 9.1.11 UTRAN Classmark Change
6830 */
6831static void
6832dtap_rr_utran_classmark_change(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6833{
6834 guint32 curr_offset;
6835 guint32 consumed;
6836 guint curr_len;
6837
6838 curr_offset = offset;
6839 curr_len = len;
6840
6841 /* UTRAN Classmark 10.5.2.7a M LV 2-? */
6842 ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_UTRAN_CM, NULL);
6843
6844 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6845}
6846
6847/*
6848 * 9.1.12 Classmark enquiry
6849 */
6850static void
6851dtap_rr_cm_enq(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6852{
6853 guint32 curr_offset;
6854 guint32 consumed;
6855 guint curr_len;
6856
6857 curr_offset = offset;
6858 curr_len = len;
6859
6860 /* 10 Classmark Enquiry Mask 10.5.2.7c O TLV 3 */
6861 ELEM_OPT_TLV(0x10, GSM_A_PDU_TYPE_RR, DE_RR_CM_ENQ_MASK, NULL);
6862
6863 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6864
6865}
6866
6867/*
6868 * 9.1.12b Configuration change command
6869 */
6870static void
6871dtap_rr_conf_change_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6872{
6873 guint32 curr_offset;
6874 guint32 consumed;
6875 guint curr_len;
6876
6877 curr_offset = offset;
6878 curr_len = len;
6879
6880 /* Multislot Allocation 10.5.2.21b M LV 2-11 */
6881 ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_MULT_ALL, NULL);
6882
6883 /* Channel Mode 10.5.2.6 O TV 2 */
6884 ELEM_OPT_TV(0x63,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 1");
6885
6886 /* Channel Mode 10.5.2.6 O TV 2 */
6887 ELEM_OPT_TV(0x11,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 2");
6888
6889 /* Channel Mode 10.5.2.6 O TV 2 */
6890 ELEM_OPT_TV(0x13,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 3");
6891
6892 /* Channel Mode 10.5.2.6 O TV 2 */
6893 ELEM_OPT_TV(0x14,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 4");
6894
6895 /* Channel Mode 10.5.2.6 O TV 2 */
6896 ELEM_OPT_TV(0x15,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 5");
6897
6898 /* Channel Mode 10.5.2.6 O TV 2 */
6899 ELEM_OPT_TV(0x16,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 6");
6900
6901 /* Channel Mode 10.5.2.6 O TV 2 */
6902 ELEM_OPT_TV(0x17,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 7");
6903
6904 /* Channel Mode 10.5.2.6 O TV 2 */
6905 ELEM_OPT_TV(0x18,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 8");
6906
6907 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
6908}
6909
6910/*
6911 * 9.1.12c Configuration change acknowledge
6912 */
6913/* empty message */
6914
6915/*
6916 * 9.1.12d Configuration change reject
6917 */
6918static void
6919dtap_rr_conf_change_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6920{
6921 guint32 curr_offset;
6922 guint32 consumed;
6923 guint curr_len;
6924
6925 curr_offset = offset;
6926 curr_len = len;
6927
6928 /* RR Cause 10.5.2.31 M V 1 */
6929 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE);
6930
6931 EXTRANEOUS_DATA_CHECK(curr_len, 0);
6932}
6933
6934
6935/*
6936 * 9.1.13 Frequency Redefinition
6937 */
6938static void
6939dtap_rr_freq_redef(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6940{
6941 guint32 curr_offset;
6942 guint32 consumed;
6943 guint curr_len;
6944
6945 curr_offset = offset;
6946 curr_len = len;
6947
6948 /* Channel Description 10.5.2.5 M V 3 */
6949 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC);
6950
6951 /* Mobile Allocation 10.5.2.21 M LV 1-9 */
6952 ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, NULL);
6953
6954 /* Starting Time 10.5.2.38 M V 2 */
6955 ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, NULL);
6956
6957 /* Cell Channel Description 10.5.2.1b O TV 17 */
6958 ELEM_OPT_TV(0x62,GSM_A_PDU_TYPE_RR, DE_RR_CELL_CH_DSC, NULL);
6959
6960 /* Carrier Indication 10.5.2.69 O TV 1 */
6961 ELEM_OPT_TV_SHORT(0x90,GSM_A_PDU_TYPE_RR, DE_RR_CARRIER_IND,NULL);
6962
6963 /* Mobile Allocation 10.5.2.21 O TLV 1-9 */
6964 ELEM_OPT_TLV(0x11, GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, " - Mobile Allocation C2");
6965
6966 /* Channel Description 3 10.5.2.5c O TV 3 */
6967 ELEM_OPT_TV(0x12,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC3, " - Channel Description C2");
6968
6969 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
6970}
6971
6972/*
6973 * 9.1.13b GPRS suspension request
6974 */
6975static void
6976dtap_rr_gprs_sus_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
6977{
6978 guint32 curr_offset;
6979 guint32 consumed;
6980 guint curr_len;
6981 curr_offset = offset;
6982 curr_len = len;
6983
6984 /* TLLI 10.5.2.41a M V 4 */
6985 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TLLI);
6986
6987 /* Routeing Area Identification 10.5.5.15 M V 6 */
6988 ELEM_MAND_V(GSM_A_PDU_TYPE_GM, DE_RAI);
6989 /* Suspension cause 10.5.2.47 M V 1 */
6990 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SUS_CAU);
6991
6992 /* 01 Service Support 10.5.2.57 O TV 2 */
6993 ELEM_OPT_TV_SHORT(0x01,GSM_A_PDU_TYPE_RR, DE_RR_SERV_SUP,NULL);
6994
6995 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
6996
6997}
6998
6999static void
7000dtap_rr_app_inf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7001{
7002 tvbuff_t *sub_tvb;
7003 guint8 apdu_len;
7004
7005 apdu_len = tvb_get_guint8(tvb, 2);
7006
7007 sub_tvb = tvb_new_subset(tvb, 3, len, apdu_len);
7008 call_dissector(rrlp_dissector, sub_tvb, rr_apdu_info, pinfo, tree);
7009}
7010
7011/*
7012 * 9.1.14 Handover Access
7013 */
7014/* This message does NOT follow the basic format, and is only found on DCH during initial handover access */
7015
7016/* 3GPP TS 24.008 version 4.7.0 Release 4
7017 * [3] 9.1.15
7018 */
7019void
7020dtap_rr_ho_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7021{
7022 guint32 curr_offset;
7023 guint32 consumed;
7024 guint curr_len;
7025 curr_offset = offset;
7026 curr_len = len;
7027
7028 /* Mandatory Elemets
7029 * Cell description 10.5.2.2
7030 */
7031 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CELL_DSC);
7032
7033 /* Description of the first channel,after time
7034 * Channel Description 2 10.5.2.5a
7035 */
7036 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC2);
7037
7038 /* Handover Reference 10.5.2.15 */
7039 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_HO_REF);
7040
7041 /* Power Command and Access type 10.5.2.28a */
7042 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_POW_CMD_AND_ACC_TYPE);
7043
7044 /* optional elements */
7045
7046 /* Synchronization Indication 10.5.2.39 */
7047 ELEM_OPT_TV_SHORT(0xD0,GSM_A_PDU_TYPE_RR, DE_RR_SYNC_IND,NULL);
7048
7049 /* Frequency Short List 10.5.2.14 */
7050 ELEM_OPT_TV(0x02,GSM_A_PDU_TYPE_RR, DE_RR_FREQ_SHORT_LIST," - Frequency Short List, after time");
7051
7052 /* Frequency List 10.5.2.13 */
7053 ELEM_OPT_TLV(0x05, GSM_A_PDU_TYPE_RR, DE_RR_FREQ_LIST, " - Frequency List, after time");
7054
7055 /* Cell Channel Description 10.5.2.1b */
7056 ELEM_OPT_TV(0x62,GSM_A_PDU_TYPE_RR, DE_RR_CELL_CH_DSC, NULL);
7057
7058 /* Multislot Allocation 10.5.2.21b */
7059 ELEM_OPT_TLV(0x10,GSM_A_PDU_TYPE_RR, DE_RR_MULT_ALL, NULL);
7060
7061 /* Mode of the First Channel(Channel Set 1)) Channel Mode 10.5.2.6*/
7062 ELEM_OPT_TV(0x63,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of the First Channel(Channel Set 1))");
7063
7064 /* Mode of Channel Set 2 Channel Mode 10.5.2.6*/
7065 ELEM_OPT_TV(0x11,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 2");
7066
7067 /* Mode of Channel Set 3 Channel Mode 10.5.2.6*/
7068 ELEM_OPT_TV(0x13,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 3");
7069
7070 /* Mode of Channel Set 4 Channel Mode 10.5.2.6*/
7071 ELEM_OPT_TV(0x14,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 4");
7072
7073 /* Mode of Channel Set 5 Channel Mode 10.5.2.6*/
7074 ELEM_OPT_TV(0x15,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 5");
7075
7076 /* Mode of Channel Set 6 Channel Mode 10.5.2.6*/
7077 ELEM_OPT_TV(0x16,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 6");
7078
7079 /* Mode of Channel Set 7 Channel Mode 10.5.2.6*/
7080 ELEM_OPT_TV(0x17,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 7");
7081
7082 /* Mode of Channel Set 8 Channel Mode 10.5.2.6*/
7083 ELEM_OPT_TV(0x18,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, " - Mode of Channel Set 8");
7084
7085 /* Description of the Second Channel, after time, Channel Description 10.5.2.5 */
7086 ELEM_OPT_TV(0x64,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, " - Description of the Second Channel, after time");
7087
7088 /* Mode of the Second Channel, Channel Mode 2 10.5.2.7 */
7089 ELEM_OPT_TV(0x66,GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE2, " - Mode of the Second Channel");
7090
7091 /* Frequency Channel Sequence, after time, Frequency Channel Sequence 10.5.2.12 */
7092 ELEM_OPT_TV(0x69,GSM_A_PDU_TYPE_RR, DE_RR_FREQ_CH_SEQ, " - Frequency Channel Sequence, after time");
7093
7094 /* Mobile Allocation, after time, Mobile Allocation 10.5.2.21 */
7095 ELEM_OPT_TLV(0x72,GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, " - Mobile Allocation, after time");
7096
7097 /* Starting Time 10.5.2.38 */
7098 ELEM_OPT_TV(0x7C,GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, NULL);
7099
7100 /* Real Time Difference, Time Difference 10.5.2.41 */
7101 ELEM_OPT_TV(0x7B,GSM_A_PDU_TYPE_RR, DE_RR_TIME_DIFF, " - Real Time Difference");
7102
7103 /* Timing Advance, Timing Advance 10.5.2.40 */
7104 ELEM_OPT_TV(0x7D,GSM_A_PDU_TYPE_RR, DE_RR_TIMING_ADV, NULL);
7105
7106 /* Frequency Short List, before time, Frequency Short List 10.5.2.14 */
7107 ELEM_OPT_TV(0x12,GSM_A_PDU_TYPE_RR, DE_RR_FREQ_SHORT_LIST, " - Frequency Short List, before time");
7108
7109 /* Frequency List, before time, Frequency List 10.5.2.13 */
7110 ELEM_OPT_TLV(0x19,GSM_A_PDU_TYPE_RR, DE_RR_FREQ_LIST, " - Frequency List, before time");
7111
7112 /* Description of the First Channel, before time, Channel Description 2 10.5.2.5a*/
7113 ELEM_OPT_TV(0x1c,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC2, " - Description of the First Channel, before time");
7114
7115 /* Description of the Second Channel, before time, Channel Description 10.5.2.5*/
7116 ELEM_OPT_TV(0x1d,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, " - Description of the Second Channel, before time");
7117
7118 /* Frequency channel sequence before time, Frequency channel sequence 10.5.2.12*/
7119 ELEM_OPT_TV(0x1e,GSM_A_PDU_TYPE_RR, DE_RR_FREQ_CH_SEQ, " - Frequency channel sequence before time");
7120
7121 /* Mobile Allocation, before time, Mobile Allocation 10.5.2.21 */
7122 ELEM_OPT_TLV(0x21,GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, " - Mobile Allocation, before time");
7123
7124 /* Cipher Mode Setting, Cipher Mode Setting 10.5.2.9 */
7125 ELEM_OPT_TV_SHORT(0x90,GSM_A_PDU_TYPE_RR, DE_RR_CIP_MODE_SET, NULL);
7126
7127 /* VGCS target mode Indication, VGCS target mode Indication 10.5.2.42a */
7128 ELEM_OPT_TLV(0x01,GSM_A_PDU_TYPE_RR, DE_RR_VGCS_TAR_MODE_IND, NULL);
7129
7130 /* Multi-Rate configuration, MultiRate configuration 10.5.2.21a */
7131 ELEM_OPT_TLV(0x03,GSM_A_PDU_TYPE_RR, DE_RR_MULTIRATE_CONF, NULL);
7132
7133 /* Dynamic ARFCN Mapping, Dynamic ARFCN Mapping 10.5.2.11b */
7134 ELEM_OPT_TLV(0x76,GSM_A_PDU_TYPE_RR, DE_RR_DYN_ARFCN_MAP, NULL);
7135
7136 /* VGCS Ciphering Parameters, VGCS Ciphering Parameters 10.5.2.42b */
7137 ELEM_OPT_TLV(0x04,GSM_A_PDU_TYPE_RR, DE_RR_VGCS_CIP_PAR, NULL);
7138
7139 /* Dedicated Service Information, Dedicated Service Information 10.5.2.59 */
7140 ELEM_OPT_TV(0x51,GSM_A_PDU_TYPE_RR, DE_RR_DED_SERV_INF, NULL);
7141
7142 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
7143
7144}
7145
7146/*
7147 * 9.1.15a Inter System To UTRAN Handover Command
7148 */
7149static void
7150dtap_rr_inter_syst_to_utran_ho_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7151{
7152 guint32 curr_offset;
7153 guint32 consumed;
7154 guint curr_len;
7155
7156 curr_offset = offset;
7157 curr_len = len;
7158
7159 /* UTRAN Classmark 10.5.2.51 M LV 2-? */
7160 ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_HO_TO_UTRAN_CMD, NULL);
7161
7162 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7163}
7164
7165/* 3GPP TS 24.008 version 4.7.0 Release 4
7166 * [3] 9.1.16
7167 */
7168static void
7169dtap_rr_ho_cpte(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7170{
7171 guint32 curr_offset;
7172 guint32 consumed;
7173 guint curr_len;
7174 curr_offset = offset;
7175 curr_len = len;
7176
7177 /* RR Cause RR Cause 10.5.2.31 M V 1 */
7178 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE);
7179
7180 /* 77 Mobile Observed Time Difference Mobile Time Difference 10.5.2.21a */
7181 ELEM_OPT_TLV(0x77,GSM_A_PDU_TYPE_RR, DE_RR_MOB_TIME_DIFF, " - Mobile Observed Time Difference");
7182
7183 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
7184
7185}
7186
7187/*
7188 * 9.1.17 Handover failure
7189 */
7190static void
7191dtap_rr_ho_fail(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7192{
7193 guint32 curr_offset;
7194 guint32 consumed;
7195 guint curr_len;
7196
7197 curr_offset = offset;
7198 curr_len = len;
7199
7200 /* RR Cause RR Cause 10.5.2.31 M V 1 */
7201 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE);
7202
7203 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7204
7205}
7206
7207/*
7208 * 9.1.18 Immediate assignment
7209 */
7210static void
7211dtap_rr_imm_ass(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7212{
7213 guint32 curr_offset;
7214 guint32 consumed;
7215 guint curr_len;
7216 guint8 oct;
7217 curr_offset = offset;
7218 curr_len = len;
7219
7220 oct = tvb_get_guint8(tvb, curr_offset);
7221
7222 /* NOTE: The order of the mandatory information elements should be chosen so that
7223 * information elements with 1/2 octet of content (type 1) go together in succession.
7224 * The first type 1 information element occupies bits 1 to 4 of octet N,
7225 * the second bits 5 to 8 of octet N, the third bits 1 to 4 of octet N+1 etc.
7226 * If the number of type 1 information elements is odd then bits 5 to 8 of the last octet
7227 * occupied by these information elements should be treated as spare bits,
7228 * i.e. coded with a "0" in each.
7229 */
7230
7231 /* Page Mode 10.5.2.26 M V 1/2 */
7232 ELEM_MAND_V_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_PAGE_MODE);
7233
7234 /* Dedicated mode or TBF 10.5.2.25b M V 1/2 */
7235 ELEM_MAND_V_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_DED_MOD_OR_TBF);
7236
7237 if((oct&0x10) == 0){
7238 /* Channel Description 10.5.2.5 C V 3m */
7239 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC);
7240 }else{
7241 /* Packet Channel Description 10.5.2.25a C V 3
7242 * If the Dedicated mode or TBF IE indicates that the message assigns a Temporary Block Flow (TBF),
7243 * the mobile station shall consider this information element present in the message.
7244 * If the Dedicated mode or TBF IE indicates that this message is the first of two in a two-message
7245 * assignment of an uplink or downlink TBF, the mobile station shall ignore the contents
7246 * of this information element and regard it as an unnecessary IE.
7247 */
7248 if((oct&0x04) == 0){
7249 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_PACKET_CH_DESC);
7250 }
7251 }
7252 /* Request Reference 10.5.2.30 M V 3 */
7253 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF);
7254
7255 /* Timing Advance 10.5.2.40 M V 1 */
7256 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TIMING_ADV);
7257 /* Mobile Allocation 10.5.2.21 M LV 1-9 */
7258 ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, NULL);
7259 /* 7C Starting Time 10.5.2.38 O TV 3 */
7260 ELEM_OPT_TV(0x7C,GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, NULL);
7261 /* IA Rest Octets 10.5.2.16 M V 0-11 */
7262 if(tvb_length_remaining(tvb,curr_offset) > 0)
7263 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_IA_REST_OCT);
7264
7265}
7266
7267/*
7268 * 9.1.19 Immediate assignment extended
7269 */
7270static void
7271dtap_rr_imm_ass_ext(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7272{
7273 guint32 curr_offset;
7274 guint32 consumed;
7275 guint curr_len;
7276 guint8 oct;
7277 curr_offset = offset;
7278 curr_len = len;
7279
7280 oct = tvb_get_guint8(tvb, curr_offset);
7281
7282 /* Page Mode 10.5.2.26 M V 1/2 */
7283 ELEM_MAND_V_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_PAGE_MODE);
7284 /* Spare Half Octet 10.5.1.8 M V 1/2 */
7285 ELEM_MAND_V_SHORT(GSM_A_PDU_TYPE_COMMON, DE_SPARE_NIBBLE);
7286 /* Channel Description 1 Channel Description 10.5.2.5 M V 3 */
7287 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC);
7288 /* Request Reference 1 Request Reference 10.5.2.30 M V 3 */
7289 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF);
7290 /* Timing Advance 1 Timing Advance 10.5.2.40 M V 1 */
7291 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TIMING_ADV);
7292 /* Channel Description 2 Channel Description 10.5.2.5 M V 3 */
7293 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC);
7294 /* Request Reference 2 Request Reference 10.5.2.30 M V 3 */
7295 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF);
7296 /* Timing Advance 2 Timing Advance 10.5.2.40 M V 1 */
7297 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TIMING_ADV);
7298 /* Mobile Allocation 10.5.2.21 M LV 1-9 */
7299 ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, NULL);
7300 /* 7C Starting Time 10.5.2.38 O TV 3 */
7301 ELEM_OPT_TV(0x7C,GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, NULL);
7302 /* IAX Rest Octets 10.5.2.18 M V 0-4 */
7303 if(tvb_length_remaining(tvb,curr_offset) > 0)
7304 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_IAX_REST_OCT);
7305
7306}
7307
7308/*
7309 * 9.1.20 Immediate assignment reject
7310 */
7311static void
7312dtap_rr_imm_ass_rej(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7313{
7314 guint32 curr_offset;
7315 guint32 consumed;
7316 guint curr_len;
7317 guint8 oct;
7318 curr_offset = offset;
7319 curr_len = len;
7320
7321 oct = tvb_get_guint8(tvb, curr_offset);
7322
7323 /* Page Mode 10.5.2.26 M V 1/2 */
7324 ELEM_MAND_V_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_PAGE_MODE);
7325 /* Spare Half Octet 10.5.1.8 M V 1/2 */
7326 ELEM_MAND_V_SHORT(GSM_A_PDU_TYPE_COMMON, DE_SPARE_NIBBLE);
7327 /* Request Reference 1 Request Reference 10.5.2.30 M V 3 */
7328 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF);
7329 /* Wait Indication 1 Wait Indication 10.5.2.43 M V 1 */
7330 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_WAIT_IND);
7331 /* Request Reference 2 Request Reference 10.5.2.30 M V 3 */
7332 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF);
7333 /* Wait Indication 2 Wait Indication 10.5.2.43 M V 1 */
7334 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_WAIT_IND);
7335 /* Request Reference 3 Request Reference 10.5.2.30 M V 3 */
7336 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF);
7337 /* Wait Indication 3 Wait Indication 10.5.2.43 M V 1 */
7338 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_WAIT_IND);
7339 /* Request Reference 4 Request Reference 10.5.2.30 M V 3 */
7340 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_REQ_REF);
7341 /* Wait Indication 4 Wait Indication 10.5.2.43 M V 1 */
7342 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_WAIT_IND);
7343 /* IAR Rest Octets 10.5.2.19 M V 3 */
7344 if(tvb_length_remaining(tvb,curr_offset) > 0)
7345 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_IAR_REST_OCT);
7346
7347}
7348
7349/*
7350 * 9.1.21 Measurement report
7351 */
7352static void
7353dtap_rr_meas_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7354{
7355 guint32 curr_offset;
7356 guint32 consumed;
7357 guint curr_len;
7358
7359 curr_offset = offset;
7360 curr_len = len;
7361
7362 /* Measurement Results 10.5.2.20 M V 16 */
7363 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_MEAS_RES);
7364}
7365
7366/*
7367 * 9.1.7 Paging Request Type 1
7368 */
7369static void
7370dtap_rr_paging_req_type_1(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7371{
7372 guint32 curr_offset;
7373 guint32 consumed;
7374 guint curr_len;
7375
7376 curr_offset = offset;
7377 curr_len = len;
7378 lower_nibble = FALSE;
7379
7380 /* RR Page Mode 10.5.2.26 M V 1/2 */
7381 ELEM_MAND_V_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_PAGE_MODE);
7382
7383 /* RR Channel Needed 10.5.2.8 M V 1/2 */
7384 ELEM_MAND_V_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_CHNL_NEEDED);
7385
7386 /* RR Mobile Identity 10.5.1.4 M LV 2-9 */
7387 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, " - Mobile Identity 1");
7388
7389 /* RR Mobile Identity 10.5.1.4 O TLV 3-10 */
7390 ELEM_OPT_TLV(0x17, GSM_A_PDU_TYPE_COMMON, DE_MID, " - Mobile Identity 2");
7391
7392 /* RR P1 Rest Octets 10.5.2.23 M V 0-17 */
7393 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_P1_REST_OCT);
7394
7395}
7396
7397/*
7398 * 9.1.8 Paging Request Type 2
7399 */
7400static void
7401dtap_rr_paging_req_type_2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7402{
7403 guint32 curr_offset;
7404 guint32 consumed;
7405 guint curr_len;
7406
7407 curr_offset = offset;
7408 curr_len = len;
7409 lower_nibble = FALSE;
7410
7411 /* RR Page Mode 10.5.2.26 M V 1/2 */
7412 ELEM_MAND_V_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_PAGE_MODE);
7413
7414 /* RR Channel Needed 10.5.2.8 M V 1/2 */
7415 ELEM_MAND_V_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_CHNL_NEEDED);
7416
7417 /* RR TMSI/P-TMSI 10.5.2.42 M V 4 */
7418 proto_tree_add_text(tree, tvb, curr_offset, 4, "Mobile Identity 1");
7419 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TMSI_PTMSI);
7420
7421 /* RR TMSI/P-TMSI 10.5.2.42 M V 4 */
7422 proto_tree_add_text(tree, tvb, curr_offset, 4, "Mobile Identity 2");
7423 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TMSI_PTMSI);
7424
7425 /* RR Mobile Identity 10.5.1.4 O TLV 3-10 */
7426 ELEM_OPT_TLV(0x17, GSM_A_PDU_TYPE_COMMON, DE_MID, " - Mobile Identity 3");
7427
7428 /* RR P2 Rest Octets 10.5.2.24 M V 1-11 */
7429 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_P2_REST_OCT);
7430
7431}
7432
7433/*
7434 * 9.1.9 Paging Request Type 3
7435 */
7436static void
7437dtap_rr_paging_req_type_3(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7438{
7439 guint32 curr_offset;
7440 guint32 consumed;
7441 guint curr_len;
7442
7443 curr_offset = offset;
7444 curr_len = len;
7445 lower_nibble = FALSE;
7446
7447 /* RR Page Mode 10.5.2.26 M V 1/2 */
7448 ELEM_MAND_V_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_PAGE_MODE);
7449
7450 /* RR Channel Needed 10.5.2.8 M V 1/2 */
7451 ELEM_MAND_V_SHORT(GSM_A_PDU_TYPE_RR, DE_RR_CHNL_NEEDED);
7452
7453 /* RR TMSI/P-TMSI 10.5.2.42 M V 4 */
7454 proto_tree_add_text(tree, tvb, curr_offset, 4, "Mobile Identity 1");
7455 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TMSI_PTMSI);
7456
7457 /* RR TMSI/P-TMSI 10.5.2.42 M V 4 */
7458 proto_tree_add_text(tree, tvb, curr_offset, 4, "Mobile Identity 2");
7459 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TMSI_PTMSI);
7460
7461 /* RR TMSI/P-TMSI 10.5.2.42 M V 4 */
7462 proto_tree_add_text(tree, tvb, curr_offset, 4, "Mobile Identity 3");
7463 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TMSI_PTMSI);
7464
7465 /* RR TMSI/P-TMSI 10.5.2.42 M V 4 */
7466 proto_tree_add_text(tree, tvb, curr_offset, 4, "Mobile Identity 4");
7467 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TMSI_PTMSI);
7468
7469 /* RR P3 Rest Octets 10.5.2.25 M V 3 */
7470 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_P3_REST_OCT);
7471
7472}
7473
7474/*
7475 * [4] 9.1.25 Paging response
7476 */
7477static void
7478dtap_rr_paging_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7479{
7480 guint32 curr_offset;
7481 guint32 consumed;
7482 guint curr_len;
7483 guint8 oct;
7484 proto_tree *subtree;
7485 proto_item *item;
7486
7487 curr_offset = offset;
7488 curr_len = len;
7489
7490 /*
7491 * special dissection for Cipher Key Sequence Number
7492 */
7493 oct = tvb_get_guint8(tvb, curr_offset);
7494
7495 other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
7496 proto_tree_add_text(tree,
7497 tvb, curr_offset, 1,
7498 "%s : Spare",
7499 a_bigbuf);
7500
7501 item =
7502 proto_tree_add_text(tree,
7503 tvb, curr_offset, 1, "%s",
7504 gsm_common_elem_strings[DE_CIPH_KEY_SEQ_NUM].strptr);
7505
7506 subtree = proto_item_add_subtree(item, ett_gsm_common_elem[DE_CIPH_KEY_SEQ_NUM]);
7507
7508 other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
7509 proto_tree_add_text(subtree,
7510 tvb, curr_offset, 1,
7511 "%s : Spare",
7512 a_bigbuf);
7513
7514 other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
7515
7516 switch (oct & 0x07)
7517 {
7518 case 0x07:
7519 proto_tree_add_text(subtree,
7520 tvb, curr_offset, 1,
7521 "%s : Ciphering Key Sequence Number: No key is available",
7522 a_bigbuf);
7523 break;
7524
7525 default:
7526 proto_tree_add_text(subtree,
7527 tvb, curr_offset, 1,
7528 "%s : Ciphering Key Sequence Number: %u",
7529 a_bigbuf,
7530 oct & 0x07);
7531 break;
7532 }
7533
7534 curr_offset++;
7535 curr_len--;
7536
7537 if ((signed)curr_len <= 0) return;
7538
7539 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, NULL);
7540
7541 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON, DE_MID, NULL);
7542
7543 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7544}
7545
7546/*
7547 * [4] 9.1.26 Partial Release
7548 */
7549static void
7550dtap_rr_partial_rel(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7551{
7552 guint32 curr_offset;
7553 guint32 consumed;
7554 guint curr_len;
7555
7556 curr_offset = offset;
7557 curr_len = len;
7558
7559 /* Channel Description 10.5.2.5 M V 3 */
7560 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC);
7561
7562 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7563}
7564
7565/*
7566 * [4] 9.1.27 Partial Release Complete
7567 */
7568/* empty message */
7569
7570/*
7571 * [4] 9.1.29 Physical Information
7572 */
7573static void
7574dtap_rr_phy_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7575{
7576 guint32 curr_offset;
7577 guint32 consumed;
7578 guint curr_len;
7579
7580 curr_offset = offset;
7581 curr_len = len;
7582
7583 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_TIMING_ADV);
7584
7585 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7586}
7587
7588/*
7589 * [4] 9.1.29
7590 */
7591static void
7592dtap_rr_rr_status(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7593{
7594 guint32 curr_offset;
7595 guint32 consumed;
7596 guint curr_len;
7597
7598 curr_offset = offset;
7599 curr_len = len;
7600
7601 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CAUSE);
7602
7603 EXTRANEOUS_DATA_CHECK(curr_len, 0);
7604}
7605
7606/*
7607 * [4] 9.1.31
7608 */
7609static void
7610dtap_rr_sys_info_1(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7611{
7612 guint32 curr_offset;
7613 guint32 consumed;
7614 guint curr_len;
7615
7616 curr_offset = offset;
7617 curr_len = len;
7618
7619 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CELL_CH_DSC);
7620
7621 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_RACH_CTRL_PARAM);
7622
7623 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SI1_REST_OCT);
7624}
7625
7626/*
7627 * [4] 9.1.32
7628 */
7629static void
7630dtap_rr_sys_info_2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7631{
7632 guint32 curr_offset;
7633 guint32 consumed;
7634 guint curr_len;
7635
7636 curr_offset = offset;
7637 curr_len = len;
7638
7639 proto_tree_add_text(tree, tvb, curr_offset, 16, "BCCH Frequency List");
7640 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NEIGH_CELL_DESC);
7641
7642 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NCC_PERM);
7643
7644 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_RACH_CTRL_PARAM);
7645}
7646
7647/*
7648 * [4] 9.1.33
7649 */
7650static void
7651dtap_rr_sys_info_2bis(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7652{
7653 guint32 curr_offset;
7654 guint32 consumed;
7655 guint curr_len;
7656
7657 curr_offset = offset;
7658 curr_len = len;
7659
7660 proto_tree_add_text(tree, tvb, curr_offset, 16, "Extended BCCH Frequency List");
7661 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NEIGH_CELL_DESC);
7662
7663 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_RACH_CTRL_PARAM);
7664}
7665
7666/*
7667 * [4] 9.1.34
7668 */
7669static void
7670dtap_rr_sys_info_2ter(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7671{
7672 guint32 curr_offset;
7673 guint32 consumed;
7674 guint curr_len;
7675
7676 curr_offset = offset;
7677 curr_len = len;
7678
7679 proto_tree_add_text(tree, tvb, curr_offset, 16, "Extended BCCH Frequency List");
7680 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NEIGH_CELL_DESC2);
7681
7682 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SI2TER_REST_OCT);
7683}
7684
7685/*
7686 * [4] 9.1.34a
7687 */
7688static void
7689dtap_rr_sys_info_2quater(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7690{
7691 guint32 curr_offset;
7692 guint32 consumed;
7693 guint curr_len;
7694
7695 curr_offset = offset;
7696 curr_len = len;
7697
7698 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SI2QUATER_REST_OCT);
7699}
7700
7701/*
7702 * [4] 9.1.35
7703 */
7704static void
7705dtap_rr_sys_info_3(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7706{
7707 guint32 curr_offset;
7708 guint32 consumed;
7709 guint curr_len;
7710
7711 curr_offset = offset;
7712 curr_len = len;
7713
7714 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_CELL_ID);
7715
7716 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_LAI);
7717
7718 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CTRL_CH_DESC);
7719
7720 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CELL_OPT_BCCH);
7721
7722 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CELL_SEL_PARAM);
7723
7724 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_RACH_CTRL_PARAM);
7725
7726 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SI3_REST_OCT);
7727}
7728
7729/*
7730 * [4] 9.1.36
7731 */
7732static void
7733dtap_rr_sys_info_4(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7734{
7735 guint32 curr_offset;
7736 guint32 consumed;
7737 guint curr_len;
7738
7739 curr_offset = offset;
7740 curr_len = len;
7741
7742 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_LAI);
7743
7744 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CELL_SEL_PARAM);
7745
7746 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_RACH_CTRL_PARAM);
7747
7748 ELEM_OPT_TV(0x64, GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, "CBCH Channel Description");
7749
7750 ELEM_OPT_TV(0x72, GSM_A_PDU_TYPE_RR, DE_RR_MOB_ALL, "CBCH Mobile Allocation");
7751
7752 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SI4_REST_OCT);
7753}
7754
7755/*
7756 * [4] 9.1.37
7757 */
7758static void
7759dtap_rr_sys_info_5(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7760{
7761 guint32 curr_offset;
7762 guint32 consumed;
7763 guint curr_len;
7764
7765 curr_offset = offset;
7766 curr_len = len;
7767
7768 proto_tree_add_text(tree, tvb, curr_offset, 16, "BCCH Frequency List");
7769 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NEIGH_CELL_DESC);
7770}
7771
7772/*
7773 * [4] 9.1.38
7774 */
7775static void
7776dtap_rr_sys_info_5bis(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7777{
7778 guint32 curr_offset;
7779 guint32 consumed;
7780 guint curr_len;
7781
7782 curr_offset = offset;
7783 curr_len = len;
7784
7785 proto_tree_add_text(tree, tvb, curr_offset, 16, "Extended BCCH Frequency List");
7786 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NEIGH_CELL_DESC);
7787}
7788
7789/*
7790 * [4] 9.1.39
7791 */
7792static void
7793dtap_rr_sys_info_5ter(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7794{
7795 guint32 curr_offset;
7796 guint32 consumed;
7797 guint curr_len;
7798
7799 curr_offset = offset;
7800 curr_len = len;
7801
7802 proto_tree_add_text(tree, tvb, curr_offset, 16, "Extended BCCH Frequency List");
7803 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NEIGH_CELL_DESC2);
7804}
7805
7806/*
7807 * [4] 9.1.40
7808 */
7809static void
7810dtap_rr_sys_info_6(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7811{
7812 guint32 curr_offset;
7813 guint32 consumed;
7814 guint curr_len;
7815
7816 curr_offset = offset;
7817 curr_len = len;
7818
7819 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_CELL_ID);
7820
7821 ELEM_MAND_V(GSM_A_PDU_TYPE_COMMON, DE_LAI);
7822
7823 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_CELL_OPT_SACCH);
7824
7825 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_NCC_PERM);
7826
7827 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SI6_REST_OCT);
7828}
7829
7830/*
7831 * [4] 9.1.43a
7832 */
7833static void
7834dtap_rr_sys_info_13(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7835{
7836 guint32 curr_offset;
7837 guint32 consumed;
7838 guint curr_len;
7839
7840 curr_offset = offset;
7841 curr_len = len;
7842
7843 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_SI13_REST_OCT);
7844}
7845
7846/*
7847 * [4] 9.1.51 Extended Measurement Order
7848 */
7849static void
7850dtap_rr_ext_meas_order(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7851{
7852 guint32 curr_offset;
7853 guint32 consumed;
7854 guint curr_len;
7855
7856 curr_offset = offset;
7857 curr_len = len;
7858
7859 /* Extended Measurement Frequency List 10.5.2.46 M V 16 */
7860 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_EXT_MEAS_FREQ_LIST);
7861}
7862
7863/*
7864 * [4] 9.1.52 Extended Measurement Report
7865 */
7866static void
7867dtap_rr_ext_meas_report(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
7868{
7869 guint32 curr_offset;
7870 guint32 consumed;
7871 guint curr_len;
7872
7873 curr_offset = offset;
7874 curr_len = len;
7875
7876 /* Extended Measurement Result 10.5.2.45 M V 16 */
7877 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_EXT_MEAS_RESULT);
7878}
7879
7880/*
7881 * [4] 9.1.54 Measurement Information
7882 */
7883static const value_string gsm_a_rr_3g_wait_vals[] = {
7884 { 0, "1 instance that contain 3G Neighbour Cell Description shall be received"},
7885 { 1, "2 instances that contain 3G Neighbour Cell Description shall be received"},
7886 { 2, "3 instances that contain 3G Neighbour Cell Description shall be received"},
7887 { 3, "4 instances that contain 3G Neighbour Cell Description shall be received"},
7888 { 4, "5 instances that contain 3G Neighbour Cell Description shall be received"},
7889 { 5, "6 instances that contain 3G Neighbour Cell Description shall be received"},
7890 { 6, "7 instances that contain 3G Neighbour Cell Description shall be received"},
7891 { 7, "8 instances that contain 3G Neighbour Cell Description shall be received"},
7892 { 0, NULL }
7893};
7894
7895
7896static void
7897sacch_rr_meas_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_)
7898{
7899 proto_tree *subtree, *subtree2;
7900 proto_item *item, *item2;
7901 guint32 curr_offset;
7902 gint bit_offset, bit_offset_sav, bit_offset_sav2;
7903 guint8 value, idx;
7904
7905 curr_offset = offset;
7906 bit_offset = curr_offset << 3;
7907
7908 proto_tree_add_bits_item(tree, hf_gsm_a_rr_ba_ind, tvb, bit_offset, 1, FALSE);
7909 bit_offset += 1;
7910 proto_tree_add_bits_item(tree, hf_gsm_a_rr_3g_ba_ind, tvb, bit_offset, 1, FALSE);
7911 bit_offset += 1;
7912 proto_tree_add_bits_item(tree, hf_gsm_a_rr_mp_change_mark, tvb, bit_offset, 1, FALSE);
7913 bit_offset += 1;
7914 proto_tree_add_bits_item(tree, hf_gsm_a_rr_mi_index, tvb, bit_offset, 4, FALSE);
7915 bit_offset += 4;
7916 proto_tree_add_bits_item(tree, hf_gsm_a_rr_mi_count, tvb, bit_offset, 4, FALSE);
7917 bit_offset += 4;
7918 proto_tree_add_bits_item(tree, hf_gsm_a_rr_pwrc, tvb, bit_offset, 1, FALSE);
7919 bit_offset += 1;
7920 proto_tree_add_bits_item(tree, hf_gsm_a_rr_gsm_report_type, tvb, bit_offset, 1, FALSE);
7921 bit_offset += 1;
7922 proto_tree_add_bits_item(tree, hf_gsm_a_rr_reporting_rate, tvb, bit_offset, 1, FALSE);
7923 bit_offset +=1;
7924 proto_tree_add_bits_item(tree, hf_gsm_a_rr_invalid_bsic_reporting, tvb, bit_offset, 1, FALSE);
7925 bit_offset +=1;
7926 value = tvb_get_bits8(tvb,bit_offset,1);
7927 bit_offset += 1;
7928 if (value)
7929 { /* Real Time Difference Description */
7930 bit_offset += de_rr_rtd_desc(tvb, tree, bit_offset, DE_RR_REST_OCTETS_RTD_DESC);
7931 }
7932 value = tvb_get_bits8(tvb,bit_offset,1);
7933 bit_offset += 1;
7934 if (value)
7935 { /* BSIC Description */
7936 bit_offset += de_rr_bsic_desc(tvb, tree, bit_offset, DE_RR_REST_OCTETS_BSIC_DESC);
7937 }
7938 value = tvb_get_bits8(tvb,bit_offset,1);
7939 bit_offset += 1;
7940 if (value)
7941 { /* Report Priority Description */
7942 bit_offset += de_rr_report_priority_desc(tvb, tree, bit_offset, DE_RR_REST_OCTETS_REPORT_PRIO_DESC);
7943 }
7944 value = tvb_get_bits8(tvb,bit_offset,1);
7945 bit_offset += 1;
7946 if (value)
7947 { /* Measurement Parameters Description */
7948 bit_offset += de_rr_meas_param_desc(tvb, tree, bit_offset, DE_RR_REST_OCTETS_MEAS_PARAM_DESC);
7949 }
7950 value = tvb_get_bits8(tvb,bit_offset,1);
7951 bit_offset += 1;
7952 if (value)
7953 { /* used for future extensions of the 2G parameters */
7954 value = tvb_get_bits8(tvb,bit_offset,8);
7955 bit_offset += 8 + value + 1;
7956 }
7957 value = tvb_get_bits8(tvb,bit_offset,1);
7958 bit_offset += 1;
7959 if (value)
7960 { /* 3G Neighbour Cell Description */
7961 bit_offset_sav = bit_offset;
7962 item = proto_tree_add_text(tree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_NEIGH_CELL_DESC].strptr);
7963 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_NEIGH_CELL_DESC]);
7964 value = tvb_get_bits8(tvb,bit_offset,1);
7965 bit_offset += 1;
7966 if (value)
7967 {
7968 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_wait, tvb, bit_offset, 3, FALSE);
7969 bit_offset += 3;
7970 }
7971 value = tvb_get_bits8(tvb,bit_offset,1);
7972 bit_offset += 1;
7973 if (value)
7974 {
7975 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_index_start_3g, tvb, bit_offset, 7, FALSE);
7976 bit_offset += 7;
7977 }
7978 value = tvb_get_bits8(tvb,bit_offset,1);
7979 bit_offset += 1;
7980 if (value)
7981 {
7982 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_absolute_index_start_emr, tvb, bit_offset, 7, FALSE);
7983 bit_offset += 7;
7984 }
7985 value = tvb_get_bits8(tvb,bit_offset,1);
7986 bit_offset += 1;
7987 if (value)
7988 { /* UTRAN FDD Description */
7989 bit_offset += de_rr_si2quater_meas_info_utran_fdd_desc(tvb, subtree, bit_offset);
7990 }
7991 value = tvb_get_bits8(tvb,bit_offset,1);
7992 bit_offset += 1;
7993 if (value)
7994 { /* UTRAN TDD Description */
7995 bit_offset += de_rr_si2quater_meas_info_utran_tdd_desc(tvb, subtree, bit_offset);
7996 }
7997 value = tvb_get_bits8(tvb,bit_offset,1);
7998 bit_offset += 1;
7999 if (value)
8000 { /* CDMA2000 Description */
8001 bit_offset_sav2 = bit_offset;
8002 item2 = proto_tree_add_text(subtree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_CDMA2000_DESC].strptr);
8003 subtree2 = proto_item_add_subtree(item2, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_CDMA2000_DESC]);
8004 bit_offset += 16; /* cdma2000 frequency band + cdma2000 frequency */
8005 idx = tvb_get_bits8(tvb,bit_offset,5); /* number_cdma2000_cells */
8006 bit_offset += 5;
8007 while (idx)
8008 {
8009 bit_offset += 9; /* Pilot PN offset */
8010 if (tvb_get_bits8(tvb,bit_offset,1))
8011 {
8012 bit_offset += 1;
8013 value = tvb_get_bits8(tvb,bit_offset,3);
8014 switch (value)
8015 {
8016 case 0:
8017 bit_offset += 5; /* TD_MODE + TD_POWER_LEVEL */
8018 break;
8019 case 1:
8020 bit_offset += 2; /* QOF */
8021 bit_offset += tvb_get_bits8(tvb,bit_offset,3) + 3 + 6; /* WALSH_LEN_A + bit(val(WALSH_LEN_A)+6) */
8022 break;
8023 case 2:
8024 bit_offset += 2; /* QOF */
8025 bit_offset += tvb_get_bits8(tvb,bit_offset,3) + 3 + 6; /* WALSH_LEN_B + bit(val(WALSH_LEN_B)+6) */
8026 bit_offset += 4; /* AUX_TD_POWER_LEVEL + TD_MODE */
8027 break;
8028 case 3:
8029 bit_offset += 8; /* SR3_PRIM_PILOT + SR3_PILOT_POWER1 + SR3_PILOT_POWER2 */
8030 break;
8031 case 6:
8032 bit_offset += 10; /* SR3_PRIM_PILOT + SR3_PILOT_POWER1 + SR3_PILOT_POWER2 + QOF */
8033 bit_offset += tvb_get_bits8(tvb,bit_offset,3) + 3 + 6; /* WALSH_LEN_C + bit(val(WALSH_LEN_C)+6) */
8034 if (tvb_get_bits8(tvb,bit_offset,1))
8035 {
8036 bit_offset += 3; /* 1 + QOF1 */
8037 bit_offset += tvb_get_bits8(tvb,bit_offset,3) + 3 + 6; /* WALSH_LENGTH1 + bit(val(WALSH_LENGTH1)+6) */
8038 }
8039 else
8040 bit_offset += 1;
8041 if (tvb_get_bits8(tvb,bit_offset,1))
8042 {
8043 bit_offset += 3; /* 1 + QOF2 */
8044 bit_offset += tvb_get_bits8(tvb,bit_offset,3) + 3 + 6; /* WALSH_LENGTH2 + bit(val(WALSH_LENGTH2)+6) */
8045 }
8046 else
8047 bit_offset += 1;
8048 break;
8049 default:
8050 /* decoding sequence is unknown ! */
8051 return;
8052 }
8053 }
8054 else
8055 bit_offset += 1;
8056 idx -= 1;
8057 }
8058 proto_tree_add_text(subtree2,tvb, bit_offset_sav2>>3, ((bit_offset-bit_offset_sav2)>>3)+1,"Data(Not decoded)");
8059 proto_item_set_len(item2,((bit_offset-bit_offset_sav2)>>3)+1);
8060 }
8061 proto_item_set_len(item,((bit_offset-bit_offset_sav)>>3)+1);
8062 }
8063 value = tvb_get_bits8(tvb,bit_offset,1);
8064 bit_offset += 1;
8065 if (value)
8066 { /* 3G Measurement Parameters Description */
8067 bit_offset_sav = bit_offset;
8068 item = proto_tree_add_text(tree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_MEAS_PARAM_DESC].strptr);
8069 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_MEAS_PARAM_DESC]);
8070 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_qsearch_c, tvb, bit_offset, 4, FALSE);
8071 bit_offset += 4;
8072 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_search_prio, tvb, bit_offset, 1, FALSE);
8073 bit_offset += 1;
8074 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_fdd_rep_quant, tvb, bit_offset, 1, FALSE);
8075 bit_offset += 1;
8076 value = tvb_get_bits8(tvb,bit_offset,1);
8077 bit_offset += 1;
8078 if (value)
8079 {
8080 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_fdd_multirat_reporting, tvb, bit_offset, 2, FALSE);
8081 bit_offset += 2;
8082 }
8083 value = tvb_get_bits8(tvb,bit_offset,1);
8084 bit_offset += 1;
8085 if (value)
8086 {
8087 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_fdd_reporting_offset, tvb, bit_offset, 3, FALSE);
8088 bit_offset += 3;
8089 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_fdd_reporting_threshold, tvb, bit_offset, 3, FALSE);
8090 bit_offset += 3;
8091 }
8092 value = tvb_get_bits8(tvb,bit_offset,1);
8093 bit_offset += 1;
8094 if (value)
8095 {
8096 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tdd_multirat_reporting, tvb, bit_offset, 2, FALSE);
8097 bit_offset += 2;
8098 }
8099 value = tvb_get_bits8(tvb,bit_offset,1);
8100 bit_offset += 1;
8101 if (value)
8102 {
8103 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tdd_reporting_offset, tvb, bit_offset, 3, FALSE);
8104 bit_offset += 3;
8105 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_tdd_reporting_threshold, tvb, bit_offset, 3, FALSE);
8106 bit_offset += 3;
8107 }
8108 value = tvb_get_bits8(tvb,bit_offset,1);
8109 bit_offset += 1;
8110 if (value)
8111 bit_offset += 2; /* CDMA2000 Multirat Reporting */
8112 value = tvb_get_bits8(tvb,bit_offset,1);
8113 bit_offset += 1;
8114 if (value)
8115 bit_offset += 6; /* CDMA2000 Reporting Offset + CDMA2000 Reporting Threshold */
8116 proto_item_set_len(item,((bit_offset-bit_offset_sav)>>3)+1);
8117 }
8118 if (((curr_offset + len)<<3) - bit_offset > 0)
8119 {
8120 /* There is still room left in the Rest Octets IE */
8121 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
8122 { /* Additions in Rel-5 */
8123 bit_offset += 1;
8124 value = tvb_get_bits8(tvb,bit_offset,1);
8125 bit_offset += 1;
8126 if (value)
8127 { /* 3G Additional Measurement Parameters Description 2 */
8128 bit_offset += de_rr_3g_add_meas_param_desc2(tvb, tree, bit_offset);
8129 }
8130 if (((curr_offset + len)<<3) - bit_offset > 0)
8131 {
8132 /* There is still room left in the Rest Octets IE */
8133 if (gsm_a_rr_is_bit_high(tvb,bit_offset) == TRUE)
8134 { /* Additions in Rel-7 */
8135 bit_offset += 1;
8136 value = tvb_get_bits8(tvb,bit_offset,1);
8137 bit_offset += 1;
8138 if (value)
8139 {
8140 proto_tree_add_bits_item(tree, hf_gsm_a_rr_700_reporting_offset, tvb, bit_offset, 3, FALSE);
8141 bit_offset += 3;
8142 proto_tree_add_bits_item(tree, hf_gsm_a_rr_700_reporting_threshold, tvb, bit_offset, 3, FALSE);
8143 bit_offset += 3;
8144 }
8145 value = tvb_get_bits8(tvb,bit_offset,1);
8146 bit_offset += 1;
8147 if (value)
8148 {
8149 proto_tree_add_bits_item(tree, hf_gsm_a_rr_810_reporting_offset, tvb, bit_offset, 3, FALSE);
8150 bit_offset += 3;
8151 proto_tree_add_bits_item(tree, hf_gsm_a_rr_810_reporting_threshold, tvb, bit_offset, 3, FALSE);
8152 bit_offset += 3;
8153 }
8154 }
8155 else
8156 bit_offset += 1;
8157 }
8158 }
8159 else
8160 bit_offset += 1;
8161 }
8162}
8163
8164/*
8165 * [4] 9.1.55 Enhanced Measurement Information
8166 */
8167static const true_false_string gsm_a_rr_bsic_seen_value = {
8168 "One Cell or more with invalid BSIC and allowed NCC part of BSIC is seen",
8169 "No cell with invalid BSIC and allowed NCC part of BSIC is seen"
8170};
8171
8172static const true_false_string gsm_a_rr_scale_value = {
8173 "+10 dB",
8174 "0 dB"
8175};
8176
8177static const value_string gsm_a_rr_mean_bep_gmsk_vals[] = {
8178 { 0, "log10(BEP) > -0.60"},
8179 { 1, "-0.70 < log10(BEP) < -0.60"},
8180 { 2, "-0.80 < log10(BEP) < -0.70"},
8181 { 3, "-0.90 < log10(BEP) < -0.80"},
8182 { 4, "-1.00 < log10(BEP) < -0.90"},
8183 { 5, "-1.10 < log10(BEP) < -1.00"},
8184 { 6, "-1.20 < log10(BEP) < -1.10"},
8185 { 7, "-1.30 < log10(BEP) < -1.20"},
8186 { 8, "-1.40 < log10(BEP) < -1.30"},
8187 { 9, "-1.50 < log10(BEP) < -1.40"},
8188 { 10, "-1.60 < log10(BEP) < -1.50"},
8189 { 11, "-1.70 < log10(BEP) < -1.60"},
8190 { 12, "-1.80 < log10(BEP) < -1.70"},
8191 { 13, "-1.90 < log10(BEP) < -1.80"},
8192 { 14, "-2.00 < log10(BEP) < -1.90"},
8193 { 15, "-2.10 < log10(BEP) < -2.00"},
8194 { 16, "-2.20 < log10(BEP) < -2.10"},
8195 { 17, "-2.30 < log10(BEP) < -2.20"},
8196 { 18, "-2.40 < log10(BEP) < -2.30"},
8197 { 19, "-2.50 < log10(BEP) < -2.40"},
8198 { 20, "-2.60 < log10(BEP) < -2.50"},
8199 { 21, "-2.70 < log10(BEP) < -2.60"},
8200 { 22, "-2.80 < log10(BEP) < -2.70"},
8201 { 23, "-2.90 < log10(BEP) < -2.80"},
8202 { 24, "-3.00 < log10(BEP) < -2.90"},
8203 { 25, "-3.10 < log10(BEP) < -3.00"},
8204 { 26, "-3.20 < log10(BEP) < -3.10"},
8205 { 27, "-3.30 < log10(BEP) < -3.20"},
8206 { 28, "-3.40 < log10(BEP) < -3.30"},
8207 { 29, "-3.50 < log10(BEP) < -3.40"},
8208 { 30, "-3.60 < log10(BEP) < -3.50"},
8209 { 31, "log10(BEP) < -3.60"},
8210 { 0, NULL }
8211};
8212
8213static const value_string gsm_a_rr_cv_bep_vals[] = {
8214 { 0, "1.75 < CV BEP < 2.00"},
8215 { 1, "1.50 < CV BEP < 1.75"},
8216 { 2, "1.25 < CV BEP < 1.50"},
8217 { 3, "1.00 < CV BEP < 1.25"},
8218 { 4, "0.75 < CV BEP < 1.00"},
8219 { 5, "0.50 < CV BEP < 0.75"},
8220 { 6, "0.25 < CV BEP < 0.50"},
8221 { 7, "0.00 < CV BEP < 0.25"},
8222 { 0, NULL }
8223};
8224
8225
8226static void
8227sacch_rr_enh_meas_report(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
8228{
8229 proto_tree *subtree;
8230 proto_item *item;
8231 guint32 curr_offset;
8232 gint bit_offset, bit_offset_sav;
8233 guint8 value, idx;
8234
8235 curr_offset = offset;
8236 bit_offset = curr_offset << 3;
8237
8238 proto_tree_add_bits_item(tree, hf_gsm_a_rr_ba_used, tvb, bit_offset, 1, FALSE);
8239 bit_offset += 1;
8240 proto_tree_add_bits_item(tree, hf_gsm_a_rr_3g_ba_used, tvb, bit_offset, 1, FALSE);
8241 bit_offset += 1;
8242 proto_tree_add_bits_item(tree, hf_gsm_a_rr_bsic_seen, tvb, bit_offset, 1, FALSE);
8243 bit_offset += 1;
8244 proto_tree_add_bits_item(tree, hf_gsm_a_rr_scale, tvb, bit_offset, 1, FALSE);
8245 bit_offset += 1;
8246 value = tvb_get_bits8(tvb,bit_offset,1);
8247 bit_offset += 1;
8248 if (value)
8249 { /* Serving cell data */
8250 bit_offset_sav = bit_offset;
8251 item = proto_tree_add_text(tree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_SERVING_CELL_DATA].strptr);
8252 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_SERVING_CELL_DATA]);
8253 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_dtx_used, tvb, bit_offset, 1, FALSE);
8254 bit_offset += 1;
8255 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rxlev_full_serv_cell, tvb, bit_offset, 6, FALSE);
8256 bit_offset += 6;
8257 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rxqual_full_serv_cell, tvb, bit_offset, 3, FALSE);
8258 bit_offset += 3;
8259 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_mean_bep_gmsk, tvb, bit_offset, 5, FALSE);
8260 bit_offset += 5;
8261 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_mean_cv_bep, tvb, bit_offset, 3, FALSE);
8262 bit_offset += 3;
8263 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_nbr_rcvd_blocks, tvb, bit_offset, 5, FALSE);
8264 bit_offset += 5;
8265 proto_item_set_len(item,((bit_offset-bit_offset_sav)>>3)+1);
8266 }
8267 value = tvb_get_bits8(tvb,bit_offset,1);
8268 bit_offset += 1;
8269 while (value)
8270 { /* Repeated Invalid BSIC Information */
8271 bit_offset_sav = bit_offset;
8272 item = proto_tree_add_text(tree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_REPEAT_INV_BSIC_INFO].strptr);
8273 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_REPEAT_INV_BSIC_INFO]);
8274 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bcch_freq_ncell, tvb, bit_offset, 5, FALSE);
8275 bit_offset += 5;
8276 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_bsic_ncell, tvb, bit_offset, 6, FALSE);
8277 bit_offset += 6;
8278 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_rxlev_ncell, tvb, bit_offset, 6, FALSE);
8279 bit_offset += 6;
8280 proto_item_set_len(item,((bit_offset-bit_offset_sav)>>3)+1);
8281 value = tvb_get_bits8(tvb,bit_offset,1);
8282 bit_offset += 1;
8283 }
8284 value = tvb_get_bits8(tvb,bit_offset,1);
8285 bit_offset += 1;
8286 if (value)
8287 { /* Bitmap Type Reporting */
8288 bit_offset_sav = bit_offset;
8289 item = proto_tree_add_text(tree, tvb, bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_BITMAP_TYPE_REPORTING].strptr);
8290 subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_BITMAP_TYPE_REPORTING]);
8291 idx = 0;
8292 while (((guint)(bit_offset>>3) <= (offset + len)) && (idx < 96))
8293 {
8294 value = tvb_get_bits8(tvb,bit_offset,1);
8295 bit_offset += 1;
8296 if (value)
8297 {
8298 proto_tree_add_text(subtree, tvb, bit_offset>>3, 1, "Neighbour Cell List index: %u", idx);
8299 proto_tree_add_bits_item(subtree, hf_gsm_a_rr_reporting_quantity, tvb, bit_offset, 6, FALSE);
8300 bit_offset += 6;
8301 }
8302 idx += 1;
8303 }
8304 }
8305}
8306
8307#define NUM_GSM_DTAP_MSG_RR (sizeof(gsm_a_dtap_msg_rr_strings)/sizeof(value_string))
8308static gint ett_gsm_dtap_msg_rr[NUM_GSM_DTAP_MSG_RR];
8309static void (*dtap_msg_rr_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
8310 NULL, /* Reserved */
8311 dtap_rr_add_ass, /* Additional Assignment */
8312 dtap_rr_imm_ass, /* 9.1.18 Immediate assignment */
8313 dtap_rr_imm_ass_ext, /* Immediate Assignment Extended */
8314 dtap_rr_imm_ass_rej, /* Immediate Assignment Reject */
8315
8316 NULL, /* DTM Assignment Failure */
8317 NULL, /* DTM Reject */
8318 NULL, /* DTM Request */
8319 NULL, /* Main DCCH Assignment Command */
8320 NULL, /* Packet Assignment Command */
8321
8322 dtap_rr_cip_mode_cmd, /* Ciphering Mode Command */
8323 dtap_rr_cip_mode_cpte, /* Ciphering Mode Complete */
8324
8325 dtap_rr_conf_change_cmd, /* Configuration Change Command */
8326 NULL, /* Configuration Change Ack. */
8327 dtap_rr_conf_change_rej, /* Configuration Change Reject */
8328
8329 dtap_rr_ass_cmd, /* 9.1.2 Assignment Command */
8330 dtap_rr_ass_comp, /* Assignment Complete */
8331 dtap_rr_ass_fail, /* Assignment Failure */
8332 dtap_rr_ho_cmd, /* Handover Command */
8333 dtap_rr_ho_cpte, /* Handover Complete */
8334 dtap_rr_ho_fail, /* Handover Failure */
8335 dtap_rr_phy_info, /* Physical Information */
8336 NULL, /* DTM Assignment Command */
8337
8338 NULL, /* RR-cell Change Order */
8339 NULL, /* PDCH Assignment Command */
8340
8341 dtap_rr_ch_rel, /* Channel Release */
8342 dtap_rr_partial_rel, /* Partial Release */
8343 NULL, /* Partial Release Complete */
8344
8345 dtap_rr_paging_req_type_1, /* Paging Request Type 1 */
8346 dtap_rr_paging_req_type_2, /* Paging Request Type 2 */
8347 dtap_rr_paging_req_type_3, /* Paging Request Type 3 */
8348 dtap_rr_paging_resp, /* Paging Response */
8349 NULL, /* Notification/NCH */
8350 NULL, /* Reserved */
8351 NULL, /* Notification/Response */
8352
8353 NULL, /* Reserved */
8354
8355 dtap_rr_utran_classmark_change, /* Utran Classmark Change */
8356 NULL, /* cdma2000 Classmark Change */
8357 dtap_rr_inter_syst_to_utran_ho_cmd, /* Inter System to UTRAN Handover Command */
8358 NULL, /* Inter System to cdma2000 Handover Command */
8359
8360 NULL, /* System Information Type 8 */
8361 dtap_rr_sys_info_1, /* System Information Type 1 */
8362 dtap_rr_sys_info_2, /* System Information Type 2 */
8363 dtap_rr_sys_info_3, /* System Information Type 3 */
8364 dtap_rr_sys_info_4, /* System Information Type 4 */
8365 dtap_rr_sys_info_5, /* System Information Type 5 */
8366 dtap_rr_sys_info_6, /* System Information Type 6 */
8367 NULL, /* System Information Type 7 */
8368
8369 dtap_rr_sys_info_2bis, /* System Information Type 2bis */
8370 dtap_rr_sys_info_2ter, /* System Information Type 2ter */
8371 dtap_rr_sys_info_2quater, /* System Information Type 2quater */
8372 dtap_rr_sys_info_5bis, /* System Information Type 5bis */
8373 dtap_rr_sys_info_5ter, /* System Information Type 5ter */
8374 NULL, /* System Information Type 9 */
8375 dtap_rr_sys_info_13, /* System Information Type 13 */
8376
8377 NULL, /* System Information Type 16 */
8378 NULL, /* System Information Type 17 */
8379
8380 NULL, /* System Information Type 18 */
8381 NULL, /* System Information Type 19 */
8382 NULL, /* System Information Type 20 */
8383
8384 dtap_rr_ch_mode_mod, /* Channel Mode Modify */
8385 dtap_rr_rr_status, /* RR Status */
8386 dtap_rr_ch_mode_mod_ack, /* Channel Mode Modify Acknowledge */
8387 dtap_rr_freq_redef, /* Frequency Redefinition */
8388 dtap_rr_meas_rep, /* 9.1.21 Measurement report */
8389 dtap_rr_mm_cm_change, /* 9.1.11 Classmark Change */
8390 dtap_rr_cm_enq, /* Classmark Enquiry */
8391 dtap_rr_ext_meas_report, /* Extended Measurement Report */
8392 dtap_rr_ext_meas_order, /* Extended Measurement Order */
8393 dtap_rr_gprs_sus_req, /* 9.1.13b GPRS Suspension Request */
8394
8395 NULL, /* VGCS Uplink Grant */
8396 NULL, /* Uplink Release */
8397 NULL, /* Reserved */
8398 NULL, /* Uplink Busy */
8399 NULL, /* Talker Indication */
8400
8401 NULL, /* UTRAN Classmark Change/Handover To UTRAN Command */ /* spec conflict */
8402
8403 dtap_rr_app_inf, /* Application Information */
8404
8405 NULL, /* NONE */
8406};
8407
8408void get_rr_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn)
8409{
8410 gint idx;
8411
8412 *msg_str = match_strval_idx((guint32) (oct & DTAP_RR_IEI_MASK), gsm_a_dtap_msg_rr_strings, &idx);
8413 *hf_idx = hf_gsm_a_dtap_msg_rr_type;
8414 if (*msg_str != NULL) {
8415 *ett_tree = ett_gsm_dtap_msg_rr[idx];
8416 *msg_fcn = dtap_msg_rr_fcn[idx];
8417 }
8418
8419 return;
8420}
8421/* This is more or less a copy of the dissect_dtap() code just adding
8422 * L2 Pseudo Length decoding first
8423 * The code should probably be cleaned up.
8424 * The name CCCH might not be correct!
8425 */
8426static void
8427dissect_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
8428{
8429
8430 static gsm_a_tap_rec_t tap_rec[4];
8431 static gsm_a_tap_rec_t *tap_p;
8432 static guint tap_current=0;
8433
8434 void (*msg_fcn)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len);
8435 guint8 oct;
8436 guint8 pd;
8437 guint32 offset, saved_offset;
8438 guint32 len;
8439 guint32 oct_1, oct_2;
8440 proto_item *ccch_item = NULL;
8441 proto_tree *ccch_tree = NULL;
8442 proto_item *oct_1_item = NULL;
8443 proto_tree *pd_tree = NULL;
8444 proto_tree *saved_tree = NULL;
8445 const gchar *msg_str;
8446 gint ett_tree;
8447 gint ti;
8448 int hf_idx;
8449 gboolean nsd;
8450 guint8 pseudo_len;
8451 guint32 curr_offset;
8452 guint32 consumed;
8453 guint curr_len;
8454
8455 len = tvb_length(tvb);
8456
8457 if (len < 2){
8458 /*
8459 * too short to be CCCH
8460 */
8461 call_dissector(data_handle, tvb, pinfo, tree);
8462 return;
8463 }
8464
8465 if (check_col(pinfo->cinfo, COL_INFO)){
8466 col_append_str(pinfo->cinfo, COL_INFO, "(CCCH) ");
8467 }
8468 /*
8469 * set tap record pointer
8470 */
8471 tap_current++;
8472 if (tap_current >= 4)
8473 {
8474 tap_current = 0;
8475 }
8476 tap_p = &tap_rec[tap_current];
8477
8478 offset = 0;
8479 oct_2 = 0;
8480
8481 /* Skip pseeudo hdr here */
8482 offset = 1;
8483
8484 /*
8485 * get protocol discriminator
8486 */
8487 oct_1 = tvb_get_guint8(tvb, offset++);
8488
8489 if ((((oct_1 & DTAP_TI_MASK) >> 4) & DTAP_TIE_PRES_MASK) == DTAP_TIE_PRES_MASK){
8490 /*
8491 * eventhough we don't know if a TI should be in the message yet
8492 * we rely on the TI/SKIP indicator to be 0 to avoid taking this
8493 * octet
8494 */
8495 oct_2 = tvb_get_guint8(tvb, offset++);
8496 }
8497
8498 oct = tvb_get_guint8(tvb, offset);
8499
8500 pd = oct_1 & DTAP_PD_MASK;
8501 ti = -1;
8502 msg_str = NULL;
8503 ett_tree = -1;
8504 hf_idx = -1;
8505 msg_fcn = NULL;
8506 nsd = FALSE;
8507 if (check_col(pinfo->cinfo, COL_INFO)){
8508 col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ",val_to_str(pd,gsm_a_pd_short_str_vals,"Unknown (%u)"));
8509 }
8510
8511 /*
8512 * octet 1
8513 */
8514 switch (pd){
8515 case 6:
8516 rr_apdu_pinfo = pinfo;
8517 get_rr_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn);
8518 break;
8519
8520 default:
8521 /* 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 */
8522 return;
8523 }
8524
8525 /*
8526 * create the protocol tree
8527 */
8528 if (msg_str == NULL){
8529 ccch_item = proto_tree_add_protocol_format(tree, proto_a_ccch, tvb, 0, len,
8530 "GSM CCCH - Message Type (0x%02x)",
8531 oct);
8532
8533 ccch_tree = proto_item_add_subtree(ccch_item, ett_ccch_msg);
8534 }else{
8535 ccch_item = proto_tree_add_protocol_format(tree, proto_a_ccch, tvb, 0, -1,
8536 "GSM CCCH - %s", msg_str);
8537
8538 ccch_tree = proto_item_add_subtree(ccch_item, ett_tree);
8539 }
8540
8541 if (check_col(pinfo->cinfo, COL_INFO)){
8542 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
8543 }
8544
8545 /* back to the begining */
8546 saved_offset = offset;
8547 offset = 0;
8548
8549 curr_offset = offset;
8550 curr_len = len;
8551 len = 1;
8552
8553 /* L2 Pseudo Length 10.5.2.19 */
8554 pseudo_len = tvb_get_guint8(tvb,offset)>>2;
8555
8556 saved_tree = tree;
8557 tree = ccch_tree;
8558 ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_L2_PSEUDO_LEN);
8559 tree = saved_tree;
8560 offset = saved_offset;
8561
8562 oct_1_item =
8563 proto_tree_add_text(ccch_tree,
8564 tvb, 1, 1,
8565 "Protocol Discriminator: %s",
8566 val_to_str(pd, protocol_discriminator_vals, "Unknown (%u)"));
8567
8568 pd_tree = proto_item_add_subtree(oct_1_item, ett_ccch_oct_1);
8569
8570 if (ti == -1){
8571 proto_tree_add_item(pd_tree, hf_gsm_a_skip_ind, tvb, 1, 1, FALSE);
8572 }else{
8573 other_decode_bitfield_value(a_bigbuf, oct_1, 0x80, 8);
8574 proto_tree_add_text(pd_tree,tvb, 1, 1,
8575 "%s : TI flag: %s",
8576 a_bigbuf,
8577 ((oct_1 & 0x80) ? "allocated by receiver" : "allocated by sender"));
8578
8579 if ((ti & DTAP_TIE_PRES_MASK) == DTAP_TIE_PRES_MASK){
8580 /* ti is extended to next octet */
8581 other_decode_bitfield_value(a_bigbuf, oct_1, 0x70, 8);
8582 proto_tree_add_text(pd_tree, tvb, 1, 1,
8583 "%s : TIO: The TI value is given by the TIE in octet 2",
8584 a_bigbuf);
8585 }else{
8586 other_decode_bitfield_value(a_bigbuf, oct_1, 0x70, 8);
8587 proto_tree_add_text(pd_tree,tvb, 1, 1,
8588 "%s : TIO: %u",a_bigbuf,ti & DTAP_TIE_PRES_MASK);
8589 }
8590 }
8591
8592 proto_tree_add_item(pd_tree, hf_gsm_a_L3_protocol_discriminator, tvb, 1, 1, FALSE);
8593
8594 if ((ti != -1) && (ti & DTAP_TIE_PRES_MASK) == DTAP_TIE_PRES_MASK){
8595 proto_tree_add_item(tree, hf_gsm_a_extension, tvb, 2, 1, FALSE);
8596 other_decode_bitfield_value(a_bigbuf, oct_2, DTAP_TIE_MASK, 8);
8597 proto_tree_add_text(pd_tree, tvb, 2, 1,
8598 "%s : TIE: %u", a_bigbuf, oct_2 & DTAP_TIE_MASK);
8599 }
8600
8601 /*
8602 * N(SD)
8603 */
8604 if ((pinfo->p2p_dir == P2P_DIR_RECV) &&
8605 nsd)
8606 {
8607 /* XXX */
8608 }
8609
8610 /*
8611 * add DTAP message name
8612 */
8613 proto_tree_add_uint_format(ccch_tree, hf_idx, tvb, offset, 1, oct,
8614 "Message Type: %s",msg_str ? msg_str : "(Unknown)");
8615
8616 offset++;
8617
8618 tap_p->pdu_type = GSM_A_PDU_TYPE_DTAP;
8619 tap_p->message_type = (nsd ? (oct & 0x3f) : oct);
8620 tap_p->protocol_disc = pd;
8621
8622 tap_queue_packet(gsm_a_tap, pinfo, tap_p);
8623
8624 if (msg_str == NULL)
8625 return;
8626
8627 if (offset >= len)
8628 return;
8629
8630 /*
8631 * decode elements
8632 */
8633 if (msg_fcn == NULL){
8634 proto_tree_add_text(ccch_tree, tvb, offset, len - offset,
8635 "Message Elements");
8636 }else{
8637 (*msg_fcn)(tvb, ccch_tree, offset, len - offset);
8638 }
8639}
8640
8641const value_string gsm_a_sacch_msg_rr_strings[] = {
8642 { 0x00, "System Information Type 10" },
8643 { 0x01, "Notification/FACCH" },
8644 { 0x02, "Uplink Free" },
8645 { 0x04, "Enhanced Measurement Report" },
8646 { 0x05, "Measurement Information" },
8647 { 0x06, "VBS/VGCS Reconfigure" },
8648 { 0x07, "VBS/VGCS Reconfigure2" },
8649 { 0x08, "VGCS Additional Information" },
8650 { 0x09, "VGCS SMS Information" },
8651 { 0, NULL }
8652};
8653
8654#define NUM_GSM_SACCH_MSG_RR (sizeof(gsm_a_sacch_msg_rr_strings)/sizeof(value_string))
8655static gint ett_gsm_sacch_msg_rr[NUM_GSM_SACCH_MSG_RR];
8656static void (*sacch_msg_rr_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
8657 NULL, /* System Information Type 10 */
8658 NULL, /* Notification/FACCH */
8659 NULL, /* Uplink Free */
8660 sacch_rr_enh_meas_report, /* Enhanced Measurement Report */
8661 sacch_rr_meas_info, /* Measurement Information */
8662 NULL, /* VBS/VGCS Reconfigure */
8663 NULL, /* VBS/VGCS Reconfigure2 */
8664 NULL, /* VGCS Additional Information */
8665 NULL, /* VGCS SMS Information */
8666 NULL, /* NONE */
8667};
8668
8669void get_rr_short_pd_msg_params(guint8 mess_type, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn)
8670{
8671 gint idx;
8672
8673 *msg_str = match_strval_idx((guint32) mess_type, gsm_a_sacch_msg_rr_strings, &idx);
8674 *hf_idx = hf_gsm_a_sacch_msg_rr_type;
8675 if (*msg_str != NULL) {
8676 *ett_tree = ett_gsm_sacch_msg_rr[idx];
8677 *msg_fcn = sacch_msg_rr_fcn[idx];
8678 }
8679}
8680
8681const value_string short_protocol_discriminator_vals[] = {
8682 {0x0, "Radio Resources Management messages"},
8683 { 0, NULL }
8684};
8685
8686static void
8687dissect_sacch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
8688{
8689 static gsm_a_tap_rec_t tap_rec[4];
8690 static gsm_a_tap_rec_t *tap_p;
8691 static guint tap_current=0;
8692
8693 void (*msg_fcn)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len);
8694 guint8 oct, short_pd, mess_type;
8695 guint32 offset;
8696 guint32 len;
8697 proto_item *sacch_item = NULL;
8698 proto_tree *sacch_tree = NULL;
8699 const gchar *msg_str;
8700 gint ett_tree;
8701 int hf_idx;
8702
8703 len = tvb_length(tvb);
8704
8705 if (check_col(pinfo->cinfo, COL_INFO))
8706 col_append_str(pinfo->cinfo, COL_INFO, "(SACCH) ");
8707
8708 /*
8709 * set tap record pointer
8710 */
8711 tap_current++;
8712 if (tap_current >= 4)
8713 {
8714 tap_current = 0;
8715 }
8716 tap_p = &tap_rec[tap_current];
8717
8718 offset = 0;
8719
8720 oct = tvb_get_guint8(tvb, offset);
8721
8722 msg_str = NULL;
8723 ett_tree = -1;
8724 hf_idx = -1;
8725 msg_fcn = NULL;
8726
8727 short_pd = (oct & 0x80) >> 7;
8728 mess_type = (oct & 0x7c) >> 2;
8729
8730 if (short_pd == 0)
8731 {
8732 if (check_col(pinfo->cinfo, COL_INFO))
8733 col_append_fstr(pinfo->cinfo, COL_INFO, "(RR) ");
8734 get_rr_short_pd_msg_params(mess_type, &msg_str, &ett_tree, &hf_idx, &msg_fcn);
8735 }
8736 else
8737 {
8738 if (check_col(pinfo->cinfo, COL_INFO))
8739 col_append_fstr(pinfo->cinfo, COL_INFO, "(Unknown) ");
8740 }
8741
8742 /*
8743 * create the protocol tree
8744 */
8745 if (msg_str == NULL){
8746 sacch_item = proto_tree_add_protocol_format(tree, proto_a_sacch, tvb, 0, len,
8747 "GSM SACCH - Message Type (0x%02x)", mess_type);
8748
8749 sacch_tree = proto_item_add_subtree(sacch_item, ett_sacch_msg);
8750 }else{
8751 sacch_item = proto_tree_add_protocol_format(tree, proto_a_sacch, tvb, 0, -1,
8752 "GSM SACCH - %s", msg_str);
8753
8754 sacch_tree = proto_item_add_subtree(sacch_item, ett_tree);
8755
8756 if (check_col(pinfo->cinfo, COL_INFO)){
8757 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
8758 }
8759 }
8760
8761 if (short_pd == 0)
8762 proto_tree_add_text(sacch_tree,
8763 tvb, offset, 1,
8764 "Short Protocol Discriminator: %s",
8765 val_to_str(short_pd, short_protocol_discriminator_vals, "Unknown (%u)"));
8766
8767 if (hf_idx == -1)
8768 return;
8769
8770 /*
8771 * add SACCH message name
8772 */
8773 proto_tree_add_uint_format(sacch_tree, hf_idx, tvb, offset, 1, oct,
8774 "Message Type: %s",msg_str ? msg_str : "(Unknown)");
8775
8776 proto_tree_add_text(sacch_tree, tvb, offset, 1,
8777 "Short Layer 2 header: %u", oct & 0x03);
8778
8779 offset++;
8780
8781 tap_p->pdu_type = GSM_A_PDU_TYPE_SACCH;
8782 tap_p->message_type = mess_type;
8783 tap_p->protocol_disc = short_pd;
8784
8785 tap_queue_packet(gsm_a_tap, pinfo, tap_p);
8786
8787 if (msg_str == NULL)
8788 return;
8789
8790 /*
8791 * decode elements
8792 */
8793 if (msg_fcn == NULL){
8794 proto_tree_add_text(sacch_tree, tvb, offset, len - offset,
8795 "Message Elements");
8796 }else{
8797 (*msg_fcn)(tvb, sacch_tree, offset, len - offset);
8798 }
8799}
8800
8801/* Register the protocol with Wireshark */
8802void
8803proto_register_gsm_a_rr(void)
8804{
8805 guint i;
8806 guint last_offset;
8807
8808 /* Setup list of header fields */
8809
8810 static hf_register_info hf[] =
8811 {
8812 { &hf_gsm_a_dtap_msg_rr_type,
8813 { "DTAP Radio Resources Management Message Type", "gsm_a.dtap_msg_rr_type",
8814 FT_UINT8, BASE_HEX, VALS(gsm_a_dtap_msg_rr_strings), 0x0,
8815 NULL, HFILL }
8816 },
8817 { &hf_gsm_a_rr_elem_id,
8818 { "Element ID", "gsm_a_rr.elem_id",
8819 FT_UINT8, BASE_DEC, NULL, 0,
8820 NULL, HFILL }
8821 },
8822 { &hf_gsm_a_bcc,
8823 { "BCC","gsm_a.bcc",
8824 FT_UINT8,BASE_DEC, NULL, 0x07,
8825 NULL, HFILL }
8826 },
8827 { &hf_gsm_a_ncc,
8828 { "NCC","gsm_a.ncc",
8829 FT_UINT8,BASE_DEC, NULL, 0x38,
8830 NULL, HFILL }
8831 },
8832 { &hf_gsm_a_bcch_arfcn,
8833 { "BCCH ARFCN(RF channel number)","gsm_a.bcch_arfcn",
8834 FT_UINT16,BASE_DEC, NULL, 0x0,
8835 NULL, HFILL }
8836 },
8837 { &hf_gsm_a_rr_range_nb,
8838 { "Number of Ranges","gsm_a.rr.range_nb",
8839 FT_UINT8, BASE_DEC, NULL, 0xff,
8840 NULL, HFILL }
8841 },
8842 { &hf_gsm_a_rr_range_lower,
8843 { "Range Lower","gsm_a.rr.range_lower",
8844 FT_UINT16, BASE_DEC, NULL, 0x0000,
8845 "ARFCN used as the lower limit of a range of frequencies to be used by the mobile station in cell selection (Range Lower)", HFILL }
8846 },
8847 { &hf_gsm_a_rr_range_higher,
8848 { "Range Higher","gsm_a.rr.range_higher",
8849 FT_UINT16, BASE_DEC, NULL, 0x0000,
8850 "ARFCN used as the higher limit of a range of frequencies to be used by the mobile station in cell selection (Range Higher)", HFILL }
8851 },
8852 { &hf_gsm_a_rr_ba_list_pref_length,
8853 { "Length of BA List Pref","gsm_a.rr.ba_list_pref_length",
8854 FT_UINT8, BASE_DEC, NULL, 0xff,
8855 NULL, HFILL }
8856 },
8857 { &hf_gsm_a_rr_ba_freq,
8858 { "BA Freq","gsm_a.rr.ba_freq",
8859 FT_UINT16, BASE_DEC, NULL, 0x0000,
8860 "ARFCN indicating a single frequency to be used by the mobile station in cell selection and reselection (BA Freq)", HFILL }
8861 },
8862 { &hf_gsm_a_rr_utran_freq_list_length,
8863 { "Length of BA List Pref","gsm_a.rr.ba_list_pref_length",
8864 FT_UINT8, BASE_DEC, NULL, 0xff,
8865 NULL, HFILL }
8866 },
8867 { &hf_gsm_a_rr_ho_ref_val,
8868 { "Handover reference value","gsm_a.rr.ho_ref_val",
8869 FT_UINT8,BASE_DEC, NULL, 0x0,
8870 NULL, HFILL }
8871 },
8872 { &hf_gsm_a_rr_L2_pseudo_len,
8873 { "L2 Pseudo Length value","gsm_a.rr.rr_2_pseudo_len",
8874 FT_UINT8, BASE_DEC, NULL, 0xfc,
8875 NULL, HFILL }
8876 },
8877 { &hf_gsm_a_rr_ba_used,
8878 { "BA-USED","gsm_a.rr.ba_used",
8879 FT_UINT8, BASE_DEC, NULL, 0x00,
8880 NULL, HFILL }
8881 },
8882 { &hf_gsm_a_rr_dtx_used,
8883 { "DTX-USED","gsm_a.rr.dtx_used",
8884 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_dtx_vals), 0x0,
8885 NULL, HFILL }
8886 },
8887 { &hf_gsm_a_rr_3g_ba_used,
8888 { "3G-BA-USED","gsm_a.rr.3g_ba_used",
8889 FT_UINT8, BASE_DEC, NULL, 0x00,
8890 NULL, HFILL }
8891 },
8892 { &hf_gsm_a_rr_meas_valid,
8893 { "MEAS-VALID","gsm_a.rr.meas_valid",
8894 FT_BOOLEAN,8, TFS(&gsm_a_rr_mv_vals), 0x40,
8895 NULL, HFILL }
8896 },
8897 { &hf_gsm_a_rr_rxlev_full_serv_cell,
8898 { "RXLEV-FULL-SERVING-CELL","gsm_a.rr.rxlev_full_serv_cell",
8899 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_rxlev_vals), 0x00,
8900 NULL, HFILL }
8901 },
8902 { &hf_gsm_a_rr_rxlev_sub_serv_cell,
8903 { "RXLEV-SUB-SERVING-CELL","gsm_a.rr.rxlev_sub_serv_cell",
8904 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_rxlev_vals), 0x3f,
8905 NULL, HFILL }
8906 },
8907 { &hf_gsm_a_rr_rxqual_full_serv_cell,
8908 { "RXQUAL-FULL-SERVING-CELL","gsm_a.rr.rxqual_full_serv_cell",
8909 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_rxqual_vals), 0x00,
8910 NULL, HFILL }
8911 },
8912 { &hf_gsm_a_rr_rxqual_sub_serv_cell,
8913 { "RXQUAL-SUB-SERVING-CELL","gsm_a.rr.rxqual_sub_serv_cell",
8914 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_rxqual_vals), 0x0e,
8915 NULL, HFILL }
8916 },
8917 { &hf_gsm_a_rr_no_ncell_m,
8918 { "NO-NCELL-M","gsm_a.rr.no_ncell_m",
8919 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_ncell_vals), 0x00,
8920 NULL, HFILL }
8921 },
8922 { &hf_gsm_a_rr_rxlev_ncell,
8923 { "RXLEV-NCELL","gsm_a.rr.rxlev_ncell",
8924 FT_UINT8,BASE_DEC, NULL, 0x00,
8925 NULL, HFILL }
8926 },
8927 { &hf_gsm_a_rr_bcch_freq_ncell,
8928 { "BCCH-FREQ-NCELL","gsm_a.rr.bcch_freq_ncell",
8929 FT_UINT8,BASE_DEC, NULL, 0x00,
8930 NULL, HFILL }
8931 },
8932 { &hf_gsm_a_rr_bsic_ncell,
8933 { "BSIC-NCELL","gsm_a.rr.bsic_ncell",
8934 FT_UINT8,BASE_DEC, NULL, 0x00,
8935 NULL, HFILL }
8936 },
8937 { &hf_gsm_a_rr_mobile_time_difference,
8938 { "Mobile Timing Difference value (in half bit periods)","gsm_a.rr.mobile_time_difference",
8939 FT_UINT32,BASE_DEC, NULL, 0xFFFFF8,
8940 NULL, HFILL }
8941 },
8942 { &hf_gsm_a_rr_pow_cmd_atc,
8943 { "ATC","gsm_a.rr.pow_cmd_atc",
8944 FT_BOOLEAN,8, TFS(&gsm_a_rr_pow_cmd_atc_value), 0x80,
8945 NULL, HFILL }
8946 },
8947 { &hf_gsm_a_rr_page_mode,
8948 { "Page Mode","gsm_a.rr.page_mode",
8949 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_page_mode_vals), 0x03,
8950 NULL, HFILL }
8951 },
8952 { &hf_gsm_a_rr_dedicated_mode_or_tbf,
8953 { "Dedicated mode or TBF","gsm_a.rr.dedicated_mode_or_tbf",
8954 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_dedicated_mode_or_tbf_vals), 0x70,
8955 NULL, HFILL }
8956 },
8957 { &hf_gsm_a_rr_pow_cmd_epc,
8958 { "EPC_mode","gsm_a.rr.pow_cmd_epc",
8959 FT_BOOLEAN,8, TFS(&gsm_a_rr_pow_cmd_epc_value), 0x40,
8960 NULL, HFILL }
8961 },
8962 { &hf_gsm_a_rr_pow_cmd_fpcepc,
8963 { "FPC_EPC","gsm_a.rr.pow_cmd_fpcepc",
8964 FT_BOOLEAN,8, TFS(&gsm_a_rr_pow_cmd_fpcepc_value), 0x20,
8965 NULL, HFILL }
8966 },
8967 { &hf_gsm_a_rr_pow_cmd_powlev,
8968 { "POWER LEVEL","gsm_a.rr.pow_cmd_pow",
8969 FT_UINT8,BASE_DEC, NULL, 0x1f,
8970 NULL, HFILL }
8971 },
8972 { &hf_gsm_a_rr_sync_ind_nci,
8973 { "Normal cell indication(NCI)","gsm_a.rr.sync_ind_nci",
8974 FT_BOOLEAN,8, TFS(&gsm_a_rr_sync_ind_nci_value), 0x08,
8975 NULL, HFILL }
8976 },
8977 { &hf_gsm_a_rr_sync_ind_rot,
8978 { "Report Observed Time Difference(ROT)","gsm_a.rr.sync_ind_rot",
8979 FT_BOOLEAN,8, TFS(&sm_a_rr_sync_ind_rot_value), 0x04,
8980 NULL, HFILL }
8981 },
8982 { &hf_gsm_a_rr_sync_ind_si,
8983 { "Synchronization indication(SI)","gsm_a.rr_sync_ind_si",
8984 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_sync_ind_si_vals), 0x03,
8985 NULL, HFILL }
8986 },
8987 { &hf_gsm_a_rr_format_id,
8988 { "Format Identifier","gsm_a.rr_format_id",
8989 FT_UINT8,BASE_HEX, VALS(gsm_a_rr_freq_list_format_id_vals), 0xce,
8990 NULL, HFILL }
8991 },
8992 { &hf_gsm_a_rr_channel_mode,
8993 { "Channel Mode","gsm_a.rr.channel_mode",
8994 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_channel_mode_vals), 0x0,
8995 NULL, HFILL }
8996 },
8997 { &hf_gsm_a_rr_channel_mode2,
8998 { "Channel Mode 2","gsm_a.rr.channel_mode2",
8999 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_channel_mode2_vals), 0x0,
9000 NULL, HFILL }
9001 },
9002 { &hf_gsm_a_rr_sc,
9003 { "SC","gsm_a.rr.SC",
9004 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_sc_vals), 0x00,
9005 NULL, HFILL }
9006 },
9007 { &hf_gsm_a_algorithm_id,
9008 { "Algorithm identifier","gsm_a.algorithm_identifier",
9009 FT_UINT8,BASE_DEC, VALS(gsm_a_algorithm_identifier_vals), 0x00,
9010 NULL, HFILL }
9011 },
9012 { &hf_gsm_a_rr_cr,
9013 { "CR","gsm_a.rr.CR",
9014 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_cr_vals), 0x00,
9015 NULL, HFILL }
9016 },
9017 { &hf_gsm_a_rr_multirate_speech_ver,
9018 { "Multirate speech version","gsm_a.rr.multirate_speech_ver",
9019 FT_UINT8,BASE_DEC, VALS(multirate_speech_ver_vals), 0xe0,
9020 NULL, HFILL }
9021 },
9022 { &hf_gsm_a_rr_NCSB,
9023 { "NSCB: Noise Suppression Control Bit","gsm_a.rr.NCSB",
9024 FT_UINT8,BASE_DEC, VALS(NSCB_vals), 0x10,
9025 NULL, HFILL }
9026 },
9027 { &hf_gsm_a_rr_ICMI,
9028 { "ICMI: Initial Codec Mode Indicator","gsm_a.rr.ICMI",
9029 FT_UINT8,BASE_DEC, VALS(ICMI_vals), 0x8,
9030 NULL, HFILL }
9031 },
9032 { &hf_gsm_a_rr_start_mode,
9033 { "Start Mode","gsm_a.rr.start_mode",
9034 FT_UINT8,BASE_DEC, NULL, 0x3,
9035 NULL, HFILL }
9036 },
9037 { &hf_gsm_a_rr_timing_adv,
9038 { "Timing advance value","gsm_a.rr.timing_adv",
9039 FT_UINT8,BASE_DEC, NULL, 0x0,
9040 NULL, HFILL }
9041 },
9042 { &hf_gsm_a_rr_time_diff,
9043 { "Time difference value","gsm_a.rr.time_diff",
9044 FT_UINT8,BASE_DEC, NULL, 0x0,
9045 NULL, HFILL }
9046 },
9047 { &hf_gsm_a_rr_tlli,
9048 { "TLLI","gsm_a.rr.tlli",
9049 FT_UINT32,BASE_HEX, NULL, 0x0,
9050 NULL, HFILL }
9051 },
9052 { &hf_gsm_a_rr_tmsi_ptmsi,
9053 { "TMSI/P-TMSI Value","gsm_a.rr.tmsi_ptmsi",
9054 FT_UINT32,BASE_HEX, NULL, 0x0,
9055 NULL, HFILL }
9056 },
9057 { &hf_gsm_a_rr_target_mode,
9058 { "Target mode","gsm_a.rr.target_mode",
9059 FT_UINT8,BASE_DEC, NULL, 0xc0,
9060 NULL, HFILL }
9061 },
9062 { &hf_gsm_a_rr_wait_indication,
9063 { "Wait Indication","gsm_a.rr.wait_indication",
9064 FT_UINT8,BASE_DEC, NULL, 0x00,
9065 NULL, HFILL }
9066 },
9067 { &hf_gsm_a_rr_seq_code,
9068 { "Sequence Code","gsm_a.rr.seq_code",
9069 FT_UINT8, BASE_DEC, NULL, 0x00,
9070 NULL, HFILL }
9071 },
9072
9073 { &hf_gsm_a_rr_group_cipher_key_number,
9074 { "Group cipher key number","gsm_a.rr.Group_cipher_key_number",
9075 FT_UINT8,BASE_DEC, NULL, 0x3c,
9076 NULL, HFILL }
9077 },
9078 { &hf_gsm_a_rr_MBMS_broadcast,
9079 { "MBMS Broadcast","gsm_a.rr.MBMS_broadcast",
9080 FT_BOOLEAN,8, TFS(&gsm_a_rr_MBMS_broadcast_value), 0x01,
9081 NULL, HFILL }
9082 },
9083 { &hf_gsm_a_rr_MBMS_multicast,
9084 { "MBMS Multicast","gsm_a.rr.MBMS_multicast",
9085 FT_BOOLEAN,8, TFS(&gsm_a_rr_MBMS_multicast_value), 0x02,
9086 NULL, HFILL }
9087 },
9088 { &hf_gsm_a_rr_last_segment,
9089 { "Last Segment","gsm_a.rr.last_segment",
9090 FT_BOOLEAN,8, TFS(&gsm_a_rr_last_segment_value), 0x01,
9091 NULL, HFILL }
9092 },
9093 { &hf_gsm_a_rr_carrier_ind,
9094 { "Carrier Indication","gsm_a.rr.carrier_ind",
9095 FT_BOOLEAN,8, TFS(&gsm_a_rr_carrier_ind_value), 0x01,
9096 NULL, HFILL }
9097 },
9098 { &hf_gsm_a_rr_ra,
9099 { "Random Access Information (RA)", "gsm_a_rr_ra",
9100 FT_UINT8, BASE_DEC, NULL, 0x0,
9101 NULL, HFILL }
9102 },
9103 { &hf_gsm_a_rr_T1prim,
9104 { "T1'", "gsm_a.rr.T1prim",
9105 FT_UINT8, BASE_DEC, NULL, 0xf8,
9106 NULL, HFILL }
9107 },
9108 { &hf_gsm_a_rr_T3,
9109 { "T3", "gsm_a.rr.T3",
9110 FT_UINT16, BASE_DEC, NULL, 0x07e0,
9111 NULL, HFILL }
9112 },
9113 { &hf_gsm_a_rr_T2,
9114 { "T2", "gsm_a.rr.T2",
9115 FT_UINT8, BASE_DEC, NULL, 0x1f,
9116 NULL, HFILL }
9117 },
9118 { &hf_gsm_a_rr_rfn,
9119 { "RFN", "gsm_a.rr.rfn",
9120 FT_UINT16, BASE_DEC, NULL, 0x0,
9121 "Reduced Frame Number", HFILL }
9122 },
9123 { &hf_gsm_a_rr_RR_cause,
9124 { "RR cause value","gsm_a.rr.RRcause",
9125 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_RR_cause_vals), 0x0,
9126 NULL, HFILL }
9127 },
9128 { &hf_gsm_a_rr_cm_cng_msg_req,
9129 { "CLASSMARK CHANGE","gsm_a.rr_cm_cng_msg_req",
9130 FT_BOOLEAN,8, TFS(&gsm_a_msg_req_value), 0x80,
9131 NULL, HFILL }
9132 },
9133 { &hf_gsm_a_rr_utran_cm_cng_msg_req,
9134 { "UTRAN CLASSMARK CHANGE","gsm_a.rr_utran_cm_cng_msg_req",
9135 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_utran_cm_cng_msg_req_vals), 0x70,
9136 NULL, HFILL }
9137 },
9138 { &hf_gsm_a_rr_cdma200_cm_cng_msg_req,
9139 { "CDMA2000 CLASSMARK CHANGE","gsm_a.rr_cdma200_cm_cng_msg_req",
9140 FT_BOOLEAN,8, TFS(&gsm_a_msg_req_value), 0x08,
9141 NULL, HFILL }
9142 },
9143 { &hf_gsm_a_rr_geran_iu_cm_cng_msg_req,
9144 { "GERAN IU MODE CLASSMARK CHANGE","gsm_a.rr_geran_iu_cm_cng_msg_req",
9145 FT_BOOLEAN,8, TFS(&gsm_a_msg_req_value), 0x04,
9146 NULL, HFILL }
9147 },
9148 { &hf_gsm_a_rr_chnl_needed_ch1,
9149 { "Channel 1","gsm_a.rr_chnl_needed_ch1",
9150 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_channel_needed_vals), 0x00,
9151 NULL, HFILL }
9152 },
9153 { &hf_gsm_a_rr_chnl_needed_ch2,
9154 { "Channel 2","gsm_a.rr_chnl_needed_ch2",
9155 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_channel_needed_vals), 0x00,
9156 NULL, HFILL }
9157 },
9158 { &hf_gsm_a_rr_chnl_needed_ch3,
9159 { "Channel 3","gsm_a.rr_chnl_needed_ch3",
9160 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_channel_needed_vals), 0x00,
9161 NULL, HFILL }
9162 },
9163 { &hf_gsm_a_rr_chnl_needed_ch4,
9164 { "Channel 4","gsm_a.rr_chnl_needed_ch4",
9165 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_channel_needed_vals), 0x00,
9166 NULL, HFILL }
9167 },
9168 { &hf_gsm_a_rr_suspension_cause,
9169 { "Suspension cause value","gsm_a.rr.suspension_cause",
9170 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_suspension_cause_vals), 0x0,
9171 NULL, HFILL }
9172 },
9173 { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b8,
9174 { "12,2 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b8",
9175 FT_BOOLEAN,8, TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x80,
9176 NULL, HFILL }
9177 },
9178 { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b7,
9179 { "10,2 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b7",
9180 FT_BOOLEAN,8, TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x40,
9181 NULL, HFILL }
9182 },
9183 { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b6,
9184 { "7,95 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b6",
9185 FT_BOOLEAN,8, TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x20,
9186 NULL, HFILL }
9187 },
9188 { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b5,
9189 { "7,40 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b5",
9190 FT_BOOLEAN,8, TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x10,
9191 NULL, HFILL }
9192 },
9193 { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b4,
9194 { "6,70 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b4",
9195 FT_BOOLEAN,8, TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x08,
9196 NULL, HFILL }
9197 },
9198 { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b3,
9199 { "5,90 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b3",
9200 FT_BOOLEAN,8, TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x04,
9201 NULL, HFILL }
9202 },
9203 { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b2,
9204 { "5,15 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b2",
9205 FT_BOOLEAN,8, TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x02,
9206 NULL, HFILL }
9207 },
9208 { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b1,
9209 { "4,75 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b1",
9210 FT_BOOLEAN,8, TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x01,
9211 NULL, HFILL }
9212 },
9213 { &hf_gsm_a_rr_set_of_amr_codec_modes_v2_b5,
9214 { "23,85 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v2b5",
9215 FT_BOOLEAN,8, TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x10,
9216 NULL, HFILL }
9217 },
9218 { &hf_gsm_a_rr_set_of_amr_codec_modes_v2_b4,
9219 { "15,85 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v2b4",
9220 FT_BOOLEAN,8, TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x08,
9221 NULL, HFILL }
9222 },
9223 { &hf_gsm_a_rr_set_of_amr_codec_modes_v2_b3,
9224 { "12,65 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v2b3",
9225 FT_BOOLEAN,8, TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x04,
9226 NULL, HFILL }
9227 },
9228 { &hf_gsm_a_rr_set_of_amr_codec_modes_v2_b2,
9229 { "8,85 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v2b2",
9230 FT_BOOLEAN,8, TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x02,
9231 NULL, HFILL }
9232 },
9233 { &hf_gsm_a_rr_set_of_amr_codec_modes_v2_b1,
9234 { "6,60 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v2b1",
9235 FT_BOOLEAN,8, TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x01,
9236 NULL, HFILL }
9237 },
9238 { &hf_gsm_a_rr_amr_threshold,
9239 { "AMR Threshold", "gsm_a.rr.amr_threshold",
9240 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_amr_threshold_vals), 0x00,
9241 NULL, HFILL }
9242 },
9243 { &hf_gsm_a_rr_amr_hysteresis,
9244 { "AMR Hysteresis", "gsm_a.rr.amr_hysteresis",
9245 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_amr_hysteresis_vals), 0x00,
9246 NULL, HFILL }
9247 },
9248 { &hf_gsm_a_rr_pwrc,
9249 { "PWRC", "gsm_a.rr.pwrc",
9250 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
9251 "Power Control Indicator (PWRC)", HFILL }
9252 },
9253 { &hf_gsm_a_rr_dtx_bcch,
9254 { "DTX (BCCH)", "gsm_a.rr.dtx_bcch",
9255 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_dtx_bcch_vals), 0x30,
9256 "Discontinuous Transmission (DTX-BCCH)", HFILL }
9257 },
9258 { &hf_gsm_a_rr_dtx_sacch,
9259 { "DTX (SACCH)", "gsm_a.rr.dtx_sacch",
9260 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_dtx_sacch_vals), 0xb0,
9261 "Discontinuous Transmission (DTX-SACCH)", HFILL }
9262 },
9263 { &hf_gsm_a_rr_radio_link_timeout,
9264 { "Radio Link Timeout", "gsm_a.rr.radio_link_timeout",
9265 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_radio_link_timeout_vals), 0x0f,
9266 "Radio Link Timeout (s)", HFILL }
9267 },
9268 { &hf_gsm_a_rr_cell_reselect_hyst,
9269 { "Cell Reselection Hysteresis", "gsm_a.rr.cell_reselect_hyst",
9270 FT_UINT8, BASE_DEC, NULL, 0xe0,
9271 "Cell Reselection Hysteresis (dB)", HFILL }
9272 },
9273 { &hf_gsm_a_rr_ms_txpwr_max_cch,
9274 { "MS TXPWR MAX CCH", "gsm_a.rr.ms_txpwr_max_cch",
9275 FT_UINT8, BASE_DEC, NULL, 0x1f,
9276 NULL, HFILL }
9277 },
9278 { &hf_gsm_a_rr_acs,
9279 { "ACS", "gsm_a.rr.acs",
9280 FT_BOOLEAN, 8, NULL, 0x80,
9281 "Additional Reselect Param Indicator (ACS)", HFILL }
9282 },
9283 { &hf_gsm_a_rr_neci,
9284 { "NECI", "gsm_a.rr.neci",
9285 FT_UINT8, BASE_DEC, NULL, 0x40,
9286 "New Establishment Cause Indicator (NECI)", HFILL }
9287 },
9288 { &hf_gsm_a_rr_rxlev_access_min,
9289 { "RXLEV-ACCESS-MIN", "gsm_a.rr.rxlev_access_min",
9290 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_rxlev_vals), 0x3f,
9291 NULL, HFILL }
9292 },
9293 { &hf_gsm_a_rr_mscr,
9294 { "MSCR", "gsm_a.rr.mscr",
9295 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_mscr_vals), 0x80,
9296 "MSC Release Indicator (MSCR)", HFILL }
9297 },
9298 { &hf_gsm_a_rr_att,
9299 { "ATT", "gsm_a.rr.att",
9300 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_att_vals), 0x40,
9301 "Attach Indicator (ATT)", HFILL }
9302 },
9303 { &hf_gsm_a_rr_bs_ag_blks_res,
9304 { "BS_AG_BLKS_RES", "gsm_a.rr.bs_ag_blks_res",
9305 FT_UINT8, BASE_DEC, NULL, 0x38,
9306 "Access Grant Reserved Blocks (BS_AG_BLKS_RES)", HFILL }
9307 },
9308 { &hf_gsm_a_rr_ccch_conf,
9309 { "CCCH-CONF", "gsm_a.rr.ccch_conf",
9310 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_ccch_conf_vals), 0x07,
9311 NULL, HFILL }
9312 },
9313 { &hf_gsm_a_rr_cbq3,
9314 { "CBQ3", "gsm_a.rr.cbq3",
9315 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_cbq3_vals), 0x00,
9316 "Cell Bar Qualify 3", HFILL }
9317 },
9318 { &hf_gsm_a_rr_bs_pa_mfrms,
9319 { "BS-PA-MFRMS", "gsm_a.rr.bs_pa_mfrms",
9320 FT_UINT8, BASE_DEC, NULL, 0x07,
9321 NULL, HFILL }
9322 },
9323 { &hf_gsm_a_rr_t3212,
9324 { "T3212", "gsm_a.rr.t3212",
9325 FT_UINT8, BASE_DEC, NULL, 0x00,
9326 "Periodic Update period (T3212) (deci-hours)", HFILL }
9327 },
9328 { &hf_gsm_a_rr_dyn_arfcn_length,
9329 { "Length of Dynamic Mapping", "gsm_a.rr.dyn_arfcn_length",
9330 FT_UINT8, BASE_DEC, NULL, 0x00,
9331 NULL, HFILL }
9332 },
9333 { &hf_gsm_a_rr_gsm_band,
9334 { "GSM Band", "gsm_a.rr.gsm_band",
9335 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_gsm_band_vals), 0x00,
9336 NULL, HFILL }
9337 },
9338 { &hf_gsm_a_rr_arfcn_first,
9339 { "ARFCN First", "gsm_a.rr.arfcn_first",
9340 FT_UINT16, BASE_DEC, NULL, 0x00,
9341 NULL, HFILL }
9342 },
9343 { &hf_gsm_a_rr_band_offset,
9344 { "Band Offset", "gsm_a.rr.band_offset",
9345 FT_UINT16, BASE_DEC, NULL, 0x00,
9346 NULL, HFILL }
9347 },
9348 { &hf_gsm_a_rr_arfcn_range,
9349 { "ARFCN Range", "gsm_a.rr.arfcn_range",
9350 FT_UINT8, BASE_DEC, NULL, 0x00,
9351 NULL, HFILL }
9352 },
9353 { &hf_gsm_a_rr_lowest_arfcn,
9354 { "Lowest ARFCN", "gsm_a.rr.lowest_arfcn",
9355 FT_UINT8, BASE_DEC, NULL, 0x7f,
9356 NULL, HFILL }
9357 },
9358 { &hf_gsm_a_rr_inc_skip_arfcn,
9359 { "Increment skip ARFCN", "gsm_a.rr.inc_skip_arfcn",
9360 FT_UINT8, BASE_DEC, NULL, 0x00,
9361 NULL, HFILL }
9362 },
9363 { &hf_gsm_a_rr_gprs_resumption_ack,
9364 { "Ack", "gsm_a.rr.gprs_resumption_ack",
9365 FT_BOOLEAN, 8, TFS(&gsm_a_rr_gprs_resumption_ack_value), 0x01,
9366 "GPRS Resumption Ack bit", HFILL }
9367 },
9368 { &hf_gsm_a_rr_ext_ind,
9369 { "EXT-IND", "gsm_a.rr.ext_ind",
9370 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_ext_ind_vals), 0x20,
9371 "Extension Indication (EXT-IND)", HFILL }
9372 },
9373 { &hf_gsm_a_rr_ba_ind,
9374 { "BA-IND", "gsm_a.rr.ba_ind",
9375 FT_UINT8, BASE_DEC, NULL, 0x00,
9376 "BCCH Allocation Indication (BA-IND)", HFILL }
9377 },
9378 { &hf_gsm_a_rr_multiband_reporting,
9379 { "Multiband Reporting", "gsm_a.rr.multiband_reporting",
9380 FT_UINT8, BASE_DEC, NULL, 0x00,
9381 "Number of cells to be reported in each band if Multiband Reporting", HFILL }
9382 },
9383 { &hf_gsm_a_rr_ncc_permitted,
9384 { "NCC Permitted", "gsm_a.rr.ncc_permitted",
9385 FT_UINT8, BASE_HEX, NULL, 0xff,
9386 NULL, HFILL }
9387 },
9388 { &hf_gsm_a_rr_max_retrans,
9389 { "Max retrans", "gsm_a.rr.max_retrans",
9390 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_max_retrans_vals), 0xc0,
9391 "Maximum number of retransmissions", HFILL }
9392 },
9393 { &hf_gsm_a_rr_tx_integer,
9394 { "Tx-integer", "gsm_a.rr.tx_integer",
9395 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_tx_integer_vals), 0x3c,
9396 "Number of Slots to spread Transmission (Tx-integer)", HFILL }
9397 },
9398 { &hf_gsm_a_rr_cell_barr_access,
9399 { "CELL_BARR_ACCESS", "gsm_a.rr.cell_barr_access",
9400 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_cell_barr_access_vals), 0x02,
9401 "Cell Barred for Access (CELL_BARR_ACCESS)", HFILL }
9402 },
9403 { &hf_gsm_a_rr_re,
9404 { "RE", "gsm_a.rr.re",
9405 FT_BOOLEAN, 8, NULL, 0x01,
9406 "Call re-establishment allowed (RE)", HFILL }
9407 },
9408 { &hf_gsm_a_rr_acc,
9409 { "ACC", "gsm_a.rr.acc",
9410 FT_UINT16, BASE_HEX, NULL, 0xffff,
9411 "Access Control Class N barred (ACC)", HFILL }
9412 },
9413 { &hf_gsm_a_rr_nch_position,
9414 { "NCH Position", "gsm_a.rr.nch_position",
9415 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_nch_position_vals), 0x00,
9416 NULL, HFILL }
9417 },
9418 { &hf_gsm_a_rr_si2ter_mp_change_mark,
9419 { "SI2ter Measurement Parameter Change Mark", "gsm_a.rr.si2ter_mp_change_mark",
9420 FT_UINT8, BASE_DEC, NULL, 0x00,
9421 NULL, HFILL }
9422 },
9423 { &hf_gsm_a_rr_si2ter_3g_change_mark,
9424 { "SI2ter 3G Change Mark", "gsm_a.rr.si2ter_3g_change_mark",
9425 FT_UINT8, BASE_DEC, NULL, 0x00,
9426 NULL, HFILL }
9427 },
9428 { &hf_gsm_a_rr_si2ter_index,
9429 { "SI2ter Index", "gsm_a.rr.si2ter_index",
9430 FT_UINT8, BASE_DEC, NULL, 0x00,
9431 NULL, HFILL }
9432 },
9433 { &hf_gsm_a_rr_si2ter_count,
9434 { "SI2ter Count", "gsm_a.rr.si2ter_count",
9435 FT_UINT8, BASE_DEC, NULL, 0x00,
9436 NULL, HFILL }
9437 },
9438 { &hf_gsm_a_rr_fdd_uarfcn,
9439 { "FDD UARFCN", "gsm_a.rr.fdd_uarfcn",
9440 FT_UINT16, BASE_DEC, NULL, 0x0000,
9441 NULL, HFILL }
9442 },
9443 { &hf_gsm_a_rr_bandwidth_fdd,
9444 { "Bandwidth FDD", "gsm_a.rr.bandwidth_fdd",
9445 FT_UINT8, BASE_DEC, NULL, 0x00,
9446 NULL, HFILL }
9447 },
9448 { &hf_gsm_a_rr_tdd_uarfcn,
9449 { "TDD UARFCN", "gsm_a.rr.tdd_uarfcn",
9450 FT_UINT16, BASE_DEC, NULL, 0x0000,
9451 NULL, HFILL }
9452 },
9453 { &hf_gsm_a_rr_bandwidth_tdd,
9454 { "Bandwidth TDD", "gsm_a.rr.bandwidth_tdd",
9455 FT_UINT8, BASE_DEC, NULL, 0x00,
9456 NULL, HFILL }
9457 },
9458 { &hf_gsm_a_rr_arfcn,
9459 { "ARFCN", "gsm_a.rr.arfcn",
9460 FT_UINT16, BASE_DEC, NULL, 0x0000,
9461 "Absolute Radio Frequency Channel Number (ARFCN)", HFILL }
9462 },
9463 { &hf_gsm_a_rr_bsic,
9464 { "BSIC", "gsm_a.rr.bsic",
9465 FT_UINT8, BASE_DEC, NULL, 0x00,
9466 "Base Station Identify Code (BSIC)", HFILL }
9467 },
9468 { &hf_gsm_a_rr_qsearch_i,
9469 { "Qsearch I", "gsm_a.rr.qsearch_i",
9470 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_qsearch_x_vals), 0x00,
9471 "Search for 3G cells if signal level is below (0 7) or above (8 15) threshold (Qsearch I)", HFILL }
9472 },
9473 { &hf_gsm_a_rr_fdd_qoffset,
9474 { "FDD Qoffset", "gsm_a.rr.fdd_qoffset",
9475 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xdd_qoffset_vals), 0x00,
9476 "Offset to RLA_C for cell re selection to FDD access technology (FDD Qoffset)", HFILL }
9477 },
9478 { &hf_gsm_a_rr_fdd_qmin,
9479 { "FDD Qmin", "gsm_a.rr.fdd_qmin",
9480 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_fdd_qmin_vals), 0x00,
9481 "Minimum threshold for Ec/No for UTRAN FDD cell re-selection (FDD Qmin)", HFILL }
9482 },
9483 { &hf_gsm_a_rr_tdd_qoffset,
9484 { "TDD Qoffset", "gsm_a.rr.tdd_qoffset",
9485 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xdd_qoffset_vals), 0x00,
9486 "Offset to RLA_C for cell re selection to TDD access technology (TDD Qoffset)", HFILL }
9487 },
9488 { &hf_gsm_a_rr_fdd_qmin_offset,
9489 { "FDD Qmin Offset", "gsm_a.rr.fdd_qmin_offset",
9490 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_fdd_qmin_offset_vals), 0x00,
9491 "Offset to FDD Qmin value (FDD Qmin Offset)", HFILL }
9492 },
9493 { &hf_gsm_a_rr_fdd_rscpmin,
9494 { "FDD RSCPmin", "gsm_a.rr.fdd_rscpmin",
9495 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_fdd_rscpmin_vals), 0x00,
9496 "Minimum threshold of RSCP for UTRAN FDD cell re-selection (FDD RSCPmin)", HFILL }
9497 },
9498 { &hf_gsm_a_rr_3g_ba_ind,
9499 { "3G BA-IND", "gsm_a.rr.3g_ba_ind",
9500 FT_UINT8, BASE_DEC, NULL, 0x00,
9501 "3G BCCH Allocation Indication (3G BA-IND)", HFILL }
9502 },
9503 { &hf_gsm_a_rr_mp_change_mark,
9504 { "Measurement Parameter Change Mark", "gsm_a.rr.mp_change_mark",
9505 FT_UINT8, BASE_DEC, NULL, 0x00,
9506 NULL, HFILL }
9507 },
9508 { &hf_gsm_a_rr_si2quater_index,
9509 { "SI2quater Index", "gsm_a.rr.si2quater_index",
9510 FT_UINT8, BASE_DEC, NULL, 0x00,
9511 NULL, HFILL }
9512 },
9513 { &hf_gsm_a_rr_si2quater_count,
9514 { "SI2quater Count", "gsm_a.rr.si2quater_count",
9515 FT_UINT8, BASE_DEC, NULL, 0x00,
9516 NULL, HFILL }
9517 },
9518 { &hf_gsm_a_rr_gsm_report_type,
9519 { "Report Type", "gsm_a.rr.gsm_report_type",
9520 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_gsm_report_type_value), 0x0,
9521 "Report type the MS shall use (Report Type)", HFILL }
9522 },
9523 { &hf_gsm_a_rr_serving_band_reporting,
9524 { "Serving Band Reporting", "gsm_a.rr.serving_band_reporting",
9525 FT_UINT8, BASE_DEC, NULL, 0x00,
9526 "Number of cells reported from the GSM serving frequency band (Serving Band Reporting)", HFILL }
9527 },
9528 { &hf_gsm_a_rr_frequency_scrolling,
9529 { "Frequency Scrolling", "gsm_a.rr.frequency_scrolling",
9530 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_frequency_scrolling_value), 0x0,
9531 NULL, HFILL }
9532 },
9533 { &hf_gsm_a_rr_rep_priority,
9534 { "Rep Priority", "gsm_a.rr.rep_priority",
9535 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_rep_priority_value), 0x0,
9536 "Reporting Priority", HFILL }
9537 },
9538 { &hf_gsm_a_rr_report_type,
9539 { "Report Type", "gsm_a.rr.report_type",
9540 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_report_type_value), 0x0,
9541 NULL, HFILL }
9542 },
9543 { &hf_gsm_a_rr_reporting_rate,
9544 { "Reporting Rate", "gsm_a.rr.reporting_rate",
9545 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_reporting_rate_value), 0x0,
9546 NULL, HFILL }
9547 },
9548 { &hf_gsm_a_rr_invalid_bsic_reporting,
9549 { "Invalid BSIC Reporting", "gsm_a.rr.invalid_bsic_reporting",
9550 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_invalid_bsic_reporting_value), 0x0,
9551 NULL, HFILL }
9552 },
9553 { &hf_gsm_a_rr_scale_ord,
9554 { "Scale Ord", "gsm_a.rr.scale_ord",
9555 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_scale_ord_vals), 0x00,
9556 "Offset used for the reported RXLEV values (Scale Ord)", HFILL }
9557 },
9558 { &hf_gsm_a_rr_900_reporting_offset,
9559 { "900 Reporting Offset", "gsm_a.rr.900_reporting_offset",
9560 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
9561 "Offset to the reported value when prioritising the cells for reporting for GSM frequency band 900 (900 Reporting Offset)", HFILL }
9562 },
9563 { &hf_gsm_a_rr_900_reporting_threshold,
9564 { "900 Reporting Threshold", "gsm_a.rr.900_reporting_threshold",
9565 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_threshold_vals), 0x00,
9566 "Apply priority reporting if the reported value is above threshold for GSM frequency band 900 (900 Reporting Threshold)", HFILL }
9567 },
9568 { &hf_gsm_a_rr_1800_reporting_offset,
9569 { "1800 Reporting Offset", "gsm_a.rr.1800_reporting_offset",
9570 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
9571 "Offset to the reported value when prioritising the cells for reporting for GSM frequency band 1800 (1800 Reporting Offset)", HFILL }
9572 },
9573 { &hf_gsm_a_rr_1800_reporting_threshold,
9574 { "1800 Reporting Threshold", "gsm_a.rr.1800_reporting_threshold",
9575 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_threshold_vals), 0x00,
9576 "Apply priority reporting if the reported value is above threshold for GSM frequency band 1800 (1800 Reporting Threshold)", HFILL }
9577 },
9578 { &hf_gsm_a_rr_400_reporting_offset,
9579 { "400 Reporting Offset", "gsm_a.rr.400_reporting_offset",
9580 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
9581 "Offset to the reported value when prioritising the cells for reporting for GSM frequency band 400 (400 Reporting Offset)", HFILL }
9582 },
9583 { &hf_gsm_a_rr_400_reporting_threshold,
9584 { "400 Reporting Threshold", "gsm_a.rr.400_reporting_threshold",
9585 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_threshold_vals), 0x00,
9586 "Apply priority reporting if the reported value is above threshold for GSM frequency band 400 (400 Reporting Threshold)", HFILL }
9587 },
9588 { &hf_gsm_a_rr_1900_reporting_offset,
9589 { "1900 Reporting Offset", "gsm_a.rr.1900_reporting_offset",
9590 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
9591 "Offset to the reported value when prioritising the cells for reporting for GSM frequency band 1900 (1900 Reporting Offset)", HFILL }
9592 },
9593 { &hf_gsm_a_rr_1900_reporting_threshold,
9594 { "1900 Reporting Threshold", "gsm_a.rr.1900_reporting_threshold",
9595 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_threshold_vals), 0x00,
9596 "Apply priority reporting if the reported value is above threshold for GSM frequency band 1900 (1900 Reporting Threshold)", HFILL }
9597 },
9598 { &hf_gsm_a_rr_850_reporting_offset,
9599 { "850 Reporting Offset", "gsm_a.rr.850_reporting_offset",
9600 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
9601 "Offset to the reported value when prioritising the cells for reporting for GSM frequency band 850 (850 Reporting Offset)", HFILL }
9602 },
9603 { &hf_gsm_a_rr_850_reporting_threshold,
9604 { "850 Reporting Threshold", "gsm_a.rr.900_reporting_threshold",
9605 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_threshold_vals), 0x00,
9606 "Apply priority reporting if the reported value is above threshold for GSM frequency band 850 (850 Reporting Threshold)", HFILL }
9607 },
9608 { &hf_gsm_a_rr_network_control_order,
9609 { "Network Control Order", "gsm_a.rr.network_control_order",
9610 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_network_control_order_vals), 0x00,
9611 NULL, HFILL }
9612 },
9613 { &hf_gsm_a_rr_nc_non_drx_period,
9614 { "NC Non DRX Period", "gsm_a.rr.nc_non_drx_period",
9615 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_nc_non_drx_period_vals), 0x00,
9616 NULL, HFILL }
9617 },
9618 { &hf_gsm_a_rr_nc_reporting_period_i,
9619 { "NC Reporting Period I", "gsm_a.rr.nc_reporting_period_i",
9620 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_nc_reporting_period_x_vals), 0x00,
9621 "NC Reporting Period in Packet Idle mode (NC Reporting Period I)", HFILL }
9622 },
9623 { &hf_gsm_a_rr_nc_reporting_period_t,
9624 { "NC Reporting Period T", "gsm_a.rr.nc_reporting_period_t",
9625 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_nc_reporting_period_x_vals), 0x00,
9626 "NC Reporting Period in Packet Transfer mode (NC Reporting Period T)", HFILL }
9627 },
9628 { &hf_gsm_a_rr_index_start_3g,
9629 { "Index Start 3G", "gsm_a.rr.index_start_3g",
9630 FT_UINT8, BASE_DEC, NULL, 0x00,
9631 NULL, HFILL }
9632 },
9633 { &hf_gsm_a_rr_absolute_index_start_emr,
9634 { "Absolute Index Start EMR", "gsm_a.rr.absolute_index_start_emr",
9635 FT_UINT8, BASE_DEC, NULL, 0x00,
9636 NULL, HFILL }
9637 },
9638 { &hf_gsm_a_rr_qsearch_c_initial,
9639 { "QSearch C Initial", "gsm_a.rr.qsearch_c_initial",
9640 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_qsearch_c_initial_value), 0x0,
9641 "Qsearch value to be used in connected mode before Qsearch C is received (QSearch C Initial)", HFILL }
9642 },
9643 { &hf_gsm_a_rr_fdd_rep_quant,
9644 { "FDD Rep Quant", "gsm_a.rr.fdd_rep_quant",
9645 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_fdd_rep_quant_value), 0x0,
9646 "FDD Reporting Quantity (FDD Rep Quant)", HFILL }
9647 },
9648 { &hf_gsm_a_rr_fdd_multirat_reporting,
9649 { "FDD Multirat Reporting", "gsm_a.rr.fdd_multirat_reporting",
9650 FT_UINT8, BASE_DEC, NULL, 0x00,
9651 "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 }
9652 },
9653 { &hf_gsm_a_rr_tdd_multirat_reporting,
9654 { "TDD Multirat Reporting", "gsm_a.rr.tdd_multirat_reporting",
9655 FT_UINT8, BASE_DEC, NULL, 0x00,
9656 "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 }
9657 },
9658 { &hf_gsm_a_rr_qsearch_p,
9659 { "Qsearch P", "gsm_a.rr.qsearch_p",
9660 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_qsearch_x_vals), 0x00,
9661 "Search for 3G cells if signal level below threshold (Qsearch P)", HFILL }
9662 },
9663 { &hf_gsm_a_rr_3g_search_prio,
9664 { "3G Search Prio", "gsm_a.rr.3g_search_prio",
9665 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_3g_search_prio_value), 0x0,
9666 NULL, HFILL }
9667 },
9668 { &hf_gsm_a_rr_fdd_reporting_offset,
9669 { "FDD Reporting Offset", "gsm_a.rr.fdd_reporting_offset",
9670 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
9671 "Offset to the reported value when prioritising the cells for reporting for FDD access technology (FDD Reporting Offset)", HFILL }
9672 },
9673 { &hf_gsm_a_rr_fdd_reporting_threshold,
9674 { "FDD Reporting Threshold", "gsm_a.rr.fdd_reporting_threshold",
9675 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_threshold_vals), 0x00,
9676 "Apply priority reporting if the reported value is above threshold for FDD access technology (FDD Reporting Threshold)", HFILL }
9677 },
9678 { &hf_gsm_a_rr_tdd_reporting_offset,
9679 { "TDD Reporting Offset", "gsm_a.rr.tdd_reporting_offset",
9680 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
9681 "Offset to the reported value when prioritising the cells for reporting for TDD access technology (TDD Reporting Offset)", HFILL }
9682 },
9683 { &hf_gsm_a_rr_tdd_reporting_threshold,
9684 { "TDD Reporting Threshold", "gsm_a.rr.tdd_reporting_threshold",
9685 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_threshold_vals), 0x00,
9686 "Apply priority reporting if the reported value is above threshold for TDD access technology (TDD Reporting Threshold)", HFILL }
9687 },
9688 { &hf_gsm_a_rr_fdd_reporting_threshold_2,
9689 { "FDD Reporting Threshold 2", "gsm_a.rr.fdd_reporting_threshold_2",
9690 FT_UINT8, BASE_DEC, NULL, 0x00,
9691 "Reporting threshold for the CPICH parameter (Ec/No or RSCP) that is not reported according to FDD_REP_QUANT (FDD Reporting Threshold 2)", HFILL }
9692 },
9693 { &hf_gsm_a_rr_3g_ccn_active,
9694 { "3G CCN Active", "gsm_a.rr.3g_ccn_active",
9695 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_3g_ccn_active_value), 0x0,
9696 NULL, HFILL }
9697 },
9698 { &hf_gsm_a_rr_700_reporting_offset,
9699 { "700 Reporting Offset", "gsm_a.rr.700_reporting_offset",
9700 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
9701 "Offset to the reported value when prioritising the cells for reporting for GSM frequency band 700 (700 Reporting Offset)", HFILL }
9702 },
9703 { &hf_gsm_a_rr_700_reporting_threshold,
9704 { "700 Reporting Threshold", "gsm_a.rr.700_reporting_threshold",
9705 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_threshold_vals), 0x00,
9706 "Apply priority reporting if the reported value is above threshold for GSM frequency band 700 (700 Reporting Threshold)", HFILL }
9707 },
9708 { &hf_gsm_a_rr_810_reporting_offset,
9709 { "810 Reporting Offset", "gsm_a.rr.810_reporting_offset",
9710 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_offset_vals), 0x00,
9711 "Offset to the reported value when prioritising the cells for reporting for GSM frequency band 810 (810 Reporting Offset)", HFILL }
9712 },
9713 { &hf_gsm_a_rr_810_reporting_threshold,
9714 { "810 Reporting Threshold", "gsm_a.rr.810_reporting_threshold",
9715 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_xxx_reporting_threshold_vals), 0x00,
9716 "Apply priority reporting if the reported value is above threshold for GSM frequency band 810 (810 Reporting Threshold)", HFILL }
9717 },
9718 { &hf_gsm_a_rr_cbq,
9719 { "CBQ", "gsm_a.rr.cbq",
9720 FT_UINT8, BASE_DEC, NULL, 0x00,
9721 "Cell Bar Qualify", HFILL }
9722 },
9723 { &hf_gsm_a_rr_cell_reselect_offset,
9724 { "Cell Reselect Offset", "gsm_a.rr.cell_reselect_offset",
9725 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_cell_reselect_offset_vals), 0x00,
9726 "Offset to the C2 reselection criterion (Cell Reselect Offset)", HFILL }
9727 },
9728 { &hf_gsm_a_rr_temporary_offset,
9729 { "Temporary Offset", "gsm_a.rr.temporary_offset",
9730 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_temporary_offset_vals), 0x0,
9731 "Negative offset to C2 for the duration of Penalty Time (Temporary Offset)", HFILL }
9732 },
9733 { &hf_gsm_a_rr_penalty_time,
9734 { "Penalty Time", "gsm_a.rr.penalty_time",
9735 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_penalty_time_vals), 0x0,
9736 "Duration for which the temporary offset is applied (Penalty Time)", HFILL }
9737 },
9738 { &hf_gsm_a_rr_si13_position,
9739 { "SI13 Position", "gsm_a.rr.si13_position",
9740 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_si13_position_vals), 0x0,
9741 NULL, HFILL }
9742 },
9743 { &hf_gsm_a_rr_power_offset,
9744 { "Power Offset", "gsm_a.rr.power_offset",
9745 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_power_offset_vals), 0x0,
9746 "Power offset used in conjunction with the MS TXPWR MAX CCH parameter by the class 3 DCS 1800 MS (Power Offset)", HFILL }
9747 },
9748 { &hf_gsm_a_rr_si2quater_position,
9749 { "SI2quater Position", "gsm_a.rr.si2quater_position",
9750 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_si2quater_position_value), 0x0,
9751 NULL, HFILL }
9752 },
9753 { &hf_gsm_a_rr_si13alt_position,
9754 { "SI13alt Position", "gsm_a.rr.si13alt_position",
9755 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_si13alt_position_value), 0x0,
9756 NULL, HFILL }
9757 },
9758 { &hf_gsm_a_rr_prio_thr,
9759 { "Prio Thr", "gsm_a.rr.prio_thr",
9760 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_prio_thr_vals), 0x0,
9761 "Prio signal strength threshold is related to RXLEV ACCESS_MIN (Prio Thr)", HFILL }
9762 },
9763 { &hf_gsm_a_rr_lsa_offset,
9764 { "LSA Offset", "gsm_a.rr.lsa_offset",
9765 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_lsa_offset_vals), 0x0,
9766 "Offset to be used for LSA cell re selection between cells with the same LSA priorities (LSA Offset)", HFILL }
9767 },
9768 { &hf_gsm_a_rr_paging_channel_restructuring,
9769 { "Paging Channel Restructuring", "gsm_a.rr.paging_channel_restructuring",
9770 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_paging_channel_restructuring_value), 0x0,
9771 NULL, HFILL }
9772 },
9773 { &hf_gsm_a_rr_nln_sacch,
9774 { "NLN (SACCH)", "gsm_a.rr.nln_sacch",
9775 FT_UINT8, BASE_DEC, NULL, 0x0,
9776 NULL, HFILL }
9777 },
9778 { &hf_gsm_a_rr_nln_status_sacch,
9779 { "NLN Status (SACCH)", "gsm_a.rr.nln_status_sacch",
9780 FT_UINT8, BASE_DEC, NULL, 0x0,
9781 NULL, HFILL }
9782 },
9783 { &hf_gsm_a_rr_nln_pch,
9784 { "NLN (PCH)", "gsm_a.rr.nln_pch",
9785 FT_UINT8, BASE_DEC, NULL, 0x0,
9786 NULL, HFILL }
9787 },
9788 { &hf_gsm_a_rr_nln_status_pch,
9789 { "NLN Status (PCH)", "gsm_a.rr.nln_status_pch",
9790 FT_UINT8, BASE_DEC, NULL, 0x0,
9791 NULL, HFILL }
9792 },
9793 { &hf_gsm_a_rr_vbs_vgcs_inband_notifications,
9794 { "Inband Notifications", "gsm_a.rr.vbs_vgcs_inband_notifications",
9795 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_vbs_vgcs_inband_notifications_value), 0x0,
9796 NULL, HFILL }
9797 },
9798 { &hf_gsm_a_rr_vbs_vgcs_inband_pagings,
9799 { "Inband Pagings", "gsm_a.rr.vbs_vgcs_inband_pagings",
9800 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_vbs_vgcs_inband_pagings_value), 0x0,
9801 NULL, HFILL }
9802 },
9803 { &hf_gsm_a_rr_rac,
9804 { "RAC", "gsm_a.rr.rac",
9805 FT_UINT8, BASE_DEC, NULL, 0x0,
9806 "Routeing Area Code", HFILL }
9807 },
9808 { &hf_gsm_a_rr_max_lapdm,
9809 { "Max LAPDm", "gsm_a.rr.max_lapdm",
9810 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_max_lapdm_vals), 0x0,
9811 "Maximum number of LAPDm frames on which a layer 3 can be segmented into and be sent on the main DCCH (Max LAPDm)", HFILL }
9812 },
9813 { &hf_gsm_a_rr_gprs_ms_txpwr_max_ccch,
9814 { "GPRS MS TxPwr Max CCH", "gsm_a.rr.gprs_ms_txpwr_max_cch",
9815 FT_UINT8, BASE_DEC, NULL, 0x00,
9816 NULL, HFILL }
9817 },
9818 { &hf_gsm_a_rr_dedicated_mode_mbms_notification_support,
9819 { "Dedicated Mode MBMS Notification Support", "gsm_a.rr.dedicated_mode_mbms_notification_support",
9820 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_dedicated_mode_mbms_notification_support_value), 0x0,
9821 NULL, HFILL }
9822 },
9823 { &hf_gsm_a_rr_mnci_support,
9824 { "MNCI Support", "gsm_a.rr.mnci_support",
9825 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_mnci_support_value), 0x0,
9826 "MBMS Neighbouring Cell Information Support (MNCI Support)", HFILL }
9827 },
9828 { &hf_gsm_a_rr_amr_config,
9829 { "AMR Configuration", "gsm_a.rr.amr_config",
9830 FT_UINT8, BASE_DEC, NULL, 0x0,
9831 NULL, HFILL }
9832 },
9833 { &hf_gsm_a_rr_bcch_change_mark,
9834 { "BCCH Change Mark", "gsm_a.rr.bcch_change_mark",
9835 FT_UINT8, BASE_DEC, NULL, 0x0,
9836 NULL, HFILL }
9837 },
9838 { &hf_gsm_a_rr_si_change_field,
9839 { "SI Change Field", "gsm_a.rr.si_change_field",
9840 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_si_change_field_vals), 0x0,
9841 NULL, HFILL }
9842 },
9843 { &hf_gsm_a_rr_si13_change_mark,
9844 { "SI13 Change Mark", "gsm_a.rr.si13_change_mark",
9845 FT_UINT8, BASE_DEC, NULL, 0x0,
9846 NULL, HFILL }
9847 },
9848 { &hf_gsm_a_rr_hsn,
9849 { "HSN", "gsm_a.rr.hsn",
9850 FT_UINT8, BASE_DEC, NULL, 0x0,
9851 "Hopping Sequence Number (HSN)", HFILL }
9852 },
9853 { &hf_gsm_a_rr_rfl_number,
9854 { "RFL Number", "gsm_a.rr.rfl_number",
9855 FT_UINT8, BASE_DEC, NULL, 0x0,
9856 "Radio Frequency List Number (RFL Number)", HFILL }
9857 },
9858 { &hf_gsm_a_rr_arfcn_index,
9859 { "ARFCN Index", "gsm_a.rr.arfcn_index",
9860 FT_UINT8, BASE_DEC, NULL, 0x0,
9861 NULL, HFILL }
9862 },
9863 { &hf_gsm_a_rr_ma_length,
9864 { "MA Length", "gsm_a.rr.ma_length",
9865 FT_UINT8, BASE_DEC, NULL, 0x0,
9866 "Mobile Allocation Length (MA Length)", HFILL }
9867 },
9868 { &hf_gsm_a_rr_psi1_repeat_period,
9869 { "PSI1 Repeat Period", "gsm_a.rr.psi1_repeat_period",
9870 FT_UINT8, BASE_DEC, VALS(&gsm_a_rr_psi1_repeat_period_vals), 0x0,
9871 NULL, HFILL }
9872 },
9873 { &hf_gsm_a_rr_pbcch_pb,
9874 { "Pb", "gsm_a.rr.pbcch_pb",
9875 FT_UINT8, BASE_DEC, VALS(&gsm_a_rr_pbcch_pb_vals), 0x0,
9876 "Power reduction on PBCCH/PCCCH (Pb)", HFILL }
9877 },
9878 { &hf_gsm_a_rr_pbcch_tsc,
9879 { "TSC", "gsm_a.rr.pbcch_tsc",
9880 FT_UINT8, BASE_DEC, NULL, 0x0,
9881 "Training Sequence Code for PBCCH (TSC)", HFILL }
9882 },
9883 { &hf_gsm_a_rr_pbcch_tn,
9884 { "TN", "gsm_a.rr.pbcch_tn",
9885 FT_UINT8, BASE_DEC, NULL, 0x0,
9886 "Timeslot Number for PCCH (TN)", HFILL }
9887 },
9888 { &hf_gsm_a_rr_spgc_ccch_sup,
9889 { "SPGC CCCH Sup", "gsm_a.rr.spgc_ccch_sup",
9890 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_spgc_ccch_sup_value), 0x0,
9891 "Split PG Cycle Code on CCCH Support (SPGC CCCH Sup)", HFILL }
9892 },
9893 { &hf_gsm_a_rr_priority_access_thr,
9894 { "Priority Access Thr", "gsm_a.rr.priority_access_thr",
9895 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_priority_access_thr_vals), 0x0,
9896 "Priority Access Threshold for packet access (Priority Access Thr)", HFILL }
9897 },
9898 { &hf_gsm_a_rr_nmo,
9899 { "NMO", "gsm_a.rr.nmo",
9900 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_nmo_vals), 0x0,
9901 "Network mode of Operation (NMO)", HFILL }
9902 },
9903 { &hf_gsm_a_rr_t3168,
9904 { "T3168", "gsm_a.rr.t3168",
9905 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_t3168_vals), 0x0,
9906 NULL, HFILL }
9907 },
9908 { &hf_gsm_a_rr_t3192,
9909 { "T3192", "gsm_a.rr.t3192",
9910 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_t3192_vals), 0x0,
9911 NULL, HFILL }
9912 },
9913 { &hf_gsm_a_rr_drx_timer_max,
9914 { "DRX Timer Max", "gsm_a.rr.drx_timer_max",
9915 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_drx_timer_max_vals), 0x0,
9916 "Discontinuous Reception Timer Max (DRX Timer Max)", HFILL }
9917 },
9918 { &hf_gsm_a_rr_access_burst_type,
9919 { "Access Burst Type", "gsm_a.rr.access_burst_type",
9920 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_access_burst_type_value), 0x0,
9921 "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 }
9922 },
9923 { &hf_gsm_a_rr_control_ack_type,
9924 { "Control Ack Type", "gsm_a.rr.control_ack_type",
9925 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_control_ack_type_value), 0x0,
9926 "Default format of the PACKET CONTROL ACKNOWLEDGMENT message (Control Ack Type)", HFILL }
9927 },
9928 { &hf_gsm_a_rr_bs_cv_max,
9929 { "BS CV Max", "gsm_a.rr.bs_cv_max",
9930 FT_UINT8, BASE_DEC, NULL, 0x0,
9931 "Base Station Countdown Value Maximum (BS CV Max)", HFILL }
9932 },
9933 { &hf_gsm_a_rr_pan_dec,
9934 { "PAN Dec", "gsm_a.rr.pan_dec",
9935 FT_UINT8, BASE_DEC, NULL, 0x0,
9936 NULL, HFILL }
9937 },
9938 { &hf_gsm_a_rr_pan_inc,
9939 { "PAN Inc", "gsm_a.rr.pan_inc",
9940 FT_UINT8, BASE_DEC, NULL, 0x0,
9941 NULL, HFILL }
9942 },
9943 { &hf_gsm_a_rr_pan_max,
9944 { "PAN Max", "gsm_a.rr.pan_max",
9945 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_pan_max_vals), 0x0,
9946 NULL, HFILL }
9947 },
9948 { &hf_gsm_a_rr_egprs_packet_channel_request,
9949 { "EGPRS Packet Channel Request", "gsm_a.rr.egprs_packet_channel_request",
9950 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_egprs_packet_channel_request_value), 0x0,
9951 NULL, HFILL }
9952 },
9953 { &hf_gsm_a_rr_bep_period,
9954 { "BEP Period", "gsm_a.rr.bep_period",
9955 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_bep_period_vals), 0x0,
9956 NULL, HFILL }
9957 },
9958 { &hf_gsm_a_rr_pfc_feature_mode,
9959 { "PFC Feature Mode", "gsm_a.rr.pfc_feature_mode",
9960 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_pfc_feature_mode_value), 0x0,
9961 "Packet Flow Context Feature Mode (PFC Feature Mode)", HFILL }
9962 },
9963 { &hf_gsm_a_rr_dtm_support,
9964 { "DTM Support", "gsm_a.rr.dtm_support",
9965 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_dtm_support_value), 0x0,
9966 "Dual Transfer Mode Support (DTM Support)", HFILL }
9967 },
9968 { &hf_gsm_a_rr_bss_paging_coordination,
9969 { "BSS Paging Coordination", "gsm_a.rr.bss_paging_coordination",
9970 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_bss_paging_coordination_value), 0x0,
9971 NULL, HFILL }
9972 },
9973 { &hf_gsm_a_rr_ccn_active,
9974 { "CCN Active", "gsm_a.rr.ccn_active",
9975 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_ccn_active_value), 0x0,
9976 NULL, HFILL }
9977 },
9978 { &hf_gsm_a_rr_nw_ext_utbf,
9979 { "NW Ext UTBF", "gsm_a.rr.nw_ext_utbf",
9980 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_nw_ext_utbf_value), 0x0,
9981 "Network Extended Uplink TBF (NW Ext UTBF)", HFILL }
9982 },
9983 { &hf_gsm_a_rr_multiple_tbf_capability,
9984 { "Multiple TBF Capability", "gsm_a.rr.multiple_tbf_capability",
9985 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_multiple_tbf_capability_value), 0x0,
9986 NULL, HFILL }
9987 },
9988 { &hf_gsm_a_rr_ext_utbf_no_data,
9989 { "Ext UTBF No Data", "gsm_a.rr.ext_utbf_no_data",
9990 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_ext_utbf_no_data_value), 0x0,
9991 NULL, HFILL }
9992 },
9993 { &hf_gsm_a_rr_dtm_enhancements_capability,
9994 { "DTM Enhancements Capability", "gsm_a.rr.dtm_enhancements_capability",
9995 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_dtm_enhancements_capability_value), 0x0,
9996 NULL, HFILL }
9997 },
9998 { &hf_gsm_a_rr_reduced_latency_access,
9999 { "Reduced Latency Access", "gsm_a.rr.reduced_latency_access",
10000 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_reduced_latency_access_value), 0x0,
10001 NULL, HFILL }
10002 },
10003 { &hf_gsm_a_rr_alpha,
10004 { "Alpha", "gsm_a.rr.alpha",
10005 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_alpha_vals), 0x0,
10006 "Alpha parameter for GPR MS output power control (Alpha)", HFILL }
10007 },
10008 { &hf_gsm_a_rr_t_avg_w,
10009 { "T Avg W", "gsm_a.rr.t_avg_w",
10010 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_t_avg_x_vals), 0x0,
10011 "Signal strength filter period for power control in packet idle mode", HFILL }
10012 },
10013 { &hf_gsm_a_rr_t_avg_t,
10014 { "T Avg T", "gsm_a.rr.t_avg_t",
10015 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_t_avg_x_vals), 0x0,
10016 "Signal strength filter period for power control in packet transfer mode", HFILL }
10017 },
10018 { &hf_gsm_a_rr_pc_meas_chan,
10019 { "PC Meas Chan", "gsm_a.rr.pc_meas_chan",
10020 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_pc_meas_chan_value), 0x0,
10021 "Channel used to measure the received power level on the downlink for the purpose of the uplink power control (PC Meas Chan)", HFILL }
10022 },
10023 { &hf_gsm_a_rr_n_avg_i,
10024 { "N Avg I", "gsm_a.rr.n_avg_i",
10025 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_n_avg_i_vals), 0x0,
10026 "Interfering signal strength filter constant for power control (N Avg I)", HFILL }
10027 },
10028 { &hf_gsm_a_rr_sgsnr,
10029 { "SGSNR", "gsm_a.rr.sgsnr",
10030 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_sgsnr_value), 0x0,
10031 "SGSN Release (SGSNR)", HFILL }
10032 },
10033 { &hf_gsm_a_rr_si_status_ind,
10034 { "SI Status Ind", "gsm_a.rr.si_status_ind",
10035 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_si_status_ind_value), 0x0,
10036 NULL, HFILL }
10037 },
10038 { &hf_gsm_a_rr_lb_ms_txpwr_max_cch,
10039 { "LB MS TxPwr Max CCCH", "gsm_a.rr.n_avg_i",
10040 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_n_avg_i_vals), 0x0,
10041 "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 }
10042 },
10043 { &hf_gsm_a_rr_si2n_support,
10044 { "SI2n Support", "gsm_a.rr.si2n_support",
10045 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_si2n_support_vals), 0x0,
10046 NULL, HFILL }
10047 },
10048 { &hf_gsm_a_rr_mi_index,
10049 { "Measurement Information Index", "gsm_a.rr.mi_index",
10050 FT_UINT8, BASE_DEC, NULL, 0x0,
10051 NULL, HFILL }
10052 },
10053 { &hf_gsm_a_rr_mi_count,
10054 { "Measurement Information Count", "gsm_a.rr.mi_count",
10055 FT_UINT8, BASE_DEC, NULL, 0x0,
10056 NULL, HFILL }
10057 },
10058 { &hf_gsm_a_rr_3g_wait,
10059 { "3G Wait", "gsm_a.rr.3g_wait",
10060 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_3g_wait_vals), 0x0,
10061 NULL, HFILL }
10062 },
10063 { &hf_gsm_a_rr_qsearch_c,
10064 { "Qsearch C", "gsm_a.rr.qsearch_c",
10065 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_qsearch_x_vals), 0x00,
10066 "Search for 3G cells if signal level is below (0 7) or above (8 15) threshold (Qsearch C)", HFILL }
10067 },
10068 { &hf_gsm_a_rr_bsic_seen,
10069 { "BSIC Seen", "gsm_a.rr.bsic_seen",
10070 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_bsic_seen_value), 0x0,
10071 NULL, HFILL }
10072 },
10073 { &hf_gsm_a_rr_scale,
10074 { "Scale", "gsm_a.rr.scale",
10075 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_rr_scale_value), 0x0,
10076 "Offset applied for the reported RXLEV values (Scale)", HFILL }
10077 },
10078 { &hf_gsm_a_rr_mean_bep_gmsk,
10079 { "Mean BEP GMSK", "gsm_a.rr.mean_bep_gmsk",
10080 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_mean_bep_gmsk_vals), 0x00,
10081 "Mean Bit Error Probability in GMSK (Mean BEP GMSK)", HFILL }
10082 },
10083 { &hf_gsm_a_rr_mean_cv_bep,
10084 { "CV BEP", "gsm_a.rr.cv_bep",
10085 FT_UINT8, BASE_DEC, VALS(gsm_a_rr_cv_bep_vals), 0x00,
10086 "Coefficient of Variation of the Bit Error Probability (CV BEP)", HFILL }
10087 },
10088 { &hf_gsm_a_rr_nbr_rcvd_blocks,
10089 { "Nb Rcvd Blocks", "gsm_a.rr.nbr_rcvd_blocks",
10090 FT_UINT8, BASE_DEC, NULL, 0x00,
10091 "Number of correctly decoded blocks that were completed during the measurement report period (Nb Rcvd Blocks)", HFILL }
10092 },
10093 { &hf_gsm_a_rr_reporting_quantity,
10094 { "Reporting Quantity", "gsm_a.rr.reporting_quantity",
10095 FT_UINT8, BASE_DEC, NULL, 0x00,
10096 NULL, HFILL }
10097 }
10098 };
10099
10100 static hf_register_info hf_sacch[] =
10101 {
10102 { &hf_gsm_a_sacch_msg_rr_type,
10103 { "SACCH Radio Resources Management Message Type", "gsm_a.sacch_msg_rr_type",
10104 FT_UINT8, BASE_HEX, VALS(gsm_a_sacch_msg_rr_strings), 0x0,
10105 NULL, HFILL }
10106 }
10107 };
10108
10109 /* Setup protocol subtree array */
10110#define NUM_INDIVIDUAL_ELEMS 3
10111 static gint *ett[NUM_INDIVIDUAL_ELEMS +
10112 NUM_GSM_DTAP_MSG_RR +
10113 NUM_GSM_RR_ELEM +
10114 NUM_GSM_RR_REST_OCTETS_ELEM +
10115 NUM_GSM_SACCH_MSG_RR];
10116
10117 ett[0] = &ett_ccch_msg;
10118 ett[1] = &ett_ccch_oct_1;
10119 ett[2] = &ett_sacch_msg;
10120
10121 last_offset = NUM_INDIVIDUAL_ELEMS;
10122
10123 for (i=0; i < NUM_GSM_DTAP_MSG_RR; i++, last_offset++)
10124 {
10125 ett_gsm_dtap_msg_rr[i] = -1;
10126 ett[last_offset] = &ett_gsm_dtap_msg_rr[i];
10127 }
10128
10129 for (i=0; i < NUM_GSM_RR_ELEM; i++, last_offset++)
10130 {
10131 ett_gsm_rr_elem[i] = -1;
10132 ett[last_offset] = &ett_gsm_rr_elem[i];
10133 }
10134
10135 for (i=0; i < NUM_GSM_RR_REST_OCTETS_ELEM; i++, last_offset++)
10136 {
10137 ett_gsm_rr_rest_octets_elem[i] = -1;
10138 ett[last_offset] = &ett_gsm_rr_rest_octets_elem[i];
10139 }
10140
10141 for (i=0; i < NUM_GSM_SACCH_MSG_RR; i++, last_offset++)
10142 {
10143 ett_gsm_sacch_msg_rr[i] = -1;
10144 ett[last_offset] = &ett_gsm_sacch_msg_rr[i];
10145 }
10146
10147 /* Register the protocol name and description */
10148 proto_a_ccch =
10149 proto_register_protocol("GSM CCCH", "GSM CCCH", "gsm_a_ccch");
10150
10151 proto_register_field_array(proto_a_ccch, hf, array_length(hf));
10152
10153 /* subdissector code */
10154 register_dissector("gsm_a_ccch", dissect_ccch, proto_a_ccch);
10155
10156 /* Register the protocol name and description */
10157 proto_a_sacch =
10158 proto_register_protocol("GSM SACCH", "GSM SACCH", "gsm_a_sacch");
10159
10160 proto_register_field_array(proto_a_sacch, hf_sacch, array_length(hf_sacch));
10161
10162 /* subdissector code */
10163 register_dissector("gsm_a_sacch", dissect_sacch, proto_a_sacch);
10164
10165 /* subtree array (for both sub-dissectors) */
10166 proto_register_subtree_array(ett, array_length(ett));
10167}
10168
10169void
10170proto_reg_handoff_gsm_a_rr(void)
10171{
10172 data_handle = find_dissector("data");
10173 rrc_irat_ho_info_handle = find_dissector("rrc.irat.irat_ho_info");
10174 rrc_irat_ho_to_utran_cmd_handle = find_dissector("rrc.irat.ho_to_utran_cmd");
10175 rrlp_dissector = find_dissector("rrlp");
10176}