aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2011-02-06 18:50:32 (GMT)
committerJouni Malinen <j@w1.fi>2011-02-06 18:50:32 (GMT)
commit379ff7b9d41307ce48814a2be675e2f8ecc47f40 (patch)
treed63385109e4db74e4903500d67b176cf7b8d1920 /hostapd
parent4f1495aefa1e5d5b4230229c9619c7d4923a2676 (diff)
downloadhostap-379ff7b9d41307ce48814a2be675e2f8ecc47f40.zip
hostap-379ff7b9d41307ce48814a2be675e2f8ecc47f40.tar.gz
hostap-379ff7b9d41307ce48814a2be675e2f8ecc47f40.tar.bz2
hostapd: Add iface-name wpa_msg() callback registration
This allows the interface name to be automatically added to log file lines by the core logging logic. Signed-off-by: Ben Greear <greearb@candelatech.com>
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/hostapd/main.c b/hostapd/main.c
index 45836df..b03fdd8 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -477,6 +477,15 @@ static void usage(void)
}
+static const char * hostapd_msg_ifname_cb(void *ctx)
+{
+ struct hostapd_data *hapd = ctx;
+ if (hapd && hapd->iconf && hapd->iconf->bss)
+ return hapd->iconf->bss->iface;
+ return NULL;
+}
+
+
int main(int argc, char *argv[])
{
struct hapd_interfaces interfaces;
@@ -532,6 +541,8 @@ int main(int argc, char *argv[])
if (optind == argc)
usage();
+ wpa_msg_register_ifname_cb(hostapd_msg_ifname_cb);
+
if (log_file)
wpa_debug_open_file(log_file);