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
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
|
/* packet-gmr1_bcch.c
*
* Routines for GMR-1 BCCH dissection in wireshark.
* Copyright (c) 2011 Sylvain Munaut <tnt@246tNt.com>
*
* References:
* [1] ETSI TS 101 376-4-8 V1.3.1 - GMR-1 04.008
* [2] ETSI TS 101 376-4-8 V2.2.1 - GMPRS-1 04.008
* [3] ETSI TS 101 376-4-8 V3.1.1 - GMR-1 3G 44.008
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#include <wsutil/array.h>
#include "packet-csn1.h"
void proto_register_gmr1_bcch(void);
/* GMR-1 BCCH proto */
static int proto_gmr1_bcch;
/* GMR-1 BCCH sub tree */
static int ett_gmr1_bcch;
static expert_field ei_unknown_segment;
/* ------------------------------------------------------------------------ */
/* CSN1 fields */
/* ------------------------------------------------------------------------ */
/* Segment 1A fields - [3] 11.5.2.66 */
static int hf_seg1a_class_2_version;
static int hf_seg1a_class_3_version;
static int hf_seg1a_syncinfo_sb_frame_ts_offset;
static int hf_seg1a_syncinfo_sb_symbol_offset;
static int hf_seg1a_syncinfo_sa_freq_offset;
static int hf_seg1a_rachctrl_max_retrans;
static int hf_seg1a_rachctrl_acc[16];
static int hf_seg1a_rachctrl_cell_bar_access;
static int hf_seg1a_miscinfo_sb_reselection_hysteresis;
static int hf_seg1a_miscinfo_spare;
static int hf_seg1a_miscinfo_priority_access_ind;
static int hf_seg1a_gbch_present;
static int hf_seg1a_test_gs;
static int hf_seg1a_test_gs2;
static int hf_seg1a_spare1;
static int hf_seg1a_cell_bar_access_extension2;
static int hf_seg1a_spare2;
static int hf_seg1a_cell_bar_access_extension;
/* Segment 2A & 2Abis fields - [3] 11.5.2.67 / 11.5.2.68 */
static int hf_seg2a_class_4_version;
static int hf_seg2a_syncinfo_sa_sirfn_delay;
static int hf_seg2a_syncinfo_sa_bcch_stn;
static int hf_seg2a_syncinfo_superframe_num;
static int hf_seg2a_syncinfo_multiframe_num;
static int hf_seg2a_syncinfo_mffn_high_bit;
static int hf_seg2a_selcrit_rxlev_select_min;
static int hf_seg2a_miscinfo_sb_selection_power;
static int hf_seg2a_lainfo_sa_pch_config;
static int hf_seg2a_lainfo_sa_bach_config;
static int hf_seg2a_lainfo_rach_ts_offset;
static int hf_seg2a_lainfo_n_page_occurrences;
static int hf_seg2a_lainfo_imsi_attach_detach_ind;
static int hf_seg2a_lainfo_ecsc_indication;
static int hf_seg2a_lainfo_si_update_ind;
static int hf_seg2a_class_type;
static int hf_seg2a_segment_type_a;
static int hf_seg2a_segment_type_abis;
/* Segment 2B fields */
static int hf_seg2b_segment_type_b;
/* Segment 2Bbis fields */
static int hf_seg2b_segment_type_bbis;
/* Segment 3A fields - [1] 11.5.2.71 */
static int hf_seg3a_class_type;
static int hf_seg3a_segment_type_a;
static int hf_seg3a_lai_dissector;
static int hf_seg3a_lai_mcc;
static int hf_seg3a_lai_mnc;
static int hf_seg3a_lai_lac;
static int hf_seg3a_lai_msc_id;
static int hf_seg3a_lai_spot_beam_id;
static int hf_seg3a_system_sat_id;
static int hf_seg3a_system_sys_id;
static int hf_seg3a_satpos_latitude;
static int hf_seg3a_satpos_longitude;
static int hf_seg3a_satpos_radius;
static int hf_seg3a_beam_latitude;
static int hf_seg3a_beam_longitude;
static int hf_seg3a_miscinfo_sb_reselection_timer;
static int hf_seg3a_spare;
static int hf_seg3b_segment_type_b;
static int hf_seg3b_segment_type_bbis;
static int hf_seg3c_segment_type_c;
static int hf_seg3d_segment_type_d;
static int hf_seg3e_segment_type_e;
static int hf_seg3e_segment_type_ebis;
static int hf_seg3f_segment_type_f;
static int hf_seg3g_segment_type_g;
static int hf_seg3g_segment_type_gbis;
static int hf_seg3h_segment_type_h;
static int hf_seg3i_segment_type_i;
static int hf_seg3j_segment_type_j;
static int hf_seg3j_segment_type_jbis;
static int hf_seg3k_segment_type_kbis;
static int hf_seg4a_class_type;
static int hf_seg4a_segment_type_a;
static int hf_seg4b_segment_type_b;
static int hf_seg4c_segment_type_c;
static int hf_seg4d_segment_type_d;
static int hf_seg4e_segment_type_e;
static int hf_seg4f_segment_type_f;
static int hf_seg4g_segment_type_g;
static int hf_seg4h_segment_type_h;
static int hf_seg4i_segment_type_i;
static int hf_seg4j_segment_type_j;
static int hf_seg4k_segment_type_k;
/* Segment 3B fields */
/* Segment 3Bbis fields */
/* Segment 3C fields */
/* Segment 3D fields */
/* Segment 3E fields */
/* Segment 3Ebis fields */
/* Segment 3F fields */
/* Segment 3G fields */
/* Segment 3Gbis fields */
/* Segment 3H fields */
/* Segment 3I fields */
/* Segment 3J fields */
/* Segment 3Jbis fields */
/* Segment 3Kbis fields */
/* Segment 3L fields */
/* Segment 3M fields */
/* Segment 4A fields */
/* Segment 4B fields */
/* Segment 4C fields */
/* Segment 4D fields */
/* Segment 4E fields */
/* Segment 4F fields */
/* Segment 4G fields */
/* Segment 4H fields */
/* Segment 4I fields */
/* Segment 4J fields */
/* Segment 4K fields */
/* System Information fields [1] 10.1.31 & 10.1.32 */
static int hf_si1_segment_choice;
static int hf_si_protocol_version;
static int hf_si_block_type;
static int hf_si_spare;
static int hf_si1_randomization_period;
/* ------------------------------------------------------------------------ */
/* CSN1 parsing structure */
/* ------------------------------------------------------------------------ */
/* Segments structures */
/* Segment 1A - [3] 11.5.2.66 */
typedef struct {
uint8_t SB_FRAME_TS_OFFSET;
int8_t SB_SYMBOL_OFFSET;
int8_t SA_FREQ_OFFSET;
} Seg1A_SyncInfo_t;
typedef struct {
uint8_t AC15;
uint8_t AC14;
uint8_t AC13;
uint8_t AC12;
uint8_t AC11;
uint8_t EC10;
uint8_t AC9;
uint8_t AC8;
uint8_t AC7;
uint8_t AC6;
uint8_t AC5;
uint8_t AC4;
uint8_t AC3;
uint8_t AC2;
uint8_t AC1;
uint8_t AC0;
} Seg1A_AccessClasses_t;
typedef struct {
uint8_t Max_Retrans;
Seg1A_AccessClasses_t AccessClasses;
uint8_t CELL_BAR_ACCESS;
} Seg1A_RACHCtrlParams_t;
typedef struct {
uint8_t SB_RESELECTION_HYSTERESIS;
uint8_t Spare;
uint8_t PriorityAccessInd;
} Seg1A_MiscInfo_t;
typedef struct {
uint8_t Class_2_version;
uint8_t Class_3_version;
Seg1A_SyncInfo_t SyncInfo;
Seg1A_RACHCtrlParams_t RACHCtrlParams;
Seg1A_MiscInfo_t MiscInfo;
uint8_t GBCH_Present;
uint8_t Test_GS;
uint8_t Test_GS2;
uint8_t Spare1;
uint8_t CELL_BAR_ACCESS_EXTENSION2;
uint8_t Spare2;
uint8_t CELL_BAR_ACCESS_EXTENSION;
} Segment1A_t;
/* Segment 2A & 2Abis - [3] 11.5.2.67 / 11.5.2.68 */
typedef struct {
uint8_t SA_SIRFN_DELAY;
uint8_t SA_BCCH_STN;
uint16_t SuperframeNum;
uint8_t MultiframeNum;
uint8_t MFFN_HighBit;
} Seg2A_SyncInfo_t;
typedef struct {
uint8_t RXLEV_SELECT_MIN;
} Seg2A_SelectionCriterion_t;
typedef struct {
uint8_t SB_SELECTION_POWER;
} Seg2A_MiscInfo_t;
typedef struct {
uint8_t SA_PCH_CONFIG;
uint8_t SA_BACH_CONFIG;
uint8_t RACH_TS_OFFSET;
uint8_t N_Page_Occurrences;
uint8_t IMSI_attach_detach_ind;
uint8_t ECSC_ind;
uint8_t SI_update_ind;
} Seg2A_LAInfo_t;
typedef struct {
uint8_t Class_4_version;
Seg2A_SyncInfo_t SyncInfo;
Seg2A_SelectionCriterion_t SelectionCriterion;
Seg2A_MiscInfo_t MiscInfo;
Seg2A_LAInfo_t LAInfo;
} Segment2A_t;
typedef struct {
uint8_t Class_4_version;
Seg2A_SyncInfo_t SyncInfo;
Seg2A_SelectionCriterion_t SelectionCriterion;
Seg2A_MiscInfo_t MiscInfo;
Seg2A_LAInfo_t LAInfo;
} Segment2Abis_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment2B_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment2Bbis_t;
/* Segment 3A - [1] 11.5.2.71 */
typedef struct {
uint16_t MCC;
uint16_t MNC;
uint16_t LAC;
uint8_t MSC_ID; /* split version of LAC */
uint16_t Spot_Beam_ID; /* split version of LAC */
} Seg3A_LAI_t;
typedef struct {
uint8_t Satellite_ID;
uint8_t System_ID;
} Seg3A_System_t;
typedef struct {
int8_t Latitude;
uint16_t Longitude;
int16_t Radius;
} Seg3A_SatellitePosition_t;
typedef struct {
int16_t Latitude;
uint16_t Longitude;
} Seg3A_BeamPosition_t;
typedef struct {
uint8_t SB_RESELECTION_TIMER;
} Seg3A_MiscInfo_t;
typedef struct {
Seg3A_LAI_t LAI;
Seg3A_System_t System;
Seg3A_SatellitePosition_t SatellitePosition;
Seg3A_BeamPosition_t BeamPosition;
Seg3A_MiscInfo_t MiscInfo;
uint8_t Spare;
} Segment3A_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3B_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3Bbis_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3C_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3D_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3E_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3Ebis_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3F_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3G_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3Gbis_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3H_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3I_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3J_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3Jbis_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3Kbis_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3L_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment3M_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment4A_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment4B_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment4C_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment4D_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment4E_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment4F_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment4G_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment4H_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment4I_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment4J_t;
typedef struct {
uint8_t _dummy; /* Remove when dissection is written */
} Segment4K_t;
/* System informations structures */
/* System Information type 1 - [1] 10.1.31 */
typedef struct {
uint8_t Protocol_Version;
uint8_t Block_Type;
uint8_t Randomization_Period;
uint8_t Spare;
} SI1_Block_Header_t;
typedef struct {
SI1_Block_Header_t Block_Header;
Segment1A_t Segment1A;
uint8_t SegmentType;
union {
Segment2Abis_t Segment2Abis;
Segment2Bbis_t Segment2Bbis;
Segment3A_t Segment3A;
Segment3Bbis_t Segment3Bbis;
Segment3C_t Segment3C;
Segment3D_t Segment3D;
Segment3Ebis_t Segment3Ebis;
Segment3F_t Segment3F;
Segment3Gbis_t Segment3Gbis;
Segment3H_t Segment3H;
Segment3I_t Segment3I;
Segment3Jbis_t Segment3Jbis;
Segment3Kbis_t Segment3Kbis;
Segment4A_t Segment4A;
Segment4B_t Segment4B;
Segment4C_t Segment4C;
Segment4D_t Segment4D;
Segment4E_t Segment4E;
Segment4F_t Segment4F;
Segment4G_t Segment4G;
Segment4H_t Segment4H;
Segment4I_t Segment4I;
Segment4J_t Segment4J;
Segment4K_t Segment4K;
} u;
} SystemInformation1_t;
/* System Information type 2 - [1] 10.1.32 */
typedef struct {
uint8_t Protocol_Version;
uint8_t Block_Type;
uint8_t Spare;
} SI2_Block_Header_t;
typedef struct {
SI2_Block_Header_t Block_Header;
uint8_t SegmentType;
union {
Segment2A_t Segment2A;
Segment2B_t Segment2B;
Segment3B_t Segment3B;
Segment3E_t Segment3E;
Segment3G_t Segment3G;
Segment3J_t Segment3J;
} u;
} SystemInformation2_t;
/* ------------------------------------------------------------------------ */
/* CSN1 parsing definitions */
/* ------------------------------------------------------------------------ */
/* Segments */
/* Segment 1A - [3] 11.5.2.66 */
static const
CSN_DESCR_BEGIN(Seg1A_SyncInfo_t)
M_UINT (Seg1A_SyncInfo_t, SB_FRAME_TS_OFFSET, 5, &hf_seg1a_syncinfo_sb_frame_ts_offset),
M_UINT (Seg1A_SyncInfo_t, SB_SYMBOL_OFFSET, 6, &hf_seg1a_syncinfo_sb_symbol_offset),
M_UINT (Seg1A_SyncInfo_t, SA_FREQ_OFFSET, 8, &hf_seg1a_syncinfo_sa_freq_offset),
CSN_DESCR_END (Seg1A_SyncInfo_t)
static const
CSN_DESCR_BEGIN(Seg1A_AccessClasses_t)
M_UINT (Seg1A_AccessClasses_t, AC15, 1, &hf_seg1a_rachctrl_acc[15]),
M_UINT (Seg1A_AccessClasses_t, AC14, 1, &hf_seg1a_rachctrl_acc[14]),
M_UINT (Seg1A_AccessClasses_t, AC13, 1, &hf_seg1a_rachctrl_acc[13]),
M_UINT (Seg1A_AccessClasses_t, AC12, 1, &hf_seg1a_rachctrl_acc[12]),
M_UINT (Seg1A_AccessClasses_t, AC11, 1, &hf_seg1a_rachctrl_acc[11]),
M_UINT (Seg1A_AccessClasses_t, EC10, 1, &hf_seg1a_rachctrl_acc[10]),
M_UINT (Seg1A_AccessClasses_t, AC9, 1, &hf_seg1a_rachctrl_acc[9]),
M_UINT (Seg1A_AccessClasses_t, AC8, 1, &hf_seg1a_rachctrl_acc[8]),
M_UINT (Seg1A_AccessClasses_t, AC7, 1, &hf_seg1a_rachctrl_acc[7]),
M_UINT (Seg1A_AccessClasses_t, AC6, 1, &hf_seg1a_rachctrl_acc[6]),
M_UINT (Seg1A_AccessClasses_t, AC5, 1, &hf_seg1a_rachctrl_acc[5]),
M_UINT (Seg1A_AccessClasses_t, AC4, 1, &hf_seg1a_rachctrl_acc[4]),
M_UINT (Seg1A_AccessClasses_t, AC3, 1, &hf_seg1a_rachctrl_acc[3]),
M_UINT (Seg1A_AccessClasses_t, AC2, 1, &hf_seg1a_rachctrl_acc[2]),
M_UINT (Seg1A_AccessClasses_t, AC1, 1, &hf_seg1a_rachctrl_acc[1]),
M_UINT (Seg1A_AccessClasses_t, AC0, 1, &hf_seg1a_rachctrl_acc[0]),
CSN_DESCR_END (Seg1A_AccessClasses_t)
static const
CSN_DESCR_BEGIN(Seg1A_RACHCtrlParams_t)
M_UINT (Seg1A_RACHCtrlParams_t, Max_Retrans, 2, &hf_seg1a_rachctrl_max_retrans),
M_TYPE_LABEL (Seg1A_RACHCtrlParams_t, AccessClasses, Seg1A_AccessClasses_t, "Access Classes"),
M_UINT (Seg1A_RACHCtrlParams_t, CELL_BAR_ACCESS, 1, &hf_seg1a_rachctrl_cell_bar_access),
CSN_DESCR_END (Seg1A_RACHCtrlParams_t)
static const
CSN_DESCR_BEGIN(Seg1A_MiscInfo_t)
M_UINT (Seg1A_MiscInfo_t, SB_RESELECTION_HYSTERESIS, 4, &hf_seg1a_miscinfo_sb_reselection_hysteresis),
M_UINT (Seg1A_MiscInfo_t, Spare, 1, &hf_seg1a_miscinfo_spare),
M_UINT (Seg1A_MiscInfo_t, PriorityAccessInd, 1, &hf_seg1a_miscinfo_priority_access_ind),
CSN_DESCR_END (Seg1A_MiscInfo_t)
static const
CSN_DESCR_BEGIN(Segment1A_t)
M_UINT (Segment1A_t, Class_2_version, 3, &hf_seg1a_class_2_version),
M_UINT (Segment1A_t, Class_3_version, 4, &hf_seg1a_class_3_version),
M_TYPE_LABEL (Segment1A_t, SyncInfo, Seg1A_SyncInfo_t, "Synchronization Info Class 1"),
M_TYPE_LABEL (Segment1A_t, RACHCtrlParams, Seg1A_RACHCtrlParams_t, "RACH Control Parameters"),
M_TYPE_LABEL (Segment1A_t, MiscInfo, Seg1A_MiscInfo_t, "Misc Info Class 1"),
M_UINT (Segment1A_t, GBCH_Present, 1, &hf_seg1a_gbch_present),
M_UINT (Segment1A_t, Test_GS, 1, &hf_seg1a_test_gs),
M_UINT (Segment1A_t, Test_GS2, 1, &hf_seg1a_test_gs2),
M_UINT (Segment1A_t, Spare1, 3, &hf_seg1a_spare1),
M_UINT (Segment1A_t, CELL_BAR_ACCESS_EXTENSION2, 1, &hf_seg1a_cell_bar_access_extension2),
M_UINT (Segment1A_t, Spare2, 5, &hf_seg1a_spare2),
M_UINT (Segment1A_t, CELL_BAR_ACCESS_EXTENSION, 1, &hf_seg1a_cell_bar_access_extension),
CSN_DESCR_END (Segment1A_t)
/* Segment 2A & 2Abis - [1] 11.5.2.67 / 11.5.2.68 */
static const
CSN_DESCR_BEGIN(Seg2A_SyncInfo_t)
M_UINT (Seg2A_SyncInfo_t, SA_SIRFN_DELAY, 4, &hf_seg2a_syncinfo_sa_sirfn_delay),
M_UINT (Seg2A_SyncInfo_t, SA_BCCH_STN, 5, &hf_seg2a_syncinfo_sa_bcch_stn),
M_UINT (Seg2A_SyncInfo_t, SuperframeNum, 13, &hf_seg2a_syncinfo_superframe_num),
M_UINT (Seg2A_SyncInfo_t, MultiframeNum, 2, &hf_seg2a_syncinfo_multiframe_num),
M_UINT (Seg2A_SyncInfo_t, MFFN_HighBit, 1, &hf_seg2a_syncinfo_mffn_high_bit),
CSN_DESCR_END (Seg2A_SyncInfo_t)
static const
CSN_DESCR_BEGIN(Seg2A_SelectionCriterion_t)
M_UINT (Seg2A_SelectionCriterion_t, RXLEV_SELECT_MIN, 5, &hf_seg2a_selcrit_rxlev_select_min),
CSN_DESCR_END (Seg2A_SelectionCriterion_t)
static const
CSN_DESCR_BEGIN(Seg2A_MiscInfo_t)
M_UINT (Seg2A_MiscInfo_t, SB_SELECTION_POWER, 4, &hf_seg2a_miscinfo_sb_selection_power),
CSN_DESCR_END (Seg2A_MiscInfo_t)
static const
CSN_DESCR_BEGIN(Seg2A_LAInfo_t)
M_UINT (Seg2A_LAInfo_t, SA_PCH_CONFIG, 2, &hf_seg2a_lainfo_sa_pch_config),
M_UINT (Seg2A_LAInfo_t, SA_BACH_CONFIG, 8, &hf_seg2a_lainfo_sa_bach_config),
M_UINT (Seg2A_LAInfo_t, RACH_TS_OFFSET, 5, &hf_seg2a_lainfo_rach_ts_offset),
M_UINT (Seg2A_LAInfo_t, N_Page_Occurrences, 2, &hf_seg2a_lainfo_n_page_occurrences),
M_UINT (Seg2A_LAInfo_t, IMSI_attach_detach_ind, 1, &hf_seg2a_lainfo_imsi_attach_detach_ind),
M_UINT (Seg2A_LAInfo_t, ECSC_ind, 1, &hf_seg2a_lainfo_ecsc_indication),
M_UINT (Seg2A_LAInfo_t, SI_update_ind, 1, &hf_seg2a_lainfo_si_update_ind),
CSN_DESCR_END (Seg2A_LAInfo_t)
static const
CSN_DESCR_BEGIN(Segment2A_t)
M_FIXED_LABEL(Segment2A_t, 2, 0x2, "Class type: 2", &hf_seg2a_class_type),
M_FIXED_LABEL(Segment2A_t, 4, 0x0, "Segment type: A", &hf_seg2a_segment_type_a),
M_UINT (Segment2A_t, Class_4_version, 3, &hf_seg2a_class_4_version),
M_TYPE_LABEL (Segment2A_t, SyncInfo, Seg2A_SyncInfo_t, "Synchronization Info Class 2"),
M_TYPE_LABEL (Segment2A_t, SelectionCriterion, Seg2A_SelectionCriterion_t, "Selection Criterion"),
M_TYPE_LABEL (Segment2A_t, MiscInfo, Seg2A_MiscInfo_t, "Misc Info Class 2"),
M_TYPE_LABEL (Segment2A_t, LAInfo, Seg2A_LAInfo_t, "LA Info Class 2"),
CSN_DESCR_END (Segment2A_t)
static const
CSN_DESCR_BEGIN(Segment2Abis_t)
M_FIXED_LABEL(Segment2Abis_t, 2, 0x2, "Class type: 2", &hf_seg2a_class_type),
M_FIXED_LABEL(Segment2Abis_t, 4, 0x0, "Segment type: Abis", &hf_seg2a_segment_type_abis),
M_UINT (Segment2Abis_t, Class_4_version, 3, &hf_seg2a_class_4_version),
M_TYPE_LABEL (Segment2Abis_t, SyncInfo, Seg2A_SyncInfo_t, "Synchronization Info Class 2"),
M_TYPE_LABEL (Segment2Abis_t, SelectionCriterion, Seg2A_SelectionCriterion_t, "Selection Criterion"),
M_TYPE_LABEL (Segment2Abis_t, MiscInfo, Seg2A_MiscInfo_t, "Misc Info Class 2"),
M_TYPE_LABEL (Segment2Abis_t, LAInfo, Seg2A_LAInfo_t, "LA Info Class 2"),
CSN_DESCR_END (Segment2Abis_t)
static const
CSN_DESCR_BEGIN(Segment2B_t)
M_FIXED_LABEL(Segment2B_t, 2, 0x2, "Class type: 2", &hf_seg2a_class_type),
M_FIXED_LABEL(Segment2B_t, 4, 0x1, "Segment type: B", &hf_seg2b_segment_type_b),
CSN_DESCR_END (Segment2B_t)
static const
CSN_DESCR_BEGIN(Segment2Bbis_t)
M_FIXED_LABEL(Segment2Bbis_t, 2, 0x2, "Class type: 2", &hf_seg2a_class_type),
M_FIXED_LABEL(Segment2Bbis_t, 4, 0x1, "Segment type: B bis", &hf_seg2b_segment_type_bbis),
CSN_DESCR_END (Segment2Bbis_t)
/* Segment 3A - [1] 11.5.2.71 */
static int16_t
Seg3A_LAI_Dissector(proto_tree *tree, csnStream_t* ar, tvbuff_t *tvb, void* data, int ett_csn1)
{
Seg3A_LAI_t *LAI = (Seg3A_LAI_t *)data;
proto_item *lac_item;
proto_tree *lac_tree;
uint8_t c[5];
int i;
if (ar->remaining_bits_len < 5*8)
return -1;
for (i=0; i<5; i++)
c[i] = tvb_get_bits8(tvb, ar->bit_offset + (i<<3), 8);
LAI->MCC = (c[0] & 0xf) * 100 + ((c[0] & 0xf0) >> 4) * 10 + (c[1] & 0xf);
LAI->MNC = (c[2] & 0xf) * 10 + ((c[2] & 0xf0) >> 4);
LAI->LAC = (c[3] << 8) | c[4];
LAI->MSC_ID = (LAI->LAC >> 10) & 0x3f;
LAI->Spot_Beam_ID = LAI->LAC & 0x03ff;
proto_tree_add_uint_bits_format_value(tree, hf_seg3a_lai_mcc, tvb, ar->bit_offset, 16, (uint32_t)LAI->MCC, ENC_BIG_ENDIAN, "%d", LAI->MCC);
proto_tree_add_uint_bits_format_value(tree, hf_seg3a_lai_mnc, tvb, ar->bit_offset+16, 8, (uint32_t)LAI->MNC, ENC_BIG_ENDIAN, "%d", LAI->MNC);
lac_item = proto_tree_add_uint_bits_format_value(tree, hf_seg3a_lai_lac, tvb, ar->bit_offset+24, 16, (uint32_t)LAI->LAC, ENC_BIG_ENDIAN, "0x%04x", LAI->LAC);
lac_tree = proto_item_add_subtree(lac_item, ett_csn1);
proto_tree_add_uint_bits_format_value(lac_tree, hf_seg3a_lai_msc_id, tvb, ar->bit_offset+24, 6, (uint32_t)LAI->MSC_ID, ENC_BIG_ENDIAN, "%d", LAI->MSC_ID);
proto_tree_add_uint_bits_format_value(lac_tree, hf_seg3a_lai_spot_beam_id, tvb, ar->bit_offset+30, 10, (uint32_t)LAI->Spot_Beam_ID, ENC_BIG_ENDIAN, "%d", LAI->Spot_Beam_ID);
ar->remaining_bits_len -= 5*8;
ar->bit_offset += 5*8;
return 0;
}
static const
CSN_DESCR_BEGIN(Seg3A_System_t)
M_UINT (Seg3A_System_t, Satellite_ID, 2, &hf_seg3a_system_sat_id),
M_UINT (Seg3A_System_t, System_ID, 4, &hf_seg3a_system_sys_id),
CSN_DESCR_END (Seg3A_System_t)
static const
CSN_DESCR_BEGIN(Seg3A_SatellitePosition_t)
M_UINT (Seg3A_SatellitePosition_t, Latitude, 8, &hf_seg3a_satpos_latitude),
M_UINT (Seg3A_SatellitePosition_t, Longitude, 12, &hf_seg3a_satpos_longitude),
M_UINT (Seg3A_SatellitePosition_t, Radius, 16, &hf_seg3a_satpos_radius),
CSN_DESCR_END (Seg3A_SatellitePosition_t)
static const
CSN_DESCR_BEGIN(Seg3A_BeamPosition_t)
M_UINT (Seg3A_BeamPosition_t, Latitude, 11, &hf_seg3a_beam_latitude),
M_UINT (Seg3A_BeamPosition_t, Longitude, 12, &hf_seg3a_beam_longitude),
CSN_DESCR_END (Seg3A_BeamPosition_t)
static const
CSN_DESCR_BEGIN(Seg3A_MiscInfo_t)
M_UINT (Seg3A_MiscInfo_t, SB_RESELECTION_TIMER, 6, &hf_seg3a_miscinfo_sb_reselection_timer),
CSN_DESCR_END (Seg3A_MiscInfo_t)
static const
CSN_DESCR_BEGIN(Segment3A_t)
M_FIXED_LABEL(Segment3A_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3A_t, 4, 0x0, "Segment type: A", &hf_seg3a_segment_type_a),
M_SERIALIZE (Segment3A_t, LAI, 0, &hf_seg3a_lai_dissector, Seg3A_LAI_Dissector),
M_TYPE_LABEL (Segment3A_t, System, Seg3A_System_t, "System"),
M_TYPE_LABEL (Segment3A_t, SatellitePosition, Seg3A_SatellitePosition_t, "Satellite Position"),
M_TYPE_LABEL (Segment3A_t, BeamPosition, Seg3A_BeamPosition_t, "Beam Center Position"),
M_TYPE_LABEL (Segment3A_t, MiscInfo, Seg3A_MiscInfo_t, "Misc Info Class 3"),
M_UINT (Segment3A_t, Spare, 4, &hf_seg3a_spare),
CSN_DESCR_END (Segment3A_t)
static const
CSN_DESCR_BEGIN(Segment3B_t)
M_FIXED_LABEL(Segment3B_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3B_t, 4, 0x1, "Segment type: B", &hf_seg3b_segment_type_b),
CSN_DESCR_END (Segment3B_t)
static const
CSN_DESCR_BEGIN(Segment3Bbis_t)
M_FIXED_LABEL(Segment3Bbis_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3Bbis_t, 4, 0x1, "Segment type: B bis", &hf_seg3b_segment_type_bbis),
CSN_DESCR_END (Segment3Bbis_t)
static const
CSN_DESCR_BEGIN(Segment3C_t)
M_FIXED_LABEL(Segment3C_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3C_t, 4, 0x2, "Segment type: C", &hf_seg3c_segment_type_c),
CSN_DESCR_END (Segment3C_t)
static const
CSN_DESCR_BEGIN(Segment3D_t)
M_FIXED_LABEL(Segment3D_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3D_t, 4, 0x3, "Segment type: D", &hf_seg3d_segment_type_d),
CSN_DESCR_END (Segment3D_t)
static const
CSN_DESCR_BEGIN(Segment3E_t)
M_FIXED_LABEL(Segment3E_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3E_t, 4, 0x4, "Segment type: E", &hf_seg3e_segment_type_e),
CSN_DESCR_END (Segment3E_t)
static const
CSN_DESCR_BEGIN(Segment3Ebis_t)
M_FIXED_LABEL(Segment3Ebis_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3Ebis_t, 4, 0x4, "Segment type: E bis", &hf_seg3e_segment_type_ebis),
CSN_DESCR_END (Segment3Ebis_t)
static const
CSN_DESCR_BEGIN(Segment3F_t)
M_FIXED_LABEL(Segment3F_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3F_t, 4, 0x5, "Segment type: F", &hf_seg3f_segment_type_f),
CSN_DESCR_END (Segment3F_t)
static const
CSN_DESCR_BEGIN(Segment3G_t)
M_FIXED_LABEL(Segment3G_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3G_t, 4, 0x6, "Segment type: G", &hf_seg3g_segment_type_g),
CSN_DESCR_END (Segment3G_t)
static const
CSN_DESCR_BEGIN(Segment3Gbis_t)
M_FIXED_LABEL(Segment3Gbis_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3Gbis_t, 4, 0x6, "Segment type: G bis", &hf_seg3g_segment_type_gbis),
CSN_DESCR_END (Segment3Gbis_t)
static const
CSN_DESCR_BEGIN(Segment3H_t)
M_FIXED_LABEL(Segment3H_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3H_t, 4, 0x7, "Segment type: H", &hf_seg3h_segment_type_h),
CSN_DESCR_END (Segment3H_t)
static const
CSN_DESCR_BEGIN(Segment3I_t)
M_FIXED_LABEL(Segment3I_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3I_t, 4, 0x9, "Segment type: I", &hf_seg3i_segment_type_i),
CSN_DESCR_END (Segment3I_t)
static const
CSN_DESCR_BEGIN(Segment3J_t)
M_FIXED_LABEL(Segment3J_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3J_t, 4, 0xa, "Segment type: J", &hf_seg3j_segment_type_j),
CSN_DESCR_END (Segment3J_t)
static const
CSN_DESCR_BEGIN(Segment3Jbis_t)
M_FIXED_LABEL(Segment3Jbis_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3Jbis_t, 4, 0xa, "Segment type: J bis", &hf_seg3j_segment_type_jbis),
CSN_DESCR_END (Segment3Jbis_t)
static const
CSN_DESCR_BEGIN(Segment3Kbis_t)
M_FIXED_LABEL(Segment3Kbis_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3Kbis_t, 4, 0xb, "Segment type: K bis", &hf_seg3k_segment_type_kbis),
CSN_DESCR_END (Segment3Kbis_t)
#if 0
static const
CSN_DESCR_BEGIN(Segment3L_t)
M_FIXED_LABEL(Segment3L_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3L_t, 4, 0xc, "Segment type: L", &hf_seg3l_segment_type_l),
CSN_DESCR_END (Segment3L_t)
#endif
#if 0
static const
CSN_DESCR_BEGIN(Segment3M_t)
M_FIXED_LABEL(Segment3M_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
M_FIXED_LABEL(Segment3M_t, 4, 0xd, "Segment type: M", &hf_seg3m_segment_type_m),
CSN_DESCR_END (Segment3M_t)
#endif
static const
CSN_DESCR_BEGIN(Segment4A_t)
M_FIXED_LABEL(Segment4A_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
M_FIXED_LABEL(Segment4A_t, 4, 0x0, "Segment type: A", &hf_seg4a_segment_type_a),
CSN_DESCR_END (Segment4A_t)
static const
CSN_DESCR_BEGIN(Segment4B_t)
M_FIXED_LABEL(Segment4B_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
M_FIXED_LABEL(Segment4B_t, 4, 0x1, "Segment type: B", &hf_seg4b_segment_type_b),
CSN_DESCR_END (Segment4B_t)
static const
CSN_DESCR_BEGIN(Segment4C_t)
M_FIXED_LABEL(Segment4C_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
M_FIXED_LABEL(Segment4C_t, 4, 0x2, "Segment type: C", &hf_seg4c_segment_type_c),
CSN_DESCR_END (Segment4C_t)
static const
CSN_DESCR_BEGIN(Segment4D_t)
M_FIXED_LABEL(Segment4D_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
M_FIXED_LABEL(Segment4D_t, 4, 0x3, "Segment type: D", &hf_seg4d_segment_type_d),
CSN_DESCR_END (Segment4D_t)
static const
CSN_DESCR_BEGIN(Segment4E_t)
M_FIXED_LABEL(Segment4E_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
M_FIXED_LABEL(Segment4E_t, 4, 0x4, "Segment type: E", &hf_seg4e_segment_type_e),
CSN_DESCR_END (Segment4E_t)
static const
CSN_DESCR_BEGIN(Segment4F_t)
M_FIXED_LABEL(Segment4F_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
M_FIXED_LABEL(Segment4F_t, 4, 0x5, "Segment type: F", &hf_seg4f_segment_type_f),
CSN_DESCR_END (Segment4F_t)
static const
CSN_DESCR_BEGIN(Segment4G_t)
M_FIXED_LABEL(Segment4G_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
M_FIXED_LABEL(Segment4G_t, 4, 0x6, "Segment type: G", &hf_seg4g_segment_type_g),
CSN_DESCR_END (Segment4G_t)
static const
CSN_DESCR_BEGIN(Segment4H_t)
M_FIXED_LABEL(Segment4H_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
M_FIXED_LABEL(Segment4H_t, 4, 0x7, "Segment type: H", &hf_seg4h_segment_type_h),
CSN_DESCR_END (Segment4H_t)
static const
CSN_DESCR_BEGIN(Segment4I_t)
M_FIXED_LABEL(Segment4I_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
M_FIXED_LABEL(Segment4I_t, 4, 0x8, "Segment type: I", &hf_seg4i_segment_type_i),
CSN_DESCR_END (Segment4I_t)
static const
CSN_DESCR_BEGIN(Segment4J_t)
M_FIXED_LABEL(Segment4J_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
M_FIXED_LABEL(Segment4J_t, 4, 0x9, "Segment type: J", &hf_seg4j_segment_type_j),
CSN_DESCR_END (Segment4J_t)
static const
CSN_DESCR_BEGIN(Segment4K_t)
M_FIXED_LABEL(Segment4K_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
M_FIXED_LABEL(Segment4K_t, 4, 0xa, "Segment type: K", &hf_seg4k_segment_type_k),
CSN_DESCR_END (Segment4K_t)
/* System information */
/* System Information type 1 - [1] 10.1.31 */
static const
CSN_DESCR_BEGIN(SI1_Block_Header_t)
M_UINT (SI1_Block_Header_t, Protocol_Version, 4, &hf_si_protocol_version),
M_UINT (SI1_Block_Header_t, Block_Type, 1, &hf_si_block_type),
M_UINT (SI1_Block_Header_t, Randomization_Period, 2, &hf_si1_randomization_period),
M_UINT (SI1_Block_Header_t, Spare, 1, &hf_si_spare),
CSN_DESCR_END (SI1_Block_Header_t)
static const
CSN_ChoiceElement_t SI1_SegmentChoice[] =
{
{6, 0x20, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment2Abis, Segment2Abis_t, "Segment 2A bis")},
{6, 0x21, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment2Bbis, Segment2Bbis_t, "Segment 2B bis")},
{5, 0x00, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3A, Segment3A_t, "Segment 3A")},
{5, 0x01, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3Bbis, Segment3Bbis_t, "Segment 3B bis")},
{5, 0x02, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3C, Segment3C_t, "Segment 3C")},
{5, 0x03, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3D, Segment3D_t, "Segment 3D")},
{5, 0x04, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3Ebis, Segment3Ebis_t, "Segment 3E bis")},
{5, 0x05, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3F, Segment3F_t, "Segment 3F")},
{5, 0x06, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3Gbis, Segment3Gbis_t, "Segment 3G bis")},
{5, 0x07, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3H, Segment3H_t, "Segment 3H")},
{5, 0x09, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3I, Segment3I_t, "Segment 3I")},
{5, 0x0a, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3Jbis, Segment3Jbis_t, "Segment 3J bis")},
{5, 0x0b, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3Kbis, Segment3Kbis_t, "Segment 3K bis")},
{7, 0x60, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4A, Segment4A_t, "Segment 4A")},
{7, 0x61, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4B, Segment4B_t, "Segment 4B")},
{7, 0x62, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4C, Segment4C_t, "Segment 4C")},
{7, 0x63, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4D, Segment4D_t, "Segment 4D")},
{7, 0x64, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4E, Segment4E_t, "Segment 4E")},
{7, 0x65, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4F, Segment4F_t, "Segment 4F")},
{7, 0x66, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4G, Segment4G_t, "Segment 4G")},
{7, 0x67, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4H, Segment4H_t, "Segment 4H")},
{7, 0x68, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4I, Segment4I_t, "Segment 4I")},
{7, 0x69, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4J, Segment4J_t, "Segment 4J")},
{7, 0x6a, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4K, Segment4K_t, "Segment 4K")},
{0, 0x00, 1, CSN_ERROR(SystemInformation1_t, "Unknown segment !", -1, &ei_unknown_segment)},
};
static const
CSN_DESCR_BEGIN(SystemInformation1_t)
M_TYPE_LABEL (SystemInformation1_t, Block_Header, SI1_Block_Header_t, "Block Header"),
M_TYPE_LABEL (SystemInformation1_t, Segment1A, Segment1A_t, "Segment 1A"),
M_CHOICE_IL (SystemInformation1_t, SegmentType, SI1_SegmentChoice, array_length(SI1_SegmentChoice), &hf_si1_segment_choice),
CSN_DESCR_END (SystemInformation1_t)
/* System Information type 2 - [1] 10.1.32 */
static CSN_DESCR_BEGIN(SI2_Block_Header_t)
M_UINT (SI2_Block_Header_t, Protocol_Version, 4, &hf_si_protocol_version),
M_UINT (SI2_Block_Header_t, Block_Type, 1, &hf_si_block_type),
M_UINT (SI2_Block_Header_t, Spare, 3, &hf_si_spare),
CSN_DESCR_END (SI2_Block_Header_t)
static const
CSN_ChoiceElement_t SI2_SegmentChoice[] =
{
{6, 0x20, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment2A, Segment2A_t, "Segment 2A")},
{6, 0x21, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment2B, Segment2B_t, "Segment 2B")},
{5, 0x01, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment3B, Segment3B_t, "Segment 3B")},
{5, 0x04, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment3E, Segment3E_t, "Segment 3E")},
{5, 0x06, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment3G, Segment3G_t, "Segment 3G")},
{5, 0x0a, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment3J, Segment3J_t, "Segment 3J")},
{0, 0x00, 1, CSN_ERROR(SystemInformation2_t, "Unknown segment !", -1, &ei_unknown_segment)},
};
static const
CSN_DESCR_BEGIN(SystemInformation2_t)
M_TYPE_LABEL (SystemInformation2_t, Block_Header, SI2_Block_Header_t, "Block Header"),
M_CHOICE_IL (SystemInformation2_t, SegmentType, SI2_SegmentChoice, array_length(SI2_SegmentChoice), &hf_si1_segment_choice),
CSN_DESCR_END (SystemInformation2_t)
/* ------------------------------------------------------------------------ */
/* Fields values */
/* ------------------------------------------------------------------------ */
/* Common stuff */
static void
segx_half_db_value_fmt(char *s, uint32_t v)
{
snprintf(s, ITEM_LABEL_LENGTH, "%2.1f dB (%u)", v * 0.5f, v);
}
/* Segment 1A - [3] 11.5.2.66 */
static void
seg1a_syncinfo_sa_freq_offset_fmt(char *s, uint32_t v)
{
int32_t sv = (int32_t)v;
snprintf(s, ITEM_LABEL_LENGTH, "%d Hz (%d)", sv * 5, sv);
}
static const value_string seg1a_rachctrl_acc_vals[] = {
{ 0, "not barred (allowed)"},
{ 1, "barred (not allowed)"},
{ 0, NULL }
};
static const value_string seg1a_rachctrl_cell_bar_access_vals[] = {
{ 0, "The cell is not barred"},
{ 1, "The cell is barred"},
{ 0, NULL }
};
/* Segment 2A & 2Abis - [1] 11.5.2.67 & 11.5.2.68 */
static const value_string seg2a_lainfo_imsi_attach_detach_ind_vals[] = {
{ 0, "MESs shall NOT apply IMSI attach and detach procedure for this LA"},
{ 1, "MESs shall apply IMSI attach and detach procedure for this LA"},
{ 0, NULL }
};
static const value_string seg2a_lainfo_ecsc_indication_vals[] = {
{ 0, "Early sending is explicitly prohibited"},
{ 1, "Early sending is explicitly accepted"},
{ 0, NULL }
};
/* Segment 3A - [1] 11.5.2.71 */
static void
seg3a_latitude_fmt(char *s, uint32_t v)
{
int32_t sv = (int32_t)v;
char c;
if (sv < 0) {
c = 'S';
sv = -sv;
} else
c = 'N';
snprintf(s, ITEM_LABEL_LENGTH, "%.1f %c (%d)", sv / 10.0f, c, sv);
}
static void
seg3a_longitude_fmt(char *s, uint32_t v)
{
int32_t sv;
char c;
if (v < 1800) {
c = 'W';
sv = v;
} else {
c = 'E';
sv = 3600 - v;
}
snprintf(s, ITEM_LABEL_LENGTH, "%.1f %c (%u)", sv / 10.0f, c, v);
}
static void
seg3a_satpos_radius_fmt(char *s, uint32_t v)
{
int32_t sv = (int32_t)v;
int32_t a = (42162 * 1000) + (sv * 5);
snprintf(s, ITEM_LABEL_LENGTH, "%.3lf km (%u)", a / 1000.0, sv);
}
static void
seg3a_miscinfo_sb_reselection_timer_fmt(char *s, uint32_t v)
{
snprintf(s, ITEM_LABEL_LENGTH, "%d minutes (%u)", v*4, v);
}
/* System Information 1 - [1] 10.3.31 */
static const value_string si1_randomization_period_vals[] = {
{ 0, "7 frames after this SI block" },
{ 1, "15 frames after this SI block" },
{ 2, "23 frames after this SI block" },
{ 3, "31 frames after this SI block" },
{ 0, NULL }
};
/* ------------------------------------------------------------------------ */
/* Dissector code */
/* ------------------------------------------------------------------------ */
static int
dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dissector_data _U_)
{
proto_item *bcch_item = NULL;
proto_tree *bcch_tree = NULL;
csnStream_t ar;
bool is_si1;
col_append_str(pinfo->cinfo, COL_INFO, "(BCCH) ");
is_si1 = tvb_get_bits8(tvb, 0, 5) & 1;
bcch_item = proto_tree_add_protocol_format(
tree, proto_gmr1_bcch, tvb, 0, -1,
"GMR-1 BCCH - System Information type %d", is_si1 ? 1 : 2
);
bcch_tree = proto_item_add_subtree(bcch_item, ett_gmr1_bcch);
csnStreamInit(&ar, 0, tvb_captured_length(tvb)*8, pinfo);
/* SI1 or SI2 */
if (is_si1) {
SystemInformation1_t *data;
data = wmem_new(pinfo->pool, SystemInformation1_t);
/* Initialize the type to the last element, which is an
* "Unknown", in case the dissector bails before getting this
* far. */
data->SegmentType = array_length(SI1_SegmentChoice) - 1;
csnStreamDissector(bcch_tree, &ar, CSNDESCR(SystemInformation1_t), tvb, data, ett_gmr1_bcch);
col_append_fstr(
pinfo->cinfo, COL_INFO,
"System Information 1: Segment 1A, %s",
SI1_SegmentChoice[data->SegmentType].descr.sz
);
} else {
SystemInformation2_t *data;
data = wmem_new(pinfo->pool, SystemInformation2_t);
/* Initialize the type to the last element, which is an
* "Unknown", in case the dissector bails before getting this
* far. */
data->SegmentType = array_length(SI2_SegmentChoice) - 1;
csnStreamDissector(bcch_tree, &ar, CSNDESCR(SystemInformation2_t), tvb, data, ett_gmr1_bcch);
col_append_fstr(
pinfo->cinfo, COL_INFO,
"System Information 2: %s",
SI2_SegmentChoice[data->SegmentType].descr.sz
);
}
return tvb_captured_length(tvb);
}
void
proto_register_gmr1_bcch(void)
{
static hf_register_info hf[] = {
/* Segment 1A - [3] 11.5.2.66 */
{ &hf_seg1a_class_2_version,
{ "Class 2 version", "gmr1.bcch.seg1a.class_2_version",
FT_UINT8, BASE_DEC, NULL, 0x00,
"Version number for current Class 2 information", HFILL }
},
{ &hf_seg1a_class_3_version,
{ "Class 3 version", "gmr1.bcch.seg1a.class_3_version",
FT_UINT8, BASE_DEC, NULL, 0x00,
"Version number for current Class 3 information", HFILL }
},
{ &hf_seg1a_syncinfo_sb_frame_ts_offset,
{ "SB_FRAME_TS_OFFSET", "gmr1.bcch.seg1a.syncinfo.sb_frame_ts_offset",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg1a_syncinfo_sb_symbol_offset,
{ "SB_SYMBOL_OFFSET", "gmr1.bcch.seg1a.syncinfo.sb_symbol_offset",
FT_INT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg1a_syncinfo_sa_freq_offset,
{ "SA_FREQ_OFFSET", "gmr1.bcch.seg1a.syncinfo.sa_freq_offset",
FT_UINT8, BASE_CUSTOM, CF_FUNC(seg1a_syncinfo_sa_freq_offset_fmt), 0x00,
NULL, HFILL }
},
{ &hf_seg1a_rachctrl_max_retrans,
{ "Max Retrans", "gmr1.bcch.seg1a.rachctrl.max_retrans",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg1a_rachctrl_acc[15],
{ "AC15", "gmr1.bcch.seg1a.rachctrl.ac15",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Access Class 15 barred", HFILL }
},
{ &hf_seg1a_rachctrl_acc[14],
{ "AC14", "gmr1.bcch.seg1a.rachctrl.ac14",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Access Class 14 barred", HFILL }
},
{ &hf_seg1a_rachctrl_acc[13],
{ "AC13", "gmr1.bcch.seg1a.rachctrl.ac13",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Access Class 13 barred", HFILL }
},
{ &hf_seg1a_rachctrl_acc[12],
{ "AC12", "gmr1.bcch.seg1a.rachctrl.ac12",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Access Class 12 barred", HFILL }
},
{ &hf_seg1a_rachctrl_acc[11],
{ "AC11", "gmr1.bcch.seg1a.rachctrl.ac11",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Access Class 11 barred", HFILL }
},
{ &hf_seg1a_rachctrl_acc[10],
{ "EC10", "gmr1.bcch.seg1a.rachctrl.ac10",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Emergency Class 10 barred", HFILL }
},
{ &hf_seg1a_rachctrl_acc[9],
{ "AC9", "gmr1.bcch.seg1a.rachctrl.ac9",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Access Class 9 barred", HFILL }
},
{ &hf_seg1a_rachctrl_acc[8],
{ "AC8", "gmr1.bcch.seg1a.rachctrl.ac8",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Access Class 8 barred", HFILL }
},
{ &hf_seg1a_rachctrl_acc[7],
{ "AC7", "gmr1.bcch.seg1a.rachctrl.ac7",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Access Class 7 barred", HFILL }
},
{ &hf_seg1a_rachctrl_acc[6],
{ "AC6", "gmr1.bcch.seg1a.rachctrl.ac6",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Access Class 6 barred", HFILL }
},
{ &hf_seg1a_rachctrl_acc[5],
{ "AC5", "gmr1.bcch.seg1a.rachctrl.ac5",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Access Class 5 barred", HFILL }
},
{ &hf_seg1a_rachctrl_acc[4],
{ "AC4", "gmr1.bcch.seg1a.rachctrl.ac4",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Access Class 4 barred", HFILL }
},
{ &hf_seg1a_rachctrl_acc[3],
{ "AC3", "gmr1.bcch.seg1a.rachctrl.ac3",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Access Class 3 barred", HFILL }
},
{ &hf_seg1a_rachctrl_acc[2],
{ "AC2", "gmr1.bcch.seg1a.rachctrl.ac2",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Access Class 2 barred", HFILL }
},
{ &hf_seg1a_rachctrl_acc[1],
{ "AC1", "gmr1.bcch.seg1a.rachctrl.ac1",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Access Class 1 barred", HFILL }
},
{ &hf_seg1a_rachctrl_acc[0],
{ "AC0", "gmr1.bcch.seg1a.rachctrl.ac0",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
"Access Class 0 barred", HFILL }
},
{ &hf_seg1a_rachctrl_cell_bar_access,
{ "CELL_BAR_ACCESS", "gmr1.bcch.seg1a.rachctrl.cell_bar_access",
FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_cell_bar_access_vals), 0x00,
NULL, HFILL }
},
{ &hf_seg1a_miscinfo_sb_reselection_hysteresis,
{ "SB_RESELECTION_HYSTERESIS", "gmr1.bcch.seg1a.miscinfo.sb_reselection_hysteresis",
FT_UINT8, BASE_CUSTOM, CF_FUNC(segx_half_db_value_fmt), 0x00,
NULL, HFILL }
},
{ &hf_seg1a_miscinfo_spare,
{ "Spare", "gmr1.bcch.seg1a.miscinfo.spare",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg1a_miscinfo_priority_access_ind,
{ "Priority Access Ind", "gmr1.bcch.seg1a.miscinfo.priority_access_ind",
FT_UINT8, BASE_DEC, NULL, 0x00,
"Reserved for future use", HFILL }
},
{ &hf_seg1a_gbch_present,
{ "GBCH Present", "gmr1.bcch.seg1a.gbch_present",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg1a_test_gs,
{ "Test GS", "gmr1.bcch.seg1a.test_gs",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg1a_test_gs2,
{ "Test GS2", "gmr1.bcch.seg1a.test_gs2",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg1a_spare1,
{ "Spare", "gmr1.bcch.seg1a.spare1",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg1a_cell_bar_access_extension2,
{ "CELL_BAR_ACCESS_EXTENSION2", "gmr1.bcch.seg1a.cell_bar_access_extension2",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg1a_spare2,
{ "Spare", "gmr1.bcch.seg1a.spare2",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg1a_cell_bar_access_extension,
{ "CELL_BAR_ACCESS_EXTENSION", "gmr1.bcch.seg1a.cell_bar_access_extension",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
/* Segment 2A - [1] 11.5.2.67 */
{ &hf_seg2a_class_4_version,
{ "Class 4 version", "gmr1.bcch.seg2a.class_4_version",
FT_UINT8, BASE_DEC, NULL, 0x00,
"Version number for current Class 4 information", HFILL }
},
{ &hf_seg2a_syncinfo_sa_sirfn_delay,
{ "SA_SIRFN_DELAY", "gmr1.bcch.seg2a.syncinfo.sa_sirfn_delay",
FT_UINT8, BASE_DEC, NULL, 0x00,
"Delay of system information relative to superframe", HFILL }
},
{ &hf_seg2a_syncinfo_sa_bcch_stn,
{ "SA_BCCH_STN", "gmr1.bcch.seg2a.syncinfo.sa_bcch_stn",
FT_UINT8, BASE_DEC, NULL, 0x00,
"Starting timeslot number", HFILL }
},
{ &hf_seg2a_syncinfo_superframe_num,
{ "Superframe Number", "gmr1.bcch.seg2a.syncinfo.superframe_num",
FT_UINT16, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg2a_syncinfo_multiframe_num,
{ "Multiframe Number", "gmr1.bcch.seg2a.syncinfo.multiframe_num",
FT_UINT8, BASE_DEC, NULL, 0x00,
"Multiframe number in a superframe", HFILL }
},
{ &hf_seg2a_syncinfo_mffn_high_bit,
{ "MFFN high bit", "gmr1.bcch.seg2a.syncinfo.mffn_high_bit",
FT_UINT8, BASE_DEC, NULL, 0x00,
"High bit of the TDMA FN in a multiframe", HFILL }
},
{ &hf_seg2a_selcrit_rxlev_select_min,
{ "RXLEV_SELECT_MIN", "gmr1.bcch.seg2a.selcrit.rxlev_select_min",
FT_UINT8, BASE_CUSTOM, CF_FUNC(segx_half_db_value_fmt), 0x00,
"Adjustment to threshold to camp-on system", HFILL }
},
{ &hf_seg2a_miscinfo_sb_selection_power,
{ "SB_SELECTION_POWER", "gmr1.bcch.seg2a.miscinfo.sb_selection_power",
FT_UINT8, BASE_CUSTOM, CF_FUNC(segx_half_db_value_fmt), 0x00,
NULL, HFILL }
},
{ &hf_seg2a_lainfo_sa_pch_config,
{ "SA_PCH_CONFIG", "gmr1.bcch.seg2a.lainfo.sa_pch_config",
FT_UINT8, BASE_DEC, NULL, 0x00,
"Paging group configuration information", HFILL }
},
{ &hf_seg2a_lainfo_sa_bach_config,
{ "SA_BACH_CONFIG", "gmr1.bcch.seg2a.lainfo.sa_bach_config",
FT_UINT8, BASE_DEC, NULL, 0x00,
"Alerting group configuration information", HFILL }
},
{ &hf_seg2a_lainfo_rach_ts_offset,
{ "RACH_TS_OFFSET", "gmr1.bcch.seg2a.lainfo.rach_ts_offset",
FT_UINT8, BASE_DEC, NULL, 0x00,
"Start of RACH window with respect to BCCH", HFILL }
},
{ &hf_seg2a_lainfo_n_page_occurrences,
{ "N Page Occurrences", "gmr1.bcch.seg2a.lainfo.n_page_occurrences",
FT_UINT8, BASE_DEC, NULL, 0x00,
"Number of times a page shall be retransmitted after the initial transmission", HFILL }
},
{ &hf_seg2a_lainfo_imsi_attach_detach_ind,
{ "IMSI attach-detach ind", "gmr1.bcch.seg2a.lainfo.imsi_attach_detach_ind",
FT_UINT8, BASE_DEC, VALS(seg2a_lainfo_imsi_attach_detach_ind_vals), 0x00,
"Should MESs apply IMSI attach and detach procedure for this LA", HFILL }
},
{ &hf_seg2a_lainfo_ecsc_indication,
{ "ECSC indication", "gmr1.bcch.seg2a.lainfo.ecsc_indication",
FT_UINT8, BASE_DEC, VALS(seg2a_lainfo_ecsc_indication_vals), 0x00,
"Early Classmark Sending Control", HFILL }
},
{ &hf_seg2a_lainfo_si_update_ind,
{ "SI update ind", "gmr1.bcch.seg2a.lainfo.si_update_ind",
FT_UINT8, BASE_DEC, NULL, 0x00,
"Flag for BACH reorganization. Value changes after each reorganization", HFILL }
},
{ &hf_seg2a_class_type,
{ "Class type: 2", "gmr1.bcch.seg2a.class_type",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg2a_segment_type_a,
{ "Segment type: A", "gmr1.bcch.seg2a.segment_type_a",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg2a_segment_type_abis,
{ "Segment type: Abis", "gmr1.bcch.seg2a.segment_type_abis",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg2b_segment_type_b,
{ "Segment type: B", "gmr1.bcch.seg2b.segment_type_b",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg2b_segment_type_bbis,
{ "Segment type: B bis", "gmr1.bcch.seg2b.segment_type_bbis",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
/* Segment 3A - [1] 11.5.2.71 */
{ &hf_seg3a_class_type,
{ "Class type: 3", "gmr1.bcch.seg3a.class_type",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3a_segment_type_a,
{ "Segment type: A", "gmr1.bcch.seg3a.segment_type_a",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3a_lai_dissector,
{ "LAI Dissector length", "gmr1.bcch.seg3a.lai_dissector",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3a_lai_mcc,
{ "Mobile Country Code (MCC)", "gmr1.bcch.seg3a.lai.mcc",
FT_UINT16, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3a_lai_mnc,
{ "Mobile Network Code (MNC)", "gmr1.bcch.seg3a.lai.mnc",
FT_UINT16, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3a_lai_lac,
{ "Location Area Code (LAC)", "gmr1.bcch.seg3a.lai.lac",
FT_UINT16, BASE_HEX, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3a_lai_msc_id,
{ "MSC ID", "gmr1.bcch.seg3a.lai.msc_id",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3a_lai_spot_beam_id,
{ "Spot Beam ID", "gmr1.bcch.seg3a.lai.spot_beam_id",
FT_UINT16, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3a_system_sat_id,
{ "Satellite ID", "gmr1.bcch.seg3a.system.sat_id",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3a_system_sys_id,
{ "System ID", "gmr1.bcch.seg3a.system.sys_id",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3a_satpos_latitude,
{ "Latitude", "gmr1.bcch.seg3a.satpos.latitude",
FT_INT8, BASE_CUSTOM, CF_FUNC(seg3a_latitude_fmt), 0x00,
NULL, HFILL }
},
{ &hf_seg3a_satpos_longitude,
{ "Longitude", "gmr1.bcch.seg3a.satpos.longitude",
FT_UINT16, BASE_CUSTOM, CF_FUNC(seg3a_longitude_fmt), 0x00,
NULL, HFILL }
},
{ &hf_seg3a_satpos_radius,
{ "Radius", "gmr1.bcch.seg3a.satpos.radius",
FT_INT16, BASE_CUSTOM, CF_FUNC(seg3a_satpos_radius_fmt), 0x00,
NULL, HFILL }
},
{ &hf_seg3a_beam_latitude,
{ "Latitude", "gmr1.bcch.seg3a.beam.latitude",
FT_INT16, BASE_CUSTOM, CF_FUNC(seg3a_latitude_fmt), 0x00,
NULL, HFILL }
},
{ &hf_seg3a_beam_longitude,
{ "Longitude", "gmr1.bcch.seg3a.beam.longitude",
FT_UINT16, BASE_CUSTOM, CF_FUNC(seg3a_longitude_fmt), 0x00,
NULL, HFILL }
},
{ &hf_seg3a_miscinfo_sb_reselection_timer,
{ "SB_RESELECTION_TIMER", "gmr1.bcch.seg3a.sb_reselection_timer",
FT_UINT8, BASE_CUSTOM, CF_FUNC(seg3a_miscinfo_sb_reselection_timer_fmt), 0x00,
NULL, HFILL }
},
{ &hf_seg3a_spare,
{ "Spare", "gmr1.bcch.seg3a.spare",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3b_segment_type_b,
{ "Segment type: B", "gmr1.bcch.seg3b.segment_type_b",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3b_segment_type_bbis,
{ "Segment type: B bis", "gmr1.bcch.seg3b.segment_type_bbis",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3c_segment_type_c,
{ "Segment type: C", "gmr1.bcch.seg3c.segment_type_c",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3d_segment_type_d,
{ "Segment type: D", "gmr1.bcch.seg3d.segment_type_d",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3e_segment_type_e,
{ "Segment type: E", "gmr1.bcch.seg3e.segment_type_e",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3e_segment_type_ebis,
{ "Segment type: E bis", "gmr1.bcch.seg3e.segment_type_ebis",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3f_segment_type_f,
{ "Segment type: F", "gmr1.bcch.seg3f.segment_type_f",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3g_segment_type_g,
{ "Segment type: G", "gmr1.bcch.seg3g.segment_type_g",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3g_segment_type_gbis,
{ "Segment type: G bis", "gmr1.bcch.seg3g.segment_type_gbis",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3h_segment_type_h,
{ "Segment type: H", "gmr1.bcch.seg3h.segment_type_h",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3i_segment_type_i,
{ "Segment type: I", "gmr1.bcch.seg3i.segment_type_i",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3j_segment_type_j,
{ "Segment type: J", "gmr1.bcch.seg3j.segment_type_j",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3j_segment_type_jbis,
{ "Segment type: J bis", "gmr1.bcch.seg3j.segment_type_jbis",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg3k_segment_type_kbis,
{ "Segment type: K bis", "gmr1.bcch.seg3k.segment_type_kbis",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg4a_class_type,
{ "Class type: 4", "gmr1.bcch.seg4a.class_type",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg4a_segment_type_a,
{ "Segment type: A", "gmr1.bcch.seg3a.segment_type_a",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg4b_segment_type_b,
{ "Segment type: B", "gmr1.bcch.seg3b.segment_type_b",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg4c_segment_type_c,
{ "Segment type: C", "gmr1.bcch.seg3c.segment_type_c",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg4d_segment_type_d,
{ "Segment type: D", "gmr1.bcch.seg3d.segment_type_d",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg4e_segment_type_e,
{ "Segment type: E", "gmr1.bcch.seg3e.segment_type_e",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg4f_segment_type_f,
{ "Segment type: F", "gmr1.bcch.seg3f.segment_type_f",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg4g_segment_type_g,
{ "Segment type: G", "gmr1.bcch.seg3g.segment_type_g",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg4h_segment_type_h,
{ "Segment type: H", "gmr1.bcch.seg3h.segment_type_h",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg4i_segment_type_i,
{ "Segment type: I", "gmr1.bcch.seg3i.segment_type_i",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg4j_segment_type_j,
{ "Segment type: J", "gmr1.bcch.seg3j.segment_type_j",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_seg4k_segment_type_k,
{ "Segment type: K", "gmr1.bcch.seg3k.segment_type_k",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
/* System Information fields - [1] 10.1.31 & 10.1.32 */
{ &hf_si1_segment_choice,
{ "Segment Choice", "gmr1.bcch.si.segment_choice",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_si_protocol_version,
{ "Protocol version", "gmr1.bcch.si.protocol_version",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_si_block_type,
{ "Block Type", "gmr1.bcch.si.block_type",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_si_spare,
{ "Spare", "gmr1.bcch.si.spare",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_si1_randomization_period,
{ "Randomization Period", "gmr1.bcch.si.randomization_period",
FT_UINT8, BASE_DEC, VALS(si1_randomization_period_vals), 0x00,
NULL, HFILL }
},
};
static int *ett[] = {
&ett_gmr1_bcch,
};
static ei_register_info ei[] = {
{ &ei_unknown_segment, { "gmr1.bcch.unknown_segment", PI_PROTOCOL, PI_WARN, "Unknown segment!", EXPFILL }},
};
expert_module_t* expert_gmr1_bcch;
proto_gmr1_bcch = proto_register_protocol("GEO-Mobile Radio (1) BCCH", "GMR-1 BCCH", "gmr1.bcch");
proto_register_field_array(proto_gmr1_bcch, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_gmr1_bcch = expert_register_protocol(proto_gmr1_bcch);
expert_register_field_array(expert_gmr1_bcch, ei, array_length(ei));
register_dissector("gmr1_bcch", dissect_gmr1_bcch, proto_gmr1_bcch);
}
/*
* Editor modelines - https://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:
*/
|