Home | History | Annotate | Download | only in wpa_supplicant

Lines Matching refs:ssid

126 static int wpa_config_validate_network(struct wpa_ssid *ssid, int line)
130 if (ssid->passphrase) {
131 if (ssid->psk_set) {
136 wpa_config_update_psk(ssid);
139 if ((ssid->group_cipher & WPA_CIPHER_CCMP) &&
140 !(ssid->pairwise_cipher & WPA_CIPHER_CCMP) &&
141 !(ssid->pairwise_cipher & WPA_CIPHER_NONE)) {
146 ssid->group_cipher &= ~WPA_CIPHER_CCMP;
149 if (ssid->mode == WPAS_MODE_MESH &&
150 (ssid->key_mgmt != WPA_KEY_MGMT_NONE &&
151 ssid->key_mgmt != WPA_KEY_MGMT_SAE)) {
164 struct wpa_ssid *ssid;
170 ssid = os_zalloc(sizeof(*ssid));
171 if (ssid == NULL)
173 dl_list_init(&ssid->psk_list);
174 ssid->id = id;
176 wpa_config_set_network_defaults(ssid);
186 wpa_printf(MSG_ERROR, "Line %d: Invalid SSID line "
202 if (wpa_config_set(ssid, pos, pos2, *line) < 0)
212 errors += wpa_config_validate_network(ssid, *line);
215 wpa_config_free_ssid(ssid);
216 ssid = NULL;
219 return ssid;
367 struct wpa_ssid *ssid, *tail, *head;
384 tail = head = config->ssid;
402 ssid = wpa_config_read_network(f, &line, id++);
403 if (ssid == NULL) {
410 head = tail = ssid;
412 tail->next = ssid;
413 tail = ssid;
415 if (wpa_config_add_prio_network(config, ssid)) {
456 config->ssid = head;
474 static void write_str(FILE *f, const char *field, struct wpa_ssid *ssid)
476 char *value = wpa_config_get(ssid, field);
492 static void write_bssid(FILE *f, struct wpa_ssid *ssid)
494 char *value = wpa_config_get(ssid, "bssid");
502 static void write_psk(FILE *f, struct wpa_ssid *ssid)
506 if (ssid->mem_only_psk)
509 value = wpa_config_get(ssid, "psk");
517 static void write_proto(FILE *f, struct wpa_ssid *ssid)
521 if (ssid->proto == DEFAULT_PROTO)
524 value = wpa_config_get(ssid, "proto");
533 static void write_key_mgmt(FILE *f, struct wpa_ssid *ssid)
537 if (ssid->key_mgmt == DEFAULT_KEY_MGMT)
540 value = wpa_config_get(ssid, "key_mgmt");
549 static void write_pairwise(FILE *f, struct wpa_ssid *ssid)
553 if (ssid->pairwise_cipher == DEFAULT_PAIRWISE)
556 value = wpa_config_get(ssid, "pairwise");
565 static void write_group(FILE *f, struct wpa_ssid *ssid)
569 if (ssid->group_cipher == DEFAULT_GROUP)
572 value = wpa_config_get(ssid, "group");
581 static void write_auth_alg(FILE *f, struct wpa_ssid *ssid)
585 if (ssid->auth_alg == 0)
588 value = wpa_config_get(ssid, "auth_alg");
598 static void write_eap(FILE *f, struct wpa_ssid *ssid)
602 value = wpa_config_get(ssid, "eap");
613 static void write_wep_key(FILE *f, int idx, struct wpa_ssid *ssid)
621 value = wpa_config_get(ssid, field);
631 static void write_go_p2p_dev_addr(FILE *f, struct wpa_ssid *ssid)
633 char *value = wpa_config_get(ssid, "go_p2p_dev_addr");
640 static void write_p2p_client_list(FILE *f, struct wpa_ssid *ssid)
642 char *value = wpa_config_get(ssid, "p2p_client_list");
650 static void write_psk_list(FILE *f, struct wpa_ssid *ssid)
655 dl_list_for_each(psk, &ssid->psk_list, struct psk_list_entry, list) {
665 static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
669 #define STR(t) write_str(f, #t, ssid)
670 #define INT(t) write_int(f, #t, ssid->t, 0)
671 #define INTe(t) write_int(f, #t, ssid->eap.t, 0)
672 #define INT_DEF(t, def) write_int(f, #t, ssid->t, def)
673 #define INT_DEFe(t, def) write_int(f, #t, ssid->eap.t, def)
675 STR(ssid);
677 write_bssid(f, ssid);
678 write_str(f, "bssid_blacklist", ssid);
679 write_str(f, "bssid_whitelist", ssid);
680 write_psk(f, ssid);
682 write_proto(f, ssid);
683 write_key_mgmt(f, ssid);
685 write_pairwise(f, ssid);
686 write_group(f, ssid);
687 write_auth_alg(f, ssid);
692 write_eap(f, ssid);
736 write_wep_key(f, i, ssid);
750 write_int(f, "proactive_key_caching", ssid->proactive_key_caching, -1);
755 write_int(f, "ieee80211w", ssid->ieee80211w,
760 write_go_p2p_dev_addr(f, ssid);
761 write_p2p_client_list(f, ssid);
762 write_psk_list(f, ssid);
773 write_int(f, "mac_addr", ssid->mac_addr, -1);
879 fprintf(f, "%02x", e->ssid[j]);
1303 struct wpa_ssid *ssid;
1337 for (ssid = config->ssid; ssid; ssid = ssid->next) {
1338 if (ssid->key_mgmt == WPA_KEY_MGMT_WPS || ssid->temporary)
1340 if (wpa_key_mgmt_wpa_psk(ssid->key_mgmt) && !ssid->psk_set &&
1341 !ssid->passphrase)
1344 wpa_config_write_network(f, ssid);