HS 2.0R2: Add OSU Providers list ANQP element
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 8 Jan 2013 21:51:16 +0000 (23:51 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 25 Feb 2014 23:24:23 +0000 (01:24 +0200)
wpa_supplicant can now request OSU Providers list with "hs20_anqp_get
<BSSID> 8".

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/common/ieee802_11_defs.h
wpa_supplicant/bss.c
wpa_supplicant/bss.h
wpa_supplicant/ctrl_iface.c
wpa_supplicant/hs20_supplicant.c
wpa_supplicant/interworking.c

index 7f2d774..3161117 100644 (file)
@@ -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
 
index 9ea6903..482fc64 100644 (file)
@@ -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);
index 4deeb5f..30df7ca 100644 (file)
@@ -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 */
 };
 
index ffc76f6..dc038fe 100644 (file)
@@ -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 */
index ceafc73..d5a332f 100644 (file)
@@ -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));
index a6064fd..937c4f7 100644 (file)
@@ -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);
        }