2008-02-27 20:34:43 -05:00
|
|
|
ifndef CC
|
|
|
|
CC=gcc
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef CFLAGS
|
|
|
|
CFLAGS = -MMD -O2 -Wall -g
|
|
|
|
endif
|
|
|
|
|
|
|
|
# define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
|
|
|
|
# a file (undefine it, if you want to save in binary size)
|
|
|
|
CFLAGS += -DHOSTAPD_DUMP_STATE
|
|
|
|
|
|
|
|
CFLAGS += -I../src
|
|
|
|
CFLAGS += -I../src/crypto
|
|
|
|
CFLAGS += -I../src/utils
|
|
|
|
CFLAGS += -I../src/common
|
|
|
|
|
|
|
|
# Uncomment following line and set the path to your kernel tree include
|
|
|
|
# directory if your C library does not include all header files.
|
|
|
|
# CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
|
|
|
|
|
|
|
|
-include .config
|
|
|
|
|
|
|
|
ifndef CONFIG_OS
|
|
|
|
ifdef CONFIG_NATIVE_WINDOWS
|
|
|
|
CONFIG_OS=win32
|
|
|
|
else
|
|
|
|
CONFIG_OS=unix
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_OS), internal)
|
|
|
|
CFLAGS += -DOS_NO_C_LIB_DEFINES
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_NATIVE_WINDOWS
|
|
|
|
CFLAGS += -DCONFIG_NATIVE_WINDOWS
|
|
|
|
LIBS += -lws2_32
|
|
|
|
endif
|
|
|
|
|
2009-08-11 13:31:39 -04:00
|
|
|
SHA1OBJS = ../src/crypto/sha1.o ../src/crypto/sha1-pbkdf2.o
|
2009-08-11 13:19:37 -04:00
|
|
|
|
2009-03-26 13:06:02 -04:00
|
|
|
OBJS = hostapd.o main.o ieee802_1x.o eapol_sm.o \
|
2009-01-08 12:15:25 -05:00
|
|
|
config.o ieee802_11_auth.o \
|
2009-01-12 14:44:57 -05:00
|
|
|
sta_info.o wpa.o \
|
2009-04-09 06:40:12 -04:00
|
|
|
preauth.o pmksa_cache.o \
|
2009-01-09 10:27:03 -05:00
|
|
|
drv_callbacks.o \
|
2009-01-09 10:12:33 -05:00
|
|
|
tkip_countermeasures.o \
|
2009-07-28 14:09:57 -04:00
|
|
|
mlme.o wpa_auth_ie.o $(AESOBJS)
|
2008-02-27 20:34:43 -05:00
|
|
|
|
2009-04-09 06:40:12 -04:00
|
|
|
OBJS += ../src/drivers/drivers.o
|
|
|
|
OBJS += ../src/drivers/scan_helpers.o
|
|
|
|
CFLAGS += -DHOSTAPD
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/utils/eloop.o
|
|
|
|
OBJS += ../src/utils/common.o
|
|
|
|
OBJS += ../src/utils/wpa_debug.o
|
|
|
|
OBJS += ../src/utils/wpabuf.o
|
|
|
|
OBJS += ../src/utils/os_$(CONFIG_OS).o
|
|
|
|
OBJS += ../src/utils/ip_addr.o
|
|
|
|
|
2008-10-29 15:48:14 -04:00
|
|
|
OBJS += ../src/common/ieee802_11_common.o
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/common/wpa_common.o
|
|
|
|
|
2009-01-08 12:15:25 -05:00
|
|
|
ifdef CONFIG_NO_RADIUS
|
|
|
|
CFLAGS += -DCONFIG_NO_RADIUS
|
|
|
|
CONFIG_NO_ACCOUNTING=y
|
|
|
|
else
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/radius/radius.o
|
|
|
|
OBJS += ../src/radius/radius_client.o
|
2009-01-08 12:15:25 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_NO_ACCOUNTING
|
|
|
|
CFLAGS += -DCONFIG_NO_ACCOUNTING
|
|
|
|
else
|
|
|
|
OBJS += accounting.o
|
|
|
|
endif
|
2008-02-27 20:34:43 -05:00
|
|
|
|
2009-01-12 14:39:19 -05:00
|
|
|
ifdef CONFIG_NO_VLAN
|
|
|
|
CFLAGS += -DCONFIG_NO_VLAN
|
|
|
|
else
|
|
|
|
OBJS += vlan_init.o
|
|
|
|
endif
|
|
|
|
|
2009-01-12 14:44:57 -05:00
|
|
|
ifdef CONFIG_NO_CTRL_IFACE
|
|
|
|
CFLAGS += -DCONFIG_NO_CTRL_IFACE
|
|
|
|
else
|
|
|
|
OBJS += ctrl_iface.o
|
|
|
|
endif
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/crypto/md5.o
|
|
|
|
OBJS += ../src/crypto/rc4.o
|
|
|
|
|
2009-08-13 04:40:28 -04:00
|
|
|
AESOBJS = # none so far
|
2008-02-27 20:34:43 -05:00
|
|
|
|
|
|
|
CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
|
|
|
|
|
|
|
|
ifdef CONFIG_IAPP
|
|
|
|
CFLAGS += -DCONFIG_IAPP
|
|
|
|
OBJS += iapp.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_RSN_PREAUTH
|
|
|
|
CFLAGS += -DCONFIG_RSN_PREAUTH
|
|
|
|
CONFIG_L2_PACKET=y
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_PEERKEY
|
|
|
|
CFLAGS += -DCONFIG_PEERKEY
|
|
|
|
OBJS += peerkey.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_IEEE80211W
|
|
|
|
CFLAGS += -DCONFIG_IEEE80211W
|
|
|
|
NEED_SHA256=y
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_IEEE80211R
|
|
|
|
CFLAGS += -DCONFIG_IEEE80211R
|
|
|
|
OBJS += wpa_ft.o
|
|
|
|
NEED_SHA256=y
|
|
|
|
endif
|
|
|
|
|
2008-08-21 11:18:38 -04:00
|
|
|
ifdef CONFIG_IEEE80211N
|
|
|
|
CFLAGS += -DCONFIG_IEEE80211N
|
|
|
|
endif
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
ifdef CONFIG_DRIVER_HOSTAP
|
2009-01-08 11:40:14 -05:00
|
|
|
NEED_MLME=y
|
2008-02-27 20:34:43 -05:00
|
|
|
CFLAGS += -DCONFIG_DRIVER_HOSTAP
|
2009-04-09 06:40:12 -04:00
|
|
|
OBJS += ../src/drivers/driver_hostap.o
|
2008-02-27 20:34:43 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_DRIVER_WIRED
|
|
|
|
CFLAGS += -DCONFIG_DRIVER_WIRED
|
2009-04-09 06:40:12 -04:00
|
|
|
OBJS += ../src/drivers/driver_wired.o
|
2008-02-27 20:34:43 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_DRIVER_MADWIFI
|
|
|
|
CFLAGS += -DCONFIG_DRIVER_MADWIFI
|
2009-04-09 06:40:12 -04:00
|
|
|
OBJS += ../src/drivers/driver_madwifi.o
|
2008-02-27 20:34:43 -05:00
|
|
|
CONFIG_L2_PACKET=y
|
|
|
|
endif
|
|
|
|
|
2009-02-19 09:27:07 -05:00
|
|
|
ifdef CONFIG_DRIVER_ATHEROS
|
|
|
|
CFLAGS += -DCONFIG_DRIVER_ATHEROS
|
2009-04-09 06:40:12 -04:00
|
|
|
OBJS += ../src/drivers/driver_atheros.o
|
2009-02-19 09:27:07 -05:00
|
|
|
CONFIG_L2_PACKET=y
|
|
|
|
endif
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
ifdef CONFIG_DRIVER_PRISM54
|
|
|
|
CFLAGS += -DCONFIG_DRIVER_PRISM54
|
2009-04-09 06:40:12 -04:00
|
|
|
OBJS += ../src/drivers/driver_prism54.o
|
2008-02-27 20:34:43 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_DRIVER_NL80211
|
2009-01-08 11:40:14 -05:00
|
|
|
NEED_MLME=y
|
2008-02-27 20:34:43 -05:00
|
|
|
CFLAGS += -DCONFIG_DRIVER_NL80211
|
2009-04-09 06:40:12 -04:00
|
|
|
OBJS += ../src/drivers/driver_nl80211.o
|
2009-01-09 08:22:19 -05:00
|
|
|
OBJS += ../src/utils/radiotap.o
|
2008-02-27 20:34:43 -05:00
|
|
|
LIBS += -lnl
|
2008-12-08 15:40:58 -05:00
|
|
|
ifdef CONFIG_LIBNL20
|
|
|
|
LIBS += -lnl-genl
|
|
|
|
CFLAGS += -DCONFIG_LIBNL20
|
|
|
|
endif
|
2008-02-27 20:34:43 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_DRIVER_BSD
|
|
|
|
CFLAGS += -DCONFIG_DRIVER_BSD
|
2009-04-09 06:40:12 -04:00
|
|
|
OBJS += ../src/drivers/driver_bsd.o
|
2008-02-27 20:34:43 -05:00
|
|
|
CONFIG_L2_PACKET=y
|
|
|
|
CONFIG_DNET_PCAP=y
|
|
|
|
CONFIG_L2_FREEBSD=y
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_DRIVER_TEST
|
2009-01-08 11:40:14 -05:00
|
|
|
NEED_MLME=y
|
2008-02-27 20:34:43 -05:00
|
|
|
CFLAGS += -DCONFIG_DRIVER_TEST
|
2009-04-09 06:40:12 -04:00
|
|
|
OBJS += ../src/drivers/driver_test.o
|
2008-02-27 20:34:43 -05:00
|
|
|
endif
|
|
|
|
|
2008-10-01 07:07:55 -04:00
|
|
|
ifdef CONFIG_DRIVER_NONE
|
|
|
|
CFLAGS += -DCONFIG_DRIVER_NONE
|
2009-04-09 06:40:12 -04:00
|
|
|
OBJS += ../src/drivers/driver_none.o
|
2008-10-01 07:07:55 -04:00
|
|
|
endif
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
ifdef CONFIG_L2_PACKET
|
|
|
|
ifdef CONFIG_DNET_PCAP
|
|
|
|
ifdef CONFIG_L2_FREEBSD
|
|
|
|
LIBS += -lpcap
|
|
|
|
OBJS += ../src/l2_packet/l2_packet_freebsd.o
|
|
|
|
else
|
|
|
|
LIBS += -ldnet -lpcap
|
|
|
|
OBJS += ../src/l2_packet/l2_packet_pcap.o
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
OBJS += ../src/l2_packet/l2_packet_linux.o
|
|
|
|
endif
|
2008-11-21 08:44:00 -05:00
|
|
|
else
|
|
|
|
OBJS += ../src/l2_packet/l2_packet_none.o
|
2008-02-27 20:34:43 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
ifdef CONFIG_EAP_MD5
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_MD5
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/eap_server/eap_md5.o
|
|
|
|
CHAP=y
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_EAP_TLS
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_TLS
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/eap_server/eap_tls.o
|
|
|
|
TLS_FUNCS=y
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_EAP_PEAP
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_PEAP
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/eap_server/eap_peap.o
|
2008-06-09 03:32:12 -04:00
|
|
|
OBJS += ../src/eap_common/eap_peap_common.o
|
2008-02-27 20:34:43 -05:00
|
|
|
TLS_FUNCS=y
|
|
|
|
CONFIG_EAP_MSCHAPV2=y
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_EAP_TTLS
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_TTLS
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/eap_server/eap_ttls.o
|
|
|
|
TLS_FUNCS=y
|
|
|
|
CHAP=y
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_EAP_MSCHAPV2
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_MSCHAPV2
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/eap_server/eap_mschapv2.o
|
|
|
|
MS_FUNCS=y
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_EAP_GTC
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_GTC
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/eap_server/eap_gtc.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_EAP_SIM
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_SIM
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/eap_server/eap_sim.o
|
|
|
|
CONFIG_EAP_SIM_COMMON=y
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_EAP_AKA
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_AKA
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/eap_server/eap_aka.o
|
|
|
|
CONFIG_EAP_SIM_COMMON=y
|
2009-05-29 15:35:08 -04:00
|
|
|
NEED_SHA256=y
|
2008-02-27 20:34:43 -05:00
|
|
|
endif
|
|
|
|
|
2008-12-02 13:12:49 -05:00
|
|
|
ifdef CONFIG_EAP_AKA_PRIME
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_AKA_PRIME
|
2008-12-02 13:12:49 -05:00
|
|
|
endif
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
ifdef CONFIG_EAP_SIM_COMMON
|
|
|
|
OBJS += ../src/eap_common/eap_sim_common.o
|
|
|
|
# Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
|
|
|
|
# replaced with another file implementating the interface specified in
|
|
|
|
# eap_sim_db.h.
|
|
|
|
OBJS += ../src/eap_server/eap_sim_db.o
|
|
|
|
NEED_FIPS186_2_PRF=y
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_EAP_PAX
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_PAX
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/eap_server/eap_pax.o ../src/eap_common/eap_pax_common.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_EAP_PSK
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_PSK
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/eap_server/eap_psk.o ../src/eap_common/eap_psk_common.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_EAP_SAKE
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_SAKE
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/eap_server/eap_sake.o ../src/eap_common/eap_sake_common.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_EAP_GPSK
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_GPSK
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/eap_server/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o
|
|
|
|
ifdef CONFIG_EAP_GPSK_SHA256
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_GPSK_SHA256
|
2008-02-27 20:34:43 -05:00
|
|
|
endif
|
|
|
|
NEED_SHA256=y
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_EAP_VENDOR_TEST
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_VENDOR_TEST
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/eap_server/eap_vendor_test.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_EAP_FAST
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_FAST
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/eap_server/eap_fast.o
|
2008-02-27 20:56:30 -05:00
|
|
|
OBJS += ../src/eap_common/eap_fast_common.o
|
2008-02-27 20:34:43 -05:00
|
|
|
TLS_FUNCS=y
|
|
|
|
NEED_T_PRF=y
|
|
|
|
endif
|
|
|
|
|
2008-11-23 12:34:26 -05:00
|
|
|
ifdef CONFIG_WPS
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
|
2008-11-23 12:34:26 -05:00
|
|
|
OBJS += ../src/utils/uuid.o
|
|
|
|
OBJS += wps_hostapd.o
|
|
|
|
OBJS += ../src/eap_server/eap_wsc.o ../src/eap_common/eap_wsc_common.o
|
|
|
|
OBJS += ../src/wps/wps.o
|
|
|
|
OBJS += ../src/wps/wps_common.o
|
2008-11-29 06:16:26 -05:00
|
|
|
OBJS += ../src/wps/wps_attr_parse.o
|
|
|
|
OBJS += ../src/wps/wps_attr_build.o
|
|
|
|
OBJS += ../src/wps/wps_attr_process.o
|
2008-11-23 12:34:26 -05:00
|
|
|
OBJS += ../src/wps/wps_dev_attr.o
|
|
|
|
OBJS += ../src/wps/wps_enrollee.o
|
|
|
|
OBJS += ../src/wps/wps_registrar.o
|
|
|
|
NEED_DH_GROUPS=y
|
|
|
|
NEED_SHA256=y
|
|
|
|
NEED_CRYPTO=y
|
2008-12-26 09:40:27 -05:00
|
|
|
NEED_BASE64=y
|
2009-01-29 11:47:02 -05:00
|
|
|
|
2009-02-26 15:01:36 -05:00
|
|
|
ifdef CONFIG_WPS_UFD
|
|
|
|
CFLAGS += -DCONFIG_WPS_UFD
|
|
|
|
OBJS += ../src/wps/wps_ufd.o
|
2009-02-26 15:10:21 -05:00
|
|
|
NEED_WPS_OOB=y
|
|
|
|
endif
|
|
|
|
|
2009-03-06 09:16:22 -05:00
|
|
|
ifdef CONFIG_WPS_NFC
|
|
|
|
CFLAGS += -DCONFIG_WPS_NFC
|
|
|
|
OBJS += ../src/wps/ndef.o
|
|
|
|
OBJS += ../src/wps/wps_nfc.o
|
|
|
|
NEED_WPS_OOB=y
|
|
|
|
ifdef CONFIG_WPS_NFC_PN531
|
2009-03-06 09:25:48 -05:00
|
|
|
PN531_PATH ?= /usr/local/src/nfc
|
2009-03-06 09:16:22 -05:00
|
|
|
CFLAGS += -DCONFIG_WPS_NFC_PN531
|
|
|
|
CFLAGS += -I${PN531_PATH}/inc
|
|
|
|
OBJS += ../src/wps/wps_nfc_pn531.o
|
|
|
|
LIBS += ${PN531_PATH}/lib/wpsnfc.dll
|
|
|
|
LIBS += ${PN531_PATH}/lib/libnfc_mapping_pn53x.dll
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2009-02-26 15:10:21 -05:00
|
|
|
ifdef NEED_WPS_OOB
|
|
|
|
CFLAGS += -DCONFIG_WPS_OOB
|
2009-02-26 15:01:36 -05:00
|
|
|
endif
|
|
|
|
|
2009-01-29 11:47:02 -05:00
|
|
|
ifdef CONFIG_WPS_UPNP
|
|
|
|
CFLAGS += -DCONFIG_WPS_UPNP
|
|
|
|
OBJS += ../src/wps/wps_upnp.o
|
|
|
|
OBJS += ../src/wps/wps_upnp_ssdp.o
|
|
|
|
OBJS += ../src/wps/wps_upnp_web.o
|
|
|
|
OBJS += ../src/wps/wps_upnp_event.o
|
|
|
|
OBJS += ../src/wps/httpread.o
|
|
|
|
endif
|
|
|
|
|
2008-11-23 12:34:26 -05:00
|
|
|
endif
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
ifdef CONFIG_EAP_IKEV2
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_IKEV2
|
2008-02-27 20:34:43 -05:00
|
|
|
OBJS += ../src/eap_server/eap_ikev2.o ../src/eap_server/ikev2.o
|
|
|
|
OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
|
|
|
|
NEED_DH_GROUPS=y
|
|
|
|
endif
|
|
|
|
|
2008-03-09 04:37:18 -04:00
|
|
|
ifdef CONFIG_EAP_TNC
|
2009-03-25 06:06:19 -04:00
|
|
|
CFLAGS += -DEAP_SERVER_TNC
|
2008-03-09 04:37:18 -04:00
|
|
|
OBJS += ../src/eap_server/eap_tnc.o
|
|
|
|
OBJS += ../src/eap_server/tncs.o
|
|
|
|
NEED_BASE64=y
|
2009-03-21 14:59:07 -04:00
|
|
|
ifndef CONFIG_DRIVER_BSD
|
2009-02-05 12:24:16 -05:00
|
|
|
LIBS += -ldl
|
2008-03-09 04:37:18 -04:00
|
|
|
endif
|
2009-03-21 14:59:07 -04:00
|
|
|
endif
|
2008-03-09 04:37:18 -04:00
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
# Basic EAP functionality is needed for EAPOL
|
|
|
|
OBJS += ../src/eap_server/eap.o
|
|
|
|
OBJS += ../src/eap_common/eap_common.o
|
|
|
|
OBJS += ../src/eap_server/eap_methods.o
|
|
|
|
OBJS += ../src/eap_server/eap_identity.o
|
|
|
|
|
|
|
|
ifdef CONFIG_EAP
|
|
|
|
CFLAGS += -DEAP_SERVER
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef CONFIG_TLS
|
|
|
|
CONFIG_TLS=openssl
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_TLS), internal)
|
|
|
|
ifndef CONFIG_CRYPTO
|
|
|
|
CONFIG_CRYPTO=internal
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_CRYPTO), libtomcrypt)
|
|
|
|
CFLAGS += -DCONFIG_INTERNAL_X509
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_CRYPTO), internal)
|
|
|
|
CFLAGS += -DCONFIG_INTERNAL_X509
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
ifdef TLS_FUNCS
|
|
|
|
# Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
|
|
|
|
CFLAGS += -DEAP_TLS_FUNCS
|
|
|
|
OBJS += ../src/eap_server/eap_tls_common.o
|
2009-01-12 08:20:12 -05:00
|
|
|
NEED_TLS_PRF=y
|
2008-02-27 20:34:43 -05:00
|
|
|
ifeq ($(CONFIG_TLS), openssl)
|
|
|
|
OBJS += ../src/crypto/tls_openssl.o
|
|
|
|
LIBS += -lssl -lcrypto
|
|
|
|
LIBS_p += -lcrypto
|
|
|
|
LIBS_h += -lcrypto
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_TLS), gnutls)
|
|
|
|
OBJS += ../src/crypto/tls_gnutls.o
|
|
|
|
LIBS += -lgnutls -lgcrypt -lgpg-error
|
|
|
|
LIBS_p += -lgcrypt
|
|
|
|
LIBS_h += -lgcrypt
|
|
|
|
endif
|
|
|
|
ifdef CONFIG_GNUTLS_EXTRA
|
|
|
|
CFLAGS += -DCONFIG_GNUTLS_EXTRA
|
|
|
|
LIBS += -lgnutls-extra
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_TLS), internal)
|
|
|
|
OBJS += ../src/crypto/tls_internal.o
|
|
|
|
OBJS += ../src/tls/tlsv1_common.o ../src/tls/tlsv1_record.o
|
|
|
|
OBJS += ../src/tls/tlsv1_cred.o ../src/tls/tlsv1_server.o
|
|
|
|
OBJS += ../src/tls/tlsv1_server_write.o ../src/tls/tlsv1_server_read.o
|
|
|
|
OBJS += ../src/tls/asn1.o ../src/tls/x509v3.o
|
|
|
|
OBJS_p += ../src/tls/asn1.o
|
2009-07-28 14:09:57 -04:00
|
|
|
OBJS_p += ../src/crypto/rc4.o $(AESOBJS)
|
2008-02-27 20:34:43 -05:00
|
|
|
NEED_BASE64=y
|
|
|
|
CFLAGS += -DCONFIG_TLS_INTERNAL
|
|
|
|
CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
|
|
|
|
ifeq ($(CONFIG_CRYPTO), internal)
|
|
|
|
ifdef CONFIG_INTERNAL_LIBTOMMATH
|
|
|
|
CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
|
|
|
|
else
|
|
|
|
LIBS += -ltommath
|
|
|
|
LIBS_p += -ltommath
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_CRYPTO), libtomcrypt)
|
|
|
|
LIBS += -ltomcrypt -ltfm
|
|
|
|
LIBS_p += -ltomcrypt -ltfm
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
NEED_CRYPTO=y
|
|
|
|
else
|
|
|
|
OBJS += ../src/crypto/tls_none.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_PKCS12
|
|
|
|
CFLAGS += -DPKCS12_FUNCS
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef MS_FUNCS
|
|
|
|
OBJS += ../src/crypto/ms_funcs.o
|
|
|
|
NEED_CRYPTO=y
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CHAP
|
|
|
|
OBJS += ../src/eap_common/chap.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef NEED_CRYPTO
|
|
|
|
ifndef TLS_FUNCS
|
|
|
|
ifeq ($(CONFIG_TLS), openssl)
|
|
|
|
LIBS += -lcrypto
|
|
|
|
LIBS_p += -lcrypto
|
|
|
|
LIBS_h += -lcrypto
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_TLS), gnutls)
|
|
|
|
LIBS += -lgcrypt
|
|
|
|
LIBS_p += -lgcrypt
|
|
|
|
LIBS_h += -lgcrypt
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_TLS), internal)
|
|
|
|
ifeq ($(CONFIG_CRYPTO), libtomcrypt)
|
|
|
|
LIBS += -ltomcrypt -ltfm
|
|
|
|
LIBS_p += -ltomcrypt -ltfm
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_TLS), openssl)
|
|
|
|
OBJS += ../src/crypto/crypto_openssl.o
|
|
|
|
OBJS_p += ../src/crypto/crypto_openssl.o
|
|
|
|
HOBJS += ../src/crypto/crypto_openssl.o
|
2009-08-11 13:06:23 -04:00
|
|
|
ifdef NEED_FIPS186_2_PRF
|
|
|
|
OBJS += ../src/crypto/fips_prf_openssl.o
|
|
|
|
OBJS_p += ../src/crypto/fips_prf_openssl.o
|
|
|
|
HOBJS += ../src/crypto/fips_prf_openssl.o
|
|
|
|
endif
|
2008-02-27 20:34:43 -05:00
|
|
|
CONFIG_INTERNAL_SHA256=y
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_TLS), gnutls)
|
|
|
|
OBJS += ../src/crypto/crypto_gnutls.o
|
|
|
|
OBJS_p += ../src/crypto/crypto_gnutls.o
|
|
|
|
HOBJS += ../src/crypto/crypto_gnutls.o
|
2009-08-11 13:06:23 -04:00
|
|
|
ifdef NEED_FIPS186_2_PRF
|
|
|
|
OBJS += ../src/crypto/fips_prf_gnutls.o
|
|
|
|
OBJS_p += ../src/crypto/fips_prf_gnutls.o
|
|
|
|
HOBJS += ../src/crypto/fips_prf_gnutls.o
|
|
|
|
endif
|
2008-02-27 20:34:43 -05:00
|
|
|
CONFIG_INTERNAL_SHA256=y
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_TLS), internal)
|
|
|
|
ifeq ($(CONFIG_CRYPTO), libtomcrypt)
|
|
|
|
OBJS += ../src/crypto/crypto_libtomcrypt.o
|
|
|
|
OBJS_p += ../src/crypto/crypto_libtomcrypt.o
|
|
|
|
CONFIG_INTERNAL_SHA256=y
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_CRYPTO), internal)
|
|
|
|
OBJS += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o
|
|
|
|
OBJS_p += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o
|
|
|
|
CFLAGS += -DCONFIG_CRYPTO_INTERNAL
|
2009-05-26 10:09:04 -04:00
|
|
|
ifdef CONFIG_INTERNAL_LIBTOMMATH
|
|
|
|
CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
|
|
|
|
ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
|
|
|
|
CFLAGS += -DLTM_FAST
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
LIBS += -ltommath
|
|
|
|
LIBS_p += -ltommath
|
|
|
|
endif
|
2008-02-27 20:34:43 -05:00
|
|
|
CONFIG_INTERNAL_AES=y
|
|
|
|
CONFIG_INTERNAL_DES=y
|
|
|
|
CONFIG_INTERNAL_SHA1=y
|
|
|
|
CONFIG_INTERNAL_MD4=y
|
|
|
|
CONFIG_INTERNAL_MD5=y
|
|
|
|
CONFIG_INTERNAL_SHA256=y
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
CONFIG_INTERNAL_AES=y
|
|
|
|
CONFIG_INTERNAL_SHA1=y
|
|
|
|
CONFIG_INTERNAL_MD5=y
|
|
|
|
CONFIG_INTERNAL_SHA256=y
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_INTERNAL_AES
|
2009-08-13 04:21:32 -04:00
|
|
|
AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-enc.o
|
2008-02-27 20:34:43 -05:00
|
|
|
endif
|
|
|
|
ifdef CONFIG_INTERNAL_SHA1
|
2009-08-11 13:19:37 -04:00
|
|
|
SHA1OBJS += ../src/crypto/sha1-internal.o
|
2009-08-11 13:06:23 -04:00
|
|
|
ifdef NEED_FIPS186_2_PRF
|
2009-08-11 13:19:37 -04:00
|
|
|
SHA1OBJS += ../src/crypto/fips_prf_internal.o
|
2009-08-11 13:06:23 -04:00
|
|
|
endif
|
2008-02-27 20:34:43 -05:00
|
|
|
endif
|
|
|
|
ifdef CONFIG_INTERNAL_MD5
|
2009-07-28 14:36:13 -04:00
|
|
|
OBJS += ../src/crypto/md5-internal.o
|
2008-02-27 20:34:43 -05:00
|
|
|
endif
|
|
|
|
ifdef CONFIG_INTERNAL_MD4
|
2009-07-28 14:27:02 -04:00
|
|
|
OBJS += ../src/crypto/md4-internal.o
|
2008-02-27 20:34:43 -05:00
|
|
|
endif
|
|
|
|
ifdef CONFIG_INTERNAL_DES
|
2009-07-28 14:00:44 -04:00
|
|
|
OBJS += ../src/crypto/des-internal.o
|
2008-02-27 20:34:43 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef NEED_SHA256
|
|
|
|
OBJS += ../src/crypto/sha256.o
|
2009-07-28 14:20:04 -04:00
|
|
|
ifdef CONFIG_INTERNAL_SHA256
|
|
|
|
OBJS += ../src/crypto/sha256-internal.o
|
|
|
|
endif
|
2008-02-27 20:34:43 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef NEED_DH_GROUPS
|
|
|
|
OBJS += ../src/crypto/dh_groups.o
|
|
|
|
endif
|
|
|
|
|
2009-08-11 13:19:37 -04:00
|
|
|
ifdef NEED_T_PRF
|
|
|
|
SHA1OBJS += ../src/crypto/sha1-tprf.o
|
2008-02-27 20:34:43 -05:00
|
|
|
endif
|
|
|
|
|
2009-08-11 13:24:06 -04:00
|
|
|
ifdef NEED_TLS_PRF
|
|
|
|
SHA1OBJS += ../src/crypto/sha1-tlsprf.o
|
2009-01-12 08:20:12 -05:00
|
|
|
endif
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
ifdef CONFIG_RADIUS_SERVER
|
|
|
|
CFLAGS += -DRADIUS_SERVER
|
|
|
|
OBJS += ../src/radius/radius_server.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_IPV6
|
|
|
|
CFLAGS += -DCONFIG_IPV6
|
|
|
|
endif
|
|
|
|
|
2008-03-12 05:43:55 -04:00
|
|
|
ifdef CONFIG_DRIVER_RADIUS_ACL
|
|
|
|
CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
|
|
|
|
endif
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
ifdef CONFIG_FULL_DYNAMIC_VLAN
|
|
|
|
# define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
|
|
|
|
# and vlan interfaces for the vlan feature.
|
|
|
|
CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef NEED_BASE64
|
|
|
|
OBJS += ../src/utils/base64.o
|
|
|
|
endif
|
|
|
|
|
2009-01-08 11:40:14 -05:00
|
|
|
ifdef NEED_MLME
|
|
|
|
OBJS += beacon.o wme.o ap_list.o ieee802_11.o
|
2009-01-12 15:03:58 -05:00
|
|
|
OBJS += hw_features.o
|
2009-01-08 11:40:14 -05:00
|
|
|
CFLAGS += -DNEED_MLME
|
|
|
|
endif
|
|
|
|
|
2009-01-08 09:47:04 -05:00
|
|
|
ifdef CONFIG_NO_STDOUT_DEBUG
|
|
|
|
CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
|
|
|
|
endif
|
|
|
|
|
2009-08-13 04:40:28 -04:00
|
|
|
AESOBJS += ../src/crypto/aes-wrap.o
|
|
|
|
ifndef CONFIG_NO_AES_EXTRAS
|
2009-08-13 04:16:21 -04:00
|
|
|
ifdef CONFIG_INTERNAL_AES
|
|
|
|
AESOBJS += ../src/crypto/aes-internal-dec.o
|
|
|
|
endif
|
2009-08-13 04:40:28 -04:00
|
|
|
AESOBJS += ../src/crypto/aes-cbc.o
|
|
|
|
AESOBJS += ../src/crypto/aes-ctr.o
|
|
|
|
AESOBJS += ../src/crypto/aes-eax.o
|
|
|
|
AESOBJS += ../src/crypto/aes-encblock.o
|
|
|
|
AESOBJS += ../src/crypto/aes-omac1.o
|
|
|
|
AESOBJS += ../src/crypto/aes-unwrap.o
|
2009-01-12 08:15:35 -05:00
|
|
|
endif
|
|
|
|
|
2009-08-11 13:19:37 -04:00
|
|
|
OBJS += $(SHA1OBJS)
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
ALL=hostapd hostapd_cli
|
|
|
|
|
|
|
|
all: verify_config $(ALL)
|
|
|
|
|
2009-07-23 20:11:29 -04:00
|
|
|
Q=@
|
|
|
|
E=echo
|
|
|
|
ifeq ($(V), 1)
|
|
|
|
Q=
|
|
|
|
E=true
|
|
|
|
endif
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(Q)$(CC) -c -o $@ $(CFLAGS) $<
|
|
|
|
@$(E) " CC " $<
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
verify_config:
|
|
|
|
@if [ ! -r .config ]; then \
|
|
|
|
echo 'Building hostapd requires a configuration file'; \
|
|
|
|
echo '(.config). See README for more instructions. You can'; \
|
|
|
|
echo 'run "cp defconfig .config" to create an example'; \
|
|
|
|
echo 'configuration.'; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
install: all
|
|
|
|
for i in $(ALL); do cp $$i /usr/local/bin/$$i; done
|
|
|
|
|
|
|
|
hostapd: $(OBJS)
|
|
|
|
$(CC) -o hostapd $(OBJS) $(LIBS)
|
|
|
|
|
|
|
|
OBJS_c = hostapd_cli.o ../src/common/wpa_ctrl.o ../src/utils/os_$(CONFIG_OS).o
|
|
|
|
hostapd_cli: $(OBJS_c)
|
|
|
|
$(CC) -o hostapd_cli $(OBJS_c)
|
|
|
|
|
2009-08-11 13:19:37 -04:00
|
|
|
NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) ../src/crypto/rc4.o ../src/crypto/md5.o
|
2009-07-28 14:36:13 -04:00
|
|
|
ifdef CONFIG_INTERNAL_MD5
|
|
|
|
NOBJS += ../src/crypto/md5-internal.o
|
|
|
|
endif
|
2008-02-27 20:34:43 -05:00
|
|
|
NOBJS += ../src/crypto/crypto_openssl.o ../src/utils/os_$(CONFIG_OS).o
|
|
|
|
ifdef TLS_FUNCS
|
|
|
|
LIBS_n += -lcrypto
|
|
|
|
endif
|
|
|
|
|
2009-07-28 14:09:57 -04:00
|
|
|
HOBJS=../src/hlr_auc_gw/hlr_auc_gw.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).o ../src/hlr_auc_gw/milenage.o $(AESOBJS)
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
nt_password_hash: $(NOBJS)
|
|
|
|
$(CC) -o nt_password_hash $(NOBJS) $(LIBS_n)
|
|
|
|
|
|
|
|
hlr_auc_gw: $(HOBJS)
|
|
|
|
$(CC) -o hlr_auc_gw $(HOBJS) $(LIBS_h)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(MAKE) -C ../src clean
|
|
|
|
rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw
|
|
|
|
rm -f *.d
|
|
|
|
|
|
|
|
%.eps: %.fig
|
|
|
|
fig2dev -L eps $*.fig $*.eps
|
|
|
|
|
|
|
|
%.png: %.fig
|
|
|
|
fig2dev -L png -m 3 $*.fig | pngtopnm | pnmscale 0.4 | pnmtopng \
|
|
|
|
> $*.png
|
|
|
|
|
|
|
|
docs-pics: doc/hostapd.png doc/hostapd.eps
|
|
|
|
|
|
|
|
docs: docs-pics
|
2009-01-03 02:59:12 -05:00
|
|
|
(cd ..; doxygen hostapd/doc/doxygen.full; cd hostapd)
|
2008-02-27 20:34:43 -05:00
|
|
|
$(MAKE) -C doc/latex
|
|
|
|
cp doc/latex/refman.pdf hostapd-devel.pdf
|
|
|
|
|
|
|
|
docs-fast: docs-pics
|
2009-01-03 02:59:12 -05:00
|
|
|
(cd ..; doxygen hostapd/doc/doxygen.fast; cd hostapd)
|
2008-02-27 20:34:43 -05:00
|
|
|
|
|
|
|
clean-docs:
|
|
|
|
rm -rf doc/latex doc/html
|
2009-01-03 02:59:12 -05:00
|
|
|
rm -f doc/hostapd.{eps,png} hostapd-devel.pdf
|
2008-02-27 20:34:43 -05:00
|
|
|
|
2009-08-13 04:40:28 -04:00
|
|
|
TEST_SRC_MILENAGE = ../src/hlr_auc_gw/milenage.c ../src/crypto/aes-internal.c ../src/crypto/aes-internal-dec.c \
|
|
|
|
../src/crypto/aes-cbc.c \
|
|
|
|
../src/crypto/aes-ctr.c \
|
|
|
|
../src/crypto/aes-eax.c \
|
|
|
|
../src/crypto/aes-encblock.c \
|
|
|
|
../src/crypto/aes-internal-enc.c \
|
|
|
|
../src/crypto/aes-omac1.c \
|
|
|
|
../src/crypto/aes-unwrap.c \
|
|
|
|
../src/crypto/aes-wrap.c \
|
2009-08-13 04:16:21 -04:00
|
|
|
../src/utils/common.c ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).c
|
2008-02-27 20:34:43 -05:00
|
|
|
test-milenage: $(TEST_SRC_MILENAGE)
|
|
|
|
$(CC) -o test-milenage -Wall -Werror $(TEST_SRC_MILENAGE) \
|
2009-07-28 14:09:57 -04:00
|
|
|
-DTEST_MAIN_MILENAGE -I. \
|
2008-02-27 20:34:43 -05:00
|
|
|
-I../src/crypto -I../src/utils
|
|
|
|
./test-milenage
|
|
|
|
rm test-milenage
|
|
|
|
|
|
|
|
-include $(OBJS:%.o=%.d)
|