blob: 4ffaccd69fb5fb97bd25a66f751ba2eb710b2694 [file] [log] [blame]
Harald Welte4bf40c02011-01-13 11:03:51 +01001Index: wireshark/epan/dissectors/packet-rsl.c
2===================================================================
Harald Welte7c78c472011-09-06 21:09:05 +02003--- wireshark.orig/epan/dissectors/packet-rsl.c 2011-09-06 13:57:15.000000000 +0200
4+++ wireshark/epan/dissectors/packet-rsl.c 2011-09-06 14:11:09.000000000 +0200
5@@ -2,6 +2,7 @@
Harald Welte934676e2011-01-15 13:07:44 +01006 * Routines for Radio Signalling Link (RSL) dissection.
7 *
Harald Welte7c78c472011-09-06 21:09:05 +02008 * Copyright 2007, 2011, Anders Broman <anders.broman@ericsson.com>
Harald Welte934676e2011-01-15 13:07:44 +01009+ * Copyright 2009-2011, Harald Welte <laforge@gnumonks.org>
10 *
Harald Welte7c78c472011-09-06 21:09:05 +020011 * $Id: packet-rsl.c 38413 2011-08-08 17:59:32Z wmeier $
Harald Welte934676e2011-01-15 13:07:44 +010012 *
Harald Welte7c78c472011-09-06 21:09:05 +020013@@ -136,7 +137,14 @@
14 static int hf_rsl_cstat_lost_pkts = -1;
15 static int hf_rsl_cstat_ia_jitter = -1;
16 static int hf_rsl_cstat_avg_tx_dly = -1;
17-
Harald Welte95932e72011-01-13 23:23:13 +010018+/* HSL */
Harald Welte7c78c472011-09-06 21:09:05 +020019+static int hf_rsl_hsl_bts_serno = -1;
20+static int hf_rsl_hsl_bts_ver = -1;
21+static int hf_rsl_hsl_dsp_ver = -1;
22+static int hf_rsl_hsl_fpga_ver = -1;
23+static int hf_rsl_hsl_trau_remote_port = -1;
24+static int hf_rsl_hsl_trau_remote_ip = -1;
25+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 Welte7c78c472011-09-06 21:09:05 +020037@@ -243,9 +252,11 @@
38 { 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 }
Harald Welte4bf40c02011-01-13 11:03:51 +010043 };
44 #define RSL_MSGDISC_IPACCESS 0x3f
45+#define RSL_MSGDISC_HSL 0x40
Harald Welte4bf40c02011-01-13 11:03:51 +010046 /*
47 * 9.2 MESSAGE TYPE
Harald Welte7c78c472011-09-06 21:09:05 +020048 */
49@@ -357,6 +368,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[] = {
Harald Welte7c78c472011-09-06 21:09:05 +020070 /* 0 0 0 0 - - - - Radio Link Layer Management messages: */
71 { 0x01, "DATA REQuest" }, /* 8.3.1 */
72@@ -438,6 +465,12 @@
73 { 0x77, "ip.access DLCX" },
74 { 0x78, "ip.access DLCX ACK" },
75 { 0x79, "ip.access DLCX NACK" },
76+ /* HSL */
77+ { 0x80, "HSL IDENTIFY" },
78+ { 0x81, "HSL CONNECT TRAU" },
79+ { 0x82, "HSL BSSGP" },
80+ { 0x83, "HSL GPRS TS ALLOC" },
81+ { 0x8a, "HSL TX SET POWER" },
82 { 0, NULL }
Harald Welte4bf40c02011-01-13 11:03:51 +010083 };
84
Harald Welte7c78c472011-09-06 21:09:05 +020085@@ -578,6 +611,7 @@
86 Not used
Harald Welte4bf40c02011-01-13 11:03:51 +010087
Harald Welte7c78c472011-09-06 21:09:05 +020088 */
Harald Welte95932e72011-01-13 23:23:13 +010089+ /* ip.access */
90 { 0xe0, "SRTP Configuration" },
91 { 0xe1, "BSC Proxy UDP Port" },
92 { 0xe2, "BSC Multiplex Timeout" },
Harald Welte7c78c472011-09-06 21:09:05 +020093@@ -596,6 +630,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 Welte7c78c472011-09-06 21:09:05 +0200104 { 0, NULL }
Harald Welte95932e72011-01-13 23:23:13 +0100105 };
106
Harald Welte7c78c472011-09-06 21:09:05 +0200107@@ -3062,9 +3103,10 @@
Harald Welte1761d022011-01-15 18:08:04 +0100108 guint8 msg_type;
109 guint32 local_addr = 0;
Harald Welte95932e72011-01-13 23:23:13 +0100110 guint16 local_port = 0;
Harald Welte1761d022011-01-15 18:08:04 +0100111+ int old_visited;
Harald Welte95932e72011-01-13 23:23:13 +0100112 address src_addr;
113
114- msg_type = tvb_get_guint8(tvb, offset)&0x7f;
115+ msg_type = tvb_get_guint8(tvb, offset)&0xff;
116 offset++;
117
118 #if 0
Harald Welte7c78c472011-09-06 21:09:05 +0200119@@ -3203,20 +3245,62 @@
Harald Welte95932e72011-01-13 23:23:13 +0100120 proto_tree_add_item(ie_tree, hf_rsl_cstat_avg_tx_dly, tvb,
121 offset+24, 4, FALSE);
122 break;
123+ /* HSL */
124+ case RSL_IE_HSL_BTS_SERNO:
125+ proto_tree_add_item(ie_tree, hf_rsl_hsl_bts_serno, tvb,
126+ offset, len, FALSE);
Harald Welte934676e2011-01-15 13:07:44 +0100127+ col_append_fstr(pinfo->cinfo, COL_INFO, "SerNo %s ",
128+ tvb_get_string(tvb, offset, len));
Harald Welte95932e72011-01-13 23:23:13 +0100129+ break;
130+ case RSL_IE_HSL_TRAU_PARAMS:
Harald Welte934676e2011-01-15 13:07:44 +0100131+ proto_tree_add_item(tree, hf_rsl_hsl_trau_remote_port, tvb,
132+ offset+2, 2, TRUE);
Harald Welte1761d022011-01-15 18:08:04 +0100133+ local_port = tvb_get_letohs(tvb, offset+2);
Harald Welte934676e2011-01-15 13:07:44 +0100134+ proto_tree_add_item(tree, hf_rsl_hsl_trau_remote_ip, tvb,
Harald Welte95932e72011-01-13 23:23:13 +0100135+ offset+4, 4, FALSE);
Harald Welte1761d022011-01-15 18:08:04 +0100136+ local_addr = tvb_get_ipv4(tvb, offset+4);
Harald Welte95932e72011-01-13 23:23:13 +0100137+ break;
Harald Welte1761d022011-01-15 18:08:04 +0100138+ case RSL_IE_HSL_TX_POWER:
139+ proto_tree_add_item(ie_tree, hf_rsl_hsl_tx_power, tvb,
Harald Welte934676e2011-01-15 13:07:44 +0100140+ offset, len, FALSE);
141+ break;
142+ case RSL_IE_HSL_BTS_VERSION:
143+ proto_tree_add_item(ie_tree, hf_rsl_hsl_bts_ver, tvb,
144+ offset, len, FALSE);
145+ break;
Harald Welte1761d022011-01-15 18:08:04 +0100146+ case RSL_IE_HSL_DSP_VERSION:
147+ proto_tree_add_item(ie_tree, hf_rsl_hsl_dsp_ver, tvb,
148+ offset, len, FALSE);
149+ break;
150+ case RSL_IE_HSL_FPGA_VERSION:
151+ proto_tree_add_item(ie_tree, hf_rsl_hsl_fpga_ver, tvb,
152+ offset, len, FALSE);
153+ break;
Harald Welte95932e72011-01-13 23:23:13 +0100154+ case RSL_IE_L3_INF:
155+ if (msg_type == RSL_MSG_TYPE_HSL_BSSGP) {
156+ tvbuff_t *next_tvb;
157+ next_tvb = tvb_new_subset(tvb, offset, -1, len);
158+ call_dissector(bssgp_handle, next_tvb, pinfo, tree);
159+ }
160+ break;
161 }
162 offset += len;
163 }
Harald Welte1761d022011-01-15 18:08:04 +0100164
165 switch (msg_type) {
166 case RSL_MSG_TYPE_IPAC_CRCX_ACK:
167+ case RSL_MSG_TYPE_HSL_CONN_TRAU:
168 /* Notify the RTP and RTCP dissectors about a new RTP stream */
169 src_addr.type = AT_IPv4;
170 src_addr.len = 4;
171 src_addr.data = (guint8 *)&local_addr;
172+ old_visited = pinfo->fd->flags.visited;
173+ pinfo->fd->flags.visited = 0;
174 rtp_add_address(pinfo, &src_addr, local_port, 0,
175 "GSM A-bis/IP", pinfo->fd->num, 0, NULL);
176 rtcp_add_address(pinfo, &src_addr, local_port+1, 0,
177 "GSM A-bis/IP", pinfo->fd->num);
178+ pinfo->fd->flags.visited = old_visited;
179 break;
180 }
181 return offset;
Harald Welte7c78c472011-09-06 21:09:05 +0200182@@ -3228,10 +3312,12 @@
183 guint8 msg_disc, msg_type;
Harald Welte4bf40c02011-01-13 11:03:51 +0100184
Harald Welte7c78c472011-09-06 21:09:05 +0200185 msg_disc = tvb_get_guint8(tvb, offset++) >> 1;
186- msg_type = tvb_get_guint8(tvb,offset)&0x7f;
187+ msg_type = tvb_get_guint8(tvb,offset);
188 proto_tree_add_item(tree, hf_rsl_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
Harald Welte4bf40c02011-01-13 11:03:51 +0100189
Harald Welte7c78c472011-09-06 21:09:05 +0200190- if (msg_disc == RSL_MSGDISC_IPACCESS) {
191+ switch (msg_disc) {
192+ case RSL_MSGDISC_HSL:
193+ case RSL_MSGDISC_IPACCESS:
194 offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset);
195 return offset;
196 }
197@@ -3868,7 +3954,7 @@
198 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSL");
199 col_clear(pinfo->cinfo, COL_INFO);
Harald Welte4bf40c02011-01-13 11:03:51 +0100200
Harald Welte7c78c472011-09-06 21:09:05 +0200201- msg_type = tvb_get_guint8(tvb,offset+1)&0x7f;
202+ msg_type = tvb_get_guint8(tvb,offset+1);
Harald Welte4bf40c02011-01-13 11:03:51 +0100203
Harald Welte7c78c472011-09-06 21:09:05 +0200204 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",val_to_str(msg_type, rsl_msg_type_vals,"unknown %u"));
Harald Welte4bf40c02011-01-13 11:03:51 +0100205
Harald Welte7c78c472011-09-06 21:09:05 +0200206@@ -3905,6 +3991,7 @@
207
208 gsm_a_ccch_handle = find_dissector("gsm_a_ccch");
209 gsm_a_dtap_handle = find_dissector("gsm_a_dtap");
210+ bssgp_handle = find_dissector("bssgp");
Harald Welte4bf40c02011-01-13 11:03:51 +0100211 }
212
213 /* Register the protocol with Wireshark */
Harald Welte7c78c472011-09-06 21:09:05 +0200214@@ -3925,7 +4012,7 @@
215 },
216 { &hf_rsl_msg_type,
217 { "Message type", "rsl.msg_type",
218- FT_UINT8, BASE_HEX_DEC, VALS(rsl_msg_type_vals), 0x7f,
219+ FT_UINT8, BASE_HEX_DEC, VALS(rsl_msg_type_vals), 0xff,
220 NULL, HFILL }
221 },
222 { &hf_rsl_ie_id,
223@@ -4342,6 +4429,35 @@
Harald Welte95932e72011-01-13 23:23:13 +0100224 { "Average Tx Delay", "rsl.ipacc.cstat.avg_tx_delay",
225 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
226 },
227+ /* HSL */
228+ { &hf_rsl_hsl_bts_serno,
229+ { "BTS Serial Number", "rsl.hsl.bts_serno",
230+ FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
231+ },
Harald Welte1761d022011-01-15 18:08:04 +0100232+ { &hf_rsl_hsl_tx_power,
233+ { "Transmit Power", "rsl.hsl.tx_power",
234+ FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }
Harald Welte934676e2011-01-15 13:07:44 +0100235+ },
236+ { &hf_rsl_hsl_bts_ver,
237+ { "BTS Version Number", "rsl.hsl.bts_ver",
238+ FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
239+ },
Harald Welte1761d022011-01-15 18:08:04 +0100240+ { &hf_rsl_hsl_dsp_ver,
241+ { "DSP Version Number", "rsl.hsl.dsp_ver",
242+ FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
243+ },
244+ { &hf_rsl_hsl_fpga_ver,
245+ { "FPGA Version Number", "rsl.hsl.fpga_ver",
246+ FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
247+ },
Harald Welte934676e2011-01-15 13:07:44 +0100248+ { &hf_rsl_hsl_trau_remote_port,
249+ { "HSL TRAU Remote RTP Port", "rsl.hsl.trau.remote_port",
250+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL },
251+ },
252+ { &hf_rsl_hsl_trau_remote_ip,
253+ { "HSL TRAU Remote IP Address", "rsl.hsl.trau.remote_ip",
254+ FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL },
255+ },
Harald Welte7c78c472011-09-06 21:09:05 +0200256 };
257 static gint *ett[] = {
258 &ett_rsl,
259@@ -4481,6 +4597,13 @@
260 RSL_ATT_TLVDEF(RSL_IE_IPAC_SPEECH_MODE, TLV_TYPE_TV, 0);
261 RSL_ATT_TLVDEF(RSL_IE_IPAC_CONN_ID, TLV_TYPE_FIXED, 2);
262 RSL_ATT_TLVDEF(RSL_IE_IPAC_RTP_PAYLOAD2,TLV_TYPE_TV, 0);
263+ /* HSL */
264+ RSL_ATT_TLVDEF(RSL_IE_HSL_BTS_SERNO, TLV_TYPE_TLV, 0);
265+ RSL_ATT_TLVDEF(RSL_IE_HSL_TRAU_PARAMS, TLV_TYPE_TLV, 0);
266+ RSL_ATT_TLVDEF(RSL_IE_HSL_TX_POWER, TLV_TYPE_TV, 0);
267+ RSL_ATT_TLVDEF(RSL_IE_HSL_BTS_VERSION, TLV_TYPE_TLV, 0);
268+ RSL_ATT_TLVDEF(RSL_IE_HSL_DSP_VERSION, TLV_TYPE_TLV, 0);
269+ RSL_ATT_TLVDEF(RSL_IE_HSL_FPGA_VERSION, TLV_TYPE_TLV, 0);
270
271 /* Register the protocol name and description */
272 proto_rsl = proto_register_protocol("Radio Signalling Link (RSL)",