]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_s AP mode: Add notification functions for STA authorized
authorJohannes Berg <johannes.berg@intel.com>
Wed, 16 Mar 2011 13:58:41 +0000 (15:58 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 16 Mar 2011 13:58:41 +0000 (15:58 +0200)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
wpa_supplicant/ap.c
wpa_supplicant/notify.c
wpa_supplicant/notify.h

index ec2de4ce616e541f8251fa26509e69af6523bdc6..77e5b78a3231735c07df5b5896ca6599f50e614c 100644 (file)
@@ -42,6 +42,7 @@
 #include "p2p_supplicant.h"
 #include "ap.h"
 #include "ap/sta_info.h"
+#include "notify.h"
 
 
 #ifdef CONFIG_WPS
@@ -243,6 +244,13 @@ static void ap_wps_event_cb(void *ctx, enum wps_event event,
 }
 
 
+static void ap_sta_authorized_cb(void *ctx, const u8 *mac_addr,
+                                int authorized)
+{
+       wpas_notify_sta_authorized(ctx, mac_addr, authorized);
+}
+
+
 static int ap_vendor_action_rx(void *ctx, const u8 *buf, size_t len, int freq)
 {
 #ifdef CONFIG_P2P
@@ -411,6 +419,8 @@ int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
                hapd_iface->bss[i]->wps_reg_success_cb_ctx = wpa_s;
                hapd_iface->bss[i]->wps_event_cb = ap_wps_event_cb;
                hapd_iface->bss[i]->wps_event_cb_ctx = wpa_s;
+               hapd_iface->bss[i]->sta_authorized_cb = ap_sta_authorized_cb;
+               hapd_iface->bss[i]->sta_authorized_cb_ctx = wpa_s;
 #ifdef CONFIG_P2P
                hapd_iface->bss[i]->p2p = wpa_s->global->p2p;
                hapd_iface->bss[i]->p2p_group = wpas_p2p_group_init(
index 9ee7dc20b0101aa38c05ebddeeb245989cc4a30b..2053c3d20a5d9d13f9d28358ddc6c5fcf8907583 100644 (file)
@@ -416,3 +416,25 @@ void wpas_notify_p2p_sd_response(struct wpa_supplicant *wpa_s,
 }
 
 #endif /* CONFIG_P2P */
+
+
+static void wpas_notify_ap_sta_authorized(struct wpa_supplicant *wpa_s,
+                                         const u8 *sta)
+{
+}
+
+
+static void wpas_notify_ap_sta_deauthorized(struct wpa_supplicant *wpa_s,
+                                           const u8 *sta)
+{
+}
+
+
+void wpas_notify_sta_authorized(struct wpa_supplicant *wpa_s,
+                               const u8 *mac_addr, int authorized)
+{
+       if (authorized)
+               wpas_notify_ap_sta_authorized(wpa_s, mac_addr);
+       else
+               wpas_notify_ap_sta_deauthorized(wpa_s, mac_addr);
+}
index 156774a62ae3d4f9200d35b9935d97e540f90872..6c8fdf7bfafcc04e0f404638703dd85f63169fb5 100644 (file)
@@ -79,6 +79,8 @@ void wpas_notify_debug_show_keys_changed(struct wpa_global *global);
 void wpas_notify_suspend(struct wpa_global *global);
 void wpas_notify_resume(struct wpa_global *global);
 
+void wpas_notify_sta_authorized(struct wpa_supplicant *wpa_s,
+                               const u8 *mac_addr, int authorized);
 void wpas_notify_p2p_device_found(struct wpa_supplicant *wpa_s,
                                  const u8 *dev_addr, int new_device);
 void wpas_notify_p2p_device_lost(struct wpa_supplicant *wpa_s,