Android.mk 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098
  1. # Copyright (C) 2008 The Android Open Source Project
  2. #
  3. # This software may be distributed under the terms of the BSD license.
  4. # See README for more details.
  5. #
  6. LOCAL_PATH := $(call my-dir)
  7. WPA_BUILD_HOSTAPD := false
  8. ifneq ($(BOARD_HOSTAPD_DRIVER),)
  9. WPA_BUILD_HOSTAPD := true
  10. CONFIG_DRIVER_$(BOARD_HOSTAPD_DRIVER) := y
  11. endif
  12. ifeq ($(WPA_BUILD_HOSTAPD),true)
  13. include $(LOCAL_PATH)/android.config
  14. # To ignore possible wrong network configurations
  15. L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
  16. L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\"
  17. # Set Android log name
  18. L_CFLAGS += -DANDROID_LOG_NAME=\"hostapd\"
  19. # Disable unused parameter warnings
  20. L_CFLAGS += -Wno-unused-parameter
  21. # Set Android extended P2P functionality
  22. L_CFLAGS += -DANDROID_P2P
  23. ifeq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
  24. L_CFLAGS += -DANDROID_LIB_STUB
  25. endif
  26. # Use Android specific directory for control interface sockets
  27. L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/misc/wifi/sockets\"
  28. L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/system/hostapd\"
  29. # Use Android specific directory for hostapd_cli command completion history
  30. L_CFLAGS += -DCONFIG_HOSTAPD_CLI_HISTORY_DIR=\"/data/misc/wifi\"
  31. # To force sizeof(enum) = 4
  32. ifeq ($(TARGET_ARCH),arm)
  33. L_CFLAGS += -mabi=aapcs-linux
  34. endif
  35. INCLUDES = $(LOCAL_PATH)
  36. INCLUDES += $(LOCAL_PATH)/src
  37. INCLUDES += $(LOCAL_PATH)/src/utils
  38. INCLUDES += system/security/keystore/include
  39. ifdef CONFIG_DRIVER_NL80211
  40. ifneq ($(wildcard external/libnl),)
  41. INCLUDES += external/libnl/include
  42. else
  43. INCLUDES += external/libnl-headers
  44. endif
  45. endif
  46. ifndef CONFIG_OS
  47. ifdef CONFIG_NATIVE_WINDOWS
  48. CONFIG_OS=win32
  49. else
  50. CONFIG_OS=unix
  51. endif
  52. endif
  53. ifeq ($(CONFIG_OS), internal)
  54. L_CFLAGS += -DOS_NO_C_LIB_DEFINES
  55. endif
  56. ifdef CONFIG_NATIVE_WINDOWS
  57. L_CFLAGS += -DCONFIG_NATIVE_WINDOWS
  58. LIBS += -lws2_32
  59. endif
  60. OBJS = main.c
  61. OBJS += config_file.c
  62. OBJS += src/ap/hostapd.c
  63. OBJS += src/ap/wpa_auth_glue.c
  64. OBJS += src/ap/drv_callbacks.c
  65. OBJS += src/ap/ap_drv_ops.c
  66. OBJS += src/ap/utils.c
  67. OBJS += src/ap/authsrv.c
  68. OBJS += src/ap/ieee802_1x.c
  69. OBJS += src/ap/ap_config.c
  70. OBJS += src/ap/eap_user_db.c
  71. OBJS += src/ap/ieee802_11_auth.c
  72. OBJS += src/ap/sta_info.c
  73. OBJS += src/ap/wpa_auth.c
  74. OBJS += src/ap/tkip_countermeasures.c
  75. OBJS += src/ap/ap_mlme.c
  76. OBJS += src/ap/wpa_auth_ie.c
  77. OBJS += src/ap/preauth_auth.c
  78. OBJS += src/ap/pmksa_cache_auth.c
  79. OBJS += src/ap/ieee802_11_shared.c
  80. OBJS += src/ap/beacon.c
  81. OBJS += src/ap/bss_load.c
  82. OBJS += src/ap/neighbor_db.c
  83. OBJS += src/ap/rrm.c
  84. OBJS_d =
  85. OBJS_p =
  86. LIBS =
  87. LIBS_c =
  88. HOBJS =
  89. LIBS_h =
  90. NEED_RC4=y
  91. NEED_AES=y
  92. NEED_MD5=y
  93. NEED_SHA1=y
  94. OBJS += src/drivers/drivers.c
  95. L_CFLAGS += -DHOSTAPD
  96. ifdef CONFIG_WPA_TRACE
  97. L_CFLAGS += -DWPA_TRACE
  98. OBJS += src/utils/trace.c
  99. HOBJS += src/utils/trace.c
  100. LDFLAGS += -rdynamic
  101. L_CFLAGS += -funwind-tables
  102. ifdef CONFIG_WPA_TRACE_BFD
  103. L_CFLAGS += -DWPA_TRACE_BFD
  104. LIBS += -lbfd
  105. LIBS_c += -lbfd
  106. LIBS_h += -lbfd
  107. endif
  108. endif
  109. OBJS += src/utils/eloop.c
  110. ifdef CONFIG_ELOOP_POLL
  111. L_CFLAGS += -DCONFIG_ELOOP_POLL
  112. endif
  113. ifdef CONFIG_ELOOP_EPOLL
  114. L_CFLAGS += -DCONFIG_ELOOP_EPOLL
  115. endif
  116. OBJS += src/utils/common.c
  117. OBJS += src/utils/wpa_debug.c
  118. OBJS += src/utils/wpabuf.c
  119. OBJS += src/utils/os_$(CONFIG_OS).c
  120. OBJS += src/utils/ip_addr.c
  121. OBJS += src/common/ieee802_11_common.c
  122. OBJS += src/common/wpa_common.c
  123. OBJS += src/common/hw_features_common.c
  124. OBJS += src/eapol_auth/eapol_auth_sm.c
  125. ifndef CONFIG_NO_DUMP_STATE
  126. # define HOSTAPD_DUMP_STATE to include support for dumping internal state
  127. # through control interface commands (undefine it, if you want to save in
  128. # binary size)
  129. L_CFLAGS += -DHOSTAPD_DUMP_STATE
  130. OBJS += src/eapol_auth/eapol_auth_dump.c
  131. endif
  132. ifdef CONFIG_NO_RADIUS
  133. L_CFLAGS += -DCONFIG_NO_RADIUS
  134. CONFIG_NO_ACCOUNTING=y
  135. else
  136. OBJS += src/radius/radius.c
  137. OBJS += src/radius/radius_client.c
  138. OBJS += src/radius/radius_das.c
  139. endif
  140. ifdef CONFIG_NO_ACCOUNTING
  141. L_CFLAGS += -DCONFIG_NO_ACCOUNTING
  142. else
  143. OBJS += src/ap/accounting.c
  144. endif
  145. ifdef CONFIG_NO_VLAN
  146. L_CFLAGS += -DCONFIG_NO_VLAN
  147. else
  148. OBJS += src/ap/vlan_init.c
  149. OBJS += src/ap/vlan_ifconfig.c
  150. OBJS += src/ap/vlan.c
  151. ifdef CONFIG_FULL_DYNAMIC_VLAN
  152. # Define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
  153. # and VLAN interfaces for the VLAN feature.
  154. L_CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
  155. OBJS += src/ap/vlan_full.c
  156. ifdef CONFIG_VLAN_NETLINK
  157. OBJS += src/ap/vlan_util.c
  158. else
  159. OBJS += src/ap/vlan_ioctl.c
  160. endif
  161. endif
  162. endif
  163. ifdef CONFIG_NO_CTRL_IFACE
  164. L_CFLAGS += -DCONFIG_NO_CTRL_IFACE
  165. else
  166. OBJS += src/common/ctrl_iface_common.c
  167. OBJS += ctrl_iface.c
  168. OBJS += src/ap/ctrl_iface_ap.c
  169. endif
  170. L_CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
  171. ifdef CONFIG_IAPP
  172. L_CFLAGS += -DCONFIG_IAPP
  173. OBJS += src/ap/iapp.c
  174. endif
  175. ifdef CONFIG_RSN_PREAUTH
  176. L_CFLAGS += -DCONFIG_RSN_PREAUTH
  177. CONFIG_L2_PACKET=y
  178. endif
  179. ifdef CONFIG_PEERKEY
  180. L_CFLAGS += -DCONFIG_PEERKEY
  181. OBJS += src/ap/peerkey_auth.c
  182. endif
  183. ifdef CONFIG_HS20
  184. NEED_AES_OMAC1=y
  185. CONFIG_PROXYARP=y
  186. endif
  187. ifdef CONFIG_PROXYARP
  188. CONFIG_L2_PACKET=y
  189. endif
  190. ifdef CONFIG_SUITEB
  191. L_CFLAGS += -DCONFIG_SUITEB
  192. NEED_SHA256=y
  193. NEED_AES_OMAC1=y
  194. endif
  195. ifdef CONFIG_SUITEB192
  196. L_CFLAGS += -DCONFIG_SUITEB192
  197. NEED_SHA384=y
  198. endif
  199. ifdef CONFIG_IEEE80211W
  200. L_CFLAGS += -DCONFIG_IEEE80211W
  201. NEED_SHA256=y
  202. NEED_AES_OMAC1=y
  203. endif
  204. ifdef CONFIG_IEEE80211R
  205. L_CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP
  206. OBJS += src/ap/wpa_auth_ft.c
  207. NEED_SHA256=y
  208. NEED_AES_OMAC1=y
  209. NEED_AES_UNWRAP=y
  210. NEED_AES_SIV=y
  211. NEED_ETH_P_OUI=y
  212. NEED_SHA256=y
  213. NEED_HMAC_SHA256_KDF=y
  214. endif
  215. ifdef NEED_ETH_P_OUI
  216. L_CFLAGS += -DCONFIG_ETH_P_OUI
  217. OBJS += src/ap/eth_p_oui.c
  218. endif
  219. ifdef CONFIG_SAE
  220. L_CFLAGS += -DCONFIG_SAE
  221. OBJS += src/common/sae.c
  222. NEED_ECC=y
  223. NEED_DH_GROUPS=y
  224. endif
  225. ifdef CONFIG_OWE
  226. L_CFLAGS += -DCONFIG_OWE
  227. NEED_ECC=y
  228. NEED_HMAC_SHA256_KDF=y
  229. endif
  230. ifdef CONFIG_FILS
  231. L_CFLAGS += -DCONFIG_FILS
  232. OBJS += src/ap/fils_hlp.c
  233. NEED_SHA384=y
  234. NEED_AES_SIV=y
  235. ifdef CONFIG_FILS_SK_PFS
  236. L_CFLAGS += -DCONFIG_FILS_SK_PFS
  237. NEED_ECC=y
  238. endif
  239. endif
  240. ifdef CONFIG_WNM
  241. L_CFLAGS += -DCONFIG_WNM
  242. OBJS += src/ap/wnm_ap.c
  243. endif
  244. ifdef CONFIG_IEEE80211N
  245. L_CFLAGS += -DCONFIG_IEEE80211N
  246. endif
  247. ifdef CONFIG_IEEE80211AC
  248. L_CFLAGS += -DCONFIG_IEEE80211AC
  249. endif
  250. ifdef CONFIG_IEEE80211AX
  251. L_CFLAGS += -DCONFIG_IEEE80211AX
  252. endif
  253. ifdef CONFIG_MBO
  254. L_CFLAGS += -DCONFIG_MBO
  255. OBJS += src/ap/mbo_ap.c
  256. endif
  257. ifdef CONFIG_FST
  258. L_CFLAGS += -DCONFIG_FST
  259. OBJS += src/fst/fst.c
  260. OBJS += src/fst/fst_group.c
  261. OBJS += src/fst/fst_iface.c
  262. OBJS += src/fst/fst_session.c
  263. OBJS += src/fst/fst_ctrl_aux.c
  264. ifdef CONFIG_FST_TEST
  265. L_CFLAGS += -DCONFIG_FST_TEST
  266. endif
  267. ifndef CONFIG_NO_CTRL_IFACE
  268. OBJS += src/fst/fst_ctrl_iface.c
  269. endif
  270. endif
  271. include $(LOCAL_PATH)/src/drivers/drivers.mk
  272. OBJS += $(DRV_AP_OBJS)
  273. L_CFLAGS += $(DRV_AP_CFLAGS)
  274. LDFLAGS += $(DRV_AP_LDFLAGS)
  275. LIBS += $(DRV_AP_LIBS)
  276. ifdef CONFIG_L2_PACKET
  277. ifdef CONFIG_DNET_PCAP
  278. ifdef CONFIG_L2_FREEBSD
  279. LIBS += -lpcap
  280. OBJS += src/l2_packet/l2_packet_freebsd.c
  281. else
  282. LIBS += -ldnet -lpcap
  283. OBJS += src/l2_packet/l2_packet_pcap.c
  284. endif
  285. else
  286. OBJS += src/l2_packet/l2_packet_linux.c
  287. endif
  288. else
  289. OBJS += src/l2_packet/l2_packet_none.c
  290. endif
  291. ifdef CONFIG_EAP_MD5
  292. L_CFLAGS += -DEAP_SERVER_MD5
  293. OBJS += src/eap_server/eap_server_md5.c
  294. CHAP=y
  295. endif
  296. ifdef CONFIG_EAP_TLS
  297. L_CFLAGS += -DEAP_SERVER_TLS
  298. OBJS += src/eap_server/eap_server_tls.c
  299. TLS_FUNCS=y
  300. endif
  301. ifdef CONFIG_EAP_UNAUTH_TLS
  302. L_CFLAGS += -DEAP_SERVER_UNAUTH_TLS
  303. ifndef CONFIG_EAP_TLS
  304. OBJS += src/eap_server/eap_server_tls.c
  305. TLS_FUNCS=y
  306. endif
  307. endif
  308. ifdef CONFIG_EAP_PEAP
  309. L_CFLAGS += -DEAP_SERVER_PEAP
  310. OBJS += src/eap_server/eap_server_peap.c
  311. OBJS += src/eap_common/eap_peap_common.c
  312. TLS_FUNCS=y
  313. CONFIG_EAP_MSCHAPV2=y
  314. endif
  315. ifdef CONFIG_EAP_TTLS
  316. L_CFLAGS += -DEAP_SERVER_TTLS
  317. OBJS += src/eap_server/eap_server_ttls.c
  318. TLS_FUNCS=y
  319. CHAP=y
  320. endif
  321. ifdef CONFIG_EAP_MSCHAPV2
  322. L_CFLAGS += -DEAP_SERVER_MSCHAPV2
  323. OBJS += src/eap_server/eap_server_mschapv2.c
  324. MS_FUNCS=y
  325. endif
  326. ifdef CONFIG_EAP_GTC
  327. L_CFLAGS += -DEAP_SERVER_GTC
  328. OBJS += src/eap_server/eap_server_gtc.c
  329. endif
  330. ifdef CONFIG_EAP_SIM
  331. L_CFLAGS += -DEAP_SERVER_SIM
  332. OBJS += src/eap_server/eap_server_sim.c
  333. CONFIG_EAP_SIM_COMMON=y
  334. NEED_AES_CBC=y
  335. endif
  336. ifdef CONFIG_EAP_AKA
  337. L_CFLAGS += -DEAP_SERVER_AKA
  338. OBJS += src/eap_server/eap_server_aka.c
  339. CONFIG_EAP_SIM_COMMON=y
  340. NEED_SHA256=y
  341. NEED_AES_CBC=y
  342. endif
  343. ifdef CONFIG_EAP_AKA_PRIME
  344. L_CFLAGS += -DEAP_SERVER_AKA_PRIME
  345. endif
  346. ifdef CONFIG_EAP_SIM_COMMON
  347. OBJS += src/eap_common/eap_sim_common.c
  348. # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
  349. # replaced with another file implementating the interface specified in
  350. # eap_sim_db.h.
  351. OBJS += src/eap_server/eap_sim_db.c
  352. NEED_FIPS186_2_PRF=y
  353. endif
  354. ifdef CONFIG_EAP_PAX
  355. L_CFLAGS += -DEAP_SERVER_PAX
  356. OBJS += src/eap_server/eap_server_pax.c src/eap_common/eap_pax_common.c
  357. endif
  358. ifdef CONFIG_EAP_PSK
  359. L_CFLAGS += -DEAP_SERVER_PSK
  360. OBJS += src/eap_server/eap_server_psk.c src/eap_common/eap_psk_common.c
  361. NEED_AES_OMAC1=y
  362. NEED_AES_ENCBLOCK=y
  363. NEED_AES_EAX=y
  364. endif
  365. ifdef CONFIG_EAP_SAKE
  366. L_CFLAGS += -DEAP_SERVER_SAKE
  367. OBJS += src/eap_server/eap_server_sake.c src/eap_common/eap_sake_common.c
  368. endif
  369. ifdef CONFIG_EAP_GPSK
  370. L_CFLAGS += -DEAP_SERVER_GPSK
  371. OBJS += src/eap_server/eap_server_gpsk.c src/eap_common/eap_gpsk_common.c
  372. ifdef CONFIG_EAP_GPSK_SHA256
  373. L_CFLAGS += -DEAP_GPSK_SHA256
  374. endif
  375. NEED_SHA256=y
  376. NEED_AES_OMAC1=y
  377. endif
  378. ifdef CONFIG_EAP_PWD
  379. L_CFLAGS += -DEAP_SERVER_PWD
  380. OBJS += src/eap_server/eap_server_pwd.c src/eap_common/eap_pwd_common.c
  381. NEED_SHA256=y
  382. endif
  383. ifdef CONFIG_EAP_EKE
  384. L_CFLAGS += -DEAP_SERVER_EKE
  385. OBJS += src/eap_server/eap_server_eke.c src/eap_common/eap_eke_common.c
  386. NEED_DH_GROUPS=y
  387. NEED_DH_GROUPS_ALL=y
  388. endif
  389. ifdef CONFIG_EAP_VENDOR_TEST
  390. L_CFLAGS += -DEAP_SERVER_VENDOR_TEST
  391. OBJS += src/eap_server/eap_server_vendor_test.c
  392. endif
  393. ifdef CONFIG_EAP_FAST
  394. L_CFLAGS += -DEAP_SERVER_FAST
  395. OBJS += src/eap_server/eap_server_fast.c
  396. OBJS += src/eap_common/eap_fast_common.c
  397. TLS_FUNCS=y
  398. NEED_T_PRF=y
  399. NEED_AES_UNWRAP=y
  400. endif
  401. ifdef CONFIG_WPS
  402. L_CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
  403. OBJS += src/utils/uuid.c
  404. OBJS += src/ap/wps_hostapd.c
  405. OBJS += src/eap_server/eap_server_wsc.c src/eap_common/eap_wsc_common.c
  406. OBJS += src/wps/wps.c
  407. OBJS += src/wps/wps_common.c
  408. OBJS += src/wps/wps_attr_parse.c
  409. OBJS += src/wps/wps_attr_build.c
  410. OBJS += src/wps/wps_attr_process.c
  411. OBJS += src/wps/wps_dev_attr.c
  412. OBJS += src/wps/wps_enrollee.c
  413. OBJS += src/wps/wps_registrar.c
  414. NEED_DH_GROUPS=y
  415. NEED_SHA256=y
  416. NEED_BASE64=y
  417. NEED_AES_CBC=y
  418. NEED_MODEXP=y
  419. CONFIG_EAP=y
  420. ifdef CONFIG_WPS_NFC
  421. L_CFLAGS += -DCONFIG_WPS_NFC
  422. OBJS += src/wps/ndef.c
  423. NEED_WPS_OOB=y
  424. endif
  425. ifdef NEED_WPS_OOB
  426. L_CFLAGS += -DCONFIG_WPS_OOB
  427. endif
  428. ifdef CONFIG_WPS_UPNP
  429. L_CFLAGS += -DCONFIG_WPS_UPNP
  430. OBJS += src/wps/wps_upnp.c
  431. OBJS += src/wps/wps_upnp_ssdp.c
  432. OBJS += src/wps/wps_upnp_web.c
  433. OBJS += src/wps/wps_upnp_event.c
  434. OBJS += src/wps/wps_upnp_ap.c
  435. OBJS += src/wps/upnp_xml.c
  436. OBJS += src/wps/httpread.c
  437. OBJS += src/wps/http_client.c
  438. OBJS += src/wps/http_server.c
  439. endif
  440. ifdef CONFIG_WPS_STRICT
  441. L_CFLAGS += -DCONFIG_WPS_STRICT
  442. OBJS += src/wps/wps_validate.c
  443. endif
  444. ifdef CONFIG_WPS_TESTING
  445. L_CFLAGS += -DCONFIG_WPS_TESTING
  446. endif
  447. endif
  448. ifdef CONFIG_DPP
  449. L_CFLAGS += -DCONFIG_DPP
  450. OBJS += src/common/dpp.c
  451. OBJS += src/ap/dpp_hostapd.c
  452. OBJS += src/ap/gas_query_ap.c
  453. NEED_AES_SIV=y
  454. NEED_HMAC_SHA256_KDF=y
  455. NEED_HMAC_SHA384_KDF=y
  456. NEED_HMAC_SHA512_KDF=y
  457. NEED_SHA256=y
  458. NEED_SHA384=y
  459. NEED_SHA512=y
  460. NEED_JSON=y
  461. NEED_GAS=y
  462. endif
  463. ifdef CONFIG_EAP_IKEV2
  464. L_CFLAGS += -DEAP_SERVER_IKEV2
  465. OBJS += src/eap_server/eap_server_ikev2.c src/eap_server/ikev2.c
  466. OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  467. NEED_DH_GROUPS=y
  468. NEED_DH_GROUPS_ALL=y
  469. NEED_MODEXP=y
  470. NEED_CIPHER=y
  471. endif
  472. ifdef CONFIG_EAP_TNC
  473. L_CFLAGS += -DEAP_SERVER_TNC
  474. OBJS += src/eap_server/eap_server_tnc.c
  475. OBJS += src/eap_server/tncs.c
  476. NEED_BASE64=y
  477. ifndef CONFIG_DRIVER_BSD
  478. LIBS += -ldl
  479. endif
  480. endif
  481. # Basic EAP functionality is needed for EAPOL
  482. OBJS += eap_register.c
  483. OBJS += src/eap_server/eap_server.c
  484. OBJS += src/eap_common/eap_common.c
  485. OBJS += src/eap_server/eap_server_methods.c
  486. OBJS += src/eap_server/eap_server_identity.c
  487. L_CFLAGS += -DEAP_SERVER_IDENTITY
  488. ifdef CONFIG_EAP
  489. L_CFLAGS += -DEAP_SERVER
  490. endif
  491. ifdef CONFIG_PKCS12
  492. L_CFLAGS += -DPKCS12_FUNCS
  493. endif
  494. ifdef MS_FUNCS
  495. OBJS += src/crypto/ms_funcs.c
  496. NEED_DES=y
  497. NEED_MD4=y
  498. endif
  499. ifdef CHAP
  500. OBJS += src/eap_common/chap.c
  501. endif
  502. ifdef TLS_FUNCS
  503. NEED_DES=y
  504. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
  505. L_CFLAGS += -DEAP_TLS_FUNCS
  506. OBJS += src/eap_server/eap_server_tls_common.c
  507. NEED_TLS_PRF=y
  508. endif
  509. ifndef CONFIG_TLS
  510. CONFIG_TLS=openssl
  511. endif
  512. ifdef CONFIG_TLSV11
  513. L_CFLAGS += -DCONFIG_TLSV11
  514. endif
  515. ifdef CONFIG_TLSV12
  516. L_CFLAGS += -DCONFIG_TLSV12
  517. NEED_SHA256=y
  518. endif
  519. ifeq ($(CONFIG_TLS), openssl)
  520. ifdef TLS_FUNCS
  521. OBJS += src/crypto/tls_openssl.c
  522. OBJS += src/crypto/tls_openssl_ocsp.c
  523. LIBS += -lssl
  524. endif
  525. OBJS += src/crypto/crypto_openssl.c
  526. HOBJS += src/crypto/crypto_openssl.c
  527. ifdef NEED_FIPS186_2_PRF
  528. OBJS += src/crypto/fips_prf_openssl.c
  529. endif
  530. NEED_SHA256=y
  531. NEED_TLS_PRF_SHA256=y
  532. LIBS += -lcrypto
  533. LIBS_h += -lcrypto
  534. ifndef CONFIG_TLS_DEFAULT_CIPHERS
  535. CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW"
  536. endif
  537. L_CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
  538. endif
  539. ifeq ($(CONFIG_TLS), gnutls)
  540. ifdef TLS_FUNCS
  541. OBJS += src/crypto/tls_gnutls.c
  542. LIBS += -lgnutls -lgpg-error
  543. endif
  544. OBJS += src/crypto/crypto_gnutls.c
  545. HOBJS += src/crypto/crypto_gnutls.c
  546. ifdef NEED_FIPS186_2_PRF
  547. OBJS += src/crypto/fips_prf_internal.c
  548. OBJS += src/crypto/sha1-internal.c
  549. endif
  550. LIBS += -lgcrypt
  551. LIBS_h += -lgcrypt
  552. CONFIG_INTERNAL_SHA256=y
  553. CONFIG_INTERNAL_RC4=y
  554. CONFIG_INTERNAL_DH_GROUP5=y
  555. endif
  556. ifeq ($(CONFIG_TLS), internal)
  557. ifndef CONFIG_CRYPTO
  558. CONFIG_CRYPTO=internal
  559. endif
  560. ifdef TLS_FUNCS
  561. OBJS += src/crypto/crypto_internal-rsa.c
  562. OBJS += src/crypto/tls_internal.c
  563. OBJS += src/tls/tlsv1_common.c
  564. OBJS += src/tls/tlsv1_record.c
  565. OBJS += src/tls/tlsv1_cred.c
  566. OBJS += src/tls/tlsv1_server.c
  567. OBJS += src/tls/tlsv1_server_write.c
  568. OBJS += src/tls/tlsv1_server_read.c
  569. OBJS += src/tls/asn1.c
  570. OBJS += src/tls/rsa.c
  571. OBJS += src/tls/x509v3.c
  572. OBJS += src/tls/pkcs1.c
  573. OBJS += src/tls/pkcs5.c
  574. OBJS += src/tls/pkcs8.c
  575. NEED_SHA256=y
  576. NEED_BASE64=y
  577. NEED_TLS_PRF=y
  578. ifdef CONFIG_TLSV12
  579. NEED_TLS_PRF_SHA256=y
  580. endif
  581. NEED_MODEXP=y
  582. NEED_CIPHER=y
  583. L_CFLAGS += -DCONFIG_TLS_INTERNAL
  584. L_CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  585. endif
  586. ifdef NEED_CIPHER
  587. NEED_DES=y
  588. OBJS += src/crypto/crypto_internal-cipher.c
  589. endif
  590. ifdef NEED_MODEXP
  591. OBJS += src/crypto/crypto_internal-modexp.c
  592. OBJS += src/tls/bignum.c
  593. endif
  594. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  595. OBJS += src/crypto/crypto_libtomcrypt.c
  596. LIBS += -ltomcrypt -ltfm
  597. LIBS_h += -ltomcrypt -ltfm
  598. CONFIG_INTERNAL_SHA256=y
  599. CONFIG_INTERNAL_RC4=y
  600. CONFIG_INTERNAL_DH_GROUP5=y
  601. endif
  602. ifeq ($(CONFIG_CRYPTO), internal)
  603. OBJS += src/crypto/crypto_internal.c
  604. NEED_AES_DEC=y
  605. L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  606. ifdef CONFIG_INTERNAL_LIBTOMMATH
  607. L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  608. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  609. L_CFLAGS += -DLTM_FAST
  610. endif
  611. else
  612. LIBS += -ltommath
  613. LIBS_h += -ltommath
  614. endif
  615. CONFIG_INTERNAL_AES=y
  616. CONFIG_INTERNAL_DES=y
  617. CONFIG_INTERNAL_SHA1=y
  618. CONFIG_INTERNAL_MD4=y
  619. CONFIG_INTERNAL_MD5=y
  620. CONFIG_INTERNAL_SHA256=y
  621. CONFIG_INTERNAL_SHA384=y
  622. CONFIG_INTERNAL_SHA512=y
  623. CONFIG_INTERNAL_RC4=y
  624. CONFIG_INTERNAL_DH_GROUP5=y
  625. endif
  626. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  627. OBJS += src/crypto/crypto_cryptoapi.c
  628. OBJS_p += src/crypto/crypto_cryptoapi.c
  629. L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  630. CONFIG_INTERNAL_SHA256=y
  631. CONFIG_INTERNAL_RC4=y
  632. endif
  633. endif
  634. ifeq ($(CONFIG_TLS), none)
  635. ifdef TLS_FUNCS
  636. OBJS += src/crypto/tls_none.c
  637. L_CFLAGS += -DEAP_TLS_NONE
  638. CONFIG_INTERNAL_AES=y
  639. CONFIG_INTERNAL_SHA1=y
  640. CONFIG_INTERNAL_MD5=y
  641. endif
  642. OBJS += src/crypto/crypto_none.c
  643. OBJS_p += src/crypto/crypto_none.c
  644. CONFIG_INTERNAL_SHA256=y
  645. CONFIG_INTERNAL_RC4=y
  646. endif
  647. ifndef TLS_FUNCS
  648. OBJS += src/crypto/tls_none.c
  649. ifeq ($(CONFIG_TLS), internal)
  650. CONFIG_INTERNAL_AES=y
  651. CONFIG_INTERNAL_SHA1=y
  652. CONFIG_INTERNAL_MD5=y
  653. CONFIG_INTERNAL_RC4=y
  654. endif
  655. endif
  656. AESOBJS = # none so far
  657. ifdef CONFIG_INTERNAL_AES
  658. AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-enc.c
  659. endif
  660. ifneq ($(CONFIG_TLS), openssl)
  661. AESOBJS += src/crypto/aes-wrap.c
  662. endif
  663. ifdef NEED_AES_EAX
  664. AESOBJS += src/crypto/aes-eax.c
  665. NEED_AES_CTR=y
  666. NEED_AES_OMAC1=y
  667. endif
  668. ifdef NEED_AES_SIV
  669. AESOBJS += src/crypto/aes-siv.c
  670. NEED_AES_CTR=y
  671. NEED_AES_OMAC1=y
  672. endif
  673. ifdef NEED_AES_CTR
  674. AESOBJS += src/crypto/aes-ctr.c
  675. endif
  676. ifdef NEED_AES_ENCBLOCK
  677. AESOBJS += src/crypto/aes-encblock.c
  678. endif
  679. ifdef NEED_AES_OMAC1
  680. AESOBJS += src/crypto/aes-omac1.c
  681. endif
  682. ifdef NEED_AES_UNWRAP
  683. ifneq ($(CONFIG_TLS), openssl)
  684. NEED_AES_DEC=y
  685. AESOBJS += src/crypto/aes-unwrap.c
  686. endif
  687. endif
  688. ifdef NEED_AES_CBC
  689. NEED_AES_DEC=y
  690. ifneq ($(CONFIG_TLS), openssl)
  691. AESOBJS += src/crypto/aes-cbc.c
  692. endif
  693. endif
  694. ifdef NEED_AES_DEC
  695. ifdef CONFIG_INTERNAL_AES
  696. AESOBJS += src/crypto/aes-internal-dec.c
  697. endif
  698. endif
  699. ifdef NEED_AES
  700. OBJS += $(AESOBJS)
  701. endif
  702. SHA1OBJS =
  703. ifdef NEED_SHA1
  704. ifneq ($(CONFIG_TLS), openssl)
  705. SHA1OBJS += src/crypto/sha1.c
  706. endif
  707. SHA1OBJS += src/crypto/sha1-prf.c
  708. ifdef CONFIG_INTERNAL_SHA1
  709. SHA1OBJS += src/crypto/sha1-internal.c
  710. ifdef NEED_FIPS186_2_PRF
  711. SHA1OBJS += src/crypto/fips_prf_internal.c
  712. endif
  713. endif
  714. ifneq ($(CONFIG_TLS), openssl)
  715. SHA1OBJS += src/crypto/sha1-pbkdf2.c
  716. endif
  717. ifdef NEED_T_PRF
  718. SHA1OBJS += src/crypto/sha1-tprf.c
  719. endif
  720. ifdef NEED_TLS_PRF
  721. SHA1OBJS += src/crypto/sha1-tlsprf.c
  722. endif
  723. endif
  724. ifdef NEED_SHA1
  725. OBJS += $(SHA1OBJS)
  726. endif
  727. ifneq ($(CONFIG_TLS), openssl)
  728. OBJS += src/crypto/md5.c
  729. endif
  730. ifdef NEED_MD5
  731. ifdef CONFIG_INTERNAL_MD5
  732. OBJS += src/crypto/md5-internal.c
  733. HOBJS += src/crypto/md5-internal.c
  734. endif
  735. endif
  736. ifdef NEED_MD4
  737. ifdef CONFIG_INTERNAL_MD4
  738. OBJS += src/crypto/md4-internal.c
  739. endif
  740. endif
  741. ifdef NEED_DES
  742. ifdef CONFIG_INTERNAL_DES
  743. OBJS += src/crypto/des-internal.c
  744. endif
  745. endif
  746. ifdef CONFIG_NO_RC4
  747. L_CFLAGS += -DCONFIG_NO_RC4
  748. endif
  749. ifdef NEED_RC4
  750. ifdef CONFIG_INTERNAL_RC4
  751. ifndef CONFIG_NO_RC4
  752. OBJS += src/crypto/rc4.c
  753. endif
  754. endif
  755. endif
  756. ifdef NEED_SHA256
  757. L_CFLAGS += -DCONFIG_SHA256
  758. ifneq ($(CONFIG_TLS), openssl)
  759. OBJS += src/crypto/sha256.c
  760. endif
  761. OBJS += src/crypto/sha256-prf.c
  762. ifdef CONFIG_INTERNAL_SHA256
  763. OBJS += src/crypto/sha256-internal.c
  764. endif
  765. ifdef NEED_TLS_PRF_SHA256
  766. OBJS += src/crypto/sha256-tlsprf.c
  767. endif
  768. ifdef NEED_HMAC_SHA256_KDF
  769. OBJS += src/crypto/sha256-kdf.c
  770. endif
  771. ifdef NEED_HMAC_SHA384_KDF
  772. OBJS += src/crypto/sha384-kdf.c
  773. endif
  774. ifdef NEED_HMAC_SHA512_KDF
  775. OBJS += src/crypto/sha512-kdf.c
  776. endif
  777. endif
  778. ifdef NEED_SHA384
  779. L_CFLAGS += -DCONFIG_SHA384
  780. ifneq ($(CONFIG_TLS), openssl)
  781. OBJS += src/crypto/sha384.c
  782. endif
  783. OBJS += src/crypto/sha384-prf.c
  784. endif
  785. ifdef NEED_SHA512
  786. L_CFLAGS += -DCONFIG_SHA512
  787. ifneq ($(CONFIG_TLS), openssl)
  788. ifneq ($(CONFIG_TLS), linux)
  789. OBJS += src/crypto/sha512.c
  790. endif
  791. endif
  792. OBJS += src/crypto/sha512-prf.c
  793. endif
  794. ifdef CONFIG_INTERNAL_SHA384
  795. L_CFLAGS += -DCONFIG_INTERNAL_SHA384
  796. OBJS += src/crypto/sha384-internal.c
  797. endif
  798. ifdef CONFIG_INTERNAL_SHA512
  799. L_CFLAGS += -DCONFIG_INTERNAL_SHA512
  800. OBJS += src/crypto/sha512-internal.c
  801. endif
  802. ifdef NEED_DH_GROUPS
  803. OBJS += src/crypto/dh_groups.c
  804. endif
  805. ifdef NEED_DH_GROUPS_ALL
  806. L_CFLAGS += -DALL_DH_GROUPS
  807. endif
  808. ifdef CONFIG_INTERNAL_DH_GROUP5
  809. ifdef NEED_DH_GROUPS
  810. OBJS += src/crypto/dh_group5.c
  811. endif
  812. endif
  813. ifdef NEED_ECC
  814. L_CFLAGS += -DCONFIG_ECC
  815. endif
  816. ifdef CONFIG_NO_RANDOM_POOL
  817. L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
  818. else
  819. OBJS += src/crypto/random.c
  820. HOBJS += src/crypto/random.c
  821. HOBJS += src/utils/eloop.c
  822. HOBJS += $(SHA1OBJS)
  823. ifneq ($(CONFIG_TLS), openssl)
  824. HOBJS += src/crypto/md5.c
  825. endif
  826. endif
  827. ifdef CONFIG_RADIUS_SERVER
  828. L_CFLAGS += -DRADIUS_SERVER
  829. OBJS += src/radius/radius_server.c
  830. endif
  831. ifdef CONFIG_IPV6
  832. L_CFLAGS += -DCONFIG_IPV6
  833. endif
  834. ifdef CONFIG_DRIVER_RADIUS_ACL
  835. L_CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
  836. endif
  837. ifdef NEED_BASE64
  838. OBJS += src/utils/base64.c
  839. endif
  840. ifdef NEED_JSON
  841. OBJS += src/utils/json.c
  842. L_CFLAGS += -DCONFIG_JSON
  843. endif
  844. ifdef NEED_AP_MLME
  845. OBJS += src/ap/wmm.c
  846. OBJS += src/ap/ap_list.c
  847. OBJS += src/ap/ieee802_11.c
  848. OBJS += src/ap/hw_features.c
  849. OBJS += src/ap/dfs.c
  850. L_CFLAGS += -DNEED_AP_MLME
  851. endif
  852. ifdef CONFIG_IEEE80211N
  853. OBJS += src/ap/ieee802_11_ht.c
  854. endif
  855. ifdef CONFIG_IEEE80211AC
  856. OBJS += src/ap/ieee802_11_vht.c
  857. endif
  858. ifdef CONFIG_IEEE80211AX
  859. OBJS += src/ap/ieee802_11_he.c
  860. endif
  861. ifdef CONFIG_P2P_MANAGER
  862. L_CFLAGS += -DCONFIG_P2P_MANAGER
  863. OBJS += src/ap/p2p_hostapd.c
  864. endif
  865. ifdef CONFIG_HS20
  866. L_CFLAGS += -DCONFIG_HS20
  867. OBJS += src/ap/hs20.c
  868. CONFIG_INTERWORKING=y
  869. endif
  870. ifdef CONFIG_INTERWORKING
  871. L_CFLAGS += -DCONFIG_INTERWORKING
  872. NEED_GAS=y
  873. endif
  874. ifdef NEED_GAS
  875. OBJS += src/common/gas.c
  876. OBJS += src/ap/gas_serv.c
  877. endif
  878. ifdef CONFIG_PROXYARP
  879. L_CFLAGS += -DCONFIG_PROXYARP
  880. OBJS += src/ap/x_snoop.c
  881. OBJS += src/ap/dhcp_snoop.c
  882. ifdef CONFIG_IPV6
  883. OBJS += src/ap/ndisc_snoop.c
  884. endif
  885. endif
  886. OBJS += src/drivers/driver_common.c
  887. ifdef CONFIG_ACS
  888. L_CFLAGS += -DCONFIG_ACS
  889. OBJS += src/ap/acs.c
  890. LIBS += -lm
  891. endif
  892. ifdef CONFIG_NO_STDOUT_DEBUG
  893. L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  894. endif
  895. ifdef CONFIG_DEBUG_SYSLOG
  896. L_CFLAGS += -DCONFIG_DEBUG_SYSLOG
  897. endif
  898. ifdef CONFIG_DEBUG_LINUX_TRACING
  899. L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
  900. endif
  901. ifdef CONFIG_DEBUG_FILE
  902. L_CFLAGS += -DCONFIG_DEBUG_FILE
  903. endif
  904. ifdef CONFIG_ANDROID_LOG
  905. L_CFLAGS += -DCONFIG_ANDROID_LOG
  906. endif
  907. OBJS_c = hostapd_cli.c
  908. OBJS_c += src/common/wpa_ctrl.c
  909. OBJS_c += src/utils/os_$(CONFIG_OS).c
  910. OBJS_c += src/common/cli.c
  911. OBJS_c += src/utils/eloop.c
  912. OBJS_c += src/utils/common.c
  913. ifdef CONFIG_WPA_TRACE
  914. OBJS_c += src/utils/trace.c
  915. endif
  916. OBJS_c += src/utils/wpa_debug.c
  917. ifdef CONFIG_WPA_CLI_EDIT
  918. OBJS_c += src/utils/edit.c
  919. else
  920. OBJS_c += src/utils/edit_simple.c
  921. endif
  922. ########################
  923. include $(CLEAR_VARS)
  924. LOCAL_MODULE := hostapd_cli
  925. LOCAL_MODULE_TAGS := debug
  926. LOCAL_SHARED_LIBRARIES := libc libcutils liblog
  927. LOCAL_CFLAGS := $(L_CFLAGS)
  928. LOCAL_SRC_FILES := $(OBJS_c)
  929. LOCAL_C_INCLUDES := $(INCLUDES)
  930. include $(BUILD_EXECUTABLE)
  931. ########################
  932. include $(CLEAR_VARS)
  933. LOCAL_MODULE := hostapd
  934. LOCAL_MODULE_TAGS := optional
  935. ifdef CONFIG_DRIVER_CUSTOM
  936. LOCAL_STATIC_LIBRARIES := libCustomWifi
  937. endif
  938. ifneq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
  939. LOCAL_STATIC_LIBRARIES += $(BOARD_HOSTAPD_PRIVATE_LIB)
  940. endif
  941. LOCAL_SHARED_LIBRARIES := libc libcutils liblog libcrypto libssl
  942. ifdef CONFIG_DRIVER_NL80211
  943. ifneq ($(wildcard external/libnl),)
  944. LOCAL_SHARED_LIBRARIES += libnl
  945. else
  946. LOCAL_STATIC_LIBRARIES += libnl_2
  947. endif
  948. endif
  949. LOCAL_CFLAGS := $(L_CFLAGS)
  950. LOCAL_SRC_FILES := $(OBJS)
  951. LOCAL_C_INCLUDES := $(INCLUDES)
  952. LOCAL_INIT_RC := hostapd.android.rc
  953. include $(BUILD_EXECUTABLE)
  954. endif # ifeq ($(WPA_BUILD_HOSTAPD),true)