• Home
  • Raw
  • Download

Lines Matching refs:hapd

57 prepare_auth_resp_fils(struct hostapd_data *hapd,
65 u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid) in hostapd_eid_supp_rates() argument
70 if (hapd->iface->current_rates == NULL) in hostapd_eid_supp_rates()
74 num = hapd->iface->num_rates; in hostapd_eid_supp_rates()
75 if (hapd->iconf->ieee80211n && hapd->iconf->require_ht) in hostapd_eid_supp_rates()
77 if (hapd->iconf->ieee80211ac && hapd->iconf->require_vht) in hostapd_eid_supp_rates()
86 for (i = 0, count = 0; i < hapd->iface->num_rates && count < num; in hostapd_eid_supp_rates()
89 *pos = hapd->iface->current_rates[i].rate / 5; in hostapd_eid_supp_rates()
90 if (hapd->iface->current_rates[i].flags & HOSTAPD_RATE_BASIC) in hostapd_eid_supp_rates()
95 if (hapd->iconf->ieee80211n && hapd->iconf->require_ht && count < 8) { in hostapd_eid_supp_rates()
100 if (hapd->iconf->ieee80211ac && hapd->iconf->require_vht && count < 8) { in hostapd_eid_supp_rates()
109 u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid) in hostapd_eid_ext_supp_rates() argument
114 if (hapd->iface->current_rates == NULL) in hostapd_eid_ext_supp_rates()
117 num = hapd->iface->num_rates; in hostapd_eid_ext_supp_rates()
118 if (hapd->iconf->ieee80211n && hapd->iconf->require_ht) in hostapd_eid_ext_supp_rates()
120 if (hapd->iconf->ieee80211ac && hapd->iconf->require_vht) in hostapd_eid_ext_supp_rates()
128 for (i = 0, count = 0; i < hapd->iface->num_rates && count < num + 8; in hostapd_eid_ext_supp_rates()
133 *pos = hapd->iface->current_rates[i].rate / 5; in hostapd_eid_ext_supp_rates()
134 if (hapd->iface->current_rates[i].flags & HOSTAPD_RATE_BASIC) in hostapd_eid_ext_supp_rates()
139 if (hapd->iconf->ieee80211n && hapd->iconf->require_ht) { in hostapd_eid_ext_supp_rates()
145 if (hapd->iconf->ieee80211ac && hapd->iconf->require_vht) { in hostapd_eid_ext_supp_rates()
155 u16 hostapd_own_capab_info(struct hostapd_data *hapd) in hostapd_own_capab_info() argument
163 dfs = hostapd_is_dfs_required(hapd->iface); in hostapd_own_capab_info()
170 if (hapd->iface->num_sta_no_short_preamble == 0 && in hostapd_own_capab_info()
171 hapd->iconf->preamble == SHORT_PREAMBLE) in hostapd_own_capab_info()
174 privacy = hapd->conf->ssid.wep.keys_set; in hostapd_own_capab_info()
176 if (hapd->conf->ieee802_1x && in hostapd_own_capab_info()
177 (hapd->conf->default_wep_key_len || in hostapd_own_capab_info()
178 hapd->conf->individual_wep_key_len)) in hostapd_own_capab_info()
181 if (hapd->conf->wpa) in hostapd_own_capab_info()
185 if (hapd->conf->osen) in hostapd_own_capab_info()
192 if (hapd->iface->current_mode && in hostapd_own_capab_info()
193 hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G && in hostapd_own_capab_info()
194 hapd->iface->num_sta_no_short_slot_time == 0) in hostapd_own_capab_info()
203 if (hapd->iface->current_mode && in hostapd_own_capab_info()
204 hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211A && in hostapd_own_capab_info()
205 (hapd->iconf->spectrum_mgmt_required || dfs)) in hostapd_own_capab_info()
209 if (hapd->conf->radio_measurements[i]) { in hostapd_own_capab_info()
220 static u16 auth_shared_key(struct hostapd_data *hapd, struct sta_info *sta, in auth_shared_key() argument
224 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in auth_shared_key()
257 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in auth_shared_key()
264 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in auth_shared_key()
277 static int send_auth_reply(struct hostapd_data *hapd, in send_auth_reply() argument
296 os_memcpy(reply->sa, hapd->own_addr, ETH_ALEN); in send_auth_reply()
310 if (hostapd_drv_send_mlme(hapd, reply, rlen, 0) < 0) in send_auth_reply()
326 struct hostapd_data *hapd = ctx; in handle_auth_ft_finish() local
330 reply_res = send_auth_reply(hapd, dst, bssid, WLAN_AUTH_FT, in handle_auth_ft_finish()
333 sta = ap_get_sta(hapd, dst); in handle_auth_ft_finish()
339 hostapd_drv_sta_remove(hapd, sta->addr); in handle_auth_ft_finish()
347 hostapd_logger(hapd, dst, HOSTAPD_MODULE_IEEE80211, in handle_auth_ft_finish()
350 mlme_authenticate_indication(hapd, sta); in handle_auth_ft_finish()
360 static struct wpabuf * auth_build_sae_commit(struct hostapd_data *hapd, in auth_build_sae_commit() argument
366 password = hapd->conf->sae_password; in auth_build_sae_commit()
368 password = hapd->conf->ssid.wpa_passphrase; in auth_build_sae_commit()
375 sae_prepare_commit(hapd->own_addr, sta->addr, in auth_build_sae_commit()
392 static struct wpabuf * auth_build_sae_confirm(struct hostapd_data *hapd, in auth_build_sae_confirm() argument
407 static int auth_sae_send_commit(struct hostapd_data *hapd, in auth_sae_send_commit() argument
414 data = auth_build_sae_commit(hapd, sta, update); in auth_sae_send_commit()
418 reply_res = send_auth_reply(hapd, sta->addr, bssid, WLAN_AUTH_SAE, 1, in auth_sae_send_commit()
428 static int auth_sae_send_confirm(struct hostapd_data *hapd, in auth_sae_send_confirm() argument
435 data = auth_build_sae_confirm(hapd, sta); in auth_sae_send_confirm()
439 reply_res = send_auth_reply(hapd, sta->addr, bssid, WLAN_AUTH_SAE, 2, in auth_sae_send_confirm()
449 static int use_sae_anti_clogging(struct hostapd_data *hapd) in use_sae_anti_clogging() argument
454 if (hapd->conf->sae_anti_clogging_threshold == 0) in use_sae_anti_clogging()
457 for (sta = hapd->sta_list; sta; sta = sta->next) { in use_sae_anti_clogging()
464 if (open >= hapd->conf->sae_anti_clogging_threshold) in use_sae_anti_clogging()
472 static int check_sae_token(struct hostapd_data *hapd, const u8 *addr, in check_sae_token() argument
479 if (hmac_sha256(hapd->sae_token_key, sizeof(hapd->sae_token_key), in check_sae_token()
488 static struct wpabuf * auth_build_token_req(struct hostapd_data *hapd, in auth_build_token_req() argument
496 if (!os_reltime_initialized(&hapd->last_sae_token_key_update) || in auth_build_token_req()
497 os_reltime_expired(&now, &hapd->last_sae_token_key_update, 60)) { in auth_build_token_req()
498 if (random_get_bytes(hapd->sae_token_key, in auth_build_token_req()
499 sizeof(hapd->sae_token_key)) < 0) in auth_build_token_req()
502 hapd->sae_token_key, sizeof(hapd->sae_token_key)); in auth_build_token_req()
503 hapd->last_sae_token_key_update = now; in auth_build_token_req()
513 hmac_sha256(hapd->sae_token_key, sizeof(hapd->sae_token_key), in auth_build_token_req()
533 struct hostapd_data *hapd = eloop_ctx; in auth_sae_retransmit_timer() local
546 ret = auth_sae_send_commit(hapd, sta, hapd->own_addr, 0); in auth_sae_retransmit_timer()
548 hapd->dot11RSNASAERetransPeriod * 1000, in auth_sae_retransmit_timer()
549 auth_sae_retransmit_timer, hapd, sta); in auth_sae_retransmit_timer()
552 ret = auth_sae_send_confirm(hapd, sta, hapd->own_addr); in auth_sae_retransmit_timer()
554 hapd->dot11RSNASAERetransPeriod * 1000, in auth_sae_retransmit_timer()
555 auth_sae_retransmit_timer, hapd, sta); in auth_sae_retransmit_timer()
567 void sae_clear_retransmit_timer(struct hostapd_data *hapd, struct sta_info *sta) in sae_clear_retransmit_timer() argument
569 eloop_cancel_timeout(auth_sae_retransmit_timer, hapd, sta); in sae_clear_retransmit_timer()
573 static void sae_set_retransmit_timer(struct hostapd_data *hapd, in sae_set_retransmit_timer() argument
576 if (!(hapd->conf->mesh & MESH_ENABLED)) in sae_set_retransmit_timer()
579 eloop_cancel_timeout(auth_sae_retransmit_timer, hapd, sta); in sae_set_retransmit_timer()
580 eloop_register_timeout(0, hapd->dot11RSNASAERetransPeriod * 1000, in sae_set_retransmit_timer()
581 auth_sae_retransmit_timer, hapd, sta); in sae_set_retransmit_timer()
585 void sae_accept_sta(struct hostapd_data *hapd, struct sta_info *sta) in sae_accept_sta() argument
589 mlme_authenticate_indication(hapd, sta); in sae_accept_sta()
592 wpa_auth_pmksa_add_sae(hapd->wpa_auth, sta->addr, in sae_accept_sta()
597 static int sae_sm_step(struct hostapd_data *hapd, struct sta_info *sta, in sae_sm_step() argument
608 ret = auth_sae_send_commit(hapd, sta, bssid, 1); in sae_sm_step()
624 if (hapd->conf->mesh & MESH_ENABLED) { in sae_sm_step()
630 ret = auth_sae_send_confirm(hapd, sta, bssid); in sae_sm_step()
645 sae_set_retransmit_timer(hapd, sta); in sae_sm_step()
647 hostapd_logger(hapd, sta->addr, in sae_sm_step()
654 sae_clear_retransmit_timer(hapd, sta); in sae_sm_step()
659 ret = auth_sae_send_confirm(hapd, sta, bssid); in sae_sm_step()
664 sae_set_retransmit_timer(hapd, sta); in sae_sm_step()
665 } else if (hapd->conf->mesh & MESH_ENABLED) { in sae_sm_step()
674 ret = auth_sae_send_commit(hapd, sta, bssid, 0); in sae_sm_step()
678 sae_set_retransmit_timer(hapd, sta); in sae_sm_step()
685 ret = auth_sae_send_confirm(hapd, sta, bssid); in sae_sm_step()
696 return sae_sm_step(hapd, sta, bssid, auth_transaction); in sae_sm_step()
700 sae_clear_retransmit_timer(hapd, sta); in sae_sm_step()
706 ret = auth_sae_send_commit(hapd, sta, bssid, 1); in sae_sm_step()
713 ret = auth_sae_send_confirm(hapd, sta, bssid); in sae_sm_step()
717 sae_set_retransmit_timer(hapd, sta); in sae_sm_step()
719 sae_accept_sta(hapd, sta); in sae_sm_step()
727 ap_free_sta(hapd, sta); in sae_sm_step()
728 wpa_auth_pmksa_remove(hapd->wpa_auth, sta->addr); in sae_sm_step()
734 ret = auth_sae_send_confirm(hapd, sta, bssid); in sae_sm_step()
749 static void sae_pick_next_group(struct hostapd_data *hapd, struct sta_info *sta) in sae_pick_next_group() argument
752 int i, *groups = hapd->conf->sae_groups; in sae_pick_next_group()
787 static void handle_auth_sae(struct hostapd_data *hapd, struct sta_info *sta, in handle_auth_sae() argument
795 if (hapd->conf->sae_reflection_attack && auth_transaction == 1) { in handle_auth_sae()
801 send_auth_reply(hapd, mgmt->sa, mgmt->bssid, WLAN_AUTH_SAE, in handle_auth_sae()
806 if (hapd->conf->sae_commit_override && auth_transaction == 1) { in handle_auth_sae()
808 send_auth_reply(hapd, mgmt->sa, mgmt->bssid, WLAN_AUTH_SAE, in handle_auth_sae()
810 wpabuf_head(hapd->conf->sae_commit_override), in handle_auth_sae()
811 wpabuf_len(hapd->conf->sae_commit_override)); in handle_auth_sae()
833 wpa_auth_pmksa_remove(hapd->wpa_auth, sta->addr); in handle_auth_sae()
840 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in handle_auth_sae()
845 if ((hapd->conf->mesh & MESH_ENABLED) && in handle_auth_sae()
857 hapd->conf->sae_groups, in handle_auth_sae()
883 resp = auth_sae_send_commit(hapd, sta, mgmt->bssid, 0); in handle_auth_sae()
891 sae_set_retransmit_timer(hapd, sta); in handle_auth_sae()
895 if ((hapd->conf->mesh & MESH_ENABLED) && in handle_auth_sae()
901 sae_pick_next_group(hapd, sta); in handle_auth_sae()
911 &token_len, hapd->conf->sae_groups); in handle_auth_sae()
918 if (token && check_sae_token(hapd, sta->addr, token, token_len) in handle_auth_sae()
930 if (!token && use_sae_anti_clogging(hapd)) { in handle_auth_sae()
934 data = auth_build_token_req(hapd, sta->sae->group, in handle_auth_sae()
937 if (hapd->conf->mesh & MESH_ENABLED) in handle_auth_sae()
942 resp = sae_sm_step(hapd, sta, mgmt->bssid, auth_transaction); in handle_auth_sae()
944 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in handle_auth_sae()
951 !(hapd->conf->mesh & MESH_ENABLED)) { in handle_auth_sae()
959 resp = sae_sm_step(hapd, sta, mgmt->bssid, auth_transaction); in handle_auth_sae()
961 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in handle_auth_sae()
972 send_auth_reply(hapd, mgmt->sa, mgmt->bssid, WLAN_AUTH_SAE, in handle_auth_sae()
981 hostapd_drv_sta_remove(hapd, sta->addr); in handle_auth_sae()
998 int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta) in auth_sae_init_committed() argument
1008 ret = auth_sae_send_commit(hapd, sta, hapd->own_addr, 0); in auth_sae_init_committed()
1014 sae_set_retransmit_timer(hapd, sta); in auth_sae_init_committed()
1050 static void handle_auth_fils_finish(struct hostapd_data *hapd,
1054 void handle_auth_fils(struct hostapd_data *hapd, struct sta_info *sta, in handle_auth_fils() argument
1057 void (*cb)(struct hostapd_data *hapd, in handle_auth_fils() argument
1094 if (group != hapd->conf->fils_dh_group) { in handle_auth_fils()
1097 group, hapd->conf->fils_dh_group); in handle_auth_fils()
1168 sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth, sta->addr, in handle_auth_fils()
1177 res = wpa_validate_wpa_ie(hapd->wpa_auth, sta->wpa_sm, in handle_auth_fils()
1205 pmksa = wpa_auth_pmksa_get(hapd->wpa_auth, sta->addr, in handle_auth_fils()
1209 pmksa = wpa_auth_pmksa_get_fils_cache_id(hapd->wpa_auth, in handle_auth_fils()
1246 ieee802_1x_alloc_eapol_sm(hapd, sta); in handle_auth_fils()
1251 hapd, sta, elems.fils_wrapped_data, in handle_auth_fils()
1278 data = prepare_auth_resp_fils(hapd, sta, &resp, pmksa, NULL, in handle_auth_fils()
1286 cb(hapd, sta, resp, data, pub); in handle_auth_fils()
1292 prepare_auth_resp_fils(struct hostapd_data *hapd, in prepare_auth_resp_fils() argument
1312 ie = wpa_auth_get_wpa_ie(hapd->wpa_auth, &ielen); in prepare_auth_resp_fils()
1361 wpabuf_put_le16(data, hapd->conf->fils_dh_group); in prepare_auth_resp_fils()
1378 res = wpa_auth_write_fte(hapd->wpa_auth, wpabuf_put(data, 0), in prepare_auth_resp_fils()
1436 hapd->wpa_auth, sta->addr, in prepare_auth_resp_fils()
1488 static void handle_auth_fils_finish(struct hostapd_data *hapd, in handle_auth_fils_finish() argument
1497 send_auth_reply(hapd, sta->addr, hapd->own_addr, auth_alg, 2, resp, in handle_auth_fils_finish()
1503 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in handle_auth_fils_finish()
1509 mlme_authenticate_indication(hapd, sta); in handle_auth_fils_finish()
1514 void ieee802_11_finish_fils_auth(struct hostapd_data *hapd, in ieee802_11_finish_fils_auth() argument
1528 data = prepare_auth_resp_fils(hapd, sta, &resp, NULL, erp_resp, in ieee802_11_finish_fils_auth()
1535 sta->fils_pending_cb(hapd, sta, resp, data, pub); in ieee802_11_finish_fils_auth()
1542 ieee802_11_allowed_address(struct hostapd_data *hapd, const u8 *addr, in ieee802_11_allowed_address() argument
1552 res = hostapd_allowed_address(hapd, addr, msg, len, in ieee802_11_allowed_address()
1578 ieee802_11_set_radius_info(struct hostapd_data *hapd, struct sta_info *sta, in ieee802_11_set_radius_info() argument
1586 !hostapd_vlan_valid(hapd->conf->vlan, vlan_id)) { in ieee802_11_set_radius_info()
1587 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS, in ieee802_11_set_radius_info()
1594 if (ap_sta_set_vlan(hapd, sta, vlan_id) < 0) in ieee802_11_set_radius_info()
1597 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS, in ieee802_11_set_radius_info()
1601 if (hapd->conf->wpa_psk_radius != PSK_RADIUS_IGNORED) { in ieee802_11_set_radius_info()
1613 if (hapd->conf->acct_interim_interval == 0 && acct_interim_interval) in ieee802_11_set_radius_info()
1616 ap_sta_session_timeout(hapd, sta, session_timeout); in ieee802_11_set_radius_info()
1618 ap_sta_no_session_timeout(hapd, sta); in ieee802_11_set_radius_info()
1624 static void handle_auth(struct hostapd_data *hapd, in handle_auth() argument
1649 if (hapd->iconf->ignore_auth_probability > 0.0 && in handle_auth()
1650 drand48() < hapd->iconf->ignore_auth_probability) { in handle_auth()
1688 if (hapd->tkip_countermeasures) { in handle_auth()
1693 if (!(((hapd->conf->auth_algs & WPA_AUTH_ALG_OPEN) && in handle_auth()
1696 (hapd->conf->wpa && wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt) && in handle_auth()
1700 (hapd->conf->wpa && wpa_key_mgmt_sae(hapd->conf->wpa_key_mgmt) && in handle_auth()
1704 (hapd->conf->wpa && wpa_key_mgmt_fils(hapd->conf->wpa_key_mgmt) && in handle_auth()
1706 (hapd->conf->wpa && wpa_key_mgmt_fils(hapd->conf->wpa_key_mgmt) && in handle_auth()
1707 hapd->conf->fils_dh_group && in handle_auth()
1710 ((hapd->conf->auth_algs & WPA_AUTH_ALG_SHARED) && in handle_auth()
1726 if (os_memcmp(mgmt->sa, hapd->own_addr, ETH_ALEN) == 0) { in handle_auth()
1733 if (hapd->conf->no_auth_if_seen_on) { in handle_auth()
1736 other = sta_track_seen_on(hapd->iface, mgmt->sa, in handle_auth()
1737 hapd->conf->no_auth_if_seen_on); in handle_auth()
1745 hapd->conf->iface, MAC2STR(mgmt->sa), in handle_auth()
1746 hapd->conf->no_auth_if_seen_on); in handle_auth()
1789 hapd, mgmt->sa, (const u8 *) mgmt, len, &session_timeout, in handle_auth()
1798 sta = ap_get_sta(hapd, mgmt->sa); in handle_auth()
1805 hostapd_logger(hapd, sta->addr, in handle_auth()
1813 if ((hapd->conf->mesh & MESH_ENABLED) && in handle_auth()
1823 if (hapd->conf->mesh & MESH_ENABLED) { in handle_auth()
1833 wpabuf_free(hapd->mesh_pending_auth); in handle_auth()
1834 hapd->mesh_pending_auth = wpabuf_alloc_copy(mgmt, len); in handle_auth()
1835 os_get_reltime(&hapd->mesh_pending_auth_time); in handle_auth()
1840 sta = ap_sta_add(hapd, mgmt->sa); in handle_auth()
1850 hapd, sta, res, session_timeout, acct_interim_interval, in handle_auth()
1879 if (FULL_AP_CLIENT_STATE_SUPP(hapd->iface->drv_flags) && in handle_auth()
1881 !(hapd->conf->mesh & MESH_ENABLED) && in handle_auth()
1890 hostapd_drv_sta_remove(hapd, sta->addr); in handle_auth()
1894 if (hostapd_sta_add(hapd, sta->addr, 0, 0, NULL, 0, 0, in handle_auth()
1896 hostapd_logger(hapd, sta->addr, in handle_auth()
1909 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in handle_auth()
1915 mlme_authenticate_indication(hapd, sta); in handle_auth()
1919 resp = auth_shared_key(hapd, sta, auth_transaction, challenge, in handle_auth()
1922 mlme_authenticate_indication(hapd, sta); in handle_auth()
1936 sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth, in handle_auth()
1948 handle_auth_ft_finish, hapd); in handle_auth()
1956 hapd->conf->mesh & MESH_ENABLED) { in handle_auth()
1959 wpa_auth_sta_init(hapd->wpa_auth, in handle_auth()
1969 handle_auth_sae(hapd, sta, mgmt, len, auth_transaction, in handle_auth()
1976 handle_auth_fils(hapd, sta, mgmt->u.auth.variable, in handle_auth()
1989 reply_res = send_auth_reply(hapd, mgmt->sa, mgmt->bssid, auth_alg, in handle_auth()
1995 hostapd_drv_sta_remove(hapd, sta->addr); in handle_auth()
2001 int hostapd_get_aid(struct hostapd_data *hapd, struct sta_info *sta) in hostapd_get_aid() argument
2015 if (hapd->sta_aid[i] == (u32) -1) in hostapd_get_aid()
2018 if (!(hapd->sta_aid[i] & BIT(j))) in hostapd_get_aid()
2031 hapd->sta_aid[i] |= BIT(j); in hostapd_get_aid()
2037 static u16 check_ssid(struct hostapd_data *hapd, struct sta_info *sta, in check_ssid() argument
2043 if (ssid_ie_len != hapd->conf->ssid.ssid_len || in check_ssid()
2044 os_memcmp(ssid_ie, hapd->conf->ssid.ssid, ssid_ie_len) != 0) { in check_ssid()
2045 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in check_ssid()
2056 static u16 check_wmm(struct hostapd_data *hapd, struct sta_info *sta, in check_wmm() argument
2061 if (wmm_ie && hapd->conf->wmm_enabled) { in check_wmm()
2064 if (!hostapd_eid_wmm_valid(hapd, wmm_ie, wmm_ie_len)) { in check_wmm()
2065 hostapd_logger(hapd, sta->addr, in check_wmm()
2081 static u16 copy_supp_rates(struct hostapd_data *hapd, struct sta_info *sta, in copy_supp_rates() argument
2085 if (hapd->iface->current_mode && in copy_supp_rates()
2086 hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211AD) in copy_supp_rates()
2090 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in copy_supp_rates()
2098 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in copy_supp_rates()
2115 static u16 check_ext_capab(struct hostapd_data *hapd, struct sta_info *sta, in check_ext_capab() argument
2135 static int owe_group_supported(struct hostapd_data *hapd, u16 group) in owe_group_supported() argument
2138 int *groups = hapd->conf->owe_groups; in owe_group_supported()
2155 static u16 owe_process_assoc_req(struct hostapd_data *hapd, in owe_process_assoc_req() argument
2174 if (!owe_group_supported(hapd, group)) { in owe_process_assoc_req()
2291 wpa_auth_pmksa_add2(hapd->wpa_auth, sta->addr, sta->owe_pmk, in owe_process_assoc_req()
2300 static u16 check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta, in check_assoc_ies() argument
2310 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in check_assoc_ies()
2316 resp = check_ssid(hapd, sta, elems.ssid, elems.ssid_len); in check_assoc_ies()
2319 resp = check_wmm(hapd, sta, elems.wmm, elems.wmm_len); in check_assoc_ies()
2322 resp = check_ext_capab(hapd, sta, elems.ext_capab, elems.ext_capab_len); in check_assoc_ies()
2325 resp = copy_supp_rates(hapd, sta, &elems); in check_assoc_ies()
2329 resp = copy_sta_ht_capab(hapd, sta, elems.ht_capabilities); in check_assoc_ies()
2332 if (hapd->iconf->ieee80211n && hapd->iconf->require_ht && in check_assoc_ies()
2334 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in check_assoc_ies()
2342 if (hapd->iconf->ieee80211ac) { in check_assoc_ies()
2343 resp = copy_sta_vht_capab(hapd, sta, elems.vht_capabilities); in check_assoc_ies()
2347 resp = set_sta_vht_opmode(hapd, sta, elems.vht_opmode_notif); in check_assoc_ies()
2352 if (hapd->iconf->ieee80211ac && hapd->iconf->require_vht && in check_assoc_ies()
2354 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in check_assoc_ies()
2360 if (hapd->conf->vendor_vht && !elems.vht_capabilities) { in check_assoc_ies()
2361 resp = copy_sta_vendor_vht(hapd, sta, elems.vendor_vht, in check_assoc_ies()
2381 if ((hapd->conf->wpa & WPA_PROTO_RSN) && elems.rsn_ie) { in check_assoc_ies()
2384 } else if ((hapd->conf->wpa & WPA_PROTO_WPA) && in check_assoc_ies()
2395 if (hapd->conf->wps_state && elems.wps_ie) { in check_assoc_ies()
2413 } else if (hapd->conf->wps_state && wpa_ie == NULL) { in check_assoc_ies()
2419 if (hapd->conf->wpa && wpa_ie == NULL) { in check_assoc_ies()
2420 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in check_assoc_ies()
2426 if (hapd->conf->wpa && wpa_ie) { in check_assoc_ies()
2431 sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth, in check_assoc_ies()
2439 res = wpa_validate_wpa_ie(hapd->wpa_auth, sta->wpa_sm, in check_assoc_ies()
2449 ap_check_sa_query_timeout(hapd, sta); in check_assoc_ies()
2460 ap_sta_start_sa_query(hapd, sta); in check_assoc_ies()
2513 if ((hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_OWE) && in check_assoc_ies()
2516 resp = owe_process_assoc_req(hapd, sta, elems.owe_dh, in check_assoc_ies()
2526 hostapd_logger(hapd, sta->addr, in check_assoc_ies()
2535 } else if (hapd->conf->osen) { in check_assoc_ies()
2538 hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in check_assoc_ies()
2546 sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth, in check_assoc_ies()
2553 if (wpa_validate_osen(hapd->wpa_auth, sta->wpa_sm, in check_assoc_ies()
2561 p2p_group_notif_assoc(hapd->p2p_group, sta->addr, ies, ies_len); in check_assoc_ies()
2575 if (hapd->iface->fst) in check_assoc_ies()
2582 mbo_ap_check_sta_assoc(hapd, sta, &elems); in check_assoc_ies()
2584 if (hapd->conf->mbo_enabled && (hapd->conf->wpa & 2) && in check_assoc_ies()
2586 hapd->conf->ieee80211w != NO_MGMT_FRAME_PROTECTION) { in check_assoc_ies()
2606 static void send_deauth(struct hostapd_data *hapd, const u8 *addr, in send_deauth() argument
2616 os_memcpy(reply.sa, hapd->own_addr, ETH_ALEN); in send_deauth()
2617 os_memcpy(reply.bssid, hapd->own_addr, ETH_ALEN); in send_deauth()
2622 if (hostapd_drv_send_mlme(hapd, &reply, send_len, 0) < 0) in send_deauth()
2628 static int add_associated_sta(struct hostapd_data *hapd, in add_associated_sta() argument
2650 hostapd_drv_sta_remove(hapd, sta->addr); in add_associated_sta()
2657 hostapd_get_ht_capab(hapd, sta->ht_capabilities, &ht_cap); in add_associated_sta()
2661 hostapd_get_vht_capab(hapd, sta->vht_capabilities, &vht_cap); in add_associated_sta()
2669 if (hostapd_sta_add(hapd, sta->addr, sta->aid, sta->capability, in add_associated_sta()
2677 hostapd_logger(hapd, sta->addr, in add_associated_sta()
2683 hostapd_drv_sta_remove(hapd, sta->addr); in add_associated_sta()
2696 static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta, in send_assoc_resp() argument
2713 if (sta && (hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_OWE)) in send_assoc_resp()
2727 os_memcpy(reply->sa, hapd->own_addr, ETH_ALEN); in send_assoc_resp()
2728 os_memcpy(reply->bssid, hapd->own_addr, ETH_ALEN); in send_assoc_resp()
2733 host_to_le16(hostapd_own_capab_info(hapd)); in send_assoc_resp()
2739 p = hostapd_eid_supp_rates(hapd, reply->u.assoc_resp.variable); in send_assoc_resp()
2741 p = hostapd_eid_ext_supp_rates(hapd, p); in send_assoc_resp()
2754 if (sta && (hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_OWE)) in send_assoc_resp()
2762 p = hostapd_eid_assoc_comeback_time(hapd, sta, p); in send_assoc_resp()
2766 p = hostapd_eid_ht_capabilities(hapd, p); in send_assoc_resp()
2767 p = hostapd_eid_ht_operation(hapd, p); in send_assoc_resp()
2771 if (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) { in send_assoc_resp()
2774 if (sta && hapd->conf->use_sta_nsts && sta->vht_capabilities) { in send_assoc_resp()
2777 nsts = (hapd->iface->conf->vht_capab >> in send_assoc_resp()
2788 p = hostapd_eid_vht_capabilities(hapd, p, nsts); in send_assoc_resp()
2789 p = hostapd_eid_vht_operation(hapd, p); in send_assoc_resp()
2793 p = hostapd_eid_ext_capab(hapd, p); in send_assoc_resp()
2794 p = hostapd_eid_bss_max_idle_period(hapd, p); in send_assoc_resp()
2796 p = hostapd_eid_qos_map_set(hapd, p); in send_assoc_resp()
2799 if (hapd->iface->fst_ies) { in send_assoc_resp()
2800 os_memcpy(p, wpabuf_head(hapd->iface->fst_ies), in send_assoc_resp()
2801 wpabuf_len(hapd->iface->fst_ies)); in send_assoc_resp()
2802 p += wpabuf_len(hapd->iface->fst_ies); in send_assoc_resp()
2807 if (sta && hapd->conf->vendor_vht && (sta->flags & WLAN_STA_VENDOR_VHT)) in send_assoc_resp()
2808 p = hostapd_eid_vendor_vht(hapd, p); in send_assoc_resp()
2812 p = hostapd_eid_wmm(hapd, p); in send_assoc_resp()
2817 ((sta->flags & WLAN_STA_MAYBE_WPS) && hapd->conf->wpa))) { in send_assoc_resp()
2828 if (sta && sta->p2p_ie && hapd->p2p_group) { in send_assoc_resp()
2842 p2p_resp_ie = p2p_group_assoc_resp_ie(hapd->p2p_group, status); in send_assoc_resp()
2853 if (hapd->conf->p2p & P2P_MANAGE) in send_assoc_resp()
2854 p = hostapd_eid_p2p_manage(hapd, p); in send_assoc_resp()
2857 p = hostapd_eid_mbo(hapd, p, buf + buflen - p); in send_assoc_resp()
2859 if (hapd->conf->assocresp_elements && in send_assoc_resp()
2861 wpabuf_len(hapd->conf->assocresp_elements)) { in send_assoc_resp()
2862 os_memcpy(p, wpabuf_head(hapd->conf->assocresp_elements), in send_assoc_resp()
2863 wpabuf_len(hapd->conf->assocresp_elements)); in send_assoc_resp()
2864 p += wpabuf_len(hapd->conf->assocresp_elements); in send_assoc_resp()
2900 if ((hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_OWE) && in send_assoc_resp()
2923 if (hostapd_drv_send_mlme(hapd, reply, send_len, 0) < 0) { in send_assoc_resp()
2937 void fils_hlp_finish_assoc(struct hostapd_data *hapd, struct sta_info *sta) in fils_hlp_finish_assoc() argument
2943 eloop_cancel_timeout(fils_hlp_timeout, hapd, sta); in fils_hlp_finish_assoc()
2946 reply_res = send_assoc_resp(hapd, sta, sta->addr, WLAN_STATUS_SUCCESS, in fils_hlp_finish_assoc()
2963 hostapd_drv_sta_remove(hapd, sta->addr); in fils_hlp_finish_assoc()
2969 struct hostapd_data *hapd = eloop_ctx; in fils_hlp_timeout() local
2976 hostapd_notify_assoc_fils_finish(hapd, sta); in fils_hlp_timeout()
2978 fils_hlp_finish_assoc(hapd, sta); in fils_hlp_timeout()
2984 static void handle_assoc(struct hostapd_data *hapd, in handle_assoc() argument
3010 if (hapd->iconf->ignore_reassoc_probability > 0.0 && in handle_assoc()
3011 drand48() < hapd->iconf->ignore_reassoc_probability) { in handle_assoc()
3018 if (hapd->iconf->ignore_assoc_probability > 0.0 && in handle_assoc()
3019 drand48() < hapd->iconf->ignore_assoc_probability) { in handle_assoc()
3056 sta = ap_get_sta(hapd, mgmt->sa); in handle_assoc()
3072 if (hapd->iface->current_mode && in handle_assoc()
3073 hapd->iface->current_mode->mode == in handle_assoc()
3080 hapd, mgmt->sa, (const u8 *) mgmt, len, in handle_assoc()
3092 sta = ap_sta_add(hapd, mgmt->sa); in handle_assoc()
3094 hostapd_logger(hapd, mgmt->sa, in handle_assoc()
3103 hapd, sta, acl_res, session_timeout, in handle_assoc()
3111 hostapd_logger(hapd, sta->addr, in handle_assoc()
3119 hostapd_logger(hapd, mgmt->sa, in handle_assoc()
3125 send_deauth(hapd, mgmt->sa, in handle_assoc()
3136 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in handle_assoc()
3146 if (hapd->tkip_countermeasures) { in handle_assoc()
3151 if (listen_interval > hapd->conf->max_listen_interval) { in handle_assoc()
3152 hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, in handle_assoc()
3161 if (hapd->conf->mbo_enabled && hapd->mbo_assoc_disallow) { in handle_assoc()
3198 resp = check_assoc_ies(hapd, sta, pos, left, reassoc); in handle_assoc()
3202 if (hostapd_get_aid(hapd, sta) < 0) { in handle_assoc()
3203 hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, in handle_assoc()
3211 if (hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G) in handle_assoc()
3221 hapd->iface->num_sta_non_erp++; in handle_assoc()
3222 if (hapd->iface->num_sta_non_erp == 1) in handle_assoc()
3223 ieee802_11_set_beacons(hapd->iface); in handle_assoc()
3229 hapd->iface->num_sta_no_short_slot_time++; in handle_assoc()
3230 if (hapd->iface->current_mode->mode == in handle_assoc()
3232 hapd->iface->num_sta_no_short_slot_time == 1) in handle_assoc()
3233 ieee802_11_set_beacons(hapd->iface); in handle_assoc()
3244 hapd->iface->num_sta_no_short_preamble++; in handle_assoc()
3245 if (hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G in handle_assoc()
3246 && hapd->iface->num_sta_no_short_preamble == 1) in handle_assoc()
3247 ieee802_11_set_beacons(hapd->iface); in handle_assoc()
3251 update_ht_state(hapd, sta); in handle_assoc()
3254 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in handle_assoc()
3279 taxonomy_sta_info_assoc_req(hapd, sta, pos, left); in handle_assoc()
3288 if (fils_process_hlp(hapd, sta, pos, left) > 0) in handle_assoc()
3316 if (resp == WLAN_STATUS_SUCCESS && sta && add_associated_sta(hapd, sta)) in handle_assoc()
3321 eloop_cancel_timeout(fils_hlp_timeout, hapd, sta); in handle_assoc()
3336 eloop_cancel_timeout(fils_hlp_timeout, hapd, sta); in handle_assoc()
3337 eloop_register_timeout(0, hapd->conf->fils_hlp_wait_time * 1024, in handle_assoc()
3338 fils_hlp_timeout, hapd, sta); in handle_assoc()
3343 reply_res = send_assoc_resp(hapd, sta, mgmt->sa, resp, reassoc, pos, in handle_assoc()
3354 hostapd_drv_sta_remove(hapd, sta->addr); in handle_assoc()
3360 static void handle_disassoc(struct hostapd_data *hapd, in handle_disassoc() argument
3375 sta = ap_get_sta(hapd, mgmt->sa); in handle_disassoc()
3382 ap_sta_set_authorized(hapd, sta, 0); in handle_disassoc()
3386 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in handle_disassoc()
3392 accounting_sta_stop(hapd, sta); in handle_disassoc()
3393 ieee802_1x_free_station(hapd, sta); in handle_disassoc()
3395 hostapd_drv_br_delete_ip_neigh(hapd, 4, (u8 *) &sta->ipaddr); in handle_disassoc()
3396 ap_sta_ip6addr_del(hapd, sta); in handle_disassoc()
3397 hostapd_drv_sta_remove(hapd, sta->addr); in handle_disassoc()
3403 eloop_cancel_timeout(ap_handle_timer, hapd, sta); in handle_disassoc()
3405 hapd, sta); in handle_disassoc()
3409 hapd, sta, le_to_host16(mgmt->u.disassoc.reason_code)); in handle_disassoc()
3413 if (hapd->iface->current_mode && in handle_disassoc()
3414 hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211AD) { in handle_disassoc()
3417 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in handle_disassoc()
3419 ap_free_sta(hapd, sta); in handle_disassoc()
3424 static void handle_deauth(struct hostapd_data *hapd, in handle_deauth() argument
3430 wpa_msg(hapd->msg_ctx, MSG_DEBUG, "handle_deauth - too short " in handle_deauth()
3435 wpa_msg(hapd->msg_ctx, MSG_DEBUG, "deauthentication: STA=" MACSTR in handle_deauth()
3439 sta = ap_get_sta(hapd, mgmt->sa); in handle_deauth()
3441 wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying " in handle_deauth()
3447 ap_sta_set_authorized(hapd, sta, 0); in handle_deauth()
3452 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in handle_deauth()
3455 hapd, sta, le_to_host16(mgmt->u.deauth.reason_code)); in handle_deauth()
3458 ap_free_sta(hapd, sta); in handle_deauth()
3462 static void handle_beacon(struct hostapd_data *hapd, in handle_beacon() argument
3479 ap_list_process_beacon(hapd->iface, mgmt, &elems, fi); in handle_beacon()
3485 static int hostapd_sa_query_action(struct hostapd_data *hapd, in hostapd_sa_query_action() argument
3499 ieee802_11_sa_query_action(hapd, mgmt->sa, in hostapd_sa_query_action()
3514 static int handle_action(struct hostapd_data *hapd, in handle_action() argument
3518 sta = ap_get_sta(hapd, mgmt->sa); in handle_action()
3521 hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, in handle_action()
3540 hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, in handle_action()
3556 hostapd_logger(hapd, sta->addr, in handle_action()
3578 hostapd_wmm_action(hapd, mgmt, len); in handle_action()
3582 return hostapd_sa_query_action(hapd, mgmt, len); in handle_action()
3586 ieee802_11_rx_wnm_action_ap(hapd, mgmt, len); in handle_action()
3591 if (hapd->iface->fst) in handle_action()
3592 fst_rx_action(hapd->iface->fst, mgmt, len); in handle_action()
3607 hostapd_2040_coex_action(hapd, mgmt, len); in handle_action()
3623 hostapd_dpp_rx_action(hapd, mgmt->sa, pos, end - pos, in handle_action()
3624 hapd->iface->freq); in handle_action()
3636 gas_query_ap_rx(hapd->gas, mgmt->sa, in handle_action()
3638 pos, end - pos, hapd->iface->freq); in handle_action()
3642 if (hapd->public_action_cb) { in handle_action()
3643 hapd->public_action_cb(hapd->public_action_cb_ctx, in handle_action()
3645 hapd->iface->freq); in handle_action()
3647 if (hapd->public_action_cb2) { in handle_action()
3648 hapd->public_action_cb2(hapd->public_action_cb2_ctx, in handle_action()
3650 hapd->iface->freq); in handle_action()
3652 if (hapd->public_action_cb || hapd->public_action_cb2) in handle_action()
3656 if (hapd->vendor_action_cb) { in handle_action()
3657 if (hapd->vendor_action_cb(hapd->vendor_action_cb_ctx, in handle_action()
3659 hapd->iface->freq) == 0) in handle_action()
3664 hostapd_handle_radio_measurement(hapd, (const u8 *) mgmt, len); in handle_action()
3668 hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, in handle_action()
3689 os_memcpy(resp->sa, hapd->own_addr, ETH_ALEN); in handle_action()
3690 os_memcpy(resp->bssid, hapd->own_addr, ETH_ALEN); in handle_action()
3693 if (hostapd_drv_send_mlme(hapd, resp, len, 0) < 0) { in handle_action()
3717 int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len, in ieee802_11_mgmt() argument
3732 handle_beacon(hapd, mgmt, len, fi); in ieee802_11_mgmt()
3739 !((hapd->conf->p2p & P2P_GROUP_OWNER) && in ieee802_11_mgmt()
3743 !(hapd->conf->mesh & MESH_ENABLED) && in ieee802_11_mgmt()
3745 os_memcmp(mgmt->bssid, hapd->own_addr, ETH_ALEN) != 0) { in ieee802_11_mgmt()
3753 handle_probe_req(hapd, mgmt, len, fi->ssi_signal); in ieee802_11_mgmt()
3759 os_memcmp(mgmt->da, hapd->own_addr, ETH_ALEN) != 0) { in ieee802_11_mgmt()
3760 hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, in ieee802_11_mgmt()
3767 if (hapd->iconf->track_sta_max_num) in ieee802_11_mgmt()
3768 sta_track_add(hapd->iface, mgmt->sa, fi->ssi_signal); in ieee802_11_mgmt()
3773 handle_auth(hapd, mgmt, len); in ieee802_11_mgmt()
3778 handle_assoc(hapd, mgmt, len, 0); in ieee802_11_mgmt()
3783 handle_assoc(hapd, mgmt, len, 1); in ieee802_11_mgmt()
3788 handle_disassoc(hapd, mgmt, len); in ieee802_11_mgmt()
3792 wpa_msg(hapd->msg_ctx, MSG_DEBUG, "mgmt::deauth"); in ieee802_11_mgmt()
3793 handle_deauth(hapd, mgmt, len); in ieee802_11_mgmt()
3798 ret = handle_action(hapd, mgmt, len); in ieee802_11_mgmt()
3801 hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, in ieee802_11_mgmt()
3811 static void handle_auth_cb(struct hostapd_data *hapd, in handle_auth_cb() argument
3818 sta = ap_get_sta(hapd, mgmt->da); in handle_auth_cb()
3830 hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211, in handle_auth_cb()
3845 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in handle_auth_cb()
3849 hostapd_set_sta_flags(hapd, sta); in handle_auth_cb()
3855 hostapd_drv_sta_remove(hapd, sta->addr); in handle_auth_cb()
3861 static void hostapd_set_wds_encryption(struct hostapd_data *hapd, in hostapd_set_wds_encryption() argument
3866 struct hostapd_ssid *ssid = &hapd->conf->ssid; in hostapd_set_wds_encryption()
3868 if (hapd->conf->ieee802_1x || hapd->conf->wpa) in hostapd_set_wds_encryption()
3873 hostapd_drv_set_key(ifname_wds, hapd, WPA_ALG_WEP, NULL, i, in hostapd_set_wds_encryption()
3885 static void handle_assoc_cb(struct hostapd_data *hapd, in handle_assoc_cb() argument
3893 sta = ap_get_sta(hapd, mgmt->da); in handle_assoc_cb()
3905 hostapd_drv_sta_remove(hapd, sta->addr); in handle_assoc_cb()
3915 hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211, in handle_assoc_cb()
3921 hostapd_drv_sta_remove(hapd, sta->addr); in handle_assoc_cb()
3931 accounting_sta_stop(hapd, sta); in handle_assoc_cb()
3933 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in handle_assoc_cb()
3942 if ((!hapd->conf->ieee802_1x && !hapd->conf->wpa && in handle_assoc_cb()
3943 !hapd->conf->osen) || in handle_assoc_cb()
3952 ap_sta_set_authorized(hapd, sta, 1); in handle_assoc_cb()
3956 mlme_reassociate_indication(hapd, sta); in handle_assoc_cb()
3958 mlme_associate_indication(hapd, sta); in handle_assoc_cb()
3970 if (ap_sta_bind_vlan(hapd, sta) < 0) in handle_assoc_cb()
3974 if (ap_sta_bind_vlan(hapd, sta) < 0) in handle_assoc_cb()
3978 hostapd_set_sta_flags(hapd, sta); in handle_assoc_cb()
3995 ret = hostapd_set_wds_sta(hapd, ifname_wds, sta->addr, in handle_assoc_cb()
3998 hostapd_set_wds_encryption(hapd, sta, ifname_wds); in handle_assoc_cb()
4005 hapd->new_assoc_sta_cb(hapd, sta, !new_assoc); in handle_assoc_cb()
4014 ap_sta_disconnect(hapd, sta, sta->addr, in handle_assoc_cb()
4030 hapd, mgmt->da, in handle_assoc_cb()
4041 static void handle_deauth_cb(struct hostapd_data *hapd, in handle_deauth_cb() argument
4048 sta = ap_get_sta(hapd, mgmt->da); in handle_deauth_cb()
4061 ap_sta_deauth_cb(hapd, sta); in handle_deauth_cb()
4065 static void handle_disassoc_cb(struct hostapd_data *hapd, in handle_disassoc_cb() argument
4072 sta = ap_get_sta(hapd, mgmt->da); in handle_disassoc_cb()
4085 ap_sta_disassoc_cb(hapd, sta); in handle_disassoc_cb()
4089 static void handle_action_cb(struct hostapd_data *hapd, in handle_action_cb() argument
4111 hostapd_dpp_tx_status(hapd, mgmt->da, pos, end - pos, ok); in handle_action_cb()
4124 gas_query_ap_tx_status(hapd->gas, mgmt->da, pos, end - pos, ok); in handle_action_cb()
4128 sta = ap_get_sta(hapd, mgmt->da); in handle_action_cb()
4144 hostapd_rrm_beacon_req_tx_status(hapd, mgmt, len, ok); in handle_action_cb()
4157 void ieee802_11_mgmt_cb(struct hostapd_data *hapd, const u8 *buf, size_t len, in ieee802_11_mgmt_cb() argument
4164 if (hapd->ext_mgmt_frame_handling) { in ieee802_11_mgmt_cb()
4170 wpa_msg(hapd->msg_ctx, MSG_INFO, in ieee802_11_mgmt_cb()
4182 handle_auth_cb(hapd, mgmt, len, ok); in ieee802_11_mgmt_cb()
4186 handle_assoc_cb(hapd, mgmt, len, 0, ok); in ieee802_11_mgmt_cb()
4190 handle_assoc_cb(hapd, mgmt, len, 1, ok); in ieee802_11_mgmt_cb()
4197 handle_deauth_cb(hapd, mgmt, len, ok); in ieee802_11_mgmt_cb()
4201 handle_disassoc_cb(hapd, mgmt, len, ok); in ieee802_11_mgmt_cb()
4205 handle_action_cb(hapd, mgmt, len, ok); in ieee802_11_mgmt_cb()
4214 int ieee802_11_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) in ieee802_11_get_mib() argument
4221 int ieee802_11_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta, in ieee802_11_get_mib_sta() argument
4229 void hostapd_tx_status(struct hostapd_data *hapd, const u8 *addr, in hostapd_tx_status() argument
4233 struct hostapd_iface *iface = hapd->iface; in hostapd_tx_status()
4235 sta = ap_get_sta(hapd, addr); in hostapd_tx_status()
4239 hapd = iface->bss[j]; in hostapd_tx_status()
4240 sta = ap_get_sta(hapd, addr); in hostapd_tx_status()
4255 ieee802_1x_tx_status(hapd, sta, buf, len, ack); in hostapd_tx_status()
4259 void hostapd_eapol_tx_status(struct hostapd_data *hapd, const u8 *dst, in hostapd_eapol_tx_status() argument
4263 struct hostapd_iface *iface = hapd->iface; in hostapd_eapol_tx_status()
4265 sta = ap_get_sta(hapd, dst); in hostapd_eapol_tx_status()
4269 hapd = iface->bss[j]; in hostapd_eapol_tx_status()
4270 sta = ap_get_sta(hapd, dst); in hostapd_eapol_tx_status()
4282 ieee802_1x_eapol_tx_status(hapd, sta, data, len, ack); in hostapd_eapol_tx_status()
4286 void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr) in hostapd_client_poll_ok() argument
4289 struct hostapd_iface *iface = hapd->iface; in hostapd_client_poll_ok()
4291 sta = ap_get_sta(hapd, addr); in hostapd_client_poll_ok()
4295 hapd = iface->bss[j]; in hostapd_client_poll_ok()
4296 sta = ap_get_sta(hapd, addr); in hostapd_client_poll_ok()
4303 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POLL_OK MACSTR, in hostapd_client_poll_ok()
4314 void ieee802_11_rx_from_unknown(struct hostapd_data *hapd, const u8 *src, in ieee802_11_rx_from_unknown() argument
4319 sta = ap_get_sta(hapd, src); in ieee802_11_rx_from_unknown()
4323 if (!hapd->conf->wds_sta) in ieee802_11_rx_from_unknown()
4344 ret = hostapd_set_wds_sta(hapd, ifname_wds, in ieee802_11_rx_from_unknown()
4347 hostapd_set_wds_encryption(hapd, sta, in ieee802_11_rx_from_unknown()
4370 hapd, src, in ieee802_11_rx_from_unknown()
4374 hapd, src, in ieee802_11_rx_from_unknown()