blob: 29220b87b324cecf38d5c6d49099fbbe7072e575 [file] [log] [blame]
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +08001From 8f35d623641dbba90e6186604c11e892bf515ecc Mon Sep 17 00:00:00 2001
2From: Holger Hans Peter Freyther <zecke@selfish.org>
3Date: Mon, 19 Apr 2010 13:32:58 +0800
4Subject: [PATCH 2/2] RSL patch
5
6---
7 epan/dissectors/packet-rsl.c | 522 +++++++++++++++++++++++++++++++++++++++++-
8 1 files changed, 515 insertions(+), 7 deletions(-)
9
10diff --git a/epan/dissectors/packet-rsl.c b/epan/dissectors/packet-rsl.c
11index b10a671..a455cf3 100644
12--- a/epan/dissectors/packet-rsl.c
13+++ b/epan/dissectors/packet-rsl.c
Harald Welte2d112ad2009-06-10 05:42:52 +080014@@ -2,6 +2,7 @@
15 * Routines for Radio Signalling Link (RSL) dissection.
16 *
17 * Copyright 2007, Anders Broman <anders.broman@ericsson.com>
18+ * Copyright 2009, Harald Welte <laforge@gnumonks.org>
19 *
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +080020 * $Id$
Harald Welte2d112ad2009-06-10 05:42:52 +080021 *
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +080022@@ -42,6 +43,8 @@
Harald Welte9e20bc52009-06-26 15:04:00 +020023 #include <epan/lapd_sapi.h>
24
25 #include "packet-gsm_a_common.h"
26+#include "packet-rtp.h"
27+#include "packet-rtcp.h"
28
29 /* Initialize the protocol and registered fields */
30 static int proto_rsl = -1;
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +080031@@ -115,6 +118,24 @@ static int hf_rsl_emlpp_prio = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080032 static int hf_rsl_rtd = -1;
33 static int hf_rsl_delay_ind = -1;
34 static int hf_rsl_tfo = -1;
Harald Welteb5280c72009-10-22 10:09:56 +020035+static int hf_rsl_speech_mode_s = -1;
36+static int hf_rsl_speech_mode_m = -1;
Harald Weltec9b484f2009-07-12 20:46:43 +020037+static int hf_rsl_conn_stat = -1;
38+static int hf_rsl_conn_id = -1;
39+static int hf_rsl_rtp_payload = -1;
Harald Welteb5280c72009-10-22 10:09:56 +020040+static int hf_rsl_rtp_csd_fmt_d = -1;
41+static int hf_rsl_rtp_csd_fmt_ir = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080042+static int hf_rsl_local_port = -1;
43+static int hf_rsl_remote_port = -1;
44+static int hf_rsl_local_ip = -1;
45+static int hf_rsl_remote_ip = -1;
Harald Welteb5280c72009-10-22 10:09:56 +020046+static int hf_rsl_cstat_tx_pkts = -1;
47+static int hf_rsl_cstat_tx_octs = -1;
48+static int hf_rsl_cstat_rx_pkts = -1;
49+static int hf_rsl_cstat_rx_octs = -1;
50+static int hf_rsl_cstat_lost_pkts = -1;
51+static int hf_rsl_cstat_ia_jitter = -1;
52+static int hf_rsl_cstat_avg_tx_dly = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080053
54 /* Initialize the subtree pointers */
55 static int ett_rsl = -1;
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +080056@@ -172,6 +193,15 @@ static int ett_ie_cause = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080057 static int ett_ie_meas_res_no = -1;
58 static int ett_ie_message_id = -1;
59 static int ett_ie_sys_info_type = -1;
Harald Weltec9b484f2009-07-12 20:46:43 +020060+static int ett_ie_speech_mode = -1;
61+static int ett_ie_conn_stat = -1;
62+static int ett_ie_conn_id = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080063+static int ett_ie_remote_ip = -1;
64+static int ett_ie_remote_port = -1;
65+static int ett_ie_local_port = -1;
66+static int ett_ie_local_ip = -1;
Harald Weltec9b484f2009-07-12 20:46:43 +020067+static int ett_ie_rtp_payload = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080068+
69
70 proto_tree *top_tree;
71 dissector_handle_t gsm_a_ccch_handle;
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +080072@@ -207,8 +237,11 @@ static const value_string rsl_msg_disc_vals[] = {
Harald Welte2d112ad2009-06-10 05:42:52 +080073 { 0x06, "Common Channel Management messages" },
74 { 0x08, "TRX Management messages" },
75 { 0x16, "Location Services messages" },
76+ { 0x3f, "ip.access Vendor Specific messages" },
77 { 0, NULL }
78 };
79+#define RSL_MSGDISC_IPACCESS 0x3f
80+
81 /*
82 * 9.2 MESSAGE TYPE
83 */
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +080084@@ -275,6 +308,49 @@ static const value_string rsl_msg_disc_vals[] = {
Harald Welte2d112ad2009-06-10 05:42:52 +080085 /* 0 1 - - - - - - Location Services messages: */
Harald Welte9e20bc52009-06-26 15:04:00 +020086 #define RSL_MSG_LOC_INF 65 /* 8.7.1 */
Harald Welte2d112ad2009-06-10 05:42:52 +080087
88+/* Vendor-Specific messages of ip.access nanoBTS. There is no public documentation
89+ * about those extensions, all information in this dissector is based on lawful
90+ * protocol reverse enginering by Harald Welte <laforge@gnumonks.org> */
Harald Weltea1f0ac72009-07-12 21:59:04 +020091+#define RSL_MSG_TYPE_IPAC_MEAS_PP_DEF 0x60
92+#define RSL_MSG_TYPE_IPAC_HO_CAND_INQ 0x61
93+#define RSL_MSG_TYPE_IPAC_HO_CAND_RESP 0x62
94+
95+#define RSL_MSG_TYPE_IPAC_PDCH_ACT 0x48
96+#define RSL_MSG_TYPE_IPAC_PDCH_ACT_ACK 0x49
97+#define RSL_MSG_TYPE_IPAC_PDCH_ACT_NACK 0x4a
98+#define RSL_MSG_TYPE_IPAC_PDCH_DEACT 0x4b
99+#define RSL_MSG_TYPE_IPAC_PDCH_DEACT_ACK 0x4c
100+#define RSL_MSG_TYPE_IPAC_PDCH_DEACT_NACK 0x4d
101+
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800102+#define RSL_MSG_TYPE_IPAC_CRCX 0x70
103+#define RSL_MSG_TYPE_IPAC_CRCX_ACK 0x71
104+#define RSL_MSG_TYPE_IPAC_CRCX_NACK 0x72
105+#define RSL_MSG_TYPE_IPAC_MDCX 0x73
106+#define RSL_MSG_TYPE_IPAC_MDCX_ACK 0x74
107+#define RSL_MSG_TYPE_IPAC_MDCX_NACK 0x75
108+#define RSL_MSG_TYPE_IPAC_DLCX_IND 0x76
109+#define RSL_MSG_TYPE_IPAC_DLCX 0x77
110+#define RSL_MSG_TYPE_IPAC_DLCX_ACK 0x78
111+#define RSL_MSG_TYPE_IPAC_DLCX_NACK 0x79
Harald Welte8dc1a682009-07-01 11:22:01 +0200112+
Harald Weltec9b484f2009-07-12 20:46:43 +0200113+#define RSL_IE_IPAC_SRTP_CONFIG 0xe0
114+#define RSL_IE_IPAC_PROXY_UDP 0xe1
115+#define RSL_IE_IPAC_BSCMPL_TOUT 0xe2
Harald Welte2d112ad2009-06-10 05:42:52 +0800116+#define RSL_IE_IPAC_REMOTE_IP 0xf0
117+#define RSL_IE_IPAC_REMOTE_PORT 0xf1
Harald Weltec9b484f2009-07-12 20:46:43 +0200118+#define RSL_IE_IPAC_RTP_PAYLOAD 0xf2
Harald Welte2d112ad2009-06-10 05:42:52 +0800119+#define RSL_IE_IPAC_LOCAL_PORT 0xf3
Harald Weltec9b484f2009-07-12 20:46:43 +0200120+#define RSL_IE_IPAC_SPEECH_MODE 0xf4
Harald Welte2d112ad2009-06-10 05:42:52 +0800121+#define RSL_IE_IPAC_LOCAL_IP 0xf5
Harald Weltec9b484f2009-07-12 20:46:43 +0200122+#define RSL_IE_IPAC_CONN_STAT 0xf6
123+#define RSL_IE_IPAC_HO_C_PARMS 0xf7
124+#define RSL_IE_IPAC_CONN_ID 0xf8
125+#define RSL_IE_IPAC_RTP_CSD_FMT 0xf9
126+#define RSL_IE_IPAC_RTP_JIT_BUF 0xfa
127+#define RSL_IE_IPAC_RTP_COMPR 0xfb
128+#define RSL_IE_IPAC_RTP_PAYLOAD2 0xfc
129+#define RSL_IE_IPAC_RTP_MPLEX 0xfd
130+#define RSL_IE_IPAC_RTP_MPLEX_ID 0xfe
Harald Welte9e20bc52009-06-26 15:04:00 +0200131
132 static const value_string rsl_msg_type_vals[] = {
133 /* 0 0 0 0 - - - - Radio Link Layer Management messages: */
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800134@@ -337,6 +413,26 @@ static const value_string rsl_msg_type_vals[] = {
Harald Welte9e20bc52009-06-26 15:04:00 +0200135 { 0x3f, "TFO MODification REQuest" }, /* 8.4.31 */
136 /* 0 1 - - - - - - Location Services messages: */
137 { 0x41, "Location Information" }, /* 8.7.1 */
138+ /* ip.access */
Harald Weltea1f0ac72009-07-12 21:59:04 +0200139+ { 0x48, "ip.access PDCH ACTIVATION" },
140+ { 0x49, "ip.access PDCH ACTIVATION ACK" },
141+ { 0x4a, "ip.access PDCH ACTIVATION NACK" },
142+ { 0x4b, "ip.access PDCH DEACTIVATION" },
143+ { 0x4c, "ip.access PDCH DEACTIVATION ACK" },
144+ { 0x4d, "ip.access PDCH DEACTIVATION NACK" },
145+ { 0x60, "ip.access MEASurement PREPROCessing DeFauLT" },
146+ { 0x61, "ip.access HANDOover CANDidate ENQuiry" },
147+ { 0x62, "ip.access HANDOover CANDidate RESPonse" },
Holger Hans Peter Freytherb9bda7b2009-11-18 21:31:15 +0100148+ { 0x70, "ip.access CRCX" },
149+ { 0x71, "ip.access CRCX ACK" },
150+ { 0x72, "ip.access CRCX NACK" },
151+ { 0x73, "ip.access MDCX" },
152+ { 0x74, "ip.access MDCX ACK" },
153+ { 0x75, "ip.access MDCX NACK" },
154+ { 0x76, "ip.access DLCX INDication" },
155+ { 0x77, "ip.access DLCX" },
156+ { 0x78, "ip.access DLCX ACK" },
157+ { 0x79, "ip.access DLCX NACK" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200158 { 0, NULL }
159 };
160
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800161@@ -370,10 +466,10 @@ static const value_string rsl_msg_type_vals[] = {
Harald Weltea1f0ac72009-07-12 21:59:04 +0200162 #define RSL_IE_MESSAGE_ID 28
163
164 #define RSL_IE_SYS_INFO_TYPE 30
165-
166-
167-
168-
169+#define RSL_IE_MS_POWER_PARAM 31
170+#define RSL_IE_BS_POWER_PARAM 32
171+#define RSL_IE_PREPROC_PARAM 33
172+#define RSL_IE_PREPROC_MEAS 34
173 #define RSL_IE_FULL_IMM_ASS_INF 35
174 #define RSL_IE_SMSCB_INF 36
175 #define RSL_IE_FULL_MS_TIMING_OFFSET 37
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800176@@ -476,6 +572,24 @@ static const value_string rsl_ie_type_vals[] = {
Harald Welte9e20bc52009-06-26 15:04:00 +0200177 Not used
178
179 */
Harald Weltec9b484f2009-07-12 20:46:43 +0200180+ { 0xe0, "SRTP Configuration" },
181+ { 0xe1, "BSC Proxy UDP Port" },
182+ { 0xe2, "BSC Multiplex Timeout" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200183+ { 0xf0, "Remote IP Address" },
184+ { 0xf1, "Remote RTP Port" },
Harald Weltec9b484f2009-07-12 20:46:43 +0200185+ { 0xf2, "RTP Payload Type" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200186+ { 0xf3, "Local RTP Port" },
Harald Weltec9b484f2009-07-12 20:46:43 +0200187+ { 0xf4, "Speech Mode" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200188+ { 0xf5, "Local IP Address" },
Harald Weltec9b484f2009-07-12 20:46:43 +0200189+ { 0xf6, "Connection Statistics" },
190+ { 0xf7, "Handover C Parameters" },
191+ { 0xf8, "Connection Identifier" },
192+ { 0xf9, "RTP CSD Format" },
193+ { 0xfa, "RTP Jitter Buffer" },
194+ { 0xfb, "RTP Compression" },
195+ { 0xfc, "RTP Payload Type 2" },
196+ { 0xfd, "RTP Multiplex" },
197+ { 0xfe, "RTP Multiplex Identifier" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200198 { 0, NULL }
199 };
200
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800201@@ -512,6 +626,96 @@ static const value_string rsl_ch_no_Cbits_vals[] = {
Harald Welte9e20bc52009-06-26 15:04:00 +0200202 { 0, NULL }
203 };
204
205+/* From openbsc/include/openbsc/tlv.h */
206+enum tlv_type {
207+ TLV_TYPE_FIXED,
208+ TLV_TYPE_T,
209+ TLV_TYPE_TV,
210+ TLV_TYPE_TLV,
211+ TLV_TYPE_TL16V,
212+};
213+
214+struct tlv_def {
215+ enum tlv_type type;
216+ u_int8_t fixed_len;
217+};
218+
219+struct tlv_definition {
220+ struct tlv_def def[0xff];
221+};
222+
223+static const struct tlv_definition rsl_att_tlvdef = {
224+ .def = {
225+ [RSL_IE_CH_NO] = { TLV_TYPE_TV, 0 },
226+ [RSL_IE_LINK_ID] = { TLV_TYPE_TV, 0 },
227+ [RSL_IE_ACT_TYPE] = { TLV_TYPE_TV, 0 },
228+ [RSL_IE_BS_POW] = { TLV_TYPE_TV, 0 },
229+ [RSL_IE_CH_ID] = { TLV_TYPE_TLV, 0 },
230+ [RSL_IE_CH_MODE] = { TLV_TYPE_TLV, 0 },
231+ [RSL_IE_ENC_INF] = { TLV_TYPE_TLV, 0 },
232+ [RSL_IE_FRAME_NO] = { TLV_TYPE_FIXED, 2 },
233+ [RSL_IE_HO_REF] = { TLV_TYPE_TV, 0 },
234+ [RSL_IE_L1_INF] = { TLV_TYPE_FIXED, 2 },
235+ [RSL_IE_L3_INF] = { TLV_TYPE_TL16V, 0 },
236+ [RSL_IE_MS_ID] = { TLV_TYPE_TLV, 0 },
237+ [RSL_IE_MS_POW] = { TLV_TYPE_TV, 0 },
238+ [RSL_IE_PAGING_GRP] = { TLV_TYPE_TV, 0 },
239+ [RSL_IE_PAGING_LOAD] = { TLV_TYPE_FIXED, 2 },
240+ [RSL_IE_PHY_CTX] = { TLV_TYPE_TLV, 0 },
241+ [RSL_IE_ACCESS_DELAY] = { TLV_TYPE_TV, 0 },
242+ [RSL_IE_RACH_LOAD] = { TLV_TYPE_TLV, 0 },
243+ [RSL_IE_REQ_REF] = { TLV_TYPE_FIXED, 3 },
244+ [RSL_IE_REL_MODE] = { TLV_TYPE_TV, 0 },
245+ [RSL_IE_RESOURCE_INF] = { TLV_TYPE_TLV, 0 },
246+ [RSL_IE_RLM_CAUSE] = { TLV_TYPE_TLV, 0 },
247+ [RSL_IE_STARTING_TIME] = { TLV_TYPE_FIXED, 2 },
248+ [RSL_IE_TIMING_ADV] = { TLV_TYPE_TV, 0 },
249+ [RSL_IE_UPLINK_MEAS] = { TLV_TYPE_TLV, 0 },
250+ [RSL_IE_CAUSE] = { TLV_TYPE_TLV, 0 },
251+ [RSL_IE_MEAS_RES_NO] = { TLV_TYPE_TV, 0 },
252+ [RSL_IE_MESSAGE_ID] = { TLV_TYPE_TV, 0 },
253+ [RSL_IE_SYS_INFO_TYPE] = { TLV_TYPE_TV, 0 },
Harald Weltea1f0ac72009-07-12 21:59:04 +0200254+ [RSL_IE_MS_POWER_PARAM] = { TLV_TYPE_TLV, 0 },
255+ [RSL_IE_BS_POWER_PARAM] = { TLV_TYPE_TLV, 0 },
256+ [RSL_IE_PREPROC_PARAM] = { TLV_TYPE_TLV, 0 },
257+ [RSL_IE_PREPROC_MEAS] = { TLV_TYPE_TLV, 0 },
Harald Welte9e20bc52009-06-26 15:04:00 +0200258+ //[RSL_IE_IMM_ASS_INFO] = { TLV_TYPE_TLV, 0 },
259+ //[RSL_IE_SMSCB_INFO] = { TLV_TYPE_FIXED, 23 },
260+ //[RSL_IE_MS_TIMING_OFFSET] = { TLV_TYPE_TV, 0 },
261+ [RSL_IE_ERR_MSG] = { TLV_TYPE_TLV, 0 },
262+ [RSL_IE_FULL_BCCH_INF] = { TLV_TYPE_TLV, 0 },
263+ [RSL_IE_CH_NEEDED] = { TLV_TYPE_TV, 0 },
264+ [RSL_IE_CB_CMD_TYPE] = { TLV_TYPE_TV, 0 },
265+ [RSL_IE_SMSCB_MESS] = { TLV_TYPE_TLV, 0 },
266+ [RSL_IE_FULL_IMM_ASS_INF] = { TLV_TYPE_TLV, 0 },
267+ //[RSL_IE_SACCH_INFO] = { TLV_TYPE_TLV, 0 },
268+ [RSL_IE_CBCH_LOAD_INF] = { TLV_TYPE_TV, 0 },
269+ [RSL_IE_SMSCB_CH_IND] = { TLV_TYPE_TV, 0 },
270+ [RSL_IE_GRP_CALL_REF] = { TLV_TYPE_TLV, 0 },
271+ [RSL_IE_CH_DESC] = { TLV_TYPE_TLV, 0 },
272+ [RSL_IE_NCH_DRX_INF] = { TLV_TYPE_TLV, 0 },
273+ [RSL_IE_CMD_IND] = { TLV_TYPE_TLV, 0 },
274+ [RSL_IE_EMLPP_PRIO] = { TLV_TYPE_TV, 0 },
275+ [RSL_IE_UIC] = { TLV_TYPE_TLV, 0 },
276+ [RSL_IE_MAIN_CH_REF] = { TLV_TYPE_TV, 0 },
277+ [RSL_IE_MULTIRATE_CONF] = { TLV_TYPE_TLV, 0 },
278+ [RSL_IE_MULTIRATE_CNTRL] = { TLV_TYPE_TV, 0 },
279+ [RSL_IE_SUP_CODEC_TYPES] = { TLV_TYPE_TLV, 0 },
280+ [RSL_IE_CODEC_CONF] = { TLV_TYPE_TLV, 0 },
281+ [RSL_IE_RTD] = { TLV_TYPE_TV, 0 },
282+ [RSL_IE_TFO_STATUS] = { TLV_TYPE_TV, 0 },
283+ [RSL_IE_LLP_APDU] = { TLV_TYPE_TLV, 0 },
284+ [RSL_IE_IPAC_REMOTE_IP] = { TLV_TYPE_FIXED, 4 },
285+ [RSL_IE_IPAC_REMOTE_PORT] = { TLV_TYPE_FIXED, 2 },
286+ [RSL_IE_IPAC_LOCAL_IP] = { TLV_TYPE_FIXED, 4 },
Harald Welteb5280c72009-10-22 10:09:56 +0200287+ [RSL_IE_IPAC_CONN_STAT] = { TLV_TYPE_TLV, 0 },
Harald Welte9e20bc52009-06-26 15:04:00 +0200288+ [RSL_IE_IPAC_LOCAL_PORT] = { TLV_TYPE_FIXED, 2 },
Harald Weltec9b484f2009-07-12 20:46:43 +0200289+ [RSL_IE_IPAC_SPEECH_MODE] = { TLV_TYPE_TV, 0 },
290+ [RSL_IE_IPAC_CONN_ID] = { TLV_TYPE_FIXED, 2 },
291+ [RSL_IE_IPAC_RTP_PAYLOAD2] = { TLV_TYPE_TV, 0 },
Harald Welte9e20bc52009-06-26 15:04:00 +0200292+ },
293+};
294+
295 /* 9.3.1 Channel number 9.3.1 M TV 2 */
296 static int
297 dissect_rsl_ie_ch_no(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800298@@ -2042,7 +2246,6 @@ dissect_rsl_ie_err_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
Harald Welte9e20bc52009-06-26 15:04:00 +0200299 proto_item_set_len(ti, length+2);
300
301 proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, FALSE);
302- offset++;
303
304 /* Received Message */
305 offset = dissct_rsl_msg(tvb, pinfo, ie_tree, offset);
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800306@@ -2907,12 +3110,184 @@ dissect_rsl_ie_tfo_transp_cont(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
Harald Welte9e20bc52009-06-26 15:04:00 +0200307 }
308
Harald Welteb5280c72009-10-22 10:09:56 +0200309 static int
Harald Weltea1f0ac72009-07-12 21:59:04 +0200310+dissct_rsl_ipaccess_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
Harald Welte2d112ad2009-06-10 05:42:52 +0800311+{
312+ guint8 msg_type;
Harald Welte9e20bc52009-06-26 15:04:00 +0200313+ guint32 local_addr = 0;
314+ guint16 local_port = 0;
315+ address src_addr;
Harald Welte2d112ad2009-06-10 05:42:52 +0800316+
317+ msg_type = tvb_get_guint8(tvb, offset)&0x7f;
318+ offset++;
319+
Harald Welteb5280c72009-10-22 10:09:56 +0200320+#if 0
Harald Welte2d112ad2009-06-10 05:42:52 +0800321+ switch (msg_type) {
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800322+ case RSL_MSG_TYPE_IPAC_CRCX:
323+ case RSL_MSG_TYPE_IPAC_CRCX_ACK:
324+ case RSL_MSG_TYPE_IPAC_CRCX_NACK:
325+ case RSL_MSG_TYPE_IPAC_MDCX:
326+ case RSL_MSG_TYPE_IPAC_MDCX_ACK:
327+ case RSL_MSG_TYPE_IPAC_MDCX_NACK:
328+ case RSL_MSG_TYPE_IPAC_DLCX_IND:
329+ case RSL_MSG_TYPE_IPAC_DLCX:
330+ case RSL_MSG_TYPE_IPAC_DLCX_ACK:
331+ case RSL_MSG_TYPE_IPAC_DLCX_NACK:
Harald Weltea1f0ac72009-07-12 21:59:04 +0200332+ case RSL_MSG_TYPE_IPAC_PDCH_ACT:
333+ case RSL_MSG_TYPE_IPAC_PDCH_ACT_ACK:
334+ case RSL_MSG_TYPE_IPAC_PDCH_ACT_NACK:
335+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT:
336+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT_ACK:
337+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT_NACK:
Harald Welte2d112ad2009-06-10 05:42:52 +0800338+ /* Channel number 9.3.1 M TV 2 */
339+ offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
340+ break;
Harald Welte4e8c98a2009-08-20 00:59:11 +0900341+ }
Harald Welteb5280c72009-10-22 10:09:56 +0200342+#endif
343+ /* parse TLV attributes */
Harald Welte9e20bc52009-06-26 15:04:00 +0200344+ while (tvb_reported_length_remaining(tvb, offset) != 0) {
345+ guint8 tag;
346+ unsigned int len, hlen, len_len;
347+ const struct tlv_def *tdef;
348+ proto_item *ti;
349+ proto_tree *ie_tree;
350+
351+ tag = tvb_get_guint8(tvb, offset);
352+ tdef = &rsl_att_tlvdef.def[tag];
353+
354+ switch (tdef->type) {
355+ case TLV_TYPE_FIXED:
356+ hlen = 1;
357+ len_len = 0;
358+ len = tdef->fixed_len;
359+ break;
360+ case TLV_TYPE_T:
361+ hlen = 1;
362+ len_len = 0;
363+ len = 0;
364+ break;
365+ case TLV_TYPE_TV:
366+ hlen = 1;
367+ len_len = 0;
368+ len = 1;
369+ break;
370+ case TLV_TYPE_TLV:
371+ hlen = 2;
372+ len_len = 1;
373+ len = tvb_get_guint8(tvb, offset+1);
374+ break;
375+ case TLV_TYPE_TL16V:
376+ hlen = 3;
377+ len_len = 2;
378+ len = tvb_get_guint8(tvb, offset+1) << 8 |
379+ tvb_get_guint8(tvb, offset+2);
380+ break;
Harald Weltea1f0ac72009-07-12 21:59:04 +0200381+ default:
382+ hlen = len_len = len = 0;
383+ DISSECTOR_ASSERT_NOT_REACHED();
384+ break;
Harald Welte9e20bc52009-06-26 15:04:00 +0200385+ }
386+
387+ ti = proto_tree_add_item(tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
388+ ie_tree = proto_item_add_subtree(ti, ett_ie_local_port);
389+ offset += hlen;
390+
391+ switch (tag) {
392+ case RSL_IE_CH_NO:
Harald Welteb5280c72009-10-22 10:09:56 +0200393+ dissect_rsl_ie_ch_no(tvb, pinfo, ie_tree, offset, FALSE);
Harald Weltea1f0ac72009-07-12 21:59:04 +0200394+ break;
395+ case RSL_IE_FRAME_NO:
Harald Welteb5280c72009-10-22 10:09:56 +0200396+ dissect_rsl_ie_frame_no(tvb, pinfo, ie_tree, offset, FALSE);
Harald Weltea1f0ac72009-07-12 21:59:04 +0200397+ break;
398+ case RSL_IE_MS_POW:
Harald Welteb5280c72009-10-22 10:09:56 +0200399+ dissect_rsl_ie_ms_pow(tvb, pinfo, ie_tree, offset, FALSE);
Harald Welte9e20bc52009-06-26 15:04:00 +0200400+ break;
401+ case RSL_IE_IPAC_REMOTE_IP:
Harald Welte8dc1a682009-07-01 11:22:01 +0200402+ proto_tree_add_item(ie_tree, hf_rsl_remote_ip, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200403+ offset, len, FALSE);
Harald Welte9e20bc52009-06-26 15:04:00 +0200404+ break;
405+ case RSL_IE_IPAC_REMOTE_PORT:
Harald Welte8dc1a682009-07-01 11:22:01 +0200406+ proto_tree_add_item(ie_tree, hf_rsl_remote_port, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200407+ offset, len, FALSE);
Harald Welte9e20bc52009-06-26 15:04:00 +0200408+ break;
409+ case RSL_IE_IPAC_LOCAL_IP:
Harald Welte8dc1a682009-07-01 11:22:01 +0200410+ proto_tree_add_item(ie_tree, hf_rsl_local_ip, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200411+ offset, len, FALSE);
Harald Welte9e20bc52009-06-26 15:04:00 +0200412+ local_addr = tvb_get_ipv4(tvb, offset);
413+ break;
414+ case RSL_IE_IPAC_LOCAL_PORT:
Harald Welte8dc1a682009-07-01 11:22:01 +0200415+ proto_tree_add_item(ie_tree, hf_rsl_local_port, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200416+ offset, len, FALSE);
Harald Welte9e20bc52009-06-26 15:04:00 +0200417+ local_port = tvb_get_ntohs(tvb, offset);
418+ break;
Harald Weltec9b484f2009-07-12 20:46:43 +0200419+ case RSL_IE_IPAC_SPEECH_MODE:
Harald Welteb5280c72009-10-22 10:09:56 +0200420+ proto_tree_add_item(ie_tree, hf_rsl_speech_mode_s, tvb,
421+ offset, len, FALSE);
422+ proto_tree_add_item(ie_tree, hf_rsl_speech_mode_m, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200423+ offset, len, FALSE);
Harald Weltec9b484f2009-07-12 20:46:43 +0200424+ break;
425+ case RSL_IE_IPAC_RTP_PAYLOAD:
426+ case RSL_IE_IPAC_RTP_PAYLOAD2:
427+ proto_tree_add_item(ie_tree, hf_rsl_rtp_payload, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200428+ offset, len, FALSE);
429+ break;
Harald Welteb5280c72009-10-22 10:09:56 +0200430+ case RSL_IE_IPAC_RTP_CSD_FMT:
431+ proto_tree_add_item(ie_tree, hf_rsl_rtp_csd_fmt_d, tvb,
432+ offset, len, FALSE);
433+ proto_tree_add_item(ie_tree, hf_rsl_rtp_csd_fmt_ir, tvb,
434+ offset, len, FALSE);
435+ break;
Harald Weltec9b484f2009-07-12 20:46:43 +0200436+ case RSL_IE_IPAC_CONN_ID:
437+ proto_tree_add_item(ie_tree, hf_rsl_conn_id, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200438+ offset, len, FALSE);
Holger Hans Peter Freytherb9bda7b2009-11-18 21:31:15 +0100439+ break;
Harald Welteb5280c72009-10-22 10:09:56 +0200440+ case RSL_IE_IPAC_CONN_STAT:
441+ proto_tree_add_item(ie_tree, hf_rsl_cstat_tx_pkts, tvb,
442+ offset, 4, FALSE);
443+ proto_tree_add_item(ie_tree, hf_rsl_cstat_tx_octs, tvb,
444+ offset+4, 4, FALSE);
445+ proto_tree_add_item(ie_tree, hf_rsl_cstat_rx_pkts, tvb,
446+ offset+8, 4, FALSE);
447+ proto_tree_add_item(ie_tree, hf_rsl_cstat_rx_octs, tvb,
448+ offset+12, 4, FALSE);
449+ proto_tree_add_item(ie_tree, hf_rsl_cstat_lost_pkts, tvb,
450+ offset+16, 4, FALSE);
451+ proto_tree_add_item(ie_tree, hf_rsl_cstat_ia_jitter, tvb,
452+ offset+20, 4, FALSE);
453+ proto_tree_add_item(ie_tree, hf_rsl_cstat_avg_tx_dly, tvb,
454+ offset+24, 4, FALSE);
Harald Weltec9b484f2009-07-12 20:46:43 +0200455+ break;
Harald Welte9e20bc52009-06-26 15:04:00 +0200456+ }
457+ offset += len;
Harald Welte2d112ad2009-06-10 05:42:52 +0800458+ }
459+
Harald Welte9e20bc52009-06-26 15:04:00 +0200460+ switch (msg_type) {
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800461+ case RSL_MSG_TYPE_IPAC_CRCX_ACK:
Harald Welte8dc1a682009-07-01 11:22:01 +0200462+ /* Notify the RTP and RTCP dissectors about a new RTP stream */
Harald Welte9e20bc52009-06-26 15:04:00 +0200463+ src_addr.type = AT_IPv4;
464+ src_addr.len = 4;
465+ src_addr.data = (guint8 *)&local_addr;
Harald Welte8dc1a682009-07-01 11:22:01 +0200466+ rtp_add_address(pinfo, &src_addr, local_port, 0,
Harald Welte63aba292009-07-04 04:11:21 +0200467+ "GSM A-bis/IP", pinfo->fd->num, 0, NULL);
Harald Welte8dc1a682009-07-01 11:22:01 +0200468+ rtcp_add_address(pinfo, &src_addr, local_port+1, 0,
469+ "GSM A-bis/IP", pinfo->fd->num);
Harald Welte9e20bc52009-06-26 15:04:00 +0200470+ break;
471+ }
Harald Welte2d112ad2009-06-10 05:42:52 +0800472+ return offset;
473+}
474+
Harald Welteb5280c72009-10-22 10:09:56 +0200475+static int
Harald Welte2d112ad2009-06-10 05:42:52 +0800476 dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
477 {
478- guint8 msg_type;
479+ guint8 msg_disc, msg_type;
480
481+ msg_disc = tvb_get_guint8(tvb, offset++) >> 1;
482 msg_type = tvb_get_guint8(tvb,offset)&0x7f;
483 proto_tree_add_item(tree, hf_rsl_msg_type, tvb, offset, 1, FALSE);
484+
485+ if (msg_disc == RSL_MSGDISC_IPACCESS) {
486+ offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset);
487+ return offset;
488+ }
489 offset++;
490
491 switch (msg_type){
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800492@@ -3480,6 +3855,18 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
Harald Weltea1f0ac72009-07-12 21:59:04 +0200493 /* LLP APDU 9.3.58 M LV 2-N */
494 offset = dissect_rsl_ie_llp_apdu(tvb, pinfo, tree, offset, TRUE);
495 break;
496+ /* the following messages are ip.access specific but sent without
497+ * ip.access memssage discriminator */
498+ case RSL_MSG_TYPE_IPAC_MEAS_PP_DEF:
499+ case RSL_MSG_TYPE_IPAC_HO_CAND_INQ:
500+ case RSL_MSG_TYPE_IPAC_HO_CAND_RESP:
501+ case RSL_MSG_TYPE_IPAC_PDCH_ACT:
502+ case RSL_MSG_TYPE_IPAC_PDCH_ACT_ACK:
503+ case RSL_MSG_TYPE_IPAC_PDCH_ACT_NACK:
504+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT:
505+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT_ACK:
506+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT_NACK:
507+ offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset-1);
508 default:
509 break;
510 }
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800511@@ -3487,6 +3874,40 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
Harald Welteb5280c72009-10-22 10:09:56 +0200512 return offset;
513
514 }
515+
516+static const value_string rsl_ipacc_spm_s_vals[] = {
517+ { 0, "GSM FR codec (GSM type 1, FS)" },
518+ { 1, "GSM EFR codec (GSM type 2, FS)" },
519+ { 2, "GSM AMR/FR codec (GSM type 3, FS)" },
520+ { 3, "GSM HR codec (GSM type 1, HS)" },
521+ { 5, "GSM AMR/HR codec (GSM type 3, HS)" },
522+ { 0xf, "As specified by RTP Payload Type IE" },
523+ { 0, NULL }
524+};
525+
526+static const value_string rsl_ipacc_spm_m_vals[] = {
527+ { 0, "Send and Receive" },
528+ { 1, "Receive Only" },
529+ { 2, "Send Only" },
530+ { 0, NULL }
531+};
532+
533+static const value_string rsl_ipacc_rtp_csd_fmt_d_vals[] = {
534+ { 0, "External TRAU format" },
535+ { 1, "Non-TRAU Packed format" },
536+ { 2, "TRAU within the BTS" },
537+ { 3, "IWF-Free BTS-BTS Data" },
538+ { 0, NULL }
539+};
540+
541+static const value_string rsl_ipacc_rtp_csd_fmt_ir_vals[] = {
542+ { 0, "8kb/s" },
543+ { 1, "16kb/s" },
544+ { 2, "32kb/s" },
545+ { 3, "64kb/s" },
546+ { 0, NULL }
547+};
548+
549 static void
550 dissect_rsl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
551 {
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800552@@ -3514,7 +3935,6 @@ dissect_rsl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
Harald Welte2d112ad2009-06-10 05:42:52 +0800553 /* 9.1 Message discriminator */
554 proto_tree_add_item(rsl_tree, hf_rsl_msg_dsc, tvb, offset, 1, FALSE);
555 proto_tree_add_item(rsl_tree, hf_rsl_T_bit, tvb, offset, 1, FALSE);
556- offset++;
557
558 offset = dissct_rsl_msg(tvb, pinfo, rsl_tree, offset);
559
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800560@@ -3884,6 +4304,86 @@ void proto_register_rsl(void)
Harald Welte2d112ad2009-06-10 05:42:52 +0800561 FT_UINT8, BASE_DEC, VALS(rsl_emlpp_prio_vals), 0x03,
Harald Welte63aba292009-07-04 04:11:21 +0200562 NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800563 },
Harald Welteb5280c72009-10-22 10:09:56 +0200564+ { &hf_rsl_speech_mode_s,
565+ { "ip.access Speech Mode S", "rsl.ipacc.speech_mode_s",
566+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_spm_s_vals),
567+ 0xf, NULL, HFILL }
568+ },
569+ { &hf_rsl_speech_mode_m,
570+ { "ip.access Speech Mode M", "rsl.ipacc.speech_mode_m",
571+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_spm_m_vals),
572+ 0xf0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800573+ },
Harald Weltec9b484f2009-07-12 20:46:43 +0200574+ { &hf_rsl_conn_stat,
575+ { "ip.access Connection Statistics","rsl.ipacc.conn_stat",
Harald Welteb5280c72009-10-22 10:09:56 +0200576+ FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800577+ },
Harald Weltec9b484f2009-07-12 20:46:43 +0200578+ { &hf_rsl_conn_id,
579+ { "ip.access Connection ID", "rsl.ipacc.conn_id",
580+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800581+ },
Harald Weltec9b484f2009-07-12 20:46:43 +0200582+ { &hf_rsl_rtp_payload,
583+ { "ip.access RTP Payload Type", "rsl.ipacc.rtp_payload",
584+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800585+ },
Harald Welteb5280c72009-10-22 10:09:56 +0200586+ { &hf_rsl_rtp_csd_fmt_d,
587+ { "ip.access RTP CSD Format D", "rsl.ipacc.rtp_csd_fmt_d",
588+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_rtp_csd_fmt_d_vals),
589+ 0x0f, NULL, HFILL },
590+ },
591+ { &hf_rsl_rtp_csd_fmt_ir,
592+ { "ip.access RTP CSD Format IR", "rsl.ipacc.rtp_csd_fmt_ir",
593+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_rtp_csd_fmt_ir_vals),
594+ 0xf0, NULL, HFILL },
595+ },
Harald Welte2d112ad2009-06-10 05:42:52 +0800596+ { &hf_rsl_local_port,
597+ { "ip.access Local RTP Port", "rsl.ipacc.local_port",
598+ FT_UINT16, BASE_DEC, NULL, 0x0,
599+ "ip.access Local RTP Port", HFILL },
600+ },
601+ { &hf_rsl_remote_port,
602+ { "ip.access Remote RTP Port", "rsl.ipacc.remote_port",
603+ FT_UINT16, BASE_DEC, NULL, 0x0,
604+ "ip.access Remote RTP Port", HFILL },
605+ },
606+ { &hf_rsl_local_ip,
607+ { "ip.access Local IP Address", "rsl.ipacc.local_ip",
608+ FT_IPv4, BASE_NONE, NULL, 0x0,
609+ "ip.access Local IP Address", HFILL },
610+ },
611+ { &hf_rsl_remote_ip,
612+ { "ip.access Remote IP Address", "rsl.ipacc.remote_ip",
613+ FT_IPv4, BASE_NONE, NULL, 0x0,
614+ "ip.access Remote IP Address", HFILL },
615+ },
Harald Welteb5280c72009-10-22 10:09:56 +0200616+ { &hf_rsl_cstat_tx_pkts,
617+ { "Packets Sent", "rsl.ipacc.cstat.tx_pkts",
618+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
619+ },
620+ { &hf_rsl_cstat_tx_octs,
621+ { "Octets Sent", "rsl.ipacc.cstat.tx_octets",
622+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
623+ },
624+ { &hf_rsl_cstat_rx_pkts,
625+ { "Packets Received", "rsl.ipacc.cstat.rx_pkts",
626+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
627+ },
628+ { &hf_rsl_cstat_rx_octs,
629+ { "Octets Received", "rsl.ipacc.cstat.rx_octets",
630+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
631+ },
632+ { &hf_rsl_cstat_lost_pkts,
633+ { "Packets Lost", "rsl.ipacc.cstat.lost_pkts",
634+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
635+ },
636+ { &hf_rsl_cstat_ia_jitter,
637+ { "Inter-arrival Jitter", "rsl.ipacc.cstat.ia_jitter",
638+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
639+ },
640+ { &hf_rsl_cstat_avg_tx_dly,
641+ { "Average Tx Delay", "rsl.ipacc.cstat.avg_tx_delay",
642+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
643+ },
Harald Welte2d112ad2009-06-10 05:42:52 +0800644 };
645 static gint *ett[] = {
646 &ett_rsl,
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800647@@ -3941,6 +4441,14 @@ void proto_register_rsl(void)
Harald Welte2d112ad2009-06-10 05:42:52 +0800648 &ett_ie_meas_res_no,
649 &ett_ie_message_id,
650 &ett_ie_sys_info_type,
Harald Weltec9b484f2009-07-12 20:46:43 +0200651+ &ett_ie_speech_mode,
652+ &ett_ie_conn_stat,
653+ &ett_ie_conn_id,
Harald Welte2d112ad2009-06-10 05:42:52 +0800654+ &ett_ie_remote_ip,
655+ &ett_ie_remote_port,
656+ &ett_ie_local_port,
657+ &ett_ie_local_ip,
Harald Weltec9b484f2009-07-12 20:46:43 +0200658+ &ett_ie_rtp_payload,
Harald Welte2d112ad2009-06-10 05:42:52 +0800659 };
660
661 /* Register the protocol name and description */
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800662--
6631.7.0.1
664