Lines Matching refs:wpa_s
41 static void _wpa_supplicant_disassociate(void *wpa_s, int reason_code)
43 wpa_supplicant_disassociate(wpa_s, reason_code);
47 static void _wpa_supplicant_deauthenticate(void *wpa_s, int reason_code)
49 wpa_supplicant_deauthenticate(wpa_s, reason_code);
53 static u8 * wpa_alloc_eapol(const struct wpa_supplicant *wpa_s, u8 type,
64 hdr->version = wpa_s->conf->eapol_version;
80 static u8 * _wpa_alloc_eapol(void *wpa_s, u8 type,
84 return wpa_alloc_eapol(wpa_s, type, data, data_len, msg_len, data_pos);
90 struct wpa_supplicant *wpa_s = ctx;
91 wpa_s->wpa_state = state;
97 struct wpa_supplicant *wpa_s = ctx;
98 return wpa_s->wpa_state;
102 static int wpa_ether_send(void *wpa_s, const u8 *dest, u16 proto,
110 static void * wpa_supplicant_get_network_ctx(void *wpa_s)
112 return wpa_supplicant_get_ssid(wpa_s);
116 static void _wpa_supplicant_cancel_auth_timeout(void *wpa_s)
118 wpa_supplicant_cancel_auth_timeout(wpa_s);
122 static int wpa_supplicant_get_beacon_ie(void *wpa_s)
129 static int wpa_supplicant_get_bssid(void *wpa_s, u8 *bssid)
136 static int wpa_supplicant_set_key(void *wpa_s, enum wpa_alg alg,
146 static int wpa_supplicant_mlme_setprotection(void *wpa_s, const u8 *addr,
155 static int wpa_supplicant_add_pmkid(void *wpa_s,
163 static int wpa_supplicant_remove_pmkid(void *wpa_s,
174 struct wpa_supplicant *wpa_s = ctx;
175 wpa_config_set_blob(wpa_s->conf, blob);
182 struct wpa_supplicant *wpa_s = ctx;
183 return wpa_config_get_blob(wpa_s->conf, name);
187 static void test_eapol_clean(struct wpa_supplicant *wpa_s)
189 rsn_preauth_deinit(wpa_s->wpa);
190 pmksa_candidate_free(wpa_s->wpa);
191 wpa_sm_deinit(wpa_s->wpa);
192 scard_deinit(wpa_s->scard);
193 if (wpa_s->ctrl_iface) {
194 wpa_supplicant_ctrl_iface_deinit(wpa_s->ctrl_iface);
195 wpa_s->ctrl_iface = NULL;
197 wpa_config_free(wpa_s->conf);
212 struct wpa_supplicant *wpa_s = eloop_ctx;
213 if (!rsn_preauth_in_progress(wpa_s->wpa))
225 static void wpa_init_conf(struct wpa_supplicant *wpa_s, const char *ifname)
231 wpa_s->driver = &dummy_driver;
236 ctx->ctx = wpa_s;
237 ctx->msg_ctx = wpa_s;
255 wpa_s->wpa = wpa_sm_init(ctx);
256 assert(wpa_s->wpa != NULL);
257 wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_PROTO, WPA_PROTO_RSN);
259 os_strlcpy(wpa_s->ifname, ifname, sizeof(wpa_s->ifname));
260 wpa_sm_set_ifname(wpa_s->wpa, wpa_s->ifname, NULL);
262 l2 = l2_packet_init(wpa_s->ifname, NULL, ETH_P_RSN_PREAUTH, NULL,
265 if (l2_packet_get_own_addr(l2, wpa_s->own_addr)) {
270 wpa_sm_set_own_addr(wpa_s->wpa, wpa_s->own_addr);
276 struct wpa_supplicant *wpa_s = signal_ctx;
277 wpa_msg(wpa_s, MSG_INFO, "Signal %d received - terminating", sig);
284 struct wpa_supplicant wpa_s;
318 os_memset(&wpa_s, 0, sizeof(wpa_s));
319 wpa_s.conf = wpa_config_read(argv[1]);
320 if (wpa_s.conf == NULL) {
324 if (wpa_s.conf->ssid == NULL) {
329 wpa_init_conf(&wpa_s, argv[3]);
330 wpa_s.ctrl_iface = wpa_supplicant_ctrl_iface_init(&wpa_s);
331 if (wpa_s.ctrl_iface == NULL) {
339 wpa_s.conf->ctrl_interface);
342 if (wpa_supplicant_scard_init(&wpa_s, wpa_s.conf->ssid))
345 if (rsn_preauth_init(wpa_s.wpa, bssid, &wpa_s.conf->ssid->eap))
349 eloop_register_timeout(0, 100000, eapol_test_poll, &wpa_s, NULL);
350 eloop_register_signal_terminate(eapol_test_terminate, &wpa_s);
351 eloop_register_signal_reconfig(eapol_test_terminate, &wpa_s);
357 ret = pmksa_cache_set_current(wpa_s.wpa, NULL, bssid, NULL, 0)
361 test_eapol_clean(&wpa_s);