]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FST: Add FST IEs into AP mode management frames
authorAnton Nayshtut <qca_antonn@qca.qualcomm.com>
Wed, 21 Jan 2015 13:30:48 +0000 (15:30 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 16 Jul 2015 15:26:15 +0000 (18:26 +0300)
This adds the FST IEs received from the FST module into Beacon, Probe
Response, and (Re)Association Response frames.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/ap_drv_ops.c
src/ap/beacon.c
src/ap/ieee802_11.c

index f3f7edd1e339f225f37cdb0b9165da8a87bba48e..e4176142ddf18052bdaa7c004c89bfcc551bc1e0 100644 (file)
@@ -81,6 +81,22 @@ int hostapd_build_ap_extra_ies(struct hostapd_data *hapd,
                wpabuf_put_data(proberesp, buf, pos - buf);
        }
 
+#ifdef CONFIG_FST
+       if (hapd->iface->fst_ies) {
+               size_t add = wpabuf_len(hapd->iface->fst_ies);
+
+               if (wpabuf_resize(&beacon, add) < 0)
+                       goto fail;
+               wpabuf_put_buf(beacon, hapd->iface->fst_ies);
+               if (wpabuf_resize(&proberesp, add) < 0)
+                       goto fail;
+               wpabuf_put_buf(proberesp, hapd->iface->fst_ies);
+               if (wpabuf_resize(&assocresp, add) < 0)
+                       goto fail;
+               wpabuf_put_buf(assocresp, hapd->iface->fst_ies);
+       }
+#endif /* CONFIG_FST */
+
        if (hapd->wps_beacon_ie) {
                if (wpabuf_resize(&beacon, wpabuf_len(hapd->wps_beacon_ie)) <
                    0)
index 51d0c1504a48f25253adfd3c0bdb33fa10402766..98d6832949cadedc985012cebf2303b26b88e913 100644 (file)
@@ -377,6 +377,10 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
        if (hapd->p2p_probe_resp_ie)
                buflen += wpabuf_len(hapd->p2p_probe_resp_ie);
 #endif /* CONFIG_P2P */
+#ifdef CONFIG_FST
+       if (hapd->iface->fst_ies)
+               buflen += wpabuf_len(hapd->iface->fst_ies);
+#endif /* CONFIG_FST */
        if (hapd->conf->vendor_elements)
                buflen += wpabuf_len(hapd->conf->vendor_elements);
        if (hapd->conf->vendor_vht) {
@@ -449,6 +453,15 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
 
        pos = hostapd_add_csa_elems(hapd, pos, (u8 *)resp,
                                    &hapd->cs_c_off_proberesp);
+
+#ifdef CONFIG_FST
+       if (hapd->iface->fst_ies) {
+               os_memcpy(pos, wpabuf_head(hapd->iface->fst_ies),
+                         wpabuf_len(hapd->iface->fst_ies));
+               pos += wpabuf_len(hapd->iface->fst_ies);
+       }
+#endif /* CONFIG_FST */
+
 #ifdef CONFIG_IEEE80211AC
        if (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) {
                pos = hostapd_eid_vht_capabilities(hapd, pos);
@@ -797,6 +810,10 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
        if (hapd->p2p_beacon_ie)
                tail_len += wpabuf_len(hapd->p2p_beacon_ie);
 #endif /* CONFIG_P2P */
+#ifdef CONFIG_FST
+       if (hapd->iface->fst_ies)
+               tail_len += wpabuf_len(hapd->iface->fst_ies);
+#endif /* CONFIG_FST */
        if (hapd->conf->vendor_elements)
                tail_len += wpabuf_len(hapd->conf->vendor_elements);
 
@@ -895,6 +912,15 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
        tailpos = hostapd_eid_roaming_consortium(hapd, tailpos);
        tailpos = hostapd_add_csa_elems(hapd, tailpos, tail,
                                        &hapd->cs_c_off_beacon);
+
+#ifdef CONFIG_FST
+       if (hapd->iface->fst_ies) {
+               os_memcpy(tailpos, wpabuf_head(hapd->iface->fst_ies),
+                         wpabuf_len(hapd->iface->fst_ies));
+               tailpos += wpabuf_len(hapd->iface->fst_ies);
+       }
+#endif /* CONFIG_FST */
+
 #ifdef CONFIG_IEEE80211AC
        if (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) {
                tailpos = hostapd_eid_vht_capabilities(hapd, tailpos);
index dff6d0ea9d397c94eaf22e643eb9e7b3dfd35c2c..2785c61f6f7af4a1c7470e8dc20f9eba47917aac 100644 (file)
@@ -1632,6 +1632,14 @@ static void send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
        if (sta->qos_map_enabled)
                p = hostapd_eid_qos_map_set(hapd, p);
 
+#ifdef CONFIG_FST
+       if (hapd->iface->fst_ies) {
+               os_memcpy(p, wpabuf_head(hapd->iface->fst_ies),
+                         wpabuf_len(hapd->iface->fst_ies));
+               p += wpabuf_len(hapd->iface->fst_ies);
+       }
+#endif /* CONFIG_FST */
+
 #ifdef CONFIG_IEEE80211AC
        if (hapd->conf->vendor_vht && (sta->flags & WLAN_STA_VENDOR_VHT))
                p = hostapd_eid_vendor_vht(hapd, p);