blob: 98221a1d84209025edfd05ee13e62a4d56a042c3 [file] [log] [blame]
Harald Welte2268a8b2011-01-13 11:03:51 +01001Index: wireshark/epan/dissectors/packet-rsl.c
2===================================================================
Harald Welte98aa6132011-01-13 23:23:13 +01003--- wireshark.orig/epan/dissectors/packet-rsl.c 2011-01-13 12:51:02.000000000 +0100
Harald Weltec19170b2011-01-15 13:07:44 +01004+++ wireshark/epan/dissectors/packet-rsl.c 2011-01-14 10:41:18.000000000 +0100
5@@ -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 *
14@@ -137,6 +137,12 @@
Harald Welte98aa6132011-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 Weltec19170b2011-01-15 13:07:44 +010020+static int hf_rsl_hsl_bts_ver = -1;
21+static int hf_rsl_hsl_l1_prim = -1;
22+static int hf_rsl_hsl_trau_remote_port = -1;
23+static int hf_rsl_hsl_trau_remote_ip = -1;
Harald Welte98aa6132011-01-13 23:23:13 +010024
25 /* Initialize the subtree pointers */
26 static int ett_rsl = -1;
Harald Weltec19170b2011-01-15 13:07:44 +010027@@ -207,6 +213,7 @@
Harald Welte2268a8b2011-01-13 11:03:51 +010028 static proto_tree *top_tree;
29 static dissector_handle_t gsm_a_ccch_handle;
30 static dissector_handle_t gsm_a_dtap_handle;
31+static dissector_handle_t bssgp_handle;
32
33 static gboolean is_si2q = FALSE;
34
Harald Weltec19170b2011-01-15 13:07:44 +010035@@ -239,9 +246,11 @@
Harald Welte2268a8b2011-01-13 11:03:51 +010036 { 0x08, "TRX Management messages" },
37 { 0x16, "Location Services messages" },
38 { 0x3f, "ip.access Vendor Specific messages" },
39+ { 0x80, "HSL Vendor Specific messages" },
40 { 0, NULL }
41 };
42 #define RSL_MSGDISC_IPACCESS 0x3f
43+#define RSL_MSGDISC_HSL 0x40
44
45 /*
46 * 9.2 MESSAGE TYPE
Harald Weltec19170b2011-01-15 13:07:44 +010047@@ -353,6 +362,22 @@
Harald Welte2268a8b2011-01-13 11:03:51 +010048 #define RSL_IE_IPAC_RTP_MPLEX 0xfd
49 #define RSL_IE_IPAC_RTP_MPLEX_ID 0xfe
50
51+/* Vendor-Specific messages of HSL femtocell. There is no public documentation
52+ * about those extensions, all information in this dissector is based on lawful
53+ * protocol reverse enginering by Harald Welte <laforge@gnumonks.org> */
Harald Welte98aa6132011-01-13 23:23:13 +010054+#define RSL_MSG_TYPE_HSL_IDENTIFY 0x80
Harald Welte2268a8b2011-01-13 11:03:51 +010055+#define RSL_MSG_TYPE_HSL_CONN_TRAU 0x81
56+#define RSL_MSG_TYPE_HSL_BSSGP 0x82
57+#define RSL_MSG_TYPE_HSL_GPRS_TS_ALLOC 0x83
58+#define RSL_MSG_TYPE_HSL_L1_PRIM 0x8a
59+
Harald Welte98aa6132011-01-13 23:23:13 +010060+#define RSL_IE_HSL_BTS_SERNO 0xc0
61+#define RSL_IE_HSL_TRAU_PARAMS 0xc1
62+#define RSL_IE_HSL_L1_PRIM 0xc4
63+#define RSL_IE_HSL_BTS_VERSION 0xc5
64+#define RSL_IE_HSL_UNKNOWN_VERSION1 0xc6
65+#define RSL_IE_HSL_UNKNOWN_VERSION2 0xc7
66+
Harald Welte2268a8b2011-01-13 11:03:51 +010067 static const value_string rsl_msg_type_vals[] = {
68 /* 0 0 0 0 - - - - Radio Link Layer Management messages: */
69 { 0x01, "DATA REQuest" }, /* 8.3.1 */
Harald Weltec19170b2011-01-15 13:07:44 +010070@@ -434,6 +459,12 @@
Harald Welte2268a8b2011-01-13 11:03:51 +010071 { 0x77, "ip.access DLCX" },
72 { 0x78, "ip.access DLCX ACK" },
73 { 0x79, "ip.access DLCX NACK" },
74+ /* HSL */
Harald Welte98aa6132011-01-13 23:23:13 +010075+ { 0x80, "HSL IDENTIFY" },
Harald Welte2268a8b2011-01-13 11:03:51 +010076+ { 0x81, "HSL CONNECT TRAU" },
77+ { 0x82, "HSL BSSGP" },
78+ { 0x83, "HSL GPRS TS ALLOC" },
79+ { 0x8a, "HSL L1 PRIMITIVE" },
80 { 0, NULL }
81 };
82
Harald Weltec19170b2011-01-15 13:07:44 +010083@@ -573,6 +604,7 @@
Harald Welte98aa6132011-01-13 23:23:13 +010084 Not used
Harald Welte2268a8b2011-01-13 11:03:51 +010085
Harald Welte98aa6132011-01-13 23:23:13 +010086 */
87+ /* ip.access */
88 { 0xe0, "SRTP Configuration" },
89 { 0xe1, "BSC Proxy UDP Port" },
90 { 0xe2, "BSC Multiplex Timeout" },
Harald Weltec19170b2011-01-15 13:07:44 +010091@@ -591,6 +623,13 @@
Harald Welte98aa6132011-01-13 23:23:13 +010092 { 0xfc, "RTP Payload Type 2" },
93 { 0xfd, "RTP Multiplex" },
94 { 0xfe, "RTP Multiplex Identifier" },
95+ /* HSL */
96+ { 0xc0, "HSL Serial Number" },
97+ { 0xc1, "HSL TRAU Parameters" },
98+ { 0xc4, "HSL L1 Primitive" },
99+ { 0xc5, "HSL BTS SW Version" },
100+ { 0xc6, "HSL Unknown Version" },
101+ { 0xc7, "HSL Unknown Version" },
102 { 0, NULL }
103 };
104
Harald Weltec19170b2011-01-15 13:07:44 +0100105@@ -714,6 +753,13 @@
Harald Welte98aa6132011-01-13 23:23:13 +0100106 [RSL_IE_IPAC_SPEECH_MODE] = { TLV_TYPE_TV, 0 },
107 [RSL_IE_IPAC_CONN_ID] = { TLV_TYPE_FIXED, 2 },
108 [RSL_IE_IPAC_RTP_PAYLOAD2] = { TLV_TYPE_TV, 0 },
109+ /* HSL */
110+ [RSL_IE_HSL_BTS_SERNO] = { TLV_TYPE_TLV,0 },
111+ [RSL_IE_HSL_TRAU_PARAMS] = { TLV_TYPE_TLV,0 },
112+ [RSL_IE_HSL_L1_PRIM] = { TLV_TYPE_TV, 0 },
113+ [RSL_IE_HSL_BTS_VERSION] = { TLV_TYPE_TLV, 0 },
114+ [RSL_IE_HSL_UNKNOWN_VERSION1] = { TLV_TYPE_TLV, 0 },
115+ [RSL_IE_HSL_UNKNOWN_VERSION2] = { TLV_TYPE_TLV, 0 },
116 },
117 };
118
Harald Weltec19170b2011-01-15 13:07:44 +0100119@@ -3120,7 +3166,7 @@
Harald Welte98aa6132011-01-13 23:23:13 +0100120 guint16 local_port = 0;
121 address src_addr;
122
123- msg_type = tvb_get_guint8(tvb, offset)&0x7f;
124+ msg_type = tvb_get_guint8(tvb, offset)&0xff;
125 offset++;
126
127 #if 0
Harald Weltec19170b2011-01-15 13:07:44 +0100128@@ -3259,6 +3305,35 @@
Harald Welte98aa6132011-01-13 23:23:13 +0100129 proto_tree_add_item(ie_tree, hf_rsl_cstat_avg_tx_dly, tvb,
130 offset+24, 4, FALSE);
131 break;
132+ /* HSL */
133+ case RSL_IE_HSL_BTS_SERNO:
134+ proto_tree_add_item(ie_tree, hf_rsl_hsl_bts_serno, tvb,
135+ offset, len, FALSE);
Harald Weltec19170b2011-01-15 13:07:44 +0100136+ col_append_fstr(pinfo->cinfo, COL_INFO, "SerNo %s ",
137+ tvb_get_string(tvb, offset, len));
Harald Welte98aa6132011-01-13 23:23:13 +0100138+ break;
139+ case RSL_IE_HSL_TRAU_PARAMS:
Harald Weltec19170b2011-01-15 13:07:44 +0100140+ proto_tree_add_item(tree, hf_rsl_hsl_trau_remote_port, tvb,
141+ offset+2, 2, TRUE);
142+ proto_tree_add_item(tree, hf_rsl_hsl_trau_remote_ip, tvb,
Harald Welte98aa6132011-01-13 23:23:13 +0100143+ offset+4, 4, FALSE);
144+ /* FIXME: other fields !! */
145+ break;
Harald Weltec19170b2011-01-15 13:07:44 +0100146+ case RSL_IE_HSL_L1_PRIM:
147+ proto_tree_add_item(ie_tree, hf_rsl_hsl_l1_prim, tvb,
148+ offset, len, FALSE);
149+ break;
150+ case RSL_IE_HSL_BTS_VERSION:
151+ proto_tree_add_item(ie_tree, hf_rsl_hsl_bts_ver, tvb,
152+ offset, len, FALSE);
153+ break;
Harald Welte98aa6132011-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 Weltec19170b2011-01-15 13:07:44 +0100164@@ -3284,10 +3359,12 @@
Harald Welte2268a8b2011-01-13 11:03:51 +0100165 guint8 msg_disc, msg_type;
166
167 msg_disc = tvb_get_guint8(tvb, offset++) >> 1;
168- msg_type = tvb_get_guint8(tvb,offset)&0x7f;
169+ msg_type = tvb_get_guint8(tvb,offset)&0xff;
170 proto_tree_add_item(tree, hf_rsl_msg_type, tvb, offset, 1, FALSE);
171
172- if (msg_disc == RSL_MSGDISC_IPACCESS) {
173+ switch (msg_disc) {
Harald Welte98aa6132011-01-13 23:23:13 +0100174+ case RSL_MSGDISC_HSL:
Harald Welte2268a8b2011-01-13 11:03:51 +0100175+ case RSL_MSGDISC_IPACCESS:
176 offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset);
177 return offset;
Harald Welte2268a8b2011-01-13 11:03:51 +0100178 }
Harald Weltec19170b2011-01-15 13:07:44 +0100179@@ -3924,7 +4001,7 @@
Harald Welte2268a8b2011-01-13 11:03:51 +0100180 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSL");
181 col_clear(pinfo->cinfo, COL_INFO);
182
183- msg_type = tvb_get_guint8(tvb,offset+1)&0x7f;
184+ msg_type = tvb_get_guint8(tvb,offset+1)&0xff;
185
186 if (check_col(pinfo->cinfo, COL_INFO)){
187 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",val_to_str(msg_type, rsl_msg_type_vals,"unknown %u"));
Harald Weltec19170b2011-01-15 13:07:44 +0100188@@ -3955,6 +4032,7 @@
Harald Welte2268a8b2011-01-13 11:03:51 +0100189
190 gsm_a_ccch_handle = find_dissector("gsm_a_ccch");
191 gsm_a_dtap_handle = find_dissector("gsm_a_dtap");
192+ bssgp_handle = find_dissector("bssgp");
193 }
194
195 /* Register the protocol with Wireshark */
Harald Weltec19170b2011-01-15 13:07:44 +0100196@@ -3975,7 +4053,7 @@
Harald Welte2268a8b2011-01-13 11:03:51 +0100197 },
198 { &hf_rsl_msg_type,
199 { "Message type", "rsl.msg_type",
200- FT_UINT8, BASE_HEX_DEC, VALS(rsl_msg_type_vals), 0x7f,
201+ FT_UINT8, BASE_HEX_DEC, VALS(rsl_msg_type_vals), 0xff,
202 NULL, HFILL }
203 },
204 { &hf_rsl_ie_id,
Harald Weltec19170b2011-01-15 13:07:44 +0100205@@ -4392,6 +4470,28 @@
Harald Welte98aa6132011-01-13 23:23:13 +0100206 { "Average Tx Delay", "rsl.ipacc.cstat.avg_tx_delay",
207 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
208 },
209+ /* HSL */
210+ { &hf_rsl_hsl_bts_serno,
211+ { "BTS Serial Number", "rsl.hsl.bts_serno",
212+ FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
213+ },
Harald Weltec19170b2011-01-15 13:07:44 +0100214+ { &hf_rsl_hsl_l1_prim,
215+ { "Layer 1 Primitive?", "rsl.hsl.l1_prim",
216+ FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
217+ },
218+ { &hf_rsl_hsl_bts_ver,
219+ { "BTS Version Number", "rsl.hsl.bts_ver",
220+ FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
221+ },
222+ { &hf_rsl_hsl_trau_remote_port,
223+ { "HSL TRAU Remote RTP Port", "rsl.hsl.trau.remote_port",
224+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL },
225+ },
226+ { &hf_rsl_hsl_trau_remote_ip,
227+ { "HSL TRAU Remote IP Address", "rsl.hsl.trau.remote_ip",
228+ FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL },
229+ },
230+
Harald Welte98aa6132011-01-13 23:23:13 +0100231 };
232 static gint *ett[] = {
233 &ett_rsl,