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