aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-12-27 22:42:51 (GMT)
committerJouni Malinen <j@w1.fi>2009-12-27 22:42:51 (GMT)
commitf0d126d3398d211e94895cc62b56d95ddb2171ac (patch)
treedde5d75dcc20478b6ee0c40d7c5fa43e0eabf038 /wpa_supplicant
parent3a068632962f340fde5e507574ef3ff11553b17a (diff)
downloadhostap-f0d126d3398d211e94895cc62b56d95ddb2171ac.zip
hostap-f0d126d3398d211e94895cc62b56d95ddb2171ac.tar.gz
hostap-f0d126d3398d211e94895cc62b56d95ddb2171ac.tar.bz2
Add ctrl_iface events for BSS added/removed
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/bss.c4
-rw-r--r--wpa_supplicant/notify.c13
-rw-r--r--wpa_supplicant/notify.h6
3 files changed, 15 insertions, 8 deletions
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index 0323458..96ab955 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -60,7 +60,7 @@ static void wpa_bss_remove(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
wpa_printf(MSG_DEBUG, "BSS: Remove id %u BSSID " MACSTR " SSID '%s'",
bss->id, MAC2STR(bss->bssid),
wpa_ssid_txt(bss->ssid, bss->ssid_len));
- wpas_notify_bss_removed(wpa_s, bss->bssid);
+ wpas_notify_bss_removed(wpa_s, bss->bssid, bss->id);
os_free(bss);
}
@@ -127,7 +127,7 @@ static void wpa_bss_add(struct wpa_supplicant *wpa_s,
wpa_s->num_bss++;
wpa_printf(MSG_DEBUG, "BSS: Add new id %u BSSID " MACSTR " SSID '%s'",
bss->id, MAC2STR(bss->bssid), wpa_ssid_txt(ssid, ssid_len));
- wpas_notify_bss_added(wpa_s, res->bssid);
+ wpas_notify_bss_added(wpa_s, bss->bssid, bss->id);
if (wpa_s->num_bss > WPA_BSS_MAX_COUNT) {
/* Remove the oldest entry */
wpa_bss_remove(wpa_s, dl_list_first(&wpa_s->bss,
diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index f398ee9..6c2f447 100644
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
@@ -12,9 +12,10 @@
* See README and COPYING for more details.
*/
-#include "includes.h"
+#include "utils/includes.h"
-#include "common.h"
+#include "utils/common.h"
+#include "common/wpa_ctrl.h"
#include "config.h"
#include "wpa_supplicant_i.h"
#include "wps_supplicant.h"
@@ -239,20 +240,24 @@ void wpas_notify_network_removed(struct wpa_supplicant *wpa_s,
void wpas_notify_bss_added(struct wpa_supplicant *wpa_s,
- u8 bssid[])
+ u8 bssid[], unsigned int id)
{
struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
if (cbs)
cbs->register_bss(wpa_s, bssid);
+ wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_BSS_ADDED "%u " MACSTR,
+ id, MAC2STR(bssid));
}
void wpas_notify_bss_removed(struct wpa_supplicant *wpa_s,
- u8 bssid[])
+ u8 bssid[], unsigned int id)
{
struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
if (cbs)
cbs->unregister_bss(wpa_s, bssid);
+ wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_BSS_REMOVED "%u " MACSTR,
+ id, MAC2STR(bssid));
}
diff --git a/wpa_supplicant/notify.h b/wpa_supplicant/notify.h
index 437a902..02f87a3 100644
--- a/wpa_supplicant/notify.h
+++ b/wpa_supplicant/notify.h
@@ -47,8 +47,10 @@ void wpas_notify_network_added(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid);
void wpas_notify_network_removed(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid);
-void wpas_notify_bss_added(struct wpa_supplicant *wpa_s, u8 bssid[]);
-void wpas_notify_bss_removed(struct wpa_supplicant *wpa_s, u8 bssid[]);
+void wpas_notify_bss_added(struct wpa_supplicant *wpa_s, u8 bssid[],
+ unsigned int id);
+void wpas_notify_bss_removed(struct wpa_supplicant *wpa_s, u8 bssid[],
+ unsigned int id);
void wpas_notify_blob_added(struct wpa_supplicant *wpa_s, const char *name);
void wpas_notify_blob_removed(struct wpa_supplicant *wpa_s, const char *name);