blob: 1cb4c5c61238ed99f3b187deca6c9996bee34bd9 [file] [log] [blame]
Harald Welte2d112ad2009-06-10 05:42:52 +08001Index: wireshark/epan/dissectors/packet-rsl.c
2===================================================================
Harald Welte9e20bc52009-06-26 15:04:00 +02003--- wireshark.orig/epan/dissectors/packet-rsl.c 2009-02-28 15:39:56.000000000 +0100
4+++ wireshark/epan/dissectors/packet-rsl.c 2009-06-26 14:58:39.000000000 +0200
Harald Welte2d112ad2009-06-10 05:42:52 +08005@@ -2,6 +2,7 @@
6 * Routines for Radio Signalling Link (RSL) dissection.
7 *
8 * Copyright 2007, Anders Broman <anders.broman@ericsson.com>
9+ * Copyright 2009, Harald Welte <laforge@gnumonks.org>
10 *
11 * $Id: packet-rsl.c 27065 2008-12-20 00:09:02Z wmeier $
12 *
Harald Welte9e20bc52009-06-26 15:04:00 +020013@@ -44,6 +45,8 @@
14 #include <epan/lapd_sapi.h>
15
16 #include "packet-gsm_a_common.h"
17+#include "packet-rtp.h"
18+#include "packet-rtcp.h"
19
20 /* Initialize the protocol and registered fields */
21 static int proto_rsl = -1;
22@@ -116,6 +119,14 @@
Harald Welte2d112ad2009-06-10 05:42:52 +080023 static int hf_rsl_rtd = -1;
24 static int hf_rsl_delay_ind = -1;
25 static int hf_rsl_tfo = -1;
26+static int hf_rsl_f4 = -1;
27+static int hf_rsl_f6 = -1;
28+static int hf_rsl_f8 = -1;
29+static int hf_rsl_fc = -1;
30+static int hf_rsl_local_port = -1;
31+static int hf_rsl_remote_port = -1;
32+static int hf_rsl_local_ip = -1;
33+static int hf_rsl_remote_ip = -1;
34
35 /* Initialize the subtree pointers */
36 static int ett_rsl = -1;
Harald Welte9e20bc52009-06-26 15:04:00 +020037@@ -173,6 +184,15 @@
Harald Welte2d112ad2009-06-10 05:42:52 +080038 static int ett_ie_meas_res_no = -1;
39 static int ett_ie_message_id = -1;
40 static int ett_ie_sys_info_type = -1;
41+static int ett_ie_f4 = -1;
42+static int ett_ie_f6 = -1;
43+static int ett_ie_f8 = -1;
44+static int ett_ie_remote_ip = -1;
45+static int ett_ie_remote_port = -1;
46+static int ett_ie_local_port = -1;
47+static int ett_ie_local_ip = -1;
48+static int ett_ie_fc = -1;
49+
50
51 proto_tree *top_tree;
52 dissector_handle_t gsm_a_ccch_handle;
Harald Welte9e20bc52009-06-26 15:04:00 +020053@@ -208,8 +228,11 @@
Harald Welte2d112ad2009-06-10 05:42:52 +080054 { 0x06, "Common Channel Management messages" },
55 { 0x08, "TRX Management messages" },
56 { 0x16, "Location Services messages" },
57+ { 0x3f, "ip.access Vendor Specific messages" },
58 { 0, NULL }
59 };
60+#define RSL_MSGDISC_IPACCESS 0x3f
61+
62 /*
63 * 9.2 MESSAGE TYPE
64 */
Harald Welte9e20bc52009-06-26 15:04:00 +020065@@ -276,6 +299,21 @@
Harald Welte2d112ad2009-06-10 05:42:52 +080066 /* 0 1 - - - - - - Location Services messages: */
Harald Welte9e20bc52009-06-26 15:04:00 +020067 #define RSL_MSG_LOC_INF 65 /* 8.7.1 */
Harald Welte2d112ad2009-06-10 05:42:52 +080068
69+/* Vendor-Specific messages of ip.access nanoBTS. There is no public documentation
70+ * about those extensions, all information in this dissector is based on lawful
71+ * protocol reverse enginering by Harald Welte <laforge@gnumonks.org> */
72+#define RSL_MSG_TYPE_IPAC_BIND 0x70
73+#define RSL_MSG_TYPE_IPAC_BIND_ACK 0x71
74+#define RSL_MSG_TYPE_IPAC_BIND_NACK 0x72
75+#define RSL_MSG_TYPE_IPAC_CONNECT 0x73
76+#define RSL_MSG_TYPE_IPAC_CONNECT_ACK 0x74
77+#define RSL_MSG_TYPE_IPAC_CONNECT_NACK 0x75
78+#define RSL_MSG_TYPE_IPAC_DISC_IND 0x76
79+#define RSL_IE_IPAC_REMOTE_IP 0xf0
80+#define RSL_IE_IPAC_REMOTE_PORT 0xf1
81+#define RSL_IE_IPAC_LOCAL_PORT 0xf3
82+#define RSL_IE_IPAC_LOCAL_IP 0xf5
83+
Harald Welte9e20bc52009-06-26 15:04:00 +020084
85 static const value_string rsl_msg_type_vals[] = {
86 /* 0 0 0 0 - - - - Radio Link Layer Management messages: */
87@@ -338,6 +376,14 @@
88 { 0x3f, "TFO MODification REQuest" }, /* 8.4.31 */
89 /* 0 1 - - - - - - Location Services messages: */
90 { 0x41, "Location Information" }, /* 8.7.1 */
91+ /* ip.access */
92+ { 0x70, "ip.access BIND" },
93+ { 0x71, "ip.access BIND ACK" },
94+ { 0x72, "ip.access BIND NACK" },
95+ { 0x73, "ip.access CONNECT" },
96+ { 0x74, "ip.access CONNECT ACK" },
97+ { 0x75, "ip.access CONNECT NACK" },
98+ { 0x76, "ip.access DISCONNECT INDication" },
99 { 0, NULL }
100 };
101
102@@ -477,6 +523,10 @@
103 Not used
104
105 */
106+ { 0xf0, "Remote IP Address" },
107+ { 0xf1, "Remote RTP Port" },
108+ { 0xf3, "Local RTP Port" },
109+ { 0xf5, "Local IP Address" },
110 { 0, NULL }
111 };
112
113@@ -513,6 +563,95 @@
114 { 0, NULL }
115 };
116
117+/* From openbsc/include/openbsc/tlv.h */
118+enum tlv_type {
119+ TLV_TYPE_FIXED,
120+ TLV_TYPE_T,
121+ TLV_TYPE_TV,
122+ TLV_TYPE_TLV,
123+ TLV_TYPE_TL16V,
124+};
125+
126+struct tlv_def {
127+ enum tlv_type type;
128+ u_int8_t fixed_len;
129+};
130+
131+struct tlv_definition {
132+ struct tlv_def def[0xff];
133+};
134+
135+static const struct tlv_definition rsl_att_tlvdef = {
136+ .def = {
137+ [RSL_IE_CH_NO] = { TLV_TYPE_TV, 0 },
138+ [RSL_IE_LINK_ID] = { TLV_TYPE_TV, 0 },
139+ [RSL_IE_ACT_TYPE] = { TLV_TYPE_TV, 0 },
140+ [RSL_IE_BS_POW] = { TLV_TYPE_TV, 0 },
141+ [RSL_IE_CH_ID] = { TLV_TYPE_TLV, 0 },
142+ [RSL_IE_CH_MODE] = { TLV_TYPE_TLV, 0 },
143+ [RSL_IE_ENC_INF] = { TLV_TYPE_TLV, 0 },
144+ [RSL_IE_FRAME_NO] = { TLV_TYPE_FIXED, 2 },
145+ [RSL_IE_HO_REF] = { TLV_TYPE_TV, 0 },
146+ [RSL_IE_L1_INF] = { TLV_TYPE_FIXED, 2 },
147+ [RSL_IE_L3_INF] = { TLV_TYPE_TL16V, 0 },
148+ [RSL_IE_MS_ID] = { TLV_TYPE_TLV, 0 },
149+ [RSL_IE_MS_POW] = { TLV_TYPE_TV, 0 },
150+ [RSL_IE_PAGING_GRP] = { TLV_TYPE_TV, 0 },
151+ [RSL_IE_PAGING_LOAD] = { TLV_TYPE_FIXED, 2 },
152+ [RSL_IE_PHY_CTX] = { TLV_TYPE_TLV, 0 },
153+ [RSL_IE_ACCESS_DELAY] = { TLV_TYPE_TV, 0 },
154+ [RSL_IE_RACH_LOAD] = { TLV_TYPE_TLV, 0 },
155+ [RSL_IE_REQ_REF] = { TLV_TYPE_FIXED, 3 },
156+ [RSL_IE_REL_MODE] = { TLV_TYPE_TV, 0 },
157+ [RSL_IE_RESOURCE_INF] = { TLV_TYPE_TLV, 0 },
158+ [RSL_IE_RLM_CAUSE] = { TLV_TYPE_TLV, 0 },
159+ [RSL_IE_STARTING_TIME] = { TLV_TYPE_FIXED, 2 },
160+ [RSL_IE_TIMING_ADV] = { TLV_TYPE_TV, 0 },
161+ [RSL_IE_UPLINK_MEAS] = { TLV_TYPE_TLV, 0 },
162+ [RSL_IE_CAUSE] = { TLV_TYPE_TLV, 0 },
163+ [RSL_IE_MEAS_RES_NO] = { TLV_TYPE_TV, 0 },
164+ [RSL_IE_MESSAGE_ID] = { TLV_TYPE_TV, 0 },
165+ [RSL_IE_SYS_INFO_TYPE] = { TLV_TYPE_TV, 0 },
166+ //[RSL_IE_MS_POWER_PARAM] = { TLV_TYPE_TLV, 0 },
167+ //[RSL_IE_BS_POWER_PARAM] = { TLV_TYPE_TLV, 0 },
168+ //[RSL_IE_PREPROC_CONFIG] = { TLV_TYPE_TLV, 0 },
169+ //[RSL_IE_PREPROC_MEAS_RES] = { TLV_TYPE_TLV, 0 },
170+ //[RSL_IE_IMM_ASS_INFO] = { TLV_TYPE_TLV, 0 },
171+ //[RSL_IE_SMSCB_INFO] = { TLV_TYPE_FIXED, 23 },
172+ //[RSL_IE_MS_TIMING_OFFSET] = { TLV_TYPE_TV, 0 },
173+ [RSL_IE_ERR_MSG] = { TLV_TYPE_TLV, 0 },
174+ [RSL_IE_FULL_BCCH_INF] = { TLV_TYPE_TLV, 0 },
175+ [RSL_IE_CH_NEEDED] = { TLV_TYPE_TV, 0 },
176+ [RSL_IE_CB_CMD_TYPE] = { TLV_TYPE_TV, 0 },
177+ [RSL_IE_SMSCB_MESS] = { TLV_TYPE_TLV, 0 },
178+ [RSL_IE_FULL_IMM_ASS_INF] = { TLV_TYPE_TLV, 0 },
179+ //[RSL_IE_SACCH_INFO] = { TLV_TYPE_TLV, 0 },
180+ [RSL_IE_CBCH_LOAD_INF] = { TLV_TYPE_TV, 0 },
181+ [RSL_IE_SMSCB_CH_IND] = { TLV_TYPE_TV, 0 },
182+ [RSL_IE_GRP_CALL_REF] = { TLV_TYPE_TLV, 0 },
183+ [RSL_IE_CH_DESC] = { TLV_TYPE_TLV, 0 },
184+ [RSL_IE_NCH_DRX_INF] = { TLV_TYPE_TLV, 0 },
185+ [RSL_IE_CMD_IND] = { TLV_TYPE_TLV, 0 },
186+ [RSL_IE_EMLPP_PRIO] = { TLV_TYPE_TV, 0 },
187+ [RSL_IE_UIC] = { TLV_TYPE_TLV, 0 },
188+ [RSL_IE_MAIN_CH_REF] = { TLV_TYPE_TV, 0 },
189+ [RSL_IE_MULTIRATE_CONF] = { TLV_TYPE_TLV, 0 },
190+ [RSL_IE_MULTIRATE_CNTRL] = { TLV_TYPE_TV, 0 },
191+ [RSL_IE_SUP_CODEC_TYPES] = { TLV_TYPE_TLV, 0 },
192+ [RSL_IE_CODEC_CONF] = { TLV_TYPE_TLV, 0 },
193+ [RSL_IE_RTD] = { TLV_TYPE_TV, 0 },
194+ [RSL_IE_TFO_STATUS] = { TLV_TYPE_TV, 0 },
195+ [RSL_IE_LLP_APDU] = { TLV_TYPE_TLV, 0 },
196+ [RSL_IE_IPAC_REMOTE_IP] = { TLV_TYPE_FIXED, 4 },
197+ [RSL_IE_IPAC_REMOTE_PORT] = { TLV_TYPE_FIXED, 2 },
198+ [RSL_IE_IPAC_LOCAL_IP] = { TLV_TYPE_FIXED, 4 },
199+ [RSL_IE_IPAC_LOCAL_PORT] = { TLV_TYPE_FIXED, 2 },
200+ [0xf4] = { TLV_TYPE_TV, 0 },
201+ [0xf8] = { TLV_TYPE_FIXED, 2 },
202+ [0xfc] = { TLV_TYPE_TV, 0 },
203+ },
204+};
205+
206 /* 9.3.1 Channel number 9.3.1 M TV 2 */
207 static int
208 dissect_rsl_ie_ch_no(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
209@@ -2043,7 +2182,6 @@
210 proto_item_set_len(ti, length+2);
211
212 proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, FALSE);
213- offset++;
214
215 /* Received Message */
216 offset = dissct_rsl_msg(tvb, pinfo, ie_tree, offset);
217@@ -2907,13 +3045,385 @@
218 return ie_offset + length;
219 }
220
221+#if 0
Harald Welte2d112ad2009-06-10 05:42:52 +0800222+static int
223+dissect_rsl_ipac_ie_f8(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
224+{
225+ proto_item *ti;
226+ proto_tree *ie_tree;
227+ guint8 ie_id;
228+
229+ if (is_mandatory == FALSE) {
230+ ie_id = tvb_get_guint8(tvb, offset);
231+ if (ie_id != 0xf8)
232+ return offset;
233+ }
234+
235+ ti = proto_tree_add_text(tree, tvb, offset, 0, "Unknown 0xf8 IE");
236+ ie_tree = proto_item_add_subtree(ti, ett_ie_f8);
237+
238+ /* Element identifier */
239+ proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
240+ offset++;
241+ /* Fixed Length */
242+ proto_item_set_len(ti, 3);
243+
244+ proto_tree_add_item(ie_tree, hf_rsl_f8, tvb, offset, 2, FALSE);
245+ offset += 2;
246+
247+ return offset;
248+}
249+
250+static int
251+dissect_rsl_ipac_ie_local_port(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
252+{
253+ proto_item *ti;
254+ proto_tree *ie_tree;
255+ guint8 ie_id;
256+
257+ if (is_mandatory == FALSE) {
258+ ie_id = tvb_get_guint8(tvb, offset);
259+ if (ie_id != RSL_IE_IPAC_LOCAL_PORT)
260+ return offset;
261+ }
262+
263+ ti = proto_tree_add_text(tree, tvb, offset, 0, "Local RTP Port IE");
264+ ie_tree = proto_item_add_subtree(ti, ett_ie_local_port);
265+
266+ /* Element identifier */
267+ proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
268+ offset++;
269+ /* Fixed Length */
270+ proto_item_set_len(ti, 3);
271+
272+ proto_tree_add_item(ie_tree, hf_rsl_local_port, tvb, offset, 2, FALSE);
273+ offset += 2;
274+
275+ return offset;
276+}
277+
278+static int
279+dissect_rsl_ipac_ie_remote_port(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
280+{
281+ proto_item *ti;
282+ proto_tree *ie_tree;
283+ guint8 ie_id;
284+
285+ if (is_mandatory == FALSE) {
286+ ie_id = tvb_get_guint8(tvb, offset);
287+ if (ie_id != RSL_IE_IPAC_REMOTE_PORT)
288+ return offset;
289+ }
290+
291+ ti = proto_tree_add_text(tree, tvb, offset, 0, "Remote RTP Port IE");
292+ ie_tree = proto_item_add_subtree(ti, ett_ie_remote_port);
293+
294+ /* Element identifier */
295+ proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
296+ offset++;
297+ /* Fixed Length */
298+ proto_item_set_len(ti, 3);
299+
300+ proto_tree_add_uint(ie_tree, hf_rsl_remote_port, tvb, offset, 2, FALSE);
301+ offset += 2;
302+
303+ return offset;
304+}
305+
306+static int
307+dissect_rsl_ipac_ie_local_ip(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
308+{
309+ proto_item *ti;
310+ proto_tree *ie_tree;
311+ guint8 ie_id;
312+ guint32 ip;
313+
314+ if (is_mandatory == FALSE) {
315+ ie_id = tvb_get_guint8(tvb, offset);
316+ if (ie_id != RSL_IE_IPAC_LOCAL_IP)
317+ return offset;
318+ }
319+
320+ ti = proto_tree_add_text(tree, tvb, offset, 0, "Local IP Address IE");
321+ ie_tree = proto_item_add_subtree(ti, ett_ie_local_ip);
322+
323+ /* Element identifier */
324+ proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
325+ offset++;
326+ /* Fixed Length */
327+ proto_item_set_len(ti, 5);
328+
329+ ip = tvb_get_ipv4(tvb, offset);
330+ proto_tree_add_ipv4(ie_tree, hf_rsl_local_ip, tvb, offset, 4, ip);
331+ offset += 4;
332+
333+ return offset;
334+}
335+
336+static int
337+dissect_rsl_ipac_ie_remote_ip(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
338+{
339+ proto_item *ti;
340+ proto_tree *ie_tree;
341+ guint8 ie_id;
342+ guint32 ip;
343+
344+ if (is_mandatory == FALSE) {
345+ ie_id = tvb_get_guint8(tvb, offset);
346+ if (ie_id != RSL_IE_IPAC_REMOTE_IP)
347+ return offset;
348+ }
349+
350+ ti = proto_tree_add_text(tree, tvb, offset, 0, "Remote IP Address IE");
351+ ie_tree = proto_item_add_subtree(ti, ett_ie_remote_ip);
352+
353+ /* Element identifier */
354+ proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
355+ offset++;
356+ /* Fixed Length */
357+ proto_item_set_len(ti, 5);
358+
359+ ip = tvb_get_ipv4(tvb, offset);
360+ proto_tree_add_ipv4(ie_tree, hf_rsl_remote_ip, tvb, offset, 4, ip);
361+ offset += 4;
362+
363+ return offset;
364+}
365+
366+static int
367+dissect_rsl_ipac_ie_f6(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
368+{
369+ proto_item *ti;
370+ proto_tree *ie_tree;
371+ guint8 length;
372+ guint8 ie_id;
373+
374+ if (is_mandatory == FALSE) {
375+ ie_id = tvb_get_guint8(tvb, offset);
376+ if (ie_id != 0xf6)
377+ return offset;
378+ }
379+
380+ ti = proto_tree_add_text(tree, tvb, offset, 0, "Unknown 0xf6 IE");
381+ ie_tree = proto_item_add_subtree(ti, ett_ie_f6);
382+
383+ /* Element identifier */
384+ proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
385+ offset++;
386+
387+ /* Length */
388+ length = tvb_get_guint8(tvb, offset);
389+ offset++;
390+ proto_item_set_len(ti, length+2);
391+
392+ proto_tree_add_bytes(ie_tree, hf_rsl_f6, tvb, offset, length,
393+ tvb_get_ptr(tvb, offset, length));
394+ offset += length;
395+
396+ return offset;
397+}
398+
399+static int
400+dissect_rsl_ipac_ie_f4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
401+{
402+ proto_item *ti;
403+ proto_tree *ie_tree;
404+ guint8 ie_id;
405+
406+ if (is_mandatory == FALSE) {
407+ ie_id = tvb_get_guint8(tvb, offset);
408+ if (ie_id != 0xf4)
409+ return offset;
410+ }
411+
412+ ti = proto_tree_add_text(tree, tvb, offset, 0, "Unknown 0xf4 IE");
413+ ie_tree = proto_item_add_subtree(ti, ett_ie_f4);
414+
415+ /* Element identifier */
416+ proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
417+ offset++;
418+ /* Fixed Length */
419+ proto_item_set_len(ti, 2);
420+ proto_tree_add_item(ie_tree, hf_rsl_f4, tvb, offset, 1, FALSE);
421+ offset++;
422+
423+ return offset;
424+}
425+
426+static int
427+dissect_rsl_ipac_ie_fc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
428+{
429+ proto_item *ti;
430+ proto_tree *ie_tree;
431+ guint8 ie_id;
432+
433+ if (is_mandatory == FALSE) {
434+ ie_id = tvb_get_guint8(tvb, offset);
435+ if (ie_id != 0xfc)
436+ return offset;
437+ }
438+
439+ ti = proto_tree_add_text(tree, tvb, offset, 0, "Unknown 0xfc IE");
440+ ie_tree = proto_item_add_subtree(ti, ett_ie_fc);
441+
442+ /* Element identifier */
443+ proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
444+ offset++;
445+ /* Fixed Length */
446+ proto_item_set_len(ti, 2);
447+ proto_tree_add_item(ie_tree, hf_rsl_fc, tvb, offset, 1, FALSE);
448+ offset++;
449+
450+ return offset;
451+}
Harald Welte9e20bc52009-06-26 15:04:00 +0200452+#endif
Harald Welte2d112ad2009-06-10 05:42:52 +0800453+
454+static int
455+dissct_rsl_ipaccess_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
456+{
457+ guint8 msg_type;
Harald Welte9e20bc52009-06-26 15:04:00 +0200458+ guint32 local_addr = 0;
459+ guint16 local_port = 0;
460+ address src_addr;
Harald Welte2d112ad2009-06-10 05:42:52 +0800461+
462+ msg_type = tvb_get_guint8(tvb, offset)&0x7f;
463+ offset++;
464+
465+ switch (msg_type) {
466+ case RSL_MSG_TYPE_IPAC_BIND:
Harald Welte9e20bc52009-06-26 15:04:00 +0200467+ case RSL_MSG_TYPE_IPAC_BIND_ACK:
468+ case RSL_MSG_TYPE_IPAC_BIND_NACK:
469+ case RSL_MSG_TYPE_IPAC_CONNECT:
470+ case RSL_MSG_TYPE_IPAC_CONNECT_ACK:
471+ case RSL_MSG_TYPE_IPAC_CONNECT_NACK:
472+ case RSL_MSG_TYPE_IPAC_DISC_IND:
Harald Welte2d112ad2009-06-10 05:42:52 +0800473+ /* Channel number 9.3.1 M TV 2 */
474+ offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
475+ break;
Harald Welte9e20bc52009-06-26 15:04:00 +0200476+#if 0
Harald Welte2d112ad2009-06-10 05:42:52 +0800477+ /* Channel number 9.3.1 M TV 2 */
478+ offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
479+ offset = dissect_rsl_ipac_ie_f8(tvb, pinfo, tree, offset, TRUE);
480+ offset = dissect_rsl_ipac_ie_local_port(tvb, pinfo, tree, offset, TRUE);
481+ offset = dissect_rsl_ipac_ie_local_ip(tvb, pinfo, tree, offset, TRUE);
482+ offset = dissect_rsl_ipac_ie_fc(tvb, pinfo, tree, offset, TRUE);
483+ break;
Harald Welte2d112ad2009-06-10 05:42:52 +0800484+ /* Channel number 9.3.1 M TV 2 */
485+ offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
486+ break;
Harald Welte2d112ad2009-06-10 05:42:52 +0800487+ /* Channel number 9.3.1 M TV 2 */
488+ offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
489+ offset = dissect_rsl_ipac_ie_remote_ip(tvb, pinfo, tree, offset, TRUE);
490+ offset = dissect_rsl_ipac_ie_remote_port(tvb, pinfo, tree, offset, TRUE);
491+ offset = dissect_rsl_ipac_ie_f4(tvb, pinfo, tree, offset, TRUE);
492+ offset = dissect_rsl_ipac_ie_fc(tvb, pinfo, tree, offset, TRUE);
493+ break;
Harald Welte2d112ad2009-06-10 05:42:52 +0800494+ /* Channel number 9.3.1 M TV 2 */
495+ offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
496+ offset = dissect_rsl_ipac_ie_f8(tvb, pinfo, tree, offset, TRUE);
497+ break;
Harald Welte2d112ad2009-06-10 05:42:52 +0800498+ /* Channel number 9.3.1 M TV 2 */
499+ offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
500+ break;
Harald Welte2d112ad2009-06-10 05:42:52 +0800501+ /* Channel number 9.3.1 M TV 2 */
502+ offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
503+ offset = dissect_rsl_ipac_ie_f8(tvb, pinfo, tree, offset, TRUE);
504+ offset = dissect_rsl_ipac_ie_f6(tvb, pinfo, tree, offset, TRUE);
505+ /* Cause 9.3.26 M TLV >=3 */
506+ offset = dissect_rsl_ie_cause(tvb, pinfo, tree, offset, TRUE);
507+ break;
Harald Welte9e20bc52009-06-26 15:04:00 +0200508+#endif
509+ }
510+ /* parse remaining TLV attributes */
511+ while (tvb_reported_length_remaining(tvb, offset) != 0) {
512+ guint8 tag;
513+ unsigned int len, hlen, len_len;
514+ const struct tlv_def *tdef;
515+ proto_item *ti;
516+ proto_tree *ie_tree;
517+
518+ tag = tvb_get_guint8(tvb, offset);
519+ tdef = &rsl_att_tlvdef.def[tag];
520+
521+ switch (tdef->type) {
522+ case TLV_TYPE_FIXED:
523+ hlen = 1;
524+ len_len = 0;
525+ len = tdef->fixed_len;
526+ break;
527+ case TLV_TYPE_T:
528+ hlen = 1;
529+ len_len = 0;
530+ len = 0;
531+ break;
532+ case TLV_TYPE_TV:
533+ hlen = 1;
534+ len_len = 0;
535+ len = 1;
536+ break;
537+ case TLV_TYPE_TLV:
538+ hlen = 2;
539+ len_len = 1;
540+ len = tvb_get_guint8(tvb, offset+1);
541+ break;
542+ case TLV_TYPE_TL16V:
543+ hlen = 3;
544+ len_len = 2;
545+ len = tvb_get_guint8(tvb, offset+1) << 8 |
546+ tvb_get_guint8(tvb, offset+2);
547+ break;
548+ }
549+
550+ ti = proto_tree_add_item(tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
551+ ie_tree = proto_item_add_subtree(ti, ett_ie_local_port);
552+ offset += hlen;
553+
554+ switch (tag) {
555+ case RSL_IE_CH_NO:
556+ break;
557+ case RSL_IE_IPAC_REMOTE_IP:
558+ proto_tree_add_item(ie_tree, hf_rsl_remote_ip, tvb, offset, len, FALSE);
559+ break;
560+ case RSL_IE_IPAC_REMOTE_PORT:
561+ proto_tree_add_item(ie_tree, hf_rsl_remote_port, tvb, offset, len, FALSE);
562+ break;
563+ case RSL_IE_IPAC_LOCAL_IP:
564+ proto_tree_add_item(ie_tree, hf_rsl_local_ip, tvb, offset, len, FALSE);
565+ local_addr = tvb_get_ipv4(tvb, offset);
566+ break;
567+ case RSL_IE_IPAC_LOCAL_PORT:
568+ proto_tree_add_item(ie_tree, hf_rsl_local_port, tvb, offset, len, FALSE);
569+ local_port = tvb_get_ntohs(tvb, offset);
570+ break;
571+ }
572+ offset += len;
Harald Welte2d112ad2009-06-10 05:42:52 +0800573+ }
574+
Harald Welte9e20bc52009-06-26 15:04:00 +0200575+ switch (msg_type) {
576+ case RSL_MSG_TYPE_IPAC_BIND_ACK:
577+ src_addr.type = AT_IPv4;
578+ src_addr.len = 4;
579+ src_addr.data = (guint8 *)&local_addr;
580+ rtp_add_address(pinfo, &src_addr, local_port, 0, "GSM A-bis/IP", pinfo->fd->num, 0);
581+ rtcp_add_address(pinfo, &src_addr, local_port+1, 0, "GSM A-bis/IP", pinfo->fd->num);
582+ break;
583+ }
Harald Welte2d112ad2009-06-10 05:42:52 +0800584+ return offset;
585+}
586+
587 static int
588 dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
589 {
590- guint8 msg_type;
591+ guint8 msg_disc, msg_type;
592
593+ msg_disc = tvb_get_guint8(tvb, offset++) >> 1;
594 msg_type = tvb_get_guint8(tvb,offset)&0x7f;
595 proto_tree_add_item(tree, hf_rsl_msg_type, tvb, offset, 1, FALSE);
596+
597+ if (msg_disc == RSL_MSGDISC_IPACCESS) {
598+ offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset);
599+ return offset;
600+ }
601 offset++;
602
603 switch (msg_type){
Harald Welte9e20bc52009-06-26 15:04:00 +0200604@@ -3517,7 +4027,6 @@
Harald Welte2d112ad2009-06-10 05:42:52 +0800605 /* 9.1 Message discriminator */
606 proto_tree_add_item(rsl_tree, hf_rsl_msg_dsc, tvb, offset, 1, FALSE);
607 proto_tree_add_item(rsl_tree, hf_rsl_T_bit, tvb, offset, 1, FALSE);
608- offset++;
609
610 offset = dissct_rsl_msg(tvb, pinfo, rsl_tree, offset);
611
Harald Welte9e20bc52009-06-26 15:04:00 +0200612@@ -3883,6 +4392,46 @@
Harald Welte2d112ad2009-06-10 05:42:52 +0800613 FT_UINT8, BASE_DEC, VALS(rsl_emlpp_prio_vals), 0x03,
614 "eMLPP Priority", HFILL }
615 },
616+ { &hf_rsl_f4,
617+ { "unknown F4 IE", "rsl.ipacc.f4",
618+ FT_UINT8, BASE_DEC, NULL, 0x0,
619+ "unknown F4 IE", HFILL }
620+ },
621+ { &hf_rsl_f6,
622+ { "unknown F6 IE", "rsl.ipacc.f6",
623+ FT_BYTES, BASE_HEX, NULL, 0x0,
624+ "unknown F6 IE", HFILL }
625+ },
626+ { &hf_rsl_f8,
627+ { "unknown F8 IE", "rsl.ipacc.f8",
628+ FT_UINT16, BASE_DEC, NULL, 0x0,
629+ "unknown F8 IE", HFILL }
630+ },
631+ { &hf_rsl_fc,
632+ { "unknown FC IE", "rsl.ipacc.fc",
633+ FT_UINT8, BASE_DEC, NULL, 0x0,
634+ "unknown FC IE", HFILL }
635+ },
636+ { &hf_rsl_local_port,
637+ { "ip.access Local RTP Port", "rsl.ipacc.local_port",
638+ FT_UINT16, BASE_DEC, NULL, 0x0,
639+ "ip.access Local RTP Port", HFILL },
640+ },
641+ { &hf_rsl_remote_port,
642+ { "ip.access Remote RTP Port", "rsl.ipacc.remote_port",
643+ FT_UINT16, BASE_DEC, NULL, 0x0,
644+ "ip.access Remote RTP Port", HFILL },
645+ },
646+ { &hf_rsl_local_ip,
647+ { "ip.access Local IP Address", "rsl.ipacc.local_ip",
648+ FT_IPv4, BASE_NONE, NULL, 0x0,
649+ "ip.access Local IP Address", HFILL },
650+ },
651+ { &hf_rsl_remote_ip,
652+ { "ip.access Remote IP Address", "rsl.ipacc.remote_ip",
653+ FT_IPv4, BASE_NONE, NULL, 0x0,
654+ "ip.access Remote IP Address", HFILL },
655+ },
656 };
657 static gint *ett[] = {
658 &ett_rsl,
Harald Welte9e20bc52009-06-26 15:04:00 +0200659@@ -3941,6 +4490,14 @@
Harald Welte2d112ad2009-06-10 05:42:52 +0800660 &ett_ie_meas_res_no,
661 &ett_ie_message_id,
662 &ett_ie_sys_info_type,
663+ &ett_ie_f4,
664+ &ett_ie_f6,
665+ &ett_ie_f8,
666+ &ett_ie_remote_ip,
667+ &ett_ie_remote_port,
668+ &ett_ie_local_port,
669+ &ett_ie_local_ip,
670+ &ett_ie_fc,
671 };
672
673 /* Register the protocol name and description */