ieee80211: Separate WFA vendor specific element and ANQP subtypes

Subtypes (refers to 'OUI type' in most specs) found in Wi-Fi alliance
vendor specific Element and vendor specific ANQP are not part of
single enum so treat them separately.

Also move the 'ANQP' in the macro prefix to allow more consistent
naming when more WFA ANQP are added.

Bug: 16494
Change-Id: I20b187a32230c623eaf1e6ff9f689c8376bb4b5b
Reviewed-on: https://code.wireshark.org/review/36865
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Cedric Izoard 2020-02-26 12:24:51 +01:00 committed by Anders Broman
parent 4cdf2a2419
commit 5d0bff5c40
2 changed files with 13 additions and 7 deletions

View File

@ -653,7 +653,6 @@ static const value_string wfa_subtype_vals[] = {
{ WFA_SUBTYPE_DEAUTHENTICATION_IMMINENT, "Deauthentication Imminent" },
{ WFA_SUBTYPE_P2P, "P2P" },
{ WFA_SUBTYPE_HS20_INDICATION, "Hotspot 2.0 Indication" },
{ WFA_SUBTYPE_HS20_ANQP, "Hotspot 2.0 ANQP" },
{ WFA_SUBTYPE_OSEN, "OSU Server-only l2 Encryption Network" },
{ WFA_SUBTYPE_NAN_IE, "NAN" },
{ WFA_SUBTYPE_MBO_OCE, "Multi Band Operation - Optimized Connectivity Experience"},
@ -665,6 +664,11 @@ static const value_string wfa_subtype_vals[] = {
{ 0, NULL }
};
static const value_string wfa_anqp_subtype_vals[] = {
{ WFA_ANQP_SUBTYPE_HS20, "Hotspot 2.0 ANQP" },
{ 0, NULL }
};
#define DPP_CONFIGURATION_PROTOCOL 0x01
static const value_string dpp_subtype_vals[] = {
@ -7366,14 +7370,14 @@ dissect_anqp_capab_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int
break;
subtype = tvb_get_guint8(tvb, offset);
proto_item_append_text(vtree, " - WFA - %s",
val_to_str(subtype, wfa_subtype_vals,
val_to_str(subtype, wfa_anqp_subtype_vals,
"Unknown (%u)"));
proto_tree_add_item(vtree, hf_ieee80211_anqp_wfa_subtype,
tvb, offset, 1, ENC_NA);
offset++;
len--;
switch (subtype) {
case WFA_SUBTYPE_HS20_ANQP:
case WFA_ANQP_SUBTYPE_HS20:
dissect_hs20_anqp_hs_capability_list(vtree, tvb, offset, end);
break;
default:
@ -30898,7 +30902,7 @@ proto_register_ieee80211(void)
{&hf_ieee80211_anqp_wfa_subtype,
{"WFA Subtype", "wlan.anqp.wfa.subtype",
FT_UINT8, BASE_DEC, VALS(wfa_subtype_vals), 0, NULL, HFILL }},
FT_UINT8, BASE_DEC, VALS(wfa_anqp_subtype_vals), 0, NULL, HFILL }},
{&hf_ieee80211_dpp_subtype,
{"DPP Subtype", "wlan.wfa.dpp.subtype",
@ -39174,7 +39178,7 @@ proto_reg_handoff_ieee80211(void)
dissector_add_uint("wlan.action.vendor_specific", OUI_WFA, create_dissector_handle(dissect_vendor_action_wifi_alliance, -1));
dissector_add_uint("wlan.anqp.vendor_specific", OUI_WFA, create_dissector_handle(dissect_vendor_wifi_alliance_anqp, -1));
dissector_add_uint("wlan.anqp.wifi_alliance.subtype", WFA_SUBTYPE_HS20_ANQP, create_dissector_handle(dissect_hs20_anqp, -1));
dissector_add_uint("wlan.anqp.wifi_alliance.subtype", WFA_ANQP_SUBTYPE_HS20, create_dissector_handle(dissect_hs20_anqp, -1));
dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_SUBSCRIPTION_REMEDIATION, create_dissector_handle(dissect_hs20_subscription_remediation, -1));
dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_DEAUTHENTICATION_IMMINENT, create_dissector_handle(dissect_hs20_deauthentication_imminent, -1));
dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_HS20_INDICATION, create_dissector_handle(dissect_hs20_indication, -1));

View File

@ -285,13 +285,12 @@ typedef struct anqp_info_dissector_data {
int idx;
} anqp_info_dissector_data_t;
/* WFA vendor specific subtypes */
/* WFA vendor specific element subtypes */
#define WFA_SUBTYPE_SUBSCRIPTION_REMEDIATION 0
#define WFA_SUBTYPE_DEAUTHENTICATION_IMMINENT 1
#define WFA_SUBTYPE_P2P 9
#define WFA_SUBTYPE_WIFI_DISPLAY 10
#define WFA_SUBTYPE_HS20_INDICATION 16
#define WFA_SUBTYPE_HS20_ANQP 17
#define WFA_SUBTYPE_OSEN 18
#define WFA_SUBTYPE_NAN_IE 19
#define WFA_SUBTYPE_MBO_OCE 22
@ -301,6 +300,9 @@ typedef struct anqp_info_dissector_data {
#define WFA_SUBTYPE_IEEE1905_MULTI_AP 27 /* ox1B */
#define WFA_SUBTYPE_OWE_TRANSITION_MODE 28
/* WFA vendor specific ANQP subtypes */
#define WFA_ANQP_SUBTYPE_HS20 17
/* Information Element tags */
#define TAG_SSID 0
#define TAG_SUPP_RATES 1