Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-gsm_a_common.c
blob248f73f5fbcaba323f35fcb817b0ea9eb141a3c4
1 /* packet-gsm_a_common.c
2 * Common routines for GSM A Interface dissection
4 * Copyright 2003, Michael Lum <mlum [AT] telostech.com>
5 * In association with Telos Technology Inc.
7 * Split from packet-gsm_a.c by Neil Piercy <Neil [AT] littlebriars.co.uk>
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * SPDX-License-Identifier: GPL-2.0-or-later
16 #include "config.h"
18 #include <math.h>
20 #include <epan/packet.h>
21 #include <epan/expert.h>
22 #include <epan/tap.h>
23 #include <epan/stat_tap_ui.h>
24 #include <epan/tfs.h>
25 #include <epan/unit_strings.h>
27 #include <wsutil/str_util.h>
28 #include <wsutil/array.h>
29 #include "packet-gsm_a_common.h"
30 #include "packet-bssap.h"
31 #include "packet-gmr1_common.h"
32 #include "packet-e212.h"
34 void proto_register_gsm_a_common(void);
36 static const value_string gsm_common_elem_strings[] = {
37 /* Common Information Elements 10.5.1 */
38 { DE_CELL_ID, "Cell Identity" },
39 { DE_CIPH_KEY_SEQ_NUM, "Ciphering Key Sequence Number" },
40 { DE_LAI, "Location Area Identification (LAI)" },
41 { DE_MID, "Mobile Identity" },
42 { DE_MS_CM_1, "Mobile Station Classmark 1" },
43 { DE_MS_CM_2, "Mobile Station Classmark 2" },
44 { DE_MS_CM_3, "Mobile Station Classmark 3" },
45 { DE_SPARE_NIBBLE, "Spare Half Octet" },
46 { DE_D_GB_CALL_REF, "Descriptive group or broadcast call reference" },
47 { DE_G_CIPH_KEY_NUM, "Group Cipher Key Number" },
48 { DE_PD_SAPI, "PD and SAPI $(CCBS)$" },
49 { DE_PRIO, "Priority Level" },
50 { DE_CN_COMMON_GSM_MAP_NAS_SYS_INFO, "CN Common GSM-MAP NAS system information" },
51 { DE_CS_DOMAIN_SPEC_SYS_INFO, "CS domain specific system information" },
52 { DE_PS_DOMAIN_SPEC_SYS_INFO, "PS domain specific system information" },
53 { DE_PLMN_LIST, "PLMN List" },
54 { DE_NAS_CONT_FOR_PS_HO, "NAS container for PS HO" },
55 { DE_MS_NET_FEAT_SUP, "MS network feature support" },
56 { 0, NULL }
58 value_string_ext gsm_common_elem_strings_ext = VALUE_STRING_EXT_INIT(gsm_common_elem_strings);
60 static const value_string gsm_a_skip_ind_vals[] = {
61 { 0, "No indication of selected PLMN"},
62 { 1, "PLMN identity of the Common PLMN in the broadcast system information"},
63 { 2, "PLMN identity of the first Additional PLMN in the broadcast system information"},
64 { 3, "PLMN identity of the second Additional PLMN in the broadcast system information"},
65 { 4, "PLMN identity of the third Additional PLMN in the broadcast system information"},
66 { 5, "PLMN identity of the fourth Additional PLMN in the broadcast system information"},
67 { 6, "Reserved"},
68 { 7, "Reserved"},
69 { 0, NULL }
72 static const true_false_string gsm_a_extension_value = {
73 "No Extension",
74 "Extended"
78 /* Mobile Station Classmark Value strings
81 /* Mobile Station Classmark
82 * Revision level
84 static const value_string gsm_a_msc_rev_vals[] = {
85 { 0, "Reserved for GSM phase 1"},
86 { 1, "Used by GSM phase 2 mobile stations"},
87 { 2, "Used by mobile stations supporting R99 or later versions of the protocol"},
88 { 3, "Reserved for future use"},
89 { 0, NULL }
92 /* ES IND (octet 3, bit 5) "Controlled Early Classmark Sending" option implementation */
93 static const true_false_string ES_IND_vals = {
94 "Controlled Early Classmark Sending option is implemented in the MS",
95 "Controlled Early Classmark Sending option is not implemented in the MS"
97 /* A5/1 algorithm supported (octet 3, bit 4) */
98 static const true_false_string A5_1_algorithm_sup_vals = {
99 "encryption algorithm A5/1 not available",
100 "encryption algorithm A5/1 available"
102 /* RF Power Capability (Octet 3) */
103 static const value_string RF_power_capability_vals[] = {
104 { 0, "class 1"},
105 { 1, "class 2"},
106 { 2, "class 3"},
107 { 3, "class 4"},
108 { 4, "class 5"},
109 { 7, "RF Power capability is irrelevant in this information element"},
110 { 0, NULL }
112 /* PS capability (pseudo-synchronization capability) (octet 4) */
113 static const true_false_string ps_sup_cap_vals = {
114 "PS capability present",
115 "PS capability not present"
117 /* SS Screening Indicator (octet 4)defined in 3GPP TS 24.080 */
118 static const value_string SS_screening_indicator_vals[] = {
119 { 0, "Default value of phase 1"},
120 { 1, "Capability of handling of ellipsis notation and phase 2 error handling "},
121 { 2, "For future use"},
122 { 3, "For future use"},
123 { 0, NULL }
125 /* SM capability (MT SMS pt to pt capability) (octet 4)*/
126 static const true_false_string SM_capability_vals = {
127 "Mobile station supports mobile terminated point to point SMS",
128 "Mobile station does not support mobile terminated point to point SMS"
130 /* VBS notification reception (octet 4) */
131 static const true_false_string VBS_notification_rec_vals = {
132 "VBS capability and notifications wanted",
133 "no VBS capability or no notifications wanted"
135 /* VGCS notification reception (octet 4) */
136 static const true_false_string VGCS_notification_rec_vals = {
137 "VGCS capability and notifications wanted",
138 "no VGCS capability or no notifications wanted"
140 /* FC Frequency Capability (octet 4 ) */
141 static const true_false_string FC_frequency_cap_vals = {
142 "The MS does support the E-GSM or R-GSM",
143 "The MS does not support the E-GSM or R-GSM band"
145 /* CM3 (octet 5, bit 8) */
146 static const true_false_string CM3_vals = {
147 "The MS supports options that are indicated in classmark 3 IE",
148 "The MS does not support any options that are indicated in CM3"
150 /* LCS VA capability (LCS value added location request notification capability) (octet 5,bit 6) */
151 static const true_false_string LCS_VA_cap_vals = {
152 "LCS value added location request notification capability supported",
153 "LCS value added location request notification capability not supported"
155 /* UCS2 treatment (octet 5, bit 5) */
156 static const true_false_string UCS2_treatment_vals = {
157 "the ME has no preference between the use of the default alphabet and the use of UCS2",
158 "the ME has a preference for the default alphabet"
160 /* SoLSA (octet 5, bit 4) */
161 static const true_false_string SoLSA_vals = {
162 "The ME supports SoLSA",
163 "The ME does not support SoLSA"
165 /* CMSP: CM Service Prompt (octet 5, bit 3) */
166 static const true_false_string CMSP_vals = {
167 "Network initiated MO CM connection request supported for at least one CM protocol",
168 "Network initiated MO CM connection request not supported"
170 /* A5/7 algorithm supported */
171 static const true_false_string A5_7_algorithm_sup_vals = {
172 "encryption algorithm A5/7 available",
173 "encryption algorithm A5/7 not available"
175 /* A5/6 algorithm supported */
176 static const true_false_string A5_6_algorithm_sup_vals = {
177 "encryption algorithm A5/6 available",
178 "encryption algorithm A5/6 not available"
180 /* A5/5 algorithm supported */
181 static const true_false_string A5_5_algorithm_sup_vals = {
182 "encryption algorithm A5/5 available",
183 "encryption algorithm A5/5 not available"
185 /* A5/4 algorithm supported */
186 static const true_false_string A5_4_algorithm_sup_vals = {
187 "encryption algorithm A5/4 available",
188 "encryption algorithm A5/4 not available"
190 /* A5/3 algorithm supported (octet 5, bit 2) */
191 static const true_false_string A5_3_algorithm_sup_vals = {
192 "encryption algorithm A5/3 available",
193 "encryption algorithm A5/3 not available"
195 /* A5/2 algorithm supported (octet 5, bit 1) */
196 static const true_false_string A5_2_algorithm_sup_vals = {
197 "encryption algorithm A5/2 available",
198 "encryption algorithm A5/2 not available"
201 static const value_string mobile_identity_type_vals[] = {
202 { 0, "No Identity"},
203 { 1, "IMSI"},
204 { 2, "IMEI"},
205 { 3, "IMEISV"},
206 { 4, "TMSI/P-TMSI/M-TMSI"},
207 { 5, "TMGI and optional MBMS Session Identity"}, /* ETSI TS 124 008 V6.8.0 (2005-03) p326 */
208 { 0, NULL }
211 static const true_false_string oddevenind_vals = {
212 "Odd number of identity digits",
213 "Even number of identity digits"
217 const value_string gsm_a_sms_vals[] = {
218 { 0, "1/4 timeslot (~144 microseconds)" },
219 { 1, "2/4 timeslot (~288 microseconds)" },
220 { 2, "3/4 timeslot (~433 microseconds)" },
221 { 3, "4/4 timeslot (~577 microseconds)" },
222 { 4, "5/4 timeslot (~721 microseconds)" },
223 { 5, "6/4 timeslot (~865 microseconds)" },
224 { 6, "7/4 timeslot (~1009 microseconds)" },
225 { 7, "8/4 timeslot (~1154 microseconds)" },
226 { 8, "9/4 timeslot (~1298 microseconds)" },
227 { 9, "10/4 timeslot (~1442 microseconds)" },
228 { 10, "11/4 timeslot (~1586 microseconds)" },
229 { 11, "12/4 timeslot (~1730 microseconds)" },
230 { 12, "13/4 timeslot (~1874 microseconds)" },
231 { 13, "14/4 timeslot (~2019 microseconds)" },
232 { 14, "15/4 timeslot (~2163 microseconds)" },
233 { 15, "16/4 timeslot (~2307 microseconds)" },
234 { 0, NULL}
237 static const true_false_string ms_assisted_e_otd_vals = {
238 "MS assisted E-OTD supported",
239 "MS assisted E-OTD not supported"
242 static const true_false_string ms_based_e_otd_vals = {
243 "MS based E-OTD supported",
244 "MS based E-OTD not supported"
247 static const true_false_string ms_assisted_gps_vals = {
248 "MS assisted GPS supported",
249 "MS assisted GPS not supported"
252 static const true_false_string ms_based_gps_vals = {
253 "MS based GPS supported",
254 "MS based GPS not supported"
257 static const true_false_string ms_conventional_gps_vals = {
258 "Conventional GPS supported",
259 "Conventional GPS not supported"
262 static const true_false_string modulation_capability_vals = {
263 "8-PSK supported for uplink transmission and downlink reception",
264 "8-PSK supported for downlink reception only"
267 static const value_string eight_psk_rf_power_capability_vals[] = {
268 { 0, "Reserved" },
269 { 1, "Power class E1" },
270 { 2, "Power class E2" },
271 { 3, "Power class E3" },
272 { 0, NULL}
275 static const value_string gsm_400_bands_supported_vals[] = {
276 { 1, "GSM 480 supported, GSM 450 not supported" },
277 { 2, "GSM 450 supported, GSM 480 not supported" },
278 { 3, "GSM 450 supported, GSM 480 supported" },
279 { 0, NULL}
282 static const true_false_string umts_fdd_rat_cap_vals = {
283 "UMTS FDD supported",
284 "UMTS FDD not supported"
287 static const true_false_string umts_384_mcps_tdd_rat_cap_vals = {
288 "UMTS 3.84 Mcps TDD supported",
289 "UMTS 3.84 Mcps TDD not supported"
292 static const true_false_string cdma_2000_rat_cap_vals = {
293 "CDMA 2000 supported",
294 "CDMA 2000 not supported"
297 static const value_string dtm_gprs_multi_slot_class_vals[] = {
298 { 0, "Unused. If received, the network shall interpret this as 1" },
299 { 1, "Multislot class 5 supported" },
300 { 2, "Multislot class 9 supported" },
301 { 3, "Multislot class 11 supported" },
302 { 0, NULL}
305 static const true_false_string single_slot_dtm_vals = {
306 "Single Slot DTM supported",
307 "Single Slot DTM not supported"
310 static const value_string gsm_band_vals[] = {
311 { 0, "E-GSM is supported" },
312 { 1, "P-GSM is supported" },
313 { 2, "GSM 1800 is supported" },
314 { 3, "GSM 450 is supported" },
315 { 4, "GSM 480 is supported" },
316 { 5, "GSM 850 is supported" },
317 { 6, "GSM 1900 is supported" },
318 { 7, "GSM 750 is supported" },
319 { 8, "GSM 710 is supported" },
320 { 9, "T-GSM 810 is supported" },
321 { 0, NULL}
324 static const true_false_string umts_128_mcps_tdd_rat_cap_vals = {
325 "UMTS 1.28 Mcps TDD supported",
326 "UMTS 1.28 Mcps TDD not supported"
329 static const true_false_string geran_feature_package_1_vals = {
330 "GERAN feature package 1 supported",
331 "GERAN feature package 1 not supported"
334 static const true_false_string flo_iu_cap_vals = {
335 "FLO in GERAN Iu Mode supported",
336 "FLO in GERAN Iu Mode not supported"
339 static const true_false_string geran_feature_package_2_vals = {
340 "GERAN feature package 2 supported",
341 "GERAN feature package 2 not supported"
344 static const value_string gmsk_multislot_power_prof_vals[] = {
345 { 0, "GMSK_MULTISLOT_POWER_PROFILE 0" },
346 { 1, "GMSK_MULTISLOT_POWER_PROFILE 1" },
347 { 2, "GMSK_MULTISLOT_POWER_PROFILE 2" },
348 { 3, "GMSK_MULTISLOT_POWER_PROFILE 3" },
349 { 0, NULL}
352 static const value_string eight_psk_multislot_power_prof_vals[] = {
353 { 0, "8-PSK_MULTISLOT_POWER_PROFILE 0" },
354 { 1, "8-PSK_MULTISLOT_POWER_PROFILE 1" },
355 { 2, "8-PSK_MULTISLOT_POWER_PROFILE 2" },
356 { 3, "8-PSK_MULTISLOT_POWER_PROFILE 3" },
357 { 0, NULL}
360 static const value_string t_gsm_400_bands_supported_vals[] = {
361 { 1, "T-GSM 380 supported, T-GSM 410 not supported" },
362 { 2, "T-GSM 410 supported, T-GSM 380 not supported" },
363 { 3, "T-GSM 410 supported, T-GSM 380 supported" },
364 { 0, NULL}
367 static const value_string downlink_adv_receiver_perf_vals[] = {
368 { 0, "Downlink Advanced Receiver Performance not supported" },
369 { 1, "Downlink Advanced Receiver Performance - phase I supported" },
370 { 2, "Downlink Advanced Receiver Performance - phase II supported" },
371 { 0, NULL}
374 static const true_false_string dtm_enhancements_cap_vals = {
375 "The mobile station supports enhanced DTM CS establishment and release procedures",
376 "The mobile station does not support enhanced DTM CS establishment and release procedures"
379 static const true_false_string offset_required_vals = {
380 "The mobile station requires the offset",
381 "The mobile station does not require the offset"
384 static const value_string dtm_gprs_high_multi_slot_class_vals[] = {
385 { 0, "Unused. If received, the network shall interpret this as \"0 0 1\"" },
386 { 1, "Multislot class 31 or 36 supported" },
387 { 2, "Multislot class 32 or 37 supported" },
388 { 3, "Multislot class 33 or 38 supported" },
389 { 4, "Multislot class 41 supported" },
390 { 5, "Multislot class 42 supported" },
391 { 6, "Multislot class 43 supported" },
392 { 7, "Multislot class 44 supported" },
393 { 0, NULL}
396 static const true_false_string repeated_acch_cap_vals = {
397 "The mobile station supports Repeated SACCH and Repeated Downlink FACCH",
398 "The mobile station does not support Repeated SACCH"
401 static const true_false_string ciphering_mode_setting_cap_vals = {
402 "The mobile station supports the Ciphering Mode Setting IE in the DTM ASSIGNMENT COMMAND message",
403 "The mobile station does not support the Ciphering Mode Setting IE in the DTM ASSIGNMENT COMMAND message"
406 static const true_false_string additional_positioning_caps_vals = {
407 "The mobile station supports additional positioning capabilities which can be retrieved using RRLP",
408 "The mobile station does not support additional positioning capabilities which can be retrieved using RRLP"
411 static const true_false_string e_utra_fdd_support_vals = {
412 "E-UTRA FDD supported",
413 "E-UTRA FDD not supported"
416 static const true_false_string e_utra_tdd_support_vals = {
417 "E-UTRA TDD supported",
418 "E-UTRA TDD not supported"
421 static const true_false_string e_utra_meas_and_report_support_vals = {
422 "E-UTRAN Neighbour Cell measurements and measurement reporting while having an RR connection supported",
423 "E-UTRAN Neighbour Cell measurements and measurement reporting while having an RR connection not supported"
426 static const true_false_string prio_based_resel_support_vals = {
427 "Priority-based cell reselection supported",
428 "Priority-based cell reselection not supported"
431 static const true_false_string utra_csg_cells_reporting_vals = {
432 "Reporting of UTRAN CSG cells supported",
433 "Reporting of UTRAN CSG cells not supported"
436 static const value_string vamos_level_vals[] = {
437 { 0, "VAMOS not supported" },
438 { 1, "VAMOS I supported" },
439 { 2, "VAMOS II supported" },
440 { 3, "VAMOS III supported" },
441 { 0, NULL}
444 const value_string tighter_cap_level_vals[] = {
445 { 0, "TIGHTER not supported" },
446 { 1, "TIGHTER supported for speech and signalling channels only" },
447 { 2, "TIGHTER supported for speech and signalling channels and for GPRS and EGPRS, but not for EGPRS2" },
448 { 3, "TIGHTER supported for speech and signalling channels and for GPRS, EGPRS and EGPRS2" },
449 { 0, NULL}
452 static const value_string cs_to_ps_srvcc_geran_to_utra_vals[] = {
453 { 0, "CS to PS SRVCC from GERAN to UMTS FDD and 1.28 Mcps TDD not supported" },
454 { 1, "CS to PS SRVCC from GERAN to UMTS FDD supported" },
455 { 2, "CS to PS SRVCC from GERAN to UMTS 1.28 Mcps TDD supported" },
456 { 3, "CS to PS SRVCC from GERAN to UMTS FDD and 1.28 Mcps TDD supported" },
457 { 0, NULL}
460 static const value_string cs_to_ps_srvcc_geran_to_eutra_vals[] = {
461 { 0, "CS to PS SRVCC from GERAN to E-UTRA FDD and TDD not supported" },
462 { 1, "CS to PS SRVCC from GERAN to E-UTRA FDD supported" },
463 { 2, "CS to PS SRVCC from GERAN to E-UTRA TDD supported" },
464 { 3, "CS to PS SRVCC from GERAN to E-UTRA FDD and TDD supported" },
465 { 0, NULL}
468 static const value_string gsm_a_rr_rxlev_vals [] = {
469 { 0, "< -110 dBm"},
470 { 1, "-110 <= x < -109 dBm"},
471 { 2, "-109 <= x < -108 dBm"},
472 { 3, "-108 <= x < -107 dBm"},
473 { 4, "-107 <= x < -106 dBm"},
474 { 5, "-106 <= x < -105 dBm"},
475 { 6, "-105 <= x < -104 dBm"},
476 { 7, "-104 <= x < -103 dBm"},
477 { 8, "-103 <= x < -102 dBm"},
478 { 9, "-102 <= x < -101 dBm"},
479 { 10, "-101 <= x < -100 dBm"},
480 { 11, "-100 <= x < -99 dBm"},
481 { 12, "-99 <= x < -98 dBm"},
482 { 13, "-98 <= x < -97 dBm"},
483 { 14, "-97 <= x < -96 dBm"},
484 { 15, "-96 <= x < -95 dBm"},
485 { 16, "-95 <= x < -94 dBm"},
486 { 17, "-94 <= x < -93 dBm"},
487 { 18, "-93 <= x < -92 dBm"},
488 { 19, "-92 <= x < -91 dBm"},
489 { 20, "-91 <= x < -90 dBm"},
490 { 21, "-90 <= x < -89 dBm"},
491 { 22, "-89 <= x < -88 dBm"},
492 { 23, "-88 <= x < -87 dBm"},
493 { 24, "-87 <= x < -86 dBm"},
494 { 25, "-86 <= x < -85 dBm"},
495 { 26, "-85 <= x < -84 dBm"},
496 { 27, "-84 <= x < -83 dBm"},
497 { 28, "-83 <= x < -82 dBm"},
498 { 29, "-82 <= x < -81 dBm"},
499 { 30, "-81 <= x < -80 dBm"},
500 { 31, "-80 <= x < -79 dBm"},
501 { 32, "-79 <= x < -78 dBm"},
502 { 33, "-78 <= x < -77 dBm"},
503 { 34, "-77 <= x < -76 dBm"},
504 { 35, "-76 <= x < -75 dBm"},
505 { 36, "-75 <= x < -74 dBm"},
506 { 37, "-74 <= x < -73 dBm"},
507 { 38, "-73 <= x < -72 dBm"},
508 { 39, "-72 <= x < -71 dBm"},
509 { 40, "-71 <= x < -70 dBm"},
510 { 41, "-70 <= x < -69 dBm"},
511 { 42, "-69 <= x < -68 dBm"},
512 { 43, "-68 <= x < -67 dBm"},
513 { 44, "-67 <= x < -66 dBm"},
514 { 45, "-66 <= x < -65 dBm"},
515 { 46, "-65 <= x < -64 dBm"},
516 { 47, "-64 <= x < -63 dBm"},
517 { 48, "-63 <= x < -62 dBm"},
518 { 49, "-62 <= x < -61 dBm"},
519 { 50, "-61 <= x < -60 dBm"},
520 { 51, "-60 <= x < -59 dBm"},
521 { 52, "-59 <= x < -58 dBm"},
522 { 53, "-58 <= x < -57 dBm"},
523 { 54, "-57 <= x < -56 dBm"},
524 { 55, "-56 <= x < -55 dBm"},
525 { 56, "-55 <= x < -54 dBm"},
526 { 57, "-54 <= x < -53 dBm"},
527 { 58, "-53 <= x < -52 dBm"},
528 { 59, "-52 <= x < -51 dBm"},
529 { 60, "-51 <= x < -50 dBm"},
530 { 61, "-50 <= x < -49 dBm"},
531 { 62, "-49 <= x < -48 dBm"},
532 { 63, ">= -48 dBm"},
533 { 0, NULL}
535 value_string_ext gsm_a_rr_rxlev_vals_ext = VALUE_STRING_EXT_INIT(gsm_a_rr_rxlev_vals);
537 const value_string gsm_a_rr_rxqual_vals[] = {
538 {0, "BER < 0.2%, Mean value 0.14%"},
539 {1, "0.2% <= BER < 0.4%, Mean value 0.28%"},
540 {2, "0.4% <= BER < 0.8%, Mean value 0.57%"},
541 {3, "0.8% <= BER < 1.6%, Mean value 1.13%"},
542 {4, "1.6% <= BER < 3.2%, Mean value 2.26%"},
543 {5, "3.2% <= BER < 6.4%, Mean value 4.53%"},
544 {6, "6.4% <= BER < 12.8%, Mean value 9.05%"},
545 {7, "BER > 12.8%, Mean value 18.10%"},
546 {0, NULL}
549 /* Initialize the protocol and registered fields */
550 static int proto_a_common;
551 static int proto_3gpp;
553 int gsm_a_tap;
555 int hf_gsm_a_common_elem_id;
556 static int hf_gsm_a_common_elem_id_f0;
557 static int hf_gsm_a_l_ext;
558 int hf_gsm_a_tmsi;
559 static int hf_gsm_a_imei;
560 static int hf_gsm_a_imeisv;
562 static int hf_gsm_a_MSC_rev;
563 static int hf_gsm_a_ES_IND;
564 static int hf_gsm_a_A5_1_algorithm_sup;
565 static int hf_gsm_a_RF_power_capability;
566 static int hf_gsm_a_ps_sup_cap;
567 static int hf_gsm_a_SS_screening_indicator;
568 static int hf_gsm_a_SM_capability;
569 static int hf_gsm_a_VBS_notification_rec;
570 static int hf_gsm_a_VGCS_notification_rec;
571 static int hf_gsm_a_FC_frequency_cap;
572 static int hf_gsm_a_CM3;
573 static int hf_gsm_a_LCS_VA_cap;
574 static int hf_gsm_a_UCS2_treatment;
575 static int hf_gsm_a_SoLSA;
576 static int hf_gsm_a_CMSP;
577 static int hf_gsm_a_A5_7_algorithm_sup;
578 static int hf_gsm_a_A5_6_algorithm_sup;
579 static int hf_gsm_a_A5_5_algorithm_sup;
580 static int hf_gsm_a_A5_4_algorithm_sup;
581 static int hf_gsm_a_A5_3_algorithm_sup;
582 static int hf_gsm_a_A5_2_algorithm_sup;
584 static int hf_gsm_a_odd_even_ind;
585 static int hf_gsm_a_id_dig_1;
586 static int hf_gsm_a_unused;
587 static int hf_gsm_a_mobile_identity_type;
588 static int hf_gsm_a_tmgi_mcc_mnc_ind;
589 static int hf_gsm_a_mbs_ses_id_ind;
590 static int hf_gsm_a_mbs_service_id;
591 static int hf_gsm_a_mbs_session_id;
592 static int hf_gsm_a_length;
593 static int hf_gsm_a_element_value;
594 int hf_gsm_a_extension;
595 int hf_gsm_a_L3_protocol_discriminator;
596 int hf_gsm_a_call_prio;
597 int hf_gsm_a_skip_ind;
598 int hf_gsm_a_spare_bits;
599 int hf_gsm_a_lac;
601 static int hf_gsm_a_spare_nibble;
602 static int hf_gsm_a_type_of_ciph_alg;
603 static int hf_gsm_a_att;
604 static int hf_gsm_a_nmo_1;
605 static int hf_gsm_a_nmo;
606 static int hf_gsm_a_old_xid;
607 static int hf_gsm_a_iov_ui;
608 static int hf_gsm_a_ext_periodic_timers;
609 static int hf_gsm_a_b7spare;
610 int hf_gsm_a_b8spare;
611 static int hf_gsm_a_multi_bnd_sup_fields;
612 static int hf_gsm_a_pgsm_supported;
613 static int hf_gsm_a_egsm_supported;
614 static int hf_gsm_a_gsm1800_supported;
615 static int hf_gsm_a_ass_radio_cap1;
616 static int hf_gsm_a_ass_radio_cap2;
617 static int hf_gsm_a_rsupport;
618 static int hf_gsm_a_r_capabilities;
619 static int hf_gsm_a_multislot_capabilities;
620 static int hf_gsm_a_multislot_class;
621 static int hf_gsm_a_ucs2_treatment;
622 static int hf_gsm_a_extended_measurement_cap;
623 static int hf_gsm_a_ms_measurement_capability;
624 static int hf_gsm_a_sms_value;
625 static int hf_gsm_a_sm_value;
626 static int hf_gsm_a_key_seq;
627 static int hf_gsm_a_ms_pos_method_cap_present;
628 static int hf_gsm_a_ms_pos_method;
629 static int hf_gsm_a_ms_assisted_e_otd;
630 static int hf_gsm_a_ms_based_e_otd;
631 static int hf_gsm_a_ms_assisted_gps;
632 static int hf_gsm_a_ms_based_gps;
633 static int hf_gsm_a_ms_conventional_gps;
634 static int hf_gsm_a_ecsd_multi_slot_capability;
635 static int hf_gsm_a_ecsd_multi_slot_class;
636 static int hf_gsm_a_8_psk_struct_present;
637 static int hf_gsm_a_8_psk_struct;
638 static int hf_gsm_a_modulation_capability;
639 static int hf_gsm_a_8_psk_rf_power_capability_1_present;
640 static int hf_gsm_a_8_psk_rf_power_capability_1;
641 static int hf_gsm_a_8_psk_rf_power_capability_2_present;
642 static int hf_gsm_a_8_psk_rf_power_capability_2;
643 static int hf_gsm_a_gsm_400_band_info_present;
644 static int hf_gsm_a_gsm_400_bands_supported;
645 static int hf_gsm_a_gsm_400_assoc_radio_cap;
646 static int hf_gsm_a_gsm_850_assoc_radio_cap_present;
647 static int hf_gsm_a_gsm_850_assoc_radio_cap;
648 static int hf_gsm_a_gsm_1900_assoc_radio_cap_present;
649 static int hf_gsm_a_gsm_1900_assoc_radio_cap;
650 static int hf_gsm_a_cm3_A5_bits;
651 static int hf_gsm_a_umts_fdd_rat_cap;
652 static int hf_gsm_a_umts_384_mcps_tdd_rat_cap;
653 static int hf_gsm_a_cdma_2000_rat_cap;
654 static int hf_gsm_a_dtm_e_gprs_multi_slot_info_present;
655 static int hf_gsm_a_dtm_gprs_multi_slot_class;
656 static int hf_gsm_a_single_slot_dtm;
657 static int hf_gsm_a_dtm_egprs_multi_slot_class_present;
658 static int hf_gsm_a_dtm_egprs_multi_slot_class;
659 static int hf_gsm_a_single_band_support;
660 static int hf_gsm_a_gsm_band;
661 static int hf_gsm_a_gsm_750_assoc_radio_cap_present;
662 static int hf_gsm_a_gsm_750_assoc_radio_cap;
663 static int hf_gsm_a_umts_128_mcps_tdd_rat_cap;
664 static int hf_gsm_a_geran_feature_package_1;
665 static int hf_gsm_a_ext_dtm_e_gprs_multi_slot_info_present;
666 static int hf_gsm_a_ext_dtm_gprs_multi_slot_class;
667 static int hf_gsm_a_ext_dtm_egprs_multi_slot_class;
668 static int hf_gsm_a_high_multislot_cap_present;
669 static int hf_gsm_a_high_multislot_cap;
670 static int hf_gsm_a_geran_iu_mode_support;
671 static int hf_gsm_a_geran_iu_mode_cap;
672 static int hf_gsm_a_geran_iu_mode_cap_length;
673 static int hf_gsm_a_flo_iu_cap;
674 static int hf_gsm_a_geran_feature_package_2;
675 static int hf_gsm_a_gmsk_multislot_power_prof;
676 static int hf_gsm_a_8_psk_multislot_power_prof;
677 static int hf_gsm_a_t_gsm_400_band_info_present;
678 static int hf_gsm_a_t_gsm_400_bands_supported;
679 static int hf_gsm_a_t_gsm_400_assoc_radio_cap;
680 static int hf_gsm_a_t_gsm_900_assoc_radio_cap_present;
681 static int hf_gsm_a_t_gsm_900_assoc_radio_cap;
682 static int hf_gsm_a_downlink_adv_receiver_perf;
683 static int hf_gsm_a_dtm_enhancements_cap;
684 static int hf_gsm_a_dtm_e_gprs_high_multi_slot_info_present;
685 static int hf_gsm_a_dtm_gprs_high_multi_slot_class;
686 static int hf_gsm_a_offset_required;
687 static int hf_gsm_a_dtm_egprs_high_multi_slot_class_present;
688 static int hf_gsm_a_dtm_egprs_high_multi_slot_class;
689 static int hf_gsm_a_repeated_acch_cap;
690 static int hf_gsm_a_gsm_710_assoc_radio_cap_present;
691 static int hf_gsm_a_gsm_710_assoc_radio_cap;
692 static int hf_gsm_a_t_gsm_810_assoc_radio_cap_present;
693 static int hf_gsm_a_t_gsm_810_assoc_radio_cap;
694 static int hf_gsm_a_ciphering_mode_setting_cap;
695 static int hf_gsm_a_additional_positioning_caps;
696 static int hf_gsm_a_e_utra_fdd_support;
697 static int hf_gsm_a_e_utra_tdd_support;
698 static int hf_gsm_a_e_utra_meas_and_report_support;
699 static int hf_gsm_a_prio_based_resel_support;
700 static int hf_gsm_a_utra_csg_cells_reporting;
701 static int hf_gsm_a_vamos_level;
702 static int hf_gsm_a_tighter_cap;
703 static int hf_gsm_a_selective_ciph_down_sacch;
704 static int hf_gsm_a_cs_to_ps_srvcc_geran_to_utra;
705 static int hf_gsm_a_cs_to_ps_srvcc_geran_to_eutra;
706 static int hf_gsm_a_geran_network_sharing_support;
707 static int hf_gsm_a_eutra_wb_rsrq_support;
708 static int hf_gsm_a_er_band_support;
709 static int hf_gsm_a_utra_mfbi_support;
710 static int hf_gsm_a_eutra_mfbi_support;
711 static int hf_gsm_a_ext_tsc_set_cap_support;
712 static int hf_gsm_a_ext_earfcn_value_range;
714 static int hf_gsm_a_geo_loc_type_of_shape;
715 static int hf_gsm_a_geo_loc_sign_of_lat;
716 static int hf_gsm_a_geo_loc_deg_of_lat;
717 static int hf_gsm_a_geo_loc_deg_of_long;
718 static int hf_gsm_a_geo_loc_osm_uri;
719 static int hf_gsm_a_geo_loc_uncertainty_code;
720 static int hf_gsm_a_geo_loc_uncertainty_semi_major;
721 static int hf_gsm_a_geo_loc_uncertainty_semi_minor;
722 static int hf_gsm_a_geo_loc_orientation_of_major_axis;
723 static int hf_gsm_a_geo_loc_uncertainty_altitude;
724 static int hf_gsm_a_geo_loc_confidence;
725 static int hf_gsm_a_geo_loc_uncertainty_range;
726 static int hf_gsm_a_geo_loc_horizontal_confidence;
727 static int hf_gsm_a_geo_loc_horizontal_uncertainty_range;
728 static int hf_gsm_a_geo_loc_vertical_confidence;
729 static int hf_gsm_a_geo_loc_vertical_uncertainty_range;
730 static int hf_gsm_a_geo_loc_high_acc_uncertainty_alt;
731 static int hf_gsm_a_geo_loc_no_of_points;
732 static int hf_gsm_a_geo_loc_high_acc_deg_of_lat;
733 static int hf_gsm_a_geo_loc_high_acc_deg_of_long;
734 static int hf_gsm_a_geo_loc_high_acc_uncertainty_semi_major;
735 static int hf_gsm_a_geo_loc_high_acc_uncertainty_semi_minor;
736 static int hf_gsm_a_geo_loc_high_acc_alt;
737 static int hf_gsm_a_velocity_type;
738 static int hf_gsm_a_bearing;
739 static int hf_gsm_a_horizontal_speed;
740 static int hf_gsm_a_uncertainty_speed;
741 static int hf_gsm_a_h_uncertainty_speed;
742 static int hf_gsm_a_v_uncertainty_speed;
743 static int hf_gsm_a_vertical_speed;
744 static int hf_gsm_a_d;
745 static int hf_gsm_a_geo_loc_D;
746 static int hf_gsm_a_geo_loc_altitude;
747 static int hf_gsm_a_geo_loc_inner_radius;
748 static int hf_gsm_a_geo_loc_uncertainty_radius;
749 static int hf_gsm_a_geo_loc_offset_angle;
750 static int hf_gsm_a_geo_loc_included_angle;
752 /* Generated from convert_proto_tree_add_text.pl */
753 static int hf_gsm_a_filler;
754 static int hf_gsm_a_identity_digit1;
755 static int hf_gsm_a_group_call_reference;
756 static int hf_gsm_a_service_flag;
757 static int hf_gsm_a_af_acknowledgement;
758 static int hf_gsm_a_call_priority;
759 static int hf_gsm_a_ciphering_info;
760 static int hf_gsm_a_sapi;
762 /* Inter protocol hf */
763 int hf_3gpp_tmsi;
765 static int ett_gsm_a_plmn;
766 static int ett_gsm_a_poly_pnt;
768 static expert_field ei_gsm_a_extraneous_data;
769 static expert_field ei_gsm_a_unknown_element;
770 static expert_field ei_gsm_a_unknown_pdu_type;
771 static expert_field ei_gsm_a_no_element_dissector;
772 static expert_field ei_gsm_a_format_not_supported;
773 static expert_field ei_gsm_a_mobile_identity_type;
774 static expert_field ei_gsm_a_ie_length_too_short;
776 sccp_assoc_info_t* sccp_assoc;
778 #define NUM_GSM_COMMON_ELEM array_length(gsm_common_elem_strings)
779 int ett_gsm_common_elem[NUM_GSM_COMMON_ELEM];
782 #define ELLIPSOID_POINT 0
783 #define ELLIPSOID_POINT_WITH_UNCERT_CIRC 1
784 #define ELLIPSOID_POINT_WITH_UNCERT_ELLIPSE 3
785 #define POLYGON 5
786 #define ELLIPSOID_POINT_WITH_ALT 8
787 #define ELLIPSOID_POINT_WITH_ALT_AND_UNCERT_ELLIPSOID 9
788 #define ELLIPSOID_ARC 10
789 #define HIGH_ACC_ELLIPSOID_PNT_WITH_UNCERT_ELLIPSE 11
790 #define HIGH_ACC_ELLIPSOID_PNT_WITH_ALT_AND_UNCERT_ELLIPSOID 12
791 #define HIGH_ACC_ELLIPSOID_PNT_WITH_SCALABLE_UNCERT_ELLIPSE 13
792 #define HIGH_ACC_ELLIPSOID_PNT_WITH_ALT_AND_SCALABLE_UNCERT_ELLIPSOID 14
794 4 3 2 1
795 0 0 0 0 Ellipsoid Point
796 0 0 0 1 Ellipsoid point with uncertainty Circle
797 0 0 1 1 Ellipsoid point with uncertainty Ellipse
798 0 1 0 1 Polygon
799 1 0 0 0 Ellipsoid point with altitude
800 1 0 0 1 Ellipsoid point with altitude and uncertainty Ellipsoid
801 1 0 1 0 Ellipsoid Arc
802 1 0 1 1 High Accuracy Ellipsoid point with uncertainty ellipse
803 1 1 0 0 High Accuracy Ellipsoid point with altitude and uncertainty ellipsoid
804 1 1 0 1 High Accuracy Ellipsoid point with scalable uncertainty ellipse
805 1 1 1 0 High Accuracy Ellipsoid point with altitude and scalable uncertainty ellipsoid
806 other values reserved for future use
809 /* TS 23 032 Table 2a: Coding of Type of Shape */
810 static const value_string type_of_shape_vals[] = {
811 { ELLIPSOID_POINT, "Ellipsoid Point"},
812 { ELLIPSOID_POINT_WITH_UNCERT_CIRC, "Ellipsoid point with uncertainty Circle"},
813 { ELLIPSOID_POINT_WITH_UNCERT_ELLIPSE, "Ellipsoid point with uncertainty Ellipse"},
814 { POLYGON, "Polygon"},
815 { ELLIPSOID_POINT_WITH_ALT, "Ellipsoid point with altitude"},
816 { ELLIPSOID_POINT_WITH_ALT_AND_UNCERT_ELLIPSOID, "Ellipsoid point with altitude and uncertainty Ellipsoid"},
817 { ELLIPSOID_ARC, "Ellipsoid Arc"},
818 { HIGH_ACC_ELLIPSOID_PNT_WITH_UNCERT_ELLIPSE, "High Accuracy Ellipsoid point with uncertainty ellipse"},
819 { HIGH_ACC_ELLIPSOID_PNT_WITH_ALT_AND_UNCERT_ELLIPSOID, "High Accuracy Ellipsoid point with altitude and uncertainty ellipsoid"},
820 { HIGH_ACC_ELLIPSOID_PNT_WITH_SCALABLE_UNCERT_ELLIPSE, "High Accuracy Ellipsoid point with scalable uncertainty ellipse"},
821 { HIGH_ACC_ELLIPSOID_PNT_WITH_ALT_AND_SCALABLE_UNCERT_ELLIPSOID, "High Accuracy Ellipsoid point with altitude and scalable uncertainty ellipsoid"},
822 { 0, NULL }
825 /* 3GPP TS 23.032 7.3.1 */
826 static const value_string sign_of_latitude_vals[] = {
827 { 0, "North"},
828 { 1, "South"},
829 { 0, NULL }
832 static const value_string dir_of_alt_vals[] = {
833 { 0, "Altitude expresses height"},
834 { 1, "Altitude expresses depth"},
835 { 0, NULL }
838 static const value_string uncertainty_range[] = {
839 { 0, "High Accuracy default uncertainty range used"},
840 { 1, "High Accuracy Extended Uncertainty Range used"},
841 { 0, NULL }
844 typedef uint16_t (**elem_func_hander)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len);
847 dissect_geographical_description(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) {
849 proto_item *lat_item, *long_item, *major_item, *minor_item, *orientation_item, *alt_item, *uncer_item, *loc_uri_item;
850 /*proto_tree *subtree; */
851 uint32_t type_of_shape;
852 int offset = 0;
853 int length;
854 uint8_t value;
855 uint32_t uvalue32;
856 int32_t svalue32;
857 char *deg_lat_str;
858 char *deg_lon_str;
859 char *osm_uri;
860 int loc_offset;
862 /*subtree = proto_item_add_subtree(item, ett_gsm_a_geo_desc);*/
864 length = tvb_reported_length_remaining(tvb, 0);
865 /* Geographical Location
866 * The Location Estimate field is composed of 1 or more octets with an internal structure
867 * according to section 7 in [23.032].
869 proto_tree_add_item_ret_uint(tree, hf_gsm_a_geo_loc_type_of_shape, tvb, 0, 1, ENC_BIG_ENDIAN, &type_of_shape);
870 offset++;
871 if (length < 2) {
872 return length;
874 switch (type_of_shape) {
875 case ELLIPSOID_POINT:
876 /* Ellipsoid Point */
877 case ELLIPSOID_POINT_WITH_UNCERT_CIRC:
878 /* Ellipsoid Point with uncertainty Circle */
879 case ELLIPSOID_POINT_WITH_UNCERT_ELLIPSE:
880 /* Ellipsoid Point with uncertainty Ellipse */
881 case ELLIPSOID_POINT_WITH_ALT:
882 /* Ellipsoid Point with Altitude */
883 case ELLIPSOID_POINT_WITH_ALT_AND_UNCERT_ELLIPSOID:
884 /* Ellipsoid Point with altitude and uncertainty ellipsoid */
885 case ELLIPSOID_ARC:
886 /* Ellipsoid Arc */
887 if (length < 4)
888 return length;
889 proto_tree_add_item(tree, hf_gsm_a_geo_loc_sign_of_lat, tvb, offset, 1, ENC_BIG_ENDIAN);
891 uvalue32 = tvb_get_ntoh24(tvb,offset);
892 /* convert degrees (X/0x7fffff) * 90 = degrees */
893 lat_item = proto_tree_add_item(tree, hf_gsm_a_geo_loc_deg_of_lat, tvb, offset, 3, ENC_BIG_ENDIAN);
894 deg_lat_str = wmem_strdup_printf(pinfo->pool, "%s%.5f",
895 (uvalue32 & 0x00800000) ? "-" : "",
896 ((double)(uvalue32 & 0x7fffff)/8388607.0) * 90);
897 proto_item_append_text(lat_item, " (%s degrees)", deg_lat_str);
898 loc_offset = offset;
899 offset = offset + 3;
900 if (length < 7)
901 return offset;
902 svalue32 = tvb_get_ntoh24(tvb,offset);
903 svalue32 |= (svalue32 & 0x800000) ? 0xff000000 : 0x00000000;
904 long_item = proto_tree_add_item(tree, hf_gsm_a_geo_loc_deg_of_long, tvb, offset, 3, ENC_BIG_ENDIAN);
905 /* (X/0xffffff) *360 = degrees */
906 deg_lon_str = wmem_strdup_printf(pinfo->pool, "%.5f",
907 ((double)svalue32/16777215.0) * 360);
908 proto_item_append_text(long_item, " (%s degrees)", deg_lon_str);
909 offset = offset + 3;
910 if (type_of_shape == ELLIPSOID_POINT_WITH_UNCERT_CIRC) {
911 /* Ellipsoid Point with uncertainty Circle */
912 if (length < 8)
913 return offset;
914 /* Uncertainty code */
915 value = tvb_get_uint8(tvb,offset)&0x7f;
916 uncer_item = proto_tree_add_item(tree, hf_gsm_a_geo_loc_uncertainty_code, tvb, offset, 1, ENC_BIG_ENDIAN);
917 proto_item_append_text(uncer_item, " (%.1f m)", 10 * (pow(1.1, (double)value) - 1));
918 }else if (type_of_shape == ELLIPSOID_POINT_WITH_UNCERT_ELLIPSE) {
919 /* Ellipsoid Point with uncertainty Ellipse */
920 /* Uncertainty semi-major octet 10
921 * To convert to metres 10*(((1.1)^X)-1)
923 value = tvb_get_uint8(tvb,offset) & 0x7f;
924 major_item = proto_tree_add_item(tree, hf_gsm_a_geo_loc_uncertainty_semi_major, tvb, offset, 1, ENC_BIG_ENDIAN);
925 proto_item_append_text(major_item, " (%.1f m)", 10 * (pow(1.1, (double)value) - 1));
926 offset++;
927 /* Uncertainty semi-minor Octet 11
928 * To convert to metres 10*(((1.1)^X)-1)
930 value = tvb_get_uint8(tvb,offset)&0x7f;
931 minor_item = proto_tree_add_item(tree, hf_gsm_a_geo_loc_uncertainty_semi_minor, tvb, offset, 1, ENC_BIG_ENDIAN);
932 proto_item_append_text(minor_item, " (%.1f m)", 10 * (pow(1.1, (double)value) - 1));
933 offset++;
934 /* TS 23.032 V15.1.0 (2018-09)
935 * Orientation of major axis octet 12
936 * allowed value from 0-179
938 orientation_item = proto_tree_add_item_ret_uint(tree, hf_gsm_a_geo_loc_orientation_of_major_axis, tvb, offset, 1, ENC_BIG_ENDIAN, &uvalue32);
939 proto_item_append_text(orientation_item, " (%d degrees)", 2 * uvalue32);
940 offset++;
941 /* Confidence */
942 proto_tree_add_item(tree, hf_gsm_a_geo_loc_confidence, tvb, offset, 1, ENC_BIG_ENDIAN);
943 offset++;
944 }else if (type_of_shape == ELLIPSOID_POINT_WITH_ALT) {
945 /* Ellipsoid Point with Altitude */
946 /*D: Direction of Altitude */
947 proto_tree_add_item(tree, hf_gsm_a_geo_loc_D, tvb, offset, 1, ENC_BIG_ENDIAN);
948 /* Altitude */
949 proto_tree_add_item(tree, hf_gsm_a_geo_loc_altitude, tvb, offset, 2, ENC_BIG_ENDIAN);
950 }else if (type_of_shape == ELLIPSOID_POINT_WITH_ALT_AND_UNCERT_ELLIPSOID) {
951 /* Ellipsoid Point with altitude and uncertainty ellipsoid */
952 /*D: Direction of Altitude octet 8,9 */
953 proto_tree_add_item(tree, hf_gsm_a_geo_loc_D, tvb, offset, 1, ENC_BIG_ENDIAN);
954 /* Altitude Octet 8,9*/
955 proto_tree_add_item(tree, hf_gsm_a_geo_loc_altitude, tvb, offset, 2, ENC_BIG_ENDIAN);
956 offset = offset +2;
957 /* Uncertainty semi-major octet 10
958 * To convert to metres 10*(((1.1)^X)-1)
960 value = tvb_get_uint8(tvb,offset)&0x7f;
961 major_item = proto_tree_add_item(tree, hf_gsm_a_geo_loc_uncertainty_semi_major, tvb, offset, 1, ENC_BIG_ENDIAN);
962 proto_item_append_text(major_item, " (%.1f m)", 10 * (pow(1.1, (double)value) - 1));
963 offset++;
964 /* Uncertainty semi-minor Octet 11
965 * To convert to metres 10*(((1.1)^X)-1)
967 value = tvb_get_uint8(tvb,offset)&0x7f;
968 minor_item = proto_tree_add_item(tree, hf_gsm_a_geo_loc_uncertainty_semi_minor, tvb, offset, 1, ENC_BIG_ENDIAN);
969 proto_item_append_text(minor_item, " (%.1f m)", 10 * (pow(1.1, (double)value) - 1));
970 offset++;
971 /* Orientation of major axis octet 12
972 * allowed value from 0-179 to convert
973 * to actual degrees multiply by 2.
975 orientation_item = proto_tree_add_item_ret_uint(tree, hf_gsm_a_geo_loc_orientation_of_major_axis, tvb, offset, 1, ENC_BIG_ENDIAN, &uvalue32);
976 proto_item_append_text(orientation_item, " (%d degrees)", 2 * uvalue32);
977 offset++;
978 /* Uncertainty Altitude 13
979 * to convert to metres 45*(((1.025)^X)-1)
981 value = tvb_get_uint8(tvb,offset)&0x7f;
982 alt_item = proto_tree_add_item(tree, hf_gsm_a_geo_loc_uncertainty_altitude, tvb, offset, 1, ENC_BIG_ENDIAN);
983 proto_item_append_text(alt_item, " (%.1f m)", 45 * (pow(1.025, (double)value) - 1));
984 offset++;
985 /* Confidence octet 14
987 proto_tree_add_item(tree, hf_gsm_a_geo_loc_confidence, tvb, offset, 1, ENC_BIG_ENDIAN);
988 }else if (type_of_shape == ELLIPSOID_ARC) {
989 /* Ellipsoid Arc */
990 /* Inner radius */
991 proto_tree_add_item(tree, hf_gsm_a_geo_loc_inner_radius, tvb, offset, 2, ENC_BIG_ENDIAN);
992 offset = offset + 2;
993 /* Uncertainty radius */
994 proto_tree_add_item(tree, hf_gsm_a_geo_loc_uncertainty_radius, tvb, offset, 1, ENC_BIG_ENDIAN);
995 offset++;
996 /* Offset angle */
997 proto_tree_add_item(tree, hf_gsm_a_geo_loc_offset_angle, tvb, offset, 1, ENC_BIG_ENDIAN);
998 offset++;
999 /* Included angle */
1000 proto_tree_add_item(tree, hf_gsm_a_geo_loc_included_angle, tvb, offset, 1, ENC_BIG_ENDIAN);
1001 offset++;
1002 /* Confidence */
1003 proto_tree_add_item(tree, hf_gsm_a_geo_loc_confidence, tvb, offset, 1, ENC_BIG_ENDIAN);
1005 osm_uri = wmem_strdup_printf(pinfo->pool, "https://www.openstreetmap.org/?mlat=%s&mlon=%s&zoom=12", deg_lat_str, deg_lon_str);
1006 loc_uri_item = proto_tree_add_string(tree, hf_gsm_a_geo_loc_osm_uri, tvb, loc_offset, 6, osm_uri);
1007 proto_item_set_url(loc_uri_item);
1008 proto_item_set_generated(loc_uri_item);
1010 break;
1011 case POLYGON: /* Polygon */
1013 /* Number of points */
1014 uint32_t no_of_points;
1015 unsigned point_no = 0;
1016 proto_tree* sub_tree;
1017 proto_item *ti;
1019 proto_tree_add_item_ret_uint(tree, hf_gsm_a_geo_loc_no_of_points, tvb, 0, 1, ENC_BIG_ENDIAN, &no_of_points);
1020 /* offset increased with 1 after reading of shape above */
1021 while (no_of_points > 0) {
1022 point_no++;
1023 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 6,
1024 ett_gsm_a_poly_pnt, &ti, "Polygon point %u", point_no);
1025 proto_tree_add_item(sub_tree, hf_gsm_a_geo_loc_sign_of_lat, tvb, offset, 1, ENC_BIG_ENDIAN);
1027 uvalue32 = tvb_get_ntoh24(tvb, offset);
1028 /* convert degrees (X/0x7fffff) * 90 = degrees */
1029 lat_item = proto_tree_add_item(sub_tree, hf_gsm_a_geo_loc_deg_of_lat, tvb, offset, 3, ENC_BIG_ENDIAN);
1030 deg_lat_str = wmem_strdup_printf(pinfo->pool, "%s%.5f",
1031 (uvalue32 & 0x00800000) ? "-" : "",
1032 ((double)(uvalue32 & 0x7fffff) / 8388607.0) * 90);
1033 proto_item_append_text(lat_item, " (%s degrees)", deg_lat_str);
1034 loc_offset = offset;
1035 offset = offset + 3;
1036 svalue32 = tvb_get_ntoh24(tvb, offset);
1037 svalue32 |= (svalue32 & 0x800000) ? 0xff000000 : 0x00000000;
1038 long_item = proto_tree_add_item(sub_tree, hf_gsm_a_geo_loc_deg_of_long, tvb, offset, 3, ENC_BIG_ENDIAN);
1039 /* (X/0xffffff) *360 = degrees */
1040 deg_lon_str = wmem_strdup_printf(pinfo->pool, "%.5f",
1041 ((double)svalue32 / 16777215.0) * 360);
1042 proto_item_append_text(long_item, " (%s degrees)", deg_lon_str);
1043 offset = offset + 3;
1044 no_of_points--;
1046 osm_uri = wmem_strdup_printf(pinfo->pool, "https://www.openstreetmap.org/?mlat=%s&mlon=%s&zoom=12", deg_lat_str, deg_lon_str);
1047 loc_uri_item = proto_tree_add_string(tree, hf_gsm_a_geo_loc_osm_uri, tvb, loc_offset, 6, osm_uri);
1048 proto_item_set_url(loc_uri_item);
1049 proto_item_set_generated(loc_uri_item);
1052 break;
1053 case HIGH_ACC_ELLIPSOID_PNT_WITH_UNCERT_ELLIPSE:
1054 case HIGH_ACC_ELLIPSOID_PNT_WITH_SCALABLE_UNCERT_ELLIPSE:
1055 loc_offset = offset;
1056 lat_item = proto_tree_add_item_ret_int(tree, hf_gsm_a_geo_loc_high_acc_deg_of_lat, tvb, offset, 4, ENC_BIG_ENDIAN, &svalue32);
1057 deg_lat_str = wmem_strdup_printf(pinfo->pool, "%s%.5f",
1058 (svalue32 & 0x80000000) ? "-" : "",
1059 ((double)(svalue32 & 0x7fffffff) / 2147483647.0) * 90);
1060 proto_item_append_text(lat_item, " (%s degrees)", deg_lat_str);
1061 offset += 4;
1062 long_item = proto_tree_add_item_ret_int(tree, hf_gsm_a_geo_loc_high_acc_deg_of_long, tvb, offset, 4, ENC_BIG_ENDIAN, &svalue32);
1063 deg_lon_str = wmem_strdup_printf(pinfo->pool, "%s%.5f",
1064 (svalue32 & 0x80000000) ? "-" : "",
1065 ((double)svalue32 / 2147483647.0) * 180);
1066 proto_item_append_text(long_item, " (%s degrees)", deg_lon_str);
1068 offset += 4;
1069 /* High accuracy uncertainty semi-major*/
1070 major_item = proto_tree_add_item_ret_uint(tree, hf_gsm_a_geo_loc_high_acc_uncertainty_semi_major, tvb, offset, 1, ENC_BIG_ENDIAN, &uvalue32);
1071 proto_item_append_text(major_item, " (%.5f m)", 0.3 * (pow(1.02, (double)uvalue32) - 1));
1072 offset++;
1073 /* High accuracy uncertainty semi-minor*/
1074 minor_item = proto_tree_add_item_ret_uint(tree, hf_gsm_a_geo_loc_high_acc_uncertainty_semi_minor, tvb, offset, 1, ENC_BIG_ENDIAN, &uvalue32);
1075 proto_item_append_text(minor_item, " (%.5f m)", 0.3 * (pow(1.02, (double)uvalue32) - 1));
1076 offset++;
1077 /* Orientation of major axis */
1078 value = tvb_get_uint8(tvb,offset)&0x7f;
1079 orientation_item = proto_tree_add_item_ret_uint(tree, hf_gsm_a_geo_loc_orientation_of_major_axis, tvb, offset, 1, ENC_BIG_ENDIAN, &uvalue32);
1080 proto_item_append_text(orientation_item, " (%d degrees)", 2 * uvalue32);
1081 offset++;
1082 /* Confidence */
1083 proto_tree_add_item(tree, hf_gsm_a_geo_loc_confidence, tvb, offset, 1, ENC_BIG_ENDIAN);
1084 if (type_of_shape == HIGH_ACC_ELLIPSOID_PNT_WITH_SCALABLE_UNCERT_ELLIPSE) {
1085 /* Uncertainty Range */
1086 proto_tree_add_item(tree, hf_gsm_a_geo_loc_uncertainty_range, tvb, offset, 1, ENC_BIG_ENDIAN);
1088 offset++;
1090 osm_uri = wmem_strdup_printf(pinfo->pool, "https://www.openstreetmap.org/?mlat=%s&mlon=%s&zoom=12", deg_lat_str, deg_lon_str);
1091 loc_uri_item = proto_tree_add_string(tree, hf_gsm_a_geo_loc_osm_uri, tvb, loc_offset, 6, osm_uri);
1092 proto_item_set_url(loc_uri_item);
1093 proto_item_set_generated(loc_uri_item);
1095 break;
1096 case HIGH_ACC_ELLIPSOID_PNT_WITH_ALT_AND_UNCERT_ELLIPSOID:
1097 case HIGH_ACC_ELLIPSOID_PNT_WITH_ALT_AND_SCALABLE_UNCERT_ELLIPSOID:
1098 lat_item = proto_tree_add_item_ret_int(tree, hf_gsm_a_geo_loc_high_acc_deg_of_lat, tvb, offset, 4, ENC_BIG_ENDIAN, &svalue32);
1099 deg_lat_str = wmem_strdup_printf(pinfo->pool, "%s%.5f",
1100 (svalue32 & 0x80000000) ? "-" : "",
1101 ((double)(svalue32 & 0x7fffffff) / 2147483647.0) * 90);
1102 proto_item_append_text(lat_item, " (%s degrees)", deg_lat_str);
1103 offset += 4;
1104 long_item = proto_tree_add_item_ret_int(tree, hf_gsm_a_geo_loc_high_acc_deg_of_long, tvb, offset, 4, ENC_BIG_ENDIAN, &svalue32);
1105 deg_lon_str = wmem_strdup_printf(pinfo->pool, "%s%.5f",
1106 (svalue32 & 0x80000000) ? "-" : "",
1107 ((double)svalue32 / 2147483647.0) * 180);
1108 proto_item_append_text(long_item, " (%s degrees)", deg_lon_str);
1109 offset += 4;
1111 /* High accuracy altitude
1112 * High accuracy altitude is encoded as a number N between -64000 and 1280000 using 2's complement binary on 22 bits.
1115 alt_item = proto_tree_add_item_ret_int(tree, hf_gsm_a_geo_loc_high_acc_alt, tvb, offset, 3, ENC_BIG_ENDIAN, &svalue32);
1116 /* double z = pow(double x, double y);*/
1117 proto_item_append_text(alt_item, " (%.1f m)", (double)svalue32 * pow(2,-7));
1118 offset += 3;
1120 /* High accuracy uncertainty semi-major*/
1121 major_item = proto_tree_add_item_ret_uint(tree, hf_gsm_a_geo_loc_high_acc_uncertainty_semi_major, tvb, offset, 1, ENC_BIG_ENDIAN, &uvalue32);
1122 proto_item_append_text(major_item, " (%.5f m)", 0.3 * (pow(1.02, (double)uvalue32) - 1));
1123 offset++;
1124 /* High accuracy uncertainty semi-minor*/
1125 minor_item = proto_tree_add_item_ret_uint(tree, hf_gsm_a_geo_loc_high_acc_uncertainty_semi_minor, tvb, offset, 1, ENC_BIG_ENDIAN, &uvalue32);
1126 proto_item_append_text(minor_item, " (%.5f m)", 0.3 * (pow(1.02, (double)uvalue32) - 1));
1127 offset++;
1128 /* Orientation of major axis */
1129 orientation_item = proto_tree_add_item_ret_uint(tree, hf_gsm_a_geo_loc_orientation_of_major_axis, tvb, offset, 1, ENC_BIG_ENDIAN, &uvalue32);
1130 proto_item_append_text(orientation_item, " (%d degrees)", 2 * uvalue32);
1131 offset++;
1133 /* Horizontal confidence */
1134 proto_tree_add_item(tree, hf_gsm_a_geo_loc_horizontal_confidence, tvb, offset, 1, ENC_BIG_ENDIAN);
1135 if (type_of_shape == HIGH_ACC_ELLIPSOID_PNT_WITH_ALT_AND_SCALABLE_UNCERT_ELLIPSOID) {
1136 /* Horizontal Uncertainty Range */
1137 proto_tree_add_item(tree, hf_gsm_a_geo_loc_horizontal_uncertainty_range, tvb, offset, 1, ENC_BIG_ENDIAN);
1139 offset++;
1141 /* High accuracy uncertainty altitude */
1142 value = tvb_get_uint8(tvb, offset) & 0x7f;
1143 alt_item = proto_tree_add_item(tree, hf_gsm_a_geo_loc_high_acc_uncertainty_alt, tvb, offset, 1, ENC_BIG_ENDIAN);
1144 proto_item_append_text(alt_item, " (%.1f m)", 45 * (pow(1.025, (double)value) - 1));
1145 offset++;
1147 /* Vertical confidence*/
1148 proto_tree_add_item(tree, hf_gsm_a_geo_loc_vertical_confidence, tvb, offset, 1, ENC_BIG_ENDIAN);
1149 if (type_of_shape == HIGH_ACC_ELLIPSOID_PNT_WITH_ALT_AND_SCALABLE_UNCERT_ELLIPSOID) {
1150 /* Vertical Uncertainty Range */
1151 proto_tree_add_item(tree, hf_gsm_a_geo_loc_vertical_uncertainty_range, tvb, offset, 1, ENC_BIG_ENDIAN);
1153 offset++;
1154 break;
1156 default:
1157 break;
1159 return offset;
1162 /* TS 23.032
1163 * Ch. 8 Description of Velocity
1165 /* 8.6 Coding of Velocity Type */
1166 static const value_string gsm_a_velocity_type_vals[] = {
1167 { 0, "Horizontal Velocity"},
1168 { 1, "Horizontal with Vertical Velocity"},
1169 { 2, "Horizontal Velocity with Uncertainty"},
1170 { 3, "Horizontal with Vertical Velocity and Uncertainty"},
1171 { 4, "reserved for future use"},
1172 { 5, "reserved for future use"},
1173 { 6, "reserved for future use"},
1174 { 7, "reserved for future use"},
1175 { 8, "reserved for future use"},
1176 { 9, "reserved for future use"},
1177 { 10, "reserved for future use"},
1178 { 11, "reserved for future use"},
1179 { 12, "reserved for future use"},
1180 { 13, "reserved for future use"},
1181 { 14, "reserved for future use"},
1182 { 15, "reserved for future use"},
1183 { 0, NULL }
1186 static const true_false_string gsm_a_dir_of_ver_speed_vals = {
1187 "Downward",
1188 "Upward"
1191 uint16_t
1192 dissect_description_of_velocity(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
1194 proto_item *velocity_item;
1195 uint32_t curr_offset;
1196 uint32_t velocity_type, uncertainty_speed = 0;
1198 curr_offset = offset;
1200 /* Bit 8 - 5 Velocity Type */
1201 proto_tree_add_item_ret_uint(tree, hf_gsm_a_velocity_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &velocity_type);
1203 switch (velocity_type) {
1204 case 0:
1205 /* 8.12 Coding of Horizontal Velocity */
1206 /* Spare bits */
1207 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 3, ENC_BIG_ENDIAN);
1208 /* Bearing is encoded in increments of 1 degree measured clockwise from North using a 9 bit binary coded number N. */
1209 proto_tree_add_bits_item(tree, hf_gsm_a_bearing, tvb, (curr_offset<<3)+7, 9, ENC_BIG_ENDIAN);
1210 curr_offset += 2;
1211 /* Horizontal speed is encoded in increments of 1 kilometre per hour using a 16 bit binary coded number N. */
1212 proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1213 curr_offset += 2;
1214 break;
1215 case 1:
1216 /* 8.13 Coding of Horizontal with Vertical Velocity */
1217 /* Spare bits */
1218 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 2, ENC_BIG_ENDIAN);
1219 /* D: Direction of Vertical Speed */
1220 proto_tree_add_item(tree, hf_gsm_a_d, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1221 /* Bearing is encoded in increments of 1 degree measured clockwise from North using a 9 bit binary coded number N. */
1222 proto_tree_add_bits_item(tree, hf_gsm_a_bearing, tvb, (curr_offset<<3)+7, 9, ENC_BIG_ENDIAN);
1223 curr_offset += 2;
1224 /* Horizontal speed is encoded in increments of 1 kilometre per hour using a 16 bit binary coded number N. */
1225 proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1226 curr_offset += 2;
1227 /* Vertical Speed Octet 5
1228 * Vertical speed is encoded in increments of 1 kilometre per hour using 8 bits giving a number N between 0 and 28-1.
1230 proto_tree_add_item(tree, hf_gsm_a_vertical_speed, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1231 curr_offset++;
1232 break;
1233 case 2:
1234 /* 8.14 Coding of Horizontal Velocity with Uncertainty */
1235 /* Spare bits */
1236 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 3, ENC_BIG_ENDIAN);
1237 /* Bearing is encoded in increments of 1 degree measured clockwise from North using a 9 bit binary coded number N. */
1238 proto_tree_add_bits_item(tree, hf_gsm_a_bearing, tvb, (curr_offset<<3)+7, 9, ENC_BIG_ENDIAN);
1239 curr_offset += 2;
1240 /* Horizontal speed is encoded in increments of 1 kilometre per hour using a 16 bit binary coded number N. */
1241 proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1242 curr_offset += 2;
1243 /* Uncertainty Speed Octet 5
1244 * Uncertainty speed is encoded in increments of 1 kilometre per hour using an 8 bit binary coded number N. The value of
1245 * N gives the uncertainty speed except for N=255 which indicates that the uncertainty is not specified.
1247 velocity_item = proto_tree_add_item_ret_uint(tree, hf_gsm_a_uncertainty_speed, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &uncertainty_speed);
1248 if (uncertainty_speed == 255) {
1249 proto_item_append_text(velocity_item, " (not specified)");
1250 } else {
1251 proto_item_append_text(velocity_item, "km/h");
1253 curr_offset++;
1254 break;
1255 case 3:
1256 /* 8.15 Coding of Horizontal with Vertical Velocity and Uncertainty */
1257 /* Spare bits */
1258 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 2, ENC_BIG_ENDIAN);
1259 /* D: Direction of Vertical Speed */
1260 proto_tree_add_item(tree, hf_gsm_a_d, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1261 /* Bearing is encoded in increments of 1 degree measured clockwise from North using a 9 bit binary coded number N. */
1262 proto_tree_add_bits_item(tree, hf_gsm_a_bearing, tvb, (curr_offset<<3)+7, 9, ENC_BIG_ENDIAN);
1263 curr_offset += 2;
1264 /* Horizontal speed is encoded in increments of 1 kilometre per hour using a 16 bit binary coded number N. */
1265 proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1266 curr_offset += 2;
1267 /* Vertical Speed Octet 5
1268 * Vertical speed is encoded in increments of 1 kilometre per hour using 8 bits giving a number N between 0 and 28-1.
1270 proto_tree_add_item(tree, hf_gsm_a_vertical_speed, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
1271 curr_offset++;
1273 /* Horizontal Uncertainty Speed Octet 6 */
1274 velocity_item = proto_tree_add_item_ret_uint(tree, hf_gsm_a_h_uncertainty_speed, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &uncertainty_speed);
1275 if (uncertainty_speed == 255) {
1276 proto_item_append_text(velocity_item, " (not specified)");
1277 } else {
1278 proto_item_append_text(velocity_item, "km/h");
1280 curr_offset++;
1282 /* Vertical Uncertainty Speed Octet 7 */
1283 velocity_item = proto_tree_add_item_ret_uint(tree, hf_gsm_a_v_uncertainty_speed, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &uncertainty_speed);
1284 if (uncertainty_speed == 255) {
1285 proto_item_append_text(velocity_item, " (not specified)");
1286 } else {
1287 proto_item_append_text(velocity_item, "km/h");
1289 curr_offset++;
1290 break;
1291 default:
1292 break;
1295 return (curr_offset - offset);
1298 const char* get_gsm_a_msg_string(int pdu_type, int idx)
1300 const char *msg_string = NULL;
1302 switch (pdu_type) {
1303 case GSM_A_PDU_TYPE_BSSMAP:
1304 msg_string = val_to_str_ext(idx, &gsm_bssmap_elem_strings_ext, "GSM_A_PDU_TYPE_BSSMAP (%u)");
1305 break;
1306 case GSM_A_PDU_TYPE_DTAP:
1307 msg_string = val_to_str_ext(idx, &gsm_dtap_elem_strings_ext, "GSM_A_PDU_TYPE_DTAP (%u)");
1308 break;
1309 case GSM_A_PDU_TYPE_RP:
1310 msg_string = val_to_str_ext(idx, &gsm_rp_elem_strings_ext, "GSM_A_PDU_TYPE_RP (%u)");
1311 break;
1312 case GSM_A_PDU_TYPE_RR:
1313 msg_string = val_to_str_ext(idx, &gsm_rr_elem_strings_ext, "GSM_A_PDU_TYPE_RR (%u)");
1314 break;
1315 case GSM_A_PDU_TYPE_COMMON:
1316 msg_string = val_to_str_ext(idx, &gsm_common_elem_strings_ext, "GSM_A_PDU_TYPE_COMMON (%u)");
1317 break;
1318 case GSM_A_PDU_TYPE_GM:
1319 msg_string = val_to_str_ext(idx, &gsm_gm_elem_strings_ext, "GSM_A_PDU_TYPE_GM (%u)");
1320 break;
1321 case GSM_A_PDU_TYPE_BSSLAP:
1322 msg_string = val_to_str_ext(idx, &gsm_bsslap_elem_strings_ext, "GSM_A_PDU_TYPE_BSSLAP (%u)");
1323 break;
1324 case GSM_PDU_TYPE_BSSMAP_LE:
1325 msg_string = val_to_str_ext(idx, &gsm_bssmap_le_elem_strings_ext, "GSM_PDU_TYPE_BSSMAP_LE (%u)");
1326 break;
1327 case NAS_PDU_TYPE_COMMON:
1328 msg_string = val_to_str_ext(idx, &nas_eps_common_elem_strings_ext, "NAS_PDU_TYPE_COMMON (%u)");
1329 break;
1330 case NAS_PDU_TYPE_EMM:
1331 msg_string = val_to_str_ext(idx, &nas_emm_elem_strings_ext, "NAS_PDU_TYPE_EMM (%u)");
1332 break;
1333 case NAS_PDU_TYPE_ESM:
1334 msg_string = val_to_str_ext(idx, &nas_esm_elem_strings_ext, "NAS_PDU_TYPE_ESM (%u)");
1335 break;
1336 case SGSAP_PDU_TYPE:
1337 msg_string = val_to_str_ext(idx, &sgsap_elem_strings_ext, "SGSAP_PDU_TYPE (%u)");
1338 break;
1339 case BSSGP_PDU_TYPE:
1340 msg_string = val_to_str_ext(idx, &bssgp_elem_strings_ext, "BSSGP_PDU_TYPE (%u)");
1341 break;
1342 case GMR1_IE_COMMON:
1343 msg_string = val_to_str_ext(idx, &gmr1_ie_common_strings_ext, "GMR1_IE_COMMON (%u)");
1344 break;
1345 case GMR1_IE_RR:
1346 msg_string = val_to_str_ext(idx, &gmr1_ie_rr_strings_ext, "GMR1_IE_RR (%u)");
1347 break;
1348 case NAS_5GS_PDU_TYPE_COMMON:
1349 msg_string = val_to_str_ext(idx, &nas_5gs_common_elem_strings_ext, "NAS_5GS_PDU_TYPE_COMMON (%u)");
1350 break;
1351 case NAS_5GS_PDU_TYPE_MM:
1352 msg_string = val_to_str_ext(idx, &nas_5gs_mm_elem_strings_ext, "NAS_5GS_PDU_TYPE_MM (%u)");
1353 break;
1354 case NAS_5GS_PDU_TYPE_SM:
1355 msg_string = val_to_str_ext(idx, &nas_5gs_sm_elem_strings_ext, "NAS_5GS_PDU_TYPE_SM (%u)");
1356 break;
1357 case NAS_5GS_PDU_TYPE_UPDP:
1358 msg_string = val_to_str_ext(idx, &nas_5gs_updp_elem_strings_ext, "NAS_5GS_PDU_TYPE_UPDP (%u)");
1359 break;
1360 default:
1361 DISSECTOR_ASSERT_NOT_REACHED();
1364 return msg_string;
1367 static int get_hf_elem_id(int pdu_type)
1369 int hf_elem_id = 0;
1371 switch (pdu_type) {
1372 case GSM_A_PDU_TYPE_BSSMAP:
1373 hf_elem_id = hf_gsm_a_bssmap_elem_id;
1374 break;
1375 case GSM_A_PDU_TYPE_DTAP:
1376 hf_elem_id = hf_gsm_a_dtap_elem_id;
1377 break;
1378 case GSM_A_PDU_TYPE_RP:
1379 hf_elem_id = hf_gsm_a_rp_elem_id;
1380 break;
1381 case GSM_A_PDU_TYPE_RR:
1382 hf_elem_id = hf_gsm_a_rr_elem_id;
1383 break;
1384 case GSM_A_PDU_TYPE_COMMON:
1385 hf_elem_id = hf_gsm_a_common_elem_id;
1386 break;
1387 case GSM_A_PDU_TYPE_GM:
1388 hf_elem_id = hf_gsm_a_gm_elem_id;
1389 break;
1390 case GSM_A_PDU_TYPE_BSSLAP:
1391 hf_elem_id = hf_gsm_a_bsslap_elem_id;
1392 break;
1393 case GSM_PDU_TYPE_BSSMAP_LE:
1394 hf_elem_id = hf_gsm_bssmap_le_elem_id;
1395 break;
1396 case NAS_PDU_TYPE_COMMON:
1397 hf_elem_id = hf_nas_eps_common_elem_id;
1398 break;
1399 case NAS_PDU_TYPE_EMM:
1400 hf_elem_id = hf_nas_eps_emm_elem_id;
1401 break;
1402 case NAS_PDU_TYPE_ESM:
1403 hf_elem_id = hf_nas_eps_esm_elem_id;
1404 break;
1405 case SGSAP_PDU_TYPE:
1406 hf_elem_id = hf_sgsap_elem_id;
1407 break;
1408 case BSSGP_PDU_TYPE:
1409 hf_elem_id = hf_bssgp_elem_id;
1410 break;
1411 case GMR1_IE_COMMON:
1412 case GMR1_IE_RR:
1413 hf_elem_id = hf_gmr1_elem_id;
1414 break;
1415 case NAS_5GS_PDU_TYPE_COMMON:
1416 hf_elem_id = hf_nas_5gs_common_elem_id;
1417 break;
1418 case NAS_5GS_PDU_TYPE_MM:
1419 hf_elem_id = hf_nas_5gs_mm_elem_id;
1420 break;
1421 case NAS_5GS_PDU_TYPE_SM:
1422 hf_elem_id = hf_nas_5gs_sm_elem_id;
1423 break;
1424 case NAS_5GS_PDU_TYPE_UPDP:
1425 hf_elem_id = hf_nas_5gs_updp_elem_id;
1426 break;
1427 default:
1428 DISSECTOR_ASSERT_NOT_REACHED();
1431 return hf_elem_id;
1435 * Type Length Value (TLV) element dissector
1437 uint16_t elem_tlv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint8_t iei, int pdu_type, int idx, uint32_t offset, unsigned len _U_, const char *name_add)
1439 uint8_t oct;
1440 uint16_t parm_len;
1441 uint8_t lengt_length = 1;
1442 uint16_t consumed;
1443 uint32_t curr_offset;
1444 proto_tree *subtree;
1445 proto_item *item;
1446 value_string_ext elem_names_ext;
1447 int *elem_ett;
1448 const char *elem_name;
1449 elem_func_hander elem_funcs;
1451 curr_offset = offset;
1452 consumed = 0;
1454 SET_ELEM_VARS(pdu_type, elem_names_ext, elem_ett, elem_funcs, &ei_gsm_a_unknown_pdu_type);
1456 oct = tvb_get_uint8(tvb, curr_offset);
1458 if (oct == iei) {
1459 parm_len = tvb_get_uint8(tvb, curr_offset + 1);
1461 elem_name = try_val_to_str_ext(idx, &elem_names_ext);
1463 /* idx is out of range */
1464 if (elem_name == NULL) {
1465 proto_tree_add_expert_format(tree, pinfo, &ei_gsm_a_unknown_element,
1466 tvb, curr_offset, parm_len + 1 + lengt_length,
1467 "Unknown - aborting dissection%s", (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
1468 return consumed;
1471 subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, parm_len + 1 + lengt_length, elem_ett[idx], &item,
1472 "%s%s", elem_name, (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
1474 proto_tree_add_uint(subtree,
1475 get_hf_elem_id(pdu_type), tvb,
1476 curr_offset, 1, oct);
1478 proto_tree_add_uint(subtree, hf_gsm_a_length, tvb,
1479 curr_offset + 1, lengt_length, parm_len);
1481 if (parm_len > 0)
1483 if (elem_funcs[idx] == NULL)
1485 proto_tree_add_item(subtree, hf_gsm_a_element_value, tvb, curr_offset + 1 + lengt_length, parm_len, ENC_NA);
1486 /* See ASSERT above */
1487 consumed = (uint8_t)parm_len;
1489 else
1491 char *a_add_string;
1493 a_add_string = (char *)wmem_alloc(pinfo->pool, 1024);
1494 a_add_string[0] = '\0';
1495 consumed =
1496 (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 2,
1497 parm_len, a_add_string, 1024);
1499 if (a_add_string[0] != '\0')
1501 proto_item_append_text(item, "%s", a_add_string);
1506 consumed += 1 + lengt_length;
1509 return consumed;
1513 * Type Extendable Length Value (TELV) element dissector
1514 * This is a version where the length field can be one or two octets depending
1515 * if the extension bit is set or not (TS 48.016 p 10.1.2).
1516 * 8 7 6 5 4 3 2 1
1517 * octet 2 0/1 ext length
1518 * octet 2a length
1520 uint16_t elem_telv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint8_t iei, int pdu_type, int idx, uint32_t offset, unsigned len _U_, const char *name_add)
1522 uint8_t oct;
1523 uint16_t parm_len;
1524 uint8_t lengt_length = 1;
1525 uint16_t consumed;
1526 uint32_t curr_offset;
1527 proto_tree *subtree;
1528 proto_item *item;
1529 value_string_ext elem_names_ext;
1530 int *elem_ett;
1531 const char *elem_name;
1532 elem_func_hander elem_funcs;
1534 curr_offset = offset;
1535 consumed = 0;
1537 SET_ELEM_VARS(pdu_type, elem_names_ext, elem_ett, elem_funcs, &ei_gsm_a_unknown_pdu_type);
1539 oct = tvb_get_uint8(tvb, curr_offset);
1541 if (oct == iei) {
1542 parm_len = tvb_get_uint8(tvb, curr_offset + 1);
1543 if ((parm_len&0x80) == 0) {
1544 /* length in 2 octets */
1545 parm_len = tvb_get_ntohs(tvb, curr_offset + 1);
1546 lengt_length = 2;
1547 }else{
1548 parm_len = parm_len & 0x7f;
1551 elem_name = try_val_to_str_ext(idx, &elem_names_ext);
1553 /* idx is out of range */
1554 if (elem_name == NULL) {
1555 proto_tree_add_expert_format(tree, pinfo, &ei_gsm_a_unknown_element,
1556 tvb, curr_offset, parm_len + 1 + lengt_length,
1557 "Unknown - aborting dissection%s", (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
1558 return consumed;
1561 subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, parm_len + 1 + lengt_length, elem_ett[idx], &item,
1562 "%s%s", elem_name, (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
1564 proto_tree_add_uint(subtree,
1565 get_hf_elem_id(pdu_type), tvb,
1566 curr_offset, 1, oct);
1568 proto_tree_add_item(subtree, hf_gsm_a_l_ext, tvb, curr_offset+1, 1, ENC_BIG_ENDIAN);
1570 proto_tree_add_uint(subtree, hf_gsm_a_length, tvb,
1571 curr_offset + 1, lengt_length, parm_len);
1573 if (parm_len > 0)
1575 if (elem_funcs[idx] == NULL)
1577 proto_tree_add_item(subtree, hf_gsm_a_element_value, tvb, curr_offset + 1 + lengt_length, parm_len, ENC_NA);
1578 /* See ASSERT above */
1579 consumed = parm_len;
1581 else
1583 char *a_add_string;
1585 a_add_string = (char*)wmem_alloc(pinfo->pool, 1024);
1586 a_add_string[0] = '\0';
1587 consumed =
1588 (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 1 + lengt_length,
1589 parm_len, a_add_string, 1024);
1591 if (a_add_string[0] != '\0')
1593 proto_item_append_text(item, "%s", a_add_string);
1598 consumed += 1 + lengt_length;
1601 return consumed;
1605 * Type Length Value Extended(TLV-E) element dissector
1606 * TS 24.007
1607 * information elements of format LV-E or TLV-E with value part consisting of zero,
1608 * one or more octets and a maximum of 65535 octets (type 6). This category is used in EPS only.
1610 uint16_t elem_tlv_e(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint8_t iei, int pdu_type, int idx, uint32_t offset, unsigned len _U_, const char *name_add)
1612 uint8_t oct;
1613 uint16_t parm_len;
1614 uint16_t consumed;
1615 uint32_t curr_offset;
1616 proto_tree *subtree;
1617 proto_item *item;
1618 value_string_ext elem_names_ext;
1619 int *elem_ett;
1620 const char *elem_name;
1621 elem_func_hander elem_funcs;
1623 curr_offset = offset;
1624 consumed = 0;
1626 SET_ELEM_VARS(pdu_type, elem_names_ext, elem_ett, elem_funcs, &ei_gsm_a_unknown_pdu_type);
1628 oct = tvb_get_uint8(tvb, curr_offset);
1630 if (oct == iei) {
1631 parm_len = tvb_get_ntohs(tvb, curr_offset + 1);
1633 elem_name = try_val_to_str_ext(idx, &elem_names_ext);
1635 /* idx is out of range */
1636 if (elem_name == NULL) {
1637 proto_tree_add_expert_format(tree, pinfo, &ei_gsm_a_unknown_element,
1638 tvb, curr_offset, parm_len + 1 + 2,
1639 "Unknown - aborting dissection%s", (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
1640 return consumed;
1643 subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, parm_len + 1 + 2, elem_ett[idx], &item,
1644 "%s%s", elem_name, (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
1646 proto_tree_add_uint(subtree,
1647 get_hf_elem_id(pdu_type), tvb,
1648 curr_offset, 1, oct);
1650 proto_tree_add_uint(subtree, hf_gsm_a_length, tvb,
1651 curr_offset + 1, 2, parm_len);
1653 if (parm_len > 0)
1655 if (elem_funcs[idx] == NULL)
1657 proto_tree_add_item(subtree, hf_gsm_a_element_value, tvb, curr_offset + 1 + 2, parm_len, ENC_NA);
1658 /* See ASSERT above */
1659 consumed = parm_len;
1661 else
1663 char *a_add_string;
1665 a_add_string = (char*)wmem_alloc(pinfo->pool, 1024);
1666 a_add_string[0] = '\0';
1667 consumed =
1668 (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 1 + 2,
1669 parm_len, a_add_string, 1024);
1671 if (a_add_string[0] != '\0')
1673 proto_item_append_text(item, "%s", a_add_string);
1678 consumed += 1 + 2;
1681 return consumed;
1685 * Type Value (TV) element dissector
1687 * Length cannot be used in these functions, big problem if a element dissector
1688 * is not defined for these.
1690 uint16_t elem_tv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint8_t iei, int pdu_type, int idx, uint32_t offset, const char *name_add)
1692 uint8_t oct;
1693 uint16_t consumed;
1694 uint32_t curr_offset;
1695 proto_tree *subtree;
1696 proto_item *item;
1697 value_string_ext elem_names_ext;
1698 int *elem_ett;
1699 const char *elem_name;
1700 elem_func_hander elem_funcs;
1702 curr_offset = offset;
1703 consumed = 0;
1705 SET_ELEM_VARS(pdu_type, elem_names_ext, elem_ett, elem_funcs, &ei_gsm_a_unknown_pdu_type);
1707 oct = tvb_get_uint8(tvb, curr_offset);
1709 if (oct == iei)
1711 elem_name = try_val_to_str_ext(idx, &elem_names_ext);
1713 /* idx is out of range */
1714 if (elem_name == NULL) {
1715 proto_tree_add_expert_format(tree, pinfo, &ei_gsm_a_unknown_element,
1716 tvb, curr_offset, -1,
1717 "Unknown - aborting dissection%s", (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
1718 return consumed;
1721 subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, -1, elem_ett[idx], &item,
1722 "%s%s", elem_name, (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
1724 proto_tree_add_uint(subtree,
1725 get_hf_elem_id(pdu_type), tvb,
1726 curr_offset, 1, oct);
1728 if (elem_funcs[idx] == NULL)
1730 /* BAD THING, CANNOT DETERMINE LENGTH */
1731 expert_add_info(pinfo, item, &ei_gsm_a_no_element_dissector);
1733 consumed = 1;
1735 else
1737 char *a_add_string;
1739 a_add_string = (char*)wmem_alloc(pinfo->pool, 1024);
1740 a_add_string[0] = '\0';
1741 consumed = (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 1, -1, a_add_string, 1024);
1743 if (a_add_string[0] != '\0')
1745 proto_item_append_text(item, "%s", a_add_string);
1749 consumed++;
1751 proto_item_set_len(item, consumed);
1754 return consumed;
1758 * Type Value (TV) element dissector
1759 * Where top half nibble is IEI and bottom half nibble is value.
1761 * Length cannot be used in these functions, big problem if a element dissector
1762 * is not defined for these.
1764 uint16_t elem_tv_short(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint8_t iei, int pdu_type, int idx, uint32_t offset, const char *name_add)
1766 uint8_t oct;
1767 uint16_t consumed;
1768 uint32_t curr_offset;
1769 proto_tree *subtree;
1770 proto_item *item;
1771 value_string_ext elem_names_ext;
1772 int *elem_ett;
1773 const char *elem_name;
1774 elem_func_hander elem_funcs;
1776 curr_offset = offset;
1777 consumed = 0;
1779 SET_ELEM_VARS(pdu_type, elem_names_ext, elem_ett, elem_funcs, &ei_gsm_a_unknown_pdu_type);
1781 oct = tvb_get_uint8(tvb, curr_offset);
1783 if ((oct & 0xf0) == (iei & 0xf0))
1785 elem_name = try_val_to_str_ext(idx, &elem_names_ext);
1787 /* idx is out of range */
1788 if (elem_name == NULL) {
1789 proto_tree_add_expert_format(tree, pinfo, &ei_gsm_a_unknown_element,
1790 tvb, curr_offset, -1,
1791 "Unknown - aborting dissection%s", (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
1792 return consumed;
1795 subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, -1, elem_ett[idx], &item,
1796 "%s%s", elem_name, (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
1798 proto_tree_add_uint_format_value(subtree, hf_gsm_a_common_elem_id_f0, tvb, curr_offset, 1, oct, "0x%1x-", oct>>4);
1800 if (elem_funcs[idx] == NULL)
1802 /* BAD THING, CANNOT DETERMINE LENGTH */
1804 expert_add_info(pinfo, item, &ei_gsm_a_no_element_dissector);
1806 consumed++;
1808 else
1810 char *a_add_string;
1812 a_add_string = (char*)wmem_alloc(pinfo->pool, 1024);
1813 a_add_string[0] = '\0';
1814 consumed = (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset, RIGHT_NIBBLE, a_add_string, 1024);
1816 if (a_add_string[0] != '\0')
1818 proto_item_append_text(item, "%s", a_add_string);
1822 proto_item_set_len(item, consumed);
1825 return consumed;
1829 * Type (T) element dissector
1831 uint16_t elem_t(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint8_t iei, int pdu_type, int idx, uint32_t offset, const char *name_add)
1833 uint8_t oct;
1834 uint32_t curr_offset;
1835 uint16_t consumed;
1836 value_string_ext elem_names_ext;
1837 int *elem_ett;
1838 elem_func_hander elem_funcs;
1840 curr_offset = offset;
1841 consumed = 0;
1843 SET_ELEM_VARS(pdu_type, elem_names_ext, elem_ett, elem_funcs, &ei_gsm_a_unknown_pdu_type);
1845 (void)elem_ett;
1846 (void)elem_funcs;
1848 oct = tvb_get_uint8(tvb, curr_offset);
1850 if (oct == iei)
1852 proto_tree_add_uint_format(tree,
1853 get_hf_elem_id(pdu_type), tvb,
1854 curr_offset, 1, oct,
1855 "%s%s",
1856 val_to_str_ext(idx, &elem_names_ext, "Unknown (%u)"),
1857 (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
1859 consumed = 1;
1862 return consumed;
1866 * Length Value (LV) element dissector
1868 uint16_t
1869 elem_lv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int pdu_type, int idx, uint32_t offset, unsigned len _U_, const char *name_add)
1871 uint8_t parm_len;
1872 uint16_t consumed;
1873 uint32_t curr_offset;
1874 proto_tree *subtree;
1875 proto_item *item;
1876 value_string_ext elem_names_ext;
1877 int *elem_ett;
1878 const char *elem_name;
1879 elem_func_hander elem_funcs;
1881 curr_offset = offset;
1882 consumed = 0;
1884 SET_ELEM_VARS(pdu_type, elem_names_ext, elem_ett, elem_funcs, &ei_gsm_a_unknown_pdu_type);
1886 parm_len = tvb_get_uint8(tvb, curr_offset);
1888 elem_name = try_val_to_str_ext(idx, &elem_names_ext);
1890 /* idx is out of range */
1891 if (elem_name == NULL) {
1892 proto_tree_add_expert_format(tree, pinfo, &ei_gsm_a_unknown_element,
1893 tvb, curr_offset, parm_len + 1,
1894 "Unknown - aborting dissection%s", (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
1895 return consumed;
1898 subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, parm_len + 1, elem_ett[idx], &item,
1899 "%s%s", elem_name, (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
1901 proto_tree_add_uint(subtree, hf_gsm_a_length, tvb,
1902 curr_offset, 1, parm_len);
1904 if (parm_len > 0)
1906 if (elem_funcs[idx] == NULL)
1908 proto_tree_add_item(subtree, hf_gsm_a_element_value, tvb, curr_offset + 1, parm_len, ENC_NA);
1910 consumed = parm_len;
1912 else
1914 char *a_add_string;
1916 a_add_string = (char*)wmem_alloc(pinfo->pool, 1024);
1917 a_add_string[0] = '\0';
1918 consumed =
1919 (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 1,
1920 parm_len, a_add_string, 1024);
1922 if (a_add_string[0] != '\0')
1924 proto_item_append_text(item, "%s", a_add_string);
1929 return (consumed + 1);
1933 * Length Value Extended(LV-E) element dissector
1935 uint16_t elem_lv_e(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int pdu_type, int idx, uint32_t offset, unsigned len _U_, const char *name_add)
1937 uint16_t parm_len;
1938 uint16_t consumed;
1939 uint32_t curr_offset;
1940 proto_tree *subtree;
1941 proto_item *item;
1942 value_string_ext elem_names_ext;
1943 int *elem_ett;
1944 const char *elem_name;
1945 elem_func_hander elem_funcs;
1947 curr_offset = offset;
1948 consumed = 0;
1950 SET_ELEM_VARS(pdu_type, elem_names_ext, elem_ett, elem_funcs, &ei_gsm_a_unknown_pdu_type);
1952 parm_len = tvb_get_ntohs(tvb, curr_offset);
1954 elem_name = try_val_to_str_ext(idx, &elem_names_ext);
1956 /* idx is out of range */
1957 if (elem_name == NULL) {
1958 proto_tree_add_expert_format(tree, pinfo, &ei_gsm_a_unknown_element,
1959 tvb, curr_offset, parm_len + 2,
1960 "Unknown - aborting dissection%s", (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
1961 return consumed;
1964 subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, parm_len + 2, elem_ett[idx], &item,
1965 "%s%s", elem_name, (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
1967 proto_tree_add_uint(subtree, hf_gsm_a_length, tvb,
1968 curr_offset, 2, parm_len);
1970 if (parm_len > 0)
1972 if (elem_funcs[idx] == NULL)
1974 proto_tree_add_item(subtree, hf_gsm_a_element_value, tvb, curr_offset + 2, parm_len, ENC_NA);
1976 consumed = parm_len;
1978 else
1980 char *a_add_string;
1982 a_add_string = (char*)wmem_alloc(pinfo->pool, 1024);
1983 a_add_string[0] = '\0';
1984 consumed =
1985 (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 2,
1986 parm_len, a_add_string, 1024);
1988 if (a_add_string[0] != '\0')
1990 proto_item_append_text(item, "%s", a_add_string);
1995 return (consumed + 2);
1998 * Value (V) element dissector
2000 * Length cannot be used in these functions, big problem if a element dissector
2001 * is not defined for these.
2003 uint16_t elem_v(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int pdu_type, int idx, uint32_t offset, const char *name_add)
2005 uint16_t consumed;
2006 uint32_t curr_offset;
2007 proto_tree *subtree;
2008 proto_item *item;
2009 value_string_ext elem_names_ext;
2010 int *elem_ett;
2011 const char *elem_name;
2012 elem_func_hander elem_funcs;
2014 curr_offset = offset;
2015 consumed = 0;
2017 SET_ELEM_VARS(pdu_type, elem_names_ext, elem_ett, elem_funcs, &ei_gsm_a_unknown_pdu_type);
2019 elem_name = try_val_to_str_ext(idx, &elem_names_ext);
2021 if (elem_name == NULL || elem_funcs[idx] == NULL)
2023 /* BAD THING, CANNOT DETERMINE LENGTH */
2024 proto_tree_add_expert(tree, pinfo, &ei_gsm_a_no_element_dissector, tvb, curr_offset, 1);
2026 consumed = 1;
2028 else
2030 char *a_add_string;
2032 subtree =
2033 proto_tree_add_subtree_format(tree,
2034 tvb, curr_offset, 0,
2035 elem_ett[idx], &item, "%s%s", elem_name,
2036 (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
2038 a_add_string= (char*)wmem_alloc(pinfo->pool, 1024);
2039 a_add_string[0] = '\0';
2040 consumed = (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset, -1, a_add_string, 1024);
2041 if (a_add_string[0] != '\0')
2043 proto_item_append_text(item, "%s", a_add_string);
2045 proto_item_set_len(item, consumed);
2048 return (consumed);
2052 * Short Value (V_SHORT) element dissector
2054 * nibble is used in this function to indicate right or left nibble of the octet
2055 * This is expected to be used right nibble first, as the tables of 24.008.
2058 uint16_t elem_v_short(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int pdu_type, int idx, uint32_t offset, uint32_t nibble)
2060 uint16_t consumed = 1;
2061 uint32_t curr_offset;
2062 proto_tree *subtree;
2063 proto_item *item;
2064 value_string_ext elem_names_ext;
2065 int *elem_ett;
2066 elem_fcn *elem_funcs;
2067 char *a_add_string;
2068 const char *elem_name;
2070 curr_offset = offset;
2072 SET_ELEM_VARS(pdu_type, elem_names_ext, elem_ett, elem_funcs, &ei_gsm_a_unknown_pdu_type);
2074 elem_name = try_val_to_str_ext(idx, &elem_names_ext);
2076 /* idx is out of range */
2077 if (elem_name == NULL) {
2078 proto_tree_add_expert(tree, pinfo, &ei_gsm_a_unknown_element,
2079 tvb, curr_offset, 0);
2080 return consumed;
2083 subtree = proto_tree_add_subtree(tree, tvb, curr_offset, 0, elem_ett[idx], &item, elem_name);
2085 a_add_string= (char*)wmem_alloc(pinfo->pool, 1024);
2086 a_add_string[0] = '\0';
2088 if (elem_funcs[idx] == NULL)
2090 /* NOT NECESSARILY A BAD THING - LENGTH IS HALF OCTET */
2091 (void)de_spare_nibble(tvb, subtree, pinfo, curr_offset, nibble, a_add_string, 1024);
2093 else
2095 (void)(*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset, nibble, a_add_string, 1024);
2098 if (a_add_string[0] != '\0')
2100 proto_item_append_text(item, "%s", a_add_string);
2102 proto_item_set_len(item, consumed);
2104 return consumed;
2108 static dgt_set_t Dgt1_9_bcd = {
2110 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2111 '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?','?'
2115 /* FUNCTIONS */
2117 /* 3GPP TS 24.008
2118 * [3] 10.5.1.1 Cell Identity
2120 uint16_t
2121 de_cell_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len)
2123 uint32_t curr_offset;
2125 curr_offset = offset;
2127 curr_offset +=
2128 /* 0x02 CI */
2129 be_cell_id_aux(tvb, tree, pinfo, offset, len, add_string, string_len, 0x02);
2131 /* no length check possible */
2133 return (curr_offset - offset);
2136 * 10.5.1.2 Ciphering Key Sequence Number
2141 * Key sequence (octet 1)
2142 * Bits
2143 * 3 2 1
2144 * 0 0 0
2145 * through
2146 * 1 1 0
2147 * Possible values for the ciphering key sequence number
2148 * 1 1 1 No key is available (MS to network);Reserved (network to MS)
2151 static const value_string gsm_a_key_seq_vals[] = {
2152 { 0, "Ciphering key sequence number"},
2153 { 1, "Ciphering key sequence number"},
2154 { 2, "Ciphering key sequence number"},
2155 { 3, "Ciphering key sequence number"},
2156 { 4, "Ciphering key sequence number"},
2157 { 5, "Ciphering key sequence number"},
2158 { 6, "Ciphering key sequence number"},
2159 { 7, "No key is available (MS to network)"},
2160 { 0, NULL }
2163 static uint16_t
2164 de_ciph_key_seq_num( tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
2166 uint32_t curr_offset, bit_offset;
2168 curr_offset = offset;
2170 if (RIGHT_NIBBLE == len)
2171 bit_offset = 4;
2172 else
2173 bit_offset = 0;
2175 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+bit_offset, 1, ENC_BIG_ENDIAN);
2176 proto_tree_add_bits_item(tree, hf_gsm_a_key_seq, tvb, (curr_offset<<3)+bit_offset+1, 3, ENC_BIG_ENDIAN);
2177 curr_offset++;
2179 return (curr_offset - offset);
2184 * [3] 10.5.1.3
2187 uint16_t
2188 de_lai(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
2190 uint16_t value;
2191 uint32_t curr_offset;
2192 proto_tree *subtree;
2193 proto_item *item;
2194 char *mcc_mnc_str;
2196 curr_offset = offset;
2198 subtree = proto_tree_add_subtree(tree,
2199 tvb, curr_offset, 5, ett_gsm_common_elem[DE_LAI], &item,
2200 val_to_str_ext_const(DE_LAI, &gsm_common_elem_strings_ext, ""));
2202 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, subtree, curr_offset, E212_LAI, true);
2204 curr_offset += 3;
2206 value = tvb_get_ntohs(tvb, curr_offset);
2208 proto_tree_add_item(subtree, hf_gsm_a_lac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
2210 proto_item_append_text(item, " - %s, LAC %u", mcc_mnc_str, value);
2212 curr_offset += 2;
2214 /* no length check possible */
2216 return (curr_offset - offset);
2220 * [3] 10.5.1.4 Mobile Identity
2221 * 3GPP TS 24.008 version 7.8.0 Release 7
2224 uint16_t
2225 de_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len)
2227 uint8_t oct;
2228 uint32_t curr_offset;
2229 uint32_t value;
2230 bool odd;
2231 const char *digit_str;
2232 proto_item* ti;
2234 curr_offset = offset;
2236 oct = tvb_get_uint8(tvb, curr_offset);
2238 switch (oct & 0x07)
2240 case 0: /* No Identity */
2241 proto_tree_add_item(tree, hf_gsm_a_unused, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2242 proto_tree_add_item(tree, hf_gsm_a_odd_even_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2243 proto_tree_add_item(tree, hf_gsm_a_mobile_identity_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2245 if (add_string)
2246 snprintf(add_string, string_len, " - No Identity Code");
2248 curr_offset++;
2250 if (len != 1 && len != 3)
2252 expert_add_info(pinfo, tree, &ei_gsm_a_format_not_supported);
2255 curr_offset += len - 1;
2256 break;
2258 case 3: /* IMEISV */
2259 /* FALLTHRU */
2261 case 1: /* IMSI */
2262 odd = oct & 0x08;
2263 proto_tree_add_item(tree, hf_gsm_a_id_dig_1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2264 proto_tree_add_item(tree, hf_gsm_a_odd_even_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2265 proto_tree_add_item(tree, hf_gsm_a_mobile_identity_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2267 if (curr_offset - offset >= len) /* Sanity check */
2268 return (curr_offset - offset);
2270 if((oct & 0x07) == 3){
2271 /* imeisv */
2272 digit_str = tvb_bcd_dig_to_str(pinfo->pool, tvb ,curr_offset , len - (curr_offset - offset), NULL, true);
2273 proto_tree_add_string_format(tree,
2274 hf_gsm_a_imeisv,
2275 tvb, curr_offset, len - (curr_offset - offset),
2276 digit_str,
2277 "BCD Digits: %s",
2278 digit_str);
2279 }else{
2280 digit_str = dissect_e212_imsi(tvb, pinfo, tree, curr_offset, len - (curr_offset - offset), true);
2283 if (sccp_assoc && ! sccp_assoc->calling_party) {
2284 sccp_assoc->calling_party = wmem_strdup_printf(wmem_file_scope(),
2285 ((oct & 0x07) == 3) ? "IMEISV: %s" : "IMSI: %s",
2286 digit_str );
2289 if (add_string)
2290 snprintf(add_string, string_len, " - %s (%s)",
2291 ((oct & 0x07) == 3) ? "IMEISV" : "IMSI",
2292 digit_str);
2294 curr_offset += len - (curr_offset - offset);
2296 if (!odd)
2298 proto_tree_add_item(tree, hf_gsm_a_filler, tvb, curr_offset - 1, 1, ENC_NA);
2300 break;
2302 case 2: /* IMEI */
2303 proto_tree_add_uint_format_value(tree, hf_gsm_a_identity_digit1, tvb, curr_offset, 1, oct, "%c", Dgt1_9_bcd.out[(oct & 0xf0) >> 4]);
2305 proto_tree_add_item(tree, hf_gsm_a_odd_even_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2307 proto_tree_add_item(tree, hf_gsm_a_mobile_identity_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2309 if (curr_offset - offset >= len) /* Sanity check */
2310 return (curr_offset - offset);
2312 digit_str = tvb_bcd_dig_to_str(pinfo->pool, tvb, curr_offset, len - (curr_offset - offset), NULL, true);
2314 proto_tree_add_string_format(tree,
2315 hf_gsm_a_imei,
2316 tvb, curr_offset, len - (curr_offset - offset),
2317 digit_str,
2318 "BCD Digits: %s",
2319 digit_str);
2321 if (add_string)
2322 snprintf(add_string, string_len, " - IMEI (%s)", digit_str);
2324 curr_offset += len - (curr_offset - offset);
2325 break;
2327 case 4: /* TMSI/P-TMSI/M-TMSI */
2328 proto_tree_add_item(tree, hf_gsm_a_unused, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2329 proto_tree_add_item(tree, hf_gsm_a_odd_even_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2330 proto_tree_add_item(tree, hf_gsm_a_mobile_identity_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2331 curr_offset++;
2333 proto_tree_add_item_ret_uint(tree, hf_3gpp_tmsi, tvb, curr_offset, 4, ENC_BIG_ENDIAN, &value);
2335 if (add_string)
2336 snprintf(add_string, string_len, " - TMSI/P-TMSI (0x%04x)", value);
2338 curr_offset += 4;
2339 break;
2341 case 5: /* TMGI and optional MBMS Session Identity */
2342 /* Spare bits (octet 3) Bits 8-7 */
2343 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 2, ENC_BIG_ENDIAN);
2344 /* MBMS Session Identity indication (octet 3) Bit 6 */
2345 proto_tree_add_item(tree, hf_gsm_a_mbs_ses_id_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2346 /* MCC/MNC indication (octet 3) Bit 5 */
2347 proto_tree_add_item(tree, hf_gsm_a_tmgi_mcc_mnc_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2348 /* Odd/even indication (octet 3) Bit 4 */
2349 proto_tree_add_item(tree, hf_gsm_a_odd_even_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2350 /* Type of identity (octet 3) Bits 3-1 */
2351 proto_tree_add_item(tree, hf_gsm_a_mobile_identity_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2352 curr_offset++;
2353 /* MBMS Service ID (octet 4, 5 and 6) */
2354 proto_tree_add_item(tree, hf_gsm_a_mbs_service_id, tvb, curr_offset, 3, ENC_BIG_ENDIAN);
2355 curr_offset += 3;
2356 if ((oct&0x10) == 0x10) {
2357 /* MCC/MNC*/
2358 /* MCC, Mobile country code (octet 6a, octet 6b bits 1 to 4)*/
2359 /* MNC, Mobile network code (octet 6b bits 5 to 8, octet 6c) */
2360 curr_offset = dissect_e212_mcc_mnc(tvb, pinfo, tree, curr_offset, E212_NONE, true);
2362 if ((oct&0x20) == 0x20) {
2363 /* MBMS Session Identity (octet 7)
2364 * The MBMS Session Identity field is encoded as the value part
2365 * of the MBMS Session Identity IE as specified in 3GPP TS 48.018 [86].
2367 proto_tree_add_item(tree, hf_gsm_a_mbs_session_id, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2368 curr_offset++;
2370 break;
2372 default: /* Reserved */
2373 proto_tree_add_item(tree, hf_gsm_a_odd_even_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2374 ti = proto_tree_add_item(tree, hf_gsm_a_mobile_identity_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2375 expert_add_info_format(pinfo, ti, &ei_gsm_a_mobile_identity_type, "Unknown format %u", (oct & 0x07));
2377 if (add_string)
2378 snprintf(add_string, string_len, " - Format Unknown");
2380 curr_offset += len;
2381 break;
2384 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_extraneous_data);
2386 return (curr_offset - offset);
2390 * [3] 10.5.1.5
2392 uint16_t
2393 de_ms_cm_1(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
2395 uint32_t curr_offset;
2396 proto_tree *subtree;
2398 curr_offset = offset;
2400 subtree =
2401 proto_tree_add_subtree(tree,
2402 tvb, curr_offset, 1, ett_gsm_common_elem[DE_MS_CM_1], NULL,
2403 val_to_str_ext_const(DE_MS_CM_1, &gsm_common_elem_strings_ext, ""));
2405 proto_tree_add_item(subtree, hf_gsm_a_b8spare, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2407 proto_tree_add_item(subtree, hf_gsm_a_MSC_rev, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2409 proto_tree_add_item(subtree, hf_gsm_a_ES_IND, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2411 proto_tree_add_item(subtree, hf_gsm_a_A5_1_algorithm_sup, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2413 proto_tree_add_item(subtree, hf_gsm_a_RF_power_capability, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2415 curr_offset++;
2417 /* no length check possible */
2419 return (curr_offset - offset);
2423 * [3] 10.5.1.6 Mobile Station Classmark 2
2424 * 3GPP TS 24.008 version 7.8.0 Release 7
2426 uint16_t
2427 de_ms_cm_2(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
2429 uint32_t curr_offset;
2430 curr_offset = offset;
2432 proto_tree_add_item(tree, hf_gsm_a_b8spare, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2434 proto_tree_add_item(tree, hf_gsm_a_MSC_rev, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2436 proto_tree_add_item(tree, hf_gsm_a_ES_IND, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2438 proto_tree_add_item(tree, hf_gsm_a_A5_1_algorithm_sup, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2440 proto_tree_add_item(tree, hf_gsm_a_RF_power_capability, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2442 curr_offset++;
2444 NO_MORE_DATA_CHECK(len);
2446 proto_tree_add_item(tree, hf_gsm_a_b8spare, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2448 proto_tree_add_item(tree, hf_gsm_a_ps_sup_cap, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2450 proto_tree_add_item(tree, hf_gsm_a_SS_screening_indicator, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2452 /* SM capability (MT SMS pt to pt capability) (octet 4)*/
2453 proto_tree_add_item(tree, hf_gsm_a_SM_capability, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2454 /* VBS notification reception (octet 4) */
2455 proto_tree_add_item(tree, hf_gsm_a_VBS_notification_rec, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2456 /*VGCS notification reception (octet 4)*/
2457 proto_tree_add_item(tree, hf_gsm_a_VGCS_notification_rec, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2458 /* FC Frequency Capability (octet 4 ) */
2459 proto_tree_add_item(tree, hf_gsm_a_FC_frequency_cap, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2461 curr_offset++;
2463 NO_MORE_DATA_CHECK(len);
2465 /* CM3 (octet 5, bit 8) */
2466 proto_tree_add_item(tree, hf_gsm_a_CM3, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2467 /* spare bit 7 */
2468 proto_tree_add_item(tree, hf_gsm_a_b7spare, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2469 /* LCS VA capability (LCS value added location request notification capability) (octet 5,bit 6) */
2470 proto_tree_add_item(tree, hf_gsm_a_LCS_VA_cap, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2471 /* UCS2 treatment (octet 5, bit 5) */
2472 proto_tree_add_item(tree, hf_gsm_a_UCS2_treatment, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2473 /* SoLSA (octet 5, bit 4) */
2474 proto_tree_add_item(tree, hf_gsm_a_SoLSA, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2475 /* CMSP: CM Service Prompt (octet 5, bit 3) */
2476 proto_tree_add_item(tree, hf_gsm_a_CMSP, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2477 /* A5/3 algorithm supported (octet 5, bit 2) */
2478 proto_tree_add_item(tree, hf_gsm_a_A5_3_algorithm_sup, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2479 /* A5/2 algorithm supported (octet 5, bit 1) */
2480 proto_tree_add_item(tree, hf_gsm_a_A5_2_algorithm_sup, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
2482 curr_offset++;
2484 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_extraneous_data);
2486 return (curr_offset - offset);
2490 * [3] 10.5.1.7 Mobile Station Classmark 3
2491 * 3GPP TS 24.008 version 12.10.0 Release 12
2493 #define AVAILABLE_BITS_CHECK(n) \
2494 bits_left = ((len + offset) << 3) - bit_offset; \
2495 if (bits_left < (n)) { \
2496 if (bits_left > 0) \
2497 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, bit_offset, bits_left, ENC_BIG_ENDIAN); \
2498 else if (bits_left < 0) \
2499 proto_tree_add_expert(tree, pinfo, &ei_gsm_a_ie_length_too_short, tvb, offset, len); \
2500 return len; \
2503 uint16_t
2504 de_ms_cm_3(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
2506 uint32_t curr_offset;
2507 uint32_t bit_offset; /* Offset in bits */
2508 uint8_t length;
2509 proto_tree *subtree;
2510 proto_item *item;
2511 int32_t bits_left;
2512 uint32_t target_bit_offset, old_bit_offset;
2513 uint64_t multi_bnd_sup_fields, rsupport, multislotCapability;
2514 uint64_t msMeasurementCapability, msPosMethodCapPresent;
2515 uint64_t ecsdMultiSlotCapability, eightPskStructPresent, eightPskStructRfPowerCapPresent;
2516 uint64_t gsm400BandInfoPresent, gsm850AssocRadioCapabilityPresent;
2517 uint64_t gsm1900AssocRadioCapabilityPresent, dtmEGprsMultiSlotInfoPresent;
2518 uint64_t dtmEgprsMultiSlotClassPresent, singleBandSupport;
2519 uint64_t gsm750AssocRadioCapabilityPresent, extDtmEGprsMultiSlotInfoPresent;
2520 uint64_t highMultislotCapPresent, geranIuModeSupport;
2521 uint64_t tGsm400BandInfoPresent, tGsm900AssocRadioCapabilityPresent, dtmEGprsHighMultiSlotInfoPresent;
2522 uint64_t dtmEgprsHighMultiSlotClassPresent, gsm710AssocRadioCapabilityPresent;
2523 uint64_t tGsm810AssocRadioCapabilityPresent;
2525 curr_offset = offset;
2527 bit_offset = curr_offset << 3;
2529 /* Spare bit */
2530 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2531 bit_offset++;
2533 /* Multiband supported field
2534 * { < Multiband supported : { 000 } >
2535 * < A5 bits >
2536 * | < Multiband supported : { 101 | 110 } >
2537 * < A5 bits >
2538 * < Associated Radio Capability 2 : bit(4) >
2539 * < Associated Radio Capability 1 : bit(4) >
2540 * | < Multiband supported : { 001 | 010 | 100 } >
2541 * < A5 bits >
2542 * < spare bit >(4)
2543 * < Associated Radio Capability 1 : bit(4) > }
2546 item = proto_tree_add_bits_ret_val(tree, hf_gsm_a_multi_bnd_sup_fields, tvb, bit_offset, 3, &multi_bnd_sup_fields, ENC_BIG_ENDIAN);
2547 subtree = proto_item_add_subtree(item, ett_gsm_common_elem[DE_MS_CM_3]);
2549 proto_tree_add_bits_item(subtree, hf_gsm_a_gsm1800_supported, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2550 bit_offset++;
2552 proto_tree_add_bits_item(subtree, hf_gsm_a_egsm_supported, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2553 bit_offset++;
2555 proto_tree_add_bits_item(subtree, hf_gsm_a_pgsm_supported, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2556 bit_offset++;
2558 item = proto_tree_add_bits_item(tree, hf_gsm_a_cm3_A5_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2559 subtree = proto_item_add_subtree(item, ett_gsm_common_elem[DE_MS_CM_3]);
2561 /* < A5 bits > */
2562 proto_tree_add_bits_item(subtree, hf_gsm_a_A5_7_algorithm_sup, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2563 bit_offset++;
2564 proto_tree_add_bits_item(subtree, hf_gsm_a_A5_6_algorithm_sup, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2565 bit_offset++;
2566 proto_tree_add_bits_item(subtree, hf_gsm_a_A5_5_algorithm_sup, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2567 bit_offset++;
2568 proto_tree_add_bits_item(subtree, hf_gsm_a_A5_4_algorithm_sup, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2569 bit_offset++;
2571 switch (multi_bnd_sup_fields) {
2572 case 0:
2573 /* A5 bits dissected is done */
2574 break;
2576 * | < Multiband supported : { 001 | 010 | 100 } >
2578 case 1:
2579 case 2:
2580 case 4:
2581 /* < spare bit >(4) */
2582 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2583 bit_offset += 4;
2584 /* < Associated Radio Capability 1 : bit(4) > */
2585 proto_tree_add_bits_item(tree, hf_gsm_a_ass_radio_cap1, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2586 bit_offset += 4;
2587 break;
2588 /* < Multiband supported : { 101 | 110 } > */
2589 case 5:
2590 /* fall trough */
2591 case 6:
2592 /* < Associated Radio Capability 2 : bit(4) > */
2593 proto_tree_add_bits_item(tree, hf_gsm_a_ass_radio_cap2, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2594 bit_offset += 4;
2595 /* < Associated Radio Capability 1 : bit(4) > */
2596 proto_tree_add_bits_item(tree, hf_gsm_a_ass_radio_cap1, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2597 bit_offset += 4;
2598 break;
2599 default:
2600 break;
2602 /* Extract R Support */
2603 AVAILABLE_BITS_CHECK(1);
2604 proto_tree_add_bits_ret_val(tree, hf_gsm_a_rsupport, tvb, bit_offset, 1, &rsupport, ENC_BIG_ENDIAN);
2605 bit_offset++;
2607 if (rsupport == 1)
2610 * { 0 | 1 < R Support > }
2611 * Extract R Capabilities
2613 proto_tree_add_bits_item(tree, hf_gsm_a_r_capabilities, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2614 bit_offset = bit_offset + 3;
2618 * { 0 | 1 < HSCSD Multi Slot Capability > }
2619 * Extract Multislot capability
2621 AVAILABLE_BITS_CHECK(1);
2622 proto_tree_add_bits_ret_val(tree, hf_gsm_a_multislot_capabilities, tvb, bit_offset, 1, &multislotCapability, ENC_BIG_ENDIAN);
2623 bit_offset++;
2625 if (multislotCapability == 1)
2627 /* Extract Multislot Class */
2628 proto_tree_add_bits_item(tree, hf_gsm_a_multislot_class, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2629 bit_offset = bit_offset + 5;
2632 /* < UCS2 treatment: bit > */
2633 AVAILABLE_BITS_CHECK(1);
2634 proto_tree_add_bits_item(tree, hf_gsm_a_ucs2_treatment, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2635 bit_offset = bit_offset + 1;
2637 /* < Extended Measurement Capability : bit > */
2638 AVAILABLE_BITS_CHECK(1);
2639 proto_tree_add_bits_item(tree, hf_gsm_a_extended_measurement_cap, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2640 bit_offset = bit_offset + 1;
2642 /* { 0 | 1 < MS measurement capability > }
2643 * Extract MS Measurement capability
2645 AVAILABLE_BITS_CHECK(1);
2646 proto_tree_add_bits_ret_val(tree, hf_gsm_a_ms_measurement_capability, tvb, bit_offset, 1, &msMeasurementCapability, ENC_BIG_ENDIAN);
2647 bit_offset = bit_offset + 1;
2649 if (msMeasurementCapability == 1)
2651 /* Extract SMS Value n/4 */
2652 proto_tree_add_bits_item(tree, hf_gsm_a_sms_value, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2653 bit_offset = bit_offset + 4;
2655 /* Extract SM Value n/4 */
2656 proto_tree_add_bits_item(tree, hf_gsm_a_sm_value, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2657 bit_offset = bit_offset + 4;
2660 /* { 0 | 1 < MS Positioning Method Capability > }
2661 * Extract MS Positioning Method Capability
2663 AVAILABLE_BITS_CHECK(1);
2664 proto_tree_add_bits_ret_val(tree, hf_gsm_a_ms_pos_method_cap_present, tvb, bit_offset, 1, &msPosMethodCapPresent, ENC_BIG_ENDIAN);
2665 bit_offset = bit_offset + 1;
2667 if (msPosMethodCapPresent == 1)
2669 /* Extract MS Positioning Method */
2670 item = proto_tree_add_bits_item(tree, hf_gsm_a_ms_pos_method, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2671 subtree = proto_item_add_subtree(item, ett_gsm_common_elem[DE_MS_CM_3]);
2673 proto_tree_add_bits_item(subtree, hf_gsm_a_ms_assisted_e_otd, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2674 bit_offset++;
2676 proto_tree_add_bits_item(subtree, hf_gsm_a_ms_based_e_otd, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2677 bit_offset++;
2679 proto_tree_add_bits_item(subtree, hf_gsm_a_ms_assisted_gps, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2680 bit_offset++;
2682 proto_tree_add_bits_item(subtree, hf_gsm_a_ms_based_gps, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2683 bit_offset++;
2685 proto_tree_add_bits_item(subtree, hf_gsm_a_ms_conventional_gps, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2686 bit_offset++;
2689 /* { 0 | 1 < ECSD Multi Slot Capability > }
2690 * Extract ECSD Multi Slot Capability
2692 AVAILABLE_BITS_CHECK(1);
2693 proto_tree_add_bits_ret_val(tree, hf_gsm_a_ecsd_multi_slot_capability, tvb, bit_offset, 1, &ecsdMultiSlotCapability, ENC_BIG_ENDIAN);
2694 bit_offset = bit_offset + 1;
2696 if (ecsdMultiSlotCapability == 1)
2698 /* Extract ECSD Multi Slot Class */
2699 proto_tree_add_bits_item(tree, hf_gsm_a_ecsd_multi_slot_class, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2700 bit_offset = bit_offset + 5;
2703 /* { 0 | 1 < 8-PSK Struct > }
2704 * Extract 8-PSK struct presence
2706 AVAILABLE_BITS_CHECK(1);
2707 proto_tree_add_bits_ret_val(tree, hf_gsm_a_8_psk_struct_present, tvb, bit_offset, 1, &eightPskStructPresent, ENC_BIG_ENDIAN);
2708 bit_offset = bit_offset + 1;
2710 if (eightPskStructPresent == 1)
2712 /* At lesst Modulation Capability and cap1,cap2 present indicators are present */
2713 uint8_t psk_struct_len = 3;
2714 uint32_t tmp_bit_offset = bit_offset;
2716 /* Check if Power Capability 1 is present */
2717 tmp_bit_offset++;
2718 if (tvb_get_bits8(tvb,tmp_bit_offset,1) == 1){
2719 psk_struct_len += 2;
2720 tmp_bit_offset += 2;
2722 tmp_bit_offset++;
2723 /* Check if Power Capability 2 is present */
2724 if (tvb_get_bits8(tvb,tmp_bit_offset,1) == 1){
2725 psk_struct_len += 2;
2727 /* Extract 8-PSK struct */
2728 item = proto_tree_add_bits_item(tree, hf_gsm_a_8_psk_struct, tvb, bit_offset, psk_struct_len, ENC_BIG_ENDIAN);
2729 subtree = proto_item_add_subtree(item, ett_gsm_common_elem[DE_MS_CM_3]);
2730 old_bit_offset = bit_offset;
2732 /* Extract Modulation Capability */
2733 proto_tree_add_bits_item(subtree, hf_gsm_a_modulation_capability, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2734 bit_offset = bit_offset + 1;
2736 /* Extract 8_PSK RF Power Capability 1 */
2737 proto_tree_add_bits_ret_val(subtree, hf_gsm_a_8_psk_rf_power_capability_1_present, tvb, bit_offset,
2738 1, &eightPskStructRfPowerCapPresent, ENC_BIG_ENDIAN);
2739 bit_offset = bit_offset + 1;
2740 if (eightPskStructRfPowerCapPresent == 1)
2742 proto_tree_add_bits_item(subtree, hf_gsm_a_8_psk_rf_power_capability_1, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2743 bit_offset = bit_offset + 2;
2746 /* Extract 8_PSK RF Power Capability 2 */
2747 proto_tree_add_bits_ret_val(subtree, hf_gsm_a_8_psk_rf_power_capability_2_present, tvb, bit_offset,
2748 1, &eightPskStructRfPowerCapPresent, ENC_BIG_ENDIAN);
2749 bit_offset = bit_offset + 1;
2750 if (eightPskStructRfPowerCapPresent == 1)
2752 proto_tree_add_bits_item(subtree, hf_gsm_a_8_psk_rf_power_capability_2, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2753 bit_offset = bit_offset + 2;
2755 length = (uint8_t)((bit_offset - old_bit_offset)>>3);
2756 if ((bit_offset - old_bit_offset) & 0x07)
2757 length++;
2758 proto_item_set_len(item, length);
2761 /* { 0 | 1 < GSM 400 Bands Supported : { 01 | 10 | 11 } >
2762 * < GSM 400 Associated Radio Capability: bit(4) > }
2763 * Extract GSM 400 Band Information presence
2765 AVAILABLE_BITS_CHECK(1);
2766 proto_tree_add_bits_ret_val(tree, hf_gsm_a_gsm_400_band_info_present, tvb, bit_offset, 1, &gsm400BandInfoPresent, ENC_BIG_ENDIAN);
2767 bit_offset = bit_offset + 1;
2769 if (gsm400BandInfoPresent == 1)
2771 /* Extract GSM 400 Bands Supported */
2772 proto_tree_add_bits_item(tree, hf_gsm_a_gsm_400_bands_supported, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2773 bit_offset = bit_offset + 2;
2775 /* Extract GSM 400 Associated Radio Capability */
2776 proto_tree_add_bits_item(tree, hf_gsm_a_gsm_400_assoc_radio_cap, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2777 bit_offset = bit_offset + 4;
2780 /* { 0 | 1 <GSM 850 Associated Radio Capability : bit(4) > }
2781 * Extract GSM 850 Associated Radio Capability presence
2783 AVAILABLE_BITS_CHECK(1);
2784 proto_tree_add_bits_ret_val(tree, hf_gsm_a_gsm_850_assoc_radio_cap_present, tvb, bit_offset, 1, &gsm850AssocRadioCapabilityPresent, ENC_BIG_ENDIAN);
2785 bit_offset = bit_offset + 1;
2787 if (gsm850AssocRadioCapabilityPresent == 1)
2789 /* Extract GSM 850 Associated Radio Capability */
2790 proto_tree_add_bits_item(tree, hf_gsm_a_gsm_850_assoc_radio_cap, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2791 bit_offset = bit_offset + 4;
2794 /* { 0 | 1 <GSM 1900 Associated Radio Capability : bit(4) > }
2795 * Extract GSM 1900 Associated Radio Capability presence
2797 AVAILABLE_BITS_CHECK(1);
2798 proto_tree_add_bits_ret_val(tree, hf_gsm_a_gsm_1900_assoc_radio_cap_present, tvb, bit_offset, 1, &gsm1900AssocRadioCapabilityPresent, ENC_BIG_ENDIAN);
2799 bit_offset = bit_offset + 1;
2801 if (gsm1900AssocRadioCapabilityPresent == 1)
2803 /* Extract GSM 1900 Associated Radio Capability */
2804 proto_tree_add_bits_item(tree, hf_gsm_a_gsm_1900_assoc_radio_cap, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2805 bit_offset = bit_offset + 4;
2808 /* < UMTS FDD Radio Access Technology Capability : bit >
2809 * Extract UMTS FDD Radio Access Technology Capability
2811 AVAILABLE_BITS_CHECK(1);
2812 proto_tree_add_bits_item(tree, hf_gsm_a_umts_fdd_rat_cap, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2813 bit_offset = bit_offset + 1;
2815 /* < UMTS 3.84 Mcps TDD Radio Access Technology Capability : bit >
2816 * Extract UMTS 3.84 Mcps TDD Radio Access Technology Capability
2818 AVAILABLE_BITS_CHECK(1);
2819 proto_tree_add_bits_item(tree, hf_gsm_a_umts_384_mcps_tdd_rat_cap, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2820 bit_offset = bit_offset + 1;
2822 /* < CDMA 2000 Radio Access Technology Capability : bit >
2823 * Extract CDMA 2000 Radio Access Technology Capability
2825 AVAILABLE_BITS_CHECK(1);
2826 proto_tree_add_bits_item(tree, hf_gsm_a_cdma_2000_rat_cap, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2827 bit_offset = bit_offset + 1;
2829 /* { 0 | 1 < DTM GPRS Multi Slot Class : bit(2) >
2830 * < Single Slot DTM : bit >
2831 * {0 | 1< DTM EGPRS Multi Slot Class : bit(2) > } }
2832 * Extract DTM E/GPRS Information presence
2834 AVAILABLE_BITS_CHECK(1);
2835 proto_tree_add_bits_ret_val(tree, hf_gsm_a_dtm_e_gprs_multi_slot_info_present, tvb, bit_offset, 1, &dtmEGprsMultiSlotInfoPresent, ENC_BIG_ENDIAN);
2836 bit_offset = bit_offset + 1;
2838 if (dtmEGprsMultiSlotInfoPresent == 1)
2840 /* Extract DTM GPRS Multi Slot Class */
2841 proto_tree_add_bits_item(tree, hf_gsm_a_dtm_gprs_multi_slot_class, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2842 bit_offset = bit_offset + 2;
2844 /* Extract Single Slot DTM */
2845 proto_tree_add_bits_item(tree, hf_gsm_a_single_slot_dtm, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2846 bit_offset = bit_offset + 1;
2848 /* Extract DTM EGPRS Multi Slot Class Presence */
2849 proto_tree_add_bits_ret_val(tree, hf_gsm_a_dtm_egprs_multi_slot_class_present, tvb, bit_offset, 1, &dtmEgprsMultiSlotClassPresent, ENC_BIG_ENDIAN);
2850 bit_offset = bit_offset + 1;
2852 /* Extract DTM EGPRS Multi Slot Class */
2853 if (dtmEgprsMultiSlotClassPresent == 1)
2855 proto_tree_add_bits_item(tree, hf_gsm_a_dtm_egprs_multi_slot_class, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2856 bit_offset = bit_offset + 2;
2861 * Release 4 starts here
2863 * { 0 | 1 < Single Band Support > } -- Release 4 starts here:
2864 * Extract Single Band Support
2866 AVAILABLE_BITS_CHECK(1);
2867 proto_tree_add_bits_ret_val(tree, hf_gsm_a_single_band_support, tvb, bit_offset, 1, &singleBandSupport, ENC_BIG_ENDIAN);
2868 bit_offset = bit_offset + 1;
2870 if (singleBandSupport == 1)
2872 /* Extract Single Band Support */
2873 proto_tree_add_bits_item(tree, hf_gsm_a_gsm_band, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2874 bit_offset = bit_offset + 4;
2877 /* { 0 | 1 <GSM 750 Associated Radio Capability : bit(4) > }
2878 * Extract GSM 750 Associated Radio Capability presence
2880 AVAILABLE_BITS_CHECK(1);
2881 proto_tree_add_bits_ret_val(tree, hf_gsm_a_gsm_750_assoc_radio_cap_present, tvb, bit_offset, 1, &gsm750AssocRadioCapabilityPresent, ENC_BIG_ENDIAN);
2882 bit_offset = bit_offset + 1;
2884 if (gsm750AssocRadioCapabilityPresent == 1)
2886 /* Extract GSM 750 Associated Radio Capability */
2887 proto_tree_add_bits_item(tree, hf_gsm_a_gsm_750_assoc_radio_cap, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2888 bit_offset = bit_offset + 4;
2891 /* < UMTS 1.28 Mcps TDD Radio Access Technology Capability : bit >
2892 * Extract UMTS 1.28 Mcps TDD Radio Access Technology Capability
2894 AVAILABLE_BITS_CHECK(1);
2895 proto_tree_add_bits_item(tree, hf_gsm_a_umts_128_mcps_tdd_rat_cap, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2896 bit_offset = bit_offset + 1;
2898 /* < GERAN Feature Package 1 : bit >
2899 * Extract GERAN Feature Package 1
2901 AVAILABLE_BITS_CHECK(1);
2902 proto_tree_add_bits_item(tree, hf_gsm_a_geran_feature_package_1, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2903 bit_offset = bit_offset + 1;
2905 /* { 0 | 1 < Extended DTM GPRS Multi Slot Class : bit(2) >
2906 * < Extended DTM EGPRS Multi Slot Class : bit(2) > }
2907 * Extract Extended DTM E/GPRS Information presence
2909 AVAILABLE_BITS_CHECK(1);
2910 proto_tree_add_bits_ret_val(tree, hf_gsm_a_ext_dtm_e_gprs_multi_slot_info_present, tvb, bit_offset, 1, &extDtmEGprsMultiSlotInfoPresent, ENC_BIG_ENDIAN);
2911 bit_offset = bit_offset + 1;
2913 if (extDtmEGprsMultiSlotInfoPresent == 1)
2915 /* Extract Extended DTM GPRS Multi Slot Class */
2916 proto_tree_add_bits_item(tree, hf_gsm_a_ext_dtm_gprs_multi_slot_class, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2917 bit_offset = bit_offset + 2;
2919 /* Extract Extended DTM EGPRS Multi Slot Class */
2920 proto_tree_add_bits_item(tree, hf_gsm_a_ext_dtm_egprs_multi_slot_class, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2921 bit_offset = bit_offset + 2;
2925 * Release 5 starts here
2927 * { 0 | 1 < High Multislot Capability : bit(2) > } -- Release 5 starts here.
2928 * Extract High Multislot Capability presence
2930 AVAILABLE_BITS_CHECK(1);
2931 proto_tree_add_bits_ret_val(tree, hf_gsm_a_high_multislot_cap_present, tvb, bit_offset, 1, &highMultislotCapPresent, ENC_BIG_ENDIAN);
2932 bit_offset = bit_offset + 1;
2934 if (highMultislotCapPresent == 1)
2936 /* Extract High Multislot Capability */
2937 proto_tree_add_bits_item(tree, hf_gsm_a_high_multislot_cap, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2938 bit_offset = bit_offset + 2;
2942 * { 0 | 1 < GERAN Iu Mode Capabilities > } -- "1" also means support of GERAN Iu mode
2943 * Extract GERAN Iu Mode Capabilities presence
2945 AVAILABLE_BITS_CHECK(1);
2946 proto_tree_add_bits_ret_val(tree, hf_gsm_a_geran_iu_mode_support, tvb, bit_offset, 1, &geranIuModeSupport, ENC_BIG_ENDIAN);
2947 bit_offset = bit_offset + 1;
2949 if (geranIuModeSupport == 1)
2951 /* Extract GERAN Iu Mode Capabilities Length */
2952 length = tvb_get_bits8(tvb, bit_offset, 4);
2954 /* Extract GERAN Iu Mode Capabilities */
2955 item = proto_tree_add_bits_item(tree, hf_gsm_a_geran_iu_mode_cap, tvb, bit_offset, length + 4, ENC_BIG_ENDIAN);
2956 subtree = proto_item_add_subtree(item, ett_gsm_common_elem[DE_MS_CM_3]);
2958 /* Add GERAN Iu Mode Capabilities Length in subtree */
2959 proto_tree_add_bits_item(subtree, hf_gsm_a_geran_iu_mode_cap_length, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2960 bit_offset += 4;
2961 target_bit_offset = bit_offset + length;
2963 /* Extract FLO Iu Capability */
2964 proto_tree_add_bits_item(subtree, hf_gsm_a_flo_iu_cap, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2965 bit_offset += 1;
2967 /* If needed, add spare bits */
2968 if (target_bit_offset > bit_offset)
2970 proto_tree_add_bits_item(subtree, hf_gsm_a_spare_bits, tvb, bit_offset, target_bit_offset - bit_offset, ENC_BIG_ENDIAN);
2971 bit_offset = target_bit_offset;
2975 /* < GERAN Feature Package 2 : bit >
2976 * Extract GERAN Feature Package 2
2978 AVAILABLE_BITS_CHECK(1);
2979 proto_tree_add_bits_item(tree, hf_gsm_a_geran_feature_package_2, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2980 bit_offset = bit_offset + 1;
2982 /* < GMSK Multislot Power Profile : bit (2) >
2983 * Extract GMSK Multislot Power Profile
2985 AVAILABLE_BITS_CHECK(2);
2986 proto_tree_add_bits_item(tree, hf_gsm_a_gmsk_multislot_power_prof, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2987 bit_offset = bit_offset + 2;
2989 /* < 8-PSK Multislot Power Profile : bit (2) >
2990 * Extract GMSK Multislot Power Profile
2992 AVAILABLE_BITS_CHECK(2);
2993 proto_tree_add_bits_item(tree, hf_gsm_a_8_psk_multislot_power_prof, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2994 bit_offset = bit_offset + 2;
2997 * Release 6 starts here
2999 * { 0 | 1 < T-GSM 400 Bands Supported : { 01 | 10 | 11 } > -- Release 6 starts here.
3000 * < T-GSM 400 Associated Radio Capability: bit(4) > }
3002 AVAILABLE_BITS_CHECK(1);
3003 proto_tree_add_bits_ret_val(tree, hf_gsm_a_t_gsm_400_band_info_present, tvb, bit_offset, 1, &tGsm400BandInfoPresent, ENC_BIG_ENDIAN);
3004 bit_offset = bit_offset + 1;
3006 if (tGsm400BandInfoPresent == 1)
3008 /* Extract T-GSM 400 Bands Supported */
3009 proto_tree_add_bits_item(tree, hf_gsm_a_t_gsm_400_bands_supported, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
3010 bit_offset = bit_offset + 2;
3012 /* Extract T-GSM 400 Associated Radio Capability */
3013 proto_tree_add_bits_item(tree, hf_gsm_a_t_gsm_400_assoc_radio_cap, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3014 bit_offset = bit_offset + 4;
3017 /* { 0 | 1 < T-GSM 900 Associated Radio Capability: bit(4) > }
3018 * Extract T-GSM 900 Associated Radio Capability presence
3020 AVAILABLE_BITS_CHECK(1);
3021 proto_tree_add_bits_ret_val(tree, hf_gsm_a_t_gsm_900_assoc_radio_cap_present, tvb, bit_offset, 1, &tGsm900AssocRadioCapabilityPresent, ENC_BIG_ENDIAN);
3022 bit_offset = bit_offset + 1;
3024 if (tGsm900AssocRadioCapabilityPresent == 1)
3026 /* Extract T-GSM 900 Associated Radio Capability */
3027 proto_tree_add_bits_item(tree, hf_gsm_a_t_gsm_900_assoc_radio_cap, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3028 bit_offset = bit_offset + 4;
3031 /* < Downlink Advanced Receiver Performance : bit (2)>
3032 * Extract Downlink Advanced Receiver Performance
3034 AVAILABLE_BITS_CHECK(2);
3035 proto_tree_add_bits_item(tree, hf_gsm_a_downlink_adv_receiver_perf, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
3036 bit_offset = bit_offset + 2;
3038 /* < DTM Enhancements Capability : bit >
3039 * Extract DTM Enhancements Capability
3041 AVAILABLE_BITS_CHECK(1);
3042 proto_tree_add_bits_item(tree, hf_gsm_a_dtm_enhancements_cap, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3043 bit_offset = bit_offset + 1;
3045 /* { 0 | 1 < DTM GPRS High Multi Slot Class : bit(3) >
3046 * < Offset required : bit>
3047 * { 0 | 1 < DTM EGPRS High Multi Slot Class : bit(3) > } }
3048 * Extract DTM E/GPRS High Multi Slot Information presence
3050 AVAILABLE_BITS_CHECK(1);
3051 proto_tree_add_bits_ret_val(tree, hf_gsm_a_dtm_e_gprs_high_multi_slot_info_present, tvb, bit_offset, 1, &dtmEGprsHighMultiSlotInfoPresent, ENC_BIG_ENDIAN);
3052 bit_offset = bit_offset + 1;
3054 if (dtmEGprsHighMultiSlotInfoPresent == 1)
3056 /* Extract DTM GPRS High Multi Slot Class */
3057 proto_tree_add_bits_item(tree, hf_gsm_a_dtm_gprs_high_multi_slot_class, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
3058 bit_offset = bit_offset + 3;
3060 /* Extract Offset Required */
3061 proto_tree_add_bits_item(tree, hf_gsm_a_offset_required, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3062 bit_offset = bit_offset + 1;
3064 /* Extract DTM EGPRS High Multi Slot Class Presence */
3065 proto_tree_add_bits_ret_val(tree, hf_gsm_a_dtm_egprs_high_multi_slot_class_present, tvb, bit_offset, 1, &dtmEgprsHighMultiSlotClassPresent, ENC_BIG_ENDIAN);
3066 bit_offset = bit_offset + 1;
3068 /* Extract DTM EGPRS High Multi Slot Class */
3069 if (dtmEgprsHighMultiSlotClassPresent == 1)
3071 proto_tree_add_bits_item(tree, hf_gsm_a_dtm_egprs_high_multi_slot_class, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
3072 bit_offset = bit_offset + 3;
3076 /* < Repeated ACCH Capability : bit >
3077 * Extract Repeated ACCH Capability
3079 AVAILABLE_BITS_CHECK(1);
3080 proto_tree_add_bits_item(tree, hf_gsm_a_repeated_acch_cap, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3081 bit_offset = bit_offset + 1;
3084 * Release 7 starts here
3086 * { 0 | 1 <GSM 710 Associated Radio Capability : bit(4) > } -- Release 7 starts here.
3087 * Extract GSM 710 Associated Radio Capability presence
3089 AVAILABLE_BITS_CHECK(1);
3090 proto_tree_add_bits_ret_val(tree, hf_gsm_a_gsm_710_assoc_radio_cap_present, tvb, bit_offset, 1, &gsm710AssocRadioCapabilityPresent, ENC_BIG_ENDIAN);
3091 bit_offset = bit_offset + 1;
3093 if (gsm710AssocRadioCapabilityPresent == 1)
3095 /* Extract GSM 710 Associated Radio Capability */
3096 proto_tree_add_bits_item(tree, hf_gsm_a_gsm_710_assoc_radio_cap, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3097 bit_offset = bit_offset + 4;
3100 /* { 0 | 1 < T-GSM 810 Associated Radio Capability: bit(4) > }
3101 * Extract T-GSM 810 Associated Radio Capability presence
3103 AVAILABLE_BITS_CHECK(1);
3104 proto_tree_add_bits_ret_val(tree, hf_gsm_a_t_gsm_810_assoc_radio_cap_present, tvb, bit_offset, 1, &tGsm810AssocRadioCapabilityPresent, ENC_BIG_ENDIAN);
3105 bit_offset = bit_offset + 1;
3107 if (tGsm810AssocRadioCapabilityPresent == 1)
3109 /* Extract T-GSM 810 Associated Radio Capability */
3110 proto_tree_add_bits_item(tree, hf_gsm_a_t_gsm_810_assoc_radio_cap, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
3111 bit_offset = bit_offset + 4;
3114 /* < Ciphering Mode Setting Capability : bit >
3115 * Extract Ciphering Mode Setting Capability
3117 AVAILABLE_BITS_CHECK(1);
3118 proto_tree_add_bits_item(tree, hf_gsm_a_ciphering_mode_setting_cap, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3119 bit_offset = bit_offset + 1;
3121 /* < Additional Positioning Capabilities : bit >
3122 * Extract Additional Positioning Capabilities
3124 AVAILABLE_BITS_CHECK(1);
3125 proto_tree_add_bits_item(tree, hf_gsm_a_additional_positioning_caps, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3126 bit_offset = bit_offset + 1;
3129 * Release 8 starts here
3131 * <E-UTRA FDD support : bit > -- Release 8 starts here.
3132 * Extract E-UTRA FDD support
3134 AVAILABLE_BITS_CHECK(1);
3135 proto_tree_add_bits_item(tree, hf_gsm_a_e_utra_fdd_support, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3136 bit_offset = bit_offset + 1;
3139 * <E-UTRA TDD support : bit >
3140 * Extract E-UTRA TDD support
3142 AVAILABLE_BITS_CHECK(1);
3143 proto_tree_add_bits_item(tree, hf_gsm_a_e_utra_tdd_support, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3144 bit_offset = bit_offset + 1;
3147 * <E-UTRA Measurement and Reporting support : bit >
3148 * Extract E-UTRA Measurement and Reporting support
3150 AVAILABLE_BITS_CHECK(1);
3151 proto_tree_add_bits_item(tree, hf_gsm_a_e_utra_meas_and_report_support, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3152 bit_offset = bit_offset + 1;
3155 * <Priority-based reselection support : bit >
3156 * Extract Priority-based reselection support
3158 AVAILABLE_BITS_CHECK(1);
3159 proto_tree_add_bits_item(tree, hf_gsm_a_prio_based_resel_support, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3160 bit_offset = bit_offset + 1;
3163 * Release 9 starts here
3165 * <UTRA CSG Cells Reporting : bit > -- Release 9 starts here.
3166 * Extract UTRA CSG Cells Reporting
3168 AVAILABLE_BITS_CHECK(1);
3169 proto_tree_add_bits_item(tree, hf_gsm_a_utra_csg_cells_reporting, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3170 bit_offset = bit_offset + 1;
3173 * <VAMOS Level : bit(2) >
3174 * Extract VAMOS Level
3176 AVAILABLE_BITS_CHECK(2);
3177 proto_tree_add_bits_item(tree, hf_gsm_a_vamos_level, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
3178 bit_offset = bit_offset + 2;
3181 * Release 10 starts here
3183 * < TIGHTER Capability : bit(2) > -- Release 10 starts here.
3184 * Extract TIGHTER Capability
3186 AVAILABLE_BITS_CHECK(2);
3187 proto_tree_add_bits_item(tree, hf_gsm_a_tighter_cap, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
3188 bit_offset = bit_offset + 2;
3191 * < Selective Ciphering of Downlink SACCH : bit >
3192 * Extract Selective Ciphering of Downlink SACCH
3194 AVAILABLE_BITS_CHECK(1);
3195 proto_tree_add_bits_item(tree, hf_gsm_a_selective_ciph_down_sacch, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3196 bit_offset = bit_offset + 1;
3199 * Release 11 starts here
3201 * < CS to PS SRVCC from GERAN to UTRA : bit(2) > -- Release 11 starts here
3203 AVAILABLE_BITS_CHECK(2);
3204 proto_tree_add_bits_item(tree, hf_gsm_a_cs_to_ps_srvcc_geran_to_utra, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
3205 bit_offset = bit_offset + 2;
3208 * < CS to PS SRVCC from GERAN to E-UTRA : bit(2)>
3210 AVAILABLE_BITS_CHECK(2);
3211 proto_tree_add_bits_item(tree, hf_gsm_a_cs_to_ps_srvcc_geran_to_eutra, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
3212 bit_offset = bit_offset + 2;
3215 * < GERAN Network Sharing support : bit(1)>
3217 AVAILABLE_BITS_CHECK(1);
3218 proto_tree_add_bits_item(tree, hf_gsm_a_geran_network_sharing_support, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3219 bit_offset = bit_offset + 1;
3222 * < E-UTRA Wideband RSRQ measurements support : bit(1)>
3224 AVAILABLE_BITS_CHECK(1);
3225 proto_tree_add_bits_item(tree, hf_gsm_a_eutra_wb_rsrq_support, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3226 bit_offset = bit_offset + 1;
3229 * Release 12 starts here
3231 * < ER Band support : bit(1) > -- Release 12 starts here
3233 AVAILABLE_BITS_CHECK(1);
3234 proto_tree_add_bits_item(tree, hf_gsm_a_er_band_support, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3235 bit_offset = bit_offset + 1;
3238 * < UTRA Multiple Frequency Band Indicators support : bit(1)>
3240 AVAILABLE_BITS_CHECK(1);
3241 proto_tree_add_bits_item(tree, hf_gsm_a_utra_mfbi_support, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3242 bit_offset = bit_offset + 1;
3245 * < E-UTRA Multiple Frequency Band Indicators support : bit(1)>
3247 AVAILABLE_BITS_CHECK(1);
3248 proto_tree_add_bits_item(tree, hf_gsm_a_eutra_mfbi_support, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3249 bit_offset = bit_offset + 1;
3252 * < Extended TSC Set Capability support : bit(1)>
3254 AVAILABLE_BITS_CHECK(1);
3255 proto_tree_add_bits_item(tree, hf_gsm_a_ext_tsc_set_cap_support, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3256 bit_offset = bit_offset + 1;
3259 * < Extended EARFCN value range : bit(1)>
3261 AVAILABLE_BITS_CHECK(1);
3262 proto_tree_add_bits_item(tree, hf_gsm_a_ext_earfcn_value_range, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3263 bit_offset = bit_offset + 1;
3266 * Add spare bits until we reach an octet boundary
3268 bits_left = (((len + offset) << 3) - bit_offset) & 0x07;
3269 if (bits_left != 0)
3271 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, bit_offset, bits_left, ENC_BIG_ENDIAN);
3272 bit_offset += bits_left;
3275 /* translate to byte offset (we already know that we are on an octet boundary) */
3276 curr_offset = bit_offset >> 3;
3277 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_extraneous_data);
3279 return len;
3282 * [3] 10.5.1.8
3284 uint16_t de_spare_nibble(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3286 uint32_t curr_offset;
3287 int bit_offset;
3289 curr_offset = offset;
3290 if (RIGHT_NIBBLE == len)
3291 bit_offset = 4;
3292 else
3293 bit_offset = 0;
3295 proto_tree_add_bits_item(tree, hf_gsm_a_spare_nibble, tvb, (curr_offset<<3)+bit_offset, 4, ENC_BIG_ENDIAN);
3296 curr_offset = curr_offset + 1;
3298 return (curr_offset - offset);
3302 * [3] 10.5.1.9 Descriptive group or broadcast call reference
3304 static const true_false_string tfs_vgcs_vbs = { "VGCS (Group call reference)", "VBS (Broadcast call reference)" };
3306 static const value_string gsm_a_call_priority_vals[] = {
3307 { 0, "no priority applied"},
3308 { 1, "call priority level 4"},
3309 { 2, "call priority level 3"},
3310 { 3, "call priority level 2"},
3311 { 4, "call priority level 1"},
3312 { 5, "call priority level 0"},
3313 { 6, "call priority level B"},
3314 { 7, "call priority level A"},
3315 { 0, NULL }
3318 uint16_t
3319 de_d_gb_call_ref(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3321 uint32_t curr_offset = offset;
3323 proto_tree_add_item(tree, hf_gsm_a_group_call_reference, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
3324 proto_tree_add_item(tree, hf_gsm_a_service_flag, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
3325 proto_tree_add_item(tree, hf_gsm_a_af_acknowledgement, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
3326 proto_tree_add_item(tree, hf_gsm_a_call_priority, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
3327 curr_offset += 4;
3329 proto_tree_add_item(tree, hf_gsm_a_ciphering_info, tvb, curr_offset, 1, ENC_NA);
3331 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 4, ENC_BIG_ENDIAN);
3332 curr_offset++;
3334 /* no length check possible */
3336 return (curr_offset - offset);
3340 * [3] 10.5.1.10a PD and SAPI $(CCBS)$
3342 static const value_string gsm_a_sapi_vals[] = {
3343 { 0, "SAPI 0"},
3344 { 1, "Reserved"},
3345 { 2, "Reserved"},
3346 { 3, "SAPI 3"},
3347 { 0, NULL }
3350 static uint16_t
3351 de_pd_sapi(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3353 uint32_t curr_offset;
3354 proto_tree *subtree;
3356 curr_offset = offset;
3358 subtree =
3359 proto_tree_add_subtree(tree,
3360 tvb, curr_offset, 1, ett_gsm_dtap_elem[DE_PD_SAPI], NULL,
3361 val_to_str_ext_const(DE_PD_SAPI, &gsm_dtap_elem_strings_ext, ""));
3363 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 2, ENC_BIG_ENDIAN);
3365 proto_tree_add_item(subtree, hf_gsm_a_sapi, tvb, curr_offset, 1, ENC_NA);
3367 proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3369 curr_offset++;
3371 /* no length check possible */
3373 return (curr_offset - offset);
3377 * [3] 10.5.1.11 Priority Level
3379 static const value_string gsm_a_call_prio_vals[] = {
3380 { 0x00, "no priority applied" },
3381 { 0x01, "call priority level 4" },
3382 { 0x02, "call priority level 3" },
3383 { 0x03, "call priority level 2" },
3384 { 0x04, "call priority level 1" },
3385 { 0x05, "call priority level 0" },
3386 { 0x06, "call priority level B" },
3387 { 0x07, "call priority level A" },
3388 { 0, NULL }
3391 static uint16_t
3392 de_prio(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3394 uint32_t curr_offset;
3396 curr_offset = offset;
3398 proto_tree_add_item(tree, hf_gsm_a_b8spare, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3399 proto_tree_add_bits_item(tree, hf_gsm_a_call_prio, tvb, (curr_offset<<3)+5, 3, ENC_BIG_ENDIAN);
3400 curr_offset++;
3402 /* no length check possible */
3404 return (curr_offset - offset);
3408 * [3] 10.5.1.12.1 CN Common GSM-MAP NAS system information
3410 uint16_t
3411 de_cn_common_gsm_map_nas_sys_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3413 uint32_t curr_offset;
3415 curr_offset = offset;
3417 proto_tree_add_item(tree, hf_gsm_a_lac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
3418 curr_offset += 2;
3420 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_extraneous_data);
3422 return (curr_offset - offset);
3426 * [3] 10.5.1.12.2 CS domain specific system information
3428 static const true_false_string gsm_a_att_value = {
3429 "MSs shall apply IMSI attach and detach procedure",
3430 "MSs shall not apply IMSI attach and detach procedure"
3433 uint16_t
3434 de_cs_domain_spec_sys_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3436 uint32_t curr_offset;
3438 curr_offset = offset;
3440 proto_tree_add_item(tree, hf_gsm_a_rr_t3212, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3441 curr_offset++;
3442 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3), 7, ENC_BIG_ENDIAN);
3443 proto_tree_add_item(tree, hf_gsm_a_att, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3444 curr_offset++;
3446 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_extraneous_data);
3448 return (curr_offset - offset);
3452 * [3] 10.5.1.12.3 PS domain specific system information
3454 static const true_false_string gsm_a_nmo_1_value = {
3455 "Network Mode of Operation I is used for MS configured for NMO_I_Behaviour",
3456 "Network Mode of Operation indicated in Bit 1 (NMO) is used for MS configured for NMO_I_Behaviour"
3459 static const true_false_string gsm_a_nmo_value = {
3460 "Network Mode of Operation II",
3461 "Network Mode of Operation I"
3464 uint16_t
3465 de_ps_domain_spec_sys_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3467 uint32_t curr_offset;
3469 curr_offset = offset;
3471 proto_tree_add_item(tree, hf_gsm_a_gm_rac, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3472 curr_offset++;
3473 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3), 6, ENC_BIG_ENDIAN);
3474 proto_tree_add_item(tree, hf_gsm_a_nmo_1, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3475 proto_tree_add_item(tree, hf_gsm_a_nmo, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3476 curr_offset++;
3478 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_extraneous_data);
3480 return (curr_offset - offset);
3484 * [3] 10.5.1.13 PLMN list
3486 uint16_t
3487 de_plmn_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len)
3489 char *mcc_mnc_str;
3490 uint32_t curr_offset;
3491 uint8_t num_plmn;
3492 proto_tree* subtree;
3494 curr_offset = offset;
3496 num_plmn = 0;
3497 while ((len - (curr_offset - offset)) >= 3)
3499 subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, 3, ett_gsm_a_plmn, NULL, "PLMN[%u]", num_plmn + 1);
3500 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, subtree, curr_offset, E212_NONE, true);
3501 proto_item_append_text(subtree, ": %s", mcc_mnc_str);
3503 curr_offset += 3;
3505 num_plmn++;
3508 if (add_string)
3509 snprintf(add_string, string_len, " - %u PLMN%s",
3510 num_plmn, plurality(num_plmn, "", "s"));
3512 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_extraneous_data);
3514 return (curr_offset - offset);
3518 * 10.5.1.14 NAS container for PS HO
3521 static const value_string gsm_a_pld_xid_vals[] = {
3522 { 0x00, "The MS shall perform a Reset of LLC and SNDCP without old XID indicator" },
3523 { 0x01, "The MS shall perform a Reset of LLC and SNDCP with old XID indicator" },
3524 { 0, NULL }
3527 static uint16_t
3528 de_nas_cont_for_ps_ho(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
3530 uint32_t curr_offset;
3532 curr_offset = offset;
3534 /* 8 7 6 5 4 3 2 1
3535 * 0 0 0 old 0 Type of ciphering
3536 * spare spare spare XID spare algorithm
3538 proto_tree_add_item(tree, hf_gsm_a_old_xid, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3539 proto_tree_add_item(tree, hf_gsm_a_type_of_ciph_alg, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
3540 curr_offset++;
3542 /* IOV-UI value (octet 2 to 5)
3543 * The IOV-UI value consists of 32 bits, the format is defined in 3GPP TS 44.064 [78a].
3545 proto_tree_add_item(tree, hf_gsm_a_iov_ui, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
3546 curr_offset += 4;
3548 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_extraneous_data);
3550 return (curr_offset - offset);
3554 * 10.5.1.15 MS network feature support
3556 static const true_false_string gsm_a_ext_periodic_timers_value = {
3557 "MS supports the extended periodic timer in this domain",
3558 "MS does not support the extended periodic timer in this domain"
3561 static uint16_t
3562 de_ms_net_feat_sup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
3564 uint32_t curr_offset, bit_offset;
3566 curr_offset = offset;
3567 bit_offset = (curr_offset<<3)+4;
3569 proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
3570 bit_offset += 3;
3571 proto_tree_add_bits_item(tree, hf_gsm_a_ext_periodic_timers, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3572 curr_offset++;
3574 return (curr_offset - offset);
3578 uint16_t (*common_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string, int string_len) = {
3579 /* Common Information Elements 10.5.1 */
3580 de_cell_id, /* Cell Identity */
3581 de_ciph_key_seq_num, /* Ciphering Key Sequence Number */
3582 de_lai, /* Location Area Identification */
3583 de_mid, /* Mobile Identity */
3584 de_ms_cm_1, /* Mobile Station Classmark 1 */
3585 de_ms_cm_2, /* Mobile Station Classmark 2 */
3586 de_ms_cm_3, /* Mobile Station Classmark 3 */
3587 de_spare_nibble, /* Spare Half Octet */
3588 de_d_gb_call_ref, /* Descriptive group or broadcast call reference */
3589 NULL /* handled inline */, /* Group Cipher Key Number */
3590 de_pd_sapi, /* PD and SAPI $(CCBS)$ */
3591 /* Pos 10 */
3592 de_prio /* handled inline */, /* Priority Level */
3593 de_cn_common_gsm_map_nas_sys_info, /* 10.5.1.12.1 CN Common GSM-MAP NAS system information */
3594 de_cs_domain_spec_sys_info, /* 10.5.1.12.2 CS domain specific system information */
3595 de_ps_domain_spec_sys_info, /* 10.5.1.12.2 PS domain specific system information */
3596 de_plmn_list, /* 10.5.1.13 PLMN list */
3597 de_nas_cont_for_ps_ho, /* 10.5.1.14 NAS container for PS HO */
3598 de_ms_net_feat_sup, /* 10.5.1.15 MS network feature support */
3599 NULL, /* NONE */
3602 /* TAP STAT INFO */
3603 typedef enum
3605 IEI_COLUMN,
3606 MSG_NAME_COLUMN,
3607 COUNT_COLUMN
3608 } gsm_a_stat_columns;
3610 static stat_tap_table_item gsm_a_stat_fields[] = {
3611 {TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "IEI", "%d"},
3612 {TABLE_ITEM_STRING, TAP_ALIGN_LEFT, "Message Name", "%-25s"},
3613 {TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Count", "%d"}
3616 static void gsm_a_stat_init(stat_tap_table_ui* new_stat, const char *table_title, const value_string *msg_strings)
3618 int num_fields = array_length(gsm_a_stat_fields);
3619 stat_tap_table* table;
3620 unsigned i;
3621 stat_tap_table_item_type items[array_length(gsm_a_stat_fields)];
3623 items[IEI_COLUMN].type = TABLE_ITEM_UINT;
3624 items[MSG_NAME_COLUMN].type = TABLE_ITEM_STRING;
3625 items[COUNT_COLUMN].type = TABLE_ITEM_UINT;
3626 items[COUNT_COLUMN].value.uint_value = 0;
3628 table = stat_tap_find_table(new_stat, table_title);
3629 if (table) {
3630 if (new_stat->stat_tap_reset_table_cb) {
3631 new_stat->stat_tap_reset_table_cb(table);
3633 return;
3636 table = stat_tap_init_table(table_title, num_fields, 0, NULL);
3637 stat_tap_add_table(new_stat, table);
3639 /* Add a row for each value type */
3640 for (i = 0; i < 256; i++)
3642 const char *msg_str = try_val_to_str(i, msg_strings);
3643 char *col_str;
3644 if (msg_str) {
3645 col_str = g_strdup(msg_str);
3646 } else {
3647 col_str = ws_strdup_printf("Unknown message %d", i);
3650 items[IEI_COLUMN].value.uint_value = i;
3651 items[MSG_NAME_COLUMN].value.string_value = col_str;
3652 stat_tap_init_table_row(table, i, num_fields, items);
3656 static void gsm_a_bssmap_stat_init(stat_tap_table_ui* new_stat)
3658 gsm_a_stat_init(new_stat,
3659 "GSM A-I/F BSSMAP Statistics", gsm_a_bssmap_msg_strings);
3662 static void gsm_a_dtap_mm_stat_init(stat_tap_table_ui* new_stat)
3664 gsm_a_stat_init(new_stat,
3665 "GSM A-I/F DTAP Mobility Management Statistics", gsm_a_dtap_msg_mm_strings);
3668 static void gsm_a_dtap_rr_stat_init(stat_tap_table_ui* new_stat)
3670 gsm_a_stat_init(new_stat,
3671 "GSM A-I/F DTAP Radio Resource Management Statistics", gsm_a_dtap_msg_rr_strings);
3674 static void gsm_a_dtap_cc_stat_init(stat_tap_table_ui* new_stat)
3676 gsm_a_stat_init(new_stat,
3677 "GSM A-I/F DTAP Call Control Statistics", gsm_a_dtap_msg_cc_strings);
3680 static void gsm_a_dtap_gmm_stat_init(stat_tap_table_ui* new_stat)
3682 gsm_a_stat_init(new_stat,
3683 "GSM A-I/F DTAP GPRS Mobility Management Statistics", gsm_a_dtap_msg_gmm_strings);
3686 static void gsm_a_dtap_sm_stat_init(stat_tap_table_ui* new_stat)
3688 gsm_a_stat_init(new_stat,
3689 "GSM A-I/F DTAP GPRS Session Management Statistics", gsm_a_dtap_msg_sm_strings);
3692 static void gsm_a_dtap_sms_stat_init(stat_tap_table_ui* new_stat)
3694 gsm_a_stat_init(new_stat,
3695 "GSM A-I/F DTAP Short Message Service Statistics", gsm_a_dtap_msg_sms_strings);
3698 static void gsm_a_dtap_tp_stat_init(stat_tap_table_ui* new_stat)
3700 gsm_a_stat_init(new_stat,
3701 "GSM A-I/F DTAP Special Conformance Testing Functions", gsm_a_dtap_msg_tp_strings);
3704 static void gsm_a_dtap_ss_stat_init(stat_tap_table_ui* new_stat)
3706 gsm_a_stat_init(new_stat,
3707 "GSM A-I/F DTAP Supplementary Services Statistics", gsm_a_dtap_msg_ss_strings);
3710 static void gsm_a_sacch_rr_stat_init(stat_tap_table_ui* new_stat)
3712 gsm_a_stat_init(new_stat,
3713 "GSM A-I/F SACCH Statistics", gsm_a_rr_short_pd_msg_strings);
3716 static tap_packet_status
3717 gsm_a_stat_packet(void *tapdata, const void *gatr_ptr, uint8_t pdu_type, int protocol_disc)
3719 stat_data_t* stat_data = (stat_data_t*)tapdata;
3720 const gsm_a_tap_rec_t *gatr = (const gsm_a_tap_rec_t *) gatr_ptr;
3721 stat_tap_table* table;
3722 stat_tap_table_item_type* msg_data;
3724 if (gatr->pdu_type != pdu_type) return TAP_PACKET_DONT_REDRAW;
3725 if (pdu_type == BSSAP_PDU_TYPE_DTAP && (int)gatr->protocol_disc != protocol_disc) return TAP_PACKET_DONT_REDRAW;
3726 if (pdu_type == GSM_A_PDU_TYPE_SACCH && gatr->protocol_disc != 0) return TAP_PACKET_DONT_REDRAW;
3728 table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, 0);
3729 msg_data = stat_tap_get_field_data(table, gatr->message_type, COUNT_COLUMN);
3730 msg_data->value.uint_value++;
3731 stat_tap_set_field_data(table, gatr->message_type, COUNT_COLUMN, msg_data);
3733 return TAP_PACKET_REDRAW;
3736 static tap_packet_status
3737 gsm_a_bssmap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr, tap_flags_t flags _U_)
3739 return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_BSSMAP, 0);
3742 static tap_packet_status
3743 gsm_a_dtap_mm_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr, tap_flags_t flags _U_)
3745 return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_MM);
3748 static tap_packet_status
3749 gsm_a_dtap_rr_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr, tap_flags_t flags _U_)
3751 return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_RR);
3754 static tap_packet_status
3755 gsm_a_dtap_cc_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr, tap_flags_t flags _U_)
3757 return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_CC);
3760 static tap_packet_status
3761 gsm_a_dtap_gmm_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr, tap_flags_t flags _U_)
3763 return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_GMM);
3766 static tap_packet_status
3767 gsm_a_dtap_sms_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr, tap_flags_t flags _U_)
3769 return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_SMS);
3772 static tap_packet_status
3773 gsm_a_dtap_sm_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr, tap_flags_t flags _U_)
3775 return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_SM);
3778 static tap_packet_status
3779 gsm_a_dtap_ss_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr, tap_flags_t flags _U_)
3781 return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_SS);
3784 static tap_packet_status
3785 gsm_a_dtap_tp_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr, tap_flags_t flags _U_)
3787 return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_TP);
3790 static tap_packet_status
3791 gsm_a_sacch_rr_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr, tap_flags_t flags _U_)
3793 return gsm_a_stat_packet(tapdata, gatr_ptr, GSM_A_PDU_TYPE_SACCH, 0);
3796 static void
3797 gsm_a_stat_reset(stat_tap_table* table)
3799 unsigned element;
3800 stat_tap_table_item_type* item_data;
3802 for (element = 0; element < table->num_elements; element++)
3804 item_data = stat_tap_get_field_data(table, element, COUNT_COLUMN);
3805 item_data->value.uint_value = 0;
3806 stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
3810 static void
3811 gsm_a_stat_free_table_item(stat_tap_table* table _U_, unsigned row _U_, unsigned column, stat_tap_table_item_type* field_data)
3813 if (column != MSG_NAME_COLUMN) return;
3814 g_free((char*)field_data->value.string_value);
3817 /* Register the protocol with Wireshark */
3818 void
3819 proto_register_gsm_a_common(void)
3821 unsigned i;
3822 unsigned last_offset;
3824 /* Setup list of header fields */
3825 static hf_register_info hf[] =
3827 { &hf_gsm_a_common_elem_id,
3828 { "Element ID", "gsm_a.common.elem_id",
3829 FT_UINT8, BASE_HEX, NULL, 0,
3830 NULL, HFILL }
3832 { &hf_gsm_a_common_elem_id_f0,
3833 { "Element ID", "gsm_a.common.elem_id",
3834 FT_UINT8, BASE_HEX, NULL, 0xF0,
3835 NULL, HFILL }
3837 { &hf_gsm_a_l_ext,
3838 { "ext", "gsm_a.l_ext",
3839 FT_UINT8, BASE_DEC, NULL, 0x80,
3840 NULL, HFILL }
3842 { &hf_gsm_a_tmsi,
3843 { "TMSI/P-TMSI", "gsm_a.tmsi",
3844 FT_UINT32, BASE_DEC_HEX, 0, 0x0,
3845 NULL, HFILL }
3847 { &hf_gsm_a_imei,
3848 { "IMEI", "gsm_a.imei",
3849 FT_STRING, BASE_NONE, 0, 0,
3850 NULL, HFILL }
3852 { &hf_gsm_a_imeisv,
3853 { "IMEISV", "gsm_a.imeisv",
3854 FT_STRING, BASE_NONE, 0, 0,
3855 NULL, HFILL }
3857 { &hf_gsm_a_MSC_rev,
3858 { "Revision Level", "gsm_a.MSC_rev",
3859 FT_UINT8, BASE_DEC, VALS(gsm_a_msc_rev_vals), 0x60,
3860 NULL, HFILL }
3862 { &hf_gsm_a_ES_IND,
3863 { "ES IND", "gsm_a.ES_IND",
3864 FT_BOOLEAN, 8, TFS(&ES_IND_vals), 0x10,
3865 NULL, HFILL }
3867 { &hf_gsm_a_A5_1_algorithm_sup,
3868 { "A5/1 algorithm supported", "gsm_a.A5_1_algorithm_sup",
3869 FT_BOOLEAN, 8, TFS(&A5_1_algorithm_sup_vals), 0x08,
3870 NULL, HFILL }
3872 { &hf_gsm_a_RF_power_capability,
3873 { "RF Power Capability", "gsm_a.RF_power_capability",
3874 FT_UINT8, BASE_DEC, VALS(RF_power_capability_vals), 0x07,
3875 NULL, HFILL }
3877 { &hf_gsm_a_ps_sup_cap,
3878 { "PS capability (pseudo-synchronization capability)", "gsm_a.ps_sup_cap",
3879 FT_BOOLEAN, 8, TFS(&ps_sup_cap_vals), 0x40,
3880 NULL, HFILL }
3882 { &hf_gsm_a_SS_screening_indicator,
3883 { "SS Screening Indicator", "gsm_a.SS_screening_indicator",
3884 FT_UINT8, BASE_DEC, VALS(SS_screening_indicator_vals), 0x30,
3885 NULL, HFILL }
3887 { &hf_gsm_a_SM_capability,
3888 { "SM capability (MT SMS pt to pt capability)", "gsm_a.SM_cap",
3889 FT_BOOLEAN, 8, TFS(&SM_capability_vals), 0x08,
3890 NULL, HFILL }
3892 { &hf_gsm_a_VBS_notification_rec,
3893 { "VBS notification reception", "gsm_a.VBS_notification_rec",
3894 FT_BOOLEAN, 8, TFS(&VBS_notification_rec_vals), 0x04,
3895 NULL, HFILL }
3897 { &hf_gsm_a_VGCS_notification_rec,
3898 { "VGCS notification reception", "gsm_a.VGCS_notification_rec",
3899 FT_BOOLEAN, 8, TFS(&VGCS_notification_rec_vals), 0x02,
3900 NULL, HFILL }
3902 { &hf_gsm_a_FC_frequency_cap,
3903 { "FC Frequency Capability", "gsm_a.FC_frequency_cap",
3904 FT_BOOLEAN, 8, TFS(&FC_frequency_cap_vals), 0x01,
3905 NULL, HFILL }
3907 { &hf_gsm_a_CM3,
3908 { "CM3", "gsm_a.CM3",
3909 FT_BOOLEAN, 8, TFS(&CM3_vals), 0x80,
3910 NULL, HFILL }
3912 { &hf_gsm_a_LCS_VA_cap,
3913 { "LCS VA capability (LCS value added location request notification capability)", "gsm_a.LCS_VA_cap",
3914 FT_BOOLEAN, 8, TFS(&LCS_VA_cap_vals), 0x20,
3915 NULL, HFILL }
3917 { &hf_gsm_a_UCS2_treatment,
3918 { "UCS2 treatment", "gsm_a.UCS2_treatment",
3919 FT_BOOLEAN, 8, TFS(&UCS2_treatment_vals), 0x10,
3920 NULL, HFILL }
3922 { &hf_gsm_a_SoLSA,
3923 { "SoLSA", "gsm_a.SoLSA",
3924 FT_BOOLEAN, 8, TFS(&SoLSA_vals), 0x08,
3925 NULL, HFILL }
3927 { &hf_gsm_a_CMSP,
3928 { "CMSP: CM Service Prompt", "gsm_a.CMSP",
3929 FT_BOOLEAN, 8, TFS(&CMSP_vals), 0x04,
3930 NULL, HFILL }
3932 { &hf_gsm_a_A5_7_algorithm_sup,
3933 { "A5/7 algorithm supported", "gsm_a.A5_7_algorithm_sup",
3934 FT_BOOLEAN, BASE_NONE, TFS(&A5_7_algorithm_sup_vals), 0x0,
3935 NULL, HFILL }
3937 { &hf_gsm_a_A5_6_algorithm_sup,
3938 { "A5/6 algorithm supported", "gsm_a.A5_6_algorithm_sup",
3939 FT_BOOLEAN, BASE_NONE, TFS(&A5_6_algorithm_sup_vals), 0x0,
3940 NULL, HFILL }
3942 { &hf_gsm_a_A5_5_algorithm_sup,
3943 { "A5/5 algorithm supported", "gsm_a.A5_5_algorithm_sup",
3944 FT_BOOLEAN, BASE_NONE, TFS(&A5_5_algorithm_sup_vals), 0x0,
3945 NULL, HFILL }
3947 { &hf_gsm_a_A5_4_algorithm_sup,
3948 { "A5/4 algorithm supported", "gsm_a.A5_4_algorithm_sup",
3949 FT_BOOLEAN, BASE_NONE, TFS(&A5_4_algorithm_sup_vals), 0x0,
3950 NULL, HFILL }
3952 { &hf_gsm_a_A5_3_algorithm_sup,
3953 { "A5/3 algorithm supported", "gsm_a.A5_3_algorithm_sup",
3954 FT_BOOLEAN, 8, TFS(&A5_3_algorithm_sup_vals), 0x02,
3955 NULL, HFILL }
3957 { &hf_gsm_a_A5_2_algorithm_sup,
3958 { "A5/2 algorithm supported", "gsm_a.A5_2_algorithm_sup",
3959 FT_BOOLEAN, 8, TFS(&A5_2_algorithm_sup_vals), 0x01,
3960 NULL, HFILL }
3962 { &hf_gsm_a_mobile_identity_type,
3963 { "Mobile Identity Type", "gsm_a.ie.mobileid.type",
3964 FT_UINT8, BASE_DEC, VALS(mobile_identity_type_vals), 0x07,
3965 NULL, HFILL }
3967 { &hf_gsm_a_id_dig_1,
3968 { "Identity Digit 1", "gsm_a.id_dig_1",
3969 FT_UINT8, BASE_DEC, NULL, 0xf0,
3970 NULL, HFILL }
3972 { &hf_gsm_a_odd_even_ind,
3973 { "Odd/even indication", "gsm_a.oddevenind",
3974 FT_BOOLEAN, 8, TFS(&oddevenind_vals), 0x08,
3975 NULL, HFILL }
3977 { &hf_gsm_a_unused,
3978 { "Unused", "gsm_a.unused",
3979 FT_UINT8, BASE_HEX, NULL, 0xf0,
3980 NULL, HFILL }
3982 { &hf_gsm_a_tmgi_mcc_mnc_ind,
3983 { "MCC/MNC indication", "gsm_a.tmgi_mcc_mnc_ind",
3984 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
3985 NULL, HFILL}
3987 { &hf_gsm_a_mbs_ses_id_ind,
3988 { "MBMS Session Identity indication", "gsm_a.mbs_session_id_ind",
3989 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
3990 NULL, HFILL}
3992 { &hf_gsm_a_mbs_service_id,
3993 { "MBMS Service ID", "gsm_a.mbs_service_id",
3994 FT_UINT24, BASE_HEX, NULL, 0x0,
3995 NULL, HFILL }
3997 { &hf_gsm_a_mbs_session_id,
3998 { "MBMS Session ID", "gsm_a.mbs_session_id",
3999 FT_UINT8, BASE_HEX, NULL, 0x0,
4000 NULL, HFILL }
4002 { &hf_gsm_a_length,
4003 { "Length", "gsm_a.len",
4004 FT_UINT16, BASE_DEC, NULL, 0,
4005 NULL, HFILL }
4007 { &hf_gsm_a_element_value,
4008 { "Element Value", "gsm_a.element_value",
4009 FT_BYTES, BASE_NONE, NULL, 0,
4010 NULL, HFILL }
4012 { &hf_gsm_a_extension,
4013 { "Extension", "gsm_a.extension",
4014 FT_BOOLEAN, 8, TFS(&gsm_a_extension_value), 0x80,
4015 NULL, HFILL }
4017 { &hf_gsm_a_L3_protocol_discriminator,
4018 { "Protocol discriminator", "gsm_a.L3_protocol_discriminator",
4019 FT_UINT8, BASE_HEX, VALS(protocol_discriminator_vals), 0x0f,
4020 NULL, HFILL }
4022 { &hf_gsm_a_call_prio,
4023 { "Call priority", "gsm_a.call_prio",
4024 FT_UINT8, BASE_DEC, VALS(gsm_a_call_prio_vals), 0x00,
4025 NULL, HFILL }
4027 { &hf_gsm_a_type_of_ciph_alg,
4028 { "Type of ciphering algorithm", "gsm_a.type_of_ciph_alg",
4029 FT_UINT8, BASE_DEC, VALS(gsm_a_gm_type_of_ciph_alg_vals), 0x07,
4030 NULL, HFILL }
4032 { &hf_gsm_a_att,
4033 { "ATT", "gsm_a.att",
4034 FT_BOOLEAN, 8, TFS(&gsm_a_att_value), 0x01,
4035 "Attach-detach allowed", HFILL }
4037 { &hf_gsm_a_nmo_1,
4038 { "NMO I", "gsm_a.nmo_1",
4039 FT_BOOLEAN, 8, TFS(&gsm_a_nmo_1_value), 0x02,
4040 "Network Mode of Operation I", HFILL }
4042 { &hf_gsm_a_nmo,
4043 { "NMO", "gsm_a.nmo",
4044 FT_BOOLEAN, 8, TFS(&gsm_a_nmo_value), 0x01,
4045 "Network Mode of Operation", HFILL }
4047 { &hf_gsm_a_old_xid,
4048 { "Old XID", "gsm_a.old_xid",
4049 FT_UINT8, BASE_DEC, VALS(gsm_a_pld_xid_vals), 0x10,
4050 NULL, HFILL }
4052 { &hf_gsm_a_iov_ui,
4053 { "IOV-UI", "gsm_a.iov_ui",
4054 FT_UINT32, BASE_HEX, NULL, 0x0,
4055 NULL, HFILL }
4057 { &hf_gsm_a_ext_periodic_timers,
4058 { "Extended periodic timers", "gsm_a.ext_periodic_timers",
4059 FT_BOOLEAN, BASE_NONE, TFS(&gsm_a_ext_periodic_timers_value), 0x0,
4060 NULL, HFILL }
4062 { &hf_gsm_a_skip_ind,
4063 { "Skip Indicator", "gsm_a.skip.ind",
4064 FT_UINT8, BASE_DEC, VALS(gsm_a_skip_ind_vals), 0xf0,
4065 NULL, HFILL }
4067 { &hf_gsm_a_b7spare,
4068 { "Spare", "gsm_a.spareb7",
4069 FT_UINT8, BASE_DEC, NULL, 0x40,
4070 NULL, HFILL }
4072 { &hf_gsm_a_b8spare,
4073 { "Spare", "gsm_a.spareb8",
4074 FT_UINT8, BASE_DEC, NULL, 0x80,
4075 NULL, HFILL }
4077 { &hf_gsm_a_spare_bits,
4078 { "Spare bit(s)", "gsm_a.spare_bits",
4079 FT_UINT8, BASE_DEC, NULL, 0x0,
4080 NULL, HFILL }
4082 { &hf_gsm_a_multi_bnd_sup_fields,
4083 { "Multiband supported field", "gsm_a.multi_bnd_sup_fields",
4084 FT_UINT8, BASE_DEC, NULL, 0x0,
4085 NULL, HFILL }
4087 { &hf_gsm_a_pgsm_supported,
4088 { "P-GSM Supported", "gsm_a.classmark3.pgsmSupported",
4089 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4090 NULL, HFILL}
4092 { &hf_gsm_a_egsm_supported,
4093 { "E-GSM or R-GSM Supported", "gsm_a.classmark3.egsmSupported",
4094 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4095 NULL, HFILL}
4097 { &hf_gsm_a_gsm1800_supported,
4098 { "GSM 1800 Supported", "gsm_a.classmark3.gsm1800Supported",
4099 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4100 NULL, HFILL}
4102 { &hf_gsm_a_ass_radio_cap1,
4103 { "Associated Radio Capability 1", "gsm_a.classmark3.ass_radio_cap1",
4104 FT_UINT8, BASE_DEC, NULL, 0x0,
4105 NULL, HFILL}
4107 { &hf_gsm_a_ass_radio_cap2,
4108 { "Associated Radio Capability 2", "gsm_a.classmark3.ass_radio_cap2",
4109 FT_UINT8, BASE_DEC, NULL, 0x0,
4110 NULL, HFILL}
4112 { &hf_gsm_a_cm3_A5_bits,
4113 { "A5 bits", "gsm_a.classmark3.a5_bits",
4114 FT_UINT8, BASE_HEX, NULL, 0x00,
4115 NULL, HFILL}
4117 { &hf_gsm_a_rsupport,
4118 { "R Support", "gsm_a.classmark3.rsupport",
4119 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4120 NULL, HFILL}
4122 { &hf_gsm_a_r_capabilities,
4123 { "R-GSM band Associated Radio Capability", "gsm_a.classmark3.r_capabilities",
4124 FT_UINT8, BASE_DEC, NULL, 0x0,
4125 NULL, HFILL}
4127 { &hf_gsm_a_multislot_capabilities,
4128 { "HSCSD Multi Slot Capability", "gsm_a.classmark3.multislot_capabilities",
4129 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4130 NULL, HFILL}
4132 { &hf_gsm_a_multislot_class,
4133 { "HSCSD Multi Slot Class", "gsm_a.classmark3.multislot_cap",
4134 FT_UINT8, BASE_DEC, NULL, 0x0,
4135 NULL, HFILL}
4137 { &hf_gsm_a_ucs2_treatment,
4138 { "UCS2 treatment", "gsm_a.UCS2_treatment",
4139 FT_BOOLEAN, BASE_NONE, TFS(&UCS2_treatment_vals), 0x0,
4140 NULL, HFILL }
4142 { &hf_gsm_a_extended_measurement_cap,
4143 { "Extended Measurement Capability", "gsm_a.classmark3.ext_meas_cap",
4144 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4145 NULL, HFILL}
4147 { &hf_gsm_a_ms_measurement_capability,
4148 { "MS measurement capability", "gsm_a.classmark3.ms_measurement_capability",
4149 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4150 NULL, HFILL}
4152 { &hf_gsm_a_sms_value,
4153 { "SMS_VALUE (Switch-Measure-Switch)", "gsm_a.classmark3.sms_value",
4154 FT_UINT8, BASE_DEC, VALS(gsm_a_sms_vals), 0x0,
4155 NULL, HFILL}
4157 { &hf_gsm_a_sm_value,
4158 { "SM_VALUE (Switch-Measure)", "gsm_a.classmark3.sm_value",
4159 FT_UINT8, BASE_DEC, VALS(gsm_a_sms_vals), 0x0,
4160 NULL, HFILL}
4162 { &hf_gsm_a_ms_pos_method_cap_present,
4163 { "MS Positioning Method Capability present", "gsm_a.classmark3.ms_pos_method_cap_present",
4164 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4165 NULL, HFILL}
4167 { &hf_gsm_a_ms_pos_method,
4168 { "MS Positioning Method", "gsm_a.classmark3.ms_pos_method",
4169 FT_UINT8, BASE_HEX, NULL, 0x00,
4170 NULL, HFILL}
4172 { &hf_gsm_a_ms_assisted_e_otd,
4173 { "MS assisted E-OTD", "gsm_a.classmark3.ms_assisted_e_otd",
4174 FT_BOOLEAN, BASE_NONE, TFS(&ms_assisted_e_otd_vals), 0x0,
4175 NULL, HFILL}
4177 { &hf_gsm_a_ms_based_e_otd,
4178 { "MS based E-OTD", "gsm_a.classmark3.ms_based_e_otd",
4179 FT_BOOLEAN, BASE_NONE, TFS(&ms_based_e_otd_vals), 0x0,
4180 NULL, HFILL}
4182 { &hf_gsm_a_ms_assisted_gps,
4183 { "MS assisted GPS", "gsm_a.classmark3.ms_assisted_gps",
4184 FT_BOOLEAN, BASE_NONE, TFS(&ms_assisted_gps_vals), 0x0,
4185 NULL, HFILL}
4187 { &hf_gsm_a_ms_based_gps,
4188 { "MS based GPS", "gsm_a.classmark3.ms_based_gps",
4189 FT_BOOLEAN, BASE_NONE, TFS(&ms_based_gps_vals), 0x0,
4190 NULL, HFILL}
4192 { &hf_gsm_a_ms_conventional_gps,
4193 { "MS Conventional GPS", "gsm_a.classmark3.ms_conventional_gps",
4194 FT_BOOLEAN, BASE_NONE, TFS(&ms_conventional_gps_vals), 0x0,
4195 NULL, HFILL}
4197 { &hf_gsm_a_ecsd_multi_slot_capability,
4198 { "ECSD Multi Slot Capability present", "gsm_a.classmark3.ecsd_multi_slot_capability",
4199 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4200 NULL, HFILL}
4202 { &hf_gsm_a_ecsd_multi_slot_class,
4203 { "ECSD Multi Slot Class", "gsm_a.classmark3.ecsd_multi_slot_class",
4204 FT_UINT8, BASE_DEC, NULL, 0x00,
4205 NULL, HFILL}
4207 { &hf_gsm_a_8_psk_struct_present,
4208 { "8-PSK Struct present", "gsm_a.classmark3.8_psk_struct_present",
4209 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4210 NULL, HFILL}
4212 { &hf_gsm_a_8_psk_struct,
4213 { "8-PSK Struct", "gsm_a.classmark3.8_psk_struct",
4214 FT_UINT8, BASE_HEX, NULL, 0x00,
4215 NULL, HFILL}
4217 { &hf_gsm_a_modulation_capability,
4218 { "Modulation Capability", "gsm_a.classmark3.modulation_capability",
4219 FT_BOOLEAN, BASE_NONE, TFS(&modulation_capability_vals), 0x00,
4220 NULL, HFILL}
4222 { &hf_gsm_a_8_psk_rf_power_capability_1_present,
4223 { "8-PSK RF Power Capability 1 present", "gsm_a.classmark3.8_psk_rf_power_capability_1_present",
4224 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4225 NULL, HFILL}
4227 { &hf_gsm_a_8_psk_rf_power_capability_1,
4228 { "8-PSK RF Power Capability 1", "gsm_a.classmark3.8_psk_rf_power_capability_1",
4229 FT_UINT8, BASE_HEX, VALS(eight_psk_rf_power_capability_vals), 0x00,
4230 NULL, HFILL}
4232 { &hf_gsm_a_8_psk_rf_power_capability_2_present,
4233 { "8-PSK RF Power Capability 2 present", "gsm_a.classmark3.8_psk_rf_power_capability_2_present",
4234 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4235 NULL, HFILL}
4237 { &hf_gsm_a_8_psk_rf_power_capability_2,
4238 { "8-PSK RF Power Capability 2", "gsm_a.classmark3.8_psk_rf_power_capability_2",
4239 FT_UINT8, BASE_HEX, VALS(eight_psk_rf_power_capability_vals), 0x00,
4240 NULL, HFILL}
4242 { &hf_gsm_a_gsm_400_band_info_present,
4243 { "GSM 400 Band Information present", "gsm_a.classmark3.gsm_400_band_info_present",
4244 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4245 NULL, HFILL}
4247 { &hf_gsm_a_gsm_400_bands_supported,
4248 { "GSM 400 Bands Supported", "gsm_a.classmark3.gsm_400_bands_supported",
4249 FT_UINT8, BASE_HEX, VALS(gsm_400_bands_supported_vals), 0x00,
4250 NULL, HFILL}
4252 { &hf_gsm_a_gsm_400_assoc_radio_cap,
4253 { "GSM 400 Associated Radio Capability", "gsm_a.classmark3.gsm_400_assoc_radio_cap",
4254 FT_UINT8, BASE_HEX, NULL, 0x00,
4255 NULL, HFILL}
4257 { &hf_gsm_a_gsm_850_assoc_radio_cap_present,
4258 { "GSM 850 Associated Radio Capability present", "gsm_a.classmark3.gsm_850_assoc_radio_cap_present",
4259 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4260 NULL, HFILL}
4262 { &hf_gsm_a_gsm_850_assoc_radio_cap,
4263 { "GSM 850 Associated Radio Capability", "gsm_a.classmark3.gsm_850_assoc_radio_cap",
4264 FT_UINT8, BASE_HEX, NULL, 0x00,
4265 NULL, HFILL}
4267 { &hf_gsm_a_gsm_1900_assoc_radio_cap_present,
4268 { "GSM 1900 Associated Radio Capability present", "gsm_a.classmark3.gsm_1900_assoc_radio_cap_present",
4269 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4270 NULL, HFILL}
4272 { &hf_gsm_a_gsm_1900_assoc_radio_cap,
4273 { "GSM 1900 Associated Radio Capability", "gsm_a.classmark3.gsm_1900_assoc_radio_cap",
4274 FT_UINT8, BASE_HEX, NULL, 0x00,
4275 NULL, HFILL}
4277 { &hf_gsm_a_umts_fdd_rat_cap,
4278 { "UMTS FDD Radio Access Technology Capability", "gsm_a.classmark3.umts_fdd_rat_cap",
4279 FT_BOOLEAN, BASE_NONE, TFS(&umts_fdd_rat_cap_vals), 0x00,
4280 NULL, HFILL}
4282 { &hf_gsm_a_umts_384_mcps_tdd_rat_cap,
4283 { "UMTS 3.84 Mcps TDD Radio Access Technology Capability", "gsm_a.classmark3.umts_384_mcps_tdd_rat_cap",
4284 FT_BOOLEAN, BASE_NONE, TFS(&umts_384_mcps_tdd_rat_cap_vals), 0x00,
4285 NULL, HFILL}
4287 { &hf_gsm_a_cdma_2000_rat_cap,
4288 { "CDMA 2000 Radio Access Technology Capability", "gsm_a.classmark3.cdma_2000_rat_cap",
4289 FT_BOOLEAN, BASE_NONE, TFS(&cdma_2000_rat_cap_vals), 0x00,
4290 NULL, HFILL}
4292 { &hf_gsm_a_dtm_e_gprs_multi_slot_info_present,
4293 { "DTM E/GPRS Multi Slot Information present", "gsm_a.classmark3.dtm_e_gprs_multi_slot_info_present",
4294 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4295 NULL, HFILL}
4297 { &hf_gsm_a_dtm_gprs_multi_slot_class,
4298 { "DTM GPRS Multi Slot Class", "gsm_a.classmark3.dtm_gprs_multi_slot_class",
4299 FT_UINT8, BASE_DEC, VALS(dtm_gprs_multi_slot_class_vals), 0x00,
4300 NULL, HFILL}
4302 { &hf_gsm_a_single_slot_dtm,
4303 { "Single Slot DTM", "gsm_a.classmark3.single_slot_dtm_supported",
4304 FT_BOOLEAN, BASE_NONE, TFS(&single_slot_dtm_vals), 0x0,
4305 NULL, HFILL}
4307 { &hf_gsm_a_dtm_egprs_multi_slot_class_present,
4308 { "DTM EGPRS Multi Slot Class present", "gsm_a.classmark3.dtm_egprs_multi_slot_class_present",
4309 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4310 NULL, HFILL}
4312 { &hf_gsm_a_dtm_egprs_multi_slot_class,
4313 { "DTM EGPRS Multi Slot Class", "gsm_a.classmark3.dtm_egprs_multi_slot_class",
4314 FT_UINT8, BASE_DEC, VALS(dtm_gprs_multi_slot_class_vals), 0x00,
4315 NULL, HFILL}
4317 { &hf_gsm_a_single_band_support,
4318 { "Single Band Support", "gsm_a.classmark3.single_band_support",
4319 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4320 NULL, HFILL}
4322 { &hf_gsm_a_gsm_band,
4323 { "GSM Band", "gsm_a.classmark3.gsm_band",
4324 FT_UINT8, BASE_DEC, VALS(gsm_band_vals), 0x00,
4325 NULL, HFILL}
4327 { &hf_gsm_a_gsm_750_assoc_radio_cap_present,
4328 { "GSM 750 Associated Radio Capability present", "gsm_a.classmark3.gsm_750_assoc_radio_cap_present",
4329 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4330 NULL, HFILL}
4332 { &hf_gsm_a_gsm_750_assoc_radio_cap,
4333 { "GSM 750 Associated Radio Capability", "gsm_a.classmark3.gsm_750_assoc_radio_cap",
4334 FT_UINT8, BASE_HEX, NULL, 0x00,
4335 NULL, HFILL}
4337 { &hf_gsm_a_umts_128_mcps_tdd_rat_cap,
4338 { "UMTS 1.28 Mcps TDD Radio Access Technology Capability", "gsm_a.classmark3.umts_128_mcps_tdd_rat_cap",
4339 FT_BOOLEAN, BASE_NONE, TFS(&umts_128_mcps_tdd_rat_cap_vals), 0x00,
4340 NULL, HFILL}
4342 { &hf_gsm_a_geran_feature_package_1,
4343 { "GERAN Feature Package 1", "gsm_a.classmark3.geran_feature_package_1",
4344 FT_BOOLEAN, BASE_NONE, TFS(&geran_feature_package_1_vals), 0x00,
4345 NULL, HFILL}
4347 { &hf_gsm_a_ext_dtm_e_gprs_multi_slot_info_present,
4348 { "Extended DTM E/GPRS Multi Slot Information present", "gsm_a.classmark3.ext_dtm_e_gprs_info_present",
4349 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4350 NULL, HFILL}
4352 { &hf_gsm_a_ext_dtm_gprs_multi_slot_class,
4353 { "Extended DTM GPRS Multi Slot Class", "gsm_a.classmark3.ext_dtm_gprs_multi_slot_class",
4354 FT_UINT8, BASE_HEX, NULL, 0x00,
4355 NULL, HFILL}
4357 { &hf_gsm_a_ext_dtm_egprs_multi_slot_class,
4358 { "Extended DTM EGPRS Multi Slot Class", "gsm_a.classmark3.ext_dtm_egprs_multi_slot_class",
4359 FT_UINT8, BASE_HEX, NULL, 0x00,
4360 NULL, HFILL}
4362 { &hf_gsm_a_high_multislot_cap_present,
4363 { "High Multislot Capability present", "gsm_a.classmark3.high_multislot_cap_present",
4364 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4365 NULL, HFILL}
4367 { &hf_gsm_a_high_multislot_cap,
4368 { "High Multislot Capability", "gsm_a.classmark3.high_multislot_cap",
4369 FT_UINT8, BASE_HEX, NULL, 0x00,
4370 NULL, HFILL}
4372 { &hf_gsm_a_geran_iu_mode_support,
4373 { "GERAN Iu Mode Support", "gsm_a.classmark3.geran_iu_mode_support",
4374 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4375 NULL, HFILL}
4377 { &hf_gsm_a_geran_iu_mode_cap,
4378 { "GERAN Iu Mode Capabilities", "gsm_a.classmark3.geran_iu_mode_cap",
4379 FT_UINT24, BASE_HEX, NULL, 0x00,
4380 NULL, HFILL}
4382 { &hf_gsm_a_geran_iu_mode_cap_length,
4383 { "Length", "gsm_a.classmark3.geran_iu_mode_cap.length",
4384 FT_UINT8, BASE_DEC, NULL, 0x00,
4385 NULL, HFILL}
4387 { &hf_gsm_a_flo_iu_cap,
4388 { "FLO Iu Capability", "gsm_a.classmark3.geran_iu_mode_cap.flo_iu_cap",
4389 FT_BOOLEAN, BASE_NONE, TFS(&flo_iu_cap_vals), 0x00,
4390 NULL, HFILL}
4392 { &hf_gsm_a_geran_feature_package_2,
4393 { "GERAN Feature Package 2", "gsm_a.classmark3.geran_feature_package_2",
4394 FT_BOOLEAN, BASE_NONE, TFS(&geran_feature_package_2_vals), 0x00,
4395 NULL, HFILL}
4397 { &hf_gsm_a_gmsk_multislot_power_prof,
4398 { "GMSK Multislot Power Profile", "gsm_a.classmark3.gmsk_multislot_power_prof",
4399 FT_UINT8, BASE_DEC, VALS(gmsk_multislot_power_prof_vals), 0x00,
4400 NULL, HFILL}
4402 { &hf_gsm_a_8_psk_multislot_power_prof,
4403 { "8-PSK Multislot Power Profile", "gsm_a.classmark3.8_psk_multislot_power_prof",
4404 FT_UINT8, BASE_DEC, VALS(eight_psk_multislot_power_prof_vals), 0x00,
4405 NULL, HFILL}
4407 { &hf_gsm_a_t_gsm_400_band_info_present,
4408 { "T-GSM 400 Band Information present", "gsm_a.classmark3.gsm_400_band_info_present",
4409 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4410 NULL, HFILL}
4412 { &hf_gsm_a_t_gsm_400_bands_supported,
4413 { "T-GSM 400 Bands Supported", "gsm_a.classmark3.t_gsm_400_bands_supported",
4414 FT_UINT8, BASE_HEX, VALS(t_gsm_400_bands_supported_vals), 0x00,
4415 NULL, HFILL}
4417 { &hf_gsm_a_t_gsm_400_assoc_radio_cap,
4418 { "T-GSM 400 Associated Radio Capability", "gsm_a.classmark3.t_gsm_400_assoc_radio_cap",
4419 FT_UINT8, BASE_HEX, NULL, 0x00,
4420 NULL, HFILL}
4422 { &hf_gsm_a_t_gsm_900_assoc_radio_cap_present,
4423 { "T-GSM 900 Associated Radio Capability present", "gsm_a.classmark3.t_gsm_900_assoc_radio_cap_present",
4424 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4425 NULL, HFILL}
4427 { &hf_gsm_a_t_gsm_900_assoc_radio_cap,
4428 { "T-GSM 900 Associated Radio Capability", "gsm_a.classmark3.t_gsm_900_assoc_radio_cap",
4429 FT_UINT8, BASE_HEX, NULL, 0x00,
4430 NULL, HFILL}
4432 { &hf_gsm_a_downlink_adv_receiver_perf,
4433 { "Downlink Advanced Receiver Performance", "gsm_a.classmark3.downlink_adv_receiver_perf",
4434 FT_UINT8, BASE_DEC, VALS(downlink_adv_receiver_perf_vals), 0x00,
4435 NULL, HFILL}
4437 { &hf_gsm_a_dtm_enhancements_cap,
4438 { "DTM Enhancements Capability", "gsm_a.classmark3.dtm_enhancements_capability",
4439 FT_BOOLEAN, BASE_NONE, TFS(&dtm_enhancements_cap_vals), 0x00,
4440 NULL, HFILL}
4442 { &hf_gsm_a_dtm_e_gprs_high_multi_slot_info_present,
4443 { "DTM E/GPRS High Multi Slot Information present", "gsm_a.classmark3.dtm_e_gprs_high_mutli_slot_info_present",
4444 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4445 NULL, HFILL}
4447 { &hf_gsm_a_dtm_gprs_high_multi_slot_class,
4448 { "DTM GPRS Multi Slot Class", "gsm_a.classmark3.dtm_gprs_multi_slot_class",
4449 FT_UINT8, BASE_DEC, VALS(dtm_gprs_high_multi_slot_class_vals), 0x00,
4450 NULL, HFILL}
4452 { &hf_gsm_a_offset_required,
4453 { "Offset required", "gsm_a.classmark3.offset_required",
4454 FT_BOOLEAN, BASE_NONE, TFS(&offset_required_vals), 0x0,
4455 NULL, HFILL}
4457 { &hf_gsm_a_dtm_egprs_high_multi_slot_class_present,
4458 { "DTM EGPRS High Multi Slot Class present", "gsm_a.classmark3.dtm_egprs_high_multi_slot_class_present",
4459 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4460 NULL, HFILL}
4462 { &hf_gsm_a_dtm_egprs_high_multi_slot_class,
4463 { "DTM EGPRS High Multi Slot Class", "gsm_a.classmark3.dtm_egprs_high_multi_slot_class",
4464 FT_UINT8, BASE_DEC, VALS(dtm_gprs_high_multi_slot_class_vals), 0x00,
4465 NULL, HFILL}
4467 { &hf_gsm_a_repeated_acch_cap,
4468 { "Repeated ACCH Capability", "gsm_a.classmark3.repeated_acch_cap",
4469 FT_BOOLEAN, BASE_NONE, TFS(&repeated_acch_cap_vals), 0x00,
4470 NULL, HFILL}
4472 { &hf_gsm_a_gsm_710_assoc_radio_cap_present,
4473 { "GSM 710 Associated Radio Capability present", "gsm_a.classmark3.gsm_710_assoc_radio_cap_present",
4474 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4475 NULL, HFILL}
4477 { &hf_gsm_a_gsm_710_assoc_radio_cap,
4478 { "GSM 710 Associated Radio Capability", "gsm_a.classmark3.gsm_710_assoc_radio_cap",
4479 FT_UINT8, BASE_HEX, NULL, 0x00,
4480 NULL, HFILL}
4482 { &hf_gsm_a_t_gsm_810_assoc_radio_cap_present,
4483 { "T-GSM 810 Associated Radio Capability present", "gsm_a.classmark3.t_gsm_810_assoc_radio_cap_present",
4484 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4485 NULL, HFILL}
4487 { &hf_gsm_a_t_gsm_810_assoc_radio_cap,
4488 { "T-GSM 810 Associated Radio Capability", "gsm_a.classmark3.t_gsm_810_assoc_radio_cap",
4489 FT_UINT8, BASE_HEX, NULL, 0x00,
4490 NULL, HFILL}
4492 { &hf_gsm_a_ciphering_mode_setting_cap,
4493 { "Ciphering Mode Setting Capability", "gsm_a.classmark3.ciphering_mode_setting_cap",
4494 FT_BOOLEAN, BASE_NONE, TFS(&ciphering_mode_setting_cap_vals), 0x00,
4495 NULL, HFILL}
4497 { &hf_gsm_a_additional_positioning_caps,
4498 { "Additional Positioning Capabilities", "gsm_a.classmark3.additional_positioning_caps",
4499 FT_BOOLEAN, BASE_NONE, TFS(&additional_positioning_caps_vals), 0x00,
4500 NULL, HFILL}
4502 { &hf_gsm_a_e_utra_fdd_support,
4503 { "E-UTRA FDD support", "gsm_a.classmark3.e_utra_fdd_support",
4504 FT_BOOLEAN, BASE_NONE, TFS(&e_utra_fdd_support_vals), 0x00,
4505 NULL, HFILL}
4507 { &hf_gsm_a_e_utra_tdd_support,
4508 { "E-UTRA TDD support", "gsm_a.classmark3.e_utra_tdd_support",
4509 FT_BOOLEAN, BASE_NONE, TFS(&e_utra_tdd_support_vals), 0x00,
4510 NULL, HFILL}
4512 { &hf_gsm_a_e_utra_meas_and_report_support,
4513 { "E-UTRA Measurement and Reporting support", "gsm_a.classmark3.e_utra_meas_and_report_support",
4514 FT_BOOLEAN, BASE_NONE, TFS(&e_utra_meas_and_report_support_vals), 0x00,
4515 NULL, HFILL}
4517 { &hf_gsm_a_prio_based_resel_support,
4518 { "Priority-based reselection support", "gsm_a.classmark3.prio_based_resel_support",
4519 FT_BOOLEAN, BASE_NONE, TFS(&prio_based_resel_support_vals), 0x00,
4520 NULL, HFILL}
4522 { &hf_gsm_a_utra_csg_cells_reporting,
4523 { "UTRA CSG Cells Reporting", "gsm_a.classmark3.utra_csg_cells_reporting",
4524 FT_BOOLEAN, BASE_NONE, TFS(&utra_csg_cells_reporting_vals), 0x00,
4525 NULL, HFILL}
4527 { &hf_gsm_a_vamos_level,
4528 { "VAMOS Level", "gsm_a.classmark3.vamos_level",
4529 FT_UINT8, BASE_DEC, VALS(vamos_level_vals), 0x00,
4530 NULL, HFILL}
4532 { &hf_gsm_a_tighter_cap,
4533 { "TIGHTER Capability", "gsm_a.classmark3.tighter_cap",
4534 FT_UINT8, BASE_DEC, VALS(tighter_cap_level_vals), 0x00,
4535 NULL, HFILL}
4537 { &hf_gsm_a_selective_ciph_down_sacch,
4538 { "Selective Ciphering of Downlink SACCH", "gsm_a.classmark3.selective_ciph_down_sacch",
4539 FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x00,
4540 NULL, HFILL}
4542 { &hf_gsm_a_cs_to_ps_srvcc_geran_to_utra,
4543 { "CS to PS SRVCC from GERAN to UTRA", "gsm_a.classmark3.cs_to_ps_srvcc_geran_to_utra",
4544 FT_UINT8, BASE_DEC, VALS(cs_to_ps_srvcc_geran_to_utra_vals), 0x00,
4545 NULL, HFILL}
4547 { &hf_gsm_a_cs_to_ps_srvcc_geran_to_eutra,
4548 { "CS to PS SRVCC from GERAN to E-UTRA", "gsm_a.classmark3.cs_to_ps_srvcc_geran_to_eutra",
4549 FT_UINT8, BASE_DEC, VALS(cs_to_ps_srvcc_geran_to_eutra_vals), 0x00,
4550 NULL, HFILL}
4552 { &hf_gsm_a_geran_network_sharing_support,
4553 { "GERAN Network Sharing support", "gsm_a.classmark3.geran_network_sharing_support",
4554 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4555 NULL, HFILL}
4557 { &hf_gsm_a_eutra_wb_rsrq_support,
4558 { "E-UTRA Wideband RSRQ measurements support", "gsm_a.classmark3.eutra_wb_rsrq_support",
4559 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4560 NULL, HFILL}
4562 { &hf_gsm_a_er_band_support,
4563 { "ER Band support", "gsm_a.classmark3.er_band_support",
4564 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4565 NULL, HFILL}
4567 { &hf_gsm_a_utra_mfbi_support,
4568 { "UTRA Multiple Frequency Band Indicators support", "gsm_a.classmark3.utra_mfbi_support",
4569 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4570 NULL, HFILL}
4572 { &hf_gsm_a_eutra_mfbi_support,
4573 { "E-UTRA Multiple Frequency Band Indicators support", "gsm_a.classmark3.eutra_mfbi_support",
4574 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4575 NULL, HFILL}
4577 { &hf_gsm_a_ext_tsc_set_cap_support,
4578 { "Extended TSC Set Capability support", "gsm_a.classmark3.ext_tsc_set_cap_support",
4579 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
4580 NULL, HFILL}
4582 { &hf_gsm_a_ext_earfcn_value_range,
4583 { "Extended EARFCN value range", "gsm_a.classmark3.ext_earfcn_value_range",
4584 FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x00,
4585 NULL, HFILL}
4587 { &hf_gsm_a_geo_loc_type_of_shape,
4588 { "Location estimate", "gsm_a.gad.location_estimate",
4589 FT_UINT8, BASE_DEC, VALS(type_of_shape_vals), 0xf0,
4590 NULL, HFILL }
4592 { &hf_gsm_a_geo_loc_sign_of_lat,
4593 { "Sign of latitude", "gsm_a.gad.sign_of_latitude",
4594 FT_UINT8, BASE_DEC, VALS(sign_of_latitude_vals), 0x80,
4595 NULL, HFILL }
4597 { &hf_gsm_a_geo_loc_deg_of_lat,
4598 { "Degrees of latitude", "gsm_a.gad.deg_of_latitude",
4599 FT_UINT24, BASE_DEC, NULL, 0x7fffff,
4600 NULL, HFILL }
4602 { &hf_gsm_a_geo_loc_deg_of_long,
4603 { "Degrees of longitude", "gsm_a.gad.deg_of_longitude",
4604 FT_INT24, BASE_DEC, NULL, 0xffffff,
4605 NULL, HFILL }
4607 { &hf_gsm_a_geo_loc_osm_uri,
4608 { "Location OSM URI", "gsm_a.gad.location_uri",
4609 FT_STRING, BASE_NONE, NULL, 0x0,
4610 NULL, HFILL }
4612 { &hf_gsm_a_geo_loc_uncertainty_code,
4613 { "Uncertainty code", "gsm_a.gad.uncertainty_code",
4614 FT_UINT8, BASE_DEC, NULL, 0x7f,
4615 NULL, HFILL }
4617 { &hf_gsm_a_geo_loc_uncertainty_semi_major,
4618 { "Uncertainty semi-major", "gsm_a.gad.uncertainty_semi_major",
4619 FT_UINT8, BASE_DEC, NULL, 0x7f,
4620 NULL, HFILL }
4622 { &hf_gsm_a_geo_loc_uncertainty_semi_minor,
4623 { "Uncertainty semi-minor", "gsm_a.gad.uncertainty_semi_minor",
4624 FT_UINT8, BASE_DEC, NULL, 0x7f,
4625 NULL, HFILL }
4627 { &hf_gsm_a_geo_loc_orientation_of_major_axis,
4628 { "Orientation of major axis", "gsm_a.gad.orientation_of_major_axis",
4629 FT_UINT8, BASE_DEC, NULL, 0x0,
4630 NULL, HFILL }
4632 { &hf_gsm_a_geo_loc_uncertainty_altitude,
4633 { "Uncertainty Altitude", "gsm_a.gad.uncertainty_altitude",
4634 FT_UINT8, BASE_DEC, NULL, 0x7f,
4635 NULL, HFILL }
4637 { &hf_gsm_a_geo_loc_confidence,
4638 { "Confidence(%)", "gsm_a.gad.confidence",
4639 FT_UINT8, BASE_DEC, NULL, 0x7f,
4640 NULL, HFILL }
4642 { &hf_gsm_a_geo_loc_uncertainty_range,
4643 { "Uncertainty Range", "gsm_a.gad.uncertainty_range",
4644 FT_UINT8, BASE_DEC, VALS(uncertainty_range), 0x80,
4645 NULL, HFILL }
4647 { &hf_gsm_a_geo_loc_horizontal_confidence,
4648 { "Horizontal confidence(%)", "gsm_a.gad.horizontal_confidence",
4649 FT_UINT8, BASE_DEC, NULL, 0x7f,
4650 NULL, HFILL }
4652 { &hf_gsm_a_geo_loc_horizontal_uncertainty_range,
4653 { "Horizontal Uncertainty Range", "gsm_a.gad.horizontal_uncertainty_range",
4654 FT_UINT8, BASE_DEC, VALS(uncertainty_range), 0x80,
4655 NULL, HFILL }
4657 { &hf_gsm_a_geo_loc_vertical_confidence,
4658 { "Vertical Confidence(%)", "gsm_a.gad.vertical_confidence",
4659 FT_UINT8, BASE_DEC, NULL, 0x7f,
4660 NULL, HFILL }
4662 { &hf_gsm_a_geo_loc_vertical_uncertainty_range,
4663 { "Vertical Uncertainty Range", "gsm_a.gad.vertical_uncertainty_range",
4664 FT_UINT8, BASE_DEC, VALS(uncertainty_range), 0x80,
4665 NULL, HFILL }
4667 { &hf_gsm_a_geo_loc_high_acc_uncertainty_alt,
4668 { "High accuracy uncertainty altitude", "gsm_a.gad.high_acc_uncertainty_alt",
4669 FT_UINT8, BASE_DEC, NULL, 0x0,
4670 NULL, HFILL }
4672 { &hf_gsm_a_geo_loc_no_of_points,
4673 { "Number of points", "gsm_a.gad.no_of_points",
4674 FT_UINT8, BASE_DEC, NULL, 0x0f,
4675 NULL, HFILL }
4677 { &hf_gsm_a_geo_loc_high_acc_deg_of_lat,
4678 { "High accuracy degrees of latitude", "gsm_a.gad.hig_acc_deg_of_lat",
4679 FT_INT32, BASE_DEC, NULL, 0x0,
4680 NULL, HFILL }
4682 { &hf_gsm_a_geo_loc_high_acc_deg_of_long,
4683 { "High accuracy degrees of longitude", "gsm_a.gad.high_acc_deg_of_long",
4684 FT_INT32, BASE_DEC, NULL, 0x0,
4685 NULL, HFILL }
4687 { &hf_gsm_a_geo_loc_high_acc_uncertainty_semi_major,
4688 { "High accuracy uncertainty semi-major", "gsm_a.gad.high_acc_uncertainty_semi_major",
4689 FT_UINT8, BASE_DEC, NULL, 0x0,
4690 NULL, HFILL }
4692 { &hf_gsm_a_geo_loc_high_acc_uncertainty_semi_minor,
4693 { "High accuracy uncertainty semi-minor", "gsm_a.gad.high_acc_uncertainty_semi_minor",
4694 FT_UINT8, BASE_DEC, NULL, 0x0,
4695 NULL, HFILL }
4697 { &hf_gsm_a_geo_loc_high_acc_alt,
4698 { "High accuracy altitude", "gsm_a.gad.high_acc_alt",
4699 FT_INT24, BASE_DEC, NULL, 0x3fffff,
4700 NULL, HFILL }
4702 { &hf_gsm_a_velocity_type,
4703 { "Velocity type", "gsm_a.gad.velocity_type",
4704 FT_UINT8, BASE_DEC, VALS(gsm_a_velocity_type_vals), 0xf0,
4705 NULL, HFILL }
4707 { &hf_gsm_a_bearing,
4708 { "Bearing", "gsm_a.gad.bearing",
4709 FT_UINT16, BASE_DEC, NULL, 0x0,
4710 NULL, HFILL }
4712 { &hf_gsm_a_horizontal_speed,
4713 { "Horizontal Speed", "gsm_a.gad.horizontal_velocity",
4714 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kmh), 0x0,
4715 NULL, HFILL }
4717 { &hf_gsm_a_vertical_speed,
4718 { "Vertical Speed", "gsm_a.gad.vertical_speed",
4719 FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kmh), 0x0,
4720 NULL, HFILL }
4722 { &hf_gsm_a_uncertainty_speed,
4723 { "Uncertainty Speed", "gsm_a.gad.uncertainty_speed",
4724 FT_UINT8, BASE_DEC, NULL, 0x0,
4725 NULL, HFILL }
4727 { &hf_gsm_a_h_uncertainty_speed,
4728 { "Horizontal Uncertainty Speed", "gsm_a.gad.h_uncertainty_speed",
4729 FT_UINT8, BASE_DEC, NULL, 0x0,
4730 NULL, HFILL }
4732 { &hf_gsm_a_v_uncertainty_speed,
4733 { "Vertical Uncertainty Speed", "gsm_a.gad.v_uncertainty_speed",
4734 FT_UINT8, BASE_DEC, NULL, 0x0,
4735 NULL, HFILL }
4737 { &hf_gsm_a_d,
4738 { "Direction of Vertical Speed", "gsm_a.gad.d",
4739 FT_BOOLEAN, 8, TFS(&gsm_a_dir_of_ver_speed_vals), 0x02,
4740 NULL, HFILL}
4742 { &hf_gsm_a_geo_loc_D,
4743 { "D: Direction of Altitude", "gsm_a.gad.D",
4744 FT_UINT16, BASE_DEC, VALS(dir_of_alt_vals), 0x8000,
4745 NULL, HFILL }
4747 { &hf_gsm_a_geo_loc_altitude,
4748 { "Altitude in meters", "gsm_a.gad.altitude",
4749 FT_UINT16, BASE_DEC, NULL, 0x7fff,
4750 NULL, HFILL }
4752 { &hf_gsm_a_geo_loc_inner_radius,
4753 { "Inner radius", "gsm_a.gad.inner_radius",
4754 FT_UINT16, BASE_DEC, NULL, 0x0,
4755 NULL, HFILL }
4757 { &hf_gsm_a_geo_loc_uncertainty_radius,
4758 { "Uncertainty radius", "gsm_a.gad.uncertainty_radius",
4759 FT_UINT8, BASE_DEC, NULL, 0x7f,
4760 NULL, HFILL }
4762 { &hf_gsm_a_geo_loc_offset_angle,
4763 { "Offset angle", "gsm_a.gad.offset_angle",
4764 FT_UINT8, BASE_DEC, NULL, 0x0,
4765 NULL, HFILL }
4767 { &hf_gsm_a_geo_loc_included_angle,
4768 { "Included angle", "gsm_a.gad.included_angle",
4769 FT_UINT8, BASE_DEC, NULL, 0x0,
4770 NULL, HFILL }
4772 { &hf_gsm_a_key_seq,
4773 { "key sequence", "gsm_a.key_seq",
4774 FT_UINT8, BASE_DEC, VALS(gsm_a_key_seq_vals), 0x00,
4775 NULL, HFILL }
4777 { &hf_gsm_a_lac,
4778 { "Location Area Code (LAC)", "gsm_a.lac",
4779 FT_UINT16, BASE_HEX_DEC, NULL, 0x00,
4780 NULL, HFILL }
4782 { &hf_gsm_a_spare_nibble,
4783 { "Spare Nibble", "gsm_a.spare",
4784 FT_UINT8, BASE_DEC_HEX, NULL, 0x00,
4785 NULL, HFILL }
4787 /* Generated from convert_proto_tree_add_text.pl */
4788 { &hf_gsm_a_filler, { "Filler", "gsm_a.filler", FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL }},
4789 { &hf_gsm_a_identity_digit1, { "Identity Digit 1", "gsm_a.identity_digit1", FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL }},
4790 { &hf_gsm_a_group_call_reference, { "Group or Broadcast call reference", "gsm_a.group_call_reference", FT_UINT32, BASE_DEC_HEX, NULL, 0xffffffe0, NULL, HFILL }},
4791 { &hf_gsm_a_service_flag, { "SF Service Flag", "gsm_a.service_flag", FT_BOOLEAN, 32, TFS(&tfs_vgcs_vbs), 0x00000010, NULL, HFILL }},
4792 { &hf_gsm_a_af_acknowledgement, { "AF Acknowledgement", "gsm_a.af_acknowledgement", FT_BOOLEAN, 32, TFS(&tfs_required_not_required), 0x00000008, NULL, HFILL }},
4793 { &hf_gsm_a_call_priority, { "Call Priority", "gsm_a.call_priority", FT_UINT32, BASE_DEC, VALS(gsm_a_call_priority_vals), 0x00000007, NULL, HFILL }},
4794 { &hf_gsm_a_ciphering_info, { "Ciphering Information", "gsm_a.ciphering_info", FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL }},
4795 { &hf_gsm_a_sapi, { "SAPI (Service Access Point Identifier)", "gsm_a.sapi", FT_UINT8, BASE_DEC, VALS(gsm_a_sapi_vals), 0x30, NULL, HFILL }},
4798 /* Setup protocol subtree array */
4799 #define NUM_INDIVIDUAL_ELEMS 2
4800 static int *ett[NUM_INDIVIDUAL_ELEMS +
4801 NUM_GSM_COMMON_ELEM];
4803 static ei_register_info ei[] = {
4804 { &ei_gsm_a_extraneous_data, { "gsm_a.extraneous_data", PI_PROTOCOL, PI_NOTE, "Extraneous Data, dissector bug or later version spec(report to wireshark.org)", EXPFILL }},
4805 { &ei_gsm_a_unknown_element, { "gsm_a.unknown_element", PI_PROTOCOL, PI_ERROR, "Unknown - aborting dissection", EXPFILL }},
4806 { &ei_gsm_a_unknown_pdu_type, { "gsm_a.unknown_pdu_type", PI_PROTOCOL, PI_WARN, "Unknown PDU type", EXPFILL }},
4807 { &ei_gsm_a_no_element_dissector, { "gsm_a.no_element_dissector", PI_PROTOCOL, PI_WARN, "No element dissector, rest of dissection may be incorrect", EXPFILL }},
4808 { &ei_gsm_a_format_not_supported, { "gsm_a.format_not_supported", PI_PROTOCOL, PI_WARN, "Format not supported", EXPFILL }},
4809 { &ei_gsm_a_mobile_identity_type, { "gsm_a.ie.mobileid.type.unknown", PI_PROTOCOL, PI_WARN, "Format unknown", EXPFILL }},
4810 { &ei_gsm_a_ie_length_too_short, { "gsm_a.ie.length_too_short", PI_PROTOCOL, PI_ERROR, "IE length too short", EXPFILL }}
4813 expert_module_t* expert_a_common;
4815 static tap_param gsm_a_stat_params[] = {
4816 { PARAM_FILTER, "filter", "Filter", NULL, true }
4819 static stat_tap_table_ui gsm_a_bssmap_stat_table = {
4820 REGISTER_TELEPHONY_GROUP_GSM,
4821 "A-Interface BSSMAP",
4822 "gsm_a",
4823 "gsm_a,bssmap",
4824 gsm_a_bssmap_stat_init,
4825 gsm_a_bssmap_stat_packet,
4826 gsm_a_stat_reset,
4827 gsm_a_stat_free_table_item,
4828 NULL,
4829 array_length(gsm_a_stat_fields), gsm_a_stat_fields,
4830 array_length(gsm_a_stat_params), gsm_a_stat_params,
4831 NULL,
4835 static stat_tap_table_ui gsm_a_dtap_mm_stat_table = {
4836 REGISTER_TELEPHONY_GROUP_GSM,
4837 "A-Interface DTAP Mobility Management",
4838 "gsm_a",
4839 "gsm_a,dtap_mm",
4840 gsm_a_dtap_mm_stat_init,
4841 gsm_a_dtap_mm_stat_packet,
4842 gsm_a_stat_reset,
4843 gsm_a_stat_free_table_item,
4844 NULL,
4845 array_length(gsm_a_stat_fields), gsm_a_stat_fields,
4846 array_length(gsm_a_stat_params), gsm_a_stat_params,
4847 NULL,
4851 static stat_tap_table_ui gsm_a_dtap_rr_stat_table = {
4852 REGISTER_TELEPHONY_GROUP_GSM,
4853 "A-Interface DTAP Radio Resource Management",
4854 "gsm_a",
4855 "gsm_a,dtap_rr",
4856 gsm_a_dtap_rr_stat_init,
4857 gsm_a_dtap_rr_stat_packet,
4858 gsm_a_stat_reset,
4859 gsm_a_stat_free_table_item,
4860 NULL,
4861 array_length(gsm_a_stat_fields), gsm_a_stat_fields,
4862 array_length(gsm_a_stat_params), gsm_a_stat_params,
4863 NULL,
4867 static stat_tap_table_ui gsm_a_dtap_cc_stat_table = {
4868 REGISTER_TELEPHONY_GROUP_GSM,
4869 "A-Interface DTAP Call Control",
4870 "gsm_a",
4871 "gsm_a,dtap_cc",
4872 gsm_a_dtap_cc_stat_init,
4873 gsm_a_dtap_cc_stat_packet,
4874 gsm_a_stat_reset,
4875 gsm_a_stat_free_table_item,
4876 NULL,
4877 array_length(gsm_a_stat_fields), gsm_a_stat_fields,
4878 array_length(gsm_a_stat_params), gsm_a_stat_params,
4879 NULL,
4883 static stat_tap_table_ui gsm_a_dtap_gmm_stat_table = {
4884 REGISTER_TELEPHONY_GROUP_GSM,
4885 "A-Interface DTAP GPRS Mobility Management",
4886 "gsm_a",
4887 "gsm_a,dtap_gmm",
4888 gsm_a_dtap_gmm_stat_init,
4889 gsm_a_dtap_gmm_stat_packet,
4890 gsm_a_stat_reset,
4891 gsm_a_stat_free_table_item,
4892 NULL,
4893 array_length(gsm_a_stat_fields), gsm_a_stat_fields,
4894 array_length(gsm_a_stat_params), gsm_a_stat_params,
4895 NULL,
4899 static stat_tap_table_ui gsm_a_dtap_sm_stat_table = {
4900 REGISTER_TELEPHONY_GROUP_GSM,
4901 "A-Interface DTAP GPRS Session Management",
4902 "gsm_a",
4903 "gsm_a,dtap_sm",
4904 gsm_a_dtap_sm_stat_init,
4905 gsm_a_dtap_sm_stat_packet,
4906 gsm_a_stat_reset,
4907 gsm_a_stat_free_table_item,
4908 NULL,
4909 array_length(gsm_a_stat_fields), gsm_a_stat_fields,
4910 array_length(gsm_a_stat_params), gsm_a_stat_params,
4911 NULL,
4915 static stat_tap_table_ui gsm_a_dtap_sms_stat_table = {
4916 REGISTER_TELEPHONY_GROUP_GSM,
4917 "A-Interface DTAP Short Message Service",
4918 "gsm_a",
4919 "gsm_a,dtap_sms",
4920 gsm_a_dtap_sms_stat_init,
4921 gsm_a_dtap_sms_stat_packet,
4922 gsm_a_stat_reset,
4923 gsm_a_stat_free_table_item,
4924 NULL,
4925 array_length(gsm_a_stat_fields), gsm_a_stat_fields,
4926 array_length(gsm_a_stat_params), gsm_a_stat_params,
4927 NULL,
4931 static stat_tap_table_ui gsm_a_dtap_tp_stat_table = {
4932 REGISTER_TELEPHONY_GROUP_GSM,
4933 "A-Interface DTAP Special Conformance Testing Functions",
4934 "gsm_a",
4935 "gsm_a,dtap_tp",
4936 gsm_a_dtap_tp_stat_init,
4937 gsm_a_dtap_tp_stat_packet,
4938 gsm_a_stat_reset,
4939 gsm_a_stat_free_table_item,
4940 NULL,
4941 array_length(gsm_a_stat_fields), gsm_a_stat_fields,
4942 array_length(gsm_a_stat_params), gsm_a_stat_params,
4943 NULL,
4947 static stat_tap_table_ui gsm_a_dtap_ss_stat_table = {
4948 REGISTER_TELEPHONY_GROUP_GSM,
4949 "A-Interface DTAP Supplementary Services",
4950 "gsm_a",
4951 "gsm_a,dtap_ss",
4952 gsm_a_dtap_ss_stat_init,
4953 gsm_a_dtap_ss_stat_packet,
4954 gsm_a_stat_reset,
4955 gsm_a_stat_free_table_item,
4956 NULL,
4957 array_length(gsm_a_stat_fields), gsm_a_stat_fields,
4958 array_length(gsm_a_stat_params), gsm_a_stat_params,
4959 NULL,
4963 static stat_tap_table_ui gsm_a_sacch_rr_stat_table = {
4964 REGISTER_TELEPHONY_GROUP_GSM,
4965 "A-Interface SACCH",
4966 "gsm_a",
4967 "gsm_a,dtap_sacch",
4968 gsm_a_sacch_rr_stat_init,
4969 gsm_a_sacch_rr_stat_packet,
4970 gsm_a_stat_reset,
4971 gsm_a_stat_free_table_item,
4972 NULL,
4973 array_length(gsm_a_stat_fields), gsm_a_stat_fields,
4974 array_length(gsm_a_stat_params), gsm_a_stat_params,
4975 NULL,
4979 last_offset = NUM_INDIVIDUAL_ELEMS;
4981 ett[0] = &ett_gsm_a_plmn;
4982 ett[1] = &ett_gsm_a_poly_pnt;
4983 for (i=0; i < NUM_GSM_COMMON_ELEM; i++, last_offset++)
4985 ett[last_offset] = &ett_gsm_common_elem[i];
4988 /* Register the protocol name and description */
4990 proto_a_common =
4991 proto_register_protocol("GSM A-I/F COMMON", "GSM COMMON", "gsm_a");
4993 proto_register_field_array(proto_a_common, hf, array_length(hf));
4995 proto_register_subtree_array(ett, array_length(ett));
4996 expert_a_common = expert_register_protocol(proto_a_common);
4997 expert_register_field_array(expert_a_common, ei, array_length(ei));
5000 gsm_a_tap = register_tap("gsm_a");
5002 register_stat_tap_table_ui(&gsm_a_bssmap_stat_table);
5003 register_stat_tap_table_ui(&gsm_a_dtap_mm_stat_table);
5004 register_stat_tap_table_ui(&gsm_a_dtap_rr_stat_table);
5005 register_stat_tap_table_ui(&gsm_a_dtap_cc_stat_table);
5006 register_stat_tap_table_ui(&gsm_a_dtap_gmm_stat_table);
5007 register_stat_tap_table_ui(&gsm_a_dtap_sms_stat_table);
5008 register_stat_tap_table_ui(&gsm_a_dtap_sm_stat_table);
5009 register_stat_tap_table_ui(&gsm_a_dtap_ss_stat_table);
5010 register_stat_tap_table_ui(&gsm_a_dtap_tp_stat_table);
5011 register_stat_tap_table_ui(&gsm_a_sacch_rr_stat_table);
5013 /* Register a 3GPP protocol to be used for "global hf" that can be used to track inter protocol relations*/
5014 static hf_register_info hf_3gpp[] =
5016 { &hf_3gpp_tmsi,
5017 { "TMSI/P-TMSI/M-TMSI/5G-TMSI", "3gpp.tmsi",
5018 FT_UINT32, BASE_DEC_HEX, 0, 0x0,
5019 "Filter TMSI, P-TMSI, M-TMSI, 5G-TMSI across protocols", HFILL }
5023 proto_3gpp = proto_register_protocol("3GPP COMMON", "3GPP COMMON", "3gpp");
5025 proto_register_field_array(proto_3gpp, hf_3gpp, array_length(hf_3gpp));
5030 * Editor modelines - https://www.wireshark.org/tools/modelines.html
5032 * Local variables:
5033 * c-basic-offset: 4
5034 * tab-width: 8
5035 * indent-tabs-mode: nil
5036 * End:
5038 * vi: set shiftwidth=4 tabstop=8 expandtab:
5039 * :indentSize=4:tabSize=8:noTabs=true: