forked from osmocom/wireshark
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>
This commit is contained in:
parent
dc269fcd6f
commit
74936320a4
|
@ -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));
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue