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