Lines Matching refs:bss

208 	struct hostapd_bss_config *bss = conf->bss[0];  in wpa_supplicant_conf_ap()  local
212 os_strlcpy(bss->iface, wpa_s->ifname, sizeof(bss->iface)); in wpa_supplicant_conf_ap()
261 bss->isolate = !wpa_s->conf->p2p_intra_bss; in wpa_supplicant_conf_ap()
262 bss->force_per_enrollee_psk = wpa_s->global->p2p_per_sta_psk; in wpa_supplicant_conf_ap()
265 os_memcpy(bss->ip_addr_go, wpa_s->p2pdev->conf->ip_addr_go, 4); in wpa_supplicant_conf_ap()
266 os_memcpy(bss->ip_addr_mask, wpa_s->p2pdev->conf->ip_addr_mask, in wpa_supplicant_conf_ap()
268 os_memcpy(bss->ip_addr_start, in wpa_supplicant_conf_ap()
270 os_memcpy(bss->ip_addr_end, wpa_s->p2pdev->conf->ip_addr_end, in wpa_supplicant_conf_ap()
279 os_memcpy(bss->ssid.ssid, ssid->ssid, ssid->ssid_len); in wpa_supplicant_conf_ap()
280 bss->ssid.ssid_len = ssid->ssid_len; in wpa_supplicant_conf_ap()
281 bss->ssid.ssid_set = 1; in wpa_supplicant_conf_ap()
283 bss->ignore_broadcast_ssid = ssid->ignore_broadcast_ssid; in wpa_supplicant_conf_ap()
286 bss->auth_algs = ssid->auth_alg; in wpa_supplicant_conf_ap()
289 bss->wpa = ssid->proto; in wpa_supplicant_conf_ap()
290 bss->wpa_key_mgmt = ssid->key_mgmt; in wpa_supplicant_conf_ap()
291 bss->wpa_pairwise = ssid->pairwise_cipher; in wpa_supplicant_conf_ap()
293 bin_clear_free(bss->ssid.wpa_psk, sizeof(*bss->ssid.wpa_psk)); in wpa_supplicant_conf_ap()
294 bss->ssid.wpa_psk = os_zalloc(sizeof(struct hostapd_wpa_psk)); in wpa_supplicant_conf_ap()
295 if (bss->ssid.wpa_psk == NULL) in wpa_supplicant_conf_ap()
297 os_memcpy(bss->ssid.wpa_psk->psk, ssid->psk, PMK_LEN); in wpa_supplicant_conf_ap()
298 bss->ssid.wpa_psk->group = 1; in wpa_supplicant_conf_ap()
300 bss->ssid.wpa_passphrase = os_strdup(ssid->passphrase); in wpa_supplicant_conf_ap()
303 struct hostapd_wep_keys *wep = &bss->ssid.wep; in wpa_supplicant_conf_ap()
320 bss->ap_max_inactivity = ssid->ap_max_inactivity; in wpa_supplicant_conf_ap()
323 bss->dtim_period = ssid->dtim_period; in wpa_supplicant_conf_ap()
325 bss->dtim_period = wpa_s->conf->dtim_period; in wpa_supplicant_conf_ap()
347 if ((bss->wpa & 2) && bss->rsn_pairwise == 0) in wpa_supplicant_conf_ap()
348 bss->rsn_pairwise = bss->wpa_pairwise; in wpa_supplicant_conf_ap()
349 bss->wpa_group = wpa_select_ap_group_cipher(bss->wpa, bss->wpa_pairwise, in wpa_supplicant_conf_ap()
350 bss->rsn_pairwise); in wpa_supplicant_conf_ap()
352 if (bss->wpa && bss->ieee802_1x) in wpa_supplicant_conf_ap()
353 bss->ssid.security_policy = SECURITY_WPA; in wpa_supplicant_conf_ap()
354 else if (bss->wpa) in wpa_supplicant_conf_ap()
355 bss->ssid.security_policy = SECURITY_WPA_PSK; in wpa_supplicant_conf_ap()
356 else if (bss->ieee802_1x) { in wpa_supplicant_conf_ap()
358 bss->ssid.security_policy = SECURITY_IEEE_802_1X; in wpa_supplicant_conf_ap()
359 bss->ssid.wep.default_len = bss->default_wep_key_len; in wpa_supplicant_conf_ap()
360 if (bss->default_wep_key_len) in wpa_supplicant_conf_ap()
361 cipher = bss->default_wep_key_len >= 13 ? in wpa_supplicant_conf_ap()
363 bss->wpa_group = cipher; in wpa_supplicant_conf_ap()
364 bss->wpa_pairwise = cipher; in wpa_supplicant_conf_ap()
365 bss->rsn_pairwise = cipher; in wpa_supplicant_conf_ap()
366 } else if (bss->ssid.wep.keys_set) { in wpa_supplicant_conf_ap()
368 if (bss->ssid.wep.len[0] >= 13) in wpa_supplicant_conf_ap()
370 bss->ssid.security_policy = SECURITY_STATIC_WEP; in wpa_supplicant_conf_ap()
371 bss->wpa_group = cipher; in wpa_supplicant_conf_ap()
372 bss->wpa_pairwise = cipher; in wpa_supplicant_conf_ap()
373 bss->rsn_pairwise = cipher; in wpa_supplicant_conf_ap()
375 bss->ssid.security_policy = SECURITY_PLAINTEXT; in wpa_supplicant_conf_ap()
376 bss->wpa_group = WPA_CIPHER_NONE; in wpa_supplicant_conf_ap()
377 bss->wpa_pairwise = WPA_CIPHER_NONE; in wpa_supplicant_conf_ap()
378 bss->rsn_pairwise = WPA_CIPHER_NONE; in wpa_supplicant_conf_ap()
381 if (bss->wpa_group_rekey < 86400 && (bss->wpa & 2) && in wpa_supplicant_conf_ap()
382 (bss->wpa_group == WPA_CIPHER_CCMP || in wpa_supplicant_conf_ap()
383 bss->wpa_group == WPA_CIPHER_GCMP || in wpa_supplicant_conf_ap()
384 bss->wpa_group == WPA_CIPHER_CCMP_256 || in wpa_supplicant_conf_ap()
385 bss->wpa_group == WPA_CIPHER_GCMP_256)) { in wpa_supplicant_conf_ap()
390 bss->wpa_group_rekey = 86400; in wpa_supplicant_conf_ap()
395 bss->ieee80211w = ssid->ieee80211w; in wpa_supplicant_conf_ap()
404 if (bss->ssid.security_policy != SECURITY_WPA_PSK && in wpa_supplicant_conf_ap()
405 bss->ssid.security_policy != SECURITY_PLAINTEXT) in wpa_supplicant_conf_ap()
407 if (bss->ssid.security_policy == SECURITY_WPA_PSK && in wpa_supplicant_conf_ap()
408 (!(bss->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP)) || in wpa_supplicant_conf_ap()
409 !(bss->wpa & 2))) in wpa_supplicant_conf_ap()
412 bss->eap_server = 1; in wpa_supplicant_conf_ap()
415 bss->wps_state = 2; in wpa_supplicant_conf_ap()
417 bss->ap_setup_locked = 2; in wpa_supplicant_conf_ap()
419 bss->config_methods = os_strdup(wpa_s->conf->config_methods); in wpa_supplicant_conf_ap()
420 os_memcpy(bss->device_type, wpa_s->conf->device_type, in wpa_supplicant_conf_ap()
423 bss->device_name = os_strdup(wpa_s->conf->device_name); in wpa_supplicant_conf_ap()
424 bss->friendly_name = os_strdup(wpa_s->conf->device_name); in wpa_supplicant_conf_ap()
427 bss->manufacturer = os_strdup(wpa_s->conf->manufacturer); in wpa_supplicant_conf_ap()
429 bss->model_name = os_strdup(wpa_s->conf->model_name); in wpa_supplicant_conf_ap()
431 bss->model_number = os_strdup(wpa_s->conf->model_number); in wpa_supplicant_conf_ap()
433 bss->serial_number = os_strdup(wpa_s->conf->serial_number); in wpa_supplicant_conf_ap()
435 os_memcpy(bss->uuid, wpa_s->wps->uuid, WPS_UUID_LEN); in wpa_supplicant_conf_ap()
437 os_memcpy(bss->uuid, wpa_s->conf->uuid, WPS_UUID_LEN); in wpa_supplicant_conf_ap()
438 os_memcpy(bss->os_version, wpa_s->conf->os_version, 4); in wpa_supplicant_conf_ap()
439 bss->pbc_in_m1 = wpa_s->conf->pbc_in_m1; in wpa_supplicant_conf_ap()
445 bss->max_num_sta = wpa_s->max_stations; in wpa_supplicant_conf_ap()
447 bss->max_num_sta = wpa_s->conf->max_num_sta; in wpa_supplicant_conf_ap()
449 bss->disassoc_low_ack = wpa_s->conf->disassoc_low_ack; in wpa_supplicant_conf_ap()
452 bss->vendor_elements = in wpa_supplicant_conf_ap()
456 bss->pbss = ssid->pbss; in wpa_supplicant_conf_ap()
686 conf->bss[0]->wmm_enabled = 1; in wpa_supplicant_create_ap()
687 conf->bss[0]->wmm_uapsd = 1; in wpa_supplicant_create_ap()
698 conf->bss[0]->p2p = P2P_ENABLED | P2P_GROUP_OWNER; in wpa_supplicant_create_ap()
700 conf->bss[0]->p2p = P2P_ENABLED | P2P_GROUP_OWNER | in wpa_supplicant_create_ap()
705 hapd_iface->bss = os_calloc(conf->num_bss, in wpa_supplicant_create_ap()
707 if (hapd_iface->bss == NULL) { in wpa_supplicant_create_ap()
713 hapd_iface->bss[i] = in wpa_supplicant_create_ap()
715 conf->bss[i]); in wpa_supplicant_create_ap()
716 if (hapd_iface->bss[i] == NULL) { in wpa_supplicant_create_ap()
721 hapd_iface->bss[i]->msg_ctx = wpa_s; in wpa_supplicant_create_ap()
722 hapd_iface->bss[i]->msg_ctx_parent = wpa_s->p2pdev; in wpa_supplicant_create_ap()
723 hapd_iface->bss[i]->public_action_cb = ap_public_action_rx; in wpa_supplicant_create_ap()
724 hapd_iface->bss[i]->public_action_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
725 hapd_iface->bss[i]->vendor_action_cb = ap_vendor_action_rx; in wpa_supplicant_create_ap()
726 hapd_iface->bss[i]->vendor_action_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
727 hostapd_register_probereq_cb(hapd_iface->bss[i], in wpa_supplicant_create_ap()
729 hapd_iface->bss[i]->wps_reg_success_cb = ap_wps_reg_success_cb; in wpa_supplicant_create_ap()
730 hapd_iface->bss[i]->wps_reg_success_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
731 hapd_iface->bss[i]->wps_event_cb = ap_wps_event_cb; in wpa_supplicant_create_ap()
732 hapd_iface->bss[i]->wps_event_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
733 hapd_iface->bss[i]->sta_authorized_cb = ap_sta_authorized_cb; in wpa_supplicant_create_ap()
734 hapd_iface->bss[i]->sta_authorized_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
736 hapd_iface->bss[i]->new_psk_cb = ap_new_psk_cb; in wpa_supplicant_create_ap()
737 hapd_iface->bss[i]->new_psk_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
738 hapd_iface->bss[i]->p2p = wpa_s->global->p2p; in wpa_supplicant_create_ap()
739 hapd_iface->bss[i]->p2p_group = wpas_p2p_group_init(wpa_s, in wpa_supplicant_create_ap()
742 hapd_iface->bss[i]->setup_complete_cb = wpas_ap_configured_cb; in wpa_supplicant_create_ap()
743 hapd_iface->bss[i]->setup_complete_cb_ctx = wpa_s; in wpa_supplicant_create_ap()
745 hapd_iface->bss[i]->ext_eapol_frame_io = in wpa_supplicant_create_ap()
750 os_memcpy(hapd_iface->bss[0]->own_addr, wpa_s->own_addr, ETH_ALEN); in wpa_supplicant_create_ap()
751 hapd_iface->bss[0]->driver = wpa_s->driver; in wpa_supplicant_create_ap()
752 hapd_iface->bss[0]->drv_priv = wpa_s->drv_priv; in wpa_supplicant_create_ap()
800 hostapd_tx_status(wpa_s->ap_iface->bss[0], addr, buf, len, ack); in ap_tx_status()
812 hostapd_tx_status(wpa_s->ap_iface->bss[0], dst, data, len, ack); in ap_eapol_tx_status()
822 hostapd_client_poll_ok(wpa_s->ap_iface->bss[0], addr); in ap_client_poll_ok()
831 ieee802_11_rx_from_unknown(wpa_s->ap_iface->bss[0], addr, wds); in ap_rx_from_unknown_sta()
844 ieee802_11_mgmt(wpa_s->ap_iface->bss[0], rx_mgmt->frame, in ap_mgmt_rx()
854 ieee802_11_mgmt_cb(wpa_s->ap_iface->bss[0], buf, len, stype, ok); in ap_mgmt_tx_cb()
862 ieee802_1x_receive(wpa_s->ap_iface->bss[0], src_addr, buf, len); in wpa_supplicant_ap_rx_eapol()
873 return hostapd_wps_button_pushed(wpa_s->ap_iface->bss[0], in wpa_supplicant_ap_wps_pbc()
883 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]->wps) in wpa_supplicant_ap_wps_cancel()
886 reg = wpa_s->ap_iface->bss[0]->wps->registrar; in wpa_supplicant_ap_wps_cancel()
888 wps_sta = ap_for_each_sta(wpa_s->ap_iface->bss[0], in wpa_supplicant_ap_wps_cancel()
932 ret = hostapd_wps_add_pin(wpa_s->ap_iface->bss[0], bssid, "any", pin, in wpa_supplicant_ap_wps_pin()
954 hapd = wpa_s->ap_iface->bss[0]; in wpas_wps_ap_pin_enable()
971 hapd = wpa_s->ap_iface->bss[0]; in wpas_wps_ap_pin_disable()
986 hapd = wpa_s->ap_iface->bss[0]; in wpas_wps_ap_pin_random()
1005 hapd = wpa_s->ap_iface->bss[0]; in wpas_wps_ap_pin_get()
1019 hapd = wpa_s->ap_iface->bss[0]; in wpas_wps_ap_pin_set()
1039 hapd = wpa_s->ap_iface->bss[0]; in wpa_supplicant_ap_pwd_auth_fail()
1067 hapd = wpa_s->ap_iface->bss[0]; in wpas_ap_wps_nfc_config_token()
1079 hapd = wpa_s->ap_iface->bss[0]; in wpas_ap_wps_nfc_handover_sel()
1092 hapd = wpa_s->ap_iface->bss[0]; in wpas_ap_wps_nfc_report_handover()
1109 hapd = wpa_s->ap_iface->bss[0]; in ap_ctrl_iface_sta_first()
1111 hapd = wpa_s->ifmsh->bss[0]; in ap_ctrl_iface_sta_first()
1124 hapd = wpa_s->ap_iface->bss[0]; in ap_ctrl_iface_sta()
1126 hapd = wpa_s->ifmsh->bss[0]; in ap_ctrl_iface_sta()
1139 hapd = wpa_s->ap_iface->bss[0]; in ap_ctrl_iface_sta_next()
1141 hapd = wpa_s->ifmsh->bss[0]; in ap_ctrl_iface_sta_next()
1153 return hostapd_ctrl_iface_disassociate(wpa_s->ap_iface->bss[0], in ap_ctrl_iface_sta_disassociate()
1163 return hostapd_ctrl_iface_deauthenticate(wpa_s->ap_iface->bss[0], in ap_ctrl_iface_sta_deauthenticate()
1178 conf = wpa_s->ap_iface->bss[0]->conf; in ap_ctrl_iface_wpa_get_status()
1212 iface->conf->bss[0]->p2p = P2P_ENABLED | P2P_GROUP_OWNER; in wpa_supplicant_ap_update_beacon()
1214 iface->conf->bss[0]->p2p = P2P_ENABLED | P2P_GROUP_OWNER | in wpa_supplicant_ap_update_beacon()
1218 hapd = iface->bss[0]; in wpa_supplicant_ap_update_beacon()
1232 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) in ap_switch_channel()
1235 return hostapd_switch_channel(wpa_s->ap_iface->bss[0], settings); in ap_switch_channel()
1265 hostapd_event_ch_switch(wpa_s->ap_iface->bss[0], freq, ht, in wpas_ap_ch_switch()
1285 hapd = wpa_s->ap_iface->bss[0]; in wpa_supplicant_ap_mac_addr_filter()
1320 hapd = wpa_s->ap_iface->bss[0]; in wpas_ap_wps_add_nfc_pw()
1363 hapd = wpa_s->ap_iface->bss[0]; in wpas_ap_stop_ap()
1386 wpa_s->ap_iface->bss[i], in wpas_ap_pmksa_cache_list()
1399 wpa_s->ifmsh->bss[0], &buf[reply_len], in wpas_ap_pmksa_cache_list()
1413 hostapd_ctrl_iface_pmksa_flush(wpa_s->ap_iface->bss[i]); in wpas_ap_pmksa_cache_flush()
1417 hostapd_ctrl_iface_pmksa_flush(wpa_s->ifmsh->bss[0]); in wpas_ap_pmksa_cache_flush()
1425 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) in wpas_event_dfs_radar_detected()
1438 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) in wpas_event_dfs_cac_started()
1450 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) in wpas_event_dfs_cac_finished()
1462 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) in wpas_event_dfs_cac_aborted()
1474 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) in wpas_event_dfs_cac_nop_finished()