aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gsm_abis_om2000.c
blob: f49301369f0111d53d363d8b8f158ca628f3921a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
/* packet-abis_om2000.c
 * Routines for packet dissection of Ericsson A-bis OML (OM 2000)
 * Copyright 2010-2012 by Harald Welte <laforge@gnumonks.org>
 *
 * This dissector is not 100% complete, i.e. there are a number of FIXMEs
 * indicating where portions of the protocol are not dissected completely.
 * However, even a partial protocol decode is much more useful than no protocol
 * decode at all...
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#include "config.h"

#include <glib.h>

#include <epan/packet.h>
#include <epan/emem.h>
#include <epan/lapd_sapi.h>

#include "packet-gsm_a_common.h"

#include <stdio.h>

void proto_register_abis_om2000(void);

/* initialize the protocol and registered fields */
static int proto_abis_om2000 = -1;

static int hf_om2k_msg_code = -1;
static int hf_om2k_mo_if = -1;
static int hf_om2k_mo_class = -1;
static int hf_om2k_mo_sub1 = -1;
static int hf_om2k_mo_sub2 = -1;
static int hf_om2k_mo_instance = -1;

static int hf_om2k_aip = -1;
static int hf_om2k_oip = -1;
static int hf_om2k_comb = -1;
static int hf_om2k_ts = -1;
static int hf_om2k_hsn = -1;
static int hf_om2k_maio = -1;
static int hf_om2k_bsic = -1;
static int hf_om2k_diversity = -1;
static int hf_om2k_fn_offs = -1;
static int hf_om2k_ext_range = -1;
static int hf_om2k_irc = -1;
static int hf_om2k_bs_pa_mfrms = -1;
static int hf_om2k_bs_ag_blks_res= -1;
static int hf_om2k_drx_dev_max = -1;
static int hf_om2k_cr = -1;
static int hf_om2k_ipt3 = -1;
static int hf_om2k_aop = -1;
static int hf_om2k_t3105 = -1;
static int hf_om2k_ny1 = -1;
static int hf_om2k_cbi = -1;
static int hf_om2k_tsc = -1;
static int hf_om2k_icm = -1;
static int hf_om2k_tta = -1;
static int hf_om2k_icm_cr = -1;
static int hf_om2k_lsc_fm = -1;
static int hf_om2k_lsc_lsi = -1;
static int hf_om2k_lsc_lsa = -1;
static int hf_om2k_ls_ft = -1;
static int hf_om2k_cst = -1;
static int hf_om2k_ea = -1;
static int hf_om2k_unknown_tag = -1;
static int hf_om2k_unknown_val = -1;
static int hf_om2k_nom_pwr = -1;
static int hf_om2k_fill_mark = -1;
static int hf_om2k_bcc = -1;
static int hf_om2k_mo_state = -1;
static int hf_om2k_la_state = -1;
static int hf_om2k_tsn_state = -1;
static int hf_om2k_bts_manuf = -1;
static int hf_om2k_bts_gen = -1;
static int hf_om2k_bts_rev = -1;
static int hf_om2k_bts_var = -1;
static int hf_om2k_brr = -1;
static int hf_om2k_bfr = -1;
static int hf_om2k_hwinfo_sig = -1;
static int hf_om2k_capa_sig = -1;
static int hf_om2k_file_rev = -1;
static int hf_om2k_filerel_ilr = -1;
static int hf_om2k_filerel_cur = -1;
static int hf_om2k_filerel_other = -1;
static int hf_om2k_cal_time = -1;
static int hf_om2k_list_nr = -1;
static int hf_om2k_list_nr_end = -1;
static int hf_om2k_isl = -1;
static int hf_om2k_isl_icp1 = -1;
static int hf_om2k_isl_icp2 = -1;
static int hf_om2k_isl_ci = -1;
static int hf_om2k_conl = -1;
static int hf_om2k_conl_nr_cgs = -1;
static int hf_om2k_conl_nr_cps_cg = -1;
static int hf_om2k_conl_ccp = -1;
static int hf_om2k_conl_ci = -1;
static int hf_om2k_conl_tag = -1;
static int hf_om2k_conl_tei = -1;
static int hf_om2k_tf_mode = -1;
static int hf_om2k_tf_fs_offset = -1;

/* initialize the subtree pointers */
static int ett_om2000 = -1;
static int ett_om2k_mo = -1;
static int ett_om2k_isl = -1;
static int ett_om2k_conl = -1;

static const value_string om2k_msgcode_vals[] = {
	{ 0x0000, "Abort SP Command" },
	{ 0x0002, "Abort SP Complete" },
	{ 0x0004, "Alarm Report ACK" },
	{ 0x0005, "Alarm Report NACK" },
	{ 0x0006, "Alarm Report" },
	{ 0x0008, "Alarm Status Request" },
	{ 0x000a, "Alarm Status Request Accept" },
	{ 0x000b, "Alarm Status Request Reject" },
	{ 0x000c, "Alarm Status Result ACK" },
	{ 0x000d, "Alarm Status Result NACK" },
	{ 0x000e, "Alarm Status Result" },
	{ 0x0010, "Calendar Time Response" },
	{ 0x0011, "Calendar Time Reject" },
	{ 0x0012, "Calendar Time Request" },
	{ 0x0014, "CON Configuration Request" },
	{ 0x0016, "CON Configuration Request Accept" },
	{ 0x0017, "CON Configuration Request Reject" },
	{ 0x0018, "CON Configuration Result ACK" },
	{ 0x0019, "CON Configuration Result NACK" },
	{ 0x001a, "CON Configuration Result" },
	{ 0x001c, "Connect Command" },
	{ 0x001e, "Connect Complete" },
	{ 0x001f, "Connect Rejecte" },
	{ 0x0028, "Disable Request" },
	{ 0x002a, "Disable Request Accept" },
	{ 0x002b, "Disable Request Reject" },
	{ 0x002c, "Disable Result ACK" },
	{ 0x002d, "Disable Result NACK" },
	{ 0x002e, "Disable Result" },
	{ 0x0030, "Disconnect Command" },
	{ 0x0032, "Disconnect Complete" },
	{ 0x0033, "Disconnect Reject" },
	{ 0x0034, "Enable Request" },
	{ 0x0036, "Enable Request Accept" },
	{ 0x0037, "Enable Request Reject" },
	{ 0x0038, "Enable Result ACK" },
	{ 0x0039, "Enable Result NACK" },
	{ 0x003a, "Enable Result" },
	{ 0x003c, "Escape Downlink Normal" },
	{ 0x003d, "Escape Downlink NACK" },
	{ 0x003e, "Escape Uplink Normal" },
	{ 0x003f, "Escape Uplink NACK" },
	{ 0x0040, "Fault Report ACK" },
	{ 0x0041, "Fault Report NACK" },
	{ 0x0042, "Fault Report" },
	{ 0x0044, "File Package End Command" },
	{ 0x0046, "File Package End Result" },
	{ 0x0047, "File Package End Reject" },
	{ 0x0048, "File Relation Request" },
	{ 0x004a, "File Relation Response" },
	{ 0x004b, "File Relation Request Reject" },
	{ 0x004c, "File Segment Transfer" },
	{ 0x004e, "File Segment Transfer Complete" },
	{ 0x004f, "File Segment Transfer Reject" },
	{ 0x0050, "HW Information Request" },
	{ 0x0052, "HW Information Request Accept" },
	{ 0x0053, "HW Information Request Reject" },
	{ 0x0054, "HW Information Result ACK" },
	{ 0x0055, "HW Information Result NACK" },
	{ 0x0056, "HW Information Result" },
	{ 0x0060, "IS Configuration Request" },
	{ 0x0062, "IS Configuration Request Accept" },
	{ 0x0063, "IS Configuration Request Reject" },
	{ 0x0064, "IS Configuration Result ACK" },
	{ 0x0065, "IS Configuration Result NACK" },
	{ 0x0066, "IS Configuration Result" },
	{ 0x0068, "Load Data End" },
	{ 0x006a, "Load Data End Result" },
	{ 0x006b, "Load Data End Reject" },
	{ 0x006c, "Load Data Init" },
	{ 0x006e, "Load Data Init Accept" },
	{ 0x006f, "Load Data Init Reject" },
	{ 0x0070, "Loop Control Command" },
	{ 0x0072, "Loop Control Complete" },
	{ 0x0073, "Loop Control Reject" },
	{ 0x0074, "Operational Information" },
	{ 0x0076, "Operational Information Accept" },
	{ 0x0077, "Operational Information Reject" },
	{ 0x0078, "Reset Command" },
	{ 0x007a, "Reset Complete" },
	{ 0x007b, "Reset Reject" },
	{ 0x007c, "RX Configuration Request" },
	{ 0x007e, "RX Configuration Request Accept" },
	{ 0x007f, "RX Configuration Request Reject" },
	{ 0x0080, "RX Configuration Result ACK" },
	{ 0x0081, "RX Configuration Result NACK" },
	{ 0x0082, "RX Configuration Result" },
	{ 0x0084, "Start Request" },
	{ 0x0086, "Start Request Accept" },
	{ 0x0087, "Start Request Reject" },
	{ 0x0088, "Start Result ACK" },
	{ 0x0089, "Start Result NACK" },
	{ 0x008a, "Start Result" },
	{ 0x008c, "Status Request" },
	{ 0x008e, "Status Response" },
	{ 0x008f, "Status Reject" },
	{ 0x0094, "Test Request" },
	{ 0x0096, "Test Request Accept" },
	{ 0x0097, "Test Request Reject" },
	{ 0x0098, "Test Result ACK" },
	{ 0x0099, "Test Result NACK" },
	{ 0x009a, "Test Result" },
	{ 0x00a0, "TF Configuration Request" },
	{ 0x00a2, "TF Configuration Request Accept" },
	{ 0x00a3, "TF Configuration Request Reject" },
	{ 0x00a4, "TF Configuration Result ACK" },
	{ 0x00a5, "TF Configuration Result NACK" },
	{ 0x00a6, "TF Configuration Result" },
	{ 0x00a8, "TS Configuration Request" },
	{ 0x00aa, "TS Configuration Request Accept" },
	{ 0x00ab, "TS Configuration Request Reject" },
	{ 0x00ac, "TS Configuration Result ACK" },
	{ 0x00ad, "TS Configuration Result NACK" },
	{ 0x00ae, "TS Configuration Result" },
	{ 0x00b0, "TX Configuration Request" },
	{ 0x00b2, "TX Configuration Request Accept" },
	{ 0x00b3, "TX Configuration Request Reject" },
	{ 0x00b4, "TX Configuration Result ACK" },
	{ 0x00b5, "TX Configuration Result NACK" },
	{ 0x00b6, "TX Configuration Result" },
	{ 0x00bc, "DIP Alarm Report ACK" },
	{ 0x00bd, "DIP Alarm Report NACK" },
	{ 0x00be, "DIP Alarm Report" },
	{ 0x00c0, "DIP Alarm Status Request" },
	{ 0x00c2, "DIP Alarm Status Response" },
	{ 0x00c3, "DIP Alarm Status Reject" },
	{ 0x00c4, "DIP Quality Report I ACK" },
	{ 0x00c5, "DIP Quality Report I NACK" },
	{ 0x00c6, "DIP Quality Report I" },
	{ 0x00c8, "DIP Quality Report II ACK" },
	{ 0x00c9, "DIP Quality Report II NACK" },
	{ 0x00ca, "DIP Quality Report II" },
	{ 0x00dc, "DP Configuration Request" },
	{ 0x00de, "DP Configuration Request Accept" },
	{ 0x00df, "DP Configuration Request Reject" },
	{ 0x00e0, "DP Configuration Result ACK" },
	{ 0x00e1, "DP Configuration Result NACK" },
	{ 0x00e2, "DP Configuration Result" },
	{ 0x00e4, "Capabilities HW Info Report ACK" },
	{ 0x00e5, "Capabilities HW Info Report NACK" },
	{ 0x00e6, "Capabilities HW Info Report" },
	{ 0x00e8, "Capabilities Request" },
	{ 0x00ea, "Capabilities Request Accept" },
	{ 0x00eb, "Capabilities Request Reject" },
	{ 0x00ec, "Capabilities Result ACK" },
	{ 0x00ed, "Capabilities Result NACK" },
	{ 0x00ee, "Capabilities Result" },
	{ 0x00f0, "FM Configuration Request" },
	{ 0x00f2, "FM Configuration Request Accept" },
	{ 0x00f3, "FM Configuration Request Reject" },
	{ 0x00f4, "FM Configuration Result ACK" },
	{ 0x00f5, "FM Configuration Result NACK" },
	{ 0x00f6, "FM Configuration Result" },
	{ 0x00f8, "FM Report Request" },
	{ 0x00fa, "FM Report Response" },
	{ 0x00fb, "FM Report Reject" },
	{ 0x00fc, "FM Start Command" },
	{ 0x00fe, "FM Start Complete" },
	{ 0x00ff, "FM Start Reject" },
	{ 0x0100, "FM Stop Command" },
	{ 0x0102, "FM Stop Complete" },
	{ 0x0103, "FM Stop Reject" },
	{ 0x0104, "Negotiation Request ACK" },
	{ 0x0105, "Negotiation Request NACK" },
	{ 0x0106, "Negotiation Request" },
	{ 0x0108, "BTS Initiated Request ACK" },
	{ 0x0109, "BTS Initiated Request NACK" },
	{ 0x010a, "BTS Initiated Request" },
	{ 0x010c, "Radio Channels Release Command" },
	{ 0x010e, "Radio Channels Release Complete" },
	{ 0x010f, "Radio Channels Release Reject" },
	{ 0x0118, "Feature Control Command" },
	{ 0x011a, "Feature Control Complete" },
	{ 0x011b, "Feature Control Reject" },

	{ 0, NULL }
};
static value_string_ext om2k_msgcode_vals_ext = VALUE_STRING_EXT_INIT(om2k_msgcode_vals);

/* TS 12.21 Section 9.4: Attributes */
static const value_string om2k_attr_vals[] = {
	{ 0x00, "Accordance indication" },
	{ 0x01, "Alarm Id" },
	{ 0x02, "Alarm Data" },
	{ 0x03, "Alarm Severity" },
	{ 0x04, "Alarm Status" },
	{ 0x05, "Alarm Status Type" },
	{ 0x06, "BCC" },
	{ 0x07, "BS_AG_BKS_RES" },
	{ 0x09, "BSIC" },
	{ 0x0a, "BA_PA_MFRMS" },
	{ 0x0b, "CBCH Indicator" },
	{ 0x0c, "CCCH Options" },
	{ 0x0d, "Calendar Time" },
	{ 0x0f, "Channel Combination" },
	{ 0x10, "CON Connection List" },
	{ 0x11, "Data End Indication" },
	{ 0x12, "DRX_DEV_MAX" },
	{ 0x13, "End List Number" },
	{ 0x14, "External Condition Map Class 1" },
	{ 0x15, "External Condition Map Class 2" },
	{ 0x16, "File Relation Indication" },
	{ 0x17, "File Revision" },
	{ 0x18, "File Segment Data" },
	{ 0x19, "File Segment Length" },
	{ 0x1a, "File Segment Sequence Number" },
	{ 0x1b, "File Size" },
	{ 0x1c, "Filling Marker" },
	{ 0x1d, "FN Offset" },
	{ 0x1e, "Frequency List" },
	{ 0x1f, "Frequency Specifier RX" },
	{ 0x20, "Frequency Specifier TX" },
	{ 0x21, "HSN" },
	{ 0x22, "ICM Indicator" },
	{ 0x23, "Internal Fault Map Class 1A" },
	{ 0x24, "Internal Fault Map Class 1B" },
	{ 0x25, "Internal Fault Map Class 2A" },
	{ 0x26, "Internal Fault Map Class 2A Extension" },
	{ 0x27, "IS Connection List" },
	{ 0x28, "List Number" },
	{ 0x29, "File Package State Indication" },
	{ 0x2a, "Local Access State" },
	{ 0x2b, "MAIO" },
	{ 0x2c, "MO State" },
	{ 0x2d, "Ny1" },
	{ 0x2e, "Operational Information" },
	{ 0x2f, "Power" },
	{ 0x30, "RU Position Data" },
	{ 0x31, "Protocol Error" },
	{ 0x32, "Reason Code" },
	{ 0x33, "Receiver Diversity" },
	{ 0x34, "Replacement Unit Map" },
	{ 0x35, "Result Code" },
	{ 0x36, "RU Revision Data" },
	{ 0x38, "T3105" },
	{ 0x39, "Test Loop Setting" },
	{ 0x3a, "TF Mode" },
	{ 0x3b, "TF Compensation Value" },
	{ 0x3c, "Time Slot Number" },
	{ 0x3d, "TSC" },
	{ 0x3e, "RU Logical Id" },
	{ 0x3f, "RU Serial Number Data" },
	{ 0x40, "BTS Version" },
	{ 0x41, "OML IWD Version" },
	{ 0x42, "RWL IWD Version" },
	{ 0x43, "OML Function Map 1" },
	{ 0x44, "OML Function Map 2" },
	{ 0x45, "RSL Function Map 1" },
	{ 0x46, "RSL Function Map 2" },
	{ 0x47, "Extended Range Indicator" },
	{ 0x48, "Request Indicators" },
	{ 0x49, "DIP Alarm Condition Map" },
	{ 0x4a, "ES Incoming" },
	{ 0x4b, "ES Outgoing" },
	{ 0x4e, "SES Incoming" },
	{ 0x4f, "SES Outgoing" },
	{ 0x50, "Replacement Unit Map Extension" },
	{ 0x52, "UAS Incoming" },
	{ 0x53, "UAS Outgoing" },
	{ 0x58, "DF Incoming" },
	{ 0x5a, "DF Outgoing" },
	{ 0x5c, "SF" },
	{ 0x60, "S Bits Setting" },
	{ 0x61, "CRC-4 Use Option" },
	{ 0x62, "T Parameter" },
	{ 0x63, "N Parameter" },
	{ 0x64, "N1 Parameter" },
	{ 0x65, "N3 Parameter" },
	{ 0x66, "N4 Parameter" },
	{ 0x67, "P Parameter" },
	{ 0x68, "Q Parameter" },
	{ 0x69, "BI_Q1" },
	{ 0x6a, "BI_Q2" },
	{ 0x74, "ICM Boundary Parameters" },
	{ 0x77, "AFT" },
	{ 0x78, "AFT RAI" },
	{ 0x79, "Link Supervision Control" },
	{ 0x7a, "Link Supervision Filtering Time" },
	{ 0x7b, "Call Supervision Time" },
	{ 0x7c, "Interval Length UAS Incoming" },
	{ 0x7d, "Interval Length UAS Outgoing" },
	{ 0x7e, "ICM Channel Rate" },
	{ 0x7f, "Attribute Identifier" },
	{ 0x80, "FM Frequency List" },
	{ 0x81, "FM Frequency Report" },
	{ 0x82, "FM Percentile" },
	{ 0x83, "FM Clear Indication" },
	{ 0x84, "HW Info Signature" },
	{ 0x85, "MO Record" },
	{ 0x86, "TF Synchronisation Source" },
	{ 0x87, "TTA" },
	{ 0x88, "End Segment Number" },
	{ 0x89, "Segment Number" },
	{ 0x8a, "Capabilities Signature" },
	{ 0x8c, "File Relation List" },
	{ 0x90, "Negotiation Record I" },
	{ 0x91, "Negotiation Record II" },
	{ 0x92, "Encryption Algorithm" },
	{ 0x94, "Interference Rejection Combining" },
	{ 0x95, "Dedication Information" },
	{ 0x97, "Feature Code" },
	{ 0x98, "FS Offset" },
	{ 0x99, "ESB Timeslot" },
	{ 0x9a, "Master TG Instance" },
	{ 0x9b, "Master TX Chain Delay" },
	{ 0x9c, "External Condition Class 2 Extension" },
	{ 0x9d, "TSs MO State" },
	{ 0, NULL }
};
static value_string_ext om2k_attr_vals_ext = VALUE_STRING_EXT_INIT(om2k_attr_vals);

static const value_string om2k_diversity_vals[] = {
	{ 0x01, "B receiver side" },
	{ 0x02, "A receiver side" },
	{ 0x03, "A+B receiver sides" },
	{ 0x04, "A+B+C+D receiver sides" },
	{ 0, NULL }
};

static const value_string om2k_oip_vals[] = {
	{ 0x00, "Not Operational" },
	{ 0x01, "Operational" },
	{ 0, NULL }
};

static const value_string om2k_aip_vals[] = {
	{ 0x00, "Data according to request" },
	{ 0x01, "Data not according to request" },
	{ 0x02, "Inconsistent MO data" },
	{ 0x03, "Capability constraint violation" },
	{ 0, NULL }
};

static const value_string om2k_comb_vals[] = {
	{ 0x03, "SDCCH/8 + SACCH/C8" },
	{ 0x04, "BCCH, non-combined" },
	{ 0x05, "BCCH, combined (SDCCH/4)" },
	{ 0x08, "TCH Type, unspecified" },
	{ 0, NULL }
};

static const value_string om2k_icmcr_vals[] = {
	{ 0x00, "ICM as per TCH/F" },
	{ 0x01, "ICM as per TCH/H(0 and 1)" },
	{ 0, NULL }
};

static const value_string om2k_ea_vals[] = {
	{ 0x00, "A5/1 and A5/2" },
	{ 0x01, "A5/2 only" },
	{ 0, NULL }
};

static const value_string om2k_fill_vals[] = {
	{ 0x00, "Filling" },
	{ 0x01, "No filling" },
	{ 0, NULL }
};

static const value_string om2k_mo_state_vals[] = {
	{ 0x00, "RESET" },
	{ 0x01, "STARTED" },
	{ 0x02, "ENABLED" },
	{ 0x03, "DISABLED" },
	{ 0, NULL }
};

static const value_string om2k_la_state_vals[] = {
	{ 0x00, "LOCALLY CONNECTED" },
	{ 0x01, "LOCALLY DISCONNECTED" },
	{ 0, NULL }
};

static const value_string filerel_state_vals[] = {
	{ 0x00, "Not known in current state (unknown file)" },
	{ 0x01, "allowed, already loaded" },
	{ 0x02, "allowed, not loaded" },
	{ 0x03, "not allowed" },
	{ 0, NULL }
};

static const value_string om2k_mo_class_short_vals[] = {
	{ 0x01, "TRXC" },
	{ 0x03, "TS" },
	{ 0x04, "TF" },
	{ 0x05, "IS" },
	{ 0x06, "CON" },
	{ 0x0a, "CF" },
	{ 0x0b, "TX" },
	{ 0x0c, "RX" },
	{ 0, NULL }
};

static const value_string om2k_mo_class_vals[] = {
	{ 0x01, "TRXC (TRX Controller)" },
	{ 0x03, "TS (Timeslot)" },
	{ 0x04, "TF (Timing Function)" },
	{ 0x05, "IS (Interface Switch)" },
	{ 0x06, "CON (Concentrator)" },
	{ 0x0a, "CF (Central Function)" },
	{ 0x0b, "TX (Transmitter)" },
	{ 0x0c, "RX (Receiver)" },
	{ 0, NULL }
};

static const value_string om2k_tf_mode_vals[] = {
	{ 0x00, "Master" },
	{ 0x01, "Standalone" },
	{ 0x02, "Slave" },
	{ 0xff, "Not defined" },
	{ 0, NULL }
};

static gint
dissect_tss_mo_state(tvbuff_t *tvb, gint offset, proto_tree *tree)
{
	guint8 tmp;
	guint  i = 0;

	for (i = 0; i < 8; i+= 2) {
		tmp = tvb_get_guint8(tvb, offset);
		proto_tree_add_uint_format(tree, hf_om2k_tsn_state, tvb, offset, 1, tmp & 0xf,
					   "Timslot %u MO State: %s", i,
					   val_to_str(tmp & 0xf, om2k_mo_state_vals, "unknown (%02d)"));
		proto_tree_add_uint_format(tree, hf_om2k_tsn_state, tvb, offset, 1, tmp >> 4,
					   "Timslot %u MO State: %s", i+1,
					   val_to_str(tmp >> 4, om2k_mo_state_vals, "unknown (%02d)"));
		offset++;
	}

	return 4;
}


static gint
dissect_om2k_time(tvbuff_t *tvb, gint offset, proto_tree *tree)
{
	nstime_t  tmptime;
	time_t    tval;
	struct tm _time;

	_time.tm_year  = 100 + tvb_get_guint8(tvb, offset++);
	_time.tm_mon   = tvb_get_guint8(tvb, offset++) - 1;
	_time.tm_mday  = tvb_get_guint8(tvb, offset++);
	_time.tm_hour  = tvb_get_guint8(tvb, offset++);
	_time.tm_min   = tvb_get_guint8(tvb, offset++);
	_time.tm_sec   = tvb_get_guint8(tvb, offset++);
	_time.tm_isdst = -1;

	tval           = mktime(&_time);
	tmptime.secs   = tval;
	tmptime.nsecs  = 0;

	proto_tree_add_time(tree, hf_om2k_cal_time, tvb, offset, 6,
			    &tmptime);
	return 6;
}

static gint
dissect_om2k_attr_unkn(tvbuff_t *tvb, gint offset, gint len, gint iei, proto_tree *tree)
{
	proto_tree_add_bytes_format(tree, hf_om2k_unknown_val, tvb,
				    offset, len, NULL,
				    "%s: %s",
				    val_to_str_ext(iei, &om2k_attr_vals_ext, "0x%02x"),
				    tvb_bytes_to_ep_str(tvb, offset, len));
	return len;
}

static gint
dissect_om2k_is_list(tvbuff_t *tvb, gint base_offset, proto_tree *tree)
{
	gint        offset = base_offset;
	proto_item *ti;
	proto_tree *isl_tree;
	guint8      len    = tvb_get_guint8(tvb, offset++);

	ti       = proto_tree_add_item(tree, hf_om2k_isl, tvb, offset, len, ENC_NA);
	isl_tree = proto_item_add_subtree(ti, ett_om2k_isl);

	while (offset < base_offset + len) {
		proto_tree_add_item(isl_tree, hf_om2k_isl_icp1, tvb,
				    offset, 2, ENC_BIG_ENDIAN);
		offset += 2;
		proto_tree_add_item(isl_tree, hf_om2k_isl_icp2, tvb,
				    offset, 2, ENC_BIG_ENDIAN);
		offset += 2;
		proto_tree_add_item(isl_tree, hf_om2k_isl_ci, tvb,
				    offset++, 1, ENC_BIG_ENDIAN);
	}
	return offset - base_offset;
}

static gint
dissect_om2k_con_list(tvbuff_t *tvb, gint base_offset, proto_tree *tree)
{
	gint        offset = base_offset;
	proto_item *ti;
	proto_tree *conl_tree;
	guint8      len    = tvb_get_guint8(tvb, offset++);

	ti = proto_tree_add_item(tree, hf_om2k_conl, tvb, offset, len, ENC_NA);
	conl_tree = proto_item_add_subtree(ti, ett_om2k_conl);

	proto_tree_add_item(conl_tree, hf_om2k_conl_nr_cgs, tvb,
			    offset++, 1, ENC_BIG_ENDIAN);

	while (offset < base_offset + len) {
		guint8 nr_cps_cg = tvb_get_guint8(tvb, offset);
		proto_tree_add_item(conl_tree, hf_om2k_conl_nr_cps_cg, tvb,
				    offset++, 1, ENC_BIG_ENDIAN);
		while (nr_cps_cg--) {
			proto_tree_add_item(conl_tree, hf_om2k_conl_ccp, tvb,
				    offset, 2, ENC_BIG_ENDIAN);
			offset += 2;
			proto_tree_add_item(conl_tree, hf_om2k_conl_ci, tvb,
				    offset++, 1, ENC_BIG_ENDIAN);
			proto_tree_add_item(conl_tree, hf_om2k_conl_tag, tvb,
				    offset++, 1, ENC_BIG_ENDIAN);
			proto_tree_add_item(conl_tree, hf_om2k_conl_tei, tvb,
				    offset++, 1, ENC_BIG_ENDIAN);
		}
	}
	return offset - base_offset;
}


static gint
dissect_om2k_attrs(tvbuff_t *tvb, gint offset, proto_tree *tree)
{
	while (tvb_reported_length_remaining(tvb, offset) > 0) {
		guint8 iei = tvb_get_guint8(tvb, offset++);
		guint8 len, tmp;

		switch (iei) {
		case 0x00: /* Accordance Information */
			proto_tree_add_item(tree, hf_om2k_aip, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x06: /* BCC */
			proto_tree_add_item(tree, hf_om2k_bcc, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x07: /* BS_AG_BLKS_RES */
			proto_tree_add_item(tree, hf_om2k_bs_ag_blks_res, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x09: /* BSIC */
			proto_tree_add_item(tree, hf_om2k_bsic, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x0a: /* BS_PA_MFRMS */
			proto_tree_add_item(tree, hf_om2k_bs_pa_mfrms, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x0b: /* CBCH indicator */
			proto_tree_add_item(tree, hf_om2k_cbi, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x0c: /* CCCH Options */
			proto_tree_add_item(tree, hf_om2k_cr, tvb,
					    offset, 1, ENC_BIG_ENDIAN);
			proto_tree_add_item(tree, hf_om2k_ipt3, tvb,
					    offset, 1, ENC_BIG_ENDIAN);
			proto_tree_add_item(tree, hf_om2k_aop, tvb,
					    offset, 1, ENC_BIG_ENDIAN);
			offset++;
			break;
		case 0x0d: /* Calendar Time */
			offset += dissect_om2k_time(tvb, offset, tree);
			break;
		case 0x0f: /* Combination */
			proto_tree_add_item(tree, hf_om2k_comb, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x10: /* CON Connection List */
			offset += dissect_om2k_con_list(tvb, offset, tree);
			break;
		case 0x12: /* DRX_DEV_MAX */
			proto_tree_add_item(tree, hf_om2k_drx_dev_max, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x13: /* End List Number */
			proto_tree_add_item(tree, hf_om2k_list_nr_end, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x14: /* External Condition Map Class 1 */
			/* FIXME */
		case 0x15: /* External Condition Map Class 2 */
			/* FIXME */
			offset += dissect_om2k_attr_unkn(tvb, offset, 2, iei, tree);
			break;
		case 0x16: /* File Relation Indication */
			proto_tree_add_item(tree, hf_om2k_filerel_ilr, tvb,
					    offset, 1, ENC_BIG_ENDIAN);
			proto_tree_add_item(tree, hf_om2k_filerel_cur, tvb,
					    offset, 1, ENC_BIG_ENDIAN);
			offset++;
			proto_tree_add_item(tree, hf_om2k_filerel_other, tvb,
					    offset, 1, ENC_BIG_ENDIAN);
			offset++;
			break;
		case 0x17: /* File Revision */
			proto_tree_add_item(tree, hf_om2k_file_rev, tvb,
					    offset, 8, ENC_ASCII|ENC_NA);
			offset += 8;
			break;
		case 0x1c: /* Filling Marker */
			proto_tree_add_item(tree, hf_om2k_fill_mark, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x1d: /* FN Offset */
			proto_tree_add_item(tree, hf_om2k_fn_offs, tvb,
					    offset, 2, ENC_BIG_ENDIAN);
			offset += 2;
			break;
		case 0x1e: /* Frequency List */
			len = tvb_get_guint8(tvb, offset++);
			/* FIXME */
			offset += dissect_om2k_attr_unkn(tvb, offset, len, iei, tree);
			break;
		case 0x1f: /* Frequency Specifier Rx */
			/* FIXME */
		case 0x20: /* Frequency Specifier Rx */
			/* FIXME */
			offset += dissect_om2k_attr_unkn(tvb, offset, 2, iei, tree);
			break;
		case 0x21: /* HSN */
			proto_tree_add_item(tree, hf_om2k_hsn, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x22: /* ICM */
			proto_tree_add_item(tree, hf_om2k_icm, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x23: /* Internal Fault Map Class 1A */
			/* FIXME */
		case 0x24: /* Internal Fault Map Class 1B */
			/* FIXME */
		case 0x25: /* Internal Fault Map Class 2A */
			/* FIXME */
		case 0x26: /* Internal Fault Map Class 2A Ext */
			/* FIXME */
			offset += dissect_om2k_attr_unkn(tvb, offset, 6, iei, tree);
			break;
		case 0x27: /* IS Connection List */
			offset += dissect_om2k_is_list(tvb, offset, tree);
			break;
		case 0x28: /* List Number */
			proto_tree_add_item(tree, hf_om2k_list_nr, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x2a: /* Local Access State */
			proto_tree_add_item(tree, hf_om2k_la_state, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x2b: /* MAIO */
			proto_tree_add_item(tree, hf_om2k_maio, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x2c: /* MO State */
			proto_tree_add_item(tree, hf_om2k_mo_state, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x2d: /* Ny1 */
			proto_tree_add_item(tree, hf_om2k_ny1, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x2e: /* Operational Information */
			proto_tree_add_item(tree, hf_om2k_oip, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x2f: /* Nominal Power */
			proto_tree_add_item(tree, hf_om2k_nom_pwr, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x33: /* Receiver Diversity */
			proto_tree_add_item(tree, hf_om2k_diversity, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x34: /* Replacement Unit Map */
			/* FIXME */
			offset += dissect_om2k_attr_unkn(tvb, offset, 6, iei, tree);
			break;
		case 0x38: /* T3105 */
			proto_tree_add_item(tree, hf_om2k_t3105, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x3a: /* TF Mode */
			proto_tree_add_item(tree, hf_om2k_tf_mode, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x3c: /* TS Number */
			proto_tree_add_item(tree, hf_om2k_ts, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x3d: /* TSC */
			proto_tree_add_item(tree, hf_om2k_tsc, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x40: /* BTS Version */
			proto_tree_add_item(tree, hf_om2k_bts_manuf, tvb,
					    offset, 3, ENC_ASCII|ENC_NA);
			offset += 3;
			proto_tree_add_item(tree, hf_om2k_bts_gen, tvb,
					    offset, 3, ENC_ASCII|ENC_NA);
			offset += 3;
			proto_tree_add_item(tree, hf_om2k_bts_rev, tvb,
					    offset, 3, ENC_ASCII|ENC_NA);
			offset += 3;
			proto_tree_add_item(tree, hf_om2k_bts_var, tvb,
					    offset, 3, ENC_ASCII|ENC_NA);
			offset += 3;
			break;
		case 0x43: /* OML Function Map 1 */
		case 0x44: /* OML Function Map 2 */
		case 0x45: /* RSL Function Map 1 */
		case 0x46: /* RSL Function Map 2 */
			len = tvb_get_guint8(tvb, offset++);
			/* FIXME */
			offset += dissect_om2k_attr_unkn(tvb, offset, len, iei, tree);
			break;
		case 0x47: /* Ext Range */
			proto_tree_add_item(tree, hf_om2k_ext_range, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x48: /* Request Indicators */
			proto_tree_add_item(tree, hf_om2k_brr, tvb,
					    offset, 1, ENC_BIG_ENDIAN);
			proto_tree_add_item(tree, hf_om2k_bfr, tvb,
					    offset, 1, ENC_BIG_ENDIAN);
			offset++;
			break;
		case 0x50: /* Replacement Unit Map Extension */
			/* FIXME */
			offset += dissect_om2k_attr_unkn(tvb, offset, 6, iei, tree);
			break;
		case 0x74: /* ICM Boundary */
			/* FIXME */
			offset += dissect_om2k_attr_unkn(tvb, offset, 5, iei, tree);
			break;
		case 0x79: /* Link Supervision Control */
			proto_tree_add_item(tree, hf_om2k_lsc_fm, tvb,
					    offset, 1, ENC_BIG_ENDIAN);
			proto_tree_add_item(tree, hf_om2k_lsc_lsi, tvb,
					    offset, 1, ENC_BIG_ENDIAN);
			proto_tree_add_item(tree, hf_om2k_lsc_lsa, tvb,
					    offset, 1, ENC_BIG_ENDIAN);
			offset++;
			break;
		case 0x7a: /* Link Supervision Control */
			proto_tree_add_item(tree, hf_om2k_ls_ft, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x7b: /* Call Supervision Time */
			proto_tree_add_item(tree, hf_om2k_cst, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x7e: /* ICM Channel Rate */
			proto_tree_add_item(tree, hf_om2k_icm_cr, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x84: /* HW Info Signature */
			proto_tree_add_item(tree, hf_om2k_hwinfo_sig, tvb,
					    offset, 2, ENC_BIG_ENDIAN);
			offset += 2;
			break;
		case 0x87: /* TTA */
			proto_tree_add_item(tree, hf_om2k_tta, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x8a: /* Capabilities Signature */
			proto_tree_add_item(tree, hf_om2k_capa_sig, tvb,
					    offset, 2, ENC_BIG_ENDIAN);
			offset += 2;
			break;
		case 0x90: /* Negotiation Record I */
		case 0x91: /* Negotiation Record II */
			len = tvb_get_guint8(tvb, offset++);
			/* FIXME */
			offset += dissect_om2k_attr_unkn(tvb, offset, len, iei, tree);
			break;
		case 0x92: /* Encryption Algorithm */
			proto_tree_add_item(tree, hf_om2k_ea, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x94: /* Interference Rejection Combining */
			proto_tree_add_item(tree, hf_om2k_irc, tvb,
					    offset++, 1, ENC_BIG_ENDIAN);
			break;
		case 0x95: /* Dedication information */
			/* FIXME */
			offset += dissect_om2k_attr_unkn(tvb, offset, 3, iei, tree);
			break;
		case 0x98: /* FS Offset */
			proto_tree_add_item(tree, hf_om2k_tf_fs_offset, tvb,
					    offset, 5, ENC_BIG_ENDIAN);
			offset += 5;
			break;
		case 0x9c: /* External Condition Class 2 Extension */
			/* FIXME */
			offset += dissect_om2k_attr_unkn(tvb, offset, 4, iei, tree);
			break;
		case 0x9d: /* TSs MO State */
			offset += dissect_tss_mo_state(tvb, offset, tree);
			break;
		case 0x9e:
		case 0x9f:
		default:
			tmp = tvb_get_guint8(tvb, offset);
			proto_tree_add_uint_format(tree, hf_om2k_unknown_tag, tvb,
					    offset-1, 1, tmp, "Tag %s: 0x%02x",
					    val_to_str_ext(iei, &om2k_attr_vals_ext, "0x%02x"), tmp);
			offset++;
			break;
		}
	}

	return offset;
}

static guint
dissect_om2k_mo(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree)
{
	guint8      mo_class = tvb_get_guint8(tvb, offset);
	guint8      inst  = tvb_get_guint8(tvb, offset+3);

	col_append_fstr(pinfo->cinfo, COL_INFO, ", (%-4s %u)",
				val_to_str(mo_class, om2k_mo_class_short_vals,
					   "0x%02x"), inst);
	if (tree) {
		proto_item *ti;
		proto_tree *mo_tree;
		guint8      sub1  = tvb_get_guint8(tvb, offset+1);
		guint8      sub2  = tvb_get_guint8(tvb, offset+2);

		ti      = proto_tree_add_item(tree, hf_om2k_mo_if, tvb, offset,
					      4, ENC_NA);
		mo_tree = proto_item_add_subtree(ti, ett_om2k_mo);
		proto_tree_add_item(mo_tree, hf_om2k_mo_class, tvb, offset,
				    1, ENC_BIG_ENDIAN);
		proto_tree_add_item(mo_tree, hf_om2k_mo_sub1, tvb, offset+1,
				    1, ENC_BIG_ENDIAN);
		proto_tree_add_item(mo_tree, hf_om2k_mo_sub2, tvb, offset+2,
				    1, ENC_BIG_ENDIAN);
		proto_tree_add_item(mo_tree, hf_om2k_mo_instance, tvb, offset+3,
				    1, ENC_BIG_ENDIAN);
		proto_item_append_text(ti, ", Class: %s, Sub: %02x/%02x, Instance: %u",
				       val_to_str(mo_class, om2k_mo_class_vals, "0x%02x"),
				       sub1, sub2, inst);
	}
	return 4;
}

static void
dissect_abis_om2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
	proto_item *ti;
	proto_tree *om2k_tree;
	guint16     msg_code;
	guint8      tmp;

	int offset;

	if ((tree == NULL) && (pinfo->cinfo == NULL))
		return;   /* no dissection required */

	col_set_str(pinfo->cinfo, COL_PROTOCOL, "OM2000");
	/* Don't do col_clear() so this dissector can append to COL_INFO*/

	offset = 0;

	ti = proto_tree_add_item(tree, proto_abis_om2000,
				 tvb, 0, -1, ENC_NA);
	om2k_tree = proto_item_add_subtree(ti, ett_om2000);

	msg_code = tvb_get_ntohs(tvb, offset);
	proto_tree_add_item(om2k_tree, hf_om2k_msg_code, tvb, offset,
			    2, ENC_BIG_ENDIAN);
	offset += 2;

	offset += dissect_om2k_mo(tvb, offset, pinfo, om2k_tree);  /* appends to COL_INFO */

	col_append_fstr(pinfo->cinfo, COL_INFO, " %s ",
			val_to_str_ext(msg_code, &om2k_msgcode_vals_ext,
				   "unknown 0x%04x"));

	if (tree == NULL)
		return;   /* No refs to COL_...  beyond this point */

	proto_item_append_text(ti, " %s ",
			       val_to_str_ext(msg_code, &om2k_msgcode_vals_ext,
					  "unknown 0x%04x"));

	switch (msg_code) {
	case 0x74: /* Operational Info */
		tmp = tvb_get_guint8(tvb, offset+1);
		proto_item_append_text(ti, ": %s",
				       val_to_str(tmp, om2k_oip_vals,
						  "unknown 0x%02x"));
		break;
	case 0x1A: /* CON Configuration Result */
	case 0x66: /* IS Configuration Result */
	case 0x82: /* RX Configuration Result */
	case 0xA6: /* TF Configuration Result */
	case 0xAE: /* TS Configuration Result */
	case 0xB6: /* TX Configuration Result */
	case 0xE2: /* DP Configuration Result */
	case 0xF6: /* DP Configuration Result */
		tmp = tvb_get_guint8(tvb, offset+1);
		proto_item_append_text(ti, ": %s",
				       val_to_str(tmp, om2k_aip_vals,
						  "unknown 0x%02x"));
		break;
	default:
		break;
	}
	dissect_om2k_attrs(tvb, offset, om2k_tree);
}

void
proto_register_abis_om2000(void)
{
	static hf_register_info hf[] = {
		{ &hf_om2k_msg_code,
		  { "Message Code", "gsm_abis_om2000.msg_code",
		    FT_UINT16, BASE_HEX|BASE_EXT_STRING, &om2k_msgcode_vals_ext, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_mo_if,
		  { "MO Interface", "gsm_abis_om2000.mo_if",
		    FT_BYTES, BASE_NONE, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_mo_class,
		  { "MO IF Class", "gsm_abis_om2000.mo_if.class",
		    FT_UINT8, BASE_HEX, VALS(om2k_mo_class_vals), 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_mo_sub1,
			{ "MO IF Sub 1", "gsm_abis_om2000.mo_if.sub1",
			  FT_UINT8, BASE_HEX, NULL, 0,
			  NULL, HFILL }
		},
		{ &hf_om2k_mo_sub2,
			{ "MO IF Sub 2", "gsm_abis_om2000.mo_if.sub2",
			  FT_UINT8, BASE_HEX, NULL, 0,
			  NULL, HFILL }
		},
		{ &hf_om2k_mo_instance,
		  { "MO IF Instance", "gsm_abis_om2000.mo_if.instance",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_oip,
		  { "OIP (Operational Info)", "gsm_abis_om2000.oip",
		    FT_UINT8, BASE_HEX, VALS(om2k_oip_vals), 0,
		    "Operational Information Parameter", HFILL }
		},
		{ &hf_om2k_aip,
		  { "AIP (Accordance Info)", "gsm_abis_om2000.aip",
		    FT_UINT8, BASE_HEX, VALS(om2k_aip_vals), 0,
		    "Accordance Information Parameter", HFILL }
		},
		{ &hf_om2k_comb,
		  { "Channel Combination", "gsm_abis_om2000.chan_comb",
		    FT_UINT8, BASE_DEC, VALS(om2k_comb_vals), 0,
		    "Logical Channel Combination", HFILL }
		},
		{ &hf_om2k_ts,
		  { "Timeslot Number", "gsm_abis_om2000.ts",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_hsn,
		  { "HSN", "gsm_abis_om2000.hsn",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    "Hopping Sequence Number", HFILL }
		},
		{ &hf_om2k_maio,
		  { "MAIO", "gsm_abis_om2000.maio",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    "Mobile Allication Index Offset", HFILL }
		},
		{ &hf_om2k_bsic,
		  { "BSIC", "gsm_abis_om2000.bsic",
		    FT_UINT8, BASE_HEX, NULL, 0,
		    "Base Station Identity Code", HFILL }
		},
		{ &hf_om2k_diversity,
		  { "Receiver Diversity", "gsm_abis_om2000.diversity",
		    FT_UINT8, BASE_HEX, VALS(om2k_diversity_vals), 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_fn_offs,
		  { "FN Offset", "gsm_abis_om2000.fn_offset",
		    FT_UINT16, BASE_DEC, NULL, 0,
		    "GSM Frame Number Offset", HFILL }
		},
		{ &hf_om2k_ext_range,
		  { "Extended Range", "gsm_abis_om2000.ext_range",
		    FT_BOOLEAN, 1, NULL, 0,          /* XXX: bitmask needed? 'FT_BOOLEAN, 8, NULL, 0x01' ? */
		    NULL, HFILL }
		},
		{ &hf_om2k_irc,
		  { "Interference Rejection Combining", "gsm_abis_om2000.irc",
		    FT_BOOLEAN, 1, NULL, 0,          /* XXX: bitmask needed? 'FT_BOOLEAN, 8, NULL, 0x01,' ? */
		    NULL, HFILL }
		},
		{ &hf_om2k_bs_pa_mfrms,
		  { "BS_PA_MFRMS", "gsm_abis_om2000.bs_pa_mfrms",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_bs_ag_blks_res,
		  { "BS_AG_BLKS_RES", "gsm_abis_om2000.bs_ag_blks_res",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_drx_dev_max,
		  { "DRX_DEV_MAX", "gsm_abis_om2000.drx_dev_max",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_cr,
		  { "CCCH Repeat", "gsm_abis_om2000.ccch_repeat",
		    FT_BOOLEAN, 1, NULL, 0,          /* XXX: bitmask needed? 'FT_BOOLEAN, 8, NULL, 0x01,' ? */
		    NULL, HFILL }
		},
		{ &hf_om2k_ipt3,
		  { "Inhibit Paging Request Type 3", "gsm_abis_om2000.ipt3",
		    FT_BOOLEAN, 2, NULL, 0,          /* XXX: bitmask needed? 'FT_BOOLEAN, 8, NULL, 0x02,' ? */
		    NULL, HFILL }
		},
		{ &hf_om2k_aop,
		  { "Age Of Paging", "gsm_abis_om2000.aop",
		    FT_UINT8, BASE_DEC, NULL, 0x3C,  /* XXX: Verify bitmask */
		    NULL, HFILL }
		},
		{ &hf_om2k_t3105,
		  { "T3105 (in 10ms)", "gsm_abis_om2000.t3105",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_ny1,
		  { "Ny1", "gsm_abis_om2000.ny1",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_cbi,
		  { "CBCH Indicator", "gsm_abis_om2000.cbi",
		    FT_BOOLEAN, 1, NULL, 0,          /* XXX: bitmask needed? 'FT_BOOLEAN, 8, NULL, 0x01,' ? */
		    NULL, HFILL }
		},
		{ &hf_om2k_tsc,
		  { "Training Sequence Code", "gsm_abis_om2000.tsc",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_icm,
		  { "Idle Channel Measurement", "gsm_abis_om2000.icm",
		    FT_BOOLEAN, 1, NULL, 0,          /* XXX: bitmask needed? 'FT_BOOLEAN, 8, NULL, 0x01,' ? */
		    NULL, HFILL }
		},
		{ &hf_om2k_tta,
		  { "Timer for Time Alignment", "gsm_abis_om2000.tta",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_icm_cr,
		  { "ICM Channel Rate", "gsm_abis_om2000.icm_cr",
		    FT_UINT8, BASE_DEC, VALS(om2k_icmcr_vals), 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_lsc_fm,
		  { "LSC Dummy Frequency Measurement", "gsm_abis_om2000.lsc.fm",
		    FT_BOOLEAN, 8, NULL, 0x80,
		    NULL, HFILL }
		},
		{ &hf_om2k_lsc_lsi,
		  { "LSC Idle Channels", "gsm_abis_om2000.ls.lsi",
		    FT_BOOLEAN, 8, NULL, 0x01,
		    NULL, HFILL }
		},
		{ &hf_om2k_lsc_lsa,
		  { "LSC Active Channels", "gsm_abis_om2000.ls.lsa",
		    FT_BOOLEAN, 8, NULL, 0x02,
		    NULL, HFILL }
		},
		{ &hf_om2k_ls_ft,
		  { "Link Supervision Filtering Time (100ms)", "gsm_abis_om2000.ls_ft",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_cst,
		  { "Call Supervision Time (480ms)", "gsm_abis_om2000.cst",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_ea,
		  { "Encryption Algorithm", "gsm_abis_om2000.ea",
		    FT_UINT8, BASE_DEC, VALS(om2k_ea_vals), 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_nom_pwr,
		  { "Nominal Power (dBm)", "gsm_abis_om2000.pwr",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_fill_mark,
		  { "Filling Marker", "gsm_abis_om2000.filling",
		    FT_UINT8, BASE_DEC, VALS(om2k_fill_vals), 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_bcc,
		  { "BCC", "gsm_abis_om2000.bcc",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    "Base Station Color Code", HFILL }
		},
		{ &hf_om2k_mo_state,
		  { "MO State", "gsm_abis_om2000.mo_state",
		    FT_UINT8, BASE_DEC, VALS(om2k_mo_state_vals), 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_la_state,
		  { "Local Access State", "gsm_abis_om2000.la_state",
		    FT_UINT8, BASE_DEC, VALS(om2k_la_state_vals), 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_tsn_state,
		  { "Time Slot N MO State", "gsm_abis_om2000.tsn_mo_state",
		    FT_UINT8, BASE_DEC, VALS(om2k_mo_state_vals), 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_bts_manuf,
		  { "BTS Manufacturer ID", "gsm_abis_om2000.bts_ver.manuf",
		    FT_STRING, BASE_NONE, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_bts_gen,
		  { "BTS Generation", "gsm_abis_om2000.bts_ver.gen",
		    FT_STRING, BASE_NONE, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_bts_rev,
		  { "BTS Revision", "gsm_abis_om2000.bts_ver.rev",
		    FT_STRING, BASE_NONE, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_bts_var,
		  { "BTS Variant", "gsm_abis_om2000.bts_ver.variant",
		    FT_STRING, BASE_NONE, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_brr,
		  { "BTS Requested Restart", "gsm_abis_om2000.brr",
		    FT_BOOLEAN, 0x01, NULL, 0,          /* XXX: bitmask needed? 'FT_BOOLEAN, 8, NULL, 0x??,' ? */
		    NULL, HFILL }
		},
		{ &hf_om2k_bfr,
		  { "BTS Requested File Relation", "gsm_abis_om2000.bfr",
		    FT_BOOLEAN, 0x01, NULL, 0,          /* XXX: bitmask needed? 'FT_BOOLEAN, 8, NULL, 0x??,' ? */
		    NULL, HFILL }
		},
		{ &hf_om2k_hwinfo_sig,
		  { "HW Info Signature", "gsm_abis_om2000.hwinfo_sig",
		    FT_UINT16, BASE_HEX, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_capa_sig,
		  { "Capabilities Signature", "gsm_abis_om2000.capa_sig",
		    FT_UINT16, BASE_HEX, NULL, 0,
		    NULL, HFILL }
		},

		{ &hf_om2k_unknown_tag,
		  { "Unknown Tag", "gsm_abis_om2000.unknown.tag",
		    FT_UINT8, BASE_HEX, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_unknown_val,
		  { "Unknown Value", "gsm_abis_om2000.unknown.val",
		    FT_BYTES, BASE_NONE, NULL, 0,
		    NULL, HFILL }
		},

		{ &hf_om2k_file_rev,
		  { "File Revision", "gsm_abis_om2000.file_rev",
		    FT_STRING, BASE_NONE, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_filerel_ilr,
		  { "Immediate Load Requested", "gsm_abis_om2000.filerel.ilr",
		    FT_BOOLEAN, 8, NULL, 0x08,
		    NULL, HFILL }
		},
		{ &hf_om2k_filerel_cur,
		  { "Current State", "gsm_abis_om2000.filerel.cur",
		    FT_UINT8, BASE_HEX, VALS(filerel_state_vals), 0x07,
		    NULL, HFILL }
		},
		{ &hf_om2k_filerel_other,
		  { "Other State", "gsm_abis_om2000.filerel.other",
		    FT_UINT8, BASE_HEX, VALS(filerel_state_vals), 0x07,
		    NULL, HFILL }
		},
		{ &hf_om2k_cal_time,
		  { "Calendar Time", "gsm_abis_om2000.cal_time",
		    FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_list_nr,
		  { "List Number", "gsm_abis_om2000.list_nr",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_list_nr_end,
		  { "End List Number", "gsm_abis_om2000.list_nr_end",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_isl,
		  { "IS Connection List", "gsm_abis_om2000.is_list",
		    FT_BYTES, BASE_NONE, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_isl_icp1,
		  { "ICP1", "gsm_abis_om2000.is_list.icp1",
		    FT_UINT16, BASE_DEC, NULL, 0x7ff,
		    NULL, HFILL }
		},
		{ &hf_om2k_isl_icp2,
		  { "ICP2", "gsm_abis_om2000.is_list.icp2",
		    FT_UINT16, BASE_DEC, NULL, 0x7ff,
		    NULL, HFILL }
		},
		{ &hf_om2k_isl_ci,
		  { "Contiguity Index", "gsm_abis_om2000.is_list.ci",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_conl,
		  { "Connection List", "gsm_abis_om2000.con_list",
		    FT_BYTES, BASE_NONE, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_conl_nr_cgs,
		  { "Number of CGs", "gsm_abis_om2000.con_list.nr_cgs",
		    FT_UINT8, BASE_DEC, NULL, 0x1f,
		    "Number of Concentration Groups in the DE", HFILL }
		},
		{ &hf_om2k_conl_nr_cps_cg,
		  { "Number of CPS in CG", "gsm_abis_om2000.con_list.nr_cps_cg",
		    FT_UINT8, BASE_DEC, NULL, 0x1f,
		    "Number of CPS in Concentration Group", HFILL }
		},
		{ &hf_om2k_conl_ccp,
		  { "CON Connection Point", "gsm_abis_om2000.con_list.cpp",
		    FT_UINT16, BASE_DEC, NULL, 0x3ff,
		    NULL, HFILL }
		},
		{ &hf_om2k_conl_ci,
		  { "Contiguity Index", "gsm_abis_om2000.con_list.ci",
		    FT_UINT8, BASE_DEC, NULL, 0x7,
		    NULL, HFILL }
		},
		{ &hf_om2k_conl_tag,
		  { "Tag", "gsm_abis_om2000.con_list.tag",
		    FT_UINT8, BASE_DEC, NULL, 0x1f,
		    NULL, HFILL }
		},
		{ &hf_om2k_conl_tei,
		  { "TEI", "gsm_abis_om2000.con_list.tei",
		    FT_UINT8, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_tf_mode,
		  { "TF Mode", "gsm_abis_om2000.tf_mode",
		    FT_UINT8, BASE_HEX, VALS(om2k_tf_mode_vals), 0,
		    NULL, HFILL }
		},
		{ &hf_om2k_tf_fs_offset,
		  { "TF FS Offset", "gsm_abis_om2000.tf_fs_offset",
		    FT_UINT64, BASE_DEC, NULL, 0,
		    NULL, HFILL }
		},
	};
	static gint *ett[] = {
		&ett_om2000,
		&ett_om2k_mo,
		&ett_om2k_isl,
		&ett_om2k_conl,
	};

	proto_abis_om2000 = proto_register_protocol("Ericsson A-bis OML",
						    "Ericsson OML",
						    "gsm_abis_om2000");

	proto_register_field_array(proto_abis_om2000, hf, array_length(hf));

	proto_register_subtree_array(ett, array_length(ett));

	register_dissector("gsm_abis_om2000", dissect_abis_om2000,
			   proto_abis_om2000);
}

/*
 * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
 *
 * Local variables:
 * c-basic-offset: 8
 * tab-width: 8
 * indent-tabs-mode: t
 * End:
 *
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
 * :indentSize=8:tabSize=8:noTabs=false:
 */