aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-01-14 04:12:03 (GMT)
committerJouni Malinen <j@w1.fi>2008-01-14 04:12:03 (GMT)
commitffd98ab164d67b5b0fe35ddb37e19d6058ba0f46 (patch)
treee662851a93397e7b2d8d86e8e1f69f6eceef0833 /hostapd
parentb13bd4791cdf3f6155faebe40f6e9985013577d1 (diff)
downloadhostap-history-ffd98ab164d67b5b0fe35ddb37e19d6058ba0f46.zip
hostap-history-ffd98ab164d67b5b0fe35ddb37e19d6058ba0f46.tar.gz
hostap-history-ffd98ab164d67b5b0fe35ddb37e19d6058ba0f46.tar.bz2
WPS: Added callbacks to notify hostapd about new AP Settings
hostapd_wps_cred_cb() in wps_hostapd.c is now called when a Registrar has configured the AP. This function is currently only showing the new configuration in debug output and sending a notification to ctrl_iface monitors, i.e., the configuration is not yet taken into use or stored.
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/wps_hostapd.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/hostapd/wps_hostapd.c b/hostapd/wps_hostapd.c
index 1b3028a..2a21be2 100644
--- a/hostapd/wps_hostapd.c
+++ b/hostapd/wps_hostapd.c
@@ -152,6 +152,30 @@ static void hostapd_wps_pin_needed_cb(void *ctx, const u8 *uuid_e,
}
+static int hostapd_wps_cred_cb(void *ctx, const struct wps_credential *cred)
+{
+ struct hostapd_data *hapd = ctx;
+
+ wpa_printf(MSG_DEBUG, "WPS: Received new AP Settings");
+ wpa_hexdump_ascii(MSG_DEBUG, "WPS: SSID", cred->ssid, cred->ssid_len);
+ wpa_printf(MSG_DEBUG, "WPS: Authentication Type 0x%x",
+ cred->auth_type);
+ wpa_printf(MSG_DEBUG, "WPS: Encryption Type 0x%x", cred->encr_type);
+ wpa_printf(MSG_DEBUG, "WPS: Network Key Index %d", cred->key_idx);
+ wpa_hexdump_key(MSG_DEBUG, "WPS: Network Key",
+ cred->key, cred->key_len);
+ wpa_printf(MSG_DEBUG, "WPS: MAC Address " MACSTR,
+ MAC2STR(cred->mac_addr));
+
+ hostapd_ctrl_iface_send(hapd, MSG_INFO, WPS_EVENT_NEW_AP_SETTINGS,
+ os_strlen(WPS_EVENT_NEW_AP_SETTINGS));
+
+ /* TODO: take new settings into use and write them to file */
+
+ return 0;
+}
+
+
static void hostapd_wps_clear_ies(struct hostapd_data *hapd)
{
os_free(hapd->wps_beacon_ie);
@@ -181,6 +205,9 @@ int hostapd_init_wps(struct hostapd_data *hapd,
if (wps == NULL)
return -1;
+ wps->cred_cb = hostapd_wps_cred_cb;
+ wps->cb_ctx = hapd;
+
os_memset(&cfg, 0, sizeof(cfg));
wps->wps_state = hapd->conf->wps_state;
wps->ap_setup_locked = hapd->conf->ap_setup_locked;