Lines Matching refs:bss

30 static int hostapd_config_read_vlan_file(struct hostapd_bss_config *bss,  in hostapd_config_read_vlan_file()  argument
110 vlan->next = bss->vlan; in hostapd_config_read_vlan_file()
111 bss->vlan = vlan; in hostapd_config_read_vlan_file()
612 static int hostapd_parse_das_client(struct hostapd_bss_config *bss, char *val) in hostapd_parse_das_client() argument
622 if (hostapd_parse_ip_addr(val, &bss->radius_das_client_addr)) in hostapd_parse_das_client()
625 os_free(bss->radius_das_shared_secret); in hostapd_parse_das_client()
626 bss->radius_das_shared_secret = (u8 *) os_strdup(secret); in hostapd_parse_das_client()
627 if (bss->radius_das_shared_secret == NULL) in hostapd_parse_das_client()
629 bss->radius_das_shared_secret_len = os_strlen(secret); in hostapd_parse_das_client()
877 struct hostapd_bss_config **all, *bss; in hostapd_config_bss() local
882 all = os_realloc_array(conf->bss, conf->num_bss + 1, in hostapd_config_bss()
889 conf->bss = all; in hostapd_config_bss()
891 bss = os_zalloc(sizeof(*bss)); in hostapd_config_bss()
892 if (bss == NULL) in hostapd_config_bss()
894 bss->radius = os_zalloc(sizeof(*bss->radius)); in hostapd_config_bss()
895 if (bss->radius == NULL) { in hostapd_config_bss()
898 os_free(bss); in hostapd_config_bss()
902 conf->bss[conf->num_bss++] = bss; in hostapd_config_bss()
903 conf->last_bss = bss; in hostapd_config_bss()
905 hostapd_config_defaults_bss(bss); in hostapd_config_bss()
906 os_strlcpy(bss->iface, ifname, sizeof(bss->iface)); in hostapd_config_bss()
907 os_memcpy(bss->ssid.vlan, bss->iface, IFNAMSIZ + 1); in hostapd_config_bss()
934 static int add_r0kh(struct hostapd_bss_config *bss, char *value) in add_r0kh() argument
973 r0kh->next = bss->r0kh_list; in add_r0kh()
974 bss->r0kh_list = r0kh; in add_r0kh()
980 static int add_r1kh(struct hostapd_bss_config *bss, char *value) in add_r1kh() argument
1018 r1kh->next = bss->r1kh_list; in add_r1kh()
1019 bss->r1kh_list = r1kh; in add_r1kh()
1288 static int parse_roaming_consortium(struct hostapd_bss_config *bss, char *pos, in parse_roaming_consortium() argument
1304 rc = os_realloc_array(bss->roaming_consortium, in parse_roaming_consortium()
1305 bss->roaming_consortium_count + 1, in parse_roaming_consortium()
1310 os_memcpy(rc[bss->roaming_consortium_count].oi, oi, len); in parse_roaming_consortium()
1311 rc[bss->roaming_consortium_count].len = len; in parse_roaming_consortium()
1313 bss->roaming_consortium = rc; in parse_roaming_consortium()
1314 bss->roaming_consortium_count++; in parse_roaming_consortium()
1368 static int parse_venue_name(struct hostapd_bss_config *bss, char *pos, in parse_venue_name() argument
1371 if (parse_lang_string(&bss->venue_name, &bss->venue_name_count, pos)) { in parse_venue_name()
1380 static int parse_venue_url(struct hostapd_bss_config *bss, char *pos, in parse_venue_url() argument
1397 url = os_realloc_array(bss->venue_url, bss->venue_url_count + 1, in parse_venue_url()
1402 bss->venue_url = url; in parse_venue_url()
1403 url = &bss->venue_url[bss->venue_url_count++]; in parse_venue_url()
1418 static int parse_3gpp_cell_net(struct hostapd_bss_config *bss, char *buf, in parse_3gpp_cell_net() argument
1477 os_free(bss->anqp_3gpp_cell_net); in parse_3gpp_cell_net()
1478 bss->anqp_3gpp_cell_net = info; in parse_3gpp_cell_net()
1479 bss->anqp_3gpp_cell_net_len = 2 + 3 + 3 * count; in parse_3gpp_cell_net()
1481 bss->anqp_3gpp_cell_net, bss->anqp_3gpp_cell_net_len); in parse_3gpp_cell_net()
1493 static int parse_nai_realm(struct hostapd_bss_config *bss, char *buf, int line) in parse_nai_realm() argument
1500 offsets = os_calloc(bss->nai_realm_count * MAX_NAI_REALMS, in parse_nai_realm()
1505 for (i = 0; i < bss->nai_realm_count; i++) { in parse_nai_realm()
1506 realm = &bss->nai_realm_data[i]; in parse_nai_realm()
1514 realm = os_realloc_array(bss->nai_realm_data, bss->nai_realm_count + 1, in parse_nai_realm()
1520 bss->nai_realm_data = realm; in parse_nai_realm()
1523 for (i = 0; i < bss->nai_realm_count; i++) { in parse_nai_realm()
1524 realm = &bss->nai_realm_data[i]; in parse_nai_realm()
1535 realm = &bss->nai_realm_data[bss->nai_realm_count]; in parse_nai_realm()
1624 bss->nai_realm_count++; in parse_nai_realm()
1634 static int parse_anqp_elem(struct hostapd_bss_config *bss, char *buf, int line) in parse_anqp_elem() argument
1659 dl_list_for_each(elem, &bss->anqp_elem, struct anqp_element, list) { in parse_anqp_elem()
1676 dl_list_add(&bss->anqp_elem, &elem->list); in parse_anqp_elem()
1684 static int parse_qos_map_set(struct hostapd_bss_config *bss, in parse_qos_map_set() argument
1718 os_memcpy(bss->qos_map_set, qos_map_set, count); in parse_qos_map_set()
1719 bss->qos_map_set_len = count; in parse_qos_map_set()
1726 static int hs20_parse_conn_capab(struct hostapd_bss_config *bss, char *buf, in hs20_parse_conn_capab() argument
1732 if (bss->hs20_connection_capability_len >= 0xfff0) in hs20_parse_conn_capab()
1735 conn_cap = os_realloc(bss->hs20_connection_capability, in hs20_parse_conn_capab()
1736 bss->hs20_connection_capability_len + 4); in hs20_parse_conn_capab()
1740 bss->hs20_connection_capability = conn_cap; in hs20_parse_conn_capab()
1741 conn_cap += bss->hs20_connection_capability_len; in hs20_parse_conn_capab()
1754 bss->hs20_connection_capability_len += 4; in hs20_parse_conn_capab()
1760 static int hs20_parse_wan_metrics(struct hostapd_bss_config *bss, char *buf, in hs20_parse_wan_metrics() argument
1812 os_free(bss->hs20_wan_metrics); in hs20_parse_wan_metrics()
1813 bss->hs20_wan_metrics = wan_metrics; in hs20_parse_wan_metrics()
1825 static int hs20_parse_oper_friendly_name(struct hostapd_bss_config *bss, in hs20_parse_oper_friendly_name() argument
1828 if (parse_lang_string(&bss->hs20_oper_friendly_name, in hs20_parse_oper_friendly_name()
1829 &bss->hs20_oper_friendly_name_count, pos)) { in hs20_parse_oper_friendly_name()
1838 static int hs20_parse_icon(struct hostapd_bss_config *bss, char *pos) in hs20_parse_icon() argument
1843 icon = os_realloc_array(bss->hs20_icons, bss->hs20_icons_count + 1, in hs20_parse_icon()
1847 bss->hs20_icons = icon; in hs20_parse_icon()
1848 icon = &bss->hs20_icons[bss->hs20_icons_count]; in hs20_parse_icon()
1885 bss->hs20_icons_count++; in hs20_parse_icon()
1891 static int hs20_parse_osu_ssid(struct hostapd_bss_config *bss, in hs20_parse_osu_ssid() argument
1904 os_memcpy(bss->osu_ssid, str, slen); in hs20_parse_osu_ssid()
1905 bss->osu_ssid_len = slen; in hs20_parse_osu_ssid()
1912 static int hs20_parse_osu_server_uri(struct hostapd_bss_config *bss, in hs20_parse_osu_server_uri() argument
1917 p = os_realloc_array(bss->hs20_osu_providers, in hs20_parse_osu_server_uri()
1918 bss->hs20_osu_providers_count + 1, sizeof(*p)); in hs20_parse_osu_server_uri()
1922 bss->hs20_osu_providers = p; in hs20_parse_osu_server_uri()
1923 bss->last_osu = &bss->hs20_osu_providers[bss->hs20_osu_providers_count]; in hs20_parse_osu_server_uri()
1924 bss->hs20_osu_providers_count++; in hs20_parse_osu_server_uri()
1925 os_memset(bss->last_osu, 0, sizeof(*p)); in hs20_parse_osu_server_uri()
1926 bss->last_osu->server_uri = os_strdup(pos); in hs20_parse_osu_server_uri()
1932 static int hs20_parse_osu_friendly_name(struct hostapd_bss_config *bss, in hs20_parse_osu_friendly_name() argument
1935 if (bss->last_osu == NULL) { in hs20_parse_osu_friendly_name()
1940 if (parse_lang_string(&bss->last_osu->friendly_name, in hs20_parse_osu_friendly_name()
1941 &bss->last_osu->friendly_name_count, pos)) { in hs20_parse_osu_friendly_name()
1951 static int hs20_parse_osu_nai(struct hostapd_bss_config *bss, in hs20_parse_osu_nai() argument
1954 if (bss->last_osu == NULL) { in hs20_parse_osu_nai()
1959 os_free(bss->last_osu->osu_nai); in hs20_parse_osu_nai()
1960 bss->last_osu->osu_nai = os_strdup(pos); in hs20_parse_osu_nai()
1961 if (bss->last_osu->osu_nai == NULL) in hs20_parse_osu_nai()
1968 static int hs20_parse_osu_nai2(struct hostapd_bss_config *bss, in hs20_parse_osu_nai2() argument
1971 if (bss->last_osu == NULL) { in hs20_parse_osu_nai2()
1976 os_free(bss->last_osu->osu_nai2); in hs20_parse_osu_nai2()
1977 bss->last_osu->osu_nai2 = os_strdup(pos); in hs20_parse_osu_nai2()
1978 if (bss->last_osu->osu_nai2 == NULL) in hs20_parse_osu_nai2()
1980 bss->hs20_osu_providers_nai_count++; in hs20_parse_osu_nai2()
1986 static int hs20_parse_osu_method_list(struct hostapd_bss_config *bss, char *pos, in hs20_parse_osu_method_list() argument
1989 if (bss->last_osu == NULL) { in hs20_parse_osu_method_list()
1994 if (hostapd_parse_intlist(&bss->last_osu->method_list, pos)) { in hs20_parse_osu_method_list()
2003 static int hs20_parse_osu_icon(struct hostapd_bss_config *bss, char *pos, in hs20_parse_osu_icon() argument
2007 struct hs20_osu_provider *p = bss->last_osu; in hs20_parse_osu_icon()
2027 static int hs20_parse_osu_service_desc(struct hostapd_bss_config *bss, in hs20_parse_osu_service_desc() argument
2030 if (bss->last_osu == NULL) { in hs20_parse_osu_service_desc()
2035 if (parse_lang_string(&bss->last_osu->service_desc, in hs20_parse_osu_service_desc()
2036 &bss->last_osu->service_desc_count, pos)) { in hs20_parse_osu_service_desc()
2046 static int hs20_parse_operator_icon(struct hostapd_bss_config *bss, char *pos, in hs20_parse_operator_icon() argument
2051 n = os_realloc_array(bss->hs20_operator_icon, in hs20_parse_operator_icon()
2052 bss->hs20_operator_icon_count + 1, sizeof(char *)); in hs20_parse_operator_icon()
2055 bss->hs20_operator_icon = n; in hs20_parse_operator_icon()
2056 bss->hs20_operator_icon[bss->hs20_operator_icon_count] = os_strdup(pos); in hs20_parse_operator_icon()
2057 if (!bss->hs20_operator_icon[bss->hs20_operator_icon_count]) in hs20_parse_operator_icon()
2059 bss->hs20_operator_icon_count++; in hs20_parse_operator_icon()
2135 static int parse_fils_realm(struct hostapd_bss_config *bss, const char *val) in parse_fils_realm() argument
2150 dl_list_add_tail(&bss->fils_realms, &realm->list); in parse_fils_realm()
2198 static int add_airtime_weight(struct hostapd_bss_config *bss, char *value) in add_airtime_weight() argument
2226 wt->next = bss->airtime_weight_list; in add_airtime_weight()
2227 bss->airtime_weight_list = wt; in add_airtime_weight()
2235 static int parse_sae_password(struct hostapd_bss_config *bss, const char *val) in parse_sae_password() argument
2316 !bss->sae_pk_password_check_skip && in parse_sae_password()
2325 pw->next = bss->sae_passwords; in parse_sae_password()
2326 bss->sae_passwords = pw; in parse_sae_password()
2340 static int parse_sae_password_file(struct hostapd_bss_config *bss, in parse_sae_password_file() argument
2359 if (parse_sae_password(bss, buf)) { in parse_sae_password_file()
2376 static int hostapd_dpp_controller_parse(struct hostapd_bss_config *bss, in hostapd_dpp_controller_parse() argument
2394 conf->next = bss->dpp_controller; in hostapd_dpp_controller_parse()
2395 bss->dpp_controller = conf; in hostapd_dpp_controller_parse()
2440 struct hostapd_bss_config *bss, in hostapd_config_fill() argument
2444 os_strlcpy(conf->bss[0]->iface, pos, in hostapd_config_fill()
2445 sizeof(conf->bss[0]->iface)); in hostapd_config_fill()
2447 os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); in hostapd_config_fill()
2449 bss->bridge_hairpin = atoi(pos); in hostapd_config_fill()
2451 os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge)); in hostapd_config_fill()
2453 os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge)); in hostapd_config_fill()
2478 bss->logger_syslog_level = atoi(pos); in hostapd_config_fill()
2480 bss->logger_stdout_level = atoi(pos); in hostapd_config_fill()
2482 bss->logger_syslog = atoi(pos); in hostapd_config_fill()
2484 bss->logger_stdout = atoi(pos); in hostapd_config_fill()
2489 struct hostapd_ssid *ssid = &bss->ssid; in hostapd_config_fill()
2501 struct hostapd_ssid *ssid = &bss->ssid; in hostapd_config_fill()
2516 bss->ssid.utf8_ssid = atoi(pos) > 0; in hostapd_config_fill()
2527 bss->macaddr_acl = acl; in hostapd_config_fill()
2529 if (hostapd_config_read_maclist(pos, &bss->accept_mac, in hostapd_config_fill()
2530 &bss->num_accept_mac)) { in hostapd_config_fill()
2536 if (hostapd_config_read_maclist(pos, &bss->deny_mac, in hostapd_config_fill()
2537 &bss->num_deny_mac)) { in hostapd_config_fill()
2543 bss->wds_sta = atoi(pos); in hostapd_config_fill()
2545 bss->start_disabled = atoi(pos); in hostapd_config_fill()
2547 bss->isolate = atoi(pos); in hostapd_config_fill()
2549 bss->ap_max_inactivity = atoi(pos); in hostapd_config_fill()
2551 bss->skip_inactivity_poll = atoi(pos); in hostapd_config_fill()
2560 bss->bss_max_idle = val; in hostapd_config_fill()
2562 bss->max_acceptable_idle_period = atoi(pos); in hostapd_config_fill()
2572 bss->no_disconnect_on_group_keyerror = val; in hostapd_config_fill()
2574 os_free(bss->config_id); in hostapd_config_fill()
2575 bss->config_id = os_strdup(pos); in hostapd_config_fill()
2592 bss->ieee802_1x = atoi(pos); in hostapd_config_fill()
2607 bss->eapol_version = eapol_version; in hostapd_config_fill()
2608 wpa_printf(MSG_DEBUG, "eapol_version=%d", bss->eapol_version); in hostapd_config_fill()
2611 bss->eap_server = atoi(pos); in hostapd_config_fill()
2614 bss->eap_server = atoi(pos); in hostapd_config_fill()
2616 if (hostapd_config_read_eap_user(pos, bss)) in hostapd_config_fill()
2619 os_free(bss->ca_cert); in hostapd_config_fill()
2620 bss->ca_cert = os_strdup(pos); in hostapd_config_fill()
2622 os_free(bss->server_cert); in hostapd_config_fill()
2623 bss->server_cert = os_strdup(pos); in hostapd_config_fill()
2625 os_free(bss->server_cert2); in hostapd_config_fill()
2626 bss->server_cert2 = os_strdup(pos); in hostapd_config_fill()
2628 os_free(bss->private_key); in hostapd_config_fill()
2629 bss->private_key = os_strdup(pos); in hostapd_config_fill()
2631 os_free(bss->private_key2); in hostapd_config_fill()
2632 bss->private_key2 = os_strdup(pos); in hostapd_config_fill()
2634 os_free(bss->private_key_passwd); in hostapd_config_fill()
2635 bss->private_key_passwd = os_strdup(pos); in hostapd_config_fill()
2637 os_free(bss->private_key_passwd2); in hostapd_config_fill()
2638 bss->private_key_passwd2 = os_strdup(pos); in hostapd_config_fill()
2645 os_free(bss->check_cert_subject); in hostapd_config_fill()
2646 bss->check_cert_subject = os_strdup(pos); in hostapd_config_fill()
2647 if (!bss->check_cert_subject) in hostapd_config_fill()
2650 bss->check_crl = atoi(pos); in hostapd_config_fill()
2652 bss->check_crl_strict = atoi(pos); in hostapd_config_fill()
2654 bss->crl_reload_interval = atoi(pos); in hostapd_config_fill()
2656 bss->tls_session_lifetime = atoi(pos); in hostapd_config_fill()
2658 bss->tls_flags = parse_tls_flags(pos); in hostapd_config_fill()
2660 bss->max_auth_rounds = atoi(pos); in hostapd_config_fill()
2662 bss->max_auth_rounds_short = atoi(pos); in hostapd_config_fill()
2664 os_free(bss->ocsp_stapling_response); in hostapd_config_fill()
2665 bss->ocsp_stapling_response = os_strdup(pos); in hostapd_config_fill()
2667 os_free(bss->ocsp_stapling_response_multi); in hostapd_config_fill()
2668 bss->ocsp_stapling_response_multi = os_strdup(pos); in hostapd_config_fill()
2670 os_free(bss->dh_file); in hostapd_config_fill()
2671 bss->dh_file = os_strdup(pos); in hostapd_config_fill()
2673 os_free(bss->openssl_ciphers); in hostapd_config_fill()
2674 bss->openssl_ciphers = os_strdup(pos); in hostapd_config_fill()
2676 os_free(bss->openssl_ecdh_curves); in hostapd_config_fill()
2677 bss->openssl_ecdh_curves = os_strdup(pos); in hostapd_config_fill()
2679 bss->fragment_size = atoi(pos); in hostapd_config_fill()
2682 os_free(bss->pac_opaque_encr_key); in hostapd_config_fill()
2683 bss->pac_opaque_encr_key = os_malloc(16); in hostapd_config_fill()
2684 if (bss->pac_opaque_encr_key == NULL) { in hostapd_config_fill()
2689 } else if (hexstr2bin(pos, bss->pac_opaque_encr_key, 16)) { in hostapd_config_fill()
2701 os_free(bss->eap_fast_a_id); in hostapd_config_fill()
2702 bss->eap_fast_a_id = os_malloc(idlen / 2); in hostapd_config_fill()
2703 if (bss->eap_fast_a_id == NULL || in hostapd_config_fill()
2704 hexstr2bin(pos, bss->eap_fast_a_id, idlen / 2)) { in hostapd_config_fill()
2707 os_free(bss->eap_fast_a_id); in hostapd_config_fill()
2708 bss->eap_fast_a_id = NULL; in hostapd_config_fill()
2711 bss->eap_fast_a_id_len = idlen / 2; in hostapd_config_fill()
2714 os_free(bss->eap_fast_a_id_info); in hostapd_config_fill()
2715 bss->eap_fast_a_id_info = os_strdup(pos); in hostapd_config_fill()
2717 bss->eap_fast_prov = atoi(pos); in hostapd_config_fill()
2719 bss->pac_key_lifetime = atoi(pos); in hostapd_config_fill()
2721 bss->pac_key_refresh_time = atoi(pos); in hostapd_config_fill()
2733 bss->eap_teap_auth = val; in hostapd_config_fill()
2735 bss->eap_teap_pac_no_inner = atoi(pos); in hostapd_config_fill()
2737 bss->eap_teap_separate_result = atoi(pos); in hostapd_config_fill()
2739 bss->eap_teap_id = atoi(pos); in hostapd_config_fill()
2741 bss->eap_teap_method_sequence = atoi(pos); in hostapd_config_fill()
2745 os_free(bss->eap_sim_db); in hostapd_config_fill()
2746 bss->eap_sim_db = os_strdup(pos); in hostapd_config_fill()
2748 bss->eap_sim_db_timeout = atoi(pos); in hostapd_config_fill()
2750 bss->eap_sim_aka_result_ind = atoi(pos); in hostapd_config_fill()
2752 bss->eap_sim_id = atoi(pos); in hostapd_config_fill()
2754 os_free(bss->imsi_privacy_key); in hostapd_config_fill()
2755 bss->imsi_privacy_key = os_strdup(pos); in hostapd_config_fill()
2757 bss->eap_sim_aka_fast_reauth_limit = atoi(pos); in hostapd_config_fill()
2761 bss->tnc = atoi(pos); in hostapd_config_fill()
2765 bss->pwd_group = atoi(pos); in hostapd_config_fill()
2769 bss->eap_server_erp = atoi(pos); in hostapd_config_fill()
2774 os_free(bss->eap_req_id_text); in hostapd_config_fill()
2775 bss->eap_req_id_text = os_strdup(pos); in hostapd_config_fill()
2776 if (bss->eap_req_id_text == NULL) { in hostapd_config_fill()
2781 bss->eap_req_id_text_len = os_strlen(bss->eap_req_id_text); in hostapd_config_fill()
2782 term = os_strstr(bss->eap_req_id_text, "\\0"); in hostapd_config_fill()
2786 bss->eap_req_id_text_len - in hostapd_config_fill()
2787 (term - bss->eap_req_id_text) - 1); in hostapd_config_fill()
2788 bss->eap_req_id_text_len--; in hostapd_config_fill()
2791 bss->erp_send_reauth_start = atoi(pos); in hostapd_config_fill()
2793 os_free(bss->erp_domain); in hostapd_config_fill()
2794 bss->erp_domain = os_strdup(pos); in hostapd_config_fill()
2805 bss->default_wep_key_len = val; in hostapd_config_fill()
2815 bss->individual_wep_key_len = val; in hostapd_config_fill()
2817 bss->wep_rekeying_period = atoi(pos); in hostapd_config_fill()
2818 if (bss->wep_rekeying_period < 0) { in hostapd_config_fill()
2820 line, bss->wep_rekeying_period); in hostapd_config_fill()
2825 bss->eap_reauth_period = atoi(pos); in hostapd_config_fill()
2826 if (bss->eap_reauth_period < 0) { in hostapd_config_fill()
2828 line, bss->eap_reauth_period); in hostapd_config_fill()
2832 bss->eapol_key_index_workaround = atoi(pos); in hostapd_config_fill()
2838 if (hostapd_parse_ip_addr(pos, &bss->own_ip_addr)) { in hostapd_config_fill()
2845 os_free(bss->nas_identifier); in hostapd_config_fill()
2846 bss->nas_identifier = os_strdup(pos); in hostapd_config_fill()
2849 if (hostapd_parse_ip_addr(pos, &bss->radius->client_addr)) { in hostapd_config_fill()
2855 bss->radius->force_client_addr = 1; in hostapd_config_fill()
2857 os_free(bss->radius->force_client_dev); in hostapd_config_fill()
2858 bss->radius->force_client_dev = os_strdup(pos); in hostapd_config_fill()
2861 &bss->radius->auth_servers, in hostapd_config_fill()
2862 &bss->radius->num_auth_servers, pos, 1812, in hostapd_config_fill()
2863 &bss->radius->auth_server)) { in hostapd_config_fill()
2869 } else if (bss->radius->auth_server && in hostapd_config_fill()
2872 &bss->radius->auth_server->addr)) { in hostapd_config_fill()
2878 } else if (bss->radius->auth_server && in hostapd_config_fill()
2880 bss->radius->auth_server->port = atoi(pos); in hostapd_config_fill()
2881 } else if (bss->radius->auth_server && in hostapd_config_fill()
2890 os_free(bss->radius->auth_server->shared_secret); in hostapd_config_fill()
2891 bss->radius->auth_server->shared_secret = (u8 *) os_strdup(pos); in hostapd_config_fill()
2892 bss->radius->auth_server->shared_secret_len = len; in hostapd_config_fill()
2893 } else if (bss->radius->auth_server && in hostapd_config_fill()
2896 bss->radius->auth_server->tls = false; in hostapd_config_fill()
2899 bss->radius->auth_server->tls = true; in hostapd_config_fill()
2907 } else if (bss->radius->auth_server && in hostapd_config_fill()
2909 os_free(bss->radius->auth_server->ca_cert); in hostapd_config_fill()
2910 bss->radius->auth_server->ca_cert = os_strdup(pos); in hostapd_config_fill()
2911 } else if (bss->radius->auth_server && in hostapd_config_fill()
2913 os_free(bss->radius->auth_server->client_cert); in hostapd_config_fill()
2914 bss->radius->auth_server->client_cert = os_strdup(pos); in hostapd_config_fill()
2915 } else if (bss->radius->auth_server && in hostapd_config_fill()
2917 os_free(bss->radius->auth_server->private_key); in hostapd_config_fill()
2918 bss->radius->auth_server->private_key = os_strdup(pos); in hostapd_config_fill()
2919 } else if (bss->radius->auth_server && in hostapd_config_fill()
2921 os_free(bss->radius->auth_server->private_key_passwd); in hostapd_config_fill()
2922 bss->radius->auth_server->private_key_passwd = os_strdup(pos); in hostapd_config_fill()
2926 &bss->radius->acct_servers, in hostapd_config_fill()
2927 &bss->radius->num_acct_servers, pos, 1813, in hostapd_config_fill()
2928 &bss->radius->acct_server)) { in hostapd_config_fill()
2934 } else if (bss->radius->acct_server && in hostapd_config_fill()
2937 &bss->radius->acct_server->addr)) { in hostapd_config_fill()
2943 } else if (bss->radius->acct_server && in hostapd_config_fill()
2945 bss->radius->acct_server->port = atoi(pos); in hostapd_config_fill()
2946 } else if (bss->radius->acct_server && in hostapd_config_fill()
2955 os_free(bss->radius->acct_server->shared_secret); in hostapd_config_fill()
2956 bss->radius->acct_server->shared_secret = (u8 *) os_strdup(pos); in hostapd_config_fill()
2957 bss->radius->acct_server->shared_secret_len = len; in hostapd_config_fill()
2958 } else if (bss->radius->acct_server && in hostapd_config_fill()
2961 bss->radius->acct_server->tls = false; in hostapd_config_fill()
2964 bss->radius->acct_server->tls = true; in hostapd_config_fill()
2972 } else if (bss->radius->acct_server && in hostapd_config_fill()
2974 os_free(bss->radius->acct_server->ca_cert); in hostapd_config_fill()
2975 bss->radius->acct_server->ca_cert = os_strdup(pos); in hostapd_config_fill()
2976 } else if (bss->radius->acct_server && in hostapd_config_fill()
2978 os_free(bss->radius->acct_server->client_cert); in hostapd_config_fill()
2979 bss->radius->acct_server->client_cert = os_strdup(pos); in hostapd_config_fill()
2980 } else if (bss->radius->acct_server && in hostapd_config_fill()
2982 os_free(bss->radius->acct_server->private_key); in hostapd_config_fill()
2983 bss->radius->acct_server->private_key = os_strdup(pos); in hostapd_config_fill()
2984 } else if (bss->radius->acct_server && in hostapd_config_fill()
2986 os_free(bss->radius->acct_server->private_key_passwd); in hostapd_config_fill()
2987 bss->radius->acct_server->private_key_passwd = os_strdup(pos); in hostapd_config_fill()
2990 bss->radius->retry_primary_interval = atoi(pos); in hostapd_config_fill()
2993 bss->radius_require_message_authenticator = atoi(pos); in hostapd_config_fill()
2995 bss->acct_interim_interval = atoi(pos); in hostapd_config_fill()
2997 bss->radius_request_cui = atoi(pos); in hostapd_config_fill()
3006 } else if (bss->radius_auth_req_attr == NULL) { in hostapd_config_fill()
3007 bss->radius_auth_req_attr = attr; in hostapd_config_fill()
3009 a = bss->radius_auth_req_attr; in hostapd_config_fill()
3022 } else if (bss->radius_acct_req_attr == NULL) { in hostapd_config_fill()
3023 bss->radius_acct_req_attr = attr; in hostapd_config_fill()
3025 a = bss->radius_acct_req_attr; in hostapd_config_fill()
3031 os_free(bss->radius_req_attr_sqlite); in hostapd_config_fill()
3032 bss->radius_req_attr_sqlite = os_strdup(pos); in hostapd_config_fill()
3034 bss->radius_das_port = atoi(pos); in hostapd_config_fill()
3036 if (hostapd_parse_das_client(bss, pos) < 0) { in hostapd_config_fill()
3042 bss->radius_das_time_window = atoi(pos); in hostapd_config_fill()
3044 bss->radius_das_require_event_timestamp = atoi(pos); in hostapd_config_fill()
3047 bss->radius_das_require_message_authenticator = atoi(pos); in hostapd_config_fill()
3050 bss->auth_algs = atoi(pos); in hostapd_config_fill()
3051 if (bss->auth_algs == 0) { in hostapd_config_fill()
3057 bss->max_num_sta = atoi(pos); in hostapd_config_fill()
3058 if (bss->max_num_sta < 0 || in hostapd_config_fill()
3059 bss->max_num_sta > MAX_STA_COUNT) { in hostapd_config_fill()
3061 line, bss->max_num_sta, MAX_STA_COUNT); in hostapd_config_fill()
3065 bss->wpa = atoi(pos); in hostapd_config_fill()
3075 bss->extended_key_id = val; in hostapd_config_fill()
3077 bss->wpa_group_rekey = atoi(pos); in hostapd_config_fill()
3078 bss->wpa_group_rekey_set = 1; in hostapd_config_fill()
3080 bss->wpa_strict_rekey = atoi(pos); in hostapd_config_fill()
3082 bss->wpa_gmk_rekey = atoi(pos); in hostapd_config_fill()
3084 bss->wpa_ptk_rekey = atoi(pos); in hostapd_config_fill()
3086 bss->wpa_deny_ptk0_rekey = atoi(pos); in hostapd_config_fill()
3087 if (bss->wpa_deny_ptk0_rekey < 0 || in hostapd_config_fill()
3088 bss->wpa_deny_ptk0_rekey > 2) { in hostapd_config_fill()
3091 line, bss->wpa_deny_ptk0_rekey); in hostapd_config_fill()
3104 bss->wpa_group_update_count = (u32) val; in hostapd_config_fill()
3115 bss->wpa_pairwise_update_count = (u32) val; in hostapd_config_fill()
3117 bss->wpa_disable_eapol_key_retries = atoi(pos); in hostapd_config_fill()
3125 os_free(bss->ssid.wpa_passphrase); in hostapd_config_fill()
3126 bss->ssid.wpa_passphrase = os_strdup(pos); in hostapd_config_fill()
3127 if (bss->ssid.wpa_passphrase) { in hostapd_config_fill()
3128 hostapd_config_clear_wpa_psk(&bss->ssid.wpa_psk); in hostapd_config_fill()
3129 bss->ssid.wpa_passphrase_set = 1; in hostapd_config_fill()
3132 hostapd_config_clear_wpa_psk(&bss->ssid.wpa_psk); in hostapd_config_fill()
3133 bss->ssid.wpa_psk = os_zalloc(sizeof(struct hostapd_wpa_psk)); in hostapd_config_fill()
3134 if (bss->ssid.wpa_psk == NULL) in hostapd_config_fill()
3136 if (hexstr2bin(pos, bss->ssid.wpa_psk->psk, PMK_LEN) || in hostapd_config_fill()
3140 hostapd_config_clear_wpa_psk(&bss->ssid.wpa_psk); in hostapd_config_fill()
3143 bss->ssid.wpa_psk->group = 1; in hostapd_config_fill()
3144 os_free(bss->ssid.wpa_passphrase); in hostapd_config_fill()
3145 bss->ssid.wpa_passphrase = NULL; in hostapd_config_fill()
3146 bss->ssid.wpa_psk_set = 1; in hostapd_config_fill()
3148 os_free(bss->ssid.wpa_psk_file); in hostapd_config_fill()
3149 bss->ssid.wpa_psk_file = os_strdup(pos); in hostapd_config_fill()
3150 if (!bss->ssid.wpa_psk_file) { in hostapd_config_fill()
3156 bss->wpa_key_mgmt = hostapd_config_parse_key_mgmt(line, pos); in hostapd_config_fill()
3157 if (bss->wpa_key_mgmt == -1) in hostapd_config_fill()
3160 bss->wpa_psk_radius = atoi(pos); in hostapd_config_fill()
3161 if (bss->wpa_psk_radius != PSK_RADIUS_IGNORED && in hostapd_config_fill()
3162 bss->wpa_psk_radius != PSK_RADIUS_ACCEPTED && in hostapd_config_fill()
3163 bss->wpa_psk_radius != PSK_RADIUS_REQUIRED && in hostapd_config_fill()
3164 bss->wpa_psk_radius != PSK_RADIUS_DURING_4WAY_HS) { in hostapd_config_fill()
3167 line, bss->wpa_psk_radius); in hostapd_config_fill()
3171 bss->wpa_pairwise = hostapd_config_parse_cipher(line, pos); in hostapd_config_fill()
3172 if (bss->wpa_pairwise == -1 || bss->wpa_pairwise == 0) in hostapd_config_fill()
3174 if (bss->wpa_pairwise & in hostapd_config_fill()
3181 bss->rsn_pairwise = hostapd_config_parse_cipher(line, pos); in hostapd_config_fill()
3182 if (bss->rsn_pairwise == -1 || bss->rsn_pairwise == 0) in hostapd_config_fill()
3184 if (bss->rsn_pairwise & in hostapd_config_fill()
3191 bss->group_cipher = hostapd_config_parse_cipher(line, pos); in hostapd_config_fill()
3192 if (bss->group_cipher == -1 || bss->group_cipher == 0) in hostapd_config_fill()
3194 if (bss->group_cipher != WPA_CIPHER_TKIP && in hostapd_config_fill()
3195 bss->group_cipher != WPA_CIPHER_CCMP && in hostapd_config_fill()
3196 bss->group_cipher != WPA_CIPHER_GCMP && in hostapd_config_fill()
3197 bss->group_cipher != WPA_CIPHER_GCMP_256 && in hostapd_config_fill()
3198 bss->group_cipher != WPA_CIPHER_CCMP_256) { in hostapd_config_fill()
3206 bss->rsn_preauth = atoi(pos); in hostapd_config_fill()
3208 os_free(bss->rsn_preauth_interfaces); in hostapd_config_fill()
3209 bss->rsn_preauth_interfaces = os_strdup(pos); in hostapd_config_fill()
3217 hexstr2bin(pos, bss->mobility_domain, in hostapd_config_fill()
3226 hexstr2bin(pos, bss->r1_key_holder, FT_R1KH_ID_LEN) != 0) { in hostapd_config_fill()
3234 bss->r0_key_lifetime = atoi(pos) * 60; in hostapd_config_fill()
3236 bss->r0_key_lifetime = atoi(pos); in hostapd_config_fill()
3238 bss->r1_max_key_lifetime = atoi(pos); in hostapd_config_fill()
3240 bss->reassociation_deadline = atoi(pos); in hostapd_config_fill()
3242 bss->rkh_pos_timeout = atoi(pos); in hostapd_config_fill()
3244 bss->rkh_neg_timeout = atoi(pos); in hostapd_config_fill()
3246 bss->rkh_pull_timeout = atoi(pos); in hostapd_config_fill()
3248 bss->rkh_pull_retries = atoi(pos); in hostapd_config_fill()
3250 if (add_r0kh(bss, pos) < 0) { in hostapd_config_fill()
3256 if (add_r1kh(bss, pos) < 0) { in hostapd_config_fill()
3262 os_free(bss->rxkh_file); in hostapd_config_fill()
3263 bss->rxkh_file = os_strdup(pos); in hostapd_config_fill()
3264 if (!bss->rxkh_file) { in hostapd_config_fill()
3269 if (hostapd_config_read_rxkh_file(bss, pos)) { in hostapd_config_fill()
3277 bss->pmk_r1_push = atoi(pos); in hostapd_config_fill()
3279 bss->ft_over_ds = atoi(pos); in hostapd_config_fill()
3281 bss->ft_psk_generate_local = atoi(pos); in hostapd_config_fill()
3285 os_free(bss->ctrl_interface); in hostapd_config_fill()
3286 bss->ctrl_interface = os_strdup(pos); in hostapd_config_fill()
3295 bss->ctrl_interface_gid = grp->gr_gid; in hostapd_config_fill()
3296 bss->ctrl_interface_gid_set = 1; in hostapd_config_fill()
3298 bss->ctrl_interface_gid, group); in hostapd_config_fill()
3303 bss->ctrl_interface_gid = strtol(group, &endp, 10); in hostapd_config_fill()
3309 bss->ctrl_interface_gid_set = 1; in hostapd_config_fill()
3311 bss->ctrl_interface_gid); in hostapd_config_fill()
3316 os_free(bss->radius_server_clients); in hostapd_config_fill()
3317 bss->radius_server_clients = os_strdup(pos); in hostapd_config_fill()
3319 bss->radius_server_auth_port = atoi(pos); in hostapd_config_fill()
3321 bss->radius_server_acct_port = atoi(pos); in hostapd_config_fill()
3323 bss->radius_server_ipv6 = atoi(pos); in hostapd_config_fill()
3326 bss->use_pae_group_addr = atoi(pos); in hostapd_config_fill()
3346 bss->wps_rf_bands = WPS_RF_60GHZ; in hostapd_config_fill()
3348 bss->wps_rf_bands = WPS_RF_50GHZ; in hostapd_config_fill()
3351 bss->wps_rf_bands = WPS_RF_24GHZ; in hostapd_config_fill()
3354 bss->wps_rf_bands = WPS_RF_24GHZ | WPS_RF_50GHZ; in hostapd_config_fill()
3448 bss->dtim_period = val; in hostapd_config_fill()
3458 bss->bss_load_update_period = val; in hostapd_config_fill()
3468 bss->chan_util_avg_period = val; in hostapd_config_fill()
3495 bss->send_probe_response = val; in hostapd_config_fill()
3558 bss->ignore_broadcast_ssid = atoi(pos); in hostapd_config_fill()
3560 bss->no_probe_resp_if_max_sta = atoi(pos); in hostapd_config_fill()
3563 bss->ssid.wep.idx = atoi(pos); in hostapd_config_fill()
3564 if (bss->ssid.wep.idx > 3) { in hostapd_config_fill()
3567 bss->ssid.wep.idx); in hostapd_config_fill()
3574 if (hostapd_config_read_wep(&bss->ssid.wep, in hostapd_config_fill()
3583 bss->ssid.dynamic_vlan = atoi(pos); in hostapd_config_fill()
3585 bss->ssid.per_sta_vif = atoi(pos); in hostapd_config_fill()
3587 if (hostapd_config_read_vlan_file(bss, pos)) { in hostapd_config_fill()
3593 bss->ssid.vlan_naming = atoi(pos); in hostapd_config_fill()
3594 if (bss->ssid.vlan_naming >= DYNAMIC_VLAN_NAMING_END || in hostapd_config_fill()
3595 bss->ssid.vlan_naming < 0) { in hostapd_config_fill()
3598 line, bss->ssid.vlan_naming); in hostapd_config_fill()
3603 os_free(bss->ssid.vlan_tagged_interface); in hostapd_config_fill()
3604 bss->ssid.vlan_tagged_interface = os_strdup(pos); in hostapd_config_fill()
3619 bss->wmm_enabled = atoi(pos); in hostapd_config_fill()
3621 bss->wmm_uapsd = atoi(pos); in hostapd_config_fill()
3636 if (hwaddr_aton(pos, bss->bssid)) { in hostapd_config_fill()
3644 bss->ieee80211w = atoi(pos); in hostapd_config_fill()
3647 bss->group_mgmt_cipher = WPA_CIPHER_AES_128_CMAC; in hostapd_config_fill()
3649 bss->group_mgmt_cipher = WPA_CIPHER_BIP_GMAC_128; in hostapd_config_fill()
3651 bss->group_mgmt_cipher = WPA_CIPHER_BIP_GMAC_256; in hostapd_config_fill()
3653 bss->group_mgmt_cipher = WPA_CIPHER_BIP_CMAC_256; in hostapd_config_fill()
3660 bss->beacon_prot = atoi(pos); in hostapd_config_fill()
3662 bss->assoc_sa_query_max_timeout = atoi(pos); in hostapd_config_fill()
3663 if (bss->assoc_sa_query_max_timeout == 0) { in hostapd_config_fill()
3669 bss->assoc_sa_query_retry_timeout = atoi(pos); in hostapd_config_fill()
3670 if (bss->assoc_sa_query_retry_timeout == 0) { in hostapd_config_fill()
3677 bss->ocv = atoi(pos); in hostapd_config_fill()
3678 if (bss->ocv && !bss->ieee80211w) in hostapd_config_fill()
3679 bss->ieee80211w = 1; in hostapd_config_fill()
3713 bss->vendor_vht = atoi(pos); in hostapd_config_fill()
3715 bss->use_sta_nsts = atoi(pos); in hostapd_config_fill()
3890 bss->unsol_bcast_probe_resp_interval = val; in hostapd_config_fill()
3902 bss->max_listen_interval = atoi(pos); in hostapd_config_fill()
3904 bss->disable_pmksa_caching = atoi(pos); in hostapd_config_fill()
3906 bss->okc = atoi(pos); in hostapd_config_fill()
3909 bss->wps_state = atoi(pos); in hostapd_config_fill()
3910 if (bss->wps_state < 0 || bss->wps_state > 2) { in hostapd_config_fill()
3916 bss->wps_independent = atoi(pos); in hostapd_config_fill()
3918 bss->ap_setup_locked = atoi(pos); in hostapd_config_fill()
3920 if (uuid_str2bin(pos, bss->uuid)) { in hostapd_config_fill()
3925 os_free(bss->wps_pin_requests); in hostapd_config_fill()
3926 bss->wps_pin_requests = os_strdup(pos); in hostapd_config_fill()
3933 os_free(bss->device_name); in hostapd_config_fill()
3934 bss->device_name = os_strdup(pos); in hostapd_config_fill()
3941 os_free(bss->manufacturer); in hostapd_config_fill()
3942 bss->manufacturer = os_strdup(pos); in hostapd_config_fill()
3949 os_free(bss->model_name); in hostapd_config_fill()
3950 bss->model_name = os_strdup(pos); in hostapd_config_fill()
3957 os_free(bss->model_number); in hostapd_config_fill()
3958 bss->model_number = os_strdup(pos); in hostapd_config_fill()
3965 os_free(bss->serial_number); in hostapd_config_fill()
3966 bss->serial_number = os_strdup(pos); in hostapd_config_fill()
3968 if (wps_dev_type_str2bin(pos, bss->device_type)) in hostapd_config_fill()
3971 os_free(bss->config_methods); in hostapd_config_fill()
3972 bss->config_methods = os_strdup(pos); in hostapd_config_fill()
3974 if (hexstr2bin(pos, bss->os_version, 4)) { in hostapd_config_fill()
3980 os_free(bss->ap_pin); in hostapd_config_fill()
3982 bss->ap_pin = NULL; in hostapd_config_fill()
3984 bss->ap_pin = os_strdup(pos); in hostapd_config_fill()
3986 bss->skip_cred_build = atoi(pos); in hostapd_config_fill()
3988 os_free(bss->extra_cred); in hostapd_config_fill()
3989 bss->extra_cred = (u8 *) os_readfile(pos, &bss->extra_cred_len); in hostapd_config_fill()
3990 if (bss->extra_cred == NULL) { in hostapd_config_fill()
3996 bss->wps_cred_processing = atoi(pos); in hostapd_config_fill()
3998 bss->wps_cred_add_sae = atoi(pos); in hostapd_config_fill()
4000 os_free(bss->ap_settings); in hostapd_config_fill()
4001 bss->ap_settings = in hostapd_config_fill()
4002 (u8 *) os_readfile(pos, &bss->ap_settings_len); in hostapd_config_fill()
4003 if (bss->ap_settings == NULL) { in hostapd_config_fill()
4018 os_memcpy(bss->multi_ap_backhaul_ssid.ssid, str, slen); in hostapd_config_fill()
4019 bss->multi_ap_backhaul_ssid.ssid_len = slen; in hostapd_config_fill()
4020 bss->multi_ap_backhaul_ssid.ssid_set = 1; in hostapd_config_fill()
4031 os_free(bss->multi_ap_backhaul_ssid.wpa_passphrase); in hostapd_config_fill()
4032 bss->multi_ap_backhaul_ssid.wpa_passphrase = os_strdup(pos); in hostapd_config_fill()
4033 if (bss->multi_ap_backhaul_ssid.wpa_passphrase) { in hostapd_config_fill()
4035 &bss->multi_ap_backhaul_ssid.wpa_psk); in hostapd_config_fill()
4036 bss->multi_ap_backhaul_ssid.wpa_passphrase_set = 1; in hostapd_config_fill()
4040 &bss->multi_ap_backhaul_ssid.wpa_psk); in hostapd_config_fill()
4041 bss->multi_ap_backhaul_ssid.wpa_psk = in hostapd_config_fill()
4043 if (!bss->multi_ap_backhaul_ssid.wpa_psk) in hostapd_config_fill()
4045 if (hexstr2bin(pos, bss->multi_ap_backhaul_ssid.wpa_psk->psk, in hostapd_config_fill()
4051 &bss->multi_ap_backhaul_ssid.wpa_psk); in hostapd_config_fill()
4054 bss->multi_ap_backhaul_ssid.wpa_psk->group = 1; in hostapd_config_fill()
4055 os_free(bss->multi_ap_backhaul_ssid.wpa_passphrase); in hostapd_config_fill()
4056 bss->multi_ap_backhaul_ssid.wpa_passphrase = NULL; in hostapd_config_fill()
4057 bss->multi_ap_backhaul_ssid.wpa_psk_set = 1; in hostapd_config_fill()
4059 os_free(bss->upnp_iface); in hostapd_config_fill()
4060 bss->upnp_iface = os_strdup(pos); in hostapd_config_fill()
4062 os_free(bss->friendly_name); in hostapd_config_fill()
4063 bss->friendly_name = os_strdup(pos); in hostapd_config_fill()
4065 os_free(bss->manufacturer_url); in hostapd_config_fill()
4066 bss->manufacturer_url = os_strdup(pos); in hostapd_config_fill()
4068 os_free(bss->model_description); in hostapd_config_fill()
4069 bss->model_description = os_strdup(pos); in hostapd_config_fill()
4071 os_free(bss->model_url); in hostapd_config_fill()
4072 bss->model_url = os_strdup(pos); in hostapd_config_fill()
4074 os_free(bss->upc); in hostapd_config_fill()
4075 bss->upc = os_strdup(pos); in hostapd_config_fill()
4077 bss->pbc_in_m1 = atoi(pos); in hostapd_config_fill()
4079 os_free(bss->server_id); in hostapd_config_fill()
4080 bss->server_id = os_strdup(pos); in hostapd_config_fill()
4082 wpabuf_free(bss->wps_application_ext); in hostapd_config_fill()
4083 bss->wps_application_ext = wpabuf_parse_bin(pos); in hostapd_config_fill()
4086 bss->wps_nfc_dev_pw_id = atoi(pos); in hostapd_config_fill()
4087 if (bss->wps_nfc_dev_pw_id < 0x10 || in hostapd_config_fill()
4088 bss->wps_nfc_dev_pw_id > 0xffff) { in hostapd_config_fill()
4093 bss->wps_nfc_pw_from_config = 1; in hostapd_config_fill()
4095 wpabuf_free(bss->wps_nfc_dh_pubkey); in hostapd_config_fill()
4096 bss->wps_nfc_dh_pubkey = wpabuf_parse_bin(pos); in hostapd_config_fill()
4097 bss->wps_nfc_pw_from_config = 1; in hostapd_config_fill()
4099 wpabuf_free(bss->wps_nfc_dh_privkey); in hostapd_config_fill()
4100 bss->wps_nfc_dh_privkey = wpabuf_parse_bin(pos); in hostapd_config_fill()
4101 bss->wps_nfc_pw_from_config = 1; in hostapd_config_fill()
4103 wpabuf_free(bss->wps_nfc_dev_pw); in hostapd_config_fill()
4104 bss->wps_nfc_dev_pw = wpabuf_parse_bin(pos); in hostapd_config_fill()
4105 bss->wps_nfc_pw_from_config = 1; in hostapd_config_fill()
4111 bss->p2p |= P2P_MANAGE; in hostapd_config_fill()
4113 bss->p2p &= ~P2P_MANAGE; in hostapd_config_fill()
4116 bss->p2p |= P2P_ALLOW_CROSS_CONNECTION; in hostapd_config_fill()
4118 bss->p2p &= ~P2P_ALLOW_CROSS_CONNECTION; in hostapd_config_fill()
4121 bss->disassoc_low_ack = atoi(pos); in hostapd_config_fill()
4124 bss->tdls |= TDLS_PROHIBIT; in hostapd_config_fill()
4126 bss->tdls &= ~TDLS_PROHIBIT; in hostapd_config_fill()
4129 bss->tdls |= TDLS_PROHIBIT_CHAN_SWITCH; in hostapd_config_fill()
4131 bss->tdls &= ~TDLS_PROHIBIT_CHAN_SWITCH; in hostapd_config_fill()
4138 bss->time_advertisement = atoi(pos); in hostapd_config_fill()
4146 os_free(bss->time_zone); in hostapd_config_fill()
4147 bss->time_zone = os_strdup(pos); in hostapd_config_fill()
4148 if (bss->time_zone == NULL) in hostapd_config_fill()
4152 bss->wnm_sleep_mode = atoi(pos); in hostapd_config_fill()
4154 bss->wnm_sleep_mode_no_keys = atoi(pos); in hostapd_config_fill()
4156 bss->bss_transition = atoi(pos); in hostapd_config_fill()
4160 bss->interworking = atoi(pos); in hostapd_config_fill()
4162 bss->access_network_type = atoi(pos); in hostapd_config_fill()
4163 if (bss->access_network_type < 0 || in hostapd_config_fill()
4164 bss->access_network_type > 15) { in hostapd_config_fill()
4171 bss->internet = atoi(pos); in hostapd_config_fill()
4173 bss->asra = atoi(pos); in hostapd_config_fill()
4175 bss->esr = atoi(pos); in hostapd_config_fill()
4177 bss->uesa = atoi(pos); in hostapd_config_fill()
4179 bss->venue_group = atoi(pos); in hostapd_config_fill()
4180 bss->venue_info_set = 1; in hostapd_config_fill()
4182 bss->venue_type = atoi(pos); in hostapd_config_fill()
4183 bss->venue_info_set = 1; in hostapd_config_fill()
4185 if (hwaddr_aton(pos, bss->hessid)) { in hostapd_config_fill()
4190 if (parse_roaming_consortium(bss, pos, line) < 0) in hostapd_config_fill()
4193 if (parse_venue_name(bss, pos, line) < 0) in hostapd_config_fill()
4196 if (parse_venue_url(bss, pos, line) < 0) in hostapd_config_fill()
4211 os_free(bss->network_auth_type); in hostapd_config_fill()
4212 bss->network_auth_type = os_malloc(redirect_url_len + 3 + 1); in hostapd_config_fill()
4213 if (bss->network_auth_type == NULL) in hostapd_config_fill()
4215 *bss->network_auth_type = auth_type; in hostapd_config_fill()
4216 WPA_PUT_LE16(bss->network_auth_type + 1, redirect_url_len); in hostapd_config_fill()
4218 os_memcpy(bss->network_auth_type + 3, pos + 2, in hostapd_config_fill()
4220 bss->network_auth_type_len = 3 + redirect_url_len; in hostapd_config_fill()
4222 if (hexstr2bin(pos, &bss->ipaddr_type_availability, 1)) { in hostapd_config_fill()
4225 bss->ipaddr_type_configured = 0; in hostapd_config_fill()
4228 bss->ipaddr_type_configured = 1; in hostapd_config_fill()
4263 os_free(bss->domain_name); in hostapd_config_fill()
4264 bss->domain_name = domain_list; in hostapd_config_fill()
4265 bss->domain_name_len = domain_list_len; in hostapd_config_fill()
4267 if (parse_3gpp_cell_net(bss, pos, line) < 0) in hostapd_config_fill()
4270 if (parse_nai_realm(bss, pos, line) < 0) in hostapd_config_fill()
4273 if (parse_anqp_elem(bss, pos, line) < 0) in hostapd_config_fill()
4284 bss->gas_frag_limit = val; in hostapd_config_fill()
4286 bss->gas_comeback_delay = atoi(pos); in hostapd_config_fill()
4289 if (parse_qos_map_set(bss, pos, line) < 0) in hostapd_config_fill()
4293 os_free(bss->dump_msk_file); in hostapd_config_fill()
4294 bss->dump_msk_file = os_strdup(pos); in hostapd_config_fill()
4298 bss->proxy_arp = atoi(pos); in hostapd_config_fill()
4302 bss->hs20 = atoi(pos); in hostapd_config_fill()
4312 bss->hs20_release = val; in hostapd_config_fill()
4314 bss->disable_dgaf = atoi(pos); in hostapd_config_fill()
4316 bss->na_mcast_to_ucast = atoi(pos); in hostapd_config_fill()
4318 bss->osen = atoi(pos); in hostapd_config_fill()
4320 bss->anqp_domain_id = atoi(pos); in hostapd_config_fill()
4322 bss->hs20_deauth_req_timeout = atoi(pos); in hostapd_config_fill()
4324 if (hs20_parse_oper_friendly_name(bss, pos, line) < 0) in hostapd_config_fill()
4327 if (hs20_parse_wan_metrics(bss, pos, line) < 0) in hostapd_config_fill()
4330 if (hs20_parse_conn_capab(bss, pos, line) < 0) { in hostapd_config_fill()
4354 os_free(bss->hs20_operating_class); in hostapd_config_fill()
4355 bss->hs20_operating_class = oper_class; in hostapd_config_fill()
4356 bss->hs20_operating_class_len = oper_class_len; in hostapd_config_fill()
4358 if (hs20_parse_icon(bss, pos) < 0) { in hostapd_config_fill()
4364 if (hs20_parse_osu_ssid(bss, pos, line) < 0) in hostapd_config_fill()
4367 if (hs20_parse_osu_server_uri(bss, pos, line) < 0) in hostapd_config_fill()
4370 if (hs20_parse_osu_friendly_name(bss, pos, line) < 0) in hostapd_config_fill()
4373 if (hs20_parse_osu_nai(bss, pos, line) < 0) in hostapd_config_fill()
4376 if (hs20_parse_osu_nai2(bss, pos, line) < 0) in hostapd_config_fill()
4379 if (hs20_parse_osu_method_list(bss, pos, line) < 0) in hostapd_config_fill()
4382 if (hs20_parse_osu_icon(bss, pos, line) < 0) in hostapd_config_fill()
4385 if (hs20_parse_osu_service_desc(bss, pos, line) < 0) in hostapd_config_fill()
4388 if (hs20_parse_operator_icon(bss, pos, line) < 0) in hostapd_config_fill()
4391 os_free(bss->subscr_remediation_url); in hostapd_config_fill()
4392 bss->subscr_remediation_url = os_strdup(pos); in hostapd_config_fill()
4394 bss->subscr_remediation_method = atoi(pos); in hostapd_config_fill()
4396 os_free(bss->t_c_filename); in hostapd_config_fill()
4397 bss->t_c_filename = os_strdup(pos); in hostapd_config_fill()
4399 bss->t_c_timestamp = strtol(pos, NULL, 0); in hostapd_config_fill()
4401 os_free(bss->t_c_server_url); in hostapd_config_fill()
4402 bss->t_c_server_url = os_strdup(pos); in hostapd_config_fill()
4404 os_free(bss->hs20_sim_provisioning_url); in hostapd_config_fill()
4405 bss->hs20_sim_provisioning_url = os_strdup(pos); in hostapd_config_fill()
4409 bss->mbo_enabled = atoi(pos); in hostapd_config_fill()
4411 bss->mbo_cell_data_conn_pref = atoi(pos); in hostapd_config_fill()
4413 bss->oce = atoi(pos); in hostapd_config_fill()
4436 WPA_PUT_LE16(bss->bss_load_test, atoi(pos)); in hostapd_config_fill()
4444 bss->bss_load_test[2] = atoi(pos); in hostapd_config_fill()
4452 WPA_PUT_LE16(&bss->bss_load_test[3], atoi(pos)); in hostapd_config_fill()
4453 bss->bss_load_test_set = 1; in hostapd_config_fill()
4462 bss->radio_measurements[0] |= in hostapd_config_fill()
4480 wpabuf_free(bss->own_ie_override); in hostapd_config_fill()
4481 bss->own_ie_override = tmp; in hostapd_config_fill()
4483 bss->sae_reflection_attack = atoi(pos); in hostapd_config_fill()
4485 bss->sae_commit_status = atoi(pos); in hostapd_config_fill()
4487 bss->sae_pk_omit = atoi(pos); in hostapd_config_fill()
4489 bss->sae_pk_password_check_skip = atoi(pos); in hostapd_config_fill()
4491 wpabuf_free(bss->sae_commit_override); in hostapd_config_fill()
4492 bss->sae_commit_override = wpabuf_parse_bin(pos); in hostapd_config_fill()
4494 wpabuf_free(bss->rsne_override_eapol); in hostapd_config_fill()
4495 bss->rsne_override_eapol = wpabuf_parse_bin(pos); in hostapd_config_fill()
4497 wpabuf_free(bss->rsnxe_override_eapol); in hostapd_config_fill()
4498 bss->rsnxe_override_eapol = wpabuf_parse_bin(pos); in hostapd_config_fill()
4500 wpabuf_free(bss->rsne_override_ft); in hostapd_config_fill()
4501 bss->rsne_override_ft = wpabuf_parse_bin(pos); in hostapd_config_fill()
4503 wpabuf_free(bss->rsnxe_override_ft); in hostapd_config_fill()
4504 bss->rsnxe_override_ft = wpabuf_parse_bin(pos); in hostapd_config_fill()
4506 wpabuf_free(bss->gtk_rsc_override); in hostapd_config_fill()
4507 bss->gtk_rsc_override = wpabuf_parse_bin(pos); in hostapd_config_fill()
4509 wpabuf_free(bss->igtk_rsc_override); in hostapd_config_fill()
4510 bss->igtk_rsc_override = wpabuf_parse_bin(pos); in hostapd_config_fill()
4512 bss->no_beacon_rsnxe = atoi(pos); in hostapd_config_fill()
4514 bss->skip_prune_assoc = atoi(pos); in hostapd_config_fill()
4516 bss->ft_rsnxe_used = atoi(pos); in hostapd_config_fill()
4518 bss->oci_freq_override_eapol_m3 = atoi(pos); in hostapd_config_fill()
4520 bss->oci_freq_override_eapol_g1 = atoi(pos); in hostapd_config_fill()
4522 bss->oci_freq_override_saquery_req = atoi(pos); in hostapd_config_fill()
4524 bss->oci_freq_override_saquery_resp = atoi(pos); in hostapd_config_fill()
4526 bss->oci_freq_override_ft_assoc = atoi(pos); in hostapd_config_fill()
4528 bss->oci_freq_override_fils_assoc = atoi(pos); in hostapd_config_fill()
4530 bss->oci_freq_override_wnm_sleep = atoi(pos); in hostapd_config_fill()
4532 bss->eap_skip_prot_success = atoi(pos); in hostapd_config_fill()
4536 if (parse_wpabuf_hex(line, buf, &bss->eapol_m1_elements, pos)) in hostapd_config_fill()
4539 if (parse_wpabuf_hex(line, buf, &bss->eapol_m3_elements, pos)) in hostapd_config_fill()
4542 bss->eapol_m3_no_encrypt = atoi(pos); in hostapd_config_fill()
4544 bss->test_assoc_comeback_type = atoi(pos); in hostapd_config_fill()
4546 if (parse_wpabuf_hex(line, buf, &bss->presp_elements, pos)) in hostapd_config_fill()
4551 if (parse_sae_password(bss, pos) < 0) { in hostapd_config_fill()
4557 if (parse_sae_password_file(bss, pos) < 0) { in hostapd_config_fill()
4565 if (parse_wpabuf_hex(line, buf, &bss->vendor_elements, pos)) in hostapd_config_fill()
4568 if (parse_wpabuf_hex(line, buf, &bss->assocresp_elements, pos)) in hostapd_config_fill()
4572 bss->anti_clogging_threshold = atoi(pos); in hostapd_config_fill()
4574 bss->sae_sync = atoi(pos); in hostapd_config_fill()
4576 if (hostapd_parse_intlist(&bss->sae_groups, pos)) { in hostapd_config_fill()
4583 bss->sae_require_mfp = atoi(pos); in hostapd_config_fill()
4585 bss->sae_confirm_immediate = atoi(pos); in hostapd_config_fill()
4587 bss->sae_pwe = atoi(pos); in hostapd_config_fill()
4599 os_free(bss->wowlan_triggers); in hostapd_config_fill()
4600 bss->wowlan_triggers = os_strdup(pos); in hostapd_config_fill()
4665 os_free(bss->no_probe_resp_if_seen_on); in hostapd_config_fill()
4666 bss->no_probe_resp_if_seen_on = os_strdup(pos); in hostapd_config_fill()
4668 os_free(bss->no_auth_if_seen_on); in hostapd_config_fill()
4669 bss->no_auth_if_seen_on = os_strdup(pos); in hostapd_config_fill()
4686 bss->radio_measurements[0] |= in hostapd_config_fill()
4690 bss->radio_measurements[0] |= in hostapd_config_fill()
4696 bss->radio_measurements[0] |= in hostapd_config_fill()
4699 bss->gas_address3 = atoi(pos); in hostapd_config_fill()
4703 bss->ftm_responder = atoi(pos); in hostapd_config_fill()
4705 bss->ftm_initiator = atoi(pos); in hostapd_config_fill()
4708 if (hexstr2bin(pos, bss->fils_cache_id, FILS_CACHE_ID_LEN)) { in hostapd_config_fill()
4714 bss->fils_cache_id_set = 1; in hostapd_config_fill()
4716 if (parse_fils_realm(bss, pos) < 0) in hostapd_config_fill()
4719 bss->fils_dh_group = atoi(pos); in hostapd_config_fill()
4721 if (hostapd_parse_ip_addr(pos, &bss->dhcp_server)) { in hostapd_config_fill()
4728 bss->dhcp_rapid_commit_proxy = atoi(pos); in hostapd_config_fill()
4730 bss->fils_hlp_wait_time = atoi(pos); in hostapd_config_fill()
4732 bss->dhcp_server_port = atoi(pos); in hostapd_config_fill()
4734 bss->dhcp_relay_port = atoi(pos); in hostapd_config_fill()
4736 bss->fils_discovery_min_int = atoi(pos); in hostapd_config_fill()
4738 bss->fils_discovery_max_int = atoi(pos); in hostapd_config_fill()
4741 bss->multicast_to_unicast = atoi(pos); in hostapd_config_fill()
4743 bss->bridge_multicast_to_unicast = atoi(pos); in hostapd_config_fill()
4745 bss->broadcast_deauth = atoi(pos); in hostapd_config_fill()
4747 bss->notify_mgmt_frames = atoi(pos); in hostapd_config_fill()
4750 os_free(bss->dpp_name); in hostapd_config_fill()
4751 bss->dpp_name = os_strdup(pos); in hostapd_config_fill()
4753 os_free(bss->dpp_mud_url); in hostapd_config_fill()
4754 bss->dpp_mud_url = os_strdup(pos); in hostapd_config_fill()
4756 os_free(bss->dpp_extra_conf_req_name); in hostapd_config_fill()
4757 bss->dpp_extra_conf_req_name = os_strdup(pos); in hostapd_config_fill()
4759 os_free(bss->dpp_extra_conf_req_value); in hostapd_config_fill()
4760 bss->dpp_extra_conf_req_value = os_strdup(pos); in hostapd_config_fill()
4762 os_free(bss->dpp_connector); in hostapd_config_fill()
4763 bss->dpp_connector = os_strdup(pos); in hostapd_config_fill()
4765 if (parse_wpabuf_hex(line, buf, &bss->dpp_netaccesskey, pos)) in hostapd_config_fill()
4768 bss->dpp_netaccesskey_expiry = strtol(pos, NULL, 0); in hostapd_config_fill()
4770 if (parse_wpabuf_hex(line, buf, &bss->dpp_csign, pos)) in hostapd_config_fill()
4774 if (hostapd_dpp_controller_parse(bss, pos)) in hostapd_config_fill()
4777 bss->dpp_relay_port = atoi(pos); in hostapd_config_fill()
4779 bss->dpp_configurator_connectivity = atoi(pos); in hostapd_config_fill()
4789 bss->dpp_pfs = val; in hostapd_config_fill()
4794 if (hwaddr_aton(pos, bss->owe_transition_bssid)) { in hostapd_config_fill()
4810 os_memcpy(bss->owe_transition_ssid, str, slen); in hostapd_config_fill()
4811 bss->owe_transition_ssid_len = slen; in hostapd_config_fill()
4814 os_strlcpy(bss->owe_transition_ifname, pos, in hostapd_config_fill()
4815 sizeof(bss->owe_transition_ifname)); in hostapd_config_fill()
4817 if (hostapd_parse_intlist(&bss->owe_groups, pos)) { in hostapd_config_fill()
4824 bss->owe_ptk_workaround = atoi(pos); in hostapd_config_fill()
4827 bss->coloc_intf_reporting = atoi(pos); in hostapd_config_fill()
4837 bss->multi_ap = val; in hostapd_config_fill()
4847 bss->multi_ap_profile = val; in hostapd_config_fill()
4857 bss->multi_ap_client_disallow = val; in hostapd_config_fill()
4867 bss->multi_ap_vlanid = val; in hostapd_config_fill()
4875 bss->pbss = atoi(pos); in hostapd_config_fill()
4877 bss->transition_disable = strtol(pos, NULL, 16); in hostapd_config_fill()
4891 bss->airtime_weight = atoi(pos); in hostapd_config_fill()
4901 bss->airtime_limit = val; in hostapd_config_fill()
4903 if (add_airtime_weight(bss, pos) < 0) { in hostapd_config_fill()
4920 bss->macsec_policy = macsec_policy; in hostapd_config_fill()
4930 bss->macsec_integ_only = macsec_integ_only; in hostapd_config_fill()
4940 bss->macsec_replay_protect = macsec_replay_protect; in hostapd_config_fill()
4942 bss->macsec_replay_window = atoi(pos); in hostapd_config_fill()
4952 bss->macsec_offload = macsec_offload; in hostapd_config_fill()
4962 bss->macsec_port = macsec_port; in hostapd_config_fill()
4972 bss->mka_priority = mka_priority; in hostapd_config_fill()
4982 bss->macsec_csindex = macsec_csindex; in hostapd_config_fill()
4988 hexstr2bin(pos, bss->mka_cak, len / 2)) { in hostapd_config_fill()
4993 bss->mka_cak_len = len / 2; in hostapd_config_fill()
4994 bss->mka_psk_set |= MKA_PSK_SET_CAK; in hostapd_config_fill()
5005 bss->mka_ckn_len = len / 2; in hostapd_config_fill()
5006 if (hexstr2bin(pos, bss->mka_ckn, bss->mka_ckn_len)) { in hostapd_config_fill()
5011 bss->mka_psk_set |= MKA_PSK_SET_CKN; in hostapd_config_fill()
5014 bss->disable_11n = !!atoi(pos); in hostapd_config_fill()
5016 bss->disable_11ac = !!atoi(pos); in hostapd_config_fill()
5018 bss->disable_11ax = !!atoi(pos); in hostapd_config_fill()
5020 bss->disable_11be = !!atoi(pos); in hostapd_config_fill()
5024 bss->force_kdk_derivation = atoi(pos); in hostapd_config_fill()
5026 bss->pasn_corrupt_mic = atoi(pos); in hostapd_config_fill()
5029 if (hostapd_parse_intlist(&bss->pasn_groups, pos)) { in hostapd_config_fill()
5036 bss->pasn_comeback_after = atoi(pos); in hostapd_config_fill()
5038 bss->pasn_noauth = atoi(pos); in hostapd_config_fill()
5041 if (get_hex_config(bss->ext_capa_mask, EXT_CAPA_MAX_LEN, in hostapd_config_fill()
5045 if (get_hex_config(bss->ext_capa, EXT_CAPA_MAX_LEN, in hostapd_config_fill()
5049 bss->rnr = atoi(pos); in hostapd_config_fill()
5055 bss->ssid_protection = val; in hostapd_config_fill()
5085 bss->mld_ap = !!atoi(pos); in hostapd_config_fill()
5087 if (hwaddr_aton(pos, bss->mld_addr)) { in hostapd_config_fill()
5096 if (get_u16(pos, line, &bss->eht_oper_puncturing_override)) in hostapd_config_fill()
5099 bss->mld_indicate_disabled = atoi(pos); in hostapd_config_fill()
5149 conf->last_bss = conf->bss[0]; in hostapd_config_read()
5152 struct hostapd_bss_config *bss; in hostapd_config_read() local
5154 bss = conf->last_bss; in hostapd_config_read()
5179 errors += hostapd_config_fill(conf, bss, buf, pos, line); in hostapd_config_read()
5185 hostapd_set_security_params(conf->bss[i], 1); in hostapd_config_read()
5204 struct hostapd_bss_config *bss, const char *field, in hostapd_set_iface() argument
5210 errors = hostapd_config_fill(conf, bss, field, value, 0); in hostapd_set_iface()
5218 hostapd_set_security_params(conf->bss[i], 0); in hostapd_set_iface()