]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Move Ext Capab and Interworking element construction into shared file
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 17 Oct 2011 18:03:52 +0000 (21:03 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 17 Oct 2011 18:03:52 +0000 (21:03 +0300)
These needs to be available for drivers that implement SME/MLME.

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

index 8c504db8d791de3ecd032b04f9c5f7ddb344f0fe..23a852df708de2777d997bc3fb4f4c802469855f 100644 (file)
@@ -198,46 +198,6 @@ static u8 * hostapd_eid_wpa(struct hostapd_data *hapd, u8 *eid, size_t len)
 }
 
 
-static u8 * hostapd_eid_interworking(struct hostapd_data *hapd, u8 *eid)
-{
-       u8 *pos = eid;
-#ifdef CONFIG_INTERWORKING
-       u8 *len;
-
-       if (!hapd->conf->interworking)
-               return eid;
-
-       *pos++ = WLAN_EID_INTERWORKING;
-       len = pos++;
-
-       *pos = hapd->conf->access_network_type;
-       if (hapd->conf->internet)
-               *pos |= INTERWORKING_ANO_INTERNET;
-       if (hapd->conf->asra)
-               *pos |= INTERWORKING_ANO_ASRA;
-       if (hapd->conf->esr)
-               *pos |= INTERWORKING_ANO_ESR;
-       if (hapd->conf->uesa)
-               *pos |= INTERWORKING_ANO_UESA;
-       pos++;
-
-       if (hapd->conf->venue_info_set) {
-               *pos++ = hapd->conf->venue_group;
-               *pos++ = hapd->conf->venue_type;
-       }
-
-       if (!is_zero_ether_addr(hapd->conf->hessid)) {
-               os_memcpy(pos, hapd->conf->hessid, ETH_ALEN);
-               pos += ETH_ALEN;
-       }
-
-       *len = pos - len - 1;
-#endif /* CONFIG_INTERWORKING */
-
-       return pos;
-}
-
-
 void handle_probe_req(struct hostapd_data *hapd,
                      const struct ieee80211_mgmt *mgmt, size_t len)
 {
index afa870a79d7d520f8c3a747f932e1930dd68338c..4b7fb2e240ce4f8b60ceaf7974e90a945e18d0b4 100644 (file)
@@ -163,42 +163,6 @@ u16 hostapd_own_capab_info(struct hostapd_data *hapd, struct sta_info *sta,
 }
 
 
-u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid)
-{
-       u8 *pos = eid;
-       u8 len = 0;
-
-       if (hapd->conf->tdls & (TDLS_PROHIBIT | TDLS_PROHIBIT_CHAN_SWITCH))
-               len = 5;
-       if (len < 4 && hapd->conf->interworking)
-               len = 4;
-       if (len == 0)
-               return eid;
-
-       *pos++ = WLAN_EID_EXT_CAPAB;
-       *pos++ = len;
-       *pos++ = 0x00;
-       *pos++ = 0x00;
-       *pos++ = 0x00;
-
-       *pos = 0x00;
-       if (hapd->conf->interworking)
-               *pos |= 0x80; /* Bit 31 - Interworking */
-       pos++;
-
-       if (len < 5)
-               return pos;
-       *pos = 0x00;
-       if (hapd->conf->tdls & TDLS_PROHIBIT)
-               *pos |= 0x40; /* Bit 38 - TDLS Prohibited */
-       if (hapd->conf->tdls & TDLS_PROHIBIT_CHAN_SWITCH)
-               *pos |= 0x80; /* Bit 39 - TDLS Channel Switching Prohibited */
-       pos++;
-
-       return pos;
-}
-
-
 void ieee802_11_print_ssid(char *buf, const u8 *ssid, u8 len)
 {
        int i;
index ec113759c1de4914a42a7a4792f5779fb35e028b..3f73989a274126524f058674ab2509bc0ac2cfa4 100644 (file)
@@ -69,5 +69,6 @@ u8 * hostapd_eid_assoc_comeback_time(struct hostapd_data *hapd,
 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);
 
 #endif /* IEEE802_11_H */
index 5bb92db0c98371eacb05c2622a08e0224cb622d6..d325da59114d37f2dfde1ce18ffeb42286c1938a 100644 (file)
@@ -167,3 +167,79 @@ void ieee802_11_sa_query_action(struct hostapd_data *hapd, const u8 *sa,
 }
 
 #endif /* CONFIG_IEEE80211W */
+
+
+u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid)
+{
+       u8 *pos = eid;
+       u8 len = 0;
+
+       if (hapd->conf->tdls & (TDLS_PROHIBIT | TDLS_PROHIBIT_CHAN_SWITCH))
+               len = 5;
+       if (len < 4 && hapd->conf->interworking)
+               len = 4;
+       if (len == 0)
+               return eid;
+
+       *pos++ = WLAN_EID_EXT_CAPAB;
+       *pos++ = len;
+       *pos++ = 0x00;
+       *pos++ = 0x00;
+       *pos++ = 0x00;
+
+       *pos = 0x00;
+       if (hapd->conf->interworking)
+               *pos |= 0x80; /* Bit 31 - Interworking */
+       pos++;
+
+       if (len < 5)
+               return pos;
+       *pos = 0x00;
+       if (hapd->conf->tdls & TDLS_PROHIBIT)
+               *pos |= 0x40; /* Bit 38 - TDLS Prohibited */
+       if (hapd->conf->tdls & TDLS_PROHIBIT_CHAN_SWITCH)
+               *pos |= 0x80; /* Bit 39 - TDLS Channel Switching Prohibited */
+       pos++;
+
+       return pos;
+}
+
+
+u8 * hostapd_eid_interworking(struct hostapd_data *hapd, u8 *eid)
+{
+       u8 *pos = eid;
+#ifdef CONFIG_INTERWORKING
+       u8 *len;
+
+       if (!hapd->conf->interworking)
+               return eid;
+
+       *pos++ = WLAN_EID_INTERWORKING;
+       len = pos++;
+
+       *pos = hapd->conf->access_network_type;
+       if (hapd->conf->internet)
+               *pos |= INTERWORKING_ANO_INTERNET;
+       if (hapd->conf->asra)
+               *pos |= INTERWORKING_ANO_ASRA;
+       if (hapd->conf->esr)
+               *pos |= INTERWORKING_ANO_ESR;
+       if (hapd->conf->uesa)
+               *pos |= INTERWORKING_ANO_UESA;
+       pos++;
+
+       if (hapd->conf->venue_info_set) {
+               *pos++ = hapd->conf->venue_group;
+               *pos++ = hapd->conf->venue_type;
+       }
+
+       if (!is_zero_ether_addr(hapd->conf->hessid)) {
+               os_memcpy(pos, hapd->conf->hessid, ETH_ALEN);
+               pos += ETH_ALEN;
+       }
+
+       *len = pos - len - 1;
+#endif /* CONFIG_INTERWORKING */
+
+       return pos;
+}