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