1 From: Jo-Philipp Wich <jow@openwrt.org>
2 Date: Mon, 12 Dec 2011 17:26:13 +0000
3 Subject: [PATCH] hostapd: support optional argument for the -v switch of
4 hostapd and wpa_supplicant to query build features, e.g. hostapd -veap to
5 test whether 802.11i support is compiled in
10 #include "config_file.h"
11 #include "eap_register.h"
12 #include "ctrl_iface.h"
14 +#include "build_features.h"
18 @@ -806,7 +806,7 @@ int main(int argc, char *argv[])
19 wpa_supplicant_event = hostapd_wpa_event;
20 wpa_supplicant_event_global = hostapd_wpa_event_global;
22 - c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:q");
23 + c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:qv::");
27 @@ -843,6 +843,8 @@ int main(int argc, char *argv[])
29 #endif /* CONFIG_DEBUG_LINUX_TRACING */
32 + exit(!has_feature(optarg));
36 --- a/wpa_supplicant/main.c
37 +++ b/wpa_supplicant/main.c
39 #endif /* __linux__ */
42 +#include "build_features.h"
43 #include "crypto/crypto.h"
45 #include "wpa_supplicant_i.h"
46 @@ -202,7 +203,7 @@ int main(int argc, char *argv[])
49 c = getopt(argc, argv,
50 - "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW");
51 + "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuv::W");
55 @@ -302,8 +303,12 @@ int main(int argc, char *argv[])
57 #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
59 - printf("%s\n", wpa_supplicant_version);
62 + exitcode = !has_feature(optarg);
64 + printf("%s\n", wpa_supplicant_version);
69 params.wait_for_monitor++;