Lines Matching full:ssid
88 static int wpa_config_validate_network(struct wpa_ssid *ssid, int line)
92 if (ssid->passphrase) {
93 if (ssid->psk_set) {
98 wpa_config_update_psk(ssid);
101 if (wpa_key_mgmt_wpa_psk(ssid->key_mgmt) && !ssid->psk_set) {
107 if ((ssid->group_cipher & WPA_CIPHER_CCMP) &&
108 !(ssid->pairwise_cipher & WPA_CIPHER_CCMP) &&
109 !(ssid->pairwise_cipher & WPA_CIPHER_NONE)) {
114 ssid->group_cipher &= ~WPA_CIPHER_CCMP;
123 struct wpa_ssid *ssid;
129 ssid = os_zalloc(sizeof(*ssid));
130 if (ssid == NULL)
132 ssid->id = id;
134 wpa_config_set_network_defaults(ssid);
144 wpa_printf(MSG_ERROR, "Line %d: Invalid SSID line "
160 if (wpa_config_set(ssid, pos, pos2, *line) < 0)
170 errors += wpa_config_validate_network(ssid, *line);
173 wpa_config_free_ssid(ssid);
174 ssid = NULL;
177 return ssid;
269 struct wpa_ssid *ssid, *tail = NULL, *head = NULL;
285 ssid = wpa_config_read_network(f, &line, id++);
286 if (ssid == NULL) {
293 head = tail = ssid;
295 tail->next = ssid;
296 tail = ssid;
298 if (wpa_config_add_prio_network(config, ssid)) {
323 config->ssid = head;
340 static void write_str(FILE *f, const char *field, struct wpa_ssid *ssid)
342 char *value = wpa_config_get(ssid, field);
358 static void write_bssid(FILE *f, struct wpa_ssid *ssid)
360 char *value = wpa_config_get(ssid, "bssid");
368 static void write_psk(FILE *f, struct wpa_ssid *ssid)
370 char *value = wpa_config_get(ssid, "psk");
378 static void write_proto(FILE *f, struct wpa_ssid *ssid)
382 if (ssid->proto == DEFAULT_PROTO)
385 value = wpa_config_get(ssid, "proto");
394 static void write_key_mgmt(FILE *f, struct wpa_ssid *ssid)
398 if (ssid->key_mgmt == DEFAULT_KEY_MGMT)
401 value = wpa_config_get(ssid, "key_mgmt");
410 static void write_pairwise(FILE *f, struct wpa_ssid *ssid)
414 if (ssid->pairwise_cipher == DEFAULT_PAIRWISE)
417 value = wpa_config_get(ssid, "pairwise");
426 static void write_group(FILE *f, struct wpa_ssid *ssid)
430 if (ssid->group_cipher == DEFAULT_GROUP)
433 value = wpa_config_get(ssid, "group");
442 static void write_auth_alg(FILE *f, struct wpa_ssid *ssid)
446 if (ssid->auth_alg == 0)
449 value = wpa_config_get(ssid, "auth_alg");
459 static void write_eap(FILE *f, struct wpa_ssid *ssid)
463 value = wpa_config_get(ssid, "eap");
474 static void write_wep_key(FILE *f, int idx, struct wpa_ssid *ssid)
482 value = wpa_config_get(ssid, field);
491 static void write_p2p_client_list(FILE *f, struct wpa_ssid *ssid)
493 char *value = wpa_config_get(ssid, "p2p_client_list");
502 static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
506 #define STR(t) write_str(f, #t, ssid)
507 #define INT(t) write_int(f, #t, ssid->t, 0)
508 #define INTe(t) write_int(f, #t, ssid->eap.t, 0)
509 #define INT_DEF(t, def) write_int(f, #t, ssid->t, def)
510 #define INT_DEFe(t, def) write_int(f, #t, ssid->eap.t, def)
512 STR(ssid);
514 write_bssid(f, ssid);
515 write_psk(f, ssid);
516 write_proto(f, ssid);
517 write_key_mgmt(f, ssid);
518 write_pairwise(f, ssid);
519 write_group(f, ssid);
520 write_auth_alg(f, ssid);
522 write_eap(f, ssid);
560 write_wep_key(f, i, ssid);
577 write_p2p_client_list(f, ssid);
744 struct wpa_ssid *ssid;
760 for (ssid = config->ssid; ssid; ssid = ssid->next) {
761 if (ssid->key_mgmt == WPA_KEY_MGMT_WPS || ssid->temporary)
763 if (wpa_key_mgmt_wpa_psk(ssid->key_mgmt) && !ssid->psk_set &&
764 !ssid->passphrase)
767 wpa_config_write_network(f, ssid);