• Home
  • Raw
  • Download

Lines Matching refs:sta

37 				       struct sta_info *sta);
45 static int ap_sta_remove(struct hostapd_data *hapd, struct sta_info *sta);
48 int (*cb)(struct hostapd_data *hapd, struct sta_info *sta, in ap_for_each_sta() argument
52 struct sta_info *sta; in ap_for_each_sta() local
54 for (sta = hapd->sta_list; sta; sta = sta->next) { in ap_for_each_sta()
55 if (cb(hapd, sta, ctx)) in ap_for_each_sta()
63 struct sta_info * ap_get_sta(struct hostapd_data *hapd, const u8 *sta) in ap_get_sta() argument
67 s = hapd->sta_hash[STA_HASH(sta)]; in ap_get_sta()
68 while (s != NULL && os_memcmp(s->addr, sta, 6) != 0) in ap_get_sta()
77 struct sta_info *sta; in ap_get_sta_p2p() local
79 for (sta = hapd->sta_list; sta; sta = sta->next) { in ap_get_sta_p2p()
82 if (sta->p2p_ie == NULL) in ap_get_sta_p2p()
85 p2p_dev_addr = p2p_get_go_dev_addr(sta->p2p_ie); in ap_get_sta_p2p()
90 return sta; in ap_get_sta_p2p()
98 static void ap_sta_list_del(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_list_del() argument
102 if (hapd->sta_list == sta) { in ap_sta_list_del()
103 hapd->sta_list = sta->next; in ap_sta_list_del()
108 while (tmp != NULL && tmp->next != sta) in ap_sta_list_del()
112 "list.", MAC2STR(sta->addr)); in ap_sta_list_del()
114 tmp->next = sta->next; in ap_sta_list_del()
118 void ap_sta_hash_add(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_hash_add() argument
120 sta->hnext = hapd->sta_hash[STA_HASH(sta->addr)]; in ap_sta_hash_add()
121 hapd->sta_hash[STA_HASH(sta->addr)] = sta; in ap_sta_hash_add()
125 static void ap_sta_hash_del(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_hash_del() argument
129 s = hapd->sta_hash[STA_HASH(sta->addr)]; in ap_sta_hash_del()
131 if (os_memcmp(s->addr, sta->addr, 6) == 0) { in ap_sta_hash_del()
132 hapd->sta_hash[STA_HASH(sta->addr)] = s->hnext; in ap_sta_hash_del()
137 os_memcmp(s->hnext->addr, sta->addr, ETH_ALEN) != 0) in ap_sta_hash_del()
143 " from hash table", MAC2STR(sta->addr)); in ap_sta_hash_del()
147 void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta) in ap_free_sta() argument
151 accounting_sta_stop(hapd, sta); in ap_free_sta()
154 ap_sta_set_authorized(hapd, sta, 0); in ap_free_sta()
156 if (sta->flags & WLAN_STA_WDS) in ap_free_sta()
157 hostapd_set_wds_sta(hapd, NULL, sta->addr, sta->aid, 0); in ap_free_sta()
160 !(sta->flags & WLAN_STA_PREAUTH)) in ap_free_sta()
161 hostapd_drv_sta_remove(hapd, sta->addr); in ap_free_sta()
163 ap_sta_hash_del(hapd, sta); in ap_free_sta()
164 ap_sta_list_del(hapd, sta); in ap_free_sta()
166 if (sta->aid > 0) in ap_free_sta()
167 hapd->sta_aid[(sta->aid - 1) / 32] &= in ap_free_sta()
168 ~BIT((sta->aid - 1) % 32); in ap_free_sta()
171 if (sta->nonerp_set) { in ap_free_sta()
172 sta->nonerp_set = 0; in ap_free_sta()
178 if (sta->no_short_slot_time_set) { in ap_free_sta()
179 sta->no_short_slot_time_set = 0; in ap_free_sta()
186 if (sta->no_short_preamble_set) { in ap_free_sta()
187 sta->no_short_preamble_set = 0; in ap_free_sta()
194 if (sta->no_ht_gf_set) { in ap_free_sta()
195 sta->no_ht_gf_set = 0; in ap_free_sta()
199 if (sta->no_ht_set) { in ap_free_sta()
200 sta->no_ht_set = 0; in ap_free_sta()
204 if (sta->ht_20mhz_set) { in ap_free_sta()
205 sta->ht_20mhz_set = 0; in ap_free_sta()
210 ht40_intolerant_remove(hapd->iface, sta); in ap_free_sta()
214 if (sta->no_p2p_set) { in ap_free_sta()
215 sta->no_p2p_set = 0; in ap_free_sta()
231 __func__, MAC2STR(sta->addr)); in ap_free_sta()
232 eloop_cancel_timeout(ap_handle_timer, hapd, sta); in ap_free_sta()
233 eloop_cancel_timeout(ap_handle_session_timer, hapd, sta); in ap_free_sta()
234 eloop_cancel_timeout(ap_handle_session_warning_timer, hapd, sta); in ap_free_sta()
235 eloop_cancel_timeout(ap_sta_deauth_cb_timeout, hapd, sta); in ap_free_sta()
236 eloop_cancel_timeout(ap_sta_disassoc_cb_timeout, hapd, sta); in ap_free_sta()
238 ieee802_1x_free_station(sta); in ap_free_sta()
239 wpa_auth_sta_deinit(sta->wpa_sm); in ap_free_sta()
240 rsn_preauth_free_station(hapd, sta); in ap_free_sta()
243 radius_client_flush_auth(hapd->radius, sta->addr); in ap_free_sta()
246 os_free(sta->challenge); in ap_free_sta()
249 os_free(sta->sa_query_trans_id); in ap_free_sta()
250 eloop_cancel_timeout(ap_sa_query_timer, hapd, sta); in ap_free_sta()
254 p2p_group_notif_disassoc(hapd->p2p_group, sta->addr); in ap_free_sta()
258 if (sta->gas_dialog) { in ap_free_sta()
261 gas_serv_dialog_clear(&sta->gas_dialog[i]); in ap_free_sta()
262 os_free(sta->gas_dialog); in ap_free_sta()
266 wpabuf_free(sta->wps_ie); in ap_free_sta()
267 wpabuf_free(sta->p2p_ie); in ap_free_sta()
268 wpabuf_free(sta->hs20_ie); in ap_free_sta()
270 os_free(sta->ht_capabilities); in ap_free_sta()
271 os_free(sta->vht_capabilities); in ap_free_sta()
272 hostapd_free_psk_list(sta->psk); in ap_free_sta()
273 os_free(sta->identity); in ap_free_sta()
274 os_free(sta->radius_cui); in ap_free_sta()
275 os_free(sta->remediation_url); in ap_free_sta()
276 wpabuf_free(sta->hs20_deauth_req); in ap_free_sta()
277 os_free(sta->hs20_session_info_url); in ap_free_sta()
280 sae_clear_data(sta->sae); in ap_free_sta()
281 os_free(sta->sae); in ap_free_sta()
284 os_free(sta); in ap_free_sta()
290 struct sta_info *sta, *prev; in hostapd_free_stas() local
292 sta = hapd->sta_list; in hostapd_free_stas()
294 while (sta) { in hostapd_free_stas()
295 prev = sta; in hostapd_free_stas()
296 if (sta->flags & WLAN_STA_AUTH) { in hostapd_free_stas()
298 hapd, sta, WLAN_REASON_UNSPECIFIED); in hostapd_free_stas()
300 sta = sta->next; in hostapd_free_stas()
319 struct sta_info *sta = timeout_ctx; in ap_handle_timer() local
324 __func__, MAC2STR(sta->addr), sta->flags, in ap_handle_timer()
325 sta->timeout_next); in ap_handle_timer()
326 if (sta->timeout_next == STA_REMOVE) { in ap_handle_timer()
327 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_handle_timer()
330 ap_free_sta(hapd, sta); in ap_handle_timer()
334 if ((sta->flags & WLAN_STA_ASSOC) && in ap_handle_timer()
335 (sta->timeout_next == STA_NULLFUNC || in ap_handle_timer()
336 sta->timeout_next == STA_DISASSOC)) { in ap_handle_timer()
344 inactive_sec = hostapd_drv_get_inact_sec(hapd, sta->addr); in ap_handle_timer()
349 MACSTR, MAC2STR(sta->addr)); in ap_handle_timer()
357 sta->flags & WLAN_STA_ASSOC) { in ap_handle_timer()
361 MAC2STR(sta->addr), inactive_sec); in ap_handle_timer()
362 sta->timeout_next = STA_NULLFUNC; in ap_handle_timer()
369 MAC2STR(sta->addr), inactive_sec, in ap_handle_timer()
373 sta->timeout_next = STA_DISASSOC; in ap_handle_timer()
377 if ((sta->flags & WLAN_STA_ASSOC) && in ap_handle_timer()
378 sta->timeout_next == STA_DISASSOC && in ap_handle_timer()
379 !(sta->flags & WLAN_STA_PENDING_POLL) && in ap_handle_timer()
382 " has ACKed data poll", MAC2STR(sta->addr)); in ap_handle_timer()
385 sta->timeout_next = STA_NULLFUNC; in ap_handle_timer()
392 __func__, MAC2STR(sta->addr), next_time); in ap_handle_timer()
394 sta); in ap_handle_timer()
398 if (sta->timeout_next == STA_NULLFUNC && in ap_handle_timer()
399 (sta->flags & WLAN_STA_ASSOC)) { in ap_handle_timer()
401 sta->flags |= WLAN_STA_PENDING_POLL; in ap_handle_timer()
402 hostapd_drv_poll_client(hapd, hapd->own_addr, sta->addr, in ap_handle_timer()
403 sta->flags & WLAN_STA_WMM); in ap_handle_timer()
404 } else if (sta->timeout_next != STA_REMOVE) { in ap_handle_timer()
405 int deauth = sta->timeout_next == STA_DEAUTH; in ap_handle_timer()
410 MAC2STR(sta->addr)); in ap_handle_timer()
414 hapd, sta->addr, in ap_handle_timer()
417 reason = (sta->timeout_next == STA_DISASSOC) ? in ap_handle_timer()
421 hostapd_drv_sta_disassoc(hapd, sta->addr, reason); in ap_handle_timer()
425 switch (sta->timeout_next) { in ap_handle_timer()
427 sta->timeout_next = STA_DISASSOC; in ap_handle_timer()
430 __func__, MAC2STR(sta->addr), AP_DISASSOC_DELAY); in ap_handle_timer()
432 hapd, sta); in ap_handle_timer()
436 ap_sta_set_authorized(hapd, sta, 0); in ap_handle_timer()
437 sta->flags &= ~WLAN_STA_ASSOC; in ap_handle_timer()
438 ieee802_1x_notify_port_enabled(sta->eapol_sm, 0); in ap_handle_timer()
439 if (!sta->acct_terminate_cause) in ap_handle_timer()
440 sta->acct_terminate_cause = in ap_handle_timer()
442 accounting_sta_stop(hapd, sta); in ap_handle_timer()
443 ieee802_1x_free_station(sta); in ap_handle_timer()
444 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_handle_timer()
447 reason = (sta->timeout_next == STA_DISASSOC) ? in ap_handle_timer()
450 sta->timeout_next = STA_DEAUTH; in ap_handle_timer()
453 __func__, MAC2STR(sta->addr), AP_DEAUTH_DELAY); in ap_handle_timer()
455 hapd, sta); in ap_handle_timer()
456 mlme_disassociate_indication(hapd, sta, reason); in ap_handle_timer()
460 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_handle_timer()
463 if (!sta->acct_terminate_cause) in ap_handle_timer()
464 sta->acct_terminate_cause = in ap_handle_timer()
467 hapd, sta, in ap_handle_timer()
469 ap_free_sta(hapd, sta); in ap_handle_timer()
478 struct sta_info *sta = timeout_ctx; in ap_handle_session_timer() local
480 if (!(sta->flags & WLAN_STA_AUTH)) { in ap_handle_session_timer()
481 if (sta->flags & WLAN_STA_GAS) { in ap_handle_session_timer()
483 "entry " MACSTR, MAC2STR(sta->addr)); in ap_handle_session_timer()
484 ap_free_sta(hapd, sta); in ap_handle_session_timer()
489 hostapd_drv_sta_deauth(hapd, sta->addr, in ap_handle_session_timer()
491 mlme_deauthenticate_indication(hapd, sta, in ap_handle_session_timer()
493 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_handle_session_timer()
496 sta->acct_terminate_cause = in ap_handle_session_timer()
498 ap_free_sta(hapd, sta); in ap_handle_session_timer()
502 void ap_sta_replenish_timeout(struct hostapd_data *hapd, struct sta_info *sta, in ap_sta_replenish_timeout() argument
506 ap_handle_session_timer, hapd, sta) == 1) { in ap_sta_replenish_timeout()
507 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_sta_replenish_timeout()
514 void ap_sta_session_timeout(struct hostapd_data *hapd, struct sta_info *sta, in ap_sta_session_timeout() argument
517 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_sta_session_timeout()
520 eloop_cancel_timeout(ap_handle_session_timer, hapd, sta); in ap_sta_session_timeout()
522 hapd, sta); in ap_sta_session_timeout()
526 void ap_sta_no_session_timeout(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_no_session_timeout() argument
528 eloop_cancel_timeout(ap_handle_session_timer, hapd, sta); in ap_sta_no_session_timeout()
536 struct sta_info *sta = timeout_ctx; in ap_handle_session_warning_timer() local
539 MAC2STR(sta->addr)); in ap_handle_session_warning_timer()
540 if (sta->hs20_session_info_url == NULL) in ap_handle_session_warning_timer()
543 wnm_send_ess_disassoc_imminent(hapd, sta, sta->hs20_session_info_url, in ap_handle_session_warning_timer()
544 sta->hs20_disassoc_timer); in ap_handle_session_warning_timer()
550 struct sta_info *sta, int warning_time) in ap_sta_session_warning_timeout() argument
552 eloop_cancel_timeout(ap_handle_session_warning_timer, hapd, sta); in ap_sta_session_warning_timeout()
554 hapd, sta); in ap_sta_session_warning_timeout()
560 struct sta_info *sta; in ap_sta_add() local
562 sta = ap_get_sta(hapd, addr); in ap_sta_add()
563 if (sta) in ap_sta_add()
564 return sta; in ap_sta_add()
574 sta = os_zalloc(sizeof(struct sta_info)); in ap_sta_add()
575 if (sta == NULL) { in ap_sta_add()
579 sta->acct_interim_interval = hapd->conf->acct_interim_interval; in ap_sta_add()
580 accounting_sta_get_id(hapd, sta); in ap_sta_add()
588 ap_handle_timer, hapd, sta); in ap_sta_add()
592 os_memcpy(sta->addr, addr, ETH_ALEN); in ap_sta_add()
593 sta->next = hapd->sta_list; in ap_sta_add()
594 hapd->sta_list = sta; in ap_sta_add()
596 ap_sta_hash_add(hapd, sta); in ap_sta_add()
597 sta->ssid = &hapd->conf->ssid; in ap_sta_add()
598 ap_sta_remove_in_other_bss(hapd, sta); in ap_sta_add()
600 return sta; in ap_sta_add()
604 static int ap_sta_remove(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_remove() argument
606 ieee802_1x_notify_port_enabled(sta->eapol_sm, 0); in ap_sta_remove()
609 MAC2STR(sta->addr)); in ap_sta_remove()
610 if (hostapd_drv_sta_remove(hapd, sta->addr) && in ap_sta_remove()
611 sta->flags & WLAN_STA_ASSOC) { in ap_sta_remove()
613 " from kernel driver.", MAC2STR(sta->addr)); in ap_sta_remove()
621 struct sta_info *sta) in ap_sta_remove_in_other_bss() argument
635 sta2 = ap_get_sta(bss, sta->addr); in ap_sta_remove_in_other_bss()
648 struct sta_info *sta = timeout_ctx; in ap_sta_disassoc_cb_timeout() local
650 ap_sta_remove(hapd, sta); in ap_sta_disassoc_cb_timeout()
651 mlme_disassociate_indication(hapd, sta, sta->disassoc_reason); in ap_sta_disassoc_cb_timeout()
655 void ap_sta_disassociate(struct hostapd_data *hapd, struct sta_info *sta, in ap_sta_disassociate() argument
659 hapd->conf->iface, MAC2STR(sta->addr)); in ap_sta_disassociate()
660 sta->flags &= ~(WLAN_STA_ASSOC | WLAN_STA_ASSOC_REQ_OK); in ap_sta_disassociate()
661 ap_sta_set_authorized(hapd, sta, 0); in ap_sta_disassociate()
662 sta->timeout_next = STA_DEAUTH; in ap_sta_disassociate()
666 __func__, MAC2STR(sta->addr), in ap_sta_disassociate()
668 eloop_cancel_timeout(ap_handle_timer, hapd, sta); in ap_sta_disassociate()
670 ap_handle_timer, hapd, sta); in ap_sta_disassociate()
671 accounting_sta_stop(hapd, sta); in ap_sta_disassociate()
672 ieee802_1x_free_station(sta); in ap_sta_disassociate()
674 sta->disassoc_reason = reason; in ap_sta_disassociate()
675 sta->flags |= WLAN_STA_PENDING_DISASSOC_CB; in ap_sta_disassociate()
676 eloop_cancel_timeout(ap_sta_disassoc_cb_timeout, hapd, sta); in ap_sta_disassociate()
679 ap_sta_disassoc_cb_timeout, hapd, sta); in ap_sta_disassociate()
686 struct sta_info *sta = timeout_ctx; in ap_sta_deauth_cb_timeout() local
688 ap_sta_remove(hapd, sta); in ap_sta_deauth_cb_timeout()
689 mlme_deauthenticate_indication(hapd, sta, sta->deauth_reason); in ap_sta_deauth_cb_timeout()
693 void ap_sta_deauthenticate(struct hostapd_data *hapd, struct sta_info *sta, in ap_sta_deauthenticate() argument
697 hapd->conf->iface, MAC2STR(sta->addr)); in ap_sta_deauthenticate()
698 sta->flags &= ~(WLAN_STA_AUTH | WLAN_STA_ASSOC); in ap_sta_deauthenticate()
699 ap_sta_set_authorized(hapd, sta, 0); in ap_sta_deauthenticate()
700 sta->timeout_next = STA_REMOVE; in ap_sta_deauthenticate()
704 __func__, MAC2STR(sta->addr), in ap_sta_deauthenticate()
706 eloop_cancel_timeout(ap_handle_timer, hapd, sta); in ap_sta_deauthenticate()
708 ap_handle_timer, hapd, sta); in ap_sta_deauthenticate()
709 accounting_sta_stop(hapd, sta); in ap_sta_deauthenticate()
710 ieee802_1x_free_station(sta); in ap_sta_deauthenticate()
712 sta->deauth_reason = reason; in ap_sta_deauthenticate()
713 sta->flags |= WLAN_STA_PENDING_DEAUTH_CB; in ap_sta_deauthenticate()
714 eloop_cancel_timeout(ap_sta_deauth_cb_timeout, hapd, sta); in ap_sta_deauthenticate()
717 ap_sta_deauth_cb_timeout, hapd, sta); in ap_sta_deauthenticate()
723 struct sta_info *sta, void *ctx) in ap_sta_wps_cancel() argument
725 if (sta && (sta->flags & WLAN_STA_WPS)) { in ap_sta_wps_cancel()
726 ap_sta_deauthenticate(hapd, sta, in ap_sta_wps_cancel()
729 __func__, MAC2STR(sta->addr)); in ap_sta_wps_cancel()
738 int ap_sta_bind_vlan(struct hostapd_data *hapd, struct sta_info *sta, in ap_sta_bind_vlan() argument
750 if (sta->vlan_id == old_vlanid) in ap_sta_bind_vlan()
761 if (sta->ssid->vlan[0]) in ap_sta_bind_vlan()
762 iface = sta->ssid->vlan; in ap_sta_bind_vlan()
764 if (sta->ssid->dynamic_vlan == DYNAMIC_VLAN_DISABLED) in ap_sta_bind_vlan()
765 sta->vlan_id = 0; in ap_sta_bind_vlan()
766 else if (sta->vlan_id > 0) { in ap_sta_bind_vlan()
770 if (vlan->vlan_id == sta->vlan_id) in ap_sta_bind_vlan()
782 if (sta->vlan_id > 0 && vlan == NULL) { in ap_sta_bind_vlan()
783 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_sta_bind_vlan()
786 sta->vlan_id); in ap_sta_bind_vlan()
788 } else if (sta->vlan_id > 0 && vlan->vlan_id == VLAN_ID_WILDCARD) { in ap_sta_bind_vlan()
789 vlan = vlan_add_dynamic(hapd, vlan, sta->vlan_id); in ap_sta_bind_vlan()
791 hostapd_logger(hapd, sta->addr, in ap_sta_bind_vlan()
795 sta->vlan_id); in ap_sta_bind_vlan()
800 if (vlan_setup_encryption_dyn(hapd, sta->ssid, iface) != 0) { in ap_sta_bind_vlan()
801 hostapd_logger(hapd, sta->addr, in ap_sta_bind_vlan()
806 sta->vlan_id); in ap_sta_bind_vlan()
809 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_sta_bind_vlan()
812 } else if (vlan && vlan->vlan_id == sta->vlan_id) { in ap_sta_bind_vlan()
813 if (sta->vlan_id > 0) { in ap_sta_bind_vlan()
815 hostapd_logger(hapd, sta->addr, in ap_sta_bind_vlan()
827 if (vlan_setup_encryption_dyn(hapd, sta->ssid, iface) != 0) { in ap_sta_bind_vlan()
828 hostapd_logger(hapd, sta->addr, in ap_sta_bind_vlan()
833 sta->vlan_id); in ap_sta_bind_vlan()
837 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_sta_bind_vlan()
841 if (wpa_auth_sta_set_vlan(sta->wpa_sm, sta->vlan_id) < 0) in ap_sta_bind_vlan()
844 ret = hostapd_drv_set_sta_vlan(iface, hapd, sta->addr, sta->vlan_id); in ap_sta_bind_vlan()
846 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_sta_bind_vlan()
848 "entry to vlan_id=%d", sta->vlan_id); in ap_sta_bind_vlan()
859 int ap_check_sa_query_timeout(struct hostapd_data *hapd, struct sta_info *sta) in ap_check_sa_query_timeout() argument
864 os_reltime_sub(&now, &sta->sa_query_start, &passed); in ap_check_sa_query_timeout()
867 hostapd_logger(hapd, sta->addr, in ap_check_sa_query_timeout()
871 sta->sa_query_timed_out = 1; in ap_check_sa_query_timeout()
872 os_free(sta->sa_query_trans_id); in ap_check_sa_query_timeout()
873 sta->sa_query_trans_id = NULL; in ap_check_sa_query_timeout()
874 sta->sa_query_count = 0; in ap_check_sa_query_timeout()
875 eloop_cancel_timeout(ap_sa_query_timer, hapd, sta); in ap_check_sa_query_timeout()
886 struct sta_info *sta = timeout_ctx; in ap_sa_query_timer() local
890 if (sta->sa_query_count > 0 && in ap_sa_query_timer()
891 ap_check_sa_query_timeout(hapd, sta)) in ap_sa_query_timer()
894 nbuf = os_realloc_array(sta->sa_query_trans_id, in ap_sa_query_timer()
895 sta->sa_query_count + 1, in ap_sa_query_timer()
899 if (sta->sa_query_count == 0) { in ap_sa_query_timer()
901 os_get_reltime(&sta->sa_query_start); in ap_sa_query_timer()
903 trans_id = nbuf + sta->sa_query_count * WLAN_SA_QUERY_TR_ID_LEN; in ap_sa_query_timer()
904 sta->sa_query_trans_id = nbuf; in ap_sa_query_timer()
905 sta->sa_query_count++; in ap_sa_query_timer()
912 eloop_register_timeout(sec, usec, ap_sa_query_timer, hapd, sta); in ap_sa_query_timer()
914 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in ap_sa_query_timer()
916 "association SA Query attempt %d", sta->sa_query_count); in ap_sa_query_timer()
918 ieee802_11_send_sa_query_req(hapd, sta->addr, trans_id); in ap_sa_query_timer()
922 void ap_sta_start_sa_query(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_start_sa_query() argument
924 ap_sa_query_timer(hapd, sta); in ap_sta_start_sa_query()
928 void ap_sta_stop_sa_query(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_stop_sa_query() argument
930 eloop_cancel_timeout(ap_sa_query_timer, hapd, sta); in ap_sta_stop_sa_query()
931 os_free(sta->sa_query_trans_id); in ap_sta_stop_sa_query()
932 sta->sa_query_trans_id = NULL; in ap_sta_stop_sa_query()
933 sta->sa_query_count = 0; in ap_sta_stop_sa_query()
939 void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta, in ap_sta_set_authorized() argument
949 if (!!authorized == !!(sta->flags & WLAN_STA_AUTHORIZED)) in ap_sta_set_authorized()
954 if (sta->p2p_ie != NULL && in ap_sta_set_authorized()
955 p2p_parse_dev_addr_in_p2p_ie(sta->p2p_ie, addr) == 0) in ap_sta_set_authorized()
958 dev_addr = p2p_group_get_dev_addr(hapd->p2p_group, sta->addr); in ap_sta_set_authorized()
962 MAC2STR(sta->addr), MAC2STR(dev_addr)); in ap_sta_set_authorized()
965 os_snprintf(buf, sizeof(buf), MACSTR, MAC2STR(sta->addr)); in ap_sta_set_authorized()
971 if (wpa_auth_get_ip_addr(sta->wpa_sm, ip_addr_buf) == 0) { in ap_sta_set_authorized()
988 sta->flags |= WLAN_STA_AUTHORIZED; in ap_sta_set_authorized()
997 sta->flags &= ~WLAN_STA_AUTHORIZED; in ap_sta_set_authorized()
1002 sta->addr, authorized, dev_addr); in ap_sta_set_authorized()
1006 void ap_sta_disconnect(struct hostapd_data *hapd, struct sta_info *sta, in ap_sta_disconnect() argument
1010 if (sta == NULL && addr) in ap_sta_disconnect()
1011 sta = ap_get_sta(hapd, addr); in ap_sta_disconnect()
1016 if (sta == NULL) in ap_sta_disconnect()
1018 ap_sta_set_authorized(hapd, sta, 0); in ap_sta_disconnect()
1019 wpa_auth_sm_event(sta->wpa_sm, WPA_DEAUTH); in ap_sta_disconnect()
1020 ieee802_1x_notify_port_enabled(sta->eapol_sm, 0); in ap_sta_disconnect()
1021 sta->flags &= ~(WLAN_STA_AUTH | WLAN_STA_ASSOC); in ap_sta_disconnect()
1025 __func__, MAC2STR(sta->addr), in ap_sta_disconnect()
1027 eloop_cancel_timeout(ap_handle_timer, hapd, sta); in ap_sta_disconnect()
1029 ap_handle_timer, hapd, sta); in ap_sta_disconnect()
1030 sta->timeout_next = STA_REMOVE; in ap_sta_disconnect()
1032 sta->deauth_reason = reason; in ap_sta_disconnect()
1033 sta->flags |= WLAN_STA_PENDING_DEAUTH_CB; in ap_sta_disconnect()
1034 eloop_cancel_timeout(ap_sta_deauth_cb_timeout, hapd, sta); in ap_sta_disconnect()
1037 ap_sta_deauth_cb_timeout, hapd, sta); in ap_sta_disconnect()
1041 void ap_sta_deauth_cb(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_deauth_cb() argument
1043 if (!(sta->flags & WLAN_STA_PENDING_DEAUTH_CB)) { in ap_sta_deauth_cb()
1047 sta->flags &= ~WLAN_STA_PENDING_DEAUTH_CB; in ap_sta_deauth_cb()
1048 eloop_cancel_timeout(ap_sta_deauth_cb_timeout, hapd, sta); in ap_sta_deauth_cb()
1049 ap_sta_deauth_cb_timeout(hapd, sta); in ap_sta_deauth_cb()
1053 void ap_sta_disassoc_cb(struct hostapd_data *hapd, struct sta_info *sta) in ap_sta_disassoc_cb() argument
1055 if (!(sta->flags & WLAN_STA_PENDING_DISASSOC_CB)) { in ap_sta_disassoc_cb()
1059 sta->flags &= ~WLAN_STA_PENDING_DISASSOC_CB; in ap_sta_disassoc_cb()
1060 eloop_cancel_timeout(ap_sta_disassoc_cb_timeout, hapd, sta); in ap_sta_disassoc_cb()
1061 ap_sta_disassoc_cb_timeout(hapd, sta); in ap_sta_disassoc_cb()