aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2005-11-27 04:45:38 (GMT)
committerJouni Malinen <j@w1.fi>2005-11-27 04:45:38 (GMT)
commit759d7026285117b3e6649fcf1aa71d3c8087bac4 (patch)
tree57caa2642c47b80bf7a16dc9814671c1e2846667
parent8818c0aa0ffeb37f2a169bd0b0a8aa69b10af817 (diff)
downloadhostap-history-759d7026285117b3e6649fcf1aa71d3c8087bac4.zip
hostap-history-759d7026285117b3e6649fcf1aa71d3c8087bac4.tar.gz
hostap-history-759d7026285117b3e6649fcf1aa71d3c8087bac4.tar.bz2
Added a new header file, includes.h, that includes all commonly used header
files. This allows OS/C library specific #ifdefs etc. to be done in a single place so that all C files can be cleaned up of this mess. includes.h is included as the first header file into each C file. Include another new header file, build_config.h, as the first header file in includes.h. This creates a single place for doing build time configuration for systems that do not use Makefile (e.g., IDE or less advanced 'make' tool).
-rwxr-xr-xbuild_gpl_release2
-rw-r--r--hostapd/Makefile7
-rw-r--r--hostapd/accounting.c11
-rw-r--r--hostapd/aes.c2
-rw-r--r--hostapd/aes_wrap.c5
-rw-r--r--hostapd/build_config.h26
-rw-r--r--hostapd/common.c12
-rw-r--r--hostapd/config.c10
-rw-r--r--hostapd/ctrl_iface.c10
-rw-r--r--hostapd/driver.c9
-rw-r--r--hostapd/driver_bsd.c9
-rw-r--r--hostapd/driver_madwifi.c10
-rw-r--r--hostapd/driver_prism54.c13
-rw-r--r--hostapd/driver_test.c11
-rw-r--r--hostapd/driver_wired.c10
-rw-r--r--hostapd/eap.c7
-rw-r--r--hostapd/eap_aka.c5
-rw-r--r--hostapd/eap_gtc.c5
-rw-r--r--hostapd/eap_identity.c5
-rw-r--r--hostapd/eap_md5.c5
-rw-r--r--hostapd/eap_mschapv2.c5
-rw-r--r--hostapd/eap_pax.c5
-rw-r--r--hostapd/eap_peap.c5
-rw-r--r--hostapd/eap_psk.c5
-rw-r--r--hostapd/eap_sim.c5
-rw-r--r--hostapd/eap_sim_db.c4
-rw-r--r--hostapd/eap_tls.c5
-rw-r--r--hostapd/eap_tls_common.c5
-rw-r--r--hostapd/eap_tlv.c5
-rw-r--r--hostapd/eap_ttls.c5
-rw-r--r--hostapd/eapol_sm.c7
-rw-r--r--hostapd/eloop.c11
-rw-r--r--hostapd/eloop_none.c4
-rw-r--r--hostapd/hostapd.c12
-rw-r--r--hostapd/hostapd_cli.c6
-rw-r--r--hostapd/iapp.c8
-rw-r--r--hostapd/ieee802_11.c8
-rw-r--r--hostapd/ieee802_11_auth.c9
-rw-r--r--hostapd/ieee802_1x.c10
-rw-r--r--hostapd/includes.h47
-rw-r--r--hostapd/md5.c4
-rw-r--r--hostapd/os_none.c3
-rw-r--r--hostapd/os_unix.c7
-rw-r--r--hostapd/os_win32.c2
-rw-r--r--hostapd/radius.c12
-rw-r--r--hostapd/radius_client.c12
-rw-r--r--hostapd/radius_server.c8
-rw-r--r--hostapd/rc4.c3
-rw-r--r--hostapd/sha1.c4
-rw-r--r--hostapd/sta_info.c7
-rw-r--r--hostapd/wpa.c8
-rw-r--r--wpa_supplicant/base64.c3
-rw-r--r--wpa_supplicant/config.c4
-rw-r--r--wpa_supplicant/config_file.c4
-rw-r--r--wpa_supplicant/config_none.c4
-rw-r--r--wpa_supplicant/crypto.c4
-rw-r--r--wpa_supplicant/crypto_gnutls.c3
-rw-r--r--wpa_supplicant/ctrl_iface.c19
-rw-r--r--wpa_supplicant/driver_atmel.c6
-rw-r--r--wpa_supplicant/driver_broadcom.c8
-rw-r--r--wpa_supplicant/driver_bsd.c7
-rw-r--r--wpa_supplicant/driver_hostap.c6
-rw-r--r--wpa_supplicant/driver_ipw.c6
-rw-r--r--wpa_supplicant/driver_madwifi.c6
-rw-r--r--wpa_supplicant/driver_ndis.c7
-rw-r--r--wpa_supplicant/driver_ndis_.c12
-rw-r--r--wpa_supplicant/driver_ndiswrapper.c6
-rw-r--r--wpa_supplicant/driver_prism54.c6
-rw-r--r--wpa_supplicant/driver_test.c6
-rw-r--r--wpa_supplicant/driver_wext.c6
-rw-r--r--wpa_supplicant/driver_wired.c7
-rw-r--r--wpa_supplicant/drivers.c2
-rw-r--r--wpa_supplicant/eap.c5
-rw-r--r--wpa_supplicant/eap_aka.c4
-rw-r--r--wpa_supplicant/eap_fast.c4
-rw-r--r--wpa_supplicant/eap_gtc.c4
-rw-r--r--wpa_supplicant/eap_leap.c4
-rw-r--r--wpa_supplicant/eap_md5.c3
-rw-r--r--wpa_supplicant/eap_mschapv2.c4
-rw-r--r--wpa_supplicant/eap_otp.c4
-rw-r--r--wpa_supplicant/eap_pax.c4
-rw-r--r--wpa_supplicant/eap_pax_common.c4
-rw-r--r--wpa_supplicant/eap_peap.c4
-rw-r--r--wpa_supplicant/eap_psk.c4
-rw-r--r--wpa_supplicant/eap_psk_common.c4
-rw-r--r--wpa_supplicant/eap_sim.c4
-rw-r--r--wpa_supplicant/eap_sim_common.c4
-rw-r--r--wpa_supplicant/eap_tls.c4
-rw-r--r--wpa_supplicant/eap_tls_common.c4
-rw-r--r--wpa_supplicant/eap_tlv.c4
-rw-r--r--wpa_supplicant/eap_ttls.c4
-rw-r--r--wpa_supplicant/eapol_sm.c4
-rw-r--r--wpa_supplicant/eapol_test.c13
-rw-r--r--wpa_supplicant/events.c7
-rw-r--r--wpa_supplicant/l2_packet_freebsd.c8
-rw-r--r--wpa_supplicant/l2_packet_linux.c10
-rw-r--r--wpa_supplicant/l2_packet_none.c4
-rw-r--r--wpa_supplicant/l2_packet_pcap.c8
-rw-r--r--wpa_supplicant/main.c13
-rw-r--r--wpa_supplicant/main_none.c6
-rw-r--r--wpa_supplicant/ms_funcs.c4
-rw-r--r--wpa_supplicant/pcsc_funcs.c4
-rw-r--r--wpa_supplicant/preauth.c7
-rw-r--r--wpa_supplicant/preauth_test.c9
-rw-r--r--wpa_supplicant/tls_gnutls.c5
-rw-r--r--wpa_supplicant/tls_none.c2
-rw-r--r--wpa_supplicant/tls_openssl.c4
-rw-r--r--wpa_supplicant/tls_schannel.c4
-rw-r--r--wpa_supplicant/wpa.c7
-rw-r--r--wpa_supplicant/wpa_cli.c18
-rw-r--r--wpa_supplicant/wpa_ctrl.c18
-rw-r--r--wpa_supplicant/wpa_passphrase.c3
-rw-r--r--wpa_supplicant/wpa_supplicant.c12
113 files changed, 219 insertions, 574 deletions
diff --git a/build_gpl_release b/build_gpl_release
index c25c253..1e6d262 100755
--- a/build_gpl_release
+++ b/build_gpl_release
@@ -59,7 +59,7 @@ mkdir -p $RELDIR
# New style tarballs
mv $DIR/wpa_supplicant wpa_supplicant-$VER
cp $DIR/COPYING wpa_supplicant-$VER
-cp $DIR/hostapd/{eloop.[ch],common.[ch],md5.[ch],rc4.[ch],sha1.[ch],aes_wrap.[ch],aes.c,radius.[ch],radius_client.[ch],config_types.h,os*[ch]} wpa_supplicant-$VER
+cp $DIR/hostapd/{eloop.[ch],common.[ch],md5.[ch],rc4.[ch],sha1.[ch],aes_wrap.[ch],aes.c,radius.[ch],radius_client.[ch],config_types.h,os*[ch],includes.h,build_config.h} wpa_supplicant-$VER
cp $DIR/utils/wireless_copy.h wpa_supplicant-$VER
cd wpa_supplicant-$VER
cat Makefile | sed "s%../hostapd/%%g" > Makefile.tmp
diff --git a/hostapd/Makefile b/hostapd/Makefile
index 38f8b54..7c35dbb 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -24,6 +24,8 @@ OBJS = hostapd.o eloop.o ieee802_1x.o eapol_sm.o radius.o md5.o rc4.o \
-include .config
+CFLAGS += -DCONFIG_CTRL_IFACE
+
ifdef CONFIG_IAPP
CFLAGS += -DCONFIG_IAPP
OBJS += iapp.o
@@ -217,10 +219,7 @@ driver_conf.c: Makefile .config
rm -f driver_conf.c
echo '/* THIS FILE AUTOMATICALLY GENERATED, DO NOT EDIT! */' \
> driver_conf.c
- echo '#include <stdlib.h>' >> driver_conf.c
- echo '#include <stdio.h>' >> driver_conf.c
- echo '#include <sys/types.h>' >> driver_conf.c
- echo '#include <netinet/in.h>' >> driver_conf.c
+ echo '#include "includes.h"' >> driver_conf.c
echo '#include "hostapd.h"' >> driver_conf.c
echo '#include "driver.h"' >> driver_conf.c
ifdef CONFIG_DRIVER_HOSTAP
diff --git a/hostapd/accounting.c b/hostapd/accounting.c
index 5ee3d75..b6308dd 100644
--- a/hostapd/accounting.c
+++ b/hostapd/accounting.c
@@ -13,18 +13,9 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <netinet/in.h>
-#include <string.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <signal.h>
#include <assert.h>
-#include <time.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-
#include "hostapd.h"
#include "radius.h"
diff --git a/hostapd/aes.c b/hostapd/aes.c
index ce94778..b0af3ba 100644
--- a/hostapd/aes.c
+++ b/hostapd/aes.c
@@ -21,6 +21,8 @@
* See README and COPYING for more details.
*/
+#include "includes.h"
+
/*
* rijndael-alg-fst.c
*
diff --git a/hostapd/aes_wrap.c b/hostapd/aes_wrap.c
index 6647509..f9b5210 100644
--- a/hostapd/aes_wrap.c
+++ b/hostapd/aes_wrap.c
@@ -19,9 +19,8 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
+
#include "common.h"
#include "aes_wrap.h"
#include "crypto.h"
diff --git a/hostapd/build_config.h b/hostapd/build_config.h
new file mode 100644
index 0000000..c2a6237
--- /dev/null
+++ b/hostapd/build_config.h
@@ -0,0 +1,26 @@
+/*
+ * wpa_supplicant/hostapd - Build time configuration defines
+ * Copyright (c) 2005, Jouni Malinen <jkmaline@cc.hut.fi>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Alternatively, this software may be distributed under the terms of BSD
+ * license.
+ *
+ * See README and COPYING for more details.
+ *
+ * This header file can be used to define configuration defines that were
+ * originally defined in Makefile. This is mainly meant for IDE use or for
+ * systems that do not have suitable 'make' tool. In these cases, it may be
+ * easier to have a single place for defining all the needed C pre-processor
+ * defines.
+ */
+
+#ifndef BUILD_CONFIG_H
+#define BUILD_CONFIG_H
+
+/* Insert configuration defines, e.g., #define EAP_MD5, here, if needed. */
+
+#endif /* BUILD_CONFIG_H */
diff --git a/hostapd/common.c b/hostapd/common.c
index b08d1ff..244ed51 100644
--- a/hostapd/common.c
+++ b/hostapd/common.c
@@ -12,17 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#ifndef _MSC_VER
-#include <unistd.h>
-#include <sys/time.h>
-#endif
-#include <errno.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <time.h>
+#include "includes.h"
#include "common.h"
diff --git a/hostapd/config.c b/hostapd/config.c
index b9eb1cb..5675e75 100644
--- a/hostapd/config.c
+++ b/hostapd/config.c
@@ -13,15 +13,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+#include "includes.h"
#include <grp.h>
#include "hostapd.h"
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index ff730d4..3b8a958 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -13,17 +13,9 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+#include "includes.h"
#include <sys/un.h>
-#include <sys/uio.h>
#include <sys/stat.h>
-#include <errno.h>
-#include <netinet/in.h>
#include "hostapd.h"
#include "eloop.h"
diff --git a/hostapd/driver.c b/hostapd/driver.c
index 182b6fe..c146c55 100644
--- a/hostapd/driver.c
+++ b/hostapd/driver.c
@@ -13,15 +13,8 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <netinet/in.h>
-#include <sys/types.h>
-#include <sys/socket.h>
#ifdef USE_KERNEL_HEADERS
#include <asm/types.h>
diff --git a/hostapd/driver_bsd.c b/hostapd/driver_bsd.c
index 1322bcd..a7c8351 100644
--- a/hostapd/driver_bsd.c
+++ b/hostapd/driver_bsd.c
@@ -12,16 +12,11 @@
*
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
+
+#include "includes.h"
#include <sys/ioctl.h>
-#include <errno.h>
-#include <sys/socket.h>
#include <net/if.h>
-#include <netinet/in.h>
#include <net80211/ieee80211.h>
#include <net80211/ieee80211_crypto.h>
diff --git a/hostapd/driver_madwifi.c b/hostapd/driver_madwifi.c
index 3c76b1f..bd38ba8 100644
--- a/hostapd/driver_madwifi.c
+++ b/hostapd/driver_madwifi.c
@@ -13,15 +13,10 @@
*
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
+
+#include "includes.h"
#include <net/if.h>
#include <sys/ioctl.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
#include <include/compat.h>
#include <net80211/ieee80211.h>
@@ -41,7 +36,6 @@
#include <net/if_arp.h>
#include "wireless_copy.h"
-#include <netinet/in.h>
#include <netpacket/packet.h>
#include "hostapd.h"
diff --git a/hostapd/driver_prism54.c b/hostapd/driver_prism54.c
index ce4e840..014f91e 100644
--- a/hostapd/driver_prism54.c
+++ b/hostapd/driver_prism54.c
@@ -13,20 +13,9 @@
* See README and COPYING for more details.
*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <netinet/in.h>
-
-/* for select */
#include <sys/select.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
#ifdef USE_KERNEL_HEADERS
#include <asm/types.h>
diff --git a/hostapd/driver_test.c b/hostapd/driver_test.c
index d5ac854..2375972 100644
--- a/hostapd/driver_test.c
+++ b/hostapd/driver_test.c
@@ -13,18 +13,9 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <netinet/in.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/socket.h>
#include <sys/un.h>
-#include <sys/uio.h>
#include "hostapd.h"
#include "driver.h"
diff --git a/hostapd/driver_wired.c b/hostapd/driver_wired.c
index 6ef6b19..2f25430 100644
--- a/hostapd/driver_wired.c
+++ b/hostapd/driver_wired.c
@@ -14,16 +14,8 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <netinet/in.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/socket.h>
#ifdef USE_KERNEL_HEADERS
#include <asm/types.h>
diff --git a/hostapd/eap.c b/hostapd/eap.c
index ba81712..f6aabc5 100644
--- a/hostapd/eap.c
+++ b/hostapd/eap.c
@@ -12,12 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <sys/socket.h>
+#include "includes.h"
#include "hostapd.h"
#include "sta_info.h"
diff --git a/hostapd/eap_aka.c b/hostapd/eap_aka.c
index fb00aa0..8421022 100644
--- a/hostapd/eap_aka.c
+++ b/hostapd/eap_aka.c
@@ -12,10 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netinet/in.h>
+#include "includes.h"
#include "hostapd.h"
#include "common.h"
diff --git a/hostapd/eap_gtc.c b/hostapd/eap_gtc.c
index 674f837..263f94b 100644
--- a/hostapd/eap_gtc.c
+++ b/hostapd/eap_gtc.c
@@ -12,10 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netinet/in.h>
+#include "includes.h"
#include "hostapd.h"
#include "common.h"
diff --git a/hostapd/eap_identity.c b/hostapd/eap_identity.c
index 54efc47..785056e 100644
--- a/hostapd/eap_identity.c
+++ b/hostapd/eap_identity.c
@@ -12,10 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netinet/in.h>
+#include "includes.h"
#include "hostapd.h"
#include "common.h"
diff --git a/hostapd/eap_md5.c b/hostapd/eap_md5.c
index d776c8c..28554e8 100644
--- a/hostapd/eap_md5.c
+++ b/hostapd/eap_md5.c
@@ -12,10 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netinet/in.h>
+#include "includes.h"
#include "hostapd.h"
#include "common.h"
diff --git a/hostapd/eap_mschapv2.c b/hostapd/eap_mschapv2.c
index 5cbf6eb..a062956 100644
--- a/hostapd/eap_mschapv2.c
+++ b/hostapd/eap_mschapv2.c
@@ -12,10 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netinet/in.h>
+#include "includes.h"
#include "hostapd.h"
#include "common.h"
diff --git a/hostapd/eap_pax.c b/hostapd/eap_pax.c
index 2fbec87..e96485c 100644
--- a/hostapd/eap_pax.c
+++ b/hostapd/eap_pax.c
@@ -12,10 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netinet/in.h>
+#include "includes.h"
#include "hostapd.h"
#include "common.h"
diff --git a/hostapd/eap_peap.c b/hostapd/eap_peap.c
index 9eb61a6..6a12f1d 100644
--- a/hostapd/eap_peap.c
+++ b/hostapd/eap_peap.c
@@ -12,10 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netinet/in.h>
+#include "includes.h"
#include "hostapd.h"
#include "common.h"
diff --git a/hostapd/eap_psk.c b/hostapd/eap_psk.c
index 2f92d05..2c05e8c 100644
--- a/hostapd/eap_psk.c
+++ b/hostapd/eap_psk.c
@@ -15,10 +15,7 @@
* different from WPA-PSK. This file is not needed for WPA-PSK functionality.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netinet/in.h>
+#include "includes.h"
#include "hostapd.h"
#include "common.h"
diff --git a/hostapd/eap_sim.c b/hostapd/eap_sim.c
index 29b73ca..fe5c2ae 100644
--- a/hostapd/eap_sim.c
+++ b/hostapd/eap_sim.c
@@ -12,10 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netinet/in.h>
+#include "includes.h"
#include "hostapd.h"
#include "common.h"
diff --git a/hostapd/eap_sim_db.c b/hostapd/eap_sim_db.c
index 54d4a94..b874ff3 100644
--- a/hostapd/eap_sim_db.c
+++ b/hostapd/eap_sim_db.c
@@ -23,9 +23,7 @@
* EAP-SIM testing.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eap_sim_common.h"
diff --git a/hostapd/eap_tls.c b/hostapd/eap_tls.c
index bf76f5a..2b6e6d8 100644
--- a/hostapd/eap_tls.c
+++ b/hostapd/eap_tls.c
@@ -12,10 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netinet/in.h>
+#include "includes.h"
#include "hostapd.h"
#include "common.h"
diff --git a/hostapd/eap_tls_common.c b/hostapd/eap_tls_common.c
index d573064..31bd21c 100644
--- a/hostapd/eap_tls_common.c
+++ b/hostapd/eap_tls_common.c
@@ -12,10 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netinet/in.h>
+#include "includes.h"
#include "hostapd.h"
#include "common.h"
diff --git a/hostapd/eap_tlv.c b/hostapd/eap_tlv.c
index b7609dc..f78f170 100644
--- a/hostapd/eap_tlv.c
+++ b/hostapd/eap_tlv.c
@@ -12,10 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netinet/in.h>
+#include "includes.h"
#include "hostapd.h"
#include "common.h"
diff --git a/hostapd/eap_ttls.c b/hostapd/eap_ttls.c
index 569b1c3..52d08e8 100644
--- a/hostapd/eap_ttls.c
+++ b/hostapd/eap_ttls.c
@@ -12,10 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netinet/in.h>
+#include "includes.h"
#include "hostapd.h"
#include "common.h"
diff --git a/hostapd/eapol_sm.c b/hostapd/eapol_sm.c
index 2001acf..277b67a 100644
--- a/hostapd/eapol_sm.c
+++ b/hostapd/eapol_sm.c
@@ -13,12 +13,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <sys/socket.h>
+#include "includes.h"
#include "hostapd.h"
#include "ieee802_1x.h"
diff --git a/hostapd/eloop.c b/hostapd/eloop.c
index 5752e75..ffa0ab2 100644
--- a/hostapd/eloop.c
+++ b/hostapd/eloop.c
@@ -12,16 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#ifndef _MSC_VER
-#include <sys/time.h>
-#include <unistd.h>
-#endif /* _MSC_VER */
-#include <sys/types.h>
-#include <errno.h>
-#include <signal.h>
+#include "includes.h"
#include "common.h"
#include "eloop.h"
diff --git a/hostapd/eloop_none.c b/hostapd/eloop_none.c
index e2a038e..f62cba1 100644
--- a/hostapd/eloop_none.c
+++ b/hostapd/eloop_none.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eloop.h"
diff --git a/hostapd/hostapd.c b/hostapd/hostapd.c
index 8299826..4e5fe14 100644
--- a/hostapd/hostapd.c
+++ b/hostapd/hostapd.c
@@ -13,18 +13,8 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <signal.h>
-#include <time.h>
+#include "includes.h"
#include <syslog.h>
-#include <stdarg.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
#include "eloop.h"
#include "hostapd.h"
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index d93c41d..17511ad 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -12,11 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <signal.h>
-#include <unistd.h>
+#include "includes.h"
#include <dirent.h>
#include "wpa_ctrl.h"
diff --git a/hostapd/iapp.c b/hostapd/iapp.c
index f4dd557..1847c62 100644
--- a/hostapd/iapp.c
+++ b/hostapd/iapp.c
@@ -33,15 +33,9 @@
* - IEEE 802.11 context transfer
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <netinet/in.h>
+#include "includes.h"
#include <net/if.h>
#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
#ifdef USE_KERNEL_HEADERS
#include <linux/if_packet.h>
#else /* USE_KERNEL_HEADERS */
diff --git a/hostapd/ieee802_11.c b/hostapd/ieee802_11.c
index 1130989..0f31b1a 100644
--- a/hostapd/ieee802_11.c
+++ b/hostapd/ieee802_11.c
@@ -13,14 +13,8 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/socket.h>
+#include "includes.h"
#include <net/if.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <time.h>
#include "eloop.h"
#include "hostapd.h"
diff --git a/hostapd/ieee802_11_auth.c b/hostapd/ieee802_11_auth.c
index 296c640..edb9229 100644
--- a/hostapd/ieee802_11_auth.c
+++ b/hostapd/ieee802_11_auth.c
@@ -13,14 +13,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+#include "includes.h"
#include "hostapd.h"
#include "ieee802_11.h"
diff --git a/hostapd/ieee802_1x.c b/hostapd/ieee802_1x.c
index ac077a9..04c7aeb 100644
--- a/hostapd/ieee802_1x.c
+++ b/hostapd/ieee802_1x.c
@@ -13,17 +13,9 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <netinet/in.h>
-#include <string.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <signal.h>
#include <assert.h>
-#include <time.h>
-#include <sys/time.h>
-#include <sys/socket.h>
#include "hostapd.h"
#include "ieee802_1x.h"
diff --git a/hostapd/includes.h b/hostapd/includes.h
new file mode 100644
index 0000000..0846358
--- /dev/null
+++ b/hostapd/includes.h
@@ -0,0 +1,47 @@
+/*
+ * wpa_supplicant/hostapd - Default include files
+ * Copyright (c) 2005, Jouni Malinen <jkmaline@cc.hut.fi>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Alternatively, this software may be distributed under the terms of BSD
+ * license.
+ *
+ * See README and COPYING for more details.
+ *
+ * This header file is included into all C files so that commonly used header
+ * files can be selected with OS specific #ifdefs in one place instead of
+ * having to have OS/C library specific selection in many files.
+ */
+
+#ifndef INCLUDES_H
+#define INCLUDES_H
+
+/* Include possible build time configuration before including anything else */
+#include "build_config.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <ctype.h>
+#include <time.h>
+
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif /* _MSC_VER */
+
+#ifndef CONFIG_NATIVE_WINDOWS
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/uio.h>
+#include <sys/time.h>
+#endif /* CONFIG_NATIVE_WINDOWS */
+
+#endif /* INCLUDES_H */
diff --git a/hostapd/md5.c b/hostapd/md5.c
index 48126c3..0485daf 100644
--- a/hostapd/md5.c
+++ b/hostapd/md5.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "md5.h"
diff --git a/hostapd/os_none.c b/hostapd/os_none.c
index b8f61e3..ec3b059 100644
--- a/hostapd/os_none.c
+++ b/hostapd/os_none.c
@@ -14,8 +14,7 @@
* This file can be used as a starting point when adding a new OS target.
*/
-#include <unistd.h>
-#include <sys/time.h>
+#include "includes.h"
#include "os.h"
diff --git a/hostapd/os_unix.c b/hostapd/os_unix.c
index bfe8af0..e656d7f 100644
--- a/hostapd/os_unix.c
+++ b/hostapd/os_unix.c
@@ -12,12 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <string.h>
-#include <errno.h>
+#include "includes.h"
#include "os.h"
diff --git a/hostapd/os_win32.c b/hostapd/os_win32.c
index 0153857..b8857ca 100644
--- a/hostapd/os_win32.c
+++ b/hostapd/os_win32.c
@@ -12,8 +12,8 @@
* See README and COPYING for more details.
*/
+#include "includes.h"
#include <winsock2.h>
-#include <stdio.h>
#include "os.h"
diff --git a/hostapd/radius.c b/hostapd/radius.c
index d83c993..76a6782 100644
--- a/hostapd/radius.c
+++ b/hostapd/radius.c
@@ -13,17 +13,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <signal.h>
-#ifndef CONFIG_NATIVE_WINDOWS
-#include <netinet/in.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#endif /* CONFIG_NATIVE_WINDOWS */
+#include "includes.h"
#include "common.h"
#include "radius.h"
diff --git a/hostapd/radius_client.c b/hostapd/radius_client.c
index e3be666..e01a9c6 100644
--- a/hostapd/radius_client.c
+++ b/hostapd/radius_client.c
@@ -13,17 +13,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/types.h>
-#include <errno.h>
-#ifndef CONFIG_NATIVE_WINDOWS
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#endif /* CONFIG_NATIVE_WINDOWS */
+#include "includes.h"
#include "hostapd.h"
#include "radius.h"
diff --git a/hostapd/radius_server.c b/hostapd/radius_server.c
index 8817c5f..02688e8 100644
--- a/hostapd/radius_server.c
+++ b/hostapd/radius_server.c
@@ -12,13 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
+#include "includes.h"
#include <net/if.h>
#include "common.h"
diff --git a/hostapd/rc4.c b/hostapd/rc4.c
index 592d398..60135f4 100644
--- a/hostapd/rc4.c
+++ b/hostapd/rc4.c
@@ -12,7 +12,8 @@
* See README and COPYING for more details.
*/
-#include <stdio.h>
+#include "includes.h"
+
#include "common.h"
#include "rc4.h"
diff --git a/hostapd/sha1.c b/hostapd/sha1.c
index 43a7b24..33c3032 100644
--- a/hostapd/sha1.c
+++ b/hostapd/sha1.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "sha1.h"
diff --git a/hostapd/sta_info.c b/hostapd/sta_info.c
index 380bdf2..9acad32 100644
--- a/hostapd/sta_info.c
+++ b/hostapd/sta_info.c
@@ -13,12 +13,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netinet/in.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+#include "includes.h"
#include "hostapd.h"
#include "sta_info.h"
diff --git a/hostapd/wpa.c b/hostapd/wpa.c
index 183a140..2bc8272 100644
--- a/hostapd/wpa.c
+++ b/hostapd/wpa.c
@@ -13,13 +13,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netinet/in.h>
-#include <sys/time.h>
-#include <time.h>
-#include <unistd.h>
+#include "includes.h"
#include "hostapd.h"
#include "eapol_sm.h"
diff --git a/wpa_supplicant/base64.c b/wpa_supplicant/base64.c
index 2717e30..bb1197f 100644
--- a/wpa_supplicant/base64.c
+++ b/wpa_supplicant/base64.c
@@ -12,8 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <string.h>
+#include "includes.h"
#include "base64.h"
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 064547f..f8e4da2 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "wpa.h"
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index 59573b1..bbfa77f 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -16,9 +16,7 @@
* described in the sample configuration file, wpa_supplicant.conf.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "wpa.h"
diff --git a/wpa_supplicant/config_none.c b/wpa_supplicant/config_none.c
index 75bdd85..5708f07 100644
--- a/wpa_supplicant/config_none.c
+++ b/wpa_supplicant/config_none.c
@@ -16,9 +16,7 @@
* compilation test or a starting point for a new configuration backend.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "wpa.h"
diff --git a/wpa_supplicant/crypto.c b/wpa_supplicant/crypto.c
index ec2c004..6b0660f 100644
--- a/wpa_supplicant/crypto.c
+++ b/wpa_supplicant/crypto.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <string.h>
-#include <sys/types.h>
-
+#include "includes.h"
#include <openssl/md4.h>
#include <openssl/md5.h>
#include <openssl/sha.h>
diff --git a/wpa_supplicant/crypto_gnutls.c b/wpa_supplicant/crypto_gnutls.c
index 15f9b54..d0e3966 100644
--- a/wpa_supplicant/crypto_gnutls.c
+++ b/wpa_supplicant/crypto_gnutls.c
@@ -12,8 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdio.h>
-#include <sys/types.h>
+#include "includes.h"
#include <gcrypt.h>
#include "common.h"
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 563e6c2..648eb8c 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -12,20 +12,13 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#ifndef CONFIG_NATIVE_WINDOWS
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+#include "includes.h"
+#ifdef CONFIG_CTRL_IFACE
+#ifndef CONFIG_CTRL_IFACE_UDP
#include <sys/un.h>
-#include <sys/uio.h>
-#endif /* CONFIG_NATIVE_WINDOWS */
+#include <sys/stat.h>
+#endif /* CONFIG_CTRL_IFACE_UDP */
+#endif /* CONFIG_CTRL_IFACE */
#include "common.h"
#include "eloop.h"
diff --git a/wpa_supplicant/driver_atmel.c b/wpa_supplicant/driver_atmel.c
index 7d39a73..2388e4b 100644
--- a/wpa_supplicant/driver_atmel.c
+++ b/wpa_supplicant/driver_atmel.c
@@ -39,12 +39,8 @@
* license.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <errno.h>
#include "wireless_copy.h"
#include "common.h"
diff --git a/wpa_supplicant/driver_broadcom.c b/wpa_supplicant/driver_broadcom.c
index ad0b676..709e2fc 100644
--- a/wpa_supplicant/driver_broadcom.c
+++ b/wpa_supplicant/driver_broadcom.c
@@ -13,13 +13,8 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <errno.h>
-#include <sys/socket.h>
#if 0
#include <netpacket/packet.h>
#include <net/ethernet.h> /* the L2 protocols */
@@ -27,7 +22,6 @@
#include <linux/if_packet.h>
#include <linux/if_ether.h> /* The L2 protocols */
#endif
-#include <netinet/in.h>
#include <net/if.h>
#include <typedefs.h>
diff --git a/wpa_supplicant/driver_bsd.c b/wpa_supplicant/driver_bsd.c
index a23a087..68ec9e8 100644
--- a/wpa_supplicant/driver_bsd.c
+++ b/wpa_supplicant/driver_bsd.c
@@ -12,12 +12,8 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <errno.h>
#include "common.h"
#include "driver.h"
@@ -26,7 +22,6 @@
#include "wpa_supplicant.h"
#include "l2_packet.h"
-#include <sys/socket.h>
#include <net/if.h>
#include <net80211/ieee80211.h>
diff --git a/wpa_supplicant/driver_hostap.c b/wpa_supplicant/driver_hostap.c
index 2f463fa..9a004a0 100644
--- a/wpa_supplicant/driver_hostap.c
+++ b/wpa_supplicant/driver_hostap.c
@@ -12,12 +12,8 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <errno.h>
#include "wireless_copy.h"
#include "common.h"
diff --git a/wpa_supplicant/driver_ipw.c b/wpa_supplicant/driver_ipw.c
index 92018a5..aaa65c0 100644
--- a/wpa_supplicant/driver_ipw.c
+++ b/wpa_supplicant/driver_ipw.c
@@ -14,12 +14,8 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <errno.h>
#include "wireless_copy.h"
#include "common.h"
diff --git a/wpa_supplicant/driver_madwifi.c b/wpa_supplicant/driver_madwifi.c
index 0dce4f0..faa9a12 100644
--- a/wpa_supplicant/driver_madwifi.c
+++ b/wpa_supplicant/driver_madwifi.c
@@ -13,12 +13,8 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <errno.h>
#include "common.h"
#include "driver.h"
diff --git a/wpa_supplicant/driver_ndis.c b/wpa_supplicant/driver_ndis.c
index 8829edc..9fbd1a7 100644
--- a/wpa_supplicant/driver_ndis.c
+++ b/wpa_supplicant/driver_ndis.c
@@ -12,13 +12,8 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
+#include "includes.h"
#include <Packet32.h>
-#include <stdio.h>
-#include <string.h>
-#ifndef _MSC_VER
-#include <sys/unistd.h>
-#endif
#include <ntddndis.h>
#include "common.h"
diff --git a/wpa_supplicant/driver_ndis_.c b/wpa_supplicant/driver_ndis_.c
index 5b15592..49eb757 100644
--- a/wpa_supplicant/driver_ndis_.c
+++ b/wpa_supplicant/driver_ndis_.c
@@ -12,17 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#ifndef _MSC_VER
-#include <sys/unistd.h>
-#endif
-#include <sys/types.h>
-#ifndef CONFIG_NATIVE_WINDOWS
-#include <sys/socket.h>
-#include <netinet/in.h>
-#endif /* CONFIG_NATIVE_WINDOWS */
+#include "includes.h"
#include "common.h"
#include "driver.h"
diff --git a/wpa_supplicant/driver_ndiswrapper.c b/wpa_supplicant/driver_ndiswrapper.c
index 05749e0..4eb2a5d 100644
--- a/wpa_supplicant/driver_ndiswrapper.c
+++ b/wpa_supplicant/driver_ndiswrapper.c
@@ -13,12 +13,8 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <errno.h>
#include <net/if_arp.h>
#include "wireless_copy.h"
diff --git a/wpa_supplicant/driver_prism54.c b/wpa_supplicant/driver_prism54.c
index 30b58d1..62a1573 100644
--- a/wpa_supplicant/driver_prism54.c
+++ b/wpa_supplicant/driver_prism54.c
@@ -13,12 +13,8 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <errno.h>
#include "wireless_copy.h"
#include "common.h"
diff --git a/wpa_supplicant/driver_test.c b/wpa_supplicant/driver_test.c
index 3d869a9..6794a0a 100644
--- a/wpa_supplicant/driver_test.c
+++ b/wpa_supplicant/driver_test.c
@@ -12,11 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/socket.h>
+#include "includes.h"
#include <sys/un.h>
#include "common.h"
diff --git a/wpa_supplicant/driver_wext.c b/wpa_supplicant/driver_wext.c
index ba4185d..049c094 100644
--- a/wpa_supplicant/driver_wext.c
+++ b/wpa_supplicant/driver_wext.c
@@ -18,12 +18,8 @@
* ioctls, but require private ioctls for some of the functionality.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <errno.h>
#include <net/if_arp.h>
#include "wireless_copy.h"
diff --git a/wpa_supplicant/driver_wired.c b/wpa_supplicant/driver_wired.c
index 359a21b..3307753 100644
--- a/wpa_supplicant/driver_wired.c
+++ b/wpa_supplicant/driver_wired.c
@@ -12,13 +12,8 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
#include <netpacket/packet.h>
#include <net/if.h>
diff --git a/wpa_supplicant/drivers.c b/wpa_supplicant/drivers.c
index 4fd0509..bc968cd 100644
--- a/wpa_supplicant/drivers.c
+++ b/wpa_supplicant/drivers.c
@@ -12,7 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
+#include "includes.h"
#ifdef CONFIG_DRIVER_HOSTAP
diff --git a/wpa_supplicant/eap.c b/wpa_supplicant/eap.c
index f9f9806..51ff817 100644
--- a/wpa_supplicant/eap.c
+++ b/wpa_supplicant/eap.c
@@ -12,10 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eap_aka.c b/wpa_supplicant/eap_aka.c
index dd27f7d..217d11c 100644
--- a/wpa_supplicant/eap_aka.c
+++ b/wpa_supplicant/eap_aka.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eap_fast.c b/wpa_supplicant/eap_fast.c
index f5d7a1b..d743220 100644
--- a/wpa_supplicant/eap_fast.c
+++ b/wpa_supplicant/eap_fast.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eap_gtc.c b/wpa_supplicant/eap_gtc.c
index 056a95b..3f5552b 100644
--- a/wpa_supplicant/eap_gtc.c
+++ b/wpa_supplicant/eap_gtc.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eap_leap.c b/wpa_supplicant/eap_leap.c
index a1ba56a..7fe9092 100644
--- a/wpa_supplicant/eap_leap.c
+++ b/wpa_supplicant/eap_leap.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eap_md5.c b/wpa_supplicant/eap_md5.c
index cd70ae0..7694fd7 100644
--- a/wpa_supplicant/eap_md5.c
+++ b/wpa_supplicant/eap_md5.c
@@ -12,8 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eap_mschapv2.c b/wpa_supplicant/eap_mschapv2.c
index 4e452df..047ae72 100644
--- a/wpa_supplicant/eap_mschapv2.c
+++ b/wpa_supplicant/eap_mschapv2.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eap_otp.c b/wpa_supplicant/eap_otp.c
index 9fe6c46..7bc1842 100644
--- a/wpa_supplicant/eap_otp.c
+++ b/wpa_supplicant/eap_otp.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eap_pax.c b/wpa_supplicant/eap_pax.c
index c14287b..587407f 100644
--- a/wpa_supplicant/eap_pax.c
+++ b/wpa_supplicant/eap_pax.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eap_pax_common.c b/wpa_supplicant/eap_pax_common.c
index d8f4016..c74b446 100644
--- a/wpa_supplicant/eap_pax_common.c
+++ b/wpa_supplicant/eap_pax_common.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "sha1.h"
diff --git a/wpa_supplicant/eap_peap.c b/wpa_supplicant/eap_peap.c
index 7e6e12b..8272fe9 100644
--- a/wpa_supplicant/eap_peap.c
+++ b/wpa_supplicant/eap_peap.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eap_psk.c b/wpa_supplicant/eap_psk.c
index 2def2e3..31ac828 100644
--- a/wpa_supplicant/eap_psk.c
+++ b/wpa_supplicant/eap_psk.c
@@ -15,9 +15,7 @@
* different from WPA-PSK. This file is not needed for WPA-PSK functionality.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eap_psk_common.c b/wpa_supplicant/eap_psk_common.c
index 24de66c..96d9aa1 100644
--- a/wpa_supplicant/eap_psk_common.c
+++ b/wpa_supplicant/eap_psk_common.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "aes_wrap.h"
diff --git a/wpa_supplicant/eap_sim.c b/wpa_supplicant/eap_sim.c
index 69df1d9..b13f6ba 100644
--- a/wpa_supplicant/eap_sim.c
+++ b/wpa_supplicant/eap_sim.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eap_sim_common.c b/wpa_supplicant/eap_sim_common.c
index 423b824..9efd425 100644
--- a/wpa_supplicant/eap_sim_common.c
+++ b/wpa_supplicant/eap_sim_common.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eap_tls.c b/wpa_supplicant/eap_tls.c
index 7b6ab56..5d792db 100644
--- a/wpa_supplicant/eap_tls.c
+++ b/wpa_supplicant/eap_tls.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eap_tls_common.c b/wpa_supplicant/eap_tls_common.c
index cb3fb28..91fbe6e 100644
--- a/wpa_supplicant/eap_tls_common.c
+++ b/wpa_supplicant/eap_tls_common.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eap_tlv.c b/wpa_supplicant/eap_tlv.c
index 70402e5..3186bad 100644
--- a/wpa_supplicant/eap_tlv.c
+++ b/wpa_supplicant/eap_tlv.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "wpa_supplicant.h"
diff --git a/wpa_supplicant/eap_ttls.c b/wpa_supplicant/eap_ttls.c
index 6134477..926cb43 100644
--- a/wpa_supplicant/eap_ttls.c
+++ b/wpa_supplicant/eap_ttls.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eap_i.h"
diff --git a/wpa_supplicant/eapol_sm.c b/wpa_supplicant/eapol_sm.c
index ef936b3..a3d6072 100644
--- a/wpa_supplicant/eapol_sm.c
+++ b/wpa_supplicant/eapol_sm.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eapol_sm.h"
diff --git a/wpa_supplicant/eapol_test.c b/wpa_supplicant/eapol_test.c
index 25503c1..78bc9d4 100644
--- a/wpa_supplicant/eapol_test.c
+++ b/wpa_supplicant/eapol_test.c
@@ -15,18 +15,7 @@
* Not used in production version.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <string.h>
-#include <signal.h>
-#ifndef CONFIG_NATIVE_WINDOWS
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#endif /* CONFIG_NATIVE_WINDOWS */
+#include "includes.h"
#include <assert.h>
#include "common.h"
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index f7ba833..a66a8ff 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -12,12 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#ifndef _MSC_VER
-#include <unistd.h>
-#endif
+#include "includes.h"
#include "common.h"
#include "eapol_sm.h"
diff --git a/wpa_supplicant/l2_packet_freebsd.c b/wpa_supplicant/l2_packet_freebsd.c
index 0182afa..8e24443 100644
--- a/wpa_supplicant/l2_packet_freebsd.c
+++ b/wpa_supplicant/l2_packet_freebsd.c
@@ -13,22 +13,16 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
+#include "includes.h"
#include <pcap.h>
-#include <sys/types.h>
#include <sys/ioctl.h>
-#include <sys/socket.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/route.h>
#include <netinet/in.h>
-#include <arpa/inet.h>
#include "common.h"
#include "eloop.h"
diff --git a/wpa_supplicant/l2_packet_linux.c b/wpa_supplicant/l2_packet_linux.c
index 421ee0e..c966a29 100644
--- a/wpa_supplicant/l2_packet_linux.c
+++ b/wpa_supplicant/l2_packet_linux.c
@@ -12,18 +12,10 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include <sys/ioctl.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
#include <netpacket/packet.h>
#include <net/if.h>
-#include <arpa/inet.h>
#include "common.h"
#include "eloop.h"
diff --git a/wpa_supplicant/l2_packet_none.c b/wpa_supplicant/l2_packet_none.c
index 269ceba..1b5e503 100644
--- a/wpa_supplicant/l2_packet_none.c
+++ b/wpa_supplicant/l2_packet_none.c
@@ -14,9 +14,7 @@
* This file can be used as a starting point for layer2 packet implementation.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "eloop.h"
diff --git a/wpa_supplicant/l2_packet_pcap.c b/wpa_supplicant/l2_packet_pcap.c
index 1c33a01..0a9279d 100644
--- a/wpa_supplicant/l2_packet_pcap.c
+++ b/wpa_supplicant/l2_packet_pcap.c
@@ -12,20 +12,14 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#ifndef CONFIG_NATIVE_WINDOWS
#include <sys/ioctl.h>
#endif /* CONFIG_NATIVE_WINDOWS */
-#include <errno.h>
#include <pcap.h>
#ifndef CONFIG_WINPCAP
#include <dnet.h>
#endif /* CONFIG_WINPCAP */
-#ifdef __linux__
-#include <arpa/inet.h>
-#endif /* __linux__ */
#include "common.h"
#include "eloop.h"
diff --git a/wpa_supplicant/main.c b/wpa_supplicant/main.c
index 5e50108..a9f67c9 100644
--- a/wpa_supplicant/main.c
+++ b/wpa_supplicant/main.c
@@ -12,13 +12,10 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#ifndef _MSC_VER
-#include <unistd.h>
-#endif
-#include <string.h>
+#include "includes.h"
+#ifdef __linux__
#include <fcntl.h>
+#endif /* __linux__ */
#include "common.h"
#include "wpa_supplicant_i.h"
@@ -101,7 +98,7 @@ static void license(void)
static void wpa_supplicant_fd_workaround(void)
{
-#ifndef _MSC_VER
+#ifdef __linux__
int s, i;
/* When started from pcmcia-cs scripts, wpa_supplicant might start with
* fd 0, 1, and 2 closed. This will cause some issues because many
@@ -115,7 +112,7 @@ static void wpa_supplicant_fd_workaround(void)
break;
}
}
-#endif /* _MSC_VER */
+#endif /* __linux__ */
}
diff --git a/wpa_supplicant/main_none.c b/wpa_supplicant/main_none.c
index 38b0686..cfb936a 100644
--- a/wpa_supplicant/main_none.c
+++ b/wpa_supplicant/main_none.c
@@ -12,11 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
+#include "includes.h"
#include "common.h"
#include "wpa_supplicant_i.h"
diff --git a/wpa_supplicant/ms_funcs.c b/wpa_supplicant/ms_funcs.c
index 5b4f634..996bae7 100644
--- a/wpa_supplicant/ms_funcs.c
+++ b/wpa_supplicant/ms_funcs.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "sha1.h"
diff --git a/wpa_supplicant/pcsc_funcs.c b/wpa_supplicant/pcsc_funcs.c
index 89a66d9..222942d 100644
--- a/wpa_supplicant/pcsc_funcs.c
+++ b/wpa_supplicant/pcsc_funcs.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include <winscard.h>
#include "common.h"
diff --git a/wpa_supplicant/preauth.c b/wpa_supplicant/preauth.c
index 07a95a8..0c481e5 100644
--- a/wpa_supplicant/preauth.c
+++ b/wpa_supplicant/preauth.c
@@ -12,12 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#ifndef CONFIG_NATIVE_WINDOWS
-#include <netinet/in.h>
-#endif /* CONFIG_NATIVE_WINDOWS */
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "sha1.h"
diff --git a/wpa_supplicant/preauth_test.c b/wpa_supplicant/preauth_test.c
index 9cf2e6f..d45a6cc 100644
--- a/wpa_supplicant/preauth_test.c
+++ b/wpa_supplicant/preauth_test.c
@@ -15,15 +15,8 @@
* Not used in production version.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <string.h>
-#include <signal.h>
-#include <netinet/in.h>
+#include "includes.h"
#include <assert.h>
-#include <arpa/inet.h>
#include "common.h"
#include "config.h"
diff --git a/wpa_supplicant/tls_gnutls.c b/wpa_supplicant/tls_gnutls.c
index d67ecf3..ea5590f 100644
--- a/wpa_supplicant/tls_gnutls.c
+++ b/wpa_supplicant/tls_gnutls.c
@@ -12,10 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
+#include "includes.h"
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
diff --git a/wpa_supplicant/tls_none.c b/wpa_supplicant/tls_none.c
index 2b3cafc..7c7a731 100644
--- a/wpa_supplicant/tls_none.c
+++ b/wpa_supplicant/tls_none.c
@@ -12,6 +12,8 @@
* See README and COPYING for more details.
*/
+#include "includes.h"
+
void * tls_init(void)
{
return (void *) 1;
diff --git a/wpa_supplicant/tls_openssl.c b/wpa_supplicant/tls_openssl.c
index dac6b30..2f71402 100644
--- a/wpa_supplicant/tls_openssl.c
+++ b/wpa_supplicant/tls_openssl.c
@@ -12,9 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#ifndef CONFIG_SMARTCARD
#ifndef OPENSSL_NO_ENGINE
diff --git a/wpa_supplicant/tls_schannel.c b/wpa_supplicant/tls_schannel.c
index d06a1c3..2671e44 100644
--- a/wpa_supplicant/tls_schannel.c
+++ b/wpa_supplicant/tls_schannel.c
@@ -20,9 +20,7 @@
* TODO: add support for EAP-TLS (client cert/key conf)
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include <windows.h>
#include <wincrypt.h>
#include <schannel.h>
diff --git a/wpa_supplicant/wpa.c b/wpa_supplicant/wpa.c
index 4e0b25b..be5ad5a 100644
--- a/wpa_supplicant/wpa.c
+++ b/wpa_supplicant/wpa.c
@@ -12,12 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#ifndef CONFIG_NATIVE_WINDOWS
-#include <netinet/in.h>
-#endif /* CONFIG_NATIVE_WINDOWS */
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "md5.h"
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 8b072b4..6dd87b4 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -12,13 +12,11 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <signal.h>
-#include <unistd.h>
+#include "includes.h"
+
+#ifdef CONFIG_CTRL_IFACE
+
#include <dirent.h>
-#include <errno.h>
#ifdef CONFIG_READLINE
#include <readline/readline.h>
#include <readline/history.h>
@@ -1404,3 +1402,11 @@ int main(int argc, char *argv[])
return 0;
}
+
+#else /* CONFIG_CTRL_IFACE */
+int main(int argc, char *argv[])
+{
+ printf("CONFIG_CTRL_IFACE not defined - wpa_cli disabled\n");
+ return -1;
+}
+#endif /* CONFIG_CTRL_IFACE */
diff --git a/wpa_supplicant/wpa_ctrl.c b/wpa_supplicant/wpa_ctrl.c
index 4033dad..10f46d4 100644
--- a/wpa_supplicant/wpa_ctrl.c
+++ b/wpa_supplicant/wpa_ctrl.c
@@ -12,17 +12,13 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#ifndef CONFIG_NATIVE_WINDOWS
-#include <sys/socket.h>
-#include <netinet/in.h>
+#include "includes.h"
+
+#ifdef CONFIG_CTRL_IFACE
+
+#ifndef CONFIG_CTRL_IFACE_UDP
#include <sys/un.h>
-#endif /* CONFIG_NATIVE_WINDOWS */
+#endif /* CONFIG_CTRL_IFACE_UDP */
#include "wpa_ctrl.h"
#include "common.h"
@@ -235,3 +231,5 @@ int wpa_ctrl_get_fd(struct wpa_ctrl *ctrl)
{
return ctrl->s;
}
+
+#endif /* CONFIG_CTRL_IFACE */
diff --git a/wpa_supplicant/wpa_passphrase.c b/wpa_supplicant/wpa_passphrase.c
index 2a68cb5..969d8ad 100644
--- a/wpa_supplicant/wpa_passphrase.c
+++ b/wpa_supplicant/wpa_passphrase.c
@@ -12,8 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdio.h>
-#include <string.h>
+#include "includes.h"
#include "common.h"
#include "sha1.h"
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index e6dd2b9..a21b629 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -12,17 +12,7 @@
* See README and COPYING for more details.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#ifndef _MSC_VER
-#include <unistd.h>
-#endif
-#include <string.h>
-#include <signal.h>
-#ifndef CONFIG_NATIVE_WINDOWS
-#include <netinet/in.h>
-#endif /* CONFIG_NATIVE_WINDOWS */
+#include "includes.h"
#include "common.h"
#include "eapol_sm.h"