blob: 6f2b8c132fc7107495d2330735b833facd74ce66 [file] [log] [blame]
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +01001From 54882db58b6ec12da6b80071e0ac2344d42df24c Mon Sep 17 00:00:00 2001
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +08002From: Holger Hans Peter Freyther <zecke@selfish.org>
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +01003Date: Tue, 11 Jan 2011 16:22:33 +0100
4Subject: [PATCH 4/4] rsl-ipaccess
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +08005
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +01006Add vendor specific commands for RSL.
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +08007---
8 epan/dissectors/packet-rsl.c | 522 +++++++++++++++++++++++++++++++++++++++++-
9 1 files changed, 515 insertions(+), 7 deletions(-)
10
11diff --git a/epan/dissectors/packet-rsl.c b/epan/dissectors/packet-rsl.c
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +010012index bf83f6f..d858e1a 100644
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +080013--- a/epan/dissectors/packet-rsl.c
14+++ b/epan/dissectors/packet-rsl.c
Harald Welte2d112ad2009-06-10 05:42:52 +080015@@ -2,6 +2,7 @@
16 * Routines for Radio Signalling Link (RSL) dissection.
17 *
18 * Copyright 2007, Anders Broman <anders.broman@ericsson.com>
19+ * Copyright 2009, Harald Welte <laforge@gnumonks.org>
20 *
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +080021 * $Id$
Harald Welte2d112ad2009-06-10 05:42:52 +080022 *
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +080023@@ -42,6 +43,8 @@
Harald Welte9e20bc52009-06-26 15:04:00 +020024 #include <epan/lapd_sapi.h>
25
26 #include "packet-gsm_a_common.h"
27+#include "packet-rtp.h"
28+#include "packet-rtcp.h"
29
30 /* Initialize the protocol and registered fields */
31 static int proto_rsl = -1;
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +010032@@ -116,6 +119,24 @@ static int hf_rsl_emlpp_prio = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080033 static int hf_rsl_rtd = -1;
34 static int hf_rsl_delay_ind = -1;
35 static int hf_rsl_tfo = -1;
Harald Welteb5280c72009-10-22 10:09:56 +020036+static int hf_rsl_speech_mode_s = -1;
37+static int hf_rsl_speech_mode_m = -1;
Harald Weltec9b484f2009-07-12 20:46:43 +020038+static int hf_rsl_conn_stat = -1;
39+static int hf_rsl_conn_id = -1;
40+static int hf_rsl_rtp_payload = -1;
Harald Welteb5280c72009-10-22 10:09:56 +020041+static int hf_rsl_rtp_csd_fmt_d = -1;
42+static int hf_rsl_rtp_csd_fmt_ir = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080043+static int hf_rsl_local_port = -1;
44+static int hf_rsl_remote_port = -1;
45+static int hf_rsl_local_ip = -1;
46+static int hf_rsl_remote_ip = -1;
Harald Welteb5280c72009-10-22 10:09:56 +020047+static int hf_rsl_cstat_tx_pkts = -1;
48+static int hf_rsl_cstat_tx_octs = -1;
49+static int hf_rsl_cstat_rx_pkts = -1;
50+static int hf_rsl_cstat_rx_octs = -1;
51+static int hf_rsl_cstat_lost_pkts = -1;
52+static int hf_rsl_cstat_ia_jitter = -1;
53+static int hf_rsl_cstat_avg_tx_dly = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080054
55 /* Initialize the subtree pointers */
56 static int ett_rsl = -1;
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +010057@@ -173,6 +194,15 @@ static int ett_ie_cause = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080058 static int ett_ie_meas_res_no = -1;
59 static int ett_ie_message_id = -1;
60 static int ett_ie_sys_info_type = -1;
Harald Weltec9b484f2009-07-12 20:46:43 +020061+static int ett_ie_speech_mode = -1;
62+static int ett_ie_conn_stat = -1;
63+static int ett_ie_conn_id = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080064+static int ett_ie_remote_ip = -1;
65+static int ett_ie_remote_port = -1;
66+static int ett_ie_local_port = -1;
67+static int ett_ie_local_ip = -1;
Harald Weltec9b484f2009-07-12 20:46:43 +020068+static int ett_ie_rtp_payload = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080069+
70
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +010071 static proto_tree *top_tree;
72 static dissector_handle_t gsm_a_ccch_handle;
73@@ -208,8 +238,11 @@ static const value_string rsl_msg_disc_vals[] = {
Harald Welte2d112ad2009-06-10 05:42:52 +080074 { 0x06, "Common Channel Management messages" },
75 { 0x08, "TRX Management messages" },
76 { 0x16, "Location Services messages" },
77+ { 0x3f, "ip.access Vendor Specific messages" },
78 { 0, NULL }
79 };
80+#define RSL_MSGDISC_IPACCESS 0x3f
81+
82 /*
83 * 9.2 MESSAGE TYPE
84 */
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +010085@@ -276,6 +309,49 @@ static const value_string rsl_msg_disc_vals[] = {
Harald Welte2d112ad2009-06-10 05:42:52 +080086 /* 0 1 - - - - - - Location Services messages: */
Harald Welte9e20bc52009-06-26 15:04:00 +020087 #define RSL_MSG_LOC_INF 65 /* 8.7.1 */
Harald Welte2d112ad2009-06-10 05:42:52 +080088
89+/* Vendor-Specific messages of ip.access nanoBTS. There is no public documentation
90+ * about those extensions, all information in this dissector is based on lawful
91+ * protocol reverse enginering by Harald Welte <laforge@gnumonks.org> */
Harald Weltea1f0ac72009-07-12 21:59:04 +020092+#define RSL_MSG_TYPE_IPAC_MEAS_PP_DEF 0x60
93+#define RSL_MSG_TYPE_IPAC_HO_CAND_INQ 0x61
94+#define RSL_MSG_TYPE_IPAC_HO_CAND_RESP 0x62
95+
96+#define RSL_MSG_TYPE_IPAC_PDCH_ACT 0x48
97+#define RSL_MSG_TYPE_IPAC_PDCH_ACT_ACK 0x49
98+#define RSL_MSG_TYPE_IPAC_PDCH_ACT_NACK 0x4a
99+#define RSL_MSG_TYPE_IPAC_PDCH_DEACT 0x4b
100+#define RSL_MSG_TYPE_IPAC_PDCH_DEACT_ACK 0x4c
101+#define RSL_MSG_TYPE_IPAC_PDCH_DEACT_NACK 0x4d
102+
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800103+#define RSL_MSG_TYPE_IPAC_CRCX 0x70
104+#define RSL_MSG_TYPE_IPAC_CRCX_ACK 0x71
105+#define RSL_MSG_TYPE_IPAC_CRCX_NACK 0x72
106+#define RSL_MSG_TYPE_IPAC_MDCX 0x73
107+#define RSL_MSG_TYPE_IPAC_MDCX_ACK 0x74
108+#define RSL_MSG_TYPE_IPAC_MDCX_NACK 0x75
109+#define RSL_MSG_TYPE_IPAC_DLCX_IND 0x76
110+#define RSL_MSG_TYPE_IPAC_DLCX 0x77
111+#define RSL_MSG_TYPE_IPAC_DLCX_ACK 0x78
112+#define RSL_MSG_TYPE_IPAC_DLCX_NACK 0x79
Harald Welte8dc1a682009-07-01 11:22:01 +0200113+
Harald Weltec9b484f2009-07-12 20:46:43 +0200114+#define RSL_IE_IPAC_SRTP_CONFIG 0xe0
115+#define RSL_IE_IPAC_PROXY_UDP 0xe1
116+#define RSL_IE_IPAC_BSCMPL_TOUT 0xe2
Harald Welte2d112ad2009-06-10 05:42:52 +0800117+#define RSL_IE_IPAC_REMOTE_IP 0xf0
118+#define RSL_IE_IPAC_REMOTE_PORT 0xf1
Harald Weltec9b484f2009-07-12 20:46:43 +0200119+#define RSL_IE_IPAC_RTP_PAYLOAD 0xf2
Harald Welte2d112ad2009-06-10 05:42:52 +0800120+#define RSL_IE_IPAC_LOCAL_PORT 0xf3
Harald Weltec9b484f2009-07-12 20:46:43 +0200121+#define RSL_IE_IPAC_SPEECH_MODE 0xf4
Harald Welte2d112ad2009-06-10 05:42:52 +0800122+#define RSL_IE_IPAC_LOCAL_IP 0xf5
Harald Weltec9b484f2009-07-12 20:46:43 +0200123+#define RSL_IE_IPAC_CONN_STAT 0xf6
124+#define RSL_IE_IPAC_HO_C_PARMS 0xf7
125+#define RSL_IE_IPAC_CONN_ID 0xf8
126+#define RSL_IE_IPAC_RTP_CSD_FMT 0xf9
127+#define RSL_IE_IPAC_RTP_JIT_BUF 0xfa
128+#define RSL_IE_IPAC_RTP_COMPR 0xfb
129+#define RSL_IE_IPAC_RTP_PAYLOAD2 0xfc
130+#define RSL_IE_IPAC_RTP_MPLEX 0xfd
131+#define RSL_IE_IPAC_RTP_MPLEX_ID 0xfe
Harald Welte9e20bc52009-06-26 15:04:00 +0200132
133 static const value_string rsl_msg_type_vals[] = {
134 /* 0 0 0 0 - - - - Radio Link Layer Management messages: */
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +0100135@@ -338,6 +414,26 @@ static const value_string rsl_msg_type_vals[] = {
Harald Welte9e20bc52009-06-26 15:04:00 +0200136 { 0x3f, "TFO MODification REQuest" }, /* 8.4.31 */
137 /* 0 1 - - - - - - Location Services messages: */
138 { 0x41, "Location Information" }, /* 8.7.1 */
139+ /* ip.access */
Harald Weltea1f0ac72009-07-12 21:59:04 +0200140+ { 0x48, "ip.access PDCH ACTIVATION" },
141+ { 0x49, "ip.access PDCH ACTIVATION ACK" },
142+ { 0x4a, "ip.access PDCH ACTIVATION NACK" },
143+ { 0x4b, "ip.access PDCH DEACTIVATION" },
144+ { 0x4c, "ip.access PDCH DEACTIVATION ACK" },
145+ { 0x4d, "ip.access PDCH DEACTIVATION NACK" },
146+ { 0x60, "ip.access MEASurement PREPROCessing DeFauLT" },
147+ { 0x61, "ip.access HANDOover CANDidate ENQuiry" },
148+ { 0x62, "ip.access HANDOover CANDidate RESPonse" },
Holger Hans Peter Freytherb9bda7b2009-11-18 21:31:15 +0100149+ { 0x70, "ip.access CRCX" },
150+ { 0x71, "ip.access CRCX ACK" },
151+ { 0x72, "ip.access CRCX NACK" },
152+ { 0x73, "ip.access MDCX" },
153+ { 0x74, "ip.access MDCX ACK" },
154+ { 0x75, "ip.access MDCX NACK" },
155+ { 0x76, "ip.access DLCX INDication" },
156+ { 0x77, "ip.access DLCX" },
157+ { 0x78, "ip.access DLCX ACK" },
158+ { 0x79, "ip.access DLCX NACK" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200159 { 0, NULL }
160 };
161
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +0100162@@ -371,10 +467,10 @@ static const value_string rsl_msg_type_vals[] = {
Harald Weltea1f0ac72009-07-12 21:59:04 +0200163 #define RSL_IE_MESSAGE_ID 28
164
165 #define RSL_IE_SYS_INFO_TYPE 30
166-
167-
168-
169-
170+#define RSL_IE_MS_POWER_PARAM 31
171+#define RSL_IE_BS_POWER_PARAM 32
172+#define RSL_IE_PREPROC_PARAM 33
173+#define RSL_IE_PREPROC_MEAS 34
174 #define RSL_IE_FULL_IMM_ASS_INF 35
175 #define RSL_IE_SMSCB_INF 36
176 #define RSL_IE_FULL_MS_TIMING_OFFSET 37
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +0100177@@ -477,6 +573,24 @@ static const value_string rsl_ie_type_vals[] = {
Harald Welte9e20bc52009-06-26 15:04:00 +0200178 Not used
179
180 */
Harald Weltec9b484f2009-07-12 20:46:43 +0200181+ { 0xe0, "SRTP Configuration" },
182+ { 0xe1, "BSC Proxy UDP Port" },
183+ { 0xe2, "BSC Multiplex Timeout" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200184+ { 0xf0, "Remote IP Address" },
185+ { 0xf1, "Remote RTP Port" },
Harald Weltec9b484f2009-07-12 20:46:43 +0200186+ { 0xf2, "RTP Payload Type" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200187+ { 0xf3, "Local RTP Port" },
Harald Weltec9b484f2009-07-12 20:46:43 +0200188+ { 0xf4, "Speech Mode" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200189+ { 0xf5, "Local IP Address" },
Harald Weltec9b484f2009-07-12 20:46:43 +0200190+ { 0xf6, "Connection Statistics" },
191+ { 0xf7, "Handover C Parameters" },
192+ { 0xf8, "Connection Identifier" },
193+ { 0xf9, "RTP CSD Format" },
194+ { 0xfa, "RTP Jitter Buffer" },
195+ { 0xfb, "RTP Compression" },
196+ { 0xfc, "RTP Payload Type 2" },
197+ { 0xfd, "RTP Multiplex" },
198+ { 0xfe, "RTP Multiplex Identifier" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200199 { 0, NULL }
200 };
201
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +0100202@@ -513,6 +627,96 @@ static const value_string rsl_ch_no_Cbits_vals[] = {
Harald Welte9e20bc52009-06-26 15:04:00 +0200203 { 0, NULL }
204 };
205
206+/* From openbsc/include/openbsc/tlv.h */
207+enum tlv_type {
208+ TLV_TYPE_FIXED,
209+ TLV_TYPE_T,
210+ TLV_TYPE_TV,
211+ TLV_TYPE_TLV,
212+ TLV_TYPE_TL16V,
213+};
214+
215+struct tlv_def {
216+ enum tlv_type type;
217+ u_int8_t fixed_len;
218+};
219+
220+struct tlv_definition {
221+ struct tlv_def def[0xff];
222+};
223+
224+static const struct tlv_definition rsl_att_tlvdef = {
225+ .def = {
226+ [RSL_IE_CH_NO] = { TLV_TYPE_TV, 0 },
227+ [RSL_IE_LINK_ID] = { TLV_TYPE_TV, 0 },
228+ [RSL_IE_ACT_TYPE] = { TLV_TYPE_TV, 0 },
229+ [RSL_IE_BS_POW] = { TLV_TYPE_TV, 0 },
230+ [RSL_IE_CH_ID] = { TLV_TYPE_TLV, 0 },
231+ [RSL_IE_CH_MODE] = { TLV_TYPE_TLV, 0 },
232+ [RSL_IE_ENC_INF] = { TLV_TYPE_TLV, 0 },
233+ [RSL_IE_FRAME_NO] = { TLV_TYPE_FIXED, 2 },
234+ [RSL_IE_HO_REF] = { TLV_TYPE_TV, 0 },
235+ [RSL_IE_L1_INF] = { TLV_TYPE_FIXED, 2 },
236+ [RSL_IE_L3_INF] = { TLV_TYPE_TL16V, 0 },
237+ [RSL_IE_MS_ID] = { TLV_TYPE_TLV, 0 },
238+ [RSL_IE_MS_POW] = { TLV_TYPE_TV, 0 },
239+ [RSL_IE_PAGING_GRP] = { TLV_TYPE_TV, 0 },
240+ [RSL_IE_PAGING_LOAD] = { TLV_TYPE_FIXED, 2 },
241+ [RSL_IE_PHY_CTX] = { TLV_TYPE_TLV, 0 },
242+ [RSL_IE_ACCESS_DELAY] = { TLV_TYPE_TV, 0 },
243+ [RSL_IE_RACH_LOAD] = { TLV_TYPE_TLV, 0 },
244+ [RSL_IE_REQ_REF] = { TLV_TYPE_FIXED, 3 },
245+ [RSL_IE_REL_MODE] = { TLV_TYPE_TV, 0 },
246+ [RSL_IE_RESOURCE_INF] = { TLV_TYPE_TLV, 0 },
247+ [RSL_IE_RLM_CAUSE] = { TLV_TYPE_TLV, 0 },
248+ [RSL_IE_STARTING_TIME] = { TLV_TYPE_FIXED, 2 },
249+ [RSL_IE_TIMING_ADV] = { TLV_TYPE_TV, 0 },
250+ [RSL_IE_UPLINK_MEAS] = { TLV_TYPE_TLV, 0 },
251+ [RSL_IE_CAUSE] = { TLV_TYPE_TLV, 0 },
252+ [RSL_IE_MEAS_RES_NO] = { TLV_TYPE_TV, 0 },
253+ [RSL_IE_MESSAGE_ID] = { TLV_TYPE_TV, 0 },
254+ [RSL_IE_SYS_INFO_TYPE] = { TLV_TYPE_TV, 0 },
Harald Weltea1f0ac72009-07-12 21:59:04 +0200255+ [RSL_IE_MS_POWER_PARAM] = { TLV_TYPE_TLV, 0 },
256+ [RSL_IE_BS_POWER_PARAM] = { TLV_TYPE_TLV, 0 },
257+ [RSL_IE_PREPROC_PARAM] = { TLV_TYPE_TLV, 0 },
258+ [RSL_IE_PREPROC_MEAS] = { TLV_TYPE_TLV, 0 },
Harald Welte9e20bc52009-06-26 15:04:00 +0200259+ //[RSL_IE_IMM_ASS_INFO] = { TLV_TYPE_TLV, 0 },
260+ //[RSL_IE_SMSCB_INFO] = { TLV_TYPE_FIXED, 23 },
261+ //[RSL_IE_MS_TIMING_OFFSET] = { TLV_TYPE_TV, 0 },
262+ [RSL_IE_ERR_MSG] = { TLV_TYPE_TLV, 0 },
263+ [RSL_IE_FULL_BCCH_INF] = { TLV_TYPE_TLV, 0 },
264+ [RSL_IE_CH_NEEDED] = { TLV_TYPE_TV, 0 },
265+ [RSL_IE_CB_CMD_TYPE] = { TLV_TYPE_TV, 0 },
266+ [RSL_IE_SMSCB_MESS] = { TLV_TYPE_TLV, 0 },
267+ [RSL_IE_FULL_IMM_ASS_INF] = { TLV_TYPE_TLV, 0 },
268+ //[RSL_IE_SACCH_INFO] = { TLV_TYPE_TLV, 0 },
269+ [RSL_IE_CBCH_LOAD_INF] = { TLV_TYPE_TV, 0 },
270+ [RSL_IE_SMSCB_CH_IND] = { TLV_TYPE_TV, 0 },
271+ [RSL_IE_GRP_CALL_REF] = { TLV_TYPE_TLV, 0 },
272+ [RSL_IE_CH_DESC] = { TLV_TYPE_TLV, 0 },
273+ [RSL_IE_NCH_DRX_INF] = { TLV_TYPE_TLV, 0 },
274+ [RSL_IE_CMD_IND] = { TLV_TYPE_TLV, 0 },
275+ [RSL_IE_EMLPP_PRIO] = { TLV_TYPE_TV, 0 },
276+ [RSL_IE_UIC] = { TLV_TYPE_TLV, 0 },
277+ [RSL_IE_MAIN_CH_REF] = { TLV_TYPE_TV, 0 },
278+ [RSL_IE_MULTIRATE_CONF] = { TLV_TYPE_TLV, 0 },
279+ [RSL_IE_MULTIRATE_CNTRL] = { TLV_TYPE_TV, 0 },
280+ [RSL_IE_SUP_CODEC_TYPES] = { TLV_TYPE_TLV, 0 },
281+ [RSL_IE_CODEC_CONF] = { TLV_TYPE_TLV, 0 },
282+ [RSL_IE_RTD] = { TLV_TYPE_TV, 0 },
283+ [RSL_IE_TFO_STATUS] = { TLV_TYPE_TV, 0 },
284+ [RSL_IE_LLP_APDU] = { TLV_TYPE_TLV, 0 },
285+ [RSL_IE_IPAC_REMOTE_IP] = { TLV_TYPE_FIXED, 4 },
286+ [RSL_IE_IPAC_REMOTE_PORT] = { TLV_TYPE_FIXED, 2 },
287+ [RSL_IE_IPAC_LOCAL_IP] = { TLV_TYPE_FIXED, 4 },
Harald Welteb5280c72009-10-22 10:09:56 +0200288+ [RSL_IE_IPAC_CONN_STAT] = { TLV_TYPE_TLV, 0 },
Harald Welte9e20bc52009-06-26 15:04:00 +0200289+ [RSL_IE_IPAC_LOCAL_PORT] = { TLV_TYPE_FIXED, 2 },
Harald Weltec9b484f2009-07-12 20:46:43 +0200290+ [RSL_IE_IPAC_SPEECH_MODE] = { TLV_TYPE_TV, 0 },
291+ [RSL_IE_IPAC_CONN_ID] = { TLV_TYPE_FIXED, 2 },
292+ [RSL_IE_IPAC_RTP_PAYLOAD2] = { TLV_TYPE_TV, 0 },
Harald Welte9e20bc52009-06-26 15:04:00 +0200293+ },
294+};
295+
296 /* 9.3.1 Channel number 9.3.1 M TV 2 */
297 static int
298 dissect_rsl_ie_ch_no(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +0100299@@ -2045,7 +2249,6 @@ dissect_rsl_ie_err_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
Harald Welte9e20bc52009-06-26 15:04:00 +0200300 proto_item_set_len(ti, length+2);
301
302 proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, FALSE);
303- offset++;
304
305 /* Received Message */
306 offset = dissct_rsl_msg(tvb, pinfo, ie_tree, offset);
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +0100307@@ -2910,12 +3113,184 @@ dissect_rsl_ie_tfo_transp_cont(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
Harald Welte9e20bc52009-06-26 15:04:00 +0200308 }
309
Harald Welteb5280c72009-10-22 10:09:56 +0200310 static int
Harald Weltea1f0ac72009-07-12 21:59:04 +0200311+dissct_rsl_ipaccess_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
Harald Welte2d112ad2009-06-10 05:42:52 +0800312+{
313+ guint8 msg_type;
Harald Welte9e20bc52009-06-26 15:04:00 +0200314+ guint32 local_addr = 0;
315+ guint16 local_port = 0;
316+ address src_addr;
Harald Welte2d112ad2009-06-10 05:42:52 +0800317+
318+ msg_type = tvb_get_guint8(tvb, offset)&0x7f;
319+ offset++;
320+
Harald Welteb5280c72009-10-22 10:09:56 +0200321+#if 0
Harald Welte2d112ad2009-06-10 05:42:52 +0800322+ switch (msg_type) {
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800323+ case RSL_MSG_TYPE_IPAC_CRCX:
324+ case RSL_MSG_TYPE_IPAC_CRCX_ACK:
325+ case RSL_MSG_TYPE_IPAC_CRCX_NACK:
326+ case RSL_MSG_TYPE_IPAC_MDCX:
327+ case RSL_MSG_TYPE_IPAC_MDCX_ACK:
328+ case RSL_MSG_TYPE_IPAC_MDCX_NACK:
329+ case RSL_MSG_TYPE_IPAC_DLCX_IND:
330+ case RSL_MSG_TYPE_IPAC_DLCX:
331+ case RSL_MSG_TYPE_IPAC_DLCX_ACK:
332+ case RSL_MSG_TYPE_IPAC_DLCX_NACK:
Harald Weltea1f0ac72009-07-12 21:59:04 +0200333+ case RSL_MSG_TYPE_IPAC_PDCH_ACT:
334+ case RSL_MSG_TYPE_IPAC_PDCH_ACT_ACK:
335+ case RSL_MSG_TYPE_IPAC_PDCH_ACT_NACK:
336+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT:
337+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT_ACK:
338+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT_NACK:
Harald Welte2d112ad2009-06-10 05:42:52 +0800339+ /* Channel number 9.3.1 M TV 2 */
340+ offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
341+ break;
Harald Welte4e8c98a2009-08-20 00:59:11 +0900342+ }
Harald Welteb5280c72009-10-22 10:09:56 +0200343+#endif
344+ /* parse TLV attributes */
Harald Welte9e20bc52009-06-26 15:04:00 +0200345+ while (tvb_reported_length_remaining(tvb, offset) != 0) {
346+ guint8 tag;
347+ unsigned int len, hlen, len_len;
348+ const struct tlv_def *tdef;
349+ proto_item *ti;
350+ proto_tree *ie_tree;
351+
352+ tag = tvb_get_guint8(tvb, offset);
353+ tdef = &rsl_att_tlvdef.def[tag];
354+
355+ switch (tdef->type) {
356+ case TLV_TYPE_FIXED:
357+ hlen = 1;
358+ len_len = 0;
359+ len = tdef->fixed_len;
360+ break;
361+ case TLV_TYPE_T:
362+ hlen = 1;
363+ len_len = 0;
364+ len = 0;
365+ break;
366+ case TLV_TYPE_TV:
367+ hlen = 1;
368+ len_len = 0;
369+ len = 1;
370+ break;
371+ case TLV_TYPE_TLV:
372+ hlen = 2;
373+ len_len = 1;
374+ len = tvb_get_guint8(tvb, offset+1);
375+ break;
376+ case TLV_TYPE_TL16V:
377+ hlen = 3;
378+ len_len = 2;
379+ len = tvb_get_guint8(tvb, offset+1) << 8 |
380+ tvb_get_guint8(tvb, offset+2);
381+ break;
Harald Weltea1f0ac72009-07-12 21:59:04 +0200382+ default:
383+ hlen = len_len = len = 0;
384+ DISSECTOR_ASSERT_NOT_REACHED();
385+ break;
Harald Welte9e20bc52009-06-26 15:04:00 +0200386+ }
387+
388+ ti = proto_tree_add_item(tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
389+ ie_tree = proto_item_add_subtree(ti, ett_ie_local_port);
390+ offset += hlen;
391+
392+ switch (tag) {
393+ case RSL_IE_CH_NO:
Harald Welteb5280c72009-10-22 10:09:56 +0200394+ dissect_rsl_ie_ch_no(tvb, pinfo, ie_tree, offset, FALSE);
Harald Weltea1f0ac72009-07-12 21:59:04 +0200395+ break;
396+ case RSL_IE_FRAME_NO:
Harald Welteb5280c72009-10-22 10:09:56 +0200397+ dissect_rsl_ie_frame_no(tvb, pinfo, ie_tree, offset, FALSE);
Harald Weltea1f0ac72009-07-12 21:59:04 +0200398+ break;
399+ case RSL_IE_MS_POW:
Harald Welteb5280c72009-10-22 10:09:56 +0200400+ dissect_rsl_ie_ms_pow(tvb, pinfo, ie_tree, offset, FALSE);
Harald Welte9e20bc52009-06-26 15:04:00 +0200401+ break;
402+ case RSL_IE_IPAC_REMOTE_IP:
Harald Welte8dc1a682009-07-01 11:22:01 +0200403+ proto_tree_add_item(ie_tree, hf_rsl_remote_ip, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200404+ offset, len, FALSE);
Harald Welte9e20bc52009-06-26 15:04:00 +0200405+ break;
406+ case RSL_IE_IPAC_REMOTE_PORT:
Harald Welte8dc1a682009-07-01 11:22:01 +0200407+ proto_tree_add_item(ie_tree, hf_rsl_remote_port, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200408+ offset, len, FALSE);
Harald Welte9e20bc52009-06-26 15:04:00 +0200409+ break;
410+ case RSL_IE_IPAC_LOCAL_IP:
Harald Welte8dc1a682009-07-01 11:22:01 +0200411+ proto_tree_add_item(ie_tree, hf_rsl_local_ip, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200412+ offset, len, FALSE);
Harald Welte9e20bc52009-06-26 15:04:00 +0200413+ local_addr = tvb_get_ipv4(tvb, offset);
414+ break;
415+ case RSL_IE_IPAC_LOCAL_PORT:
Harald Welte8dc1a682009-07-01 11:22:01 +0200416+ proto_tree_add_item(ie_tree, hf_rsl_local_port, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200417+ offset, len, FALSE);
Harald Welte9e20bc52009-06-26 15:04:00 +0200418+ local_port = tvb_get_ntohs(tvb, offset);
419+ break;
Harald Weltec9b484f2009-07-12 20:46:43 +0200420+ case RSL_IE_IPAC_SPEECH_MODE:
Harald Welteb5280c72009-10-22 10:09:56 +0200421+ proto_tree_add_item(ie_tree, hf_rsl_speech_mode_s, tvb,
422+ offset, len, FALSE);
423+ proto_tree_add_item(ie_tree, hf_rsl_speech_mode_m, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200424+ offset, len, FALSE);
Harald Weltec9b484f2009-07-12 20:46:43 +0200425+ break;
426+ case RSL_IE_IPAC_RTP_PAYLOAD:
427+ case RSL_IE_IPAC_RTP_PAYLOAD2:
428+ proto_tree_add_item(ie_tree, hf_rsl_rtp_payload, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200429+ offset, len, FALSE);
430+ break;
Harald Welteb5280c72009-10-22 10:09:56 +0200431+ case RSL_IE_IPAC_RTP_CSD_FMT:
432+ proto_tree_add_item(ie_tree, hf_rsl_rtp_csd_fmt_d, tvb,
433+ offset, len, FALSE);
434+ proto_tree_add_item(ie_tree, hf_rsl_rtp_csd_fmt_ir, tvb,
435+ offset, len, FALSE);
436+ break;
Harald Weltec9b484f2009-07-12 20:46:43 +0200437+ case RSL_IE_IPAC_CONN_ID:
438+ proto_tree_add_item(ie_tree, hf_rsl_conn_id, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200439+ offset, len, FALSE);
Holger Hans Peter Freytherb9bda7b2009-11-18 21:31:15 +0100440+ break;
Harald Welteb5280c72009-10-22 10:09:56 +0200441+ case RSL_IE_IPAC_CONN_STAT:
442+ proto_tree_add_item(ie_tree, hf_rsl_cstat_tx_pkts, tvb,
443+ offset, 4, FALSE);
444+ proto_tree_add_item(ie_tree, hf_rsl_cstat_tx_octs, tvb,
445+ offset+4, 4, FALSE);
446+ proto_tree_add_item(ie_tree, hf_rsl_cstat_rx_pkts, tvb,
447+ offset+8, 4, FALSE);
448+ proto_tree_add_item(ie_tree, hf_rsl_cstat_rx_octs, tvb,
449+ offset+12, 4, FALSE);
450+ proto_tree_add_item(ie_tree, hf_rsl_cstat_lost_pkts, tvb,
451+ offset+16, 4, FALSE);
452+ proto_tree_add_item(ie_tree, hf_rsl_cstat_ia_jitter, tvb,
453+ offset+20, 4, FALSE);
454+ proto_tree_add_item(ie_tree, hf_rsl_cstat_avg_tx_dly, tvb,
455+ offset+24, 4, FALSE);
Harald Weltec9b484f2009-07-12 20:46:43 +0200456+ break;
Harald Welte9e20bc52009-06-26 15:04:00 +0200457+ }
458+ offset += len;
Harald Welte2d112ad2009-06-10 05:42:52 +0800459+ }
460+
Harald Welte9e20bc52009-06-26 15:04:00 +0200461+ switch (msg_type) {
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800462+ case RSL_MSG_TYPE_IPAC_CRCX_ACK:
Harald Welte8dc1a682009-07-01 11:22:01 +0200463+ /* Notify the RTP and RTCP dissectors about a new RTP stream */
Harald Welte9e20bc52009-06-26 15:04:00 +0200464+ src_addr.type = AT_IPv4;
465+ src_addr.len = 4;
466+ src_addr.data = (guint8 *)&local_addr;
Harald Welte8dc1a682009-07-01 11:22:01 +0200467+ rtp_add_address(pinfo, &src_addr, local_port, 0,
Harald Welte63aba292009-07-04 04:11:21 +0200468+ "GSM A-bis/IP", pinfo->fd->num, 0, NULL);
Harald Welte8dc1a682009-07-01 11:22:01 +0200469+ rtcp_add_address(pinfo, &src_addr, local_port+1, 0,
470+ "GSM A-bis/IP", pinfo->fd->num);
Harald Welte9e20bc52009-06-26 15:04:00 +0200471+ break;
472+ }
Harald Welte2d112ad2009-06-10 05:42:52 +0800473+ return offset;
474+}
475+
Harald Welteb5280c72009-10-22 10:09:56 +0200476+static int
Harald Welte2d112ad2009-06-10 05:42:52 +0800477 dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
478 {
479- guint8 msg_type;
480+ guint8 msg_disc, msg_type;
481
482+ msg_disc = tvb_get_guint8(tvb, offset++) >> 1;
483 msg_type = tvb_get_guint8(tvb,offset)&0x7f;
484 proto_tree_add_item(tree, hf_rsl_msg_type, tvb, offset, 1, FALSE);
485+
486+ if (msg_disc == RSL_MSGDISC_IPACCESS) {
487+ offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset);
488+ return offset;
489+ }
490 offset++;
491
492 switch (msg_type){
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +0100493@@ -3483,6 +3858,18 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
Harald Weltea1f0ac72009-07-12 21:59:04 +0200494 /* LLP APDU 9.3.58 M LV 2-N */
495 offset = dissect_rsl_ie_llp_apdu(tvb, pinfo, tree, offset, TRUE);
496 break;
497+ /* the following messages are ip.access specific but sent without
498+ * ip.access memssage discriminator */
499+ case RSL_MSG_TYPE_IPAC_MEAS_PP_DEF:
500+ case RSL_MSG_TYPE_IPAC_HO_CAND_INQ:
501+ case RSL_MSG_TYPE_IPAC_HO_CAND_RESP:
502+ case RSL_MSG_TYPE_IPAC_PDCH_ACT:
503+ case RSL_MSG_TYPE_IPAC_PDCH_ACT_ACK:
504+ case RSL_MSG_TYPE_IPAC_PDCH_ACT_NACK:
505+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT:
506+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT_ACK:
507+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT_NACK:
508+ offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset-1);
509 default:
510 break;
511 }
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +0100512@@ -3490,6 +3877,40 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
Harald Welteb5280c72009-10-22 10:09:56 +0200513 return offset;
514
515 }
516+
517+static const value_string rsl_ipacc_spm_s_vals[] = {
518+ { 0, "GSM FR codec (GSM type 1, FS)" },
519+ { 1, "GSM EFR codec (GSM type 2, FS)" },
520+ { 2, "GSM AMR/FR codec (GSM type 3, FS)" },
521+ { 3, "GSM HR codec (GSM type 1, HS)" },
522+ { 5, "GSM AMR/HR codec (GSM type 3, HS)" },
523+ { 0xf, "As specified by RTP Payload Type IE" },
524+ { 0, NULL }
525+};
526+
527+static const value_string rsl_ipacc_spm_m_vals[] = {
528+ { 0, "Send and Receive" },
529+ { 1, "Receive Only" },
530+ { 2, "Send Only" },
531+ { 0, NULL }
532+};
533+
534+static const value_string rsl_ipacc_rtp_csd_fmt_d_vals[] = {
535+ { 0, "External TRAU format" },
536+ { 1, "Non-TRAU Packed format" },
537+ { 2, "TRAU within the BTS" },
538+ { 3, "IWF-Free BTS-BTS Data" },
539+ { 0, NULL }
540+};
541+
542+static const value_string rsl_ipacc_rtp_csd_fmt_ir_vals[] = {
543+ { 0, "8kb/s" },
544+ { 1, "16kb/s" },
545+ { 2, "32kb/s" },
546+ { 3, "64kb/s" },
547+ { 0, NULL }
548+};
549+
550 static void
551 dissect_rsl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
552 {
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +0100553@@ -3517,7 +3938,6 @@ dissect_rsl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
Harald Welte2d112ad2009-06-10 05:42:52 +0800554 /* 9.1 Message discriminator */
555 proto_tree_add_item(rsl_tree, hf_rsl_msg_dsc, tvb, offset, 1, FALSE);
556 proto_tree_add_item(rsl_tree, hf_rsl_T_bit, tvb, offset, 1, FALSE);
557- offset++;
558
559 offset = dissct_rsl_msg(tvb, pinfo, rsl_tree, offset);
560
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +0100561@@ -3892,6 +4312,86 @@ void proto_register_rsl(void)
Harald Welte2d112ad2009-06-10 05:42:52 +0800562 FT_UINT8, BASE_DEC, VALS(rsl_emlpp_prio_vals), 0x03,
Harald Welte63aba292009-07-04 04:11:21 +0200563 NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800564 },
Harald Welteb5280c72009-10-22 10:09:56 +0200565+ { &hf_rsl_speech_mode_s,
566+ { "ip.access Speech Mode S", "rsl.ipacc.speech_mode_s",
567+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_spm_s_vals),
568+ 0xf, NULL, HFILL }
569+ },
570+ { &hf_rsl_speech_mode_m,
571+ { "ip.access Speech Mode M", "rsl.ipacc.speech_mode_m",
572+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_spm_m_vals),
573+ 0xf0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800574+ },
Harald Weltec9b484f2009-07-12 20:46:43 +0200575+ { &hf_rsl_conn_stat,
576+ { "ip.access Connection Statistics","rsl.ipacc.conn_stat",
Harald Welteb5280c72009-10-22 10:09:56 +0200577+ FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800578+ },
Harald Weltec9b484f2009-07-12 20:46:43 +0200579+ { &hf_rsl_conn_id,
580+ { "ip.access Connection ID", "rsl.ipacc.conn_id",
581+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800582+ },
Harald Weltec9b484f2009-07-12 20:46:43 +0200583+ { &hf_rsl_rtp_payload,
584+ { "ip.access RTP Payload Type", "rsl.ipacc.rtp_payload",
585+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800586+ },
Harald Welteb5280c72009-10-22 10:09:56 +0200587+ { &hf_rsl_rtp_csd_fmt_d,
588+ { "ip.access RTP CSD Format D", "rsl.ipacc.rtp_csd_fmt_d",
589+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_rtp_csd_fmt_d_vals),
590+ 0x0f, NULL, HFILL },
591+ },
592+ { &hf_rsl_rtp_csd_fmt_ir,
593+ { "ip.access RTP CSD Format IR", "rsl.ipacc.rtp_csd_fmt_ir",
594+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_rtp_csd_fmt_ir_vals),
595+ 0xf0, NULL, HFILL },
596+ },
Harald Welte2d112ad2009-06-10 05:42:52 +0800597+ { &hf_rsl_local_port,
598+ { "ip.access Local RTP Port", "rsl.ipacc.local_port",
599+ FT_UINT16, BASE_DEC, NULL, 0x0,
600+ "ip.access Local RTP Port", HFILL },
601+ },
602+ { &hf_rsl_remote_port,
603+ { "ip.access Remote RTP Port", "rsl.ipacc.remote_port",
604+ FT_UINT16, BASE_DEC, NULL, 0x0,
605+ "ip.access Remote RTP Port", HFILL },
606+ },
607+ { &hf_rsl_local_ip,
608+ { "ip.access Local IP Address", "rsl.ipacc.local_ip",
609+ FT_IPv4, BASE_NONE, NULL, 0x0,
610+ "ip.access Local IP Address", HFILL },
611+ },
612+ { &hf_rsl_remote_ip,
613+ { "ip.access Remote IP Address", "rsl.ipacc.remote_ip",
614+ FT_IPv4, BASE_NONE, NULL, 0x0,
615+ "ip.access Remote IP Address", HFILL },
616+ },
Harald Welteb5280c72009-10-22 10:09:56 +0200617+ { &hf_rsl_cstat_tx_pkts,
618+ { "Packets Sent", "rsl.ipacc.cstat.tx_pkts",
619+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
620+ },
621+ { &hf_rsl_cstat_tx_octs,
622+ { "Octets Sent", "rsl.ipacc.cstat.tx_octets",
623+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
624+ },
625+ { &hf_rsl_cstat_rx_pkts,
626+ { "Packets Received", "rsl.ipacc.cstat.rx_pkts",
627+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
628+ },
629+ { &hf_rsl_cstat_rx_octs,
630+ { "Octets Received", "rsl.ipacc.cstat.rx_octets",
631+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
632+ },
633+ { &hf_rsl_cstat_lost_pkts,
634+ { "Packets Lost", "rsl.ipacc.cstat.lost_pkts",
635+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
636+ },
637+ { &hf_rsl_cstat_ia_jitter,
638+ { "Inter-arrival Jitter", "rsl.ipacc.cstat.ia_jitter",
639+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
640+ },
641+ { &hf_rsl_cstat_avg_tx_dly,
642+ { "Average Tx Delay", "rsl.ipacc.cstat.avg_tx_delay",
643+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
644+ },
Harald Welte2d112ad2009-06-10 05:42:52 +0800645 };
646 static gint *ett[] = {
647 &ett_rsl,
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +0100648@@ -3949,6 +4449,14 @@ void proto_register_rsl(void)
Harald Welte2d112ad2009-06-10 05:42:52 +0800649 &ett_ie_meas_res_no,
650 &ett_ie_message_id,
651 &ett_ie_sys_info_type,
Harald Weltec9b484f2009-07-12 20:46:43 +0200652+ &ett_ie_speech_mode,
653+ &ett_ie_conn_stat,
654+ &ett_ie_conn_id,
Harald Welte2d112ad2009-06-10 05:42:52 +0800655+ &ett_ie_remote_ip,
656+ &ett_ie_remote_port,
657+ &ett_ie_local_port,
658+ &ett_ie_local_ip,
Harald Weltec9b484f2009-07-12 20:46:43 +0200659+ &ett_ie_rtp_payload,
Harald Welte2d112ad2009-06-10 05:42:52 +0800660 };
661
662 /* Register the protocol name and description */
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800663--
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +01006641.7.3.4
Holger Hans Peter Freyther2fb7ccf2010-04-21 20:37:53 +0800665