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