3 * Routines for GMR-1 BCCH dissection in wireshark.
4 * Copyright (c) 2011 Sylvain Munaut <tnt@246tNt.com>
7 * [1] ETSI TS 101 376-4-8 V1.3.1 - GMR-1 04.008
8 * [2] ETSI TS 101 376-4-8 V2.2.1 - GMPRS-1 04.008
9 * [3] ETSI TS 101 376-4-8 V3.1.1 - GMR-1 3G 44.008
11 * Wireshark - Network traffic analyzer
12 * By Gerald Combs <gerald@wireshark.org>
13 * Copyright 1998 Gerald Combs
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
33 #include <epan/packet.h>
34 #include <epan/wmem/wmem.h>
36 #include "packet-csn1.h"
38 void proto_register_gmr1_bcch(void);
40 /* GMR-1 BCCH proto */
41 static int proto_gmr1_bcch = -1;
43 /* GMR-1 BCCH sub tree */
44 static gint ett_gmr1_bcch = -1;
47 /* ------------------------------------------------------------------------ */
49 /* ------------------------------------------------------------------------ */
51 /* Segment 1A fields - [3] 11.5.2.66 */
52 static int hf_seg1a_class_2_version = -1;
53 static int hf_seg1a_class_3_version = -1;
55 static int hf_seg1a_syncinfo_sb_frame_ts_offset = -1;
56 static int hf_seg1a_syncinfo_sb_symbol_offset = -1;
57 static int hf_seg1a_syncinfo_sa_freq_offset = -1;
59 static int hf_seg1a_rachctrl_max_retrans = -1;
60 static int hf_seg1a_rachctrl_acc[16] = { -1, -1, -1, -1, -1, -1, -1, -1,
61 -1, -1, -1, -1, -1, -1, -1, -1 };
62 static int hf_seg1a_rachctrl_cell_bar_access = -1;
64 static int hf_seg1a_miscinfo_sb_reselection_hysteresis = -1;
65 static int hf_seg1a_miscinfo_spare = -1;
66 static int hf_seg1a_miscinfo_priority_access_ind = -1;
68 static int hf_seg1a_gbch_present = -1;
69 static int hf_seg1a_test_gs = -1;
70 static int hf_seg1a_test_gs2 = -1;
71 static int hf_seg1a_spare1 = -1;
72 static int hf_seg1a_cell_bar_access_extension2 = -1;
73 static int hf_seg1a_spare2 = -1;
74 static int hf_seg1a_cell_bar_access_extension = -1;
76 /* Segment 2A & 2Abis fields - [3] 11.5.2.67 / 11.5.2.68 */
77 static int hf_seg2a_class_4_version = -1;
79 static int hf_seg2a_syncinfo_sa_sirfn_delay = -1;
80 static int hf_seg2a_syncinfo_sa_bcch_stn = -1;
81 static int hf_seg2a_syncinfo_superframe_num = -1;
82 static int hf_seg2a_syncinfo_multiframe_num = -1;
83 static int hf_seg2a_syncinfo_mffn_high_bit = -1;
85 static int hf_seg2a_selcrit_rxlev_select_min = -1;
87 static int hf_seg2a_miscinfo_sb_selection_power = -1;
89 static int hf_seg2a_lainfo_sa_pch_config = -1;
90 static int hf_seg2a_lainfo_sa_bach_config = -1;
91 static int hf_seg2a_lainfo_rach_ts_offset = -1;
92 static int hf_seg2a_lainfo_n_page_occurrences = -1;
93 static int hf_seg2a_lainfo_imsi_attach_detach_ind = -1;
94 static int hf_seg2a_lainfo_ecsc_indication = -1;
95 static int hf_seg2a_lainfo_si_update_ind = -1;
97 /* Segment 2B fields */
98 /* Segment 2Bbis fields */
100 /* Segment 3A fields - [1] 11.5.2.71 */
101 static int hf_seg3a_lai_mcc = -1;
102 static int hf_seg3a_lai_mnc = -1;
103 static int hf_seg3a_lai_lac = -1;
104 static int hf_seg3a_lai_msc_id = -1;
105 static int hf_seg3a_lai_spot_beam_id = -1;
107 static int hf_seg3a_system_sat_id = -1;
108 static int hf_seg3a_system_sys_id = -1;
110 static int hf_seg3a_satpos_latitude = -1;
111 static int hf_seg3a_satpos_longitude = -1;
112 static int hf_seg3a_satpos_radius = -1;
114 static int hf_seg3a_beam_latitude = -1;
115 static int hf_seg3a_beam_longitude = -1;
117 static int hf_seg3a_miscinfo_sb_reselection_timer = -1;
119 static int hf_seg3a_spare = -1;
121 /* Segment 3B fields */
122 /* Segment 3Bbis fields */
123 /* Segment 3C fields */
124 /* Segment 3D fields */
125 /* Segment 3E fields */
126 /* Segment 3Ebis fields */
127 /* Segment 3F fields */
128 /* Segment 3G fields */
129 /* Segment 3Gbis fields */
130 /* Segment 3H fields */
131 /* Segment 3I fields */
132 /* Segment 3J fields */
133 /* Segment 3Jbis fields */
134 /* Segment 3Kbis fields */
135 /* Segment 3L fields */
136 /* Segment 3M fields */
137 /* Segment 4A fields */
138 /* Segment 4B fields */
139 /* Segment 4C fields */
140 /* Segment 4D fields */
141 /* Segment 4E fields */
142 /* Segment 4F fields */
143 /* Segment 4G fields */
144 /* Segment 4H fields */
145 /* Segment 4I fields */
146 /* Segment 4J fields */
147 /* Segment 4K fields */
149 /* System Information fields [1] 10.1.31 & 10.1.32 */
150 static int hf_si_protocol_version = -1;
151 static int hf_si_block_type = -1;
152 static int hf_si_spare = -1;
154 static int hf_si1_randomization_period = -1;
157 /* ------------------------------------------------------------------------ */
158 /* CSN1 parsing structure */
159 /* ------------------------------------------------------------------------ */
161 /* Segments structures */
163 /* Segment 1A - [3] 11.5.2.66 */
165 guint8 SB_FRAME_TS_OFFSET;
166 gint8 SB_SYMBOL_OFFSET;
167 gint8 SA_FREQ_OFFSET;
187 } Seg1A_AccessClasses_t;
191 Seg1A_AccessClasses_t AccessClasses;
192 guint8 CELL_BAR_ACCESS;
193 } Seg1A_RACHCtrlParams_t;
196 guint8 SB_RESELECTION_HYSTERESIS;
198 guint8 PriorityAccessInd;
202 guint8 Class_2_version;
203 guint8 Class_3_version;
204 Seg1A_SyncInfo_t SyncInfo;
205 Seg1A_RACHCtrlParams_t RACHCtrlParams;
206 Seg1A_MiscInfo_t MiscInfo;
211 guint8 CELL_BAR_ACCESS_EXTENSION2;
213 guint8 CELL_BAR_ACCESS_EXTENSION;
216 /* Segment 2A & 2Abis - [3] 11.5.2.67 / 11.5.2.68 */
218 guint8 SA_SIRFN_DELAY;
220 guint16 SuperframeNum;
221 guint8 MultiframeNum;
226 guint8 RXLEV_SELECT_MIN;
227 } Seg2A_SelectionCriterion_t;
230 guint8 SB_SELECTION_POWER;
234 guint8 SA_PCH_CONFIG;
235 guint8 SA_BACH_CONFIG;
236 guint8 RACH_TS_OFFSET;
237 guint8 N_Page_Occurrences;
238 guint8 IMSI_attach_detach_ind;
240 guint8 SI_update_ind;
244 guint8 Class_4_version;
245 Seg2A_SyncInfo_t SyncInfo;
246 Seg2A_SelectionCriterion_t SelectionCriterion;
247 Seg2A_MiscInfo_t MiscInfo;
248 Seg2A_LAInfo_t LAInfo;
252 guint8 Class_4_version;
253 Seg2A_SyncInfo_t SyncInfo;
254 Seg2A_SelectionCriterion_t SelectionCriterion;
255 Seg2A_MiscInfo_t MiscInfo;
256 Seg2A_LAInfo_t LAInfo;
260 guint8 _dummy; /* Remove when dissection is written */
264 guint8 _dummy; /* Remove when dissection is written */
267 /* Segment 3A - [1] 11.5.2.71 */
272 guint8 MSC_ID; /* splitted version of LAC */
273 guint16 Spot_Beam_ID; /* splitted version of LAC */
285 } Seg3A_SatellitePosition_t;
290 } Seg3A_BeamPosition_t;
293 guint8 SB_RESELECTION_TIMER;
298 Seg3A_System_t System;
299 Seg3A_SatellitePosition_t SatellitePosition;
300 Seg3A_BeamPosition_t BeamPosition;
301 Seg3A_MiscInfo_t MiscInfo;
306 guint8 _dummy; /* Remove when dissection is written */
310 guint8 _dummy; /* Remove when dissection is written */
314 guint8 _dummy; /* Remove when dissection is written */
318 guint8 _dummy; /* Remove when dissection is written */
322 guint8 _dummy; /* Remove when dissection is written */
326 guint8 _dummy; /* Remove when dissection is written */
330 guint8 _dummy; /* Remove when dissection is written */
334 guint8 _dummy; /* Remove when dissection is written */
338 guint8 _dummy; /* Remove when dissection is written */
342 guint8 _dummy; /* Remove when dissection is written */
346 guint8 _dummy; /* Remove when dissection is written */
350 guint8 _dummy; /* Remove when dissection is written */
354 guint8 _dummy; /* Remove when dissection is written */
358 guint8 _dummy; /* Remove when dissection is written */
362 guint8 _dummy; /* Remove when dissection is written */
366 guint8 _dummy; /* Remove when dissection is written */
370 guint8 _dummy; /* Remove when dissection is written */
374 guint8 _dummy; /* Remove when dissection is written */
378 guint8 _dummy; /* Remove when dissection is written */
382 guint8 _dummy; /* Remove when dissection is written */
386 guint8 _dummy; /* Remove when dissection is written */
390 guint8 _dummy; /* Remove when dissection is written */
394 guint8 _dummy; /* Remove when dissection is written */
398 guint8 _dummy; /* Remove when dissection is written */
402 guint8 _dummy; /* Remove when dissection is written */
406 guint8 _dummy; /* Remove when dissection is written */
410 guint8 _dummy; /* Remove when dissection is written */
413 /* System informations structures */
415 /* System Information type 1 - [1] 10.1.31 */
417 guint8 Protocol_Version;
419 guint8 Randomization_Period;
421 } SI1_Block_Header_t;
424 SI1_Block_Header_t Block_Header;
425 Segment1A_t Segment1A;
428 Segment2Abis_t Segment2Abis;
429 Segment2Bbis_t Segment2Bbis;
430 Segment3A_t Segment3A;
431 Segment3Bbis_t Segment3Bbis;
432 Segment3C_t Segment3C;
433 Segment3D_t Segment3D;
434 Segment3Ebis_t Segment3Ebis;
435 Segment3F_t Segment3F;
436 Segment3Gbis_t Segment3Gbis;
437 Segment3H_t Segment3H;
438 Segment3I_t Segment3I;
439 Segment3Jbis_t Segment3Jbis;
440 Segment3Kbis_t Segment3Kbis;
441 Segment4A_t Segment4A;
442 Segment4B_t Segment4B;
443 Segment4C_t Segment4C;
444 Segment4D_t Segment4D;
445 Segment4E_t Segment4E;
446 Segment4F_t Segment4F;
447 Segment4G_t Segment4G;
448 Segment4H_t Segment4H;
449 Segment4I_t Segment4I;
450 Segment4J_t Segment4J;
451 Segment4K_t Segment4K;
453 } SystemInformation1_t;
455 /* System Information type 2 - [1] 10.1.32 */
457 guint8 Protocol_Version;
460 } SI2_Block_Header_t;
463 SI2_Block_Header_t Block_Header;
466 Segment2A_t Segment2A;
467 Segment2B_t Segment2B;
468 Segment3B_t Segment3B;
469 Segment3E_t Segment3E;
470 Segment3G_t Segment3G;
471 Segment3J_t Segment3J;
473 } SystemInformation2_t;
476 /* ------------------------------------------------------------------------ */
477 /* CSN1 parsing definitions */
478 /* ------------------------------------------------------------------------ */
482 /* Segment 1A - [3] 11.5.2.66 */
484 CSN_DESCR_BEGIN(Seg1A_SyncInfo_t)
485 M_UINT (Seg1A_SyncInfo_t, SB_FRAME_TS_OFFSET, 5, &hf_seg1a_syncinfo_sb_frame_ts_offset),
486 M_UINT (Seg1A_SyncInfo_t, SB_SYMBOL_OFFSET, 6, &hf_seg1a_syncinfo_sb_symbol_offset),
487 M_UINT (Seg1A_SyncInfo_t, SA_FREQ_OFFSET, 8, &hf_seg1a_syncinfo_sa_freq_offset),
488 CSN_DESCR_END (Seg1A_SyncInfo_t)
491 CSN_DESCR_BEGIN(Seg1A_AccessClasses_t)
492 M_UINT (Seg1A_AccessClasses_t, AC15, 1, &hf_seg1a_rachctrl_acc[15]),
493 M_UINT (Seg1A_AccessClasses_t, AC14, 1, &hf_seg1a_rachctrl_acc[14]),
494 M_UINT (Seg1A_AccessClasses_t, AC13, 1, &hf_seg1a_rachctrl_acc[13]),
495 M_UINT (Seg1A_AccessClasses_t, AC12, 1, &hf_seg1a_rachctrl_acc[12]),
496 M_UINT (Seg1A_AccessClasses_t, AC11, 1, &hf_seg1a_rachctrl_acc[11]),
497 M_UINT (Seg1A_AccessClasses_t, EC10, 1, &hf_seg1a_rachctrl_acc[10]),
498 M_UINT (Seg1A_AccessClasses_t, AC9, 1, &hf_seg1a_rachctrl_acc[9]),
499 M_UINT (Seg1A_AccessClasses_t, AC8, 1, &hf_seg1a_rachctrl_acc[8]),
500 M_UINT (Seg1A_AccessClasses_t, AC7, 1, &hf_seg1a_rachctrl_acc[7]),
501 M_UINT (Seg1A_AccessClasses_t, AC6, 1, &hf_seg1a_rachctrl_acc[6]),
502 M_UINT (Seg1A_AccessClasses_t, AC5, 1, &hf_seg1a_rachctrl_acc[5]),
503 M_UINT (Seg1A_AccessClasses_t, AC4, 1, &hf_seg1a_rachctrl_acc[4]),
504 M_UINT (Seg1A_AccessClasses_t, AC3, 1, &hf_seg1a_rachctrl_acc[3]),
505 M_UINT (Seg1A_AccessClasses_t, AC2, 1, &hf_seg1a_rachctrl_acc[2]),
506 M_UINT (Seg1A_AccessClasses_t, AC1, 1, &hf_seg1a_rachctrl_acc[1]),
507 M_UINT (Seg1A_AccessClasses_t, AC0, 1, &hf_seg1a_rachctrl_acc[0]),
508 CSN_DESCR_END (Seg1A_AccessClasses_t)
511 CSN_DESCR_BEGIN(Seg1A_RACHCtrlParams_t)
512 M_UINT (Seg1A_RACHCtrlParams_t, Max_Retrans, 2, &hf_seg1a_rachctrl_max_retrans),
513 M_TYPE_LABEL (Seg1A_RACHCtrlParams_t, AccessClasses, Seg1A_AccessClasses_t, "Access Classes"),
514 M_UINT (Seg1A_RACHCtrlParams_t, CELL_BAR_ACCESS, 1, &hf_seg1a_rachctrl_cell_bar_access),
515 CSN_DESCR_END (Seg1A_RACHCtrlParams_t)
518 CSN_DESCR_BEGIN(Seg1A_MiscInfo_t)
519 M_UINT (Seg1A_MiscInfo_t, SB_RESELECTION_HYSTERESIS, 4, &hf_seg1a_miscinfo_sb_reselection_hysteresis),
520 M_UINT (Seg1A_MiscInfo_t, Spare, 1, &hf_seg1a_miscinfo_spare),
521 M_UINT (Seg1A_MiscInfo_t, PriorityAccessInd, 1, &hf_seg1a_miscinfo_priority_access_ind),
522 CSN_DESCR_END (Seg1A_MiscInfo_t)
525 CSN_DESCR_BEGIN(Segment1A_t)
526 M_UINT (Segment1A_t, Class_2_version, 3, &hf_seg1a_class_2_version),
527 M_UINT (Segment1A_t, Class_3_version, 4, &hf_seg1a_class_3_version),
528 M_TYPE_LABEL (Segment1A_t, SyncInfo, Seg1A_SyncInfo_t, "Synchronization Info Class 1"),
529 M_TYPE_LABEL (Segment1A_t, RACHCtrlParams, Seg1A_RACHCtrlParams_t, "RACH Control Parameters"),
530 M_TYPE_LABEL (Segment1A_t, MiscInfo, Seg1A_MiscInfo_t, "Misc Info Class 1"),
531 M_UINT (Segment1A_t, GBCH_Present, 1, &hf_seg1a_gbch_present),
532 M_UINT (Segment1A_t, Test_GS, 1, &hf_seg1a_test_gs),
533 M_UINT (Segment1A_t, Test_GS2, 1, &hf_seg1a_test_gs2),
534 M_UINT (Segment1A_t, Spare1, 3, &hf_seg1a_spare1),
535 M_UINT (Segment1A_t, CELL_BAR_ACCESS_EXTENSION2, 1, &hf_seg1a_cell_bar_access_extension2),
536 M_UINT (Segment1A_t, Spare2, 5, &hf_seg1a_spare2),
537 M_UINT (Segment1A_t, CELL_BAR_ACCESS_EXTENSION, 1, &hf_seg1a_cell_bar_access_extension),
538 CSN_DESCR_END (Segment1A_t)
540 /* Segment 2A & 2Abis - [1] 11.5.2.67 / 11.5.2.68 */
542 CSN_DESCR_BEGIN(Seg2A_SyncInfo_t)
543 M_UINT (Seg2A_SyncInfo_t, SA_SIRFN_DELAY, 4, &hf_seg2a_syncinfo_sa_sirfn_delay),
544 M_UINT (Seg2A_SyncInfo_t, SA_BCCH_STN, 5, &hf_seg2a_syncinfo_sa_bcch_stn),
545 M_UINT (Seg2A_SyncInfo_t, SuperframeNum, 13, &hf_seg2a_syncinfo_superframe_num),
546 M_UINT (Seg2A_SyncInfo_t, MultiframeNum, 2, &hf_seg2a_syncinfo_multiframe_num),
547 M_UINT (Seg2A_SyncInfo_t, MFFN_HighBit, 1, &hf_seg2a_syncinfo_mffn_high_bit),
548 CSN_DESCR_END (Seg2A_SyncInfo_t)
551 CSN_DESCR_BEGIN(Seg2A_SelectionCriterion_t)
552 M_UINT (Seg2A_SelectionCriterion_t, RXLEV_SELECT_MIN, 5, &hf_seg2a_selcrit_rxlev_select_min),
553 CSN_DESCR_END (Seg2A_SelectionCriterion_t)
556 CSN_DESCR_BEGIN(Seg2A_MiscInfo_t)
557 M_UINT (Seg2A_MiscInfo_t, SB_SELECTION_POWER, 4, &hf_seg2a_miscinfo_sb_selection_power),
558 CSN_DESCR_END (Seg2A_MiscInfo_t)
561 CSN_DESCR_BEGIN(Seg2A_LAInfo_t)
562 M_UINT (Seg2A_LAInfo_t, SA_PCH_CONFIG, 2, &hf_seg2a_lainfo_sa_pch_config),
563 M_UINT (Seg2A_LAInfo_t, SA_BACH_CONFIG, 8, &hf_seg2a_lainfo_sa_bach_config),
564 M_UINT (Seg2A_LAInfo_t, RACH_TS_OFFSET, 5, &hf_seg2a_lainfo_rach_ts_offset),
565 M_UINT (Seg2A_LAInfo_t, N_Page_Occurrences, 2, &hf_seg2a_lainfo_n_page_occurrences),
566 M_UINT (Seg2A_LAInfo_t, IMSI_attach_detach_ind, 1, &hf_seg2a_lainfo_imsi_attach_detach_ind),
567 M_UINT (Seg2A_LAInfo_t, ECSC_ind, 1, &hf_seg2a_lainfo_ecsc_indication),
568 M_UINT (Seg2A_LAInfo_t, SI_update_ind, 1, &hf_seg2a_lainfo_si_update_ind),
569 CSN_DESCR_END (Seg2A_LAInfo_t)
572 CSN_DESCR_BEGIN(Segment2A_t)
573 M_FIXED_LABEL(Segment2A_t, 2, 0x2, "= Class type: 2"),
574 M_FIXED_LABEL(Segment2A_t, 4, 0x0, "= Segment type: A"),
575 M_UINT (Segment2A_t, Class_4_version, 3, &hf_seg2a_class_4_version),
576 M_TYPE_LABEL (Segment2A_t, SyncInfo, Seg2A_SyncInfo_t, "Synchronization Info Class 2"),
577 M_TYPE_LABEL (Segment2A_t, SelectionCriterion, Seg2A_SelectionCriterion_t, "Selection Criterion"),
578 M_TYPE_LABEL (Segment2A_t, MiscInfo, Seg2A_MiscInfo_t, "Misc Info Class 2"),
579 M_TYPE_LABEL (Segment2A_t, LAInfo, Seg2A_LAInfo_t, "LA Info Class 2"),
580 CSN_DESCR_END (Segment2A_t)
583 CSN_DESCR_BEGIN(Segment2Abis_t)
584 M_FIXED_LABEL(Segment2Abis_t, 2, 0x2, "= Class type: 2"),
585 M_FIXED_LABEL(Segment2Abis_t, 4, 0x0, "= Segment type: Abis"),
586 M_UINT (Segment2Abis_t, Class_4_version, 3, &hf_seg2a_class_4_version),
587 M_TYPE_LABEL (Segment2Abis_t, SyncInfo, Seg2A_SyncInfo_t, "Synchronization Info Class 2"),
588 M_TYPE_LABEL (Segment2Abis_t, SelectionCriterion, Seg2A_SelectionCriterion_t, "Selection Criterion"),
589 M_TYPE_LABEL (Segment2Abis_t, MiscInfo, Seg2A_MiscInfo_t, "Misc Info Class 2"),
590 M_TYPE_LABEL (Segment2Abis_t, LAInfo, Seg2A_LAInfo_t, "LA Info Class 2"),
591 CSN_DESCR_END (Segment2Abis_t)
594 CSN_DESCR_BEGIN(Segment2B_t)
595 M_FIXED_LABEL(Segment2B_t, 2, 0x2, "= Class type: 2"),
596 M_FIXED_LABEL(Segment2B_t, 4, 0x1, "= Segment type: B"),
597 CSN_DESCR_END (Segment2B_t)
600 CSN_DESCR_BEGIN(Segment2Bbis_t)
601 M_FIXED_LABEL(Segment2Bbis_t, 2, 0x2, "= Class type: 2"),
602 M_FIXED_LABEL(Segment2Bbis_t, 4, 0x1, "= Segment type: B bis"),
603 CSN_DESCR_END (Segment2Bbis_t)
605 /* Segment 3A - [1] 11.5.2.71 */
607 Seg3A_LAI_Dissector(proto_tree *tree _U_, csnStream_t* ar, tvbuff_t *tvb, void* data, int ett_csn1)
609 Seg3A_LAI_t *LAI = (Seg3A_LAI_t *)data;
610 proto_item *lac_item;
611 proto_tree *lac_tree;
615 if (ar->remaining_bits_len < 5*8)
619 c[i] = tvb_get_bits8(tvb, ar->bit_offset + (i<<3), 8);
621 LAI->MCC = (c[0] & 0xf) * 100 + ((c[0] & 0xf0) >> 4) * 10 + (c[1] & 0xf);
622 LAI->MNC = (c[2] & 0xf) * 10 + ((c[2] & 0xf0) >> 4);
624 LAI->LAC = (c[3] << 8) | c[4];
625 LAI->MSC_ID = (LAI->LAC >> 10) & 0x3f;
626 LAI->Spot_Beam_ID = LAI->LAC & 0x03ff;
628 proto_tree_add_uint_bits_format_value(tree, hf_seg3a_lai_mcc, tvb, ar->bit_offset, 16, (guint32)LAI->MCC, "%d", LAI->MCC);
629 proto_tree_add_uint_bits_format_value(tree, hf_seg3a_lai_mnc, tvb, ar->bit_offset+16, 8, (guint32)LAI->MNC, "%d", LAI->MNC);
631 lac_item = proto_tree_add_uint_bits_format_value(tree, hf_seg3a_lai_lac, tvb, ar->bit_offset+24, 16, (guint32)LAI->LAC, "0x%04x", LAI->LAC);
632 lac_tree = proto_item_add_subtree(lac_item, ett_csn1);
634 proto_tree_add_uint_bits_format_value(lac_tree, hf_seg3a_lai_msc_id, tvb, ar->bit_offset+24, 6, (guint32)LAI->MSC_ID, "%d", LAI->MSC_ID);
635 proto_tree_add_uint_bits_format_value(lac_tree, hf_seg3a_lai_spot_beam_id, tvb, ar->bit_offset+30, 10, (guint32)LAI->Spot_Beam_ID, "%d", LAI->Spot_Beam_ID);
637 ar->remaining_bits_len -= 5*8;
638 ar->bit_offset += 5*8;
644 CSN_DESCR_BEGIN(Seg3A_System_t)
645 M_UINT (Seg3A_System_t, Satellite_ID, 2, &hf_seg3a_system_sat_id),
646 M_UINT (Seg3A_System_t, System_ID, 4, &hf_seg3a_system_sys_id),
647 CSN_DESCR_END (Seg3A_System_t)
650 CSN_DESCR_BEGIN(Seg3A_SatellitePosition_t)
651 M_UINT (Seg3A_SatellitePosition_t, Latitude, 8, &hf_seg3a_satpos_latitude),
652 M_UINT (Seg3A_SatellitePosition_t, Longitude, 12, &hf_seg3a_satpos_longitude),
653 M_UINT (Seg3A_SatellitePosition_t, Radius, 16, &hf_seg3a_satpos_radius),
654 CSN_DESCR_END (Seg3A_SatellitePosition_t)
657 CSN_DESCR_BEGIN(Seg3A_BeamPosition_t)
658 M_UINT (Seg3A_BeamPosition_t, Latitude, 11, &hf_seg3a_beam_latitude),
659 M_UINT (Seg3A_BeamPosition_t, Longitude, 12, &hf_seg3a_beam_longitude),
660 CSN_DESCR_END (Seg3A_BeamPosition_t)
663 CSN_DESCR_BEGIN(Seg3A_MiscInfo_t)
664 M_UINT (Seg3A_MiscInfo_t, SB_RESELECTION_TIMER, 6, &hf_seg3a_miscinfo_sb_reselection_timer),
665 CSN_DESCR_END (Seg3A_MiscInfo_t)
668 CSN_DESCR_BEGIN(Segment3A_t)
669 M_FIXED_LABEL(Segment3A_t, 1, 0x0, "= Class type: 3"),
670 M_FIXED_LABEL(Segment3A_t, 4, 0x0, "= Segment type: A"),
671 M_SERIALIZE (Segment3A_t, LAI, 0, Seg3A_LAI_Dissector),
672 M_TYPE_LABEL (Segment3A_t, System, Seg3A_System_t, "System"),
673 M_TYPE_LABEL (Segment3A_t, SatellitePosition, Seg3A_SatellitePosition_t, "Satellite Position"),
674 M_TYPE_LABEL (Segment3A_t, BeamPosition, Seg3A_BeamPosition_t, "Beam Center Position"),
675 M_TYPE_LABEL (Segment3A_t, MiscInfo, Seg3A_MiscInfo_t, "Misc Info Class 3"),
676 M_UINT (Segment3A_t, Spare, 4, &hf_seg3a_spare),
677 CSN_DESCR_END (Segment3A_t)
680 CSN_DESCR_BEGIN(Segment3B_t)
681 M_FIXED_LABEL(Segment3B_t, 1, 0x0, "= Class type: 3"),
682 M_FIXED_LABEL(Segment3B_t, 4, 0x1, "= Segment type: B"),
683 CSN_DESCR_END (Segment3B_t)
686 CSN_DESCR_BEGIN(Segment3Bbis_t)
687 M_FIXED_LABEL(Segment3Bbis_t, 1, 0x0, "= Class type: 3"),
688 M_FIXED_LABEL(Segment3Bbis_t, 4, 0x1, "= Segment type: B bis"),
689 CSN_DESCR_END (Segment3Bbis_t)
692 CSN_DESCR_BEGIN(Segment3C_t)
693 M_FIXED_LABEL(Segment3C_t, 1, 0x0, "= Class type: 3"),
694 M_FIXED_LABEL(Segment3C_t, 4, 0x2, "= Segment type: C"),
695 CSN_DESCR_END (Segment3C_t)
698 CSN_DESCR_BEGIN(Segment3D_t)
699 M_FIXED_LABEL(Segment3D_t, 1, 0x0, "= Class type: 3"),
700 M_FIXED_LABEL(Segment3D_t, 4, 0x3, "= Segment type: D"),
701 CSN_DESCR_END (Segment3D_t)
704 CSN_DESCR_BEGIN(Segment3E_t)
705 M_FIXED_LABEL(Segment3E_t, 1, 0x0, "= Class type: 3"),
706 M_FIXED_LABEL(Segment3E_t, 4, 0x4, "= Segment type: E"),
707 CSN_DESCR_END (Segment3E_t)
710 CSN_DESCR_BEGIN(Segment3Ebis_t)
711 M_FIXED_LABEL(Segment3Ebis_t, 1, 0x0, "= Class type: 3"),
712 M_FIXED_LABEL(Segment3Ebis_t, 4, 0x4, "= Segment type: E bis"),
713 CSN_DESCR_END (Segment3Ebis_t)
716 CSN_DESCR_BEGIN(Segment3F_t)
717 M_FIXED_LABEL(Segment3F_t, 1, 0x0, "= Class type: 3"),
718 M_FIXED_LABEL(Segment3F_t, 4, 0x5, "= Segment type: F"),
719 CSN_DESCR_END (Segment3F_t)
722 CSN_DESCR_BEGIN(Segment3G_t)
723 M_FIXED_LABEL(Segment3G_t, 1, 0x0, "= Class type: 3"),
724 M_FIXED_LABEL(Segment3G_t, 4, 0x6, "= Segment type: G"),
725 CSN_DESCR_END (Segment3G_t)
728 CSN_DESCR_BEGIN(Segment3Gbis_t)
729 M_FIXED_LABEL(Segment3Gbis_t, 1, 0x0, "= Class type: 3"),
730 M_FIXED_LABEL(Segment3Gbis_t, 4, 0x6, "= Segment type: G bis"),
731 CSN_DESCR_END (Segment3Gbis_t)
734 CSN_DESCR_BEGIN(Segment3H_t)
735 M_FIXED_LABEL(Segment3H_t, 1, 0x0, "= Class type: 3"),
736 M_FIXED_LABEL(Segment3H_t, 4, 0x7, "= Segment type: H"),
737 CSN_DESCR_END (Segment3H_t)
740 CSN_DESCR_BEGIN(Segment3I_t)
741 M_FIXED_LABEL(Segment3I_t, 1, 0x0, "= Class type: 3"),
742 M_FIXED_LABEL(Segment3I_t, 4, 0x9, "= Segment type: I"),
743 CSN_DESCR_END (Segment3I_t)
746 CSN_DESCR_BEGIN(Segment3J_t)
747 M_FIXED_LABEL(Segment3J_t, 1, 0x0, "= Class type: 3"),
748 M_FIXED_LABEL(Segment3J_t, 4, 0xa, "= Segment type: J"),
749 CSN_DESCR_END (Segment3J_t)
752 CSN_DESCR_BEGIN(Segment3Jbis_t)
753 M_FIXED_LABEL(Segment3Jbis_t, 1, 0x0, "= Class type: 3"),
754 M_FIXED_LABEL(Segment3Jbis_t, 4, 0xa, "= Segment type: J bis"),
755 CSN_DESCR_END (Segment3Jbis_t)
758 CSN_DESCR_BEGIN(Segment3Kbis_t)
759 M_FIXED_LABEL(Segment3Kbis_t, 1, 0x0, "= Class type: 3"),
760 M_FIXED_LABEL(Segment3Kbis_t, 4, 0xb, "= Segment type: K bis"),
761 CSN_DESCR_END (Segment3Kbis_t)
765 CSN_DESCR_BEGIN(Segment3L_t)
766 M_FIXED_LABEL(Segment3L_t, 1, 0x0, "= Class type: 3"),
767 M_FIXED_LABEL(Segment3L_t, 4, 0xc, "= Segment type: L"),
768 CSN_DESCR_END (Segment3L_t)
773 CSN_DESCR_BEGIN(Segment3M_t)
774 M_FIXED_LABEL(Segment3M_t, 1, 0x0, "= Class type: 3"),
775 M_FIXED_LABEL(Segment3M_t, 4, 0xd, "= Segment type: M"),
776 CSN_DESCR_END (Segment3M_t)
780 CSN_DESCR_BEGIN(Segment4A_t)
781 M_FIXED_LABEL(Segment4A_t, 3, 0x6, "= Class type: 4"),
782 M_FIXED_LABEL(Segment4A_t, 4, 0x0, "= Segment type: A"),
783 CSN_DESCR_END (Segment4A_t)
786 CSN_DESCR_BEGIN(Segment4B_t)
787 M_FIXED_LABEL(Segment4B_t, 3, 0x6, "= Class type: 4"),
788 M_FIXED_LABEL(Segment4B_t, 4, 0x1, "= Segment type: B"),
789 CSN_DESCR_END (Segment4B_t)
792 CSN_DESCR_BEGIN(Segment4C_t)
793 M_FIXED_LABEL(Segment4C_t, 3, 0x6, "= Class type: 4"),
794 M_FIXED_LABEL(Segment4C_t, 4, 0x2, "= Segment type: C"),
795 CSN_DESCR_END (Segment4C_t)
798 CSN_DESCR_BEGIN(Segment4D_t)
799 M_FIXED_LABEL(Segment4D_t, 3, 0x6, "= Class type: 4"),
800 M_FIXED_LABEL(Segment4D_t, 4, 0x3, "= Segment type: D"),
801 CSN_DESCR_END (Segment4D_t)
804 CSN_DESCR_BEGIN(Segment4E_t)
805 M_FIXED_LABEL(Segment4E_t, 3, 0x6, "= Class type: 4"),
806 M_FIXED_LABEL(Segment4E_t, 4, 0x4, "= Segment type: E"),
807 CSN_DESCR_END (Segment4E_t)
810 CSN_DESCR_BEGIN(Segment4F_t)
811 M_FIXED_LABEL(Segment4F_t, 3, 0x6, "= Class type: 4"),
812 M_FIXED_LABEL(Segment4F_t, 4, 0x5, "= Segment type: F"),
813 CSN_DESCR_END (Segment4F_t)
816 CSN_DESCR_BEGIN(Segment4G_t)
817 M_FIXED_LABEL(Segment4G_t, 3, 0x6, "= Class type: 4"),
818 M_FIXED_LABEL(Segment4G_t, 4, 0x6, "= Segment type: G"),
819 CSN_DESCR_END (Segment4G_t)
822 CSN_DESCR_BEGIN(Segment4H_t)
823 M_FIXED_LABEL(Segment4H_t, 3, 0x6, "= Class type: 4"),
824 M_FIXED_LABEL(Segment4H_t, 4, 0x7, "= Segment type: H"),
825 CSN_DESCR_END (Segment4H_t)
828 CSN_DESCR_BEGIN(Segment4I_t)
829 M_FIXED_LABEL(Segment4I_t, 3, 0x6, "= Class type: 4"),
830 M_FIXED_LABEL(Segment4I_t, 4, 0x8, "= Segment type: I"),
831 CSN_DESCR_END (Segment4I_t)
834 CSN_DESCR_BEGIN(Segment4J_t)
835 M_FIXED_LABEL(Segment4J_t, 3, 0x6, "= Class type: 4"),
836 M_FIXED_LABEL(Segment4J_t, 4, 0x9, "= Segment type: J"),
837 CSN_DESCR_END (Segment4J_t)
840 CSN_DESCR_BEGIN(Segment4K_t)
841 M_FIXED_LABEL(Segment4K_t, 3, 0x6, "= Class type: 4"),
842 M_FIXED_LABEL(Segment4K_t, 4, 0xa, "= Segment type: K"),
843 CSN_DESCR_END (Segment4K_t)
846 /* System information */
848 /* System Information type 1 - [1] 10.1.31 */
851 CSN_DESCR_BEGIN(SI1_Block_Header_t)
852 M_UINT (SI1_Block_Header_t, Protocol_Version, 4, &hf_si_protocol_version),
853 M_UINT (SI1_Block_Header_t, Block_Type, 1, &hf_si_block_type),
854 M_UINT (SI1_Block_Header_t, Randomization_Period, 2, &hf_si1_randomization_period),
855 M_UINT (SI1_Block_Header_t, Spare, 1, &hf_si_spare),
856 CSN_DESCR_END (SI1_Block_Header_t)
859 CSN_ChoiceElement_t SI1_SegmentChoice[] =
861 {6, 0x20, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment2Abis, Segment2Abis_t, "Segment 2A bis")},
862 {6, 0x21, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment2Bbis, Segment2Bbis_t, "Segment 2B bis")},
863 {5, 0x00, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3A, Segment3A_t, "Segment 3A")},
864 {5, 0x01, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3Bbis, Segment3Bbis_t, "Segment 3B bis")},
865 {5, 0x02, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3C, Segment3C_t, "Segment 3C")},
866 {5, 0x03, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3D, Segment3D_t, "Segment 3D")},
867 {5, 0x04, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3Ebis, Segment3Ebis_t, "Segment 3E bis")},
868 {5, 0x05, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3F, Segment3F_t, "Segment 3F")},
869 {5, 0x06, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3Gbis, Segment3Gbis_t, "Segment 3G bis")},
870 {5, 0x07, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3H, Segment3H_t, "Segment 3H")},
871 {5, 0x09, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3I, Segment3I_t, "Segment 3I")},
872 {5, 0x0a, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3Jbis, Segment3Jbis_t, "Segment 3J bis")},
873 {5, 0x0b, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3Kbis, Segment3Kbis_t, "Segment 3K bis")},
874 {7, 0x60, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4A, Segment4A_t, "Segment 4A")},
875 {7, 0x61, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4B, Segment4B_t, "Segment 4B")},
876 {7, 0x62, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4C, Segment4C_t, "Segment 4C")},
877 {7, 0x63, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4D, Segment4D_t, "Segment 4D")},
878 {7, 0x64, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4E, Segment4E_t, "Segment 4E")},
879 {7, 0x65, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4F, Segment4F_t, "Segment 4F")},
880 {7, 0x66, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4G, Segment4G_t, "Segment 4G")},
881 {7, 0x67, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4H, Segment4H_t, "Segment 4H")},
882 {7, 0x68, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4I, Segment4I_t, "Segment 4I")},
883 {7, 0x69, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4J, Segment4J_t, "Segment 4J")},
884 {7, 0x6a, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4K, Segment4K_t, "Segment 4K")},
885 {0, 0x00, 1, CSN_ERROR(SystemInformation1_t, "Unknown segment !", -1)},
889 CSN_DESCR_BEGIN(SystemInformation1_t)
890 M_TYPE_LABEL (SystemInformation1_t, Block_Header, SI1_Block_Header_t, "Block Header"),
891 M_TYPE_LABEL (SystemInformation1_t, Segment1A, Segment1A_t, "Segment 1A"),
892 M_CHOICE_IL (SystemInformation1_t, SegmentType, SI1_SegmentChoice, ElementsOf(SI1_SegmentChoice)),
893 CSN_DESCR_END (SystemInformation1_t)
895 /* System Information type 2 - [1] 10.1.32 */
897 CSN_DESCR_BEGIN(SI2_Block_Header_t)
898 M_UINT (SI2_Block_Header_t, Protocol_Version, 4, &hf_si_protocol_version),
899 M_UINT (SI2_Block_Header_t, Block_Type, 1, &hf_si_block_type),
900 M_UINT (SI2_Block_Header_t, Spare, 3, &hf_si_spare),
901 CSN_DESCR_END (SI2_Block_Header_t)
904 CSN_ChoiceElement_t SI2_SegmentChoice[] =
906 {6, 0x20, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment2A, Segment2A_t, "Segment 2A")},
907 {6, 0x21, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment2B, Segment2B_t, "Segment 2B")},
908 {5, 0x01, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment3B, Segment3B_t, "Segment 3B")},
909 {5, 0x04, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment3E, Segment3E_t, "Segment 3E")},
910 {5, 0x06, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment3G, Segment3G_t, "Segment 3G")},
911 {5, 0x0a, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment3J, Segment3J_t, "Segment 3J")},
912 {0, 0x00, 1, CSN_ERROR(SystemInformation2_t, "Unknown segment !", -1)},
916 CSN_DESCR_BEGIN(SystemInformation2_t)
917 M_TYPE_LABEL (SystemInformation2_t, Block_Header, SI2_Block_Header_t, "Block Header"),
918 M_CHOICE_IL (SystemInformation2_t, SegmentType, SI2_SegmentChoice, ElementsOf(SI2_SegmentChoice)),
919 CSN_DESCR_END (SystemInformation2_t)
922 /* ------------------------------------------------------------------------ */
924 /* ------------------------------------------------------------------------ */
928 segx_half_db_value_fmt(gchar *s, guint32 v)
930 g_snprintf(s, ITEM_LABEL_LENGTH, "%2.1f dB (%u)", v * 0.5f, v);
933 /* Segment 1A - [3] 11.5.2.66 */
935 seg1a_syncinfo_sa_freq_offset_fmt(gchar *s, guint32 v)
937 gint32 sv = (gint32)v;
938 g_snprintf(s, ITEM_LABEL_LENGTH, "%d Hz (%d)", sv * 5, sv);
941 static const value_string seg1a_rachctrl_acc_vals[] = {
942 { 0, "not barred (allowed)"},
943 { 1, "barred (not allowed)"},
947 static const value_string seg1a_rachctrl_cell_bar_access_vals[] = {
948 { 0, "The cell is not barred"},
949 { 1, "The cell is barred"},
953 /* Segment 2A & 2Abis - [1] 11.5.2.67 & 11.5.2.68 */
954 static const value_string seg2a_lainfo_imsi_attach_detach_ind_vals[] = {
955 { 0, "MESs shall NOT apply IMSI attach and detach procedure for this LA"},
956 { 1, "MESs shall apply IMSI attach and detach procedure for this LA"},
960 static const value_string seg2a_lainfo_ecsc_indication_vals[] = {
961 { 0, "Early sending is explicitly prohibited"},
962 { 1, "Early sending is explicitly accepted"},
966 /* Segment 3A - [1] 11.5.2.71 */
968 seg3a_latitude_fmt(gchar *s, guint32 v)
970 gint32 sv = (gint32)v;
979 g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f %c (%d)", sv / 10.0f, c, sv);
983 seg3a_longitude_fmt(gchar *s, guint32 v)
996 g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f %c (%u)", sv / 10.0f, c, v);
1000 seg3a_satpos_radius_fmt(gchar *s, guint32 v)
1002 gint32 sv = (gint32)v;
1003 gint32 a = (42162 * 1000) + (sv * 5);
1004 g_snprintf(s, ITEM_LABEL_LENGTH, "%.3lf km (%u)", a / 1000.0, sv);
1008 seg3a_miscinfo_sb_reselection_timer_fmt(gchar *s, guint32 v)
1010 g_snprintf(s, ITEM_LABEL_LENGTH, "%d minutes (%u)", v*4, v);
1013 /* System Information 1 - [1] 10.3.31 */
1014 static const value_string si1_randomization_period_vals[] = {
1015 { 0, "7 frames after this SI block" },
1016 { 1, "15 frames after this SI block" },
1017 { 2, "23 frames after this SI block" },
1018 { 3, "31 frames after this SI block" },
1023 /* ------------------------------------------------------------------------ */
1024 /* Dissector code */
1025 /* ------------------------------------------------------------------------ */
1028 dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1030 proto_item *bcch_item = NULL;
1031 proto_tree *bcch_tree = NULL;
1035 col_append_str(pinfo->cinfo, COL_INFO, "(BCCH) ");
1037 is_si1 = tvb_get_bits8(tvb, 0, 5) & 1;
1039 bcch_item = proto_tree_add_protocol_format(
1040 tree, proto_gmr1_bcch, tvb, 0, -1,
1041 "GMR-1 BCCH - System Information type %d", is_si1 ? 1 : 2
1043 bcch_tree = proto_item_add_subtree(bcch_item, ett_gmr1_bcch);
1045 csnStreamInit(&ar, 0, tvb_length(tvb)*8);
1049 SystemInformation1_t *data;
1050 data = wmem_new(wmem_packet_scope(), SystemInformation1_t);
1051 /* Initialize the type to the last element, which is an
1052 * "Unknown", in case the dissector bails before getting this
1054 data->SegmentType = array_length(SI1_SegmentChoice) - 1;
1055 csnStreamDissector(bcch_tree, &ar, CSNDESCR(SystemInformation1_t), tvb, data, ett_gmr1_bcch);
1057 pinfo->cinfo, COL_INFO,
1058 "System Information 1: Segment 1A, %s",
1059 SI1_SegmentChoice[data->SegmentType].descr.sz
1062 SystemInformation2_t *data;
1063 data = wmem_new(wmem_packet_scope(), SystemInformation2_t);
1064 /* Initialize the type to the last element, which is an
1065 * "Unknown", in case the dissector bails before getting this
1067 data->SegmentType = array_length(SI2_SegmentChoice) - 1;
1068 csnStreamDissector(bcch_tree, &ar, CSNDESCR(SystemInformation2_t), tvb, data, ett_gmr1_bcch);
1070 pinfo->cinfo, COL_INFO,
1071 "System Information 2: %s",
1072 SI2_SegmentChoice[data->SegmentType].descr.sz
1078 proto_register_gmr1_bcch(void)
1080 static hf_register_info hf[] = {
1081 /* Segment 1A - [3] 11.5.2.66 */
1082 { &hf_seg1a_class_2_version,
1083 { "Class 2 version", "gmr1.bcch.seg1a.class_2_version",
1084 FT_UINT8, BASE_DEC, NULL, 0x00,
1085 "Version number for current Class 2 information", HFILL }
1087 { &hf_seg1a_class_3_version,
1088 { "Class 3 version", "gmr1.bcch.seg1a.class_3_version",
1089 FT_UINT8, BASE_DEC, NULL, 0x00,
1090 "Version number for current Class 3 information", HFILL }
1092 { &hf_seg1a_syncinfo_sb_frame_ts_offset,
1093 { "SB_FRAME_TS_OFFSET", "gmr1.bcch.seg1a.syncinfo.sb_frame_ts_offset",
1094 FT_UINT8, BASE_DEC, NULL, 0x00,
1097 { &hf_seg1a_syncinfo_sb_symbol_offset,
1098 { "SB_SYMBOL_OFFSET", "gmr1.bcch.seg1a.syncinfo.sb_symbol_offset",
1099 FT_INT8, BASE_DEC, NULL, 0x00,
1102 { &hf_seg1a_syncinfo_sa_freq_offset,
1103 { "SA_FREQ_OFFSET", "gmr1.bcch.seg1a.syncinfo.sa_freq_offset",
1104 FT_UINT8, BASE_CUSTOM, seg1a_syncinfo_sa_freq_offset_fmt, 0x00,
1107 { &hf_seg1a_rachctrl_max_retrans,
1108 { "Max Retrans", "gmr1.bcch.seg1a.rachctrl.max_retrans",
1109 FT_UINT8, BASE_DEC, NULL, 0x00,
1112 { &hf_seg1a_rachctrl_acc[15],
1113 { "AC15", "gmr1.bcch.seg1a.rachctrl.ac15",
1114 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1115 "Access Class 15 barred", HFILL }
1117 { &hf_seg1a_rachctrl_acc[14],
1118 { "AC14", "gmr1.bcch.seg1a.rachctrl.ac14",
1119 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1120 "Access Class 14 barred", HFILL }
1122 { &hf_seg1a_rachctrl_acc[13],
1123 { "AC13", "gmr1.bcch.seg1a.rachctrl.ac13",
1124 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1125 "Access Class 13 barred", HFILL }
1127 { &hf_seg1a_rachctrl_acc[12],
1128 { "AC12", "gmr1.bcch.seg1a.rachctrl.ac12",
1129 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1130 "Access Class 12 barred", HFILL }
1132 { &hf_seg1a_rachctrl_acc[11],
1133 { "AC11", "gmr1.bcch.seg1a.rachctrl.ac11",
1134 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1135 "Access Class 11 barred", HFILL }
1137 { &hf_seg1a_rachctrl_acc[10],
1138 { "EC10", "gmr1.bcch.seg1a.rachctrl.ac10",
1139 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1140 "Emergency Class 10 barred", HFILL }
1142 { &hf_seg1a_rachctrl_acc[9],
1143 { "AC9", "gmr1.bcch.seg1a.rachctrl.ac9",
1144 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1145 "Access Class 9 barred", HFILL }
1147 { &hf_seg1a_rachctrl_acc[8],
1148 { "AC8", "gmr1.bcch.seg1a.rachctrl.ac8",
1149 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1150 "Access Class 8 barred", HFILL }
1152 { &hf_seg1a_rachctrl_acc[7],
1153 { "AC7", "gmr1.bcch.seg1a.rachctrl.ac7",
1154 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1155 "Access Class 7 barred", HFILL }
1157 { &hf_seg1a_rachctrl_acc[6],
1158 { "AC6", "gmr1.bcch.seg1a.rachctrl.ac6",
1159 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1160 "Access Class 6 barred", HFILL }
1162 { &hf_seg1a_rachctrl_acc[5],
1163 { "AC5", "gmr1.bcch.seg1a.rachctrl.ac5",
1164 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1165 "Access Class 5 barred", HFILL }
1167 { &hf_seg1a_rachctrl_acc[4],
1168 { "AC4", "gmr1.bcch.seg1a.rachctrl.ac4",
1169 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1170 "Access Class 4 barred", HFILL }
1172 { &hf_seg1a_rachctrl_acc[3],
1173 { "AC3", "gmr1.bcch.seg1a.rachctrl.ac3",
1174 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1175 "Access Class 3 barred", HFILL }
1177 { &hf_seg1a_rachctrl_acc[2],
1178 { "AC2", "gmr1.bcch.seg1a.rachctrl.ac2",
1179 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1180 "Access Class 2 barred", HFILL }
1182 { &hf_seg1a_rachctrl_acc[1],
1183 { "AC1", "gmr1.bcch.seg1a.rachctrl.ac1",
1184 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1185 "Access Class 1 barred", HFILL }
1187 { &hf_seg1a_rachctrl_acc[0],
1188 { "AC0", "gmr1.bcch.seg1a.rachctrl.ac0",
1189 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1190 "Access Class 0 barred", HFILL }
1192 { &hf_seg1a_rachctrl_cell_bar_access,
1193 { "CELL_BAR_ACCESS", "gmr1.bcch.seg1a.rachctrl.cell_bar_access",
1194 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_cell_bar_access_vals), 0x00,
1197 { &hf_seg1a_miscinfo_sb_reselection_hysteresis,
1198 { "SB_RESELECTION_HYSTERESIS", "gmr1.bcch.seg1a.miscinfo.sb_reselection_hysteresis",
1199 FT_UINT8, BASE_CUSTOM, segx_half_db_value_fmt, 0x00,
1202 { &hf_seg1a_miscinfo_spare,
1203 { "Spare", "gmr1.bcch.seg1a.miscinfo.spare",
1204 FT_UINT8, BASE_DEC, NULL, 0x00,
1207 { &hf_seg1a_miscinfo_priority_access_ind,
1208 { "Priority Access Ind", "gmr1.bcch.seg1a.miscinfo.priority_access_ind",
1209 FT_UINT8, BASE_DEC, NULL, 0x00,
1210 "Reserved for future use", HFILL }
1212 { &hf_seg1a_gbch_present,
1213 { "GBCH Present", "gmr1.bcch.seg1a.gbch_present",
1214 FT_UINT8, BASE_DEC, NULL, 0x00,
1217 { &hf_seg1a_test_gs,
1218 { "Test GS", "gmr1.bcch.seg1a.test_gs",
1219 FT_UINT8, BASE_DEC, NULL, 0x00,
1222 { &hf_seg1a_test_gs2,
1223 { "Test GS2", "gmr1.bcch.seg1a.test_gs2",
1224 FT_UINT8, BASE_DEC, NULL, 0x00,
1228 { "Spare", "gmr1.bcch.seg1a.spare1",
1229 FT_UINT8, BASE_DEC, NULL, 0x00,
1232 { &hf_seg1a_cell_bar_access_extension2,
1233 { "CELL_BAR_ACCESS_EXTENSION2", "gmr1.bcch.seg1a.cell_bar_access_extension2",
1234 FT_UINT8, BASE_DEC, NULL, 0x00,
1238 { "Spare", "gmr1.bcch.seg1a.spare2",
1239 FT_UINT8, BASE_DEC, NULL, 0x00,
1242 { &hf_seg1a_cell_bar_access_extension,
1243 { "CELL_BAR_ACCESS_EXTENSION", "gmr1.bcch.seg1a.cell_bar_access_extension",
1244 FT_UINT8, BASE_DEC, NULL, 0x00,
1248 /* Segment 2A - [1] 11.5.2.67 */
1249 { &hf_seg2a_class_4_version,
1250 { "Class 4 version", "gmr1.bcch.seg2a.class_4_version",
1251 FT_UINT8, BASE_DEC, NULL, 0x00,
1252 "Version number for current Class 4 information", HFILL }
1254 { &hf_seg2a_syncinfo_sa_sirfn_delay,
1255 { "SA_SIRFN_DELAY", "gmr1.bcch.seg2a.syncinfo.sa_sirfn_delay",
1256 FT_UINT8, BASE_DEC, NULL, 0x00,
1257 "Delay of system information relative to superframe", HFILL }
1259 { &hf_seg2a_syncinfo_sa_bcch_stn,
1260 { "SA_BCCH_STN", "gmr1.bcch.seg2a.syncinfo.sa_bcch_stn",
1261 FT_UINT8, BASE_DEC, NULL, 0x00,
1262 "Starting timeslot number", HFILL }
1264 { &hf_seg2a_syncinfo_superframe_num,
1265 { "Superframe Number", "gmr1.bcch.seg2a.syncinfo.superframe_num",
1266 FT_UINT16, BASE_DEC, NULL, 0x00,
1269 { &hf_seg2a_syncinfo_multiframe_num,
1270 { "Multiframe Number", "gmr1.bcch.seg2a.syncinfo.multiframe_num",
1271 FT_UINT8, BASE_DEC, NULL, 0x00,
1272 "Multiframe number in a superframe", HFILL }
1274 { &hf_seg2a_syncinfo_mffn_high_bit,
1275 { "MFFN high bit", "gmr1.bcch.seg2a.syncinfo.mffn_high_bit",
1276 FT_UINT8, BASE_DEC, NULL, 0x00,
1277 "High bit of the TDMA FN in a multiframe", HFILL }
1279 { &hf_seg2a_selcrit_rxlev_select_min,
1280 { "RXLEV_SELECT_MIN", "gmr1.bcch.seg2a.selcrit.rxlev_select_min",
1281 FT_UINT8, BASE_CUSTOM, segx_half_db_value_fmt, 0x00,
1282 "Adjustment to threshold to camp-on system", HFILL }
1284 { &hf_seg2a_miscinfo_sb_selection_power,
1285 { "SB_SELECTION_POWER", "gmr1.bcch.seg2a.miscinfo.sb_selection_power",
1286 FT_UINT8, BASE_CUSTOM, segx_half_db_value_fmt, 0x00,
1289 { &hf_seg2a_lainfo_sa_pch_config,
1290 { "SA_PCH_CONFIG", "gmr1.bcch.seg2a.lainfo.sa_pch_config",
1291 FT_UINT8, BASE_DEC, NULL, 0x00,
1292 "Paging group configuration information", HFILL }
1294 { &hf_seg2a_lainfo_sa_bach_config,
1295 { "SA_BACH_CONFIG", "gmr1.bcch.seg2a.lainfo.sa_bach_config",
1296 FT_UINT8, BASE_DEC, NULL, 0x00,
1297 "Alerting group configuration information", HFILL }
1299 { &hf_seg2a_lainfo_rach_ts_offset,
1300 { "RACH_TS_OFFSET", "gmr1.bcch.seg2a.lainfo.rach_ts_offset",
1301 FT_UINT8, BASE_DEC, NULL, 0x00,
1302 "Start of RACH window with respect to BCCH", HFILL }
1304 { &hf_seg2a_lainfo_n_page_occurrences,
1305 { "N Page Occurrences", "gmr1.bcch.seg2a.lainfo.n_page_occurrences",
1306 FT_UINT8, BASE_DEC, NULL, 0x00,
1307 "Number of times a page shall be retransmitted after the initial transmission", HFILL }
1309 { &hf_seg2a_lainfo_imsi_attach_detach_ind,
1310 { "IMSI attach-detach ind", "gmr1.bcch.seg2a.lainfo.imsi_attach_detach_ind",
1311 FT_UINT8, BASE_DEC, VALS(seg2a_lainfo_imsi_attach_detach_ind_vals), 0x00,
1312 "Should MESs apply IMSI attach and detach procedure for this LA", HFILL }
1314 { &hf_seg2a_lainfo_ecsc_indication,
1315 { "ECSC indication", "gmr1.bcch.seg2a.lainfo.ecsc_indication",
1316 FT_UINT8, BASE_DEC, VALS(seg2a_lainfo_ecsc_indication_vals), 0x00,
1317 "Early Classmark Sending Control", HFILL }
1319 { &hf_seg2a_lainfo_si_update_ind,
1320 { "SI update ind", "gmr1.bcch.seg2a.lainfo.si_update_ind",
1321 FT_UINT8, BASE_DEC, NULL, 0x00,
1322 "Flag for BACH reorganization. Value changes after each reorganization", HFILL }
1325 /* Segment 3A - [1] 11.5.2.71 */
1326 { &hf_seg3a_lai_mcc,
1327 { "Mobile Country Code (MCC)", "gmr1.bcch.seg3a.lai.mcc",
1328 FT_UINT16, BASE_DEC, NULL, 0x00,
1331 { &hf_seg3a_lai_mnc,
1332 { "Mobile Network Code (MNC)", "gmr1.bcch.seg3a.lai.mnc",
1333 FT_UINT16, BASE_DEC, NULL, 0x00,
1336 { &hf_seg3a_lai_lac,
1337 { "Location Area Code (LAC)", "gmr1.bcch.seg3a.lai.lac",
1338 FT_UINT16, BASE_HEX, NULL, 0x00,
1341 { &hf_seg3a_lai_msc_id,
1342 { "MSC ID", "gmr1.bcch.seg3a.lai.msc_id",
1343 FT_UINT8, BASE_DEC, NULL, 0x00,
1346 { &hf_seg3a_lai_spot_beam_id,
1347 { "Spot Beam ID", "gmr1.bcch.seg3a.lai.spot_beam_id",
1348 FT_UINT16, BASE_DEC, NULL, 0x00,
1351 { &hf_seg3a_system_sat_id,
1352 { "Satellite ID", "gmr1.bcch.seg3a.system.sat_id",
1353 FT_UINT8, BASE_DEC, NULL, 0x00,
1356 { &hf_seg3a_system_sys_id,
1357 { "System ID", "gmr1.bcch.seg3a.system.sys_id",
1358 FT_UINT8, BASE_DEC, NULL, 0x00,
1361 { &hf_seg3a_satpos_latitude,
1362 { "Latitude", "gmr1.bcch.seg3a.satpos.latitude",
1363 FT_INT8, BASE_CUSTOM, seg3a_latitude_fmt, 0x00,
1366 { &hf_seg3a_satpos_longitude,
1367 { "Longitude", "gmr1.bcch.seg3a.satpos.longitude",
1368 FT_UINT16, BASE_CUSTOM, seg3a_longitude_fmt, 0x00,
1371 { &hf_seg3a_satpos_radius,
1372 { "Radius", "gmr1.bcch.seg3a.satpos.radius",
1373 FT_INT16, BASE_CUSTOM, seg3a_satpos_radius_fmt, 0x00,
1376 { &hf_seg3a_beam_latitude,
1377 { "Latitude", "gmr1.bcch.seg3a.beam.latitude",
1378 FT_INT16, BASE_CUSTOM, seg3a_latitude_fmt, 0x00,
1381 { &hf_seg3a_beam_longitude,
1382 { "Longitude", "gmr1.bcch.seg3a.beam.longitude",
1383 FT_UINT16, BASE_CUSTOM, seg3a_longitude_fmt, 0x00,
1386 { &hf_seg3a_miscinfo_sb_reselection_timer,
1387 { "SB_RESELECTION_TIMER", "gmr1.bcch.seg3a.sb_reselection_timer",
1388 FT_UINT8, BASE_CUSTOM, seg3a_miscinfo_sb_reselection_timer_fmt, 0x00,
1392 { "Spare", "gmr1.bcch.seg3a.spare",
1393 FT_UINT8, BASE_DEC, NULL, 0x00,
1397 /* System Information fields - [1] 10.1.31 & 10.1.32 */
1398 { &hf_si_protocol_version,
1399 { "Protocol version", "gmr1.bcch.si.protocol_version",
1400 FT_UINT8, BASE_DEC, NULL, 0x00,
1403 { &hf_si_block_type,
1404 { "Block Type", "gmr1.bcch.si.block_type",
1405 FT_UINT8, BASE_DEC, NULL, 0x00,
1409 { "Spare", "gmr1.bcch.si.spare",
1410 FT_UINT8, BASE_DEC, NULL, 0x00,
1413 { &hf_si1_randomization_period,
1414 { "Randomization Period", "gmr1.bcch.si.randomization_period",
1415 FT_UINT8, BASE_DEC, VALS(si1_randomization_period_vals), 0x00,
1420 static gint *ett[] = {
1424 proto_gmr1_bcch = proto_register_protocol("GEO-Mobile Radio (1) BCCH", "GMR-1 BCCH", "gmr1.bcch");
1426 proto_register_field_array(proto_gmr1_bcch, hf, array_length(hf));
1427 proto_register_subtree_array(ett, array_length(ett));
1429 register_dissector("gmr1_bcch", dissect_gmr1_bcch, proto_gmr1_bcch);
1433 * Editor modelines - http://www.wireshark.org/tools/modelines.html
1438 * indent-tabs-mode: t
1441 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
1442 * :indentSize=8:tabSize=8:noTabs=false: