wpa_s AP mode: Add notification functions for STA authorized

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2011-03-16 15:58:41 +02:00 committed by Jouni Malinen
parent 5b49c9d5ed
commit d8a43924ec
3 changed files with 34 additions and 0 deletions

View 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(

View 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);
}

View 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,