Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-a21.c
blob65ba07bff9ded31156b65615469f5da9a6965d31
1 /* packet-a21.c
3 * Routines for A21/s102 Message dissection
4 * Copyright 2012, Joseph Chai <chaienzhao@gmail.com>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
12 * Ref: 3GPP2 A.S0008-C v4.0
15 #include "config.h"
17 #include <epan/packet.h>
18 #include <epan/expert.h>
19 #include <epan/tfs.h>
21 #include "packet-e212.h"
22 #include "packet-a21.h"
24 void proto_register_a21(void);
25 void proto_reg_handoff_a21(void);
27 #define A21_PORT 23272
28 static dissector_handle_t a21_handle;
29 static dissector_handle_t gcsna_handle;
31 static int proto_a21;
33 static int hf_a21_message_type;
34 static int hf_a21_element_identifier;
35 static int hf_a21_element_length;
36 static int hf_a21_corr_id_corr_value;
37 static int hf_a21_mn_id_msid_value;
38 static int hf_a21_mn_id_odd_even_indicator;
39 static int hf_a21_mn_id_type_of_identity;
40 static int hf_a21_mn_id_esn;
41 static int hf_a21_mn_id_identity_digit_1;
42 static int hf_a21_gcsna_pdu_length;
43 static int hf_a21_gcsna_content;
44 static int hf_a21_reference_cell_id_cell;
45 static int hf_a21_reference_cell_id_sector;
46 static int hf_a21_mob_sub_info_record_id;
47 static int hf_a21_mob_sub_info_record_length;
48 static int hf_a21_mob_sub_info_record_content;
49 static int hf_a21_mob_sub_info_re_con_all_band_inc;
50 static int hf_a21_mob_sub_info_re_con_curr_band_sub;
51 static int hf_a21_mob_sub_info_re_band_class;
52 static int hf_a21_mob_sub_info_re_con_all_sub_band_inc;
53 static int hf_a21_mob_sub_info_re_sub_cls_len;
55 static int hf_a21_mob_sub_info_re_con_band_class;
57 static int hf_a21_auth_chall_para_rand_num_type;
58 static int hf_a21_auth_chall_para_rand_value;
59 static int hf_a21_service_option;
60 static int hf_a21_gcsna_status_reserved;
61 static int hf_a21_gcsna_status_priority_incl;
62 static int hf_a21_gcsna_status_gec;
63 static int hf_a21_gcsna_status_status_incl;
64 static int hf_a21_gcsna_status;
65 static int hf_a21_gcsna_status_call_priority;
66 static int hf_a21_3G1X_parameters;
67 static int hf_a21_reserved;
68 static int hf_a21_msg_tran_ctrl_paging_msg;
69 static int hf_a21_msg_tran_ctrl_simul_xmit_with_next;
70 static int hf_a21_msg_tran_ctrl_ackrequired;
71 static int hf_a21_msg_tran_ctrl_3GXLogicalChannel;
72 static int hf_a21_msg_tran_ctrl_protocol_revision;
73 static int hf_a21_1x_lac_en_pdu;
74 static int hf_a21_pilot_list_num_of_pilots;
75 static int hf_a21_cause_value;
76 static int hf_a21_mscid_market_id;
77 static int hf_a21_mscid_switch_number;
78 static int hf_a21_event;
79 static int hf_a21_additional_event_info;
80 static int hf_a21_allowed_forward_link_message;
81 static int hf_a21_channel_record_length;
82 static int hf_a21_ch_rec_sys_type;
83 static int hf_a21_ch_rec_band_class;
84 static int hf_a21_ch_rec_ch_num;
86 static int hf_a21_cell_id_info;
87 static int hf_a21_msc_id;
88 static int hf_a21_cell_id;
89 static int hf_a21_sector;
90 static int hf_a21_hrpd_sector_id_len;
91 static int hf_a21_ch_hrpd_sector_id;
92 static int hf_a21_ch_reference_pilot;
93 static int hf_a21_ch_pilot_pn;
94 static int hf_a21_ch_pilot_pn_phase;
95 static int hf_a21_ch_pilot_strength;
96 static int hf_a21_ch_pilot_ow_delay_flag;
97 static int hf_a21_ch_pilot_ow_delay;
98 static int hf_a21_sc0;
99 static int hf_a21_sc1;
100 static int hf_a21_sc2;
101 static int hf_a21_sc3;
102 static int hf_a21_sc4;
103 static int hf_a21_sc5;
104 static int hf_a21_sc6;
105 static int hf_a21_sc7;
107 static int ett_a21;
108 static int ett_a21_ie;
109 static int ett_a21_corr_id;
110 static int ett_a21_record_content;
111 static int ett_a21_pilot_list;
112 static int ett_a21_cr;
113 static int ett_a21_band_class;
115 static expert_field ei_a21_ie_data_not_dissected_yet;
117 static const value_string a21_message_type_vals[] = {
118 {0x01, "A21-1x Air Interface Signalling"}, /* 01H */
119 {0x02, "A21-Ack"}, /* 02H */
120 {0x03, "A21-1x Parameters"}, /* 03H */
121 {0x04, "A21-Event Notification"}, /* 04H */
122 {0x05, "A21-1x Parameters Request"}, /* 05H */
123 {0x06, "A21-Service Request"}, /* 06H */
124 {0x07, "A21-Service Response"}, /* 07H */
125 {0x08, "A21-Radio Update Request"}, /* 08H */
126 {0x09, "A21-Radio Update Response"}, /* 09H */
127 {0, NULL}
130 #define A21_IEI_1X_LAC_ENCAPSULATED_PDU 0x01 /* 01H */
131 #define A21_IEI_A21_1X_PARAMETERS 0x02 /* 02H */
132 #define A21_IEI_PILOT_LIST 0x03 /* 03H */
133 #define A21_IEI_CORRELATION_ID 0x04 /* 04H */
134 #define A21_IEI_MOBILE_IDENTITY 0x05 /* 05H */
135 #define A21_IEI_AUTHENTICATION_CHALLENGE_PARAMETER 0x06 /* 06H */
136 #define A21_IEI_A21_1X_MESSAGE_TRANSMISSION_CONTROL 0x07 /* 07H */
137 #define A21_IEI_A21_CAUSE 0x08 /* 08H */
138 #define A21_IEI_A21_EVENT 0x09 /* 09H */
139 #define A21_IEI_SERVICE_OPTION 0x0A /* 0AH */
140 #define A21_IEI_A21_MOBILE_SUBSCRIPTION_INFORMATION 0x0B /* 0BH */
141 #define A21_IEI_GCSNA_STATUS 0x0C /* 0CH */
142 #define A21_IEI_GCSNA_PDU 0xC0 /* C0H */
143 #define A21_IEI_REFERENCE_CELL_ID 0x0D /* 0DH */
144 /*(Reserved range of IEIs for S102) 30H-3FH */
148 static void
149 dissect_a21_correlation_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_)
151 int offset = 0;
152 proto_item *tc;
153 proto_tree *corr_tree;
154 uint32_t corr_id;
156 corr_tree = proto_tree_add_subtree(tree, tvb, offset, 6, ett_a21_corr_id, &tc, "A21 Correlation ID");
158 proto_tree_add_item(corr_tree, hf_a21_element_identifier, tvb, offset, 1, ENC_BIG_ENDIAN);
159 offset++;
160 proto_tree_add_item(corr_tree, hf_a21_element_length, tvb, offset, 1, ENC_BIG_ENDIAN);
161 offset++;
163 proto_tree_add_item_ret_uint(corr_tree, hf_a21_corr_id_corr_value, tvb, offset, 4, ENC_BIG_ENDIAN, &corr_id);
164 proto_item_append_text(tc, " %u", corr_id);
165 /* offset += 4; */
169 static const value_string a21_mn_id_type_of_identity_vals[] = {
170 { 0, "No Identity Code" },
171 { 1, "MEID" },
172 { 5, "ESN" },
173 { 6, "IMSI" },
174 { 0, NULL }
177 /* 5.2.4.8 Mobile Identity (MN ID) */
178 static void
179 dissect_a21_mobile_identity(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_)
181 int offset = 0;
182 unsigned identity_type;
183 const char *imsi_str;
185 if (tree == NULL)
186 return;
188 identity_type = tvb_get_uint8(tvb, offset) & 0x07;
189 proto_tree_add_item(tree, hf_a21_mn_id_type_of_identity, tvb, offset, 1, ENC_BIG_ENDIAN);
191 switch (identity_type) {
192 case 0:
193 /* No Identity Code */
194 proto_tree_add_item(tree, hf_a21_mn_id_msid_value, tvb, offset, 1, ENC_BIG_ENDIAN);
195 /* offset++; */
196 break;
197 case 1:
198 /* MEID */
199 proto_tree_add_item(tree, hf_a21_mn_id_odd_even_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
200 /* offset++; */
201 break;
202 case 5:
203 /* ESN */
204 proto_tree_add_item(tree, hf_a21_mn_id_odd_even_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
205 proto_tree_add_item(tree, hf_a21_mn_id_identity_digit_1, tvb, offset, 1, ENC_BIG_ENDIAN);
206 offset++;
207 proto_tree_add_item(tree, hf_a21_mn_id_esn, tvb, offset, 1, ENC_BIG_ENDIAN);
208 /* offset++; */
209 break;
210 case 6:
211 /* IMSI */
212 proto_tree_add_item(tree, hf_a21_mn_id_odd_even_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
214 imsi_str = dissect_e212_imsi(tvb, pinfo, tree, offset, length, true);
215 proto_item_append_text(item, "%s", imsi_str);
217 break;
223 static void
224 dissect_a21_1x_message_transmission_control(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_)
226 int offset = 0;
227 if (tree == NULL)
228 return;
229 proto_tree_add_item(tree, hf_a21_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
230 proto_tree_add_item(tree, hf_a21_msg_tran_ctrl_paging_msg, tvb, offset, 1, ENC_BIG_ENDIAN);
231 proto_tree_add_item(tree, hf_a21_msg_tran_ctrl_simul_xmit_with_next, tvb, offset, 1, ENC_BIG_ENDIAN);
232 proto_tree_add_item(tree, hf_a21_msg_tran_ctrl_ackrequired, tvb, offset, 1, ENC_BIG_ENDIAN);
233 proto_tree_add_item(tree, hf_a21_msg_tran_ctrl_3GXLogicalChannel, tvb, offset, 1, ENC_BIG_ENDIAN);
234 offset++;
235 proto_tree_add_item(tree, hf_a21_msg_tran_ctrl_protocol_revision, tvb, offset, 1, ENC_BIG_ENDIAN);
236 /* offset++; */
239 static void
240 dissect_a21_1x_lac_encapsulated_pdu(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_)
242 int offset = 0;
243 proto_tree_add_item(tree, hf_a21_1x_lac_en_pdu, tvb, offset, 3, ENC_BIG_ENDIAN);
244 /* offset += 3; */
248 /* 5.2.4.5 A21 1x Parameters */
249 static void
250 dissect_a21_1x_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_)
252 proto_tree_add_item(tree, hf_a21_3G1X_parameters, tvb, 0,length, ENC_NA);
256 * 6.4.1.12 Pilot List
257 * This IE contains the 1xRTT Pilot List passed to the MME from the eNodeB.
258 * It is included by the MME whenever the MME receives the 1xRTT Pilot List from the eNodeB.
259 * Details of format and contents of this IE are specified in 3GPP2 A.S0008-D and 3GPP2 A.S0009-D .
262 /* a21/S102 Channel Record Cell ID Info */
263 static const value_string a21_ch_cellid_info_values[] = {
264 { 0x00, "Cell Identifier field is not included - pilot: actual 1x pilot" },
265 { 0x01, "1x Cell Identifier field is included - pilot: actual 1x pilot" },
266 { 0x02, "1x Cell Identifier field is included - pilot: estimated 1x pilot" },
267 { 0x03, "1x Cell Identifier field is included - pilot: actual HRPD pilot" },
268 { 0x04, "HRPD Sector Identifier field is included - pilot: actual HRPD pilot" },
269 { 0x05, "Only an HRPD Sector Identifier field is included" },
270 { 0x06, "Only an actual HRPD pilot is included" },
271 { 0x07, "Only a 1x Cell Identifier is included" },
272 { 0, NULL }
275 /* Pilot One Way Delay flag */
276 /* A.S0008-C p. 428 */
277 static const value_string a21_ch_pilot_ow_delay_values[] = {
278 {0x00, "Not Included"},
279 {0x01, "Included"},
280 {0x00, NULL}
283 /* Pilot List System Type */
284 /* C.S0024-B p. 1493 */
285 static const value_string s102_ch_pilot_system_type_values[] = {
286 {0x00, "ChannelNumber field specifies forward CDMA channel and Reverse CDMA channel that are FDD- paired."},
287 {0x01, "System compliant to 3GPP2 C.S0002 Physical Layer Standard for cdma2000 Spread Spectrum Systems"},
288 {0x02, "ChannelNumber field specifies only the forward CDMA channel."},
289 {0x00, NULL}
292 /* S102 Current Band Class */
293 static const value_string a21_band_class_values[] = {
294 { 0x00, "800 MHz" },
295 { 0x01, "1900 MHz" },
296 { 0x02, "TACS" },
297 { 0x03, "JTACS" },
298 { 0x04, "Korean PCS" },
299 { 0x05, "450 MHz" },
300 { 0x06, "2 GHz" },
301 { 0x07, "Upper 700 MHz" },
302 { 0x08, "1800 MHz" },
303 { 0x09, "900 MHz" },
304 { 0x0a, "Secondary 800" },
305 { 0x0b, "400 MHz European PAMR" },
306 { 0x0c, "800 MHz PAMR" },
307 { 0x0d, "2.5 GHz IMT-2000 Extension" },
308 { 0x0e, "US PCS 1.9GHz" },
309 { 0x0f, "AWS" },
310 { 0x10, "US 2.5GHz" },
311 { 0x11, "US 2.5GHz Forward Link Only" },
312 { 0x12, "700 MHz Public Safety" },
313 { 0x13, "Lower 700 MHz" },
314 { 0x14, "L-Band" },
315 { 0, NULL }
318 #if 0
319 static value_string_ext a21_band_class_values_ext = VALUE_STRING_EXT_INIT(a21_band_class_values);
320 #endif
322 static void
323 dissect_a21_pilot_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_)
325 proto_tree *sub_tree, *cr_tree;
326 proto_item* ti;
327 int offset = 0,start_offset;
328 uint32_t num, ch_rec_len, i, cell_id_info, hrpd_len, reference_pilot, pilot_ow_delay_flag;
330 proto_tree_add_item_ret_uint(tree, hf_a21_pilot_list_num_of_pilots, tvb, offset, 1, ENC_BIG_ENDIAN, &num);
331 offset++;
332 for (i = 0; i < num; i++){
333 start_offset = offset;
334 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_a21_pilot_list, &ti, "Pilot %u", i+1);
335 proto_tree_add_item_ret_uint(sub_tree, hf_a21_channel_record_length, tvb, offset, 1, ENC_BIG_ENDIAN, &ch_rec_len);
336 offset++;
337 /* Channel Record
338 * This field contains a channel record as defined in 3GPP2: C.S0024-B v1.0. The
339 * information contained in a channel record include the system
340 * type, band class, and channel number
342 cr_tree = proto_tree_add_subtree(sub_tree, tvb, offset, ch_rec_len, ett_a21_cr, &ti, "Channel Record");
344 /* SystemType len = 8 bit */
345 proto_tree_add_item(cr_tree, hf_a21_ch_rec_sys_type, tvb, offset, 1, ENC_BIG_ENDIAN);
347 /* BandClass len = 5 bit */
348 proto_tree_add_item(cr_tree, hf_a21_ch_rec_band_class, tvb, offset+1, 1, ENC_BIG_ENDIAN);
350 /* ChannelNumber len = 11 bit */
351 proto_tree_add_item(cr_tree, hf_a21_ch_rec_ch_num, tvb, offset+1, 2, ENC_BIG_ENDIAN);
354 offset += ch_rec_len;
355 /* Cell ID Info */
356 proto_tree_add_item_ret_uint(sub_tree, hf_a21_cell_id_info, tvb, offset, 1, ENC_BIG_ENDIAN, &cell_id_info);
357 offset++;
358 switch (cell_id_info)
360 case 1:
361 case 2:
362 case 3:
363 case 7:
364 /* Next Info: MSCID - 1x Cell - Sector*/
365 proto_tree_add_item(sub_tree, hf_a21_msc_id, tvb, offset, 3, ENC_BIG_ENDIAN);
366 offset += 3;
368 proto_tree_add_item(sub_tree, hf_a21_cell_id, tvb, offset, 2, ENC_BIG_ENDIAN);
369 offset += 1;
371 proto_tree_add_item(sub_tree, hf_a21_sector, tvb, offset, 1, ENC_BIG_ENDIAN);
372 offset += 1;
373 break;
374 case 4:
375 case 5:
376 case 6:
377 /* Next Info: HRPD Sector Identifier */
378 proto_tree_add_item_ret_uint(sub_tree, hf_a21_hrpd_sector_id_len, tvb, offset, 1, ENC_BIG_ENDIAN, &hrpd_len);
379 offset += 1;
380 proto_tree_add_item(sub_tree, hf_a21_ch_hrpd_sector_id, tvb, offset, hrpd_len, ENC_NA);
382 offset += hrpd_len;
383 break;
384 default:
385 break;
387 /* reference pilot flag */
388 proto_tree_add_item_ret_uint(sub_tree, hf_a21_ch_reference_pilot, tvb, offset, 1, ENC_BIG_ENDIAN, &reference_pilot);
390 if (reference_pilot)
392 /* Reference Pilot PN */
393 proto_tree_add_item(sub_tree, hf_a21_ch_pilot_pn, tvb, offset, 2, ENC_BIG_ENDIAN);
395 else
397 /* Reference Pilot PN Phase*/
398 proto_tree_add_item(sub_tree, hf_a21_ch_pilot_pn_phase, tvb, offset, 2, ENC_BIG_ENDIAN);
400 offset += 2;
402 /* Pilot one way delay flag */
403 proto_tree_add_item_ret_uint(sub_tree, hf_a21_ch_pilot_ow_delay_flag, tvb, offset, 1, ENC_BIG_ENDIAN, &pilot_ow_delay_flag);
405 /* Pilot Strength */
406 proto_tree_add_item(sub_tree, hf_a21_ch_pilot_strength, tvb, offset, 1, ENC_BIG_ENDIAN);
407 offset += 1;
409 /* Pilot one way delay */
410 if (pilot_ow_delay_flag)
412 proto_tree_add_item(sub_tree, hf_a21_ch_pilot_ow_delay, tvb, offset, 2, ENC_BIG_ENDIAN);
413 offset += 2;
416 proto_item_set_len(ti, offset - start_offset);
421 static const range_string a21_random_number_type_rvals[] = {
422 {0x00, 0x00, "Reserved"},
423 {0x01, 0x01, "RAND"},
424 {0x02, 0x0F, "Reserved"},
425 {0, 0, NULL}
428 static void
429 dissect_a21_authentication_challenge_parameter(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_)
431 int offset = 0;
432 unsigned type;
434 if (tree == NULL)
435 return;
436 type = tvb_get_uint8(tvb, offset) & 0x0f;
437 proto_tree_add_item(tree, hf_a21_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
438 proto_tree_add_item(tree, hf_a21_auth_chall_para_rand_num_type, tvb, offset, 1, ENC_BIG_ENDIAN);
439 offset++;
441 switch (type) {
442 case 1:
443 proto_tree_add_item(tree, hf_a21_auth_chall_para_rand_value, tvb, offset, 4, ENC_BIG_ENDIAN);
444 /*offset += 4;*/
445 break;
450 /* A.S0008-C_v1.0_070801 5.2.4.14 A21 Mobile Subscription Information */
452 static const value_string a21_record_identifier_vals[] = {
453 {0x00, "Band Class/Band Subclass Record"},
454 /* All other values are reserved */
455 {0, NULL}
459 static void
460 dissect_a21_mobile_subscription_information(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_)
462 int offset = 0, start_offset, rec_end_offset;
463 int i = 0, j = 0;
464 uint8_t record_id, band_class;
465 uint16_t record_len = 0;
466 proto_tree *record_tree, *band_tree;
467 proto_item* ti;
468 uint32_t rec_len, sub_cls_len;
470 static int * const flags[] = {
471 &hf_a21_sc7,
472 &hf_a21_sc6,
473 &hf_a21_sc5,
474 &hf_a21_sc4,
475 &hf_a21_sc3,
476 &hf_a21_sc2,
477 &hf_a21_sc1,
478 &hf_a21_sc0,
479 NULL
482 if (tree == NULL)
483 return;
484 while (offset<length) {
485 record_id = tvb_get_uint8(tvb, offset);
486 record_len = tvb_get_uint8(tvb, offset+1);
488 record_tree = proto_tree_add_subtree_format(tree, tvb, offset+2, record_len,
489 ett_a21_record_content, NULL, "Record %u",i+1);
491 proto_tree_add_item(record_tree, hf_a21_mob_sub_info_record_id, tvb, offset, 1, ENC_BIG_ENDIAN);
492 offset++;
494 proto_tree_add_item_ret_uint(record_tree, hf_a21_mob_sub_info_record_length, tvb, offset, 1, ENC_BIG_ENDIAN, &rec_len);
495 offset++;
496 rec_end_offset = offset + rec_len;
498 if (record_id == 0) {
499 /* All Band Classes Included*/
500 proto_tree_add_item(record_tree, hf_a21_mob_sub_info_re_con_all_band_inc, tvb, offset, 1, ENC_BIG_ENDIAN);
501 /* Current Band Subclass */
502 proto_tree_add_item(record_tree, hf_a21_mob_sub_info_re_con_curr_band_sub, tvb, offset, 1, ENC_BIG_ENDIAN);
503 offset++;
504 while (offset < rec_end_offset) {
505 j++;
506 start_offset = offset;
507 band_class = tvb_get_uint8(tvb, offset);
508 band_tree = proto_tree_add_subtree_format(record_tree, tvb, offset, -1,
509 ett_a21_band_class, &ti, "Band Class %u - %s(%u)",
511 val_to_str_const(band_class, a21_band_class_values, "Unknown"),
512 band_class
515 /* Band Class */
516 proto_tree_add_item(band_tree, hf_a21_mob_sub_info_re_band_class, tvb, offset, 1, ENC_BIG_ENDIAN);
517 offset++;
518 /* All Band Subclasses Included | Reserved |Band Class 1 Subclass Length Octet 7 */
519 proto_tree_add_item(band_tree, hf_a21_mob_sub_info_re_con_all_sub_band_inc, tvb, offset, 1, ENC_BIG_ENDIAN);
520 proto_tree_add_item_ret_uint(band_tree, hf_a21_mob_sub_info_re_sub_cls_len, tvb, offset, 1, ENC_BIG_ENDIAN, &sub_cls_len);
521 offset++;
522 if (sub_cls_len > 0) {
523 proto_tree_add_bitmask_list(band_tree, tvb, offset, 1, flags, ENC_BIG_ENDIAN);
525 offset += sub_cls_len;
526 proto_item_set_len(ti, offset - start_offset);
528 } else {
529 proto_tree_add_item(record_tree, hf_a21_mob_sub_info_record_content, tvb, offset, record_len, ENC_NA);
530 offset += record_len;
535 static const value_string a21_gcsna_status_vals[] = {
536 {0x01, "Handoff successful"},
537 {0x02, "Handoff failure"},
538 /* All other values are reserved */
539 {0, NULL}
543 static void
544 dissect_a21_gcsna_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_)
546 int offset = 0;
547 uint8_t priority_incl, status_incl;
549 if (tree == NULL)
550 return;
551 status_incl = tvb_get_uint8(tvb, offset) & 0x01;
552 priority_incl = tvb_get_uint8(tvb, offset) & 0x04;
554 proto_tree_add_item(tree, hf_a21_gcsna_status_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
555 proto_tree_add_item(tree, hf_a21_gcsna_status_priority_incl, tvb, offset, 1, ENC_BIG_ENDIAN);
556 proto_tree_add_item(tree, hf_a21_gcsna_status_gec, tvb, offset, 1, ENC_BIG_ENDIAN);
557 proto_tree_add_item(tree, hf_a21_gcsna_status_status_incl, tvb, offset, 1, ENC_BIG_ENDIAN);
558 offset++;
560 if (status_incl == 1) {
561 proto_tree_add_item(tree, hf_a21_gcsna_status, tvb, offset, 1, ENC_BIG_ENDIAN);
562 offset++;
565 if (priority_incl == 1) {
566 proto_tree_add_item(tree, hf_a21_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
567 proto_tree_add_item(tree, hf_a21_gcsna_status_call_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
571 /* 5.2.4.16 GCSNA PDU */
572 static void
573 dissect_a21_gcsna_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_)
575 int offset = 0;
577 proto_tree_add_item(tree, hf_a21_gcsna_content, tvb, offset, length, ENC_NA);
578 if (gcsna_handle) {
579 tvbuff_t *new_tvb;
580 new_tvb = tvb_new_subset_length(tvb, offset, length);
581 /* call the dissector with the parent (top)tree */
582 call_dissector(gcsna_handle, new_tvb, pinfo, top_tree);
587 /* 5.2.4.17 Reference Cell ID */
588 static void
589 dissect_a21_reference_cell_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_)
591 int offset = 0;
593 if (tree == NULL)
594 return;
595 proto_tree_add_item(tree, hf_a21_mscid_market_id, tvb, offset, 2, ENC_BIG_ENDIAN);
596 offset += 2;
597 proto_tree_add_item(tree, hf_a21_mscid_switch_number, tvb, offset, 1, ENC_BIG_ENDIAN);
598 offset += 1;
600 proto_tree_add_item(tree, hf_a21_reference_cell_id_cell, tvb, offset, 2, ENC_BIG_ENDIAN);
601 offset++;
602 proto_tree_add_item(tree, hf_a21_reference_cell_id_sector, tvb, offset, 1, ENC_BIG_ENDIAN);
603 /* offset++; */
607 static const value_string a21_cause_vals[] = {
608 {0x00, "Unknown mobile"},
609 {0x01, "Unknown cell identifier(s)"},
610 {0x02, "Tunneling of 1x messages not available"},
611 {0x03, "Resources not available"},
612 {0x04, "A21 context for this MS/AT may be released"},
613 {0x05, "Airlink lost"},
614 {0x06, "Abort Handoff from HRPD to 1x"},
615 {0x07, "Unspecified"},
616 {0x08, "Rejection"},
617 {0x09, "Already Paging"},
618 {0x0A, "Abort handoff from LTE to 1x"},
619 {0x0B, "Version not supported"},
620 /* All other values are reserved */
621 {0, NULL}
625 static void
626 dissect_a21_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_)
628 int offset = 0;
630 proto_tree_add_item(tree, hf_a21_cause_value, tvb, offset, 1, ENC_BIG_ENDIAN);
631 /* offset++; */
634 static const value_string a21_event_vals[] = {
635 {0x00, "MS/AT present in 1x"},
636 {0x01, "MS/AT present in HRPD/Cancel Handoff"},
637 {0x02, "1x Power Down"},
638 {0x03, "HRPD Power Down/Connection Closed"},
639 {0x04, "Handoff Rejected"},
640 {0x05, "1x Registration"},
641 {0x06, "Transmission of All 1x LAC Encapsulated PDUs Disabled"},
642 {0x07, "Transmission of 1x LAC Encapsulated PDU(s) Enabled"},
643 {0x08, "MS/AT no longer present in this AN/PCF"},
644 {0x09, "MS/AT no longer present in this 1x BS"},
645 {0x0A, "MS/AT Not Acquired"},
646 {0x0B, "Redirection"},
647 /* All other values are reserved */
648 {0, NULL}
651 static const value_string a21_additional_event_info_vals[] = {
652 {0x00, "This field shall not be included"},
653 {0x01, "This field shall not be included"},
654 {0x02, "This field shall not be included"},
655 {0x03, "This field shall not be included"},
656 {0x04, "This field shall not be included"},
657 {0x05, "This field shall not be included"},
658 {0x06, "This field shall not be included"},
659 {0x07, "This field shall contain the variable length AllowedForwardLinkMessages negotiated by the HRPD AN and the AT"},
660 /* All other values, This field shall not be included */
661 {0, NULL}
665 static void
666 dissect_a21_event(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_)
668 int offset = 0;
669 uint8_t event_id;
671 if (tree == NULL)
672 return;
673 event_id = tvb_get_uint8(tvb, offset);
674 proto_tree_add_item(tree, hf_a21_event, tvb, offset, 1, ENC_BIG_ENDIAN);
675 proto_item_append_text(item, "%s", val_to_str_const(event_id, a21_event_vals, "Unknown"));
676 offset++;
677 if (length>1) {
678 if (event_id == 7) {
679 proto_tree_add_item(tree, hf_a21_allowed_forward_link_message, tvb, offset, 2, ENC_BIG_ENDIAN);
680 /*offset += 2;*/
682 else {
683 proto_tree_add_item(tree, hf_a21_additional_event_info, tvb, offset, 2, ENC_BIG_ENDIAN);
684 /*offset += 2;*/
691 static const value_string a21_service_option_vals[] = {
692 {0x003B, "HRPD Packet Data"},
693 /*{0x59xx, "HRPD Packet Data with ReservationLabel where xx = [00-FFH] and contains the ReservationLabel"},*/
694 {0, NULL}
698 /* 5.2.4.13 Service Option */
699 static void
700 dissect_a21_service_option(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_)
702 int offset = 0;
704 proto_tree_add_item(tree, hf_a21_service_option, tvb, offset, 2, ENC_BIG_ENDIAN);
705 /* offset += 2; */
709 static void
710 dissect_a21_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_)
712 proto_tree_add_expert(tree, pinfo, &ei_a21_ie_data_not_dissected_yet, tvb, 0, length);
715 static const value_string a21_element_type_vals[] = {
716 {0x01, "1x LAC Encapsulated PDU"},
717 {0x02, "A21 1x Parameters"},
718 {0x03, "Pilot List"},
719 {0x04, "Correlation ID"},
720 {0x05, "Mobile Identity (MN ID)"},
721 {0x06, "Authentication Challenge Parameter (RAND)"},
722 {0x07, "A21 1x Message Transmission Control"},
723 {0x08, "A21 Cause"},
724 {0x09, "A21 Event"},
725 {0x0A, "Service Option"},
726 {0x0B, "A21 Mobile Subscription Information"},
727 {0x0C, "GCSNA Status"},
728 {0x0D, "Reference Cell ID"},
729 {0xC0, "GCSNA PDU"},
730 {0, NULL}
734 void
735 dissect_a21_ie_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree, proto_tree *tree, int offset, uint8_t message_type)
737 uint8_t ie_type, length_len;
738 uint16_t length = 0;
739 tvbuff_t *ie_tvb;
740 proto_tree *ie_tree;
741 proto_item *ti;
743 while (offset < (int)tvb_reported_length(tvb)) {
744 ie_type = tvb_get_uint8(tvb, offset);
745 if (ie_type == A21_IEI_GCSNA_PDU) {
746 /* length of GCSNA PDU is 2 octets long */
747 length_len = 2;
748 length = tvb_get_ntohs(tvb, offset+1);
749 } else {
750 /* Octet 2-length */
751 length_len = 1;
752 length = tvb_get_uint8(tvb, offset+1);
755 ie_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1 + length_len + length, ett_a21_ie, &ti,
756 "%s : ", val_to_str_const(ie_type, a21_element_type_vals, "Unknown"));
758 /* Octet 1-element identifier */
759 proto_tree_add_item(ie_tree, hf_a21_element_identifier, tvb, offset, 1, ENC_BIG_ENDIAN);
760 offset++;
761 proto_tree_add_item(ie_tree, hf_a21_gcsna_pdu_length, tvb, offset, length_len, ENC_BIG_ENDIAN);
762 offset = offset+length_len;
764 ie_tvb = tvb_new_subset_remaining(tvb, offset);
766 switch (ie_type) {
767 case A21_IEI_1X_LAC_ENCAPSULATED_PDU:
768 /* 5.2.4.4 1x LAC Encapsulated PDU */
769 dissect_a21_1x_lac_encapsulated_pdu(ie_tvb,pinfo, ie_tree, ti, length, message_type);
770 break;
771 case A21_IEI_A21_1X_PARAMETERS:
772 /* 5.2.4.5 A21 1x Parameters */
773 dissect_a21_1x_parameters(ie_tvb,pinfo, ie_tree, ti, length, message_type);
774 break;
775 case A21_IEI_PILOT_LIST:
776 /* 5.2.4.6 Pilot List */
777 dissect_a21_pilot_list(ie_tvb,pinfo, ie_tree, ti, length, message_type);
778 break;
779 case A21_IEI_CORRELATION_ID:
780 /* 5.2.4.7 Correlation ID */
781 dissect_a21_correlation_id(ie_tvb,pinfo, ie_tree, ti, length, message_type);
782 break;
783 case A21_IEI_MOBILE_IDENTITY:
784 /* 5.2.4.8 Mobile Identity (MN ID) */
785 dissect_a21_mobile_identity(ie_tvb,pinfo, ie_tree, ti, length, message_type);
786 break;
787 case A21_IEI_AUTHENTICATION_CHALLENGE_PARAMETER:
788 /* 5.2.4.9 Authentication Challenge Parameter (RAND) */
789 dissect_a21_authentication_challenge_parameter(ie_tvb,pinfo, ie_tree, ti, length, message_type);
790 break;
791 case A21_IEI_A21_1X_MESSAGE_TRANSMISSION_CONTROL:
792 /* 5.2.4.10 A21 1x Message Transmission Control */
793 dissect_a21_1x_message_transmission_control(ie_tvb,pinfo, ie_tree, ti, length, message_type);
794 break;
795 case A21_IEI_A21_CAUSE:
796 /* 5.2.4.11 A21 Cause */
797 dissect_a21_cause(ie_tvb,pinfo, ie_tree, ti, length, message_type);
798 break;
799 case A21_IEI_A21_EVENT:
800 /* 5.2.4.12 A21 Event */
801 dissect_a21_event(ie_tvb,pinfo, ie_tree, ti, length, message_type);
802 break;
803 case A21_IEI_SERVICE_OPTION:
804 /* 5.2.4.13 Service Option */
805 dissect_a21_service_option(ie_tvb,pinfo, ie_tree, ti, length, message_type);
806 break;
807 case A21_IEI_A21_MOBILE_SUBSCRIPTION_INFORMATION:
808 /* 5.2.4.14 A21 Mobile Subscription Information */
809 dissect_a21_mobile_subscription_information(ie_tvb,pinfo, ie_tree, ti, length, message_type);
810 break;
811 case A21_IEI_GCSNA_STATUS:
812 /* 5.2.4.15 GCSNA Status */
813 dissect_a21_gcsna_status(ie_tvb,pinfo, ie_tree, ti, length, message_type);
814 break;
815 case A21_IEI_GCSNA_PDU:
816 /* 5.2.4.16 GCSNA PDU */
817 dissect_a21_gcsna_pdu(ie_tvb,pinfo, top_tree, ie_tree, ti, length, message_type);
818 break;
819 case A21_IEI_REFERENCE_CELL_ID:
820 /* 5.2.4.17 Reference Cell ID */
821 dissect_a21_reference_cell_id(ie_tvb,pinfo, ie_tree, ti, length, message_type);
822 break;
823 default:
824 dissect_a21_unknown(ie_tvb,pinfo, ie_tree, ti, length, message_type);
825 break;
827 offset = offset + length;
832 static int
833 dissect_a21(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
835 uint8_t message_type;
836 int offset = 0;
837 proto_item *ti, *tc;
838 proto_tree *a21_tree, *corr_tree;
839 uint32_t corr_id;
841 col_set_str(pinfo->cinfo, COL_PROTOCOL, "A21");
842 col_clear(pinfo->cinfo, COL_INFO);
844 /* Message header is 7 octet long
845 * Octet 1 consists of message type
846 * Octets 2-7 contain the Correlation Identifier.
849 message_type = tvb_get_uint8(tvb, offset);
850 col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(message_type, a21_message_type_vals, "Unknown"));
852 ti = proto_tree_add_protocol_format(tree, proto_a21, tvb, 0, -1,
853 "A21 Protocol: %s",
854 val_to_str_const(message_type, a21_message_type_vals, "Unknown"));
855 a21_tree = proto_item_add_subtree(ti, ett_a21);
857 /* message type in Octet 1 */
858 proto_tree_add_item(a21_tree, hf_a21_message_type, tvb, offset, 1, ENC_BIG_ENDIAN);
859 offset++;
860 /* Correlation Identifier in Octets 2-7 */
861 corr_tree = proto_tree_add_subtree(a21_tree, tvb, offset, 6, ett_a21_corr_id, &tc, "A21 Correlation ID");
863 proto_tree_add_item(corr_tree, hf_a21_element_identifier, tvb, offset, 1, ENC_BIG_ENDIAN);
864 offset++;
865 proto_tree_add_item(corr_tree, hf_a21_element_length, tvb, offset, 1, ENC_BIG_ENDIAN);
866 offset++;
868 proto_tree_add_item_ret_uint(corr_tree, hf_a21_corr_id_corr_value, tvb, offset, 4, ENC_BIG_ENDIAN, &corr_id);
869 proto_item_append_text(tc, " %u", corr_id);
870 offset += 4;
872 dissect_a21_ie_common(tvb, pinfo, tree, a21_tree, offset, message_type);
874 return tvb_captured_length(tvb);
877 void proto_register_a21(void)
879 static hf_register_info hf_a21[] = {
880 { &hf_a21_message_type,
881 {"Message Type", "a21.message_type",
882 FT_UINT8, BASE_DEC, VALS(a21_message_type_vals), 0x0,
883 NULL, HFILL }
885 { &hf_a21_element_identifier,
886 {"A21 Element Identifier", "a21.element_identifier",
887 FT_UINT8, BASE_DEC, VALS(a21_element_type_vals), 0x0,
888 NULL, HFILL }
890 { &hf_a21_element_length,
891 {"Length", "a21.length",
892 FT_UINT8, BASE_DEC, NULL, 0x0,
893 NULL, HFILL }
895 { &hf_a21_corr_id_corr_value,
896 {"Correlation Value", "a21.corr_id_corr_value",
897 FT_UINT32, BASE_DEC, NULL, 0x0,
898 NULL, HFILL }
900 { &hf_a21_mn_id_msid_value,
901 {"MSID Value", "a21.mn_id_msid_value",
902 FT_UINT8, BASE_DEC, NULL, 0xf8,
903 NULL, HFILL }
905 { &hf_a21_mn_id_identity_digit_1,
906 {"Identity Digit 1", "a21.mn_id_identity_digit_1",
907 FT_UINT8, BASE_DEC, NULL, 0x08,
908 NULL, HFILL }
910 { &hf_a21_mn_id_odd_even_indicator,
911 {"Odd/Even Indicator", "a21.mn_id_odd_even_indicator",
912 FT_UINT8, BASE_DEC, NULL, 0x08,
913 NULL, HFILL }
915 { &hf_a21_mn_id_type_of_identity,
916 {"Type of Identity", "a21.mn_id_type_of_identity",
917 FT_UINT8, BASE_DEC, VALS(a21_mn_id_type_of_identity_vals), 0x07,
918 NULL, HFILL }
920 { &hf_a21_mn_id_esn,
921 {"ESN", "a21.mn_id_esn",
922 FT_UINT8, BASE_DEC, NULL, 0x7f,
923 NULL, HFILL }
925 { &hf_a21_reserved,
926 {"Reserved", "a21.reserved",
927 FT_UINT8, BASE_DEC, NULL, 0xf0,
928 NULL, HFILL }
930 { &hf_a21_msg_tran_ctrl_paging_msg,
931 {"Paging Message", "a21.msg_tran_ctrl_paging_msg",
932 FT_UINT8, BASE_DEC, NULL, 0x08,
933 NULL, HFILL }
935 { &hf_a21_msg_tran_ctrl_simul_xmit_with_next,
936 {"Simul Xmit with Next", "a21.msg_tran_ctrl_simul_xmit_with_next",
937 FT_UINT8, BASE_DEC, NULL, 0x04,
938 NULL, HFILL }
940 { &hf_a21_msg_tran_ctrl_ackrequired,
941 {"AckRequired", "a21.msg_tran_ctrl_ackrequired",
942 FT_UINT8, BASE_DEC, NULL, 0x02,
943 NULL, HFILL }
945 { &hf_a21_msg_tran_ctrl_3GXLogicalChannel,
946 {"3GXLogicalChannel", "a21.msg_tran_ctrl_3GXLogicalChannel",
947 FT_UINT8, BASE_DEC, NULL, 0x01,
948 NULL, HFILL }
950 { &hf_a21_msg_tran_ctrl_protocol_revision,
951 {"ProtocolRevision", "a21.msg_tran_ctrl_protocol_revision",
952 FT_UINT8, BASE_DEC, NULL, 0x0,
953 NULL, HFILL }
955 { &hf_a21_1x_lac_en_pdu,
956 {"1x LAC Encapsulated PDU", "a21.1x_lac_en_pdu",
957 FT_UINT24, BASE_DEC, NULL, 0x0,
958 NULL, HFILL }
960 { &hf_a21_pilot_list_num_of_pilots,
961 {"Number of Pilots", "a21.pilot_list_num_of_pilots",
962 FT_UINT8, BASE_DEC, NULL, 0x0,
963 NULL, HFILL }
965 { &hf_a21_cause_value,
966 {"A21 Cause Value", "a21.cause_value",
967 FT_UINT8, BASE_DEC, VALS(a21_cause_vals), 0x0,
968 NULL, HFILL }
970 { &hf_a21_mscid_market_id,
971 {"Market ID", "a21.mscid_market_id",
972 FT_UINT16, BASE_DEC, NULL, 0x0,
973 NULL, HFILL }
975 { &hf_a21_mscid_switch_number,
976 {"Switch Number", "a21.mscid_switch_number",
977 FT_UINT8, BASE_DEC, NULL, 0x0,
978 NULL, HFILL }
980 { &hf_a21_event,
981 {"Event", "a21.event",
982 FT_UINT8, BASE_DEC, VALS(a21_event_vals), 0x0,
983 NULL, HFILL }
985 { &hf_a21_additional_event_info,
986 {"Additional Event Info", "a21.additional_event_info",
987 FT_UINT16, BASE_DEC, VALS(a21_additional_event_info_vals), 0x0,
988 NULL, HFILL }
990 { &hf_a21_allowed_forward_link_message,
991 {"Allowed Forward Link Messages", "a21.allowed_forward_link_message",
992 FT_UINT16, BASE_DEC, VALS(a21_additional_event_info_vals), 0x0,
993 NULL, HFILL }
995 { &hf_a21_gcsna_pdu_length,
996 {"Length", "a21.gcsna_pdu_length",
997 FT_UINT16, BASE_DEC, NULL, 0x0,
998 NULL, HFILL }
1000 { &hf_a21_gcsna_content,
1001 {"GCSNA Content", "a21.gcsna_content",
1002 FT_NONE, BASE_NONE, NULL, 0x0,
1003 NULL, HFILL }
1005 { &hf_a21_reference_cell_id_cell,
1006 {"Cell", "a21.reference_cell_id_cell",
1007 FT_UINT16, BASE_DEC, NULL, 0xfff0,
1008 NULL, HFILL }
1010 { &hf_a21_reference_cell_id_sector,
1011 {"Sector", "a21.reference_cell_id_sector",
1012 FT_UINT8, BASE_DEC, NULL, 0x0f,
1013 NULL, HFILL }
1015 { &hf_a21_mob_sub_info_record_id,
1016 {"Record Identifier", "a21.mob_sub_info_record_id",
1017 FT_UINT8, BASE_DEC, VALS(a21_record_identifier_vals), 0x0,
1018 NULL, HFILL }
1020 { &hf_a21_mob_sub_info_record_length,
1021 {"Record Length", "a21.mob_sub_info_record_length",
1022 FT_UINT8, BASE_DEC, NULL, 0x0,
1023 NULL, HFILL }
1025 { &hf_a21_mob_sub_info_record_content,
1026 {"Record Content", "a21.mob_sub_info_record_content",
1027 FT_BYTES, BASE_NONE, NULL, 0x0,
1028 NULL, HFILL }
1030 { &hf_a21_mob_sub_info_re_con_all_band_inc,
1031 {"All Band Classes Included", "a21.mob_sub_info_re_con_all_band_inc",
1032 FT_UINT8, BASE_DEC, NULL, 0x80,
1033 NULL, HFILL }
1035 { &hf_a21_mob_sub_info_re_con_curr_band_sub,
1036 {"Current Band Subclass", "a21.mob_sub_info_re_con_curr_band_sub",
1037 FT_UINT8, BASE_DEC, NULL, 0x7f,
1038 NULL, HFILL }
1040 { &hf_a21_mob_sub_info_re_band_class,
1041 {"Band Class", "a21.mob_sub_info_re_band_class",
1042 FT_UINT8, BASE_DEC, NULL, 0x0,
1043 NULL, HFILL }
1045 { &hf_a21_mob_sub_info_re_con_all_sub_band_inc,
1046 {"All Band Subclasses Included", "a21.mob_sub_info_re_con_all_sub_band_inc",
1047 FT_UINT8, BASE_DEC, NULL, 0x80,
1048 NULL, HFILL }
1050 { &hf_a21_mob_sub_info_re_sub_cls_len,
1051 {"Subclass Length", "a21.mob_sub_info_re_sub_cls_len",
1052 FT_UINT8, BASE_DEC, NULL, 0x0f,
1053 NULL, HFILL }
1055 #if 0
1056 { &hf_a21_mob_sub_info_re_con_band_class,
1057 {"Band Class", "a21.mob_sub_info_re_con_band_class",
1058 FT_UINT8, BASE_DEC, NULL, 0x0,
1059 NULL, HFILL }
1061 #endif
1062 { &hf_a21_auth_chall_para_rand_num_type,
1063 {"Random Number Type", "a21.auth_chall_para_rand_num_type",
1064 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(a21_random_number_type_rvals), 0x0f,
1065 NULL, HFILL }
1067 { &hf_a21_auth_chall_para_rand_value,
1068 {"RAND Value", "a21.auth_chall_para_rand_value",
1069 FT_UINT32, BASE_DEC, NULL, 0x0,
1070 NULL, HFILL }
1072 { &hf_a21_service_option,
1073 {"Service Option", "a21.service_option",
1074 FT_UINT16, BASE_DEC, VALS(a21_service_option_vals), 0x7f,
1075 NULL, HFILL }
1077 { &hf_a21_gcsna_status_reserved,
1078 {"Reserved", "a21.gcsna_status_reserved",
1079 FT_UINT8, BASE_DEC, NULL, 0xf8,
1080 NULL, HFILL }
1082 { &hf_a21_gcsna_status_priority_incl,
1083 {"Priority Incl", "a21.gcsna_status_priority_incl",
1084 FT_UINT8, BASE_DEC, NULL, 0x04,
1085 NULL, HFILL }
1087 { &hf_a21_gcsna_status_gec,
1088 {"GEC", "a21.gcsna_status_gec",
1089 FT_UINT8, BASE_DEC, NULL, 0x02,
1090 NULL, HFILL }
1092 { &hf_a21_gcsna_status_status_incl,
1093 {"Status Incl", "a21.gcsna_status_status_incl",
1094 FT_UINT8, BASE_DEC, NULL, 0x01,
1095 NULL, HFILL }
1097 { &hf_a21_gcsna_status,
1098 {"Status", "a21.gcsna_status",
1099 FT_UINT8, BASE_DEC, VALS(a21_gcsna_status_vals), 0x0,
1100 NULL, HFILL }
1102 { &hf_a21_gcsna_status_call_priority,
1103 {"Call Priority", "a21.gcsna_status_call_priority",
1104 FT_UINT8, BASE_DEC, NULL, 0x0f,
1105 NULL, HFILL }
1107 { &hf_a21_3G1X_parameters,
1108 {"3G1X Parameters", "a21.3G1X_parameters",
1109 FT_BYTES, BASE_NONE, NULL, 0x0,
1110 NULL, HFILL }
1112 { &hf_a21_channel_record_length,
1113 {"Channel Record Length", "a21.channel_record_length",
1114 FT_UINT8, BASE_DEC, NULL, 0x0,
1115 NULL, HFILL }
1117 { &hf_a21_ch_rec_sys_type,
1118 { "System Type", "a21.ch_system_type",
1119 FT_UINT8, BASE_HEX, VALS(s102_ch_pilot_system_type_values), 0x0,
1120 NULL, HFILL }
1122 { &hf_a21_ch_rec_band_class,
1123 { "Band Class", "a21.ch_band_class",
1124 FT_UINT8, BASE_DEC, VALS(a21_band_class_values), 0xf8,
1125 NULL, HFILL }
1127 { &hf_a21_ch_rec_ch_num,
1128 { "Channel Number", "a21.ch_channel_number",
1129 FT_UINT16, BASE_DEC, NULL, 0x07ff,
1130 NULL, HFILL }
1133 { &hf_a21_cell_id_info,
1134 {"Cell ID Info", "a21.cell_id_info",
1135 FT_UINT8, BASE_DEC, VALS(a21_ch_cellid_info_values), 0x07,
1136 NULL, HFILL }
1138 { &hf_a21_msc_id,
1139 { "MSC ID", "a21.msc_id",
1140 FT_UINT24, BASE_DEC, NULL, 0x0,
1141 NULL, HFILL }
1143 { &hf_a21_cell_id,
1144 { "Cell ID", "a21.cell_id",
1145 FT_UINT16, BASE_DEC, NULL, 0xfff0,
1146 NULL, HFILL }
1148 { &hf_a21_sector,
1149 { "Sector", "a21.sector",
1150 FT_UINT8, BASE_DEC, NULL, 0x0f,
1151 NULL, HFILL }
1153 { &hf_a21_hrpd_sector_id_len,
1154 {"HRPD Sector id Length", "a21.hrpd_sector_id_len",
1155 FT_UINT8, BASE_DEC, NULL, 0x0,
1156 NULL, HFILL }
1158 { &hf_a21_ch_hrpd_sector_id,
1159 { "HRPD Sector id", "a21.hrpd_sector_id",
1160 FT_UINT8, BASE_HEX, NULL, 0x0,
1161 NULL, HFILL }
1163 { &hf_a21_ch_reference_pilot,
1164 { "Reference Pilot", "a21.ch_reference_pilot",
1165 FT_UINT8, BASE_DEC, NULL, 0x80,
1166 NULL, HFILL }
1168 { &hf_a21_ch_pilot_pn,
1169 { "Pilot PN", "a21.ch_pilot_pn",
1170 FT_UINT16, BASE_DEC, NULL, 0x01ff,
1171 NULL, HFILL }
1173 { &hf_a21_ch_pilot_pn_phase,
1174 { "Pilot PN Phase", "a21.ch_pilot_pn_phase",
1175 FT_UINT16, BASE_DEC, NULL, 0x7fff,
1176 NULL, HFILL }
1178 { &hf_a21_ch_pilot_strength,
1179 { "Pilot Strength", "a21.ch_pilot_strength",
1180 FT_UINT8, BASE_DEC, NULL, 0x3f,
1181 NULL, HFILL }
1183 { &hf_a21_ch_pilot_ow_delay_flag,
1184 { "Pilot OneWay Delay", "a21.ch_pilot_onew_delay",
1185 FT_UINT8, BASE_DEC, VALS(a21_ch_pilot_ow_delay_values), 0x40,
1186 NULL, HFILL }
1188 { &hf_a21_ch_pilot_ow_delay,
1189 { "Pilot OneWay Delay (units of 100ns)", "a21.ch_pilot_onew_delay_value",
1190 FT_UINT16, BASE_DEC, NULL, 0x0,
1191 NULL, HFILL }
1193 { &hf_a21_sc0,
1194 { "SC0", "a21.sc0",
1195 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
1196 NULL, HFILL }
1198 { &hf_a21_sc1,
1199 { "SC1", "a21.sc1",
1200 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
1201 NULL, HFILL }
1203 { &hf_a21_sc2,
1204 { "SC2", "a21.sc2",
1205 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
1206 NULL, HFILL }
1208 { &hf_a21_sc3,
1209 { "SC3", "a21.sc3",
1210 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
1211 NULL, HFILL }
1213 { &hf_a21_sc4,
1214 { "SC4", "a21.sc4",
1215 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
1216 NULL, HFILL }
1218 { &hf_a21_sc5,
1219 { "SC5", "a21.sc5",
1220 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
1221 NULL, HFILL }
1223 { &hf_a21_sc6,
1224 { "SC6", "a21.sc6",
1225 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
1226 NULL, HFILL }
1228 { &hf_a21_sc7,
1229 { "SC7", "a21.sc7",
1230 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
1231 NULL, HFILL }
1235 /* Setup protocol subtree array */
1236 static int *ett_a21_array[] = {
1237 &ett_a21,
1238 &ett_a21_corr_id,
1239 &ett_a21_ie,
1240 &ett_a21_record_content,
1241 &ett_a21_pilot_list,
1242 &ett_a21_cr,
1243 &ett_a21_band_class
1246 expert_module_t *expert_a21;
1248 static ei_register_info ei[] = {
1249 { &ei_a21_ie_data_not_dissected_yet,
1250 { "a21.ie_data_not_dissected_yet",
1251 PI_PROTOCOL, PI_NOTE, "IE data not dissected yet", EXPFILL }},
1254 proto_a21 = proto_register_protocol("A21 Protocol", "A21", "a21");
1255 proto_register_field_array(proto_a21, hf_a21, array_length(hf_a21));
1256 proto_register_subtree_array(ett_a21_array, array_length(ett_a21_array));
1257 expert_a21 = expert_register_protocol(proto_a21);
1258 expert_register_field_array(expert_a21, ei, array_length(ei));
1260 a21_handle = register_dissector("a21", dissect_a21, proto_a21);
1263 void proto_reg_handoff_a21(void)
1265 gcsna_handle = find_dissector_add_dependency("gcsna", proto_a21);
1266 dissector_add_uint_with_preference("udp.port", A21_PORT, a21_handle);
1270 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1272 * Local variables:
1273 * c-basic-offset: 8
1274 * tab-width: 8
1275 * indent-tabs-mode: t
1276 * End:
1278 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
1279 * :indentSize=8:tabSize=8:noTabs=false: