[PATCH v2] Implement wps-pin-active and wps-cancel events

Bilal Hatipoglu bilal.hatipoglu at airties.com
Mon Sep 30 05:01:58 PDT 2019


Hello,

Can anyone help reviewing and merging this change?

Regards.






Bilal Hatipoglu

Principal Software Architect

AirTies Wireless Networks















From: Hostap <hostap-bounces at lists.infradead.org> on behalf of bilalhp at gmail.com <bilalhp at gmail.com>

Sent: Thursday, September 5, 2019 12:33 PM

To: hostap at lists.infradead.org <hostap at lists.infradead.org>

Subject: [PATCH v2] Implement wps-pin-active and wps-cancel events

 


From: Bilal Hatipoglu <bilal.hatipoglu at airties.com>



WPS_EVENT_CANCEL is added to indicate cancellation of WPS operation for any reason

in hostapd/wpa_supplicant.



WPS_EVENT_PIN_ACTIVE is added to indicate when a PIN operation is triggered

in supplicant.



Signed-off-by: Veli Demirel <veli.demirel at airties.com>

Signed-off-by: Bilal Hatipoglu <bilal.hatipoglu at airties.com>

---

 src/ap/wps_hostapd.c            | 1 +

 src/common/wpa_ctrl.h           | 2 ++

 wpa_supplicant/wps_supplicant.c | 4 ++++

 3 files changed, 7 insertions(+)



diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c

index 6161cdb..2f1af11 100644

--- a/src/ap/wps_hostapd.c

+++ b/src/ap/wps_hostapd.c

@@ -1425,6 +1425,7 @@ static int wps_cancel(struct hostapd_data *hapd, void *ctx)

                 data->count++;

                 wps_registrar_wps_cancel(hapd->wps->registrar);

                 ap_for_each_sta(hapd, ap_sta_wps_cancel, NULL);

+               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_CANCEL);

         }

 

         return 0;

diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h

index b24ae63..3a3e69b 100644

--- a/src/common/wpa_ctrl.h

+++ b/src/common/wpa_ctrl.h

@@ -299,6 +299,8 @@ extern "C" {

 #define WPS_EVENT_AP_SETUP_UNLOCKED "WPS-AP-SETUP-UNLOCKED "

 #define WPS_EVENT_AP_PIN_ENABLED "WPS-AP-PIN-ENABLED "

 #define WPS_EVENT_AP_PIN_DISABLED "WPS-AP-PIN-DISABLED "

+#define WPS_EVENT_PIN_ACTIVE "WPS-PIN-ACTIVE "

+#define WPS_EVENT_CANCEL "WPS-CANCEL "

 #define AP_STA_CONNECTED "AP-STA-CONNECTED "

 #define AP_STA_DISCONNECTED "AP-STA-DISCONNECTED "

 #define AP_STA_POSSIBLE_PSK_MISMATCH "AP-STA-POSSIBLE-PSK-MISMATCH "

diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c

index 0579274..f953218 100644

--- a/wpa_supplicant/wps_supplicant.c

+++ b/wpa_supplicant/wps_supplicant.c

@@ -1286,6 +1286,9 @@ static int wpas_wps_start_dev_pw(struct wpa_supplicant *wpa_s,

                 wpa_printf(MSG_DEBUG, "WPS: Failed to set phase1 '%s'", val);

                 return -1;

         }

+

+       wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_PIN_ACTIVE);

+

         if (wpa_s->wps_fragment_size)

                 ssid->eap.fragment_size = wpa_s->wps_fragment_size;

         eloop_register_timeout(WPS_PBC_WALK_TIME, 0, wpas_wps_timeout,

@@ -1351,6 +1354,7 @@ int wpas_wps_cancel(struct wpa_supplicant *wpa_s)

                         wpas_clear_wps(wpa_s);

         }

 

+       wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_CANCEL);

         wpa_s->after_wps = 0;

 

         return 0;

-- 

2.7.4





_______________________________________________

Hostap mailing list

Hostap at lists.infradead.org

http://lists.infradead.org/mailman/listinfo/hostap



This message has been scanned for malware by Websense. www.websense.com



More information about the Hostap mailing list