2 * wlantest - IEEE 802.11 protocol monitoring and testing tool
3 * Copyright (c) 2010, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
12 * See README and COPYING for more details.
15 #include "utils/includes.h"
17 #include "utils/common.h"
18 #include "utils/eloop.h"
22 extern int wpa_debug_level;
25 static void wlantest_terminate(int sig, void *signal_ctx)
31 static void usage(void)
33 printf("wlantest [-ddhqq] [-i<ifname>] [-r<pcap file>]\n");
37 int main(int argc, char *argv[])
40 const char *read_file = NULL;
41 const char *ifname = NULL;
44 wpa_debug_level = MSG_INFO;
46 if (os_program_init())
49 os_memset(&wt, 0, sizeof(wt));
53 c = getopt(argc, argv, "dhi:r:q");
58 if (wpa_debug_level > 0)
79 if (ifname == NULL && read_file == NULL) {
87 if (read_file && read_cap_file(&wt, read_file) < 0)
90 if (ifname && monitor_init(&wt, ifname) < 0)
93 eloop_register_signal_terminate(wlantest_terminate, &wt);
97 wpa_printf(MSG_INFO, "Processed: rx_mgmt=%u rx_ctrl=%u rx_data=%u "
99 wt.rx_mgmt, wt.rx_ctrl, wt.rx_data, wt.fcs_error);