diff options
author | wpaul <wpaul@FreeBSD.org> | 2005-10-10 20:40:28 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2005-10-10 20:40:28 +0000 |
commit | 020d6defa5f5cb6bd76c90cce2ca1c51c8fc81c3 (patch) | |
tree | efba7d358b2aa16cda140f10010e6bc3539d1c90 /usr.sbin/wpa/ndis_events/ndis_events.c | |
parent | 2dc99f1bfba811c45838d9ab57dcfd1dd994e605 (diff) | |
download | FreeBSD-src-020d6defa5f5cb6bd76c90cce2ca1c51c8fc81c3.zip FreeBSD-src-020d6defa5f5cb6bd76c90cce2ca1c51c8fc81c3.tar.gz |
Make forwarding of connect/disconnect events optional. wpa_supplicant
seems to already be able to tell when it's associated and the extra
events just confuse it. Only forward media-specific events by default.
Diffstat (limited to 'usr.sbin/wpa/ndis_events/ndis_events.c')
-rw-r--r-- | usr.sbin/wpa/ndis_events/ndis_events.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.sbin/wpa/ndis_events/ndis_events.c b/usr.sbin/wpa/ndis_events/ndis_events.c index 1741a64..6180c88 100644 --- a/usr.sbin/wpa/ndis_events/ndis_events.c +++ b/usr.sbin/wpa/ndis_events/ndis_events.c @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); static int verbose = 0; static int debug = 0; +static int all_events = 0; #define PROGNAME "ndis_events" @@ -189,7 +190,7 @@ announce_event(ifname, sock, dst) if (ioctl(s, SIOCGPRIVATE_0, &ifr) < 0) { close(s); - dbgmsg("failed to read event info from %s\n", ifname); + dbgmsg("failed to read event info from %s: %d", ifname, errno); return; } @@ -197,11 +198,15 @@ announce_event(ifname, sock, dst) type = EVENT_CONNECT; if (verbose) dbgmsg("Received a connect event for %s", ifname); + if (!all_events) + return; } if (e->ne_sts == NDIS_STATUS_MEDIA_DISCONNECT) { type = EVENT_DISCONNECT; if (verbose) dbgmsg("Received a disconnect event for %s", ifname); + if (!all_events) + return; } if (e->ne_sts == NDIS_STATUS_MEDIA_SPECIFIC_INDICATION) { type = EVENT_MEDIA_SPECIFIC; @@ -244,7 +249,7 @@ static void usage(progname) char *progname; { - fprintf(stderr, "Usage: ndis_events [-d] [-v]\n", progname); + fprintf(stderr, "Usage: ndis_events [-a] [-d] [-v]\n", progname); exit(1); } @@ -261,7 +266,7 @@ main(argc, argv) char ifname[IFNAMSIZ]; int ch; - while ((ch = getopt(argc, argv, "dv")) != -1) { + while ((ch = getopt(argc, argv, "dva")) != -1) { switch(ch) { case 'd': debug++; @@ -269,6 +274,9 @@ main(argc, argv) case 'v': verbose++; break; + case 'a': + all_events++; + break; default: usage(PROGNAME); break; |