summaryrefslogtreecommitdiffstats
path: root/wireshark/0005-rsl-hsl.patch
blob: 4ffaccd69fb5fb97bd25a66f751ba2eb710b2694 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
Index: wireshark/epan/dissectors/packet-rsl.c
===================================================================
--- wireshark.orig/epan/dissectors/packet-rsl.c	2011-09-06 13:57:15.000000000 +0200
+++ wireshark/epan/dissectors/packet-rsl.c	2011-09-06 14:11:09.000000000 +0200
@@ -2,6 +2,7 @@
  * Routines for Radio Signalling Link (RSL) dissection.
  *
  * Copyright 2007, 2011, Anders Broman <anders.broman@ericsson.com>
+ * Copyright 2009-2011, Harald Welte <laforge@gnumonks.org>
  *
  * $Id: packet-rsl.c 38413 2011-08-08 17:59:32Z wmeier $
  *
@@ -136,7 +137,14 @@
 static int hf_rsl_cstat_lost_pkts	= -1;
 static int hf_rsl_cstat_ia_jitter	= -1;
 static int hf_rsl_cstat_avg_tx_dly	= -1;
-
+/* HSL */
+static int hf_rsl_hsl_bts_serno		= -1;
+static int hf_rsl_hsl_bts_ver		= -1;
+static int hf_rsl_hsl_dsp_ver		= -1;
+static int hf_rsl_hsl_fpga_ver		= -1;
+static int hf_rsl_hsl_trau_remote_port	= -1;
+static int hf_rsl_hsl_trau_remote_ip	= -1;
+static int hf_rsl_hsl_tx_power		= -1;
 
 /* Initialize the subtree pointers */
 static int ett_rsl = -1;
@@ -207,6 +215,7 @@
 static proto_tree *top_tree;
 static dissector_handle_t gsm_a_ccch_handle;
 static dissector_handle_t gsm_a_dtap_handle;
+static dissector_handle_t bssgp_handle;
 
 static gboolean is_si2q = FALSE;
 
@@ -243,9 +252,11 @@
     {  0x08,        "TRX Management messages" },
     {  0x16,        "Location Services messages" },
     {  0x3f,	    "ip.access Vendor Specific messages" },
+    {  0x80,	    "HSL Vendor Specific messages" },
     { 0,            NULL }
 };
 #define RSL_MSGDISC_IPACCESS	0x3f
+#define RSL_MSGDISC_HSL		0x40
 /*
  * 9.2 MESSAGE TYPE
  */
@@ -357,6 +368,22 @@
 #define RSL_IE_IPAC_RTP_MPLEX		0xfd
 #define RSL_IE_IPAC_RTP_MPLEX_ID	0xfe
 
+/* Vendor-Specific messages of HSL femtocell. There is no public documentation
+ * about those extensions, all information in this dissector is based on lawful
+ * protocol reverse enginering by Harald Welte <laforge@gnumonks.org> */
+#define RSL_MSG_TYPE_HSL_IDENTIFY	0x80
+#define RSL_MSG_TYPE_HSL_CONN_TRAU	0x81
+#define RSL_MSG_TYPE_HSL_BSSGP		0x82
+#define RSL_MSG_TYPE_HSL_GPRS_TS_ALLOC	0x83
+#define RSL_MSG_TYPE_HSL_L1_PRIM	0x8a
+
+#define RSL_IE_HSL_BTS_SERNO		0xc0
+#define RSL_IE_HSL_TRAU_PARAMS		0xc1
+#define RSL_IE_HSL_TX_POWER		0xc4
+#define RSL_IE_HSL_BTS_VERSION		0xc5
+#define RSL_IE_HSL_DSP_VERSION		0xc6
+#define RSL_IE_HSL_FPGA_VERSION		0xc7
+
 static const value_string rsl_msg_type_vals[] = {
       /*    0 0 0 0 - - - - Radio Link Layer Management messages: */
     {  0x01,    "DATA REQuest" },                               /* 8.3.1 */
@@ -438,6 +465,12 @@
     {  0x77,	"ip.access DLCX" },
     {  0x78,	"ip.access DLCX ACK" },
     {  0x79,	"ip.access DLCX NACK" },
+    /* HSL */
+    {  0x80,	"HSL IDENTIFY" },
+    {  0x81,	"HSL CONNECT TRAU" },
+    {  0x82,	"HSL BSSGP" },
+    {  0x83,	"HSL GPRS TS ALLOC" },
+    {  0x8a,	"HSL TX SET POWER" },
     { 0,        NULL }
 };
 
@@ -578,6 +611,7 @@
             Not used
 
     */
+	/* ip.access */
 	{ 0xe0,		"SRTP Configuration" },
 	{ 0xe1,		"BSC Proxy UDP Port" },
 	{ 0xe2,		"BSC Multiplex Timeout" },
@@ -596,6 +630,13 @@
 	{ 0xfc,		"RTP Payload Type 2" },
 	{ 0xfd,		"RTP Multiplex" },
 	{ 0xfe,		"RTP Multiplex Identifier" },
+	/* HSL */
+	{ 0xc0,		"HSL Serial Number" },
+	{ 0xc1,		"HSL TRAU Parameters" },
+	{ 0xc4,		"HSL TX Power (dBm)" },
+	{ 0xc5,		"HSL BTS SW Version" },
+	{ 0xc6,		"HSL DSP SW Version" },
+	{ 0xc7,		"HSL FPGA SW Version" },
     { 0,            NULL }
 };
 
@@ -3062,9 +3103,10 @@
 	guint8 msg_type;
 	guint32 local_addr = 0;
 	guint16 local_port = 0;
+	int old_visited;
 	address src_addr;
 
-	msg_type = tvb_get_guint8(tvb, offset)&0x7f;
+	msg_type = tvb_get_guint8(tvb, offset)&0xff;
 	offset++;
 
 #if 0
@@ -3203,20 +3245,62 @@
 			proto_tree_add_item(ie_tree, hf_rsl_cstat_avg_tx_dly, tvb,
 					    offset+24, 4, FALSE);
 			break;
+		/* HSL */
+		case RSL_IE_HSL_BTS_SERNO:
+			proto_tree_add_item(ie_tree, hf_rsl_hsl_bts_serno, tvb,
+					    offset, len, FALSE);
+			col_append_fstr(pinfo->cinfo, COL_INFO, "SerNo %s ",
+					tvb_get_string(tvb, offset, len));
+			break;
+		case RSL_IE_HSL_TRAU_PARAMS:
+			proto_tree_add_item(tree, hf_rsl_hsl_trau_remote_port, tvb,
+					    offset+2, 2, TRUE);
+			local_port = tvb_get_letohs(tvb, offset+2);
+			proto_tree_add_item(tree, hf_rsl_hsl_trau_remote_ip, tvb,
+					    offset+4, 4, FALSE);
+			local_addr = tvb_get_ipv4(tvb, offset+4);
+			break;
+		case RSL_IE_HSL_TX_POWER:
+			proto_tree_add_item(ie_tree, hf_rsl_hsl_tx_power, tvb,
+					    offset, len, FALSE);
+			break;
+		case RSL_IE_HSL_BTS_VERSION:
+			proto_tree_add_item(ie_tree, hf_rsl_hsl_bts_ver, tvb,
+					    offset, len, FALSE);
+			break;
+		case RSL_IE_HSL_DSP_VERSION:
+			proto_tree_add_item(ie_tree, hf_rsl_hsl_dsp_ver, tvb,
+					    offset, len, FALSE);
+			break;
+		case RSL_IE_HSL_FPGA_VERSION:
+			proto_tree_add_item(ie_tree, hf_rsl_hsl_fpga_ver, tvb,
+					    offset, len, FALSE);
+			break;
+		case RSL_IE_L3_INF:
+			if (msg_type == RSL_MSG_TYPE_HSL_BSSGP) {
+				tvbuff_t *next_tvb;
+				next_tvb = tvb_new_subset(tvb, offset, -1, len);
+				call_dissector(bssgp_handle, next_tvb, pinfo, tree);
+			}
+			break;
 		}
 		offset += len;
 	}
 
 	switch (msg_type) {
 	case RSL_MSG_TYPE_IPAC_CRCX_ACK:
+	case RSL_MSG_TYPE_HSL_CONN_TRAU:
 		/* Notify the RTP and RTCP dissectors about a new RTP stream */
 		src_addr.type = AT_IPv4;
 		src_addr.len = 4;
 		src_addr.data = (guint8 *)&local_addr;
+		old_visited = pinfo->fd->flags.visited;
+		pinfo->fd->flags.visited = 0;
 		rtp_add_address(pinfo, &src_addr, local_port, 0,
 				"GSM A-bis/IP", pinfo->fd->num, 0, NULL);
 		rtcp_add_address(pinfo, &src_addr, local_port+1, 0,
 				 "GSM A-bis/IP", pinfo->fd->num);
+		pinfo->fd->flags.visited = old_visited;
 		break;
 	}
 	return offset;
@@ -3228,10 +3312,12 @@
     guint8  msg_disc, msg_type;
 
     msg_disc = tvb_get_guint8(tvb, offset++) >> 1;
-    msg_type = tvb_get_guint8(tvb,offset)&0x7f;
+    msg_type = tvb_get_guint8(tvb,offset);
     proto_tree_add_item(tree, hf_rsl_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
 
-    if (msg_disc == RSL_MSGDISC_IPACCESS) {
+    switch (msg_disc) {
+    case RSL_MSGDISC_HSL:
+    case RSL_MSGDISC_IPACCESS:
         offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset);
         return offset;
     }
@@ -3868,7 +3954,7 @@
     col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSL");
     col_clear(pinfo->cinfo, COL_INFO);
 
-    msg_type = tvb_get_guint8(tvb,offset+1)&0x7f;
+    msg_type = tvb_get_guint8(tvb,offset+1);
 
     col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",val_to_str(msg_type, rsl_msg_type_vals,"unknown %u"));
 
@@ -3905,6 +3991,7 @@
 
     gsm_a_ccch_handle = find_dissector("gsm_a_ccch");
     gsm_a_dtap_handle = find_dissector("gsm_a_dtap");
+    bssgp_handle = find_dissector("bssgp");
 }
 
 /* Register the protocol with Wireshark */
@@ -3925,7 +4012,7 @@
         },
         { &hf_rsl_msg_type,
             { "Message type",           "rsl.msg_type",
-            FT_UINT8, BASE_HEX_DEC, VALS(rsl_msg_type_vals), 0x7f,
+            FT_UINT8, BASE_HEX_DEC, VALS(rsl_msg_type_vals), 0xff,
             NULL, HFILL }
         },
         { &hf_rsl_ie_id,
@@ -4342,6 +4429,35 @@
 			{ "Average Tx Delay", "rsl.ipacc.cstat.avg_tx_delay",
 			  FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
 		},
+		/* HSL */
+		{ &hf_rsl_hsl_bts_serno,
+			{ "BTS Serial Number", "rsl.hsl.bts_serno",
+			  FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
+		},
+		{ &hf_rsl_hsl_tx_power,
+			{ "Transmit Power", "rsl.hsl.tx_power",
+			  FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }
+		},
+		{ &hf_rsl_hsl_bts_ver,
+			{ "BTS Version Number", "rsl.hsl.bts_ver",
+			  FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
+		},
+		{ &hf_rsl_hsl_dsp_ver,
+			{ "DSP Version Number", "rsl.hsl.dsp_ver",
+			  FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
+		},
+		{ &hf_rsl_hsl_fpga_ver,
+			{ "FPGA Version Number", "rsl.hsl.fpga_ver",
+			  FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
+		},
+		{ &hf_rsl_hsl_trau_remote_port,
+			{ "HSL TRAU Remote RTP Port",	"rsl.hsl.trau.remote_port",
+			  FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL },
+		},
+		{ &hf_rsl_hsl_trau_remote_ip,
+			{ "HSL TRAU Remote IP Address", "rsl.hsl.trau.remote_ip",
+			  FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL },
+		},
     };
     static gint *ett[] = {
         &ett_rsl,
@@ -4481,6 +4597,13 @@
 	RSL_ATT_TLVDEF(RSL_IE_IPAC_SPEECH_MODE,	TLV_TYPE_TV,		0);
 	RSL_ATT_TLVDEF(RSL_IE_IPAC_CONN_ID,	TLV_TYPE_FIXED,		2);
 	RSL_ATT_TLVDEF(RSL_IE_IPAC_RTP_PAYLOAD2,TLV_TYPE_TV,		0);
+	/* HSL */
+	RSL_ATT_TLVDEF(RSL_IE_HSL_BTS_SERNO,	TLV_TYPE_TLV,		0);
+	RSL_ATT_TLVDEF(RSL_IE_HSL_TRAU_PARAMS,	TLV_TYPE_TLV,		0);
+	RSL_ATT_TLVDEF(RSL_IE_HSL_TX_POWER,	TLV_TYPE_TV,		0);
+	RSL_ATT_TLVDEF(RSL_IE_HSL_BTS_VERSION,	TLV_TYPE_TLV,		0);
+	RSL_ATT_TLVDEF(RSL_IE_HSL_DSP_VERSION,	TLV_TYPE_TLV,		0);
+	RSL_ATT_TLVDEF(RSL_IE_HSL_FPGA_VERSION,	TLV_TYPE_TLV,		0);
 
     /* Register the protocol name and description */
     proto_rsl = proto_register_protocol("Radio Signalling Link (RSL)",