From 1d2215fc674bbdc7cc4bcf424cc672a745f1f25e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 8 Jan 2013 23:51:16 +0200 Subject: [PATCH] HS 2.0R2: Add OSU Providers list ANQP element wpa_supplicant can now request OSU Providers list with "hs20_anqp_get 8". Signed-hostap: Jouni Malinen --- src/common/ieee802_11_defs.h | 1 + wpa_supplicant/bss.c | 2 ++ wpa_supplicant/bss.h | 1 + wpa_supplicant/ctrl_iface.c | 4 ++++ wpa_supplicant/hs20_supplicant.c | 11 ++++++++++- wpa_supplicant/interworking.c | 1 + 6 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index 7f2d77407..316111749 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -908,6 +908,7 @@ enum { #define HS20_STYPE_CONNECTION_CAPABILITY 5 #define HS20_STYPE_NAI_HOME_REALM_QUERY 6 #define HS20_STYPE_OPERATING_CLASS 7 +#define HS20_STYPE_OSU_PROVIDERS_LIST 8 #define HS20_STYPE_ICON_REQUEST 10 #define HS20_STYPE_ICON_BINARY_FILE 11 diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c index 9ea690330..482fc64f7 100644 --- a/wpa_supplicant/bss.c +++ b/wpa_supplicant/bss.c @@ -98,6 +98,7 @@ static struct wpa_bss_anqp * wpa_bss_anqp_clone(struct wpa_bss_anqp *anqp) ANQP_DUP(hs20_wan_metrics); ANQP_DUP(hs20_connection_capability); ANQP_DUP(hs20_operating_class); + ANQP_DUP(hs20_osu_providers_list); #endif /* CONFIG_HS20 */ #undef ANQP_DUP @@ -166,6 +167,7 @@ static void wpa_bss_anqp_free(struct wpa_bss_anqp *anqp) wpabuf_free(anqp->hs20_wan_metrics); wpabuf_free(anqp->hs20_connection_capability); wpabuf_free(anqp->hs20_operating_class); + wpabuf_free(anqp->hs20_osu_providers_list); #endif /* CONFIG_HS20 */ os_free(anqp); diff --git a/wpa_supplicant/bss.h b/wpa_supplicant/bss.h index 4deeb5f56..30df7cacd 100644 --- a/wpa_supplicant/bss.h +++ b/wpa_supplicant/bss.h @@ -39,6 +39,7 @@ struct wpa_bss_anqp { struct wpabuf *hs20_wan_metrics; struct wpabuf *hs20_connection_capability; struct wpabuf *hs20_operating_class; + struct wpabuf *hs20_osu_providers_list; #endif /* CONFIG_HS20 */ }; diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index ffc76f67f..dc038fecb 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -3527,6 +3527,10 @@ static int print_bss_info(struct wpa_supplicant *wpa_s, struct wpa_bss *bss, anqp->hs20_wan_metrics); pos = anqp_add_hex(pos, end, "hs20_connection_capability", anqp->hs20_connection_capability); + pos = anqp_add_hex(pos, end, "hs20_operating_class", + anqp->hs20_operating_class); + pos = anqp_add_hex(pos, end, "hs20_osu_providers_list", + anqp->hs20_osu_providers_list); #endif /* CONFIG_HS20 */ } #endif /* CONFIG_INTERWORKING */ diff --git a/wpa_supplicant/hs20_supplicant.c b/wpa_supplicant/hs20_supplicant.c index ceafc731e..d5a332f60 100644 --- a/wpa_supplicant/hs20_supplicant.c +++ b/wpa_supplicant/hs20_supplicant.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2009, Atheros Communications, Inc. - * Copyright (c) 2011-2012, Qualcomm Atheros, Inc. + * Copyright (c) 2011-2013, Qualcomm Atheros, Inc. * * This software may be distributed under the terms of the BSD license. * See README for more details. @@ -238,6 +238,15 @@ void hs20_parse_rx_hs20_anqp_resp(struct wpa_supplicant *wpa_s, wpabuf_alloc_copy(pos, slen); } break; + case HS20_STYPE_OSU_PROVIDERS_LIST: + wpa_msg(wpa_s, MSG_INFO, "RX-HS20-ANQP " MACSTR + " OSU Providers list", MAC2STR(sa)); + if (anqp) { + wpabuf_free(anqp->hs20_osu_providers_list); + anqp->hs20_osu_providers_list = + wpabuf_alloc_copy(pos, slen); + } + break; case HS20_STYPE_ICON_BINARY_FILE: wpa_msg(wpa_s, MSG_INFO, "RX-HS20-ANQP " MACSTR " Icon Binary File", MAC2STR(sa)); diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c index a6064fd7b..937c4f7b8 100644 --- a/wpa_supplicant/interworking.c +++ b/wpa_supplicant/interworking.c @@ -234,6 +234,7 @@ static int interworking_anqp_send_req(struct wpa_supplicant *wpa_s, wpabuf_put_u8(extra, HS20_STYPE_WAN_METRICS); wpabuf_put_u8(extra, HS20_STYPE_CONNECTION_CAPABILITY); wpabuf_put_u8(extra, HS20_STYPE_OPERATING_CLASS); + wpabuf_put_u8(extra, HS20_STYPE_OSU_PROVIDERS_LIST); } gas_anqp_set_element_len(extra, len_pos); }