• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/contrib/wpa/wpa_supplicant/

Lines Matching refs:sta

122 			   struct sta_info *sta,
127 MAC2STR(sta->addr));
132 sizeof(sta->supported_rates)) {
135 " %d+%d", MAC2STR(sta->addr), elems->supp_rates_len,
140 sta->supported_rates_len = merge_byte_arrays(
141 sta->supported_rates, sizeof(sta->supported_rates),
172 struct sta_info *sta;
175 for (sta = hapd->sta_list; sta; sta = sta->next) {
176 if (sta->my_lid == llid)
186 struct sta_info *sta)
195 sta->my_lid = llid;
196 sta->peer_lid = 0;
197 sta->peer_aid = 0;
203 sta->plink_state = PLINK_IDLE;
208 struct sta_info *sta,
223 if (!sta)
282 wpabuf_put_le16(buf, sta->aid);
343 wpabuf_put_le16(buf, sta->my_lid);
345 wpabuf_put_le16(buf, sta->peer_lid);
349 if (sta->sae == NULL) {
353 mesh_rsn_get_pmkid(wpa_s->mesh_rsn, sta,
407 if (ampe && mesh_rsn_protect_frame(wpa_s->mesh_rsn, sta, cat, buf)) {
415 type, MAC2STR(sta->addr), sta->my_lid, sta->peer_lid);
417 sta->addr, wpa_s->own_addr, wpa_s->own_addr,
430 struct sta_info *sta,
437 MAC2STR(sta->addr), mplstate[sta->plink_state],
439 sta->plink_state = state;
442 params.addr = sta->addr;
444 params.peer_aid = sta->peer_aid;
450 ": %d", MAC2STR(sta->addr), ret);
456 struct sta_info *sta)
460 eloop_cancel_timeout(plink_timer, wpa_s, sta);
462 ap_free_sta(hapd, sta);
469 struct sta_info *sta = user_data;
474 switch (sta->plink_state) {
478 if (sta->mpm_retries < conf->dot11MeshMaxRetries) {
482 plink_timer, wpa_s, sta);
483 mesh_mpm_send_plink_action(wpa_s, sta, PLINK_OPEN, 0);
484 sta->mpm_retries++;
494 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING);
497 plink_timer, wpa_s, sta);
498 mesh_mpm_send_plink_action(wpa_s, sta, PLINK_CLOSE, reason);
503 if (sta->mesh_sae_pmksa_caching) {
506 MAC2STR(sta->addr));
507 wpa_auth_pmksa_remove(hapd->wpa_auth, sta->addr);
509 mesh_mpm_fsm_restart(wpa_s, sta);
519 mesh_mpm_plink_open(struct wpa_supplicant *wpa_s, struct sta_info *sta,
524 eloop_cancel_timeout(plink_timer, wpa_s, sta);
527 plink_timer, wpa_s, sta);
528 mesh_mpm_send_plink_action(wpa_s, sta, PLINK_OPEN, 0);
529 wpa_mesh_set_plink_state(wpa_s, sta, next_state);
533 static int mesh_mpm_plink_close(struct hostapd_data *hapd, struct sta_info *sta,
539 if (sta) {
540 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING);
541 mesh_mpm_send_plink_action(wpa_s, sta, PLINK_CLOSE, reason);
542 wpa_printf(MSG_DEBUG, "MPM closing plink sta=" MACSTR,
543 MAC2STR(sta->addr));
544 eloop_cancel_timeout(plink_timer, wpa_s, sta);
555 struct sta_info *sta;
563 sta = ap_get_sta(hapd, addr);
564 if (!sta) {
569 return mesh_mpm_plink_close(hapd, sta, wpa_s) == 0 ? 0 : -1;
587 struct sta_info *sta;
604 sta = ap_get_sta(hapd, addr);
605 if (!sta) {
610 if ((PLINK_OPN_SNT <= sta->plink_state &&
611 sta->plink_state <= PLINK_ESTAB) ||
612 (sta->sae && sta->sae->state > SAE_NOTHING)) {
619 mesh_mpm_plink_open(wpa_s, sta, PLINK_OPN_SNT);
621 mesh_rsn_auth_sae_sta(wpa_s, sta);
650 struct sta_info *sta;
653 sta = ap_get_sta(data, addr);
654 if (!sta) {
661 sta->flags |= WLAN_STA_AUTH;
663 mesh_rsn_init_ampe_sta(wpa_s, sta);
666 params.addr = sta->addr;
671 MAC2STR(sta->addr));
676 MAC2STR(sta->addr), ret);
679 if (!sta->my_lid)
680 mesh_mpm_init_link(wpa_s, sta);
682 mesh_mpm_plink_open(wpa_s, sta, PLINK_OPN_SNT);
698 struct sta_info *sta;
712 sta = ap_get_sta(data, addr);
713 if (!sta) {
714 sta = ap_sta_add(data, addr);
715 if (!sta)
720 sta->flags |= WLAN_STA_WMM;
722 /* initialize sta */
723 if (copy_supp_rates(wpa_s, sta, elems)) {
724 ap_free_sta(data, sta);
728 if (!sta->my_lid)
729 mesh_mpm_init_link(wpa_s, sta);
732 copy_sta_ht_capab(data, sta, elems->ht_capabilities);
737 sta->ht_capabilities) {
740 MAC2STR(sta->addr));
741 set_disable_ht40(sta->ht_capabilities, 1);
744 update_ht_state(data, sta);
748 copy_sta_vht_capab(data, sta, elems->vht_capabilities);
749 copy_sta_vht_oper(data, sta, elems->vht_operation);
750 set_sta_vht_opmode(data, sta, elems->vht_opmode_notif);
754 copy_sta_he_capab(data, sta, IEEE80211_MODE_MESH,
758 if (hostapd_get_aid(data, sta) < 0) {
760 ap_free_sta(data, sta);
766 params.supp_rates = sta->supported_rates;
767 params.supp_rates_len = sta->supported_rates_len;
769 params.plink_state = sta->plink_state;
770 params.aid = sta->aid;
771 params.peer_aid = sta->peer_aid;
773 params.ht_capabilities = sta->ht_capabilities;
774 params.vht_capabilities = sta->vht_capabilities;
775 params.he_capab = sta->he_capab;
776 params.he_capab_len = sta->he_capab_len;
783 sta->flags |= WLAN_STA_MFP;
792 ap_free_sta(data, sta);
796 return sta;
805 struct sta_info *sta;
808 sta = mesh_mpm_add_peer(wpa_s, addr, elems);
809 if (!sta)
844 if (sta->plink_state < PLINK_OPN_SNT ||
845 sta->plink_state > PLINK_ESTAB)
846 mesh_mpm_plink_open(wpa_s, sta, PLINK_OPN_SNT);
848 mesh_rsn_auth_sae_sta(wpa_s, sta);
866 struct sta_info *sta)
873 MAC2STR(sta->addr));
876 wpa_hexdump_key(MSG_DEBUG, "mesh: MTK", sta->mtk, sta->mtk_len);
878 sta->addr, 0, 0, seq, sizeof(seq),
879 sta->mtk, sta->mtk_len);
882 sta->mgtk_rsc, sizeof(sta->mgtk_rsc));
884 sta->mgtk, sta->mgtk_len);
886 sta->addr, sta->mgtk_key_id, 0,
887 sta->mgtk_rsc, sizeof(sta->mgtk_rsc),
888 sta->mgtk, sta->mgtk_len);
890 if (sta->igtk_len) {
892 sta->igtk_rsc, sizeof(sta->igtk_rsc));
894 sta->igtk, sta->igtk_len);
898 sta->addr, sta->igtk_key_id, 0,
899 sta->igtk_rsc, sizeof(sta->igtk_rsc),
900 sta->igtk, sta->igtk_len);
904 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_ESTAB);
907 sta->flags |= WLAN_STA_ASSOC;
908 sta->mesh_sae_pmksa_caching = 0;
912 eloop_cancel_timeout(plink_timer, wpa_s, sta);
916 MAC2STR(sta->addr));
919 wpas_notify_mesh_peer_connected(wpa_s, sta->addr);
923 static void mesh_mpm_fsm(struct wpa_supplicant *wpa_s, struct sta_info *sta,
930 MAC2STR(sta->addr), mplstate[sta->plink_state],
933 switch (sta->plink_state) {
937 mesh_mpm_fsm_restart(wpa_s, sta);
940 mesh_mpm_plink_open(wpa_s, sta, PLINK_OPN_RCVD);
941 mesh_mpm_send_plink_action(wpa_s, sta, PLINK_CONFIRM,
945 mesh_mpm_send_plink_action(wpa_s, sta,
960 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING);
966 plink_timer, wpa_s, sta);
967 mesh_mpm_send_plink_action(wpa_s, sta,
972 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_OPN_RCVD);
973 mesh_mpm_send_plink_action(wpa_s, sta,
977 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_CNF_RCVD);
978 eloop_cancel_timeout(plink_timer, wpa_s, sta);
982 plink_timer, wpa_s, sta);
996 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING);
1002 plink_timer, wpa_s, sta);
1003 sta->mpm_close_reason = reason;
1004 mesh_mpm_send_plink_action(wpa_s, sta,
1008 mesh_mpm_send_plink_action(wpa_s, sta,
1013 mesh_rsn_derive_mtk(wpa_s, sta);
1014 mesh_mpm_plink_estab(wpa_s, sta);
1028 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING);
1034 plink_timer, wpa_s, sta);
1035 sta->mpm_close_reason = reason;
1036 mesh_mpm_send_plink_action(wpa_s, sta,
1041 mesh_rsn_derive_mtk(wpa_s, sta);
1042 mesh_mpm_plink_estab(wpa_s, sta);
1043 mesh_mpm_send_plink_action(wpa_s, sta,
1055 wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING);
1062 plink_timer, wpa_s, sta);
1063 sta->mpm_close_reason = reason;
1067 MAC2STR(sta->addr), reason);
1070 MAC2STR(sta->addr));
1073 wpas_notify_mesh_peer_disconnected(wpa_s, sta->addr,
1078 mesh_mpm_send_plink_action(wpa_s, sta,
1082 mesh_mpm_send_plink_action(wpa_s, sta,
1092 mesh_mpm_fsm_restart(wpa_s, sta);
1098 reason = sta->mpm_close_reason;
1099 mesh_mpm_send_plink_action(wpa_s, sta,
1109 mplevent[event], mplstate[sta->plink_state]);
1121 struct sta_info *sta;
1209 sta = ap_get_sta(hapd, mgmt->sa);
1215 if (!sta && action_field == PLINK_OPEN &&
1218 sta = mesh_mpm_add_peer(wpa_s, mgmt->sa, &elems);
1220 if (!sta) {
1227 if (sta->sae && sta->sae->state != SAE_ACCEPTED) {
1233 if (!sta->my_lid)
1234 mesh_mpm_init_link(wpa_s, sta);
1239 res = mesh_rsn_process_ampe(wpa_s, sta, &elems,
1249 mesh_mpm_fsm(wpa_s, sta, OPN_RJCT,
1257 struct wpa_state_machine *sm = sta->wpa_sm;
1278 wpa_auth_uses_ocv(sta->wpa_sm)) {
1290 sta, channel_width_to_int(ci.chanwidth),
1306 if (sta->plink_state == PLINK_BLOCKED) {
1320 } else if (sta->peer_lid && sta->peer_lid != plid) {
1323 sta->peer_lid, plid);
1326 sta->peer_lid = plid;
1337 } else if (sta->my_lid != llid ||
1338 (sta->peer_lid && sta->peer_lid != plid)) {
1341 sta->my_lid, llid, sta->peer_lid, plid);
1344 if (!sta->peer_lid)
1345 sta->peer_lid = plid;
1346 sta->peer_aid = aid;
1351 if (sta->plink_state == PLINK_ESTAB)
1362 else if (sta->peer_lid != plid) {
1365 sta->peer_lid, plid);
1367 } else if (peer_mgmt_ie.plid && sta->my_lid != llid) {
1370 sta->my_lid, llid);
1384 mesh_mpm_fsm(wpa_s, sta, event, reason);
1389 void mesh_mpm_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
1391 if (sta->plink_state == PLINK_ESTAB)
1393 eloop_cancel_timeout(plink_timer, ELOOP_ALL_CTX, sta);
1394 eloop_cancel_timeout(mesh_auth_timer, ELOOP_ALL_CTX, sta);