blob: 8f922c4ae88fd954fe165020bb8b53c57e5df7e6 [file] [log] [blame]
Harald Welte2d112ad2009-06-10 05:42:52 +08001Index: wireshark/epan/dissectors/packet-rsl.c
2===================================================================
Harald Weltea1f0ac72009-07-12 21:59:04 +02003--- wireshark.orig/epan/dissectors/packet-rsl.c 2009-07-12 14:07:48.000000000 +0200
Harald Welte559d97d2009-07-12 23:10:28 +02004+++ wireshark/epan/dissectors/packet-rsl.c 2009-07-12 23:04:33.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 Weltec9b484f2009-07-12 20:46:43 +020011 * $Id: packet-rsl.c 29056 2009-07-10 20:00:54Z tuexen $
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 Welte559d97d2009-07-12 23:10:28 +020022@@ -116,6 +119,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 Welte559d97d2009-07-12 23:10:28 +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 Welte559d97d2009-07-12 23:10:28 +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 Welte559d97d2009-07-12 23:10:28 +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 Welte559d97d2009-07-12 23:10:28 +020047@@ -173,6 +194,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 Welte559d97d2009-07-12 23:10:28 +020063@@ -208,8 +238,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 Welte559d97d2009-07-12 23:10:28 +020075@@ -276,6 +309,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 Welte559d97d2009-07-12 23:10:28 +0200125@@ -338,6 +414,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" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200139+ { 0x70, "ip.access BIND" },
140+ { 0x71, "ip.access BIND ACK" },
141+ { 0x72, "ip.access BIND NACK" },
142+ { 0x73, "ip.access CONNECT" },
143+ { 0x74, "ip.access CONNECT ACK" },
144+ { 0x75, "ip.access CONNECT NACK" },
145+ { 0x76, "ip.access DISCONNECT INDication" },
Harald Weltea1f0ac72009-07-12 21:59:04 +0200146+ { 0x77, "ip.access DISCONNECT" },
147+ { 0x78, "ip.access DISCONNECT ACK" },
148+ { 0x79, "ip.access DISCONNECT NACK" },
Harald Welte9e20bc52009-06-26 15:04:00 +0200149 { 0, NULL }
150 };
151
Harald Welte559d97d2009-07-12 23:10:28 +0200152@@ -371,10 +467,10 @@
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 Welte559d97d2009-07-12 23:10:28 +0200167@@ -477,6 +573,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 Welte559d97d2009-07-12 23:10:28 +0200192@@ -513,6 +627,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 Welte559d97d2009-07-12 23:10:28 +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 Welte559d97d2009-07-12 23:10:28 +0200289@@ -2043,7 +2247,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 Welte559d97d2009-07-12 23:10:28 +0200297@@ -2908,12 +3111,183 @@
Harald Welte9e20bc52009-06-26 15:04:00 +0200298 }
299
Harald Welte559d97d2009-07-12 23:10:28 +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 Welte559d97d2009-07-12 23:10:28 +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 Welte9e20bc52009-06-26 15:04:00 +0200332+ }
Harald Welte559d97d2009-07-12 23:10:28 +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 Welte559d97d2009-07-12 23:10:28 +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 Welte559d97d2009-07-12 23:10:28 +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 Welte559d97d2009-07-12 23:10:28 +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 Welte559d97d2009-07-12 23:10:28 +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,
414+ 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;
421+ 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);
Harald Weltec9b484f2009-07-12 20:46:43 +0200426+ break;
427+ 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);
430+ case RSL_IE_IPAC_CONN_STAT:
431+ proto_tree_add_item(ie_tree, hf_rsl_cstat_tx_pkts, tvb,
432+ offset, 4, FALSE);
433+ proto_tree_add_item(ie_tree, hf_rsl_cstat_tx_octs, tvb,
434+ offset+4, 4, FALSE);
435+ proto_tree_add_item(ie_tree, hf_rsl_cstat_rx_pkts, tvb,
436+ offset+8, 4, FALSE);
437+ proto_tree_add_item(ie_tree, hf_rsl_cstat_rx_octs, tvb,
438+ offset+12, 4, FALSE);
439+ proto_tree_add_item(ie_tree, hf_rsl_cstat_lost_pkts, tvb,
440+ offset+16, 4, FALSE);
441+ proto_tree_add_item(ie_tree, hf_rsl_cstat_ia_jitter, tvb,
442+ offset+20, 4, FALSE);
443+ proto_tree_add_item(ie_tree, hf_rsl_cstat_avg_tx_dly, tvb,
444+ offset+24, 4, FALSE);
Harald Weltec9b484f2009-07-12 20:46:43 +0200445+ break;
Harald Welte9e20bc52009-06-26 15:04:00 +0200446+ }
447+ offset += len;
Harald Welte2d112ad2009-06-10 05:42:52 +0800448+ }
449+
Harald Welte9e20bc52009-06-26 15:04:00 +0200450+ switch (msg_type) {
451+ case RSL_MSG_TYPE_IPAC_BIND_ACK:
Harald Welte8dc1a682009-07-01 11:22:01 +0200452+ /* Notify the RTP and RTCP dissectors about a new RTP stream */
Harald Welte9e20bc52009-06-26 15:04:00 +0200453+ src_addr.type = AT_IPv4;
454+ src_addr.len = 4;
455+ src_addr.data = (guint8 *)&local_addr;
Harald Welte8dc1a682009-07-01 11:22:01 +0200456+ rtp_add_address(pinfo, &src_addr, local_port, 0,
Harald Welte63aba292009-07-04 04:11:21 +0200457+ "GSM A-bis/IP", pinfo->fd->num, 0, NULL);
Harald Welte8dc1a682009-07-01 11:22:01 +0200458+ rtcp_add_address(pinfo, &src_addr, local_port+1, 0,
459+ "GSM A-bis/IP", pinfo->fd->num);
Harald Welte9e20bc52009-06-26 15:04:00 +0200460+ break;
461+ }
Harald Welte2d112ad2009-06-10 05:42:52 +0800462+ return offset;
463+}
464+
Harald Welte559d97d2009-07-12 23:10:28 +0200465+static int
Harald Welte2d112ad2009-06-10 05:42:52 +0800466 dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
467 {
468- guint8 msg_type;
469+ guint8 msg_disc, msg_type;
470
471+ msg_disc = tvb_get_guint8(tvb, offset++) >> 1;
472 msg_type = tvb_get_guint8(tvb,offset)&0x7f;
473 proto_tree_add_item(tree, hf_rsl_msg_type, tvb, offset, 1, FALSE);
474+
475+ if (msg_disc == RSL_MSGDISC_IPACCESS) {
476+ offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset);
477+ return offset;
478+ }
479 offset++;
480
481 switch (msg_type){
Harald Welte559d97d2009-07-12 23:10:28 +0200482@@ -3481,6 +3855,18 @@
Harald Weltea1f0ac72009-07-12 21:59:04 +0200483 /* LLP APDU 9.3.58 M LV 2-N */
484 offset = dissect_rsl_ie_llp_apdu(tvb, pinfo, tree, offset, TRUE);
485 break;
486+ /* the following messages are ip.access specific but sent without
487+ * ip.access memssage discriminator */
488+ case RSL_MSG_TYPE_IPAC_MEAS_PP_DEF:
489+ case RSL_MSG_TYPE_IPAC_HO_CAND_INQ:
490+ case RSL_MSG_TYPE_IPAC_HO_CAND_RESP:
491+ case RSL_MSG_TYPE_IPAC_PDCH_ACT:
492+ case RSL_MSG_TYPE_IPAC_PDCH_ACT_ACK:
493+ case RSL_MSG_TYPE_IPAC_PDCH_ACT_NACK:
494+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT:
495+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT_ACK:
496+ case RSL_MSG_TYPE_IPAC_PDCH_DEACT_NACK:
497+ offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset-1);
498 default:
499 break;
500 }
Harald Welte559d97d2009-07-12 23:10:28 +0200501@@ -3488,6 +3874,40 @@
502 return offset;
503
504 }
505+
506+static const value_string rsl_ipacc_spm_s_vals[] = {
507+ { 0, "GSM FR codec (GSM type 1, FS)" },
508+ { 1, "GSM EFR codec (GSM type 2, FS)" },
509+ { 2, "GSM AMR/FR codec (GSM type 3, FS)" },
510+ { 3, "GSM HR codec (GSM type 1, HS)" },
511+ { 5, "GSM AMR/HR codec (GSM type 3, HS)" },
512+ { 0xf, "As specified by RTP Payload Type IE" },
513+ { 0, NULL }
514+};
515+
516+static const value_string rsl_ipacc_spm_m_vals[] = {
517+ { 0, "Send and Receive" },
518+ { 1, "Receive Only" },
519+ { 2, "Send Only" },
520+ { 0, NULL }
521+};
522+
523+static const value_string rsl_ipacc_rtp_csd_fmt_d_vals[] = {
524+ { 0, "External TRAU format" },
525+ { 1, "Non-TRAU Packed format" },
526+ { 2, "TRAU within the BTS" },
527+ { 3, "IWF-Free BTS-BTS Data" },
528+ { 0, NULL }
529+};
530+
531+static const value_string rsl_ipacc_rtp_csd_fmt_ir_vals[] = {
532+ { 0, "8kb/s" },
533+ { 1, "16kb/s" },
534+ { 2, "32kb/s" },
535+ { 3, "64kb/s" },
536+ { 0, NULL }
537+};
538+
539 static void
540 dissect_rsl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
541 {
542@@ -3517,7 +3937,6 @@
Harald Welte2d112ad2009-06-10 05:42:52 +0800543 /* 9.1 Message discriminator */
544 proto_tree_add_item(rsl_tree, hf_rsl_msg_dsc, tvb, offset, 1, FALSE);
545 proto_tree_add_item(rsl_tree, hf_rsl_T_bit, tvb, offset, 1, FALSE);
546- offset++;
547
548 offset = dissct_rsl_msg(tvb, pinfo, rsl_tree, offset);
549
Harald Welte559d97d2009-07-12 23:10:28 +0200550@@ -3883,6 +4302,86 @@
Harald Welte2d112ad2009-06-10 05:42:52 +0800551 FT_UINT8, BASE_DEC, VALS(rsl_emlpp_prio_vals), 0x03,
Harald Welte63aba292009-07-04 04:11:21 +0200552 NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800553 },
Harald Welte559d97d2009-07-12 23:10:28 +0200554+ { &hf_rsl_speech_mode_s,
555+ { "ip.access Speech Mode S", "rsl.ipacc.speech_mode_s",
556+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_spm_s_vals),
557+ 0xf, NULL, HFILL }
558+ },
559+ { &hf_rsl_speech_mode_m,
560+ { "ip.access Speech Mode M", "rsl.ipacc.speech_mode_m",
561+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_spm_m_vals),
562+ 0xf0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800563+ },
Harald Weltec9b484f2009-07-12 20:46:43 +0200564+ { &hf_rsl_conn_stat,
565+ { "ip.access Connection Statistics","rsl.ipacc.conn_stat",
566+ FT_BYTES, BASE_HEX, NULL, 0x0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800567+ },
Harald Weltec9b484f2009-07-12 20:46:43 +0200568+ { &hf_rsl_conn_id,
569+ { "ip.access Connection ID", "rsl.ipacc.conn_id",
570+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800571+ },
Harald Weltec9b484f2009-07-12 20:46:43 +0200572+ { &hf_rsl_rtp_payload,
573+ { "ip.access RTP Payload Type", "rsl.ipacc.rtp_payload",
574+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
Harald Welte2d112ad2009-06-10 05:42:52 +0800575+ },
Harald Welte559d97d2009-07-12 23:10:28 +0200576+ { &hf_rsl_rtp_csd_fmt_d,
577+ { "ip.access RTP CSD Format D", "rsl.ipacc.rtp_csd_fmt_d",
578+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_rtp_csd_fmt_d_vals),
579+ 0x0f, NULL, HFILL },
580+ },
581+ { &hf_rsl_rtp_csd_fmt_ir,
582+ { "ip.access RTP CSD Format IR", "rsl.ipacc.rtp_csd_fmt_ir",
583+ FT_UINT8, BASE_HEX, VALS(rsl_ipacc_rtp_csd_fmt_ir_vals),
584+ 0xf0, NULL, HFILL },
585+ },
Harald Welte2d112ad2009-06-10 05:42:52 +0800586+ { &hf_rsl_local_port,
587+ { "ip.access Local RTP Port", "rsl.ipacc.local_port",
588+ FT_UINT16, BASE_DEC, NULL, 0x0,
589+ "ip.access Local RTP Port", HFILL },
590+ },
591+ { &hf_rsl_remote_port,
592+ { "ip.access Remote RTP Port", "rsl.ipacc.remote_port",
593+ FT_UINT16, BASE_DEC, NULL, 0x0,
594+ "ip.access Remote RTP Port", HFILL },
595+ },
596+ { &hf_rsl_local_ip,
597+ { "ip.access Local IP Address", "rsl.ipacc.local_ip",
598+ FT_IPv4, BASE_NONE, NULL, 0x0,
599+ "ip.access Local IP Address", HFILL },
600+ },
601+ { &hf_rsl_remote_ip,
602+ { "ip.access Remote IP Address", "rsl.ipacc.remote_ip",
603+ FT_IPv4, BASE_NONE, NULL, 0x0,
604+ "ip.access Remote IP Address", HFILL },
605+ },
Harald Welte559d97d2009-07-12 23:10:28 +0200606+ { &hf_rsl_cstat_tx_pkts,
607+ { "Packets Sent", "rsl.ipacc.cstat.tx_pkts",
608+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
609+ },
610+ { &hf_rsl_cstat_tx_octs,
611+ { "Octets Sent", "rsl.ipacc.cstat.tx_octets",
612+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
613+ },
614+ { &hf_rsl_cstat_rx_pkts,
615+ { "Packets Received", "rsl.ipacc.cstat.rx_pkts",
616+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
617+ },
618+ { &hf_rsl_cstat_rx_octs,
619+ { "Octets Received", "rsl.ipacc.cstat.rx_octets",
620+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
621+ },
622+ { &hf_rsl_cstat_lost_pkts,
623+ { "Packets Lost", "rsl.ipacc.cstat.lost_pkts",
624+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
625+ },
626+ { &hf_rsl_cstat_ia_jitter,
627+ { "Inter-arrival Jitter", "rsl.ipacc.cstat.ia_jitter",
628+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
629+ },
630+ { &hf_rsl_cstat_avg_tx_dly,
631+ { "Average Tx Delay", "rsl.ipacc.cstat.avg_tx_delay",
632+ FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
633+ },
Harald Welte2d112ad2009-06-10 05:42:52 +0800634 };
635 static gint *ett[] = {
636 &ett_rsl,
Harald Welte559d97d2009-07-12 23:10:28 +0200637@@ -3941,6 +4440,14 @@
Harald Welte2d112ad2009-06-10 05:42:52 +0800638 &ett_ie_meas_res_no,
639 &ett_ie_message_id,
640 &ett_ie_sys_info_type,
Harald Weltec9b484f2009-07-12 20:46:43 +0200641+ &ett_ie_speech_mode,
642+ &ett_ie_conn_stat,
643+ &ett_ie_conn_id,
Harald Welte2d112ad2009-06-10 05:42:52 +0800644+ &ett_ie_remote_ip,
645+ &ett_ie_remote_port,
646+ &ett_ie_local_port,
647+ &ett_ie_local_ip,
Harald Weltec9b484f2009-07-12 20:46:43 +0200648+ &ett_ie_rtp_payload,
Harald Welte2d112ad2009-06-10 05:42:52 +0800649 };
650
651 /* Register the protocol name and description */