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