diff options
author | Richard Sharpe <realrichardsharpe@gmail.com> | 2017-11-09 02:44:36 -0800 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-11-09 12:06:35 +0000 |
commit | 74936320a43c18a2ad538c8235e410f4912f6e4c (patch) | |
tree | 62103012786f26be8b5a6b56f5a93eca031cf56a /epan | |
parent | dc269fcd6f1ebc41d4e164f14dbb2a078bbb6265 (diff) |
802.11: Correctly handle Wi-Fi Alliance Multi-AP subtype decoding.
Introduce a dissector table and fix a bug so that it now works
by calling through a dissector table.
Change-Id: Ifa3f01b3f306101b3144604a51806eaccc436373
Reviewed-on: https://code.wireshark.org/review/24319
Petri-Dish: Richard Sharpe <realrichardsharpe@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-ieee80211.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-ieee80211.h | 12 | ||||
-rw-r--r-- | epan/dissectors/packet-wps.c | 18 |
3 files changed, 26 insertions, 8 deletions
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index a5ad41aa5a..1ac7162008 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -721,6 +721,7 @@ static const value_string wfa_subtype_vals[] = { { WFA_SUBTYPE_HS20_INDICATION, "Hotspot 2.0 Indication" }, { WFA_SUBTYPE_HS20_ANQP, "Hotspot 2.0 ANQP" }, { WFA_SUBTYPE_DPP, "Device Provisioning Protocol" }, + { WFA_SUBTYPE_IEEE1905_MULTI_AP, "IEEE1905 Multi-AP" }, { 0, NULL } }; @@ -10610,7 +10611,7 @@ dissect_vendor_ie_wfa(packet_info *pinfo, proto_item *item, tvbuff_t *tag_tvb) subtype = tvb_get_guint8(tag_tvb, 3); proto_item_append_text(item, ": %s", val_to_str_const(subtype, wfa_subtype_vals, "Unknown")); - vendor_tvb = tvb_new_subset_length(tag_tvb, offset, tag_len - 4); + vendor_tvb = tvb_new_subset_length(tag_tvb, offset + 4, tag_len - 4); dissector_try_uint_new(wifi_alliance_ie_table, subtype, vendor_tvb, pinfo, item, FALSE, NULL); } @@ -28830,7 +28831,6 @@ proto_reg_handoff_ieee80211(void) 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.ie.wifi_alliance.subtype", WFA_SUBTYPE_HS20_INDICATION, create_dissector_handle(dissect_hs20_indication, -1)); - } /* diff --git a/epan/dissectors/packet-ieee80211.h b/epan/dissectors/packet-ieee80211.h index 9eae85442c..e899e82c5f 100644 --- a/epan/dissectors/packet-ieee80211.h +++ b/epan/dissectors/packet-ieee80211.h @@ -278,12 +278,12 @@ typedef struct anqp_info_dissector_data { } anqp_info_dissector_data_t; /* WFA vendor specific subtypes */ -#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_DPP 26 - +#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_DPP 26 +#define WFA_SUBTYPE_IEEE1905_MULTI_AP 27 /* ox1B */ /* * Editor modelines diff --git a/epan/dissectors/packet-wps.c b/epan/dissectors/packet-wps.c index 107473d798..d4c6bdc96b 100644 --- a/epan/dissectors/packet-wps.c +++ b/epan/dissectors/packet-wps.c @@ -39,6 +39,7 @@ #include <epan/sminmpec.h> #include "packet-wps.h" +#include "packet-ieee80211.h" void proto_register_wps(void); @@ -880,6 +881,17 @@ dissect_wps_wfa_ext(proto_tree *tree, tvbuff_t *tvb, } } +static int +dissect_wps_wfa_ext_via_dt(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, + void *data _U_) +{ + gint size = tvb_reported_length(tvb); + + dissect_wps_wfa_ext(tree, tvb, 0, size); + + return size; +} + static void dissect_wps_vendor_ext(proto_tree *tree, tvbuff_t *tvb, int offset, gint size) @@ -2540,6 +2552,12 @@ proto_register_wps(void) expert_register_field_array(expert_wps, ei, array_length(ei)); } +void +proto_reg_handoff_wps(void) +{ + dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_IEEE1905_MULTI_AP, create_dissector_handle(dissect_wps_wfa_ext_via_dt, -1)); +} + /* * Editor modelines * |