blob: d467354aae795ff4406a3786d532c33def0bfce9 [file] [log] [blame]
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +01001From 6254ee454147eab6f6a51792544716472e20073f Mon Sep 17 00:00:00 2001
2From: Holger Hans Peter Freyther <zecke@selfish.org>
3Date: Tue, 11 Jan 2011 15:09:18 +0100
4Subject: [PATCH 2/4] ericsson_rbs2409
5
6Add Ericsson RBS2409 dissector
7---
8 epan/CMakeLists.txt | 2 +
9 epan/dissectors/Makefile.common | 2 +
10 epan/dissectors/packet-ehdlc.c | 319 +++++++
11 epan/dissectors/packet-gsm_abis_om2000.c | 1439 ++++++++++++++++++++++++++++++
12 epan/dissectors/packet-gsm_abis_oml.c | 21 +
13 epan/dissectors/packet-l2tp.c | 7 +
14 6 files changed, 1790 insertions(+), 0 deletions(-)
15 create mode 100644 epan/dissectors/packet-ehdlc.c
16 create mode 100644 epan/dissectors/packet-gsm_abis_om2000.c
17
Harald Welte7c78c472011-09-06 21:09:05 +020018Index: wireshark/epan/CMakeLists.txt
19===================================================================
20--- wireshark.orig/epan/CMakeLists.txt 2011-09-06 13:37:42.000000000 +0200
21+++ wireshark/epan/CMakeLists.txt 2011-09-06 13:53:22.000000000 +0200
22@@ -180,6 +180,8 @@
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +010023 dissectors/packet-dcerpc-eventlog.c
24 dissectors/packet-dcerpc-lsa.c
25 dissectors/packet-dcerpc-winreg.c
26+ dissectors/packet-ehdlc.c
27+ dissectors/packet-gsm_abis_om2000.c
28 )
29 set(ASN1_DISSECTOR_SRC
30 dissectors/packet-acp133.c
Harald Welte7c78c472011-09-06 21:09:05 +020031Index: wireshark/epan/dissectors/Makefile.common
32===================================================================
33--- wireshark.orig/epan/dissectors/Makefile.common 2011-09-06 13:37:42.000000000 +0200
34+++ wireshark/epan/dissectors/Makefile.common 2011-09-06 13:53:22.000000000 +0200
35@@ -67,6 +67,8 @@
Harald Welte0326cd52010-11-29 16:32:47 +010036 packet-dcerpc-dnsserver.c \
37 packet-dcerpc-eventlog.c \
38 packet-dcerpc-lsa.c \
39+ packet-ehdlc.c \
40+ packet-gsm_abis_om2000.c \
41 packet-dcerpc-winreg.c
42
43 #
Harald Welte7c78c472011-09-06 21:09:05 +020044Index: wireshark/epan/dissectors/packet-ehdlc.c
45===================================================================
46--- /dev/null 1970-01-01 00:00:00.000000000 +0000
47+++ wireshark/epan/dissectors/packet-ehdlc.c 2011-09-06 13:37:48.000000000 +0200
48@@ -0,0 +1,321 @@
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +010049+/* packet-ehdlc.c
50+ * Routines for packet dissection of Ericsson HDLC as used in A-bis over IP
51+ * Copyright 2010 by Harald Welte <laforge@gnumonks.org>
52+ *
53+ * $Id: packet-ehdlc.c 33767 2010-08-11 11:59:47Z etxrab $
54+ *
55+ * Wireshark - Network traffic analyzer
56+ * By Gerald Combs <gerald@wireshark.org>
57+ * Copyright 1998 Gerald Combs
58+ *
59+ * This program is free software; you can redistribute it and/or
60+ * modify it under the terms of the GNU General Public License
61+ * as published by the Free Software Foundation; either version 2
62+ * of the License, or (at your option) any later version.
63+ *
64+ * This program is distributed in the hope that it will be useful,
65+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
66+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
67+ * GNU General Public License for more details.
68+ *
69+ * You should have received a copy of the GNU General Public License
70+ * along with this program; if not, write to the Free Software
71+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
72+ */
73+
74+#ifdef HAVE_CONFIG_H
75+# include "config.h"
76+#endif
77+
78+#include <glib.h>
79+
80+#include <epan/packet.h>
81+#include <epan/ipproto.h>
82+#include <epan/xdlc.h>
83+
84+/* Initialize the protocol and registered fields */
85+static int proto_ehdlc = -1;
86+
87+static int hf_ehdlc_data_len = -1;
88+static int hf_ehdlc_protocol = -1;
89+static int hf_ehdlc_sapi = -1;
90+static int hf_ehdlc_c_r = -1;
91+
92+static int hf_ehdlc_xid_payload = -1;
93+static int hf_ehdlc_control = -1;
94+
95+static int hf_ehdlc_p = -1;
96+static int hf_ehdlc_f = -1;
97+static int hf_ehdlc_u_modifier_cmd = -1;
98+static int hf_ehdlc_u_modifier_resp = -1;
99+static int hf_ehdlc_ftype_s_u = -1;
100+
101+static int hf_ehdlc_n_r = -1;
102+static int hf_ehdlc_n_s = -1;
103+static int hf_ehdlc_p_ext = -1;
104+static int hf_ehdlc_f_ext = -1;
105+static int hf_ehdlc_s_ftype = -1;
106+static int hf_ehdlc_ftype_i = -1;
107+static int hf_ehdlc_ftype_s_u_ext = -1;
108+
109+/* Used only for U frames */
110+static const xdlc_cf_items ehdlc_cf_items = {
111+ NULL,
112+ NULL,
113+ &hf_ehdlc_p,
114+ &hf_ehdlc_f,
115+ NULL,
116+ &hf_ehdlc_u_modifier_cmd,
117+ &hf_ehdlc_u_modifier_resp,
118+ NULL,
119+ &hf_ehdlc_ftype_s_u
120+};
121+
122+/* Used only for I and S frames */
123+static const xdlc_cf_items ehdlc_cf_items_ext = {
124+ &hf_ehdlc_n_r,
125+ &hf_ehdlc_n_s,
126+ &hf_ehdlc_p_ext,
127+ &hf_ehdlc_f_ext,
128+ &hf_ehdlc_s_ftype,
129+ NULL,
130+ NULL,
131+ &hf_ehdlc_ftype_i,
132+ &hf_ehdlc_ftype_s_u_ext,
133+};
134+
135+/* Initialize the subtree pointers */
136+static gint ett_ehdlc = -1;
137+static gint ett_ehdlc_control = -1;
138+
139+static const value_string ehdlc_protocol_vals[] = {
140+ { 0x20, "RSL" },
141+ { 0xa0, "ACK" },
142+ { 0xc0, "OML" },
143+ { 0, NULL }
144+};
145+
146+enum {
147+ SUB_RSL,
148+ SUB_OML,
149+ SUB_DATA,
150+
151+ SUB_MAX
152+};
153+
154+static dissector_handle_t sub_handles[SUB_MAX];
155+
156+/* Code to actually dissect the packets */
157+static void
158+dissect_ehdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
159+{
160+ gint remaining;
161+ int offset = 4;
162+
163+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "EHDLC");
164+ col_clear(pinfo->cinfo, COL_INFO);
165+
166+ while ((remaining = tvb_reported_length_remaining(tvb, offset)) > 0) {
167+ proto_item *ti = NULL;
168+ proto_tree *ehdlc_tree = NULL;
169+ guint16 len, msg_type;
170+ tvbuff_t *next_tvb;
171+ guint16 control;
172+ gboolean is_response = 0, is_extended = TRUE;
173+ gint header_length = 2; /* Address + Length field */
174+
175+ msg_type = tvb_get_guint8(tvb, offset);
176+ len = tvb_get_guint8(tvb, offset+1);
177+#if 0
178+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
179+ val_to_str(msg_type, ehdlc_protocol_vals,
180+ "unknown 0x%02x"));
181+#endif
182+ if (tree) {
183+ ti = proto_tree_add_protocol_format(tree, proto_ehdlc,
184+ tvb, offset, len,
185+ "Ericsson HDLC protocol, type: %s",
186+ val_to_str(msg_type, ehdlc_protocol_vals,
187+ "unknown 0x%02x"));
188+ ehdlc_tree = proto_item_add_subtree(ti, ett_ehdlc);
189+ proto_tree_add_item(ehdlc_tree, hf_ehdlc_protocol,
190+ tvb, offset, 1, FALSE);
191+#if 0
192+ proto_tree_add_item(ehdlc_tree, hf_ehdlc_sapi,
193+ tvb, offset, 1, FALSE);
194+ proto_tree_add_item(ehdlc_tree, hf_ehdlc_c_r,
195+ tvb, offset, 1, FALSE);
196+#endif
197+ proto_tree_add_item(ehdlc_tree, hf_ehdlc_data_len,
198+ tvb, offset+1, 1, FALSE);
199+ }
200+
201+ control = dissect_xdlc_control(tvb, offset+2, pinfo, ehdlc_tree, hf_ehdlc_control,
202+ ett_ehdlc_control, &ehdlc_cf_items, &ehdlc_cf_items_ext,
203+ NULL, NULL, is_response, is_extended, FALSE);
204+ header_length += XDLC_CONTROL_LEN(control, is_extended);
205+
206+ if (XDLC_IS_INFORMATION(control)) {
207+ next_tvb = tvb_new_subset(tvb, offset+header_length,
208+ len-header_length, len);
209+
210+ switch (msg_type) {
211+ case 0x20:
212+ /* len == 4 seems to be some kind of ACK */
213+ if (len <= 4)
214+ break;
215+ call_dissector(sub_handles[SUB_RSL], next_tvb, pinfo, tree);
216+ break;
217+ case 0xbc:
218+ case 0xdc:
219+ case 0xa0:
220+ case 0xc0:
221+ /* len == 4 seems to be some kind of ACK */
222+ if (len <= 4)
223+ break;
224+ call_dissector(sub_handles[SUB_OML], next_tvb, pinfo, tree);
225+ break;
226+ default:
227+ call_dissector(sub_handles[SUB_DATA], next_tvb, pinfo, tree);
228+ break;
229+ }
230+ } else if (control == XDLC_U | XDLC_XID) {
231+ /* XID is formatted like ISO 8885, typically we see
232+ * something like
233+ * 82 format identifier
234+ * 80 group identifier
235+ * 00 09 length
236+ * 07 01 05 Window Size Tx
237+ * 09 01 04 Ack Timer (msec)
238+ * 08 01 05 Window Size Rx */
239+ proto_tree_add_item(ehdlc_tree, hf_ehdlc_xid_payload,
240+ tvb, offset+header_length,
241+ len-header_length, FALSE);
242+ }
243+
Harald Welte7c78c472011-09-06 21:09:05 +0200244+ if (len == 0)
245+ len = 1;
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +0100246+ offset += len;
247+ }
248+}
249+
250+void proto_register_ehdlc(void)
251+{
252+ static hf_register_info hf[] = {
253+ { &hf_ehdlc_data_len,
254+ { "DataLen", "ehdlc.data_len",
255+ FT_UINT8, BASE_DEC, NULL, 0x0,
256+ "The length of the data (in bytes)", HFILL }
257+ },
258+ { &hf_ehdlc_protocol,
259+ { "Protocol", "ehdlc.protocol",
260+ FT_UINT8, BASE_HEX, VALS(ehdlc_protocol_vals), 0x0,
261+ "The HDLC Sub-Protocol", HFILL }
262+ },
263+ { &hf_ehdlc_sapi,
264+ { "SAPI", "ehdlc.sapi",
265+ FT_UINT8, BASE_DEC, NULL, 0x1f,
266+ NULL, HFILL }
267+ },
268+ { &hf_ehdlc_c_r,
269+ { "C/R", "ehdlc.c_r",
270+ FT_UINT8, BASE_HEX, NULL, 0x20,
271+ NULL, HFILL }
272+ },
273+ { &hf_ehdlc_xid_payload,
274+ { "XID Payload", "ehdlc.xid_payload",
275+ FT_BYTES, BASE_NONE, NULL, 0,
276+ NULL, HFILL }
277+ },
278+ { &hf_ehdlc_control,
279+ { "Control Field", "ehdlc.control",
280+ FT_UINT16, BASE_HEX, NULL, 0,
281+ NULL, HFILL }
282+ },
283+ { &hf_ehdlc_n_r,
284+ { "N(R)", "ehdlc.control.n_r",
285+ FT_UINT16, BASE_DEC, NULL, XDLC_N_R_EXT_MASK,
286+ NULL, HFILL }
287+ },
288+ { &hf_ehdlc_n_s,
289+ { "N(S)", "ehdlc.control.n_s",
290+ FT_UINT16, BASE_DEC, NULL, XDLC_N_S_EXT_MASK,
291+ NULL, HFILL }
292+ },
293+ { &hf_ehdlc_p,
294+ { "Poll", "ehdlc.control.p",
295+ FT_BOOLEAN, 8, TFS(&tfs_set_notset), XDLC_P_F,
296+ NULL, HFILL }
297+ },
298+ { &hf_ehdlc_p_ext,
299+ { "Poll", "ehdlc.control.p",
300+ FT_BOOLEAN, 16, TFS(&tfs_set_notset), XDLC_P_F_EXT,
301+ NULL, HFILL }
302+ },
303+ { &hf_ehdlc_f,
304+ { "Final", "ehdlc.control.f",
305+ FT_BOOLEAN, 8, TFS(&tfs_set_notset), XDLC_P_F,
306+ NULL, HFILL }
307+ },
308+ { &hf_ehdlc_f_ext,
309+ { "Final", "ehdlc.control.f",
310+ FT_BOOLEAN, 16, TFS(&tfs_set_notset), XDLC_P_F_EXT,
311+ NULL, HFILL }
312+ },
313+ { &hf_ehdlc_s_ftype,
314+ { "Supervisory frame type", "ehdlc.control.s_ftype",
315+ FT_UINT16, BASE_HEX, VALS(stype_vals), XDLC_S_FTYPE_MASK,
316+ NULL, HFILL }
317+ },
318+ { &hf_ehdlc_u_modifier_cmd,
319+ { "Command", "ehdlc.control.u_modifier_cmd",
320+ FT_UINT8, BASE_HEX, VALS(modifier_vals_cmd), XDLC_U_MODIFIER_MASK,
321+ NULL, HFILL }
322+ },
323+ { &hf_ehdlc_u_modifier_resp,
324+ { "Response", "ehdlc.control.u_modifier_resp",
325+ FT_UINT8, BASE_HEX, VALS(modifier_vals_resp), XDLC_U_MODIFIER_MASK,
326+ NULL, HFILL }
327+ },
328+ { &hf_ehdlc_ftype_i,
329+ { "Frame Type", "ehdlc.control.ftype",
330+ FT_UINT16, BASE_HEX, VALS(ftype_vals), XDLC_I_MASK,
331+ NULL, HFILL }
332+ },
333+ { &hf_ehdlc_ftype_s_u,
334+ { "Frame Type", "ehdlc.control.ftype",
335+ FT_UINT8, BASE_HEX, VALS(ftype_vals), XDLC_S_U_MASK,
336+ NULL, HFILL }
337+ },
338+ { &hf_ehdlc_ftype_s_u_ext,
339+ { "Frame Type", "ehdlc.control.ftype",
340+ FT_UINT16, BASE_HEX, VALS(ftype_vals), XDLC_S_U_MASK,
341+ NULL, HFILL }
342+ },
343+ };
344+
345+ static gint *ett[] = {
346+ &ett_ehdlc,
347+ &ett_ehdlc_control,
348+ };
349+
350+ proto_ehdlc =
351+ proto_register_protocol("Ericsson HDLC",
352+ "Ericsson HDLC as used in A-bis over IP", "ehdlc");
353+
354+ proto_register_field_array(proto_ehdlc, hf, array_length(hf));
355+ proto_register_subtree_array(ett, array_length(ett));
356+
357+ register_dissector("ehdlc", dissect_ehdlc, proto_ehdlc);
358+}
359+
360+void proto_reg_handoff_ehdlc(void)
361+{
362+ dissector_handle_t ehdlc_handle;
363+
364+ sub_handles[SUB_RSL] = find_dissector("gsm_abis_rsl");
365+ sub_handles[SUB_OML] = find_dissector("gsm_abis_oml");
366+ sub_handles[SUB_DATA] = find_dissector("data");
367+
368+ ehdlc_handle = create_dissector_handle(dissect_ehdlc, proto_ehdlc);
369+}
Harald Welte7c78c472011-09-06 21:09:05 +0200370Index: wireshark/epan/dissectors/packet-gsm_abis_om2000.c
371===================================================================
372--- /dev/null 1970-01-01 00:00:00.000000000 +0000
373+++ wireshark/epan/dissectors/packet-gsm_abis_om2000.c 2011-09-06 13:37:48.000000000 +0200
Harald Weltea36f0ed2010-11-29 22:05:34 +0100374@@ -0,0 +1,1439 @@
Harald Welte0326cd52010-11-29 16:32:47 +0100375+/* packet-abis_om2000.c
376+ * Routines for packet dissection of Ericsson A-bis OML (OM 2000)
377+ * Copyright 2010 by Harald Welte <laforge@gnumonks.org>
378+ *
379+ * $Id$
380+ *
381+ * Wireshark - Network traffic analyzer
382+ * By Gerald Combs <gerald@wireshark.org>
383+ * Copyright 1998 Gerald Combs
384+ *
385+ * This program is free software; you can redistribute it and/or
386+ * modify it under the terms of the GNU General Public License
387+ * as published by the Free Software Foundation; either version 2
388+ * of the License, or (at your option) any later version.
389+ *
390+ * This program is distributed in the hope that it will be useful,
391+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
392+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
393+ * GNU General Public License for more details.
394+ *
395+ * You should have received a copy of the GNU General Public License
396+ * along with this program; if not, write to the Free Software
397+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
398+ */
399+
400+#ifdef HAVE_CONFIG_H
401+# include "config.h"
402+#endif
403+
404+#include <glib.h>
405+
406+#include <epan/packet.h>
407+#include <epan/emem.h>
408+#include <epan/lapd_sapi.h>
409+#include <epan/prefs.h>
410+
411+#include "packet-gsm_abis_oml.h"
412+#include "packet-gsm_a_common.h"
413+
414+#include <stdio.h>
415+
416+/* initialize the protocol and registered fields */
417+static int proto_abis_om2000 = -1;
418+
419+static int hf_om2k_msg_code = -1;
420+static int hf_om2k_mo_if = -1;
421+static int hf_om2k_mo_class = -1;
Harald Weltea36f0ed2010-11-29 22:05:34 +0100422+static int hf_om2k_mo_instance = -1;
Harald Welte0326cd52010-11-29 16:32:47 +0100423+
424+static int hf_om2k_aip = -1;
425+static int hf_om2k_oip = -1;
426+static int hf_om2k_comb = -1;
427+static int hf_om2k_ts = -1;
428+static int hf_om2k_hsn = -1;
429+static int hf_om2k_maio = -1;
430+static int hf_om2k_bsic = -1;
431+static int hf_om2k_diversity = -1;
432+static int hf_om2k_fn_offs = -1;
433+static int hf_om2k_ext_range = -1;
434+static int hf_om2k_irc = -1;
435+static int hf_om2k_bs_pa_mfrms = -1;
436+static int hf_om2k_bs_ag_blks_res= -1;
437+static int hf_om2k_drx_dev_max = -1;
438+static int hf_om2k_cr = -1;
439+static int hf_om2k_ipt3 = -1;
440+static int hf_om2k_aop = -1;
441+static int hf_om2k_t3105 = -1;
442+static int hf_om2k_ny1 = -1;
443+static int hf_om2k_cbi = -1;
444+static int hf_om2k_tsc = -1;
445+static int hf_om2k_icm = -1;
446+static int hf_om2k_tta = -1;
447+static int hf_om2k_icm_cr = -1;
448+static int hf_om2k_lsc_fm = -1;
449+static int hf_om2k_lsc_lsi = -1;
450+static int hf_om2k_lsc_lsa = -1;
451+static int hf_om2k_ls_ft = -1;
452+static int hf_om2k_cst = -1;
453+static int hf_om2k_ea = -1;
454+static int hf_om2k_unknown_tag = -1;
Harald Weltea36f0ed2010-11-29 22:05:34 +0100455+static int hf_om2k_unknown_val = -1;
Harald Welte0326cd52010-11-29 16:32:47 +0100456+static int hf_om2k_nom_pwr = -1;
457+static int hf_om2k_fill_mark = -1;
458+static int hf_om2k_bcc = -1;
459+static int hf_om2k_mo_state = -1;
460+static int hf_om2k_la_state = -1;
461+static int hf_om2k_tsn_state = -1;
462+static int hf_om2k_bts_manuf = -1;
463+static int hf_om2k_bts_gen = -1;
464+static int hf_om2k_bts_rev = -1;
465+static int hf_om2k_bts_var = -1;
466+static int hf_om2k_brr = -1;
467+static int hf_om2k_bfr = -1;
468+static int hf_om2k_hwinfo_sig = -1;
469+static int hf_om2k_capa_sig = -1;
470+static int hf_om2k_file_rev = -1;
471+static int hf_om2k_filerel_ilr = -1;
472+static int hf_om2k_filerel_cur = -1;
473+static int hf_om2k_filerel_other = -1;
474+static int hf_om2k_cal_time = -1;
475+static int hf_om2k_list_nr = -1;
476+static int hf_om2k_list_nr_end = -1;
Harald Weltea36f0ed2010-11-29 22:05:34 +0100477+static int hf_om2k_isl = -1;
478+static int hf_om2k_isl_icp1 = -1;
479+static int hf_om2k_isl_icp2 = -1;
480+static int hf_om2k_isl_ci = -1;
481+static int hf_om2k_conl = -1;
482+static int hf_om2k_conl_nr_cgs = -1;
483+static int hf_om2k_conl_nr_cps_cg = -1;
484+static int hf_om2k_conl_ccp = -1;
485+static int hf_om2k_conl_ci = -1;
486+static int hf_om2k_conl_tag = -1;
487+static int hf_om2k_conl_tei = -1;
488+static int hf_om2k_tf_mode = -1;
489+static int hf_om2k_tf_fs_offset = -1;
490+
491+
Harald Welte0326cd52010-11-29 16:32:47 +0100492+
493+/* initialize the subtree pointers */
494+static int ett_om2000 = -1;
Harald Weltea36f0ed2010-11-29 22:05:34 +0100495+static int ett_om2k_mo = -1;
496+static int ett_om2k_isl = -1;
497+static int ett_om2k_conl = -1;
Harald Welte0326cd52010-11-29 16:32:47 +0100498+
499+static proto_tree *top_tree;
500+
501+static const value_string om2k_msgcode_vals[] = {
502+ { 0x0000, "Abort SP Command" },
503+ { 0x0002, "Abort SP Complete" },
504+ { 0x0004, "Alarm Report ACK" },
505+ { 0x0005, "Alarm Report NACK" },
506+ { 0x0006, "Alarm Report" },
507+ { 0x0008, "Alarm Status Request" },
508+ { 0x000a, "Alarm Status Request Accept" },
509+ { 0x000b, "Alarm Status Request Reject" },
510+ { 0x000c, "Alarm Status Result ACK" },
511+ { 0x000d, "Alarm Status Result NACK" },
512+ { 0x000e, "Alarm Status Result" },
513+ { 0x0010, "Calendar Time Response" },
514+ { 0x0011, "Calendar Time Reject" },
515+ { 0x0012, "Calendar Time Request" },
516+ { 0x0014, "CON Configuration Request" },
517+ { 0x0016, "CON Configuration Request Accept" },
518+ { 0x0017, "CON Configuration Request Reject" },
519+ { 0x0018, "CON Configuration Result ACK" },
520+ { 0x0019, "CON Configuration Result NACK" },
521+ { 0x001a, "CON Configuration Result" },
522+ { 0x001c, "Connect Command" },
523+ { 0x001e, "Connect Complete" },
524+ { 0x001f, "Connect Rejecte" },
525+ { 0x0028, "Disable Request" },
526+ { 0x002a, "Disable Request Accept" },
527+ { 0x002b, "Disable Request Reject" },
528+ { 0x002c, "Disable Result ACK" },
529+ { 0x002d, "Disable Result NACK" },
530+ { 0x002e, "Disable Result" },
531+ { 0x0030, "Disconnect Command" },
532+ { 0x0032, "Disconnect Complete" },
533+ { 0x0033, "Disconnect Reject" },
534+ { 0x0034, "Enable Request" },
535+ { 0x0036, "Enable Request Accept" },
536+ { 0x0037, "Enable Request Reject" },
537+ { 0x0038, "Enable Result ACK" },
538+ { 0x0039, "Enable Result NACK" },
539+ { 0x003a, "Enable Result" },
540+ { 0x003c, "Escape Downlink Normal" },
541+ { 0x003d, "Escape Downlink NACK" },
542+ { 0x003e, "Escape Uplink Normal" },
543+ { 0x003f, "Escape Uplink NACK" },
544+ { 0x0040, "Fault Report ACK" },
545+ { 0x0041, "Fault Report NACK" },
546+ { 0x0042, "Fault Report" },
547+ { 0x0044, "File Package End Command" },
548+ { 0x0046, "File Package End Result" },
549+ { 0x0047, "File Package End Reject" },
550+ { 0x0048, "File Relation Request" },
551+ { 0x004a, "File Relation Response" },
552+ { 0x004b, "File Relation Request Reject" },
553+ { 0x004c, "File Segment Transfer" },
554+ { 0x004e, "File Segment Transfer Complete" },
555+ { 0x004f, "File Segment Transfer Reject" },
556+ { 0x0050, "HW Information Request" },
557+ { 0x0052, "HW Information Request Accept" },
558+ { 0x0053, "HW Information Request Reject" },
559+ { 0x0054, "HW Information Result ACK" },
560+ { 0x0055, "HW Information Result NACK" },
561+ { 0x0056, "HW Information Result" },
562+ { 0x0060, "IS Configuration Request" },
563+ { 0x0062, "IS Configuration Request Accept" },
564+ { 0x0063, "IS Configuration Request Reject" },
565+ { 0x0064, "IS Configuration Result ACK" },
566+ { 0x0065, "IS Configuration Result NACK" },
567+ { 0x0066, "IS Configuration Result" },
568+ { 0x0068, "Load Data End" },
569+ { 0x006a, "Load Data End Result" },
570+ { 0x006b, "Load Data End Reject" },
571+ { 0x006c, "Load Data Init" },
572+ { 0x006e, "Load Data Init Accept" },
573+ { 0x006f, "Load Data Init Reject" },
574+ { 0x0070, "Loop Control Command" },
575+ { 0x0072, "Loop Control Complete" },
576+ { 0x0073, "Loop Control Reject" },
577+ { 0x0074, "Operational Information" },
578+ { 0x0076, "Operational Information Accept" },
579+ { 0x0077, "Operational Information Reject" },
580+ { 0x0078, "Reset Command" },
581+ { 0x007a, "Reset Complete" },
582+ { 0x007b, "Reset Reject" },
583+ { 0x007c, "RX Configuration Request" },
584+ { 0x007e, "RX Configuration Request Accept" },
585+ { 0x007f, "RX Configuration Request Reject" },
586+ { 0x0080, "RX Configuration Result ACK" },
587+ { 0x0081, "RX Configuration Result NACK" },
588+ { 0x0082, "RX Configuration Result" },
589+ { 0x0084, "Start Request" },
590+ { 0x0086, "Start Request Accept" },
591+ { 0x0087, "Start Request Reject" },
592+ { 0x0088, "Start Result ACK" },
593+ { 0x0089, "Start Result NACK" },
594+ { 0x008a, "Start Result" },
595+ { 0x008c, "Status Request" },
596+ { 0x008e, "Status Response" },
597+ { 0x008f, "Status Reject" },
598+ { 0x0094, "Test Request" },
599+ { 0x0096, "Test Request Accept" },
600+ { 0x0097, "Test Request Reject" },
601+ { 0x0098, "Test Result ACK" },
602+ { 0x0099, "Test Result NACK" },
603+ { 0x009a, "Test Result" },
604+ { 0x00a0, "TF Configuration Request" },
605+ { 0x00a2, "TF Configuration Request Accept" },
606+ { 0x00a3, "TF Configuration Request Reject" },
607+ { 0x00a4, "TF Configuration Result ACK" },
608+ { 0x00a5, "TF Configuration Result NACK" },
Harald Weltea36f0ed2010-11-29 22:05:34 +0100609+ { 0x00a6, "TF Configuration Result" },
Harald Welte0326cd52010-11-29 16:32:47 +0100610+ { 0x00a8, "TS Configuration Request" },
611+ { 0x00aa, "TS Configuration Request Accept" },
612+ { 0x00ab, "TS Configuration Request Reject" },
613+ { 0x00ac, "TS Configuration Result ACK" },
614+ { 0x00ad, "TS Configuration Result NACK" },
615+ { 0x00ae, "TS Configuration Result" },
616+ { 0x00b0, "TX Configuration Request" },
617+ { 0x00b2, "TX Configuration Request Accept" },
618+ { 0x00b3, "TX Configuration Request Reject" },
619+ { 0x00b4, "TX Configuration Result ACK" },
620+ { 0x00b5, "TX Configuration Result NACK" },
621+ { 0x00b6, "TX Configuration Result" },
622+ { 0x00bc, "DIP Alarm Report ACK" },
623+ { 0x00bd, "DIP Alarm Report NACK" },
624+ { 0x00be, "DIP Alarm Report" },
625+ { 0x00c0, "DIP Alarm Status Request" },
626+ { 0x00c2, "DIP Alarm Status Response" },
627+ { 0x00c3, "DIP Alarm Status Reject" },
628+ { 0x00c4, "DIP Quality Report I ACK" },
629+ { 0x00c5, "DIP Quality Report I NACK" },
630+ { 0x00c6, "DIP Quality Report I" },
631+ { 0x00c8, "DIP Quality Report II ACK" },
632+ { 0x00c9, "DIP Quality Report II NACK" },
633+ { 0x00ca, "DIP Quality Report II" },
Harald Weltea36f0ed2010-11-29 22:05:34 +0100634+ { 0x00dc, "DP Configuration Request" },
635+ { 0x00de, "DP Configuration Request Accept" },
636+ { 0x00df, "DP Configuration Request Reject" },
637+ { 0x00e0, "DP Configuration Result ACK" },
638+ { 0x00e1, "DP Configuration Result NACK" },
639+ { 0x00e2, "DP Configuration Result" },
640+ { 0x00e4, "Capabilities HW Info Report ACK" },
641+ { 0x00e5, "Capabilities HW Info Report NACK" },
642+ { 0x00e6, "Capabilities HW Info Report" },
643+ { 0x00e8, "Capabilities Request" },
644+ { 0x00ea, "Capabilities Request Accept" },
645+ { 0x00eb, "Capabilities Request Reject" },
646+ { 0x00ec, "Capabilities Result ACK" },
647+ { 0x00ed, "Capabilities Result NACK" },
648+ { 0x00ee, "Capabilities Result" },
649+ { 0x00f0, "FM Configuration Request" },
650+ { 0x00f2, "FM Configuration Request Accept" },
651+ { 0x00f3, "FM Configuration Request Reject" },
652+ { 0x00f4, "FM Configuration Result ACK" },
653+ { 0x00f5, "FM Configuration Result NACK" },
654+ { 0x00f6, "FM Configuration Result" },
655+ { 0x00f8, "FM Report Request" },
656+ { 0x00fa, "FM Report Response" },
657+ { 0x00fb, "FM Report Reject" },
658+ { 0x00fc, "FM Start Command" },
659+ { 0x00fe, "FM Start Complete" },
660+ { 0x00ff, "FM Start Reject" },
661+ { 0x0100, "FM Stop Command" },
662+ { 0x0102, "FM Stop Complete" },
663+ { 0x0103, "FM Stop Reject" },
Harald Welte0326cd52010-11-29 16:32:47 +0100664+ { 0x0104, "Negotiation Request ACK" },
665+ { 0x0105, "Negotiation Request NACK" },
666+ { 0x0106, "Negotiation Request" },
667+ { 0x0108, "BTS Initiated Request ACK" },
668+ { 0x0109, "BTS Initiated Request NACK" },
669+ { 0x010a, "BTS Initiated Request" },
670+ { 0x010c, "Radio Channels Release Command" },
671+ { 0x010e, "Radio Channels Release Complete" },
672+ { 0x010f, "Radio Channels Release Reject" },
673+ { 0x0118, "Feature Control Command" },
674+ { 0x011a, "Feature Control Complete" },
675+ { 0x011b, "Feature Control Reject" },
676+
677+ { 0, NULL }
678+};
679+
680+/* TS 12.21 Section 9.4: Attributes */
681+static const value_string om2k_attr_vals[] = {
682+ { 0x00, "Accordance indication" },
683+ { 0x01, "Alarm Id" },
684+ { 0x02, "Alarm Data" },
685+ { 0x03, "Alarm Severity" },
686+ { 0x04, "Alarm Status" },
687+ { 0x05, "Alarm Status Type" },
688+ { 0x06, "BCC" },
689+ { 0x07, "BS_AG_BKS_RES" },
690+ { 0x09, "BSIC" },
691+ { 0x0a, "BA_PA_MFRMS" },
692+ { 0x0b, "CBCH Indicator" },
693+ { 0x0c, "CCCH Options" },
694+ { 0x0d, "Calendar Time" },
695+ { 0x0f, "Channel Combination" },
696+ { 0x10, "CON Connection List" },
697+ { 0x11, "Data End Indication" },
698+ { 0x12, "DRX_DEV_MAX" },
699+ { 0x13, "End List Number" },
700+ { 0x14, "External Condition Map Class 1" },
701+ { 0x15, "External Condition Map Class 2" },
702+ { 0x16, "File Relation Indication" },
703+ { 0x17, "File Revision" },
704+ { 0x18, "File Segment Data" },
705+ { 0x19, "File Segment Length" },
706+ { 0x1a, "File Segment Sequence Number" },
707+ { 0x1b, "File Size" },
708+ { 0x1c, "Filling Marker" },
709+ { 0x1d, "FN Offset" },
710+ { 0x1e, "Frequency List" },
711+ { 0x1f, "Frequency Specifier RX" },
712+ { 0x20, "Frequency Specifier TX" },
713+ { 0x21, "HSN" },
714+ { 0x22, "ICM Indicator" },
715+ { 0x23, "Internal Fault Map Class 1A" },
716+ { 0x24, "Internal Fault Map Class 1B" },
717+ { 0x25, "Internal Fault Map Class 2A" },
718+ { 0x26, "Internal Fault Map Class 2A Extension" },
719+ { 0x27, "IS Connection List" },
720+ { 0x28, "List Number" },
721+ { 0x29, "File Package State Indication" },
722+ { 0x2a, "Local Access State" },
723+ { 0x2b, "MAIO" },
724+ { 0x2c, "MO State" },
725+ { 0x2d, "Ny1" },
726+ { 0x2e, "Operational Information" },
727+ { 0x2f, "Power" },
728+ { 0x30, "RU Position Data" },
729+ { 0x31, "Protocol Error" },
730+ { 0x32, "Reason Code" },
731+ { 0x33, "Receiver Diversity" },
732+ { 0x34, "Replacement Unit Map" },
733+ { 0x35, "Result Code" },
734+ { 0x36, "RU Revision Data" },
735+ { 0x38, "T3105" },
736+ { 0x39, "Test Loop Setting" },
737+ { 0x3a, "TF Mode" },
738+ { 0x3b, "TF Compensation Value" },
739+ { 0x3c, "Time Slot Number" },
740+ { 0x3d, "TSC" },
741+ { 0x3e, "RU Logical Id" },
742+ { 0x3f, "RU Serial Number Data" },
743+ { 0x40, "BTS Version" },
744+ { 0x41, "OML IWD Version" },
745+ { 0x42, "RWL IWD Version" },
746+ { 0x43, "OML Function Map 1" },
747+ { 0x44, "OML Function Map 2" },
748+ { 0x45, "RSL Function Map 1" },
749+ { 0x46, "RSL Function Map 2" },
750+ { 0x47, "Extended Range Indicator" },
751+ { 0x48, "Request Indicators" },
752+ { 0x49, "DIP Alarm Condition Map" },
753+ { 0x4a, "ES Incoming" },
754+ { 0x4b, "ES Outgoing" },
755+ { 0x4e, "SES Incoming" },
756+ { 0x4f, "SES Outgoing" },
757+ { 0x50, "Replacement Unit Map Extension" },
758+ { 0x52, "UAS Incoming" },
759+ { 0x53, "UAS Outgoing" },
760+ { 0x58, "DF Incoming" },
761+ { 0x5a, "DF Outgoing" },
762+ { 0x5c, "SF" },
763+ { 0x60, "S Bits Setting" },
764+ { 0x61, "CRC-4 Use Option" },
765+ { 0x62, "T Parameter" },
766+ { 0x63, "N Parameter" },
767+ { 0x64, "N1 Parameter" },
768+ { 0x65, "N3 Parameter" },
769+ { 0x66, "N4 Parameter" },
770+ { 0x67, "P Parameter" },
771+ { 0x68, "Q Parameter" },
772+ { 0x69, "BI_Q1" },
773+ { 0x6a, "BI_Q2" },
774+ { 0x74, "ICM Boundary Parameters" },
775+ { 0x77, "AFT" },
776+ { 0x78, "AFT RAI" },
777+ { 0x79, "Link Supervision Control" },
778+ { 0x7a, "Link Supervision Filtering Time" },
779+ { 0x7b, "Call Supervision Time" },
780+ { 0x7c, "Interval Length UAS Incoming" },
781+ { 0x7d, "Interval Length UAS Outgoing" },
782+ { 0x7e, "ICM Channel Rate" },
783+ { 0x7f, "Attribute Identifier" },
784+ { 0x80, "FM Frequency List" },
785+ { 0x81, "FM Frequency Report" },
786+ { 0x82, "FM Percentile" },
787+ { 0x83, "FM Clear Indication" },
788+ { 0x84, "HW Info Signature" },
789+ { 0x85, "MO Record" },
790+ { 0x86, "TF Synchronisation Source" },
791+ { 0x87, "TTA" },
792+ { 0x88, "End Segment Number" },
793+ { 0x89, "Segment Number" },
794+ { 0x8a, "Capabilities Signature" },
795+ { 0x8c, "File Relation List" },
796+ { 0x90, "Negotiation Record I" },
797+ { 0x91, "Negotiation Record II" },
798+ { 0x92, "Encryption Algorithm" },
799+ { 0x94, "Interference Rejection Combining" },
800+ { 0x95, "Dedication Information" },
801+ { 0x97, "Feature Code" },
802+ { 0x98, "FS Offset" },
803+ { 0x99, "ESB Timeslot" },
804+ { 0x9a, "Master TG Instance" },
805+ { 0x9b, "Master TX Chain Delay" },
806+ { 0x9c, "External Condition Class 2 Extension" },
807+ { 0x9d, "TSs MO State" },
808+ { 0, NULL }
809+};
810+
811+static const value_string om2k_diversity_vals[] = {
812+ { 0x01, "B receiver side" },
813+ { 0x02, "A receiver side" },
814+ { 0x03, "A+B receiver sides" },
815+ { 0x04, "A+B+C+D receiver sides" },
816+ { 0, NULL }
817+};
818+
819+static const value_string om2k_oip_vals[] = {
820+ { 0x00, "Not Operational" },
821+ { 0x01, "Operational" },
822+ { 0, NULL }
823+};
824+
825+static const value_string om2k_aip_vals[] = {
826+ { 0x00, "Data according to request" },
827+ { 0x01, "Data not according to request" },
828+ { 0x02, "Inconsistent MO data" },
829+ { 0x03, "Capability constraint violation" },
830+ { 0, NULL }
831+};
832+
833+static const value_string om2k_comb_vals[] = {
834+ { 0x03, "SDCCH/8 + SACCH/C8" },
835+ { 0x04, "BCCH, non-combined" },
836+ { 0x05, "BCCH, combined (SDCCH/4)" },
837+ { 0x08, "TCH Type, unspecified" },
838+ { 0, NULL }
839+};
840+
841+static const value_string om2k_icmcr_vals[] = {
842+ { 0x00, "ICM as per TCH/F" },
843+ { 0x01, "ICM as per TCH/H(0 and 1)" },
844+ { 0, NULL }
845+};
846+
847+static const value_string om2k_ea_vals[] = {
848+ { 0x00, "A5/1 and A5/2" },
849+ { 0x01, "A5/2 only" },
850+ { 0, NULL }
851+};
852+
853+static const value_string om2k_fill_vals[] = {
854+ { 0x00, "Filling" },
855+ { 0x01, "No filling" },
856+ { 0, NULL }
857+};
858+
859+static const value_string om2k_mo_state_vals[] = {
860+ { 0x00, "RESET" },
861+ { 0x01, "STARTED" },
862+ { 0x02, "ENABLED" },
863+ { 0x03, "DISABLED" },
864+ { 0, NULL }
865+};
866+
867+static const value_string om2k_la_state_vals[] = {
868+ { 0x00, "LOCALLY CONNECTED" },
869+ { 0x01, "LOCALLY DISCONNECTED" },
870+ { 0, NULL }
871+};
872+
873+static const value_string filerel_state_vals[] = {
874+ { 0x00, "Not known in current state (unknown file)" },
875+ { 0x01, "alllowed, already loaded" },
876+ { 0x02, "allowed, not loaded" },
877+ { 0x03, "not allowed" },
878+ { 0, NULL }
879+};
880+
Harald Weltea36f0ed2010-11-29 22:05:34 +0100881+static const value_string om2k_mo_class_short_vals[] = {
882+ { 0x01, "TRXC" },
883+ { 0x03, "TS" },
884+ { 0x04, "TF" },
885+ { 0x05, "IS" },
886+ { 0x06, "CON" },
887+ { 0x0a, "CF" },
888+ { 0x0b, "TX" },
889+ { 0x0c, "RX" },
890+ { 0, NULL }
891+};
892+
Harald Welte0326cd52010-11-29 16:32:47 +0100893+static const value_string om2k_mo_class_vals[] = {
Harald Weltea36f0ed2010-11-29 22:05:34 +0100894+ { 0x01, "TRXC (TRX Controller)" },
Harald Welte0326cd52010-11-29 16:32:47 +0100895+ { 0x03, "TS (Timeslot)" },
896+ { 0x04, "TF (Timing Function)" },
897+ { 0x05, "IS (Interface Switch)" },
898+ { 0x06, "CON (Concentrator)" },
899+ { 0x0a, "CF (Central Function)" },
900+ { 0x0b, "TX (Transmitter)" },
901+ { 0x0c, "RX (Receiver)" },
902+ { 0, NULL }
903+};
904+
Harald Weltea36f0ed2010-11-29 22:05:34 +0100905+static const value_string om2k_tf_mode_vals[] = {
906+ { 0x00, "Master" },
907+ { 0x01, "Standalone" },
908+ { 0x02, "Slave" },
909+ { 0xff, "Not defined" },
910+ { 0, NULL }
911+};
912+
Harald Welte0326cd52010-11-29 16:32:47 +0100913+static gint
914+dissect_tss_mo_state(tvbuff_t *tvb, gint offset, packet_info *pinfo,
915+ proto_tree *tree)
916+{
917+ guint8 tmp;
918+ guint i = 0;
919+
920+ for (i = 0; i < 8; i+= 2) {
921+ tmp = tvb_get_guint8(tvb, offset);
922+ proto_tree_add_uint_format(tree, hf_om2k_tsn_state, tvb, offset, 1, tmp & 0xf,
923+ "Timslot %u MO State: %s", i,
924+ val_to_str(tmp & 0xf, om2k_mo_state_vals, "unknown (%02d)"));
925+ proto_tree_add_uint_format(tree, hf_om2k_tsn_state, tvb, offset, 1, tmp >> 4,
926+ "Timslot %u MO State: %s", i+1,
927+ val_to_str(tmp >> 4, om2k_mo_state_vals, "unknown (%02d)"));
928+ offset++;
929+ }
930+
931+ return offset;
932+}
933+
934+
935+static gint
Harald Weltea36f0ed2010-11-29 22:05:34 +0100936+dissect_om2k_time(tvbuff_t *tvb, gint offset, proto_tree *tree)
Harald Welte0326cd52010-11-29 16:32:47 +0100937+{
938+ nstime_t tmptime;
939+ time_t tval;
940+ struct tm _time;
941+
942+ _time.tm_year = 100 + tvb_get_guint8(tvb, offset++);
943+ _time.tm_mon = tvb_get_guint8(tvb, offset++) -1;
944+ _time.tm_mday = tvb_get_guint8(tvb, offset++);
945+ _time.tm_hour = tvb_get_guint8(tvb, offset++);
946+ _time.tm_min = tvb_get_guint8(tvb, offset++);
947+ _time.tm_sec = tvb_get_guint8(tvb, offset++);
948+ _time.tm_isdst = -1;
949+
950+ tval = mktime(&_time);
951+ tmptime.secs = tval;
952+ tmptime.nsecs = 0;
953+
954+ proto_tree_add_time(tree, hf_om2k_cal_time, tvb, offset, 6,
955+ &tmptime);
956+ return 6;
957+}
958+
959+static gint
Harald Weltea36f0ed2010-11-29 22:05:34 +0100960+dissect_om2k_attr_unkn(tvbuff_t *tvb, gint offset, gint len, gint iei, proto_tree *tree)
961+{
962+ proto_tree_add_bytes_format(tree, hf_om2k_unknown_val, tvb,
963+ offset, len, tvb_get_ptr(tvb, offset, len),
964+ "%s: %s",
965+ val_to_str(iei, om2k_attr_vals, "0x%02x"),
966+ tvb_bytes_to_str(tvb, offset, len));
967+ return len;
968+}
969+
970+static gint
971+dissect_om2k_is_list(tvbuff_t *tvb, gint base_offset, proto_tree *tree)
972+{
973+ gint offset = base_offset;
974+ proto_item *ti;
975+ proto_tree *isl_tree;
976+ guint8 len = tvb_get_guint8(tvb, offset++);
977+
978+ ti = proto_tree_add_item(tree, hf_om2k_isl, tvb, offset, len, FALSE);
979+ isl_tree = proto_item_add_subtree(ti, ett_om2k_isl);
980+
981+ while (offset < base_offset + len) {
982+ proto_tree_add_item(isl_tree, hf_om2k_isl_icp1, tvb,
983+ offset, 2, FALSE);
984+ offset += 2;
985+ proto_tree_add_item(isl_tree, hf_om2k_isl_icp2, tvb,
986+ offset, 2, FALSE);
987+ offset += 2;
988+ proto_tree_add_item(isl_tree, hf_om2k_isl_ci, tvb,
989+ offset++, 1, FALSE);
990+ }
991+ return offset - base_offset;
992+}
993+
994+static gint
995+dissect_om2k_con_list(tvbuff_t *tvb, gint base_offset, proto_tree *tree)
996+{
997+ gint offset = base_offset;
998+ proto_item *ti;
999+ proto_tree *conl_tree;
1000+ guint8 len = tvb_get_guint8(tvb, offset++);
1001+
1002+ ti = proto_tree_add_item(tree, hf_om2k_conl, tvb, offset, len, FALSE);
1003+ conl_tree = proto_item_add_subtree(ti, ett_om2k_conl);
1004+
1005+ proto_tree_add_item(conl_tree, hf_om2k_conl_nr_cgs, tvb,
1006+ offset++, 1, FALSE);
1007+
1008+ while (offset < base_offset + len) {
1009+ guint8 nr_cps_cg = tvb_get_guint8(tvb, offset);
1010+ proto_tree_add_item(conl_tree, hf_om2k_conl_nr_cps_cg, tvb,
1011+ offset++, 1, FALSE);
1012+ while (nr_cps_cg--) {
1013+ proto_tree_add_item(conl_tree, hf_om2k_conl_ccp, tvb,
1014+ offset, 2, FALSE);
1015+ offset += 2;
1016+ proto_tree_add_item(conl_tree, hf_om2k_conl_ci, tvb,
1017+ offset++, 1, FALSE);
1018+ proto_tree_add_item(conl_tree, hf_om2k_conl_tag, tvb,
1019+ offset++, 1, FALSE);
1020+ proto_tree_add_item(conl_tree, hf_om2k_conl_tei, tvb,
1021+ offset++, 1, FALSE);
1022+ }
1023+ }
1024+ return offset - base_offset;
1025+}
1026+
1027+
1028+static gint
1029+dissect_om2k_attrs(tvbuff_t *tvb, gint base_offs, packet_info *pinfo,
Harald Welte0326cd52010-11-29 16:32:47 +01001030+ proto_tree *tree)
1031+{
1032+ int offset = base_offs;
1033+
1034+ while (tvb_reported_length_remaining(tvb, offset) != 0) {
1035+ guint8 iei = tvb_get_guint8(tvb, offset++);
1036+ guint8 len, tmp;
1037+ switch (iei) {
1038+ case 0x00: /* Accordance Information */
1039+ proto_tree_add_item(tree, hf_om2k_aip, tvb,
1040+ offset++, 1, FALSE);
1041+ break;
1042+ case 0x06: /* BCC */
1043+ proto_tree_add_item(tree, hf_om2k_bcc, tvb,
1044+ offset++, 1, FALSE);
1045+ break;
1046+ case 0x07: /* BS_AG_BLKS_RES */
1047+ proto_tree_add_item(tree, hf_om2k_bs_ag_blks_res, tvb,
1048+ offset++, 1, FALSE);
1049+ break;
1050+ case 0x09: /* BSIC */
1051+ proto_tree_add_item(tree, hf_om2k_bsic, tvb,
1052+ offset++, 1, FALSE);
1053+ break;
1054+ case 0x0a: /* BS_PA_MFRMS */
1055+ proto_tree_add_item(tree, hf_om2k_bs_pa_mfrms, tvb,
1056+ offset++, 1, FALSE);
1057+ break;
1058+ case 0x0b: /* CBCH indicator */
1059+ proto_tree_add_item(tree, hf_om2k_cbi, tvb,
1060+ offset++, 1, FALSE);
1061+ break;
1062+ case 0x0c: /* CCCH Options */
1063+ tmp = tvb_get_guint8(tvb, offset);
1064+ proto_tree_add_item(tree, hf_om2k_cr, tvb,
1065+ offset, 1, FALSE);
1066+ proto_tree_add_item(tree, hf_om2k_ipt3, tvb,
1067+ offset, 1, FALSE);
1068+ proto_tree_add_uint(tree, hf_om2k_aop, tvb,
1069+ offset, 1, (tmp & 0x3f) >> 2);
1070+ offset++;
1071+ break;
1072+ case 0x0d: /* Calendar Time */
1073+ offset += dissect_om2k_time(tvb, offset, tree);
1074+ break;
1075+ case 0x0f: /* Combination */
1076+ proto_tree_add_item(tree, hf_om2k_comb, tvb,
1077+ offset++, 1, FALSE);
1078+ break;
1079+ case 0x10: /* CON Connection List */
Harald Weltea36f0ed2010-11-29 22:05:34 +01001080+ offset += dissect_om2k_con_list(tvb, offset, tree);
Harald Welte0326cd52010-11-29 16:32:47 +01001081+ break;
1082+ case 0x12: /* DRX_DEV_MAX */
1083+ proto_tree_add_item(tree, hf_om2k_drx_dev_max, tvb,
1084+ offset++, 1, FALSE);
1085+ break;
1086+ case 0x13: /* End List Number */
1087+ proto_tree_add_item(tree, hf_om2k_list_nr_end, tvb,
1088+ offset++, 1, FALSE);
1089+ break;
1090+ case 0x14: /* External Condition Map Class 1 */
1091+ /* FIXME */
1092+ case 0x15: /* External Condition Map Class 2 */
1093+ /* FIXME */
Harald Weltea36f0ed2010-11-29 22:05:34 +01001094+ offset += dissect_om2k_attr_unkn(tvb, offset, 2, iei, tree);
Harald Welte0326cd52010-11-29 16:32:47 +01001095+ break;
1096+ case 0x16: /* File Relation Indication */
1097+ proto_tree_add_item(tree, hf_om2k_filerel_ilr, tvb,
1098+ offset, 1, FALSE);
1099+ proto_tree_add_item(tree, hf_om2k_filerel_cur, tvb,
1100+ offset, 1, FALSE);
1101+ offset++;
1102+ proto_tree_add_item(tree, hf_om2k_filerel_other, tvb,
1103+ offset, 1, FALSE);
1104+ offset++;
1105+ break;
1106+ case 0x17: /* File Revision */
1107+ proto_tree_add_item(tree, hf_om2k_file_rev, tvb,
1108+ offset, 8, FALSE);
1109+ offset += 8;
1110+ break;
1111+ case 0x1c: /* Filling Marker */
1112+ proto_tree_add_item(tree, hf_om2k_fill_mark, tvb,
1113+ offset++, 1, FALSE);
1114+ break;
1115+ case 0x1d: /* FN Offset */
1116+ proto_tree_add_item(tree, hf_om2k_fn_offs, tvb,
1117+ offset, 2, FALSE);
1118+ offset += 2;
1119+ break;
1120+ case 0x1e: /* Frequency List */
1121+ len = tvb_get_guint8(tvb, offset++);
1122+ /* FIXME */
Harald Weltea36f0ed2010-11-29 22:05:34 +01001123+ offset += dissect_om2k_attr_unkn(tvb, offset, len, iei, tree);
Harald Welte0326cd52010-11-29 16:32:47 +01001124+ break;
1125+ case 0x1f: /* Frequency Specifier Rx */
1126+ /* FIXME */
1127+ case 0x20: /* Frequency Specifier Rx */
1128+ /* FIXME */
Harald Weltea36f0ed2010-11-29 22:05:34 +01001129+ offset += dissect_om2k_attr_unkn(tvb, offset, 2, iei, tree);
Harald Welte0326cd52010-11-29 16:32:47 +01001130+ break;
1131+ case 0x21: /* HSN */
1132+ proto_tree_add_item(tree, hf_om2k_hsn, tvb,
1133+ offset++, 1, FALSE);
1134+ break;
1135+ case 0x22: /* ICM */
1136+ proto_tree_add_item(tree, hf_om2k_icm, tvb,
1137+ offset++, 1, FALSE);
1138+ break;
1139+ case 0x23: /* Internal Fault Map Class 1A */
1140+ /* FIXME */
1141+ case 0x24: /* Internal Fault Map Class 1B */
1142+ /* FIXME */
1143+ case 0x25: /* Internal Fault Map Class 2A */
1144+ /* FIXME */
1145+ case 0x26: /* Internal Fault Map Class 2A Ext */
1146+ /* FIXME */
Harald Weltea36f0ed2010-11-29 22:05:34 +01001147+ offset += dissect_om2k_attr_unkn(tvb, offset, 6, iei, tree);
Harald Welte0326cd52010-11-29 16:32:47 +01001148+ break;
1149+ case 0x27: /* IS Connection List */
Harald Weltea36f0ed2010-11-29 22:05:34 +01001150+ offset += dissect_om2k_is_list(tvb, offset, tree);
Harald Welte0326cd52010-11-29 16:32:47 +01001151+ break;
1152+ case 0x28: /* List Number */
1153+ proto_tree_add_item(tree, hf_om2k_list_nr, tvb,
1154+ offset++, 1, FALSE);
1155+ break;
1156+ case 0x2a: /* Local Access State */
1157+ proto_tree_add_item(tree, hf_om2k_la_state, tvb,
1158+ offset++, 1, FALSE);
1159+ break;
1160+ case 0x2b: /* MAIO */
1161+ proto_tree_add_item(tree, hf_om2k_maio, tvb,
1162+ offset++, 1, FALSE);
1163+ break;
1164+ case 0x2c: /* MO State */
1165+ proto_tree_add_item(tree, hf_om2k_mo_state, tvb,
1166+ offset++, 1, FALSE);
1167+ break;
1168+ case 0x2d: /* Ny1 */
1169+ proto_tree_add_item(tree, hf_om2k_ny1, tvb,
1170+ offset++, 1, FALSE);
1171+ break;
1172+ case 0x2e: /* Operational Information */
1173+ proto_tree_add_item(tree, hf_om2k_oip, tvb,
1174+ offset++, 1, FALSE);
1175+ break;
1176+ case 0x2f: /* Nominal Power */
1177+ proto_tree_add_item(tree, hf_om2k_nom_pwr, tvb,
1178+ offset++, 1, FALSE);
1179+ break;
1180+ case 0x33: /* Receiver Diversity */
1181+ proto_tree_add_item(tree, hf_om2k_diversity, tvb,
1182+ offset++, 1, FALSE);
1183+ break;
1184+ case 0x34: /* Replacement Unit Map */
1185+ /* FIXME */
Harald Weltea36f0ed2010-11-29 22:05:34 +01001186+ offset += dissect_om2k_attr_unkn(tvb, offset, 6, iei, tree);
Harald Welte0326cd52010-11-29 16:32:47 +01001187+ break;
1188+ case 0x38: /* T3105 */
1189+ proto_tree_add_item(tree, hf_om2k_t3105, tvb,
1190+ offset++, 1, FALSE);
1191+ break;
Harald Weltea36f0ed2010-11-29 22:05:34 +01001192+ case 0x3a: /* TF Mode */
1193+ proto_tree_add_item(tree, hf_om2k_tf_mode, tvb,
1194+ offset++, 1, FALSE);
1195+ break;
Harald Welte0326cd52010-11-29 16:32:47 +01001196+ case 0x3c: /* TS Number */
1197+ proto_tree_add_item(tree, hf_om2k_ts, tvb,
1198+ offset++, 1, FALSE);
1199+ break;
1200+ case 0x3d: /* TSC */
1201+ proto_tree_add_item(tree, hf_om2k_tsc, tvb,
1202+ offset++, 1, FALSE);
1203+ break;
1204+ case 0x40: /* BTS Version */
1205+ proto_tree_add_item(tree, hf_om2k_bts_manuf, tvb,
1206+ offset, 3, FALSE);
1207+ offset += 3;
1208+ proto_tree_add_item(tree, hf_om2k_bts_gen, tvb,
1209+ offset, 3, FALSE);
1210+ offset += 3;
1211+ proto_tree_add_item(tree, hf_om2k_bts_rev, tvb,
1212+ offset, 3, FALSE);
1213+ offset += 3;
1214+ proto_tree_add_item(tree, hf_om2k_bts_var, tvb,
1215+ offset, 3, FALSE);
1216+ offset += 3;
1217+ break;
1218+ case 0x43: /* OML Function Map 1 */
1219+ case 0x44: /* OML Function Map 2 */
1220+ case 0x45: /* RSL Function Map 1 */
1221+ case 0x46: /* RSL Function Map 2 */
1222+ len = tvb_get_guint8(tvb, offset++);
1223+ /* FIXME */
Harald Weltea36f0ed2010-11-29 22:05:34 +01001224+ offset += dissect_om2k_attr_unkn(tvb, offset, len, iei, tree);
Harald Welte0326cd52010-11-29 16:32:47 +01001225+ break;
1226+ case 0x47: /* Ext Range */
1227+ proto_tree_add_item(tree, hf_om2k_ext_range, tvb,
1228+ offset++, 1, FALSE);
1229+ break;
1230+ case 0x48: /* Request Indicators */
1231+ proto_tree_add_item(tree, hf_om2k_brr, tvb,
1232+ offset, 1, FALSE);
1233+ proto_tree_add_item(tree, hf_om2k_bfr, tvb,
1234+ offset, 1, FALSE);
1235+ offset++;
1236+ break;
1237+ case 0x50: /* Replacement Unit Map Extension */
1238+ /* FIXME */
Harald Weltea36f0ed2010-11-29 22:05:34 +01001239+ offset += dissect_om2k_attr_unkn(tvb, offset, 6, iei, tree);
Harald Welte0326cd52010-11-29 16:32:47 +01001240+ break;
1241+ case 0x74: /* ICM Boundary */
1242+ /* FIXME */
Harald Weltea36f0ed2010-11-29 22:05:34 +01001243+ offset += dissect_om2k_attr_unkn(tvb, offset, 5, iei, tree);
Harald Welte0326cd52010-11-29 16:32:47 +01001244+ break;
1245+ case 0x79: /* Link Supervision Control */
1246+ proto_tree_add_item(tree, hf_om2k_lsc_fm, tvb,
1247+ offset, 1, FALSE);
1248+ proto_tree_add_item(tree, hf_om2k_lsc_lsi, tvb,
1249+ offset, 1, FALSE);
1250+ proto_tree_add_item(tree, hf_om2k_lsc_lsa, tvb,
1251+ offset, 1, FALSE);
1252+ offset++;
1253+ break;
1254+ case 0x7a: /* Link Supervision Control */
1255+ proto_tree_add_item(tree, hf_om2k_ls_ft, tvb,
1256+ offset++, 1, FALSE);
1257+ break;
1258+ case 0x7b: /* Call Supervision Time */
1259+ proto_tree_add_item(tree, hf_om2k_cst, tvb,
1260+ offset++, 1, FALSE);
1261+ break;
1262+ case 0x7e: /* ICM Channel Rate */
1263+ proto_tree_add_item(tree, hf_om2k_icm_cr, tvb,
1264+ offset++, 1, FALSE);
1265+ break;
1266+ case 0x84: /* HW Info Signature */
1267+ proto_tree_add_item(tree, hf_om2k_hwinfo_sig, tvb,
1268+ offset, 2, FALSE);
1269+ offset += 2;
1270+ break;
1271+ case 0x87: /* TTA */
1272+ proto_tree_add_item(tree, hf_om2k_tta, tvb,
1273+ offset++, 1, FALSE);
1274+ break;
1275+ case 0x8a: /* Capabilities Signature */
1276+ proto_tree_add_item(tree, hf_om2k_capa_sig, tvb,
1277+ offset, 2, FALSE);
1278+ offset += 2;
1279+ break;
1280+ case 0x90: /* Negotiation Record I */
1281+ case 0x91: /* Negotiation Record II */
1282+ len = tvb_get_guint8(tvb, offset++);
1283+ /* FIXME */
Harald Weltea36f0ed2010-11-29 22:05:34 +01001284+ offset += dissect_om2k_attr_unkn(tvb, offset, len, iei, tree);
Harald Welte0326cd52010-11-29 16:32:47 +01001285+ break;
1286+ case 0x92: /* Encryption Algorithm */
1287+ proto_tree_add_item(tree, hf_om2k_ea, tvb,
1288+ offset++, 1, FALSE);
1289+ break;
1290+ case 0x94: /* Interference Rejection Combining */
1291+ proto_tree_add_item(tree, hf_om2k_irc, tvb,
1292+ offset++, 1, FALSE);
1293+ break;
1294+ case 0x95: /* Dedication information */
1295+ /* FIXME */
Harald Weltea36f0ed2010-11-29 22:05:34 +01001296+ offset += dissect_om2k_attr_unkn(tvb, offset, 3, iei, tree);
1297+ break;
1298+ case 0x98: /* FS Offset */
1299+ proto_tree_add_item(tree, hf_om2k_tf_fs_offset, tvb,
1300+ offset, 5, FALSE);
1301+ offset += 5;
Harald Welte0326cd52010-11-29 16:32:47 +01001302+ break;
1303+ case 0x9c: /* External Condition Class 2 Extension */
1304+ /* FIXME */
Harald Weltea36f0ed2010-11-29 22:05:34 +01001305+ offset += dissect_om2k_attr_unkn(tvb, offset, 4, iei, tree);
Harald Welte0326cd52010-11-29 16:32:47 +01001306+ break;
1307+ case 0x9d: /* TSs MO State */
1308+ dissect_tss_mo_state(tvb, offset, pinfo, tree);
1309+ offset += 4;
1310+ break;
1311+ case 0x9e:
1312+ case 0x9f:
1313+ default:
1314+ tmp = tvb_get_guint8(tvb, offset);
1315+ proto_tree_add_uint_format(tree, hf_om2k_unknown_tag, tvb,
1316+ offset-1, 1, tmp, "Tag %s: 0x%02x",
1317+ val_to_str(iei, om2k_attr_vals, "0x%02x"), tmp);
1318+ offset++;
1319+ break;
1320+ }
1321+ }
1322+
1323+ return offset;
1324+}
1325+
Harald Weltea36f0ed2010-11-29 22:05:34 +01001326+static guint
1327+dissect_om2k_mo(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree)
1328+{
1329+ proto_item *ti;
1330+ proto_tree *mo_tree;
1331+ guint8 class = tvb_get_guint8(tvb, offset);
1332+ guint8 inst = tvb_get_guint8(tvb, offset+3);
1333+
1334+ ti = proto_tree_add_item(tree, hf_om2k_mo_if, tvb, offset,
1335+ 4, FALSE);
1336+ mo_tree = proto_item_add_subtree(ti, ett_om2k_mo);
1337+ proto_tree_add_item(mo_tree, hf_om2k_mo_class, tvb, offset,
1338+ 1, FALSE);
1339+ proto_tree_add_item(mo_tree, hf_om2k_mo_instance, tvb, offset+3,
1340+ 1, FALSE);
1341+ proto_item_append_text(ti, ", Class: %s, Instance: %u",
1342+ val_to_str(class, om2k_mo_class_vals, "0x%02x"),
1343+ inst);
1344+ col_append_fstr(pinfo->cinfo, COL_INFO, ", (%-4s %u)",
1345+ val_to_str(class, &om2k_mo_class_short_vals,
1346+ "0x%02x"), inst);
1347+ return 4;
1348+}
1349+
Harald Welte0326cd52010-11-29 16:32:47 +01001350+static void
1351+dissect_abis_om2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1352+{
1353+ proto_item *ti;
1354+ proto_tree *om2k_tree;
1355+
1356+ int offset = 0;
1357+
1358+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "OM2000");
1359+
1360+ top_tree = tree;
1361+ if (tree) {
1362+ guint16 msg_code = tvb_get_ntohs(tvb, offset);
Harald Welte0326cd52010-11-29 16:32:47 +01001363+ guint8 tmp;
1364+
1365+ ti = proto_tree_add_item(tree, proto_abis_om2000,
1366+ tvb, 0, -1, FALSE);
1367+ om2k_tree = proto_item_add_subtree(ti, ett_om2000);
1368+
1369+ proto_tree_add_item(om2k_tree, hf_om2k_msg_code, tvb, offset,
1370+ 2, FALSE);
Harald Welte0326cd52010-11-29 16:32:47 +01001371+ offset += 2;
Harald Weltea36f0ed2010-11-29 22:05:34 +01001372+
1373+ offset += dissect_om2k_mo(tvb, offset, pinfo, om2k_tree);
1374+
1375+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s ",
1376+ val_to_str(msg_code, &om2k_msgcode_vals,
1377+ "unknown 0x%04x"));
1378+ proto_item_append_text(ti, " %s ",
1379+ val_to_str(msg_code, &om2k_msgcode_vals,
1380+ "unknown 0x%04x"));
Harald Welte0326cd52010-11-29 16:32:47 +01001381+
1382+ switch (msg_code) {
1383+ case 0x74: /* Operational Info */
1384+ tmp = tvb_get_guint8(tvb, offset+1);
1385+ proto_item_append_text(ti, ": %s",
1386+ val_to_str(tmp, om2k_oip_vals,
1387+ "unknown 0x%02x"));
1388+ break;
1389+ case 0x1A: /* CON Configuration Result */
1390+ case 0x66: /* IS Configuration Result */
1391+ case 0x82: /* RX Configuration Result */
1392+ case 0xA6: /* TF Configuration Result */
1393+ case 0xAE: /* TS Configuration Result */
1394+ case 0xB6: /* TX Configuration Result */
1395+ case 0xE2: /* DP Configuration Result */
1396+ case 0xF6: /* DP Configuration Result */
1397+ tmp = tvb_get_guint8(tvb, offset+1);
1398+ proto_item_append_text(ti, ": %s",
1399+ val_to_str(tmp, om2k_aip_vals,
1400+ "unknown 0x%02x"));
1401+ break;
1402+ default:
1403+ break;
1404+ }
1405+ dissect_om2k_attrs(tvb, offset, pinfo, om2k_tree);
1406+ }
1407+}
1408+
1409+void
1410+proto_reg_handoff_abis_om2000(void);
1411+
1412+void
1413+proto_register_abis_om2000(void)
1414+{
1415+ static hf_register_info hf[] = {
1416+ { &hf_om2k_msg_code,
1417+ { "Message Code", "om2000.msg_code",
1418+ FT_UINT16, BASE_HEX, VALS(om2k_msgcode_vals), 0,
1419+ NULL, HFILL }
1420+ },
1421+ { &hf_om2k_mo_if,
1422+ { "MO Interface", "om2000.mo_if",
1423+ FT_BYTES, BASE_NONE, NULL, 0,
1424+ NULL, HFILL }
1425+ },
1426+ { &hf_om2k_mo_class,
1427+ { "MO IF Class", "om2000.mo_if.class",
1428+ FT_UINT8, BASE_HEX, VALS(om2k_mo_class_vals), 0,
1429+ NULL, HFILL }
1430+ },
Harald Weltea36f0ed2010-11-29 22:05:34 +01001431+ { &hf_om2k_mo_instance,
1432+ { "MO IF Instance", "om2000.mo_if.instance",
1433+ FT_UINT8, BASE_DEC, NULL, 0,
1434+ NULL, HFILL }
1435+ },
Harald Welte0326cd52010-11-29 16:32:47 +01001436+ { &hf_om2k_oip,
1437+ { "OIP (Operational Info)", "om2000.oip",
1438+ FT_UINT8, BASE_HEX, VALS(om2k_oip_vals), 0,
1439+ "Operational Information Parameter", HFILL }
1440+ },
1441+ { &hf_om2k_aip,
1442+ { "AIP (Accordance Info)", "om2000.aip",
1443+ FT_UINT8, BASE_HEX, VALS(om2k_aip_vals), 0,
1444+ "Accordance Information Parameter", HFILL }
1445+ },
1446+ { &hf_om2k_comb,
1447+ { "Channel Combination", "om2000.chan_comb",
1448+ FT_UINT8, BASE_DEC, VALS(om2k_comb_vals), 0,
1449+ "Logical Channel Combination", HFILL }
1450+ },
1451+ { &hf_om2k_ts,
1452+ { "Timeslot Number", "om2000.ts",
1453+ FT_UINT8, BASE_DEC, NULL, 0,
1454+ NULL, HFILL }
1455+ },
1456+ { &hf_om2k_hsn,
1457+ { "HSN", "om2000.hsn",
1458+ FT_UINT8, BASE_DEC, NULL, 0,
1459+ "Hopping Sequence Number", HFILL }
1460+ },
1461+ { &hf_om2k_maio,
1462+ { "MAIO", "om2000.maio",
1463+ FT_UINT8, BASE_DEC, NULL, 0,
1464+ "Mobile Allication Index Offset", HFILL }
1465+ },
1466+ { &hf_om2k_bsic,
1467+ { "BSIC", "om2000.bsic",
1468+ FT_UINT8, BASE_HEX, NULL, 0,
1469+ "Base Station Identity Code", HFILL }
1470+ },
1471+ { &hf_om2k_diversity,
1472+ { "Receiver Diversity", "om2000.diversity",
1473+ FT_UINT8, BASE_HEX, VALS(om2k_diversity_vals), 0,
1474+ NULL, HFILL }
1475+ },
1476+ { &hf_om2k_fn_offs,
1477+ { "FN Offset", "om2000.fn_offset",
1478+ FT_UINT16, BASE_DEC, NULL, 0,
1479+ "GSM Frame Number Offset", HFILL }
1480+ },
1481+ { &hf_om2k_ext_range,
1482+ { "Extended Range", "om2000.ext_range",
1483+ FT_BOOLEAN, 1, NULL, 0,
1484+ NULL, HFILL }
1485+ },
1486+ { &hf_om2k_irc,
1487+ { "Interference Rejection Combining", "om2000.irc",
1488+ FT_BOOLEAN, 1, NULL, 0,
1489+ NULL, HFILL }
1490+ },
1491+ { &hf_om2k_bs_pa_mfrms,
1492+ { "BS_PA_MFRMS", "om2000.bs_pa_mfrms",
1493+ FT_UINT8, BASE_DEC, NULL, 0,
1494+ NULL, HFILL }
1495+ },
1496+ { &hf_om2k_bs_ag_blks_res,
1497+ { "BS_AG_BLKS_RES", "om2000.bs_ag_blks_res",
1498+ FT_UINT8, BASE_DEC, NULL, 0,
1499+ NULL, HFILL }
1500+ },
1501+ { &hf_om2k_drx_dev_max,
1502+ { "DRX_DEV_MAX", "om2000.drx_dev_max",
1503+ FT_UINT8, BASE_DEC, NULL, 0,
1504+ NULL, HFILL }
1505+ },
1506+ { &hf_om2k_cr,
1507+ { "CCCH Repeat", "om2000.ccch_repeat",
1508+ FT_BOOLEAN, 1, NULL, 0,
1509+ NULL, HFILL }
1510+ },
1511+ { &hf_om2k_ipt3,
1512+ { "Inhibit Paging Request Type 3", "om2000.ipt3",
1513+ FT_BOOLEAN, 2, NULL, 0,
1514+ NULL, HFILL }
1515+ },
1516+ { &hf_om2k_aop,
1517+ { "Age Of Paging", "om2000.aop",
1518+ FT_UINT8, BASE_DEC, NULL, 0,
1519+ NULL, HFILL }
1520+ },
1521+ { &hf_om2k_t3105,
1522+ { "T3105 (in 10ms)", "om2000.t3105",
1523+ FT_UINT8, BASE_DEC, NULL, 0,
1524+ NULL, HFILL }
1525+ },
1526+ { &hf_om2k_ny1,
1527+ { "Ny1", "om2000.ny1",
1528+ FT_UINT8, BASE_DEC, NULL, 0,
1529+ NULL, HFILL }
1530+ },
1531+ { &hf_om2k_cbi,
1532+ { "CBCH Indicator", "om2000.ny1",
1533+ FT_BOOLEAN, 1, NULL, 0,
1534+ NULL, HFILL }
1535+ },
1536+ { &hf_om2k_tsc,
1537+ { "Training Sequence Code", "om2000.tsc",
1538+ FT_UINT8, BASE_DEC, NULL, 0,
1539+ NULL, HFILL }
1540+ },
1541+ { &hf_om2k_icm,
1542+ { "Idle Channel Measurement", "om2000.icm",
1543+ FT_BOOLEAN, 1, NULL, 0,
1544+ NULL, HFILL }
1545+ },
1546+ { &hf_om2k_tta,
1547+ { "Timer for Time Alignment", "om2000.tta",
1548+ FT_UINT8, BASE_DEC, NULL, 0,
1549+ NULL, HFILL }
1550+ },
1551+ { &hf_om2k_icm_cr,
1552+ { "ICM Channel Rate", "om2000.icm_cr",
1553+ FT_BOOLEAN, 1, VALS(om2k_icmcr_vals), 0,
1554+ NULL, HFILL }
1555+ },
1556+ { &hf_om2k_lsc_fm,
1557+ { "LSC Dummy Frequency Measurement", "om2000.lsc.fm",
1558+ FT_BOOLEAN, 0x80, NULL, 0,
1559+ NULL, HFILL }
1560+ },
1561+ { &hf_om2k_lsc_lsi,
1562+ { "LSC Idle Channels", "om2000.ls.lsi",
1563+ FT_BOOLEAN, 0x01, NULL, 0,
1564+ NULL, HFILL }
1565+ },
1566+ { &hf_om2k_lsc_lsa,
1567+ { "LSC Active Channels", "om2000.ls.lsa",
1568+ FT_BOOLEAN, 0x02, NULL, 0,
1569+ NULL, HFILL }
1570+ },
1571+ { &hf_om2k_ls_ft,
1572+ { "Link Supervision Filtering Time (100ms)", "om2000.ls_ft",
1573+ FT_UINT8, BASE_DEC, NULL, 0,
1574+ NULL, HFILL }
1575+ },
1576+ { &hf_om2k_cst,
1577+ { "Call Supervision Time (480ms)", "om2000.cst",
1578+ FT_UINT8, BASE_DEC, NULL, 0,
1579+ NULL, HFILL }
1580+ },
1581+ { &hf_om2k_ea,
1582+ { "Encryption Algorithm", "om2000.ea",
1583+ FT_UINT8, BASE_DEC, VALS(om2k_ea_vals), 0,
1584+ NULL, HFILL }
1585+ },
1586+ { &hf_om2k_nom_pwr,
1587+ { "Nominal Power (dBm)", "om2000.pwr",
1588+ FT_UINT8, BASE_DEC, NULL, 0,
1589+ NULL, HFILL }
1590+ },
1591+ { &hf_om2k_fill_mark,
1592+ { "Filling Marker", "om2000.filling",
1593+ FT_BOOLEAN, 0x01, VALS(om2k_fill_vals), 0,
1594+ NULL, HFILL }
1595+ },
1596+ { &hf_om2k_bcc,
1597+ { "BCC", "om2000.bcc",
1598+ FT_UINT8, BASE_DEC, NULL, 0,
1599+ "Base Station Color Code", HFILL }
1600+ },
1601+ { &hf_om2k_mo_state,
1602+ { "MO State", "om2000.mo_state",
1603+ FT_UINT8, BASE_DEC, VALS(om2k_mo_state_vals), 0,
1604+ NULL, HFILL }
1605+ },
1606+ { &hf_om2k_la_state,
1607+ { "Local Access State", "om2000.la_state",
1608+ FT_UINT8, BASE_DEC, VALS(om2k_la_state_vals), 0,
1609+ NULL, HFILL }
1610+ },
1611+ { &hf_om2k_tsn_state,
1612+ { "Time Slot N MO State", "om2000.tsn_mo_state",
1613+ FT_UINT8, BASE_DEC, VALS(om2k_mo_state_vals), 0,
1614+ NULL, HFILL }
1615+ },
1616+ { &hf_om2k_bts_manuf,
1617+ { "BTS Manufacturer ID", "om2000.bts_ver.manuf",
1618+ FT_STRING, BASE_NONE, NULL, 0,
1619+ NULL, HFILL }
1620+ },
1621+ { &hf_om2k_bts_gen,
1622+ { "BTS Generation", "om2000.bts_ver.gen",
1623+ FT_STRING, BASE_NONE, NULL, 0,
1624+ NULL, HFILL }
1625+ },
1626+ { &hf_om2k_bts_rev,
1627+ { "BTS Revision", "om2000.bts_ver.rev",
1628+ FT_STRING, BASE_NONE, NULL, 0,
1629+ NULL, HFILL }
1630+ },
1631+ { &hf_om2k_bts_var,
1632+ { "BTS Variant", "om2000.bts_ver.variant",
1633+ FT_STRING, BASE_NONE, NULL, 0,
1634+ NULL, HFILL }
1635+ },
1636+ { &hf_om2k_brr,
1637+ { "BTS Requested Restart", "om2000.brr",
1638+ FT_BOOLEAN, 0x01, NULL, 0,
1639+ NULL, HFILL }
1640+ },
1641+ { &hf_om2k_bfr,
1642+ { "BTS Requested File Relation", "om2000.bfr",
1643+ FT_BOOLEAN, 0x01, NULL, 0,
1644+ NULL, HFILL }
1645+ },
1646+ { &hf_om2k_hwinfo_sig,
1647+ { "HW Info Signature", "om2000.hwinfo_sig",
1648+ FT_UINT16, BASE_HEX, NULL, 0,
1649+ NULL, HFILL }
1650+ },
1651+ { &hf_om2k_capa_sig,
1652+ { "Capabilities Signature", "om2000.capa_sig",
1653+ FT_UINT16, BASE_HEX, NULL, 0,
1654+ NULL, HFILL }
1655+ },
1656+
1657+ { &hf_om2k_unknown_tag,
Harald Weltea36f0ed2010-11-29 22:05:34 +01001658+ { "Unknown Tag", "om2000.unknown.tag",
Harald Welte0326cd52010-11-29 16:32:47 +01001659+ FT_UINT8, BASE_HEX, NULL, 0,
1660+ NULL, HFILL }
1661+ },
Harald Weltea36f0ed2010-11-29 22:05:34 +01001662+ { &hf_om2k_unknown_val,
1663+ { "Unknown Value", "om2000.unknown.val",
1664+ FT_BYTES, BASE_NONE, NULL, 0,
1665+ NULL, HFILL }
1666+ },
1667+
Harald Welte0326cd52010-11-29 16:32:47 +01001668+ { &hf_om2k_file_rev,
1669+ { "File Revision", "om2000.file_rev",
1670+ FT_STRING, BASE_NONE, NULL, 0,
1671+ NULL, HFILL }
1672+ },
1673+ { &hf_om2k_filerel_ilr,
1674+ { "Immediate Load Requested", "om2000.filerel.ilr",
1675+ FT_BOOLEAN, 0x08, NULL, 0,
1676+ NULL, HFILL }
1677+ },
1678+ { &hf_om2k_filerel_cur,
1679+ { "Current State", "om2000.filerel.cur",
1680+ FT_UINT8, BASE_HEX, VALS(filerel_state_vals), 0x07,
1681+ NULL, HFILL }
1682+ },
1683+ { &hf_om2k_filerel_other,
1684+ { "Other State", "om2000.filerel.other",
1685+ FT_UINT8, BASE_HEX, VALS(filerel_state_vals), 0x07,
1686+ NULL, HFILL }
1687+ },
1688+ { &hf_om2k_cal_time,
1689+ { "Calendar Time", "om2000.cal_time",
1690+ FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
1691+ NULL, HFILL }
1692+ },
1693+ { &hf_om2k_list_nr,
1694+ { "List Number", "om2000.list_nr",
1695+ FT_UINT8, BASE_DEC, NULL, 0,
1696+ NULL, HFILL }
1697+ },
1698+ { &hf_om2k_list_nr_end,
1699+ { "End List Number", "om2000.list_nr_end",
1700+ FT_UINT8, BASE_DEC, NULL, 0,
1701+ NULL, HFILL }
1702+ },
Harald Weltea36f0ed2010-11-29 22:05:34 +01001703+ { &hf_om2k_isl,
1704+ { "IS Connection List", "om2000.is_list",
1705+ FT_BYTES, BASE_NONE, NULL, 0,
1706+ NULL, HFILL }
1707+ },
1708+ { &hf_om2k_isl_icp1,
1709+ { "ICP1", "om2000.is_list.icp1",
1710+ FT_UINT16, BASE_DEC, NULL, 0x7ff,
1711+ NULL, HFILL }
1712+ },
1713+ { &hf_om2k_isl_icp2,
1714+ { "ICP2", "om2000.is_list.icp2",
1715+ FT_UINT16, BASE_DEC, NULL, 0x7ff,
1716+ NULL, HFILL }
1717+ },
1718+ { &hf_om2k_isl_ci,
1719+ { "Contiguity Index", "om2000.is_list.ci",
1720+ FT_UINT8, BASE_DEC, NULL, 0,
1721+ NULL, HFILL }
1722+ },
1723+ { &hf_om2k_conl,
1724+ { "Connection List", "om2000.con_list",
1725+ FT_BYTES, BASE_NONE, NULL, 0,
1726+ NULL, HFILL }
1727+ },
1728+ { &hf_om2k_conl_nr_cgs,
1729+ { "Number of CGs", "om2000.con_list.nr_cgs",
1730+ FT_UINT8, BASE_DEC, NULL, 0x1f,
1731+ "Number of Concentration Groups in the DE", HFILL }
1732+ },
1733+ { &hf_om2k_conl_nr_cps_cg,
1734+ { "Number of CPS in CG", "om2000.con_list.nr_cps_cg",
1735+ FT_UINT8, BASE_DEC, NULL, 0x1f,
1736+ "Number of CPS in Concentration Group", HFILL }
1737+ },
1738+ { &hf_om2k_conl_ccp,
1739+ { "CON Connection Point", "om2000.con_list.cpp",
1740+ FT_UINT16, BASE_DEC, NULL, 0x3ff,
1741+ NULL, HFILL }
1742+ },
1743+ { &hf_om2k_conl_ci,
1744+ { "Contiguity Index", "om2000.con_list.ci",
1745+ FT_UINT8, BASE_DEC, NULL, 0x7,
1746+ NULL, HFILL }
1747+ },
1748+ { &hf_om2k_conl_tag,
1749+ { "Tag", "om2000.con_list.tag",
1750+ FT_UINT8, BASE_DEC, NULL, 0x1f,
1751+ NULL, HFILL }
1752+ },
1753+ { &hf_om2k_conl_tei,
1754+ { "TEI", "om2000.con_list.tei",
1755+ FT_UINT8, BASE_DEC, NULL, 0,
1756+ NULL, HFILL }
1757+ },
1758+ { &hf_om2k_tf_mode,
1759+ { "TF Mode", "om2000.tf_mode",
1760+ FT_UINT8, BASE_HEX, VALS(om2k_tf_mode_vals), 0,
1761+ NULL, HFILL }
1762+ },
1763+ { &hf_om2k_tf_fs_offset,
1764+ { "TF FS Offset", "om2000.tf_fs_offset",
1765+ FT_UINT64, BASE_DEC, NULL, 0,
1766+ NULL, HFILL }
1767+ },
Harald Welte0326cd52010-11-29 16:32:47 +01001768+ };
1769+ static gint *ett[] = {
1770+ &ett_om2000,
Harald Weltea36f0ed2010-11-29 22:05:34 +01001771+ &ett_om2k_mo,
1772+ &ett_om2k_isl,
1773+ &ett_om2k_conl,
Harald Welte0326cd52010-11-29 16:32:47 +01001774+ };
1775+
1776+ module_t *oml_module;
1777+
1778+ proto_abis_om2000 = proto_register_protocol("Ericsson A-bis OML",
1779+ "Ericsson OML",
1780+ "gsm_abis_om2000");
1781+
1782+ proto_register_field_array(proto_abis_om2000, hf, array_length(hf));
1783+
1784+ proto_register_subtree_array(ett, array_length(ett));
1785+
1786+ register_dissector("gsm_abis_om2000", dissect_abis_om2000,
1787+ proto_abis_om2000);
1788+#if 0
1789+ oml_module = prefs_register_protocol(proto_abis_oml, proto_reg_handoff_abis_oml);
1790+ prefs_register_bool_preference(oml_module, "use_ipaccess_oml",
1791+ "Use nanoBTS definitions",
1792+ "Use ipaccess nanoBTS specific definitions for OML",
1793+ &global_oml_use_nano_bts);
1794+#endif
1795+}
1796+
1797+/* This function is called once at startup and every time the user hits
1798+ * 'apply' in the preferences dialogue */
1799+void
1800+proto_reg_handoff_abis_om2000(void)
1801+{
1802+ static gboolean initialized = FALSE;
1803+
1804+ if (!initialized) {
1805+ dissector_handle_t abis_om2k_handle;
1806+
1807+ abis_om2k_handle = create_dissector_handle(dissect_abis_om2000,
1808+ proto_abis_om2000);
1809+ //dissector_add("lapd.gsm.sapi", LAPD_GSM_SAPI_OM_PROC, abis_oml_handle);
1810+ } else {
1811+ /* preferences have been changed */
1812+ }
1813+}
Harald Welte7c78c472011-09-06 21:09:05 +02001814Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
1815===================================================================
1816--- wireshark.orig/epan/dissectors/packet-gsm_abis_oml.c 2011-09-06 13:37:42.000000000 +0200
1817+++ wireshark/epan/dissectors/packet-gsm_abis_oml.c 2011-09-06 13:56:14.000000000 +0200
1818@@ -119,9 +119,12 @@
Harald Welte0326cd52010-11-29 16:32:47 +01001819
1820 /* Decode things as nanoBTS traces */
1821 static gboolean global_oml_use_nano_bts = TRUE;
1822+static gboolean global_oml_use_ericsson = TRUE;
1823
1824 static proto_tree *top_tree;
1825
1826+static dissector_handle_t sub_om2000;
1827+
1828 /* TS 12.21 Chapter 8.1 / TS 08.59 */
1829 static const value_string oml_msg_disc_vals[] = {
1830 { ABIS_OM_MDISC_FOM, "Formatted O&M" },
Harald Welte7c78c472011-09-06 21:09:05 +02001831@@ -1161,6 +1164,7 @@
Harald Welte0326cd52010-11-29 16:32:47 +01001832 top_tree = tree;
1833 if (tree) {
1834 u_int8_t msg_disc = tvb_get_guint8(tvb, offset);
1835+ u_int8_t len = tvb_get_guint8(tvb, offset+3);
1836
1837 ti = proto_tree_add_item(tree, proto_abis_oml, tvb, 0, -1, FALSE);
1838 oml_tree = proto_item_add_subtree(ti, ett_oml);
Harald Welte7c78c472011-09-06 21:09:05 +02001839@@ -1174,6 +1178,14 @@
Harald Welte0326cd52010-11-29 16:32:47 +01001840 proto_tree_add_item(oml_tree, hf_oml_length, tvb, offset++,
1841 1, TRUE);
1842
1843+ if (global_oml_use_ericsson == TRUE) {
1844+ tvbuff_t *subtvb;
1845+ subtvb = tvb_new_subset(tvb, offset, len, len);
1846+
1847+ if (sub_om2000)
1848+ call_dissector(sub_om2000, subtvb, pinfo, tree);
1849+ } else {
1850+
1851 switch (msg_disc) {
1852 case ABIS_OM_MDISC_FOM:
1853 offset = dissect_oml_fom(tvb, pinfo, oml_tree,
Harald Welte7c78c472011-09-06 21:09:05 +02001854@@ -1187,6 +1199,8 @@
Harald Welte0326cd52010-11-29 16:32:47 +01001855 default:
1856 break;
1857 }
1858+
1859+ }
1860 }
1861 }
1862
Harald Welte7c78c472011-09-06 21:09:05 +02001863@@ -1696,6 +1710,11 @@
Harald Welte0326cd52010-11-29 16:32:47 +01001864 "Use nanoBTS definitions",
1865 "Use ipaccess nanoBTS specific definitions for OML",
1866 &global_oml_use_nano_bts);
1867+
1868+ prefs_register_bool_preference(oml_module, "use_ericsson_oml",
1869+ "Use Ericsson definitions",
1870+ "Use Ericsson A-bis OML (OM2000) definitions for OML",
1871+ &global_oml_use_ericsson);
1872 }
1873
1874 /* This function is called once at startup and every time the user hits
Harald Welte7c78c472011-09-06 21:09:05 +02001875@@ -1732,4 +1751,6 @@
Harald Welte0326cd52010-11-29 16:32:47 +01001876 oml_fom_attr_vse._vs_num_entries =
1877 array_length(oml_fom_attr_vals_bs11)-1;
1878 }
1879+
1880+ sub_om2000 = find_dissector("gsm_abis_om2000");
1881 }
Harald Welte7c78c472011-09-06 21:09:05 +02001882Index: wireshark/epan/dissectors/packet-l2tp.c
1883===================================================================
1884--- wireshark.orig/epan/dissectors/packet-l2tp.c 2011-09-06 13:37:42.000000000 +0200
1885+++ wireshark/epan/dissectors/packet-l2tp.c 2011-09-06 13:37:48.000000000 +0200
1886@@ -148,6 +148,7 @@
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +01001887 #define L2TPv3_PROTOCOL_AAL5 6
1888 #define L2TPv3_PROTOCOL_LAPD 7
1889 #define L2TPv3_PROTOCOL_DOCSIS_DMPT 8
1890+#define L2TPv3_PROTOCOL_ERICSSON 9
1891
1892 static enum_val_t l2tpv3_protocols[] = {
1893 {"eth", "Ethernet", L2TPv3_PROTOCOL_ETH},
Harald Welte7c78c472011-09-06 21:09:05 +02001894@@ -159,6 +160,7 @@
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +01001895 {"aal5", "AAL5", L2TPv3_PROTOCOL_AAL5},
1896 {"lapd", "LAPD", L2TPv3_PROTOCOL_LAPD},
1897 {"docsis-dmpt", "DOCSIS-DMPT", L2TPv3_PROTOCOL_DOCSIS_DMPT},
1898+ {"ehdlc", "Ericsson HDLC", L2TPv3_PROTOCOL_ERICSSON},
1899 {NULL, NULL, 0}
1900 };
1901
Harald Welte7c78c472011-09-06 21:09:05 +02001902@@ -583,6 +585,7 @@
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +01001903 static dissector_handle_t llc_handle;
1904 static dissector_handle_t lapd_handle;
1905 static dissector_handle_t mp2t_handle;
1906+static dissector_handle_t ehdlc_handle;
1907 static dissector_handle_t data_handle;
1908
1909 /*
Harald Welte7c78c472011-09-06 21:09:05 +02001910@@ -1495,6 +1498,9 @@
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +01001911 case L2TPv3_PROTOCOL_LAPD:
1912 call_dissector(lapd_handle, next_tvb, pinfo, tree);
1913 break;
1914+ case L2TPv3_PROTOCOL_ERICSSON:
1915+ call_dissector(ehdlc_handle, next_tvb, pinfo, tree);
1916+ break;
1917 default:
1918 call_dissector(data_handle, next_tvb, pinfo, tree);
1919 break;
Harald Welte7c78c472011-09-06 21:09:05 +02001920@@ -2167,5 +2173,6 @@
Holger Hans Peter Freyther9b5f1d72011-01-11 16:33:52 +01001921 llc_handle = find_dissector("llc");
1922 lapd_handle = find_dissector("lapd");
1923 mp2t_handle = find_dissector("mp2t");
1924+ ehdlc_handle = find_dissector("ehdlc");
1925 data_handle = find_dissector("data");
1926 }