wlantest: Add support for debug log timestamps

The new command line argument -t can now be used to request wlantest to
include a timestamp in the log entries.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-11-17 21:44:53 +02:00
parent d33fef57a4
commit de8bb171f6

View File

@ -15,6 +15,7 @@
extern int wpa_debug_level; extern int wpa_debug_level;
extern int wpa_debug_show_keys; extern int wpa_debug_show_keys;
extern int wpa_debug_timestamp;
static void wlantest_terminate(int sig, void *signal_ctx) static void wlantest_terminate(int sig, void *signal_ctx)
@ -25,7 +26,7 @@ static void wlantest_terminate(int sig, void *signal_ctx)
static void usage(void) static void usage(void)
{ {
printf("wlantest [-cddhqqF] [-i<ifname>] [-r<pcap file>] " printf("wlantest [-cddhqqFt] [-i<ifname>] [-r<pcap file>] "
"[-p<passphrase>]\n" "[-p<passphrase>]\n"
" [-I<wired ifname>] [-R<wired pcap file>] " " [-I<wired ifname>] [-R<wired pcap file>] "
"[-P<RADIUS shared secret>]\n" "[-P<RADIUS shared secret>]\n"
@ -290,7 +291,7 @@ int main(int argc, char *argv[])
wlantest_init(&wt); wlantest_init(&wt);
for (;;) { for (;;) {
c = getopt(argc, argv, "cdf:Fhi:I:L:n:p:P:qr:R:w:W:"); c = getopt(argc, argv, "cdf:Fhi:I:L:n:p:P:qr:R:tw:W:");
if (c < 0) if (c < 0)
break; break;
switch (c) { switch (c) {
@ -338,6 +339,9 @@ int main(int argc, char *argv[])
case 'R': case 'R':
read_wired_file = optarg; read_wired_file = optarg;
break; break;
case 't':
wpa_debug_timestamp = 1;
break;
case 'w': case 'w':
wt.write_file = optarg; wt.write_file = optarg;
break; break;