Lines Matching refs:wpa_s
47 static void _wpa_supplicant_disassociate(void *wpa_s, int reason_code)
49 wpa_supplicant_disassociate(wpa_s, reason_code);
53 static void _wpa_supplicant_deauthenticate(void *wpa_s, int reason_code)
55 wpa_supplicant_deauthenticate(wpa_s, reason_code);
59 static u8 * wpa_alloc_eapol(const struct wpa_supplicant *wpa_s, u8 type,
70 hdr->version = wpa_s->conf->eapol_version;
86 static u8 * _wpa_alloc_eapol(void *wpa_s, u8 type,
90 return wpa_alloc_eapol(wpa_s, type, data, data_len, msg_len, data_pos);
96 struct wpa_supplicant *wpa_s = ctx;
97 wpa_s->wpa_state = state;
103 struct wpa_supplicant *wpa_s = ctx;
104 return wpa_s->wpa_state;
108 static int wpa_ether_send(void *wpa_s, const u8 *dest, u16 proto,
116 static struct wpa_ssid * _wpa_supplicant_get_ssid(void *wpa_s)
118 return wpa_supplicant_get_ssid(wpa_s);
122 static void _wpa_supplicant_cancel_auth_timeout(void *wpa_s)
124 wpa_supplicant_cancel_auth_timeout(wpa_s);
128 static int wpa_supplicant_get_beacon_ie(void *wpa_s)
141 static int wpa_supplicant_get_bssid(void *wpa_s, u8 *bssid)
148 static int wpa_supplicant_set_key(void *wpa_s, wpa_alg alg,
158 static int wpa_supplicant_mlme_setprotection(void *wpa_s, const u8 *addr,
167 static int wpa_supplicant_add_pmkid(void *wpa_s,
175 static int wpa_supplicant_remove_pmkid(void *wpa_s,
186 struct wpa_supplicant *wpa_s = ctx;
187 wpa_config_set_blob(wpa_s->conf, blob);
194 struct wpa_supplicant *wpa_s = ctx;
195 return wpa_config_get_blob(wpa_s->conf, name);
199 static void test_eapol_clean(struct wpa_supplicant *wpa_s)
201 rsn_preauth_deinit(wpa_s->wpa);
202 pmksa_candidate_free(wpa_s->wpa);
203 wpa_sm_deinit(wpa_s->wpa);
204 scard_deinit(wpa_s->scard);
205 if (wpa_s->ctrl_iface) {
206 wpa_supplicant_ctrl_iface_deinit(wpa_s->ctrl_iface);
207 wpa_s->ctrl_iface = NULL;
209 wpa_config_free(wpa_s->conf);
224 struct wpa_supplicant *wpa_s = eloop_ctx;
225 if (!rsn_preauth_in_progress(wpa_s->wpa))
237 static void wpa_init_conf(struct wpa_supplicant *wpa_s, const char *ifname)
243 wpa_s->driver = &dummy_driver;
248 ctx->ctx = wpa_s;
267 wpa_s->wpa = wpa_sm_init(ctx);
268 assert(wpa_s->wpa != NULL);
269 wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_PROTO, WPA_PROTO_RSN);
271 os_strncpy(wpa_s->ifname, ifname, sizeof(wpa_s->ifname));
272 wpa_sm_set_ifname(wpa_s->wpa, wpa_s->ifname, NULL);
274 l2 = l2_packet_init(wpa_s->ifname, NULL, ETH_P_RSN_PREAUTH, NULL,
277 if (l2_packet_get_own_addr(l2, wpa_s->own_addr)) {
282 wpa_sm_set_own_addr(wpa_s->wpa, wpa_s->own_addr);
289 struct wpa_supplicant *wpa_s = eloop_ctx;
290 wpa_msg(wpa_s, MSG_INFO, "Signal %d received - terminating", sig);
297 struct wpa_supplicant wpa_s;
326 if (eloop_init(&wpa_s)) {
331 os_memset(&wpa_s, 0, sizeof(wpa_s));
332 wpa_s.conf = wpa_config_read(argv[1]);
333 if (wpa_s.conf == NULL) {
337 if (wpa_s.conf->ssid == NULL) {
342 wpa_init_conf(&wpa_s, argv[3]);
343 wpa_s.ctrl_iface = wpa_supplicant_ctrl_iface_init(&wpa_s);
344 if (wpa_s.ctrl_iface == NULL) {
352 wpa_s.conf->ctrl_interface);
355 if (wpa_supplicant_scard_init(&wpa_s, wpa_s.conf->ssid))
358 if (rsn_preauth_init(wpa_s.wpa, bssid, wpa_s.conf->ssid))
362 eloop_register_timeout(0, 100000, eapol_test_poll, &wpa_s, NULL);
370 ret = pmksa_cache_set_current(wpa_s.wpa, NULL, bssid, NULL, 0)
374 test_eapol_clean(&wpa_s);