diff options
author | Jouni Malinen <j@w1.fi> | 2009-11-07 12:41:01 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2009-11-07 12:41:01 +0200 |
commit | e9bcfebfce3c8a12ebdeddb05f86fc2a97fadae2 (patch) | |
tree | c3529aca898cf8db1c80ab41746ba15cb08d1141 /wpa_supplicant/wps_supplicant.c | |
parent | 08eb154db52f167b7c331ea565f4fd8bb21ccbb0 (diff) | |
download | external_wpa_supplicant_8_ti-e9bcfebfce3c8a12ebdeddb05f86fc2a97fadae2.zip external_wpa_supplicant_8_ti-e9bcfebfce3c8a12ebdeddb05f86fc2a97fadae2.tar.gz external_wpa_supplicant_8_ti-e9bcfebfce3c8a12ebdeddb05f86fc2a97fadae2.tar.bz2 |
WPS: Add initial part of External Registrar functionality
This is the first step in adding support for using wpa_supplicant as a
WPS External Registrar to manage APs over UPnP. Only the device
discovery part is implemented in this commit.
Diffstat (limited to 'wpa_supplicant/wps_supplicant.c')
-rw-r--r-- | wpa_supplicant/wps_supplicant.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c index 95f3b88..5fd94e2 100644 --- a/wpa_supplicant/wps_supplicant.c +++ b/wpa_supplicant/wps_supplicant.c @@ -814,6 +814,9 @@ void wpas_wps_deinit(struct wpa_supplicant *wpa_s) os_free(wpa_s->wps->network_key); os_free(wpa_s->wps); wpa_s->wps = NULL; + + wps_er_deinit(wpa_s->wps_er); + wpa_s->wps_er = NULL; } @@ -1021,3 +1024,30 @@ int wpas_wps_scan_result_text(const u8 *ies, size_t ies_len, char *buf, wpabuf_free(wps_ie); return ret; } + + +int wpas_wps_er_start(struct wpa_supplicant *wpa_s) +{ +#ifdef CONFIG_WPS_ER + if (wpa_s->wps_er) { + /* TODO: re-send ctrl_iface events for current data? */ + return 0; + } + wpa_s->wps_er = wps_er_init(wpa_s->wps, wpa_s->ifname); + if (wpa_s->wps_er == NULL) + return -1; + return 0; +#else /* CONFIG_WPS_ER */ + return 0; +#endif /* CONFIG_WPS_ER */ +} + + +int wpas_wps_er_stop(struct wpa_supplicant *wpa_s) +{ +#ifdef CONFIG_WPS_ER + wps_er_deinit(wpa_s->wps_er); + wpa_s->wps_er = NULL; +#endif /* CONFIG_WPS_ER */ + return 0; +} |