Fixed abbrev for "Channel rate and type".
[obnox/wireshark/wip.git] / epan / dissectors / packet-rsl.c
1 /* packet-rsl.c
2  * Routines for Radio Signalling Link (RSL) dissection.
3  *
4  * Copyright 2007, 2011, Anders Broman <anders.broman@ericsson.com>
5  *
6  * $Id$
7  *
8  * Wireshark - Network traffic analyzer
9  * By Gerald Combs <gerald@wireshark.org>
10  * Copyright 1998 Gerald Combs
11  *
12  * Copied from packet-cops.c
13  *
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * as published by the Free Software Foundation; either version 2
17  * of the License, or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
27  *
28  * REF: 3GPP TS 48.058 version 6.1.0 Release 6
29  * http://www.3gpp.org/ftp/Specs/html-info/48058.htm
30  *
31  */
32
33 #ifdef HAVE_CONFIG_H
34 # include "config.h"
35 #endif
36
37 #include <stdlib.h>
38 #include <ctype.h>
39
40 #include <epan/packet.h>
41 #include <epan/lapd_sapi.h>
42
43 #include "packet-gsm_a_common.h"
44
45 /* Initialize the protocol and registered fields */
46 static int proto_rsl        = -1;
47
48 static int hf_rsl_msg_type          = -1;
49 static int hf_rsl_T_bit             = -1;
50 static int hf_rsl_msg_dsc           = -1;
51 static int hf_rsl_ie_id             = -1;
52 static int hf_rsl_ie_length         = -1;
53 static int hf_rsl_ch_no_Cbits       = -1;
54 static int hf_rsl_ch_no_TN          = -1;
55 static int hf_rsl_acc_delay         = -1;
56 static int hf_rsl_rach_slot_cnt     = -1;
57 static int hf_rsl_rach_busy_cnt     = -1;
58 static int hf_rsl_rach_acc_cnt      = -1;
59 static int hf_rsl_req_ref_ra        = -1;
60 static int hf_rsl_req_ref_T1prim    = -1;
61 static int hf_rsl_req_ref_T3        = -1;
62 static int hf_rsl_req_ref_T2        = -1;
63 static int hf_rsl_timing_adv        = -1;
64 static int hf_rsl_ho_ref            = -1;
65 static int hf_rsl_l1inf_power_lev       = -1;
66 static int hf_rsl_l1inf_fpc         = -1;
67 static int hf_rsl_ms_power_lev      = -1;
68 static int hf_rsl_ms_fpc            = -1;
69 static int hf_rsl_act_timing_adv    = -1;
70 static int hf_rsl_phy_ctx           = -1;
71 static int hf_rsl_na                = -1;
72 static int hf_rsl_ch_type           = -1;
73 static int hf_rsl_prio              = -1;
74 static int hf_rsl_sapi              = -1;
75 static int hf_rsl_rbit              = -1;
76 static int hf_rsl_a3a2              = -1;
77 static int hf_rsl_a1_0              = -1;
78 static int hf_rsl_a1_1              = -1;
79 static int hf_rsl_a1_2              = -1;
80 static int hf_rsl_epc_mode          = -1;
81 static int hf_rsl_bs_fpc_epc_mode   = -1;
82 static int hf_rsl_bs_power          = -1;
83 static int hf_rsl_cm_dtxd           = -1;
84 static int hf_rsl_cm_dtxu           = -1;
85 static int hf_rsl_speech_or_data    = -1;
86 static int hf_rsl_ch_rate_and_type  = -1;
87 static int hf_rsl_speech_coding_alg = -1;
88 static int hf_rsl_t_nt_bit          = -1;
89 static int hf_rsl_ra_if_data_rte    = -1;
90 static int hf_rsl_data_rte          = -1;
91 static int hf_rsl_alg_id            = -1;
92 static int hf_rsl_key               = -1;
93 static int hf_rsl_cause             = -1;
94 static int hf_rsl_rel_mode          = -1;
95 static int hf_rsl_interf_band       = -1;
96 static int hf_rsl_interf_band_reserved = -1;
97 static int hf_rsl_meas_res_no       = -1;
98 static int hf_rsl_extension_bit     = -1;
99 static int hf_rsl_dtxd              = -1;
100 static int hf_rsl_rxlev_full_up     = -1;
101 static int hf_rsl_rxlev_sub_up      = -1;
102 static int hf_rsl_rxqual_full_up    = -1;
103 static int hf_rsl_rxqual_sub_up     = -1;
104 static int hf_rsl_class             = -1;
105 static int hf_rsl_paging_grp        = -1;
106 static int hf_rsl_paging_load       = -1;
107 static int hf_rsl_sys_info_type     = -1;
108 static int hf_rsl_timing_offset     = -1;
109 static int hf_rsl_ch_needed         = -1;
110 static int hf_rsl_cbch_load_type    = -1;
111 static int hf_rsl_msg_slt_cnt       = -1;
112 static int hf_rsl_ch_ind            = -1;
113 static int hf_rsl_command           = -1;
114 static int hf_rsl_emlpp_prio        = -1;
115 static int hf_rsl_rtd               = -1;
116 static int hf_rsl_delay_ind         = -1;
117 static int hf_rsl_tfo               = -1;
118
119 /* Initialize the subtree pointers */
120 static int ett_rsl = -1;
121 static int ett_ie_link_id = -1;
122 static int ett_ie_act_type = -1;
123 static int ett_ie_bs_power = -1;
124 static int ett_ie_ch_id = -1;
125 static int ett_ie_ch_mode = -1;
126 static int ett_ie_enc_inf = -1;
127 static int ett_ie_ch_no = -1;
128 static int ett_ie_frame_no = -1;
129 static int ett_ie_ho_ref = -1;
130 static int ett_ie_l1_inf = -1;
131 static int ett_ie_L3_inf = -1;
132 static int ett_ie_ms_id = -1;
133 static int ett_ie_ms_pow = -1;
134 static int ett_ie_phy_ctx = -1;
135 static int ett_ie_paging_grp = -1;
136 static int ett_ie_paging_load = -1;
137 static int ett_ie_access_delay = -1;
138 static int ett_ie_rach_load = -1;
139 static int ett_ie_req_ref = -1;
140 static int ett_ie_rel_mode = -1;
141 static int ett_ie_resource_inf = -1;
142 static int ett_ie_rlm_cause =-1;
143 static int ett_ie_staring_time = -1;
144 static int ett_ie_timing_adv = -1;
145 static int ett_ie_uplink_meas = -1;
146 static int ett_ie_full_imm_ass_inf = -1;
147 static int ett_ie_smscb_inf = -1;
148 static int ett_ie_ms_timing_offset = -1;
149 static int ett_ie_err_msg = -1;
150 static int ett_ie_full_bcch_inf = -1;
151 static int ett_ie_ch_needed = -1;
152 static int ett_ie_cb_cmd_type = -1;
153 static int ett_ie_smscb_mess = -1;
154 static int ett_ie_cbch_load_inf = -1;
155 static int ett_ie_smscb_ch_ind = -1;
156 static int ett_ie_grp_call_ref = -1;
157 static int ett_ie_ch_desc = -1;
158 static int ett_ie_nch_drx = -1;
159 static int ett_ie_cmd_ind = -1;
160 static int ett_ie_emlpp_prio = -1;
161 static int ett_ie_uic = -1;
162 static int ett_ie_main_ch_ref = -1;
163 static int ett_ie_multirate_conf = -1;
164 static int ett_ie_multirate_cntrl = -1;
165 static int ett_ie_sup_codec_types = -1;
166 static int ett_ie_codec_conf = -1;
167 static int ett_ie_rtd = -1;
168 static int ett_ie_tfo_status = -1;
169 static int ett_ie_llp_apdu = -1;
170 static int ett_ie_tfo_transp_cont = -1;
171 static int ett_ie_cause = -1;
172 static int ett_ie_meas_res_no = -1;
173 static int ett_ie_message_id = -1;
174 static int ett_ie_sys_info_type = -1;
175
176 static proto_tree *top_tree;
177 static dissector_handle_t gsm_a_ccch_handle;
178 static dissector_handle_t gsm_a_dtap_handle;
179
180 static gboolean is_si2q = FALSE;
181
182 /* Forward declarations */
183 static int dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset);
184
185 static const true_false_string rsl_t_bit_vals = {
186   "Considered transparent by BTS",
187   "Not considered transparent by BTS"
188 };
189
190 static const true_false_string rsl_na_vals = {
191   "Not Applicable",
192   "Applicable"
193 };
194
195 static const true_false_string rsl_extension_bit_value = {
196   "Extension",
197   "No Extension"
198 };
199
200 /*
201  * 9.1 Message discriminator
202  */
203  /* Radio link Layer Management Messages */
204 static const value_string rsl_msg_disc_vals[] = {
205     {  0x00,        "Reserved" },
206     {  0x01,        "Radio Link Layer Management messages" },
207     {  0x04,        "Dedicated Channel Management messages" },
208     {  0x06,        "Common Channel Management messages" },
209     {  0x08,        "TRX Management messages" },
210     {  0x16,        "Location Services messages" },
211     { 0,            NULL }
212 };
213 /*
214  * 9.2 MESSAGE TYPE
215  */
216 /* Radio link Layer Management Messages */
217 #define RSL_MSG_TYPE_DATA_REQ       1   /* 0x01 */
218 #define RSL_MSG_TYPE_DATA_IND       2   /* 0x02 */
219 #define RSL_MSG_TYPE_ERROR_IND      3   /* 0x03 */
220 #define RSL_MSG_TYPE_EST_REQ        4   /* 0x04 */
221 #define RSL_MSG_TYPE_EST_CONF       5   /* 0x05 */
222 #define RSL_MSG_EST_IND             6   /* 0x06 */
223 #define RSL_MSG_REL_REQ             7   /* 0x07 */
224 #define RSL_MSG_REL_CONF            8   /* 0x08 */
225 #define RSL_MSG_REL_IND             9   /* 0x09 */
226 #define RSL_MSG_UNIT_DATA_REQ       10  /* 0x0a */
227 /* Common Channel Management messages */
228 #define RSL_MSG_BCCH_INFO           17  /* 0x11 */
229 #define RSL_MSG_CCCH_LOAD_IND       18  /* 0x12 */
230 #define RSL_MSG_CHANRQD             19  /* 0x13 */
231 #define RSL_MSG_DELETE_IND          20  /* 0x14 */
232 #define RSL_MSG_PAGING_CMD          21  /* 0x15 */
233 #define RSL_MSG_IMM_ASS_CMD         22  /* 0x16 */
234 #define RSL_MSG_SMS_BC_REQ          23  /* 0x17 8.5.7 */
235 #define RSL_MSG_RF_RES_IND          25  /* 8.6.1 */
236 #define RSL_MSG_SACCH_FILL          26  /* 8.6.2 */
237
238 #define RSL_MSG_OVERLOAD            27  /* 8.6.3 */
239 #define RSL_MSG_ERROR_REPORT        28  /* 8.6.4 */
240 #define RSL_MSG_SMS_BC_CMD          29  /* 8.5.8 */
241 #define RSL_MSG_CBCH_LOAD_IND       30  /* 8.5.9 */
242 #define RSL_MSG_NOT_CMD             31  /* 8.5.10 */
243
244 /* 0 0 1 - - - - - Dedicated Channel Management messages: */
245 #define RSL_MSG_CHAN_ACTIV          33
246 #define RSL_MSG_CHAN_ACTIV_ACK      34
247 #define RSL_MSG_CHAN_ACTIV_N_ACK    35
248 #define RSL_MSG_CONN_FAIL           36
249 #define RSL_MSG_DEACTIVATE_SACCH    37
250
251 #define RSL_MSG_ENCR_CMD                38  /* 8.4.6 */
252 #define RSL_MSG_HANDODET                39  /* 8.4.7 */
253 #define RSL_MSG_MEAS_RES                40  /* 8.4.8 */
254 #define RSL_MSG_MODE_MODIFY_REQ         41  /* 8.4.9 */
255 #define RSL_MSG_MODE_MODIFY_ACK         42  /* 8.4.10 */
256 #define RSL_MSG_MODE_MODIFY_NACK        43  /* 8.4.11 */
257 #define RSL_MSG_PHY_CONTEXT_REQ         44  /* 8.4.12 */
258 #define RSL_MSG_PHY_CONTEXT_CONF        45  /* 8.4.13 */
259 #define RSL_MSG_RF_CHAN_REL             46  /* 8.4.14 */
260 #define RSL_MSG_MS_POWER_CONTROL        47  /* 8.4.15 */
261 #define RSL_MSG_BS_POWER_CONTROL        48  /* 8.4.16 */
262 #define RSL_MSG_PREPROC_CONFIG          49  /* 8.4.17 */
263 #define RSL_MSG_PREPROC_MEAS_RES        50  /* 8.4.18 */
264 #define RSL_MSG_RF_CHAN_REL_ACK         51  /* 8.4.19 */
265 #define RSL_MSG_SACCH_INFO_MODIFY       52  /* 8.4.20 */
266 #define RSL_MSG_TALKER_DET              53  /* 8.4.21 */
267 #define RSL_MSG_LISTENER_DET            54  /* 8.4.22 */
268 #define RSL_MSG_REMOTE_CODEC_CONF_REP   55  /* 8.4.23 */
269 #define RSL_MSG_R_T_D_REP               56  /* 8.4.24 */
270 #define RSL_MSG_PRE_HANDO_NOTIF         57  /* 8.4.25 */
271 #define RSL_MSG_MR_CODEC_MOD_REQ        58  /* 8.4.26 */
272 #define RSL_MSG_MR_CODEC_MOD_ACK        59  /* 8.4.27 */
273 #define RSL_MSG_MR_CODEC_MOD_NACK       60  /* 8.4.28 */
274 #define RSL_MSG_MR_CODEC_MOD_PER        61  /* 8.4.29 */
275 #define RSL_MSG_TFO_REP                 62  /* 8.4.30 */
276 #define RSL_MSG_TFO_MOD_REQ             63  /* 8.4.31 */
277     /*  0 1 - - - - - - Location Services messages: */
278 #define RSL_MSG_LOC_INF                 65  /* 8.7.1 */
279
280
281 static const value_string rsl_msg_type_vals[] = {
282       /*    0 0 0 0 - - - - Radio Link Layer Management messages: */
283     {  0x01,    "DATA REQuest" },                               /* 8.3.1 */
284     {  0x02,    "DATA INDication" },                            /* 8.3.2 */
285     {  0x03,    "ERROR INDication" },                           /* 8.3.3 */
286     {  0x04,    "ESTablish REQuest" },                          /* 8.3.4 */
287     {  0x05,    "ESTablish CONFirm" },                          /* 8.3.5 */
288     {  0x06,    "ESTablish INDication" },                       /* 8.3.6 */
289     {  0x07,    "RELease REQuest" },                            /* 8.3.7 */
290     {  0x08,    "RELease CONFirm" },                            /* 8.3.8 */
291     {  0x09,    "RELease INDication" },                         /* 8.3.9 */
292     {  0x0a,    "UNIT DATA REQuest" },                          /* 8.3.10 */
293     /* 0 0 0 1 - - - - Common Channel Management/TRX Management messages: */
294     {  0x11,    "BCCH INFOrmation" },                           /* 8.5.1 */
295     {  0x12,    "CCCH LOAD INDication" },                       /* 8.5.2 */
296     {  0x13,    "CHANnel ReQuireD" },                           /* 8.5.3 */
297     {  0x14,    "DELETE INDication" },                          /* 8.5.4 */
298     {  0x15,    "PAGING CoMmanD" },                             /* 8.5.5 */
299     {  0x16,    "IMMEDIATE ASSIGN COMMAND" },                   /* 8.5.6 */
300     {  0x17,    "SMS BroadCast REQuest" },                      /* 8.5.7 */
301     {  0x19,    "RF RESource INDication" },                     /* 8.6.1 */
302     {  0x1a,    "SACCH FILLing" },                              /* 8.6.2 */
303     {  0x1b,    "OVERLOAD" },                                   /* 8.6.3 */
304     {  0x1c,    "ERROR REPORT" },                               /* 8.6.4 */
305     {  0x1d,    "SMS BroadCast CoMmanD" },                      /* 8.5.8 */
306     {  0x1e,    "CBCH LOAD INDication" },                       /* 8.5.9 */
307     {  0x1f,    "NOTification CoMmanD" },                       /* 8.5.10 */
308     /* 0 0 1 - - - - - Dedicated Channel Management messages: */
309     {  0x21,    "CHANnel ACTIVation" },                         /* 8.4.1 */
310     {  0x22,    "CHANnel ACTIVation ACKnowledge" },             /* 8.4.2 */
311     {  0x23,    "CHANnel ACTIVation Negative ACK" },            /* 8.4.3 */
312     {  0x24,    "CONNection FAILure" },                         /* 8.4.4 */
313     {  0x25,    "DEACTIVATE SACCH" },                           /* 8.4.5 */
314     {  0x26,    "ENCRyption CoMmanD" },                         /* 8.4.6 */
315     {  0x27,    "HANDOver DETection" },                         /* 8.4.7 */
316     {  0x28,    "MEASurement RESult" },                         /* 8.4.8 */
317     {  0x29,    "MODE MODIFY REQuest" },                        /* 8.4.9 */
318     {  0x2a,    "MODE MODIFY ACKnowledge" },                    /* 8.4.10 */
319     {  0x2b,    "MODE MODIFY Negative ACKnowledge" },           /* 8.4.11 */
320     {  0x2c,    "PHYsical CONTEXT REQuest" },                   /* 8.4.12 */
321     {  0x2d,    "PHYsical CONTEXT CONFirm" },                   /* 8.4.13 */
322     {  0x2e,    "RF CHANnel RELease" },                         /* 8.4.14 */
323     {  0x2f,    "MS POWER CONTROL" },                           /* 8.4.15 */
324     {  0x30,    "BS POWER CONTROL" },                           /* 8.4.16 */
325     {  0x31,    "PREPROCess CONFIGure" },                       /* 8.4.17 */
326     {  0x32,    "PREPROCessed MEASurement RESult" },            /* 8.4.18 */
327     {  0x33,    "RF CHANnel RELease ACKnowledge" },             /* 8.4.19 */
328     {  0x34,    "SACCH INFO MODIFY" },                          /* 8.4.20 */
329     {  0x35,    "TALKER DETection" },                           /* 8.4.21 */
330     {  0x36,    "LISTENER DETection" },                         /* 8.4.22 */
331     {  0x37,    "REMOTE CODEC CONFiguration REPort" },          /* 8.4.23 */
332     {  0x38,    "Round Trip Delay REPort" },                    /* 8.4.24 */
333     {  0x39,    "PRE-HANDOver NOTIFication" },                  /* 8.4.25 */
334     {  0x3a,    "MultiRate CODEC MODification REQest" },        /* 8.4.26 */
335     {  0x3b,    "MultiRate CODEC MOD ACKnowledge" },            /* 8.4.27 */
336     {  0x3c,    "MultiRate CODEC MOD Negative ACKnowledge" },   /* 8.4.28 */
337     {  0x3d,    "MultiRate CODEC MOD PERformed" },              /* 8.4.29 */
338     {  0x3e,    "TFO REPort" },                                 /* 8.4.30 */
339     {  0x3f,    "TFO MODification REQuest" },                   /* 8.4.31 */
340     /*  0 1 - - - - - - Location Services messages: */
341     {  0x41,    "Location Information" },                       /* 8.7.1 */
342     { 0,        NULL }
343 };
344
345 #define RSL_IE_CH_NO            1
346 #define RSL_IE_LINK_ID          2
347 #define RSL_IE_ACT_TYPE         3
348 #define RSL_IE_BS_POW           4
349 #define RSL_IE_CH_ID            5
350 #define RSL_IE_CH_MODE          6
351 #define RSL_IE_ENC_INF          7
352 #define RSL_IE_FRAME_NO         8
353 #define RSL_IE_HO_REF           9
354 #define RSL_IE_L1_INF           10
355 #define RSL_IE_L3_INF           11
356 #define RSL_IE_MS_ID            12
357 #define RSL_IE_MS_POW           13
358 #define RSL_IE_PAGING_GRP       14
359 #define RSL_IE_PAGING_LOAD      15
360 #define RSL_IE_PHY_CTX          16
361 #define RSL_IE_ACCESS_DELAY     17
362 #define RSL_IE_RACH_LOAD        18
363 #define RSL_IE_REQ_REF          19
364 #define RSL_IE_REL_MODE         20
365 #define RSL_IE_RESOURCE_INF     21
366 #define RSL_IE_RLM_CAUSE        22
367 #define RSL_IE_STARTING_TIME    23
368 #define RSL_IE_TIMING_ADV       24
369 #define RSL_IE_UPLINK_MEAS      25
370 #define RSL_IE_CAUSE            26
371 #define RSL_IE_MEAS_RES_NO      27
372 #define RSL_IE_MESSAGE_ID       28
373
374 #define RSL_IE_SYS_INFO_TYPE    30
375
376
377
378
379 #define RSL_IE_FULL_IMM_ASS_INF         35
380 #define RSL_IE_SMSCB_INF                36
381 #define RSL_IE_FULL_MS_TIMING_OFFSET    37
382 #define RSL_IE_ERR_MSG                  38
383 #define RSL_IE_FULL_BCCH_INF            39
384 #define RSL_IE_CH_NEEDED                40
385 #define RSL_IE_CB_CMD_TYPE              41
386 #define RSL_IE_SMSCB_MESS               42
387 #define RSL_IE_CBCH_LOAD_INF            43
388
389
390 #define RSL_IE_SMSCB_CH_IND             46
391 #define RSL_IE_GRP_CALL_REF             47
392 #define RSL_IE_CH_DESC                  48
393 #define RSL_IE_NCH_DRX_INF              49
394 #define RSL_IE_CMD_IND                  50
395 #define RSL_IE_EMLPP_PRIO               51
396 #define RSL_IE_UIC                      52
397 #define RSL_IE_MAIN_CH_REF              53
398 #define RSL_IE_MULTIRATE_CONF           54
399 #define RSL_IE_MULTIRATE_CNTRL          55
400 #define RSL_IE_SUP_CODEC_TYPES          56
401 #define RSL_IE_CODEC_CONF               57
402 #define RSL_IE_RTD                      58
403 #define RSL_IE_TFO_STATUS               59
404 #define RSL_IE_LLP_APDU                 60
405 #define RSL_IE_TFO_TRANSP_CONT          61
406
407 static const value_string rsl_ie_type_vals[] = {
408     {  0x01,    "Channel Number" },             /*  9.3.1 */
409     {  0x02,    "Link Identifier" },            /*  9.3.2 */
410     {  0x03,    "Activation Type" },            /*  9.3.3 */
411     {  0x04,    "BS Power" },                   /*  9.3.4 */
412     {  0x05,    "Channel Identification" },     /*  9.3.5 */
413     {  0x06,    "Channel Mode" },               /*  9.3.6 */
414     {  0x07,    "Encryption Information" },     /*  9.3.7 */
415     {  0x08,    "Frame Number" },               /*  9.3.8 */
416     {  0x09,    "Handover Reference" },         /*  9.3.9 */
417     {  0x0a,    "L1 Information" },             /*  9.3.10 */
418     {  0x0b,    "L3 Information" },             /*  9.3.11 */
419     {  0x0c,    "MS Identity" },                /*  9.3.12 */
420     {  0x0d,    "MS Power" },                   /*  9.3.13 */
421     {  0x0e,    "Paging Group" },               /*  9.3.14 */
422     {  0x0f,    "Paging Load" },                /*  9.3.15 */
423     {  0x10,    "Physical Context" },           /*  9.3.16 */
424     {  0x11,    "Access Delay" },               /*  9.3.17 */
425     {  0x12,    "RACH Load" },                  /*  9.3.18 */
426     {  0x13,    "Request Reference" },          /*  9.3.19 */
427     {  0x14,    "Release Mode" },               /*  9.3.20 */
428     {  0x15,    "Resource Information" },       /*  9.3.21 */
429     {  0x16,    "RLM Cause" },                  /*  9.3.22 */
430     {  0x17,    "Starting Time" },              /*  9.3.23 */
431     {  0x18,    "Timing Advance" },             /*  9.3.24 */
432     {  0x19,    "Uplink Measurements" },        /*  9.3.25 */
433     {  0x1a,    "Cause" },                      /*  9.3.26 */
434     {  0x1b,    "Measurement Result Number" },  /*  9.3.27 */
435     {  0x1c,    "Message Identifier" },         /*  9.3.28 */
436     {  0x1d,    "reserved" },                   /*  */
437     {  0x1e,    "System Info Type" },           /*  9.3.30 */
438     {  0x1f,    "MS Power Parameters" },        /*  9.3.31 */
439     {  0x20,    "BS Power Parameters" },        /*  9.3.32 */
440     {  0x21,    "Pre-processing Parameters" },  /*  9.3.33 */
441     {  0x22,    "Pre-processed Measurements" }, /*  9.3.34 */
442     {  0x23,    "reserved" },                   /*  */
443     {  0x24,    "SMSCB Information" },          /*  9.3.36 */
444     {  0x25,    "MS Timing Offset" },           /*  9.3.37 */
445     {  0x26,    "Erroneous Message" },          /*  9.3.38 */
446     {  0x27,    "Full BCCH Information" },      /*  9.3.39 */
447     {  0x28,    "Channel Needed" },             /*  9.3.40 */
448     {  0x29,    "CB Command type" },            /*  9.3.41 */
449     {  0x2a,    "SMSCB Message" },              /*  9.3.42 */
450     {  0x2b,    "Full Immediate Assign Info" }, /*  9.3.35 */
451     {  0x2c,    "SACCH Information" },          /*  9.3.29 */
452     {  0x2d,    "CBCH Load Information" },      /*  9.3.43 */
453     {  0x2e,    "SMSCB Channel Indicator" },    /*  9.3.44 */
454     {  0x2f,    "Group Call Reference" },       /*  9.3.45 */
455     {  0x30,    "Channel Description" },        /*  9.3.46 */
456     {  0x31,    "NCH DRX Information" },        /*  9.3.47 */
457     {  0x32,    "Command Indicator" },          /*  9.3.48 */
458     {  0x33,    "eMLPP Priority" },             /*  9.3.49 */
459     {  0x34,    "UIC" },                        /*  9.3.50 */
460     {  0x35,    "Main Channel Reference" },     /*  9.3.51 */
461     {  0x36,    "MultiRate Configuration" },    /*  9.3.52 */
462     {  0x37,    "MultiRate Control" },          /*  9.3.53 */
463     {  0x38,    "Supported Codec Types" },      /*  9.3.54 */
464     {  0x39,    "Codec Configuration" },        /*  9.3.55 */
465     {  0x3a,    "Round Trip Delay" },           /*  9.3.56 */
466     {  0x3b,    "TFO Status" },                 /*  9.3.57 */
467     {  0x3c,    "LLP APDU" },                   /*  9.3.58 */
468     {  0x3d,    "TFO Transparent Container" },  /*  9.3.59 */
469     /*
470             0 0 1 1 1 1 1 0
471             to
472             1 1 1 0 1 1 1 1
473             Reserved for future use
474
475             1 1 1 1 0 0 0 0
476             to
477             1 1 1 1 1 1 1 1
478             Not used
479
480     */
481     { 0,            NULL }
482 };
483
484
485 /*
486 C5  C4  C3  C2  C1
487 0   0   0   0   1   Bm + ACCH's
488 0   0   0   1   T   Lm + ACCH's
489 0   0   1   T   T   SDCCH/4 + ACCH
490 0   1   T   T   T   SDCCH/8 + ACCH
491 1   0   0   0   0   BCCH
492 1   0   0   0   1   Uplink CCCH (RACH)
493 1   0   0   1   0   Downlink CCCH (PCH + AGCH)
494 */
495 static const value_string rsl_ch_no_Cbits_vals[] = {
496     {  0x01,    "Bm + ACCH" },
497     {  0x02,    "Lm + ACCH (sub-chan 0)" },
498     {  0x03,    "Lm + ACCH (sub-chan 1)" },
499     {  0x04,    "SDCCH/4 + ACCH (sub-chan 0)" },
500     {  0x05,    "SDCCH/4 + ACCH (sub-chan 1)" },
501     {  0x06,    "SDCCH/4 + ACCH (sub-chan 2)" },
502     {  0x07,    "SDCCH/4 + ACCH (sub-chan 3)" },
503     {  0x08,    "SDCCH/8 + ACCH (sub-chan 0)" },
504     {  0x09,    "SDCCH/8 + ACCH (sub-chan 1)" },
505     {  0x0a,    "SDCCH/8 + ACCH (sub-chan 2)" },
506     {  0x0b,    "SDCCH/8 + ACCH (sub-chan 3)" },
507     {  0x0c,    "SDCCH/8 + ACCH (sub-chan 4)" },
508     {  0x0d,    "SDCCH/8 + ACCH (sub-chan 5)" },
509     {  0x0e,    "SDCCH/8 + ACCH (sub-chan 6)" },
510     {  0x0f,    "SDCCH/8 + ACCH (sub-chan 7)" },
511     {  0x10,    "BCCH" },
512     {  0x11,    "Uplink CCCH (RACH)" },
513     {  0x12,    "Downlink CCCH (PCH + AGCH)" },
514     { 0,            NULL }
515 };
516
517 /* 9.3.1 Channel number         9.3.1   M TV 2 */
518 static int
519 dissect_rsl_ie_ch_no(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
520 {
521     proto_item *ti;
522     proto_tree *ie_tree;
523     guint8 ie_id;
524
525     if(is_mandatory == FALSE){
526         ie_id = tvb_get_guint8(tvb,offset);
527         if (ie_id != RSL_IE_CH_NO)
528             return offset;
529     }
530
531     ti = proto_tree_add_text(tree, tvb,offset,2,"Channel number IE ");
532     ie_tree = proto_item_add_subtree(ti, ett_ie_ch_no);
533
534
535     /* Element identifier */
536     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
537     offset++;
538     /* C-bits */
539     proto_tree_add_item(ie_tree, hf_rsl_ch_no_Cbits, tvb, offset, 1, ENC_BIG_ENDIAN);
540     /* TN is time slot number, binary represented as in 3GPP TS 45.002.
541      * 3 Bits
542      */
543     proto_tree_add_item(ie_tree, hf_rsl_ch_no_TN, tvb, offset, 1, ENC_BIG_ENDIAN);
544     offset++;
545     return offset;
546 }
547
548 static const value_string rsl_ch_type_vals[] = {
549     {  0x00,    "Main signalling channel (FACCH or SDCCH)" },
550     {  0x01,    "SACCH" },
551     { 0,            NULL }
552 };
553
554 static const value_string rsl_prio_vals[] = {
555     {  0x00,    "Normal Priority" },
556     {  0x01,    "High Priority" },
557     {  0x02,    "Low Priority" },
558     { 0,            NULL }
559 };
560
561 /*
562  * 9.3.2 Link Identifier M TV 2
563  */
564 static int
565 dissect_rsl_ie_link_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
566 {
567     proto_item *ti;
568     proto_tree *ie_tree;
569     guint8 octet;
570     guint8 ie_id;
571
572     if(is_mandatory == FALSE){
573         ie_id = tvb_get_guint8(tvb,offset);
574         if (ie_id != RSL_IE_LINK_ID)
575             return offset;
576     }
577
578     ti = proto_tree_add_text(tree, tvb,offset,2, "Link Identifier IE ");
579     ie_tree = proto_item_add_subtree(ti, ett_ie_link_id);
580
581     /* Element identifier */
582     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
583     offset++;
584
585     octet = tvb_get_guint8(tvb,offset);
586
587     if((octet&0x20) == 0x20){
588         /* Not applicable */
589         proto_tree_add_item(ie_tree, hf_rsl_na, tvb, offset, 1, ENC_BIG_ENDIAN);
590         return offset++;
591     }
592     /* channel type */
593     proto_tree_add_item(ie_tree, hf_rsl_ch_type, tvb, offset, 1, ENC_BIG_ENDIAN);
594     /* NA - Not applicable */
595     proto_tree_add_item(ie_tree, hf_rsl_na, tvb, offset, 1, ENC_BIG_ENDIAN);
596     /* Priority */
597     proto_tree_add_item(ie_tree, hf_rsl_prio, tvb, offset, 1, ENC_BIG_ENDIAN);
598     /* SAPI
599      * The SAPI field contains the SAPI value as defined in 3GPP TS 44.005.
600      */
601     proto_tree_add_item(ie_tree, hf_rsl_sapi, tvb, offset, 1, ENC_BIG_ENDIAN);
602     offset++;
603
604     return offset;
605 }
606
607 /*
608  * 9.3.3 Activation Type
609  */
610 static const true_false_string rsl_rbit_vals = {
611   "Reactivation",
612   "Initial activation"
613 };
614
615 static const value_string rsl_a3a2_vals[] = {
616     {  0x00,    "Activation related to intra-cell channel change" },
617     {  0x01,    "Activation related to inter-cell channel change (handover)" },
618     {  0x02,    "Activation related to secondary channels" },
619     { 0,            NULL }
620 };
621
622 static const true_false_string rsl_a1_0_vals = {
623   "related to normal assignment procedure",
624   "related to immediate assignment procedure"
625 };
626
627 static const true_false_string rsl_a1_1_vals = {
628   "related to synchronous handover procedure",
629   "related to asynchronous handover procedure"
630 };
631
632 static const true_false_string rsl_a1_2_vals = {
633   "related to multislot configuration",
634   "related to additional assignment procedure"
635 };
636
637 static int
638 dissect_rsl_ie_act_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
639 {
640     proto_item *ti;
641     proto_tree *ie_tree;
642     guint8 ie_id;
643     guint   octet;
644
645     if(is_mandatory == FALSE){
646         ie_id = tvb_get_guint8(tvb,offset);
647         if (ie_id != RSL_IE_ACT_TYPE)
648             return offset;
649     }
650
651     ti = proto_tree_add_text(tree, tvb,offset,2,"Activation Type IE ");
652     ie_tree = proto_item_add_subtree(ti, ett_ie_act_type);
653
654
655     /* Element identifier */
656     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
657     offset++;
658
659     /* The R bit indicates if the procedure is an initial activation or a reactivation. */
660     proto_tree_add_item(ie_tree, hf_rsl_rbit, tvb, offset, 1, ENC_BIG_ENDIAN);
661
662     /* The A-bits indicate the type of activation, which defines the access procedure
663      * and the operation of the data link layer
664      */
665     octet = (tvb_get_guint8(tvb,offset) & 0x06)>>1;
666     proto_tree_add_item(ie_tree, hf_rsl_a3a2, tvb, offset, 1, ENC_BIG_ENDIAN);
667     switch(octet){
668     case 0:
669         /* Activation related to intra-cell channel change */
670         proto_tree_add_item(ie_tree, hf_rsl_a1_0, tvb, offset, 1, ENC_BIG_ENDIAN);
671         break;
672     case 1:
673         /* Activation related to inter-cell channel change (handover) */
674         proto_tree_add_item(ie_tree, hf_rsl_a1_1, tvb, offset, 1, ENC_BIG_ENDIAN);
675         break;
676     case 2:
677         /* Activation related to secondary channels */
678         proto_tree_add_item(ie_tree, hf_rsl_a1_2, tvb, offset, 1, ENC_BIG_ENDIAN);
679         break;
680     default:
681         break;
682     }
683     offset++;
684
685     return offset;
686 }
687 /*
688  * 9.3.4 BS Power
689  */
690
691 static const true_false_string rsl_epc_mode_vals = {
692   "Channel in EPC mode",
693   "Channel not in EPC mode"
694 };
695
696 static const true_false_string rsl_fpc_epc_mode_vals = {
697   "Fast Power Control in use",
698   "Fast Power Control not in use"
699 };
700
701 static const value_string rsl_rlm_bs_power_vals[] = {
702     {  0x00,    "Pn" },
703     {  0x01,    "Pn - 2 dB" },
704     {  0x02,    "Pn - 4 dB" },
705     {  0x03,    "Pn - 6 dB" },
706     {  0x04,    "Pn - 8 dB" },
707     {  0x05,    "Pn - 10 dB" },
708     {  0x06,    "Pn - 12 dB" },
709     {  0x07,    "Pn - 14 dB" },
710     {  0x08,    "Pn - 16 dB" },
711     {  0x09,    "Pn - 18 dB" },
712     {  0x0a,    "Pn - 20 dB" },
713     {  0x0b,    "Pn - 22 dB" },
714     {  0x0c,    "Pn - 24 dB" },
715     {  0x0d,    "Pn - 26 dB" },
716     {  0x0e,    "Pn - 28 dB" },
717     {  0x0f,    "Pn - 30 dB" },
718     { 0,            NULL }
719 };
720
721 static int
722 dissect_rsl_ie_bs_power(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
723 {
724     proto_item *ti;
725     proto_tree *ie_tree;
726     guint8 ie_id;
727
728     if(is_mandatory == FALSE){
729         ie_id = tvb_get_guint8(tvb,offset);
730         if (ie_id != RSL_IE_BS_POW)
731             return offset;
732     }
733
734     ti = proto_tree_add_text(tree, tvb,offset,2,"BS Power IE");
735     ie_tree = proto_item_add_subtree(ti, ett_ie_bs_power);
736
737     /* Element identifier */
738     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
739     offset++;
740
741     /* EPC mode */
742     proto_tree_add_item(ie_tree, hf_rsl_epc_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
743     /* FPC_EPC mode */
744     proto_tree_add_item(ie_tree, hf_rsl_bs_fpc_epc_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
745
746     /* The Power Level field (octet 2) indicates the number of 2 dB steps by
747      * which the power shall be reduced from its nominal value, Pn,
748      * set by the network operator to adjust the coverage.
749      * Thus the Power Level values correspond to the following powers (relative to Pn):
750      */
751     proto_tree_add_item(ie_tree, hf_rsl_bs_power, tvb, offset, 1, ENC_BIG_ENDIAN);
752     offset++;
753
754     return offset;
755 }
756 /*
757  * 9.3.5 Channel Identification
758  */
759 static int
760 dissect_rsl_ie_ch_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
761 {
762     proto_item *ti;
763     proto_tree *ie_tree;
764     guint8 length;
765     int ie_offset;
766     guint8 ie_id;
767
768     if(is_mandatory == FALSE){
769         ie_id = tvb_get_guint8(tvb,offset);
770         if (ie_id != RSL_IE_CH_ID)
771             return offset;
772     }
773
774     ti = proto_tree_add_text(tree, tvb,offset,0,"Channel Identification IE");
775     ie_tree = proto_item_add_subtree(ti, ett_ie_ch_id);
776
777     /* Element identifier */
778     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
779     offset++;
780     /* Length */
781     length = tvb_get_guint8(tvb, offset);
782     proto_item_set_len(ti, length+2);
783     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
784     offset++;
785
786     ie_offset = offset;
787
788     /* 3GPP TS 44.018 "Channel Description"
789          * the whole of the 3GPP TS 44.018 element including the element identifier and
790          * length should be included.
791          * XXX Hmm a type 3 IE (TV).
792          */
793         proto_tree_add_text(ie_tree, tvb,offset, 1, "Channel Description Tag");
794     de_rr_ch_dsc(tvb, ie_tree, pinfo, offset+1, length, NULL, 0);
795         offset+=4;
796     /*
797      * The 3GPP TS 24.008 "Mobile Allocation" shall for compatibility reasons be
798      * included but empty, i.e. the length shall be zero.
799      */
800         proto_tree_add_text(ie_tree, tvb,offset,2,"Mobile Allocation Tag+Length(0)");
801     return ie_offset + length;
802 }
803 /*
804  * 9.3.6 Channel Mode
805  */
806
807 static const true_false_string rsl_dtx_vals = {
808   "DTX is applied",
809   "DTX is not applied"
810 };
811 static const value_string rsl_speech_or_data_vals[] = {
812     {  0x01,    "Speech" },
813     {  0x02,    "Data" },
814     {  0x03,    "Signalling" },
815     { 0,            NULL }
816 };
817 static const value_string rsl_ch_rate_and_type_vals[] = {
818     {  0x01,    "SDCCH" },
819     {  0x08,    "Full rate TCH channel Bm" },
820     {  0x09,    "Half rate TCH channel Lm" },
821     {  0x0a,    "Full rate TCH channel bi-directional Bm, Multislot configuration" },
822     {  0x1a,    "Full rate TCH channel uni-directional downlink Bm, Multislot configuration" },
823     {  0x18,    "Full rate TCH channel Bm Group call channel" },
824     {  0x19,    "Half rate TCH channel Lm Group call channel" },
825     {  0x28,    "Full rate TCH channel Bm Broadcast call channel" },
826     {  0x29,    "PHalf rate TCH channel Lm Broadcast call channel" },
827     { 0,            NULL }
828 };
829
830 static const value_string rsl_speech_coding_alg_vals[] = {
831     {  0x01,    "GSM speech coding algorithm version 1: GSM FR or GSM HR" },
832     {  0x11,    "GSM speech coding algorithm version 2: GSM EFR (half rate not defined in this version of the protocol)" },
833     {  0x21,    "GSM speech coding algorithm version 3: FR AMR or HR AMR" },
834     {  0x31,    "GSM speech coding algorithm version 4: OFR AMR-WB or OHR AMR-WB" },
835     {  0x09,    "GSM speech coding algorithm version 5: FR AMR-WB" },
836     {  0x0d,    "GSM speech coding algorithm version 6: OHR AMR" },
837     { 0,            NULL }
838 };
839
840 static const true_false_string t_nt_bit_vals = {
841   "Non-transparent service",
842   "Transparent service"
843 };
844
845 static const value_string rsl_ra_if_data_rte_vals[] = {
846     {  0x21,    "asymmetric 43.5 kbit/s (downlink) + 14.5 kbit/s (uplink)" },
847     {  0x22,    "asymmetric 29.0 kbit/s (downlink) + 14.5 kbit/s (uplink)" },
848     {  0x23,    "asymmetric 43.5 kbit/s (downlink) + 29.0 kbit/s (uplink)" },
849     {  0x29,    "asymmetric 14.5 kbit/s (downlink) + 43.5 kbit/s (uplink)" },
850     {  0x2a,    "asymmetric 14.5 kbit/s (downlink) + 29.0 kbit/s (uplink)" },
851     {  0x2b,    "asymmetric 29.0 kbit/s (downlink) + 43.5 kbit/s (uplink)" },
852     {  0x34,    "43.5 kbit/s" },
853     {  0x31,    "28.8 kbit/s" },
854     {  0x18,    "14.5 kbit/s" },
855     {  0x10,    "12 kbit/s" },
856     {  0x11,    "6 kbit/s" },
857     { 0,            NULL }
858 };
859
860 static const value_string rsl_data_rte_vals[] = {
861     {  0x38,    "32 kbit/s" },
862     {  0x22,    "39 kbit/s" },
863     {  0x18,    "14.4 kbit/s" },
864     {  0x10,    "9.6 kbit/s" },
865     {  0x11,    "4.8 kbit/s" },
866     {  0x12,    "2.4 kbit/s" },
867     {  0x13,    "1.2 kbit/s" },
868     {  0x14,    "600 bit/s" },
869     {  0x15,    "1 200/75 bit/s (1 200 network-to-MS, 75 MS-to-network)" },
870     { 0,            NULL }
871 };
872
873 static int
874 dissect_rsl_ie_ch_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
875 {
876     proto_item *ti;
877     proto_tree *ie_tree;
878     guint8 length;
879     int ie_offset;
880     guint8 ie_id;
881     guint8 octet;
882
883     if(is_mandatory == FALSE){
884         ie_id = tvb_get_guint8(tvb,offset);
885         if (ie_id != RSL_IE_CH_MODE)
886             return offset;
887     }
888
889     ti = proto_tree_add_text(tree, tvb,offset,0,"Channel Mode IE");
890     ie_tree = proto_item_add_subtree(ti, ett_ie_ch_mode);
891
892     /* Element identifier */
893     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
894     offset++;
895     /* Length */
896     length = tvb_get_guint8(tvb, offset);
897     proto_item_set_len(ti, length+2);
898     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
899     offset++;
900     ie_offset = offset;
901
902     /* The DTX bits of octet 3 indicate whether DTX is applied
903      * DTXd indicates use of DTX in the downlink direction (BTS to MS) and
904      * DTXu indicates use of DTX in the uplink direction (MS to BTS).
905      */
906     proto_tree_add_item(ie_tree, hf_rsl_cm_dtxd, tvb, offset, 1, ENC_BIG_ENDIAN);
907     proto_tree_add_item(ie_tree, hf_rsl_cm_dtxu, tvb, offset, 1, ENC_BIG_ENDIAN);
908     offset++;
909     /* The "Speech or data indicator" field (octet 4) */
910     proto_tree_add_item(ie_tree, hf_rsl_speech_or_data, tvb, offset, 1, ENC_BIG_ENDIAN);
911     octet = tvb_get_guint8(tvb,offset);
912     offset++;
913     /* Channel rate and type */
914     proto_tree_add_item(ie_tree, hf_rsl_ch_rate_and_type, tvb, offset, 1, ENC_BIG_ENDIAN);
915     offset++;
916     /* Speech coding algor./data rate + transp ind */
917     switch(octet){
918     case 1:
919         /* Speech */
920         proto_tree_add_item(ie_tree, hf_rsl_speech_coding_alg, tvb, offset, 1, ENC_BIG_ENDIAN);
921         break;
922     case 2:
923         /* Data */
924         proto_tree_add_item(ie_tree, hf_rsl_extension_bit, tvb, offset, 1, ENC_BIG_ENDIAN);
925         proto_tree_add_item(ie_tree, hf_rsl_t_nt_bit, tvb, offset, 1, ENC_BIG_ENDIAN);
926         octet = tvb_get_guint8(tvb,offset);
927         if ((octet&0x40)==0x40){
928             /* Non-transparent service */
929             /* For the non-transparent service, bits 6 to 1 indicate the radio interface data rate:*/
930             proto_tree_add_item(ie_tree, hf_rsl_ra_if_data_rte, tvb, offset, 1, ENC_BIG_ENDIAN);
931         }else{
932             /* For the transparent service, bits 6-1 indicate the data rate: */
933             proto_tree_add_item(ie_tree, hf_rsl_data_rte, tvb, offset, 1, ENC_BIG_ENDIAN);
934         }
935         break;
936     case 3:
937         /* Signalling
938          * If octet 4 indicates signalling then octet 6 is coded as follows:
939          * 0000 0000 No resources required
940          */
941         proto_tree_add_text(ie_tree, tvb,offset,1,"0 No resources required(All other values are reserved)");
942         break;
943     default:
944         /* Should not happen */
945         proto_tree_add_text(ie_tree, tvb,offset,1,"Speech or data indicator != 1,2 or 3");
946         break;
947     }
948
949     offset++;
950
951     return ie_offset + length;
952 }
953
954 /*
955  * 9.3.7 Encryption information
956  */
957
958 /* The Algorithm Identifier field (octet 3) indicates the relevant ciphering algorithm. It is coded as: */
959 static const value_string rsl_algorithm_id_vals[] = {
960     {  0x00,    "Reserved" },
961     {  0x01,    "No encryption shall be used" },
962     {  0x02,    "GSM encryption algorithm version 1 (A5/1)" },
963     {  0x03,    "GSM A5/2" },
964     {  0x04,    "GSM A5/3" },
965     {  0x05,    "GSM A5/4" },
966     {  0x06,    "GSM A5/5" },
967     {  0x07,    "GSM A5/6" },
968     {  0x08,    "GSM A5/7" },
969     { 0,            NULL }
970 };
971
972 static int
973 dissect_rsl_ie_enc_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
974 {
975     proto_item *ti;
976     proto_tree *ie_tree;
977     guint8 length;
978     guint8 ie_id;
979
980     if(is_mandatory == FALSE){
981         ie_id = tvb_get_guint8(tvb,offset);
982         if (ie_id != RSL_IE_ENC_INF)
983             return offset;
984     }
985
986     ti = proto_tree_add_text(tree, tvb,offset,0,"Encryption information IE");
987     ie_tree = proto_item_add_subtree(ti, ett_ie_enc_inf);
988
989     /* Element identifier */
990     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
991     offset++;
992     /* Length */
993     length = tvb_get_guint8(tvb, offset);
994     proto_item_set_len(ti, length+2);
995     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
996     offset++;
997
998     /* Algorithm Identifier field (octet 3) */
999     proto_tree_add_item(ie_tree, hf_rsl_alg_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1000
1001     /* key */
1002     proto_tree_add_item(ie_tree, hf_rsl_key, tvb, offset+1, length -1, ENC_NA);
1003
1004     return offset + length;
1005
1006 }
1007 /*
1008  * 9.3.8 Frame Number
1009  */
1010 static int
1011 dissect_rsl_ie_frame_no(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1012 {
1013     proto_item *ti;
1014     proto_tree *ie_tree;
1015     guint8 ie_id;
1016
1017     if(is_mandatory == FALSE){
1018         ie_id = tvb_get_guint8(tvb,offset);
1019         if (ie_id != RSL_IE_FRAME_NO)
1020             return offset;
1021     }
1022
1023     ti = proto_tree_add_text(tree, tvb,offset,3,"Frame Number IE");
1024     ie_tree = proto_item_add_subtree(ti, ett_ie_frame_no);
1025
1026     /* Element identifier */
1027     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1028     offset++;
1029
1030     proto_tree_add_item(ie_tree, hf_rsl_req_ref_T1prim, tvb, offset, 1, ENC_BIG_ENDIAN);
1031     proto_tree_add_item(ie_tree, hf_rsl_req_ref_T3, tvb, offset, 2, ENC_BIG_ENDIAN);
1032     offset++;
1033     proto_tree_add_item(ie_tree, hf_rsl_req_ref_T2, tvb, offset, 1, ENC_BIG_ENDIAN);
1034     offset++;
1035
1036     return offset;
1037 }
1038
1039 /*
1040  * 9.3.9 Handover reference
1041  */
1042 static int
1043 dissect_rsl_ie_ho_ref(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1044 {
1045     proto_item *ti;
1046     proto_tree *ie_tree;
1047     guint8 ie_id;
1048
1049     if(is_mandatory == FALSE){
1050         ie_id = tvb_get_guint8(tvb,offset);
1051         if (ie_id != RSL_IE_HO_REF)
1052             return offset;
1053     }
1054
1055     ti = proto_tree_add_text(tree, tvb,offset,2,"Handover reference IE");
1056     ie_tree = proto_item_add_subtree(ti, ett_ie_ho_ref);
1057
1058     /* Element identifier */
1059     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1060     offset++;
1061
1062     /* Hand-over reference */
1063     proto_tree_add_item(ie_tree, hf_rsl_ho_ref, tvb, offset, 1, ENC_BIG_ENDIAN);
1064     offset++;
1065
1066     return offset;
1067 }
1068
1069 /*
1070  * 9.3.10 L1 Information
1071  */
1072
1073 static int
1074 dissect_rsl_ie_l1_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1075 {
1076     proto_item *ti;
1077     proto_tree *ie_tree;
1078     guint8 ie_id;
1079
1080     if(is_mandatory == FALSE){
1081         ie_id = tvb_get_guint8(tvb,offset);
1082         if (ie_id != RSL_IE_L1_INF)
1083             return offset;
1084     }
1085
1086     ti = proto_tree_add_text(tree, tvb,offset, 3,"L1 Information IE");
1087     ie_tree = proto_item_add_subtree(ti, ett_ie_l1_inf);
1088
1089     /* Element identifier */
1090     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1091     offset++;
1092
1093     /* Octets 2-3 contain the L1 header information of SACCH blocks.
1094      * The information fields and codings are as defined in 3GPP TS 44.004.
1095      */
1096     /* Power level */
1097     proto_tree_add_item(ie_tree, hf_rsl_l1inf_power_lev, tvb, offset, 1, ENC_BIG_ENDIAN);
1098     /* FPC */
1099     proto_tree_add_item(ie_tree, hf_rsl_l1inf_fpc, tvb, offset, 1, ENC_BIG_ENDIAN);
1100     offset++;
1101     /* Actual Timing Advance */
1102     proto_tree_add_item(ie_tree, hf_rsl_act_timing_adv, tvb, offset, 1, ENC_BIG_ENDIAN);
1103     offset++;
1104
1105     return offset;
1106 }
1107
1108 /*
1109  * 9.3.11 L3 Information            9.3.11  M TLV >=3
1110  *
1111  * This element contains a link layer service data unit (L3 message).
1112  * It is used to forward a complete L3 message as specified in
1113  * 3GPP TS 24.008 or 3GPP TS 44.018 between BTS and BSC.
1114  */
1115 static int
1116 dissect_rsl_ie_L3_inf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean is_mandatory)
1117 {
1118     proto_item *ti;
1119     proto_tree *ie_tree;
1120     tvbuff_t    *next_tvb;
1121     guint16 length;
1122     guint8 ie_id;
1123
1124     if(is_mandatory == FALSE){
1125         ie_id = tvb_get_guint8(tvb,offset);
1126         if (ie_id != RSL_IE_L3_INF)
1127             return offset;
1128     }
1129
1130     ti = proto_tree_add_text(tree, tvb,offset,0,"L3 Information IE");
1131     ie_tree = proto_item_add_subtree(ti, ett_ie_L3_inf);
1132
1133     /* Element identifier */
1134     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1135     offset++;
1136     /* Length */
1137     length = tvb_get_ntohs(tvb, offset);
1138     proto_item_set_len(ti, length+3);
1139     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1140     offset= offset+2;
1141
1142     /* Link Layer Service Data Unit (i.e. a layer 3 message
1143      * as defined in 3GPP TS 24.008 or 3GPP TS 44.018)
1144      */
1145     proto_tree_add_text(ie_tree, tvb,offset,length,"Link Layer Service Data Unit ( L3 Message)");
1146     next_tvb = tvb_new_subset(tvb, offset, length, length);
1147     call_dissector(gsm_a_dtap_handle, next_tvb, pinfo, top_tree);
1148
1149     offset = offset + length;
1150
1151     return offset;
1152  }
1153
1154 /*
1155  * 9.3.12 MS Identity
1156  */
1157 static int
1158 dissect_rsl_ie_ms_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean is_mandatory)
1159 {
1160     proto_item *ti;
1161     proto_tree *ie_tree;
1162     guint length;
1163     guint8 ie_id;
1164
1165     if(is_mandatory == FALSE){
1166         ie_id = tvb_get_guint8(tvb,offset);
1167         if (ie_id != RSL_IE_MS_ID)
1168             return offset;
1169     }
1170     ti = proto_tree_add_text(tree, tvb,offset,0,"MS Identity IE");
1171     ie_tree = proto_item_add_subtree(ti, ett_ie_ms_id);
1172
1173     /* Element identifier */
1174     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1175     offset++;
1176     /* Length */
1177     length = tvb_get_guint8(tvb,offset);
1178     proto_item_set_len(ti, length+2);
1179     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1180     offset++;
1181
1182     de_mid(tvb, ie_tree, pinfo, offset, length, NULL, 0);
1183
1184     offset = offset + length;
1185
1186     return offset;
1187 }
1188
1189 static const true_false_string rsl_ms_fpc_epc_mode_vals = {
1190   "In use",
1191   "Not in use"
1192 };
1193 /*
1194  * 9.3.13 MS Power
1195  */
1196 static int
1197 dissect_rsl_ie_ms_pow(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1198 {
1199     proto_item *ti;
1200     proto_tree *ie_tree;
1201     guint8 ie_id;
1202
1203     if(is_mandatory == FALSE){
1204         ie_id = tvb_get_guint8(tvb,offset);
1205         if (ie_id != RSL_IE_MS_POW)
1206             return offset;
1207     }
1208
1209     ti = proto_tree_add_text(tree, tvb,offset, 2,"MS Power IE");
1210     ie_tree = proto_item_add_subtree(ti, ett_ie_ms_pow);
1211
1212     /* Element identifier */
1213     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1214     offset++;
1215
1216     /* MS power level */
1217     proto_tree_add_item(ie_tree, hf_rsl_ms_power_lev, tvb, offset, 1, ENC_BIG_ENDIAN);
1218     /* FPC */
1219     proto_tree_add_item(ie_tree, hf_rsl_ms_fpc, tvb, offset, 1, ENC_BIG_ENDIAN);
1220     /* Reserved */
1221     offset++;
1222
1223     return offset;
1224 }
1225
1226 /*
1227  * 9.3.14 Paging Group M TV 2 2
1228  */
1229 static int
1230 dissect_rsl_ie_paging_grp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1231 {
1232     proto_item *ti;
1233     proto_tree *ie_tree;
1234     guint8 ie_id;
1235
1236     if(is_mandatory == FALSE){
1237         ie_id = tvb_get_guint8(tvb,offset);
1238         if (ie_id != RSL_IE_PAGING_GRP)
1239             return offset;
1240     }
1241     ti = proto_tree_add_text(tree, tvb,offset,2,"Paging Group IE");
1242     ie_tree = proto_item_add_subtree(ti, ett_ie_paging_grp);
1243
1244     /* Element identifier */
1245     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1246     offset++;
1247
1248     /* The Paging Group field (octet 2) contains the binary representation of the paging
1249      * group as defined in 3GPP TS 45.002.
1250      */
1251     proto_tree_add_item(ie_tree, hf_rsl_paging_grp, tvb, offset, 1, ENC_BIG_ENDIAN);
1252     offset++;
1253
1254     return offset;
1255
1256 }
1257
1258 /*
1259  * 9.3.15 Paging Load
1260  */
1261 static int
1262 dissect_rsl_ie_paging_load(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1263 {
1264     proto_item *ti;
1265     proto_tree *ie_tree;
1266     guint8 ie_id;
1267
1268     if(is_mandatory == FALSE){
1269         ie_id = tvb_get_guint8(tvb,offset);
1270         if (ie_id != RSL_IE_PAGING_LOAD)
1271             return offset;
1272     }
1273     ti = proto_tree_add_text(tree, tvb,offset,3,"Paging Load IE");
1274     ie_tree = proto_item_add_subtree(ti, ett_ie_paging_load);
1275
1276     /* Element identifier */
1277     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1278     offset++;
1279
1280     /*
1281      * Paging Buffer Space.
1282      */
1283     proto_tree_add_item(ie_tree, hf_rsl_paging_load, tvb, offset, 2, ENC_BIG_ENDIAN);
1284     offset = offset + 2;
1285
1286     return offset;
1287
1288 }
1289 /*
1290  * 9.3.16 Physical Context TLV
1291  */
1292 static int
1293 dissect_rsl_ie_phy_ctx(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1294 {
1295     proto_item *ti;
1296     proto_tree *ie_tree;
1297     guint length;
1298     guint8 ie_id;
1299
1300     if(is_mandatory == FALSE){
1301         ie_id = tvb_get_guint8(tvb,offset);
1302         if (ie_id != RSL_IE_PHY_CTX)
1303             return offset;
1304     }
1305
1306     ti = proto_tree_add_text(tree, tvb,offset,0,"Physical Context IE ");
1307     ie_tree = proto_item_add_subtree(ti, ett_ie_phy_ctx);
1308
1309     /* Element identifier */
1310     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1311     offset++;
1312     /* Length */
1313     length = tvb_get_guint8(tvb,offset);
1314     proto_item_set_len(ti, length+2);
1315     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1316     offset++;
1317
1318     /*
1319      * Physical Context Information:
1320      *  The Physical Context Information field is not specified.
1321      *  This information should not be analysed by BSC, but merely
1322      *  forwarded from one TRX/channel to another.
1323      */
1324     proto_tree_add_item(ie_tree, hf_rsl_phy_ctx, tvb, offset, length, ENC_NA);
1325     offset = offset + length;
1326
1327     return offset;
1328 }
1329 /*
1330  * 9.3.17 Access Delay M TV 2
1331  */
1332 static int
1333 dissect_rsl_ie_access_delay(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1334 {
1335     proto_item *ti;
1336     proto_tree *ie_tree;
1337     guint8 ie_id;
1338
1339     if(is_mandatory == FALSE){
1340         ie_id = tvb_get_guint8(tvb,offset);
1341         if (ie_id != RSL_IE_ACCESS_DELAY)
1342             return offset;
1343     }
1344
1345     ti = proto_tree_add_text(tree, tvb,offset,2,"Access Delay IE ");
1346     ie_tree = proto_item_add_subtree(ti, ett_ie_access_delay);
1347
1348     /* Element identifier */
1349     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1350     offset++;
1351     proto_tree_add_item(ie_tree, hf_rsl_acc_delay, tvb, offset, 1, ENC_BIG_ENDIAN);
1352     offset++;
1353     return offset;
1354 }
1355
1356 /*
1357  * 9.3.18 RACH Load
1358  */
1359
1360 static int
1361 dissect_rsl_ie_rach_load(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1362 {
1363     proto_item *ti;
1364     proto_tree *ie_tree;
1365     guint length;
1366     guint8 ie_id;
1367     int ie_offset;
1368
1369     if(is_mandatory == FALSE){
1370         ie_id = tvb_get_guint8(tvb,offset);
1371         if (ie_id != RSL_IE_RACH_LOAD)
1372             return offset;
1373     }
1374
1375     ti = proto_tree_add_text(tree, tvb,offset,0,"RACH Load IE ");
1376     ie_tree = proto_item_add_subtree(ti, ett_ie_rach_load);
1377
1378     /* Element identifier */
1379     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1380     offset++;
1381     /* Length */
1382     length = tvb_get_guint8(tvb,offset);
1383     proto_item_set_len(ti, length+2);
1384     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1385     offset++;
1386     ie_offset = offset;
1387
1388     /*
1389      * This element is used to carry information on the load of the RACH (Random Access Channel)
1390      * associated with this CCCH timeslot. It is of variable length.
1391      */
1392     /*  RACH Slot Count */
1393     proto_tree_add_item(ie_tree, hf_rsl_rach_slot_cnt, tvb, offset, 2, ENC_BIG_ENDIAN);
1394     offset = offset +2;
1395     length = length -2;
1396     /* RACH Busy Count */
1397     proto_tree_add_item(ie_tree, hf_rsl_rach_busy_cnt, tvb, offset, 2, ENC_BIG_ENDIAN);
1398     offset = offset +2;
1399     length = length -2;
1400
1401     /* RACH Access Count */
1402     proto_tree_add_item(ie_tree, hf_rsl_rach_acc_cnt, tvb, offset, 2, ENC_BIG_ENDIAN);
1403     offset = offset +2;
1404     length = length -2;
1405
1406     /* Supplementary Information */
1407     if( length > 0){
1408         proto_tree_add_text(ie_tree, tvb, offset,length ,"Supplementary Information");
1409     }
1410     offset = ie_offset + length;
1411
1412     return offset;
1413 }
1414
1415 /*
1416  * 9.3.19 Request Reference M TV 4
1417  */
1418 static int
1419 dissect_rsl_ie_req_ref(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1420 {
1421     proto_item *ti;
1422     proto_tree *ie_tree;
1423     guint8 ie_id;
1424
1425     if(is_mandatory == FALSE){
1426         ie_id = tvb_get_guint8(tvb,offset);
1427         if (ie_id != RSL_IE_REQ_REF)
1428             return offset;
1429     }
1430
1431     ti = proto_tree_add_text(tree, tvb,offset,4,"Request Reference IE ");
1432     ie_tree = proto_item_add_subtree(ti, ett_ie_req_ref);
1433
1434     /* Element identifier */
1435     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1436     offset++;
1437     proto_tree_add_item(ie_tree, hf_rsl_req_ref_ra, tvb, offset, 1, ENC_BIG_ENDIAN);
1438     offset++;
1439     proto_tree_add_item(ie_tree, hf_rsl_req_ref_T1prim, tvb, offset, 1, ENC_BIG_ENDIAN);
1440     proto_tree_add_item(ie_tree, hf_rsl_req_ref_T3, tvb, offset, 2, ENC_BIG_ENDIAN);
1441     offset++;
1442     proto_tree_add_item(ie_tree, hf_rsl_req_ref_T2, tvb, offset, 1, ENC_BIG_ENDIAN);
1443     offset++;
1444     return offset;
1445 }
1446
1447 static const value_string rel_mode_vals[] = {
1448     {  0x00,    "Normal Release" },
1449     {  0x01,    "Local End Release" },
1450     { 0,            NULL }
1451 };
1452
1453 /*
1454  * 9.3.20 Release Mode              9.3.20  M TV 2
1455  */
1456 static int
1457 dissect_rsl_ie_rel_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1458 {
1459     proto_item *ti;
1460     proto_tree *ie_tree;
1461     guint8 ie_id;
1462
1463     if(is_mandatory == FALSE){
1464         ie_id = tvb_get_guint8(tvb,offset);
1465         if (ie_id != RSL_IE_REL_MODE)
1466             return offset;
1467     }
1468
1469     ti = proto_tree_add_text(tree, tvb,offset,4,"Release Mode IE ");
1470     ie_tree = proto_item_add_subtree(ti, ett_ie_rel_mode);
1471
1472     /* Element identifier */
1473     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1474     offset++;
1475
1476     /*  The M bit is coded as follows:
1477      * 0 normal release
1478      * 1 local end release
1479      */
1480     proto_tree_add_item(ie_tree, hf_rsl_rel_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
1481
1482     offset++;
1483     return offset;
1484 }
1485
1486 static const value_string rsl_rlm_cause_vals[] = {
1487     {  0x00,    "reserved" },
1488     {  0x01,    "timer T200 expired (N200+1) times" },
1489     {  0x02,    "re-establishment request" },
1490     {  0x03,    "unsolicited UA response" },
1491     {  0x04,    "unsolicited DM response" },
1492     {  0x05,    "unsolicited DM response, multiple frame established state" },
1493     {  0x06,    "unsolicited supervisory response" },
1494     {  0x07,    "sequence error" },
1495     {  0x08,    "U-frame with incorrect parameters" },
1496     {  0x09,    "S-frame with incorrect parameters" },
1497     {  0x0a,    "I-frame with incorrect use of M bit" },
1498     {  0x0b,    "I-frame with incorrect length" },
1499     {  0x0c,    "frame not implemented" },
1500     {  0x0d,    "SABM command, multiple frame established state" },
1501     {  0x0e,    "SABM frame with information not allowed in this state" },
1502     { 0,            NULL }
1503 };
1504
1505 /*
1506  * 9.3.21 Resource Information
1507  */
1508 static int
1509 dissect_rsl_ie_resource_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1510 {
1511     proto_item *ti;
1512     proto_tree *ie_tree;
1513     guint8 ie_id;
1514     guint       length;
1515     int ie_offset;
1516
1517     if(is_mandatory == FALSE){
1518         ie_id = tvb_get_guint8(tvb,offset);
1519         if (ie_id != RSL_IE_RESOURCE_INF)
1520             return offset;
1521     }
1522
1523     ti = proto_tree_add_text(tree, tvb,offset,0,"Resource Information IE");
1524     ie_tree = proto_item_add_subtree(ti, ett_ie_resource_inf);
1525
1526     /* Element identifier */
1527     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1528     offset++;
1529
1530     /* Length */
1531     length = tvb_get_guint8(tvb,offset);
1532     proto_item_set_len(ti, length+2);
1533
1534     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1535     offset++;
1536
1537     ie_offset = offset;
1538
1539     while (length > 0){
1540         proto_tree_add_item(ie_tree, hf_rsl_ch_no_Cbits, tvb, offset, 1, ENC_BIG_ENDIAN);
1541         /* TN is time slot number, binary represented as in 3GPP TS 45.002.
1542          * 3 Bits
1543          */
1544         proto_tree_add_item(ie_tree, hf_rsl_ch_no_TN, tvb, offset, 1, ENC_BIG_ENDIAN);
1545         offset++;
1546
1547         /* Interference level (1) */
1548         /* Interf Band */
1549         proto_tree_add_item(ie_tree, hf_rsl_interf_band, tvb, offset, 1, ENC_BIG_ENDIAN);
1550         /* Interf Band reserved bits */
1551         proto_tree_add_item(ie_tree, hf_rsl_interf_band_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
1552         offset++;
1553         length = length - 2;
1554     }
1555     return ie_offset + length;
1556 }
1557
1558 /*
1559  * 9.3.22 RLM Cause             9.3.22  M TLV 2-4
1560  */
1561 static int
1562 dissect_rsl_ie_rlm_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1563 {
1564     proto_item *ti;
1565     proto_tree *ie_tree;
1566
1567     guint       length;
1568     /* guint8       octet; */
1569     guint8 ie_id;
1570
1571     if(is_mandatory == FALSE){
1572         ie_id = tvb_get_guint8(tvb,offset);
1573         if (ie_id != RSL_IE_RLM_CAUSE)
1574             return offset;
1575     }
1576
1577     ti = proto_tree_add_text(tree, tvb,offset,0,"RLM Cause IE ");
1578     ie_tree = proto_item_add_subtree(ti, ett_ie_rlm_cause);
1579
1580     /* Element identifier */
1581     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1582     offset++;
1583     /* Length */
1584     length = tvb_get_guint8(tvb,offset);
1585     proto_item_set_len(ti, length+2);
1586
1587     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1588     offset++;
1589
1590     /* The Cause Value is a one octet field if the extension bit is set to 0.
1591      * If the extension bit is set to 1, the Cause Value is a two octet field.
1592      */
1593         /* XXX: Code doesn't reflect the comment above ?? */
1594     /* octet = tvb_get_guint8(tvb,offset); */
1595     proto_tree_add_item(tree, hf_rsl_extension_bit, tvb, offset, 1, ENC_BIG_ENDIAN);
1596     proto_tree_add_item(ie_tree, hf_rsl_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
1597     offset++;
1598
1599     return offset;
1600 }
1601
1602 /*
1603  * 9.3.23 Starting Time
1604  */
1605 static int
1606 dissect_rsl_ie_staring_time(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1607 {
1608     proto_item *ti;
1609     proto_tree *ie_tree;
1610     guint8 ie_id;
1611
1612     if(is_mandatory == FALSE){
1613         ie_id = tvb_get_guint8(tvb,offset);
1614         if (ie_id != RSL_IE_STARTING_TIME)
1615             return offset;
1616     }
1617
1618     ti = proto_tree_add_text(tree, tvb,offset,3,"Starting Time IE");
1619     ie_tree = proto_item_add_subtree(ti, ett_ie_staring_time);
1620
1621     /* Element identifier */
1622     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1623     offset++;
1624
1625     proto_tree_add_item(ie_tree, hf_rsl_req_ref_T1prim, tvb, offset, 1, ENC_BIG_ENDIAN);
1626     proto_tree_add_item(ie_tree, hf_rsl_req_ref_T3, tvb, offset, 2, ENC_BIG_ENDIAN);
1627     offset++;
1628     proto_tree_add_item(ie_tree, hf_rsl_req_ref_T2, tvb, offset, 1, ENC_BIG_ENDIAN);
1629     offset++;
1630
1631     return offset;
1632 }
1633
1634 /*
1635  * 9.3.24 Timing Advance
1636  */
1637 static int
1638 dissect_rsl_ie_timing_adv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1639 {
1640     proto_item *ti;
1641     proto_tree *ie_tree;
1642     guint8 ie_id;
1643
1644     if(is_mandatory == FALSE){
1645         ie_id = tvb_get_guint8(tvb,offset);
1646         if (ie_id != RSL_IE_TIMING_ADV)
1647             return offset;
1648     }
1649
1650     ti = proto_tree_add_text(tree, tvb,offset,2,"Timing Advance IE");
1651     ie_tree = proto_item_add_subtree(ti, ett_ie_timing_adv);
1652
1653     /* Element identifier */
1654     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1655     offset++;
1656
1657     proto_tree_add_item(ie_tree, hf_rsl_timing_adv, tvb, offset, 1, ENC_BIG_ENDIAN);
1658     offset++;
1659
1660     return offset;
1661 }
1662
1663 /*
1664  * 9.3.25 Uplink Measurements
1665  */
1666 static const true_false_string rsl_dtxd_vals = {
1667   "Employed",
1668   "Not employed"
1669 };
1670
1671 static int
1672 dissect_rsl_ie_uplik_meas(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1673 {
1674     proto_item *ti;
1675     proto_tree *ie_tree;
1676     guint       length;
1677     int         ie_offset;
1678     guint8 ie_id;
1679
1680     if(is_mandatory == FALSE){
1681         ie_id = tvb_get_guint8(tvb,offset);
1682         if (ie_id != RSL_IE_UPLINK_MEAS)
1683             return offset;
1684     }
1685
1686     ti = proto_tree_add_text(tree, tvb,offset,0,"Uplink Measurements IE");
1687     ie_tree = proto_item_add_subtree(ti, ett_ie_uplink_meas);
1688
1689     /* Element identifier */
1690     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1691     offset++;
1692
1693     /* Length */
1694     length = tvb_get_guint8(tvb,offset);
1695     proto_item_set_len(ti, length+2);
1696
1697     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1698     offset++;
1699     ie_offset = offset;
1700
1701     /* Octet 3
1702      * 8    7    6  5   4   3   2   1
1703      * rfu  DTXd | RXLEV.FULL.up
1704      */
1705     proto_tree_add_item(ie_tree, hf_rsl_dtxd, tvb, offset, 1, ENC_BIG_ENDIAN);
1706     proto_tree_add_item(ie_tree, hf_rsl_rxlev_full_up, tvb, offset, 1, ENC_BIG_ENDIAN);
1707     offset++;
1708
1709     /* Octet4
1710      * 8    7   6   5   4   3   2   1
1711      * Reserved |  RXLEV.SUB.up 4
1712      */
1713     proto_tree_add_item(ie_tree, hf_rsl_rxlev_sub_up, tvb, offset, 1, ENC_BIG_ENDIAN);
1714     offset++;
1715     /* Octet 5
1716      * 8    7    6  5   4         3 2   1
1717      * Reserved | RXQUAL.FULL.up | RXQUAL.SUB.up
1718      */
1719     proto_tree_add_item(ie_tree, hf_rsl_rxqual_full_up, tvb, offset, 1, ENC_BIG_ENDIAN);
1720     proto_tree_add_item(ie_tree, hf_rsl_rxqual_sub_up, tvb, offset, 1, ENC_BIG_ENDIAN);
1721      offset++;
1722     /* Octet 6 - N
1723      * Supplementary Measurement Information
1724      */
1725     return ie_offset+length;
1726 }
1727
1728
1729 static const value_string rsl_class_vals[] = {
1730     {  0x00,    "Normal event" },
1731     {  0x01,    "Normal event" },
1732     {  0x02,    "Resource unavailable" },
1733     {  0x03,    "Service or option not available" },
1734     {  0x04,    "Service or option not implemented" },
1735     {  0x05,    "Invalid message (e.g. parameter out of range)" },
1736     {  0x06,    "Protocol error" },
1737     {  0x07,    "Interworking" },
1738     { 0,            NULL }
1739 };
1740
1741  /*
1742   * 9.3.26 Cause
1743   */
1744 static int
1745 dissect_rsl_ie_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1746 {
1747     proto_item *ti;
1748     proto_tree *ie_tree;
1749     guint       length;
1750     guint8      octet;
1751     int         ie_offset;
1752     guint8 ie_id;
1753
1754     if(is_mandatory == FALSE){
1755         ie_id = tvb_get_guint8(tvb,offset);
1756         if (ie_id != RSL_IE_CAUSE)
1757             return offset;
1758     }
1759
1760     ti = proto_tree_add_text(tree, tvb,offset,0,"Cause IE");
1761     ie_tree = proto_item_add_subtree(ti, ett_ie_cause);
1762
1763     /* Element identifier */
1764     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1765     offset++;
1766     /* Length */
1767     length = tvb_get_guint8(tvb,offset);
1768     proto_item_set_len(ti, length+2);
1769     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1770     offset++;
1771     ie_offset = offset;
1772
1773     /* Cause Value */
1774     octet = tvb_get_guint8(tvb,offset);
1775     proto_tree_add_item(tree, hf_rsl_extension_bit, tvb, offset, 1, ENC_BIG_ENDIAN);
1776     proto_tree_add_item(tree, hf_rsl_class, tvb, offset, 1, ENC_BIG_ENDIAN);
1777     if ((octet & 0x80) == 0x80)
1778     /* Cause Extension*/
1779         offset++;
1780
1781     /* Diagnostic(s) if any */
1782     return ie_offset+length;
1783 }
1784 /*
1785  * 9.3.27 Measurement result number
1786  */
1787
1788 static int
1789 dissect_rsl_ie_meas_res_no(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1790 {
1791     proto_item *ti;
1792     proto_tree *ie_tree;
1793     guint8 ie_id;
1794
1795     if(is_mandatory == FALSE){
1796         ie_id = tvb_get_guint8(tvb,offset);
1797         if (ie_id != RSL_IE_MEAS_RES_NO)
1798             return offset;
1799     }
1800
1801     ti = proto_tree_add_text(tree, tvb,offset,2,"Measurement result number IE");
1802     ie_tree = proto_item_add_subtree(ti, ett_ie_meas_res_no);
1803
1804     /* Element identifier */
1805     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1806     offset++;
1807
1808     /* Measurement result number */
1809     proto_tree_add_item(ie_tree, hf_rsl_meas_res_no, tvb, offset, 1, ENC_BIG_ENDIAN);
1810     offset++;
1811
1812     return offset;
1813 }
1814 /*
1815  * 9.3.28 Message Identifier
1816  */
1817 static int
1818 dissect_rsl_ie_message_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1819 {
1820     proto_item *ti;
1821     proto_tree *ie_tree;
1822     guint8 ie_id;
1823
1824     if(is_mandatory == FALSE){
1825         ie_id = tvb_get_guint8(tvb,offset);
1826         if (ie_id != RSL_IE_MESSAGE_ID)
1827             return offset;
1828     }
1829
1830     ti = proto_tree_add_text(tree, tvb,offset,0,"Message Identifier IE");
1831     ie_tree = proto_item_add_subtree(ti, ett_ie_message_id);
1832
1833     /* Element identifier */
1834     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1835     offset++;
1836     /* Message Type */
1837     proto_tree_add_item(tree, hf_rsl_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1838     offset++;
1839     return offset;
1840 }
1841 /*
1842  * 9.3.30 System Info Type
1843  */
1844 static const value_string rsl_sys_info_type_vals[] = {
1845     {  0x00,    "SYSTEM INFORMATION 8" },
1846     {  0x01,    "SYSTEM INFORMATION 1" },
1847     {  0x02,    "SYSTEM INFORMATION 2" },
1848     {  0x03,    "SYSTEM INFORMATION 3" },
1849     {  0x04,    "SYSTEM INFORMATION 4" },
1850     {  0x05,    "SYSTEM INFORMATION 5" },
1851     {  0x06,    "SYSTEM INFORMATION 6" },
1852     {  0x07,    "SYSTEM INFORMATION 7" },
1853     {  0x08,    "SYSTEM INFORMATION 16" },
1854     {  0x09,    "SYSTEM INFORMATION 17" },
1855     {  0x0a,    "SYSTEM INFORMATION 2bis" },
1856     {  0x0b,    "SYSTEM INFORMATION 2ter" },
1857     {  0x0d,    "SYSTEM INFORMATION 5bis" },
1858     {  0x0e,    "SYSTEM INFORMATION 5ter" },
1859     {  0x0f,    "SYSTEM INFORMATION 10" },
1860     {  0x47,    "EXTENDED MEASUREMENT ORDER" },
1861     {  0x48,    "MEASUREMENT INFORMATION" },
1862     {  0x28,    "SYSTEM INFORMATION 13" },
1863     {  0x29,    "SYSTEM INFORMATION 2quater" },
1864     {  0x2a,    "SYSTEM INFORMATION 9" },
1865     {  0x2b,    "SYSTEM INFORMATION 18" },
1866     {  0x2c,    "SYSTEM INFORMATION 19" },
1867     {  0x2d,    "SYSTEM INFORMATION 20" },
1868     { 0,            NULL }
1869 };
1870
1871
1872 static int
1873 dissect_rsl_ie_sys_info_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1874 {
1875     proto_item *ti;
1876     proto_tree *ie_tree;
1877     guint8 ie_id, sitype;
1878
1879     if(is_mandatory == FALSE){
1880         ie_id = tvb_get_guint8(tvb,offset);
1881         if (ie_id != RSL_IE_SYS_INFO_TYPE)
1882             return offset;
1883     }
1884
1885     ti = proto_tree_add_text(tree, tvb,offset,2,"System Info Type IE");
1886     ie_tree = proto_item_add_subtree(ti, ett_ie_sys_info_type);
1887
1888     /* Element identifier */
1889     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1890     offset++;
1891     /* Message Type */
1892     proto_tree_add_item(tree, hf_rsl_sys_info_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1893     sitype = tvb_get_guint8(tvb, offset);
1894     offset++;
1895
1896     /* Check if SI is 2q, if so set flag */
1897     if (sitype==0x29) {
1898         is_si2q = TRUE; }
1899
1900     return offset;
1901 }
1902
1903 /*
1904  * 9.3.35 Full Immediate Assign Info TLV 25
1905  */
1906 static int
1907 dissect_rsl_ie_full_imm_ass_inf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean is_mandatory)
1908 {
1909     proto_item *ti;
1910     proto_tree *ie_tree;
1911
1912     guint       length;
1913     tvbuff_t    *next_tvb;
1914     guint8      ie_id;
1915
1916     if(is_mandatory == FALSE){
1917         ie_id = tvb_get_guint8(tvb,offset);
1918         if (ie_id != RSL_IE_FULL_IMM_ASS_INF)
1919             return offset;
1920     }
1921
1922     ti = proto_tree_add_text(tree, tvb,offset,0,"Full Immediate Assign Info IE ");
1923     ie_tree = proto_item_add_subtree(ti, ett_ie_full_imm_ass_inf);
1924
1925     /* Element identifier */
1926     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1927     offset++;
1928     /* Length */
1929     length = tvb_get_guint8(tvb,offset);
1930     proto_item_set_len(ti, length+2);
1931
1932     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1933     offset++;
1934     /*  The Full Immediate Assign Info field (octets 3-25)
1935      * contains a complete immediate assign message (IMMEDIATE ASSIGNMENT or
1936      * IMMEDIATE ASSIGNMENT EXTENDED or IMMEDIATE ASSIGNMENT REJECT)
1937      * as defined in 3GPP TS 44.018.
1938      */
1939     proto_tree_add_text(ie_tree, tvb,offset,length,"Full Immediate Assign Info field");
1940     next_tvb = tvb_new_subset(tvb, offset, length, length);
1941     call_dissector(gsm_a_ccch_handle, next_tvb, pinfo, top_tree);
1942
1943     offset = offset + length;
1944
1945     return offset;
1946 }
1947
1948 /*
1949  * 9.3.36 SMSCB Information
1950  *
1951  * This element is used to convey a complete frame to be broadcast on the CBCH
1952  * including the Layer 2 header for the radio path.
1953  */
1954 static int
1955 dissect_rsl_ie_smscb_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1956 {
1957     proto_item *ti;
1958     proto_tree *ie_tree;
1959
1960     guint       length;
1961     guint8      ie_id;
1962
1963     if(is_mandatory == FALSE){
1964         ie_id = tvb_get_guint8(tvb,offset);
1965         if (ie_id != RSL_IE_SMSCB_INF)
1966             return offset;
1967     }
1968
1969     ti = proto_tree_add_text(tree, tvb,offset,0,"SMSCB Information IE ");
1970     ie_tree = proto_item_add_subtree(ti, ett_ie_smscb_inf);
1971
1972     /* Element identifier */
1973     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1974     offset++;
1975     /* Length */
1976     length = tvb_get_guint8(tvb,offset);
1977     proto_item_set_len(ti, length+2);
1978
1979     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1980     offset++;
1981     /*
1982      * SMSCB frame
1983      */
1984     proto_tree_add_text(ie_tree, tvb,offset,length,"SMSCB frame");
1985
1986     offset = offset + length;
1987
1988     return offset;
1989 }
1990
1991 /*
1992  * 9.3.37 MS Timing Offset
1993  */
1994
1995 static int
1996 dissect_rsl_ie_ms_timing_offset(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
1997 {
1998     proto_item *ti;
1999     proto_tree *ie_tree;
2000     guint8      ie_id;
2001
2002     if(is_mandatory == FALSE){
2003         ie_id = tvb_get_guint8(tvb,offset);
2004         if (ie_id != RSL_IE_FULL_MS_TIMING_OFFSET)
2005             return offset;
2006     }
2007
2008     ti = proto_tree_add_text(tree, tvb,offset,0,"MS Timing Offset IE");
2009     ie_tree = proto_item_add_subtree(ti, ett_ie_ms_timing_offset);
2010
2011     /* Element identifier */
2012     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2013     offset++;
2014
2015     /* Timing Offset
2016      * The meaning of the MS Timing Offset is as defined in 3GPP TS 45.010.
2017      * The value of MS Timing Offset is the binary value of the 8-bit Timing Offset field (octet 2) - 63.
2018      * The range of MS Timing Offset is therefore -63 to 192.
2019      */
2020     proto_tree_add_item(ie_tree, hf_rsl_timing_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
2021     offset++;
2022
2023     return offset;
2024 }
2025
2026 /*
2027  * 9.3.38 Erroneous Message
2028  * This information element is used to carry a complete A-bis interface message
2029  * which was considered erroneous at reception.
2030  */
2031 static int
2032 dissect_rsl_ie_err_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean is_mandatory)
2033 {
2034     proto_item *ti;
2035     proto_tree *ie_tree;
2036
2037     guint       length;
2038     guint8      ie_id;
2039     if(is_mandatory == FALSE){
2040         ie_id = tvb_get_guint8(tvb,offset);
2041         if (ie_id != RSL_IE_ERR_MSG)
2042             return offset;
2043     }
2044
2045     ti = proto_tree_add_text(tree, tvb,offset,0,"Erroneous Message IE ");
2046     ie_tree = proto_item_add_subtree(ti, ett_ie_err_msg);
2047
2048     /* Element identifier */
2049     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2050     offset++;
2051     /* Length */
2052     length = tvb_get_guint8(tvb,offset);
2053     proto_item_set_len(ti, length+2);
2054
2055     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2056     offset++;
2057
2058     /* Received Message */
2059     offset = dissct_rsl_msg(tvb, pinfo, ie_tree, offset);
2060
2061     return offset;
2062 }
2063
2064 /*
2065  * 9.3.39 Full BCCH Information (message name)
2066  */
2067 static int
2068 dissect_rsl_ie_full_bcch_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2069 {
2070     proto_item *ti;
2071     proto_tree *ie_tree;
2072     tvbuff_t    *next_tvb;
2073     guint16 length;
2074     guint8 ie_id;
2075
2076     if(is_mandatory == FALSE){
2077         ie_id = tvb_get_guint8(tvb,offset);
2078         if (ie_id != RSL_IE_FULL_BCCH_INF)
2079             return offset;
2080     }
2081
2082     ti = proto_tree_add_text(tree, tvb,offset,0,"Full BCCH Information IE");
2083     ie_tree = proto_item_add_subtree(ti, ett_ie_full_bcch_inf);
2084
2085     /* Element identifier */
2086     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2087     offset++;
2088     /* Length */
2089     length = tvb_get_guint8(tvb, offset);
2090     proto_item_set_len(ti, length+2);
2091     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2092     offset++;
2093
2094     /*
2095      * Octets 3-25 contain the complete L3 message as defined in 3GPP TS 44.018.
2096      */
2097
2098     proto_tree_add_text(ie_tree, tvb,offset,length,"Layer 3 message");
2099     next_tvb = tvb_new_subset(tvb, offset, length, length);
2100     call_dissector(gsm_a_ccch_handle, next_tvb, pinfo, top_tree);
2101
2102     offset = offset + length;
2103
2104     return offset;
2105  }
2106
2107 /*
2108  * 9.3.40 Channel Needed
2109  */
2110 static const value_string rsl_ch_needed_vals[] = {
2111     {  0x00,    "Any Channel" },
2112     {  0x01,    "SDCCH" },
2113     {  0x02,    "TCH/F (Full rate)" },
2114     {  0x03,    "TCH/F or TCH/H (Dual rate)" },
2115     { 0,        NULL }
2116 };
2117
2118 static int
2119 dissect_rsl_ie_ch_needed(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2120 {
2121     proto_item *ti;
2122     proto_tree *ie_tree;
2123     guint8      ie_id;
2124
2125     if(is_mandatory == FALSE){
2126         ie_id = tvb_get_guint8(tvb,offset);
2127         if (ie_id != RSL_IE_CH_NEEDED)
2128             return offset;
2129     }
2130
2131
2132     ti = proto_tree_add_text(tree, tvb,offset,0,"Channel Needed IE");
2133     ie_tree = proto_item_add_subtree(ti, ett_ie_ch_needed);
2134
2135     /* Element identifier */
2136     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2137     offset++;
2138
2139     /* Channel */
2140     proto_tree_add_item(ie_tree, hf_rsl_ch_needed, tvb, offset, 1, ENC_BIG_ENDIAN);
2141     offset++;
2142
2143     return offset;
2144 }
2145 /*
2146  * 9.3.41 CB Command type
2147  */
2148 static int
2149 dissect_rsl_ie_cb_cmd_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2150 {
2151     proto_item *ti;
2152     proto_tree *ie_tree;
2153     guint8      ie_id;
2154
2155     if(is_mandatory == FALSE){
2156         ie_id = tvb_get_guint8(tvb,offset);
2157         if (ie_id != RSL_IE_CB_CMD_TYPE)
2158             return offset;
2159     }
2160
2161
2162     ti = proto_tree_add_text(tree, tvb,offset,0,"CB Command type IE");
2163     ie_tree = proto_item_add_subtree(ti, ett_ie_cb_cmd_type);
2164
2165     /* Element identifier */
2166     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2167     offset++;
2168
2169     /* Channel */
2170     proto_tree_add_item(ie_tree, hf_rsl_ch_needed, tvb, offset, 1, ENC_BIG_ENDIAN);
2171     offset++;
2172
2173     return offset;
2174 }
2175
2176 /*
2177  * 9.3.42 SMSCB Message
2178  */
2179 static int
2180 dissect_rsl_ie_smscb_mess(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2181 {
2182     proto_item *ti;
2183     proto_tree *ie_tree;
2184     guint length;
2185     guint8 ie_id;
2186     int ie_offset;
2187
2188     if(is_mandatory == FALSE){
2189         ie_id = tvb_get_guint8(tvb,offset);
2190         if (ie_id != RSL_IE_SMSCB_MESS)
2191             return offset;
2192     }
2193     ti = proto_tree_add_text(tree, tvb,offset,0,"SMSCB Message IE");
2194     ie_tree = proto_item_add_subtree(ti, ett_ie_smscb_mess);
2195
2196     /* Element identifier */
2197     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2198     offset++;
2199     /* Length */
2200     length = tvb_get_guint8(tvb,offset);
2201     proto_item_set_len(ti, length+2);
2202     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2203     offset++;
2204     ie_offset = offset;
2205
2206     /*
2207      * SMSCB Message
2208      */
2209
2210     proto_tree_add_text(ie_tree, tvb,offset,length ,"SMSCB Message");
2211
2212     offset = ie_offset + length;
2213
2214     return offset;
2215 }
2216
2217 /*
2218  * 9.3.43 CBCH Load Information
2219  */
2220
2221 static const true_false_string rsl_cbch_load_type_vals = {
2222   "Overflow",
2223   "Underflow"
2224 };
2225
2226 static int
2227 dissect_rsl_ie_cbch_load_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2228 {
2229     proto_item *ti, *item;
2230     proto_tree *ie_tree;
2231     guint8      ie_id;
2232     guint8      octet;
2233
2234     if(is_mandatory == FALSE){
2235         ie_id = tvb_get_guint8(tvb,offset);
2236         if (ie_id != RSL_IE_CBCH_LOAD_INF)
2237             return offset;
2238     }
2239
2240
2241     ti = proto_tree_add_text(tree, tvb,offset,0,"CBCH Load Information IE");
2242     ie_tree = proto_item_add_subtree(ti, ett_ie_cbch_load_inf);
2243
2244     /* Element identifier */
2245     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2246     offset++;
2247
2248     octet = tvb_get_guint8(tvb,offset);
2249     /* CBCH Load Type */
2250     proto_tree_add_item(ie_tree, hf_rsl_cbch_load_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2251
2252     /* Message Slot Count */
2253     item = proto_tree_add_item(ie_tree, hf_rsl_msg_slt_cnt, tvb, offset, 1, ENC_BIG_ENDIAN);
2254     if ((octet & 0x80) == 0x80){
2255         proto_item_append_text(item,"The amount of SMSCB messages (1 to 15) that are needed immediately by BTS");
2256     }else{
2257         proto_item_append_text(item,"The amount of delay in message slots (1 to 15) that is needed immediately by BTS");
2258     }
2259     offset++;
2260
2261     return offset;
2262 }
2263
2264 /*
2265  * 9.3.44 SMSCB Channel Indicator
2266  */
2267
2268 static const value_string rsl_ch_ind_vals[] = {
2269     {  0x00,    "Basic CBCH" },
2270     {  0x01,    "Extended CBCH (supporting the extended CBCH by the network or MSs is optional)" },
2271     { 0,        NULL }
2272 };
2273
2274 static int
2275 dissect_rsl_ie_smscb_ch_ind(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2276 {
2277     proto_item *ti;
2278     proto_tree *ie_tree;
2279     guint8      ie_id;
2280
2281     if(is_mandatory == FALSE){
2282         ie_id = tvb_get_guint8(tvb,offset);
2283         if (ie_id != RSL_IE_SMSCB_CH_IND)
2284             return offset;
2285     }
2286
2287
2288     ti = proto_tree_add_text(tree, tvb,offset,0,"SMSCB Channel Indicator IE");
2289     ie_tree = proto_item_add_subtree(ti, ett_ie_smscb_ch_ind);
2290
2291     /* Element identifier */
2292     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2293     offset++;
2294
2295     /* Channel Ind */
2296     proto_tree_add_item(ie_tree, hf_rsl_ch_ind, tvb, offset, 1, ENC_BIG_ENDIAN);
2297     offset++;
2298
2299     return offset;
2300 }
2301
2302 /*
2303  * 9.3.45 Group call reference
2304  */
2305 static int
2306 dissect_rsl_ie_grp_call_ref(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean is_mandatory)
2307 {
2308     proto_item *ti;
2309     proto_tree *ie_tree;
2310     guint length;
2311     guint8 ie_id;
2312
2313     if(is_mandatory == FALSE){
2314         ie_id = tvb_get_guint8(tvb,offset);
2315         if (ie_id != RSL_IE_GRP_CALL_REF)
2316             return offset;
2317     }
2318     ti = proto_tree_add_text(tree, tvb,offset,0,"Group call reference IE");
2319     ie_tree = proto_item_add_subtree(ti, ett_ie_grp_call_ref);
2320
2321     /* Element identifier */
2322     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2323     offset++;
2324     /* Length */
2325     length = tvb_get_guint8(tvb,offset);
2326     proto_item_set_len(ti, length+2);
2327     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2328     offset++;
2329
2330     proto_tree_add_text(ie_tree, tvb,offset,length,"Descriptive group or broadcast call reference");
2331
2332     /* The octets 3 to 7 are coded in the same way as the octets 2 to 6
2333      * in the Descriptive group or broadcast call reference
2334      * information element as defined in 3GPP TS 24.008.
2335      */
2336     de_d_gb_call_ref(tvb, ie_tree, pinfo, offset, length, NULL, 0);
2337
2338     offset = offset + length;
2339
2340     return offset;
2341 }
2342 /*
2343  * 9.3.46 Channel description
2344  */
2345 static int
2346 dissect_rsl_ie_ch_desc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2347 {
2348     proto_item *ti;
2349     proto_tree *ie_tree;
2350     guint length;
2351     guint8 ie_id;
2352
2353     if(is_mandatory == FALSE){
2354         ie_id = tvb_get_guint8(tvb,offset);
2355         if (ie_id != RSL_IE_CH_DESC)
2356             return offset;
2357     }
2358     ti = proto_tree_add_text(tree, tvb,offset,0,"Channel description IE");
2359     ie_tree = proto_item_add_subtree(ti, ett_ie_ch_desc);
2360
2361     /* Element identifier */
2362     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2363     offset++;
2364     /* Length */
2365     length = tvb_get_guint8(tvb,offset);
2366     proto_item_set_len(ti, length+2);
2367     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2368     offset++;
2369
2370     proto_tree_add_text(ie_tree, tvb,offset,length,"Group Channel Description");
2371
2372     /* Octet j (j = 3, 4, ..., n) is the unchanged octet j-2 of a radio interface Group Channel description
2373      * information element as defined in 3GPP TS 44.018, n-2 is equal to the length of the radio interface
2374      * Group channel description information element
2375      */
2376
2377     offset = offset + length;
2378
2379     return offset;
2380 }
2381 /*
2382  * 9.3.47 NCH DRX information
2383  * This is a variable length element used to pass a radio interface information element
2384  * from BSC to BTS.
2385  */
2386 static int
2387 dissect_rsl_ie_nch_drx(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2388 {
2389     proto_item *ti;
2390     proto_tree *ie_tree;
2391     guint8      ie_id;
2392
2393     if(is_mandatory == FALSE){
2394         ie_id = tvb_get_guint8(tvb,offset);
2395         if (ie_id != RSL_IE_NCH_DRX_INF)
2396             return offset;
2397     }
2398
2399     ti = proto_tree_add_text(tree, tvb,offset,2,"NCH DRX information IE");
2400     ie_tree = proto_item_add_subtree(ti, ett_ie_nch_drx);
2401
2402     /* Element identifier */
2403     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2404     offset++;
2405     /* NCH DRX information */
2406     /* Octet 3 bits 7 and 8 are spare and set to zero. */
2407     /* Octet 3 bit 6 is the NLN status parameter as defined in 3GPP TS 44.018.*/
2408     /* Octet 3 bits 3, 4 and 5 are bits 1, 2 and 3 of the radio interface
2409      * eMLPP priority as defined in 3GPP TS 44.018.
2410      */
2411     /* Octet 3 bits 1 and 2 are bits 1 and 2 of the radio interface NLN
2412      * as defined in 3GPP TS 44.018.
2413      */
2414
2415     offset++;
2416
2417     return offset;
2418 }
2419 /*
2420  * 9.3.48 Command indicator
2421  */
2422
2423 static int
2424 dissect_rsl_ie_cmd_ind(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2425 {
2426     proto_item *ti;
2427     proto_tree *ie_tree;
2428     guint8      ie_id;
2429     guint8      octet;
2430
2431     if(is_mandatory == FALSE){
2432         ie_id = tvb_get_guint8(tvb,offset);
2433         if (ie_id != RSL_IE_CMD_IND)
2434             return offset;
2435     }
2436
2437
2438     /* TODO Length wrong if extended */
2439     ti = proto_tree_add_text(tree, tvb,offset,2,"Command indicator IE");
2440     ie_tree = proto_item_add_subtree(ti, ett_ie_cmd_ind);
2441
2442     /* Element identifier */
2443     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2444     offset++;
2445
2446     /* Extension bit */
2447     proto_tree_add_item(ie_tree, hf_rsl_extension_bit, tvb, offset, 1, ENC_BIG_ENDIAN);
2448
2449
2450     /* TODO this should probably be add_uint instead!!! */
2451     octet = tvb_get_guint8(tvb,offset);
2452     if ((octet&0x80)==0x80){
2453         /* extended */
2454         /* Command Extension */
2455         proto_tree_add_item(ie_tree, hf_rsl_command, tvb, offset, 2, ENC_BIG_ENDIAN);
2456         offset = offset+2;
2457     }else{
2458         /* Command Value */
2459         proto_tree_add_item(ie_tree, hf_rsl_command, tvb, offset, 1, ENC_BIG_ENDIAN);
2460         offset++;
2461     }
2462
2463     return offset;
2464 }
2465 /*
2466  * 9.3.49 eMLPP Priority
2467  */
2468 static const value_string rsl_emlpp_prio_vals[] = {
2469     {  0x00,    "no priority applied" },
2470     {  0x01,    "call priority level 4" },
2471     {  0x02,    "call priority level 3" },
2472     {  0x03,    "call priority level 2" },
2473     {  0x04,    "call priority level 1" },
2474     {  0x05,    "call priority level 0" },
2475     {  0x06,    "call priority level B" },
2476     {  0x07,    "call priority level A" },
2477     { 0,            NULL }
2478 };
2479
2480 static int
2481 dissect_rsl_ie_emlpp_prio(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2482 {
2483     proto_item *ti;
2484     proto_tree *ie_tree;
2485     guint8      ie_id;
2486
2487     if(is_mandatory == FALSE){
2488         ie_id = tvb_get_guint8(tvb,offset);
2489         if (ie_id != RSL_IE_EMLPP_PRIO)
2490             return offset;
2491     }
2492
2493     ti = proto_tree_add_text(tree, tvb,offset,2,"eMLPP Priority IE");
2494     ie_tree = proto_item_add_subtree(ti, ett_ie_emlpp_prio);
2495
2496     /* Element identifier */
2497     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2498     offset++;
2499
2500     /* The call priority field (bit 3 to 1 of octet 2) is coded in the same way
2501      * as the call priority field (bit 3 to 1 of octet 5) in the
2502      * Descriptive group or broadcast call reference information element
2503      * as defined in 3GPP TS 24.008.
2504      */
2505     proto_tree_add_item(ie_tree, hf_rsl_emlpp_prio, tvb, offset, 1, ENC_BIG_ENDIAN);
2506     offset++;
2507
2508     return offset;
2509 }
2510
2511 /*
2512  * 9.3.50 UIC
2513  */
2514 static int
2515 dissect_rsl_ie_uic(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2516 {
2517     proto_item *ti;
2518     proto_tree *ie_tree;
2519     guint8      ie_id;
2520
2521     if(is_mandatory == FALSE){
2522         ie_id = tvb_get_guint8(tvb,offset);
2523         if (ie_id != RSL_IE_UIC)
2524             return offset;
2525     }
2526
2527     ti = proto_tree_add_text(tree, tvb,offset,0,"UIC IE");
2528     ie_tree = proto_item_add_subtree(ti, ett_ie_uic);
2529
2530     /* Element identifier */
2531     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2532     offset++;
2533
2534     /* Octet 3 bits 1 to 6 contain the radio interface octet 2 bits 3 to 8 of the
2535      * UIC information element as defined in 3GPP TS 44.018.
2536      */
2537     proto_tree_add_text(ie_tree, tvb,offset,1,"UIC");
2538     offset++;
2539
2540     return offset;
2541 }
2542
2543 /*
2544  * 9.3.51 Main channel reference
2545  */
2546
2547 static int
2548 dissect_rsl_ie_main_ch_ref(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2549 {
2550     proto_item *ti;
2551     proto_tree *ie_tree;
2552     guint8      ie_id;
2553
2554     if(is_mandatory == FALSE){
2555         ie_id = tvb_get_guint8(tvb,offset);
2556         if (ie_id != RSL_IE_MAIN_CH_REF)
2557             return offset;
2558     }
2559
2560     ti = proto_tree_add_text(tree, tvb,offset,0,"Main channel reference IE");
2561     ie_tree = proto_item_add_subtree(ti, ett_ie_main_ch_ref);
2562
2563     /* Element identifier */
2564     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2565     offset++;
2566
2567     /* TN is time slot number, binary represented as in 3GPP TS 45.002.
2568      * 3 Bits
2569      */
2570     proto_tree_add_item(ie_tree, hf_rsl_ch_no_TN, tvb, offset, 1, ENC_BIG_ENDIAN);
2571     offset++;
2572     return offset;
2573 }
2574
2575 /*
2576  * 9.3.52 MultiRate configuration
2577  */
2578
2579 static int
2580 dissect_rsl_ie_multirate_conf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean is_mandatory)
2581 {
2582     proto_item *ti;
2583     proto_tree *ie_tree;
2584     guint length;
2585     guint8 ie_id;
2586
2587     if(is_mandatory == FALSE){
2588         ie_id = tvb_get_guint8(tvb,offset);
2589         if (ie_id != RSL_IE_MULTIRATE_CONF)
2590             return offset;
2591     }
2592     ti = proto_tree_add_text(tree, tvb,offset,0,"MultiRate configuration IE");
2593     ie_tree = proto_item_add_subtree(ti, ett_ie_multirate_conf);
2594
2595     /* Element identifier */
2596     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2597     offset++;
2598     /* Length */
2599     length = tvb_get_guint8(tvb,offset);
2600     proto_item_set_len(ti, length+2);
2601     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2602     offset++;
2603
2604     /* Rest of element coded as in 3GPP TS 44.018 not including
2605      * 3GPP TS 44.018 element identifier or 3GPP TS 44.018 octet length value
2606      */
2607
2608     de_rr_multirate_conf(tvb, ie_tree, pinfo, offset, length, NULL, 0);
2609
2610     offset = offset + length;
2611
2612     return offset;
2613 }
2614
2615 /*
2616  * 9.3.53 MultiRate Control
2617  */
2618 static int
2619 dissect_rsl_ie_multirate_cntrl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2620 {
2621     proto_item *ti;
2622     proto_tree *ie_tree;
2623     guint8 ie_id;
2624
2625     if(is_mandatory == FALSE){
2626         ie_id = tvb_get_guint8(tvb,offset);
2627         if (ie_id != RSL_IE_MULTIRATE_CNTRL)
2628             return offset;
2629     }
2630     ti = proto_tree_add_text(tree, tvb,offset,2,"MultiRate Control IE");
2631     ie_tree = proto_item_add_subtree(ti, ett_ie_multirate_cntrl);
2632
2633     /* Element identifier */
2634     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2635     offset++;
2636
2637     /* Bit 8 -5 Spare */
2638     /* The OD field (bit 5 of octet 3) indicates if the BSC expects distant parameters or
2639      * TFO Decision algorithm result from the BTS
2640      */
2641     /* The PRE field (bit 4 of octet 3) indicates if an handover is to be expected soon or not. */
2642     /* The RAE field (bits 2-3, octet 3) defines whether the RATSCCH mechanism is enabled or not.*/
2643     offset++;
2644
2645     return offset;
2646 }
2647
2648 /*
2649  * 9.3.54 Supported Codec Types
2650  * This element indicates the codec types supported by the BSS or remote BSS.
2651  */
2652 static int
2653 dissect_rsl_ie_sup_codec_types(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2654 {
2655     proto_item *ti;
2656     proto_tree *ie_tree;
2657     guint length;
2658     guint8 ie_id;
2659
2660     if(is_mandatory == FALSE){
2661         ie_id = tvb_get_guint8(tvb,offset);
2662         if (ie_id != RSL_IE_SUP_CODEC_TYPES)
2663             return offset;
2664     }
2665     ti = proto_tree_add_text(tree, tvb,offset,0,"Supported Codec Types IE");
2666     ie_tree = proto_item_add_subtree(ti, ett_ie_sup_codec_types);
2667
2668     /* Element identifier */
2669     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2670     offset++;
2671     /* Length */
2672     length = tvb_get_guint8(tvb,offset);
2673     proto_item_set_len(ti, length+2);
2674     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2675     offset++;
2676
2677     proto_tree_add_text(tree, tvb,offset,length,"Codec List");
2678
2679     /* The Codec List field (octet 4) lists the codec types that are supported
2680      * by the BSS and Transcoder, and are therefore potential candidates for TFO
2681      * establishment.
2682      */
2683     /* The Codec List extension 1 field (octet 5) lists additional codec types
2684      * that are supported by the BSS and Transcoder, and are therefore potential
2685      * candidates for TFO establishment. When no codec from this list is supported,
2686      * then this field shall not be sent, and the extension bit of octet 4 shall
2687      * be set to 0.
2688      */
2689     /* If bit 4 of the Codec List field (octet 4) indicates that FR AMR is supported
2690      * or if bit 5 of the Codec List field (octet 4) indicates that HR AMR is supported
2691      * and bit 8 is set to 0, or if bit 6 of the Codec List field (octet 4) indicates
2692      * that UMTS AMR is supported, or if bit 7 of the Codec List field (octet 4)
2693      * indicates that UMTS AMR 2 is supported, or if bit 1, 3, 4 or 5 of the Codec List
2694      * extension 1 field (octet 5) indicates that AMR WB is supported, the following
2695      * two octets (after the Codec List field and its extensions) is present
2696      */
2697
2698     return offset + length;
2699
2700 }
2701 /*
2702  * 9.3.55 Codec Configuration
2703  */
2704 /* The Active Codec Type field (bits 1-8, octet 3) indicates the type of codec in use. It is coded as follows: */
2705 /*
2706 0 0 0 0 . 0 0 0 0: Full Rate Codec in use
2707 0 0 0 0 . 0 0 0 1: Half Rate Codec in use
2708 0 0 0 0 . 0 0 1 0: Enhanced Full Rate Codec in use
2709 0 0 0 0 . 0 0 1 1: FR Adaptive Multi Rate Codec in use
2710 0 0 0 0 . 0 1 0 0: HR Adaptive Multi Rate Codec in use
2711 0 0 0 0 . 0 1 0 1: UMTS Adaptive Multi Rate Codec in use
2712 0 0 0 0 . 0 1 1 0: UMTS Adaptive Multi Rate 2 Codec in use
2713 0 0 0 0 . 1 0 0 1: Full Rate Adaptive Multi-Rate WideBand Codec in use
2714 0 0 0 0 1 0 1 0 UMTS Adaptive Multi-Rate WideBand Codec in use
2715 0 0 0 0 1 0 1 1 8PSK Half Rate Adaptive Multi-Rate Codec in use
2716 0 0 0 0 1 1 0 0 8PSK Full Rate Adaptive Multi-Rate WideBand Codec in use
2717 0 0 0 0 1 1 0 1 8PSK Half Rate Adaptive Multi-Rate WideBand Codec in use
2718 All other values are reserved for future use
2719 */
2720 static int
2721 dissect_rsl_ie_codec_conf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2722 {
2723     proto_item *ti;
2724     proto_tree *ie_tree;
2725     guint length;
2726     guint8 ie_id;
2727
2728     if(is_mandatory == FALSE){
2729         ie_id = tvb_get_guint8(tvb,offset);
2730         if (ie_id != RSL_IE_CODEC_CONF)
2731             return offset;
2732     }
2733     ti = proto_tree_add_text(tree, tvb,offset,0,"Codec Configuration IE");
2734     ie_tree = proto_item_add_subtree(ti, ett_ie_codec_conf);
2735
2736     /* Element identifier */
2737     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2738     offset++;
2739     /* Length */
2740     length = tvb_get_guint8(tvb,offset);
2741     proto_item_set_len(ti, length+2);
2742     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2743     offset++;
2744
2745     /* Active Codec Type */
2746
2747     return offset + length;
2748 }
2749
2750 /*
2751  * 9.3.56 Round Trip Delay
2752  * This element indicates the value of the calculated round trip delay between the BTS
2753  * and the transcoder, or between the BTS and the remote BTS, if TFO is established.
2754  */
2755
2756 static const value_string rsl_delay_ind_vals[] = {
2757     {  0x00,    "The RTD field contains the BTS-Transcoder round trip delay" },
2758     {  0x01,    "The RTD field contains the BTS-Remote BTS round trip delay" },
2759     { 0,            NULL }
2760 };
2761 static int
2762 dissect_rsl_ie_rtd(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2763 {
2764     proto_item *ti, *rtd_item;
2765     proto_tree *ie_tree;
2766     guint8      ie_id;
2767     guint8      rtd;
2768
2769     if(is_mandatory == FALSE){
2770         ie_id = tvb_get_guint8(tvb,offset);
2771         if (ie_id != RSL_IE_RTD)
2772             return offset;
2773     }
2774
2775     ti = proto_tree_add_text(tree, tvb,offset,0,"Round Trip Delay IE");
2776     ie_tree = proto_item_add_subtree(ti, ett_ie_rtd);
2777
2778     /* Element identifier */
2779     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2780     offset++;
2781
2782     /* The RTD field is the binary representation of the value of the
2783      * round trip delay in 20 ms increments.
2784      */
2785     rtd = (tvb_get_guint8(tvb,offset)>>1)*20;
2786     rtd_item = proto_tree_add_uint(tree, hf_rsl_rtd, tvb,offset,1,rtd);
2787     proto_item_append_text(rtd_item," ms");
2788
2789     /* The Delay IND field indicates if the delay corresponds to a BTS
2790      * to transcoder delay or to a BTS to remote BTS delay.
2791      */
2792     proto_tree_add_item(ie_tree, hf_rsl_delay_ind, tvb, offset, 1, ENC_BIG_ENDIAN);
2793     offset++;
2794
2795     return offset;
2796 }
2797 /*
2798  * 9.3.57 TFO Status
2799  * This element indicates if TFO is established. It is coded in 2 octets
2800  */
2801
2802 static const true_false_string rsl_tfo_vals = {
2803   "TFO is established",
2804   "TFO is not established"
2805 };
2806
2807 static int
2808 dissect_rsl_ie_tfo_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2809 {
2810     proto_item *ti;
2811     proto_tree *ie_tree;
2812     guint8      ie_id;
2813
2814     if(is_mandatory == FALSE){
2815         ie_id = tvb_get_guint8(tvb,offset);
2816         if (ie_id != RSL_IE_TFO_STATUS)
2817             return offset;
2818     }
2819
2820     ti = proto_tree_add_text(tree, tvb,offset,0,"TFO Status IE");
2821     ie_tree = proto_item_add_subtree(ti, ett_ie_tfo_status);
2822
2823     /* Element identifier */
2824     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2825     offset++;
2826
2827     proto_tree_add_item(ie_tree, hf_rsl_tfo, tvb, offset, 1, ENC_BIG_ENDIAN);
2828     offset++;
2829     return offset;
2830 }
2831 /*
2832  * 9.3.58 LLP APDU
2833  */
2834
2835 static int
2836 dissect_rsl_ie_llp_apdu(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2837 {
2838     proto_item *ti;
2839     proto_tree *ie_tree;
2840     guint8 length;
2841     int ie_offset;
2842     guint8 ie_id;
2843
2844     if(is_mandatory == FALSE){
2845         ie_id = tvb_get_guint8(tvb,offset);
2846         if (ie_id != RSL_IE_LLP_APDU)
2847             return offset;
2848     }
2849
2850     ti = proto_tree_add_text(tree, tvb,offset,0,"LLP APDU IE");
2851     ie_tree = proto_item_add_subtree(ti, ett_ie_llp_apdu);
2852
2853     /* Element identifier */
2854     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2855     offset++;
2856     /* Length */
2857     length = tvb_get_guint8(tvb, offset);
2858     proto_item_set_len(ti, length+2);
2859     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2860     offset++;
2861
2862     ie_offset = offset;
2863
2864     /* The rest of the information element contains the embedded message
2865      * that contains a Facility Information Element as defined in
2866      * 3GPP TS 44.071 excluding the Facility IEI and length of Facility IEI
2867      * octets defined in 3GPP TS 44.071.
2868      */
2869     /* TODO: Given traces with LLP data this IE could be further dissected */
2870     proto_tree_add_text(tree, tvb,offset,length,
2871         "Facility Information Element as defined in 3GPP TS 44.071");
2872     return ie_offset + length;
2873 }
2874 /*
2875  * 9.3.59 TFO transparent container
2876  * This is a variable length element that conveys a message associated with TFO protocol,
2877  * as defined in 3GPP TS 28.062. This element can be sent from the BSC to the BTS or
2878  * from the BTS to the BSC. The BTS shall retrieve the information it is able to understand,
2879  * and forward transparently the complete information to the BSC or to the TRAU.
2880  */
2881 static int
2882 dissect_rsl_ie_tfo_transp_cont(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
2883 {
2884     proto_item *ti;
2885     proto_tree *ie_tree;
2886     guint8 length;
2887     int ie_offset;
2888     guint8 ie_id;
2889
2890     if(is_mandatory == FALSE){
2891         ie_id = tvb_get_guint8(tvb,offset);
2892         if (ie_id != RSL_IE_TFO_TRANSP_CONT)
2893             return offset;
2894     }
2895
2896     ti = proto_tree_add_text(tree, tvb,offset,0,"TFO transparent container IE");
2897     ie_tree = proto_item_add_subtree(ti, ett_ie_tfo_transp_cont);
2898
2899     /* Element identifier */
2900     proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2901     offset++;
2902     /* Length */
2903     length = tvb_get_guint8(tvb, offset);
2904     proto_item_set_len(ti, length+2);
2905     proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2906     offset++;
2907
2908     ie_offset = offset;
2909
2910     /* The rest of the information element contains the embedded message
2911      * that contains a Facility Information Element as defined in
2912      * 3GPP TS 44.071 excluding the Facility IEI and length of Facility IEI
2913      * octets defined in 3GPP TS 44.071.
2914      */
2915     proto_tree_add_text(tree, tvb,offset,length,
2916         "Embedded message that contains the TFO configuration");
2917     return ie_offset + length;
2918 }
2919
2920 static int
2921 dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2922 {
2923     guint8  msg_type;
2924
2925     msg_type = tvb_get_guint8(tvb,offset)&0x7f;
2926     proto_tree_add_item(tree, hf_rsl_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2927     offset++;
2928
2929     switch (msg_type){
2930 /* Radio Link Layer Management messages */
2931     /* 8.3.1 DATA REQUEST */
2932     case RSL_MSG_TYPE_DATA_REQ:
2933         /* Channel number           9.3.1   M TV 2      */
2934         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
2935         /* Link Identifier          9.3.2   M TV 2      */
2936         offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
2937         /* L3 Information           9.3.11  M TLV >=3   */
2938         offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, TRUE);
2939         break;
2940     /* 8.3.2 DATA INDICATION */
2941     case RSL_MSG_TYPE_DATA_IND:
2942         /* Channel number           9.3.1   M TV 2      */
2943         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
2944         /* Link Identifier          9.3.2   M TV 2      */
2945         offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
2946         /* L3 Information           9.3.11  M TLV >=3   */
2947         offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, TRUE);
2948         break;
2949     /* 8.3.3 ERROR INDICATION */
2950     case RSL_MSG_TYPE_ERROR_IND:
2951         /* Channel number           9.3.1   M TV 2      */
2952         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
2953         /* Link Identifier          9.3.2   M TV 2      */
2954         offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
2955         /* RLM Cause                9.3.22  M TLV 2-4   */
2956         offset = dissect_rsl_ie_rlm_cause(tvb, pinfo, tree, offset, TRUE);
2957         break;
2958     /* 8.3.4 ESTABLISH REQUEST */
2959     case RSL_MSG_TYPE_EST_REQ:
2960         /* Channel number           9.3.1   M TV 2      */
2961         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
2962         /* Link Identifier          9.3.2   M TV 2      */
2963         offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
2964         break;
2965     /* 8.3.5 ESTABLISH CONFIRM */
2966     case RSL_MSG_TYPE_EST_CONF:
2967         /* Channel number           9.3.1   M TV 2      */
2968         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
2969         /* Link Identifier          9.3.2   M TV 2      */
2970         offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
2971         break;
2972     /* 8.3.6 */
2973     case RSL_MSG_EST_IND:
2974         /*  Channel number          9.3.1   M TV 2               */
2975         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
2976         /*  Link Identifier         9.3.2   M TV 2               */
2977         offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
2978         /*  L3 Information          9.3.11  O (note 1) TLV 3-23  */
2979         if(tvb_length_remaining(tvb,offset) >1)
2980             offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
2981         break;
2982     /* 8.3.7 RELEASE REQUEST */
2983     case RSL_MSG_REL_REQ:
2984         /*  Channel number          9.3.1   M TV 2               */
2985         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
2986         /*  Link Identifier         9.3.2   M TV 2               */
2987         offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
2988         /* Release Mode             9.3.20  M TV 2              */
2989         offset = dissect_rsl_ie_rel_mode(tvb, pinfo, tree, offset, TRUE);
2990         break;
2991     /* 8.3.8 RELEASE CONFIRM */
2992     case RSL_MSG_REL_CONF:
2993         /*  Channel number          9.3.1   M TV 2               */
2994         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
2995         /*  Link Identifier         9.3.2   M TV 2               */
2996         offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
2997         break;
2998     /* 8.3.9 RELEASE INDICATION */
2999     case RSL_MSG_REL_IND:
3000         /*  Channel number          9.3.1   M TV 2               */
3001         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3002         /*  Link Identifier         9.3.2   M TV 2               */
3003         offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
3004         break;
3005     /* 8.3.10 UNIT DATA REQUEST 10 */
3006     case RSL_MSG_UNIT_DATA_REQ:
3007         /*  Channel number          9.3.1   M TV 2               */
3008         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3009         /*  Link Identifier         9.3.2   M TV 2               */
3010         offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
3011         /*  L3 Information          9.3.11  O (note 1) TLV 3-23  */
3012         if(tvb_length_remaining(tvb,offset) > 0)
3013             offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3014         break;
3015 /* Common Channel Management/TRX Management messages */
3016     /* 8.5.1 BCCH INFORMATION 17*/
3017     case RSL_MSG_BCCH_INFO:
3018         /*  Channel number          9.3.1   M TV 2 */
3019         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3020         /*  System Info Type        9.3.30  M TV 2 */
3021         offset = dissect_rsl_ie_sys_info_type(tvb, pinfo, tree, offset, TRUE);
3022         /*  Full BCCH Info (SYS INFO) 9.3.39 O 1) TLV 25 */
3023         if(tvb_length_remaining(tvb,offset) > 0)
3024             offset = dissect_rsl_ie_full_bcch_inf(tvb, pinfo, tree, offset, TRUE);
3025         /*  Starting Time           9.3.23  O 2) TV 3 */
3026         if(tvb_length_remaining(tvb,offset) > 0)
3027             offset = dissect_rsl_ie_staring_time(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3028         break;
3029     /* 8.5.2 CCCH LOAD INDICATION 18*/
3030     case RSL_MSG_CCCH_LOAD_IND:
3031         /*  Channel number (note)   9.3.1   M TV 2 */
3032         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3033         /* Either RACH Load or Paging Load present */
3034         /*  RACH Load               9.3.18  C 1) TLV >=8 */
3035         offset = dissect_rsl_ie_rach_load(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3036         /*  Paging Load             9.3.15  C 2) TV 3 */
3037         if(tvb_length_remaining(tvb,offset) > 0)
3038             offset = dissect_rsl_ie_paging_load(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3039         break;
3040     /* 8.5.3 */
3041     case RSL_MSG_CHANRQD: /* 19 */
3042         /* Channel number           9.3.1   M TV 2 */
3043         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3044         /* Request Reference        9.3.19  M TV 4 */
3045         offset = dissect_rsl_ie_req_ref(tvb, pinfo, tree, offset, TRUE);
3046         /* Access Delay             9.3.17  M TV 2 */
3047         offset = dissect_rsl_ie_access_delay(tvb, pinfo, tree, offset, TRUE);
3048         /* Physical Context         9.3.16  O 1) TLV >=2 */
3049         if(tvb_length_remaining(tvb,offset) > 0)
3050             offset = dissect_rsl_ie_phy_ctx(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3051         break;
3052     /* 8.5.4 DELETE INDICATION */
3053     case RSL_MSG_DELETE_IND: /* 20 */
3054         /* Channel number           9.3.1   M TV 2 */
3055         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3056         /* Full Imm. Assign Info    9.3.35  M TLV 25 */
3057         offset = dissect_rsl_ie_full_imm_ass_inf(tvb, pinfo, tree, offset, TRUE);
3058         break;
3059     case RSL_MSG_PAGING_CMD:    /* 21 */
3060         /* Channel number           9.3.1   M TV 2 */
3061         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3062         /* Paging Group             9.3.14  M TV 2 2 */
3063         offset = dissect_rsl_ie_paging_grp(tvb, pinfo, tree, offset, TRUE);
3064         /* MS Identity              9.3.12  M TLV 2-10 2 */
3065         offset = dissect_rsl_ie_ms_id(tvb, pinfo, tree, offset, TRUE);
3066         /* Channel Needed           9.3.40  O 1) TV 2 2 */
3067         if(tvb_length_remaining(tvb,offset) > 0)
3068             offset = dissect_rsl_ie_ch_needed(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3069         /* eMLPP Priority           9.3.49  O 2) TV 2 2 */
3070         if(tvb_length_remaining(tvb,offset) > 0)
3071             offset = dissect_rsl_ie_emlpp_prio(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3072         break;
3073     /* 8.5.6 IMMEDIATE ASSIGN COMMAND */
3074     case RSL_MSG_IMM_ASS_CMD:   /* 22 */
3075         /* Channel number           9.3.1   M TV 2 */
3076         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3077         /* Full Imm. Assign Info    9.3.35  M TLV 25 */
3078         offset = dissect_rsl_ie_full_imm_ass_inf(tvb, pinfo, tree, offset, TRUE);
3079         break;
3080     /* 8.5.7 SMS BROADCAST REQUEST */
3081     case RSL_MSG_SMS_BC_REQ:    /*  23   8.5.7 */
3082         /* Channel number           9.3.1   M TV 2 */
3083         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3084         /* SMSCB Information        9.3.36  M TV 24 */
3085         offset = dissect_rsl_ie_smscb_inf(tvb, pinfo, tree, offset, TRUE);
3086         /* SMSCB Channel Indicator  9.3.44  O 1) TV 2 */
3087         if(tvb_length_remaining(tvb,offset) > 0)
3088             offset = dissect_rsl_ie_smscb_ch_ind(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3089         break;
3090 /* 8.6 TRX MANAGEMENT MESSAGES */
3091     /* 8.6.1 RF RESOURCE INDICATION */
3092     case RSL_MSG_RF_RES_IND:    /*  24   8.6.1 */
3093         /* Resource Information     9.3.21  M TLV >=2 */
3094         offset = dissect_rsl_ie_resource_inf(tvb, pinfo, tree, offset, TRUE);
3095         break;
3096     /* 8.6.2 SACCH FILLING */
3097     case RSL_MSG_SACCH_FILL:    /*  25   8.6.2 */
3098         /* System Info Type         9.3.30  M TV 2 */
3099         offset = dissect_rsl_ie_sys_info_type(tvb, pinfo, tree, offset, TRUE);
3100         /* L3 Info (SYS INFO)       9.3.11 O 1) TLV 22 */
3101         if(tvb_length_remaining(tvb,offset) > 0)
3102             offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3103         /* Starting Time            9.3.23 O 2) TV 3 */
3104         if(tvb_length_remaining(tvb,offset) > 0)
3105             offset = dissect_rsl_ie_staring_time(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3106         break;
3107     case RSL_MSG_OVERLOAD:      /*  27   8.6.3 */
3108         /* Cause                    9.3.26  M TLV >=3 */
3109         offset = dissect_rsl_ie_cause(tvb, pinfo, tree, offset, TRUE);
3110         break;
3111     case RSL_MSG_ERROR_REPORT:  /*  28   8.6.4 */
3112         /* Cause                    9.3.26  M TLV >=3 */
3113         offset = dissect_rsl_ie_cause(tvb, pinfo, tree, offset, TRUE);
3114         /* Message Identifier       9.3.28  O 1) TV 2 */
3115         if(tvb_length_remaining(tvb,offset) > 0)
3116             offset = dissect_rsl_ie_message_id(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3117         /* Channel Number           9.3.1   O 2) TV 2 */
3118         if(tvb_length_remaining(tvb,offset) > 0)
3119             offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3120         /* Link identifier          9.3.2   O 3) TV 2 */
3121         if(tvb_length_remaining(tvb,offset) > 0)
3122             offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
3123         /* Erroneous Message        9.3.38  O 4) TLV >=3 */
3124         if(tvb_length_remaining(tvb,offset) > 0)
3125             offset = dissect_rsl_ie_err_msg(tvb, pinfo, tree, offset, TRUE);
3126         break;
3127     /* 8.5.8 SMS BROADCAST COMMAND */
3128     case RSL_MSG_SMS_BC_CMD:    /*  29   8.5.8 */
3129         /* Channel number           9.3.1   M TV 2 */
3130         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3131         /* CB Command type          9.3.41  M TV 2 */
3132         offset = dissect_rsl_ie_cb_cmd_type(tvb, pinfo, tree, offset, TRUE);
3133         /* SMSCB message            9.3.42  M TLV 2-90 */
3134         offset = dissect_rsl_ie_smscb_mess(tvb, pinfo, tree, offset, TRUE);
3135         /* SMSCB Channel Indicator  9.3.44  O 1) TV 2 */
3136         if(tvb_length_remaining(tvb,offset) > 0)
3137             offset = dissect_rsl_ie_smscb_ch_ind(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3138         break;
3139     case RSL_MSG_CBCH_LOAD_IND: /*  30   8.5.9 */
3140         /* Channel number           9.3.1   M TV 2 */
3141         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3142         /* CBCH Load Information    9.3.43  M TV 2 */
3143         offset = dissect_rsl_ie_cbch_load_inf(tvb, pinfo, tree, offset, TRUE);
3144         /* SMSCB Channel Indicator  9.3.44 O 1) TV 2 */
3145         if(tvb_length_remaining(tvb,offset) > 0)
3146             offset = dissect_rsl_ie_smscb_ch_ind(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3147         break;
3148     case RSL_MSG_NOT_CMD:       /*  31   8.5.10 */
3149         /* Channel number           9.3.1   M TV 2 */
3150         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3151         /* Command indicator        9.3.48 M 1) TLV 3-4 */
3152         offset = dissect_rsl_ie_cmd_ind(tvb, pinfo, tree, offset, TRUE);
3153         /* Group call reference     9.3.45 O TLV 7 */
3154         if(tvb_length_remaining(tvb,offset) > 0)
3155             offset = dissect_rsl_ie_grp_call_ref(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3156         /* Channel Description      9.3.46 O TLV 3-n */
3157         if(tvb_length_remaining(tvb,offset) > 0)
3158             offset = dissect_rsl_ie_ch_desc(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3159         /* NCH DRX information      9.3.47 O TLV 3 */
3160         if(tvb_length_remaining(tvb,offset) > 0)
3161             offset = dissect_rsl_ie_nch_drx(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3162         break;
3163
3164 /* Dedicated Channel Management messages: */
3165     /* 8.4.1 CHANNEL ACTIVATION 33*/
3166     case RSL_MSG_CHAN_ACTIV:
3167         /* Channel number           9.3.1   M TV 2          */
3168         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3169         /* Activation Type          9.3.3   M TV 2          */
3170         offset = dissect_rsl_ie_act_type(tvb, pinfo, tree, offset, TRUE);
3171         /* Channel Mode             9.3.6   M TLV 8-9       */
3172         offset = dissect_rsl_ie_ch_mode(tvb, pinfo, tree, offset, TRUE);
3173         /* Channel Identification   9.3.5   O 7) TLV 8      */
3174         if(tvb_length_remaining(tvb,offset) > 0)
3175             offset = dissect_rsl_ie_ch_id(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3176         /* Encryption information   9.3.7   O 1) TLV >=3    */
3177         if(tvb_length_remaining(tvb,offset) > 0)
3178             offset = dissect_rsl_ie_enc_inf(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3179         /* Handover Reference       9.3.9   C 2) TV 2       */
3180         if(tvb_length_remaining(tvb,offset) > 0)
3181             offset = dissect_rsl_ie_ho_ref(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3182         /* BS Power                 9.3.4   O 3) TV 2       */
3183         if(tvb_length_remaining(tvb,offset) > 0)
3184             offset = dissect_rsl_ie_bs_power(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3185         /* MS Power                 9.3.13  O 3) TV 2       */
3186         if(tvb_length_remaining(tvb,offset) > 0)
3187             offset = dissect_rsl_ie_ms_pow(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3188         /* Timing Advance           9.3.24  C 3) 4) TV 2    */
3189         if(tvb_length_remaining(tvb,offset) > 0)
3190             offset = dissect_rsl_ie_timing_adv(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3191         /* BS Power Parameters      9.3.32  O 5) TLV >=2    */
3192         /* MS Power Parameters      9.3.31  O 5) TLV >=2    */
3193         /* Physical Context         9.3.16  O 6) TLV >=2    */
3194         if(tvb_length_remaining(tvb,offset) > 0)
3195             offset = dissect_rsl_ie_phy_ctx(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3196         /* SACCH Information        9.3.29  O 8) TLV >=3    */
3197         /* UIC                      9.3.50  O 9) TLV 3      */
3198         if(tvb_length_remaining(tvb,offset) > 0)
3199             offset = dissect_rsl_ie_uic(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3200         /* Main channel reference   9.3.51  O 10) TV 2      */
3201         if(tvb_length_remaining(tvb,offset) > 0)
3202             offset = dissect_rsl_ie_main_ch_ref(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3203         /* MultiRate configuration  9.3.52  O 11) TLV >=4   */
3204         if(tvb_length_remaining(tvb,offset) > 0)
3205             offset = dissect_rsl_ie_multirate_conf(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3206         /* MultiRate Control        9.3.53  O 12) TV 2      */
3207         if(tvb_length_remaining(tvb,offset) > 0)
3208             offset = dissect_rsl_ie_multirate_cntrl(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3209             /* Supported Codec Types    9.3.54  O 12) TLV >=5   */
3210         if(tvb_length_remaining(tvb,offset) > 0)
3211             offset = dissect_rsl_ie_sup_codec_types(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3212         /* TFO transparent container 9.3.59 O 12) TLV >=3   */
3213         if(tvb_length_remaining(tvb,offset) > 0)
3214             offset = dissect_rsl_ie_tfo_transp_cont(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3215         break;
3216
3217     /* 8.4.2 CHANNEL ACTIVATION ACKNOWLEDGE 34*/
3218     case RSL_MSG_CHAN_ACTIV_ACK:
3219         /* Channel number           9.3.1   M TV 2          */
3220         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3221         /* Frame number             9.3.8   M TV 3          */
3222         offset = dissect_rsl_ie_frame_no(tvb, pinfo, tree, offset, TRUE);
3223         break;
3224     case RSL_MSG_CHAN_ACTIV_N_ACK:
3225     /* 8.4.3 CHANNEL ACTIVATION NEGATIVE ACKNOWLEDGE */
3226         /* Channel number           9.3.1   M TV 2          */
3227         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3228         /* Cause                    9.3.26  M TLV >=3       */
3229         offset = dissect_rsl_ie_cause(tvb, pinfo, tree, offset, TRUE);
3230         break;
3231     /* 8.4.4 CONNECTION FAILURE INDICATION */
3232     case RSL_MSG_CONN_FAIL:
3233         /* Channel number           9.3.1   M TV 2          */
3234         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3235         /* Cause                    9.3.26  M TLV >=3       */
3236         offset = dissect_rsl_ie_cause(tvb, pinfo, tree, offset, TRUE);
3237         break;
3238     /* 8.4.5 DEACTIVATE SACCH */
3239     case RSL_MSG_DEACTIVATE_SACCH:
3240         /* Channel number           9.3.1   M TV 2          */
3241         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3242         break;
3243     /* 8.4.6 ENCRYPTION COMMAND */
3244     case RSL_MSG_ENCR_CMD:          /*  38   8.4.6 */
3245         /* Channel number           9.3.1   M TV 2          */
3246         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3247         /* Encryption information   9.3.7   M TLV >=3       */
3248         offset = dissect_rsl_ie_enc_inf(tvb, pinfo, tree, offset, TRUE);
3249         /* Link Identifier          9.3.2   M TV 2          */
3250         offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
3251         /* L3 Info (CIPH MOD CMD)   9.3.11  M TLV 6         */
3252         offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, TRUE);
3253         break;
3254     /* 8.4.7 HANDOVER DETECTION */
3255     case RSL_MSG_HANDODET:          /*  39   8.4.7 */
3256         /* Channel number           9.3.1   M TV 2          */
3257         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3258         /* Access Delay             9.3.17 O 1) TV 2        */
3259         if(tvb_length_remaining(tvb,offset) > 0)
3260             offset = dissect_rsl_ie_access_delay(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3261         break;
3262     /* 8.4.8 MEASUREMENT RESULT 40 */
3263     case RSL_MSG_MEAS_RES:
3264         /* Channel number           9.3.1   M TV 2          */
3265         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3266         /* Measurement result number 9.3.27 M TV 2          */
3267         offset = dissect_rsl_ie_meas_res_no(tvb, pinfo, tree, offset, TRUE);
3268         /* Uplink Measurements      9.3.25  M TLV >=5       */
3269         offset = dissect_rsl_ie_uplik_meas(tvb, pinfo, tree, offset, TRUE);
3270         /* BS Power                 9.3.4   M TV 2          */
3271         offset = dissect_rsl_ie_bs_power(tvb, pinfo, tree, offset, TRUE);
3272         /* L1 Information           9.3.10 O 1) TV 3        */
3273         if(tvb_length_remaining(tvb,offset) > 0)
3274             offset = dissect_rsl_ie_l1_inf(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3275         /* L3 Info (MEAS REP, EXT MEAS REP or ENH MEAS REP) 9.3.11 O 1) TLV 21 */
3276         if(tvb_length_remaining(tvb,offset) > 0)
3277             offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3278         /* MS Timing Offset         9.3.37 O 2) TV 2        */
3279         if(tvb_length_remaining(tvb,offset) > 0)
3280             offset = dissect_rsl_ie_ms_timing_offset(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3281         break;
3282     /* 8.4.9 MODE MODIFY */
3283     case RSL_MSG_MODE_MODIFY_REQ:   /*  41  8.4.9 */
3284         /* Channel number           9.3.1 M TV 2 */
3285         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3286         /* Channel Mode             9.3.6 M TLV 8-9 */
3287         offset = dissect_rsl_ie_ch_mode(tvb, pinfo, tree, offset, TRUE);
3288         /* Encryption information   9.3.7 O 1) TLV >=3 */
3289         if(tvb_length_remaining(tvb,offset) > 0)
3290             offset = dissect_rsl_ie_enc_inf(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3291         /* Main channel reference   9.3.45 O 2) TV 2 */
3292         if(tvb_length_remaining(tvb,offset) > 0)
3293             offset = dissect_rsl_ie_main_ch_ref(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3294         /* MultiRate configuration  9.3.52 O 3) TLV >=3 */
3295         if(tvb_length_remaining(tvb,offset) > 0)
3296             offset = dissect_rsl_ie_multirate_conf(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3297         /* Multirate Control        9.3.53 O 4) TV 2 */
3298         if(tvb_length_remaining(tvb,offset) > 0)
3299             offset = dissect_rsl_ie_multirate_cntrl(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3300         /* Supported Codec Types    9.3.54 O 4) TLV >=5 */
3301         if(tvb_length_remaining(tvb,offset) > 0)
3302             offset = dissect_rsl_ie_sup_codec_types(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3303         /* TFO transparent container 9.3.59 O 4) TLV */
3304         if(tvb_length_remaining(tvb,offset) > 0)
3305             offset = dissect_rsl_ie_tfo_transp_cont(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3306         break;
3307     /* 8.4.10 MODE MODIFY ACKNOWLEDGE */
3308     case RSL_MSG_MODE_MODIFY_ACK:   /*  42  8.4.10 */
3309         /* Channel number           9.3.1   M TV 2          */
3310         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3311         break;
3312     /* 8.4.11 MODE MODIFY NEGATIVE ACKNOWLEDGE */
3313     case RSL_MSG_MODE_MODIFY_NACK:  /*  43  8.4.11 */
3314         /* Channel number           9.3.1   M TV 2          */
3315         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3316         /* Cause                    9.3.26  M TLV >=3       */
3317         offset = dissect_rsl_ie_cause(tvb, pinfo, tree, offset, TRUE);
3318         break;
3319     /* 8.4.12 PHYSICAL CONTEXT REQUEST */
3320     case RSL_MSG_PHY_CONTEXT_REQ:   /*  44  8.4.12 */
3321         /* Channel number           9.3.1   M TV 2          */
3322         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3323         break;
3324     /* 8.4.13 PHYSICAL CONTEXT CONFIRM */
3325     case RSL_MSG_PHY_CONTEXT_CONF:  /*  45  8.4.13 */
3326         /* Channel number           9.3.1   M TV 2 */
3327         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3328         /* BS Power                 9.3.4   M TV 2 */
3329         offset = dissect_rsl_ie_bs_power(tvb, pinfo, tree, offset, TRUE);
3330         /* MS Power                 9.3.13  M TV 2 */
3331         offset = dissect_rsl_ie_ms_pow(tvb, pinfo, tree, offset, TRUE);
3332         /* Timing Advance           9.3.24  M TV 2 */
3333         offset = dissect_rsl_ie_timing_adv(tvb, pinfo, tree, offset, TRUE);
3334         /* Physical Context         9.3.16  O 1) TLV */
3335         if(tvb_length_remaining(tvb,offset) > 0)
3336             offset = dissect_rsl_ie_phy_ctx(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3337         break;
3338     /* 8.4.14 RF CHANNEL RELEASE */
3339     case RSL_MSG_RF_CHAN_REL:       /*  46  8.4.14 */
3340         /* Channel number           9.3.1   M TV 2          */
3341         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3342         break;
3343     /* 8.4.15 MS POWER CONTROL */
3344     case RSL_MSG_MS_POWER_CONTROL:  /*  47  8.4.15 */
3345         /* Channel number           9.3.1   M TV 2 */
3346         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3347         /* MS Power                 9.3.13  M TV 2 */
3348         if(tvb_length_remaining(tvb,offset) > 0)
3349             offset = dissect_rsl_ie_ms_pow(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3350         /* MS Power Parameters      9.3.31  O 1) TLV >=2 */
3351         break;
3352     /* 8.4.16 BS POWER CONTROL */
3353     case RSL_MSG_BS_POWER_CONTROL:  /*  48  8.4.16 */
3354         /* Channel number           9.3.1 M TV 2 */
3355         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3356         /* BS Power                 9.3.4 M TV 2 */
3357         offset = dissect_rsl_ie_bs_power(tvb, pinfo, tree, offset, TRUE);
3358         /* BS Power Parameters      9.3.32 O 1) TLV >=2 */
3359         break;
3360     /* 8.4.17 PREPROCESS CONFIGURE */
3361     case RSL_MSG_PREPROC_CONFIG:        /*  49  8.4.17 */
3362         /* Channel number           9.3.1   M TV 2 */
3363         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3364         /* Preproc. Parameters      9.3.33  M TLV >=3 */
3365         break;
3366     /* 8.4.18 PREPROCESSED MEASUREMENT RESULT */
3367     case RSL_MSG_PREPROC_MEAS_RES:  /*  50  8.4.18 */
3368         /* Channel number           9.3.1   M TV 2 */
3369         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3370         /* Preproc. Measurements    9.3.34  M TLV >=2 */
3371         break;
3372     /* 8.4.19 RF CHANNEL RELEASE ACKNOWLEDGE */
3373     case RSL_MSG_RF_CHAN_REL_ACK:       /*  51  8.4.19 */
3374         /* Channel number           9.3.1   M TV 2          */
3375         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3376         break;
3377     /* 8.4.20 SACCH INFO MODIFY */
3378     case RSL_MSG_SACCH_INFO_MODIFY: /*  52  8.4.20 */
3379         /* Channel number           9.3.1   M TV 2 */
3380         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3381         /* System Info Type         9.3.30  M TV 2 */
3382         offset = dissect_rsl_ie_sys_info_type(tvb, pinfo, tree, offset, TRUE);
3383         /* L3 Info                  9.3.11  O 1) TLV 22 */
3384         if(tvb_length_remaining(tvb,offset) > 0)
3385             offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3386         /* Starting Time            9.3.23  O 2) TV 3 */
3387         if(tvb_length_remaining(tvb,offset) > 0)
3388             offset = dissect_rsl_ie_staring_time(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3389         break;
3390     /* 8.4.21 TALKER DETECTION */
3391     case RSL_MSG_TALKER_DET:            /*  53  8.4.21 */
3392         /* Channel number           9.3.1   M TV 2 */
3393         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3394         /* Access Delay             9.3.17  O 1) TV 2 */
3395         if(tvb_length_remaining(tvb,offset) > 0)
3396                 offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3397         break;
3398     /* 8.4.22 LISTENER DETECTION */
3399     case RSL_MSG_LISTENER_DET:      /*  54  8.4.22 */
3400         /* Channel number           9.3.1   M TV 2 */
3401         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3402         /* Access Delay             9.3.17  O 1) TV 2 */
3403         if(tvb_length_remaining(tvb,offset) > 0)
3404                 offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3405         break;
3406     /* 8.4.23 REMOTE CODEC CONFIGURATION REPORT */
3407     case RSL_MSG_REMOTE_CODEC_CONF_REP:/*   55  8.4.23 */
3408         /* Channel number           9.3.1   M TV 2 */
3409         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3410         /* Codec Configuration      9.3.55  M TLV >=3 */
3411         offset = dissect_rsl_ie_codec_conf(tvb, pinfo, tree, offset, TRUE);
3412         /* Supported Codec Types    9.3.54  M TLV >=5 */
3413         if(tvb_length_remaining(tvb,offset) > 0)
3414             offset = dissect_rsl_ie_sup_codec_types(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3415         /* TFO transparent container 9.3.59 O 4) TLV >=3 */
3416         if(tvb_length_remaining(tvb,offset) > 0)
3417             offset = dissect_rsl_ie_tfo_transp_cont(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3418         break;
3419     /* 8.4.24 ROUND TRIP DELAY REPORT */
3420     case RSL_MSG_R_T_D_REP:         /*  56  8.4.24 */
3421         /* Channel number           9.3.1   M TV 2 */
3422         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3423         /* Round Trip Delay         9.3.56  M TV 2 */
3424         offset = dissect_rsl_ie_rtd(tvb, pinfo, tree, offset, TRUE);
3425         break;
3426     /* 8.4.25 PRE-HANDOVER NOTIFICATION */
3427     case RSL_MSG_PRE_HANDO_NOTIF:       /*  57  8.4.25 */
3428         /* Channel number           9.3.1   M TV 2 */
3429         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3430         /* MultiRateControl         9.3.53  M TV 2 */
3431         offset = dissect_rsl_ie_multirate_cntrl(tvb, pinfo, tree, offset, TRUE);
3432         /* Codec Configuration      9.3.55  M TLV >=3 */
3433         offset = dissect_rsl_ie_codec_conf(tvb, pinfo, tree, offset, TRUE);
3434         /* TFO transparent container 9.3.59 O 4) TLV >=3 */
3435         if(tvb_length_remaining(tvb,offset) > 0)
3436             offset = dissect_rsl_ie_tfo_transp_cont(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3437         break;
3438     /* 8.4.26 MULTIRATE CODEC MODIFICATION REQUEST */
3439     case RSL_MSG_MR_CODEC_MOD_REQ:  /*  58  8.4.26 */
3440         /* Channel number           9.3.1   M TV 2 */
3441         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3442         /* MultiRate Configuration  9.3.52  O 1) TLV >=4 */
3443         if(tvb_length_remaining(tvb,offset) > 0)
3444             offset = dissect_rsl_ie_multirate_conf(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3445         break;
3446     /*  8.4.27 MULTIRATE CODEC MODIFICATION ACKNOWLEDGE */
3447     case RSL_MSG_MR_CODEC_MOD_ACK:  /*  59  8.4.27 */
3448         /* Channel number           9.3.1   M TV 2 */
3449         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3450         /* MultiRate Configuration  9.3.52  O 1) TLV >=4 */
3451         if(tvb_length_remaining(tvb,offset) > 0)
3452             offset = dissect_rsl_ie_multirate_conf(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3453         break;
3454     /* 8.4.28 MULTIRATE CODEC MODIFICATION NEGATIVE ACKNOWLEDGE */
3455     case RSL_MSG_MR_CODEC_MOD_NACK: /*  60  8.4.28 */
3456         /* Channel number           9.3.1   M TV 2          */
3457         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3458         /* Cause                    9.3.26  M TLV >=3       */
3459         offset = dissect_rsl_ie_cause(tvb, pinfo, tree, offset, TRUE);
3460         break;
3461     /* 8.4.29 MULTIRATE CODEC MODIFICATION PERFORMED */
3462     case RSL_MSG_MR_CODEC_MOD_PER:  /*  61  8.4.29 */
3463         /* Channel number           9.3.1   M TV 2 */
3464         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3465         /* MultiRate Configuration  9.3.52  M TLV >=4 */
3466         offset = dissect_rsl_ie_multirate_conf(tvb, pinfo, tree, offset, TRUE);
3467         break;
3468     /* 8.4.30 TFO REPORT */
3469     case RSL_MSG_TFO_REP:               /*  62  8.4.30 */
3470         /* Channel number           9.3.1   M TV 2 */
3471         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3472         /* TFO Status               9.3.57  M TV 1 */
3473         offset = dissect_rsl_ie_tfo_status(tvb, pinfo, tree, offset, TRUE);
3474         break;
3475     /* 8.4.31 TFO MODIFICATION REQUEST */
3476     case RSL_MSG_TFO_MOD_REQ:           /*  63  8.4.31 */
3477         /* Channel number           9.3.1 M TV 2 */
3478         offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
3479         /* MultiRateControl         9.3.53 M TV 2 */
3480         offset = dissect_rsl_ie_multirate_cntrl(tvb, pinfo, tree, offset, TRUE);
3481         /* Supported Codec Type     9.3.54 O 1) TLV >=5 */
3482         if(tvb_length_remaining(tvb,offset) > 0)
3483             offset = dissect_rsl_ie_sup_codec_types(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3484         /* TFO transparent container 9.3.59 O 4) TLV >=3 */
3485         if(tvb_length_remaining(tvb,offset) > 0)
3486             offset = dissect_rsl_ie_tfo_transp_cont(tvb, pinfo, tree, offset, ENC_BIG_ENDIAN);
3487         break;
3488     /*  0 1 - - - - - - Location Services messages: */
3489     /* 8.7.1 LOCATION INFORMATION */
3490     case RSL_MSG_LOC_INF:               /*  65  8.7.1 */
3491         /* LLP APDU 9.3.58 M LV 2-N */
3492         offset = dissect_rsl_ie_llp_apdu(tvb, pinfo, tree, offset, TRUE);
3493         break;
3494     default:
3495         break;
3496     }
3497
3498     return offset;
3499
3500 }
3501 static void
3502 dissect_rsl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3503 {
3504     proto_item *ti;
3505     proto_tree *rsl_tree;
3506     guint8  msg_type;
3507
3508
3509     int offset = 0;
3510
3511     col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSL");
3512     col_clear(pinfo->cinfo, COL_INFO);
3513
3514     msg_type = tvb_get_guint8(tvb,offset+1)&0x7f;
3515
3516     col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",val_to_str(msg_type, rsl_msg_type_vals,"unknown %u"));
3517
3518     top_tree = tree;
3519     if (tree) {
3520         ti = proto_tree_add_item(tree, proto_rsl, tvb, 0, -1, ENC_NA);
3521         rsl_tree = proto_item_add_subtree(ti, ett_rsl);
3522
3523         /* 9.1 Message discriminator */
3524         proto_tree_add_item(rsl_tree, hf_rsl_msg_dsc, tvb, offset, 1, ENC_BIG_ENDIAN);
3525         proto_tree_add_item(rsl_tree, hf_rsl_T_bit, tvb, offset, 1, ENC_BIG_ENDIAN);
3526         offset++;
3527
3528         offset = dissct_rsl_msg(tvb, pinfo, rsl_tree, offset);
3529
3530     }
3531
3532 }
3533
3534 void
3535 proto_reg_handoff_rsl(void)
3536 {
3537     dissector_handle_t rsl_handle;
3538
3539     rsl_handle = create_dissector_handle(dissect_rsl, proto_rsl);
3540     dissector_add_uint("lapd.gsm.sapi", LAPD_GSM_SAPI_RA_SIG_PROC, rsl_handle);
3541
3542     gsm_a_ccch_handle = find_dissector("gsm_a_ccch");
3543     gsm_a_dtap_handle = find_dissector("gsm_a_dtap");
3544 }
3545
3546 /* Register the protocol with Wireshark */
3547 void proto_register_rsl(void)
3548 {
3549
3550     /* Setup list of header fields */
3551     static hf_register_info hf[] = {
3552         { &hf_rsl_msg_dsc,
3553             { "Message discriminator",           "rsl.msg_dsc",
3554             FT_UINT8, BASE_DEC, VALS(rsl_msg_disc_vals), 0xfe,
3555             NULL, HFILL }
3556         },
3557         { &hf_rsl_T_bit,
3558             { "T bit",           "rsl.T_bit",
3559             FT_BOOLEAN, 8, TFS(&rsl_t_bit_vals), 0x01,
3560             NULL, HFILL }
3561         },
3562         { &hf_rsl_msg_type,
3563             { "Message type",           "rsl.msg_type",
3564             FT_UINT8, BASE_HEX_DEC, VALS(rsl_msg_type_vals), 0x7f,
3565             NULL, HFILL }
3566         },
3567         { &hf_rsl_ie_id,
3568             { "Element identifier",           "rsl.ie_id",
3569             FT_UINT8, BASE_HEX_DEC, VALS(rsl_ie_type_vals), 0x0,
3570             NULL, HFILL }
3571         },
3572         { &hf_rsl_ie_length,
3573             { "Length",           "rsl.ie_length",
3574             FT_UINT16, BASE_DEC, NULL, 0x0,
3575             NULL, HFILL }
3576         },
3577         { &hf_rsl_ch_no_Cbits,
3578             { "C-bits",           "rsl.ch_no_Cbits",
3579             FT_UINT8, BASE_DEC, VALS(rsl_ch_no_Cbits_vals), 0xf8,
3580             NULL, HFILL }
3581         },
3582         { &hf_rsl_ch_no_TN,
3583             { "Time slot number (TN)",  "rsl.ch_no_TN",
3584             FT_UINT8, BASE_DEC, NULL, 0x07,
3585             NULL, HFILL }
3586         },
3587         { &hf_rsl_rtd,
3588             { "Round Trip Delay (RTD)",  "rsl.rtd",
3589             FT_UINT8, BASE_DEC, NULL, 0xfe,
3590             NULL, HFILL }
3591         },
3592         { &hf_rsl_delay_ind,
3593             { "Delay IND",  "rsl.delay_ind",
3594             FT_UINT8, BASE_DEC, rsl_delay_ind_vals, 0x01,
3595             NULL, HFILL }
3596         },
3597         { &hf_rsl_tfo,
3598             { "TFO",           "rsl.tfo",
3599             FT_BOOLEAN, 8, TFS(&rsl_tfo_vals), 0x01,
3600             NULL, HFILL }
3601         },
3602         { &hf_rsl_req_ref_ra,
3603             { "Random Access Information (RA)", "rsl.req_ref_ra",
3604             FT_UINT8, BASE_DEC, NULL, 0x0,
3605             NULL, HFILL }
3606         },
3607         { &hf_rsl_req_ref_T1prim,
3608             { "T1'",           "rsl.req_ref_T1prim",
3609             FT_UINT8, BASE_DEC, NULL, 0xf8,
3610             NULL, HFILL }
3611         },
3612         { &hf_rsl_req_ref_T3,
3613             { "T3",           "rsl.req_ref_T3",
3614             FT_UINT16, BASE_DEC, NULL, 0x07e0,
3615             NULL, HFILL }
3616         },
3617         { &hf_rsl_req_ref_T2,
3618             { "T2",           "rsl.req_ref_T2",
3619             FT_UINT8, BASE_DEC, NULL, 0x1f,
3620             NULL, HFILL }
3621         },
3622         { &hf_rsl_timing_adv,
3623             { "Timing Advance",           "rsl.timing_adv",
3624             FT_UINT8, BASE_DEC, NULL, 0x0,
3625             NULL, HFILL }
3626         },
3627         { &hf_rsl_ho_ref,
3628             { "Hand-over reference",           "rsl.ho_ref",
3629             FT_UINT8, BASE_DEC, NULL, 0x0,
3630             NULL, HFILL }
3631         },
3632         { &hf_rsl_l1inf_power_lev,
3633             { "MS power level",           "rsl.ms_power_lev",
3634             FT_UINT8, BASE_DEC, NULL, 0xf8,
3635             NULL, HFILL }
3636         },
3637         { &hf_rsl_l1inf_fpc,
3638             { "FPC/EPC",           "rsl.ms_fpc",
3639             FT_BOOLEAN, 8, TFS(&rsl_ms_fpc_epc_mode_vals), 0x04,
3640             NULL, HFILL }
3641         },
3642         { &hf_rsl_ms_power_lev,
3643             { "MS power level",           "rsl.ms_power_lev",
3644             FT_UINT8, BASE_DEC, NULL, 0x1f,
3645             NULL, HFILL }
3646         },
3647         { &hf_rsl_ms_fpc,
3648             { "FPC/EPC",           "rsl.ms_fpc",
3649             FT_BOOLEAN, 8, TFS(&rsl_ms_fpc_epc_mode_vals), 0x20,
3650             NULL, HFILL }
3651         },
3652         { &hf_rsl_act_timing_adv,
3653             { "Actual Timing Advance",           "rsl.act_timing_adv",
3654             FT_UINT8, BASE_DEC, NULL, 0x0,
3655             NULL, HFILL }
3656         },
3657         { &hf_rsl_dtxd,
3658             { "DTXd",           "rsl.dtxd",
3659             FT_BOOLEAN, 8, TFS(&rsl_dtxd_vals), 0x40,
3660             NULL, HFILL }
3661         },
3662         { &hf_rsl_rxlev_full_up,
3663             { "RXLEV.FULL.up",           "rsl.rxlev_full_up",
3664             FT_UINT8, BASE_DEC, NULL, 0x3f,
3665             NULL, HFILL }
3666         },
3667         { &hf_rsl_rxlev_sub_up,
3668             { "RXLEV.SUB.up",           "rsl.rxlev_sub_up",
3669             FT_UINT8, BASE_DEC, NULL, 0x3f,
3670             NULL, HFILL }
3671         },
3672         { &hf_rsl_rxqual_full_up,
3673             { "RXQUAL.FULL.up",           "rsl.rxqual_full_up",
3674             FT_UINT8, BASE_DEC, NULL, 0x38,
3675             NULL, HFILL }
3676         },
3677         { &hf_rsl_rxqual_sub_up,
3678             { "RXQUAL.SUB.up",           "rsl.rxqual_sub_up",
3679             FT_UINT8, BASE_DEC, NULL, 0x07,
3680             NULL, HFILL }
3681         },
3682         { &hf_rsl_acc_delay,
3683             { "Access Delay",           "rsl.acc_del",
3684             FT_UINT8, BASE_DEC, NULL, 0x0,
3685             NULL, HFILL }
3686         },
3687         { &hf_rsl_rach_slot_cnt,
3688             { "RACH Slot Count",           "rsl.rach_slot_cnt",
3689             FT_UINT16, BASE_DEC, NULL, 0x0,
3690             NULL, HFILL }
3691         },
3692         { &hf_rsl_rach_busy_cnt,
3693             { "RACH Busy Count",           "rsl.rach_busy_cnt",
3694             FT_UINT16, BASE_DEC, NULL, 0x0,
3695             NULL, HFILL }
3696         },
3697         { &hf_rsl_rach_acc_cnt,
3698             { "RACH Access Count",           "rsl.rach_acc_cnt",
3699             FT_UINT16, BASE_DEC, NULL, 0x0,
3700             NULL, HFILL }
3701         },
3702         { &hf_rsl_phy_ctx,
3703             { "Physical Context",           "rsl.phy_ctx",
3704             FT_BYTES, BASE_NONE, NULL, 0x0,
3705             NULL, HFILL }
3706         },
3707         { &hf_rsl_na,
3708             { "Not applicable (NA)",           "rsl.na",
3709             FT_BOOLEAN, 8, TFS(&rsl_na_vals), 0x20,
3710             NULL, HFILL }
3711         },
3712         { &hf_rsl_ch_type,
3713             { "channel type",           "rsl.ch_type",
3714             FT_UINT8, BASE_DEC, VALS(rsl_ch_type_vals), 0xc0,
3715             NULL, HFILL }
3716         },
3717         { &hf_rsl_prio,
3718             { "Priority",           "rsl.prio",
3719             FT_UINT8, BASE_DEC, VALS(rsl_prio_vals), 0x18,
3720             NULL, HFILL }
3721         },
3722         { &hf_rsl_sapi,
3723             { "SAPI",           "rsl.sapi",
3724             FT_UINT8, BASE_DEC, NULL, 0x07,
3725             NULL, HFILL }
3726         },
3727         { &hf_rsl_rbit,
3728             { "R",           "rsl.rbit",
3729             FT_BOOLEAN, 8, TFS(&rsl_rbit_vals), 0x80,
3730             NULL, HFILL }
3731         },
3732         { &hf_rsl_a3a2,
3733             { "A3A2",           "rsl.a3a2",
3734             FT_UINT8, BASE_DEC, VALS(rsl_a3a2_vals), 0x06,
3735             NULL, HFILL }
3736         },
3737         { &hf_rsl_a1_0,
3738             { "A1",           "rsl.a1_0",
3739             FT_BOOLEAN, 8, TFS(&rsl_a1_0_vals), 0x01,
3740             NULL, HFILL }
3741         },
3742         { &hf_rsl_a1_1,
3743             { "A1",           "rsl.a1_1",
3744             FT_BOOLEAN, 8, TFS(&rsl_a1_1_vals), 0x01,
3745             NULL, HFILL }
3746         },
3747         { &hf_rsl_a1_2,
3748             { "A1",           "rsl.a2_0",
3749             FT_BOOLEAN, 8, TFS(&rsl_a1_2_vals), 0x01,
3750             NULL, HFILL }
3751         },
3752         { &hf_rsl_epc_mode,
3753             { "EPC mode", "rsl.epc_mode",
3754             FT_BOOLEAN, 8, TFS(&rsl_epc_mode_vals), 0x20,
3755             NULL, HFILL }
3756         },
3757         { &hf_rsl_bs_fpc_epc_mode,
3758             { "FPC-EPC mode", "rsl.fpc_epc_mode",
3759             FT_BOOLEAN, 8, TFS(&rsl_fpc_epc_mode_vals), 0x10,
3760             NULL, HFILL }
3761         },
3762         { &hf_rsl_bs_power,
3763             { "Power Level",           "rsl.bs_power",
3764             FT_UINT8, BASE_DEC, VALS(rsl_rlm_bs_power_vals), 0x0f,
3765             NULL, HFILL }
3766         },
3767         { &hf_rsl_cm_dtxd,
3768             { "DTXd", "rsl.cm_dtxd",
3769             FT_BOOLEAN, 8, TFS(&rsl_dtx_vals), 0x02,
3770             NULL, HFILL }
3771         },
3772         { &hf_rsl_cm_dtxu,
3773             { "DTXu", "rsl.cm_dtxu",
3774             FT_BOOLEAN, 8, TFS(&rsl_dtx_vals), 0x01,
3775             NULL, HFILL }
3776         },
3777         { &hf_rsl_speech_or_data,
3778             { "Speech or data indicator",           "rsl.speech_or_data",
3779             FT_UINT8, BASE_DEC, VALS(rsl_speech_or_data_vals), 0x0,
3780             NULL, HFILL }
3781         },
3782         { &hf_rsl_ch_rate_and_type,
3783             { "Channel rate and type",           "rsl.ch_rate_and_type",
3784             FT_UINT8, BASE_DEC, VALS(rsl_ch_rate_and_type_vals), 0x0,
3785             NULL, HFILL }
3786         },
3787         { &hf_rsl_speech_coding_alg,
3788             { "Speech coding algorithm",           "rsl.speech_coding_alg",
3789             FT_UINT8, BASE_DEC, VALS(rsl_speech_coding_alg_vals), 0x0,
3790             NULL, HFILL }
3791         },
3792         { &hf_rsl_t_nt_bit,
3793             { "Transparent indication", "rsl.t_nt_bit",
3794             FT_BOOLEAN, 8, TFS(&t_nt_bit_vals), 0x40,
3795             NULL, HFILL }
3796         },
3797         { &hf_rsl_ra_if_data_rte,
3798             { "Radio interface data rate",           "rsl.ra_if_data_rte",
3799             FT_UINT8, BASE_DEC, VALS(rsl_ra_if_data_rte_vals), 0x3f,
3800             NULL, HFILL }
3801         },
3802         { &hf_rsl_data_rte,
3803             { "Data rate",           "rsl.data_rte",
3804             FT_UINT8, BASE_DEC, VALS(rsl_ra_if_data_rte_vals), 0x3f,
3805             NULL, HFILL }
3806         },
3807         { &hf_rsl_alg_id,
3808             { "Algorithm Identifier",           "rsl.alg_id",
3809             FT_UINT8, BASE_DEC, VALS(rsl_algorithm_id_vals), 0x0,
3810             NULL, HFILL }
3811         },
3812         { &hf_rsl_key,
3813             { "KEY",           "rsl.key",
3814             FT_BYTES, BASE_NONE, NULL, 0x0,
3815             NULL, HFILL }
3816         },
3817         { &hf_rsl_cause,
3818             { "Cause",           "rsl.cause",
3819             FT_UINT8, BASE_DEC, VALS(rsl_rlm_cause_vals), 0x7f,
3820             NULL, HFILL }
3821         },
3822         { &hf_rsl_rel_mode,
3823             { "Release Mode",           "rsl.rel_mode",
3824             FT_UINT8, BASE_DEC, VALS(rel_mode_vals), 0x01,
3825             NULL, HFILL }
3826         },
3827         { &hf_rsl_interf_band,
3828             { "Interf Band",           "rsl.interf_band",
3829             FT_UINT8, BASE_DEC, NULL, 0xe0,
3830             NULL, HFILL }
3831         },
3832         { &hf_rsl_interf_band_reserved,
3833             { "Interf Band reserved bits",           "rsl.interf_band_reserved",
3834             FT_UINT8, BASE_DEC, NULL, 0x1f,
3835             NULL, HFILL }
3836         },
3837         { &hf_rsl_meas_res_no,
3838             { "Measurement result number",           "rsl.meas_res_no",
3839             FT_UINT8, BASE_DEC, NULL, 0x0,
3840             NULL, HFILL }
3841         },
3842         { &hf_rsl_extension_bit,
3843             { "Extension", "rsl.extension_bit",
3844             FT_BOOLEAN, 8, TFS(&rsl_extension_bit_value), 0x80,
3845             NULL, HFILL }},
3846         { &hf_rsl_class,
3847             { "Class",           "rsl.class",
3848             FT_UINT8, BASE_DEC, VALS(rsl_class_vals), 0x70,
3849             NULL, HFILL }
3850         },
3851         { &hf_rsl_paging_grp,
3852             { "Paging Group",           "rsl.paging_grp",
3853             FT_UINT8, BASE_DEC, NULL, 0x0,
3854             NULL, HFILL }
3855         },
3856         { &hf_rsl_paging_load,
3857             { "Paging Buffer Space",           "rsl.paging_load",
3858             FT_UINT16, BASE_DEC, NULL, 0x0,
3859             NULL, HFILL }
3860         },
3861         { &hf_rsl_sys_info_type,
3862             { "System Info Type",           "rsl.sys_info_type",
3863             FT_UINT8, BASE_DEC, VALS(rsl_sys_info_type_vals), 0x0,
3864             NULL, HFILL }
3865         },
3866         { &hf_rsl_timing_offset,
3867             { "Timing Offset",           "rsl.timing_offset",
3868             FT_UINT8, BASE_DEC, NULL, 0x0,
3869             NULL, HFILL }
3870         },
3871         { &hf_rsl_ch_needed,
3872             { "Channel Needed",           "rsl.ch_needed",
3873             FT_UINT8, BASE_DEC, VALS(rsl_ch_needed_vals), 0x03,
3874             NULL, HFILL }
3875         },
3876         { &hf_rsl_cbch_load_type,
3877             { "CBCH Load Type", "rsl.cbch_load_type",
3878             FT_BOOLEAN, 8, TFS(&rsl_cbch_load_type_vals), 0x80,
3879             NULL, HFILL }
3880         },
3881         { &hf_rsl_msg_slt_cnt,
3882             { "Message Slot Count", "rsl.sg_slt_cnt",
3883             FT_UINT8, BASE_DEC, NULL, 0x0f,
3884             NULL, HFILL }
3885         },
3886         { &hf_rsl_ch_ind,
3887             { "Channel Ind",           "rsl.ch_ind",
3888             FT_UINT8, BASE_DEC, VALS(rsl_ch_ind_vals), 0x0f,
3889             NULL, HFILL }
3890         },
3891         { &hf_rsl_command,
3892             { "Command",           "rsl.cmd",
3893             FT_UINT16, BASE_DEC, NULL, 0x0,
3894             NULL, HFILL }
3895         },
3896         { &hf_rsl_emlpp_prio,
3897             { "eMLPP Priority",           "rsl.emlpp_prio",
3898             FT_UINT8, BASE_DEC, VALS(rsl_emlpp_prio_vals), 0x03,
3899             NULL, HFILL }
3900         },
3901     };
3902     static gint *ett[] = {
3903         &ett_rsl,
3904         &ett_ie_link_id,
3905         &ett_ie_act_type,
3906         &ett_ie_bs_power,
3907         &ett_ie_ch_id,
3908         &ett_ie_ch_mode,
3909         &ett_ie_enc_inf,
3910         &ett_ie_ch_no,
3911         &ett_ie_frame_no,
3912         &ett_ie_ho_ref,
3913         &ett_ie_l1_inf,
3914         &ett_ie_L3_inf,
3915         &ett_ie_ms_id,
3916         &ett_ie_ms_pow,
3917         &ett_ie_phy_ctx,
3918         &ett_ie_paging_grp,
3919         &ett_ie_paging_load,
3920         &ett_ie_access_delay,
3921         &ett_ie_rach_load,
3922         &ett_ie_req_ref,
3923         &ett_ie_rel_mode,
3924         &ett_ie_resource_inf,
3925         &ett_ie_rlm_cause,
3926         &ett_ie_staring_time,
3927         &ett_ie_timing_adv,
3928         &ett_ie_uplink_meas,
3929         &ett_ie_full_imm_ass_inf,
3930         &ett_ie_smscb_inf,
3931         &ett_ie_ms_timing_offset,
3932         &ett_ie_err_msg,
3933         &ett_ie_full_bcch_inf,
3934         &ett_ie_ch_needed,
3935         &ett_ie_cb_cmd_type,
3936         &ett_ie_smscb_mess,
3937         &ett_ie_cbch_load_inf,
3938         &ett_ie_smscb_ch_ind,
3939         &ett_ie_grp_call_ref,
3940         &ett_ie_ch_desc,
3941         &ett_ie_nch_drx,
3942         &ett_ie_cmd_ind,
3943         &ett_ie_emlpp_prio,
3944         &ett_ie_uic,
3945         &ett_ie_main_ch_ref,
3946         &ett_ie_multirate_conf,
3947         &ett_ie_multirate_cntrl,
3948         &ett_ie_sup_codec_types,
3949         &ett_ie_codec_conf,
3950         &ett_ie_rtd,
3951         &ett_ie_tfo_status,
3952         &ett_ie_llp_apdu,
3953         &ett_ie_tfo_transp_cont,
3954         &ett_ie_cause,
3955         &ett_ie_meas_res_no,
3956         &ett_ie_message_id,
3957         &ett_ie_sys_info_type,
3958     };
3959
3960     /* Register the protocol name and description */
3961     proto_rsl = proto_register_protocol("Radio Signalling Link (RSL)",
3962                                         "RSL", "rsl");
3963
3964     proto_register_field_array(proto_rsl, hf, array_length(hf));
3965     proto_register_subtree_array(ett, array_length(ett));
3966
3967     register_dissector("gsm_abis_rsl", dissect_rsl, proto_rsl);
3968
3969 }
3970