2 * hostapd / IEEE 802.11 Management: Beacon and Probe Request/Response
3 * Copyright (c) 2002-2004, Instant802 Networks, Inc.
4 * Copyright (c) 2005-2006, Devicescape Software, Inc.
5 * Copyright (c) 2008-2009, Jouni Malinen <j@w1.fi>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * Alternatively, this software may be distributed under the terms of BSD
14 * See README and COPYING for more details.
17 #include "utils/includes.h"
19 #ifndef CONFIG_NATIVE_WINDOWS
21 #include "utils/common.h"
22 #include "common/ieee802_11_defs.h"
23 #include "common/ieee802_11_common.h"
24 #include "drivers/driver.h"
25 #include "wps/wps_defs.h"
28 #include "ieee802_11.h"
31 #include "ap_config.h"
33 #include "p2p_hostapd.h"
34 #include "ap_drv_ops.h"
41 static u8 ieee802_11_erp_info(struct hostapd_data *hapd)
45 if (hapd->iface->current_mode == NULL ||
46 hapd->iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G)
49 if (hapd->iface->olbc)
50 erp |= ERP_INFO_USE_PROTECTION;
51 if (hapd->iface->num_sta_non_erp > 0) {
52 erp |= ERP_INFO_NON_ERP_PRESENT |
53 ERP_INFO_USE_PROTECTION;
55 if (hapd->iface->num_sta_no_short_preamble > 0 ||
56 hapd->iconf->preamble == LONG_PREAMBLE)
57 erp |= ERP_INFO_BARKER_PREAMBLE_MODE;
63 static u8 * hostapd_eid_ds_params(struct hostapd_data *hapd, u8 *eid)
65 *eid++ = WLAN_EID_DS_PARAMS;
67 *eid++ = hapd->iconf->channel;
72 static u8 * hostapd_eid_erp_info(struct hostapd_data *hapd, u8 *eid)
74 if (hapd->iface->current_mode == NULL ||
75 hapd->iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G)
78 /* Set NonERP_present and use_protection bits if there
79 * are any associated NonERP stations. */
80 /* TODO: use_protection bit can be set to zero even if
81 * there are NonERP stations present. This optimization
82 * might be useful if NonERP stations are "quiet".
83 * See 802.11g/D6 E-1 for recommended practice.
84 * In addition, Non ERP present might be set, if AP detects Non ERP
85 * operation on other APs. */
87 /* Add ERP Information element */
88 *eid++ = WLAN_EID_ERP_INFO;
90 *eid++ = ieee802_11_erp_info(hapd);
96 static u8 * hostapd_eid_country_add(u8 *pos, u8 *end, int chan_spacing,
97 struct hostapd_channel_data *start,
98 struct hostapd_channel_data *prev)
103 /* first channel number */
104 *pos++ = start->chan;
105 /* number of channels */
106 *pos++ = (prev->chan - start->chan) / chan_spacing + 1;
107 /* maximum transmit power level */
108 *pos++ = start->max_tx_power;
114 static u8 * hostapd_eid_country(struct hostapd_data *hapd, u8 *eid,
118 u8 *end = eid + max_len;
120 struct hostapd_hw_modes *mode;
121 struct hostapd_channel_data *start, *prev;
122 int chan_spacing = 1;
124 if (!hapd->iconf->ieee80211d || max_len < 6 ||
125 hapd->iface->current_mode == NULL)
128 *pos++ = WLAN_EID_COUNTRY;
129 pos++; /* length will be set later */
130 os_memcpy(pos, hapd->iconf->country, 3); /* e.g., 'US ' */
133 mode = hapd->iface->current_mode;
134 if (mode->mode == HOSTAPD_MODE_IEEE80211A)
138 for (i = 0; i < mode->num_channels; i++) {
139 struct hostapd_channel_data *chan = &mode->channels[i];
140 if (chan->flag & HOSTAPD_CHAN_DISABLED)
143 prev->chan + chan_spacing == chan->chan &&
144 start->max_tx_power == chan->max_tx_power) {
146 continue; /* can use same entry */
150 pos = hostapd_eid_country_add(pos, end, chan_spacing,
155 /* Start new group */
160 pos = hostapd_eid_country_add(pos, end, chan_spacing,
164 if ((pos - eid) & 1) {
167 *pos++ = 0; /* pad for 16-bit alignment */
170 eid[1] = (pos - eid) - 2;
176 static u8 * hostapd_eid_wpa(struct hostapd_data *hapd, u8 *eid, size_t len)
181 ie = wpa_auth_get_wpa_ie(hapd->wpa_auth, &ielen);
182 if (ie == NULL || ielen > len)
185 os_memcpy(eid, ie, ielen);
190 static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
191 struct sta_info *sta,
192 const struct ieee80211_mgmt *req,
193 int is_p2p, size_t *resp_len)
195 struct ieee80211_mgmt *resp;
199 #define MAX_PROBERESP_LEN 768
200 buflen = MAX_PROBERESP_LEN;
202 if (hapd->wps_probe_resp_ie)
203 buflen += wpabuf_len(hapd->wps_probe_resp_ie);
204 #endif /* CONFIG_WPS */
206 if (hapd->p2p_probe_resp_ie)
207 buflen += wpabuf_len(hapd->p2p_probe_resp_ie);
208 #endif /* CONFIG_P2P */
209 resp = os_zalloc(buflen);
213 epos = ((u8 *) resp) + MAX_PROBERESP_LEN;
215 resp->frame_control = IEEE80211_FC(WLAN_FC_TYPE_MGMT,
216 WLAN_FC_STYPE_PROBE_RESP);
218 os_memcpy(resp->da, req->sa, ETH_ALEN);
219 os_memcpy(resp->sa, hapd->own_addr, ETH_ALEN);
221 os_memcpy(resp->bssid, hapd->own_addr, ETH_ALEN);
222 resp->u.probe_resp.beacon_int =
223 host_to_le16(hapd->iconf->beacon_int);
225 /* hardware or low-level driver will setup seq_ctrl and timestamp */
226 resp->u.probe_resp.capab_info =
227 host_to_le16(hostapd_own_capab_info(hapd, sta, 1));
229 pos = resp->u.probe_resp.variable;
230 *pos++ = WLAN_EID_SSID;
231 *pos++ = hapd->conf->ssid.ssid_len;
232 os_memcpy(pos, hapd->conf->ssid.ssid, hapd->conf->ssid.ssid_len);
233 pos += hapd->conf->ssid.ssid_len;
235 /* Supported rates */
236 pos = hostapd_eid_supp_rates(hapd, pos);
239 pos = hostapd_eid_ds_params(hapd, pos);
241 pos = hostapd_eid_country(hapd, pos, epos - pos);
243 /* ERP Information element */
244 pos = hostapd_eid_erp_info(hapd, pos);
246 /* Extended supported rates */
247 pos = hostapd_eid_ext_supp_rates(hapd, pos);
250 pos = hostapd_eid_wpa(hapd, pos, epos - pos);
252 #ifdef CONFIG_IEEE80211N
253 pos = hostapd_eid_ht_capabilities(hapd, pos);
254 pos = hostapd_eid_ht_operation(hapd, pos);
255 #endif /* CONFIG_IEEE80211N */
257 pos = hostapd_eid_ext_capab(hapd, pos);
259 pos = hostapd_eid_time_adv(hapd, pos);
260 pos = hostapd_eid_time_zone(hapd, pos);
262 pos = hostapd_eid_interworking(hapd, pos);
263 pos = hostapd_eid_adv_proto(hapd, pos);
264 pos = hostapd_eid_roaming_consortium(hapd, pos);
266 #ifdef CONFIG_IEEE80211AC
267 pos = hostapd_eid_vht_capabilities(hapd, pos);
268 pos = hostapd_eid_vht_operation(hapd, pos);
269 #endif /* CONFIG_IEEE80211AC */
271 /* Wi-Fi Alliance WMM */
272 pos = hostapd_eid_wmm(hapd, pos);
275 if (hapd->conf->wps_state && hapd->wps_probe_resp_ie) {
276 os_memcpy(pos, wpabuf_head(hapd->wps_probe_resp_ie),
277 wpabuf_len(hapd->wps_probe_resp_ie));
278 pos += wpabuf_len(hapd->wps_probe_resp_ie);
280 #endif /* CONFIG_WPS */
283 if ((hapd->conf->p2p & P2P_ENABLED) && is_p2p &&
284 hapd->p2p_probe_resp_ie) {
285 os_memcpy(pos, wpabuf_head(hapd->p2p_probe_resp_ie),
286 wpabuf_len(hapd->p2p_probe_resp_ie));
287 pos += wpabuf_len(hapd->p2p_probe_resp_ie);
289 #endif /* CONFIG_P2P */
290 #ifdef CONFIG_P2P_MANAGER
291 if ((hapd->conf->p2p & (P2P_MANAGE | P2P_ENABLED | P2P_GROUP_OWNER)) ==
293 pos = hostapd_eid_p2p_manage(hapd, pos);
294 #endif /* CONFIG_P2P_MANAGER */
297 pos = hostapd_eid_hs20_indication(hapd, pos);
298 #endif /* CONFIG_HS20 */
300 *resp_len = pos - (u8 *) resp;
305 void handle_probe_req(struct hostapd_data *hapd,
306 const struct ieee80211_mgmt *mgmt, size_t len,
310 struct ieee802_11_elems elems;
313 struct sta_info *sta = NULL;
317 ie = mgmt->u.probe_req.variable;
318 if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req))
320 ie_len = len - (IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req));
322 for (i = 0; hapd->probereq_cb && i < hapd->num_probereq_cb; i++)
323 if (hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx,
324 mgmt->sa, mgmt->da, mgmt->bssid,
325 ie, ie_len, ssi_signal) > 0)
328 if (!hapd->iconf->send_probe_response)
331 if (ieee802_11_parse_elems(ie, ie_len, &elems, 0) == ParseFailed) {
332 wpa_printf(MSG_DEBUG, "Could not parse ProbeReq from " MACSTR,
337 if ((!elems.ssid || !elems.supp_rates)) {
338 wpa_printf(MSG_DEBUG, "STA " MACSTR " sent probe request "
339 "without SSID or supported rates element",
345 if (hapd->p2p && elems.wps_ie) {
347 wps = ieee802_11_vendor_ie_concat(ie, ie_len, WPS_DEV_OUI_WFA);
348 if (wps && !p2p_group_match_dev_type(hapd->p2p_group, wps)) {
349 wpa_printf(MSG_MSGDUMP, "P2P: Ignore Probe Request "
350 "due to mismatch with Requested Device "
358 if (hapd->p2p && elems.p2p) {
360 p2p = ieee802_11_vendor_ie_concat(ie, ie_len, P2P_IE_VENDOR_TYPE);
361 if (p2p && !p2p_group_match_dev_id(hapd->p2p_group, p2p)) {
362 wpa_printf(MSG_MSGDUMP, "P2P: Ignore Probe Request "
363 "due to mismatch with Device ID");
369 #endif /* CONFIG_P2P */
371 if (hapd->conf->ignore_broadcast_ssid && elems.ssid_len == 0) {
372 wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR " for "
373 "broadcast SSID ignored", MAC2STR(mgmt->sa));
377 sta = ap_get_sta(hapd, mgmt->sa);
380 if ((hapd->conf->p2p & P2P_GROUP_OWNER) &&
381 elems.ssid_len == P2P_WILDCARD_SSID_LEN &&
382 os_memcmp(elems.ssid, P2P_WILDCARD_SSID,
383 P2P_WILDCARD_SSID_LEN) == 0) {
384 /* Process P2P Wildcard SSID like Wildcard SSID */
387 #endif /* CONFIG_P2P */
389 if (elems.ssid_len == 0 ||
390 (elems.ssid_len == hapd->conf->ssid.ssid_len &&
391 os_memcmp(elems.ssid, hapd->conf->ssid.ssid, elems.ssid_len) ==
394 sta->ssid_probe = &hapd->conf->ssid;
396 if (!(mgmt->da[0] & 0x01)) {
398 ieee802_11_print_ssid(ssid_txt, elems.ssid,
400 wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR
401 " for foreign SSID '%s' (DA " MACSTR ")",
402 MAC2STR(mgmt->sa), ssid_txt,
408 #ifdef CONFIG_INTERWORKING
409 if (elems.interworking && elems.interworking_len >= 1) {
410 u8 ant = elems.interworking[0] & 0x0f;
411 if (ant != INTERWORKING_ANT_WILDCARD &&
412 ant != hapd->conf->access_network_type) {
413 wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR
414 " for mismatching ANT %u ignored",
415 MAC2STR(mgmt->sa), ant);
420 if (elems.interworking &&
421 (elems.interworking_len == 7 || elems.interworking_len == 9)) {
423 if (elems.interworking_len == 7)
424 hessid = elems.interworking + 1;
426 hessid = elems.interworking + 1 + 2;
427 if (!is_broadcast_ether_addr(hessid) &&
428 os_memcmp(hessid, hapd->conf->hessid, ETH_ALEN) != 0) {
429 wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR
430 " for mismatching HESSID " MACSTR
432 MAC2STR(mgmt->sa), MAC2STR(hessid));
436 #endif /* CONFIG_INTERWORKING */
438 /* TODO: verify that supp_rates contains at least one matching rate
439 * with AP configuration */
441 resp = hostapd_gen_probe_resp(hapd, sta, mgmt, elems.p2p != NULL,
447 * If this is a broadcast probe request, apply no ack policy to avoid
450 noack = !!(elems.ssid_len == 0 && is_broadcast_ether_addr(mgmt->da));
452 if (hostapd_drv_send_mlme(hapd, resp, resp_len, noack) < 0)
453 perror("handle_probe_req: send");
457 wpa_printf(MSG_EXCESSIVE, "STA " MACSTR " sent probe request for %s "
458 "SSID", MAC2STR(mgmt->sa),
459 elems.ssid_len == 0 ? "broadcast" : "our");
463 static u8 * hostapd_probe_resp_offloads(struct hostapd_data *hapd,
466 /* check probe response offloading caps and print warnings */
467 if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD))
471 if (hapd->conf->wps_state && hapd->wps_probe_resp_ie &&
472 (!(hapd->iface->probe_resp_offloads &
473 (WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS |
474 WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2))))
475 wpa_printf(MSG_WARNING, "Device is trying to offload WPS "
476 "Probe Response while not supporting this");
477 #endif /* CONFIG_WPS */
480 if ((hapd->conf->p2p & P2P_ENABLED) && hapd->p2p_probe_resp_ie &&
481 !(hapd->iface->probe_resp_offloads &
482 WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P))
483 wpa_printf(MSG_WARNING, "Device is trying to offload P2P "
484 "Probe Response while not supporting this");
485 #endif /* CONFIG_P2P */
487 if (hapd->conf->interworking &&
488 !(hapd->iface->probe_resp_offloads &
489 WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING))
490 wpa_printf(MSG_WARNING, "Device is trying to offload "
491 "Interworking Probe Response while not supporting "
494 /* Generate a Probe Response template for the non-P2P case */
495 return hostapd_gen_probe_resp(hapd, NULL, NULL, 0, resp_len);
498 #endif /* NEED_AP_MLME */
501 void ieee802_11_set_beacon(struct hostapd_data *hapd)
503 struct ieee80211_mgmt *head = NULL;
505 size_t head_len = 0, tail_len = 0;
508 struct wpa_driver_ap_params params;
509 struct wpabuf *beacon, *proberesp, *assocresp;
513 #endif /* NEED_AP_MLME */
515 hapd->beacon_set_done = 1;
519 #define BEACON_HEAD_BUF_SIZE 256
520 #define BEACON_TAIL_BUF_SIZE 512
521 head = os_zalloc(BEACON_HEAD_BUF_SIZE);
522 tail_len = BEACON_TAIL_BUF_SIZE;
524 if (hapd->conf->wps_state && hapd->wps_beacon_ie)
525 tail_len += wpabuf_len(hapd->wps_beacon_ie);
526 #endif /* CONFIG_WPS */
528 if (hapd->p2p_beacon_ie)
529 tail_len += wpabuf_len(hapd->p2p_beacon_ie);
530 #endif /* CONFIG_P2P */
531 tailpos = tail = os_malloc(tail_len);
532 if (head == NULL || tail == NULL) {
533 wpa_printf(MSG_ERROR, "Failed to set beacon data");
539 head->frame_control = IEEE80211_FC(WLAN_FC_TYPE_MGMT,
540 WLAN_FC_STYPE_BEACON);
541 head->duration = host_to_le16(0);
542 os_memset(head->da, 0xff, ETH_ALEN);
544 os_memcpy(head->sa, hapd->own_addr, ETH_ALEN);
545 os_memcpy(head->bssid, hapd->own_addr, ETH_ALEN);
546 head->u.beacon.beacon_int =
547 host_to_le16(hapd->iconf->beacon_int);
549 /* hardware or low-level driver will setup seq_ctrl and timestamp */
550 capab_info = hostapd_own_capab_info(hapd, NULL, 0);
551 head->u.beacon.capab_info = host_to_le16(capab_info);
552 pos = &head->u.beacon.variable[0];
555 *pos++ = WLAN_EID_SSID;
556 if (hapd->conf->ignore_broadcast_ssid == 2) {
557 /* clear the data, but keep the correct length of the SSID */
558 *pos++ = hapd->conf->ssid.ssid_len;
559 os_memset(pos, 0, hapd->conf->ssid.ssid_len);
560 pos += hapd->conf->ssid.ssid_len;
561 } else if (hapd->conf->ignore_broadcast_ssid) {
562 *pos++ = 0; /* empty SSID */
564 *pos++ = hapd->conf->ssid.ssid_len;
565 os_memcpy(pos, hapd->conf->ssid.ssid,
566 hapd->conf->ssid.ssid_len);
567 pos += hapd->conf->ssid.ssid_len;
570 /* Supported rates */
571 pos = hostapd_eid_supp_rates(hapd, pos);
574 pos = hostapd_eid_ds_params(hapd, pos);
576 head_len = pos - (u8 *) head;
578 tailpos = hostapd_eid_country(hapd, tailpos,
579 tail + BEACON_TAIL_BUF_SIZE - tailpos);
581 /* ERP Information element */
582 tailpos = hostapd_eid_erp_info(hapd, tailpos);
584 /* Extended supported rates */
585 tailpos = hostapd_eid_ext_supp_rates(hapd, tailpos);
588 tailpos = hostapd_eid_wpa(hapd, tailpos, tail + BEACON_TAIL_BUF_SIZE -
591 #ifdef CONFIG_IEEE80211N
592 tailpos = hostapd_eid_ht_capabilities(hapd, tailpos);
593 tailpos = hostapd_eid_ht_operation(hapd, tailpos);
594 #endif /* CONFIG_IEEE80211N */
596 tailpos = hostapd_eid_ext_capab(hapd, tailpos);
599 * TODO: Time Advertisement element should only be included in some
600 * DTIM Beacon frames.
602 tailpos = hostapd_eid_time_adv(hapd, tailpos);
604 tailpos = hostapd_eid_interworking(hapd, tailpos);
605 tailpos = hostapd_eid_adv_proto(hapd, tailpos);
606 tailpos = hostapd_eid_roaming_consortium(hapd, tailpos);
608 #ifdef CONFIG_IEEE80211AC
609 tailpos = hostapd_eid_vht_capabilities(hapd, tailpos);
610 tailpos = hostapd_eid_vht_operation(hapd, tailpos);
611 #endif /* CONFIG_IEEE80211AC */
613 /* Wi-Fi Alliance WMM */
614 tailpos = hostapd_eid_wmm(hapd, tailpos);
617 if (hapd->conf->wps_state && hapd->wps_beacon_ie) {
618 os_memcpy(tailpos, wpabuf_head(hapd->wps_beacon_ie),
619 wpabuf_len(hapd->wps_beacon_ie));
620 tailpos += wpabuf_len(hapd->wps_beacon_ie);
622 #endif /* CONFIG_WPS */
625 if ((hapd->conf->p2p & P2P_ENABLED) && hapd->p2p_beacon_ie) {
626 os_memcpy(tailpos, wpabuf_head(hapd->p2p_beacon_ie),
627 wpabuf_len(hapd->p2p_beacon_ie));
628 tailpos += wpabuf_len(hapd->p2p_beacon_ie);
630 #endif /* CONFIG_P2P */
631 #ifdef CONFIG_P2P_MANAGER
632 if ((hapd->conf->p2p & (P2P_MANAGE | P2P_ENABLED | P2P_GROUP_OWNER)) ==
634 tailpos = hostapd_eid_p2p_manage(hapd, tailpos);
635 #endif /* CONFIG_P2P_MANAGER */
638 tailpos = hostapd_eid_hs20_indication(hapd, tailpos);
639 #endif /* CONFIG_HS20 */
641 tail_len = tailpos > tail ? tailpos - tail : 0;
643 resp = hostapd_probe_resp_offloads(hapd, &resp_len);
644 #endif /* NEED_AP_MLME */
646 os_memset(¶ms, 0, sizeof(params));
647 params.head = (u8 *) head;
648 params.head_len = head_len;
650 params.tail_len = tail_len;
651 params.proberesp = resp;
652 params.proberesp_len = resp_len;
653 params.dtim_period = hapd->conf->dtim_period;
654 params.beacon_int = hapd->iconf->beacon_int;
655 params.basic_rates = hapd->iconf->basic_rates;
656 params.ssid = hapd->conf->ssid.ssid;
657 params.ssid_len = hapd->conf->ssid.ssid_len;
658 params.pairwise_ciphers = hapd->conf->rsn_pairwise ?
659 hapd->conf->rsn_pairwise : hapd->conf->wpa_pairwise;
660 params.group_cipher = hapd->conf->wpa_group;
661 params.key_mgmt_suites = hapd->conf->wpa_key_mgmt;
662 params.auth_algs = hapd->conf->auth_algs;
663 params.wpa_version = hapd->conf->wpa;
664 params.privacy = hapd->conf->ssid.wep.keys_set || hapd->conf->wpa ||
665 (hapd->conf->ieee802_1x &&
666 (hapd->conf->default_wep_key_len ||
667 hapd->conf->individual_wep_key_len));
668 switch (hapd->conf->ignore_broadcast_ssid) {
670 params.hide_ssid = NO_SSID_HIDING;
673 params.hide_ssid = HIDDEN_SSID_ZERO_LEN;
676 params.hide_ssid = HIDDEN_SSID_ZERO_CONTENTS;
679 hostapd_build_ap_extra_ies(hapd, &beacon, &proberesp, &assocresp);
680 params.beacon_ies = beacon;
681 params.proberesp_ies = proberesp;
682 params.assocresp_ies = assocresp;
683 params.isolate = hapd->conf->isolate;
685 params.cts_protect = !!(ieee802_11_erp_info(hapd) &
686 ERP_INFO_USE_PROTECTION);
687 params.preamble = hapd->iface->num_sta_no_short_preamble == 0 &&
688 hapd->iconf->preamble == SHORT_PREAMBLE;
689 if (hapd->iface->current_mode &&
690 hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G)
691 params.short_slot_time =
692 hapd->iface->num_sta_no_short_slot_time > 0 ? 0 : 1;
694 params.short_slot_time = -1;
695 if (!hapd->iconf->ieee80211n || hapd->conf->disable_11n)
696 params.ht_opmode = -1;
698 params.ht_opmode = hapd->iface->ht_op_mode;
699 #endif /* NEED_AP_MLME */
700 params.interworking = hapd->conf->interworking;
701 if (hapd->conf->interworking &&
702 !is_zero_ether_addr(hapd->conf->hessid))
703 params.hessid = hapd->conf->hessid;
704 params.access_network_type = hapd->conf->access_network_type;
705 params.ap_max_inactivity = hapd->conf->ap_max_inactivity;
707 params.disable_dgaf = hapd->conf->disable_dgaf;
708 #endif /* CONFIG_HS20 */
709 if (hostapd_drv_set_ap(hapd, ¶ms))
710 wpa_printf(MSG_ERROR, "Failed to set beacon parameters");
711 hostapd_free_ap_extra_ies(hapd, beacon, proberesp, assocresp);
719 void ieee802_11_set_beacons(struct hostapd_iface *iface)
722 for (i = 0; i < iface->num_bss; i++)
723 ieee802_11_set_beacon(iface->bss[i]);
727 /* only update beacons if started */
728 void ieee802_11_update_beacons(struct hostapd_iface *iface)
731 for (i = 0; i < iface->num_bss; i++)
732 if (iface->bss[i]->beacon_set_done)
733 ieee802_11_set_beacon(iface->bss[i]);
736 #endif /* CONFIG_NATIVE_WINDOWS */