]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Interworking: Add Advertisement Protocol element
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 17 Oct 2011 20:19:52 +0000 (23:19 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 17 Oct 2011 20:19:52 +0000 (23:19 +0300)
For now, assume that ANQP will always be enabled with Interworking.
This may be made separately configurable in the future.

src/ap/ap_drv_ops.c
src/ap/beacon.c
src/ap/ieee802_11.h
src/ap/ieee802_11_shared.c

index 77d4909af2a294e6898dcb47de6695414d647c11..e09c3d8f865b7b0f0352d55c8e5447ce5c0be4c6 100644 (file)
@@ -59,6 +59,7 @@ int hostapd_build_ap_extra_ies(struct hostapd_data *hapd,
                wpabuf_put_data(assocresp, buf, pos - buf);
        }
        pos = hostapd_eid_interworking(hapd, pos);
+       pos = hostapd_eid_adv_proto(hapd, pos);
        if (pos != buf) {
                if (wpabuf_resize(&beacon, pos - buf) != 0)
                        goto fail;
index f15467f04f0729d0e16257a3196f42b5d93585c9..67dbb06f5211449f706a099bfe9b5fb3227bbe9a 100644 (file)
@@ -358,6 +358,7 @@ void handle_probe_req(struct hostapd_data *hapd,
        pos = hostapd_eid_ext_capab(hapd, pos);
 
        pos = hostapd_eid_interworking(hapd, pos);
+       pos = hostapd_eid_adv_proto(hapd, pos);
 
        /* Wi-Fi Alliance WMM */
        pos = hostapd_eid_wmm(hapd, pos);
@@ -493,6 +494,7 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd)
        tailpos = hostapd_eid_ext_capab(hapd, tailpos);
 
        tailpos = hostapd_eid_interworking(hapd, tailpos);
+       tailpos = hostapd_eid_adv_proto(hapd, tailpos);
 
        /* Wi-Fi Alliance WMM */
        tailpos = hostapd_eid_wmm(hapd, tailpos);
index 3f73989a274126524f058674ab2509bc0ac2cfa4..76fb8412aff3d6695c8dca01c39eb49632913940 100644 (file)
@@ -70,5 +70,6 @@ void ieee802_11_sa_query_action(struct hostapd_data *hapd,
                                const u8 *sa, const u8 action_type,
                                const u8 *trans_id);
 u8 * hostapd_eid_interworking(struct hostapd_data *hapd, u8 *eid);
+u8 * hostapd_eid_adv_proto(struct hostapd_data *hapd, u8 *eid);
 
 #endif /* IEEE802_11_H */
index d325da59114d37f2dfde1ce18ffeb42286c1938a..1597462fdc38f0bfbdd576cd98104fd9ef063f30 100644 (file)
@@ -243,3 +243,22 @@ u8 * hostapd_eid_interworking(struct hostapd_data *hapd, u8 *eid)
 
        return pos;
 }
+
+
+u8 * hostapd_eid_adv_proto(struct hostapd_data *hapd, u8 *eid)
+{
+       u8 *pos = eid;
+#ifdef CONFIG_INTERWORKING
+
+       /* TODO: Separate configuration for ANQP? */
+       if (!hapd->conf->interworking)
+               return eid;
+
+       *pos++ = WLAN_EID_ADV_PROTO;
+       *pos++ = 2;
+       *pos++ = 0; /* Query Response Length Limit | PAME-BI */
+       *pos++ = ACCESS_NETWORK_QUERY_PROTOCOL;
+#endif /* CONFIG_INTERWORKING */
+
+       return pos;
+}