blob: 36c09c57b4ff51ab381e718a91191ba11a078763 [file] [log] [blame]
Harald Welte2d112ad2009-06-10 05:42:52 +08001Index: wireshark/epan/dissectors/packet-rsl.c
2===================================================================
Harald Welteb5280c72009-10-22 10:09:56 +02003--- wireshark.orig/epan/dissectors/packet-rsl.c 2009-10-21 23:03:41.000000000 +0200
4+++ wireshark/epan/dissectors/packet-rsl.c 2009-10-22 10:02:51.000000000 +0200
Harald Welte2d112ad2009-06-10 05:42:52 +08005@@ -2,6 +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 *
Harald Welteb5280c72009-10-22 10:09:56 +020011 * $Id: packet-rsl.c 29944 2009-09-16 13:39:37Z morriss $
Harald Welte2d112ad2009-06-10 05:42:52 +080012 *
Harald Welte9e20bc52009-06-26 15:04:00 +020013@@ -44,6 +45,8 @@
14 #include <epan/lapd_sapi.h>
15
16 #include "packet-gsm_a_common.h"
17+#include "packet-rtp.h"
18+#include "packet-rtcp.h"
19
20 /* Initialize the protocol and registered fields */
21 static int proto_rsl = -1;
Harald Welteb5280c72009-10-22 10:09:56 +020022@@ -117,6 +120,24 @@
Harald Welte2d112ad2009-06-10 05:42:52 +080023 static int hf_rsl_rtd = -1;
24 static int hf_rsl_delay_ind = -1;
25 static int hf_rsl_tfo = -1;
Harald Welteb5280c72009-10-22 10:09:56 +020026+static int hf_rsl_speech_mode_s = -1;
27+static int hf_rsl_speech_mode_m = -1;
Harald Weltec9b484f2009-07-12 20:46:43 +020028+static int hf_rsl_conn_stat = -1;
29+static int hf_rsl_conn_id = -1;
30+static int hf_rsl_rtp_payload = -1;
Harald Welteb5280c72009-10-22 10:09:56 +020031+static int hf_rsl_rtp_csd_fmt_d = -1;
32+static int hf_rsl_rtp_csd_fmt_ir = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080033+static int hf_rsl_local_port = -1;
34+static int hf_rsl_remote_port = -1;
35+static int hf_rsl_local_ip = -1;
36+static int hf_rsl_remote_ip = -1;
Harald Welteb5280c72009-10-22 10:09:56 +020037+static int hf_rsl_cstat_tx_pkts = -1;
38+static int hf_rsl_cstat_tx_octs = -1;
39+static int hf_rsl_cstat_rx_pkts = -1;
40+static int hf_rsl_cstat_rx_octs = -1;
41+static int hf_rsl_cstat_lost_pkts = -1;
42+static int hf_rsl_cstat_ia_jitter = -1;
43+static int hf_rsl_cstat_avg_tx_dly = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080044
45 /* Initialize the subtree pointers */
46 static int ett_rsl = -1;
Harald Welteb5280c72009-10-22 10:09:56 +020047@@ -174,6 +195,15 @@
Harald Welte2d112ad2009-06-10 05:42:52 +080048 static int ett_ie_meas_res_no = -1;
49 static int ett_ie_message_id = -1;
50 static int ett_ie_sys_info_type = -1;
Harald Weltec9b484f2009-07-12 20:46:43 +020051+static int ett_ie_speech_mode = -1;
52+static int ett_ie_conn_stat = -1;
53+static int ett_ie_conn_id = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080054+static int ett_ie_remote_ip = -1;
55+static int ett_ie_remote_port = -1;
56+static int ett_ie_local_port = -1;
57+static int ett_ie_local_ip = -1;
Harald Weltec9b484f2009-07-12 20:46:43 +020058+static int ett_ie_rtp_payload = -1;
Harald Welte2d112ad2009-06-10 05:42:52 +080059+
60
61 proto_tree *top_tree;
62 dissector_handle_t gsm_a_ccch_handle;
Harald Welteb5280c72009-10-22 10:09:56 +020063@@ -209,8 +239,11 @@
Harald Welte2d112ad2009-06-10 05:42:52 +080064 { 0x06, "Common Channel Management messages" },
65 { 0x08, "TRX Management messages" },
66 { 0x16, "Location Services messages" },
67+ { 0x3f, "ip.access Vendor Specific messages" },
68 { 0, NULL }
69 };
70+#define RSL_MSGDISC_IPACCESS 0x3f
71+
72 /*
73 * 9.2 MESSAGE TYPE
74 */
Harald Welteb5280c72009-10-22 10:09:56 +020075@@ -277,6 +310,49 @@
Harald Welte2d112ad2009-06-10 05:42:52 +080076 /* 0 1 - - - - - - Location Services messages: */
Harald Welte9e20bc52009-06-26 15:04:00 +020077 #define RSL_MSG_LOC_INF 65 /* 8.7.1 */
Harald Welte2d112ad2009-06-10 05:42:52 +080078
79+/* Vendor-Specific messages of ip.access nanoBTS. There is no public documentation
80+ * about those extensions, all information in this dissector is based on lawful
81+ * protocol reverse enginering by Harald Welte <laforge@gnumonks.org> */
Harald Weltea1f0ac72009-07-12 21:59:04 +020082+#define RSL_MSG_TYPE_IPAC_MEAS_PP_DEF 0x60
83+#define RSL_MSG_TYPE_IPAC_HO_CAND_INQ 0x61
84+#define RSL_MSG_TYPE_IPAC_HO_CAND_RESP 0x62
85+
86+#define RSL_MSG_TYPE_IPAC_PDCH_ACT 0x48
87+#define RSL_MSG_TYPE_IPAC_PDCH_ACT_ACK 0x49
88+#define RSL_MSG_TYPE_IPAC_PDCH_ACT_NACK 0x4a
89+#define RSL_MSG_TYPE_IPAC_PDCH_DEACT 0x4b
90+#define RSL_MSG_TYPE_IPAC_PDCH_DEACT_ACK 0x4c
91+#define RSL_MSG_TYPE_IPAC_PDCH_DEACT_NACK 0x4d
92+
Harald Welte2d112ad2009-06-10 05:42:52 +080093+#define RSL_MSG_TYPE_IPAC_BIND 0x70
94+#define RSL_MSG_TYPE_IPAC_BIND_ACK 0x71
95+#define RSL_MSG_TYPE_IPAC_BIND_NACK 0x72
96+#define RSL_MSG_TYPE_IPAC_CONNECT 0x73
97+#define RSL_MSG_TYPE_IPAC_CONNECT_ACK 0x74
98+#define RSL_MSG_TYPE_IPAC_CONNECT_NACK 0x75
99+#define RSL_MSG_TYPE_IPAC_DISC_IND 0x76
Harald Weltea1f0ac72009-07-12 21:59:04 +0200100+#define RSL_MSG_TYPE_IPAC_DISC 0x77
101+#define RSL_MSG_TYPE_IPAC_DISC_ACK 0x78
102+#define RSL_MSG_TYPE_IPAC_DISC_NACK 0x79
Harald Welte8dc1a682009-07-01 11:22:01 +0200103+
Harald Weltec9b484f2009-07-12 20:46:43 +0200104+#define RSL_IE_IPAC_SRTP_CONFIG 0xe0
105+#define RSL_IE_IPAC_PROXY_UDP 0xe1
106+#define RSL_IE_IPAC_BSCMPL_TOUT 0xe2
Harald Welte2d112ad2009-06-10 05:42:52 +0800107+#define RSL_IE_IPAC_REMOTE_IP 0xf0
108+#define RSL_IE_IPAC_REMOTE_PORT 0xf1
Harald Weltec9b484f2009-07-12 20:46:43 +0200109+#define RSL_IE_IPAC_RTP_PAYLOAD 0xf2
Harald Welte2d112ad2009-06-10 05:42:52 +0800110+#define RSL_IE_IPAC_LOCAL_PORT 0xf3
Harald Weltec9b484f2009-07-12 20:46:43 +0200111+#define RSL_IE_IPAC_SPEECH_MODE 0xf4
Harald Welte2d112ad2009-06-10 05:42:52 +0800112+#define RSL_IE_IPAC_LOCAL_IP 0xf5
Harald Weltec9b484f2009-07-12 20:46:43 +0200113+#define RSL_IE_IPAC_CONN_STAT 0xf6
114+#define RSL_IE_IPAC_HO_C_PARMS 0xf7
115+#define RSL_IE_IPAC_CONN_ID 0xf8
116+#define RSL_IE_IPAC_RTP_CSD_FMT 0xf9
117+#define RSL_IE_IPAC_RTP_JIT_BUF 0xfa
118+#define RSL_IE_IPAC_RTP_COMPR 0xfb
119+#define RSL_IE_IPAC_RTP_PAYLOAD2 0xfc
120+#define RSL_IE_IPAC_RTP_MPLEX 0xfd
121+#define RSL_IE_IPAC_RTP_MPLEX_ID 0xfe
Harald Welte9e20bc52009-06-26 15:04:00 +0200122
123 static const value_string rsl_msg_type_vals[] = {
124 /* 0 0 0 0 - - - - Radio Link Layer Management messages: */
Harald Welteb5280c72009-10-22 10:09:56 +0200125@@ -339,6 +415,26 @@
Harald Welte9e20bc52009-06-26 15:04:00 +0200126 { 0x3f, "TFO MODification REQuest" }, /* 8.4.31 */
127 /* 0 1 - - - - - - Location Services messages: */
128 { 0x41, "Location Information" }, /* 8.7.1 */
129+ /* ip.access */
Harald Weltea1f0ac72009-07-12 21:59:04 +0200130+ { 0x48, "ip.access PDCH ACTIVATION" },
131+ { 0x49, "ip.access PDCH ACTIVATION ACK" },
132+ { 0x4a, "ip.access PDCH ACTIVATION NACK" },
133+ { 0x4b, "ip.access PDCH DEACTIVATION" },
134+ { 0x4c, "ip.access PDCH DEACTIVATION ACK" },
135+ { 0x4d, "ip.access PDCH DEACTIVATION NACK" },
136+ { 0x60, "ip.access MEASurement PREPROCessing DeFauLT" },
137+ { 0x61, "ip.access HANDOover CANDidate ENQuiry" },
138+ { 0x62, "ip.access HANDOover CANDidate RESPonse" },
Holger Hans Peter Freytherb9bda7b2009-11-18 21:31:15 +0100139+ { 0x70, "ip.access CRCX" },
140+ { 0x71, "ip.access CRCX ACK" },
141+ { 0x72, "ip.access CRCX NACK" },
142+ { 0x73, "ip.access MDCX" },
143+ { 0x74, "ip.access MDCX ACK" },
144+ { 0x75, "ip.access MDCX NACK" },
145+ { 0x76, "ip.access DLCX INDication" },
146+ { 0x77, "ip.access DLCX" },
147+ { 0x78, "ip.access DLCX ACK" },
148+ { 0x79, "ip.access DLCX NACK" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200149 { 0, NULL }
150 };
151
Holger Hans Peter Freytherb9bda7b2009-11-18 21:31:15 +0100152@@ -372,10 +468,10 @@ static const value_string rsl_msg_type_vals[] = {
Harald Weltea1f0ac72009-07-12 21:59:04 +0200153 #define RSL_IE_MESSAGE_ID 28
154
155 #define RSL_IE_SYS_INFO_TYPE 30
156-
157-
158-
159-
160+#define RSL_IE_MS_POWER_PARAM 31
161+#define RSL_IE_BS_POWER_PARAM 32
162+#define RSL_IE_PREPROC_PARAM 33
163+#define RSL_IE_PREPROC_MEAS 34
164 #define RSL_IE_FULL_IMM_ASS_INF 35
165 #define RSL_IE_SMSCB_INF 36
166 #define RSL_IE_FULL_MS_TIMING_OFFSET 37
Harald Welteb5280c72009-10-22 10:09:56 +0200167@@ -478,6 +574,24 @@
Harald Welte9e20bc52009-06-26 15:04:00 +0200168 Not used
169
170 */
Harald Weltec9b484f2009-07-12 20:46:43 +0200171+ { 0xe0, "SRTP Configuration" },
172+ { 0xe1, "BSC Proxy UDP Port" },
173+ { 0xe2, "BSC Multiplex Timeout" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200174+ { 0xf0, "Remote IP Address" },
175+ { 0xf1, "Remote RTP Port" },
Harald Weltec9b484f2009-07-12 20:46:43 +0200176+ { 0xf2, "RTP Payload Type" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200177+ { 0xf3, "Local RTP Port" },
Harald Weltec9b484f2009-07-12 20:46:43 +0200178+ { 0xf4, "Speech Mode" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200179+ { 0xf5, "Local IP Address" },
Harald Weltec9b484f2009-07-12 20:46:43 +0200180+ { 0xf6, "Connection Statistics" },
181+ { 0xf7, "Handover C Parameters" },
182+ { 0xf8, "Connection Identifier" },
183+ { 0xf9, "RTP CSD Format" },
184+ { 0xfa, "RTP Jitter Buffer" },
185+ { 0xfb, "RTP Compression" },
186+ { 0xfc, "RTP Payload Type 2" },
187+ { 0xfd, "RTP Multiplex" },
188+ { 0xfe, "RTP Multiplex Identifier" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200189 { 0, NULL }
190 };
191
Harald Welteb5280c72009-10-22 10:09:56 +0200192@@ -514,6 +628,96 @@
Harald Welte9e20bc52009-06-26 15:04:00 +0200193 { 0, NULL }
194 };
195
196+/* From openbsc/include/openbsc/tlv.h */
197+enum tlv_type {
198+ TLV_TYPE_FIXED,
199+ TLV_TYPE_T,
200+ TLV_TYPE_TV,
201+ TLV_TYPE_TLV,
202+ TLV_TYPE_TL16V,
203+};
204+
205+struct tlv_def {
206+ enum tlv_type type;
207+ u_int8_t fixed_len;
208+};
209+
210+struct tlv_definition {
211+ struct tlv_def def[0xff];
212+};
213+
214+static const struct tlv_definition rsl_att_tlvdef = {
215+ .def = {
216+ [RSL_IE_CH_NO] = { TLV_TYPE_TV, 0 },
217+ [RSL_IE_LINK_ID] = { TLV_TYPE_TV, 0 },
218+ [RSL_IE_ACT_TYPE] = { TLV_TYPE_TV, 0 },
219+ [RSL_IE_BS_POW] = { TLV_TYPE_TV, 0 },
220+ [RSL_IE_CH_ID] = { TLV_TYPE_TLV, 0 },
221+ [RSL_IE_CH_MODE] = { TLV_TYPE_TLV, 0 },
222+ [RSL_IE_ENC_INF] = { TLV_TYPE_TLV, 0 },
223+ [RSL_IE_FRAME_NO] = { TLV_TYPE_FIXED, 2 },
224+ [RSL_IE_HO_REF] = { TLV_TYPE_TV, 0 },
225+ [RSL_IE_L1_INF] = { TLV_TYPE_FIXED, 2 },
226+ [RSL_IE_L3_INF] = { TLV_TYPE_TL16V, 0 },
227+ [RSL_IE_MS_ID] = { TLV_TYPE_TLV, 0 },
228+ [RSL_IE_MS_POW] = { TLV_TYPE_TV, 0 },
229+ [RSL_IE_PAGING_GRP] = { TLV_TYPE_TV, 0 },
230+ [RSL_IE_PAGING_LOAD] = { TLV_TYPE_FIXED, 2 },
231+ [RSL_IE_PHY_CTX] = { TLV_TYPE_TLV, 0 },
232+ [RSL_IE_ACCESS_DELAY] = { TLV_TYPE_TV, 0 },
233+ [RSL_IE_RACH_LOAD] = { TLV_TYPE_TLV, 0 },
234+ [RSL_IE_REQ_REF] = { TLV_TYPE_FIXED, 3 },
235+ [RSL_IE_REL_MODE] = { TLV_TYPE_TV, 0 },
236+ [RSL_IE_RESOURCE_INF] = { TLV_TYPE_TLV, 0 },
237+ [RSL_IE_RLM_CAUSE] = { TLV_TYPE_TLV, 0 },
238+ [RSL_IE_STARTING_TIME] = { TLV_TYPE_FIXED, 2 },
239+ [RSL_IE_TIMING_ADV] = { TLV_TYPE_TV, 0 },
240+ [RSL_IE_UPLINK_MEAS] = { TLV_TYPE_TLV, 0 },
241+ [RSL_IE_CAUSE] = { TLV_TYPE_TLV, 0 },
242+ [RSL_IE_MEAS_RES_NO] = { TLV_TYPE_TV, 0 },
243+ [RSL_IE_MESSAGE_ID] = { TLV_TYPE_TV, 0 },
244+ [RSL_IE_SYS_INFO_TYPE] = { TLV_TYPE_TV, 0 },
Harald Weltea1f0ac72009-07-12 21:59:04 +0200245+ [RSL_IE_MS_POWER_PARAM] = { TLV_TYPE_TLV, 0 },
246+ [RSL_IE_BS_POWER_PARAM] = { TLV_TYPE_TLV, 0 },
247+ [RSL_IE_PREPROC_PARAM] = { TLV_TYPE_TLV, 0 },
248+ [RSL_IE_PREPROC_MEAS] = { TLV_TYPE_TLV, 0 },
Harald Welte9e20bc52009-06-26 15:04:00 +0200249+ //[RSL_IE_IMM_ASS_INFO] = { TLV_TYPE_TLV, 0 },
250+ //[RSL_IE_SMSCB_INFO] = { TLV_TYPE_FIXED, 23 },
251+ //[RSL_IE_MS_TIMING_OFFSET] = { TLV_TYPE_TV, 0 },
252+ [RSL_IE_ERR_MSG] = { TLV_TYPE_TLV, 0 },
253+ [RSL_IE_FULL_BCCH_INF] = { TLV_TYPE_TLV, 0 },
254+ [RSL_IE_CH_NEEDED] = { TLV_TYPE_TV, 0 },
255+ [RSL_IE_CB_CMD_TYPE] = { TLV_TYPE_TV, 0 },
256+ [RSL_IE_SMSCB_MESS] = { TLV_TYPE_TLV, 0 },
257+ [RSL_IE_FULL_IMM_ASS_INF] = { TLV_TYPE_TLV, 0 },
258+ //[RSL_IE_SACCH_INFO] = { TLV_TYPE_TLV, 0 },
259+ [RSL_IE_CBCH_LOAD_INF] = { TLV_TYPE_TV, 0 },
260+ [RSL_IE_SMSCB_CH_IND] = { TLV_TYPE_TV, 0 },
261+ [RSL_IE_GRP_CALL_REF] = { TLV_TYPE_TLV, 0 },
262+ [RSL_IE_CH_DESC] = { TLV_TYPE_TLV, 0 },
263+ [RSL_IE_NCH_DRX_INF] = { TLV_TYPE_TLV, 0 },
264+ [RSL_IE_CMD_IND] = { TLV_TYPE_TLV, 0 },
265+ [RSL_IE_EMLPP_PRIO] = { TLV_TYPE_TV, 0 },
266+ [RSL_IE_UIC] = { TLV_TYPE_TLV, 0 },
267+ [RSL_IE_MAIN_CH_REF] = { TLV_TYPE_TV, 0 },
268+ [RSL_IE_MULTIRATE_CONF] = { TLV_TYPE_TLV, 0 },
269+ [RSL_IE_MULTIRATE_CNTRL] = { TLV_TYPE_TV, 0 },
270+ [RSL_IE_SUP_CODEC_TYPES] = { TLV_TYPE_TLV, 0 },
271+ [RSL_IE_CODEC_CONF] = { TLV_TYPE_TLV, 0 },
272+ [RSL_IE_RTD] = { TLV_TYPE_TV, 0 },
273+ [RSL_IE_TFO_STATUS] = { TLV_TYPE_TV, 0 },
274+ [RSL_IE_LLP_APDU] = { TLV_TYPE_TLV, 0 },
275+ [RSL_IE_IPAC_REMOTE_IP] = { TLV_TYPE_FIXED, 4 },
276+ [RSL_IE_IPAC_REMOTE_PORT] = { TLV_TYPE_FIXED, 2 },
277+ [RSL_IE_IPAC_LOCAL_IP] = { TLV_TYPE_FIXED, 4 },
Harald Welteb5280c72009-10-22 10:09:56 +0200278+ [RSL_IE_IPAC_CONN_STAT] = { TLV_TYPE_TLV, 0 },
Harald Welte9e20bc52009-06-26 15:04:00 +0200279+ [RSL_IE_IPAC_LOCAL_PORT] = { TLV_TYPE_FIXED, 2 },
Harald Weltec9b484f2009-07-12 20:46:43 +0200280+ [RSL_IE_IPAC_SPEECH_MODE] = { TLV_TYPE_TV, 0 },
281+ [RSL_IE_IPAC_CONN_ID] = { TLV_TYPE_FIXED, 2 },
282+ [RSL_IE_IPAC_RTP_PAYLOAD2] = { TLV_TYPE_TV, 0 },
Harald Welte9e20bc52009-06-26 15:04:00 +0200283+ },
284+};
285+
286 /* 9.3.1 Channel number 9.3.1 M TV 2 */
287 static int
288 dissect_rsl_ie_ch_no(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
Harald Welteb5280c72009-10-22 10:09:56 +0200289@@ -2044,7 +2248,6 @@
Harald Welte9e20bc52009-06-26 15:04:00 +0200290 proto_item_set_len(ti, length+2);
291
292 proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, FALSE);
293- offset++;
294
295 /* Received Message */
296 offset = dissct_rsl_msg(tvb, pinfo, ie_tree, offset);
Harald Welteb5280c72009-10-22 10:09:56 +0200297@@ -2909,12 +3112,183 @@
Harald Welte9e20bc52009-06-26 15:04:00 +0200298 }
299
Harald Welteb5280c72009-10-22 10:09:56 +0200300 static int
Harald Weltea1f0ac72009-07-12 21:59:04 +0200301+dissct_rsl_ipaccess_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
Harald Welte2d112ad2009-06-10 05:42:52 +0800302+{
303+ guint8 msg_type;
Harald Welte9e20bc52009-06-26 15:04:00 +0200304+ guint32 local_addr = 0;
305+ guint16 local_port = 0;
306+ address src_addr;
Harald Welte2d112ad2009-06-10 05:42:52 +0800307+
308+ msg_type = tvb_get_guint8(tvb, offset)&0x7f;
309+ offset++;
310+
Harald Welteb5280c72009-10-22 10:09:56 +0200311+#if 0
Harald Welte2d112ad2009-06-10 05:42:52 +0800312+ switch (msg_type) {
313+ case RSL_MSG_TYPE_IPAC_BIND:
Harald Welte9e20bc52009-06-26 15:04:00 +0200314+ case RSL_MSG_TYPE_IPAC_BIND_ACK:
315+ case RSL_MSG_TYPE_IPAC_BIND_NACK:
316+ case RSL_MSG_TYPE_IPAC_CONNECT:
317+ case RSL_MSG_TYPE_IPAC_CONNECT_ACK:
318+ case RSL_MSG_TYPE_IPAC_CONNECT_NACK:
319+ case RSL_MSG_TYPE_IPAC_DISC_IND:
Harald Weltea1f0ac72009-07-12 21:59:04 +0200320+ case RSL_MSG_TYPE_IPAC_DISC:
321+ case RSL_MSG_TYPE_IPAC_DISC_ACK:
322+ case RSL_MSG_TYPE_IPAC_DISC_NACK:
323+ case RSL_MSG_TYPE_IPAC_PDCH_ACT:
324+ case RSL_MSG_TYPE_IPAC_PDCH_ACT_ACK:
325+ case RSL_MSG_TYPE_IPAC_PDCH_ACT_NACK:
326+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT:
327+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT_ACK:
328+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT_NACK:
Harald Welte2d112ad2009-06-10 05:42:52 +0800329+ /* Channel number 9.3.1 M TV 2 */
330+ offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
331+ break;
Harald Welte4e8c98a2009-08-20 00:59:11 +0900332+ }
Harald Welteb5280c72009-10-22 10:09:56 +0200333+#endif
334+ /* parse TLV attributes */
Harald Welte9e20bc52009-06-26 15:04:00 +0200335+ while (tvb_reported_length_remaining(tvb, offset) != 0) {
336+ guint8 tag;
337+ unsigned int len, hlen, len_len;
338+ const struct tlv_def *tdef;
339+ proto_item *ti;
340+ proto_tree *ie_tree;
341+
342+ tag = tvb_get_guint8(tvb, offset);
343+ tdef = &rsl_att_tlvdef.def[tag];
344+
345+ switch (tdef->type) {
346+ case TLV_TYPE_FIXED:
347+ hlen = 1;
348+ len_len = 0;
349+ len = tdef->fixed_len;
350+ break;
351+ case TLV_TYPE_T:
352+ hlen = 1;
353+ len_len = 0;
354+ len = 0;
355+ break;
356+ case TLV_TYPE_TV:
357+ hlen = 1;
358+ len_len = 0;
359+ len = 1;
360+ break;
361+ case TLV_TYPE_TLV:
362+ hlen = 2;
363+ len_len = 1;
364+ len = tvb_get_guint8(tvb, offset+1);
365+ break;
366+ case TLV_TYPE_TL16V:
367+ hlen = 3;
368+ len_len = 2;
369+ len = tvb_get_guint8(tvb, offset+1) << 8 |
370+ tvb_get_guint8(tvb, offset+2);
371+ break;
Harald Weltea1f0ac72009-07-12 21:59:04 +0200372+ default:
373+ hlen = len_len = len = 0;
374+ DISSECTOR_ASSERT_NOT_REACHED();
375+ break;
Harald Welte9e20bc52009-06-26 15:04:00 +0200376+ }
377+
378+ ti = proto_tree_add_item(tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
379+ ie_tree = proto_item_add_subtree(ti, ett_ie_local_port);
380+ offset += hlen;
381+
382+ switch (tag) {
383+ case RSL_IE_CH_NO:
Harald Welteb5280c72009-10-22 10:09:56 +0200384+ dissect_rsl_ie_ch_no(tvb, pinfo, ie_tree, offset, FALSE);
Harald Weltea1f0ac72009-07-12 21:59:04 +0200385+ break;
386+ case RSL_IE_FRAME_NO:
Harald Welteb5280c72009-10-22 10:09:56 +0200387+ dissect_rsl_ie_frame_no(tvb, pinfo, ie_tree, offset, FALSE);
Harald Weltea1f0ac72009-07-12 21:59:04 +0200388+ break;
389+ case RSL_IE_MS_POW:
Harald Welteb5280c72009-10-22 10:09:56 +0200390+ dissect_rsl_ie_ms_pow(tvb, pinfo, ie_tree, offset, FALSE);
Harald Welte9e20bc52009-06-26 15:04:00 +0200391+ break;
392+ case RSL_IE_IPAC_REMOTE_IP:
Harald Welte8dc1a682009-07-01 11:22:01 +0200393+ proto_tree_add_item(ie_tree, hf_rsl_remote_ip, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200394+ offset, len, FALSE);
Harald Welte9e20bc52009-06-26 15:04:00 +0200395+ break;
396+ case RSL_IE_IPAC_REMOTE_PORT:
Harald Welte8dc1a682009-07-01 11:22:01 +0200397+ proto_tree_add_item(ie_tree, hf_rsl_remote_port, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200398+ offset, len, FALSE);
Harald Welte9e20bc52009-06-26 15:04:00 +0200399+ break;
400+ case RSL_IE_IPAC_LOCAL_IP:
Harald Welte8dc1a682009-07-01 11:22:01 +0200401+ proto_tree_add_item(ie_tree, hf_rsl_local_ip, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200402+ offset, len, FALSE);
Harald Welte9e20bc52009-06-26 15:04:00 +0200403+ local_addr = tvb_get_ipv4(tvb, offset);
404+ break;
405+ case RSL_IE_IPAC_LOCAL_PORT:
Harald Welte8dc1a682009-07-01 11:22:01 +0200406+ proto_tree_add_item(ie_tree, hf_rsl_local_port, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200407+ offset, len, FALSE);
Harald Welte9e20bc52009-06-26 15:04:00 +0200408+ local_port = tvb_get_ntohs(tvb, offset);
409+ break;
Harald Weltec9b484f2009-07-12 20:46:43 +0200410+ case RSL_IE_IPAC_SPEECH_MODE:
Harald Welteb5280c72009-10-22 10:09:56 +0200411+ proto_tree_add_item(ie_tree, hf_rsl_speech_mode_s, tvb,
412+ offset, len, FALSE);
413+ proto_tree_add_item(ie_tree, hf_rsl_speech_mode_m, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200414+ offset, len, FALSE);
Harald Weltec9b484f2009-07-12 20:46:43 +0200415+ break;
416+ case RSL_IE_IPAC_RTP_PAYLOAD:
417+ case RSL_IE_IPAC_RTP_PAYLOAD2:
418+ proto_tree_add_item(ie_tree, hf_rsl_rtp_payload, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200419+ offset, len, FALSE);
420+ break;
Harald Welteb5280c72009-10-22 10:09:56 +0200421+ case RSL_IE_IPAC_RTP_CSD_FMT:
422+ proto_tree_add_item(ie_tree, hf_rsl_rtp_csd_fmt_d, tvb,
423+ offset, len, FALSE);
424+ proto_tree_add_item(ie_tree, hf_rsl_rtp_csd_fmt_ir, tvb,
425+ offset, len, FALSE);
426+ break;
Harald Weltec9b484f2009-07-12 20:46:43 +0200427+ case RSL_IE_IPAC_CONN_ID:
428+ proto_tree_add_item(ie_tree, hf_rsl_conn_id, tvb,
Harald Welte559d97d2009-07-12 23:10:28 +0200429+ offset, len, FALSE);
Holger Hans Peter Freytherb9bda7b2009-11-18 21:31:15 +0100430+ break;
Harald Welteb5280c72009-10-22 10:09:56 +0200431+ case RSL_IE_IPAC_CONN_STAT:
432+ proto_tree_add_item(ie_tree, hf_rsl_cstat_tx_pkts, tvb,
433+ offset, 4, FALSE);
434+ proto_tree_add_item(ie_tree, hf_rsl_cstat_tx_octs, tvb,
435+ offset+4, 4, FALSE);
436+ proto_tree_add_item(ie_tree, hf_rsl_cstat_rx_pkts, tvb,
437+ offset+8, 4, FALSE);
438+ proto_tree_add_item(ie_tree, hf_rsl_cstat_rx_octs, tvb,
439+ offset+12, 4, FALSE);
440+ proto_tree_add_item(ie_tree, hf_rsl_cstat_lost_pkts, tvb,
441+ offset+16, 4, FALSE);
442+ proto_tree_add_item(ie_tree, hf_rsl_cstat_ia_jitter, tvb,
443+ offset+20, 4, FALSE);
444+ proto_tree_add_item(ie_tree, hf_rsl_cstat_avg_tx_dly, tvb,
445+ offset+24, 4, FALSE);
Harald Weltec9b484f2009-07-12 20:46:43 +0200446+ break;
Harald Welte9e20bc52009-06-26 15:04:00 +0200447+ }
448+ offset += len;
Harald Welte2d112ad2009-06-10 05:42:52 +0800449+ }
450+
Harald Welte9e20bc52009-06-26 15:04:00 +0200451+ switch (msg_type) {
452+ case RSL_MSG_TYPE_IPAC_BIND_ACK:
Harald Welte8dc1a682009-07-01 11:22:01 +0200453+ /* Notify the RTP and RTCP dissectors about a new RTP stream */
Harald Welte9e20bc52009-06-26 15:04:00 +0200454+ src_addr.type = AT_IPv4;
455+ src_addr.len = 4;
456+ src_addr.data = (guint8 *)&local_addr;
Harald Welte8dc1a682009-07-01 11:22:01 +0200457+ rtp_add_address(pinfo, &src_addr, local_port, 0,
Harald Welte63aba292009-07-04 04:11:21 +0200458+ "GSM A-bis/IP", pinfo->fd->num, 0, NULL);
Harald Welte8dc1a682009-07-01 11:22:01 +0200459+ rtcp_add_address(pinfo, &src_addr, local_port+1, 0,
460+ "GSM A-bis/IP", pinfo->fd->num);
Harald Welte9e20bc52009-06-26 15:04:00 +0200461+ break;
462+ }
Harald Welte2d112ad2009-06-10 05:42:52 +0800463+ return offset;
464+}
465+
Harald Welteb5280c72009-10-22 10:09:56 +0200466+static int
Harald Welte2d112ad2009-06-10 05:42:52 +0800467 dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
468 {
469- guint8 msg_type;
470+ guint8 msg_disc, msg_type;
471
472+ msg_disc = tvb_get_guint8(tvb, offset++) >> 1;
473 msg_type = tvb_get_guint8(tvb,offset)&0x7f;
474 proto_tree_add_item(tree, hf_rsl_msg_type, tvb, offset, 1, FALSE);
475+
476+ if (msg_disc == RSL_MSGDISC_IPACCESS) {
477+ offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset);
478+ return offset;
479+ }
480 offset++;
481
482 switch (msg_type){
Harald Welteb5280c72009-10-22 10:09:56 +0200483@@ -3482,6 +3856,18 @@
Harald Weltea1f0ac72009-07-12 21:59:04 +0200484 /* LLP APDU 9.3.58 M LV 2-N */
485 offset = dissect_rsl_ie_llp_apdu(tvb, pinfo, tree, offset, TRUE);
486 break;
487+ /* the following messages are ip.access specific but sent without
488+ * ip.access memssage discriminator */
489+ case RSL_MSG_TYPE_IPAC_MEAS_PP_DEF:
490+ case RSL_MSG_TYPE_IPAC_HO_CAND_INQ:
491+ case RSL_MSG_TYPE_IPAC_HO_CAND_RESP:
492+ case RSL_MSG_TYPE_IPAC_PDCH_ACT:
493+ case RSL_MSG_TYPE_IPAC_PDCH_ACT_ACK:
494+ case RSL_MSG_TYPE_IPAC_PDCH_ACT_NACK:
495+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT:
496+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT_ACK:
497+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT_NACK:
498+ offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset-1);
499 default:
500 break;
501 }
Harald Welteb5280c72009-10-22 10:09:56 +0200502@@ -3489,6 +3875,40 @@
503 return offset;
504
505 }
506+
507+static const value_string rsl_ipacc_spm_s_vals[] = {
508+ { 0, "GSM FR codec (GSM type 1, FS)" },
509+ { 1, "GSM EFR codec (GSM type 2, FS)" },
510+ { 2, "GSM AMR/FR codec (GSM type 3, FS)" },
511+ { 3, "GSM HR codec (GSM type 1, HS)" },
512+ { 5, "GSM AMR/HR codec (GSM type 3, HS)" },
513+ { 0xf, "As specified by RTP Payload Type IE" },
514+ { 0, NULL }
515+};
516+
517+static const value_string rsl_ipacc_spm_m_vals[] = {
518+ { 0, "Send and Receive" },
519+ { 1, "Receive Only" },
520+ { 2, "Send Only" },
521+ { 0, NULL }
522+};
523+
524+static const value_string rsl_ipacc_rtp_csd_fmt_d_vals[] = {
525+ { 0, "External TRAU format" },
526+ { 1, "Non-TRAU Packed format" },
527+ { 2, "TRAU within the BTS" },
528+ { 3, "IWF-Free BTS-BTS Data" },
529+ { 0, NULL }
530+};
531+
532+static const value_string rsl_ipacc_rtp_csd_fmt_ir_vals[] = {
533+ { 0, "8kb/s" },
534+ { 1, "16kb/s" },
535+ { 2, "32kb/s" },
536+ { 3, "64kb/s" },
537+ { 0, NULL }
538+};
539+
540 static void
541 dissect_rsl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
542 {
543@@ -3516,7 +3936,6 @@
Harald Welte2d112ad2009-06-10 05:42:52 +0800544 /* 9.1 Message discriminator */
545 proto_tree_add_item(rsl_tree, hf_rsl_msg_dsc, tvb, offset, 1, FALSE);
546 proto_tree_add_item(rsl_tree, hf_rsl_T_bit, tvb, offset, 1, FALSE);
547- offset++;
548
549 offset = dissct_rsl_msg(tvb, pinfo, rsl_tree, offset);
550
Harald Welteb5280c72009-10-22 10:09:56 +0200551@@ -3886,6 +4305,86 @@
Harald Welte2d112ad2009-06-10 05:42:52 +0800552 FT_UINT8, BASE_DEC, VALS(rsl_emlpp_prio_vals), 0x03,
Harald Welte63aba292009-07-04 04:11:21 +0200553 NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800554 },
Harald Welteb5280c72009-10-22 10:09:56 +0200555+ { &hf_rsl_speech_mode_s,
556+ { "ip.access Speech Mode S", "rsl.ipacc.speech_mode_s",
557+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_spm_s_vals),
558+ 0xf, NULL, HFILL }
559+ },
560+ { &hf_rsl_speech_mode_m,
561+ { "ip.access Speech Mode M", "rsl.ipacc.speech_mode_m",
562+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_spm_m_vals),
563+ 0xf0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800564+ },
Harald Weltec9b484f2009-07-12 20:46:43 +0200565+ { &hf_rsl_conn_stat,
566+ { "ip.access Connection Statistics","rsl.ipacc.conn_stat",
Harald Welteb5280c72009-10-22 10:09:56 +0200567+ FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800568+ },
Harald Weltec9b484f2009-07-12 20:46:43 +0200569+ { &hf_rsl_conn_id,
570+ { "ip.access Connection ID", "rsl.ipacc.conn_id",
571+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800572+ },
Harald Weltec9b484f2009-07-12 20:46:43 +0200573+ { &hf_rsl_rtp_payload,
574+ { "ip.access RTP Payload Type", "rsl.ipacc.rtp_payload",
575+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800576+ },
Harald Welteb5280c72009-10-22 10:09:56 +0200577+ { &hf_rsl_rtp_csd_fmt_d,
578+ { "ip.access RTP CSD Format D", "rsl.ipacc.rtp_csd_fmt_d",
579+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_rtp_csd_fmt_d_vals),
580+ 0x0f, NULL, HFILL },
581+ },
582+ { &hf_rsl_rtp_csd_fmt_ir,
583+ { "ip.access RTP CSD Format IR", "rsl.ipacc.rtp_csd_fmt_ir",
584+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_rtp_csd_fmt_ir_vals),
585+ 0xf0, NULL, HFILL },
586+ },
Harald Welte2d112ad2009-06-10 05:42:52 +0800587+ { &hf_rsl_local_port,
588+ { "ip.access Local RTP Port", "rsl.ipacc.local_port",
589+ FT_UINT16, BASE_DEC, NULL, 0x0,
590+ "ip.access Local RTP Port", HFILL },
591+ },
592+ { &hf_rsl_remote_port,
593+ { "ip.access Remote RTP Port", "rsl.ipacc.remote_port",
594+ FT_UINT16, BASE_DEC, NULL, 0x0,
595+ "ip.access Remote RTP Port", HFILL },
596+ },
597+ { &hf_rsl_local_ip,
598+ { "ip.access Local IP Address", "rsl.ipacc.local_ip",
599+ FT_IPv4, BASE_NONE, NULL, 0x0,
600+ "ip.access Local IP Address", HFILL },
601+ },
602+ { &hf_rsl_remote_ip,
603+ { "ip.access Remote IP Address", "rsl.ipacc.remote_ip",
604+ FT_IPv4, BASE_NONE, NULL, 0x0,
605+ "ip.access Remote IP Address", HFILL },
606+ },
Harald Welteb5280c72009-10-22 10:09:56 +0200607+ { &hf_rsl_cstat_tx_pkts,
608+ { "Packets Sent", "rsl.ipacc.cstat.tx_pkts",
609+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
610+ },
611+ { &hf_rsl_cstat_tx_octs,
612+ { "Octets Sent", "rsl.ipacc.cstat.tx_octets",
613+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
614+ },
615+ { &hf_rsl_cstat_rx_pkts,
616+ { "Packets Received", "rsl.ipacc.cstat.rx_pkts",
617+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
618+ },
619+ { &hf_rsl_cstat_rx_octs,
620+ { "Octets Received", "rsl.ipacc.cstat.rx_octets",
621+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
622+ },
623+ { &hf_rsl_cstat_lost_pkts,
624+ { "Packets Lost", "rsl.ipacc.cstat.lost_pkts",
625+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
626+ },
627+ { &hf_rsl_cstat_ia_jitter,
628+ { "Inter-arrival Jitter", "rsl.ipacc.cstat.ia_jitter",
629+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
630+ },
631+ { &hf_rsl_cstat_avg_tx_dly,
632+ { "Average Tx Delay", "rsl.ipacc.cstat.avg_tx_delay",
633+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
634+ },
Harald Welte2d112ad2009-06-10 05:42:52 +0800635 };
636 static gint *ett[] = {
637 &ett_rsl,
Harald Welteb5280c72009-10-22 10:09:56 +0200638@@ -3943,6 +4442,14 @@
Harald Welte2d112ad2009-06-10 05:42:52 +0800639 &ett_ie_meas_res_no,
640 &ett_ie_message_id,
641 &ett_ie_sys_info_type,
Harald Weltec9b484f2009-07-12 20:46:43 +0200642+ &ett_ie_speech_mode,
643+ &ett_ie_conn_stat,
644+ &ett_ie_conn_id,
Harald Welte2d112ad2009-06-10 05:42:52 +0800645+ &ett_ie_remote_ip,
646+ &ett_ie_remote_port,
647+ &ett_ie_local_port,
648+ &ett_ie_local_ip,
Harald Weltec9b484f2009-07-12 20:46:43 +0200649+ &ett_ie_rtp_payload,
Harald Welte2d112ad2009-06-10 05:42:52 +0800650 };
651
652 /* Register the protocol name and description */