From: Jouni Malinen Date: Fri, 20 Nov 2009 19:57:30 +0000 (+0200) Subject: WPS ER: Refresh ER data on WPS_ER_START when already started X-Git-Tag: hostap_0_7_0~23 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=libeap.git;a=commitdiff_plain;h=b3f371cabf178935542583495ef3f51678bcf3bd WPS ER: Refresh ER data on WPS_ER_START when already started This sends out the AP and Enrollee notifications for all tracked devices and generates a new SSDP search to find more APs. --- diff --git a/src/wps/wps.h b/src/wps/wps.h index a85d600..5f1b729 100644 --- a/src/wps/wps.h +++ b/src/wps/wps.h @@ -673,6 +673,7 @@ int wps_process_oob(struct wps_context *wps, struct oob_device_data *oob_dev, int wps_attr_text(struct wpabuf *data, char *buf, char *end); struct wps_er * wps_er_init(struct wps_context *wps, const char *ifname); +void wps_er_refresh(struct wps_er *er); void wps_er_deinit(struct wps_er *er); void wps_er_set_sel_reg(struct wps_er *er, int sel_reg, u16 dev_passwd_id, u16 sel_reg_config_methods); diff --git a/src/wps/wps_er.c b/src/wps/wps_er.c index 4a6e6f7..f2fa9c5 100644 --- a/src/wps/wps_er.c +++ b/src/wps/wps_er.c @@ -1235,6 +1235,21 @@ wps_er_init(struct wps_context *wps, const char *ifname) } +void wps_er_refresh(struct wps_er *er) +{ + struct wps_er_ap *ap; + struct wps_er_sta *sta; + + for (ap = er->ap; ap; ap = ap->next) { + wps_er_ap_event(er->wps, ap, WPS_EV_ER_AP_ADD); + for (sta = ap->sta; sta; sta = sta->next) + wps_er_sta_event(er->wps, sta, WPS_EV_ER_ENROLLEE_ADD); + } + + wps_er_send_ssdp_msearch(er); +} + + void wps_er_deinit(struct wps_er *er) { if (er == NULL) diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c index 5f1a3c6..28b961c 100644 --- a/wpa_supplicant/wps_supplicant.c +++ b/wpa_supplicant/wps_supplicant.c @@ -1124,7 +1124,7 @@ 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? */ + wps_er_refresh(wpa_s->wps_er); return 0; } wpa_s->wps_er = wps_er_init(wpa_s->wps, wpa_s->ifname);