diff options
Diffstat (limited to 'epan/dissectors/packet-ieee80211-radio.c')
-rw-r--r-- | epan/dissectors/packet-ieee80211-radio.c | 200 |
1 files changed, 101 insertions, 99 deletions
diff --git a/epan/dissectors/packet-ieee80211-radio.c b/epan/dissectors/packet-ieee80211-radio.c index fde7e75cbd..47028d5849 100644 --- a/epan/dissectors/packet-ieee80211-radio.c +++ b/epan/dissectors/packet-ieee80211-radio.c @@ -35,71 +35,71 @@ static dissector_handle_t wlan_noqos_radio_handle; static dissector_handle_t ieee80211_handle; static dissector_handle_t ieee80211_noqos_handle; -static int proto_wlan_radio = -1; +static int proto_wlan_radio; /* ************************************************************************* */ /* Header field info values for radio information */ /* ************************************************************************* */ -static int hf_wlan_radio_phy = -1; -static int hf_wlan_radio_11_fhss_hop_set = -1; -static int hf_wlan_radio_11_fhss_hop_pattern = -1; -static int hf_wlan_radio_11_fhss_hop_index = -1; -static int hf_wlan_radio_11a_channel_type = -1; -static int hf_wlan_radio_11a_turbo_type = -1; -static int hf_wlan_radio_11g_mode = -1; -static int hf_wlan_radio_11n_mcs_index = -1; -static int hf_wlan_radio_11n_bandwidth = -1; -static int hf_wlan_radio_11n_short_gi = -1; -static int hf_wlan_radio_11n_greenfield = -1; -static int hf_wlan_radio_11n_fec = -1; -static int hf_wlan_radio_11n_stbc_streams = -1; -static int hf_wlan_radio_11n_ness = -1; -static int hf_wlan_radio_11ac_stbc = -1; -static int hf_wlan_radio_11ac_txop_ps_not_allowed = -1; -static int hf_wlan_radio_11ac_short_gi = -1; -static int hf_wlan_radio_11ac_short_gi_nsym_disambig = -1; -static int hf_wlan_radio_11ac_ldpc_extra_ofdm_symbol = -1; -static int hf_wlan_radio_11ac_beamformed = -1; -static int hf_wlan_radio_11ac_bandwidth = -1; -static int hf_wlan_radio_11ac_user = -1; -static int hf_wlan_radio_11ac_nsts = -1; -static int hf_wlan_radio_11ac_mcs = -1; -static int hf_wlan_radio_11ac_nss = -1; -static int hf_wlan_radio_11ac_fec = -1; -static int hf_wlan_radio_11ac_gid = -1; -static int hf_wlan_radio_11ac_p_aid = -1; -static int hf_wlan_radio_data_rate = -1; -static int hf_wlan_radio_channel = -1; -static int hf_wlan_radio_frequency = -1; -static int hf_wlan_radio_short_preamble = -1; -static int hf_wlan_radio_signal_percent = -1; -static int hf_wlan_radio_signal_db = -1; -static int hf_wlan_radio_signal_dbm = -1; -static int hf_wlan_radio_noise_percent = -1; -static int hf_wlan_radio_noise_db = -1; -static int hf_wlan_radio_noise_dbm = -1; -static int hf_wlan_radio_snr = -1; -static int hf_wlan_radio_timestamp = -1; -static int hf_wlan_last_part_of_a_mpdu = -1; -static int hf_wlan_a_mpdu_delim_crc_error = -1; -static int hf_wlan_a_mpdu_aggregate_id = -1; -static int hf_wlan_radio_duration = -1; -static int hf_wlan_radio_preamble = -1; -static int hf_wlan_radio_aggregate = -1; -static int hf_wlan_radio_aggregate_duration = -1; -static int hf_wlan_radio_ifs = -1; -static int hf_wlan_radio_start_tsf = -1; -static int hf_wlan_radio_end_tsf = -1; -static int hf_wlan_zero_length_psdu_type = -1; - -static expert_field ei_wlan_radio_assumed_short_preamble = EI_INIT; -static expert_field ei_wlan_radio_assumed_non_greenfield = EI_INIT; -static expert_field ei_wlan_radio_assumed_no_stbc = EI_INIT; -static expert_field ei_wlan_radio_assumed_no_extension_streams = EI_INIT; -static expert_field ei_wlan_radio_assumed_bcc_fec = EI_INIT; - -static int wlan_radio_tap = -1; -static int wlan_radio_timeline_tap = -1; +static int hf_wlan_radio_phy; +static int hf_wlan_radio_11_fhss_hop_set; +static int hf_wlan_radio_11_fhss_hop_pattern; +static int hf_wlan_radio_11_fhss_hop_index; +static int hf_wlan_radio_11a_channel_type; +static int hf_wlan_radio_11a_turbo_type; +static int hf_wlan_radio_11g_mode; +static int hf_wlan_radio_11n_mcs_index; +static int hf_wlan_radio_11n_bandwidth; +static int hf_wlan_radio_11n_short_gi; +static int hf_wlan_radio_11n_greenfield; +static int hf_wlan_radio_11n_fec; +static int hf_wlan_radio_11n_stbc_streams; +static int hf_wlan_radio_11n_ness; +static int hf_wlan_radio_11ac_stbc; +static int hf_wlan_radio_11ac_txop_ps_not_allowed; +static int hf_wlan_radio_11ac_short_gi; +static int hf_wlan_radio_11ac_short_gi_nsym_disambig; +static int hf_wlan_radio_11ac_ldpc_extra_ofdm_symbol; +static int hf_wlan_radio_11ac_beamformed; +static int hf_wlan_radio_11ac_bandwidth; +static int hf_wlan_radio_11ac_user; +static int hf_wlan_radio_11ac_nsts; +static int hf_wlan_radio_11ac_mcs; +static int hf_wlan_radio_11ac_nss; +static int hf_wlan_radio_11ac_fec; +static int hf_wlan_radio_11ac_gid; +static int hf_wlan_radio_11ac_p_aid; +static int hf_wlan_radio_data_rate; +static int hf_wlan_radio_channel; +static int hf_wlan_radio_frequency; +static int hf_wlan_radio_short_preamble; +static int hf_wlan_radio_signal_percent; +static int hf_wlan_radio_signal_db; +static int hf_wlan_radio_signal_dbm; +static int hf_wlan_radio_noise_percent; +static int hf_wlan_radio_noise_db; +static int hf_wlan_radio_noise_dbm; +static int hf_wlan_radio_snr; +static int hf_wlan_radio_timestamp; +static int hf_wlan_last_part_of_a_mpdu; +static int hf_wlan_a_mpdu_delim_crc_error; +static int hf_wlan_a_mpdu_aggregate_id; +static int hf_wlan_radio_duration; +static int hf_wlan_radio_preamble; +static int hf_wlan_radio_aggregate; +static int hf_wlan_radio_aggregate_duration; +static int hf_wlan_radio_ifs; +static int hf_wlan_radio_start_tsf; +static int hf_wlan_radio_end_tsf; +static int hf_wlan_zero_length_psdu_type; + +static expert_field ei_wlan_radio_assumed_short_preamble; +static expert_field ei_wlan_radio_assumed_non_greenfield; +static expert_field ei_wlan_radio_assumed_no_stbc; +static expert_field ei_wlan_radio_assumed_no_extension_streams; +static expert_field ei_wlan_radio_assumed_bcc_fec; + +static int wlan_radio_tap; +static int wlan_radio_timeline_tap; /* Settings */ static gboolean wlan_radio_always_short_preamble = FALSE; @@ -640,10 +640,10 @@ static float ieee80211_he_mu_ofdma_rate(guint nsts, guint mcs, guint ru, guint g return rate; } -static gint ett_wlan_radio = -1; -static gint ett_wlan_radio_11ac_user = -1; -static gint ett_wlan_radio_duration = -1; -static gint ett_wlan_radio_aggregate = -1; +static gint ett_wlan_radio; +static gint ett_wlan_radio_11ac_user; +static gint ett_wlan_radio_duration; +static gint ett_wlan_radio_aggregate; /* previous frame details, for aggregate detection */ struct previous_frame_info { @@ -838,7 +838,7 @@ dissect_wlan_radio_phdr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, /* this frame has already been seen, so get its info structure */ wlan_radio_info = (struct wlan_radio *) p_get_proto_data(wmem_file_scope(), pinfo, proto_wlan_radio, 0); - if (wlan_radio_info->aggregate) { + if (wlan_radio_info && wlan_radio_info->aggregate) { phy = wlan_radio_info->aggregate->phy; phy_info = &wlan_radio_info->aggregate->phy_info; } @@ -1327,7 +1327,7 @@ dissect_wlan_radio_phdr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, } /* data field calculation */ - if (wlan_radio_info->aggregate) { + if (wlan_radio_info && wlan_radio_info->aggregate) { agg_preamble = preamble; if (wlan_radio_info->prior_aggregate_data != 0) { preamble = 0; @@ -1353,7 +1353,7 @@ dissect_wlan_radio_phdr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, } preamble = 32 + 4 * info_ac->nss[0] * (info_ac->has_stbc ? info_ac->stbc+1 : 1); - if (wlan_radio_info->aggregate) { + if (wlan_radio_info && wlan_radio_info->aggregate) { agg_preamble = preamble; if (wlan_radio_info->prior_aggregate_data != 0) { preamble = 0; @@ -1444,31 +1444,33 @@ dissect_wlan_radio_phdr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, p_item = proto_tree_add_uint(d_tree, hf_wlan_radio_preamble, tvb, 0, 0, preamble); proto_item_set_generated(p_item); } - if (wlan_radio_info->aggregate) { - proto_tree *agg_tree; - - p_item = proto_tree_add_none_format(d_tree, hf_wlan_radio_aggregate, tvb, 0, 0, - "This MPDU is part of an A-MPDU"); - agg_tree = proto_item_add_subtree(item, ett_wlan_radio_aggregate); - proto_item_set_generated(p_item); - if (wlan_radio_info->aggregate->duration) { - proto_item *aitem = proto_tree_add_uint(agg_tree, hf_wlan_radio_aggregate_duration, tvb, 0, 0, - wlan_radio_info->aggregate->duration); - proto_item_set_generated(aitem); + if (wlan_radio_info) { + if (wlan_radio_info->aggregate) { + proto_tree *agg_tree; + + p_item = proto_tree_add_none_format(d_tree, hf_wlan_radio_aggregate, tvb, 0, 0, + "This MPDU is part of an A-MPDU"); + agg_tree = proto_item_add_subtree(item, ett_wlan_radio_aggregate); + proto_item_set_generated(p_item); + if (wlan_radio_info->aggregate->duration) { + proto_item *aitem = proto_tree_add_uint(agg_tree, hf_wlan_radio_aggregate_duration, tvb, 0, 0, + wlan_radio_info->aggregate->duration); + proto_item_set_generated(aitem); + } + } + if (wlan_radio_info->ifs) { + p_item = proto_tree_add_int64(d_tree, hf_wlan_radio_ifs, tvb, 0, 0, wlan_radio_info->ifs); + proto_item_set_generated(p_item); + /* TODO: warnings on unusual IFS values (too small or negative) */ + } + if (wlan_radio_info->start_tsf) { + p_item = proto_tree_add_uint64(d_tree, hf_wlan_radio_start_tsf, tvb, 0, 0, wlan_radio_info->start_tsf); + proto_item_set_generated(p_item); + } + if (wlan_radio_info->end_tsf) { + p_item = proto_tree_add_uint64(d_tree, hf_wlan_radio_end_tsf, tvb, 0, 0, wlan_radio_info->end_tsf); + proto_item_set_generated(p_item); } - } - if (wlan_radio_info->ifs) { - p_item = proto_tree_add_int64(d_tree, hf_wlan_radio_ifs, tvb, 0, 0, wlan_radio_info->ifs); - proto_item_set_generated(p_item); - /* TODO: warnings on unusual IFS values (too small or negative) */ - } - if (wlan_radio_info->start_tsf) { - p_item = proto_tree_add_uint64(d_tree, hf_wlan_radio_start_tsf, tvb, 0, 0, wlan_radio_info->start_tsf); - proto_item_set_generated(p_item); - } - if (wlan_radio_info->end_tsf) { - p_item = proto_tree_add_uint64(d_tree, hf_wlan_radio_end_tsf, tvb, 0, 0, wlan_radio_info->end_tsf); - proto_item_set_generated(p_item); } } } /* if (have_data_rate) */ @@ -1581,7 +1583,7 @@ void proto_register_ieee80211_radio(void) NULL, HFILL }}, {&hf_wlan_radio_11n_short_gi, - {"Short GI", "wlan_radio.11n.short_gi", FT_BOOLEAN, 0, NULL, 0, + {"Short GI", "wlan_radio.11n.short_gi", FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }}, {&hf_wlan_radio_11n_greenfield, @@ -1601,27 +1603,27 @@ void proto_register_ieee80211_radio(void) NULL, HFILL }}, {&hf_wlan_radio_11ac_stbc, - {"STBC", "wlan_radio.11ac.stbc", FT_BOOLEAN, 0, TFS(&tfs_on_off), 0x0, + {"STBC", "wlan_radio.11ac.stbc", FT_BOOLEAN, BASE_NONE, TFS(&tfs_on_off), 0x0, "Space Time Block Coding flag", HFILL }}, {&hf_wlan_radio_11ac_txop_ps_not_allowed, - {"TXOP_PS_NOT_ALLOWED", "wlan_radio_11ac.txop_ps_not_allowed", FT_BOOLEAN, 0, NULL, 0x0, + {"TXOP_PS_NOT_ALLOWED", "wlan_radio_11ac.txop_ps_not_allowed", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Flag indicating whether STAs may doze during TXOP", HFILL }}, {&hf_wlan_radio_11ac_short_gi, - {"Short GI", "wlan_radio.11ac.short_gi", FT_BOOLEAN, 0, NULL, 0, + {"Short GI", "wlan_radio.11ac.short_gi", FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }}, {&hf_wlan_radio_11ac_short_gi_nsym_disambig, - {"Short GI Nsym disambiguation", "wlan_radio.11ac.short_gi_nsym_disambig", FT_BOOLEAN, 0, NULL, 0x0, + {"Short GI Nsym disambiguation", "wlan_radio.11ac.short_gi_nsym_disambig", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Short Guard Interval Nsym disambiguation", HFILL }}, {&hf_wlan_radio_11ac_ldpc_extra_ofdm_symbol, - {"LDPC extra OFDM symbol", "wlan_radio.11ac.ldpc_extra_ofdm_symbol", FT_BOOLEAN, 0, NULL, 0x0, + {"LDPC extra OFDM symbol", "wlan_radio.11ac.ldpc_extra_ofdm_symbol", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }}, {&hf_wlan_radio_11ac_beamformed, - {"Beamformed", "wlan_radio.11ac.beamformed", FT_BOOLEAN, 0, NULL, 0x0, + {"Beamformed", "wlan_radio.11ac.beamformed", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }}, {&hf_wlan_radio_11ac_bandwidth, |