Lines Matching +full:rx +full:- +full:ping +full:- +full:pong

3  * Copyright (c) 2004-2024, Jouni Malinen <j@w1.fi>
91 return -1; in set_bssid_filter()
96 return -1; in set_bssid_filter()
108 os_free(wpa_s->bssid_filter); in set_bssid_filter()
109 wpa_s->bssid_filter = filter; in set_bssid_filter()
110 wpa_s->bssid_filter_count = count; in set_bssid_filter()
143 return -1; in set_disallow_aps()
150 return -1; in set_disallow_aps()
171 return -1; in set_disallow_aps()
175 if ((end - pos) & 0x01 || in set_disallow_aps()
176 end - pos > 2 * SSID_MAX_LEN || in set_disallow_aps()
178 (end - pos) / 2) < 0) { in set_disallow_aps()
183 return -1; in set_disallow_aps()
185 ssid[ssid_count].ssid_len = (end - pos) / 2; in set_disallow_aps()
196 return -1; in set_disallow_aps()
205 os_free(wpa_s->disallow_aps_bssid); in set_disallow_aps()
206 wpa_s->disallow_aps_bssid = bssid; in set_disallow_aps()
207 wpa_s->disallow_aps_bssid_count = count; in set_disallow_aps()
210 os_free(wpa_s->disallow_aps_ssid); in set_disallow_aps()
211 wpa_s->disallow_aps_ssid = ssid; in set_disallow_aps()
212 wpa_s->disallow_aps_ssid_count = ssid_count; in set_disallow_aps()
214 if (!wpa_s->current_ssid || wpa_s->wpa_state < WPA_AUTHENTICATING) in set_disallow_aps()
217 c = wpa_s->current_ssid; in set_disallow_aps()
218 if (c->mode != WPAS_MODE_INFRA && c->mode != WPAS_MODE_IBSS) in set_disallow_aps()
221 if (!disallowed_bssid(wpa_s, wpa_s->bssid) && in set_disallow_aps()
222 !disallowed_ssid(wpa_s, c->ssid, c->ssid_len)) in set_disallow_aps()
229 wpa_s->sme.prev_bssid_set = 0; in set_disallow_aps()
231 wpa_s->reassociate = 1; in set_disallow_aps()
232 wpa_s->own_disconnect_req = 1; in set_disallow_aps()
249 return -1; in wpas_ctrl_set_blob()
253 return -1; in wpas_ctrl_set_blob()
258 return -1; in wpas_ctrl_set_blob()
259 blob->name = os_strdup(name); in wpas_ctrl_set_blob()
260 blob->data = os_malloc(len / 2); in wpas_ctrl_set_blob()
261 if (blob->name == NULL || blob->data == NULL) { in wpas_ctrl_set_blob()
263 return -1; in wpas_ctrl_set_blob()
266 if (hexstr2bin(pos, blob->data, len / 2) < 0) { in wpas_ctrl_set_blob()
269 return -1; in wpas_ctrl_set_blob()
271 blob->len = len / 2; in wpas_ctrl_set_blob()
273 wpa_config_set_blob(wpa_s->conf, blob); in wpas_ctrl_set_blob()
289 os_free(wpa_s->manual_sched_scan_freqs); in wpas_ctrl_pno()
297 wpa_s->manual_sched_scan_freqs = freqs; in wpas_ctrl_pno()
325 return -1; in wpas_ctrl_set_band()
328 wpa_s->setband_mask = setband_mask; in wpas_ctrl_set_band()
329 if (wpa_drv_setband(wpa_s, wpa_s->setband_mask) == 0) { in wpas_ctrl_set_band()
346 wpabuf_free(wpa_s->lci); in wpas_ctrl_iface_set_lci()
347 wpa_s->lci = NULL; in wpas_ctrl_iface_set_lci()
353 return -1; in wpas_ctrl_iface_set_lci()
355 if (os_get_reltime(&wpa_s->lci_time)) { in wpas_ctrl_iface_set_lci()
357 return -1; in wpas_ctrl_iface_set_lci()
360 wpabuf_free(wpa_s->lci); in wpas_ctrl_iface_set_lci()
361 wpa_s->lci = lci; in wpas_ctrl_iface_set_lci()
373 wpa_s->srp.relative_rssi_set = 0; in wpas_ctrl_set_relative_rssi()
379 return -1; in wpas_ctrl_set_relative_rssi()
380 wpa_s->srp.relative_rssi = relative_rssi; in wpas_ctrl_set_relative_rssi()
381 wpa_s->srp.relative_rssi_set = 1; in wpas_ctrl_set_relative_rssi()
395 return -1; in wpas_ctrl_set_relative_band_adjust()
398 if (adjust_rssi < -100 || adjust_rssi > 100) in wpas_ctrl_set_relative_band_adjust()
399 return -1; in wpas_ctrl_set_relative_band_adjust()
402 wpa_s->srp.relative_adjust_band = WPA_SETBAND_2G; in wpas_ctrl_set_relative_band_adjust()
404 wpa_s->srp.relative_adjust_band = WPA_SETBAND_5G; in wpas_ctrl_set_relative_band_adjust()
406 return -1; in wpas_ctrl_set_relative_band_adjust()
408 wpa_s->srp.relative_adjust_rssi = adjust_rssi; in wpas_ctrl_set_relative_band_adjust()
420 wpabuf_free(wpa_s->ric_ies); in wpas_ctrl_iface_set_ric_ies()
421 wpa_s->ric_ies = NULL; in wpas_ctrl_iface_set_ric_ies()
427 return -1; in wpas_ctrl_iface_set_ric_ies()
429 wpabuf_free(wpa_s->ric_ies); in wpas_ctrl_iface_set_ric_ies()
430 wpa_s->ric_ies = ric_ies; in wpas_ctrl_iface_set_ric_ies()
445 return -1; in wpas_ctrl_iface_set_dso()
448 dl_list_for_each(tmp, &wpa_s->drv_signal_override, in wpas_ctrl_iface_set_dso()
450 if (ether_addr_equal(bssid, tmp->bssid)) { in wpas_ctrl_iface_set_dso()
459 dl_list_del(&dso->list); in wpas_ctrl_iface_set_dso()
474 return -1; in wpas_ctrl_iface_set_dso()
479 return -1; in wpas_ctrl_iface_set_dso()
480 os_memcpy(dso->bssid, bssid, ETH_ALEN); in wpas_ctrl_iface_set_dso()
481 dl_list_add(&wpa_s->drv_signal_override, &dso->list); in wpas_ctrl_iface_set_dso()
483 dso->si_current_signal = parsed.si_current_signal; in wpas_ctrl_iface_set_dso()
484 dso->si_avg_signal = parsed.si_avg_signal; in wpas_ctrl_iface_set_dso()
485 dso->si_avg_beacon_signal = parsed.si_avg_beacon_signal; in wpas_ctrl_iface_set_dso()
486 dso->si_current_noise = parsed.si_current_noise; in wpas_ctrl_iface_set_dso()
487 dso->scan_level = parsed.scan_level; in wpas_ctrl_iface_set_dso()
502 return -1; in wpa_supplicant_ctrl_iface_set()
507 eapol_sm_configure(wpa_s->eapol, in wpa_supplicant_ctrl_iface_set()
508 atoi(value), -1, -1, -1); in wpa_supplicant_ctrl_iface_set()
510 eapol_sm_configure(wpa_s->eapol, in wpa_supplicant_ctrl_iface_set()
511 -1, atoi(value), -1, -1); in wpa_supplicant_ctrl_iface_set()
513 eapol_sm_configure(wpa_s->eapol, in wpa_supplicant_ctrl_iface_set()
514 -1, -1, atoi(value), -1); in wpa_supplicant_ctrl_iface_set()
516 eapol_sm_configure(wpa_s->eapol, in wpa_supplicant_ctrl_iface_set()
517 -1, -1, -1, atoi(value)); in wpa_supplicant_ctrl_iface_set()
521 eapol_sm_notify_portControl(wpa_s->eapol, Auto); in wpa_supplicant_ctrl_iface_set()
523 eapol_sm_notify_portControl(wpa_s->eapol, in wpa_supplicant_ctrl_iface_set()
526 eapol_sm_notify_portControl(wpa_s->eapol, in wpa_supplicant_ctrl_iface_set()
529 ret = -1; in wpa_supplicant_ctrl_iface_set()
532 if (wpa_sm_set_param(wpa_s->wpa, RSNA_PMK_LIFETIME, in wpa_supplicant_ctrl_iface_set()
534 ret = -1; in wpa_supplicant_ctrl_iface_set()
536 value[-1] = '='; in wpa_supplicant_ctrl_iface_set()
537 wpa_config_process_global(wpa_s->conf, cmd, -1); in wpa_supplicant_ctrl_iface_set()
541 if (wpa_sm_set_param(wpa_s->wpa, RSNA_PMK_REAUTH_THRESHOLD, in wpa_supplicant_ctrl_iface_set()
543 ret = -1; in wpa_supplicant_ctrl_iface_set()
545 value[-1] = '='; in wpa_supplicant_ctrl_iface_set()
546 wpa_config_process_global(wpa_s->conf, cmd, -1); in wpa_supplicant_ctrl_iface_set()
549 if (wpa_sm_set_param(wpa_s->wpa, RSNA_SA_TIMEOUT, in wpa_supplicant_ctrl_iface_set()
551 ret = -1; in wpa_supplicant_ctrl_iface_set()
553 value[-1] = '='; in wpa_supplicant_ctrl_iface_set()
554 wpa_config_process_global(wpa_s->conf, cmd, -1); in wpa_supplicant_ctrl_iface_set()
557 wpa_s->wps_fragment_size = atoi(value); in wpa_supplicant_ctrl_iface_set()
563 ret = -1; in wpa_supplicant_ctrl_iface_set()
568 wpa_printf(MSG_DEBUG, "WPS: Testing - force WPS " in wpa_supplicant_ctrl_iface_set()
575 wpa_printf(MSG_DEBUG, "WPS: Testing - stub_cred=%d", in wpa_supplicant_ctrl_iface_set()
579 wpa_printf(MSG_DEBUG, "WPS: Testing - wps_corrupt_pkhash=%d", in wpa_supplicant_ctrl_iface_set()
598 ret = -1; in wpa_supplicant_ctrl_iface_set()
610 ret = -1; in wpa_supplicant_ctrl_iface_set()
612 ret = -1; in wpa_supplicant_ctrl_iface_set()
613 wpa_tdls_enable(wpa_s->wpa, !disabled); in wpa_supplicant_ctrl_iface_set()
620 ret = -1; in wpa_supplicant_ctrl_iface_set()
625 wpa_s->set_sta_uapsd = 0; in wpa_supplicant_ctrl_iface_set()
633 return -1; in wpa_supplicant_ctrl_iface_set()
638 return -1; in wpa_supplicant_ctrl_iface_set()
643 return -1; in wpa_supplicant_ctrl_iface_set()
648 wpa_s->set_sta_uapsd = 1; in wpa_supplicant_ctrl_iface_set()
649 wpa_s->sta_uapsd = 0; in wpa_supplicant_ctrl_iface_set()
651 wpa_s->sta_uapsd |= BIT(0); in wpa_supplicant_ctrl_iface_set()
653 wpa_s->sta_uapsd |= BIT(1); in wpa_supplicant_ctrl_iface_set()
655 wpa_s->sta_uapsd |= BIT(2); in wpa_supplicant_ctrl_iface_set()
657 wpa_s->sta_uapsd |= BIT(3); in wpa_supplicant_ctrl_iface_set()
660 ret = wpa_drv_set_p2p_powersave(wpa_s, atoi(value), -1, -1); in wpa_supplicant_ctrl_iface_set()
664 if (enabled && !wpa_s->global->p2p) in wpa_supplicant_ctrl_iface_set()
665 ret = -1; in wpa_supplicant_ctrl_iface_set()
667 wifi_display_enable(wpa_s->global, enabled); in wpa_supplicant_ctrl_iface_set()
674 wpa_s->no_keep_alive = !!atoi(value); in wpa_supplicant_ctrl_iface_set()
677 os_free(wpa_s->dpp_configurator_params); in wpa_supplicant_ctrl_iface_set()
678 wpa_s->dpp_configurator_params = os_strdup(value); in wpa_supplicant_ctrl_iface_set()
680 dpp_controller_set_params(wpa_s->dpp, value); in wpa_supplicant_ctrl_iface_set()
683 wpa_s->dpp_init_max_tries = atoi(value); in wpa_supplicant_ctrl_iface_set()
685 wpa_s->dpp_init_retry_time = atoi(value); in wpa_supplicant_ctrl_iface_set()
687 wpa_s->dpp_resp_wait_time = atoi(value); in wpa_supplicant_ctrl_iface_set()
689 wpa_s->dpp_resp_max_tries = atoi(value); in wpa_supplicant_ctrl_iface_set()
691 wpa_s->dpp_resp_retry_time = atoi(value); in wpa_supplicant_ctrl_iface_set()
695 ret = -1; in wpa_supplicant_ctrl_iface_set()
698 ret = -1; in wpa_supplicant_ctrl_iface_set()
704 ret = -1; in wpa_supplicant_ctrl_iface_set()
707 ret = -1; in wpa_supplicant_ctrl_iface_set()
714 ret = -1; in wpa_supplicant_ctrl_iface_set()
717 ret = -1; in wpa_supplicant_ctrl_iface_set()
724 ret = -1; in wpa_supplicant_ctrl_iface_set()
726 ret = -1; in wpa_supplicant_ctrl_iface_set()
735 wpa_s->ext_mgmt_frame_handling = !!atoi(value); in wpa_supplicant_ctrl_iface_set()
737 wpa_s->ext_eapol_frame_io = !!atoi(value); in wpa_supplicant_ctrl_iface_set()
739 if (wpa_s->ap_iface) { in wpa_supplicant_ctrl_iface_set()
740 wpa_s->ap_iface->bss[0]->ext_eapol_frame_io = in wpa_supplicant_ctrl_iface_set()
741 wpa_s->ext_eapol_frame_io; in wpa_supplicant_ctrl_iface_set()
745 wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_ENCRYPT_EAPOL_M2, in wpa_supplicant_ctrl_iface_set()
748 wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_ENCRYPT_EAPOL_M4, in wpa_supplicant_ctrl_iface_set()
751 wpa_s->extra_roc_dur = atoi(value); in wpa_supplicant_ctrl_iface_set()
753 wpa_s->test_failure = atoi(value); in wpa_supplicant_ctrl_iface_set()
755 wpa_s->p2p_go_csa_on_inv = !!atoi(value); in wpa_supplicant_ctrl_iface_set()
757 wpa_s->ignore_auth_resp = !!atoi(value); in wpa_supplicant_ctrl_iface_set()
759 wpa_s->ignore_assoc_disallow = !!atoi(value); in wpa_supplicant_ctrl_iface_set()
761 wpa_s->ignore_assoc_disallow); in wpa_supplicant_ctrl_iface_set()
763 wpa_s->disable_sa_query = !!atoi(value); in wpa_supplicant_ctrl_iface_set()
765 wpa_s->ignore_sae_h2e_only = !!atoi(value); in wpa_supplicant_ctrl_iface_set()
769 os_free(wpa_s->extra_sae_rejected_groups); in wpa_supplicant_ctrl_iface_set()
770 wpa_s->extra_sae_rejected_groups = NULL; in wpa_supplicant_ctrl_iface_set()
781 &wpa_s->extra_sae_rejected_groups, in wpa_supplicant_ctrl_iface_set()
789 wpa_s->ft_rsnxe_used = atoi(value); in wpa_supplicant_ctrl_iface_set()
791 wpa_s->oci_freq_override_eapol = atoi(value); in wpa_supplicant_ctrl_iface_set()
793 wpa_s->oci_freq_override_saquery_req = atoi(value); in wpa_supplicant_ctrl_iface_set()
795 wpa_s->oci_freq_override_saquery_resp = atoi(value); in wpa_supplicant_ctrl_iface_set()
797 wpa_s->oci_freq_override_eapol_g2 = atoi(value); in wpa_supplicant_ctrl_iface_set()
799 wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_OCI_FREQ_EAPOL_G2, in wpa_supplicant_ctrl_iface_set()
800 wpa_s->oci_freq_override_eapol_g2); in wpa_supplicant_ctrl_iface_set()
802 wpa_s->oci_freq_override_ft_assoc = atoi(value); in wpa_supplicant_ctrl_iface_set()
804 wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_OCI_FREQ_FT_ASSOC, in wpa_supplicant_ctrl_iface_set()
805 wpa_s->oci_freq_override_ft_assoc); in wpa_supplicant_ctrl_iface_set()
807 wpa_s->oci_freq_override_fils_assoc = atoi(value); in wpa_supplicant_ctrl_iface_set()
809 wpa_s->oci_freq_override_wnm_sleep = atoi(value); in wpa_supplicant_ctrl_iface_set()
811 wpabuf_free(wpa_s->rsne_override_eapol); in wpa_supplicant_ctrl_iface_set()
813 wpa_s->rsne_override_eapol = NULL; in wpa_supplicant_ctrl_iface_set()
815 wpa_s->rsne_override_eapol = wpabuf_parse_bin(value); in wpa_supplicant_ctrl_iface_set()
817 wpabuf_free(wpa_s->rsnxe_override_assoc); in wpa_supplicant_ctrl_iface_set()
819 wpa_s->rsnxe_override_assoc = NULL; in wpa_supplicant_ctrl_iface_set()
821 wpa_s->rsnxe_override_assoc = wpabuf_parse_bin(value); in wpa_supplicant_ctrl_iface_set()
823 wpabuf_free(wpa_s->rsnxe_override_eapol); in wpa_supplicant_ctrl_iface_set()
825 wpa_s->rsnxe_override_eapol = NULL; in wpa_supplicant_ctrl_iface_set()
827 wpa_s->rsnxe_override_eapol = wpabuf_parse_bin(value); in wpa_supplicant_ctrl_iface_set()
829 wpa_s->reject_btm_req_reason = atoi(value); in wpa_supplicant_ctrl_iface_set()
831 os_free(wpa_s->get_pref_freq_list_override); in wpa_supplicant_ctrl_iface_set()
833 wpa_s->get_pref_freq_list_override = NULL; in wpa_supplicant_ctrl_iface_set()
835 wpa_s->get_pref_freq_list_override = os_strdup(value); in wpa_supplicant_ctrl_iface_set()
837 wpabuf_free(wpa_s->sae_commit_override); in wpa_supplicant_ctrl_iface_set()
839 wpa_s->sae_commit_override = NULL; in wpa_supplicant_ctrl_iface_set()
841 wpa_s->sae_commit_override = wpabuf_parse_bin(value); in wpa_supplicant_ctrl_iface_set()
846 wpa_s->disable_scs_support = !!atoi(value); in wpa_supplicant_ctrl_iface_set()
848 wpa_s->disable_mscs_support = !!atoi(value); in wpa_supplicant_ctrl_iface_set()
851 wpa_s->disable_eapol_g2_tx = !!atoi(value); in wpa_supplicant_ctrl_iface_set()
853 wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_DISABLE_EAPOL_G2_TX, in wpa_supplicant_ctrl_iface_set()
854 wpa_s->disable_eapol_g2_tx); in wpa_supplicant_ctrl_iface_set()
856 wpa_s->test_assoc_comeback_type = atoi(value); in wpa_supplicant_ctrl_iface_set()
859 os_free(wpa_s->dpp_config_obj_override); in wpa_supplicant_ctrl_iface_set()
861 wpa_s->dpp_config_obj_override = NULL; in wpa_supplicant_ctrl_iface_set()
863 wpa_s->dpp_config_obj_override = os_strdup(value); in wpa_supplicant_ctrl_iface_set()
865 os_free(wpa_s->dpp_discovery_override); in wpa_supplicant_ctrl_iface_set()
867 wpa_s->dpp_discovery_override = NULL; in wpa_supplicant_ctrl_iface_set()
869 wpa_s->dpp_discovery_override = os_strdup(value); in wpa_supplicant_ctrl_iface_set()
871 os_free(wpa_s->dpp_groups_override); in wpa_supplicant_ctrl_iface_set()
873 wpa_s->dpp_groups_override = NULL; in wpa_supplicant_ctrl_iface_set()
875 wpa_s->dpp_groups_override = os_strdup(value); in wpa_supplicant_ctrl_iface_set()
878 wpa_s->dpp_ignore_netaccesskey_mismatch = atoi(value); in wpa_supplicant_ctrl_iface_set()
880 wpa_s->dpp_discard_public_action = atoi(value); in wpa_supplicant_ctrl_iface_set()
887 wpa_s->disable_fils = !!atoi(value); in wpa_supplicant_ctrl_iface_set()
888 wpa_drv_disable_fils(wpa_s, wpa_s->disable_fils); in wpa_supplicant_ctrl_iface_set()
901 value[-1] = '='; in wpa_supplicant_ctrl_iface_set()
902 wpa_config_process_global(wpa_s->conf, cmd, -1); in wpa_supplicant_ctrl_iface_set()
909 return -1; in wpa_supplicant_ctrl_iface_set()
916 return -1; in wpa_supplicant_ctrl_iface_set()
918 wpa_s->conf->oce = val; in wpa_supplicant_ctrl_iface_set()
919 if (wpa_s->conf->oce) { in wpa_supplicant_ctrl_iface_set()
920 if ((wpa_s->conf->oce & OCE_STA) && in wpa_supplicant_ctrl_iface_set()
921 (wpa_s->drv_flags & WPA_DRIVER_FLAGS_OCE_STA)) in wpa_supplicant_ctrl_iface_set()
922 wpa_s->enable_oce = OCE_STA; in wpa_supplicant_ctrl_iface_set()
924 if ((wpa_s->conf->oce & OCE_STA_CFON) && in wpa_supplicant_ctrl_iface_set()
925 (wpa_s->drv_flags & in wpa_supplicant_ctrl_iface_set()
927 /* TODO: Need to add STA-CFON support */ in wpa_supplicant_ctrl_iface_set()
929 "OCE STA-CFON feature is not yet supported"); in wpa_supplicant_ctrl_iface_set()
930 return -1; in wpa_supplicant_ctrl_iface_set()
933 wpa_s->enable_oce = 0; in wpa_supplicant_ctrl_iface_set()
955 return -1; in wpa_supplicant_ctrl_iface_set()
960 wpa_s->enable_dscp_policy_capa = !!atoi(value); in wpa_supplicant_ctrl_iface_set()
963 value[-1] = '='; in wpa_supplicant_ctrl_iface_set()
964 ret = wpa_config_process_global(wpa_s->conf, cmd, -1); in wpa_supplicant_ctrl_iface_set()
978 int res = -1; in wpa_supplicant_ctrl_iface_get()
987 if (wpa_s->conf->country[0] && wpa_s->conf->country[1]) in wpa_supplicant_ctrl_iface_get()
989 wpa_s->conf->country[0], in wpa_supplicant_ctrl_iface_get()
990 wpa_s->conf->country[1]); in wpa_supplicant_ctrl_iface_get()
994 if (wpa_s->global->p2p == NULL || in wpa_supplicant_ctrl_iface_get()
995 wpa_s->global->p2p_disabled) in wpa_supplicant_ctrl_iface_get()
998 enabled = wpa_s->global->wifi_display; in wpa_supplicant_ctrl_iface_get()
1003 if (wpa_s->last_gtk_len == 0) in wpa_supplicant_ctrl_iface_get()
1004 return -1; in wpa_supplicant_ctrl_iface_get()
1005 res = wpa_snprintf_hex(buf, buflen, wpa_s->last_gtk, in wpa_supplicant_ctrl_iface_get()
1006 wpa_s->last_gtk_len); in wpa_supplicant_ctrl_iface_get()
1014 wpa_sm_get_anonce(wpa_s->wpa), in wpa_supplicant_ctrl_iface_get()
1017 res = os_snprintf(buf, buflen, "%d", wpa_s->last_tk_key_idx); in wpa_supplicant_ctrl_iface_get()
1020 res = wpa_config_get_value(cmd, wpa_s->conf, buf, buflen); in wpa_supplicant_ctrl_iface_get()
1024 return -1; in wpa_supplicant_ctrl_iface_get()
1034 struct wpa_ssid *ssid = wpa_s->current_ssid; in wpa_supplicant_ctrl_iface_preauth()
1039 return -1; in wpa_supplicant_ctrl_iface_preauth()
1043 rsn_preauth_deinit(wpa_s->wpa); in wpa_supplicant_ctrl_iface_preauth()
1044 if (rsn_preauth_init(wpa_s->wpa, bssid, ssid ? &ssid->eap : NULL)) in wpa_supplicant_ctrl_iface_preauth()
1045 return -1; in wpa_supplicant_ctrl_iface_preauth()
1063 return -1; in wpa_supplicant_ctrl_iface_tdls_discover()
1069 if (wpa_tdls_is_external_setup(wpa_s->wpa)) in wpa_supplicant_ctrl_iface_tdls_discover()
1070 ret = wpa_tdls_send_discovery_request(wpa_s->wpa, peer); in wpa_supplicant_ctrl_iface_tdls_discover()
1087 return -1; in wpa_supplicant_ctrl_iface_tdls_setup()
1093 if ((wpa_s->conf->tdls_external_control) && in wpa_supplicant_ctrl_iface_tdls_setup()
1094 wpa_tdls_is_external_setup(wpa_s->wpa)) in wpa_supplicant_ctrl_iface_tdls_setup()
1097 wpa_tdls_remove(wpa_s->wpa, peer); in wpa_supplicant_ctrl_iface_tdls_setup()
1099 if (wpa_tdls_is_external_setup(wpa_s->wpa)) in wpa_supplicant_ctrl_iface_tdls_setup()
1100 ret = wpa_tdls_start(wpa_s->wpa, peer); in wpa_supplicant_ctrl_iface_tdls_setup()
1117 wpa_tdls_teardown_peers(wpa_s->wpa); in wpa_supplicant_ctrl_iface_tdls_teardown()
1124 return -1; in wpa_supplicant_ctrl_iface_tdls_teardown()
1130 if ((wpa_s->conf->tdls_external_control) && in wpa_supplicant_ctrl_iface_tdls_teardown()
1131 wpa_tdls_is_external_setup(wpa_s->wpa)) in wpa_supplicant_ctrl_iface_tdls_teardown()
1134 if (wpa_tdls_is_external_setup(wpa_s->wpa)) in wpa_supplicant_ctrl_iface_tdls_teardown()
1136 wpa_s->wpa, peer, in wpa_supplicant_ctrl_iface_tdls_teardown()
1151 wpa_s->drv_flags & WPA_DRIVER_FLAGS_TDLS_SUPPORT ? in ctrl_iface_get_capability_tdls()
1152 (wpa_s->drv_flags & in ctrl_iface_get_capability_tdls()
1156 return -1; in ctrl_iface_get_capability_tdls()
1169 if (!wpa_tdls_is_external_setup(wpa_s->wpa)) { in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1172 return -1; in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1179 return -1; in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1186 return -1; in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1193 return -1; in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1200 pos2 += sizeof(" " #str "=") - 1; \ in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1218 return -1; in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1229 return wpa_tdls_enable_chan_switch(wpa_s->wpa, peer, oper_class, in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1239 if (!wpa_tdls_is_external_setup(wpa_s->wpa)) { in wpa_supplicant_ctrl_iface_tdls_cancel_chan_switch()
1242 return -1; in wpa_supplicant_ctrl_iface_tdls_cancel_chan_switch()
1249 return -1; in wpa_supplicant_ctrl_iface_tdls_cancel_chan_switch()
1255 return wpa_tdls_disable_chan_switch(wpa_s->wpa, peer); in wpa_supplicant_ctrl_iface_tdls_cancel_chan_switch()
1271 return -1; in wpa_supplicant_ctrl_iface_tdls_link_status()
1276 tdls_status = wpa_tdls_get_link_status(wpa_s->wpa, peer); in wpa_supplicant_ctrl_iface_tdls_link_status()
1280 return -1; in wpa_supplicant_ctrl_iface_tdls_link_status()
1323 return -1; in wmm_ac_ctrl_addts()
1354 return -1; in wpa_supplicant_ctrl_iface_ft_ds()
1365 return wpa_ft_start_over_ds(wpa_s->wpa, target_ap, mdie, force); in wpa_supplicant_ctrl_iface_ft_ds()
1393 return -1; in wpa_supplicant_ctrl_iface_wps_pbc()
1403 return -1; in wpa_supplicant_ctrl_iface_wps_pbc()
1415 if (wpa_s->ap_iface) in wpa_supplicant_ctrl_iface_wps_pbc()
1439 return -1; in wpa_supplicant_ctrl_iface_wps_pin()
1444 return -1; in wpa_supplicant_ctrl_iface_wps_pin()
1448 if (wpa_s->ap_iface) { in wpa_supplicant_ctrl_iface_wps_pin()
1469 return -1; in wpa_supplicant_ctrl_iface_wps_pin()
1472 return -1; in wpa_supplicant_ctrl_iface_wps_pin()
1478 return -1; in wpa_supplicant_ctrl_iface_wps_pin()
1484 return -1; in wpa_supplicant_ctrl_iface_wps_pin()
1505 return -1; in wpa_supplicant_ctrl_iface_wps_check_pin()
1510 return -1; in wpa_supplicant_ctrl_iface_wps_check_pin()
1519 ret = os_snprintf(buf, buflen, "FAIL-CHECKSUM\n"); in wpa_supplicant_ctrl_iface_wps_check_pin()
1521 return -1; in wpa_supplicant_ctrl_iface_wps_check_pin()
1528 return -1; in wpa_supplicant_ctrl_iface_wps_check_pin()
1544 return -1; in wpa_supplicant_ctrl_iface_wps_nfc()
1567 return -1; in wpa_supplicant_ctrl_iface_wps_nfc_config_token()
1571 return -1; in wpa_supplicant_ctrl_iface_wps_nfc_config_token()
1596 return -1; in wpa_supplicant_ctrl_iface_wps_nfc_token()
1600 return -1; in wpa_supplicant_ctrl_iface_wps_nfc_token()
1631 return -1; in wpa_supplicant_ctrl_iface_wps_nfc_tag_read()
1636 return -1; in wpa_supplicant_ctrl_iface_wps_nfc_tag_read()
1639 return -1; in wpa_supplicant_ctrl_iface_wps_nfc_tag_read()
1658 return -1; in wpas_ctrl_nfc_get_handover_req_wps()
1682 return -1; in wpas_ctrl_nfc_get_handover_req_p2p()
1706 return -1; in wpas_ctrl_nfc_get_handover_req()
1714 return -1; in wpas_ctrl_nfc_get_handover_req()
1716 if (os_strcmp(pos, "WPS") == 0 || os_strcmp(pos, "WPS-CR") == 0) { in wpas_ctrl_nfc_get_handover_req()
1718 return -1; in wpas_ctrl_nfc_get_handover_req()
1724 if (os_strcmp(pos, "P2P-CR") == 0) { in wpas_ctrl_nfc_get_handover_req()
1730 return -1; in wpas_ctrl_nfc_get_handover_req()
1743 return -1; in wpas_ctrl_nfc_get_handover_sel_wps()
1766 return -1; in wpas_ctrl_nfc_get_handover_sel_p2p()
1789 return -1; in wpas_ctrl_nfc_get_handover_sel()
1797 return -1; in wpas_ctrl_nfc_get_handover_sel()
1802 if (os_strcmp(pos, "WPS") == 0 || os_strcmp(pos, "WPS-CR") == 0) { in wpas_ctrl_nfc_get_handover_sel()
1804 return -1; in wpas_ctrl_nfc_get_handover_sel()
1807 os_strcmp(pos, "WPS-CR") == 0, pos2); in wpas_ctrl_nfc_get_handover_sel()
1811 if (os_strcmp(pos, "P2P-CR") == 0) { in wpas_ctrl_nfc_get_handover_sel()
1816 if (os_strcmp(pos, "P2P-CR-TAG") == 0) { in wpas_ctrl_nfc_get_handover_sel()
1822 return -1; in wpas_ctrl_nfc_get_handover_sel()
1849 return -1; in wpas_ctrl_nfc_report_handover()
1857 return -1; in wpas_ctrl_nfc_report_handover()
1864 return -1; in wpas_ctrl_nfc_report_handover()
1871 return -1; in wpas_ctrl_nfc_report_handover()
1878 return -1; in wpas_ctrl_nfc_report_handover()
1883 return -1; in wpas_ctrl_nfc_report_handover()
1890 return -1; in wpas_ctrl_nfc_report_handover()
1898 return -1; in wpas_ctrl_nfc_report_handover()
1904 return -1; in wpas_ctrl_nfc_report_handover()
1907 wpa_printf(MSG_DEBUG, "NFC: Connection handover reported - role=%s type=%s req_len=%d sel_len=%d", in wpas_ctrl_nfc_report_handover()
1931 ret = -1; in wpas_ctrl_nfc_report_handover()
1958 return -1; in wpa_supplicant_ctrl_iface_wps_reg()
1964 return -1; in wpa_supplicant_ctrl_iface_wps_reg()
1974 return -1; in wpa_supplicant_ctrl_iface_wps_reg()
1979 return -1; in wpa_supplicant_ctrl_iface_wps_reg()
1984 return -1; in wpa_supplicant_ctrl_iface_wps_reg()
2005 if (!wpa_s->ap_iface) in wpa_supplicant_ctrl_iface_wps_ap_pin()
2006 return -1; in wpa_supplicant_ctrl_iface_wps_ap_pin()
2022 return -1; in wpa_supplicant_ctrl_iface_wps_ap_pin()
2029 return -1; in wpa_supplicant_ctrl_iface_wps_ap_pin()
2036 return -1; in wpa_supplicant_ctrl_iface_wps_ap_pin()
2044 return -1; in wpa_supplicant_ctrl_iface_wps_ap_pin()
2046 return -1; in wpa_supplicant_ctrl_iface_wps_ap_pin()
2050 return -1; in wpa_supplicant_ctrl_iface_wps_ap_pin()
2063 return -1; in wpa_supplicant_ctrl_iface_wps_er_pin()
2081 return -1; in wpa_supplicant_ctrl_iface_wps_er_learn()
2093 return -1; in wpa_supplicant_ctrl_iface_wps_er_set_config()
2111 return -1; in wpa_supplicant_ctrl_iface_wps_er_config()
2116 return -1; in wpa_supplicant_ctrl_iface_wps_er_config()
2121 return -1; in wpa_supplicant_ctrl_iface_wps_er_config()
2126 return -1; in wpa_supplicant_ctrl_iface_wps_er_config()
2131 return -1; in wpa_supplicant_ctrl_iface_wps_er_config()
2154 return -1; in wpa_supplicant_ctrl_iface_wps_er_nfc_config_token()
2162 return -1; in wpa_supplicant_ctrl_iface_wps_er_nfc_config_token()
2166 return -1; in wpa_supplicant_ctrl_iface_wps_er_nfc_config_token()
2192 return -1; in wpa_supplicant_ctrl_iface_ibss_rsn()
2198 return ibss_rsn_start(wpa_s->ibss_rsn, peer); in wpa_supplicant_ctrl_iface_ibss_rsn()
2211 pos = os_strchr(rsp, '-'); in wpa_supplicant_ctrl_iface_ctrl_rsp()
2213 return -1; in wpa_supplicant_ctrl_iface_ctrl_rsp()
2218 return -1; in wpa_supplicant_ctrl_iface_ctrl_rsp()
2225 ssid = wpa_config_get_network(wpa_s->conf, id); in wpa_supplicant_ctrl_iface_ctrl_rsp()
2229 return -1; in wpa_supplicant_ctrl_iface_ctrl_rsp()
2236 return -1; in wpa_supplicant_ctrl_iface_ctrl_rsp()
2253 if (os_strcmp(params, "-DRIVER") == 0) in wpa_supplicant_ctrl_iface_status()
2255 verbose = os_strcmp(params, "-VERBOSE") == 0; in wpa_supplicant_ctrl_iface_status()
2256 wps = os_strcmp(params, "-WPS") == 0; in wpa_supplicant_ctrl_iface_status()
2259 if (wpa_s->wpa_state >= WPA_ASSOCIATED) { in wpa_supplicant_ctrl_iface_status()
2260 struct wpa_ssid *ssid = wpa_s->current_ssid; in wpa_supplicant_ctrl_iface_status()
2261 ret = os_snprintf(pos, end - pos, "bssid=" MACSTR "\n", in wpa_supplicant_ctrl_iface_status()
2262 MAC2STR(wpa_s->bssid)); in wpa_supplicant_ctrl_iface_status()
2263 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2264 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2266 ret = os_snprintf(pos, end - pos, "freq=%u\n", in wpa_supplicant_ctrl_iface_status()
2267 wpa_s->assoc_freq); in wpa_supplicant_ctrl_iface_status()
2268 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2269 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2272 u8 *_ssid = ssid->ssid; in wpa_supplicant_ctrl_iface_status()
2273 size_t ssid_len = ssid->ssid_len; in wpa_supplicant_ctrl_iface_status()
2283 ret = os_snprintf(pos, end - pos, "ssid=%s\nid=%d\n", in wpa_supplicant_ctrl_iface_status()
2285 ssid->id); in wpa_supplicant_ctrl_iface_status()
2286 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2287 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2290 if (wps && ssid->passphrase && in wpa_supplicant_ctrl_iface_status()
2291 wpa_key_mgmt_wpa_psk(ssid->key_mgmt) && in wpa_supplicant_ctrl_iface_status()
2292 (ssid->mode == WPAS_MODE_AP || in wpa_supplicant_ctrl_iface_status()
2293 ssid->mode == WPAS_MODE_P2P_GO)) { in wpa_supplicant_ctrl_iface_status()
2294 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2296 ssid->passphrase); in wpa_supplicant_ctrl_iface_status()
2297 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2298 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2301 if (ssid->id_str) { in wpa_supplicant_ctrl_iface_status()
2302 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2304 ssid->id_str); in wpa_supplicant_ctrl_iface_status()
2305 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2306 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2310 switch (ssid->mode) { in wpa_supplicant_ctrl_iface_status()
2312 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2316 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2320 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2324 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2328 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2329 "mode=P2P GO - group " in wpa_supplicant_ctrl_iface_status()
2333 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2340 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2341 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2345 if (wpa_s->connection_set && in wpa_supplicant_ctrl_iface_status()
2346 (wpa_s->connection_ht || wpa_s->connection_vht || in wpa_supplicant_ctrl_iface_status()
2347 wpa_s->connection_he || wpa_s->connection_eht)) { in wpa_supplicant_ctrl_iface_status()
2348 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2350 wpa_s->connection_eht ? 7 : in wpa_supplicant_ctrl_iface_status()
2351 (wpa_s->connection_he ? 6 : in wpa_supplicant_ctrl_iface_status()
2352 (wpa_s->connection_vht ? 5 : 4))); in wpa_supplicant_ctrl_iface_status()
2353 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2354 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2359 if (wpa_s->ap_iface) { in wpa_supplicant_ctrl_iface_status()
2361 end - pos, in wpa_supplicant_ctrl_iface_status()
2365 pos += wpa_sm_get_status(wpa_s->wpa, pos, end - pos, verbose); in wpa_supplicant_ctrl_iface_status()
2369 if (wpa_s->wpa_state >= WPA_ASSOCIATED && in wpa_supplicant_ctrl_iface_status()
2371 !wpa_s->ap_iface && in wpa_supplicant_ctrl_iface_status()
2373 wpa_s->sme.sae.state == SAE_ACCEPTED) { in wpa_supplicant_ctrl_iface_status()
2374 ret = os_snprintf(pos, end - pos, "sae_group=%d\n" in wpa_supplicant_ctrl_iface_status()
2377 wpa_s->sme.sae.group, in wpa_supplicant_ctrl_iface_status()
2378 wpa_s->sme.sae.h2e, in wpa_supplicant_ctrl_iface_status()
2379 wpa_s->sme.sae.pk); in wpa_supplicant_ctrl_iface_status()
2380 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2381 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2386 ret = os_snprintf(pos, end - pos, "wpa_state=%s\n", in wpa_supplicant_ctrl_iface_status()
2387 wpa_supplicant_state_txt(wpa_s->wpa_state)); in wpa_supplicant_ctrl_iface_status()
2388 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2389 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2392 if (wpa_s->l2 && in wpa_supplicant_ctrl_iface_status()
2393 l2_packet_get_ip_addr(wpa_s->l2, tmp, sizeof(tmp)) >= 0) { in wpa_supplicant_ctrl_iface_status()
2394 ret = os_snprintf(pos, end - pos, "ip_address=%s\n", tmp); in wpa_supplicant_ctrl_iface_status()
2395 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2396 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2401 if (wpa_s->global->p2p) { in wpa_supplicant_ctrl_iface_status()
2402 ret = os_snprintf(pos, end - pos, "p2p_device_address=" MACSTR in wpa_supplicant_ctrl_iface_status()
2403 "\n", MAC2STR(wpa_s->global->p2p_dev_addr)); in wpa_supplicant_ctrl_iface_status()
2404 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2405 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2410 ret = os_snprintf(pos, end - pos, "address=" MACSTR "\n", in wpa_supplicant_ctrl_iface_status()
2411 MAC2STR(wpa_s->own_addr)); in wpa_supplicant_ctrl_iface_status()
2412 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2413 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2416 if (wpa_s->valid_links) { in wpa_supplicant_ctrl_iface_status()
2417 ret = os_snprintf(pos, end - pos, "ap_mld_addr=" MACSTR "\n", in wpa_supplicant_ctrl_iface_status()
2418 MAC2STR(wpa_s->ap_mld_addr)); in wpa_supplicant_ctrl_iface_status()
2419 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2420 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2425 if (wpa_s->current_bss && in wpa_supplicant_ctrl_iface_status()
2426 (hs20 = wpa_bss_get_vendor_ie(wpa_s->current_bss, in wpa_supplicant_ctrl_iface_status()
2428 wpa_s->wpa_proto == WPA_PROTO_RSN && in wpa_supplicant_ctrl_iface_status()
2429 wpa_key_mgmt_wpa_ieee8021x(wpa_s->key_mgmt)) { in wpa_supplicant_ctrl_iface_status()
2435 ret = os_snprintf(pos, end - pos, "hs20=%d\n", release); in wpa_supplicant_ctrl_iface_status()
2436 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2437 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2441 if (wpa_s->current_ssid) { in wpa_supplicant_ctrl_iface_status()
2445 for (cred = wpa_s->conf->cred; cred; cred = cred->next) { in wpa_supplicant_ctrl_iface_status()
2448 if (wpa_s->current_ssid->parent_cred != cred) in wpa_supplicant_ctrl_iface_status()
2451 if (cred->provisioning_sp) { in wpa_supplicant_ctrl_iface_status()
2452 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2454 cred->provisioning_sp); in wpa_supplicant_ctrl_iface_status()
2455 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2456 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2460 if (!cred->domain) in wpa_supplicant_ctrl_iface_status()
2464 if (wpa_s->current_bss && wpa_s->current_bss->anqp) { in wpa_supplicant_ctrl_iface_status()
2466 wpa_s->current_bss->anqp->domain_name; in wpa_supplicant_ctrl_iface_status()
2467 for (i = 0; names && i < cred->num_domain; i++) in wpa_supplicant_ctrl_iface_status()
2470 names, cred->domain[i], 1)) in wpa_supplicant_ctrl_iface_status()
2473 if (i == cred->num_domain) in wpa_supplicant_ctrl_iface_status()
2476 ret = os_snprintf(pos, end - pos, "home_sp=%s\n", in wpa_supplicant_ctrl_iface_status()
2477 cred->domain[i]); in wpa_supplicant_ctrl_iface_status()
2478 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2479 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2483 if (wpa_s->current_bss == NULL || in wpa_supplicant_ctrl_iface_status()
2484 wpa_s->current_bss->anqp == NULL) in wpa_supplicant_ctrl_iface_status()
2485 res = -1; in wpa_supplicant_ctrl_iface_status()
2489 wpa_s->current_bss->anqp->domain_name); in wpa_supplicant_ctrl_iface_status()
2497 ret = os_snprintf(pos, end - pos, "sp_type=%s\n", type); in wpa_supplicant_ctrl_iface_status()
2498 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2499 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2507 if (wpa_key_mgmt_wpa_ieee8021x(wpa_s->key_mgmt) || in wpa_supplicant_ctrl_iface_status()
2508 wpa_s->key_mgmt == WPA_KEY_MGMT_IEEE8021X_NO_WPA) { in wpa_supplicant_ctrl_iface_status()
2509 res = eapol_sm_get_status(wpa_s->eapol, pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2516 res = ieee802_1x_kay_get_status(wpa_s->kay, pos, end - pos); in wpa_supplicant_ctrl_iface_status()
2521 sess_id = eapol_sm_get_session_id(wpa_s->eapol, &sess_id_len); in wpa_supplicant_ctrl_iface_status()
2525 ret = os_snprintf(pos, end - pos, "eap_session_id="); in wpa_supplicant_ctrl_iface_status()
2526 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2527 return start - buf; in wpa_supplicant_ctrl_iface_status()
2529 ret = wpa_snprintf_hex(pos, end - pos, sess_id, sess_id_len); in wpa_supplicant_ctrl_iface_status()
2531 return start - buf; in wpa_supplicant_ctrl_iface_status()
2533 ret = os_snprintf(pos, end - pos, "\n"); in wpa_supplicant_ctrl_iface_status()
2534 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2535 return start - buf; in wpa_supplicant_ctrl_iface_status()
2539 res = rsn_preauth_get_status(wpa_s->wpa, pos, end - pos, verbose); in wpa_supplicant_ctrl_iface_status()
2546 uuid_bin2str(wpa_s->wps->uuid, uuid_str, sizeof(uuid_str)); in wpa_supplicant_ctrl_iface_status()
2547 ret = os_snprintf(pos, end - pos, "uuid=%s\n", uuid_str); in wpa_supplicant_ctrl_iface_status()
2548 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2549 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2554 if (wpa_s->ieee80211ac) { in wpa_supplicant_ctrl_iface_status()
2555 ret = os_snprintf(pos, end - pos, "ieee80211ac=1\n"); in wpa_supplicant_ctrl_iface_status()
2556 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2557 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2562 if (wpa_s->sme.bss_max_idle_period) { in wpa_supplicant_ctrl_iface_status()
2563 ret = os_snprintf(pos, end - pos, "bss_max_idle_period=%d\n", in wpa_supplicant_ctrl_iface_status()
2564 wpa_s->sme.bss_max_idle_period); in wpa_supplicant_ctrl_iface_status()
2565 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2566 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2571 if (wpa_s->ssid_verified) { in wpa_supplicant_ctrl_iface_status()
2572 ret = os_snprintf(pos, end - pos, "ssid_verified=1\n"); in wpa_supplicant_ctrl_iface_status()
2573 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2574 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2578 if (wpa_s->bigtk_set) { in wpa_supplicant_ctrl_iface_status()
2579 ret = os_snprintf(pos, end - pos, "bigtk_set=1\n"); in wpa_supplicant_ctrl_iface_status()
2580 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2581 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2589 * events with STATUS-NO_EVENTS. in wpa_supplicant_ctrl_iface_status()
2591 if (os_strcmp(params, "-NO_EVENTS")) { in wpa_supplicant_ctrl_iface_status()
2594 wpa_s->current_ssid ? wpa_s->current_ssid->id : -1, in wpa_supplicant_ctrl_iface_status()
2595 wpa_s->wpa_state, in wpa_supplicant_ctrl_iface_status()
2596 MAC2STR(wpa_s->bssid), in wpa_supplicant_ctrl_iface_status()
2597 wpa_s->current_ssid && wpa_s->current_ssid->ssid ? in wpa_supplicant_ctrl_iface_status()
2598 wpa_ssid_txt(wpa_s->current_ssid->ssid, in wpa_supplicant_ctrl_iface_status()
2599 wpa_s->current_ssid->ssid_len) : ""); in wpa_supplicant_ctrl_iface_status()
2600 if (wpa_s->wpa_state == WPA_COMPLETED) { in wpa_supplicant_ctrl_iface_status()
2601 struct wpa_ssid *ssid = wpa_s->current_ssid; in wpa_supplicant_ctrl_iface_status()
2605 if (wpa_s->valid_links) in wpa_supplicant_ctrl_iface_status()
2608 MAC2STR(wpa_s->ap_mld_addr)); in wpa_supplicant_ctrl_iface_status()
2611 "- connection to " MACSTR in wpa_supplicant_ctrl_iface_status()
2613 MAC2STR(wpa_s->bssid), "(auth)", in wpa_supplicant_ctrl_iface_status()
2614 ssid ? ssid->id : -1, in wpa_supplicant_ctrl_iface_status()
2615 ssid && ssid->id_str ? ssid->id_str : "", in wpa_supplicant_ctrl_iface_status()
2621 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2636 return -1; in wpa_supplicant_ctrl_iface_bssid()
2642 return -1; in wpa_supplicant_ctrl_iface_bssid()
2645 ssid = wpa_config_get_network(wpa_s->conf, id); in wpa_supplicant_ctrl_iface_bssid()
2649 return -1; in wpa_supplicant_ctrl_iface_bssid()
2652 os_memcpy(ssid->bssid, bssid, ETH_ALEN); in wpa_supplicant_ctrl_iface_bssid()
2653 ssid->bssid_set = !is_zero_ether_addr(bssid); in wpa_supplicant_ctrl_iface_bssid()
2672 e = wpa_s->bssid_ignore; in wpa_supplicant_ctrl_iface_bssid_ignore()
2674 ret = os_snprintf(pos, end - pos, MACSTR "\n", in wpa_supplicant_ctrl_iface_bssid_ignore()
2675 MAC2STR(e->bssid)); in wpa_supplicant_ctrl_iface_bssid_ignore()
2676 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_bssid_ignore()
2677 return pos - buf; in wpa_supplicant_ctrl_iface_bssid_ignore()
2679 e = e->next; in wpa_supplicant_ctrl_iface_bssid_ignore()
2681 return pos - buf; in wpa_supplicant_ctrl_iface_bssid_ignore()
2694 return -1; in wpa_supplicant_ctrl_iface_bssid_ignore()
2703 return -1; in wpa_supplicant_ctrl_iface_bssid_ignore()
2706 return -1; in wpa_supplicant_ctrl_iface_bssid_ignore()
2723 ret = os_snprintf(pos, end - pos, "Current level: %s\n" in wpa_supplicant_ctrl_iface_log_level()
2727 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_log_level()
2747 return -1; in wpa_supplicant_ctrl_iface_log_level()
2768 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_list_networks()
2770 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_list_networks()
2771 return pos - buf; in wpa_supplicant_ctrl_iface_list_networks()
2774 ssid = wpa_s->conf->ssid; in wpa_supplicant_ctrl_iface_list_networks()
2779 if (last_id != -1) { in wpa_supplicant_ctrl_iface_list_networks()
2780 while (ssid != NULL && ssid->id <= last_id) { in wpa_supplicant_ctrl_iface_list_networks()
2781 ssid = ssid->next; in wpa_supplicant_ctrl_iface_list_networks()
2788 ret = os_snprintf(pos, end - pos, "%d\t%s", in wpa_supplicant_ctrl_iface_list_networks()
2789 ssid->id, in wpa_supplicant_ctrl_iface_list_networks()
2790 wpa_ssid_txt(ssid->ssid, ssid->ssid_len)); in wpa_supplicant_ctrl_iface_list_networks()
2791 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_list_networks()
2792 return prev - buf; in wpa_supplicant_ctrl_iface_list_networks()
2794 if (ssid->bssid_set) { in wpa_supplicant_ctrl_iface_list_networks()
2795 ret = os_snprintf(pos, end - pos, "\t" MACSTR, in wpa_supplicant_ctrl_iface_list_networks()
2796 MAC2STR(ssid->bssid)); in wpa_supplicant_ctrl_iface_list_networks()
2798 ret = os_snprintf(pos, end - pos, "\tany"); in wpa_supplicant_ctrl_iface_list_networks()
2800 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_list_networks()
2801 return prev - buf; in wpa_supplicant_ctrl_iface_list_networks()
2803 ret = os_snprintf(pos, end - pos, "\t%s%s%s%s", in wpa_supplicant_ctrl_iface_list_networks()
2804 ssid == wpa_s->current_ssid ? in wpa_supplicant_ctrl_iface_list_networks()
2806 ssid->disabled ? "[DISABLED]" : "", in wpa_supplicant_ctrl_iface_list_networks()
2807 ssid->disabled_until.sec ? in wpa_supplicant_ctrl_iface_list_networks()
2808 "[TEMP-DISABLED]" : "", in wpa_supplicant_ctrl_iface_list_networks()
2809 ssid->disabled == 2 ? "[P2P-PERSISTENT]" : in wpa_supplicant_ctrl_iface_list_networks()
2811 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_list_networks()
2812 return prev - buf; in wpa_supplicant_ctrl_iface_list_networks()
2814 ret = os_snprintf(pos, end - pos, "\n"); in wpa_supplicant_ctrl_iface_list_networks()
2815 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_list_networks()
2816 return prev - buf; in wpa_supplicant_ctrl_iface_list_networks()
2819 ssid = ssid->next; in wpa_supplicant_ctrl_iface_list_networks()
2822 return pos - buf; in wpa_supplicant_ctrl_iface_list_networks()
2829 ret = os_snprintf(pos, end - pos, "-"); in wpa_supplicant_cipher_txt()
2830 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_cipher_txt()
2848 ret = os_snprintf(pos, end - pos, "[%s-", proto); in wpa_supplicant_ie_txt()
2849 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2854 ret = os_snprintf(pos, end - pos, "?]"); in wpa_supplicant_ie_txt()
2855 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2863 ret = os_snprintf(pos, end - pos, "%sEAP", in wpa_supplicant_ie_txt()
2865 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2870 ret = os_snprintf(pos, end - pos, "%sPSK", in wpa_supplicant_ie_txt()
2872 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2877 ret = os_snprintf(pos, end - pos, "%sNone", in wpa_supplicant_ie_txt()
2879 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2884 ret = os_snprintf(pos, end - pos, "%sSAE", in wpa_supplicant_ie_txt()
2886 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2891 ret = os_snprintf(pos, end - pos, "%sSAE-EXT-KEY", in wpa_supplicant_ie_txt()
2893 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2899 ret = os_snprintf(pos, end - pos, "%sFT/EAP", in wpa_supplicant_ie_txt()
2901 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2906 ret = os_snprintf(pos, end - pos, "%sFT/PSK", in wpa_supplicant_ie_txt()
2908 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2913 ret = os_snprintf(pos, end - pos, "%sFT/SAE", in wpa_supplicant_ie_txt()
2915 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2920 ret = os_snprintf(pos, end - pos, "%sFT/SAE-EXT-KEY", in wpa_supplicant_ie_txt()
2922 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2928 ret = os_snprintf(pos, end - pos, "%sEAP-SHA256", in wpa_supplicant_ie_txt()
2930 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2935 ret = os_snprintf(pos, end - pos, "%sPSK-SHA256", in wpa_supplicant_ie_txt()
2937 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2944 ret = os_snprintf(pos, end - pos, "%sEAP-SUITE-B", in wpa_supplicant_ie_txt()
2946 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2954 ret = os_snprintf(pos, end - pos, "%sEAP-SUITE-B-192", in wpa_supplicant_ie_txt()
2956 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2964 ret = os_snprintf(pos, end - pos, "%sFILS-SHA256", in wpa_supplicant_ie_txt()
2966 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2971 ret = os_snprintf(pos, end - pos, "%sFILS-SHA384", in wpa_supplicant_ie_txt()
2973 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2979 ret = os_snprintf(pos, end - pos, "%sFT-FILS-SHA256", in wpa_supplicant_ie_txt()
2981 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2986 ret = os_snprintf(pos, end - pos, "%sFT-FILS-SHA384", in wpa_supplicant_ie_txt()
2988 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2997 ret = os_snprintf(pos, end - pos, "%sOWE", in wpa_supplicant_ie_txt()
2999 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
3007 ret = os_snprintf(pos, end - pos, "%sDPP", in wpa_supplicant_ie_txt()
3009 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
3016 ret = os_snprintf(pos, end - pos, "%sOSEN", in wpa_supplicant_ie_txt()
3018 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
3025 ret = os_snprintf(pos, end - pos, "%sEAP-SHA384", in wpa_supplicant_ie_txt()
3027 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
3036 ret = os_snprintf(pos, end - pos, "-preauth"); in wpa_supplicant_ie_txt()
3037 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
3042 ret = os_snprintf(pos, end - pos, "]"); in wpa_supplicant_ie_txt()
3043 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
3062 txt = "[WPS-PBC]"; in wpa_supplicant_wps_ie_txt_buf()
3063 else if (wps_is_addr_authorized(wps_ie, wpa_s->own_addr, 0)) in wpa_supplicant_wps_ie_txt_buf()
3064 txt = "[WPS-AUTH]"; in wpa_supplicant_wps_ie_txt_buf()
3066 txt = "[WPS-PIN]"; in wpa_supplicant_wps_ie_txt_buf()
3070 ret = os_snprintf(pos, end - pos, "%s", txt); in wpa_supplicant_wps_ie_txt_buf()
3071 if (!os_snprintf_error(end - pos, ret)) in wpa_supplicant_wps_ie_txt_buf()
3106 if (p2p && bss->ssid_len == P2P_WILDCARD_SSID_LEN && in wpa_supplicant_ctrl_iface_scan_result()
3107 os_memcmp(bss->ssid, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN) == in wpa_supplicant_ctrl_iface_scan_result()
3114 ret = os_snprintf(pos, end - pos, MACSTR "\t%d\t%d\t", in wpa_supplicant_ctrl_iface_scan_result()
3115 MAC2STR(bss->bssid), bss->freq, bss->level); in wpa_supplicant_ctrl_iface_scan_result()
3116 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3117 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3129 ret = os_snprintf(pos, end - pos, "[SAE-H2E]"); in wpa_supplicant_ctrl_iface_scan_result()
3130 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3131 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3135 ret = os_snprintf(pos, end - pos, "[SAE-PK]"); in wpa_supplicant_ctrl_iface_scan_result()
3136 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3137 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3146 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_scan_result()
3147 ie2 ? "[OWE-TRANS]" : "[OWE-TRANS-OPEN]"); in wpa_supplicant_ctrl_iface_scan_result()
3148 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3149 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3153 if (!ie && !ie2 && !osen_ie && (bss->caps & IEEE80211_CAP_PRIVACY)) { in wpa_supplicant_ctrl_iface_scan_result()
3154 ret = os_snprintf(pos, end - pos, "[WEP]"); in wpa_supplicant_ctrl_iface_scan_result()
3155 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3156 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3160 ret = os_snprintf(pos, end - pos, "[MESH]"); in wpa_supplicant_ctrl_iface_scan_result()
3161 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3162 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3169 ret = os_snprintf(pos, end - pos, "[EDMG]"); in wpa_supplicant_ctrl_iface_scan_result()
3170 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3171 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3175 ret = os_snprintf(pos, end - pos, "[DMG]"); in wpa_supplicant_ctrl_iface_scan_result()
3176 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3177 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3179 switch (bss->caps & IEEE80211_CAP_DMG_MASK) { in wpa_supplicant_ctrl_iface_scan_result()
3193 ret = os_snprintf(pos, end - pos, "%s", s); in wpa_supplicant_ctrl_iface_scan_result()
3194 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3195 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3198 if (bss->caps & IEEE80211_CAP_IBSS) { in wpa_supplicant_ctrl_iface_scan_result()
3199 ret = os_snprintf(pos, end - pos, "[IBSS]"); in wpa_supplicant_ctrl_iface_scan_result()
3200 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3201 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3204 if (bss->caps & IEEE80211_CAP_ESS) { in wpa_supplicant_ctrl_iface_scan_result()
3205 ret = os_snprintf(pos, end - pos, "[ESS]"); in wpa_supplicant_ctrl_iface_scan_result()
3206 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3207 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3212 ret = os_snprintf(pos, end - pos, "[P2P]"); in wpa_supplicant_ctrl_iface_scan_result()
3213 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3214 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3219 ret = os_snprintf(pos, end - pos, "[HS20]"); in wpa_supplicant_ctrl_iface_scan_result()
3220 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3221 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3227 ret = os_snprintf(pos, end - pos, "[FILS]"); in wpa_supplicant_ctrl_iface_scan_result()
3228 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3229 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3235 ret = os_snprintf(pos, end - pos, "[FST]"); in wpa_supplicant_ctrl_iface_scan_result()
3236 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3237 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3242 ret = os_snprintf(pos, end - pos, "[UTF-8]"); in wpa_supplicant_ctrl_iface_scan_result()
3243 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3244 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3248 ret = os_snprintf(pos, end - pos, "\t%s", in wpa_supplicant_ctrl_iface_scan_result()
3249 wpa_ssid_txt(bss->ssid, bss->ssid_len)); in wpa_supplicant_ctrl_iface_scan_result()
3250 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3251 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3254 ret = os_snprintf(pos, end - pos, "\n"); in wpa_supplicant_ctrl_iface_scan_result()
3255 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3256 return -1; in wpa_supplicant_ctrl_iface_scan_result()
3259 return pos - buf; in wpa_supplicant_ctrl_iface_scan_result()
3272 ret = os_snprintf(pos, end - pos, "bssid / frequency / signal level / " in wpa_supplicant_ctrl_iface_scan_results()
3274 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_results()
3275 return pos - buf; in wpa_supplicant_ctrl_iface_scan_results()
3278 dl_list_for_each(bss, &wpa_s->bss_id, struct wpa_bss, list_id) { in wpa_supplicant_ctrl_iface_scan_results()
3280 end - pos); in wpa_supplicant_ctrl_iface_scan_results()
3281 if (ret < 0 || ret >= end - pos) in wpa_supplicant_ctrl_iface_scan_results()
3282 return pos - buf; in wpa_supplicant_ctrl_iface_scan_results()
3286 return pos - buf; in wpa_supplicant_ctrl_iface_scan_results()
3306 return -1; in wpa_supplicant_ctrl_iface_mesh_interface_add()
3322 ssid = wpa_config_get_network(wpa_s->conf, id); in wpa_supplicant_ctrl_iface_mesh_group_add()
3326 return -1; in wpa_supplicant_ctrl_iface_mesh_group_add()
3328 if (ssid->mode != WPAS_MODE_MESH) { in wpa_supplicant_ctrl_iface_mesh_group_add()
3331 return -1; in wpa_supplicant_ctrl_iface_mesh_group_add()
3333 if (ssid->key_mgmt != WPA_KEY_MGMT_NONE && in wpa_supplicant_ctrl_iface_mesh_group_add()
3334 ssid->key_mgmt != WPA_KEY_MGMT_SAE && in wpa_supplicant_ctrl_iface_mesh_group_add()
3335 ssid->key_mgmt != WPA_KEY_MGMT_SAE_EXT_KEY) { in wpa_supplicant_ctrl_iface_mesh_group_add()
3338 return -1; in wpa_supplicant_ctrl_iface_mesh_group_add()
3360 global = wpa_s->global; in wpa_supplicant_ctrl_iface_mesh_group_remove()
3363 for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) { in wpa_supplicant_ctrl_iface_mesh_group_remove()
3364 if (os_strcmp(wpa_s->ifname, cmd) == 0) { in wpa_supplicant_ctrl_iface_mesh_group_remove()
3373 return -1; in wpa_supplicant_ctrl_iface_mesh_group_remove()
3375 if (wpa_s->mesh_if_created && wpa_s == orig) { in wpa_supplicant_ctrl_iface_mesh_group_remove()
3378 return -1; in wpa_supplicant_ctrl_iface_mesh_group_remove()
3381 wpa_s->reassociate = 0; in wpa_supplicant_ctrl_iface_mesh_group_remove()
3382 wpa_s->disconnected = 1; in wpa_supplicant_ctrl_iface_mesh_group_remove()
3392 if (wpa_s->mesh_if_created) in wpa_supplicant_ctrl_iface_mesh_group_remove()
3405 return -1; in wpa_supplicant_ctrl_iface_mesh_peer_remove()
3423 duration = -1; in wpa_supplicant_ctrl_iface_mesh_peer_add()
3427 return -1; in wpa_supplicant_ctrl_iface_mesh_peer_add()
3441 int ret = -1; in wpa_supplicant_ctrl_iface_mesh_link_probe()
3444 return -1; in wpa_supplicant_ctrl_iface_mesh_link_probe()
3451 return -1; in wpa_supplicant_ctrl_iface_mesh_link_probe()
3459 return -1; in wpa_supplicant_ctrl_iface_mesh_link_probe()
3462 os_memcpy(eth->ether_dhost, addr, ETH_ALEN); in wpa_supplicant_ctrl_iface_mesh_link_probe()
3463 os_memcpy(eth->ether_shost, wpa_s->own_addr, ETH_ALEN); in wpa_supplicant_ctrl_iface_mesh_link_probe()
3464 eth->ether_type = htons(ETH_P_802_3); in wpa_supplicant_ctrl_iface_mesh_link_probe()
3472 return -ret; in wpa_supplicant_ctrl_iface_mesh_link_probe()
3493 ssid = wpa_config_get_network(wpa_s->conf, id); in wpa_supplicant_ctrl_iface_select_network()
3497 return -1; in wpa_supplicant_ctrl_iface_select_network()
3499 if (ssid->disabled == 2) { in wpa_supplicant_ctrl_iface_select_network()
3502 return -1; in wpa_supplicant_ctrl_iface_select_network()
3510 os_free(wpa_s->select_network_scan_freqs); in wpa_supplicant_ctrl_iface_select_network()
3511 wpa_s->select_network_scan_freqs = freqs; in wpa_supplicant_ctrl_iface_select_network()
3515 wpa_s->scan_min_time.sec = 0; in wpa_supplicant_ctrl_iface_select_network()
3516 wpa_s->scan_min_time.usec = 0; in wpa_supplicant_ctrl_iface_select_network()
3537 ssid = wpa_config_get_network(wpa_s->conf, id); in wpa_supplicant_ctrl_iface_enable_network()
3541 return -1; in wpa_supplicant_ctrl_iface_enable_network()
3543 if (ssid->disabled == 2) { in wpa_supplicant_ctrl_iface_enable_network()
3546 return -1; in wpa_supplicant_ctrl_iface_enable_network()
3549 if (os_strstr(cmd, " no-connect")) { in wpa_supplicant_ctrl_iface_enable_network()
3550 ssid->disabled = 0; in wpa_supplicant_ctrl_iface_enable_network()
3554 wpa_s->scan_min_time.sec = 0; in wpa_supplicant_ctrl_iface_enable_network()
3555 wpa_s->scan_min_time.usec = 0; in wpa_supplicant_ctrl_iface_enable_network()
3576 ssid = wpa_config_get_network(wpa_s->conf, id); in wpa_supplicant_ctrl_iface_disable_network()
3580 return -1; in wpa_supplicant_ctrl_iface_disable_network()
3582 if (ssid->disabled == 2) { in wpa_supplicant_ctrl_iface_disable_network()
3586 return -1; in wpa_supplicant_ctrl_iface_disable_network()
3605 return -1; in wpa_supplicant_ctrl_iface_add_network()
3607 ret = os_snprintf(buf, buflen, "%d\n", ssid->id); in wpa_supplicant_ctrl_iface_add_network()
3609 return -1; in wpa_supplicant_ctrl_iface_add_network()
3630 if (result == -1) { in wpa_supplicant_ctrl_iface_remove_network()
3633 return -1; in wpa_supplicant_ctrl_iface_remove_network()
3635 if (result == -2) { in wpa_supplicant_ctrl_iface_remove_network()
3638 return -1; in wpa_supplicant_ctrl_iface_remove_network()
3654 return -1; in wpa_supplicant_ctrl_iface_update_network()
3666 if (wpa_s->current_ssid == ssid && in wpa_supplicant_ctrl_iface_update_network()
3667 wpa_s->wpa_state == WPA_COMPLETED) in wpa_supplicant_ctrl_iface_update_network()
3677 wpa_sm_pmksa_cache_flush(wpa_s->wpa, ssid); in wpa_supplicant_ctrl_iface_update_network()
3679 if (wpa_s->current_ssid == ssid || in wpa_supplicant_ctrl_iface_update_network()
3680 wpa_s->current_ssid == NULL) { in wpa_supplicant_ctrl_iface_update_network()
3685 eapol_sm_invalidate_cached_session(wpa_s->eapol); in wpa_supplicant_ctrl_iface_update_network()
3690 value[0] == '"' && ssid->ssid_len) || in wpa_supplicant_ctrl_iface_update_network()
3691 (os_strcmp(name, "ssid") == 0 && ssid->passphrase)) in wpa_supplicant_ctrl_iface_update_network()
3694 wpa_config_update_prio_list(wpa_s->conf); in wpa_supplicant_ctrl_iface_update_network()
3711 return -1; in wpa_supplicant_ctrl_iface_set_network()
3716 return -1; in wpa_supplicant_ctrl_iface_set_network()
3725 ssid = wpa_config_get_network(wpa_s->conf, id); in wpa_supplicant_ctrl_iface_set_network()
3729 return -1; in wpa_supplicant_ctrl_iface_set_network()
3732 prev_bssid_set = ssid->bssid_set; in wpa_supplicant_ctrl_iface_set_network()
3733 prev_disabled = ssid->disabled; in wpa_supplicant_ctrl_iface_set_network()
3734 os_memcpy(prev_bssid, ssid->bssid, ETH_ALEN); in wpa_supplicant_ctrl_iface_set_network()
3738 (ssid->bssid_set != prev_bssid_set || in wpa_supplicant_ctrl_iface_set_network()
3739 !ether_addr_equal(ssid->bssid, prev_bssid))) in wpa_supplicant_ctrl_iface_set_network()
3742 if (prev_disabled != ssid->disabled && in wpa_supplicant_ctrl_iface_set_network()
3743 (prev_disabled == 2 || ssid->disabled == 2)) in wpa_supplicant_ctrl_iface_set_network()
3761 return -1; in wpa_supplicant_ctrl_iface_get_network()
3768 ssid = wpa_config_get_network(wpa_s->conf, id); in wpa_supplicant_ctrl_iface_get_network()
3772 return -1; in wpa_supplicant_ctrl_iface_get_network()
3779 return -1; in wpa_supplicant_ctrl_iface_get_network()
3785 return -1; in wpa_supplicant_ctrl_iface_get_network()
3805 return -1; in wpa_supplicant_ctrl_iface_dup_network()
3810 return -1; in wpa_supplicant_ctrl_iface_dup_network()
3817 "CTRL_IFACE: DUP_NETWORK ifname=%s->%s id=%d->%d name='%s'", in wpa_supplicant_ctrl_iface_dup_network()
3818 wpa_s->ifname, dst_wpa_s->ifname, id_s, id_d, name); in wpa_supplicant_ctrl_iface_dup_network()
3820 ssid_s = wpa_config_get_network(wpa_s->conf, id_s); in wpa_supplicant_ctrl_iface_dup_network()
3824 return -1; in wpa_supplicant_ctrl_iface_dup_network()
3827 ssid_d = wpa_config_get_network(dst_wpa_s->conf, id_d); in wpa_supplicant_ctrl_iface_dup_network()
3831 return -1; in wpa_supplicant_ctrl_iface_dup_network()
3838 return -1; in wpa_supplicant_ctrl_iface_dup_network()
3859 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_list_creds()
3861 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_list_creds()
3862 return pos - buf; in wpa_supplicant_ctrl_iface_list_creds()
3865 cred = wpa_s->conf->cred; in wpa_supplicant_ctrl_iface_list_creds()
3867 ret = os_snprintf(pos, end - pos, "%d\t%s\t%s\t%s\t%s\n", in wpa_supplicant_ctrl_iface_list_creds()
3868 cred->id, cred->realm ? cred->realm : "", in wpa_supplicant_ctrl_iface_list_creds()
3869 cred->username ? cred->username : "", in wpa_supplicant_ctrl_iface_list_creds()
3870 cred->domain ? cred->domain[0] : "", in wpa_supplicant_ctrl_iface_list_creds()
3871 cred->imsi ? cred->imsi : ""); in wpa_supplicant_ctrl_iface_list_creds()
3872 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_list_creds()
3873 return pos - buf; in wpa_supplicant_ctrl_iface_list_creds()
3876 cred = cred->next; in wpa_supplicant_ctrl_iface_list_creds()
3879 return pos - buf; in wpa_supplicant_ctrl_iface_list_creds()
3891 cred = wpa_config_add_cred(wpa_s->conf); in wpa_supplicant_ctrl_iface_add_cred()
3893 return -1; in wpa_supplicant_ctrl_iface_add_cred()
3895 wpa_msg(wpa_s, MSG_INFO, CRED_ADDED "%d", cred->id); in wpa_supplicant_ctrl_iface_add_cred()
3897 ret = os_snprintf(buf, buflen, "%d\n", cred->id); in wpa_supplicant_ctrl_iface_add_cred()
3899 return -1; in wpa_supplicant_ctrl_iface_add_cred()
3920 cred = wpa_s->conf->cred; in wpa_supplicant_ctrl_iface_remove_cred()
3923 cred = cred->next; in wpa_supplicant_ctrl_iface_remove_cred()
3924 if (prev->domain) { in wpa_supplicant_ctrl_iface_remove_cred()
3926 for (i = 0; i < prev->num_domain; i++) { in wpa_supplicant_ctrl_iface_remove_cred()
3927 if (os_strcmp(prev->domain[i], cmd + 8) in wpa_supplicant_ctrl_iface_remove_cred()
3941 cred = wpa_s->conf->cred; in wpa_supplicant_ctrl_iface_remove_cred()
3944 cred = cred->next; in wpa_supplicant_ctrl_iface_remove_cred()
3945 if (prev->provisioning_sp && in wpa_supplicant_ctrl_iface_remove_cred()
3946 os_strcmp(prev->provisioning_sp, cmd + 16) == 0) in wpa_supplicant_ctrl_iface_remove_cred()
3955 cred = wpa_config_get_cred(wpa_s->conf, id); in wpa_supplicant_ctrl_iface_remove_cred()
3970 return -1; in wpa_supplicant_ctrl_iface_set_cred()
3975 return -1; in wpa_supplicant_ctrl_iface_set_cred()
3984 cred = wpa_config_get_cred(wpa_s->conf, id); in wpa_supplicant_ctrl_iface_set_cred()
3988 return -1; in wpa_supplicant_ctrl_iface_set_cred()
3994 return -1; in wpa_supplicant_ctrl_iface_set_cred()
3997 wpa_msg(wpa_s, MSG_INFO, CRED_MODIFIED "%d %s", cred->id, name); in wpa_supplicant_ctrl_iface_set_cred()
4015 return -1; in wpa_supplicant_ctrl_iface_get_cred()
4022 cred = wpa_config_get_cred(wpa_s->conf, id); in wpa_supplicant_ctrl_iface_get_cred()
4026 return -1; in wpa_supplicant_ctrl_iface_get_cred()
4033 return -1; in wpa_supplicant_ctrl_iface_get_cred()
4039 return -1; in wpa_supplicant_ctrl_iface_get_cred()
4053 if (!wpa_s->conf->update_config) { in wpa_supplicant_ctrl_iface_save_config()
4054 wpa_printf(MSG_DEBUG, "CTRL_IFACE: SAVE_CONFIG - Not allowed " in wpa_supplicant_ctrl_iface_save_config()
4056 return -1; in wpa_supplicant_ctrl_iface_save_config()
4059 ret = wpa_config_write(wpa_s->confname, wpa_s->conf); in wpa_supplicant_ctrl_iface_save_config()
4061 wpa_printf(MSG_DEBUG, "CTRL_IFACE: SAVE_CONFIG - Failed to " in wpa_supplicant_ctrl_iface_save_config()
4064 wpa_printf(MSG_DEBUG, "CTRL_IFACE: SAVE_CONFIG - Configuration" in wpa_supplicant_ctrl_iface_save_config()
4080 { WPA_DRIVER_CAPA_ENC_CCMP_256, "CCMP-256", 0 },
4081 { WPA_DRIVER_CAPA_ENC_GCMP_256, "GCMP-256", 0 },
4095 { WPA_DRIVER_CAPA_ENC_BIP, "AES-128-CMAC", 1 },
4096 { WPA_DRIVER_CAPA_ENC_BIP_GMAC_128, "BIP-GMAC-128", 1 },
4097 { WPA_DRIVER_CAPA_ENC_BIP_GMAC_256, "BIP-GMAC-256", 1 },
4098 { WPA_DRIVER_CAPA_ENC_BIP_CMAC_256, "BIP-CMAC-256", 1 },
4123 return -1; in ctrl_iface_get_capability_pairwise()
4128 if (!ciphers[i].group_only && capa->enc & ciphers[i].capa) { in ctrl_iface_get_capability_pairwise()
4129 ret = os_snprintf(pos, end - pos, "%s%s", in ctrl_iface_get_capability_pairwise()
4132 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_pairwise()
4133 return pos - buf; in ctrl_iface_get_capability_pairwise()
4138 return pos - buf; in ctrl_iface_get_capability_pairwise()
4171 return -1; in ctrl_iface_get_capability_group()
4176 if (capa->enc & ciphers[i].capa) { in ctrl_iface_get_capability_group()
4177 ret = os_snprintf(pos, end - pos, "%s%s", in ctrl_iface_get_capability_group()
4180 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_group()
4181 return pos - buf; in ctrl_iface_get_capability_group()
4186 return pos - buf; in ctrl_iface_get_capability_group()
4205 if (capa->enc & ciphers_group_mgmt[i].capa) { in ctrl_iface_get_capability_group_mgmt()
4206 ret = os_snprintf(pos, end - pos, "%s%s", in ctrl_iface_get_capability_group_mgmt()
4209 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_group_mgmt()
4210 return pos - buf; in ctrl_iface_get_capability_group_mgmt()
4215 return pos - buf; in ctrl_iface_get_capability_group_mgmt()
4271 len = os_strlcpy(buf, "WPA-PSK WPA-EAP IEEE8021X WPA-NONE " in ctrl_iface_get_capability_key_mgmt()
4274 return -1; in ctrl_iface_get_capability_key_mgmt()
4283 return -1; in ctrl_iface_get_capability_key_mgmt()
4284 key_mgmt = capa->key_mgmt_iftype[iftype]; in ctrl_iface_get_capability_key_mgmt()
4286 key_mgmt = capa->key_mgmt; in ctrl_iface_get_capability_key_mgmt()
4289 ret = os_snprintf(pos, end - pos, "NONE IEEE8021X"); in ctrl_iface_get_capability_key_mgmt()
4290 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4291 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4296 ret = os_snprintf(pos, end - pos, " WPA-EAP"); in ctrl_iface_get_capability_key_mgmt()
4297 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4298 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4304 ret = os_snprintf(pos, end - pos, " WPA-PSK"); in ctrl_iface_get_capability_key_mgmt()
4305 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4306 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4311 ret = os_snprintf(pos, end - pos, " WPA-NONE"); in ctrl_iface_get_capability_key_mgmt()
4312 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4313 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4318 ret = os_snprintf(pos, end - pos, " WAPI-PSK"); in ctrl_iface_get_capability_key_mgmt()
4319 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4320 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4325 ret = os_snprintf(pos, end - pos, " TPK-HANDSHAKE"); in ctrl_iface_get_capability_key_mgmt()
4326 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4327 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4332 ret = os_snprintf(pos, end - pos, " CCKM"); in ctrl_iface_get_capability_key_mgmt()
4333 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4334 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4340 ret = os_snprintf(pos, end - pos, " WPA-EAP-SUITE-B"); in ctrl_iface_get_capability_key_mgmt()
4341 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4342 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4348 ret = os_snprintf(pos, end - pos, " WPA-EAP-SUITE-B-192"); in ctrl_iface_get_capability_key_mgmt()
4349 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4350 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4356 ret = os_snprintf(pos, end - pos, " OWE"); in ctrl_iface_get_capability_key_mgmt()
4357 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4358 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4364 ret = os_snprintf(pos, end - pos, " DPP"); in ctrl_iface_get_capability_key_mgmt()
4365 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4366 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4372 ret = os_snprintf(pos, end - pos, " FILS-SHA256"); in ctrl_iface_get_capability_key_mgmt()
4373 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4374 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4378 ret = os_snprintf(pos, end - pos, " FILS-SHA384"); in ctrl_iface_get_capability_key_mgmt()
4379 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4380 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4385 ret = os_snprintf(pos, end - pos, " FT-FILS-SHA256"); in ctrl_iface_get_capability_key_mgmt()
4386 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4387 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4391 ret = os_snprintf(pos, end - pos, " FT-FILS-SHA384"); in ctrl_iface_get_capability_key_mgmt()
4392 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4393 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4400 ret = os_snprintf(pos, end - pos, " FT-PSK"); in ctrl_iface_get_capability_key_mgmt()
4401 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4402 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4406 ret = os_snprintf(pos, end - pos, " FT-EAP"); in ctrl_iface_get_capability_key_mgmt()
4407 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4408 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4413 ret = os_snprintf(pos, end - pos, " FT-SAE"); in ctrl_iface_get_capability_key_mgmt()
4414 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4415 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4419 ret = os_snprintf(pos, end - pos, " FT-SAE-EXT-KEY"); in ctrl_iface_get_capability_key_mgmt()
4420 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4421 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4427 ret = os_snprintf(pos, end - pos, " FT-EAP-SHA384"); in ctrl_iface_get_capability_key_mgmt()
4428 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4429 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4436 ret = os_snprintf(pos, end - pos, " SAE"); in ctrl_iface_get_capability_key_mgmt()
4437 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4438 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4442 ret = os_snprintf(pos, end - pos, " SAE-EXT-KEY"); in ctrl_iface_get_capability_key_mgmt()
4443 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4444 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4450 ret = os_snprintf(pos, end - pos, " WPA-EAP-SHA256"); in ctrl_iface_get_capability_key_mgmt()
4451 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4452 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4457 ret = os_snprintf(pos, end - pos, " WPA-PSK-SHA256"); in ctrl_iface_get_capability_key_mgmt()
4458 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4459 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4465 ret = os_snprintf(pos, end - pos, " OSEN"); in ctrl_iface_get_capability_key_mgmt()
4466 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4467 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4472 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4492 return -1; in ctrl_iface_get_capability_proto()
4496 if (capa->key_mgmt & (WPA_DRIVER_CAPA_KEY_MGMT_WPA2 | in ctrl_iface_get_capability_proto()
4498 ret = os_snprintf(pos, end - pos, "%sRSN", in ctrl_iface_get_capability_proto()
4500 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_proto()
4501 return pos - buf; in ctrl_iface_get_capability_proto()
4505 if (capa->key_mgmt & (WPA_DRIVER_CAPA_KEY_MGMT_WPA | in ctrl_iface_get_capability_proto()
4507 ret = os_snprintf(pos, end - pos, "%sWPA", in ctrl_iface_get_capability_proto()
4509 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_proto()
4510 return pos - buf; in ctrl_iface_get_capability_proto()
4514 return pos - buf; in ctrl_iface_get_capability_proto()
4535 return -1; in ctrl_iface_get_capability_auth_alg()
4539 if (capa->auth & (WPA_DRIVER_AUTH_OPEN)) { in ctrl_iface_get_capability_auth_alg()
4540 ret = os_snprintf(pos, end - pos, "%sOPEN", in ctrl_iface_get_capability_auth_alg()
4542 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_auth_alg()
4543 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4547 if (capa->auth & (WPA_DRIVER_AUTH_SHARED)) { in ctrl_iface_get_capability_auth_alg()
4548 ret = os_snprintf(pos, end - pos, "%sSHARED", in ctrl_iface_get_capability_auth_alg()
4550 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_auth_alg()
4551 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4555 if (capa->auth & (WPA_DRIVER_AUTH_LEAP)) { in ctrl_iface_get_capability_auth_alg()
4556 ret = os_snprintf(pos, end - pos, "%sLEAP", in ctrl_iface_get_capability_auth_alg()
4558 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_auth_alg()
4559 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4564 if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SAE) { in ctrl_iface_get_capability_auth_alg()
4565 ret = os_snprintf(pos, end - pos, "%sSAE", in ctrl_iface_get_capability_auth_alg()
4567 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_auth_alg()
4568 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4575 ret = os_snprintf(pos, end - pos, "%sFILS_SK_WITHOUT_PFS", in ctrl_iface_get_capability_auth_alg()
4577 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_auth_alg()
4578 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4584 ret = os_snprintf(pos, end - pos, "%sFILS_SK_WITH_PFS", in ctrl_iface_get_capability_auth_alg()
4586 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_auth_alg()
4587 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4594 ret = os_snprintf(pos, end - pos, "%sPASN", in ctrl_iface_get_capability_auth_alg()
4596 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_auth_alg()
4597 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4602 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4622 return -1; in ctrl_iface_get_capability_modes()
4626 if (capa->flags & WPA_DRIVER_FLAGS_IBSS) { in ctrl_iface_get_capability_modes()
4627 ret = os_snprintf(pos, end - pos, "%sIBSS", in ctrl_iface_get_capability_modes()
4629 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_modes()
4630 return pos - buf; in ctrl_iface_get_capability_modes()
4634 if (capa->flags & WPA_DRIVER_FLAGS_AP) { in ctrl_iface_get_capability_modes()
4635 ret = os_snprintf(pos, end - pos, "%sAP", in ctrl_iface_get_capability_modes()
4637 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_modes()
4638 return pos - buf; in ctrl_iface_get_capability_modes()
4643 if (capa->flags & WPA_DRIVER_FLAGS_MESH) { in ctrl_iface_get_capability_modes()
4644 ret = os_snprintf(pos, end - pos, "%sMESH", in ctrl_iface_get_capability_modes()
4646 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_modes()
4647 return pos - buf; in ctrl_iface_get_capability_modes()
4652 return pos - buf; in ctrl_iface_get_capability_modes()
4666 for (j = 0; j < wpa_s->hw.num_modes; j++) { in ctrl_iface_get_capability_channels()
4667 switch (wpa_s->hw.modes[j].mode) { in ctrl_iface_get_capability_channels()
4683 ret = os_snprintf(pos, end - pos, "Mode[%s] Channels:", hmode); in ctrl_iface_get_capability_channels()
4684 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_channels()
4685 return pos - buf; in ctrl_iface_get_capability_channels()
4687 chnl = wpa_s->hw.modes[j].channels; in ctrl_iface_get_capability_channels()
4688 for (i = 0; i < wpa_s->hw.modes[j].num_channels; i++) { in ctrl_iface_get_capability_channels()
4691 ret = os_snprintf(pos, end - pos, " %d", chnl[i].chan); in ctrl_iface_get_capability_channels()
4692 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_channels()
4693 return pos - buf; in ctrl_iface_get_capability_channels()
4696 ret = os_snprintf(pos, end - pos, "\n"); in ctrl_iface_get_capability_channels()
4697 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_channels()
4698 return pos - buf; in ctrl_iface_get_capability_channels()
4702 return pos - buf; in ctrl_iface_get_capability_channels()
4716 for (j = 0; j < wpa_s->hw.num_modes; j++) { in ctrl_iface_get_capability_freq()
4717 switch (wpa_s->hw.modes[j].mode) { in ctrl_iface_get_capability_freq()
4733 ret = os_snprintf(pos, end - pos, "Mode[%s] Channels:\n", in ctrl_iface_get_capability_freq()
4735 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_freq()
4736 return pos - buf; in ctrl_iface_get_capability_freq()
4738 chnl = wpa_s->hw.modes[j].channels; in ctrl_iface_get_capability_freq()
4739 for (i = 0; i < wpa_s->hw.modes[j].num_channels; i++) { in ctrl_iface_get_capability_freq()
4742 ret = os_snprintf(pos, end - pos, " %d = %d MHz%s%s\n", in ctrl_iface_get_capability_freq()
4749 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_freq()
4750 return pos - buf; in ctrl_iface_get_capability_freq()
4753 ret = os_snprintf(pos, end - pos, "\n"); in ctrl_iface_get_capability_freq()
4754 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_freq()
4755 return pos - buf; in ctrl_iface_get_capability_freq()
4759 return pos - buf; in ctrl_iface_get_capability_freq()
4777 return -1; in wpa_supplicant_ctrl_iface_get_capability()
4793 return -1; in wpa_supplicant_ctrl_iface_get_capability()
4849 return -1; in wpa_supplicant_ctrl_iface_get_capability()
4858 return -1; in wpa_supplicant_ctrl_iface_get_capability()
4867 return -1; in wpa_supplicant_ctrl_iface_get_capability()
4877 res = os_snprintf(buf, buflen, "FILS FILS-SK-PFS"); in wpa_supplicant_ctrl_iface_get_capability()
4879 return -1; in wpa_supplicant_ctrl_iface_get_capability()
4887 return -1; in wpa_supplicant_ctrl_iface_get_capability()
4893 if (os_strcmp(field, "multibss") == 0 && wpa_s->multi_bss_support) { in wpa_supplicant_ctrl_iface_get_capability()
4894 res = os_snprintf(buf, buflen, "MULTIBSS-STA"); in wpa_supplicant_ctrl_iface_get_capability()
4896 return -1; in wpa_supplicant_ctrl_iface_get_capability()
4910 return -1; in wpa_supplicant_ctrl_iface_get_capability()
4919 return -1; in wpa_supplicant_ctrl_iface_get_capability()
4926 (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SAE)) { in wpa_supplicant_ctrl_iface_get_capability()
4933 return -1; in wpa_supplicant_ctrl_iface_get_capability()
4940 if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) || in wpa_supplicant_ctrl_iface_get_capability()
4941 (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_OCV)) in wpa_supplicant_ctrl_iface_get_capability()
4946 return -1; in wpa_supplicant_ctrl_iface_get_capability()
4952 if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_BEACON_PROTECTION) || in wpa_supplicant_ctrl_iface_get_capability()
4953 (wpa_s->drv_flags2 & in wpa_supplicant_ctrl_iface_get_capability()
4959 return -1; in wpa_supplicant_ctrl_iface_get_capability()
4966 return -1; in wpa_supplicant_ctrl_iface_get_capability()
4982 ret = os_snprintf(pos, end - pos, "%s=", title); in anqp_add_hex()
4983 if (os_snprintf_error(end - pos, ret)) in anqp_add_hex()
4989 ret = os_snprintf(pos, end - pos, "%02x", *d++); in anqp_add_hex()
4990 if (os_snprintf_error(end - pos, ret)) in anqp_add_hex()
4995 ret = os_snprintf(pos, end - pos, "\n"); in anqp_add_hex()
4996 if (os_snprintf_error(end - pos, ret)) in anqp_add_hex()
5018 if (ie_end - ie < 2) in print_fils_indication()
5023 ret = os_snprintf(pos, end - pos, "fils_info=%04x\n", info); in print_fils_indication()
5024 if (os_snprintf_error(end - pos, ret)) in print_fils_indication()
5030 if (ie_end - ie < 2) in print_fils_indication()
5032 ret = os_snprintf(pos, end - pos, "fils_cache_id=%02x%02x\n", in print_fils_indication()
5034 if (os_snprintf_error(end - pos, ret)) in print_fils_indication()
5042 if (ie_end - ie < ETH_ALEN) in print_fils_indication()
5044 ret = os_snprintf(pos, end - pos, "fils_hessid=" MACSTR "\n", in print_fils_indication()
5046 if (os_snprintf_error(end - pos, ret)) in print_fils_indication()
5054 if (ie_end - ie < realms * 2) in print_fils_indication()
5056 ret = os_snprintf(pos, end - pos, "fils_realms="); in print_fils_indication()
5057 if (os_snprintf_error(end - pos, ret)) in print_fils_indication()
5061 ret = wpa_snprintf_hex(pos, end - pos, ie, realms * 2); in print_fils_indication()
5066 ret = os_snprintf(pos, end - pos, "\n"); in print_fils_indication()
5067 if (os_snprintf_error(end - pos, ret)) in print_fils_indication()
5072 return pos - start; in print_fils_indication()
5095 size_t left = ie_end - ie; in print_rnr()
5100 left -= sizeof(struct ieee80211_neighbor_ap_info); in print_rnr()
5101 if (left < info->tbtt_info_len) in print_rnr()
5104 ret = os_snprintf(pos, end - pos, in print_rnr()
5106 n, *ie, info->tbtt_info_len, in print_rnr()
5107 info->op_class, info->channel); in print_rnr()
5108 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5114 if (info->tbtt_info_len >= 1) { in print_rnr()
5115 ret = os_snprintf(pos, end - pos, in print_rnr()
5117 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5124 if (info->tbtt_info_len >= 7) { in print_rnr()
5125 ret = os_snprintf(pos, end - pos, in print_rnr()
5128 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5135 if (info->tbtt_info_len >= 11) { in print_rnr()
5136 ret = os_snprintf(pos, end - pos, in print_rnr()
5139 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5146 if (info->tbtt_info_len >= 12) { in print_rnr()
5147 ret = os_snprintf(pos, end - pos, in print_rnr()
5149 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5156 if (info->tbtt_info_len >= 13) { in print_rnr()
5157 ret = os_snprintf(pos, end - pos, in print_rnr()
5159 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5166 if (info->tbtt_info_len >= 16) { in print_rnr()
5167 ret = os_snprintf(pos, end - pos, in print_rnr()
5170 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5177 ie = tbtt_start + info->tbtt_info_len; in print_rnr()
5179 ret = os_snprintf(pos, end - pos, "\n"); in print_rnr()
5180 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5187 return pos - start; in print_rnr()
5200 ie = get_ml_ie(wpa_bss_ie_ptr(bss), bss->ie_len, in print_ml()
5210 if (ie_end - ie < 2 + 1 + ETH_ALEN) in print_ml()
5213 ml_control = le_to_host16(ml->ml_control); in print_ml()
5216 ret = os_snprintf(pos, end - pos, in print_ml()
5217 "multi-link: control=0x%x, common info len=%u", in print_ml()
5219 if (os_snprintf_error(end - pos, ret)) in print_ml()
5224 if (ie_end - ie < common_info_length) in print_ml()
5228 common_info_length--; in print_ml()
5233 ret = os_snprintf(pos, end - pos, ", MLD addr=" MACSTR, MAC2STR(ie)); in print_ml()
5234 if (os_snprintf_error(end - pos, ret)) in print_ml()
5239 common_info_length -= ETH_ALEN; in print_ml()
5245 ret = os_snprintf(pos, end - pos, ", link ID=%u", *ie & 0x0f); in print_ml()
5246 if (os_snprintf_error(end - pos, ret)) in print_ml()
5250 common_info_length--; in print_ml()
5257 ret = os_snprintf(pos, end - pos, in print_ml()
5259 if (os_snprintf_error(end - pos, ret)) in print_ml()
5263 common_info_length--; in print_ml()
5270 ret = os_snprintf(pos, end - pos, ", MSD Info=0x%x", in print_ml()
5272 if (os_snprintf_error(end - pos, ret)) in print_ml()
5276 common_info_length -= 2; in print_ml()
5283 ret = os_snprintf(pos, end - pos, ", EML capabilities=0x%x", in print_ml()
5285 if (os_snprintf_error(end - pos, ret)) in print_ml()
5289 common_info_length -= 2; in print_ml()
5296 ret = os_snprintf(pos, end - pos, ", MLD capabilities=0x%x", in print_ml()
5298 if (os_snprintf_error(end - pos, ret)) in print_ml()
5302 common_info_length -= 2; in print_ml()
5309 ret = os_snprintf(pos, end - pos, ", MLD ID=0x%x", *ie); in print_ml()
5310 if (os_snprintf_error(end - pos, ret)) in print_ml()
5314 common_info_length--; in print_ml()
5317 ret = os_snprintf(pos, end - pos, "\n"); in print_ml()
5318 if (os_snprintf_error(end - pos, ret)) in print_ml()
5322 return pos - start; in print_ml()
5338 ret = os_snprintf(pos, end - pos, "id=%u\n", bss->id); in print_bss_info()
5339 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5345 ret = os_snprintf(pos, end - pos, "bssid=" MACSTR "\n", in print_bss_info()
5346 MAC2STR(bss->bssid)); in print_bss_info()
5347 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5353 ret = os_snprintf(pos, end - pos, "freq=%d\n", bss->freq); in print_bss_info()
5354 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5360 ret = os_snprintf(pos, end - pos, "beacon_int=%d\n", in print_bss_info()
5361 bss->beacon_int); in print_bss_info()
5362 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5368 ret = os_snprintf(pos, end - pos, "capabilities=0x%04x\n", in print_bss_info()
5369 bss->caps); in print_bss_info()
5370 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5376 ret = os_snprintf(pos, end - pos, "qual=%d\n", bss->qual); in print_bss_info()
5377 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5383 ret = os_snprintf(pos, end - pos, "noise=%d\n", bss->noise); in print_bss_info()
5384 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5390 ret = os_snprintf(pos, end - pos, "level=%d\n", bss->level); in print_bss_info()
5391 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5397 ret = os_snprintf(pos, end - pos, "tsf=%016llu\n", in print_bss_info()
5398 (unsigned long long) bss->tsf); in print_bss_info()
5399 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5408 ret = os_snprintf(pos, end - pos, "age=%d\n", in print_bss_info()
5409 (int) (now.sec - bss->last_update.sec)); in print_bss_info()
5410 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5416 ret = os_snprintf(pos, end - pos, "ie="); in print_bss_info()
5417 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5422 for (i = 0; i < bss->ie_len; i++) { in print_bss_info()
5423 ret = os_snprintf(pos, end - pos, "%02x", *ie++); in print_bss_info()
5424 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5429 ret = os_snprintf(pos, end - pos, "\n"); in print_bss_info()
5430 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5436 ret = os_snprintf(pos, end - pos, "flags="); in print_bss_info()
5437 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5454 ret = os_snprintf(pos, end - pos, "[SAE-H2E]"); in print_bss_info()
5455 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5460 ret = os_snprintf(pos, end - pos, "[SAE-PK]"); in print_bss_info()
5461 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5472 pos, end - pos, in print_bss_info()
5473 ie2 ? "[OWE-TRANS]" : "[OWE-TRANS-OPEN]"); in print_bss_info()
5474 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5480 (bss->caps & IEEE80211_CAP_PRIVACY)) { in print_bss_info()
5481 ret = os_snprintf(pos, end - pos, "[WEP]"); in print_bss_info()
5482 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5488 ret = os_snprintf(pos, end - pos, "[MESH]"); in print_bss_info()
5489 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5496 ret = os_snprintf(pos, end - pos, "[DMG]"); in print_bss_info()
5497 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5500 switch (bss->caps & IEEE80211_CAP_DMG_MASK) { in print_bss_info()
5514 ret = os_snprintf(pos, end - pos, "%s", s); in print_bss_info()
5515 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5519 if (bss->caps & IEEE80211_CAP_IBSS) { in print_bss_info()
5520 ret = os_snprintf(pos, end - pos, "[IBSS]"); in print_bss_info()
5521 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5525 if (bss->caps & IEEE80211_CAP_ESS) { in print_bss_info()
5526 ret = os_snprintf(pos, end - pos, "[ESS]"); in print_bss_info()
5527 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5534 ret = os_snprintf(pos, end - pos, "[P2P]"); in print_bss_info()
5535 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5541 ret = os_snprintf(pos, end - pos, "[HS20]"); in print_bss_info()
5542 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5549 ret = os_snprintf(pos, end - pos, "[FILS]"); in print_bss_info()
5550 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5557 ret = os_snprintf(pos, end - pos, "[FST]"); in print_bss_info()
5558 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5564 ret = os_snprintf(pos, end - pos, "[UTF-8]"); in print_bss_info()
5565 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5570 ret = os_snprintf(pos, end - pos, "\n"); in print_bss_info()
5571 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5577 ret = os_snprintf(pos, end - pos, "ssid=%s\n", in print_bss_info()
5578 wpa_ssid_txt(bss->ssid, bss->ssid_len)); in print_bss_info()
5579 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5587 ret = wpas_wps_scan_result_text(ie, bss->ie_len, pos, end); in print_bss_info()
5588 if (ret >= end - pos) in print_bss_info()
5598 ret = wpas_p2p_scan_result_text(ie, bss->ie_len, pos, end); in print_bss_info()
5599 if (ret >= end - pos) in print_bss_info()
5611 wfd = ieee802_11_vendor_ie_concat(ie, bss->ie_len, in print_bss_info()
5614 ret = os_snprintf(pos, end - pos, "wfd_subelems="); in print_bss_info()
5615 if (os_snprintf_error(end - pos, ret)) { in print_bss_info()
5621 pos += wpa_snprintf_hex(pos, end - pos, in print_bss_info()
5626 ret = os_snprintf(pos, end - pos, "\n"); in print_bss_info()
5627 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5635 if ((mask & WPA_BSS_MASK_INTERNETW) && bss->anqp) { in print_bss_info()
5636 struct wpa_bss_anqp *anqp = bss->anqp; in print_bss_info()
5640 anqp->capability_list); in print_bss_info()
5642 anqp->venue_name); in print_bss_info()
5644 anqp->network_auth_type); in print_bss_info()
5646 anqp->roaming_consortium); in print_bss_info()
5648 anqp->ip_addr_type_availability); in print_bss_info()
5650 anqp->nai_realm); in print_bss_info()
5651 pos = anqp_add_hex(pos, end, "anqp_3gpp", anqp->anqp_3gpp); in print_bss_info()
5653 anqp->domain_name); in print_bss_info()
5655 anqp->fils_realm_info); in print_bss_info()
5658 anqp->hs20_capability_list); in print_bss_info()
5660 anqp->hs20_operator_friendly_name); in print_bss_info()
5662 anqp->hs20_wan_metrics); in print_bss_info()
5664 anqp->hs20_connection_capability); in print_bss_info()
5666 anqp->hs20_operating_class); in print_bss_info()
5668 anqp->hs20_osu_providers_list); in print_bss_info()
5670 anqp->hs20_operator_icon_metadata); in print_bss_info()
5672 anqp->hs20_osu_providers_nai_list); in print_bss_info()
5675 dl_list_for_each(elem, &anqp->anqp_elems, in print_bss_info()
5680 elem->infoid); in print_bss_info()
5681 pos = anqp_add_hex(pos, end, title, elem->payload); in print_bss_info()
5682 if (elem->protected_response) { in print_bss_info()
5683 ret = os_snprintf(pos, end - pos, in print_bss_info()
5684 "protected-anqp-info[%u]=1\n", in print_bss_info()
5685 elem->infoid); in print_bss_info()
5686 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5697 ret = wpas_mesh_scan_result_text(ie, bss->ie_len, pos, end); in print_bss_info()
5698 if (ret >= end - pos) in print_bss_info()
5706 ret = os_snprintf(pos, end - pos, "snr=%d\n", bss->snr); in print_bss_info()
5707 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5713 ret = os_snprintf(pos, end - pos, "est_throughput=%d\n", in print_bss_info()
5714 bss->est_throughput); in print_bss_info()
5715 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5722 ret = fst_ctrl_iface_mb_info(bss->bssid, pos, end - pos); in print_bss_info()
5723 if (ret < 0 || ret >= end - pos) in print_bss_info()
5730 ret = os_snprintf(pos, end - pos, "update_idx=%u\n", in print_bss_info()
5731 bss->last_update_idx); in print_bss_info()
5732 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5737 if ((mask & WPA_BSS_MASK_BEACON_IE) && bss->beacon_ie_len) { in print_bss_info()
5738 ret = os_snprintf(pos, end - pos, "beacon_ie="); in print_bss_info()
5739 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5744 ie += bss->ie_len; in print_bss_info()
5745 for (i = 0; i < bss->beacon_ie_len; i++) { in print_bss_info()
5746 ret = os_snprintf(pos, end - pos, "%02x", *ie++); in print_bss_info()
5747 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5752 ret = os_snprintf(pos, end - pos, "\n"); in print_bss_info()
5753 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5765 if (!is_zero_ether_addr(bss->mld_addr) && in print_bss_info()
5767 ret = os_snprintf(pos, end - pos, in print_bss_info()
5769 MAC2STR(bss->mld_addr)); in print_bss_info()
5770 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5782 ret = os_snprintf(pos, end - pos, "====\n"); in print_bss_info()
5783 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5788 return pos - buf; in print_bss_info()
5808 bss = dl_list_first(&wpa_s->bss_id, struct wpa_bss, in wpa_supplicant_ctrl_iface_bss()
5810 bsslast = dl_list_last(&wpa_s->bss_id, struct wpa_bss, in wpa_supplicant_ctrl_iface_bss()
5812 } else { /* N1-N2 */ in wpa_supplicant_ctrl_iface_bss()
5815 if ((ctmp = os_strchr(cmd + 6, '-')) == NULL) { in wpa_supplicant_ctrl_iface_bss()
5821 if (*(cmd + 6) == '-') in wpa_supplicant_ctrl_iface_bss()
5829 id2 = (unsigned int) -1; in wpa_supplicant_ctrl_iface_bss()
5831 if (id2 == (unsigned int) -1) in wpa_supplicant_ctrl_iface_bss()
5832 bsslast = dl_list_last(&wpa_s->bss_id, in wpa_supplicant_ctrl_iface_bss()
5840 next = tmp->list_id.next; in wpa_supplicant_ctrl_iface_bss()
5841 if (next == &wpa_s->bss_id) in wpa_supplicant_ctrl_iface_bss()
5846 if (tmp->id > id2) in wpa_supplicant_ctrl_iface_bss()
5854 bss = dl_list_first(&wpa_s->bss_id, struct wpa_bss, list_id); in wpa_supplicant_ctrl_iface_bss()
5856 bss = dl_list_last(&wpa_s->bss_id, struct wpa_bss, list_id); in wpa_supplicant_ctrl_iface_bss()
5857 else if (os_strncmp(cmd, "ID-", 3) == 0) { in wpa_supplicant_ctrl_iface_bss()
5860 } else if (os_strncmp(cmd, "NEXT-", 5) == 0) { in wpa_supplicant_ctrl_iface_bss()
5864 next = bss->list_id.next; in wpa_supplicant_ctrl_iface_bss()
5865 if (next == &wpa_s->bss_id) in wpa_supplicant_ctrl_iface_bss()
5872 bss = wpa_s->current_bss; in wpa_supplicant_ctrl_iface_bss()
5886 dl_list_for_each(tmp, &wpa_s->bss_id, struct wpa_bss, list_id) in wpa_supplicant_ctrl_iface_bss()
5892 i--; in wpa_supplicant_ctrl_iface_bss()
5911 buflen -= len; in wpa_supplicant_ctrl_iface_bss()
5914 (bss == dl_list_last(&wpa_s->bss_id, in wpa_supplicant_ctrl_iface_bss()
5918 res = os_snprintf(buf - 5, end - buf + 5, in wpa_supplicant_ctrl_iface_bss()
5920 if (os_snprintf_error(end - buf + 5, res)) { in wpa_supplicant_ctrl_iface_bss()
5927 next = bss->list_id.next; in wpa_supplicant_ctrl_iface_bss()
5928 if (next == &wpa_s->bss_id) in wpa_supplicant_ctrl_iface_bss()
5985 /* MLME-DELETEKEYS.request */ in wpa_supplicant_ctrl_iface_drop_sa()
5986 wpa_drv_set_key(wpa_s, -1, WPA_ALG_NONE, NULL, 0, 0, NULL, 0, NULL, in wpa_supplicant_ctrl_iface_drop_sa()
5988 wpa_drv_set_key(wpa_s, -1, WPA_ALG_NONE, NULL, 1, 0, NULL, 0, NULL, in wpa_supplicant_ctrl_iface_drop_sa()
5990 wpa_drv_set_key(wpa_s, -1, WPA_ALG_NONE, NULL, 2, 0, NULL, 0, NULL, in wpa_supplicant_ctrl_iface_drop_sa()
5992 wpa_drv_set_key(wpa_s, -1, WPA_ALG_NONE, NULL, 3, 0, NULL, 0, NULL, in wpa_supplicant_ctrl_iface_drop_sa()
5994 wpa_drv_set_key(wpa_s, -1, WPA_ALG_NONE, NULL, 4, 0, NULL, 0, NULL, in wpa_supplicant_ctrl_iface_drop_sa()
5996 wpa_drv_set_key(wpa_s, -1, WPA_ALG_NONE, NULL, 5, 0, NULL, 0, NULL, in wpa_supplicant_ctrl_iface_drop_sa()
5999 wpa_drv_set_key(wpa_s, -1, WPA_ALG_NONE, wpa_s->bssid, 0, 0, NULL, 0, in wpa_supplicant_ctrl_iface_drop_sa()
6001 if (wpa_sm_ext_key_id(wpa_s->wpa)) in wpa_supplicant_ctrl_iface_drop_sa()
6002 wpa_drv_set_key(wpa_s, -1, WPA_ALG_NONE, wpa_s->bssid, 1, 0, in wpa_supplicant_ctrl_iface_drop_sa()
6004 /* MLME-SETPROTECTION.request(None) */ in wpa_supplicant_ctrl_iface_drop_sa()
6005 wpa_drv_mlme_setprotection(wpa_s, wpa_s->bssid, in wpa_supplicant_ctrl_iface_drop_sa()
6008 wpa_sm_drop_sa(wpa_s->wpa); in wpa_supplicant_ctrl_iface_drop_sa()
6017 return -1; in wpa_supplicant_ctrl_iface_roam()
6021 struct wpa_ssid *ssid = wpa_s->current_ssid; in wpa_supplicant_ctrl_iface_roam()
6027 return -1; in wpa_supplicant_ctrl_iface_roam()
6035 return -1; in wpa_supplicant_ctrl_iface_roam()
6038 bss = wpa_bss_get(wpa_s, bssid, ssid->ssid, ssid->ssid_len); in wpa_supplicant_ctrl_iface_roam()
6042 return -1; in wpa_supplicant_ctrl_iface_roam()
6050 already_connecting = radio_work_pending(wpa_s, "sme-connect"); in wpa_supplicant_ctrl_iface_roam()
6051 wpa_s->reassociate = 1; in wpa_supplicant_ctrl_iface_roam()
6056 * results that come in before the 'sme-connect' radio work gets in wpa_supplicant_ctrl_iface_roam()
6059 if (!already_connecting && radio_work_pending(wpa_s, "sme-connect")) in wpa_supplicant_ctrl_iface_roam()
6060 wpa_s->roam_in_progress = true; in wpa_supplicant_ctrl_iface_roam()
6081 if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) { in p2p_ctrl_find()
6084 return -1; in p2p_ctrl_find()
6098 return -1; in p2p_ctrl_find()
6106 return -1; in p2p_ctrl_find()
6122 return -1; in p2p_ctrl_find()
6167 return -1; in p2ps_ctrl_parse_cpt_priority()
6170 token_len = last - token; in p2ps_ctrl_parse_cpt_priority()
6182 return -1; in p2ps_ctrl_parse_cpt_priority()
6227 os_memcpy(p2ps_prov->info, info, info_len); in p2p_parse_asp_provision_cmd()
6228 p2ps_prov->info[info_len] = '\0'; in p2p_parse_asp_provision_cmd()
6234 p2ps_prov->status = atoi(pos + 7); in p2p_parse_asp_provision_cmd()
6236 p2ps_prov->status = -1; in p2p_parse_asp_provision_cmd()
6241 p2ps_prov->adv_id = val; in p2p_parse_asp_provision_cmd()
6245 p2ps_prov->method = strtol(pos + 7, NULL, 16); in p2p_parse_asp_provision_cmd()
6247 p2ps_prov->method = 0; in p2p_parse_asp_provision_cmd()
6252 p2ps_prov->session_id = val; in p2p_parse_asp_provision_cmd()
6255 if (!pos || hwaddr_aton(pos + 8, p2ps_prov->adv_mac)) in p2p_parse_asp_provision_cmd()
6259 if (!pos || hwaddr_aton(pos + 12, p2ps_prov->session_mac)) in p2p_parse_asp_provision_cmd()
6265 p2ps_prov->cpt_priority)) in p2p_parse_asp_provision_cmd()
6268 p2ps_prov->cpt_priority[0] = P2PS_FEATURE_CAPAB_UDP_TRANSPORT; in p2p_parse_asp_provision_cmd()
6271 for (i = 0; p2ps_prov->cpt_priority[i]; i++) in p2p_parse_asp_provision_cmd()
6272 p2ps_prov->cpt_mask |= p2ps_prov->cpt_priority[i]; in p2p_parse_asp_provision_cmd()
6287 p2ps_prov->role = role; in p2p_parse_asp_provision_cmd()
6308 return -1; in p2p_ctrl_asp_provision_resp()
6312 return -1; in p2p_ctrl_asp_provision_resp()
6316 return -1; in p2p_ctrl_asp_provision_resp()
6318 if (p2ps_prov->status < 0) { in p2p_ctrl_asp_provision_resp()
6320 return -1; in p2p_ctrl_asp_provision_resp()
6340 return -1; in p2p_ctrl_asp_provision()
6344 return -1; in p2p_ctrl_asp_provision()
6348 return -1; in p2p_ctrl_asp_provision()
6350 p2ps_prov->pd_seeker = 1; in p2p_ctrl_asp_provision()
6366 int persistent_group, persistent_id = -1; in p2p_ctrl_connect()
6370 int go_intent = -1; in p2p_ctrl_connect()
6380 if (!wpa_s->global->p2p_init_wpa_s) in p2p_ctrl_connect()
6381 return -1; in p2p_ctrl_connect()
6382 if (wpa_s->global->p2p_init_wpa_s != wpa_s) { in p2p_ctrl_connect()
6384 wpa_s->global->p2p_init_wpa_s->ifname); in p2p_ctrl_connect()
6385 wpa_s = wpa_s->global->p2p_init_wpa_s; in p2p_ctrl_connect()
6394 return -1; in p2p_ctrl_connect()
6398 return -1; in p2p_ctrl_connect()
6406 ssid = wpa_config_get_network(wpa_s->conf, persistent_id); in p2p_ctrl_connect()
6407 if (ssid == NULL || ssid->disabled != 2 || in p2p_ctrl_connect()
6408 ssid->mode != WPAS_MODE_P2P_GO) { in p2p_ctrl_connect()
6412 return -1; in p2p_ctrl_connect()
6420 vht = (os_strstr(cmd, " vht") != NULL) || wpa_s->conf->p2p_go_vht; in p2p_ctrl_connect()
6421 ht40 = (os_strstr(cmd, " ht40") != NULL) || wpa_s->conf->p2p_go_ht40 || in p2p_ctrl_connect()
6423 he = (os_strstr(cmd, " he") != NULL) || wpa_s->conf->p2p_go_he; in p2p_ctrl_connect()
6424 edmg = (os_strstr(cmd, " edmg") != NULL) || wpa_s->conf->p2p_go_edmg; in p2p_ctrl_connect()
6431 return -1; in p2p_ctrl_connect()
6439 return -1; in p2p_ctrl_connect()
6452 return -1; in p2p_ctrl_connect()
6466 group_ssid_len = (end - pos2) / 2; in p2p_ctrl_connect()
6469 return -1; in p2p_ctrl_connect()
6490 os_memcpy(buf, "FAIL-INVALID-PIN\n", 17); in p2p_ctrl_connect()
6500 if (new_pin == -2) { in p2p_ctrl_connect()
6501 os_memcpy(buf, "FAIL-CHANNEL-UNAVAILABLE\n", 25); in p2p_ctrl_connect()
6504 if (new_pin == -3) { in p2p_ctrl_connect()
6505 os_memcpy(buf, "FAIL-CHANNEL-UNSUPPORTED\n", 25); in p2p_ctrl_connect()
6509 return -1; in p2p_ctrl_connect()
6513 return -1; in p2p_ctrl_connect()
6525 if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) { in p2p_ctrl_listen()
6528 return -1; in p2p_ctrl_listen()
6543 return -1; in p2p_ctrl_prov_disc()
6547 return -1; in p2p_ctrl_prov_disc()
6562 struct wpa_ssid *ssid = wpa_s->current_ssid; in p2p_get_passphrase()
6564 if (ssid == NULL || ssid->mode != WPAS_MODE_P2P_GO || in p2p_get_passphrase()
6565 ssid->passphrase == NULL) in p2p_get_passphrase()
6566 return -1; in p2p_get_passphrase()
6568 os_strlcpy(buf, ssid->passphrase, buflen); in p2p_get_passphrase()
6584 return -1; in p2p_ctrl_serv_disc_req()
6591 return -1; in p2p_ctrl_serv_disc_req()
6598 return -1; in p2p_ctrl_serv_disc_req()
6601 return -1; in p2p_ctrl_serv_disc_req()
6605 } else if (os_strncmp(pos, "wifi-display ", 13) == 0) { in p2p_ctrl_serv_disc_req()
6615 return -1; in p2p_ctrl_serv_disc_req()
6619 return -1; in p2p_ctrl_serv_disc_req()
6635 return -1; in p2p_ctrl_serv_disc_req()
6645 return -1; in p2p_ctrl_serv_disc_req()
6649 return -1; in p2p_ctrl_serv_disc_req()
6652 return -1; in p2p_ctrl_serv_disc_req()
6659 return -1; in p2p_ctrl_serv_disc_req()
6662 return -1; in p2p_ctrl_serv_disc_req()
6673 return -1; in p2p_ctrl_serv_disc_cancel_req()
6690 return -1; in p2p_ctrl_serv_disc_resp()
6694 return -1; in p2p_ctrl_serv_disc_resp()
6697 return -1; in p2p_ctrl_serv_disc_resp()
6700 return -1; in p2p_ctrl_serv_disc_resp()
6705 return -1; in p2p_ctrl_serv_disc_resp()
6711 return -1; in p2p_ctrl_serv_disc_resp()
6715 return -1; in p2p_ctrl_serv_disc_resp()
6718 return -1; in p2p_ctrl_serv_disc_resp()
6731 return -1; in p2p_ctrl_serv_disc_external()
6732 wpa_s->p2p_sd_over_ctrl_iface = atoi(cmd); in p2p_ctrl_serv_disc_external()
6747 return -1; in p2p_ctrl_service_add_bonjour()
6752 return -1; in p2p_ctrl_service_add_bonjour()
6756 return -1; in p2p_ctrl_service_add_bonjour()
6760 ret = -1; in p2p_ctrl_service_add_bonjour()
6789 return -1; in p2p_ctrl_service_add_upnp()
6793 return -1; in p2p_ctrl_service_add_upnp()
6811 return -1; in p2p_ctrl_service_add_asp()
6814 /* Auto-Accept value is mandatory, and must be one of the in p2p_ctrl_service_add_asp()
6818 case P2PS_SETUP_NONE: /* No auto-accept */ in p2p_ctrl_service_add_asp()
6824 return -1; in p2p_ctrl_service_add_asp()
6831 return -1; in p2p_ctrl_service_add_asp()
6834 /* Handle Adv_ID == 0 (wildcard "org.wi-fi.wfds") internally. */ in p2p_ctrl_service_add_asp()
6836 return -1; in p2p_ctrl_service_add_asp()
6841 return -1; in p2p_ctrl_service_add_asp()
6844 return -1; in p2p_ctrl_service_add_asp()
6847 /* svc_state between 0 - 0xff is mandatory */ in p2p_ctrl_service_add_asp()
6849 return -1; in p2p_ctrl_service_add_asp()
6853 return -1; in p2p_ctrl_service_add_asp()
6858 return -1; in p2p_ctrl_service_add_asp()
6862 return -1; in p2p_ctrl_service_add_asp()
6866 return -1; in p2p_ctrl_service_add_asp()
6873 return -1; in p2p_ctrl_service_add_asp()
6887 return -1; in p2p_ctrl_service_add_asp()
6920 return -1; in p2p_ctrl_service_add()
6930 return -1; in p2p_ctrl_service_add()
6943 return -1; in p2p_ctrl_service_del_bonjour()
6947 return -1; in p2p_ctrl_service_del_bonjour()
6950 return -1; in p2p_ctrl_service_del_bonjour()
6966 return -1; in p2p_ctrl_service_del_upnp()
6970 return -1; in p2p_ctrl_service_del_upnp()
6986 return -1; in p2p_ctrl_service_del_asp()
6998 return -1; in p2p_ctrl_service_del()
7008 return -1; in p2p_ctrl_service_del()
7018 return -1; in p2p_ctrl_service_replace()
7025 return -1; in p2p_ctrl_service_replace()
7036 return -1; in p2p_ctrl_reject()
7058 return -1; in p2p_ctrl_invite_persistent()
7061 ssid = wpa_config_get_network(wpa_s->conf, id); in p2p_ctrl_invite_persistent()
7062 if (ssid == NULL || ssid->disabled != 2) { in p2p_ctrl_invite_persistent()
7066 return -1; in p2p_ctrl_invite_persistent()
7074 return -1; in p2p_ctrl_invite_persistent()
7082 return -1; in p2p_ctrl_invite_persistent()
7085 vht = (os_strstr(cmd, " vht") != NULL) || wpa_s->conf->p2p_go_vht; in p2p_ctrl_invite_persistent()
7086 ht40 = (os_strstr(cmd, " ht40") != NULL) || wpa_s->conf->p2p_go_ht40 || in p2p_ctrl_invite_persistent()
7088 he = (os_strstr(cmd, " he") != NULL) || wpa_s->conf->p2p_go_he; in p2p_ctrl_invite_persistent()
7089 edmg = (os_strstr(cmd, " edmg") != NULL) || wpa_s->conf->p2p_go_edmg; in p2p_ctrl_invite_persistent()
7101 return -1; in p2p_ctrl_invite_persistent()
7122 return -1; in p2p_ctrl_invite_group()
7128 return -1; in p2p_ctrl_invite_group()
7139 return -1; in p2p_ctrl_invite_group()
7155 return -1; in p2p_ctrl_invite()
7167 ssid = wpa_config_get_network(wpa_s->conf, id); in p2p_ctrl_group_add_persistent()
7168 if (ssid == NULL || ssid->disabled != 2) { in p2p_ctrl_group_add_persistent()
7172 return -1; in p2p_ctrl_group_add_persistent()
7185 int freq = 0, persistent = 0, group_id = -1; in p2p_ctrl_group_add()
7187 int vht = wpa_s->conf->p2p_go_vht; in p2p_ctrl_group_add()
7188 int ht40 = wpa_s->conf->p2p_go_ht40 || vht; in p2p_ctrl_group_add()
7189 int he = wpa_s->conf->p2p_go_he; in p2p_ctrl_group_add()
7190 int edmg = wpa_s->conf->p2p_go_edmg; in p2p_ctrl_group_add()
7224 return -1; in p2p_ctrl_group_add()
7230 return -1; in p2p_ctrl_group_add()
7235 if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_ACS_OFFLOAD) && in p2p_ctrl_group_add()
7237 if (freq == 2 && wpa_s->best_24_freq <= 0) { in p2p_ctrl_group_add()
7238 wpa_s->p2p_go_acs_band = HOSTAPD_MODE_IEEE80211G; in p2p_ctrl_group_add()
7239 wpa_s->p2p_go_do_acs = 1; in p2p_ctrl_group_add()
7241 } else if (freq == 5 && wpa_s->best_5_freq <= 0) { in p2p_ctrl_group_add()
7242 wpa_s->p2p_go_acs_band = HOSTAPD_MODE_IEEE80211A; in p2p_ctrl_group_add()
7243 wpa_s->p2p_go_do_acs = 1; in p2p_ctrl_group_add()
7246 wpa_s->p2p_go_acs_band = HOSTAPD_MODE_IEEE80211ANY; in p2p_ctrl_group_add()
7247 wpa_s->p2p_go_do_acs = 1; in p2p_ctrl_group_add()
7250 wpa_s->p2p_go_do_acs = 0; in p2p_ctrl_group_add()
7256 return -1; in p2p_ctrl_group_add()
7262 wpa_s->p2p_go_allow_dfs = !!(wpa_s->drv_flags & in p2p_ctrl_group_add()
7285 ssid = wpa_s->current_ssid; in p2p_ctrl_group_member()
7286 if (!wpa_s->global->p2p || !ssid || ssid->mode != WPAS_MODE_P2P_GO || in p2p_ctrl_group_member()
7288 return -1; in p2p_ctrl_group_member()
7290 iaddr = p2p_group_get_client_interface_addr(wpa_s->p2p_group, dev_addr); in p2p_ctrl_group_member()
7292 return -1; in p2p_ctrl_group_member()
7295 return -1; in p2p_ctrl_group_member()
7305 for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) { in wpas_find_p2p_dev_addr_bss()
7325 if (!wpa_s->global->p2p) in p2p_ctrl_peer()
7326 return -1; in p2p_ctrl_peer()
7331 } else if (os_strncmp(cmd, "NEXT-", 5) == 0) { in p2p_ctrl_peer()
7333 return -1; in p2p_ctrl_peer()
7338 return -1; in p2p_ctrl_peer()
7343 info = p2p_get_peer_info(wpa_s->global->p2p, addr_ptr, next); in p2p_ctrl_peer()
7345 return -1; in p2p_ctrl_peer()
7346 group_capab = info->group_capab; in p2p_ctrl_peer()
7349 !wpas_find_p2p_dev_addr_bss(wpa_s->global, info->p2p_device_addr)) { in p2p_ctrl_peer()
7353 MAC2STR(info->p2p_device_addr), group_capab); in p2p_ctrl_peer()
7360 res = os_snprintf(pos, end - pos, MACSTR "\n" in p2p_ctrl_peer()
7371 MAC2STR(info->p2p_device_addr), in p2p_ctrl_peer()
7372 wps_dev_type_bin2str(info->pri_dev_type, in p2p_ctrl_peer()
7374 info->device_name, in p2p_ctrl_peer()
7375 info->manufacturer, in p2p_ctrl_peer()
7376 info->model_name, in p2p_ctrl_peer()
7377 info->model_number, in p2p_ctrl_peer()
7378 info->serial_number, in p2p_ctrl_peer()
7379 info->config_methods, in p2p_ctrl_peer()
7380 info->dev_capab, in p2p_ctrl_peer()
7382 info->level); in p2p_ctrl_peer()
7383 if (os_snprintf_error(end - pos, res)) in p2p_ctrl_peer()
7384 return pos - buf; in p2p_ctrl_peer()
7387 for (i = 0; i < info->wps_sec_dev_type_list_len / WPS_DEV_TYPE_LEN; i++) in p2p_ctrl_peer()
7390 t = &info->wps_sec_dev_type_list[i * WPS_DEV_TYPE_LEN]; in p2p_ctrl_peer()
7391 res = os_snprintf(pos, end - pos, "sec_dev_type=%s\n", in p2p_ctrl_peer()
7394 if (os_snprintf_error(end - pos, res)) in p2p_ctrl_peer()
7395 return pos - buf; in p2p_ctrl_peer()
7399 ssid = wpas_p2p_get_persistent(wpa_s, info->p2p_device_addr, NULL, 0); in p2p_ctrl_peer()
7401 res = os_snprintf(pos, end - pos, "persistent=%d\n", ssid->id); in p2p_ctrl_peer()
7402 if (os_snprintf_error(end - pos, res)) in p2p_ctrl_peer()
7403 return pos - buf; in p2p_ctrl_peer()
7407 res = p2p_get_peer_info_txt(info, pos, end - pos); in p2p_ctrl_peer()
7409 return pos - buf; in p2p_ctrl_peer()
7412 if (info->vendor_elems) { in p2p_ctrl_peer()
7413 res = os_snprintf(pos, end - pos, "vendor_elems="); in p2p_ctrl_peer()
7414 if (os_snprintf_error(end - pos, res)) in p2p_ctrl_peer()
7415 return pos - buf; in p2p_ctrl_peer()
7418 pos += wpa_snprintf_hex(pos, end - pos, in p2p_ctrl_peer()
7419 wpabuf_head(info->vendor_elems), in p2p_ctrl_peer()
7420 wpabuf_len(info->vendor_elems)); in p2p_ctrl_peer()
7422 res = os_snprintf(pos, end - pos, "\n"); in p2p_ctrl_peer()
7423 if (os_snprintf_error(end - pos, res)) in p2p_ctrl_peer()
7424 return pos - buf; in p2p_ctrl_peer()
7428 return pos - buf; in p2p_ctrl_peer()
7437 if (wpa_s->global->p2p == NULL) in p2p_ctrl_disallow_freq()
7438 return -1; in p2p_ctrl_disallow_freq()
7440 if (freq_range_list_parse(&wpa_s->global->p2p_disallow_freq, param) < 0) in p2p_ctrl_disallow_freq()
7441 return -1; in p2p_ctrl_disallow_freq()
7443 for (i = 0; i < wpa_s->global->p2p_disallow_freq.num; i++) { in p2p_ctrl_disallow_freq()
7445 freq = &wpa_s->global->p2p_disallow_freq.range[i]; in p2p_ctrl_disallow_freq()
7446 wpa_printf(MSG_DEBUG, "P2P: Disallowed frequency range %u-%u", in p2p_ctrl_disallow_freq()
7447 freq->min, freq->max); in p2p_ctrl_disallow_freq()
7459 if (wpa_s->global->p2p == NULL) in p2p_ctrl_set()
7460 return -1; in p2p_ctrl_set()
7464 return -1; in p2p_ctrl_set()
7468 p2p_set_client_discoverability(wpa_s->global->p2p, in p2p_ctrl_set()
7474 p2p_set_managed_oper(wpa_s->global->p2p, atoi(param)); in p2p_ctrl_set()
7486 return p2p_set_listen_channel(wpa_s->global->p2p, op_class, in p2p_ctrl_set()
7491 return p2p_set_ssid_postfix(wpa_s->global->p2p, (u8 *) param, in p2p_ctrl_set()
7502 return -1; in p2p_ctrl_set()
7507 return -1; in p2p_ctrl_set()
7511 return -1; in p2p_ctrl_set()
7513 return -1; in p2p_ctrl_set()
7520 return wpa_drv_set_p2p_powersave(wpa_s, atoi(param), -1, -1); in p2p_ctrl_set()
7523 return wpa_drv_set_p2p_powersave(wpa_s, -1, atoi(param), -1); in p2p_ctrl_set()
7526 return wpa_drv_set_p2p_powersave(wpa_s, -1, -1, atoi(param)); in p2p_ctrl_set()
7529 wpa_s->global->p2p_disabled = atoi(param); in p2p_ctrl_set()
7531 wpa_s->global->p2p_disabled ? in p2p_ctrl_set()
7533 if (wpa_s->global->p2p_disabled) { in p2p_ctrl_set()
7535 os_memset(wpa_s->p2p_auth_invite, 0, ETH_ALEN); in p2p_ctrl_set()
7536 p2p_flush(wpa_s->global->p2p); in p2p_ctrl_set()
7543 wpa_s->global->conc_pref = WPA_CONC_PREF_STA; in p2p_ctrl_set()
7545 wpa_s->global->conc_pref = WPA_CONC_PREF_P2P; in p2p_ctrl_set()
7548 return -1; in p2p_ctrl_set()
7556 wpa_s->force_long_sd = atoi(param); in p2p_ctrl_set()
7563 return -1; in p2p_ctrl_set()
7564 p2p_set_peer_filter(wpa_s->global->p2p, addr); in p2p_ctrl_set()
7573 wpa_s->set_ap_uapsd = 0; in p2p_ctrl_set()
7575 wpa_s->set_ap_uapsd = 1; in p2p_ctrl_set()
7576 wpa_s->ap_uapsd = atoi(param); in p2p_ctrl_set()
7583 wpa_s->set_sta_uapsd = 0; in p2p_ctrl_set()
7591 return -1; in p2p_ctrl_set()
7596 return -1; in p2p_ctrl_set()
7601 return -1; in p2p_ctrl_set()
7606 wpa_s->set_sta_uapsd = 1; in p2p_ctrl_set()
7607 wpa_s->sta_uapsd = 0; in p2p_ctrl_set()
7609 wpa_s->sta_uapsd |= BIT(0); in p2p_ctrl_set()
7611 wpa_s->sta_uapsd |= BIT(1); in p2p_ctrl_set()
7613 wpa_s->sta_uapsd |= BIT(2); in p2p_ctrl_set()
7615 wpa_s->sta_uapsd |= BIT(3); in p2p_ctrl_set()
7632 return -1; in p2p_ctrl_set()
7638 return -1; in p2p_ctrl_set()
7643 return p2p_set_disc_int(wpa_s->global->p2p, min_disc_int, in p2p_ctrl_set()
7648 wpa_s->global->p2p_per_sta_psk = !!atoi(param); in p2p_ctrl_set()
7658 wpa_s->p2p_disable_ip_addr_req = !!atoi(param); in p2p_ctrl_set()
7668 return -1; in p2p_ctrl_set()
7671 p2p_set_override_pref_op_chan(wpa_s->global->p2p, op_class, in p2p_ctrl_set()
7679 return -1; in p2p_ctrl_set()
7685 os_memset(wpa_s->p2p_auth_invite, 0, ETH_ALEN); in p2p_ctrl_flush()
7686 wpa_s->force_long_sd = 0; in p2p_ctrl_flush()
7689 os_free(wpa_s->get_pref_freq_list_override); in p2p_ctrl_flush()
7690 wpa_s->get_pref_freq_list_override = NULL; in p2p_ctrl_flush()
7694 wpa_s->parent->p2ps_method_config_any = 0; in p2p_ctrl_flush()
7695 if (wpa_s->global->p2p) in p2p_ctrl_flush()
7696 p2p_flush(wpa_s->global->p2p); in p2p_ctrl_flush()
7708 return -1; in p2p_ctrl_presence_req()
7722 return -1; in p2p_ctrl_presence_req()
7740 return -1; in p2p_ctrl_ext_listen()
7762 return -1; in p2p_ctrl_remove_client()
7777 return -1; in p2p_ctrl_iface_p2p_lo_start()
7793 if (wpa_s->hw.modes == NULL) in freq_range_to_channel_list()
7800 for (i = 0; i < wpa_s->hw.num_modes; i++) { in freq_range_to_channel_list()
7803 mode = &wpa_s->hw.modes[i]; in freq_range_to_channel_list()
7804 for (j = 0; j < mode->num_channels; j++) { in freq_range_to_channel_list()
7807 if (mode->channels[j].flag & HOSTAPD_CHAN_DISABLED) in freq_range_to_channel_list()
7810 freq = mode->channels[j].freq; in freq_range_to_channel_list()
7839 return -1; in ctrl_interworking_select()
7856 return -1; in ctrl_interworking_connect()
7863 return -1; in ctrl_interworking_connect()
7866 if (bss->ssid_len == 0) { in ctrl_interworking_connect()
7872 dl_list_for_each_reverse(bss, &wpa_s->bss, struct wpa_bss, in ctrl_interworking_connect()
7874 if (ether_addr_equal(bss->bssid, bssid) && in ctrl_interworking_connect()
7875 bss->ssid_len > 0) { in ctrl_interworking_connect()
7882 return -1; in ctrl_interworking_connect()
7904 return -1; in get_anqp()
7913 return -1; in get_anqp()
7922 return -1; in get_anqp()
7925 return -1; in get_anqp()
7932 return -1; in get_anqp()
7935 return -1; in get_anqp()
7949 return -1; in get_anqp()
7960 int used, ret = -1; in gas_request()
7966 return -1; in gas_request()
7975 len = end - pos; in gas_request()
7979 return -1; in gas_request()
7982 return -1; in gas_request()
7985 return -1; in gas_request()
8033 return -1; in gas_response_get()
8040 if (wpa_s->last_gas_resp && in gas_response_get()
8041 ether_addr_equal(addr, wpa_s->last_gas_addr) && in gas_response_get()
8042 dialog_token == wpa_s->last_gas_dialog_token) in gas_response_get()
8043 resp = wpa_s->last_gas_resp; in gas_response_get()
8044 else if (wpa_s->prev_gas_resp && in gas_response_get()
8045 ether_addr_equal(addr, wpa_s->prev_gas_addr) && in gas_response_get()
8046 dialog_token == wpa_s->prev_gas_dialog_token) in gas_response_get()
8047 resp = wpa_s->prev_gas_resp; in gas_response_get()
8049 return -1; in gas_response_get()
8059 return os_snprintf(buf, buflen, "FAIL-Invalid range"); in gas_response_get()
8062 return -1; in gas_response_get()
8066 return os_snprintf(buf, buflen, "FAIL-Invalid range"); in gas_response_get()
8070 return os_snprintf(buf, buflen, "FAIL-Too long response"); in gas_response_get()
8080 if (resp == wpa_s->prev_gas_resp) { in gas_response_get()
8081 wpabuf_free(wpa_s->prev_gas_resp); in gas_response_get()
8082 wpa_s->prev_gas_resp = NULL; in gas_response_get()
8084 wpabuf_free(wpa_s->last_gas_resp); in gas_response_get()
8085 wpa_s->last_gas_resp = NULL; in gas_response_get()
8105 return -1; in get_hs20_anqp()
8112 return -1; in get_hs20_anqp()
8121 return -1; in get_hs20_anqp()
8138 return -1; in hs20_nai_home_realm_list()
8157 struct wpa_cred *cred = wpa_s->conf->cred; in hs20_get_nai_home_realm_list()
8166 return -1; in hs20_get_nai_home_realm_list()
8176 if (len == 0 && cred && cred->realm) in hs20_get_nai_home_realm_list()
8177 return hs20_nai_home_realm_list(wpa_s, dst_addr, cred->realm); in hs20_get_nai_home_realm_list()
8180 return -1; in hs20_get_nai_home_realm_list()
8184 return -1; in hs20_get_nai_home_realm_list()
8187 return -1; in hs20_get_nai_home_realm_list()
8208 return -1; in get_hs20_icon()
8215 return -1; in get_hs20_icon()
8217 wpa_s->fetch_osu_icon_in_progress = 0; in get_hs20_icon()
8234 return -1; in del_hs20_icon()
8252 return -1; in hs20_icon_request()
8258 wpa_s->fetch_osu_icon_in_progress = 0; in hs20_icon_request()
8271 enum wpa_states state = wpa_s->wpa_state; in wpa_supplicant_ctrl_iface_autoscan()
8277 return -1; in wpa_supplicant_ctrl_iface_autoscan()
8280 os_free(wpa_s->conf->autoscan); in wpa_supplicant_ctrl_iface_autoscan()
8281 wpa_s->conf->autoscan = new_params; in wpa_supplicant_ctrl_iface_autoscan()
8283 if (wpa_s->conf->autoscan == NULL) in wpa_supplicant_ctrl_iface_autoscan()
8314 return -1; in wpas_ctrl_iface_wnm_sleep()
8327 len = end - pos; in wpas_ctrl_iface_wnm_sleep()
8331 return -1; in wpas_ctrl_iface_wnm_sleep()
8335 return -1; in wpas_ctrl_iface_wnm_sleep()
8338 return -1; in wpas_ctrl_iface_wnm_sleep()
8384 return -1; in wpas_ctrl_iface_coloc_intf_report()
8403 return -1; in wpa_supplicant_signal_poll()
8408 ret = os_snprintf(pos, end - pos, "RSSI=%d\nLINKSPEED=%lu\n" in wpa_supplicant_signal_poll()
8412 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_signal_poll()
8413 return -1; in wpa_supplicant_signal_poll()
8417 ret = os_snprintf(pos, end - pos, "WIDTH=%s\n", in wpa_supplicant_signal_poll()
8419 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_signal_poll()
8420 return -1; in wpa_supplicant_signal_poll()
8425 ret = os_snprintf(pos, end - pos, "CENTER_FRQ1=%d\n", in wpa_supplicant_signal_poll()
8427 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_signal_poll()
8428 return -1; in wpa_supplicant_signal_poll()
8433 ret = os_snprintf(pos, end - pos, "CENTER_FRQ2=%d\n", in wpa_supplicant_signal_poll()
8435 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_signal_poll()
8436 return -1; in wpa_supplicant_signal_poll()
8441 ret = os_snprintf(pos, end - pos, in wpa_supplicant_signal_poll()
8443 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_signal_poll()
8444 return -1; in wpa_supplicant_signal_poll()
8449 ret = os_snprintf(pos, end - pos, in wpa_supplicant_signal_poll()
8452 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_signal_poll()
8453 return -1; in wpa_supplicant_signal_poll()
8457 return pos - buf; in wpa_supplicant_signal_poll()
8468 if (wpa_s->bgscan && wpa_s->bgscan_priv) { in wpas_ctrl_iface_signal_monitor()
8470 "Reject SIGNAL_MONITOR command - bgscan is active"); in wpas_ctrl_iface_signal_monitor()
8471 return -1; in wpas_ctrl_iface_signal_monitor()
8489 char *pos = wpa_s->get_pref_freq_list_override; in wpas_ctrl_iface_get_pref_freq_list_override()
8504 return -1; in wpas_ctrl_iface_get_pref_freq_list_override()
8507 return -1; in wpas_ctrl_iface_get_pref_freq_list_override()
8550 return -1; in wpas_ctrl_iface_get_pref_freq_list()
8558 return -1; in wpas_ctrl_iface_get_pref_freq_list()
8561 ret = os_snprintf(pos, end - pos, "%s%u", in wpas_ctrl_iface_get_pref_freq_list()
8563 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_get_pref_freq_list()
8564 return -1; in wpas_ctrl_iface_get_pref_freq_list()
8568 return pos - buf; in wpas_ctrl_iface_get_pref_freq_list()
8579 (long long unsigned) wpa_s->drv_flags); in wpas_ctrl_iface_driver_flags()
8581 return -1; in wpas_ctrl_iface_driver_flags()
8587 if (wpa_s->drv_flags & (1LLU << i)) { in wpas_ctrl_iface_driver_flags()
8588 ret = os_snprintf(pos, end - pos, "%s\n", in wpas_ctrl_iface_driver_flags()
8590 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_driver_flags()
8591 return -1; in wpas_ctrl_iface_driver_flags()
8596 return pos - buf; in wpas_ctrl_iface_driver_flags()
8607 (long long unsigned) wpa_s->drv_flags2); in wpas_ctrl_iface_driver_flags2()
8609 return -1; in wpas_ctrl_iface_driver_flags2()
8615 if (wpa_s->drv_flags2 & (1LLU << i)) { in wpas_ctrl_iface_driver_flags2()
8616 ret = os_snprintf(pos, end - pos, "%s\n", in wpas_ctrl_iface_driver_flags2()
8618 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_driver_flags2()
8619 return -1; in wpas_ctrl_iface_driver_flags2()
8624 return pos - buf; in wpas_ctrl_iface_driver_flags2()
8636 return -1; in wpa_supplicant_pktcnt_poll()
8641 return -1; in wpa_supplicant_pktcnt_poll()
8655 struct p2p_data *p2p = wpa_s->global->p2p; in wpa_supplicant_driver_cmd()
8666 ret = -1; in wpa_supplicant_driver_cmd()
8690 return -EINVAL; in wpa_supplicant_vendor_cmd()
8696 return -EINVAL; in wpa_supplicant_vendor_cmd()
8699 data_len = temp ? (size_t) (temp - pos) : os_strlen(pos); in wpa_supplicant_vendor_cmd()
8706 return -1; in wpa_supplicant_vendor_cmd()
8712 return -EINVAL; in wpa_supplicant_vendor_cmd()
8721 reply = wpabuf_alloc((buflen - 1) / 2); in wpa_supplicant_vendor_cmd()
8724 return -1; in wpa_supplicant_vendor_cmd()
8744 struct wpa_supplicant *p2p_wpa_s = wpa_s->global->p2p_init_wpa_s ? in wpa_supplicant_ctrl_iface_flush()
8745 wpa_s->global->p2p_init_wpa_s : wpa_s; in wpa_supplicant_ctrl_iface_flush()
8751 wpa_s->ignore_post_flush_scan_res = 1; in wpa_supplicant_ctrl_iface_flush()
8753 if (wpa_s->wpa_state >= WPA_AUTHENTICATING) { in wpa_supplicant_ctrl_iface_flush()
8755 * Avoid possible auto connect re-connection on getting in wpa_supplicant_ctrl_iface_flush()
8766 p2p_wpa_s->global->p2p_disabled = 0; in wpa_supplicant_ctrl_iface_flush()
8767 p2p_wpa_s->global->p2p_per_sta_psk = 0; in wpa_supplicant_ctrl_iface_flush()
8768 p2p_wpa_s->conf->num_sec_device_types = 0; in wpa_supplicant_ctrl_iface_flush()
8769 p2p_wpa_s->p2p_disable_ip_addr_req = 0; in wpa_supplicant_ctrl_iface_flush()
8770 os_free(p2p_wpa_s->global->p2p_go_avoid_freq.range); in wpa_supplicant_ctrl_iface_flush()
8771 p2p_wpa_s->global->p2p_go_avoid_freq.range = NULL; in wpa_supplicant_ctrl_iface_flush()
8772 p2p_wpa_s->global->p2p_go_avoid_freq.num = 0; in wpa_supplicant_ctrl_iface_flush()
8773 p2p_wpa_s->global->pending_p2ps_group = 0; in wpa_supplicant_ctrl_iface_flush()
8774 p2p_wpa_s->global->pending_p2ps_group_freq = 0; in wpa_supplicant_ctrl_iface_flush()
8785 wpa_s->wps_fragment_size = 0; in wpa_supplicant_ctrl_iface_flush()
8787 wps_registrar_flush(wpa_s->wps->registrar); in wpa_supplicant_ctrl_iface_flush()
8789 wpa_s->after_wps = 0; in wpa_supplicant_ctrl_iface_flush()
8790 wpa_s->known_wps_freq = 0; in wpa_supplicant_ctrl_iface_flush()
8794 wpa_s->dpp_init_max_tries = 0; in wpa_supplicant_ctrl_iface_flush()
8795 wpa_s->dpp_init_retry_time = 0; in wpa_supplicant_ctrl_iface_flush()
8796 wpa_s->dpp_resp_wait_time = 0; in wpa_supplicant_ctrl_iface_flush()
8797 wpa_s->dpp_resp_max_tries = 0; in wpa_supplicant_ctrl_iface_flush()
8798 wpa_s->dpp_resp_retry_time = 0; in wpa_supplicant_ctrl_iface_flush()
8801 wpa_s->dpp_pfs_fallback = 0; in wpa_supplicant_ctrl_iface_flush()
8810 info = &wpa_s->dpp_pb[i]; in wpa_supplicant_ctrl_iface_flush()
8811 info->rx_time.sec = 0; in wpa_supplicant_ctrl_iface_flush()
8812 info->rx_time.usec = 0; in wpa_supplicant_ctrl_iface_flush()
8837 wpa_tdls_enable(wpa_s->wpa, 1); in wpa_supplicant_ctrl_iface_flush()
8842 wpa_s->last_michael_mic_error.sec = 0; in wpa_supplicant_ctrl_iface_flush()
8844 wpa_s->no_keep_alive = 0; in wpa_supplicant_ctrl_iface_flush()
8845 wpa_s->own_disconnect_req = 0; in wpa_supplicant_ctrl_iface_flush()
8846 wpa_s->own_reconnect_req = 0; in wpa_supplicant_ctrl_iface_flush()
8847 wpa_s->deny_ptk0_rekey = 0; in wpa_supplicant_ctrl_iface_flush()
8849 os_free(wpa_s->disallow_aps_bssid); in wpa_supplicant_ctrl_iface_flush()
8850 wpa_s->disallow_aps_bssid = NULL; in wpa_supplicant_ctrl_iface_flush()
8851 wpa_s->disallow_aps_bssid_count = 0; in wpa_supplicant_ctrl_iface_flush()
8852 os_free(wpa_s->disallow_aps_ssid); in wpa_supplicant_ctrl_iface_flush()
8853 wpa_s->disallow_aps_ssid = NULL; in wpa_supplicant_ctrl_iface_flush()
8854 wpa_s->disallow_aps_ssid_count = 0; in wpa_supplicant_ctrl_iface_flush()
8856 wpa_s->set_sta_uapsd = 0; in wpa_supplicant_ctrl_iface_flush()
8857 wpa_s->sta_uapsd = 0; in wpa_supplicant_ctrl_iface_flush()
8859 wpa_s->consecutive_conn_failures = 0; in wpa_supplicant_ctrl_iface_flush()
8865 wpa_config_flush_blobs(wpa_s->conf); in wpa_supplicant_ctrl_iface_flush()
8866 wpa_s->conf->auto_interworking = 0; in wpa_supplicant_ctrl_iface_flush()
8867 wpa_s->conf->okc = 0; in wpa_supplicant_ctrl_iface_flush()
8869 ptksa_cache_flush(wpa_s->ptksa, NULL, WPA_CIPHER_NONE); in wpa_supplicant_ctrl_iface_flush()
8870 wpa_sm_pmksa_cache_flush(wpa_s->wpa, NULL); in wpa_supplicant_ctrl_iface_flush()
8871 rsn_preauth_deinit(wpa_s->wpa); in wpa_supplicant_ctrl_iface_flush()
8873 wpa_sm_set_param(wpa_s->wpa, RSNA_PMK_LIFETIME, 43200); in wpa_supplicant_ctrl_iface_flush()
8874 wpa_sm_set_param(wpa_s->wpa, RSNA_PMK_REAUTH_THRESHOLD, 70); in wpa_supplicant_ctrl_iface_flush()
8875 wpa_sm_set_param(wpa_s->wpa, RSNA_SA_TIMEOUT, 60); in wpa_supplicant_ctrl_iface_flush()
8876 eapol_sm_notify_logoff(wpa_s->eapol, false); in wpa_supplicant_ctrl_iface_flush()
8879 wpa_s->ext_work_in_progress = 0; in wpa_supplicant_ctrl_iface_flush()
8881 wpa_s->next_ssid = NULL; in wpa_supplicant_ctrl_iface_flush()
8892 wpa_s->ext_mgmt_frame_handling = 0; in wpa_supplicant_ctrl_iface_flush()
8893 wpa_s->ext_eapol_frame_io = 0; in wpa_supplicant_ctrl_iface_flush()
8895 wpa_s->extra_roc_dur = 0; in wpa_supplicant_ctrl_iface_flush()
8896 wpa_s->test_failure = WPAS_TEST_FAILURE_NONE; in wpa_supplicant_ctrl_iface_flush()
8897 wpa_s->p2p_go_csa_on_inv = 0; in wpa_supplicant_ctrl_iface_flush()
8898 wpa_s->ignore_auth_resp = 0; in wpa_supplicant_ctrl_iface_flush()
8899 wpa_s->ignore_assoc_disallow = 0; in wpa_supplicant_ctrl_iface_flush()
8900 wpa_s->disable_sa_query = 0; in wpa_supplicant_ctrl_iface_flush()
8901 wpa_s->testing_resend_assoc = 0; in wpa_supplicant_ctrl_iface_flush()
8902 wpa_s->ignore_sae_h2e_only = 0; in wpa_supplicant_ctrl_iface_flush()
8903 wpa_s->ft_rsnxe_used = 0; in wpa_supplicant_ctrl_iface_flush()
8904 wpa_s->reject_btm_req_reason = 0; in wpa_supplicant_ctrl_iface_flush()
8905 wpa_sm_set_test_assoc_ie(wpa_s->wpa, NULL); in wpa_supplicant_ctrl_iface_flush()
8906 wpa_sm_set_test_eapol_m2_elems(wpa_s->wpa, NULL); in wpa_supplicant_ctrl_iface_flush()
8907 wpa_sm_set_test_eapol_m4_elems(wpa_s->wpa, NULL); in wpa_supplicant_ctrl_iface_flush()
8908 wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_ENCRYPT_EAPOL_M2, 0); in wpa_supplicant_ctrl_iface_flush()
8909 wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_ENCRYPT_EAPOL_M4, 0); in wpa_supplicant_ctrl_iface_flush()
8910 os_free(wpa_s->get_pref_freq_list_override); in wpa_supplicant_ctrl_iface_flush()
8911 wpa_s->get_pref_freq_list_override = NULL; in wpa_supplicant_ctrl_iface_flush()
8912 wpabuf_free(wpa_s->sae_commit_override); in wpa_supplicant_ctrl_iface_flush()
8913 wpa_s->sae_commit_override = NULL; in wpa_supplicant_ctrl_iface_flush()
8914 os_free(wpa_s->extra_sae_rejected_groups); in wpa_supplicant_ctrl_iface_flush()
8915 wpa_s->extra_sae_rejected_groups = NULL; in wpa_supplicant_ctrl_iface_flush()
8916 wpabuf_free(wpa_s->rsne_override_eapol); in wpa_supplicant_ctrl_iface_flush()
8917 wpa_s->rsne_override_eapol = NULL; in wpa_supplicant_ctrl_iface_flush()
8918 wpabuf_free(wpa_s->rsnxe_override_assoc); in wpa_supplicant_ctrl_iface_flush()
8919 wpa_s->rsnxe_override_assoc = NULL; in wpa_supplicant_ctrl_iface_flush()
8920 wpabuf_free(wpa_s->rsnxe_override_eapol); in wpa_supplicant_ctrl_iface_flush()
8921 wpa_s->rsnxe_override_eapol = NULL; in wpa_supplicant_ctrl_iface_flush()
8924 wpa_s->disable_scs_support = 0; in wpa_supplicant_ctrl_iface_flush()
8925 wpa_s->disable_mscs_support = 0; in wpa_supplicant_ctrl_iface_flush()
8926 wpa_s->enable_dscp_policy_capa = 0; in wpa_supplicant_ctrl_iface_flush()
8928 wpa_s->oci_freq_override_eapol = 0; in wpa_supplicant_ctrl_iface_flush()
8929 wpa_s->oci_freq_override_saquery_req = 0; in wpa_supplicant_ctrl_iface_flush()
8930 wpa_s->oci_freq_override_saquery_resp = 0; in wpa_supplicant_ctrl_iface_flush()
8931 wpa_s->oci_freq_override_eapol_g2 = 0; in wpa_supplicant_ctrl_iface_flush()
8932 wpa_s->oci_freq_override_ft_assoc = 0; in wpa_supplicant_ctrl_iface_flush()
8933 wpa_s->oci_freq_override_fils_assoc = 0; in wpa_supplicant_ctrl_iface_flush()
8934 wpa_s->oci_freq_override_wnm_sleep = 0; in wpa_supplicant_ctrl_iface_flush()
8935 wpa_s->disable_eapol_g2_tx = 0; in wpa_supplicant_ctrl_iface_flush()
8936 wpa_s->test_assoc_comeback_type = -1; in wpa_supplicant_ctrl_iface_flush()
8938 os_free(wpa_s->dpp_config_obj_override); in wpa_supplicant_ctrl_iface_flush()
8939 wpa_s->dpp_config_obj_override = NULL; in wpa_supplicant_ctrl_iface_flush()
8940 os_free(wpa_s->dpp_discovery_override); in wpa_supplicant_ctrl_iface_flush()
8941 wpa_s->dpp_discovery_override = NULL; in wpa_supplicant_ctrl_iface_flush()
8942 os_free(wpa_s->dpp_groups_override); in wpa_supplicant_ctrl_iface_flush()
8943 wpa_s->dpp_groups_override = NULL; in wpa_supplicant_ctrl_iface_flush()
8944 wpa_s->dpp_ignore_netaccesskey_mismatch = 0; in wpa_supplicant_ctrl_iface_flush()
8945 wpa_s->dpp_discard_public_action = 0; in wpa_supplicant_ctrl_iface_flush()
8950 wpa_s->disconnected = 0; in wpa_supplicant_ctrl_iface_flush()
8951 os_free(wpa_s->next_scan_freqs); in wpa_supplicant_ctrl_iface_flush()
8952 wpa_s->next_scan_freqs = NULL; in wpa_supplicant_ctrl_iface_flush()
8953 os_memset(wpa_s->next_scan_bssid, 0, ETH_ALEN); in wpa_supplicant_ctrl_iface_flush()
8954 wpa_s->next_scan_bssid_wildcard_ssid = 0; in wpa_supplicant_ctrl_iface_flush()
8955 os_free(wpa_s->select_network_scan_freqs); in wpa_supplicant_ctrl_iface_flush()
8956 wpa_s->select_network_scan_freqs = NULL; in wpa_supplicant_ctrl_iface_flush()
8958 os_memset(&wpa_s->robust_av, 0, sizeof(struct robust_av_data)); in wpa_supplicant_ctrl_iface_flush()
8962 if (!dl_list_empty(&wpa_s->bss)) { in wpa_supplicant_ctrl_iface_flush()
8966 dl_list_len(&wpa_s->bss), wpa_s->current_bss, in wpa_supplicant_ctrl_iface_flush()
8967 MAC2STR(wpa_s->bssid), in wpa_supplicant_ctrl_iface_flush()
8968 MAC2STR(wpa_s->pending_bssid)); in wpa_supplicant_ctrl_iface_flush()
8972 wpa_s->wnmsleep_used = 0; in wpa_supplicant_ctrl_iface_flush()
8975 wpa_s->sme.last_unprot_disconnect.sec = 0; in wpa_supplicant_ctrl_iface_flush()
8976 wpa_s->sme.auth_alg = 0; in wpa_supplicant_ctrl_iface_flush()
8979 wpabuf_free(wpa_s->ric_ies); in wpa_supplicant_ctrl_iface_flush()
8980 wpa_s->ric_ies = NULL; in wpa_supplicant_ctrl_iface_flush()
8987 os_memset(&wpa_s->robust_av, 0, sizeof(struct robust_av_data)); in wpa_supplicant_ctrl_iface_flush()
8994 if (wpa_s->mac_addr_changed && wpa_s->conf->mac_addr == 0) in wpa_supplicant_ctrl_iface_flush()
8997 wpa_s->conf->ignore_old_scan_res = 0; in wpa_supplicant_ctrl_iface_flush()
9017 dl_list_for_each(work, &wpa_s->radio->work, struct wpa_radio_work, list) in wpas_ctrl_radio_work_show()
9021 os_reltime_sub(&now, &work->time, &diff); in wpas_ctrl_radio_work_show()
9022 ret = os_snprintf(pos, end - pos, "%s@%s:%u:%u:%ld.%06ld\n", in wpas_ctrl_radio_work_show()
9023 work->type, work->wpa_s->ifname, work->freq, in wpas_ctrl_radio_work_show()
9024 work->started, diff.sec, diff.usec); in wpas_ctrl_radio_work_show()
9025 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_radio_work_show()
9030 return pos - buf; in wpas_ctrl_radio_work_show()
9037 struct wpa_external_work *ework = work->ctx; in wpas_ctrl_radio_work_timeout()
9039 wpa_dbg(work->wpa_s, MSG_DEBUG, in wpas_ctrl_radio_work_timeout()
9041 ework->id, work->type); in wpas_ctrl_radio_work_timeout()
9042 wpa_msg(work->wpa_s, MSG_INFO, EXT_RADIO_WORK_TIMEOUT "%u", ework->id); in wpas_ctrl_radio_work_timeout()
9043 work->wpa_s->ext_work_in_progress = 0; in wpas_ctrl_radio_work_timeout()
9051 struct wpa_external_work *ework = work->ctx; in wpas_ctrl_radio_work_cb()
9054 if (work->started) in wpas_ctrl_radio_work_cb()
9059 * work->type points to a buffer in ework, so need to replace in wpas_ctrl_radio_work_cb()
9063 work->type = "freed-ext-work"; in wpas_ctrl_radio_work_cb()
9064 work->ctx = NULL; in wpas_ctrl_radio_work_cb()
9069 wpa_dbg(work->wpa_s, MSG_DEBUG, "Starting external radio work %u (%s)", in wpas_ctrl_radio_work_cb()
9070 ework->id, ework->type); in wpas_ctrl_radio_work_cb()
9071 wpa_msg(work->wpa_s, MSG_INFO, EXT_RADIO_WORK_START "%u", ework->id); in wpas_ctrl_radio_work_cb()
9072 work->wpa_s->ext_work_in_progress = 1; in wpas_ctrl_radio_work_cb()
9073 if (!ework->timeout) in wpas_ctrl_radio_work_cb()
9074 ework->timeout = 10; in wpas_ctrl_radio_work_cb()
9075 eloop_register_timeout(ework->timeout, 0, wpas_ctrl_radio_work_timeout, in wpas_ctrl_radio_work_cb()
9093 return -1; in wpas_ctrl_radio_work_add()
9097 type_len = pos - cmd; in wpas_ctrl_radio_work_add()
9106 ework->timeout = atoi(pos2 + 8); in wpas_ctrl_radio_work_add()
9110 if (4 + type_len >= sizeof(ework->type)) in wpas_ctrl_radio_work_add()
9111 type_len = sizeof(ework->type) - 4 - 1; in wpas_ctrl_radio_work_add()
9112 os_strlcpy(ework->type, "ext:", sizeof(ework->type)); in wpas_ctrl_radio_work_add()
9113 os_memcpy(ework->type + 4, cmd, type_len); in wpas_ctrl_radio_work_add()
9114 ework->type[4 + type_len] = '\0'; in wpas_ctrl_radio_work_add()
9116 wpa_s->ext_work_id++; in wpas_ctrl_radio_work_add()
9117 if (wpa_s->ext_work_id == 0) in wpas_ctrl_radio_work_add()
9118 wpa_s->ext_work_id++; in wpas_ctrl_radio_work_add()
9119 ework->id = wpa_s->ext_work_id; in wpas_ctrl_radio_work_add()
9121 if (radio_add_work(wpa_s, freq, ework->type, 0, wpas_ctrl_radio_work_cb, in wpas_ctrl_radio_work_add()
9124 return -1; in wpas_ctrl_radio_work_add()
9127 ret = os_snprintf(buf, buflen, "%u", ework->id); in wpas_ctrl_radio_work_add()
9129 return -1; in wpas_ctrl_radio_work_add()
9139 dl_list_for_each(work, &wpa_s->radio->work, struct wpa_radio_work, list) in wpas_ctrl_radio_work_done()
9143 if (os_strncmp(work->type, "ext:", 4) != 0) in wpas_ctrl_radio_work_done()
9145 ework = work->ctx; in wpas_ctrl_radio_work_done()
9146 if (id && ework->id != id) in wpas_ctrl_radio_work_done()
9150 ework->id, ework->type); in wpas_ctrl_radio_work_done()
9152 wpa_s->ext_work_in_progress = 0; in wpas_ctrl_radio_work_done()
9158 return -1; in wpas_ctrl_radio_work_done()
9171 return -1; in wpas_ctrl_radio_work()
9179 if (!wpa_s || !wpa_s->radio) in wpas_ctrl_radio_work_flush()
9182 dl_list_for_each_safe(work, tmp, &wpa_s->radio->work, in wpas_ctrl_radio_work_flush()
9186 if (os_strncmp(work->type, "ext:", 4) != 0) in wpas_ctrl_radio_work_flush()
9188 ework = work->ctx; in wpas_ctrl_radio_work_flush()
9191 work->started ? " started" : "", ework->id, in wpas_ctrl_radio_work_flush()
9192 ework->type); in wpas_ctrl_radio_work_flush()
9193 if (work->started) in wpas_ctrl_radio_work_flush()
9205 eapol_sm_notify_ctrl_response(wpa_s->eapol); in wpas_ctrl_eapol_response()
9218 return -1; in scan_id_list_parse()
9246 if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) { in wpas_ctrl_scan()
9247 *reply_len = -1; in wpas_ctrl_scan()
9253 "Pending scan scheduled - reject new request"); in wpas_ctrl_scan()
9254 *reply_len = os_snprintf(reply, reply_size, "FAIL-BUSY\n"); in wpas_ctrl_scan()
9259 if (wpa_s->fetch_anqp_in_progress || wpa_s->network_select) { in wpas_ctrl_scan()
9261 "Interworking select in progress - reject new scan"); in wpas_ctrl_scan()
9262 *reply_len = os_snprintf(reply, reply_size, "FAIL-BUSY\n"); in wpas_ctrl_scan()
9276 *reply_len = -1; in wpas_ctrl_scan()
9296 *reply_len = -1; in wpas_ctrl_scan()
9307 *reply_len = -1; in wpas_ctrl_scan()
9310 os_memcpy(wpa_s->next_scan_bssid, bssid, ETH_ALEN); in wpas_ctrl_scan()
9312 wpa_s->next_scan_bssid_wildcard_ssid = in wpas_ctrl_scan()
9337 *reply_len = -1; in wpas_ctrl_scan()
9342 if ((end - pos) & 0x01 || in wpas_ctrl_scan()
9343 end - pos > 2 * SSID_MAX_LEN || in wpas_ctrl_scan()
9345 (end - pos) / 2) < 0) { in wpas_ctrl_scan()
9349 *reply_len = -1; in wpas_ctrl_scan()
9352 ssid[ssid_count].ssid_len = (end - pos) / 2; in wpas_ctrl_scan()
9366 wpa_s->num_ssids_from_scan_req = ssid_count; in wpas_ctrl_scan()
9367 os_free(wpa_s->ssids_from_scan_req); in wpas_ctrl_scan()
9369 wpa_s->ssids_from_scan_req = ssid; in wpas_ctrl_scan()
9372 wpa_s->ssids_from_scan_req = NULL; in wpas_ctrl_scan()
9377 else if (wpa_s->scan_res_handler == scan_only_handler) in wpas_ctrl_scan()
9380 scan_res_handler = wpa_s->scan_res_handler; in wpas_ctrl_scan()
9382 if (!wpa_s->sched_scanning && !wpa_s->scanning && in wpas_ctrl_scan()
9383 ((wpa_s->wpa_state <= WPA_SCANNING) || in wpas_ctrl_scan()
9384 (wpa_s->wpa_state == WPA_COMPLETED))) { in wpas_ctrl_scan()
9385 wpa_s->manual_scan_passive = manual_scan_passive; in wpas_ctrl_scan()
9386 wpa_s->manual_scan_use_id = manual_scan_use_id; in wpas_ctrl_scan()
9387 wpa_s->manual_scan_only_new = manual_scan_only_new; in wpas_ctrl_scan()
9388 wpa_s->scan_id_count = scan_id_count; in wpas_ctrl_scan()
9389 wpa_s->manual_non_coloc_6ghz = manual_non_coloc_6ghz; in wpas_ctrl_scan()
9390 os_memcpy(wpa_s->scan_id, scan_id, scan_id_count * sizeof(int)); in wpas_ctrl_scan()
9391 wpa_s->scan_res_handler = scan_res_handler; in wpas_ctrl_scan()
9392 os_free(wpa_s->manual_scan_freqs); in wpas_ctrl_scan()
9393 wpa_s->manual_scan_freqs = manual_scan_freqs; in wpas_ctrl_scan()
9396 wpa_s->normal_scans = 0; in wpas_ctrl_scan()
9397 wpa_s->scan_req = MANUAL_SCAN_REQ; in wpas_ctrl_scan()
9398 wpa_s->after_wps = 0; in wpas_ctrl_scan()
9399 wpa_s->known_wps_freq = 0; in wpas_ctrl_scan()
9401 if (wpa_s->manual_scan_use_id) { in wpas_ctrl_scan()
9402 wpa_s->manual_scan_id++; in wpas_ctrl_scan()
9404 wpa_s->manual_scan_id); in wpas_ctrl_scan()
9406 wpa_s->manual_scan_id); in wpas_ctrl_scan()
9408 } else if (wpa_s->sched_scanning) { in wpas_ctrl_scan()
9409 wpa_s->manual_scan_passive = manual_scan_passive; in wpas_ctrl_scan()
9410 wpa_s->manual_scan_use_id = manual_scan_use_id; in wpas_ctrl_scan()
9411 wpa_s->manual_scan_only_new = manual_scan_only_new; in wpas_ctrl_scan()
9412 wpa_s->scan_id_count = scan_id_count; in wpas_ctrl_scan()
9413 wpa_s->manual_non_coloc_6ghz = manual_non_coloc_6ghz; in wpas_ctrl_scan()
9414 os_memcpy(wpa_s->scan_id, scan_id, scan_id_count * sizeof(int)); in wpas_ctrl_scan()
9415 wpa_s->scan_res_handler = scan_res_handler; in wpas_ctrl_scan()
9416 os_free(wpa_s->manual_scan_freqs); in wpas_ctrl_scan()
9417 wpa_s->manual_scan_freqs = manual_scan_freqs; in wpas_ctrl_scan()
9422 wpa_s->scan_req = MANUAL_SCAN_REQ; in wpas_ctrl_scan()
9424 if (wpa_s->manual_scan_use_id) { in wpas_ctrl_scan()
9425 wpa_s->manual_scan_id++; in wpas_ctrl_scan()
9427 wpa_s->manual_scan_id); in wpas_ctrl_scan()
9429 wpa_s->manual_scan_id); in wpas_ctrl_scan()
9432 wpa_printf(MSG_DEBUG, "Ongoing scan action - reject new request"); in wpas_ctrl_scan()
9433 *reply_len = os_snprintf(reply, reply_size, "FAIL-BUSY\n"); in wpas_ctrl_scan()
9451 wpa_msg(wpa_s, MSG_INFO, "MGMT-TX-STATUS freq=%u dst=" MACSTR in wpas_ctrl_iface_mgmt_tx_cb()
9476 return -1; in wpas_ctrl_iface_mgmt_tx()
9482 return -1; in wpas_ctrl_iface_mgmt_tx()
9505 return -1; in wpas_ctrl_iface_mgmt_tx()
9510 return -1; in wpas_ctrl_iface_mgmt_tx()
9515 return -1; in wpas_ctrl_iface_mgmt_tx()
9519 return -1; in wpas_ctrl_iface_mgmt_tx()
9522 res = offchannel_send_action(wpa_s, freq, da, wpa_s->own_addr, bssid, in wpas_ctrl_iface_mgmt_tx()
9532 wpa_printf(MSG_DEBUG, "External MGMT TX - done waiting"); in wpas_ctrl_iface_mgmt_tx_done()
9546 if (!wpa_s->ext_mgmt_frame_handling) in wpas_ctrl_iface_mgmt_rx_process()
9547 return -1; in wpas_ctrl_iface_mgmt_rx_process()
9551 wpa_printf(MSG_DEBUG, "External MGMT RX process: %s", cmd); in wpas_ctrl_iface_mgmt_rx_process()
9574 return -1; in wpas_ctrl_iface_mgmt_rx_process()
9579 return -1; in wpas_ctrl_iface_mgmt_rx_process()
9584 return -1; in wpas_ctrl_iface_mgmt_rx_process()
9588 return -1; in wpas_ctrl_iface_mgmt_rx_process()
9597 wpa_s->ext_mgmt_frame_handling = 0; in wpas_ctrl_iface_mgmt_rx_process()
9599 wpa_s->ext_mgmt_frame_handling = 1; in wpas_ctrl_iface_mgmt_rx_process()
9613 int ret = -1; in wpas_ctrl_iface_driver_scan_res()
9616 return -1; in wpas_ctrl_iface_driver_scan_res()
9629 return -1; in wpas_ctrl_iface_driver_scan_res()
9634 return -1; in wpas_ctrl_iface_driver_scan_res()
9638 res->flags = strtol(pos + 7, NULL, 16); in wpas_ctrl_iface_driver_scan_res()
9641 if (pos && hwaddr_aton(pos + 7, res->bssid)) in wpas_ctrl_iface_driver_scan_res()
9646 res->freq = atoi(pos + 6); in wpas_ctrl_iface_driver_scan_res()
9650 res->beacon_int = atoi(pos + 12); in wpas_ctrl_iface_driver_scan_res()
9654 res->caps = strtol(pos + 6, NULL, 16); in wpas_ctrl_iface_driver_scan_res()
9658 res->qual = atoi(pos + 6); in wpas_ctrl_iface_driver_scan_res()
9662 res->noise = atoi(pos + 7); in wpas_ctrl_iface_driver_scan_res()
9666 res->level = atoi(pos + 7); in wpas_ctrl_iface_driver_scan_res()
9670 res->tsf = strtoll(pos + 5, NULL, 16); in wpas_ctrl_iface_driver_scan_res()
9674 res->age = atoi(pos + 5); in wpas_ctrl_iface_driver_scan_res()
9678 res->est_throughput = atoi(pos + 16); in wpas_ctrl_iface_driver_scan_res()
9682 res->snr = atoi(pos + 5); in wpas_ctrl_iface_driver_scan_res()
9686 res->parent_tsf = strtoll(pos + 7, NULL, 16); in wpas_ctrl_iface_driver_scan_res()
9689 if (pos && hwaddr_aton(pos + 11, res->tsf_bssid)) in wpas_ctrl_iface_driver_scan_res()
9698 res->ie_len = (end - pos) / 2; in wpas_ctrl_iface_driver_scan_res()
9699 if (hexstr2bin(pos, (u8 *) (res + 1), res->ie_len)) in wpas_ctrl_iface_driver_scan_res()
9709 res->beacon_ie_len = (end - pos) / 2; in wpas_ctrl_iface_driver_scan_res()
9710 if (hexstr2bin(pos, ((u8 *) (res + 1)) + res->ie_len, in wpas_ctrl_iface_driver_scan_res()
9711 res->beacon_ie_len)) in wpas_ctrl_iface_driver_scan_res()
9731 int ret = -1; in wpas_ctrl_iface_driver_event_assoc()
9754 ai->reassoc = atoi(pos); in wpas_ctrl_iface_driver_event_assoc()
9760 ai->req_ies = wpabuf_head(req_ies); in wpas_ctrl_iface_driver_event_assoc()
9761 ai->req_ies_len = wpabuf_len(req_ies); in wpas_ctrl_iface_driver_event_assoc()
9767 ai->resp_ies = wpabuf_head(resp_ies); in wpas_ctrl_iface_driver_event_assoc()
9768 ai->resp_ies_len = wpabuf_len(resp_ies); in wpas_ctrl_iface_driver_event_assoc()
9774 ai->resp_frame = wpabuf_head(resp_frame); in wpas_ctrl_iface_driver_event_assoc()
9775 ai->resp_frame_len = wpabuf_len(resp_frame); in wpas_ctrl_iface_driver_event_assoc()
9781 ai->beacon_ies = wpabuf_head(beacon_ies); in wpas_ctrl_iface_driver_event_assoc()
9782 ai->beacon_ies_len = wpabuf_len(beacon_ies); in wpas_ctrl_iface_driver_event_assoc()
9784 ai->freq = atoi(pos); in wpas_ctrl_iface_driver_event_assoc()
9786 ai->wmm_params.info_bitmap = atoi(pos); in wpas_ctrl_iface_driver_event_assoc()
9788 ai->wmm_params.uapsd_queues = atoi(pos); in wpas_ctrl_iface_driver_event_assoc()
9792 ai->addr = addr; in wpas_ctrl_iface_driver_event_assoc()
9794 ai->authorized = atoi(pos); in wpas_ctrl_iface_driver_event_assoc()
9800 ai->key_replay_ctr = wpabuf_head(key_replay_ctr); in wpas_ctrl_iface_driver_event_assoc()
9801 ai->key_replay_ctr_len = wpabuf_len(key_replay_ctr); in wpas_ctrl_iface_driver_event_assoc()
9807 ai->ptk_kck = wpabuf_head(ptk_kck); in wpas_ctrl_iface_driver_event_assoc()
9808 ai->ptk_kck_len = wpabuf_len(ptk_kck); in wpas_ctrl_iface_driver_event_assoc()
9814 ai->ptk_kek = wpabuf_head(ptk_kek); in wpas_ctrl_iface_driver_event_assoc()
9815 ai->ptk_kek_len = wpabuf_len(ptk_kek); in wpas_ctrl_iface_driver_event_assoc()
9817 ai->subnet_status = atoi(pos); in wpas_ctrl_iface_driver_event_assoc()
9819 ai->fils_erp_next_seq_num = atoi(pos); in wpas_ctrl_iface_driver_event_assoc()
9825 ai->fils_pmk = wpabuf_head(fils_pmk); in wpas_ctrl_iface_driver_event_assoc()
9826 ai->fils_pmk_len = wpabuf_len(fils_pmk); in wpas_ctrl_iface_driver_event_assoc()
9830 ai->fils_pmkid = fils_pmkid; in wpas_ctrl_iface_driver_event_assoc()
9859 wpa_dbg(wpa_s, MSG_DEBUG, "Testing - external driver event: %s", cmd); in wpas_ctrl_iface_driver_event()
9877 return -1; in wpas_ctrl_iface_driver_event()
9886 wpa_dbg(wpa_s, MSG_DEBUG, "Testing - unknown driver event: %s", in wpas_ctrl_iface_driver_event()
9888 return -1; in wpas_ctrl_iface_driver_event()
9904 wpa_printf(MSG_DEBUG, "External EAPOL RX: %s", cmd); in wpas_ctrl_iface_eapol_rx()
9909 return -1; in wpas_ctrl_iface_eapol_rx()
9916 return -1; in wpas_ctrl_iface_eapol_rx()
9921 return -1; in wpas_ctrl_iface_eapol_rx()
9925 return -1; in wpas_ctrl_iface_eapol_rx()
9948 return -1; in wpas_ctrl_iface_eapol_tx()
9955 return -1; in wpas_ctrl_iface_eapol_tx()
9961 return -1; in wpas_ctrl_iface_eapol_tx()
9964 prev = wpa_s->ext_eapol_frame_io; in wpas_ctrl_iface_eapol_tx()
9965 wpa_s->ext_eapol_frame_io = 0; in wpas_ctrl_iface_eapol_tx()
9967 wpa_s->ext_eapol_frame_io = prev; in wpas_ctrl_iface_eapol_tx()
9991 #define HWSIM_IP_LEN (HWSIM_PACKETLEN - sizeof(struct ether_header))
10005 "test data: RX - ignore unexpected length %d", in wpas_data_test_rx()
10016 "test data: RX - ignore unexpected IP header"); in wpas_data_test_rx()
10020 for (i = 0; i < ntohs(ip.ip_len) - sizeof(ip); i++) { in wpas_data_test_rx()
10023 "test data: RX - ignore mismatching payload"); in wpas_data_test_rx()
10031 wpa_msg(wpa_s, MSG_INFO, "DATA-TEST-RX " MACSTR " " MACSTR "%s", in wpas_data_test_rx()
10032 MAC2STR(eth->ether_dhost), MAC2STR(eth->ether_shost), extra); in wpas_data_test_rx()
10044 if (wpa_s->l2_test) { in wpas_ctrl_iface_data_test_config()
10045 l2_packet_deinit(wpa_s->l2_test); in wpas_ctrl_iface_data_test_config()
10046 wpa_s->l2_test = NULL; in wpas_ctrl_iface_data_test_config()
10052 if (wpa_s->l2_test) in wpas_ctrl_iface_data_test_config()
10059 ifname = wpa_s->ifname; in wpas_ctrl_iface_data_test_config()
10061 wpa_s->l2_test = l2_packet_init(ifname, wpa_s->own_addr, in wpas_ctrl_iface_data_test_config()
10064 if (wpa_s->l2_test == NULL) in wpas_ctrl_iface_data_test_config()
10065 return -1; in wpas_ctrl_iface_data_test_config()
10087 if (wpa_s->l2_test == NULL) in wpas_ctrl_iface_data_test_tx()
10088 return -1; in wpas_ctrl_iface_data_test_tx()
10095 return -1; in wpas_ctrl_iface_data_test_tx()
10101 return -1; in wpas_ctrl_iface_data_test_tx()
10106 return -1; in wpas_ctrl_iface_data_test_tx()
10113 return -1; in wpas_ctrl_iface_data_test_tx()
10118 os_memcpy(eth->ether_dhost, dst, ETH_ALEN); in wpas_ctrl_iface_data_test_tx()
10119 os_memcpy(eth->ether_shost, src, ETH_ALEN); in wpas_ctrl_iface_data_test_tx()
10120 eth->ether_type = htons(ETHERTYPE_IP); in wpas_ctrl_iface_data_test_tx()
10123 ip->ip_hl = 5; in wpas_ctrl_iface_data_test_tx()
10124 ip->ip_v = 4; in wpas_ctrl_iface_data_test_tx()
10125 ip->ip_ttl = 64; in wpas_ctrl_iface_data_test_tx()
10126 ip->ip_tos = tos; in wpas_ctrl_iface_data_test_tx()
10127 ip->ip_len = htons(send_len); in wpas_ctrl_iface_data_test_tx()
10128 ip->ip_p = 1; in wpas_ctrl_iface_data_test_tx()
10129 ip->ip_src.s_addr = htonl(192U << 24 | 168 << 16 | 1 << 8 | 1); in wpas_ctrl_iface_data_test_tx()
10130 ip->ip_dst.s_addr = htonl(192U << 24 | 168 << 16 | 1 << 8 | 2); in wpas_ctrl_iface_data_test_tx()
10131 ip->ip_sum = ipv4_hdr_checksum(ip, sizeof(*ip)); in wpas_ctrl_iface_data_test_tx()
10133 for (i = 0; i < send_len - sizeof(*ip); i++) in wpas_ctrl_iface_data_test_tx()
10136 if (l2_packet_send(wpa_s->l2_test, dst, ETHERTYPE_IP, &buf[2], in wpas_ctrl_iface_data_test_tx()
10138 return -1; in wpas_ctrl_iface_data_test_tx()
10155 int res = -1; in wpas_ctrl_iface_data_test_frame()
10159 return -1; in wpas_ctrl_iface_data_test_frame()
10164 return -1; in wpas_ctrl_iface_data_test_frame()
10170 ethertype = ntohs(eth->ether_type); in wpas_ctrl_iface_data_test_frame()
10172 l2 = l2_packet_init(wpa_s->ifname, wpa_s->own_addr, ethertype, in wpas_ctrl_iface_data_test_frame()
10177 res = l2_packet_send(l2, eth->ether_dhost, ethertype, buf, len); in wpas_ctrl_iface_data_test_frame()
10184 return res < 0 ? -1 : 0; in wpas_ctrl_iface_data_test_frame()
10196 wpa_msg_ctrl(wpa_s, MSG_INFO, "TEST-EVENT-MESSAGE %d/%d", in wpas_ctrl_event_test_cb()
10208 return -1; in wpas_ctrl_event_test()
10222 return -1; in wpas_get_hex_buf()
10230 return -1; in wpas_get_hex_buf()
10234 return -1; in wpas_get_hex_buf()
10249 return -1; in wpas_ctrl_test_assoc_ie()
10250 wpa_sm_set_test_assoc_ie(wpa_s->wpa, buf); in wpas_ctrl_test_assoc_ie()
10261 return -1; in wpas_ctrl_test_eapol_m2_elems()
10262 wpa_sm_set_test_eapol_m2_elems(wpa_s->wpa, buf); in wpas_ctrl_test_eapol_m2_elems()
10273 return -1; in wpas_ctrl_test_eapol_m4_elems()
10274 wpa_sm_set_test_eapol_m4_elems(wpa_s->wpa, buf); in wpas_ctrl_test_eapol_m4_elems()
10283 if (wpa_s->last_tk_alg == WPA_ALG_NONE) in wpas_ctrl_reset_pn()
10284 return -1; in wpas_ctrl_reset_pn()
10291 if (wpa_drv_set_key(wpa_s, -1, wpa_s->last_tk_alg, wpa_s->last_tk_addr, in wpas_ctrl_reset_pn()
10292 wpa_s->last_tk_key_idx, 1, zero, 6, in wpas_ctrl_reset_pn()
10293 zero, wpa_s->last_tk_len, in wpas_ctrl_reset_pn()
10295 return -1; in wpas_ctrl_reset_pn()
10298 return wpa_drv_set_key(wpa_s, -1, wpa_s->last_tk_alg, in wpas_ctrl_reset_pn()
10299 wpa_s->last_tk_addr, in wpas_ctrl_reset_pn()
10300 wpa_s->last_tk_key_idx, 1, zero, 6, in wpas_ctrl_reset_pn()
10301 wpa_s->last_tk, wpa_s->last_tk_len, in wpas_ctrl_reset_pn()
10314 return -1; in wpas_ctrl_key_request()
10316 wpa_sm_key_request(wpa_s->wpa, error, pairwise); in wpas_ctrl_key_request()
10328 params.bssid = wpa_s->bssid; in wpas_ctrl_resend_assoc()
10329 params.ssid = wpa_s->sme.ssid; in wpas_ctrl_resend_assoc()
10330 params.ssid_len = wpa_s->sme.ssid_len; in wpas_ctrl_resend_assoc()
10331 params.freq.freq = wpa_s->sme.freq; in wpas_ctrl_resend_assoc()
10332 if (wpa_s->last_assoc_req_wpa_ie) { in wpas_ctrl_resend_assoc()
10333 params.wpa_ie = wpabuf_head(wpa_s->last_assoc_req_wpa_ie); in wpas_ctrl_resend_assoc()
10334 params.wpa_ie_len = wpabuf_len(wpa_s->last_assoc_req_wpa_ie); in wpas_ctrl_resend_assoc()
10336 params.pairwise_suite = wpa_s->pairwise_cipher; in wpas_ctrl_resend_assoc()
10337 params.group_suite = wpa_s->group_cipher; in wpas_ctrl_resend_assoc()
10338 params.mgmt_group_suite = wpa_s->mgmt_group_cipher; in wpas_ctrl_resend_assoc()
10339 params.key_mgmt_suite = wpa_s->key_mgmt; in wpas_ctrl_resend_assoc()
10340 params.wpa_proto = wpa_s->wpa_proto; in wpas_ctrl_resend_assoc()
10341 params.mgmt_frame_protection = wpa_s->sme.mfp; in wpas_ctrl_resend_assoc()
10342 params.rrm_used = wpa_s->rrm.rrm_used; in wpas_ctrl_resend_assoc()
10343 if (wpa_s->sme.prev_bssid_set) in wpas_ctrl_resend_assoc()
10344 params.prev_bssid = wpa_s->sme.prev_bssid; in wpas_ctrl_resend_assoc()
10347 wpa_s->testing_resend_assoc = 1; in wpas_ctrl_resend_assoc()
10350 return -1; in wpas_ctrl_resend_assoc()
10371 u8 control = BIT(4); /* Control field (IEEE Std 802.11ax-2021, in wpas_ctrl_iface_send_twt_setup()
10372 * Figure 9-687 - Control field format): in wpas_ctrl_iface_send_twt_setup()
10399 return -1; in wpas_ctrl_iface_send_twt_setup()
10466 return -1; in wpas_ctrl_vendor_elem_add()
10471 return -1; in wpas_ctrl_vendor_elem_add()
10478 return -1; in wpas_ctrl_vendor_elem_add()
10483 return -1; in wpas_ctrl_vendor_elem_add()
10487 return -1; in wpas_ctrl_vendor_elem_add()
10493 return -1; in wpas_ctrl_vendor_elem_add()
10496 if (wpa_s->vendor_elem[frame] == NULL) { in wpas_ctrl_vendor_elem_add()
10497 wpa_s->vendor_elem[frame] = buf; in wpas_ctrl_vendor_elem_add()
10501 if (wpabuf_resize(&wpa_s->vendor_elem[frame], len) < 0) { in wpas_ctrl_vendor_elem_add()
10503 return -1; in wpas_ctrl_vendor_elem_add()
10506 wpabuf_put_buf(wpa_s->vendor_elem[frame], buf); in wpas_ctrl_vendor_elem_add()
10526 return -1; in wpas_ctrl_vendor_elem_get()
10529 if (wpa_s->vendor_elem[frame] == NULL) in wpas_ctrl_vendor_elem_get()
10533 wpabuf_head_u8(wpa_s->vendor_elem[frame]), in wpas_ctrl_vendor_elem_get()
10534 wpabuf_len(wpa_s->vendor_elem[frame])); in wpas_ctrl_vendor_elem_get()
10549 return -1; in wpas_ctrl_vendor_elem_remove()
10554 return -1; in wpas_ctrl_vendor_elem_remove()
10558 wpabuf_free(wpa_s->vendor_elem[frame]); in wpas_ctrl_vendor_elem_remove()
10559 wpa_s->vendor_elem[frame] = NULL; in wpas_ctrl_vendor_elem_remove()
10564 if (wpa_s->vendor_elem[frame] == NULL) in wpas_ctrl_vendor_elem_remove()
10565 return -1; in wpas_ctrl_vendor_elem_remove()
10571 return -1; in wpas_ctrl_vendor_elem_remove()
10576 return -1; in wpas_ctrl_vendor_elem_remove()
10580 return -1; in wpas_ctrl_vendor_elem_remove()
10585 return -1; in wpas_ctrl_vendor_elem_remove()
10603 * Neighbor Report element (IEEE P802.11-REVmc/D5.0) in wpas_ctrl_neighbor_rep_cb()
10650 while (end - pos > 2) { in wpas_ctrl_neighbor_rep_cb()
10655 if (s_len > end - pos) in wpas_ctrl_neighbor_rep_cb()
10691 len -= 2 + nr_len; in wpas_ctrl_neighbor_rep_cb()
10711 return -1; in wpas_ctrl_iface_send_neighbor_rep()
10744 eapol_sm_erp_flush(wpa_s->eapol); in wpas_ctrl_iface_erp_flush()
10765 type = wpa_s->mac_addr_rand_supported; in wpas_ctrl_iface_mac_rand_scan()
10774 return -1; in wpas_ctrl_iface_mac_rand_scan()
10782 return -1; in wpas_ctrl_iface_mac_rand_scan()
10788 return -1; in wpas_ctrl_iface_mac_rand_scan()
10794 return -1; in wpas_ctrl_iface_mac_rand_scan()
10800 return -1; in wpas_ctrl_iface_mac_rand_scan()
10815 reply_len = wpa_sm_pmksa_cache_list(wpa_s->wpa, buf, buflen); in wpas_ctrl_iface_pmksa()
10818 buflen - reply_len); in wpas_ctrl_iface_pmksa()
10826 ptksa_cache_flush(wpa_s->ptksa, NULL, WPA_CIPHER_NONE); in wpas_ctrl_iface_pmksa_flush()
10827 wpa_sm_pmksa_cache_flush(wpa_s->wpa, NULL); in wpas_ctrl_iface_pmksa_flush()
10845 ssid = wpa_config_get_network(wpa_s->conf, atoi(cmd)); in wpas_ctrl_iface_pmksa_get()
10847 return -1; in wpas_ctrl_iface_pmksa_get()
10861 for (entry = wpa_sm_pmksa_cache_head(wpa_s->wpa); entry; in wpas_ctrl_iface_pmksa_get()
10862 entry = entry->next) { in wpas_ctrl_iface_pmksa_get()
10863 if (entry->network_ctx != ssid) in wpas_ctrl_iface_pmksa_get()
10867 ret = os_snprintf(pos2, end - pos2, MACSTR " ", in wpas_ctrl_iface_pmksa_get()
10868 MAC2STR(entry->aa)); in wpas_ctrl_iface_pmksa_get()
10869 if (os_snprintf_error(end - pos2, ret)) in wpas_ctrl_iface_pmksa_get()
10873 pos2 += wpa_snprintf_hex(pos2, end - pos2, entry->pmkid, in wpas_ctrl_iface_pmksa_get()
10876 ret = os_snprintf(pos2, end - pos2, " "); in wpas_ctrl_iface_pmksa_get()
10877 if (os_snprintf_error(end - pos2, ret)) in wpas_ctrl_iface_pmksa_get()
10881 pos2 += wpa_snprintf_hex(pos2, end - pos2, entry->pmk, in wpas_ctrl_iface_pmksa_get()
10882 entry->pmk_len); in wpas_ctrl_iface_pmksa_get()
10884 ret = os_snprintf(pos2, end - pos2, " %d %d %d %d", in wpas_ctrl_iface_pmksa_get()
10885 (int) (entry->reauth_time - now.sec), in wpas_ctrl_iface_pmksa_get()
10886 (int) (entry->expiration - now.sec), in wpas_ctrl_iface_pmksa_get()
10887 entry->akmp, in wpas_ctrl_iface_pmksa_get()
10888 entry->opportunistic); in wpas_ctrl_iface_pmksa_get()
10889 if (os_snprintf_error(end - pos2, ret)) in wpas_ctrl_iface_pmksa_get()
10893 if (entry->fils_cache_id_set) { in wpas_ctrl_iface_pmksa_get()
10894 ret = os_snprintf(pos2, end - pos2, " %02x%02x", in wpas_ctrl_iface_pmksa_get()
10895 entry->fils_cache_id[0], in wpas_ctrl_iface_pmksa_get()
10896 entry->fils_cache_id[1]); in wpas_ctrl_iface_pmksa_get()
10897 if (os_snprintf_error(end - pos2, ret)) in wpas_ctrl_iface_pmksa_get()
10902 ret = os_snprintf(pos2, end - pos2, "\n"); in wpas_ctrl_iface_pmksa_get()
10903 if (os_snprintf_error(end - pos2, ret)) in wpas_ctrl_iface_pmksa_get()
10910 return pos - buf; in wpas_ctrl_iface_pmksa_get()
10920 int ret = -1; in wpas_ctrl_iface_pmksa_add()
10931 ssid = wpa_config_get_network(wpa_s->conf, atoi(cmd)); in wpas_ctrl_iface_pmksa_add()
10933 return -1; in wpas_ctrl_iface_pmksa_add()
10937 return -1; in wpas_ctrl_iface_pmksa_add()
10942 return -1; in wpas_ctrl_iface_pmksa_add()
10944 if (hwaddr_aton(pos, entry->aa)) in wpas_ctrl_iface_pmksa_add()
10952 if (hexstr2bin(pos, entry->pmkid, PMKID_LEN) < 0) in wpas_ctrl_iface_pmksa_add()
10963 entry->pmk_len = (pos2 - pos) / 2; in wpas_ctrl_iface_pmksa_add()
10964 if (entry->pmk_len < PMK_LEN || entry->pmk_len > PMK_LEN_MAX || in wpas_ctrl_iface_pmksa_add()
10965 hexstr2bin(pos, entry->pmk, entry->pmk_len) < 0) in wpas_ctrl_iface_pmksa_add()
10974 &entry->akmp, &entry->opportunistic) != 4) in wpas_ctrl_iface_pmksa_add()
10988 if (hexstr2bin(pos, entry->fils_cache_id, in wpas_ctrl_iface_pmksa_add()
10991 entry->fils_cache_id_set = 1; in wpas_ctrl_iface_pmksa_add()
10994 entry->expiration = now.sec + expiration; in wpas_ctrl_iface_pmksa_add()
10995 entry->reauth_time = now.sec + reauth_time; in wpas_ctrl_iface_pmksa_add()
10997 entry->network_ctx = ssid; in wpas_ctrl_iface_pmksa_add()
10998 os_memcpy(entry->spa, wpa_s->own_addr, ETH_ALEN); in wpas_ctrl_iface_pmksa_add()
11000 entry->external = true; in wpas_ctrl_iface_pmksa_add()
11002 wpa_sm_pmksa_cache_add_entry(wpa_s->wpa, entry); in wpas_ctrl_iface_pmksa_add()
11019 if (!wpa_s->ifmsh) in wpas_ctrl_iface_mesh_pmksa_get()
11020 return -1; in wpas_ctrl_iface_mesh_pmksa_get()
11026 return -1; in wpas_ctrl_iface_mesh_pmksa_get()
11037 * stored before wpa_s->ifmsh creation to suppress commit message in wpas_ctrl_iface_mesh_pmksa_add()
11058 return -1; in wpas_ctrl_iface_fils_hlp_req_add()
11060 if (hwaddr_aton(cmd, req->dst)) in wpas_ctrl_iface_fils_hlp_req_add()
11067 req->pkt = wpabuf_parse_bin(pos); in wpas_ctrl_iface_fils_hlp_req_add()
11068 if (!req->pkt) in wpas_ctrl_iface_fils_hlp_req_add()
11071 dl_list_add_tail(&wpa_s->fils_hlp_req, &req->list); in wpas_ctrl_iface_fils_hlp_req_add()
11074 wpabuf_free(req->pkt); in wpas_ctrl_iface_fils_hlp_req_add()
11076 return -1; in wpas_ctrl_iface_fils_hlp_req_add()
11083 if (os_strcmp(cmd, "PING") == 0 || in wpas_ctrl_cmd_debug_level()
11088 os_strncmp(cmd, "STA-", 4) == 0) in wpas_ctrl_cmd_debug_level()
11100 struct robust_av_data *robust_av = &wpa_s->robust_av; in wpas_ctrl_iface_configure_mscs()
11110 robust_av->request_type = SCS_REQ_ADD; in wpas_ctrl_iface_configure_mscs()
11112 robust_av->request_type = SCS_REQ_REMOVE; in wpas_ctrl_iface_configure_mscs()
11113 robust_av->valid_config = false; in wpas_ctrl_iface_configure_mscs()
11116 robust_av->request_type = SCS_REQ_CHANGE; in wpas_ctrl_iface_configure_mscs()
11118 return -1; in wpas_ctrl_iface_configure_mscs()
11123 return -1; in wpas_ctrl_iface_configure_mscs()
11127 return -1; in wpas_ctrl_iface_configure_mscs()
11128 robust_av->up_bitmap = val; in wpas_ctrl_iface_configure_mscs()
11132 return -1; in wpas_ctrl_iface_configure_mscs()
11134 robust_av->up_limit = atoi(pos + 9); in wpas_ctrl_iface_configure_mscs()
11138 return -1; in wpas_ctrl_iface_configure_mscs()
11140 robust_av->stream_timeout = atoi(pos + 15); in wpas_ctrl_iface_configure_mscs()
11141 if (robust_av->stream_timeout == 0) in wpas_ctrl_iface_configure_mscs()
11142 return -1; in wpas_ctrl_iface_configure_mscs()
11146 return -1; in wpas_ctrl_iface_configure_mscs()
11153 frame_classifier_len = (end - pos) / 2; in wpas_ctrl_iface_configure_mscs()
11154 if (frame_classifier_len > sizeof(robust_av->frame_classifier) || in wpas_ctrl_iface_configure_mscs()
11155 hexstr2bin(pos, robust_av->frame_classifier, frame_classifier_len)) in wpas_ctrl_iface_configure_mscs()
11156 return -1; in wpas_ctrl_iface_configure_mscs()
11158 robust_av->frame_classifier_len = frame_classifier_len; in wpas_ctrl_iface_configure_mscs()
11159 robust_av->valid_config = true; in wpas_ctrl_iface_configure_mscs()
11171 int akmp = -1, cipher = -1, got_bssid = 0; in wpas_ctrl_iface_pasn_start()
11175 int id = 0, ret = -1; in wpas_ctrl_iface_pasn_start()
11189 } else if (os_strcmp(token, "akmp=FT-PSK") == 0) { in wpas_ctrl_iface_pasn_start()
11191 } else if (os_strcmp(token, "akmp=FT-EAP-SHA384") == 0) { in wpas_ctrl_iface_pasn_start()
11193 } else if (os_strcmp(token, "akmp=FT-EAP") == 0) { in wpas_ctrl_iface_pasn_start()
11199 } else if (os_strcmp(token, "akmp=SAE-EXT-KEY") == 0) { in wpas_ctrl_iface_pasn_start()
11203 } else if (os_strcmp(token, "akmp=FILS-SHA256") == 0) { in wpas_ctrl_iface_pasn_start()
11205 } else if (os_strcmp(token, "akmp=FILS-SHA384") == 0) { in wpas_ctrl_iface_pasn_start()
11208 } else if (os_strcmp(token, "cipher=CCMP-256") == 0) { in wpas_ctrl_iface_pasn_start()
11210 } else if (os_strcmp(token, "cipher=GCMP-256") == 0) { in wpas_ctrl_iface_pasn_start()
11238 if (!got_bssid || akmp == -1 || cipher == -1 || group == 0xFFFF) { in wpas_ctrl_iface_pasn_start()
11243 ret = wpas_pasn_auth_start(wpa_s, wpa_s->own_addr, bssid, akmp, cipher, in wpas_ctrl_iface_pasn_start()
11259 return -1; in wpas_ctrl_iface_pasn_deauthenticate()
11262 return wpas_pasn_deauthenticate(wpa_s, wpa_s->own_addr, bssid); in wpas_ctrl_iface_pasn_deauthenticate()
11282 return -1; in wpas_ctrl_iface_pasn_driver()
11286 return -1; in wpas_ctrl_iface_pasn_driver()
11292 return -1; in wpas_ctrl_iface_pasn_driver()
11294 os_memcpy(peer->own_addr, wpa_s->own_addr, ETH_ALEN); in wpas_ctrl_iface_pasn_driver()
11295 os_memcpy(peer->peer_addr, addr, ETH_ALEN); in wpas_ctrl_iface_pasn_driver()
11324 param->ip_version = IPV4; in set_type4_frame_classifier()
11326 param->ip_version = IPV6; in set_type4_frame_classifier()
11329 return -1; in set_type4_frame_classifier()
11341 alen = end - pos; in set_type4_frame_classifier()
11343 return -1; in set_type4_frame_classifier()
11346 if (param->ip_version == IPV4) in set_type4_frame_classifier()
11348 &param->ip_params.v4.src_ip); in set_type4_frame_classifier()
11351 &param->ip_params.v6.src_ip); in set_type4_frame_classifier()
11357 return -1; in set_type4_frame_classifier()
11370 alen = end - pos; in set_type4_frame_classifier()
11372 return -1; in set_type4_frame_classifier()
11375 if (param->ip_version == IPV4) in set_type4_frame_classifier()
11377 &param->ip_params.v4.dst_ip); in set_type4_frame_classifier()
11380 &param->ip_params.v6.dst_ip); in set_type4_frame_classifier()
11386 return -1; in set_type4_frame_classifier()
11394 if (param->ip_version == IPV4) in set_type4_frame_classifier()
11395 param->ip_params.v4.src_port = atoi(pos + 9); in set_type4_frame_classifier()
11397 param->ip_params.v6.src_port = atoi(pos + 9); in set_type4_frame_classifier()
11403 if (param->ip_version == IPV4) in set_type4_frame_classifier()
11404 param->ip_params.v4.dst_port = atoi(pos + 9); in set_type4_frame_classifier()
11406 param->ip_params.v6.dst_port = atoi(pos + 9); in set_type4_frame_classifier()
11412 if (param->ip_version == IPV4) in set_type4_frame_classifier()
11413 param->ip_params.v4.dscp = atoi(pos + 5); in set_type4_frame_classifier()
11415 param->ip_params.v6.dscp = atoi(pos + 5); in set_type4_frame_classifier()
11419 if (param->ip_version == IPV4) { in set_type4_frame_classifier()
11423 param->ip_params.v4.protocol = 17; in set_type4_frame_classifier()
11425 param->ip_params.v4.protocol = 6; in set_type4_frame_classifier()
11427 param->ip_params.v4.protocol = 50; in set_type4_frame_classifier()
11430 return -1; in set_type4_frame_classifier()
11438 param->ip_params.v6.next_header = 17; in set_type4_frame_classifier()
11440 param->ip_params.v6.next_header = 6; in set_type4_frame_classifier()
11442 param->ip_params.v6.next_header = 50; in set_type4_frame_classifier()
11445 return -1; in set_type4_frame_classifier()
11458 if (end - pos != 6 || in set_type4_frame_classifier()
11459 hexstr2bin(pos, param->ip_params.v6.flow_label, in set_type4_frame_classifier()
11461 param->ip_params.v6.flow_label[0] > 0x0F) { in set_type4_frame_classifier()
11463 return -1; in set_type4_frame_classifier()
11470 param->classifier_mask = classifier_mask; in set_type4_frame_classifier()
11484 return -1; in set_type10_frame_classifier()
11486 param->prot_instance = atoi(pos + 14); in set_type10_frame_classifier()
11491 return -1; in set_type10_frame_classifier()
11494 param->prot_number = 17; in set_type10_frame_classifier()
11496 param->prot_number = 6; in set_type10_frame_classifier()
11498 param->prot_number = 50; in set_type10_frame_classifier()
11501 return -1; in set_type10_frame_classifier()
11508 return -1; in set_type10_frame_classifier()
11516 filter_len = (end - pos) / 2; in set_type10_frame_classifier()
11517 param->filter_value = os_malloc(filter_len); in set_type10_frame_classifier()
11518 if (!param->filter_value) in set_type10_frame_classifier()
11519 return -1; in set_type10_frame_classifier()
11521 if (hexstr2bin(pos, param->filter_value, filter_len)) { in set_type10_frame_classifier()
11538 if (filter_len != (size_t) (end - pos) / 2) { in set_type10_frame_classifier()
11541 filter_len, (size_t) (end - pos) / 2); in set_type10_frame_classifier()
11545 param->filter_mask = os_malloc(filter_len); in set_type10_frame_classifier()
11546 if (!param->filter_mask) in set_type10_frame_classifier()
11549 if (hexstr2bin(pos, param->filter_mask, filter_len)) { in set_type10_frame_classifier()
11551 os_free(param->filter_mask); in set_type10_frame_classifier()
11552 param->filter_mask = NULL; in set_type10_frame_classifier()
11556 param->filter_len = filter_len; in set_type10_frame_classifier()
11559 os_free(param->filter_value); in set_type10_frame_classifier()
11560 param->filter_value = NULL; in set_type10_frame_classifier()
11561 return -1; in set_type10_frame_classifier()
11569 if (set_type4_frame_classifier(pos, &type4_param) == -1) { in scs_parse_type4()
11571 return -1; in scs_parse_type4()
11574 os_memcpy(&elem->frame_classifier.type4_param, in scs_parse_type4()
11584 if (set_type10_frame_classifier(pos, &type10_param) == -1) { in scs_parse_type10()
11586 return -1; in scs_parse_type10()
11589 os_memcpy(&elem->frame_classifier.type10_param, in scs_parse_type10()
11599 struct scs_robust_av_data *scs_data = &wpa_s->scs_robust_av_req; in wpas_ctrl_iface_configure_scs()
11604 if (wpa_s->ongoing_scs_req) { in wpas_ctrl_iface_configure_scs()
11607 return -1; in wpas_ctrl_iface_configure_scs()
11612 * [scs_id=<decimal number>] <add|remove|change> [scs_up=<0-7>] in wpas_ctrl_iface_configure_scs()
11629 return -1; in wpas_ctrl_iface_configure_scs()
11657 pos1[next_scs_desc - pos1 - 1] = '\0'; in wpas_ctrl_iface_configure_scs()
11660 dl_list_for_each(active_scs_desc, &wpa_s->active_scs_ids, in wpas_ctrl_iface_configure_scs()
11662 if (desc_elem.scs_id == active_scs_desc->scs_id) { in wpas_ctrl_iface_configure_scs()
11673 return -1; in wpas_ctrl_iface_configure_scs()
11680 return -1; in wpas_ctrl_iface_configure_scs()
11688 return -1; in wpas_ctrl_iface_configure_scs()
11698 "Intra-Access user priority not present"); in wpas_ctrl_iface_configure_scs()
11705 "Intra-Access user priority invalid %d", in wpas_ctrl_iface_configure_scs()
11737 pos[next_tclas_elem - pos - 1] = '\0'; in wpas_ctrl_iface_configure_scs()
11789 qos_elem->available = true; in wpas_ctrl_iface_configure_scs()
11791 qos_elem->direction = SCS_DIRECTION_UP; in wpas_ctrl_iface_configure_scs()
11798 qos_elem->direction = SCS_DIRECTION_DOWN; in wpas_ctrl_iface_configure_scs()
11800 qos_elem->direction = SCS_DIRECTION_DIRECT; in wpas_ctrl_iface_configure_scs()
11808 qos_elem->min_si = atoi(pos1 + 7); in wpas_ctrl_iface_configure_scs()
11815 qos_elem->max_si = atoi(pos1 + 7); in wpas_ctrl_iface_configure_scs()
11817 if (qos_elem->min_si && qos_elem->max_si && in wpas_ctrl_iface_configure_scs()
11818 qos_elem->max_si < qos_elem->min_si) { in wpas_ctrl_iface_configure_scs()
11828 qos_elem->min_data_rate = atoi(pos1 + 14); in wpas_ctrl_iface_configure_scs()
11835 qos_elem->delay_bound = atoi(pos1 + 12); in wpas_ctrl_iface_configure_scs()
11837 if (qos_elem->min_data_rate >= BIT(24) || in wpas_ctrl_iface_configure_scs()
11838 qos_elem->delay_bound >= BIT(24)) { in wpas_ctrl_iface_configure_scs()
11846 qos_elem->max_msdu_size = atoi(pos2 + 9); in wpas_ctrl_iface_configure_scs()
11847 qos_elem->mask |= SCS_QOS_BIT_MAX_MSDU_SIZE; in wpas_ctrl_iface_configure_scs()
11852 qos_elem->service_start_time = atoi(pos2 + 19); in wpas_ctrl_iface_configure_scs()
11853 qos_elem->mask |= SCS_QOS_BIT_SERVICE_START_TIME; in wpas_ctrl_iface_configure_scs()
11858 qos_elem->service_start_time_link_id = atoi(pos2 + 27); in wpas_ctrl_iface_configure_scs()
11859 qos_elem->mask |= SCS_QOS_BIT_SERVICE_START_TIME_LINKID; in wpas_ctrl_iface_configure_scs()
11864 qos_elem->mean_data_rate = atoi(pos2 + 15); in wpas_ctrl_iface_configure_scs()
11865 qos_elem->mask |= SCS_QOS_BIT_MEAN_DATA_RATE; in wpas_ctrl_iface_configure_scs()
11870 qos_elem->burst_size = atoi(pos2 + 11); in wpas_ctrl_iface_configure_scs()
11871 qos_elem->mask |= in wpas_ctrl_iface_configure_scs()
11877 qos_elem->msdu_lifetime = atoi(pos2 + 14); in wpas_ctrl_iface_configure_scs()
11878 qos_elem->mask |= SCS_QOS_BIT_MSDU_LIFETIME; in wpas_ctrl_iface_configure_scs()
11883 qos_elem->msdu_delivery_info = atoi(pos2 + 19); in wpas_ctrl_iface_configure_scs()
11884 qos_elem->mask |= SCS_QOS_BIT_MSDU_DELIVERY_INFO; in wpas_ctrl_iface_configure_scs()
11889 qos_elem->medium_time = atoi(pos2 + 12); in wpas_ctrl_iface_configure_scs()
11890 qos_elem->mask |= SCS_QOS_BIT_MEDIUM_TIME; in wpas_ctrl_iface_configure_scs()
11894 n1 = os_realloc(scs_data->scs_desc_elems, (num_scs_desc + 1) * in wpas_ctrl_iface_configure_scs()
11899 scs_data->scs_desc_elems = n1; in wpas_ctrl_iface_configure_scs()
11900 os_memcpy((u8 *) scs_data->scs_desc_elems + num_scs_desc * in wpas_ctrl_iface_configure_scs()
11903 scs_data->num_scs_desc = num_scs_desc; in wpas_ctrl_iface_configure_scs()
11913 return -1; in wpas_ctrl_iface_configure_scs()
11922 int num_policies = 0, ret = -1; in wpas_ctrl_iface_send_dscp_resp()
12004 return -1; in wpas_ctrl_iface_send_dscp_query()
12020 if (!wpa_s->valid_links) in wpas_ctrl_iface_mlo_signal_poll()
12021 return -1; in wpas_ctrl_iface_mlo_signal_poll()
12025 return -1; in wpas_ctrl_iface_mlo_signal_poll()
12031 ret = os_snprintf(pos, end - pos, in wpas_ctrl_iface_mlo_signal_poll()
12038 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_mlo_signal_poll()
12039 return -1; in wpas_ctrl_iface_mlo_signal_poll()
12043 ret = os_snprintf(pos, end - pos, "WIDTH=%s\n", in wpas_ctrl_iface_mlo_signal_poll()
12046 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_mlo_signal_poll()
12047 return -1; in wpas_ctrl_iface_mlo_signal_poll()
12052 ret = os_snprintf(pos, end - pos, "CENTER_FRQ1=%d\n", in wpas_ctrl_iface_mlo_signal_poll()
12054 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_mlo_signal_poll()
12055 return -1; in wpas_ctrl_iface_mlo_signal_poll()
12060 ret = os_snprintf(pos, end - pos, "CENTER_FRQ2=%d\n", in wpas_ctrl_iface_mlo_signal_poll()
12062 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_mlo_signal_poll()
12063 return -1; in wpas_ctrl_iface_mlo_signal_poll()
12068 ret = os_snprintf(pos, end - pos, in wpas_ctrl_iface_mlo_signal_poll()
12071 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_mlo_signal_poll()
12072 return -1; in wpas_ctrl_iface_mlo_signal_poll()
12078 pos, end - pos, "AVG_BEACON_RSSI=%d\n", in wpas_ctrl_iface_mlo_signal_poll()
12080 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_mlo_signal_poll()
12081 return -1; in wpas_ctrl_iface_mlo_signal_poll()
12086 return pos - buf; in wpas_ctrl_iface_mlo_signal_poll()
12096 if (!wpa_s->valid_links) in wpas_ctrl_iface_mlo_status()
12097 return -1; in wpas_ctrl_iface_mlo_status()
12102 for_each_link(wpa_s->valid_links, i) { in wpas_ctrl_iface_mlo_status()
12103 ret = os_snprintf(pos, end - pos, "link_id=%d\nfreq=%u\n" in wpas_ctrl_iface_mlo_status()
12106 i, wpa_s->links[i].freq, in wpas_ctrl_iface_mlo_status()
12107 MAC2STR(wpa_s->links[i].bssid), in wpas_ctrl_iface_mlo_status()
12108 MAC2STR(wpa_s->links[i].addr)); in wpas_ctrl_iface_mlo_status()
12109 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_mlo_status()
12110 return pos - buf; in wpas_ctrl_iface_mlo_status()
12114 return pos - buf; in wpas_ctrl_iface_mlo_status()
12123 int mld_id = -1, link_id = -1; in wpas_ctrl_ml_probe()
12132 return -1; in wpas_ctrl_ml_probe()
12143 return -1; in wpas_ctrl_ml_probe()
12150 return -1; in wpas_ctrl_ml_probe()
12153 if (wpa_s->sched_scanning || wpa_s->scanning || in wpas_ctrl_ml_probe()
12154 (wpa_s->wpa_state > WPA_SCANNING && in wpas_ctrl_ml_probe()
12155 wpa_s->wpa_state != WPA_COMPLETED)) { in wpas_ctrl_ml_probe()
12158 return -1; in wpas_ctrl_ml_probe()
12163 return -1; in wpas_ctrl_ml_probe()
12165 freqs[0] = bss->freq; in wpas_ctrl_ml_probe()
12168 wpa_s->manual_scan_passive = 0; in wpas_ctrl_ml_probe()
12169 wpa_s->manual_scan_use_id = 0; in wpas_ctrl_ml_probe()
12170 wpa_s->manual_scan_only_new = 0; in wpas_ctrl_ml_probe()
12171 wpa_s->scan_id_count = 0; in wpas_ctrl_ml_probe()
12172 wpa_s->scan_res_handler = scan_only_handler; in wpas_ctrl_ml_probe()
12173 os_free(wpa_s->manual_scan_freqs); in wpas_ctrl_ml_probe()
12174 wpa_s->manual_scan_freqs = freqs; in wpas_ctrl_ml_probe()
12176 os_memcpy(wpa_s->ml_probe_bssid, bssid, ETH_ALEN); in wpas_ctrl_ml_probe()
12177 wpa_s->ml_probe_mld_id = mld_id; in wpas_ctrl_ml_probe()
12179 wpa_s->ml_probe_links = BIT(link_id); in wpas_ctrl_ml_probe()
12181 wpa_s->normal_scans = 0; in wpas_ctrl_ml_probe()
12182 wpa_s->scan_req = MANUAL_SCAN_REQ; in wpas_ctrl_ml_probe()
12183 wpa_s->after_wps = 0; in wpas_ctrl_ml_probe()
12184 wpa_s->known_wps_freq = 0; in wpas_ctrl_ml_probe()
12202 int ret = -1; in wpas_ctrl_nan_publish()
12308 return -1; in wpas_ctrl_nan_cancel_publish()
12314 return -1; in wpas_ctrl_nan_cancel_publish()
12328 int ret = -1; in wpas_ctrl_nan_update_publish()
12368 int ret = -1; in wpas_ctrl_nan_subscribe()
12438 return -1; in wpas_ctrl_nan_cancel_subscribe()
12444 return -1; in wpas_ctrl_nan_cancel_subscribe()
12459 int ret = -1; in wpas_ctrl_nan_transmit()
12472 return -1; in wpas_ctrl_nan_transmit()
12534 "SET_NETWORK" : "key-add")); in wpa_supplicant_ctrl_iface_process()
12537 wpa_hexdump_ascii_key(MSG_DEBUG, "RX ctrl_iface", in wpa_supplicant_ctrl_iface_process()
12553 if (os_strcmp(buf, "PING") == 0) { in wpa_supplicant_ctrl_iface_process()
12554 os_memcpy(reply, "PONG\n", 5); in wpa_supplicant_ctrl_iface_process()
12557 reply_len = os_strlen(wpa_s->ifname); in wpa_supplicant_ctrl_iface_process()
12558 os_memcpy(reply, wpa_s->ifname, reply_len); in wpa_supplicant_ctrl_iface_process()
12561 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12565 reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); in wpa_supplicant_ctrl_iface_process()
12567 reply_len += eapol_sm_get_mib(wpa_s->eapol, in wpa_supplicant_ctrl_iface_process()
12569 reply_size - reply_len); in wpa_supplicant_ctrl_iface_process()
12572 wpa_s->kay, reply + reply_len, in wpa_supplicant_ctrl_iface_process()
12573 reply_size - reply_len); in wpa_supplicant_ctrl_iface_process()
12589 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12596 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12601 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12603 reply_len = wpa_config_dump_values(wpa_s->conf, in wpa_supplicant_ctrl_iface_process()
12609 eapol_sm_notify_logoff(wpa_s->eapol, false); in wpa_supplicant_ctrl_iface_process()
12611 eapol_sm_notify_logoff(wpa_s->eapol, true); in wpa_supplicant_ctrl_iface_process()
12613 if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) in wpa_supplicant_ctrl_iface_process()
12614 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12618 if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED || in wpa_supplicant_ctrl_iface_process()
12619 !wpa_s->current_ssid) in wpa_supplicant_ctrl_iface_process()
12620 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12622 wpa_s->reattach = 1; in wpa_supplicant_ctrl_iface_process()
12626 if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) in wpa_supplicant_ctrl_iface_process()
12627 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12628 else if (wpa_s->disconnected) in wpa_supplicant_ctrl_iface_process()
12633 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12638 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12643 if (res == -2) { in wpa_supplicant_ctrl_iface_process()
12644 os_memcpy(reply, "FAIL-PBC-OVERLAP\n", 17); in wpa_supplicant_ctrl_iface_process()
12647 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12650 if (res == -2) { in wpa_supplicant_ctrl_iface_process()
12651 os_memcpy(reply, "FAIL-PBC-OVERLAP\n", 17); in wpa_supplicant_ctrl_iface_process()
12654 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12664 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12668 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12671 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12681 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12690 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12694 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12703 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12706 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12711 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12714 if (ret == -2) { in wpa_supplicant_ctrl_iface_process()
12715 os_memcpy(reply, "FAIL-PBC-OVERLAP\n", 17); in wpa_supplicant_ctrl_iface_process()
12717 } else if (ret == -3) { in wpa_supplicant_ctrl_iface_process()
12718 os_memcpy(reply, "FAIL-UNKNOWN-UUID\n", 18); in wpa_supplicant_ctrl_iface_process()
12720 } else if (ret == -4) { in wpa_supplicant_ctrl_iface_process()
12721 os_memcpy(reply, "FAIL-NO-AP-SETTINGS\n", 20); in wpa_supplicant_ctrl_iface_process()
12724 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12727 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12731 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12734 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12745 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12756 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12760 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12763 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12766 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12769 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12774 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12777 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12782 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12785 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12791 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12794 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12797 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12800 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12803 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12809 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12817 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12820 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12825 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12830 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12833 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12836 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12839 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12842 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12848 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12853 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12856 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12859 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12862 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12865 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12868 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12871 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12874 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12877 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12881 if (wifi_display_subelem_set(wpa_s->global, buf + 16) < 0) in wpa_supplicant_ctrl_iface_process()
12882 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12884 reply_len = wifi_display_subelem_get(wpa_s->global, buf + 16, in wpa_supplicant_ctrl_iface_process()
12890 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12895 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12898 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12901 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12907 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12911 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12915 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12918 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12926 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12929 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12932 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12935 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12940 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12943 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12944 } else if (os_strcmp(buf, "FETCH_OSU no-scan") == 0) { in wpa_supplicant_ctrl_iface_process()
12946 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12954 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12965 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12967 wpa_supplicant_terminate_proc(wpa_s->global); in wpa_supplicant_ctrl_iface_process()
12970 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
12998 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13001 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13004 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13007 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13013 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13016 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13023 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13032 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13035 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13043 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13050 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13053 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13056 wpa_s->global, reply, reply_size); in wpa_supplicant_ctrl_iface_process()
13059 wpa_s->global, buf + 10, reply, reply_size); in wpa_supplicant_ctrl_iface_process()
13064 } else if (os_strcmp(buf, "STA-FIRST") == 0) { in wpa_supplicant_ctrl_iface_process()
13069 } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { in wpa_supplicant_ctrl_iface_process()
13074 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13077 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13080 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13083 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13086 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13093 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13100 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13110 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13112 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13121 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13127 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13135 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13137 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13141 wpas_notify_suspend(wpa_s->global); in wpa_supplicant_ctrl_iface_process()
13143 wpas_notify_resume(wpa_s->global); in wpa_supplicant_ctrl_iface_process()
13150 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13152 wpa_s->auto_reconnect_disabled = atoi(buf + 16) == 0; in wpa_supplicant_ctrl_iface_process()
13155 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13159 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13165 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13168 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13171 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13175 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13179 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13189 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13192 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13199 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13206 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13223 pmksa_cache_clear_current(wpa_s->wpa); in wpa_supplicant_ctrl_iface_process()
13224 eapol_sm_request_reauth(wpa_s->eapol); in wpa_supplicant_ctrl_iface_process()
13228 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13231 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13234 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13239 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13242 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13245 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13255 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13260 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13263 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13266 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13269 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13272 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13275 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13278 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13281 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13286 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13291 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13294 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13297 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13300 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13303 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13306 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13309 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13312 wpa_s, wpa_s->bssid, NULL, in wpa_supplicant_ctrl_iface_process()
13316 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13319 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13322 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13325 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13328 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13332 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13338 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13342 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13348 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13355 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13365 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13369 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13376 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13380 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13387 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13391 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13398 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13402 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13407 res = dpp_bootstrap_gen(wpa_s->dpp, buf + 18); in wpa_supplicant_ctrl_iface_process()
13409 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13413 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13416 if (dpp_bootstrap_remove(wpa_s->dpp, buf + 21) < 0) in wpa_supplicant_ctrl_iface_process()
13417 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13421 uri = dpp_bootstrap_get_uri(wpa_s->dpp, atoi(buf + 22)); in wpa_supplicant_ctrl_iface_process()
13423 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13427 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13430 reply_len = dpp_bootstrap_info(wpa_s->dpp, atoi(buf + 19), in wpa_supplicant_ctrl_iface_process()
13433 if (dpp_bootstrap_set(wpa_s->dpp, atoi(buf + 18), in wpa_supplicant_ctrl_iface_process()
13435 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13438 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13441 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13448 res = dpp_configurator_add(wpa_s->dpp, buf + 20); in wpa_supplicant_ctrl_iface_process()
13450 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13454 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13457 if (dpp_configurator_set(wpa_s->dpp, buf + 20) < 0) in wpa_supplicant_ctrl_iface_process()
13458 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13460 if (dpp_configurator_remove(wpa_s->dpp, buf + 24) < 0) in wpa_supplicant_ctrl_iface_process()
13461 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13464 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13466 reply_len = dpp_configurator_get_key_id(wpa_s->dpp, in wpa_supplicant_ctrl_iface_process()
13474 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13478 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13482 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13485 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13489 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13492 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13494 dpp_controller_stop(wpa_s->dpp); in wpa_supplicant_ctrl_iface_process()
13497 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13502 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13505 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13510 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13513 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13522 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13525 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13531 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13534 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13539 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13543 reply_len = ptksa_cache_list(wpa_s->ptksa, reply, reply_size); in wpa_supplicant_ctrl_iface_process()
13546 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13550 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13556 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13559 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13562 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13565 reply_len = -1; in wpa_supplicant_ctrl_iface_process()
13612 return -1; in wpa_supplicant_global_iface_add()
13681 return -1; in wpa_supplicant_global_iface_add()
13687 return -1; in wpa_supplicant_global_iface_add()
13694 if (!global->ifaces) in wpa_supplicant_global_iface_add()
13695 return -1; in wpa_supplicant_global_iface_add()
13696 if (wpa_drv_if_add(global->ifaces, type, iface.ifname, in wpa_supplicant_global_iface_add()
13700 return -1; in wpa_supplicant_global_iface_add()
13714 wpa_s->added_vif = create_iface; in wpa_supplicant_global_iface_add()
13719 /* wpa_supplicant does not create multi-BSS AP, so collapse to in wpa_supplicant_global_iface_add()
13721 wpa_drv_if_remove(global->ifaces, WPA_IF_STATION, iface.ifname); in wpa_supplicant_global_iface_add()
13723 return -1; in wpa_supplicant_global_iface_add()
13738 return -1; in wpa_supplicant_global_iface_remove()
13739 delete_iface = wpa_s->added_vif; in wpa_supplicant_global_iface_remove()
13744 /* wpa_supplicant does not create multi-BSS AP, so collapse to in wpa_supplicant_global_iface_remove()
13746 ret = wpa_drv_if_remove(global->ifaces, WPA_IF_STATION, cmd); in wpa_supplicant_global_iface_remove()
13758 iface = iface->next; in wpa_free_iface_info()
13760 os_free(prev->ifname); in wpa_free_iface_info()
13761 os_free(prev->desc); in wpa_free_iface_info()
13776 if (drv->get_interfaces == NULL) in wpa_supplicant_global_iface_list()
13778 tmp = drv->get_interfaces(global->drv_priv[i]); in wpa_supplicant_global_iface_list()
13785 last->next = tmp; in wpa_supplicant_global_iface_list()
13786 while (last->next) in wpa_supplicant_global_iface_list()
13787 last = last->next; in wpa_supplicant_global_iface_list()
13792 for (tmp = iface; tmp; tmp = tmp->next) { in wpa_supplicant_global_iface_list()
13793 res = os_snprintf(pos, end - pos, "%s\t%s\t%s\n", in wpa_supplicant_global_iface_list()
13794 tmp->drv_name, tmp->ifname, in wpa_supplicant_global_iface_list()
13795 tmp->desc ? tmp->desc : ""); in wpa_supplicant_global_iface_list()
13796 if (os_snprintf_error(end - pos, res)) { in wpa_supplicant_global_iface_list()
13805 return pos - buf; in wpa_supplicant_global_iface_list()
13821 wpa_s = global->ifaces; in wpa_supplicant_global_iface_interfaces()
13827 res = os_snprintf(pos, end - pos, "%s ctrl_iface=%s\n", in wpa_supplicant_global_iface_interfaces()
13828 wpa_s->ifname, in wpa_supplicant_global_iface_interfaces()
13829 wpa_s->conf->ctrl_interface ? in wpa_supplicant_global_iface_interfaces()
13830 wpa_s->conf->ctrl_interface : "N/A"); in wpa_supplicant_global_iface_interfaces()
13832 res = os_snprintf(pos, end - pos, "%s\n", in wpa_supplicant_global_iface_interfaces()
13833 wpa_s->ifname); in wpa_supplicant_global_iface_interfaces()
13835 if (os_snprintf_error(end - pos, res)) { in wpa_supplicant_global_iface_interfaces()
13840 wpa_s = wpa_s->next; in wpa_supplicant_global_iface_interfaces()
13842 return pos - buf; in wpa_supplicant_global_iface_interfaces()
13852 for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) { in wpas_global_ctrl_iface_ifname()
13853 if (os_strcmp(ifname, wpa_s->ifname) == 0) in wpas_global_ctrl_iface_ifname()
13858 char *resp = os_strdup("FAIL-NO-IFNAME-MATCH\n"); in wpas_global_ctrl_iface_ifname()
13888 "STA-FIRST", in wpas_global_ctrl_iface_redir_p2p()
13930 "STA-NEXT ", in wpas_global_ctrl_iface_redir_p2p()
13937 if (global->p2p_init_wpa_s == NULL) in wpas_global_ctrl_iface_redir_p2p()
13951 return wpa_supplicant_ctrl_iface_process(global->p2p_init_wpa_s, in wpas_global_ctrl_iface_redir_p2p()
13962 if (global->p2p_init_wpa_s == NULL) in wpas_global_ctrl_iface_redir_wfd()
13966 return wpa_supplicant_ctrl_iface_process(global->p2p_init_wpa_s, in wpas_global_ctrl_iface_redir_wfd()
13996 return -1; in wpas_global_ctrl_iface_set()
14009 value[-1] = ' '; in wpas_global_ctrl_iface_set()
14011 return -1; in wpas_global_ctrl_iface_set()
14028 return -1; in wpas_global_ctrl_iface_dup_network()
14031 wpa_s[i] = global->ifaces; in wpas_global_ctrl_iface_dup_network()
14032 for (; wpa_s[i]; wpa_s[i] = wpa_s[i]->next) { in wpas_global_ctrl_iface_dup_network()
14033 if (os_strcmp(cmd, wpa_s[i]->ifname) == 0) in wpas_global_ctrl_iface_dup_network()
14040 return -1; in wpas_global_ctrl_iface_dup_network()
14056 for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) { in wpas_global_ctrl_iface_save_config()
14057 if (!wpa_s->conf->update_config) { in wpas_global_ctrl_iface_save_config()
14058 …wpa_dbg(wpa_s, MSG_DEBUG, "CTRL_IFACE: SAVE_CONFIG - Not allowed to update configuration (update_c… in wpas_global_ctrl_iface_save_config()
14062 if (wpa_config_write(wpa_s->confname, wpa_s->conf)) { in wpas_global_ctrl_iface_save_config()
14063 wpa_dbg(wpa_s, MSG_DEBUG, "CTRL_IFACE: SAVE_CONFIG - Failed to update configuration"); in wpas_global_ctrl_iface_save_config()
14066 wpa_dbg(wpa_s, MSG_DEBUG, "CTRL_IFACE: SAVE_CONFIG - Configuration updated"); in wpas_global_ctrl_iface_save_config()
14073 "CTRL_IFACE: SAVE_CONFIG - No configuration files could be updated"); in wpas_global_ctrl_iface_save_config()
14093 if (global->p2p && !global->p2p_disabled) { in wpas_global_ctrl_iface_status()
14094 ret = os_snprintf(pos, end - pos, "p2p_device_address=" MACSTR in wpas_global_ctrl_iface_status()
14097 MAC2STR(global->p2p_dev_addr), in wpas_global_ctrl_iface_status()
14098 p2p_get_state_txt(global->p2p)); in wpas_global_ctrl_iface_status()
14099 if (os_snprintf_error(end - pos, ret)) in wpas_global_ctrl_iface_status()
14100 return pos - buf; in wpas_global_ctrl_iface_status()
14102 } else if (global->p2p) { in wpas_global_ctrl_iface_status()
14103 ret = os_snprintf(pos, end - pos, "p2p_state=DISABLED\n"); in wpas_global_ctrl_iface_status()
14104 if (os_snprintf_error(end - pos, ret)) in wpas_global_ctrl_iface_status()
14105 return pos - buf; in wpas_global_ctrl_iface_status()
14111 ret = os_snprintf(pos, end - pos, "wifi_display=%d\n", in wpas_global_ctrl_iface_status()
14112 !!global->wifi_display); in wpas_global_ctrl_iface_status()
14113 if (os_snprintf_error(end - pos, ret)) in wpas_global_ctrl_iface_status()
14114 return pos - buf; in wpas_global_ctrl_iface_status()
14118 for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) { in wpas_global_ctrl_iface_status()
14119 ret = os_snprintf(pos, end - pos, "ifname=%s\n" in wpas_global_ctrl_iface_status()
14121 wpa_s->ifname, MAC2STR(wpa_s->own_addr)); in wpas_global_ctrl_iface_status()
14122 if (os_snprintf_error(end - pos, ret)) in wpas_global_ctrl_iface_status()
14123 return pos - buf; in wpas_global_ctrl_iface_status()
14127 return pos - buf; in wpas_global_ctrl_iface_status()
14145 if (wpa_s->fst) { in wpas_global_ctrl_iface_fst_attach()
14147 return -1; in wpas_global_ctrl_iface_fst_attach()
14150 wpa_s->fst = fst_attach(ifname, wpa_s->own_addr, in wpas_global_ctrl_iface_fst_attach()
14152 if (wpa_s->fst) in wpas_global_ctrl_iface_fst_attach()
14157 return -1; in wpas_global_ctrl_iface_fst_attach()
14172 wpa_s->fst = NULL; in wpas_global_ctrl_iface_fst_detach()
14178 return -1; in wpas_global_ctrl_iface_fst_detach()
14206 if (os_strcmp(buf, "PING") == 0) in wpa_supplicant_global_ctrl_iface_process()
14208 wpa_hexdump_ascii(level, "RX global ctrl_iface", in wpa_supplicant_global_ctrl_iface_process()
14220 if (os_strcmp(buf, "PING") == 0) { in wpa_supplicant_global_ctrl_iface_process()
14221 os_memcpy(reply, "PONG\n", 5); in wpa_supplicant_global_ctrl_iface_process()
14225 reply_len = -1; in wpa_supplicant_global_ctrl_iface_process()
14228 reply_len = -1; in wpa_supplicant_global_ctrl_iface_process()
14236 } else if (os_strncmp(buf, "FST-ATTACH ", 11) == 0) { in wpa_supplicant_global_ctrl_iface_process()
14240 } else if (os_strncmp(buf, "FST-DETACH ", 11) == 0) { in wpa_supplicant_global_ctrl_iface_process()
14244 } else if (os_strncmp(buf, "FST-MANAGER ", 12) == 0) { in wpa_supplicant_global_ctrl_iface_process()
14256 if (global->p2p_init_wpa_s) { in wpa_supplicant_global_ctrl_iface_process()
14261 global->p2p_init_wpa_s, in wpa_supplicant_global_ctrl_iface_process()
14265 reply_len = -1; in wpa_supplicant_global_ctrl_iface_process()
14269 reply_len = -1; in wpa_supplicant_global_ctrl_iface_process()
14273 reply_len = -1; in wpa_supplicant_global_ctrl_iface_process()
14281 reply_len = -1; in wpa_supplicant_global_ctrl_iface_process()
14285 reply_len = -1; in wpa_supplicant_global_ctrl_iface_process()