aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_cli.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-05-18 11:07:28 (GMT)
committerJouni Malinen <j@w1.fi>2013-05-18 11:07:28 (GMT)
commit214e428b422b1cecb62664942a978725eff7fd92 (patch)
tree3e32a7e6b6add6a0aa9c1ad635fa6528dd316573 /wpa_supplicant/wpa_cli.c
parent89c7ac570bd9630c78f6df67c84bb04abde8f757 (diff)
downloadhostap-214e428b422b1cecb62664942a978725eff7fd92.zip
hostap-214e428b422b1cecb62664942a978725eff7fd92.tar.gz
hostap-214e428b422b1cecb62664942a978725eff7fd92.tar.bz2
Allow global ctrl_iface monitors
The ATTACH/DETACH mechanism to request event messages from wpa_supplicant can now be used through the global control interface, too. This results in events from all interfaces being delivered through a single monitor socket. "IFNAME=<ifname> " prefix is used on events that are specific to an interface. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/wpa_cli.c')
-rw-r--r--wpa_supplicant/wpa_cli.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 30b1d74..33a63a1 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -3567,6 +3567,23 @@ int main(int argc, char *argv[])
global, strerror(errno));
return -1;
}
+
+ if (interactive) {
+ mon_conn = wpa_ctrl_open(global);
+ if (mon_conn) {
+ if (wpa_ctrl_attach(mon_conn) == 0) {
+ wpa_cli_attached = 1;
+ eloop_register_read_sock(
+ wpa_ctrl_get_fd(mon_conn),
+ wpa_cli_mon_receive,
+ NULL, NULL);
+ } else {
+ printf("Failed to open monitor "
+ "connection through global "
+ "control interface\n");
+ }
+ }
+ }
}
eloop_register_signal_terminate(wpa_cli_terminate, NULL);