Lines Matching defs:hapd

36 u8 * hostapd_eid_assoc_comeback_time(struct hostapd_data *hapd,
46 if (hapd->conf->assoc_sa_query_max_timeout > tu)
47 timeout = hapd->conf->assoc_sa_query_max_timeout - tu;
50 if (timeout < hapd->conf->assoc_sa_query_max_timeout)
54 if (hapd->conf->test_assoc_comeback_type != -1)
55 type = hapd->conf->test_assoc_comeback_type;
62 void ieee802_11_send_sa_query_req(struct hostapd_data *hapd,
66 struct sta_info *sta = ap_get_sta(hapd, addr);
72 const u8 *own_addr = hapd->own_addr;
83 if (hostapd_drv_channel_info(hapd, &ci) != 0) {
89 if (hapd->conf->oci_freq_override_saquery_req) {
93 hapd->conf->oci_freq_override_saquery_req);
95 hapd->conf->oci_freq_override_saquery_req;
123 if (ap_sta_is_mld(hapd, sta))
124 own_addr = hapd->mld->mld_addr;
143 if (hostapd_drv_send_mlme(hapd, mgmt, end - (u8 *) mgmt, 0, NULL, 0, 0)
152 static void ieee802_11_send_sa_query_resp(struct hostapd_data *hapd,
160 const u8 *own_addr = hapd->own_addr;
167 sta = ap_get_sta(hapd, sa);
178 if (hostapd_drv_channel_info(hapd, &ci) != 0) {
184 if (hapd->conf->oci_freq_override_saquery_resp) {
188 hapd->conf->oci_freq_override_saquery_resp);
190 hapd->conf->oci_freq_override_saquery_resp;
221 if (ap_sta_is_mld(hapd, sta))
222 own_addr = hapd->mld->mld_addr;
241 if (hostapd_drv_send_mlme(hapd, resp, end - (u8 *) resp, 0, NULL, 0, 0)
250 void ieee802_11_sa_query_action(struct hostapd_data *hapd,
274 sta = ap_get_sta(hapd, sa);
294 if (hostapd_drv_channel_info(hapd, &ci) != 0) {
309 wpa_msg(hapd->msg_ctx, MSG_INFO, OCV_FAILURE "addr="
322 ieee802_11_send_sa_query_resp(hapd, sa, trans_id);
358 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
361 ap_sta_stop_sa_query(hapd, sta);
365 static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx,
372 if (hapd->iconf->obss_interval)
374 if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA)
378 if (hapd->conf->proxy_arp)
380 if (hapd->conf->coloc_intf_reporting) {
386 if (hapd->conf->wnm_sleep_mode)
388 if (hapd->conf->bss_transition)
390 if (hapd->iconf->mbssid)
397 if (hapd->conf->time_advertisement == 2)
399 if (hapd->conf->interworking)
403 if (hapd->conf->qos_map_set_len)
405 if (hapd->conf->tdls & TDLS_PROHIBIT)
407 if (hapd->conf->tdls & TDLS_PROHIBIT_CHAN_SWITCH) {
414 if (hapd->conf->hs20)
418 if (hapd->conf->mbo_enabled)
423 if (hapd->conf->ssid.utf8_ssid)
429 if (hapd->conf->ftm_responder)
431 if (hapd->conf->ftm_initiator)
436 if ((hapd->conf->wpa & WPA_PROTO_RSN) &&
437 wpa_key_mgmt_fils(hapd->conf->wpa_key_mgmt))
441 if (hostapd_get_he_twt_responder(hapd, IEEE80211_MODE_AP))
444 if (hostapd_get_ht_vht_twt_responder(hapd))
449 if (hapd->conf->wpa &&
450 wpa_key_mgmt_sae(hapd->conf->wpa_key_mgmt)) {
451 int in_use = hostapd_sae_pw_id_in_use(hapd->conf);
461 if (hapd->conf->beacon_prot &&
462 (hapd->iface->drv_flags &
465 if (hapd->iconf->mbssid == ENHANCED_MBSSID_ENABLED)
473 if (hapd->conf->wpa &&
474 wpa_key_mgmt_sae(hapd->conf->wpa_key_mgmt) &&
475 hostapd_sae_pk_exclusively(hapd->conf))
483 u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid,
489 if (len < hapd->iface->extended_capa_len)
490 len = hapd->iface->extended_capa_len;
495 hostapd_ext_capab_byte(hapd, pos, i, mbssid_complete);
497 if (i < hapd->iface->extended_capa_len) {
498 *pos &= ~hapd->iface->extended_capa_mask[i];
499 *pos |= hapd->iface->extended_capa[i];
503 *pos &= ~hapd->conf->ext_capa_mask[i];
504 *pos |= hapd->conf->ext_capa[i];
509 if (i == 10 && hapd->iconf->mbssid < ENHANCED_MBSSID_ENABLED)
511 if (i == 2 && !hapd->iconf->mbssid)
526 u8 * hostapd_eid_qos_map_set(struct hostapd_data *hapd, u8 *eid)
529 u8 len = hapd->conf->qos_map_set_len;
536 os_memcpy(pos, hapd->conf->qos_map_set, len);
543 u8 * hostapd_eid_interworking(struct hostapd_data *hapd, u8 *eid)
549 if (!hapd->conf->interworking)
555 *pos = hapd->conf->access_network_type;
556 if (hapd->conf->internet)
558 if (hapd->conf->asra)
560 if (hapd->conf->esr)
562 if (hapd->conf->uesa)
566 if (hapd->conf->venue_info_set) {
567 *pos++ = hapd->conf->venue_group;
568 *pos++ = hapd->conf->venue_type;
571 if (!is_zero_ether_addr(hapd->conf->hessid)) {
572 os_memcpy(pos, hapd->conf->hessid, ETH_ALEN);
583 u8 * hostapd_eid_adv_proto(struct hostapd_data *hapd, u8 *eid)
589 if (!hapd->conf->interworking)
602 u8 * hostapd_eid_roaming_consortium(struct hostapd_data *hapd, u8 *eid)
609 if (!hapd->conf->interworking ||
610 hapd->conf->roaming_consortium == NULL ||
611 hapd->conf->roaming_consortium_count == 0)
618 if (hapd->conf->roaming_consortium_count > 3 + 255)
620 else if (hapd->conf->roaming_consortium_count > 3)
621 *pos++ = hapd->conf->roaming_consortium_count - 3;
626 *pos = hapd->conf->roaming_consortium[0].len;
627 if (hapd->conf->roaming_consortium_count > 1)
628 *pos |= hapd->conf->roaming_consortium[1].len << 4;
631 if (hapd->conf->roaming_consortium_count > 3)
634 count = hapd->conf->roaming_consortium_count;
637 os_memcpy(pos, hapd->conf->roaming_consortium[i].oi,
638 hapd->conf->roaming_consortium[i].len);
639 pos += hapd->conf->roaming_consortium[i].len;
649 u8 * hostapd_eid_time_adv(struct hostapd_data *hapd, u8 *eid)
651 if (hapd->conf->time_advertisement != 2)
654 if (hapd->time_adv == NULL &&
655 hostapd_update_time_adv(hapd) < 0)
658 if (hapd->time_adv == NULL)
661 os_memcpy(eid, wpabuf_head(hapd->time_adv),
662 wpabuf_len(hapd->time_adv));
663 eid += wpabuf_len(hapd->time_adv);
669 u8 * hostapd_eid_time_zone(struct hostapd_data *hapd, u8 *eid)
673 if (hapd->conf->time_advertisement != 2 || !hapd->conf->time_zone)
676 len = os_strlen(hapd->conf->time_zone);
680 os_memcpy(eid, hapd->conf->time_zone, len);
687 int hostapd_update_time_adv(struct hostapd_data *hapd)
694 if (hapd->conf->time_advertisement != 2)
700 if (!hapd->time_adv) {
701 hapd->time_adv = wpabuf_alloc(elen);
702 if (hapd->time_adv == NULL)
704 pos = wpabuf_put(hapd->time_adv, elen);
706 pos = wpabuf_mhead_u8(hapd->time_adv);
734 *pos++ = hapd->time_update_counter++;
740 u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid,
746 if (hapd->conf->ap_max_inactivity > 0 &&
747 hapd->conf->bss_max_idle) {
751 val = hapd->conf->ap_max_inactivity;
766 *pos++ = hapd->conf->bss_max_idle == 2 ? BIT(0) : 0x00;
776 u8 * hostapd_eid_mbo_rssi_assoc_rej(struct hostapd_data *hapd, u8 *eid,
786 mbo[3] = hapd->iconf->rssi_reject_assoc_timeout;
792 u8 * hostapd_eid_mbo(struct hostapd_data *hapd, u8 *eid, size_t len)
797 if (!hapd->conf->mbo_enabled &&
798 !OCE_STA_CFON_ENABLED(hapd) && !OCE_AP_ENABLED(hapd))
801 if (hapd->conf->mbo_enabled) {
808 if (hapd->conf->mbo_enabled && hapd->mbo_assoc_disallow) {
811 *mbo_pos++ = hapd->mbo_assoc_disallow;
814 if (OCE_STA_CFON_ENABLED(hapd) || OCE_AP_ENABLED(hapd)) {
818 if (OCE_STA_CFON_ENABLED(hapd) && !OCE_AP_ENABLED(hapd))
832 u8 hostapd_mbo_ie_len(struct hostapd_data *hapd)
836 if (!hapd->conf->mbo_enabled &&
837 !OCE_STA_CFON_ENABLED(hapd) && !OCE_AP_ENABLED(hapd))
845 if (hapd->conf->mbo_enabled)
846 len += 3 + (hapd->mbo_assoc_disallow ? 3 : 0);
849 if (OCE_STA_CFON_ENABLED(hapd) || OCE_AP_ENABLED(hapd))
859 static int hostapd_eid_owe_trans_enabled(struct hostapd_data *hapd)
861 return hapd->conf->owe_transition_ssid_len > 0 &&
862 !is_zero_ether_addr(hapd->conf->owe_transition_bssid);
867 size_t hostapd_eid_owe_trans_len(struct hostapd_data *hapd)
870 if (!hostapd_eid_owe_trans_enabled(hapd))
872 return 6 + ETH_ALEN + 1 + hapd->conf->owe_transition_ssid_len;
879 u8 * hostapd_eid_owe_trans(struct hostapd_data *hapd, u8 *eid,
886 if (hapd->conf->owe_transition_ifname[0] &&
887 !hostapd_eid_owe_trans_enabled(hapd))
888 hostapd_owe_trans_get_info(hapd);
890 if (!hostapd_eid_owe_trans_enabled(hapd))
893 elen = hostapd_eid_owe_trans_len(hapd);
905 os_memcpy(pos, hapd->conf->owe_transition_bssid, ETH_ALEN);
907 *pos++ = hapd->conf->owe_transition_ssid_len;
908 os_memcpy(pos, hapd->conf->owe_transition_ssid,
909 hapd->conf->owe_transition_ssid_len);
910 pos += hapd->conf->owe_transition_ssid_len;
919 size_t hostapd_eid_dpp_cc_len(struct hostapd_data *hapd)
922 if (hostapd_dpp_configurator_connectivity(hapd))
929 u8 * hostapd_eid_dpp_cc(struct hostapd_data *hapd, u8 *eid, size_t len)
934 if (!hostapd_dpp_configurator_connectivity(hapd) || len < 6)
965 u8 * hostapd_eid_fils_indic(struct hostapd_data *hapd, u8 *eid, int hessid)
974 if (!(hapd->conf->wpa & WPA_PROTO_RSN) ||
975 !wpa_key_mgmt_fils(hapd->conf->wpa_key_mgmt))
978 realms = dl_list_len(&hapd->conf->fils_realms);
985 if (hapd->conf->erp_domain) {
990 if (hapd->conf->fils_cache_id_set)
992 if (hessid && !is_zero_ether_addr(hapd->conf->hessid))
996 if (hapd->conf->fils_dh_group) {
1004 if (hapd->conf->fils_cache_id_set) {
1005 os_memcpy(pos, hapd->conf->fils_cache_id, FILS_CACHE_ID_LEN);
1008 if (hessid && !is_zero_ether_addr(hapd->conf->hessid)) {
1009 os_memcpy(pos, hapd->conf->hessid, ETH_ALEN);
1013 dl_list_for_each(realm, &hapd->conf->fils_realms, struct fils_realm,
1096 u8 * hostapd_eid_rsnxe(struct hostapd_data *hapd, u8 *eid, size_t len)
1103 if (!(hapd->conf->wpa & WPA_PROTO_RSN))
1107 sae_pk = hostapd_sae_pk_in_use(hapd->conf);
1110 if (wpa_key_mgmt_sae(hapd->conf->wpa_key_mgmt) &&
1111 (hapd->conf->sae_pwe == SAE_PWE_HASH_TO_ELEMENT ||
1112 hapd->conf->sae_pwe == SAE_PWE_BOTH ||
1113 hostapd_sae_pw_id_in_use(hapd->conf) || sae_pk ||
1114 wpa_key_mgmt_sae_ext_key(hapd->conf->wpa_key_mgmt)) &&
1115 hapd->conf->sae_pwe != SAE_PWE_FORCE_HUNT_AND_PECK) {
1123 if (hapd->iface->drv_flags2 & WPA_DRIVER_FLAGS2_SEC_LTF_AP)
1125 if (hapd->iface->drv_flags2 & WPA_DRIVER_FLAGS2_SEC_RTT_AP)
1127 if (hapd->iface->drv_flags2 & WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_AP)
1129 if (hapd->conf->ssid_protection)
1156 u16 check_ext_capab(struct hostapd_data *hapd, struct sta_info *sta,
1180 struct sta_info * hostapd_ml_get_assoc_sta(struct hostapd_data *hapd,
1188 if (!ap_sta_is_mld(hapd, sta))
1191 *assoc_hapd = hapd;
1194 if (sta->mld_assoc_link_id == hapd->mld_link_id)
1197 other_hapd = hostapd_mld_get_link_bss(hapd, sta->mld_assoc_link_id);
1221 bool hostapd_get_ht_vht_twt_responder(struct hostapd_data *hapd)
1223 return hapd->iconf->ht_vht_twt_responder &&
1224 ((hapd->iconf->ieee80211n && !hapd->conf->disable_11n) ||
1225 (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac)) &&
1226 (hapd->iface->drv_flags2 &