MBO: Parse MBO ANQP-element on STA
This extends the GAS/ANQP parser in wpa_supplicant to process MBO ANQP-elements and indicate received Cellular Data Connection Preference values over the control interface. When a valid MBO ANQP-element is received, the following control interface message is sent: RX-MBO-ANQP <BSSID> cell_conn_pref=<value> Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
941caed980
commit
34f2851902
4 changed files with 41 additions and 3 deletions
|
@ -234,6 +234,7 @@ extern "C" {
|
||||||
#define RX_HS20_ANQP "RX-HS20-ANQP "
|
#define RX_HS20_ANQP "RX-HS20-ANQP "
|
||||||
#define RX_HS20_ANQP_ICON "RX-HS20-ANQP-ICON "
|
#define RX_HS20_ANQP_ICON "RX-HS20-ANQP-ICON "
|
||||||
#define RX_HS20_ICON "RX-HS20-ICON "
|
#define RX_HS20_ICON "RX-HS20-ICON "
|
||||||
|
#define RX_MBO_ANQP "RX-MBO-ANQP "
|
||||||
|
|
||||||
#define HS20_SUBSCRIPTION_REMEDIATION "HS20-SUBSCRIPTION-REMEDIATION "
|
#define HS20_SUBSCRIPTION_REMEDIATION "HS20-SUBSCRIPTION-REMEDIATION "
|
||||||
#define HS20_DEAUTH_IMMINENT_NOTICE "HS20-DEAUTH-IMMINENT-NOTICE "
|
#define HS20_DEAUTH_IMMINENT_NOTICE "HS20-DEAUTH-IMMINENT-NOTICE "
|
||||||
|
|
|
@ -2912,7 +2912,6 @@ static void interworking_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (WPA_GET_BE24(pos)) {
|
switch (WPA_GET_BE24(pos)) {
|
||||||
#ifdef CONFIG_HS20
|
|
||||||
case OUI_WFA:
|
case OUI_WFA:
|
||||||
pos += 3;
|
pos += 3;
|
||||||
slen -= 3;
|
slen -= 3;
|
||||||
|
@ -2923,19 +2922,26 @@ static void interworking_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s,
|
||||||
slen--;
|
slen--;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
#ifdef CONFIG_HS20
|
||||||
case HS20_ANQP_OUI_TYPE:
|
case HS20_ANQP_OUI_TYPE:
|
||||||
hs20_parse_rx_hs20_anqp_resp(wpa_s, bss, sa,
|
hs20_parse_rx_hs20_anqp_resp(wpa_s, bss, sa,
|
||||||
pos, slen,
|
pos, slen,
|
||||||
dialog_token);
|
dialog_token);
|
||||||
break;
|
break;
|
||||||
|
#endif /* CONFIG_HS20 */
|
||||||
|
#ifdef CONFIG_MBO
|
||||||
|
case MBO_ANQP_OUI_TYPE:
|
||||||
|
mbo_parse_rx_anqp_resp(wpa_s, bss, sa,
|
||||||
|
pos, slen);
|
||||||
|
break;
|
||||||
|
#endif /* CONFIG_MBO */
|
||||||
default:
|
default:
|
||||||
wpa_msg(wpa_s, MSG_DEBUG,
|
wpa_msg(wpa_s, MSG_DEBUG,
|
||||||
"HS20: Unsupported ANQP vendor type %u",
|
"ANQP: Unsupported ANQP vendor type %u",
|
||||||
type);
|
type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* CONFIG_HS20 */
|
|
||||||
default:
|
default:
|
||||||
wpa_msg(wpa_s, MSG_DEBUG,
|
wpa_msg(wpa_s, MSG_DEBUG,
|
||||||
"Interworking: Unsupported vendor-specific ANQP OUI %06x",
|
"Interworking: Unsupported vendor-specific ANQP OUI %06x",
|
||||||
|
|
|
@ -549,3 +549,31 @@ struct wpabuf * mbo_build_anqp_buf(struct wpa_supplicant *wpa_s,
|
||||||
|
|
||||||
return anqp_buf;
|
return anqp_buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void mbo_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s,
|
||||||
|
struct wpa_bss *bss, const u8 *sa,
|
||||||
|
const u8 *data, size_t slen)
|
||||||
|
{
|
||||||
|
const u8 *pos = data;
|
||||||
|
u8 subtype;
|
||||||
|
|
||||||
|
if (slen < 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
subtype = *pos++;
|
||||||
|
slen--;
|
||||||
|
|
||||||
|
switch (subtype) {
|
||||||
|
case MBO_ANQP_SUBTYPE_CELL_CONN_PREF:
|
||||||
|
if (slen < 1)
|
||||||
|
break;
|
||||||
|
wpa_msg(wpa_s, MSG_INFO, RX_MBO_ANQP MACSTR
|
||||||
|
" cell_conn_pref=%u", MAC2STR(sa), *pos);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
wpa_printf(MSG_DEBUG, "MBO: Unsupported ANQP subtype %u",
|
||||||
|
subtype);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1295,6 +1295,9 @@ size_t wpas_mbo_ie_bss_trans_reject(struct wpa_supplicant *wpa_s, u8 *pos,
|
||||||
void wpas_mbo_update_cell_capa(struct wpa_supplicant *wpa_s, u8 mbo_cell_capa);
|
void wpas_mbo_update_cell_capa(struct wpa_supplicant *wpa_s, u8 mbo_cell_capa);
|
||||||
struct wpabuf * mbo_build_anqp_buf(struct wpa_supplicant *wpa_s,
|
struct wpabuf * mbo_build_anqp_buf(struct wpa_supplicant *wpa_s,
|
||||||
struct wpa_bss *bss, u32 mbo_subtypes);
|
struct wpa_bss *bss, u32 mbo_subtypes);
|
||||||
|
void mbo_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s,
|
||||||
|
struct wpa_bss *bss, const u8 *sa,
|
||||||
|
const u8 *data, size_t slen);
|
||||||
|
|
||||||
/* op_classes.c */
|
/* op_classes.c */
|
||||||
enum chan_allowed {
|
enum chan_allowed {
|
||||||
|
|
Loading…
Reference in a new issue