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