aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-12-28 14:24:04 (GMT)
committerJouni Malinen <j@w1.fi>2009-12-28 14:24:04 (GMT)
commitc2f5126941403ab0bb23ed61566fc35e142222aa (patch)
treef9fae4231dbf4563fc611454c5aaca45b4fa32d4 /src/ap
parentf7e54365022cd30de16e32d4a88e085861243881 (diff)
downloadhostap-c2f5126941403ab0bb23ed61566fc35e142222aa.zip
hostap-c2f5126941403ab0bb23ed61566fc35e142222aa.tar.gz
hostap-c2f5126941403ab0bb23ed61566fc35e142222aa.tar.bz2
WPS: Add Enrollee-seen event message and wpa_gui-qt4 Peers entry
This can be used to show active Enrollees in AP mode to make it easier to provision a new device.
Diffstat (limited to 'src/ap')
-rw-r--r--src/ap/wps_hostapd.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c
index 235071b..d5145f0 100644
--- a/src/ap/wps_hostapd.c
+++ b/src/ap/wps_hostapd.c
@@ -154,6 +154,29 @@ static void hostapd_wps_reg_success_cb(void *ctx, const u8 *mac_addr,
}
+static void hostapd_wps_enrollee_seen_cb(void *ctx, const u8 *addr,
+ const u8 *uuid_e,
+ const u8 *pri_dev_type,
+ u16 config_methods,
+ u16 dev_password_id, u8 request_type,
+ const char *dev_name)
+{
+ struct hostapd_data *hapd = ctx;
+ char uuid[40];
+ char devtype[WPS_DEV_TYPE_BUFSIZE];
+ if (uuid_bin2str(uuid_e, uuid, sizeof(uuid)))
+ return;
+ if (dev_name == NULL)
+ dev_name = "";
+ wpa_msg_ctrl(hapd->msg_ctx, MSG_INFO, WPS_EVENT_ENROLLEE_SEEN MACSTR
+ " %s %s 0x%x %u %u [%s]",
+ MAC2STR(addr), uuid,
+ wps_dev_type_bin2str(pri_dev_type, devtype,
+ sizeof(devtype)),
+ config_methods, dev_password_id, request_type, dev_name);
+}
+
+
static int str_starts(const char *str, const char *start)
{
return os_strncmp(str, start, os_strlen(start)) == 0;
@@ -596,6 +619,7 @@ int hostapd_init_wps(struct hostapd_data *hapd,
cfg.set_ie_cb = hostapd_wps_set_ie_cb;
cfg.pin_needed_cb = hostapd_wps_pin_needed_cb;
cfg.reg_success_cb = hostapd_wps_reg_success_cb;
+ cfg.enrollee_seen_cb = hostapd_wps_enrollee_seen_cb;
cfg.cb_ctx = hapd;
cfg.skip_cred_build = conf->skip_cred_build;
cfg.extra_cred = conf->extra_cred;