A21/s102: Dissect Pilot List.

Change-Id: I6549232daa67ab1047da0b07b68d39ed6cc648f5
Reviewed-on: https://code.wireshark.org/review/33273
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Anders Broman 2019-05-20 14:07:59 +02:00 committed by Anders Broman
parent e803f83ac8
commit e05fac3ec0
1 changed files with 258 additions and 8 deletions

View File

@ -78,12 +78,30 @@ static int hf_a21_mscid_switch_number = -1;
static int hf_a21_event = -1;
static int hf_a21_additional_event_info = -1;
static int hf_a21_allowed_forward_link_message = -1;
static int hf_a21_channel_record_length = -1;
static int hf_a21_ch_rec_sys_type = -1;
static int hf_a21_ch_rec_band_class = -1;
static int hf_a21_ch_rec_ch_num = -1;
static int hf_a21_cell_id_info = -1;
static int hf_a21_msc_id = -1;
static int hf_a21_cell_id = -1;
static int hf_a21_sector = -1;
static int hf_a21_hrpd_sector_id_len = -1;
static int hf_a21_ch_hrpd_sector_id;
static int hf_a21_ch_reference_pilot = -1;
static int hf_a21_ch_pilot_pn = -1;
static int hf_a21_ch_pilot_pn_phase = -1;
static int hf_a21_ch_pilot_strength = -1;
static int hf_a21_ch_pilot_ow_delay_flag = -1;
static int hf_a21_ch_pilot_ow_delay = -1;
static gint ett_a21 = -1;
static gint ett_a21_ie = -1;
static gint ett_a21_corr_id = -1;
static gint ett_a21_record_content = -1;
static gint ett_a21_pilot_list = -1;
static gint ett_a21_cr = -1;
static expert_field ei_a21_ie_data_not_dissected_yet = EI_INIT;
@ -226,18 +244,167 @@ dissect_a21_1x_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
proto_tree_add_item(tree, hf_a21_3G1X_parameters, tvb, 0,length, ENC_NA);
}
/*
* 6.4.1.12 Pilot List
* This IE contains the 1xRTT Pilot List passed to the MME from the eNodeB.
* It is included by the MME whenever the MME receives the 1xRTT Pilot List from the eNodeB.
* Details of format and contents of this IE are specified in 3GPP2 A.S0008-D and 3GPP2 A.S0009-D .
*/
/* a21/S102 Channel Record Cell ID Info */
static const value_string a21_ch_cellid_info_values[] = {
{ 0x00, "Cell Identifier field is not included - pilot: actual 1x pilot" },
{ 0x01, "1x Cell Identifier field is included - pilot: actual 1x pilot" },
{ 0x02, "1x Cell Identifier field is included - pilot: estimated 1x pilot" },
{ 0x03, "1x Cell Identifier field is included - pilot: actual HRPD pilot" },
{ 0x04, "HRPD Sector Identifier field is included - pilot: actual HRPD pilot" },
{ 0x05, "Only an HRPD Sector Identifier field is included" },
{ 0x06, "Only an actual HRPD pilot is included" },
{ 0x07, "Only a 1x Cell Identifier is included" },
{ 0, NULL }
};
/* Pilot One Way Delay flag */
/* A.S0008-C p. 428 */
static const value_string a21_ch_pilot_ow_delay_values[] = {
{0x00, "Not Included"},
{0x01, "Included"},
{0x00, NULL}
};
/* Pilot List System Type */
/* C.S0024-B p. 1493 */
static const value_string s102_ch_pilot_system_type_values[] = {
{0x00, "ChannelNumber field specifies forward CDMA channel and Reverse CDMA channel that are FDD- paired."},
{0x01, "System compliant to 3GPP2 C.S0002 Physical Layer Standard for cdma2000 Spread Spectrum Systems"},
{0x02, "ChannelNumber field specifies only the forward CDMA channel."},
{0x00, NULL}
};
/* S102 Current Band Class */
static const value_string a21_band_class_values[] = {
{ 0x00, "800 MHz" },
{ 0x01, "1900 MHz" },
{ 0x02, "TACS" },
{ 0x03, "JTACS" },
{ 0x04, "Korean PCS" },
{ 0x05, "450 MHz" },
{ 0x06, "2 GHz" },
{ 0x07, "Upper 700 MHz" },
{ 0x08, "1800 MHz" },
{ 0x09, "900 MHz" },
{ 0x0a, "Secondary 800" },
{ 0x0b, "400 MHz European PAMR" },
{ 0x0c, "800 MHz PAMR" },
{ 0x0d, "2.5 GHz IMT-2000 Extension" },
{ 0x0e, "US PCS 1.9GHz" },
{ 0x0f, "AWS" },
{ 0x10, "US 2.5GHz" },
{ 0x11, "US 2.5GHz Forward Link Only" },
{ 0x12, "700 MHz Public Safety" },
{ 0x13, "Lower 700 MHz" },
{ 0x14, "L-Band" },
{ 0, NULL }
};
value_string_ext a21_band_class_values_ext = VALUE_STRING_EXT_INIT(a21_band_class_values);
static void
dissect_a21_pilot_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_)
{
int offset = 0;
guint8 num;
proto_tree *sub_tree, *cr_tree;
proto_item* ti;
int offset = 0,start_offset;
guint32 num, ch_rec_len, i, cell_id_info, hrpd_len, reference_pilot, pilot_ow_delay_flag;
num = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_a21_pilot_list_num_of_pilots, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item_ret_uint(tree, hf_a21_pilot_list_num_of_pilots, tvb, offset, 1, ENC_BIG_ENDIAN, &num);
offset++;
if (num>0) {
proto_tree_add_item(tree, hf_a21_pilot_list_value, tvb, offset, length-1, ENC_NA);
/* offset += (length-1); */
for (i = 0; i < num; i++){
start_offset = offset;
sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_a21_pilot_list, &ti, "Pilot %u", i+1);
proto_tree_add_item_ret_uint(sub_tree, hf_a21_channel_record_length, tvb, offset, 1, ENC_BIG_ENDIAN, &ch_rec_len);
offset++;
/* Channel Record
* This field contains a channel record as defined in 3GPP2: C.S0024-B v1.0. The
* information contained in a channel record include the system
* type, band class, and channel number
*/
cr_tree = proto_tree_add_subtree(sub_tree, tvb, offset, ch_rec_len, ett_a21_cr, &ti, "Channel Record");
/* SystemType len = 8 bit */
proto_tree_add_item(cr_tree, hf_a21_ch_rec_sys_type, tvb, offset, 1, ENC_BIG_ENDIAN);
/* BandClass len = 5 bit */
proto_tree_add_item(cr_tree, hf_a21_ch_rec_band_class, tvb, offset+1, 1, ENC_BIG_ENDIAN);
/* ChannelNumber len = 11 bit */
proto_tree_add_item(cr_tree, hf_a21_ch_rec_ch_num, tvb, offset+1, 2, ENC_BIG_ENDIAN);
offset += ch_rec_len;
/* Cell ID Info */
proto_tree_add_item_ret_uint(sub_tree, hf_a21_cell_id_info, tvb, offset, 1, ENC_BIG_ENDIAN, &cell_id_info);
offset++;
switch (cell_id_info)
{
case 1:
case 2:
case 3:
case 7:
/* Next Info: MSCID - 1x Cell - Sector*/
proto_tree_add_item(sub_tree, hf_a21_msc_id, tvb, offset, 3, ENC_BIG_ENDIAN);
offset += 3;
proto_tree_add_item(sub_tree, hf_a21_cell_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(sub_tree, hf_a21_sector, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
break;
case 4:
case 5:
case 6:
/* Next Info: HRPD Sector Identifier */
proto_tree_add_item_ret_uint(sub_tree, hf_a21_hrpd_sector_id_len, tvb, offset, 1, ENC_BIG_ENDIAN, &hrpd_len);
offset += 1;
proto_tree_add_item(sub_tree, hf_a21_ch_hrpd_sector_id, tvb, offset, hrpd_len, ENC_NA);
offset += hrpd_len;
break;
default:
break;
}
/* reference pilot flag */
proto_tree_add_item_ret_uint(sub_tree, hf_a21_ch_reference_pilot, tvb, offset, 1, ENC_BIG_ENDIAN, &reference_pilot);
if (reference_pilot)
{
/* Reference Pilot PN */
proto_tree_add_item(sub_tree, hf_a21_ch_pilot_pn, tvb, offset, 2, ENC_BIG_ENDIAN);
}
else
{
/* Reference Pilot PN Phase*/
proto_tree_add_item(sub_tree, hf_a21_ch_pilot_pn_phase, tvb, offset, 2, ENC_BIG_ENDIAN);
}
offset += 2;
/* Pilot one way delay flag */
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);
/* Pilot Strength */
proto_tree_add_item(sub_tree, hf_a21_ch_pilot_strength, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
/* Pilot one way delay */
if (pilot_ow_delay_flag)
{
proto_tree_add_item(sub_tree, hf_a21_ch_pilot_ow_delay, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
proto_item_set_len(ti, offset - start_offset);
}
}
@ -904,6 +1071,87 @@ void proto_register_a21(void)
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_a21_channel_record_length,
{"Channel Record Length", "a21.channel_record_length",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_a21_ch_rec_sys_type,
{ "System Type", "a21.ch_system_type",
FT_UINT8, BASE_HEX, VALS(s102_ch_pilot_system_type_values), 0x0,
NULL, HFILL }
},
{ &hf_a21_ch_rec_band_class,
{ "Band Class", "a21.ch_band_class",
FT_UINT8, BASE_DEC, VALS(a21_band_class_values), 0xf8,
NULL, HFILL }
},
{ &hf_a21_ch_rec_ch_num,
{ "Channel Number", "a21.ch_channel_number",
FT_UINT16, BASE_DEC, NULL, 0x7ff,
NULL, HFILL }
},
{ &hf_a21_cell_id_info,
{"Cell ID Info", "a21.cell_id_info",
FT_UINT8, BASE_DEC, VALS(a21_ch_cellid_info_values), 0x07,
NULL, HFILL }
},
{ &hf_a21_msc_id,
{ "MSC ID", "a21.msc_id",
FT_UINT24, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_a21_cell_id,
{ "Cell ID", "a21.cell_id",
FT_UINT16, BASE_DEC, NULL, 0xfff0,
NULL, HFILL }
},
{ &hf_a21_sector,
{ "Sector", "a21.sector",
FT_UINT8, BASE_DEC, NULL, 0x0f,
NULL, HFILL }
},
{ &hf_a21_hrpd_sector_id_len,
{"HRPD Sector id Length", "a21.hrpd_sector_id_len",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_a21_ch_hrpd_sector_id,
{ "HRPD Sector id", "a21.hrpd_sector_id",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_a21_ch_reference_pilot,
{ "Reference Pilot", "a21.ch_reference_pilot",
FT_UINT8, BASE_DEC, NULL, 0x80,
NULL, HFILL }
},
{ &hf_a21_ch_pilot_pn,
{ "Pilot PN", "a21.ch_pilot_pn",
FT_UINT16, BASE_DEC, NULL, 0x01ff,
NULL, HFILL }
},
{ &hf_a21_ch_pilot_pn_phase,
{ "Pilot PN Phase", "a21.ch_pilot_pn_phase",
FT_UINT16, BASE_DEC, NULL, 0x7fff,
NULL, HFILL }
},
{ &hf_a21_ch_pilot_strength,
{ "Pilot Strength", "a21.ch_pilot_strength",
FT_UINT8, BASE_DEC, NULL, 0x3f,
NULL, HFILL }
},
{ &hf_a21_ch_pilot_ow_delay_flag,
{ "Pilot OneWay Delay", "a21.ch_pilot_onew_delay",
FT_UINT8, BASE_DEC, VALS(a21_ch_pilot_ow_delay_values), 0x40,
NULL, HFILL }
},
{ &hf_a21_ch_pilot_ow_delay,
{ "Pilot OneWay Delay (units of 100ns)", "a21.ch_pilot_onew_delay_value",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
};
/* Setup protocol subtree array */
@ -911,7 +1159,9 @@ void proto_register_a21(void)
&ett_a21,
&ett_a21_corr_id,
&ett_a21_ie,
&ett_a21_record_content
&ett_a21_record_content,
&ett_a21_pilot_list,
& ett_a21_cr
};
expert_module_t *expert_a21;