blob: 409d724454c98131766f522c7474cbb34b0c7cc3 [file] [log] [blame]
Harald Welte4bf40c02011-01-13 11:03:51 +01001Index: wireshark/epan/dissectors/packet-rsl.c
2===================================================================
Harald Welte95932e72011-01-13 23:23:13 +01003--- wireshark.orig/epan/dissectors/packet-rsl.c 2011-01-13 12:51:02.000000000 +0100
Harald Welte1761d022011-01-15 18:08:04 +01004+++ wireshark/epan/dissectors/packet-rsl.c 2011-01-15 18:05:20.000000000 +0100
Harald Welte934676e2011-01-15 13:07:44 +01005@@ -2,7 +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+ * Copyright 2009-2011, Harald Welte <laforge@gnumonks.org>
11 *
12 * $Id: packet-rsl.c 35224 2010-12-20 05:35:29Z guy $
13 *
Harald Welte1761d022011-01-15 18:08:04 +010014@@ -137,6 +137,14 @@
Harald Welte95932e72011-01-13 23:23:13 +010015 static int hf_rsl_cstat_lost_pkts = -1;
16 static int hf_rsl_cstat_ia_jitter = -1;
17 static int hf_rsl_cstat_avg_tx_dly = -1;
18+/* HSL */
19+static int hf_rsl_hsl_bts_serno = -1;
Harald Welte934676e2011-01-15 13:07:44 +010020+static int hf_rsl_hsl_bts_ver = -1;
Harald Welte1761d022011-01-15 18:08:04 +010021+static int hf_rsl_hsl_dsp_ver = -1;
22+static int hf_rsl_hsl_fpga_ver = -1;
Harald Welte934676e2011-01-15 13:07:44 +010023+static int hf_rsl_hsl_trau_remote_port = -1;
24+static int hf_rsl_hsl_trau_remote_ip = -1;
Harald Welte1761d022011-01-15 18:08:04 +010025+static int hf_rsl_hsl_tx_power = -1;
Harald Welte95932e72011-01-13 23:23:13 +010026
27 /* Initialize the subtree pointers */
28 static int ett_rsl = -1;
Harald Welte1761d022011-01-15 18:08:04 +010029@@ -207,6 +215,7 @@
Harald Welte4bf40c02011-01-13 11:03:51 +010030 static proto_tree *top_tree;
31 static dissector_handle_t gsm_a_ccch_handle;
32 static dissector_handle_t gsm_a_dtap_handle;
33+static dissector_handle_t bssgp_handle;
34
35 static gboolean is_si2q = FALSE;
36
Harald Welte1761d022011-01-15 18:08:04 +010037@@ -239,9 +248,11 @@
Harald Welte4bf40c02011-01-13 11:03:51 +010038 { 0x08, "TRX Management messages" },
39 { 0x16, "Location Services messages" },
40 { 0x3f, "ip.access Vendor Specific messages" },
41+ { 0x80, "HSL Vendor Specific messages" },
42 { 0, NULL }
43 };
44 #define RSL_MSGDISC_IPACCESS 0x3f
45+#define RSL_MSGDISC_HSL 0x40
46
47 /*
48 * 9.2 MESSAGE TYPE
Harald Welte1761d022011-01-15 18:08:04 +010049@@ -353,6 +364,22 @@
Harald Welte4bf40c02011-01-13 11:03:51 +010050 #define RSL_IE_IPAC_RTP_MPLEX 0xfd
51 #define RSL_IE_IPAC_RTP_MPLEX_ID 0xfe
52
53+/* Vendor-Specific messages of HSL femtocell. There is no public documentation
54+ * about those extensions, all information in this dissector is based on lawful
55+ * protocol reverse enginering by Harald Welte <laforge@gnumonks.org> */
Harald Welte95932e72011-01-13 23:23:13 +010056+#define RSL_MSG_TYPE_HSL_IDENTIFY 0x80
Harald Welte4bf40c02011-01-13 11:03:51 +010057+#define RSL_MSG_TYPE_HSL_CONN_TRAU 0x81
58+#define RSL_MSG_TYPE_HSL_BSSGP 0x82
59+#define RSL_MSG_TYPE_HSL_GPRS_TS_ALLOC 0x83
60+#define RSL_MSG_TYPE_HSL_L1_PRIM 0x8a
61+
Harald Welte95932e72011-01-13 23:23:13 +010062+#define RSL_IE_HSL_BTS_SERNO 0xc0
63+#define RSL_IE_HSL_TRAU_PARAMS 0xc1
Harald Welte1761d022011-01-15 18:08:04 +010064+#define RSL_IE_HSL_TX_POWER 0xc4
Harald Welte95932e72011-01-13 23:23:13 +010065+#define RSL_IE_HSL_BTS_VERSION 0xc5
Harald Welte1761d022011-01-15 18:08:04 +010066+#define RSL_IE_HSL_DSP_VERSION 0xc6
67+#define RSL_IE_HSL_FPGA_VERSION 0xc7
Harald Welte95932e72011-01-13 23:23:13 +010068+
Harald Welte4bf40c02011-01-13 11:03:51 +010069 static const value_string rsl_msg_type_vals[] = {
70 /* 0 0 0 0 - - - - Radio Link Layer Management messages: */
71 { 0x01, "DATA REQuest" }, /* 8.3.1 */
Harald Welte1761d022011-01-15 18:08:04 +010072@@ -434,6 +461,12 @@
Harald Welte4bf40c02011-01-13 11:03:51 +010073 { 0x77, "ip.access DLCX" },
74 { 0x78, "ip.access DLCX ACK" },
75 { 0x79, "ip.access DLCX NACK" },
76+ /* HSL */
Harald Welte95932e72011-01-13 23:23:13 +010077+ { 0x80, "HSL IDENTIFY" },
Harald Welte4bf40c02011-01-13 11:03:51 +010078+ { 0x81, "HSL CONNECT TRAU" },
79+ { 0x82, "HSL BSSGP" },
80+ { 0x83, "HSL GPRS TS ALLOC" },
Harald Welte1761d022011-01-15 18:08:04 +010081+ { 0x8a, "HSL TX SET POWER" },
Harald Welte4bf40c02011-01-13 11:03:51 +010082 { 0, NULL }
83 };
84
Harald Welte1761d022011-01-15 18:08:04 +010085@@ -573,6 +606,7 @@
Harald Welte95932e72011-01-13 23:23:13 +010086 Not used
Harald Welte4bf40c02011-01-13 11:03:51 +010087
Harald Welte95932e72011-01-13 23:23:13 +010088 */
89+ /* ip.access */
90 { 0xe0, "SRTP Configuration" },
91 { 0xe1, "BSC Proxy UDP Port" },
92 { 0xe2, "BSC Multiplex Timeout" },
Harald Welte1761d022011-01-15 18:08:04 +010093@@ -591,6 +625,13 @@
Harald Welte95932e72011-01-13 23:23:13 +010094 { 0xfc, "RTP Payload Type 2" },
95 { 0xfd, "RTP Multiplex" },
96 { 0xfe, "RTP Multiplex Identifier" },
97+ /* HSL */
98+ { 0xc0, "HSL Serial Number" },
99+ { 0xc1, "HSL TRAU Parameters" },
Harald Welte1761d022011-01-15 18:08:04 +0100100+ { 0xc4, "HSL TX Power (dBm)" },
Harald Welte95932e72011-01-13 23:23:13 +0100101+ { 0xc5, "HSL BTS SW Version" },
Harald Welte1761d022011-01-15 18:08:04 +0100102+ { 0xc6, "HSL DSP SW Version" },
103+ { 0xc7, "HSL FPGA SW Version" },
Harald Welte95932e72011-01-13 23:23:13 +0100104 { 0, NULL }
105 };
106
Harald Welte1761d022011-01-15 18:08:04 +0100107@@ -714,6 +755,13 @@
Harald Welte95932e72011-01-13 23:23:13 +0100108 [RSL_IE_IPAC_SPEECH_MODE] = { TLV_TYPE_TV, 0 },
109 [RSL_IE_IPAC_CONN_ID] = { TLV_TYPE_FIXED, 2 },
110 [RSL_IE_IPAC_RTP_PAYLOAD2] = { TLV_TYPE_TV, 0 },
111+ /* HSL */
112+ [RSL_IE_HSL_BTS_SERNO] = { TLV_TYPE_TLV,0 },
113+ [RSL_IE_HSL_TRAU_PARAMS] = { TLV_TYPE_TLV,0 },
Harald Welte1761d022011-01-15 18:08:04 +0100114+ [RSL_IE_HSL_TX_POWER] = { TLV_TYPE_TV, 0 },
Harald Welte95932e72011-01-13 23:23:13 +0100115+ [RSL_IE_HSL_BTS_VERSION] = { TLV_TYPE_TLV, 0 },
Harald Welte1761d022011-01-15 18:08:04 +0100116+ [RSL_IE_HSL_DSP_VERSION] = { TLV_TYPE_TLV, 0 },
117+ [RSL_IE_HSL_FPGA_VERSION] = { TLV_TYPE_TLV, 0 },
Harald Welte95932e72011-01-13 23:23:13 +0100118 },
119 };
120
Harald Welte1761d022011-01-15 18:08:04 +0100121@@ -3118,9 +3166,10 @@
122 guint8 msg_type;
123 guint32 local_addr = 0;
Harald Welte95932e72011-01-13 23:23:13 +0100124 guint16 local_port = 0;
Harald Welte1761d022011-01-15 18:08:04 +0100125+ int old_visited;
Harald Welte95932e72011-01-13 23:23:13 +0100126 address src_addr;
127
128- msg_type = tvb_get_guint8(tvb, offset)&0x7f;
129+ msg_type = tvb_get_guint8(tvb, offset)&0xff;
130 offset++;
131
132 #if 0
Harald Welte1761d022011-01-15 18:08:04 +0100133@@ -3259,20 +3308,62 @@
Harald Welte95932e72011-01-13 23:23:13 +0100134 proto_tree_add_item(ie_tree, hf_rsl_cstat_avg_tx_dly, tvb,
135 offset+24, 4, FALSE);
136 break;
137+ /* HSL */
138+ case RSL_IE_HSL_BTS_SERNO:
139+ proto_tree_add_item(ie_tree, hf_rsl_hsl_bts_serno, tvb,
140+ offset, len, FALSE);
Harald Welte934676e2011-01-15 13:07:44 +0100141+ col_append_fstr(pinfo->cinfo, COL_INFO, "SerNo %s ",
142+ tvb_get_string(tvb, offset, len));
Harald Welte95932e72011-01-13 23:23:13 +0100143+ break;
144+ case RSL_IE_HSL_TRAU_PARAMS:
Harald Welte934676e2011-01-15 13:07:44 +0100145+ proto_tree_add_item(tree, hf_rsl_hsl_trau_remote_port, tvb,
146+ offset+2, 2, TRUE);
Harald Welte1761d022011-01-15 18:08:04 +0100147+ local_port = tvb_get_letohs(tvb, offset+2);
Harald Welte934676e2011-01-15 13:07:44 +0100148+ proto_tree_add_item(tree, hf_rsl_hsl_trau_remote_ip, tvb,
Harald Welte95932e72011-01-13 23:23:13 +0100149+ offset+4, 4, FALSE);
Harald Welte1761d022011-01-15 18:08:04 +0100150+ local_addr = tvb_get_ipv4(tvb, offset+4);
Harald Welte95932e72011-01-13 23:23:13 +0100151+ break;
Harald Welte1761d022011-01-15 18:08:04 +0100152+ case RSL_IE_HSL_TX_POWER:
153+ proto_tree_add_item(ie_tree, hf_rsl_hsl_tx_power, tvb,
Harald Welte934676e2011-01-15 13:07:44 +0100154+ offset, len, FALSE);
155+ break;
156+ case RSL_IE_HSL_BTS_VERSION:
157+ proto_tree_add_item(ie_tree, hf_rsl_hsl_bts_ver, tvb,
158+ offset, len, FALSE);
159+ break;
Harald Welte1761d022011-01-15 18:08:04 +0100160+ case RSL_IE_HSL_DSP_VERSION:
161+ proto_tree_add_item(ie_tree, hf_rsl_hsl_dsp_ver, tvb,
162+ offset, len, FALSE);
163+ break;
164+ case RSL_IE_HSL_FPGA_VERSION:
165+ proto_tree_add_item(ie_tree, hf_rsl_hsl_fpga_ver, tvb,
166+ offset, len, FALSE);
167+ break;
Harald Welte95932e72011-01-13 23:23:13 +0100168+ case RSL_IE_L3_INF:
169+ if (msg_type == RSL_MSG_TYPE_HSL_BSSGP) {
170+ tvbuff_t *next_tvb;
171+ next_tvb = tvb_new_subset(tvb, offset, -1, len);
172+ call_dissector(bssgp_handle, next_tvb, pinfo, tree);
173+ }
174+ break;
175 }
176 offset += len;
177 }
Harald Welte1761d022011-01-15 18:08:04 +0100178
179 switch (msg_type) {
180 case RSL_MSG_TYPE_IPAC_CRCX_ACK:
181+ case RSL_MSG_TYPE_HSL_CONN_TRAU:
182 /* Notify the RTP and RTCP dissectors about a new RTP stream */
183 src_addr.type = AT_IPv4;
184 src_addr.len = 4;
185 src_addr.data = (guint8 *)&local_addr;
186+ old_visited = pinfo->fd->flags.visited;
187+ pinfo->fd->flags.visited = 0;
188 rtp_add_address(pinfo, &src_addr, local_port, 0,
189 "GSM A-bis/IP", pinfo->fd->num, 0, NULL);
190 rtcp_add_address(pinfo, &src_addr, local_port+1, 0,
191 "GSM A-bis/IP", pinfo->fd->num);
192+ pinfo->fd->flags.visited = old_visited;
193 break;
194 }
195 return offset;
196@@ -3284,10 +3375,12 @@
Harald Welte4bf40c02011-01-13 11:03:51 +0100197 guint8 msg_disc, msg_type;
198
199 msg_disc = tvb_get_guint8(tvb, offset++) >> 1;
200- msg_type = tvb_get_guint8(tvb,offset)&0x7f;
201+ msg_type = tvb_get_guint8(tvb,offset)&0xff;
202 proto_tree_add_item(tree, hf_rsl_msg_type, tvb, offset, 1, FALSE);
203
204- if (msg_disc == RSL_MSGDISC_IPACCESS) {
205+ switch (msg_disc) {
Harald Welte95932e72011-01-13 23:23:13 +0100206+ case RSL_MSGDISC_HSL:
Harald Welte4bf40c02011-01-13 11:03:51 +0100207+ case RSL_MSGDISC_IPACCESS:
208 offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset);
209 return offset;
Harald Welte4bf40c02011-01-13 11:03:51 +0100210 }
Harald Welte1761d022011-01-15 18:08:04 +0100211@@ -3924,7 +4017,7 @@
Harald Welte4bf40c02011-01-13 11:03:51 +0100212 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSL");
213 col_clear(pinfo->cinfo, COL_INFO);
214
215- msg_type = tvb_get_guint8(tvb,offset+1)&0x7f;
216+ msg_type = tvb_get_guint8(tvb,offset+1)&0xff;
217
218 if (check_col(pinfo->cinfo, COL_INFO)){
219 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",val_to_str(msg_type, rsl_msg_type_vals,"unknown %u"));
Harald Welte1761d022011-01-15 18:08:04 +0100220@@ -3955,6 +4048,7 @@
Harald Welte4bf40c02011-01-13 11:03:51 +0100221
222 gsm_a_ccch_handle = find_dissector("gsm_a_ccch");
223 gsm_a_dtap_handle = find_dissector("gsm_a_dtap");
224+ bssgp_handle = find_dissector("bssgp");
225 }
226
227 /* Register the protocol with Wireshark */
Harald Welte1761d022011-01-15 18:08:04 +0100228@@ -3975,7 +4069,7 @@
Harald Welte4bf40c02011-01-13 11:03:51 +0100229 },
230 { &hf_rsl_msg_type,
231 { "Message type", "rsl.msg_type",
232- FT_UINT8, BASE_HEX_DEC, VALS(rsl_msg_type_vals), 0x7f,
233+ FT_UINT8, BASE_HEX_DEC, VALS(rsl_msg_type_vals), 0xff,
234 NULL, HFILL }
235 },
236 { &hf_rsl_ie_id,
Harald Welte1761d022011-01-15 18:08:04 +0100237@@ -4392,6 +4486,36 @@
Harald Welte95932e72011-01-13 23:23:13 +0100238 { "Average Tx Delay", "rsl.ipacc.cstat.avg_tx_delay",
239 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
240 },
241+ /* HSL */
242+ { &hf_rsl_hsl_bts_serno,
243+ { "BTS Serial Number", "rsl.hsl.bts_serno",
244+ FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
245+ },
Harald Welte1761d022011-01-15 18:08:04 +0100246+ { &hf_rsl_hsl_tx_power,
247+ { "Transmit Power", "rsl.hsl.tx_power",
248+ FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }
Harald Welte934676e2011-01-15 13:07:44 +0100249+ },
250+ { &hf_rsl_hsl_bts_ver,
251+ { "BTS Version Number", "rsl.hsl.bts_ver",
252+ FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
253+ },
Harald Welte1761d022011-01-15 18:08:04 +0100254+ { &hf_rsl_hsl_dsp_ver,
255+ { "DSP Version Number", "rsl.hsl.dsp_ver",
256+ FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
257+ },
258+ { &hf_rsl_hsl_fpga_ver,
259+ { "FPGA Version Number", "rsl.hsl.fpga_ver",
260+ FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
261+ },
Harald Welte934676e2011-01-15 13:07:44 +0100262+ { &hf_rsl_hsl_trau_remote_port,
263+ { "HSL TRAU Remote RTP Port", "rsl.hsl.trau.remote_port",
264+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL },
265+ },
266+ { &hf_rsl_hsl_trau_remote_ip,
267+ { "HSL TRAU Remote IP Address", "rsl.hsl.trau.remote_ip",
268+ FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL },
269+ },
270+
Harald Welte95932e72011-01-13 23:23:13 +0100271 };
272 static gint *ett[] = {
273 &ett_rsl,