• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#Copyright (c) 2021-2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15
16WPA_ROOT_DIR = "//third_party/wpa_supplicant/wpa_supplicant-2.9_standard"
17
18declare_args() {
19  wpa_supplicant_driver_nl80211_hisi = false
20  wpa_supplicant_driver_nl80211 = false
21  wpa_supplicant_ohos_certmgr = true
22}
23
24if (wpa_supplicant_driver_nl80211_hisi) {
25  CONFIG_HISI = "true"
26} else {
27  CONFIG_HISI = "false"
28}
29if (wpa_supplicant_driver_nl80211) {
30  CONFIG_DRIVER = "nl80211"
31} else {
32  CONFIG_DRIVER = "hdf"
33}
34
35CONFIG_OS = "unix"
36CONFIG_ELOOP = "eloop"
37if ("${CONFIG_DRIVER}" == "nl80211") {
38  CONFIG_L2_PACKET = "linux"
39} else {
40  CONFIG_L2_PACKET = "rtos"
41}
42CONFIG_CTRL_IFACE = "udp"
43CONFIG_MAIN = "main"
44
45config("wpa_warnings") {
46  cflags = [ "-Wno-error=sign-compare" ]
47  ldflags = [
48    "-flto",
49    "-fsanitize=cfi",
50    "-Wl,-plugin-opt,O1",
51  ]
52}
53
54ohos_shared_library("wpa_client") {
55  sanitize = {
56    cfi = true
57    debug = false
58    blocklist = "./wpa_blocklist.txt"
59  }
60
61  output_name = "wpa_client"
62  sources = [
63    "$WPA_ROOT_DIR/src/common/wpa_ctrl.c",
64    "$WPA_ROOT_DIR/src/utils/common.c",
65    "$WPA_ROOT_DIR/src/utils/os_${CONFIG_OS}.c",
66    "$WPA_ROOT_DIR/src/utils/wpa_debug.c",
67  ]
68
69  include_dirs = [
70    "$WPA_ROOT_DIR/src",
71    "$WPA_ROOT_DIR/src/utils",
72    "$WPA_ROOT_DIR/src/drivers",
73    "$WPA_ROOT_DIR/wpa_supplicant",
74    "$WPA_ROOT_DIR/build/include",
75    "//drivers/peripheral/wlan/client/include",
76    "//third_party/bounds_checking_function/include",
77    "//base/hiviewdfxhilog/interfaces/native/innerkits/include",
78    "//base/startup/init/interfaces/innerkits/include/syspara",
79  ]
80
81  cflags = [
82    "-UANDROID",
83    "-fsigned-char",
84    "-DCONFIG_IEEE80211W",
85    "-DCONFIG_NO_VLAN",
86    "-DCONFIG_NO_RADIUS",
87    "-DCONFIG_NO_RANDOM_POOL",
88    "-DCONFIG_SHA256",
89    "-DCONFIG_CRYPTO_INTERNAL",
90    "-DCONFIG_INTERNAL_LIBTOMMATH",
91    "-DCONFIG_INTERNAL_SHA384",
92    "-DCONFIG_INTERNAL_SHA512",
93    "-DCONFIG_CTRL_IFACE",
94    "-DCONFIG_CTRL_IFACE_UDP",
95    "-DCONFIG_IBSS_RSN",
96    "-DIEEE8021X_EAPOL",
97    "-DCONFIG_BACEND_FILE",
98    "-DCONFIG_NO_CONFIG_BLOBS",
99    "-DUSERSPACE_CLIENT_SUPPORT",
100    "-DCONFIG_DEBUG_FILE",
101    "-DCONFIG_OPEN_HARMONY_PATCH",
102  ]
103
104  deps = [
105    "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog",
106    "//base/startup/init/interfaces/innerkits:libbegetutil",
107  ]
108
109  if ("${CONFIG_DRIVER}" == "nl80211") {
110    include_dirs += [ "$WPA_ROOT_DIR/libnl/include/libnl3" ]
111    cflags += [
112      "-DCONFIG_DRIVER_NL80211",
113      "-DCONFIG_LIBNL32",
114    ]
115  } else {
116    cflags += [
117      "-DCONFIG_DRIVER_HDF",
118      "-DCONFIG_OHOS_P2P",
119    ]
120  }
121  configs = [ ":wpa_warnings" ]
122  part_name = "wpa_supplicant-2.9"
123  subsystem_name = "wpa_supplicant-2.9"
124}
125
126ohos_shared_library("wpa") {
127  sanitize = {
128    cfi = true
129    debug = false
130    blocklist = "./wpa_blocklist.txt"
131  }
132  output_name = "wpa"
133  sources = [
134    # wpa & hostapd
135    "$WPA_ROOT_DIR/hostapd/ap_config_file.c",
136    "$WPA_ROOT_DIR/hostapd/ap_ctrl_iface.c",
137    "$WPA_ROOT_DIR/hostapd/ap_eap_register.c",
138
139    # hostapd
140    "$WPA_ROOT_DIR/hostapd/ap_main.c",
141    "$WPA_ROOT_DIR/src/ap/ap_config.c",
142    "$WPA_ROOT_DIR/src/ap/ap_drv_ops.c",
143    "$WPA_ROOT_DIR/src/ap/ap_list.c",
144    "$WPA_ROOT_DIR/src/ap/ap_mlme.c",
145    "$WPA_ROOT_DIR/src/ap/ap_rrm.c",
146    "$WPA_ROOT_DIR/src/ap/authsrv.c",
147    "$WPA_ROOT_DIR/src/ap/beacon.c",
148    "$WPA_ROOT_DIR/src/ap/bss_load.c",
149    "$WPA_ROOT_DIR/src/ap/ctrl_iface_ap.c",
150    "$WPA_ROOT_DIR/src/ap/dfs.c",
151    "$WPA_ROOT_DIR/src/ap/drv_callbacks.c",
152    "$WPA_ROOT_DIR/src/ap/eap_user_db.c",
153    "$WPA_ROOT_DIR/src/ap/hostapd.c",
154    "$WPA_ROOT_DIR/src/ap/hw_features.c",
155    "$WPA_ROOT_DIR/src/ap/ieee802_11.c",
156    "$WPA_ROOT_DIR/src/ap/ieee802_11_auth.c",
157    "$WPA_ROOT_DIR/src/ap/ieee802_11_ht.c",
158    "$WPA_ROOT_DIR/src/ap/ieee802_11_shared.c",
159    "$WPA_ROOT_DIR/src/ap/ieee802_1x.c",
160    "$WPA_ROOT_DIR/src/ap/neighbor_db.c",
161    "$WPA_ROOT_DIR/src/ap/pmksa_cache_auth.c",
162    "$WPA_ROOT_DIR/src/ap/preauth_auth.c",
163    "$WPA_ROOT_DIR/src/ap/sta_info.c",
164    "$WPA_ROOT_DIR/src/ap/tkip_countermeasures.c",
165    "$WPA_ROOT_DIR/src/ap/utils.c",
166    "$WPA_ROOT_DIR/src/ap/wmm.c",
167    "$WPA_ROOT_DIR/src/ap/wpa_auth.c",
168    "$WPA_ROOT_DIR/src/ap/wpa_auth_glue.c",
169    "$WPA_ROOT_DIR/src/ap/wpa_auth_ie.c",
170    "$WPA_ROOT_DIR/src/common/ctrl_iface_common.c",
171    "$WPA_ROOT_DIR/src/common/hw_features_common.c",
172    "$WPA_ROOT_DIR/src/common/ieee802_11_common.c",
173    "$WPA_ROOT_DIR/src/common/wpa_common.c",
174    "$WPA_ROOT_DIR/src/crypto/aes-internal.c",
175    "$WPA_ROOT_DIR/src/crypto/aes-omac1.c",
176    "$WPA_ROOT_DIR/src/crypto/sha1-prf.c",
177    "$WPA_ROOT_DIR/src/crypto/sha256-prf.c",
178    "$WPA_ROOT_DIR/src/drivers/driver_common.c",
179    "$WPA_ROOT_DIR/src/drivers/drivers.c",
180    "$WPA_ROOT_DIR/src/eap_common/eap_common.c",
181    "$WPA_ROOT_DIR/src/eap_peer/eap.c",
182    "$WPA_ROOT_DIR/src/eap_peer/eap_methods.c",
183    "$WPA_ROOT_DIR/src/eap_server/eap_server.c",
184    "$WPA_ROOT_DIR/src/eap_server/eap_server_identity.c",
185    "$WPA_ROOT_DIR/src/eap_server/eap_server_methods.c",
186    "$WPA_ROOT_DIR/src/eapol_auth/eapol_auth_sm.c",
187    "$WPA_ROOT_DIR/src/eapol_supp/eapol_supp_sm.c",
188    "$WPA_ROOT_DIR/src/l2_packet/l2_packet_${CONFIG_L2_PACKET}.c",
189    "$WPA_ROOT_DIR/src/rsn_supp/pmksa_cache.c",
190    "$WPA_ROOT_DIR/src/rsn_supp/preauth.c",
191    "$WPA_ROOT_DIR/src/rsn_supp/wpa.c",
192    "$WPA_ROOT_DIR/src/rsn_supp/wpa_i.h",
193    "$WPA_ROOT_DIR/src/rsn_supp/wpa_ie.c",
194    "$WPA_ROOT_DIR/src/utils/${CONFIG_ELOOP}.c",
195    "$WPA_ROOT_DIR/src/utils/bitfield.c",
196    "$WPA_ROOT_DIR/src/utils/common.c",
197    "$WPA_ROOT_DIR/src/utils/ip_addr.c",
198    "$WPA_ROOT_DIR/src/utils/os_${CONFIG_OS}.c",
199    "$WPA_ROOT_DIR/src/utils/radiotap.c",
200    "$WPA_ROOT_DIR/src/utils/wpa_debug.c",
201    "$WPA_ROOT_DIR/src/utils/wpabuf.c",
202    "$WPA_ROOT_DIR/wpa_supplicant/${CONFIG_MAIN}.c",
203    "$WPA_ROOT_DIR/wpa_supplicant/bss.c",
204    "$WPA_ROOT_DIR/wpa_supplicant/bssid_ignore.c",
205
206    # wpa_supplicant
207    "$WPA_ROOT_DIR/wpa_supplicant/config.c",
208    "$WPA_ROOT_DIR/wpa_supplicant/config_file.c",
209    "$WPA_ROOT_DIR/wpa_supplicant/ctrl_iface.c",
210    "$WPA_ROOT_DIR/wpa_supplicant/ctrl_iface_${CONFIG_CTRL_IFACE}.c",
211    "$WPA_ROOT_DIR/wpa_supplicant/eap_register.c",
212    "$WPA_ROOT_DIR/wpa_supplicant/events.c",
213    "$WPA_ROOT_DIR/wpa_supplicant/ibss_rsn.c",
214    "$WPA_ROOT_DIR/wpa_supplicant/notify.c",
215    "$WPA_ROOT_DIR/wpa_supplicant/op_classes.c",
216    "$WPA_ROOT_DIR/wpa_supplicant/robust_av.c",
217    "$WPA_ROOT_DIR/wpa_supplicant/rrm.c",
218    "$WPA_ROOT_DIR/wpa_supplicant/scan.c",
219    "$WPA_ROOT_DIR/wpa_supplicant/wmm_ac.c",
220    "$WPA_ROOT_DIR/wpa_supplicant/wpa_supplicant.c",
221    "$WPA_ROOT_DIR/wpa_supplicant/wpas_glue.c",
222
223    #sae
224    "$WPA_ROOT_DIR/src/common/sae.c",
225    "$WPA_ROOT_DIR/wpa_supplicant/sme.c",
226
227    #p2p
228    "$WPA_ROOT_DIR/src/ap/p2p_hostapd.c",
229    "$WPA_ROOT_DIR/src/ap/wps_hostapd.c",
230    "$WPA_ROOT_DIR/src/common/dragonfly.c",
231    "$WPA_ROOT_DIR/src/common/gas.c",
232    "$WPA_ROOT_DIR/src/crypto/crypto_openssl.c",
233    "$WPA_ROOT_DIR/src/crypto/dh_groups.c",
234    "$WPA_ROOT_DIR/src/crypto/fips_prf_openssl.c",
235    "$WPA_ROOT_DIR/src/crypto/ms_funcs.c",
236    "$WPA_ROOT_DIR/src/crypto/sha1-tlsprf.c",
237    "$WPA_ROOT_DIR/src/crypto/sha256-kdf.c",
238    "$WPA_ROOT_DIR/src/crypto/tls_openssl.c",
239    "$WPA_ROOT_DIR/src/crypto/tls_openssl_ocsp.c",
240    "$WPA_ROOT_DIR/src/eap_common/chap.c",
241    "$WPA_ROOT_DIR/src/eap_common/eap_peap_common.c",
242    "$WPA_ROOT_DIR/src/eap_common/eap_pwd_common.c",
243    "$WPA_ROOT_DIR/src/eap_common/eap_sim_common.c",
244    "$WPA_ROOT_DIR/src/eap_common/eap_wsc_common.c",
245    "$WPA_ROOT_DIR/src/eap_peer/eap_aka.c",
246    "$WPA_ROOT_DIR/src/eap_peer/eap_mschapv2.c",
247    "$WPA_ROOT_DIR/src/eap_peer/eap_peap.c",
248    "$WPA_ROOT_DIR/src/eap_peer/eap_pwd.c",
249    "$WPA_ROOT_DIR/src/eap_peer/eap_sim.c",
250    "$WPA_ROOT_DIR/src/eap_peer/eap_tls.c",
251    "$WPA_ROOT_DIR/src/eap_peer/eap_tls_common.c",
252    "$WPA_ROOT_DIR/src/eap_peer/eap_ttls.c",
253    "$WPA_ROOT_DIR/src/eap_peer/eap_wsc.c",
254    "$WPA_ROOT_DIR/src/eap_peer/mschapv2.c",
255    "$WPA_ROOT_DIR/src/eap_server/eap_server_wsc.c",
256    "$WPA_ROOT_DIR/src/p2p/p2p.c",
257    "$WPA_ROOT_DIR/src/p2p/p2p_build.c",
258    "$WPA_ROOT_DIR/src/p2p/p2p_dev_disc.c",
259    "$WPA_ROOT_DIR/src/p2p/p2p_go_neg.c",
260    "$WPA_ROOT_DIR/src/p2p/p2p_group.c",
261    "$WPA_ROOT_DIR/src/p2p/p2p_invitation.c",
262    "$WPA_ROOT_DIR/src/p2p/p2p_parse.c",
263    "$WPA_ROOT_DIR/src/p2p/p2p_pd.c",
264    "$WPA_ROOT_DIR/src/p2p/p2p_sd.c",
265    "$WPA_ROOT_DIR/src/p2p/p2p_utils.c",
266    "$WPA_ROOT_DIR/src/tls/bignum.c",
267    "$WPA_ROOT_DIR/src/utils/base64.c",
268    "$WPA_ROOT_DIR/src/utils/config.c",
269    "$WPA_ROOT_DIR/src/utils/crc32.c",
270    "$WPA_ROOT_DIR/src/utils/uuid.c",
271    "$WPA_ROOT_DIR/src/wps/wps.c",
272    "$WPA_ROOT_DIR/src/wps/wps_attr_build.c",
273    "$WPA_ROOT_DIR/src/wps/wps_attr_parse.c",
274    "$WPA_ROOT_DIR/src/wps/wps_attr_process.c",
275    "$WPA_ROOT_DIR/src/wps/wps_common.c",
276    "$WPA_ROOT_DIR/src/wps/wps_dev_attr.c",
277    "$WPA_ROOT_DIR/src/wps/wps_enrollee.c",
278    "$WPA_ROOT_DIR/src/wps/wps_registrar.c",
279    "$WPA_ROOT_DIR/wpa_supplicant/ap.c",
280    "$WPA_ROOT_DIR/wpa_supplicant/gas_query.c",
281    "$WPA_ROOT_DIR/wpa_supplicant/offchannel.c",
282    "$WPA_ROOT_DIR/wpa_supplicant/p2p_supplicant.c",
283    "$WPA_ROOT_DIR/wpa_supplicant/p2p_supplicant_sd.c",
284    "$WPA_ROOT_DIR/wpa_supplicant/wps_supplicant.c",
285    "$WPA_ROOT_DIR/wpa_supplicant_lib/wpa_magiclink.c",
286  ]
287
288  include_dirs = [
289    "$WPA_ROOT_DIR/src",
290    "$WPA_ROOT_DIR/src/utils",
291    "$WPA_ROOT_DIR/src/drivers",
292    "$WPA_ROOT_DIR/wpa_supplicant",
293    "$WPA_ROOT_DIR/build/include",
294    "$WPA_ROOT_DIR/wpa_supplicant_lib",
295    "//third_party/libnl/include",
296    "//drivers/peripheral/wlan/client/include",
297    "//third_party/bounds_checking_function/include",
298    "//third_party/openssl/include",
299    "$WPA_ROOT_DIR/src/crypto",
300    "$WPA_ROOT_DIR/src/eap_common",
301    "//base/hiviewdfxhilog/interfaces/native/innerkits/include",
302  ]
303
304  cflags = [
305    "-UANDROID",
306    "-fsigned-char",
307    "-DCONFIG_IEEE80211W",
308    "-DCONFIG_NO_VLAN",
309    "-DCONFIG_NO_RADIUS",
310    "-DCONFIG_NO_RANDOM_POOL",
311    "-DCONFIG_SHA256",
312    "-DCONFIG_CRYPTO_INTERNAL",
313    "-DCONFIG_INTERNAL_LIBTOMMATH",
314    "-DCONFIG_INTERNAL_SHA384",
315    "-DCONFIG_INTERNAL_SHA512",
316    "-DCONFIG_CTRL_IFACE",
317    "-DCONFIG_CTRL_IFACE_UDP",
318    "-DCONFIG_IBSS_RSN",
319    "-DIEEE8021X_EAPOL",
320    "-DUSERSPACE_CLIENT_SUPPORT",
321    "-DCONFIG_BACKEND_FILE",
322    "-DCONFIG_NO_CONFIG_BLOBS",
323    "-DCONFIG_NO_ACCOUNTING",
324    "-DEAP_SERVER_IDENTITY",
325    "-DCONFIG_IEEE80211N",
326    "-DHOSTAPD",
327    "-DNEED_AP_MLME",
328    "-DCONFIG_WPS",
329    "-DCONFIG_AP",
330    "-DCONFIG_P2P",
331    "-DEAP_WSC",
332    "-DEAP_SERVER_WSC",
333    "-DEAP_SERVER",
334    "-DCONFIG_GAS",
335    "-DCONFIG_OFFCHANNEL",
336    "-DCONFIG_MAGICLINK",
337    "-DCONFIG_OPEN_HARMONY_PATCH",
338    "-DEAP_MSCHAPV2",
339    "-DEAP_TLS",
340    "-DEAP_PEAP",
341    "-DEAP_TTLS",
342    "-DEAP_SIM",
343    "-DEAP_PWD",
344    "-DEAP_MSCHAPv2",
345    "-DCONFIG_SHA256",
346    "-DCONFIG_ECC",
347    "-DEAP_AKA",
348    "-DEAP_AKA_PRIME",
349    "-DEAP_TLS_OPENSSL",
350    "-DCONFIG_SAE",
351    "-DCONFIG_SME",
352    "-DCONFIG_WEP",
353  ]
354
355  defines = [ "TLS_DEFAULT_CIPHERS = \"DEFAULT:!EXP:!LOW\"" ]
356
357  deps = [
358    "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog",
359    "//drivers/peripheral/wlan/client:wifi_driver_client",
360    "//third_party/bounds_checking_function:libsec_static",
361    "//third_party/openssl:libcrypto_shared",
362    "//third_party/openssl:libssl_shared",
363  ]
364  external_deps = [ "init:libbegetutil" ]
365
366  if ("${CONFIG_DRIVER}" == "nl80211") {
367    sources += [
368      "$WPA_ROOT_DIR/src/ap/ieee802_11_he.c",
369      "$WPA_ROOT_DIR/src/ap/ieee802_11_vht.c",
370      "$WPA_ROOT_DIR/src/drivers/driver_nl80211.c",
371      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_capa.c",
372      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_event.c",
373      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_monitor.c",
374      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_scan.c",
375      "$WPA_ROOT_DIR/src/drivers/linux_ioctl.c",
376      "$WPA_ROOT_DIR/src/drivers/netlink.c",
377      "$WPA_ROOT_DIR/src/drivers/rfkill.c",
378    ]
379    include_dirs += [
380      "$WPA_ROOT_DIR/libnl/include/libnl3",
381      "$WPA_ROOT_DIR/wpa_supplicant_lib",
382    ]
383
384    cflags += [
385      "-DCONFIG_DRIVER_NL80211",
386      "-DCONFIG_LIBNL32",
387      "-DCONFIG_LIBNL20",
388      "-DCONFIG_DEBUG_FILE",
389      "-DCONFIG_IEEE80211AC",
390      "-DCONFIG_IEEE80211AX",
391    ]
392    deps += [ "//third_party/libnl:libnl_share" ]
393  } else {
394    sources += [
395      "$WPA_ROOT_DIR/src/drivers/wpa_hal.c",
396      "$WPA_ROOT_DIR/src/drivers/wpa_hal_event.c",
397    ]
398    cflags += [
399      "-DCONFIG_DRIVER_HDF",
400      "-DCONFIG_OHOS_P2P",
401    ]
402  }
403  if ("${CONFIG_HISI}" == "true") {
404    sources += [ "$WPA_ROOT_DIR/wpa_supplicant_lib/driver_nl80211_hisi.c" ]
405    cflags += [ "-DCONFIG_DRIVER_NL80211_HISI" ]
406    if (use_musl) {
407      cflags += [ "-DCONFIG_DRIVER_NL80211_HISI_TRUNK" ]
408    }
409  }
410
411  if (wpa_supplicant_ohos_certmgr) {
412    sources += [ "$WPA_ROOT_DIR/wpa_supplicant_lib/wpa_evp_key.c" ]
413    deps += [ "//base/security/certificate_manager/interfaces/innerkits/cert_manager_standard/main:cert_manager_sdk" ]
414    include_dirs += [
415      "//base/security/certificate_manager/frameworks/cert_manager_standard/main/common/include",
416      "//base/security/certificate_manager/interfaces/innerkits/cert_manager_standard/main/include",
417      "//third_party/openssl",
418    ]
419    defines += [ "CONFIG_OHOS_CERTMGR" ]
420  }
421
422  configs = [ ":wpa_warnings" ]
423  part_name = "wpa_supplicant-2.9"
424  subsystem_name = "wpa_supplicant-2.9"
425}
426
427ohos_executable("wpa_cli") {
428  sources = [
429    "$WPA_ROOT_DIR/src/common/cli.c",
430    "$WPA_ROOT_DIR/src/common/wpa_ctrl.c",
431    "$WPA_ROOT_DIR/src/utils/${CONFIG_ELOOP}.c",
432    "$WPA_ROOT_DIR/src/utils/common.c",
433    "$WPA_ROOT_DIR/src/utils/edit_simple.c",
434    "$WPA_ROOT_DIR/src/utils/os_${CONFIG_OS}.c",
435    "$WPA_ROOT_DIR/src/utils/wpa_debug.c",
436    "$WPA_ROOT_DIR/wpa_supplicant/wpa_cli.c",
437  ]
438
439  include_dirs = [
440    "$WPA_ROOT_DIR/src",
441    "$WPA_ROOT_DIR/src/utils",
442    "$WPA_ROOT_DIR/src/drivers",
443    "$WPA_ROOT_DIR/wpa_supplicant",
444    "$WPA_ROOT_DIR/build/include",
445    "//base/hiviewdfxhilog/interfaces/native/innerkits/include",
446    "//base/startup/init/interfaces/innerkits/include/syspara",
447  ]
448
449  cflags = [
450    "-UANDROID",
451    "-fsigned-char",
452    "-DCONFIG_IEEE80211W",
453    "-DCONFIG_NO_VLAN",
454    "-DCONFIG_NO_RADIUS",
455    "-DCONFIG_NO_RANDOM_POOL",
456    "-DCONFIG_SHA256",
457    "-DCONFIG_CRYPTO_INTERNAL",
458    "-DCONFIG_INTERNAL_LIBTOMMATH",
459    "-DCONFIG_INTERNAL_SHA384",
460    "-DCONFIG_INTERNAL_SHA512",
461    "-DCONFIG_CTRL_IFACE",
462    "-DCONFIG_CTRL_IFACE_UDP",
463    "-DCONFIG_IBSS_RSN",
464    "-DIEEE8021X_EAPOL",
465    "-DUSERSPACE_CLIENT_SUPPORT",
466    "-DCONFIG_BACKEND_FILE",
467    "-DCONFIG_NO_CONFIG_BLOBS",
468    "-DCONFIG_WPS",
469    "-DCONFIG_AP",
470    "-DCONFIG_P2P",
471    "-DEAP_WSC",
472    "-DEAP_SERVER_WSC",
473    "-DEAP_SERVER",
474    "-DCONFIG_GAS",
475    "-DCONFIG_OFFCHANNEL",
476    "-DCONFIG_MAGICLINK",
477    "-DCONFIG_DEBUG_FILE",
478    "-DCONFIG_OPEN_HARMONY_PATCH",
479  ]
480
481  if ("${CONFIG_DRIVER}" == "nl80211") {
482    include_dirs += [ "$WPA_ROOT_DIR/libnl/include/libnl3" ]
483    cflags += [
484      "-DCONFIG_DRIVER_NL80211",
485      "-DCONFIG_LIBNL32",
486    ]
487  } else {
488    cflags += [
489      "-DCONFIG_DRIVER_HDF",
490      "-DCONFIG_OHOS_P2P",
491    ]
492  }
493
494  deps = [
495    "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog",
496    "//base/startup/init/interfaces/innerkits:libbegetutil",
497  ]
498
499  configs = [ ":wpa_warnings" ]
500  part_name = "wpa_supplicant-2.9"
501  subsystem_name = "wpa_supplicant-2.9"
502}
503
504ohos_executable("hostapd_cli") {
505  sources = [
506    "$WPA_ROOT_DIR/hostapd/hostapd_cli.c",
507    "$WPA_ROOT_DIR/src/common/cli.c",
508    "$WPA_ROOT_DIR/src/common/wpa_ctrl.c",
509    "$WPA_ROOT_DIR/src/utils/${CONFIG_ELOOP}.c",
510    "$WPA_ROOT_DIR/src/utils/common.c",
511    "$WPA_ROOT_DIR/src/utils/edit_simple.c",
512    "$WPA_ROOT_DIR/src/utils/os_${CONFIG_OS}.c",
513    "$WPA_ROOT_DIR/src/utils/wpa_debug.c",
514  ]
515
516  include_dirs = [
517    "$WPA_ROOT_DIR/src",
518    "$WPA_ROOT_DIR/src/utils",
519    "$WPA_ROOT_DIR/src/drivers",
520    "$WPA_ROOT_DIR/wpa_supplicant",
521    "$WPA_ROOT_DIR/build/include",
522    "$WPA_ROOT_DIR/libnl/include/libnl3",
523    "//base/hiviewdfxhilog/interfaces/native/innerkits/include",
524    "//base/startup/init/interfaces/innerkits/include/syspara",
525  ]
526
527  cflags = [
528    "-UANDROID",
529    "-fsigned-char",
530    "-DCONFIG_IEEE80211W",
531    "-DCONFIG_NO_VLAN",
532    "-DCONFIG_NO_RADIUS",
533    "-DCONFIG_NO_RANDOM_POOL",
534    "-DCONFIG_SHA256",
535    "-DCONFIG_CRYPTO_INTERNAL",
536    "-DCONFIG_INTERNAL_LIBTOMMATH",
537    "-DCONFIG_INTERNAL_SHA384",
538    "-DCONFIG_INTERNAL_SHA512",
539    "-DCONFIG_CTRL_IFACE",
540    "-DCONFIG_CTRL_IFACE_UDP",
541    "-DCONFIG_IBSS_RSN",
542    "-DIEEE8021X_EAPOL",
543    "-DUSERSPACE_CLIENT_SUPPORT",
544    "-DCONFIG_BACKEND_FILE",
545    "-DCONFIG_NO_CONFIG_BLOBS",
546    "-DCONFIG_NO_ACCOUNTING",
547    "-DEAP_SERVER_IDENTITY",
548    "-DCONFIG_IEEE80211N",
549    "-DHOSTAPD",
550    "-DNEED_AP_MLME",
551    "-DCONFIG_WPS",
552    "-DCONFIG_AP",
553    "-DCONFIG_P2P",
554    "-DEAP_WSC",
555    "-DEAP_SERVER_WSC",
556    "-DEAP_SERVER",
557    "-DCONFIG_GAS",
558    "-DCONFIG_OFFCHANNEL",
559    "-DCONFIG_DEBUG_FILE",
560    "-DCONFIG_OPEN_HARMONY_PATCH",
561  ]
562
563  deps = [
564    "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog",
565    "//base/startup/init/interfaces/innerkits:libbegetutil",
566  ]
567
568  if ("${CONFIG_DRIVER}" == "nl80211") {
569    cflags += [
570      "-DCONFIG_DRIVER_NL80211",
571      "-DCONFIG_LIBNL32",
572    ]
573  } else {
574    cflags += [
575      "-DCONFIG_DRIVER_HDF",
576      "-DCONFIG_OHOS_P2P",
577    ]
578  }
579  configs = [ ":wpa_warnings" ]
580  part_name = "wpa_supplicant-2.9"
581  subsystem_name = "wpa_supplicant-2.9"
582}
583
584ohos_executable("wpa_supplicant") {
585  sources = [ "$WPA_ROOT_DIR/wpa_test/wpa_sample.c" ]
586
587  include_dirs = [ "$WPA_ROOT_DIR/build/include" ]
588
589  deps = [ "//third_party/wpa_supplicant/wpa_supplicant-2.9_standard:wpa" ]
590  configs = [ ":wpa_warnings" ]
591  cflags = [
592    "-DCONFIG_DEBUG_FILE",
593    "-DCONFIG_OPEN_HARMONY_PATCH",
594  ]
595  part_name = "wpa_supplicant-2.9"
596  subsystem_name = "wpa_supplicant-2.9"
597}
598
599ohos_executable("hostapd") {
600  sources = [ "$WPA_ROOT_DIR/hostapd_test/hostapd_sample.c" ]
601
602  include_dirs = [ "$WPA_ROOT_DIR/build/include" ]
603
604  deps = [ "//third_party/wpa_supplicant/wpa_supplicant-2.9_standard:wpa" ]
605
606  configs = [ ":wpa_warnings" ]
607  cflags = [
608    "-DCONFIG_DEBUG_FILE",
609    "-DCONFIG_OPEN_HARMONY_PATCH",
610  ]
611  part_name = "wpa_supplicant-2.9"
612  subsystem_name = "wpa_supplicant-2.9"
613}
614