aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-02-02 14:56:59 (GMT)
committerJouni Malinen <j@w1.fi>2011-02-02 14:56:59 (GMT)
commit0661eed204553d869ddbd3bed050385797d6fa2a (patch)
tree7a07bebdcdc7f4eca250f514d5882f6898c1c5c3 /src
parent6905dcb1e07a0115c2054ed74dff072956c8f5e7 (diff)
downloadhostap-0661eed204553d869ddbd3bed050385797d6fa2a.zip
hostap-0661eed204553d869ddbd3bed050385797d6fa2a.tar.gz
hostap-0661eed204553d869ddbd3bed050385797d6fa2a.tar.bz2
AP: Add callback for STA authorized transitions
Add a callback for station's authorized transitions to allow wpa_supplicant to emit events in DBus. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/ap/hostapd.h4
-rw-r--r--src/ap/sta_info.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index 0346408..8d2dc20 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -141,6 +141,10 @@ struct hostapd_data {
union wps_event_data *data);
void *wps_event_cb_ctx;
+ void (*sta_authorized_cb)(void *ctx, const u8 *mac_addr,
+ int authorized);
+ void *sta_authorized_cb_ctx;
+
#ifdef CONFIG_P2P
struct p2p_data *p2p;
struct p2p_group *p2p_group;
diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
index 7dee9ca..3818d06 100644
--- a/src/ap/sta_info.c
+++ b/src/ap/sta_info.c
@@ -763,6 +763,10 @@ void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
sta->flags |= WLAN_STA_AUTHORIZED;
else
sta->flags &= ~WLAN_STA_AUTHORIZED;
+
+ if (hapd->sta_authorized_cb)
+ hapd->sta_authorized_cb(hapd->sta_authorized_cb_ctx,
+ sta->addr, authorized);
}