Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-gmr1_bcch.c
blob788519e049745b9eabc5aa1aa6cdb9115b9372bb
1 /* packet-gmr1_bcch.c
3 * Routines for GMR-1 BCCH dissection in wireshark.
4 * Copyright (c) 2011 Sylvain Munaut <tnt@246tNt.com>
6 * References:
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 * SPDX-License-Identifier: GPL-2.0-or-later
18 #include "config.h"
20 #include <epan/packet.h>
21 #include <epan/expert.h>
22 #include <wsutil/array.h>
23 #include "packet-csn1.h"
25 void proto_register_gmr1_bcch(void);
27 /* GMR-1 BCCH proto */
28 static int proto_gmr1_bcch;
30 /* GMR-1 BCCH sub tree */
31 static int ett_gmr1_bcch;
33 static expert_field ei_unknown_segment;
35 /* ------------------------------------------------------------------------ */
36 /* CSN1 fields */
37 /* ------------------------------------------------------------------------ */
39 /* Segment 1A fields - [3] 11.5.2.66 */
40 static int hf_seg1a_class_2_version;
41 static int hf_seg1a_class_3_version;
43 static int hf_seg1a_syncinfo_sb_frame_ts_offset;
44 static int hf_seg1a_syncinfo_sb_symbol_offset;
45 static int hf_seg1a_syncinfo_sa_freq_offset;
47 static int hf_seg1a_rachctrl_max_retrans;
48 static int hf_seg1a_rachctrl_acc[16];
49 static int hf_seg1a_rachctrl_cell_bar_access;
51 static int hf_seg1a_miscinfo_sb_reselection_hysteresis;
52 static int hf_seg1a_miscinfo_spare;
53 static int hf_seg1a_miscinfo_priority_access_ind;
55 static int hf_seg1a_gbch_present;
56 static int hf_seg1a_test_gs;
57 static int hf_seg1a_test_gs2;
58 static int hf_seg1a_spare1;
59 static int hf_seg1a_cell_bar_access_extension2;
60 static int hf_seg1a_spare2;
61 static int hf_seg1a_cell_bar_access_extension;
63 /* Segment 2A & 2Abis fields - [3] 11.5.2.67 / 11.5.2.68 */
64 static int hf_seg2a_class_4_version;
66 static int hf_seg2a_syncinfo_sa_sirfn_delay;
67 static int hf_seg2a_syncinfo_sa_bcch_stn;
68 static int hf_seg2a_syncinfo_superframe_num;
69 static int hf_seg2a_syncinfo_multiframe_num;
70 static int hf_seg2a_syncinfo_mffn_high_bit;
72 static int hf_seg2a_selcrit_rxlev_select_min;
74 static int hf_seg2a_miscinfo_sb_selection_power;
76 static int hf_seg2a_lainfo_sa_pch_config;
77 static int hf_seg2a_lainfo_sa_bach_config;
78 static int hf_seg2a_lainfo_rach_ts_offset;
79 static int hf_seg2a_lainfo_n_page_occurrences;
80 static int hf_seg2a_lainfo_imsi_attach_detach_ind;
81 static int hf_seg2a_lainfo_ecsc_indication;
82 static int hf_seg2a_lainfo_si_update_ind;
84 static int hf_seg2a_class_type;
85 static int hf_seg2a_segment_type_a;
86 static int hf_seg2a_segment_type_abis;
88 /* Segment 2B fields */
89 static int hf_seg2b_segment_type_b;
90 /* Segment 2Bbis fields */
91 static int hf_seg2b_segment_type_bbis;
93 /* Segment 3A fields - [1] 11.5.2.71 */
94 static int hf_seg3a_class_type;
95 static int hf_seg3a_segment_type_a;
96 static int hf_seg3a_lai_dissector;
97 static int hf_seg3a_lai_mcc;
98 static int hf_seg3a_lai_mnc;
99 static int hf_seg3a_lai_lac;
100 static int hf_seg3a_lai_msc_id;
101 static int hf_seg3a_lai_spot_beam_id;
103 static int hf_seg3a_system_sat_id;
104 static int hf_seg3a_system_sys_id;
106 static int hf_seg3a_satpos_latitude;
107 static int hf_seg3a_satpos_longitude;
108 static int hf_seg3a_satpos_radius;
110 static int hf_seg3a_beam_latitude;
111 static int hf_seg3a_beam_longitude;
113 static int hf_seg3a_miscinfo_sb_reselection_timer;
115 static int hf_seg3a_spare;
117 static int hf_seg3b_segment_type_b;
118 static int hf_seg3b_segment_type_bbis;
119 static int hf_seg3c_segment_type_c;
120 static int hf_seg3d_segment_type_d;
121 static int hf_seg3e_segment_type_e;
122 static int hf_seg3e_segment_type_ebis;
123 static int hf_seg3f_segment_type_f;
124 static int hf_seg3g_segment_type_g;
125 static int hf_seg3g_segment_type_gbis;
126 static int hf_seg3h_segment_type_h;
127 static int hf_seg3i_segment_type_i;
128 static int hf_seg3j_segment_type_j;
129 static int hf_seg3j_segment_type_jbis;
130 static int hf_seg3k_segment_type_kbis;
131 static int hf_seg4a_class_type;
132 static int hf_seg4a_segment_type_a;
133 static int hf_seg4b_segment_type_b;
134 static int hf_seg4c_segment_type_c;
135 static int hf_seg4d_segment_type_d;
136 static int hf_seg4e_segment_type_e;
137 static int hf_seg4f_segment_type_f;
138 static int hf_seg4g_segment_type_g;
139 static int hf_seg4h_segment_type_h;
140 static int hf_seg4i_segment_type_i;
141 static int hf_seg4j_segment_type_j;
142 static int hf_seg4k_segment_type_k;
144 /* Segment 3B fields */
145 /* Segment 3Bbis fields */
146 /* Segment 3C fields */
147 /* Segment 3D fields */
148 /* Segment 3E fields */
149 /* Segment 3Ebis fields */
150 /* Segment 3F fields */
151 /* Segment 3G fields */
152 /* Segment 3Gbis fields */
153 /* Segment 3H fields */
154 /* Segment 3I fields */
155 /* Segment 3J fields */
156 /* Segment 3Jbis fields */
157 /* Segment 3Kbis fields */
158 /* Segment 3L fields */
159 /* Segment 3M fields */
160 /* Segment 4A fields */
161 /* Segment 4B fields */
162 /* Segment 4C fields */
163 /* Segment 4D fields */
164 /* Segment 4E fields */
165 /* Segment 4F fields */
166 /* Segment 4G fields */
167 /* Segment 4H fields */
168 /* Segment 4I fields */
169 /* Segment 4J fields */
170 /* Segment 4K fields */
172 /* System Information fields [1] 10.1.31 & 10.1.32 */
173 static int hf_si1_segment_choice;
174 static int hf_si_protocol_version;
175 static int hf_si_block_type;
176 static int hf_si_spare;
178 static int hf_si1_randomization_period;
181 /* ------------------------------------------------------------------------ */
182 /* CSN1 parsing structure */
183 /* ------------------------------------------------------------------------ */
185 /* Segments structures */
187 /* Segment 1A - [3] 11.5.2.66 */
188 typedef struct {
189 uint8_t SB_FRAME_TS_OFFSET;
190 int8_t SB_SYMBOL_OFFSET;
191 int8_t SA_FREQ_OFFSET;
192 } Seg1A_SyncInfo_t;
194 typedef struct {
195 uint8_t AC15;
196 uint8_t AC14;
197 uint8_t AC13;
198 uint8_t AC12;
199 uint8_t AC11;
200 uint8_t EC10;
201 uint8_t AC9;
202 uint8_t AC8;
203 uint8_t AC7;
204 uint8_t AC6;
205 uint8_t AC5;
206 uint8_t AC4;
207 uint8_t AC3;
208 uint8_t AC2;
209 uint8_t AC1;
210 uint8_t AC0;
211 } Seg1A_AccessClasses_t;
213 typedef struct {
214 uint8_t Max_Retrans;
215 Seg1A_AccessClasses_t AccessClasses;
216 uint8_t CELL_BAR_ACCESS;
217 } Seg1A_RACHCtrlParams_t;
219 typedef struct {
220 uint8_t SB_RESELECTION_HYSTERESIS;
221 uint8_t Spare;
222 uint8_t PriorityAccessInd;
223 } Seg1A_MiscInfo_t;
225 typedef struct {
226 uint8_t Class_2_version;
227 uint8_t Class_3_version;
228 Seg1A_SyncInfo_t SyncInfo;
229 Seg1A_RACHCtrlParams_t RACHCtrlParams;
230 Seg1A_MiscInfo_t MiscInfo;
231 uint8_t GBCH_Present;
232 uint8_t Test_GS;
233 uint8_t Test_GS2;
234 uint8_t Spare1;
235 uint8_t CELL_BAR_ACCESS_EXTENSION2;
236 uint8_t Spare2;
237 uint8_t CELL_BAR_ACCESS_EXTENSION;
238 } Segment1A_t;
240 /* Segment 2A & 2Abis - [3] 11.5.2.67 / 11.5.2.68 */
241 typedef struct {
242 uint8_t SA_SIRFN_DELAY;
243 uint8_t SA_BCCH_STN;
244 uint16_t SuperframeNum;
245 uint8_t MultiframeNum;
246 uint8_t MFFN_HighBit;
247 } Seg2A_SyncInfo_t;
249 typedef struct {
250 uint8_t RXLEV_SELECT_MIN;
251 } Seg2A_SelectionCriterion_t;
253 typedef struct {
254 uint8_t SB_SELECTION_POWER;
255 } Seg2A_MiscInfo_t;
257 typedef struct {
258 uint8_t SA_PCH_CONFIG;
259 uint8_t SA_BACH_CONFIG;
260 uint8_t RACH_TS_OFFSET;
261 uint8_t N_Page_Occurrences;
262 uint8_t IMSI_attach_detach_ind;
263 uint8_t ECSC_ind;
264 uint8_t SI_update_ind;
265 } Seg2A_LAInfo_t;
267 typedef struct {
268 uint8_t Class_4_version;
269 Seg2A_SyncInfo_t SyncInfo;
270 Seg2A_SelectionCriterion_t SelectionCriterion;
271 Seg2A_MiscInfo_t MiscInfo;
272 Seg2A_LAInfo_t LAInfo;
273 } Segment2A_t;
275 typedef struct {
276 uint8_t Class_4_version;
277 Seg2A_SyncInfo_t SyncInfo;
278 Seg2A_SelectionCriterion_t SelectionCriterion;
279 Seg2A_MiscInfo_t MiscInfo;
280 Seg2A_LAInfo_t LAInfo;
281 } Segment2Abis_t;
283 typedef struct {
284 uint8_t _dummy; /* Remove when dissection is written */
285 } Segment2B_t;
287 typedef struct {
288 uint8_t _dummy; /* Remove when dissection is written */
289 } Segment2Bbis_t;
291 /* Segment 3A - [1] 11.5.2.71 */
292 typedef struct {
293 uint16_t MCC;
294 uint16_t MNC;
295 uint16_t LAC;
296 uint8_t MSC_ID; /* split version of LAC */
297 uint16_t Spot_Beam_ID; /* split version of LAC */
298 } Seg3A_LAI_t;
300 typedef struct {
301 uint8_t Satellite_ID;
302 uint8_t System_ID;
303 } Seg3A_System_t;
305 typedef struct {
306 int8_t Latitude;
307 uint16_t Longitude;
308 int16_t Radius;
309 } Seg3A_SatellitePosition_t;
311 typedef struct {
312 int16_t Latitude;
313 uint16_t Longitude;
314 } Seg3A_BeamPosition_t;
316 typedef struct {
317 uint8_t SB_RESELECTION_TIMER;
318 } Seg3A_MiscInfo_t;
320 typedef struct {
321 Seg3A_LAI_t LAI;
322 Seg3A_System_t System;
323 Seg3A_SatellitePosition_t SatellitePosition;
324 Seg3A_BeamPosition_t BeamPosition;
325 Seg3A_MiscInfo_t MiscInfo;
326 uint8_t Spare;
327 } Segment3A_t;
329 typedef struct {
330 uint8_t _dummy; /* Remove when dissection is written */
331 } Segment3B_t;
333 typedef struct {
334 uint8_t _dummy; /* Remove when dissection is written */
335 } Segment3Bbis_t;
337 typedef struct {
338 uint8_t _dummy; /* Remove when dissection is written */
339 } Segment3C_t;
341 typedef struct {
342 uint8_t _dummy; /* Remove when dissection is written */
343 } Segment3D_t;
345 typedef struct {
346 uint8_t _dummy; /* Remove when dissection is written */
347 } Segment3E_t;
349 typedef struct {
350 uint8_t _dummy; /* Remove when dissection is written */
351 } Segment3Ebis_t;
353 typedef struct {
354 uint8_t _dummy; /* Remove when dissection is written */
355 } Segment3F_t;
357 typedef struct {
358 uint8_t _dummy; /* Remove when dissection is written */
359 } Segment3G_t;
361 typedef struct {
362 uint8_t _dummy; /* Remove when dissection is written */
363 } Segment3Gbis_t;
365 typedef struct {
366 uint8_t _dummy; /* Remove when dissection is written */
367 } Segment3H_t;
369 typedef struct {
370 uint8_t _dummy; /* Remove when dissection is written */
371 } Segment3I_t;
373 typedef struct {
374 uint8_t _dummy; /* Remove when dissection is written */
375 } Segment3J_t;
377 typedef struct {
378 uint8_t _dummy; /* Remove when dissection is written */
379 } Segment3Jbis_t;
381 typedef struct {
382 uint8_t _dummy; /* Remove when dissection is written */
383 } Segment3Kbis_t;
385 typedef struct {
386 uint8_t _dummy; /* Remove when dissection is written */
387 } Segment3L_t;
389 typedef struct {
390 uint8_t _dummy; /* Remove when dissection is written */
391 } Segment3M_t;
393 typedef struct {
394 uint8_t _dummy; /* Remove when dissection is written */
395 } Segment4A_t;
397 typedef struct {
398 uint8_t _dummy; /* Remove when dissection is written */
399 } Segment4B_t;
401 typedef struct {
402 uint8_t _dummy; /* Remove when dissection is written */
403 } Segment4C_t;
405 typedef struct {
406 uint8_t _dummy; /* Remove when dissection is written */
407 } Segment4D_t;
409 typedef struct {
410 uint8_t _dummy; /* Remove when dissection is written */
411 } Segment4E_t;
413 typedef struct {
414 uint8_t _dummy; /* Remove when dissection is written */
415 } Segment4F_t;
417 typedef struct {
418 uint8_t _dummy; /* Remove when dissection is written */
419 } Segment4G_t;
421 typedef struct {
422 uint8_t _dummy; /* Remove when dissection is written */
423 } Segment4H_t;
425 typedef struct {
426 uint8_t _dummy; /* Remove when dissection is written */
427 } Segment4I_t;
429 typedef struct {
430 uint8_t _dummy; /* Remove when dissection is written */
431 } Segment4J_t;
433 typedef struct {
434 uint8_t _dummy; /* Remove when dissection is written */
435 } Segment4K_t;
437 /* System informations structures */
439 /* System Information type 1 - [1] 10.1.31 */
440 typedef struct {
441 uint8_t Protocol_Version;
442 uint8_t Block_Type;
443 uint8_t Randomization_Period;
444 uint8_t Spare;
445 } SI1_Block_Header_t;
447 typedef struct {
448 SI1_Block_Header_t Block_Header;
449 Segment1A_t Segment1A;
450 uint8_t SegmentType;
451 union {
452 Segment2Abis_t Segment2Abis;
453 Segment2Bbis_t Segment2Bbis;
454 Segment3A_t Segment3A;
455 Segment3Bbis_t Segment3Bbis;
456 Segment3C_t Segment3C;
457 Segment3D_t Segment3D;
458 Segment3Ebis_t Segment3Ebis;
459 Segment3F_t Segment3F;
460 Segment3Gbis_t Segment3Gbis;
461 Segment3H_t Segment3H;
462 Segment3I_t Segment3I;
463 Segment3Jbis_t Segment3Jbis;
464 Segment3Kbis_t Segment3Kbis;
465 Segment4A_t Segment4A;
466 Segment4B_t Segment4B;
467 Segment4C_t Segment4C;
468 Segment4D_t Segment4D;
469 Segment4E_t Segment4E;
470 Segment4F_t Segment4F;
471 Segment4G_t Segment4G;
472 Segment4H_t Segment4H;
473 Segment4I_t Segment4I;
474 Segment4J_t Segment4J;
475 Segment4K_t Segment4K;
476 } u;
477 } SystemInformation1_t;
479 /* System Information type 2 - [1] 10.1.32 */
480 typedef struct {
481 uint8_t Protocol_Version;
482 uint8_t Block_Type;
483 uint8_t Spare;
484 } SI2_Block_Header_t;
486 typedef struct {
487 SI2_Block_Header_t Block_Header;
488 uint8_t SegmentType;
489 union {
490 Segment2A_t Segment2A;
491 Segment2B_t Segment2B;
492 Segment3B_t Segment3B;
493 Segment3E_t Segment3E;
494 Segment3G_t Segment3G;
495 Segment3J_t Segment3J;
496 } u;
497 } SystemInformation2_t;
500 /* ------------------------------------------------------------------------ */
501 /* CSN1 parsing definitions */
502 /* ------------------------------------------------------------------------ */
504 /* Segments */
506 /* Segment 1A - [3] 11.5.2.66 */
507 static const
508 CSN_DESCR_BEGIN(Seg1A_SyncInfo_t)
509 M_UINT (Seg1A_SyncInfo_t, SB_FRAME_TS_OFFSET, 5, &hf_seg1a_syncinfo_sb_frame_ts_offset),
510 M_UINT (Seg1A_SyncInfo_t, SB_SYMBOL_OFFSET, 6, &hf_seg1a_syncinfo_sb_symbol_offset),
511 M_UINT (Seg1A_SyncInfo_t, SA_FREQ_OFFSET, 8, &hf_seg1a_syncinfo_sa_freq_offset),
512 CSN_DESCR_END (Seg1A_SyncInfo_t)
514 static const
515 CSN_DESCR_BEGIN(Seg1A_AccessClasses_t)
516 M_UINT (Seg1A_AccessClasses_t, AC15, 1, &hf_seg1a_rachctrl_acc[15]),
517 M_UINT (Seg1A_AccessClasses_t, AC14, 1, &hf_seg1a_rachctrl_acc[14]),
518 M_UINT (Seg1A_AccessClasses_t, AC13, 1, &hf_seg1a_rachctrl_acc[13]),
519 M_UINT (Seg1A_AccessClasses_t, AC12, 1, &hf_seg1a_rachctrl_acc[12]),
520 M_UINT (Seg1A_AccessClasses_t, AC11, 1, &hf_seg1a_rachctrl_acc[11]),
521 M_UINT (Seg1A_AccessClasses_t, EC10, 1, &hf_seg1a_rachctrl_acc[10]),
522 M_UINT (Seg1A_AccessClasses_t, AC9, 1, &hf_seg1a_rachctrl_acc[9]),
523 M_UINT (Seg1A_AccessClasses_t, AC8, 1, &hf_seg1a_rachctrl_acc[8]),
524 M_UINT (Seg1A_AccessClasses_t, AC7, 1, &hf_seg1a_rachctrl_acc[7]),
525 M_UINT (Seg1A_AccessClasses_t, AC6, 1, &hf_seg1a_rachctrl_acc[6]),
526 M_UINT (Seg1A_AccessClasses_t, AC5, 1, &hf_seg1a_rachctrl_acc[5]),
527 M_UINT (Seg1A_AccessClasses_t, AC4, 1, &hf_seg1a_rachctrl_acc[4]),
528 M_UINT (Seg1A_AccessClasses_t, AC3, 1, &hf_seg1a_rachctrl_acc[3]),
529 M_UINT (Seg1A_AccessClasses_t, AC2, 1, &hf_seg1a_rachctrl_acc[2]),
530 M_UINT (Seg1A_AccessClasses_t, AC1, 1, &hf_seg1a_rachctrl_acc[1]),
531 M_UINT (Seg1A_AccessClasses_t, AC0, 1, &hf_seg1a_rachctrl_acc[0]),
532 CSN_DESCR_END (Seg1A_AccessClasses_t)
534 static const
535 CSN_DESCR_BEGIN(Seg1A_RACHCtrlParams_t)
536 M_UINT (Seg1A_RACHCtrlParams_t, Max_Retrans, 2, &hf_seg1a_rachctrl_max_retrans),
537 M_TYPE_LABEL (Seg1A_RACHCtrlParams_t, AccessClasses, Seg1A_AccessClasses_t, "Access Classes"),
538 M_UINT (Seg1A_RACHCtrlParams_t, CELL_BAR_ACCESS, 1, &hf_seg1a_rachctrl_cell_bar_access),
539 CSN_DESCR_END (Seg1A_RACHCtrlParams_t)
541 static const
542 CSN_DESCR_BEGIN(Seg1A_MiscInfo_t)
543 M_UINT (Seg1A_MiscInfo_t, SB_RESELECTION_HYSTERESIS, 4, &hf_seg1a_miscinfo_sb_reselection_hysteresis),
544 M_UINT (Seg1A_MiscInfo_t, Spare, 1, &hf_seg1a_miscinfo_spare),
545 M_UINT (Seg1A_MiscInfo_t, PriorityAccessInd, 1, &hf_seg1a_miscinfo_priority_access_ind),
546 CSN_DESCR_END (Seg1A_MiscInfo_t)
548 static const
549 CSN_DESCR_BEGIN(Segment1A_t)
550 M_UINT (Segment1A_t, Class_2_version, 3, &hf_seg1a_class_2_version),
551 M_UINT (Segment1A_t, Class_3_version, 4, &hf_seg1a_class_3_version),
552 M_TYPE_LABEL (Segment1A_t, SyncInfo, Seg1A_SyncInfo_t, "Synchronization Info Class 1"),
553 M_TYPE_LABEL (Segment1A_t, RACHCtrlParams, Seg1A_RACHCtrlParams_t, "RACH Control Parameters"),
554 M_TYPE_LABEL (Segment1A_t, MiscInfo, Seg1A_MiscInfo_t, "Misc Info Class 1"),
555 M_UINT (Segment1A_t, GBCH_Present, 1, &hf_seg1a_gbch_present),
556 M_UINT (Segment1A_t, Test_GS, 1, &hf_seg1a_test_gs),
557 M_UINT (Segment1A_t, Test_GS2, 1, &hf_seg1a_test_gs2),
558 M_UINT (Segment1A_t, Spare1, 3, &hf_seg1a_spare1),
559 M_UINT (Segment1A_t, CELL_BAR_ACCESS_EXTENSION2, 1, &hf_seg1a_cell_bar_access_extension2),
560 M_UINT (Segment1A_t, Spare2, 5, &hf_seg1a_spare2),
561 M_UINT (Segment1A_t, CELL_BAR_ACCESS_EXTENSION, 1, &hf_seg1a_cell_bar_access_extension),
562 CSN_DESCR_END (Segment1A_t)
564 /* Segment 2A & 2Abis - [1] 11.5.2.67 / 11.5.2.68 */
565 static const
566 CSN_DESCR_BEGIN(Seg2A_SyncInfo_t)
567 M_UINT (Seg2A_SyncInfo_t, SA_SIRFN_DELAY, 4, &hf_seg2a_syncinfo_sa_sirfn_delay),
568 M_UINT (Seg2A_SyncInfo_t, SA_BCCH_STN, 5, &hf_seg2a_syncinfo_sa_bcch_stn),
569 M_UINT (Seg2A_SyncInfo_t, SuperframeNum, 13, &hf_seg2a_syncinfo_superframe_num),
570 M_UINT (Seg2A_SyncInfo_t, MultiframeNum, 2, &hf_seg2a_syncinfo_multiframe_num),
571 M_UINT (Seg2A_SyncInfo_t, MFFN_HighBit, 1, &hf_seg2a_syncinfo_mffn_high_bit),
572 CSN_DESCR_END (Seg2A_SyncInfo_t)
574 static const
575 CSN_DESCR_BEGIN(Seg2A_SelectionCriterion_t)
576 M_UINT (Seg2A_SelectionCriterion_t, RXLEV_SELECT_MIN, 5, &hf_seg2a_selcrit_rxlev_select_min),
577 CSN_DESCR_END (Seg2A_SelectionCriterion_t)
579 static const
580 CSN_DESCR_BEGIN(Seg2A_MiscInfo_t)
581 M_UINT (Seg2A_MiscInfo_t, SB_SELECTION_POWER, 4, &hf_seg2a_miscinfo_sb_selection_power),
582 CSN_DESCR_END (Seg2A_MiscInfo_t)
584 static const
585 CSN_DESCR_BEGIN(Seg2A_LAInfo_t)
586 M_UINT (Seg2A_LAInfo_t, SA_PCH_CONFIG, 2, &hf_seg2a_lainfo_sa_pch_config),
587 M_UINT (Seg2A_LAInfo_t, SA_BACH_CONFIG, 8, &hf_seg2a_lainfo_sa_bach_config),
588 M_UINT (Seg2A_LAInfo_t, RACH_TS_OFFSET, 5, &hf_seg2a_lainfo_rach_ts_offset),
589 M_UINT (Seg2A_LAInfo_t, N_Page_Occurrences, 2, &hf_seg2a_lainfo_n_page_occurrences),
590 M_UINT (Seg2A_LAInfo_t, IMSI_attach_detach_ind, 1, &hf_seg2a_lainfo_imsi_attach_detach_ind),
591 M_UINT (Seg2A_LAInfo_t, ECSC_ind, 1, &hf_seg2a_lainfo_ecsc_indication),
592 M_UINT (Seg2A_LAInfo_t, SI_update_ind, 1, &hf_seg2a_lainfo_si_update_ind),
593 CSN_DESCR_END (Seg2A_LAInfo_t)
595 static const
596 CSN_DESCR_BEGIN(Segment2A_t)
597 M_FIXED_LABEL(Segment2A_t, 2, 0x2, "Class type: 2", &hf_seg2a_class_type),
598 M_FIXED_LABEL(Segment2A_t, 4, 0x0, "Segment type: A", &hf_seg2a_segment_type_a),
599 M_UINT (Segment2A_t, Class_4_version, 3, &hf_seg2a_class_4_version),
600 M_TYPE_LABEL (Segment2A_t, SyncInfo, Seg2A_SyncInfo_t, "Synchronization Info Class 2"),
601 M_TYPE_LABEL (Segment2A_t, SelectionCriterion, Seg2A_SelectionCriterion_t, "Selection Criterion"),
602 M_TYPE_LABEL (Segment2A_t, MiscInfo, Seg2A_MiscInfo_t, "Misc Info Class 2"),
603 M_TYPE_LABEL (Segment2A_t, LAInfo, Seg2A_LAInfo_t, "LA Info Class 2"),
604 CSN_DESCR_END (Segment2A_t)
606 static const
607 CSN_DESCR_BEGIN(Segment2Abis_t)
608 M_FIXED_LABEL(Segment2Abis_t, 2, 0x2, "Class type: 2", &hf_seg2a_class_type),
609 M_FIXED_LABEL(Segment2Abis_t, 4, 0x0, "Segment type: Abis", &hf_seg2a_segment_type_abis),
610 M_UINT (Segment2Abis_t, Class_4_version, 3, &hf_seg2a_class_4_version),
611 M_TYPE_LABEL (Segment2Abis_t, SyncInfo, Seg2A_SyncInfo_t, "Synchronization Info Class 2"),
612 M_TYPE_LABEL (Segment2Abis_t, SelectionCriterion, Seg2A_SelectionCriterion_t, "Selection Criterion"),
613 M_TYPE_LABEL (Segment2Abis_t, MiscInfo, Seg2A_MiscInfo_t, "Misc Info Class 2"),
614 M_TYPE_LABEL (Segment2Abis_t, LAInfo, Seg2A_LAInfo_t, "LA Info Class 2"),
615 CSN_DESCR_END (Segment2Abis_t)
617 static const
618 CSN_DESCR_BEGIN(Segment2B_t)
619 M_FIXED_LABEL(Segment2B_t, 2, 0x2, "Class type: 2", &hf_seg2a_class_type),
620 M_FIXED_LABEL(Segment2B_t, 4, 0x1, "Segment type: B", &hf_seg2b_segment_type_b),
621 CSN_DESCR_END (Segment2B_t)
623 static const
624 CSN_DESCR_BEGIN(Segment2Bbis_t)
625 M_FIXED_LABEL(Segment2Bbis_t, 2, 0x2, "Class type: 2", &hf_seg2a_class_type),
626 M_FIXED_LABEL(Segment2Bbis_t, 4, 0x1, "Segment type: B bis", &hf_seg2b_segment_type_bbis),
627 CSN_DESCR_END (Segment2Bbis_t)
629 /* Segment 3A - [1] 11.5.2.71 */
630 static int16_t
631 Seg3A_LAI_Dissector(proto_tree *tree, csnStream_t* ar, tvbuff_t *tvb, void* data, int ett_csn1)
633 Seg3A_LAI_t *LAI = (Seg3A_LAI_t *)data;
634 proto_item *lac_item;
635 proto_tree *lac_tree;
636 uint8_t c[5];
637 int i;
639 if (ar->remaining_bits_len < 5*8)
640 return -1;
642 for (i=0; i<5; i++)
643 c[i] = tvb_get_bits8(tvb, ar->bit_offset + (i<<3), 8);
645 LAI->MCC = (c[0] & 0xf) * 100 + ((c[0] & 0xf0) >> 4) * 10 + (c[1] & 0xf);
646 LAI->MNC = (c[2] & 0xf) * 10 + ((c[2] & 0xf0) >> 4);
648 LAI->LAC = (c[3] << 8) | c[4];
649 LAI->MSC_ID = (LAI->LAC >> 10) & 0x3f;
650 LAI->Spot_Beam_ID = LAI->LAC & 0x03ff;
652 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);
653 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);
655 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);
656 lac_tree = proto_item_add_subtree(lac_item, ett_csn1);
658 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);
659 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);
661 ar->remaining_bits_len -= 5*8;
662 ar->bit_offset += 5*8;
664 return 0;
667 static const
668 CSN_DESCR_BEGIN(Seg3A_System_t)
669 M_UINT (Seg3A_System_t, Satellite_ID, 2, &hf_seg3a_system_sat_id),
670 M_UINT (Seg3A_System_t, System_ID, 4, &hf_seg3a_system_sys_id),
671 CSN_DESCR_END (Seg3A_System_t)
673 static const
674 CSN_DESCR_BEGIN(Seg3A_SatellitePosition_t)
675 M_UINT (Seg3A_SatellitePosition_t, Latitude, 8, &hf_seg3a_satpos_latitude),
676 M_UINT (Seg3A_SatellitePosition_t, Longitude, 12, &hf_seg3a_satpos_longitude),
677 M_UINT (Seg3A_SatellitePosition_t, Radius, 16, &hf_seg3a_satpos_radius),
678 CSN_DESCR_END (Seg3A_SatellitePosition_t)
680 static const
681 CSN_DESCR_BEGIN(Seg3A_BeamPosition_t)
682 M_UINT (Seg3A_BeamPosition_t, Latitude, 11, &hf_seg3a_beam_latitude),
683 M_UINT (Seg3A_BeamPosition_t, Longitude, 12, &hf_seg3a_beam_longitude),
684 CSN_DESCR_END (Seg3A_BeamPosition_t)
686 static const
687 CSN_DESCR_BEGIN(Seg3A_MiscInfo_t)
688 M_UINT (Seg3A_MiscInfo_t, SB_RESELECTION_TIMER, 6, &hf_seg3a_miscinfo_sb_reselection_timer),
689 CSN_DESCR_END (Seg3A_MiscInfo_t)
691 static const
692 CSN_DESCR_BEGIN(Segment3A_t)
693 M_FIXED_LABEL(Segment3A_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
694 M_FIXED_LABEL(Segment3A_t, 4, 0x0, "Segment type: A", &hf_seg3a_segment_type_a),
695 M_SERIALIZE (Segment3A_t, LAI, 0, &hf_seg3a_lai_dissector, Seg3A_LAI_Dissector),
696 M_TYPE_LABEL (Segment3A_t, System, Seg3A_System_t, "System"),
697 M_TYPE_LABEL (Segment3A_t, SatellitePosition, Seg3A_SatellitePosition_t, "Satellite Position"),
698 M_TYPE_LABEL (Segment3A_t, BeamPosition, Seg3A_BeamPosition_t, "Beam Center Position"),
699 M_TYPE_LABEL (Segment3A_t, MiscInfo, Seg3A_MiscInfo_t, "Misc Info Class 3"),
700 M_UINT (Segment3A_t, Spare, 4, &hf_seg3a_spare),
701 CSN_DESCR_END (Segment3A_t)
703 static const
704 CSN_DESCR_BEGIN(Segment3B_t)
705 M_FIXED_LABEL(Segment3B_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
706 M_FIXED_LABEL(Segment3B_t, 4, 0x1, "Segment type: B", &hf_seg3b_segment_type_b),
707 CSN_DESCR_END (Segment3B_t)
709 static const
710 CSN_DESCR_BEGIN(Segment3Bbis_t)
711 M_FIXED_LABEL(Segment3Bbis_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
712 M_FIXED_LABEL(Segment3Bbis_t, 4, 0x1, "Segment type: B bis", &hf_seg3b_segment_type_bbis),
713 CSN_DESCR_END (Segment3Bbis_t)
715 static const
716 CSN_DESCR_BEGIN(Segment3C_t)
717 M_FIXED_LABEL(Segment3C_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
718 M_FIXED_LABEL(Segment3C_t, 4, 0x2, "Segment type: C", &hf_seg3c_segment_type_c),
719 CSN_DESCR_END (Segment3C_t)
721 static const
722 CSN_DESCR_BEGIN(Segment3D_t)
723 M_FIXED_LABEL(Segment3D_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
724 M_FIXED_LABEL(Segment3D_t, 4, 0x3, "Segment type: D", &hf_seg3d_segment_type_d),
725 CSN_DESCR_END (Segment3D_t)
727 static const
728 CSN_DESCR_BEGIN(Segment3E_t)
729 M_FIXED_LABEL(Segment3E_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
730 M_FIXED_LABEL(Segment3E_t, 4, 0x4, "Segment type: E", &hf_seg3e_segment_type_e),
731 CSN_DESCR_END (Segment3E_t)
733 static const
734 CSN_DESCR_BEGIN(Segment3Ebis_t)
735 M_FIXED_LABEL(Segment3Ebis_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
736 M_FIXED_LABEL(Segment3Ebis_t, 4, 0x4, "Segment type: E bis", &hf_seg3e_segment_type_ebis),
737 CSN_DESCR_END (Segment3Ebis_t)
739 static const
740 CSN_DESCR_BEGIN(Segment3F_t)
741 M_FIXED_LABEL(Segment3F_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
742 M_FIXED_LABEL(Segment3F_t, 4, 0x5, "Segment type: F", &hf_seg3f_segment_type_f),
743 CSN_DESCR_END (Segment3F_t)
745 static const
746 CSN_DESCR_BEGIN(Segment3G_t)
747 M_FIXED_LABEL(Segment3G_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
748 M_FIXED_LABEL(Segment3G_t, 4, 0x6, "Segment type: G", &hf_seg3g_segment_type_g),
749 CSN_DESCR_END (Segment3G_t)
751 static const
752 CSN_DESCR_BEGIN(Segment3Gbis_t)
753 M_FIXED_LABEL(Segment3Gbis_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
754 M_FIXED_LABEL(Segment3Gbis_t, 4, 0x6, "Segment type: G bis", &hf_seg3g_segment_type_gbis),
755 CSN_DESCR_END (Segment3Gbis_t)
757 static const
758 CSN_DESCR_BEGIN(Segment3H_t)
759 M_FIXED_LABEL(Segment3H_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
760 M_FIXED_LABEL(Segment3H_t, 4, 0x7, "Segment type: H", &hf_seg3h_segment_type_h),
761 CSN_DESCR_END (Segment3H_t)
763 static const
764 CSN_DESCR_BEGIN(Segment3I_t)
765 M_FIXED_LABEL(Segment3I_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
766 M_FIXED_LABEL(Segment3I_t, 4, 0x9, "Segment type: I", &hf_seg3i_segment_type_i),
767 CSN_DESCR_END (Segment3I_t)
769 static const
770 CSN_DESCR_BEGIN(Segment3J_t)
771 M_FIXED_LABEL(Segment3J_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
772 M_FIXED_LABEL(Segment3J_t, 4, 0xa, "Segment type: J", &hf_seg3j_segment_type_j),
773 CSN_DESCR_END (Segment3J_t)
775 static const
776 CSN_DESCR_BEGIN(Segment3Jbis_t)
777 M_FIXED_LABEL(Segment3Jbis_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
778 M_FIXED_LABEL(Segment3Jbis_t, 4, 0xa, "Segment type: J bis", &hf_seg3j_segment_type_jbis),
779 CSN_DESCR_END (Segment3Jbis_t)
781 static const
782 CSN_DESCR_BEGIN(Segment3Kbis_t)
783 M_FIXED_LABEL(Segment3Kbis_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
784 M_FIXED_LABEL(Segment3Kbis_t, 4, 0xb, "Segment type: K bis", &hf_seg3k_segment_type_kbis),
785 CSN_DESCR_END (Segment3Kbis_t)
787 #if 0
788 static const
789 CSN_DESCR_BEGIN(Segment3L_t)
790 M_FIXED_LABEL(Segment3L_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
791 M_FIXED_LABEL(Segment3L_t, 4, 0xc, "Segment type: L", &hf_seg3l_segment_type_l),
792 CSN_DESCR_END (Segment3L_t)
793 #endif
795 #if 0
796 static const
797 CSN_DESCR_BEGIN(Segment3M_t)
798 M_FIXED_LABEL(Segment3M_t, 1, 0x0, "Class type: 3", &hf_seg3a_class_type),
799 M_FIXED_LABEL(Segment3M_t, 4, 0xd, "Segment type: M", &hf_seg3m_segment_type_m),
800 CSN_DESCR_END (Segment3M_t)
801 #endif
803 static const
804 CSN_DESCR_BEGIN(Segment4A_t)
805 M_FIXED_LABEL(Segment4A_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
806 M_FIXED_LABEL(Segment4A_t, 4, 0x0, "Segment type: A", &hf_seg4a_segment_type_a),
807 CSN_DESCR_END (Segment4A_t)
809 static const
810 CSN_DESCR_BEGIN(Segment4B_t)
811 M_FIXED_LABEL(Segment4B_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
812 M_FIXED_LABEL(Segment4B_t, 4, 0x1, "Segment type: B", &hf_seg4b_segment_type_b),
813 CSN_DESCR_END (Segment4B_t)
815 static const
816 CSN_DESCR_BEGIN(Segment4C_t)
817 M_FIXED_LABEL(Segment4C_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
818 M_FIXED_LABEL(Segment4C_t, 4, 0x2, "Segment type: C", &hf_seg4c_segment_type_c),
819 CSN_DESCR_END (Segment4C_t)
821 static const
822 CSN_DESCR_BEGIN(Segment4D_t)
823 M_FIXED_LABEL(Segment4D_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
824 M_FIXED_LABEL(Segment4D_t, 4, 0x3, "Segment type: D", &hf_seg4d_segment_type_d),
825 CSN_DESCR_END (Segment4D_t)
827 static const
828 CSN_DESCR_BEGIN(Segment4E_t)
829 M_FIXED_LABEL(Segment4E_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
830 M_FIXED_LABEL(Segment4E_t, 4, 0x4, "Segment type: E", &hf_seg4e_segment_type_e),
831 CSN_DESCR_END (Segment4E_t)
833 static const
834 CSN_DESCR_BEGIN(Segment4F_t)
835 M_FIXED_LABEL(Segment4F_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
836 M_FIXED_LABEL(Segment4F_t, 4, 0x5, "Segment type: F", &hf_seg4f_segment_type_f),
837 CSN_DESCR_END (Segment4F_t)
839 static const
840 CSN_DESCR_BEGIN(Segment4G_t)
841 M_FIXED_LABEL(Segment4G_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
842 M_FIXED_LABEL(Segment4G_t, 4, 0x6, "Segment type: G", &hf_seg4g_segment_type_g),
843 CSN_DESCR_END (Segment4G_t)
845 static const
846 CSN_DESCR_BEGIN(Segment4H_t)
847 M_FIXED_LABEL(Segment4H_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
848 M_FIXED_LABEL(Segment4H_t, 4, 0x7, "Segment type: H", &hf_seg4h_segment_type_h),
849 CSN_DESCR_END (Segment4H_t)
851 static const
852 CSN_DESCR_BEGIN(Segment4I_t)
853 M_FIXED_LABEL(Segment4I_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
854 M_FIXED_LABEL(Segment4I_t, 4, 0x8, "Segment type: I", &hf_seg4i_segment_type_i),
855 CSN_DESCR_END (Segment4I_t)
857 static const
858 CSN_DESCR_BEGIN(Segment4J_t)
859 M_FIXED_LABEL(Segment4J_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
860 M_FIXED_LABEL(Segment4J_t, 4, 0x9, "Segment type: J", &hf_seg4j_segment_type_j),
861 CSN_DESCR_END (Segment4J_t)
863 static const
864 CSN_DESCR_BEGIN(Segment4K_t)
865 M_FIXED_LABEL(Segment4K_t, 3, 0x6, "Class type: 4", &hf_seg4a_class_type),
866 M_FIXED_LABEL(Segment4K_t, 4, 0xa, "Segment type: K", &hf_seg4k_segment_type_k),
867 CSN_DESCR_END (Segment4K_t)
870 /* System information */
872 /* System Information type 1 - [1] 10.1.31 */
874 static const
875 CSN_DESCR_BEGIN(SI1_Block_Header_t)
876 M_UINT (SI1_Block_Header_t, Protocol_Version, 4, &hf_si_protocol_version),
877 M_UINT (SI1_Block_Header_t, Block_Type, 1, &hf_si_block_type),
878 M_UINT (SI1_Block_Header_t, Randomization_Period, 2, &hf_si1_randomization_period),
879 M_UINT (SI1_Block_Header_t, Spare, 1, &hf_si_spare),
880 CSN_DESCR_END (SI1_Block_Header_t)
882 static const
883 CSN_ChoiceElement_t SI1_SegmentChoice[] =
885 {6, 0x20, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment2Abis, Segment2Abis_t, "Segment 2A bis")},
886 {6, 0x21, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment2Bbis, Segment2Bbis_t, "Segment 2B bis")},
887 {5, 0x00, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3A, Segment3A_t, "Segment 3A")},
888 {5, 0x01, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3Bbis, Segment3Bbis_t, "Segment 3B bis")},
889 {5, 0x02, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3C, Segment3C_t, "Segment 3C")},
890 {5, 0x03, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3D, Segment3D_t, "Segment 3D")},
891 {5, 0x04, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3Ebis, Segment3Ebis_t, "Segment 3E bis")},
892 {5, 0x05, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3F, Segment3F_t, "Segment 3F")},
893 {5, 0x06, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3Gbis, Segment3Gbis_t, "Segment 3G bis")},
894 {5, 0x07, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3H, Segment3H_t, "Segment 3H")},
895 {5, 0x09, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3I, Segment3I_t, "Segment 3I")},
896 {5, 0x0a, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3Jbis, Segment3Jbis_t, "Segment 3J bis")},
897 {5, 0x0b, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment3Kbis, Segment3Kbis_t, "Segment 3K bis")},
898 {7, 0x60, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4A, Segment4A_t, "Segment 4A")},
899 {7, 0x61, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4B, Segment4B_t, "Segment 4B")},
900 {7, 0x62, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4C, Segment4C_t, "Segment 4C")},
901 {7, 0x63, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4D, Segment4D_t, "Segment 4D")},
902 {7, 0x64, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4E, Segment4E_t, "Segment 4E")},
903 {7, 0x65, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4F, Segment4F_t, "Segment 4F")},
904 {7, 0x66, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4G, Segment4G_t, "Segment 4G")},
905 {7, 0x67, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4H, Segment4H_t, "Segment 4H")},
906 {7, 0x68, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4I, Segment4I_t, "Segment 4I")},
907 {7, 0x69, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4J, Segment4J_t, "Segment 4J")},
908 {7, 0x6a, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4K, Segment4K_t, "Segment 4K")},
909 {0, 0x00, 1, CSN_ERROR(SystemInformation1_t, "Unknown segment !", -1, &ei_unknown_segment)},
912 static const
913 CSN_DESCR_BEGIN(SystemInformation1_t)
914 M_TYPE_LABEL (SystemInformation1_t, Block_Header, SI1_Block_Header_t, "Block Header"),
915 M_TYPE_LABEL (SystemInformation1_t, Segment1A, Segment1A_t, "Segment 1A"),
916 M_CHOICE_IL (SystemInformation1_t, SegmentType, SI1_SegmentChoice, array_length(SI1_SegmentChoice), &hf_si1_segment_choice),
917 CSN_DESCR_END (SystemInformation1_t)
919 /* System Information type 2 - [1] 10.1.32 */
921 static CSN_DESCR_BEGIN(SI2_Block_Header_t)
922 M_UINT (SI2_Block_Header_t, Protocol_Version, 4, &hf_si_protocol_version),
923 M_UINT (SI2_Block_Header_t, Block_Type, 1, &hf_si_block_type),
924 M_UINT (SI2_Block_Header_t, Spare, 3, &hf_si_spare),
925 CSN_DESCR_END (SI2_Block_Header_t)
927 static const
928 CSN_ChoiceElement_t SI2_SegmentChoice[] =
930 {6, 0x20, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment2A, Segment2A_t, "Segment 2A")},
931 {6, 0x21, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment2B, Segment2B_t, "Segment 2B")},
932 {5, 0x01, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment3B, Segment3B_t, "Segment 3B")},
933 {5, 0x04, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment3E, Segment3E_t, "Segment 3E")},
934 {5, 0x06, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment3G, Segment3G_t, "Segment 3G")},
935 {5, 0x0a, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment3J, Segment3J_t, "Segment 3J")},
936 {0, 0x00, 1, CSN_ERROR(SystemInformation2_t, "Unknown segment !", -1, &ei_unknown_segment)},
939 static const
940 CSN_DESCR_BEGIN(SystemInformation2_t)
941 M_TYPE_LABEL (SystemInformation2_t, Block_Header, SI2_Block_Header_t, "Block Header"),
942 M_CHOICE_IL (SystemInformation2_t, SegmentType, SI2_SegmentChoice, array_length(SI2_SegmentChoice), &hf_si1_segment_choice),
943 CSN_DESCR_END (SystemInformation2_t)
946 /* ------------------------------------------------------------------------ */
947 /* Fields values */
948 /* ------------------------------------------------------------------------ */
950 /* Common stuff */
951 static void
952 segx_half_db_value_fmt(char *s, uint32_t v)
954 snprintf(s, ITEM_LABEL_LENGTH, "%2.1f dB (%u)", v * 0.5f, v);
957 /* Segment 1A - [3] 11.5.2.66 */
958 static void
959 seg1a_syncinfo_sa_freq_offset_fmt(char *s, uint32_t v)
961 int32_t sv = (int32_t)v;
962 snprintf(s, ITEM_LABEL_LENGTH, "%d Hz (%d)", sv * 5, sv);
965 static const value_string seg1a_rachctrl_acc_vals[] = {
966 { 0, "not barred (allowed)"},
967 { 1, "barred (not allowed)"},
968 { 0, NULL }
971 static const value_string seg1a_rachctrl_cell_bar_access_vals[] = {
972 { 0, "The cell is not barred"},
973 { 1, "The cell is barred"},
974 { 0, NULL }
977 /* Segment 2A & 2Abis - [1] 11.5.2.67 & 11.5.2.68 */
978 static const value_string seg2a_lainfo_imsi_attach_detach_ind_vals[] = {
979 { 0, "MESs shall NOT apply IMSI attach and detach procedure for this LA"},
980 { 1, "MESs shall apply IMSI attach and detach procedure for this LA"},
981 { 0, NULL }
984 static const value_string seg2a_lainfo_ecsc_indication_vals[] = {
985 { 0, "Early sending is explicitly prohibited"},
986 { 1, "Early sending is explicitly accepted"},
987 { 0, NULL }
990 /* Segment 3A - [1] 11.5.2.71 */
991 static void
992 seg3a_latitude_fmt(char *s, uint32_t v)
994 int32_t sv = (int32_t)v;
995 char c;
997 if (sv < 0) {
998 c = 'S';
999 sv = -sv;
1000 } else
1001 c = 'N';
1003 snprintf(s, ITEM_LABEL_LENGTH, "%.1f %c (%d)", sv / 10.0f, c, sv);
1006 static void
1007 seg3a_longitude_fmt(char *s, uint32_t v)
1009 int32_t sv;
1010 char c;
1012 if (v < 1800) {
1013 c = 'W';
1014 sv = v;
1015 } else {
1016 c = 'E';
1017 sv = 3600 - v;
1020 snprintf(s, ITEM_LABEL_LENGTH, "%.1f %c (%u)", sv / 10.0f, c, v);
1023 static void
1024 seg3a_satpos_radius_fmt(char *s, uint32_t v)
1026 int32_t sv = (int32_t)v;
1027 int32_t a = (42162 * 1000) + (sv * 5);
1028 snprintf(s, ITEM_LABEL_LENGTH, "%.3lf km (%u)", a / 1000.0, sv);
1031 static void
1032 seg3a_miscinfo_sb_reselection_timer_fmt(char *s, uint32_t v)
1034 snprintf(s, ITEM_LABEL_LENGTH, "%d minutes (%u)", v*4, v);
1037 /* System Information 1 - [1] 10.3.31 */
1038 static const value_string si1_randomization_period_vals[] = {
1039 { 0, "7 frames after this SI block" },
1040 { 1, "15 frames after this SI block" },
1041 { 2, "23 frames after this SI block" },
1042 { 3, "31 frames after this SI block" },
1043 { 0, NULL }
1047 /* ------------------------------------------------------------------------ */
1048 /* Dissector code */
1049 /* ------------------------------------------------------------------------ */
1051 static int
1052 dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dissector_data _U_)
1054 proto_item *bcch_item = NULL;
1055 proto_tree *bcch_tree = NULL;
1056 csnStream_t ar;
1057 bool is_si1;
1059 col_append_str(pinfo->cinfo, COL_INFO, "(BCCH) ");
1061 is_si1 = tvb_get_bits8(tvb, 0, 5) & 1;
1063 bcch_item = proto_tree_add_protocol_format(
1064 tree, proto_gmr1_bcch, tvb, 0, -1,
1065 "GMR-1 BCCH - System Information type %d", is_si1 ? 1 : 2
1067 bcch_tree = proto_item_add_subtree(bcch_item, ett_gmr1_bcch);
1069 csnStreamInit(&ar, 0, tvb_captured_length(tvb)*8, pinfo);
1071 /* SI1 or SI2 */
1072 if (is_si1) {
1073 SystemInformation1_t *data;
1074 data = wmem_new(pinfo->pool, SystemInformation1_t);
1075 /* Initialize the type to the last element, which is an
1076 * "Unknown", in case the dissector bails before getting this
1077 * far. */
1078 data->SegmentType = array_length(SI1_SegmentChoice) - 1;
1079 csnStreamDissector(bcch_tree, &ar, CSNDESCR(SystemInformation1_t), tvb, data, ett_gmr1_bcch);
1080 col_append_fstr(
1081 pinfo->cinfo, COL_INFO,
1082 "System Information 1: Segment 1A, %s",
1083 SI1_SegmentChoice[data->SegmentType].descr.sz
1085 } else {
1086 SystemInformation2_t *data;
1087 data = wmem_new(pinfo->pool, SystemInformation2_t);
1088 /* Initialize the type to the last element, which is an
1089 * "Unknown", in case the dissector bails before getting this
1090 * far. */
1091 data->SegmentType = array_length(SI2_SegmentChoice) - 1;
1092 csnStreamDissector(bcch_tree, &ar, CSNDESCR(SystemInformation2_t), tvb, data, ett_gmr1_bcch);
1093 col_append_fstr(
1094 pinfo->cinfo, COL_INFO,
1095 "System Information 2: %s",
1096 SI2_SegmentChoice[data->SegmentType].descr.sz
1100 return tvb_captured_length(tvb);
1103 void
1104 proto_register_gmr1_bcch(void)
1106 static hf_register_info hf[] = {
1107 /* Segment 1A - [3] 11.5.2.66 */
1108 { &hf_seg1a_class_2_version,
1109 { "Class 2 version", "gmr1.bcch.seg1a.class_2_version",
1110 FT_UINT8, BASE_DEC, NULL, 0x00,
1111 "Version number for current Class 2 information", HFILL }
1113 { &hf_seg1a_class_3_version,
1114 { "Class 3 version", "gmr1.bcch.seg1a.class_3_version",
1115 FT_UINT8, BASE_DEC, NULL, 0x00,
1116 "Version number for current Class 3 information", HFILL }
1118 { &hf_seg1a_syncinfo_sb_frame_ts_offset,
1119 { "SB_FRAME_TS_OFFSET", "gmr1.bcch.seg1a.syncinfo.sb_frame_ts_offset",
1120 FT_UINT8, BASE_DEC, NULL, 0x00,
1121 NULL, HFILL }
1123 { &hf_seg1a_syncinfo_sb_symbol_offset,
1124 { "SB_SYMBOL_OFFSET", "gmr1.bcch.seg1a.syncinfo.sb_symbol_offset",
1125 FT_INT8, BASE_DEC, NULL, 0x00,
1126 NULL, HFILL }
1128 { &hf_seg1a_syncinfo_sa_freq_offset,
1129 { "SA_FREQ_OFFSET", "gmr1.bcch.seg1a.syncinfo.sa_freq_offset",
1130 FT_UINT8, BASE_CUSTOM, CF_FUNC(seg1a_syncinfo_sa_freq_offset_fmt), 0x00,
1131 NULL, HFILL }
1133 { &hf_seg1a_rachctrl_max_retrans,
1134 { "Max Retrans", "gmr1.bcch.seg1a.rachctrl.max_retrans",
1135 FT_UINT8, BASE_DEC, NULL, 0x00,
1136 NULL, HFILL }
1138 { &hf_seg1a_rachctrl_acc[15],
1139 { "AC15", "gmr1.bcch.seg1a.rachctrl.ac15",
1140 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1141 "Access Class 15 barred", HFILL }
1143 { &hf_seg1a_rachctrl_acc[14],
1144 { "AC14", "gmr1.bcch.seg1a.rachctrl.ac14",
1145 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1146 "Access Class 14 barred", HFILL }
1148 { &hf_seg1a_rachctrl_acc[13],
1149 { "AC13", "gmr1.bcch.seg1a.rachctrl.ac13",
1150 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1151 "Access Class 13 barred", HFILL }
1153 { &hf_seg1a_rachctrl_acc[12],
1154 { "AC12", "gmr1.bcch.seg1a.rachctrl.ac12",
1155 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1156 "Access Class 12 barred", HFILL }
1158 { &hf_seg1a_rachctrl_acc[11],
1159 { "AC11", "gmr1.bcch.seg1a.rachctrl.ac11",
1160 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1161 "Access Class 11 barred", HFILL }
1163 { &hf_seg1a_rachctrl_acc[10],
1164 { "EC10", "gmr1.bcch.seg1a.rachctrl.ac10",
1165 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1166 "Emergency Class 10 barred", HFILL }
1168 { &hf_seg1a_rachctrl_acc[9],
1169 { "AC9", "gmr1.bcch.seg1a.rachctrl.ac9",
1170 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1171 "Access Class 9 barred", HFILL }
1173 { &hf_seg1a_rachctrl_acc[8],
1174 { "AC8", "gmr1.bcch.seg1a.rachctrl.ac8",
1175 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1176 "Access Class 8 barred", HFILL }
1178 { &hf_seg1a_rachctrl_acc[7],
1179 { "AC7", "gmr1.bcch.seg1a.rachctrl.ac7",
1180 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1181 "Access Class 7 barred", HFILL }
1183 { &hf_seg1a_rachctrl_acc[6],
1184 { "AC6", "gmr1.bcch.seg1a.rachctrl.ac6",
1185 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1186 "Access Class 6 barred", HFILL }
1188 { &hf_seg1a_rachctrl_acc[5],
1189 { "AC5", "gmr1.bcch.seg1a.rachctrl.ac5",
1190 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1191 "Access Class 5 barred", HFILL }
1193 { &hf_seg1a_rachctrl_acc[4],
1194 { "AC4", "gmr1.bcch.seg1a.rachctrl.ac4",
1195 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1196 "Access Class 4 barred", HFILL }
1198 { &hf_seg1a_rachctrl_acc[3],
1199 { "AC3", "gmr1.bcch.seg1a.rachctrl.ac3",
1200 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1201 "Access Class 3 barred", HFILL }
1203 { &hf_seg1a_rachctrl_acc[2],
1204 { "AC2", "gmr1.bcch.seg1a.rachctrl.ac2",
1205 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1206 "Access Class 2 barred", HFILL }
1208 { &hf_seg1a_rachctrl_acc[1],
1209 { "AC1", "gmr1.bcch.seg1a.rachctrl.ac1",
1210 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1211 "Access Class 1 barred", HFILL }
1213 { &hf_seg1a_rachctrl_acc[0],
1214 { "AC0", "gmr1.bcch.seg1a.rachctrl.ac0",
1215 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_acc_vals), 0x00,
1216 "Access Class 0 barred", HFILL }
1218 { &hf_seg1a_rachctrl_cell_bar_access,
1219 { "CELL_BAR_ACCESS", "gmr1.bcch.seg1a.rachctrl.cell_bar_access",
1220 FT_UINT8, BASE_DEC, VALS(seg1a_rachctrl_cell_bar_access_vals), 0x00,
1221 NULL, HFILL }
1223 { &hf_seg1a_miscinfo_sb_reselection_hysteresis,
1224 { "SB_RESELECTION_HYSTERESIS", "gmr1.bcch.seg1a.miscinfo.sb_reselection_hysteresis",
1225 FT_UINT8, BASE_CUSTOM, CF_FUNC(segx_half_db_value_fmt), 0x00,
1226 NULL, HFILL }
1228 { &hf_seg1a_miscinfo_spare,
1229 { "Spare", "gmr1.bcch.seg1a.miscinfo.spare",
1230 FT_UINT8, BASE_DEC, NULL, 0x00,
1231 NULL, HFILL }
1233 { &hf_seg1a_miscinfo_priority_access_ind,
1234 { "Priority Access Ind", "gmr1.bcch.seg1a.miscinfo.priority_access_ind",
1235 FT_UINT8, BASE_DEC, NULL, 0x00,
1236 "Reserved for future use", HFILL }
1238 { &hf_seg1a_gbch_present,
1239 { "GBCH Present", "gmr1.bcch.seg1a.gbch_present",
1240 FT_UINT8, BASE_DEC, NULL, 0x00,
1241 NULL, HFILL }
1243 { &hf_seg1a_test_gs,
1244 { "Test GS", "gmr1.bcch.seg1a.test_gs",
1245 FT_UINT8, BASE_DEC, NULL, 0x00,
1246 NULL, HFILL }
1248 { &hf_seg1a_test_gs2,
1249 { "Test GS2", "gmr1.bcch.seg1a.test_gs2",
1250 FT_UINT8, BASE_DEC, NULL, 0x00,
1251 NULL, HFILL }
1253 { &hf_seg1a_spare1,
1254 { "Spare", "gmr1.bcch.seg1a.spare1",
1255 FT_UINT8, BASE_DEC, NULL, 0x00,
1256 NULL, HFILL }
1258 { &hf_seg1a_cell_bar_access_extension2,
1259 { "CELL_BAR_ACCESS_EXTENSION2", "gmr1.bcch.seg1a.cell_bar_access_extension2",
1260 FT_UINT8, BASE_DEC, NULL, 0x00,
1261 NULL, HFILL }
1263 { &hf_seg1a_spare2,
1264 { "Spare", "gmr1.bcch.seg1a.spare2",
1265 FT_UINT8, BASE_DEC, NULL, 0x00,
1266 NULL, HFILL }
1268 { &hf_seg1a_cell_bar_access_extension,
1269 { "CELL_BAR_ACCESS_EXTENSION", "gmr1.bcch.seg1a.cell_bar_access_extension",
1270 FT_UINT8, BASE_DEC, NULL, 0x00,
1271 NULL, HFILL }
1274 /* Segment 2A - [1] 11.5.2.67 */
1275 { &hf_seg2a_class_4_version,
1276 { "Class 4 version", "gmr1.bcch.seg2a.class_4_version",
1277 FT_UINT8, BASE_DEC, NULL, 0x00,
1278 "Version number for current Class 4 information", HFILL }
1280 { &hf_seg2a_syncinfo_sa_sirfn_delay,
1281 { "SA_SIRFN_DELAY", "gmr1.bcch.seg2a.syncinfo.sa_sirfn_delay",
1282 FT_UINT8, BASE_DEC, NULL, 0x00,
1283 "Delay of system information relative to superframe", HFILL }
1285 { &hf_seg2a_syncinfo_sa_bcch_stn,
1286 { "SA_BCCH_STN", "gmr1.bcch.seg2a.syncinfo.sa_bcch_stn",
1287 FT_UINT8, BASE_DEC, NULL, 0x00,
1288 "Starting timeslot number", HFILL }
1290 { &hf_seg2a_syncinfo_superframe_num,
1291 { "Superframe Number", "gmr1.bcch.seg2a.syncinfo.superframe_num",
1292 FT_UINT16, BASE_DEC, NULL, 0x00,
1293 NULL, HFILL }
1295 { &hf_seg2a_syncinfo_multiframe_num,
1296 { "Multiframe Number", "gmr1.bcch.seg2a.syncinfo.multiframe_num",
1297 FT_UINT8, BASE_DEC, NULL, 0x00,
1298 "Multiframe number in a superframe", HFILL }
1300 { &hf_seg2a_syncinfo_mffn_high_bit,
1301 { "MFFN high bit", "gmr1.bcch.seg2a.syncinfo.mffn_high_bit",
1302 FT_UINT8, BASE_DEC, NULL, 0x00,
1303 "High bit of the TDMA FN in a multiframe", HFILL }
1305 { &hf_seg2a_selcrit_rxlev_select_min,
1306 { "RXLEV_SELECT_MIN", "gmr1.bcch.seg2a.selcrit.rxlev_select_min",
1307 FT_UINT8, BASE_CUSTOM, CF_FUNC(segx_half_db_value_fmt), 0x00,
1308 "Adjustment to threshold to camp-on system", HFILL }
1310 { &hf_seg2a_miscinfo_sb_selection_power,
1311 { "SB_SELECTION_POWER", "gmr1.bcch.seg2a.miscinfo.sb_selection_power",
1312 FT_UINT8, BASE_CUSTOM, CF_FUNC(segx_half_db_value_fmt), 0x00,
1313 NULL, HFILL }
1315 { &hf_seg2a_lainfo_sa_pch_config,
1316 { "SA_PCH_CONFIG", "gmr1.bcch.seg2a.lainfo.sa_pch_config",
1317 FT_UINT8, BASE_DEC, NULL, 0x00,
1318 "Paging group configuration information", HFILL }
1320 { &hf_seg2a_lainfo_sa_bach_config,
1321 { "SA_BACH_CONFIG", "gmr1.bcch.seg2a.lainfo.sa_bach_config",
1322 FT_UINT8, BASE_DEC, NULL, 0x00,
1323 "Alerting group configuration information", HFILL }
1325 { &hf_seg2a_lainfo_rach_ts_offset,
1326 { "RACH_TS_OFFSET", "gmr1.bcch.seg2a.lainfo.rach_ts_offset",
1327 FT_UINT8, BASE_DEC, NULL, 0x00,
1328 "Start of RACH window with respect to BCCH", HFILL }
1330 { &hf_seg2a_lainfo_n_page_occurrences,
1331 { "N Page Occurrences", "gmr1.bcch.seg2a.lainfo.n_page_occurrences",
1332 FT_UINT8, BASE_DEC, NULL, 0x00,
1333 "Number of times a page shall be retransmitted after the initial transmission", HFILL }
1335 { &hf_seg2a_lainfo_imsi_attach_detach_ind,
1336 { "IMSI attach-detach ind", "gmr1.bcch.seg2a.lainfo.imsi_attach_detach_ind",
1337 FT_UINT8, BASE_DEC, VALS(seg2a_lainfo_imsi_attach_detach_ind_vals), 0x00,
1338 "Should MESs apply IMSI attach and detach procedure for this LA", HFILL }
1340 { &hf_seg2a_lainfo_ecsc_indication,
1341 { "ECSC indication", "gmr1.bcch.seg2a.lainfo.ecsc_indication",
1342 FT_UINT8, BASE_DEC, VALS(seg2a_lainfo_ecsc_indication_vals), 0x00,
1343 "Early Classmark Sending Control", HFILL }
1345 { &hf_seg2a_lainfo_si_update_ind,
1346 { "SI update ind", "gmr1.bcch.seg2a.lainfo.si_update_ind",
1347 FT_UINT8, BASE_DEC, NULL, 0x00,
1348 "Flag for BACH reorganization. Value changes after each reorganization", HFILL }
1350 { &hf_seg2a_class_type,
1351 { "Class type: 2", "gmr1.bcch.seg2a.class_type",
1352 FT_UINT8, BASE_DEC, NULL, 0x00,
1353 NULL, HFILL }
1355 { &hf_seg2a_segment_type_a,
1356 { "Segment type: A", "gmr1.bcch.seg2a.segment_type_a",
1357 FT_UINT8, BASE_DEC, NULL, 0x00,
1358 NULL, HFILL }
1360 { &hf_seg2a_segment_type_abis,
1361 { "Segment type: Abis", "gmr1.bcch.seg2a.segment_type_abis",
1362 FT_UINT8, BASE_DEC, NULL, 0x00,
1363 NULL, HFILL }
1365 { &hf_seg2b_segment_type_b,
1366 { "Segment type: B", "gmr1.bcch.seg2b.segment_type_b",
1367 FT_UINT8, BASE_DEC, NULL, 0x00,
1368 NULL, HFILL }
1370 { &hf_seg2b_segment_type_bbis,
1371 { "Segment type: B bis", "gmr1.bcch.seg2b.segment_type_bbis",
1372 FT_UINT8, BASE_DEC, NULL, 0x00,
1373 NULL, HFILL }
1376 /* Segment 3A - [1] 11.5.2.71 */
1377 { &hf_seg3a_class_type,
1378 { "Class type: 3", "gmr1.bcch.seg3a.class_type",
1379 FT_UINT8, BASE_DEC, NULL, 0x00,
1380 NULL, HFILL }
1382 { &hf_seg3a_segment_type_a,
1383 { "Segment type: A", "gmr1.bcch.seg3a.segment_type_a",
1384 FT_UINT8, BASE_DEC, NULL, 0x00,
1385 NULL, HFILL }
1387 { &hf_seg3a_lai_dissector,
1388 { "LAI Dissector length", "gmr1.bcch.seg3a.lai_dissector",
1389 FT_UINT8, BASE_DEC, NULL, 0x00,
1390 NULL, HFILL }
1392 { &hf_seg3a_lai_mcc,
1393 { "Mobile Country Code (MCC)", "gmr1.bcch.seg3a.lai.mcc",
1394 FT_UINT16, BASE_DEC, NULL, 0x00,
1395 NULL, HFILL }
1397 { &hf_seg3a_lai_mnc,
1398 { "Mobile Network Code (MNC)", "gmr1.bcch.seg3a.lai.mnc",
1399 FT_UINT16, BASE_DEC, NULL, 0x00,
1400 NULL, HFILL }
1402 { &hf_seg3a_lai_lac,
1403 { "Location Area Code (LAC)", "gmr1.bcch.seg3a.lai.lac",
1404 FT_UINT16, BASE_HEX, NULL, 0x00,
1405 NULL, HFILL }
1407 { &hf_seg3a_lai_msc_id,
1408 { "MSC ID", "gmr1.bcch.seg3a.lai.msc_id",
1409 FT_UINT8, BASE_DEC, NULL, 0x00,
1410 NULL, HFILL }
1412 { &hf_seg3a_lai_spot_beam_id,
1413 { "Spot Beam ID", "gmr1.bcch.seg3a.lai.spot_beam_id",
1414 FT_UINT16, BASE_DEC, NULL, 0x00,
1415 NULL, HFILL }
1417 { &hf_seg3a_system_sat_id,
1418 { "Satellite ID", "gmr1.bcch.seg3a.system.sat_id",
1419 FT_UINT8, BASE_DEC, NULL, 0x00,
1420 NULL, HFILL }
1422 { &hf_seg3a_system_sys_id,
1423 { "System ID", "gmr1.bcch.seg3a.system.sys_id",
1424 FT_UINT8, BASE_DEC, NULL, 0x00,
1425 NULL, HFILL }
1427 { &hf_seg3a_satpos_latitude,
1428 { "Latitude", "gmr1.bcch.seg3a.satpos.latitude",
1429 FT_INT8, BASE_CUSTOM, CF_FUNC(seg3a_latitude_fmt), 0x00,
1430 NULL, HFILL }
1432 { &hf_seg3a_satpos_longitude,
1433 { "Longitude", "gmr1.bcch.seg3a.satpos.longitude",
1434 FT_UINT16, BASE_CUSTOM, CF_FUNC(seg3a_longitude_fmt), 0x00,
1435 NULL, HFILL }
1437 { &hf_seg3a_satpos_radius,
1438 { "Radius", "gmr1.bcch.seg3a.satpos.radius",
1439 FT_INT16, BASE_CUSTOM, CF_FUNC(seg3a_satpos_radius_fmt), 0x00,
1440 NULL, HFILL }
1442 { &hf_seg3a_beam_latitude,
1443 { "Latitude", "gmr1.bcch.seg3a.beam.latitude",
1444 FT_INT16, BASE_CUSTOM, CF_FUNC(seg3a_latitude_fmt), 0x00,
1445 NULL, HFILL }
1447 { &hf_seg3a_beam_longitude,
1448 { "Longitude", "gmr1.bcch.seg3a.beam.longitude",
1449 FT_UINT16, BASE_CUSTOM, CF_FUNC(seg3a_longitude_fmt), 0x00,
1450 NULL, HFILL }
1452 { &hf_seg3a_miscinfo_sb_reselection_timer,
1453 { "SB_RESELECTION_TIMER", "gmr1.bcch.seg3a.sb_reselection_timer",
1454 FT_UINT8, BASE_CUSTOM, CF_FUNC(seg3a_miscinfo_sb_reselection_timer_fmt), 0x00,
1455 NULL, HFILL }
1457 { &hf_seg3a_spare,
1458 { "Spare", "gmr1.bcch.seg3a.spare",
1459 FT_UINT8, BASE_DEC, NULL, 0x00,
1460 NULL, HFILL }
1463 { &hf_seg3b_segment_type_b,
1464 { "Segment type: B", "gmr1.bcch.seg3b.segment_type_b",
1465 FT_UINT8, BASE_DEC, NULL, 0x00,
1466 NULL, HFILL }
1468 { &hf_seg3b_segment_type_bbis,
1469 { "Segment type: B bis", "gmr1.bcch.seg3b.segment_type_bbis",
1470 FT_UINT8, BASE_DEC, NULL, 0x00,
1471 NULL, HFILL }
1473 { &hf_seg3c_segment_type_c,
1474 { "Segment type: C", "gmr1.bcch.seg3c.segment_type_c",
1475 FT_UINT8, BASE_DEC, NULL, 0x00,
1476 NULL, HFILL }
1478 { &hf_seg3d_segment_type_d,
1479 { "Segment type: D", "gmr1.bcch.seg3d.segment_type_d",
1480 FT_UINT8, BASE_DEC, NULL, 0x00,
1481 NULL, HFILL }
1483 { &hf_seg3e_segment_type_e,
1484 { "Segment type: E", "gmr1.bcch.seg3e.segment_type_e",
1485 FT_UINT8, BASE_DEC, NULL, 0x00,
1486 NULL, HFILL }
1488 { &hf_seg3e_segment_type_ebis,
1489 { "Segment type: E bis", "gmr1.bcch.seg3e.segment_type_ebis",
1490 FT_UINT8, BASE_DEC, NULL, 0x00,
1491 NULL, HFILL }
1493 { &hf_seg3f_segment_type_f,
1494 { "Segment type: F", "gmr1.bcch.seg3f.segment_type_f",
1495 FT_UINT8, BASE_DEC, NULL, 0x00,
1496 NULL, HFILL }
1498 { &hf_seg3g_segment_type_g,
1499 { "Segment type: G", "gmr1.bcch.seg3g.segment_type_g",
1500 FT_UINT8, BASE_DEC, NULL, 0x00,
1501 NULL, HFILL }
1503 { &hf_seg3g_segment_type_gbis,
1504 { "Segment type: G bis", "gmr1.bcch.seg3g.segment_type_gbis",
1505 FT_UINT8, BASE_DEC, NULL, 0x00,
1506 NULL, HFILL }
1508 { &hf_seg3h_segment_type_h,
1509 { "Segment type: H", "gmr1.bcch.seg3h.segment_type_h",
1510 FT_UINT8, BASE_DEC, NULL, 0x00,
1511 NULL, HFILL }
1513 { &hf_seg3i_segment_type_i,
1514 { "Segment type: I", "gmr1.bcch.seg3i.segment_type_i",
1515 FT_UINT8, BASE_DEC, NULL, 0x00,
1516 NULL, HFILL }
1518 { &hf_seg3j_segment_type_j,
1519 { "Segment type: J", "gmr1.bcch.seg3j.segment_type_j",
1520 FT_UINT8, BASE_DEC, NULL, 0x00,
1521 NULL, HFILL }
1523 { &hf_seg3j_segment_type_jbis,
1524 { "Segment type: J bis", "gmr1.bcch.seg3j.segment_type_jbis",
1525 FT_UINT8, BASE_DEC, NULL, 0x00,
1526 NULL, HFILL }
1528 { &hf_seg3k_segment_type_kbis,
1529 { "Segment type: K bis", "gmr1.bcch.seg3k.segment_type_kbis",
1530 FT_UINT8, BASE_DEC, NULL, 0x00,
1531 NULL, HFILL }
1534 { &hf_seg4a_class_type,
1535 { "Class type: 4", "gmr1.bcch.seg4a.class_type",
1536 FT_UINT8, BASE_DEC, NULL, 0x00,
1537 NULL, HFILL }
1539 { &hf_seg4a_segment_type_a,
1540 { "Segment type: A", "gmr1.bcch.seg3a.segment_type_a",
1541 FT_UINT8, BASE_DEC, NULL, 0x00,
1542 NULL, HFILL }
1544 { &hf_seg4b_segment_type_b,
1545 { "Segment type: B", "gmr1.bcch.seg3b.segment_type_b",
1546 FT_UINT8, BASE_DEC, NULL, 0x00,
1547 NULL, HFILL }
1549 { &hf_seg4c_segment_type_c,
1550 { "Segment type: C", "gmr1.bcch.seg3c.segment_type_c",
1551 FT_UINT8, BASE_DEC, NULL, 0x00,
1552 NULL, HFILL }
1554 { &hf_seg4d_segment_type_d,
1555 { "Segment type: D", "gmr1.bcch.seg3d.segment_type_d",
1556 FT_UINT8, BASE_DEC, NULL, 0x00,
1557 NULL, HFILL }
1559 { &hf_seg4e_segment_type_e,
1560 { "Segment type: E", "gmr1.bcch.seg3e.segment_type_e",
1561 FT_UINT8, BASE_DEC, NULL, 0x00,
1562 NULL, HFILL }
1564 { &hf_seg4f_segment_type_f,
1565 { "Segment type: F", "gmr1.bcch.seg3f.segment_type_f",
1566 FT_UINT8, BASE_DEC, NULL, 0x00,
1567 NULL, HFILL }
1569 { &hf_seg4g_segment_type_g,
1570 { "Segment type: G", "gmr1.bcch.seg3g.segment_type_g",
1571 FT_UINT8, BASE_DEC, NULL, 0x00,
1572 NULL, HFILL }
1574 { &hf_seg4h_segment_type_h,
1575 { "Segment type: H", "gmr1.bcch.seg3h.segment_type_h",
1576 FT_UINT8, BASE_DEC, NULL, 0x00,
1577 NULL, HFILL }
1579 { &hf_seg4i_segment_type_i,
1580 { "Segment type: I", "gmr1.bcch.seg3i.segment_type_i",
1581 FT_UINT8, BASE_DEC, NULL, 0x00,
1582 NULL, HFILL }
1584 { &hf_seg4j_segment_type_j,
1585 { "Segment type: J", "gmr1.bcch.seg3j.segment_type_j",
1586 FT_UINT8, BASE_DEC, NULL, 0x00,
1587 NULL, HFILL }
1589 { &hf_seg4k_segment_type_k,
1590 { "Segment type: K", "gmr1.bcch.seg3k.segment_type_k",
1591 FT_UINT8, BASE_DEC, NULL, 0x00,
1592 NULL, HFILL }
1595 /* System Information fields - [1] 10.1.31 & 10.1.32 */
1596 { &hf_si1_segment_choice,
1597 { "Segment Choice", "gmr1.bcch.si.segment_choice",
1598 FT_UINT8, BASE_DEC, NULL, 0x00,
1599 NULL, HFILL }
1601 { &hf_si_protocol_version,
1602 { "Protocol version", "gmr1.bcch.si.protocol_version",
1603 FT_UINT8, BASE_DEC, NULL, 0x00,
1604 NULL, HFILL }
1606 { &hf_si_block_type,
1607 { "Block Type", "gmr1.bcch.si.block_type",
1608 FT_UINT8, BASE_DEC, NULL, 0x00,
1609 NULL, HFILL }
1611 { &hf_si_spare,
1612 { "Spare", "gmr1.bcch.si.spare",
1613 FT_UINT8, BASE_DEC, NULL, 0x00,
1614 NULL, HFILL }
1616 { &hf_si1_randomization_period,
1617 { "Randomization Period", "gmr1.bcch.si.randomization_period",
1618 FT_UINT8, BASE_DEC, VALS(si1_randomization_period_vals), 0x00,
1619 NULL, HFILL }
1623 static int *ett[] = {
1624 &ett_gmr1_bcch,
1627 static ei_register_info ei[] = {
1628 { &ei_unknown_segment, { "gmr1.bcch.unknown_segment", PI_PROTOCOL, PI_WARN, "Unknown segment!", EXPFILL }},
1631 expert_module_t* expert_gmr1_bcch;
1633 proto_gmr1_bcch = proto_register_protocol("GEO-Mobile Radio (1) BCCH", "GMR-1 BCCH", "gmr1.bcch");
1635 proto_register_field_array(proto_gmr1_bcch, hf, array_length(hf));
1636 proto_register_subtree_array(ett, array_length(ett));
1637 expert_gmr1_bcch = expert_register_protocol(proto_gmr1_bcch);
1638 expert_register_field_array(expert_gmr1_bcch, ei, array_length(ei));
1640 register_dissector("gmr1_bcch", dissect_gmr1_bcch, proto_gmr1_bcch);
1644 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1646 * Local variables:
1647 * c-basic-offset: 8
1648 * tab-width: 8
1649 * indent-tabs-mode: t
1650 * End:
1652 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
1653 * :indentSize=8:tabSize=8:noTabs=false: