Lines Matching refs:hapd
47 static void ap_sta_remove_in_other_bss(struct hostapd_data *hapd,
54 static int ap_sta_remove(struct hostapd_data *hapd, struct sta_info *sta);
57 int ap_for_each_sta(struct hostapd_data *hapd, in ap_for_each_sta() argument
58 int (*cb)(struct hostapd_data *hapd, struct sta_info *sta, in ap_for_each_sta() argument
64 for (sta = hapd->sta_list; sta; sta = sta->next) { in ap_for_each_sta()
65 if (cb(hapd, sta, ctx)) in ap_for_each_sta()
73 struct sta_info * ap_get_sta(struct hostapd_data *hapd, const u8 *sta) in ap_get_sta() argument
77 s = hapd->sta_hash[STA_HASH(sta)]; in ap_get_sta()
85 struct sta_info * ap_get_sta_p2p(struct hostapd_data *hapd, const u8 *addr) in ap_get_sta_p2p() argument
89 for (sta = hapd->sta_list; sta; sta = sta->next) { in ap_get_sta_p2p()
108 static void ap_sta_list_del(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_list_del() argument
112 if (hapd->sta_list == sta) { in ap_sta_list_del()
113 hapd->sta_list = sta->next; in ap_sta_list_del()
117 tmp = hapd->sta_list; in ap_sta_list_del()
128 void ap_sta_hash_add(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_hash_add() argument
130 sta->hnext = hapd->sta_hash[STA_HASH(sta->addr)]; in ap_sta_hash_add()
131 hapd->sta_hash[STA_HASH(sta->addr)] = sta; in ap_sta_hash_add()
135 static void ap_sta_hash_del(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_hash_del() argument
139 s = hapd->sta_hash[STA_HASH(sta->addr)]; in ap_sta_hash_del()
142 hapd->sta_hash[STA_HASH(sta->addr)] = s->hnext; in ap_sta_hash_del()
157 void ap_sta_ip6addr_del(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_ip6addr_del() argument
159 sta_ip6addr_del(hapd, sta); in ap_sta_ip6addr_del()
165 void ap_free_sta_pasn(struct hostapd_data *hapd, struct sta_info *sta) in ap_free_sta_pasn() argument
195 static void __ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta) in __ap_free_sta() argument
198 if (hostapd_sta_is_link_sta(hapd, sta) && in __ap_free_sta()
199 !hostapd_drv_link_sta_remove(hapd, sta->addr)) in __ap_free_sta()
203 hostapd_drv_sta_remove(hapd, sta->addr); in __ap_free_sta()
208 static void clear_wpa_sm_for_each_partner_link(struct hostapd_data *hapd, in clear_wpa_sm_for_each_partner_link() argument
214 if (!ap_sta_is_mld(hapd, psta)) in clear_wpa_sm_for_each_partner_link()
217 for_each_mld_link(lhapd, hapd) { in clear_wpa_sm_for_each_partner_link()
218 if (lhapd == hapd) in clear_wpa_sm_for_each_partner_link()
229 void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta) in ap_free_sta() argument
233 accounting_sta_stop(hapd, sta); in ap_free_sta()
236 ap_sta_set_authorized(hapd, sta, 0); in ap_free_sta()
237 hostapd_set_sta_flags(hapd, sta); in ap_free_sta()
241 (hapd->conf->multi_ap & BACKHAUL_BSS) && in ap_free_sta()
242 hapd->conf->wds_sta && in ap_free_sta()
244 hostapd_set_wds_sta(hapd, NULL, sta->addr, sta->aid, 0); in ap_free_sta()
247 hostapd_drv_br_delete_ip_neigh(hapd, 4, (u8 *) &sta->ipaddr); in ap_free_sta()
248 ap_sta_ip6addr_del(hapd, sta); in ap_free_sta()
250 if (!hapd->iface->driver_ap_teardown && in ap_free_sta()
252 __ap_free_sta(hapd, sta); in ap_free_sta()
256 ap_sta_hash_del(hapd, sta); in ap_free_sta()
257 ap_sta_list_del(hapd, sta); in ap_free_sta()
260 hapd->sta_aid[(sta->aid - 1) / 32] &= in ap_free_sta()
263 hapd->num_sta--; in ap_free_sta()
266 hapd->iface->num_sta_non_erp--; in ap_free_sta()
267 if (hapd->iface->num_sta_non_erp == 0) in ap_free_sta()
273 hapd->iface->num_sta_no_short_slot_time--; in ap_free_sta()
274 if (hapd->iface->current_mode && in ap_free_sta()
275 hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G in ap_free_sta()
276 && hapd->iface->num_sta_no_short_slot_time == 0) in ap_free_sta()
282 hapd->iface->num_sta_no_short_preamble--; in ap_free_sta()
283 if (hapd->iface->current_mode && in ap_free_sta()
284 hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G in ap_free_sta()
285 && hapd->iface->num_sta_no_short_preamble == 0) in ap_free_sta()
291 hapd->iface->num_sta_ht_no_gf--; in ap_free_sta()
296 hapd->iface->num_sta_no_ht--; in ap_free_sta()
301 hapd->iface->num_sta_ht_20mhz--; in ap_free_sta()
311 ht40_intolerant_remove(hapd->iface, sta); in ap_free_sta()
316 hapd->num_sta_no_p2p--; in ap_free_sta()
317 if (hapd->num_sta_no_p2p == 0) in ap_free_sta()
318 hostapd_p2p_non_p2p_sta_disconnected(hapd); in ap_free_sta()
323 if (hostapd_ht_operation_update(hapd->iface) > 0) in ap_free_sta()
328 if (hapd->mesh_sta_free_cb) in ap_free_sta()
329 hapd->mesh_sta_free_cb(hapd, sta); in ap_free_sta()
333 ieee802_11_update_beacons(hapd->iface); in ap_free_sta()
337 eloop_cancel_timeout(ap_handle_timer, hapd, sta); in ap_free_sta()
338 eloop_cancel_timeout(ap_handle_session_timer, hapd, sta); in ap_free_sta()
339 eloop_cancel_timeout(ap_handle_session_warning_timer, hapd, sta); in ap_free_sta()
340 ap_sta_clear_disconnect_timeouts(hapd, sta); in ap_free_sta()
341 sae_clear_retransmit_timer(hapd, sta); in ap_free_sta()
343 ieee802_1x_free_station(hapd, sta); in ap_free_sta()
346 if (!ap_sta_is_mld(hapd, sta) || in ap_free_sta()
347 hapd->mld_link_id == sta->mld_assoc_link_id) { in ap_free_sta()
350 clear_wpa_sm_for_each_partner_link(hapd, sta); in ap_free_sta()
355 if (hostapd_sta_is_link_sta(hapd, sta)) in ap_free_sta()
356 wpa_release_link_auth_ref(sta->wpa_sm, hapd->mld_link_id); in ap_free_sta()
361 rsn_preauth_free_station(hapd, sta); in ap_free_sta()
363 if (hapd->radius) in ap_free_sta()
364 radius_client_flush_auth(hapd->radius, sta->addr); in ap_free_sta()
374 vlan_remove_dynamic(hapd, sta->vlan_id); in ap_free_sta()
380 if (hapd->iface->driver_ap_teardown && in ap_free_sta()
382 hostapd_drv_sta_remove(hapd, sta->addr); in ap_free_sta()
385 vlan_remove_dynamic(hapd, sta->vlan_id_bound); in ap_free_sta()
392 eloop_cancel_timeout(ap_sa_query_timer, hapd, sta); in ap_free_sta()
395 p2p_group_notif_disassoc(hapd->p2p_group, sta->addr); in ap_free_sta()
442 eloop_cancel_timeout(fils_hlp_timeout, hapd, sta); in ap_free_sta()
463 eloop_cancel_timeout(ap_sta_reset_steer_flag_timer, hapd, sta); in ap_free_sta()
467 ap_free_sta_pasn(hapd, sta); in ap_free_sta()
485 void hostapd_free_stas(struct hostapd_data *hapd) in hostapd_free_stas() argument
489 sta = hapd->sta_list; in hostapd_free_stas()
495 hapd, sta, WLAN_REASON_UNSPECIFIED); in hostapd_free_stas()
500 ap_free_sta(hapd, prev); in hostapd_free_stas()
506 void hostapd_free_link_stas(struct hostapd_data *hapd) in hostapd_free_link_stas() argument
510 sta = hapd->sta_list; in hostapd_free_link_stas()
515 if (!hostapd_sta_is_link_sta(hapd, prev)) in hostapd_free_link_stas()
520 ap_free_sta(hapd, prev); in hostapd_free_link_stas()
536 struct hostapd_data *hapd = eloop_ctx; in ap_handle_timer() local
540 int max_inactivity = hapd->conf->ap_max_inactivity; in ap_handle_timer()
543 hapd->conf->iface, __func__, MAC2STR(sta->addr), sta->flags, in ap_handle_timer()
546 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_handle_timer()
549 ap_free_sta(hapd, sta); in ap_handle_timer()
566 inactive_sec = hostapd_drv_get_inact_sec(hapd, sta->addr); in ap_handle_timer()
568 wpa_msg(hapd->msg_ctx, MSG_DEBUG, in ap_handle_timer()
579 wpa_msg(hapd->msg_ctx, MSG_DEBUG, in ap_handle_timer()
588 wpa_msg(hapd->msg_ctx, MSG_DEBUG, in ap_handle_timer()
594 wpa_msg(hapd->msg_ctx, MSG_DEBUG, in ap_handle_timer()
600 if (hapd->conf->skip_inactivity_poll) in ap_handle_timer()
608 !hapd->conf->skip_inactivity_poll) { in ap_handle_timer()
609 wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR in ap_handle_timer()
622 eloop_register_timeout(next_time, 0, ap_handle_timer, hapd, in ap_handle_timer()
631 hostapd_drv_poll_client(hapd, hapd->own_addr, sta->addr, in ap_handle_timer()
643 wpa_dbg(hapd->msg_ctx, MSG_DEBUG, in ap_handle_timer()
650 hapd, sta->addr, in ap_handle_timer()
657 hostapd_drv_sta_disassoc(hapd, sta->addr, reason); in ap_handle_timer()
668 hapd, sta); in ap_handle_timer()
672 ap_sta_set_authorized(hapd, sta, 0); in ap_handle_timer()
674 hostapd_set_sta_flags(hapd, sta); in ap_handle_timer()
679 accounting_sta_stop(hapd, sta); in ap_handle_timer()
680 ieee802_1x_free_station(hapd, sta); in ap_handle_timer()
681 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_handle_timer()
692 hapd, sta); in ap_handle_timer()
693 mlme_disassociate_indication(hapd, sta, reason); in ap_handle_timer()
697 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_handle_timer()
704 hapd, sta, in ap_handle_timer()
706 ap_free_sta(hapd, sta); in ap_handle_timer()
714 struct hostapd_data *hapd = eloop_ctx; in ap_handle_session_timer() local
718 hapd->conf->iface, MAC2STR(sta->addr)); in ap_handle_session_timer()
724 ap_free_sta(hapd, sta); in ap_handle_session_timer()
729 hostapd_drv_sta_deauth(hapd, sta->addr, in ap_handle_session_timer()
731 mlme_deauthenticate_indication(hapd, sta, in ap_handle_session_timer()
733 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_handle_session_timer()
738 ap_free_sta(hapd, sta); in ap_handle_session_timer()
742 void ap_sta_replenish_timeout(struct hostapd_data *hapd, struct sta_info *sta, in ap_sta_replenish_timeout() argument
746 ap_handle_session_timer, hapd, sta) == 1) { in ap_sta_replenish_timeout()
747 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_sta_replenish_timeout()
754 void ap_sta_session_timeout(struct hostapd_data *hapd, struct sta_info *sta, in ap_sta_session_timeout() argument
757 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_sta_session_timeout()
760 eloop_cancel_timeout(ap_handle_session_timer, hapd, sta); in ap_sta_session_timeout()
762 hapd, sta); in ap_sta_session_timeout()
766 void ap_sta_no_session_timeout(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_no_session_timeout() argument
768 eloop_cancel_timeout(ap_handle_session_timer, hapd, sta); in ap_sta_no_session_timeout()
775 struct hostapd_data *hapd = eloop_ctx; in ap_handle_session_warning_timer() local
779 MACSTR, hapd->conf->iface, MAC2STR(sta->addr)); in ap_handle_session_warning_timer()
783 wnm_send_ess_disassoc_imminent(hapd, sta, sta->hs20_session_info_url, in ap_handle_session_warning_timer()
789 void ap_sta_session_warning_timeout(struct hostapd_data *hapd, in ap_sta_session_warning_timeout() argument
792 eloop_cancel_timeout(ap_handle_session_warning_timer, hapd, sta); in ap_sta_session_warning_timeout()
794 hapd, sta); in ap_sta_session_warning_timeout()
798 struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr) in ap_sta_add() argument
802 int max_inactivity = hapd->conf->ap_max_inactivity; in ap_sta_add()
804 sta = ap_get_sta(hapd, addr); in ap_sta_add()
809 if (hapd->num_sta >= hapd->conf->max_num_sta) { in ap_sta_add()
812 hapd->num_sta, hapd->conf->max_num_sta); in ap_sta_add()
821 sta->acct_interim_interval = hapd->conf->acct_interim_interval; in ap_sta_add()
822 if (accounting_sta_get_id(hapd, sta) < 0) { in ap_sta_add()
828 if (!hapd->iface->basic_rates) in ap_sta_add()
830 if (hapd->iface->basic_rates[i] < 0) in ap_sta_add()
832 sta->supported_rates[i] = hapd->iface->basic_rates[i] / 5; in ap_sta_add()
839 if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_INACTIVITY_TIMER)) { in ap_sta_add()
845 ap_handle_timer, hapd, sta); in ap_sta_add()
850 sta->next = hapd->sta_list; in ap_sta_add()
851 hapd->sta_list = sta; in ap_sta_add()
852 hapd->num_sta++; in ap_sta_add()
853 ap_sta_hash_add(hapd, sta); in ap_sta_add()
854 ap_sta_remove_in_other_bss(hapd, sta); in ap_sta_add()
859 sta_track_claim_taxonomy_info(hapd->iface, addr, in ap_sta_add()
867 static int ap_sta_remove(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_remove() argument
872 hostapd_drv_br_delete_ip_neigh(hapd, 4, (u8 *) &sta->ipaddr); in ap_sta_remove()
873 ap_sta_ip6addr_del(hapd, sta); in ap_sta_remove()
876 hapd->conf->iface, MAC2STR(sta->addr)); in ap_sta_remove()
877 if (hostapd_drv_sta_remove(hapd, sta->addr) && in ap_sta_remove()
881 hapd->conf->iface, MAC2STR(sta->addr)); in ap_sta_remove()
889 static void ap_sta_remove_in_other_bss(struct hostapd_data *hapd, in ap_sta_remove_in_other_bss() argument
892 struct hostapd_iface *iface = hapd->iface; in ap_sta_remove_in_other_bss()
902 if (bss == hapd || bss == NULL) in ap_sta_remove_in_other_bss()
910 hapd->conf->iface, MAC2STR(sta2->addr), in ap_sta_remove_in_other_bss()
920 struct hostapd_data *hapd = eloop_ctx; in ap_sta_disassoc_cb_timeout() local
924 hapd->conf->iface, MAC2STR(sta->addr)); in ap_sta_disassoc_cb_timeout()
925 ap_sta_remove(hapd, sta); in ap_sta_disassoc_cb_timeout()
926 mlme_disassociate_indication(hapd, sta, sta->disassoc_reason); in ap_sta_disassoc_cb_timeout()
930 static void ap_sta_disconnect_common(struct hostapd_data *hapd, in ap_sta_disconnect_common() argument
935 ap_sta_set_authorized(hapd, sta, 0); in ap_sta_disconnect_common()
936 hostapd_set_sta_flags(hapd, sta); in ap_sta_disconnect_common()
942 eloop_cancel_timeout(ap_handle_timer, hapd, sta); in ap_sta_disconnect_common()
943 eloop_register_timeout(timeout, 0, ap_handle_timer, hapd, sta); in ap_sta_disconnect_common()
944 accounting_sta_stop(hapd, sta); in ap_sta_disconnect_common()
945 ieee802_1x_free_station(hapd, sta); in ap_sta_disconnect_common()
947 if (!hapd->conf->mld_ap || in ap_sta_disconnect_common()
948 hapd->mld_link_id == sta->mld_assoc_link_id) { in ap_sta_disconnect_common()
950 clear_wpa_sm_for_each_partner_link(hapd, sta); in ap_sta_disconnect_common()
960 static void ap_sta_handle_disassociate(struct hostapd_data *hapd, in ap_sta_handle_disassociate() argument
964 hapd->conf->iface, MAC2STR(sta->addr)); in ap_sta_handle_disassociate()
966 if (hapd->iface->current_mode && in ap_sta_handle_disassociate()
967 hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211AD) { in ap_sta_handle_disassociate()
977 ap_sta_disconnect_common(hapd, sta, AP_MAX_INACTIVITY_AFTER_DISASSOC); in ap_sta_handle_disassociate()
981 eloop_cancel_timeout(ap_sta_disassoc_cb_timeout, hapd, sta); in ap_sta_handle_disassociate()
982 eloop_register_timeout(hapd->iface->drv_flags & in ap_sta_handle_disassociate()
984 ap_sta_disassoc_cb_timeout, hapd, sta); in ap_sta_handle_disassociate()
990 struct hostapd_data *hapd = eloop_ctx; in ap_sta_deauth_cb_timeout() local
994 hapd->conf->iface, MAC2STR(sta->addr)); in ap_sta_deauth_cb_timeout()
995 ap_sta_remove(hapd, sta); in ap_sta_deauth_cb_timeout()
996 mlme_deauthenticate_indication(hapd, sta, sta->deauth_reason); in ap_sta_deauth_cb_timeout()
1000 static void ap_sta_handle_deauthenticate(struct hostapd_data *hapd, in ap_sta_handle_deauthenticate() argument
1003 if (hapd->iface->current_mode && in ap_sta_handle_deauthenticate()
1004 hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211AD) { in ap_sta_handle_deauthenticate()
1007 ap_sta_disassociate(hapd, sta, reason); in ap_sta_handle_deauthenticate()
1012 hapd->conf->iface, MAC2STR(sta->addr)); in ap_sta_handle_deauthenticate()
1017 ap_sta_disconnect_common(hapd, sta, AP_MAX_INACTIVITY_AFTER_DEAUTH); in ap_sta_handle_deauthenticate()
1021 eloop_cancel_timeout(ap_sta_deauth_cb_timeout, hapd, sta); in ap_sta_handle_deauthenticate()
1022 eloop_register_timeout(hapd->iface->drv_flags & in ap_sta_handle_deauthenticate()
1024 ap_sta_deauth_cb_timeout, hapd, sta); in ap_sta_handle_deauthenticate()
1028 static bool ap_sta_ml_disconnect(struct hostapd_data *hapd, in ap_sta_ml_disconnect() argument
1038 if (!hostapd_is_mld_ap(hapd)) in ap_sta_ml_disconnect()
1045 assoc_sta = hostapd_ml_get_assoc_sta(hapd, sta, &assoc_hapd); in ap_sta_ml_disconnect()
1106 void ap_sta_disassociate(struct hostapd_data *hapd, struct sta_info *sta, in ap_sta_disassociate() argument
1109 if (ap_sta_ml_disconnect(hapd, sta, reason, true)) in ap_sta_disassociate()
1112 ap_sta_handle_disassociate(hapd, sta, reason); in ap_sta_disassociate()
1116 void ap_sta_deauthenticate(struct hostapd_data *hapd, struct sta_info *sta, in ap_sta_deauthenticate() argument
1119 if (ap_sta_ml_disconnect(hapd, sta, reason, false)) in ap_sta_deauthenticate()
1122 ap_sta_handle_deauthenticate(hapd, sta, reason); in ap_sta_deauthenticate()
1127 int ap_sta_wps_cancel(struct hostapd_data *hapd, in ap_sta_wps_cancel() argument
1131 ap_sta_deauthenticate(hapd, sta, in ap_sta_wps_cancel()
1143 static int ap_sta_get_free_vlan_id(struct hostapd_data *hapd) in ap_sta_get_free_vlan_id() argument
1149 for (vlan = hapd->conf->vlan; vlan; vlan = vlan->next) { in ap_sta_get_free_vlan_id()
1159 int ap_sta_set_vlan(struct hostapd_data *hapd, struct sta_info *sta, in ap_sta_set_vlan() argument
1166 if (hapd->conf->ssid.per_sta_vif && !sta->vlan_id) { in ap_sta_set_vlan()
1168 } else if (hapd->conf->ssid.dynamic_vlan == DYNAMIC_VLAN_DISABLED && in ap_sta_set_vlan()
1169 !hapd->conf->ssid.per_sta_vif && sta->vlan_id) { in ap_sta_set_vlan()
1176 if (hapd->conf->ssid.per_sta_vif) { in ap_sta_set_vlan()
1179 vlan_id = ap_sta_get_free_vlan_id(hapd); in ap_sta_set_vlan()
1181 for (vlan = hapd->conf->vlan; vlan; vlan = vlan->next) { in ap_sta_set_vlan()
1186 hostapd_logger(hapd, sta->addr, in ap_sta_set_vlan()
1195 for (vlan = hapd->conf->vlan; vlan; vlan = vlan->next) { in ap_sta_set_vlan()
1208 vlan_id = ap_sta_get_free_vlan_id(hapd); in ap_sta_set_vlan()
1211 hostapd_logger(hapd, sta->addr, in ap_sta_set_vlan()
1224 vlan = vlan_add_dynamic(hapd, vlan, vlan_id, vlan_desc); in ap_sta_set_vlan()
1226 hostapd_logger(hapd, sta->addr, in ap_sta_set_vlan()
1238 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_sta_set_vlan()
1244 hostapd_logger(hapd, sta->addr, in ap_sta_set_vlan()
1256 vlan_remove_dynamic(hapd, old_vlan_id); in ap_sta_set_vlan()
1262 int ap_sta_bind_vlan(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_bind_vlan() argument
1272 if (hapd->conf->mld_ap) in ap_sta_bind_vlan()
1273 mld_link_id = hapd->mld_link_id; in ap_sta_bind_vlan()
1283 iface = hapd->conf->iface; in ap_sta_bind_vlan()
1284 if (hapd->conf->ssid.vlan[0]) in ap_sta_bind_vlan()
1285 iface = hapd->conf->ssid.vlan; in ap_sta_bind_vlan()
1288 for (vlan = hapd->conf->vlan; vlan; vlan = vlan->next) { in ap_sta_bind_vlan()
1305 !(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_VLAN_OFFLOAD)) { in ap_sta_bind_vlan()
1306 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_sta_bind_vlan()
1314 hostapd_logger(hapd, sta->addr, in ap_sta_bind_vlan()
1325 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_sta_bind_vlan()
1332 ret = hostapd_drv_set_sta_vlan(iface, hapd, sta->addr, sta->vlan_id, in ap_sta_bind_vlan()
1335 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_sta_bind_vlan()
1342 vlan_remove_dynamic(hapd, old_vlanid); in ap_sta_bind_vlan()
1352 int ap_check_sa_query_timeout(struct hostapd_data *hapd, struct sta_info *sta) in ap_check_sa_query_timeout() argument
1359 if (hapd->conf->assoc_sa_query_max_timeout < tu) { in ap_check_sa_query_timeout()
1360 hostapd_logger(hapd, sta->addr, in ap_check_sa_query_timeout()
1368 eloop_cancel_timeout(ap_sa_query_timer, hapd, sta); in ap_check_sa_query_timeout()
1378 struct hostapd_data *hapd = eloop_ctx; in ap_sa_query_timer() local
1385 hapd->conf->iface, MAC2STR(sta->addr), sta->sa_query_count); in ap_sa_query_timer()
1388 ap_check_sa_query_timeout(hapd, sta)) in ap_sa_query_timer()
1416 timeout = hapd->conf->assoc_sa_query_retry_timeout; in ap_sa_query_timer()
1419 eloop_register_timeout(sec, usec, ap_sa_query_timer, hapd, sta); in ap_sa_query_timer()
1421 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_sa_query_timer()
1425 ieee802_11_send_sa_query_req(hapd, sta->addr, trans_id); in ap_sa_query_timer()
1429 void ap_sta_start_sa_query(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_start_sa_query() argument
1431 ap_sa_query_timer(hapd, sta); in ap_sta_start_sa_query()
1435 void ap_sta_stop_sa_query(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_stop_sa_query() argument
1437 eloop_cancel_timeout(ap_sa_query_timer, hapd, sta); in ap_sta_stop_sa_query()
1444 const char * ap_sta_wpa_get_keyid(struct hostapd_data *hapd, in ap_sta_wpa_get_keyid() argument
1452 ssid = &hapd->conf->ssid; in ap_sta_wpa_get_keyid()
1468 const u8 * ap_sta_wpa_get_dpp_pkhash(struct hostapd_data *hapd, in ap_sta_wpa_get_dpp_pkhash() argument
1475 bool ap_sta_set_authorized_flag(struct hostapd_data *hapd, struct sta_info *sta, in ap_sta_set_authorized_flag() argument
1485 if (ap_sta_is_mld(hapd, sta)) { in ap_sta_set_authorized_flag()
1486 if (sta->mld_assoc_link_id == hapd->mld_link_id) in ap_sta_set_authorized_flag()
1493 hostapd_prune_associations(hapd, sta->addr, in ap_sta_set_authorized_flag()
1504 void ap_sta_set_authorized_event(struct hostapd_data *hapd, in ap_sta_set_authorized_event() argument
1521 if (hapd->p2p_group == NULL) { in ap_sta_set_authorized_event()
1526 dev_addr = p2p_group_get_dev_addr(hapd->p2p_group, sta->addr); in ap_sta_set_authorized_event()
1555 keyid = ap_sta_wpa_get_keyid(hapd, sta); in ap_sta_set_authorized_event()
1561 dpp_pkhash = ap_sta_wpa_get_dpp_pkhash(hapd, sta); in ap_sta_set_authorized_event()
1573 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s%s", in ap_sta_set_authorized_event()
1576 if (hapd->msg_ctx_parent && in ap_sta_set_authorized_event()
1577 hapd->msg_ctx_parent != hapd->msg_ctx) in ap_sta_set_authorized_event()
1578 wpa_msg_no_global(hapd->msg_ctx_parent, MSG_INFO, in ap_sta_set_authorized_event()
1583 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf); in ap_sta_set_authorized_event()
1585 if (hapd->msg_ctx_parent && in ap_sta_set_authorized_event()
1586 hapd->msg_ctx_parent != hapd->msg_ctx) in ap_sta_set_authorized_event()
1587 wpa_msg_no_global(hapd->msg_ctx_parent, MSG_INFO, in ap_sta_set_authorized_event()
1593 supplicant_send_wifi_mgmt_ap_sta_event(hapd->iface, in ap_sta_set_authorized_event()
1597 supplicant_send_wifi_mgmt_ap_sta_event(hapd->iface->owner, in ap_sta_set_authorized_event()
1602 if (hapd->sta_authorized_cb) in ap_sta_set_authorized_event()
1603 hapd->sta_authorized_cb(hapd->sta_authorized_cb_ctx, in ap_sta_set_authorized_event()
1608 if (hapd->iface->fst) { in ap_sta_set_authorized_event()
1610 fst_notify_peer_connected(hapd->iface->fst, sta->addr); in ap_sta_set_authorized_event()
1612 fst_notify_peer_disconnected(hapd->iface->fst, in ap_sta_set_authorized_event()
1619 void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta, in ap_sta_set_authorized() argument
1622 if (!ap_sta_set_authorized_flag(hapd, sta, authorized)) in ap_sta_set_authorized()
1624 ap_sta_set_authorized_event(hapd, sta, authorized); in ap_sta_set_authorized()
1628 void ap_sta_disconnect(struct hostapd_data *hapd, struct sta_info *sta, in ap_sta_disconnect() argument
1633 hapd->conf->iface, __func__, MAC2STR(sta->addr), in ap_sta_disconnect()
1637 hapd->conf->iface, __func__, MAC2STR(addr), in ap_sta_disconnect()
1641 sta = ap_get_sta(hapd, addr); in ap_sta_disconnect()
1644 hostapd_drv_sta_deauth(hapd, addr, reason); in ap_sta_disconnect()
1648 ap_sta_set_authorized(hapd, sta, 0); in ap_sta_disconnect()
1650 hostapd_set_sta_flags(hapd, sta); in ap_sta_disconnect()
1656 hapd->conf->iface, __func__, MAC2STR(sta->addr), in ap_sta_disconnect()
1658 eloop_cancel_timeout(ap_handle_timer, hapd, sta); in ap_sta_disconnect()
1660 ap_handle_timer, hapd, sta); in ap_sta_disconnect()
1663 if (hapd->iface->current_mode && in ap_sta_disconnect()
1664 hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211AD) { in ap_sta_disconnect()
1669 eloop_cancel_timeout(ap_sta_disassoc_cb_timeout, hapd, sta); in ap_sta_disconnect()
1670 eloop_register_timeout(hapd->iface->drv_flags & in ap_sta_disconnect()
1673 hapd, sta); in ap_sta_disconnect()
1679 eloop_cancel_timeout(ap_sta_deauth_cb_timeout, hapd, sta); in ap_sta_disconnect()
1680 eloop_register_timeout(hapd->iface->drv_flags & in ap_sta_disconnect()
1682 ap_sta_deauth_cb_timeout, hapd, sta); in ap_sta_disconnect()
1686 void ap_sta_deauth_cb(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_deauth_cb() argument
1693 eloop_cancel_timeout(ap_sta_deauth_cb_timeout, hapd, sta); in ap_sta_deauth_cb()
1694 ap_sta_deauth_cb_timeout(hapd, sta); in ap_sta_deauth_cb()
1698 void ap_sta_disassoc_cb(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_disassoc_cb() argument
1705 eloop_cancel_timeout(ap_sta_disassoc_cb_timeout, hapd, sta); in ap_sta_disassoc_cb()
1706 ap_sta_disassoc_cb_timeout(hapd, sta); in ap_sta_disassoc_cb()
1710 void ap_sta_clear_disconnect_timeouts(struct hostapd_data *hapd, in ap_sta_clear_disconnect_timeouts() argument
1713 if (eloop_cancel_timeout(ap_sta_deauth_cb_timeout, hapd, sta) > 0) in ap_sta_clear_disconnect_timeouts()
1717 hapd->conf->iface, MAC2STR(sta->addr)); in ap_sta_clear_disconnect_timeouts()
1718 if (eloop_cancel_timeout(ap_sta_disassoc_cb_timeout, hapd, sta) > 0) in ap_sta_clear_disconnect_timeouts()
1722 hapd->conf->iface, MAC2STR(sta->addr)); in ap_sta_clear_disconnect_timeouts()
1723 if (eloop_cancel_timeout(ap_sta_delayed_1x_auth_fail_cb, hapd, sta) > 0) in ap_sta_clear_disconnect_timeouts()
1728 hapd->conf->iface, MAC2STR(sta->addr)); in ap_sta_clear_disconnect_timeouts()
1730 hostapd_wps_eap_completed(hapd); in ap_sta_clear_disconnect_timeouts()
1775 struct hostapd_data *hapd = eloop_ctx; in ap_sta_delayed_1x_auth_fail_cb() local
1779 wpa_dbg(hapd->msg_ctx, MSG_DEBUG, in ap_sta_delayed_1x_auth_fail_cb()
1786 ap_sta_disconnect(hapd, sta, sta->addr, reason); in ap_sta_delayed_1x_auth_fail_cb()
1788 hostapd_wps_eap_completed(hapd); in ap_sta_delayed_1x_auth_fail_cb()
1792 void ap_sta_delayed_1x_auth_fail_disconnect(struct hostapd_data *hapd, in ap_sta_delayed_1x_auth_fail_disconnect() argument
1796 wpa_dbg(hapd->msg_ctx, MSG_DEBUG, in ap_sta_delayed_1x_auth_fail_disconnect()
1805 eloop_cancel_timeout(ap_sta_delayed_1x_auth_fail_cb, hapd, sta); in ap_sta_delayed_1x_auth_fail_disconnect()
1807 ap_sta_delayed_1x_auth_fail_cb, hapd, sta); in ap_sta_delayed_1x_auth_fail_disconnect()
1811 int ap_sta_pending_delayed_1x_auth_fail_disconnect(struct hostapd_data *hapd, in ap_sta_pending_delayed_1x_auth_fail_disconnect() argument
1815 hapd, sta); in ap_sta_pending_delayed_1x_auth_fail_disconnect()
1820 static void ap_sta_remove_link_sta(struct hostapd_data *hapd, in ap_sta_remove_link_sta() argument
1825 for_each_mld_link(tmp_hapd, hapd) { in ap_sta_remove_link_sta()
1828 if (hapd == tmp_hapd) in ap_sta_remove_link_sta()
1845 int ap_sta_re_add(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_re_add() argument
1859 if (ap_sta_is_mld(hapd, sta)) { in ap_sta_re_add()
1860 u8 mld_link_id = hapd->mld_link_id; in ap_sta_re_add()
1869 ap_sta_remove_link_sta(hapd, sta); in ap_sta_re_add()
1873 ap_sta_set_authorized(hapd, sta, 0); in ap_sta_re_add()
1874 hostapd_drv_sta_remove(hapd, sta->addr); in ap_sta_re_add()
1877 if (hostapd_sta_add(hapd, sta->addr, 0, 0, in ap_sta_re_add()
1883 hostapd_logger(hapd, sta->addr, in ap_sta_re_add()