Lines Matching refs:kw

64 typedef struct kw {
91 kw_t *kw;
95 kw = (kw_t *)kw_list.q_forw;
98 while (kw->kw_bssids.q_forw != &kw->kw_bssids) {
99 b = (bssid_t *)kw->kw_bssids.q_forw;
104 remque(&kw->kw_links);
105 free(kw);
113 kw_t *kw;
118 for (kw = (kw_t *)kw_list.q_forw;
119 kw != (kw_t *)&kw_list;
120 kw = (kw_t *)kw->kw_links.q_forw) {
121 if (strcmp(essid, kw->kw_essid) == 0)
122 return (kw);
131 kw_t *kw;
138 if ((kw = calloc(1, sizeof (kw_t))) == NULL) {
143 kw->kw_bssids.q_forw = kw->kw_bssids.q_back = &kw->kw_bssids;
146 (void) strlcpy(kw->kw_essid, essid, sizeof (kw->kw_essid));
147 kw->kw_num_bssids = 1;
149 insque(&b->bssid_links, kw->kw_bssids.q_back);
150 insque(&kw->kw_links, kw_list.q_back);
157 * Add the BSSID to the given kw. Since /etc/nwam/known_wifi_nets is
159 * of the file, remove the give kw from its current position and append it
164 kw_update(kw_t *kw, const char *bssid)
174 insque(&b->bssid_links, kw->kw_bssids.q_back);
175 kw->kw_num_bssids++;
177 /* remove kw from current position */
178 remque(&kw->kw_links);
180 insque(&kw->kw_links, kw_list.q_back);
183 bssid, kw->kw_essid);
199 kw_t *kw;
224 if ((kw = kw_lookup(tok[ESSID])) == NULL) {
234 if (!kw_update(kw, tok[BSSID])) {
300 kw_t *kw;
315 for (kw = (kw_t *)kw_list.q_forw, priority = num_kw-1;
316 kw != (kw_t *)&kw_list;
317 kw = (kw_t *)kw->kw_links.q_forw, priority--) {
323 nlog(LOG_DEBUG, "Creating Known WLAN %s", kw->kw_essid);
325 if ((err = nwam_known_wlan_create(kw->kw_essid, &kwh))
328 "could not create known wlan: %s", kw->kw_essid,
337 "could not create priority value: %s", kw->kw_essid,
347 "could not set priority value: %s", kw->kw_essid,
353 /* loop through kw->kw_bssids and create an array of bssids */
354 bssids = calloc(kw->kw_num_bssids, sizeof (char *));
358 "could not calloc for bssids: %m", kw->kw_essid);
361 for (b = (bssid_t *)kw->kw_bssids.q_forw, i = 0;
362 b != (bssid_t *)&kw->kw_bssids;
369 kw->kw_num_bssids, &bssidsval)) != NWAM_SUCCESS) {
371 "could not create bssids value: %s", kw->kw_essid,
373 for (i = 0; i < kw->kw_num_bssids; i++)
382 for (i = 0; i < kw->kw_num_bssids; i++)
387 "could not set bssids: %s", kw->kw_essid,
397 nwamd_set_key_name(kw->kw_essid, NULL, nsa.nsa_essid_prefix,
420 kw->kw_essid, nwam_strerror(err));
432 "could not commit wlan: %s", kw->kw_essid,