• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#Copyright (c) 2021-2023 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
14if (defined(ohos_lite)) {
15  import("//build/lite/config/component/lite_component.gni")
16} else {
17  import("//build/ohos.gni")
18}
19
20import("//third_party/wpa_supplicant/wpa_supplicant-2.9_standard/wpa.gni")
21import(
22    "//third_party/wpa_supplicant/wpa_supplicant-2.9_standard/wpa_vendor_ext.gni")
23
24declare_args() {
25  wpa_supplicant_driver_nl80211_hisi = false
26  wpa_supplicant_driver_nl80211 = false
27  wpa_supplicant_ohos_certmgr = true
28  wpa_supplicant_ohos_eapauth = true
29  wpa_supplicant_config_hilog = true
30  wpa_supplicant_config_openssl = true
31  wpa_supplicant_config_wfd = true
32}
33
34if (wpa_supplicant_ohos_certmgr) {
35  cert_manager_sources = [
36    "$WPA_ROOT_DIR/wpa_supplicant_lib/cert_mgr_deps/src/cert_manager_api.c",
37    "$WPA_ROOT_DIR/wpa_supplicant_lib/cert_mgr_deps/src/cm_ipc_client.c",
38    "$WPA_ROOT_DIR/wpa_supplicant_lib/cert_mgr_deps/src/cm_ipc_client_serialization.c",
39    "$WPA_ROOT_DIR/wpa_supplicant_lib/cert_mgr_deps/src/cm_load_sa.cpp",
40    "$WPA_ROOT_DIR/wpa_supplicant_lib/cert_mgr_deps/src/cm_mem.c",
41    "$WPA_ROOT_DIR/wpa_supplicant_lib/cert_mgr_deps/src/cm_param.c",
42    "$WPA_ROOT_DIR/wpa_supplicant_lib/cert_mgr_deps/src/cm_request.cpp",
43  ]
44
45  cert_manager_include_dirs = [
46    "//third_party/openssl",
47    "$WPA_ROOT_DIR/wpa_supplicant_lib/cert_mgr_deps/include",
48  ]
49
50  cert_manager_external_deps = [
51    "c_utils:utils",
52    "ipc:ipc_single",
53    "openssl:libcrypto_shared",
54    "samgr:samgr_proxy",
55  ]
56}
57
58if (wpa_supplicant_driver_nl80211_hisi) {
59  CONFIG_HISI = "true"
60} else {
61  CONFIG_HISI = "false"
62}
63if (wpa_supplicant_driver_nl80211) {
64  CONFIG_DRIVER = "nl80211"
65} else {
66  CONFIG_DRIVER = "hdf"
67}
68if (wpa_supplicant_ohos_eapauth) {
69  CONFIG_EAPAUTH = "true"
70} else {
71  CONFIG_EAPAUTH = "false"
72}
73
74CONFIG_OS = "unix"
75CONFIG_ELOOP = "eloop"
76if ("${CONFIG_DRIVER}" == "nl80211") {
77  CONFIG_L2_PACKET = "linux"
78} else {
79  CONFIG_L2_PACKET = "rtos"
80}
81
82CONFIG_MAIN = "main"
83
84config("wpa_warnings") {
85  cflags = [ "-Wno-error=sign-compare" ]
86  ldflags = [
87    "-flto",
88    "-fsanitize=cfi",
89    "-Wl,-plugin-opt,O1",
90  ]
91}
92
93wpa_client_base_sources = [
94  "$WPA_ROOT_DIR/src/common/wpa_ctrl.c",
95  "$WPA_ROOT_DIR/src/utils/common.c",
96  "$WPA_ROOT_DIR/src/utils/os_${CONFIG_OS}.c",
97  "$WPA_ROOT_DIR/src/utils/wpa_debug.c",
98]
99
100wpa_client_base_include_dirs = [
101  "$WPA_ROOT_DIR/src",
102  "$WPA_ROOT_DIR/src/utils",
103  "$WPA_ROOT_DIR/src/drivers",
104  "$WPA_ROOT_DIR/wpa_supplicant",
105  "$WPA_ROOT_DIR/build/include",
106]
107
108wpa_client_vendor_base_include_dirs = [
109  "$WPA_ROOT_DIR/src",
110  "$WPA_ROOT_DIR/src/utils",
111  "$WPA_ROOT_DIR/src/drivers",
112  "$WPA_ROOT_DIR/wpa_supplicant",
113  "$WPA_ROOT_DIR/build/include",
114]
115
116config("wpa_client_public_config") {
117  include_dirs = [ "$WPA_ROOT_DIR/src/common" ]
118}
119
120wpa_client_base_cflags = [
121  "-UANDROID",
122  "-fsigned-char",
123  "-DCONFIG_IEEE80211W",
124  "-DCONFIG_NO_VLAN",
125  "-DCONFIG_NO_RADIUS",
126  "-DCONFIG_NO_RANDOM_POOL",
127  "-DCONFIG_SHA256",
128  "-DCONFIG_CRYPTO_INTERNAL",
129  "-DCONFIG_INTERNAL_LIBTOMMATH",
130  "-DCONFIG_INTERNAL_SHA384",
131  "-DCONFIG_INTERNAL_SHA512",
132  "-DCONFIG_CTRL_IFACE",
133  "-DCONFIG_IBSS_RSN",
134  "-DIEEE8021X_EAPOL",
135  "-DCONFIG_BACEND_FILE",
136  "-DCONFIG_NO_CONFIG_BLOBS",
137  "-DUSERSPACE_CLIENT_SUPPORT",
138  "-DCONFIG_DEBUG_FILE",
139  "-DCONFIG_OPEN_HARMONY_PATCH",
140]
141
142ohos_shared_library("wpa_client") {
143  sanitize = {
144    cfi = true
145    debug = false
146  }
147
148  output_name = "wpa_client"
149  sources = wpa_client_base_sources
150
151  include_dirs = wpa_client_base_include_dirs
152
153  cflags = wpa_client_base_cflags
154  if ("${CONFIG_CTRL_IFACE}" == "udp") {
155    cflags += [ "-DCONFIG_CTRL_IFACE_UDP" ]
156  } else {
157    cflags += [ "-DCONFIG_CTRL_IFACE_UNIX" ]
158  }
159
160  external_deps = [ "init:libbegetutil" ]
161  if (wpa_supplicant_config_hilog) {
162    external_deps += [ "hilog:libhilog" ]
163  }
164  if ("${CONFIG_DRIVER}" == "nl80211") {
165    include_dirs += [ "$WPA_ROOT_DIR/libnl/include/libnl3" ]
166    cflags += [
167      "-DCONFIG_DRIVER_NL80211",
168      "-DCONFIG_LIBNL32",
169    ]
170  } else {
171    cflags += [
172      "-DCONFIG_DRIVER_HDF",
173      "-DCONFIG_OHOS_P2P",
174    ]
175  }
176  public_configs = [ ":wpa_client_public_config" ]
177  configs = [ ":wpa_warnings" ]
178  part_name = "wpa_supplicant"
179  subsystem_name = "thirdparty"
180  install_images = [ "system" ]
181}
182
183ohos_shared_library("wpa_client_vendor") {
184  sanitize = {
185    cfi = true
186    debug = false
187  }
188
189  output_name = "wpa_client_vendor"
190  sources = wpa_client_base_sources
191
192  include_dirs = wpa_client_vendor_base_include_dirs
193
194  cflags = wpa_client_base_cflags
195  if ("${CONFIG_CTRL_IFACE}" == "udp") {
196    cflags += [ "-DCONFIG_CTRL_IFACE_UDP" ]
197  } else {
198    cflags += [ "-DCONFIG_CTRL_IFACE_UNIX" ]
199  }
200
201  external_deps = [ "init:libbegetutil" ]
202  if (wpa_supplicant_config_hilog) {
203    external_deps += [ "hilog:libhilog" ]
204  }
205  if ("${CONFIG_DRIVER}" == "nl80211") {
206    include_dirs += [ "$WPA_ROOT_DIR/libnl/include/libnl3" ]
207    cflags += [
208      "-DCONFIG_DRIVER_NL80211",
209      "-DCONFIG_LIBNL32",
210    ]
211  } else {
212    cflags += [
213      "-DCONFIG_DRIVER_HDF",
214      "-DCONFIG_OHOS_P2P",
215    ]
216  }
217  public_configs = [ ":wpa_client_public_config" ]
218  configs = [ ":wpa_warnings" ]
219  part_name = "wpa_supplicant"
220  subsystem_name = "thirdparty"
221  install_images = [ chipset_base_dir ]
222}
223
224ohos_shared_library("wpa_client_updater") {
225  sanitize = {
226    cfi = true
227    debug = false
228  }
229
230  output_name = "wpa_client_updater"
231  symlink_target_name = [ "libwpa_client.z.so" ]
232  sources = wpa_client_base_sources
233
234  include_dirs = wpa_client_base_include_dirs
235
236  cflags = wpa_client_base_cflags
237  if ("${CONFIG_CTRL_IFACE}" == "udp") {
238    cflags += [ "-DCONFIG_CTRL_IFACE_UDP" ]
239  } else {
240    cflags += [ "-DCONFIG_CTRL_IFACE_UNIX" ]
241  }
242
243  external_deps = [ "init:libbegetutil" ]
244  if (wpa_supplicant_config_hilog) {
245    external_deps += [ "hilog:libhilog" ]
246  }
247
248  if ("${CONFIG_DRIVER}" == "nl80211") {
249    include_dirs += [ "$WPA_ROOT_DIR/libnl/include/libnl3" ]
250    cflags += [
251      "-DCONFIG_DRIVER_NL80211",
252      "-DCONFIG_LIBNL32",
253    ]
254  } else {
255    cflags += [
256      "-DCONFIG_DRIVER_HDF",
257      "-DCONFIG_OHOS_P2P",
258    ]
259  }
260  public_configs = [ ":wpa_client_public_config" ]
261  defines = [ "OHOS_EUPDATER" ]
262  configs = [ ":wpa_warnings" ]
263  part_name = "wpa_supplicant"
264  subsystem_name = "thirdparty"
265  install_images = [ "updater" ]
266}
267
268wpa_base_sources = [
269  # wpa & hostapd
270  "$WPA_ROOT_DIR/hostapd/ap_config_file.c",
271  "$WPA_ROOT_DIR/hostapd/ap_ctrl_iface.c",
272  "$WPA_ROOT_DIR/hostapd/ap_eap_register.c",
273
274  # hostapd
275  "$WPA_ROOT_DIR/hostapd/ap_main.c",
276  "$WPA_ROOT_DIR/src/ap/ap_config.c",
277  "$WPA_ROOT_DIR/src/ap/ap_drv_ops.c",
278  "$WPA_ROOT_DIR/src/ap/ap_list.c",
279  "$WPA_ROOT_DIR/src/ap/ap_mlme.c",
280  "$WPA_ROOT_DIR/src/ap/ap_rrm.c",
281  "$WPA_ROOT_DIR/src/ap/authsrv.c",
282  "$WPA_ROOT_DIR/src/ap/beacon.c",
283  "$WPA_ROOT_DIR/src/ap/bss_load.c",
284  "$WPA_ROOT_DIR/src/ap/ctrl_iface_ap.c",
285  "$WPA_ROOT_DIR/src/ap/dfs.c",
286  "$WPA_ROOT_DIR/src/ap/drv_callbacks.c",
287  "$WPA_ROOT_DIR/src/ap/eap_user_db.c",
288  "$WPA_ROOT_DIR/src/ap/hostapd.c",
289  "$WPA_ROOT_DIR/src/ap/hw_features.c",
290  "$WPA_ROOT_DIR/src/ap/ieee802_11.c",
291  "$WPA_ROOT_DIR/src/ap/ieee802_11_auth.c",
292  "$WPA_ROOT_DIR/src/ap/ieee802_11_ht.c",
293  "$WPA_ROOT_DIR/src/ap/ieee802_11_shared.c",
294  "$WPA_ROOT_DIR/src/ap/ieee802_1x.c",
295  "$WPA_ROOT_DIR/src/ap/neighbor_db.c",
296  "$WPA_ROOT_DIR/src/ap/pmksa_cache_auth.c",
297  "$WPA_ROOT_DIR/src/ap/preauth_auth.c",
298  "$WPA_ROOT_DIR/src/ap/sta_info.c",
299  "$WPA_ROOT_DIR/src/ap/tkip_countermeasures.c",
300  "$WPA_ROOT_DIR/src/ap/utils.c",
301  "$WPA_ROOT_DIR/src/ap/wmm.c",
302  "$WPA_ROOT_DIR/src/ap/wpa_auth.c",
303  "$WPA_ROOT_DIR/src/ap/wpa_auth_glue.c",
304  "$WPA_ROOT_DIR/src/ap/wpa_auth_ie.c",
305  "$WPA_ROOT_DIR/src/common/ctrl_iface_common.c",
306  "$WPA_ROOT_DIR/src/common/hw_features_common.c",
307  "$WPA_ROOT_DIR/src/common/ieee802_11_common.c",
308  "$WPA_ROOT_DIR/src/common/wpa_common.c",
309  "$WPA_ROOT_DIR/src/crypto/aes-internal.c",
310  "$WPA_ROOT_DIR/src/crypto/aes-omac1.c",
311  "$WPA_ROOT_DIR/src/crypto/sha1-prf.c",
312  "$WPA_ROOT_DIR/src/crypto/sha256-prf.c",
313  "$WPA_ROOT_DIR/src/drivers/driver_common.c",
314  "$WPA_ROOT_DIR/src/drivers/drivers.c",
315  "$WPA_ROOT_DIR/src/eap_common/eap_common.c",
316  "$WPA_ROOT_DIR/src/eap_peer/eap.c",
317  "$WPA_ROOT_DIR/src/eap_peer/eap_methods.c",
318  "$WPA_ROOT_DIR/src/eap_server/eap_server.c",
319  "$WPA_ROOT_DIR/src/eap_server/eap_server_identity.c",
320  "$WPA_ROOT_DIR/src/eap_server/eap_server_methods.c",
321  "$WPA_ROOT_DIR/src/eapol_auth/eapol_auth_sm.c",
322  "$WPA_ROOT_DIR/src/eapol_supp/eapol_supp_sm.c",
323  "$WPA_ROOT_DIR/src/l2_packet/l2_packet_${CONFIG_L2_PACKET}.c",
324  "$WPA_ROOT_DIR/src/rsn_supp/pmksa_cache.c",
325  "$WPA_ROOT_DIR/src/rsn_supp/preauth.c",
326  "$WPA_ROOT_DIR/src/rsn_supp/wpa.c",
327  "$WPA_ROOT_DIR/src/rsn_supp/wpa_i.h",
328  "$WPA_ROOT_DIR/src/rsn_supp/wpa_ie.c",
329  "$WPA_ROOT_DIR/src/utils/${CONFIG_ELOOP}.c",
330  "$WPA_ROOT_DIR/src/utils/bitfield.c",
331  "$WPA_ROOT_DIR/src/utils/common.c",
332  "$WPA_ROOT_DIR/src/utils/ip_addr.c",
333  "$WPA_ROOT_DIR/src/utils/os_${CONFIG_OS}.c",
334  "$WPA_ROOT_DIR/src/utils/radiotap.c",
335  "$WPA_ROOT_DIR/src/utils/wpa_debug.c",
336  "$WPA_ROOT_DIR/src/utils/wpabuf.c",
337  "$WPA_ROOT_DIR/wpa_supplicant/${CONFIG_MAIN}.c",
338  "$WPA_ROOT_DIR/wpa_supplicant/bss.c",
339  "$WPA_ROOT_DIR/wpa_supplicant/bssid_ignore.c",
340
341  # wpa_supplicant
342  "$WPA_ROOT_DIR/src/crypto/sha384-kdf.c",
343  "$WPA_ROOT_DIR/src/crypto/sha384-prf.c",
344  "$WPA_ROOT_DIR/wpa_supplicant/config.c",
345  "$WPA_ROOT_DIR/wpa_supplicant/config_file.c",
346  "$WPA_ROOT_DIR/wpa_supplicant/ctrl_iface.c",
347  "$WPA_ROOT_DIR/wpa_supplicant/ctrl_iface_${CONFIG_CTRL_IFACE}.c",
348  "$WPA_ROOT_DIR/wpa_supplicant/eap_register.c",
349  "$WPA_ROOT_DIR/wpa_supplicant/events.c",
350  "$WPA_ROOT_DIR/wpa_supplicant/ibss_rsn.c",
351  "$WPA_ROOT_DIR/wpa_supplicant/notify.c",
352  "$WPA_ROOT_DIR/wpa_supplicant/op_classes.c",
353  "$WPA_ROOT_DIR/wpa_supplicant/robust_av.c",
354  "$WPA_ROOT_DIR/wpa_supplicant/rrm.c",
355  "$WPA_ROOT_DIR/wpa_supplicant/scan.c",
356  "$WPA_ROOT_DIR/wpa_supplicant/wmm_ac.c",
357  "$WPA_ROOT_DIR/wpa_supplicant/wpa_supplicant.c",
358  "$WPA_ROOT_DIR/wpa_supplicant/wpas_glue.c",
359
360  #sae
361  "$WPA_ROOT_DIR/src/common/sae.c",
362  "$WPA_ROOT_DIR/wpa_supplicant/sme.c",
363
364  #p2p
365  "$WPA_ROOT_DIR/src/ap/p2p_hostapd.c",
366  "$WPA_ROOT_DIR/src/ap/wps_hostapd.c",
367  "$WPA_ROOT_DIR/src/common/dragonfly.c",
368  "$WPA_ROOT_DIR/src/common/gas.c",
369  "$WPA_ROOT_DIR/src/crypto/crypto_openssl.c",
370  "$WPA_ROOT_DIR/src/crypto/dh_groups.c",
371  "$WPA_ROOT_DIR/src/crypto/fips_prf_openssl.c",
372  "$WPA_ROOT_DIR/src/crypto/ms_funcs.c",
373  "$WPA_ROOT_DIR/src/crypto/sha1-tlsprf.c",
374  "$WPA_ROOT_DIR/src/crypto/sha256-kdf.c",
375  "$WPA_ROOT_DIR/src/crypto/tls_openssl.c",
376  "$WPA_ROOT_DIR/src/crypto/tls_openssl_ocsp.c",
377  "$WPA_ROOT_DIR/src/eap_common/chap.c",
378  "$WPA_ROOT_DIR/src/eap_common/eap_peap_common.c",
379  "$WPA_ROOT_DIR/src/eap_common/eap_pwd_common.c",
380  "$WPA_ROOT_DIR/src/eap_common/eap_sim_common.c",
381  "$WPA_ROOT_DIR/src/eap_common/eap_wsc_common.c",
382  "$WPA_ROOT_DIR/src/eap_peer/eap_aka.c",
383  "$WPA_ROOT_DIR/src/eap_peer/eap_gtc.c",
384  "$WPA_ROOT_DIR/src/eap_peer/eap_mschapv2.c",
385  "$WPA_ROOT_DIR/src/eap_peer/eap_peap.c",
386  "$WPA_ROOT_DIR/src/eap_peer/eap_pwd.c",
387  "$WPA_ROOT_DIR/src/eap_peer/eap_sim.c",
388  "$WPA_ROOT_DIR/src/eap_peer/eap_tls.c",
389  "$WPA_ROOT_DIR/src/eap_peer/eap_tls_common.c",
390  "$WPA_ROOT_DIR/src/eap_peer/eap_ttls.c",
391  "$WPA_ROOT_DIR/src/eap_peer/eap_wsc.c",
392  "$WPA_ROOT_DIR/src/eap_peer/mschapv2.c",
393  "$WPA_ROOT_DIR/src/eap_server/eap_server_wsc.c",
394  "$WPA_ROOT_DIR/src/p2p/p2p.c",
395  "$WPA_ROOT_DIR/src/p2p/p2p_build.c",
396  "$WPA_ROOT_DIR/src/p2p/p2p_dev_disc.c",
397  "$WPA_ROOT_DIR/src/p2p/p2p_go_neg.c",
398  "$WPA_ROOT_DIR/src/p2p/p2p_group.c",
399  "$WPA_ROOT_DIR/src/p2p/p2p_invitation.c",
400  "$WPA_ROOT_DIR/src/p2p/p2p_parse.c",
401  "$WPA_ROOT_DIR/src/p2p/p2p_pd.c",
402  "$WPA_ROOT_DIR/src/p2p/p2p_sd.c",
403  "$WPA_ROOT_DIR/src/p2p/p2p_utils.c",
404  "$WPA_ROOT_DIR/src/tls/bignum.c",
405  "$WPA_ROOT_DIR/src/utils/base64.c",
406  "$WPA_ROOT_DIR/src/utils/config.c",
407  "$WPA_ROOT_DIR/src/utils/crc32.c",
408  "$WPA_ROOT_DIR/src/utils/uuid.c",
409  "$WPA_ROOT_DIR/src/wps/wps.c",
410  "$WPA_ROOT_DIR/src/wps/wps_attr_build.c",
411  "$WPA_ROOT_DIR/src/wps/wps_attr_parse.c",
412  "$WPA_ROOT_DIR/src/wps/wps_attr_process.c",
413  "$WPA_ROOT_DIR/src/wps/wps_common.c",
414  "$WPA_ROOT_DIR/src/wps/wps_dev_attr.c",
415  "$WPA_ROOT_DIR/src/wps/wps_enrollee.c",
416  "$WPA_ROOT_DIR/src/wps/wps_registrar.c",
417  "$WPA_ROOT_DIR/wpa_supplicant/ap.c",
418  "$WPA_ROOT_DIR/wpa_supplicant/gas_query.c",
419  "$WPA_ROOT_DIR/wpa_supplicant/offchannel.c",
420  "$WPA_ROOT_DIR/wpa_supplicant/p2p_supplicant.c",
421  "$WPA_ROOT_DIR/wpa_supplicant/p2p_supplicant_sd.c",
422  "$WPA_ROOT_DIR/wpa_supplicant/wps_supplicant.c",
423  "$WPA_ROOT_DIR/wpa_supplicant_lib/wpa_magiclink.c",
424]
425
426if ("${CONFIG_EAPAUTH}" == "true") {
427  wpa_base_sources += [
428    "$WPA_ROOT_DIR/src/crypto/aes-encblock.c",
429    "$WPA_ROOT_DIR/src/crypto/milenage.c",
430  ]
431}
432
433if (wpa_supplicant_config_wfd) {
434  wpa_base_sources += [ "$WPA_ROOT_DIR/wpa_supplicant/wifi_display.c" ]
435}
436
437wpa_base_include_dirs = [
438  "$WPA_ROOT_DIR/src",
439  "$WPA_ROOT_DIR/src/ap",
440  "$WPA_ROOT_DIR/src/utils",
441  "$WPA_ROOT_DIR/src/drivers",
442  "$WPA_ROOT_DIR/wpa_supplicant",
443  "$WPA_ROOT_DIR/build/include",
444  "$WPA_ROOT_DIR/wpa_supplicant_lib",
445  "//drivers/peripheral/wlan/client/include",
446  "//third_party/libnl/libnl-3.7.0/include",
447  "$WPA_ROOT_DIR/src/crypto",
448  "$WPA_ROOT_DIR/src/eap_common",
449]
450
451if (wpa_supplicant_vendor_ext) {
452  wpa_base_include_dirs += wpa_vendor_ext_inc_path
453}
454
455if (wpa_supplicant_vendor_ext == false || wpa_supplicant_wapi == false) {
456  wpa_base_include_dirs += [ "$WPA_ROOT_DIR/wpa_supplicant/wapi" ]
457  wpa_base_sources += [ "$WPA_ROOT_DIR/wpa_supplicant/wapi/wapi_asue_i.c" ]
458}
459
460ohos_shared_library("wpa_sys") {
461  sanitize = {
462    cfi = true
463    debug = false
464  }
465  output_name = "wpa_sys"
466  sources = wpa_base_sources
467
468  include_dirs = wpa_base_include_dirs
469
470  cflags = [
471    "-UANDROID",
472    "-fsigned-char",
473    "-DCONFIG_IEEE80211W",
474    "-DCONFIG_NO_VLAN",
475    "-DCONFIG_NO_RADIUS",
476    "-DCONFIG_NO_RANDOM_POOL",
477    "-DCONFIG_SHA256",
478    "-DCONFIG_CRYPTO_INTERNAL",
479    "-DCONFIG_INTERNAL_LIBTOMMATH",
480    "-DCONFIG_INTERNAL_SHA384",
481    "-DCONFIG_INTERNAL_SHA512",
482    "-DCONFIG_CTRL_IFACE",
483    "-DCONFIG_IBSS_RSN",
484    "-DIEEE8021X_EAPOL",
485    "-DUSERSPACE_CLIENT_SUPPORT",
486    "-DCONFIG_BACKEND_FILE",
487    "-DCONFIG_NO_CONFIG_BLOBS",
488    "-DCONFIG_NO_ACCOUNTING",
489    "-DEAP_SERVER_IDENTITY",
490    "-DCONFIG_IEEE80211N",
491    "-DHOSTAPD",
492    "-DNEED_AP_MLME",
493    "-DCONFIG_WPS",
494    "-DCONFIG_AP",
495    "-DCONFIG_P2P",
496    "-DEAP_WSC",
497    "-DEAP_SERVER_WSC",
498    "-DEAP_SERVER",
499    "-DCONFIG_GAS",
500    "-DCONFIG_OFFCHANNEL",
501    "-DCONFIG_MAGICLINK",
502    "-DCONFIG_MAGICLINK_PC",
503    "-DCONFIG_OPEN_HARMONY_PATCH",
504    "-DEAP_MSCHAPV2",
505    "-DEAP_TLS",
506    "-DEAP_PEAP",
507    "-DEAP_TTLS",
508    "-DEAP_SIM",
509    "-DEAP_PWD",
510    "-DEAP_MSCHAPv2",
511    "-DCONFIG_SHA256",
512    "-DCONFIG_ECC",
513    "-DEAP_AKA",
514    "-DEAP_AKA_PRIME",
515    "-DEAP_TLS_OPENSSL",
516    "-DCONFIG_SAE",
517    "-DCONFIG_SME",
518    "-DCONFIG_SUITEB192",
519    "-DCONFIG_SHA384",
520    "-DCONFIG_SUITEB",
521    "-DCONFIG_WEP",
522    "-DPKCS12_FUNCS",
523    "-DEAP_GTC",
524  ]
525  if ("${CONFIG_CTRL_IFACE}" == "udp") {
526    cflags += [ "-DCONFIG_CTRL_IFACE_UDP" ]
527  } else {
528    cflags += [ "-DCONFIG_CTRL_IFACE_UNIX" ]
529  }
530
531  if (wpa_supplicant_config_wfd) {
532    cflags += [ "-DCONFIG_WIFI_DISPLAY" ]
533  }
534
535  defines = [
536    "TLS_DEFAULT_CIPHERS = \"DEFAULT:!EXP:!LOW\"",
537    "OPENSSL_SUPPRESS_DEPRECATED",
538  ]
539
540  external_deps = [ "bounds_checking_function:libsec_static" ]
541  if (wpa_supplicant_config_openssl) {
542    external_deps += [
543      "openssl:libcrypto_shared",
544      "openssl:libssl_shared",
545    ]
546  }
547
548  external_deps += [ "init:libbegetutil" ]
549  if (wpa_supplicant_config_hilog) {
550    external_deps += [ "hilog:libhilog" ]
551  }
552
553  if ("${CONFIG_DRIVER}" == "nl80211") {
554    sources += [
555      "$WPA_ROOT_DIR/src/ap/ieee802_11_he.c",
556      "$WPA_ROOT_DIR/src/ap/ieee802_11_vht.c",
557      "$WPA_ROOT_DIR/src/drivers/driver_nl80211.c",
558      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_capa.c",
559      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_event.c",
560      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_monitor.c",
561      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_scan.c",
562      "$WPA_ROOT_DIR/src/drivers/linux_ioctl.c",
563      "$WPA_ROOT_DIR/src/drivers/netlink.c",
564      "$WPA_ROOT_DIR/src/drivers/rfkill.c",
565    ]
566    include_dirs += [
567      "$WPA_ROOT_DIR/libnl/include/libnl3",
568      "$WPA_ROOT_DIR/wpa_supplicant_lib",
569    ]
570
571    cflags += [
572      "-DCONFIG_DRIVER_NL80211",
573      "-DCONFIG_LIBNL32",
574      "-DCONFIG_LIBNL20",
575      "-DCONFIG_DEBUG_FILE",
576      "-DCONFIG_IEEE80211AC",
577      "-DCONFIG_IEEE80211AX",
578    ]
579    deps = [ "//third_party/libnl:libnl_share" ]
580  } else {
581    sources += [
582      "$WPA_ROOT_DIR/src/drivers/wpa_hal.c",
583      "$WPA_ROOT_DIR/src/drivers/wpa_hal_event.c",
584    ]
585    cflags += [
586      "-DCONFIG_DRIVER_HDF",
587      "-DCONFIG_OHOS_P2P",
588    ]
589  }
590  if ("${CONFIG_HISI}" == "true") {
591    sources += [ "$WPA_ROOT_DIR/wpa_supplicant_lib/driver_nl80211_hisi.c" ]
592    cflags += [
593      "-DCONFIG_DRIVER_NL80211_HISI",
594      "-DCONFIG_P2P_160M",
595    ]
596    if (use_musl) {
597      cflags += [ "-DCONFIG_DRIVER_NL80211_HISI_TRUNK" ]
598    }
599  }
600  cflags += ext_cflags
601
602  if (wpa_supplicant_ohos_certmgr) {
603    sources += [ "$WPA_ROOT_DIR/wpa_supplicant_lib/wpa_evp_key.c" ]
604    sources += cert_manager_sources
605    external_deps += cert_manager_external_deps
606    include_dirs += cert_manager_include_dirs
607    defines += [ "CONFIG_OHOS_CERTMGR" ]
608  }
609  if (wpa_supplicant_vendor_ext) {
610    sources += wpa_vendor_ext_src
611    external_deps += [ "cJSON:cjson" ]
612  }
613  if ("${CONFIG_EAPAUTH}" == "true") {
614    cflags += [ "-DCONFIG_EAP_AUTH" ]
615  }
616  configs = [ ":wpa_warnings" ]
617  part_name = "wpa_supplicant"
618  subsystem_name = "thirdparty"
619}
620
621ohos_shared_library("wpa_sys_updater") {
622  sanitize = {
623    cfi = true
624    integer_overflow = true
625    cfi_cross_dso = true
626    debug = false
627  }
628  output_name = "wpa_sys_updater"
629  sources = wpa_base_sources
630  include_dirs = wpa_base_include_dirs
631  symlink_target_name = [ "libwpa_sys.z.so" ]
632
633  cflags = [
634    "-UANDROID",
635    "-fsigned-char",
636    "-DCONFIG_IEEE80211W",
637    "-DCONFIG_NO_VLAN",
638    "-DCONFIG_NO_RADIUS",
639    "-DCONFIG_NO_RANDOM_POOL",
640    "-DCONFIG_SHA256",
641    "-DCONFIG_CRYPTO_INTERNAL",
642    "-DCONFIG_INTERNAL_LIBTOMMATH",
643    "-DCONFIG_INTERNAL_SHA384",
644    "-DCONFIG_INTERNAL_SHA512",
645    "-DCONFIG_CTRL_IFACE",
646    "-DCONFIG_IBSS_RSN",
647    "-DIEEE8021X_EAPOL",
648    "-DUSERSPACE_CLIENT_SUPPORT",
649    "-DCONFIG_BACKEND_FILE",
650    "-DCONFIG_NO_CONFIG_BLOBS",
651    "-DCONFIG_NO_ACCOUNTING",
652    "-DEAP_SERVER_IDENTITY",
653    "-DCONFIG_IEEE80211N",
654    "-DHOSTAPD",
655    "-DNEED_AP_MLME",
656    "-DCONFIG_WPS",
657    "-DCONFIG_AP",
658    "-DCONFIG_P2P",
659    "-DEAP_WSC",
660    "-DEAP_SERVER_WSC",
661    "-DEAP_SERVER",
662    "-DCONFIG_GAS",
663    "-DCONFIG_OFFCHANNEL",
664    "-DCONFIG_MAGICLINK",
665    "-DCONFIG_MAGICLINK_PC",
666    "-DCONFIG_OPEN_HARMONY_PATCH",
667    "-DEAP_MSCHAPV2",
668    "-DEAP_TLS",
669    "-DEAP_PEAP",
670    "-DEAP_TTLS",
671    "-DEAP_SIM",
672    "-DEAP_PWD",
673    "-DEAP_MSCHAPv2",
674    "-DCONFIG_SHA256",
675    "-DCONFIG_ECC",
676    "-DEAP_AKA",
677    "-DEAP_AKA_PRIME",
678    "-DEAP_TLS_OPENSSL",
679    "-DCONFIG_SAE",
680    "-DCONFIG_SME",
681    "-DCONFIG_SUITEB192",
682    "-DCONFIG_SHA384",
683    "-DCONFIG_SUITEB",
684    "-DCONFIG_WEP",
685    "-DPKCS12_FUNCS",
686    "-DEAP_GTC",
687  ]
688  if ("${CONFIG_CTRL_IFACE}" == "udp") {
689    cflags += [ "-DCONFIG_CTRL_IFACE_UDP" ]
690  } else {
691    cflags += [ "-DCONFIG_CTRL_IFACE_UNIX" ]
692  }
693
694  if (wpa_supplicant_config_wfd) {
695    cflags += [ "-DCONFIG_WIFI_DISPLAY" ]
696  }
697
698  defines = [
699    "TLS_DEFAULT_CIPHERS = \"DEFAULT:!EXP:!LOW\"",
700    "OPENSSL_SUPPRESS_DEPRECATED",
701  ]
702
703  external_deps = [ "bounds_checking_function:libsec_static" ]
704  if (wpa_supplicant_config_openssl) {
705    external_deps += [
706      "openssl:libcrypto_shared",
707      "openssl:libssl_shared",
708    ]
709  }
710  external_deps += [ "init:libbegetutil" ]
711  if (wpa_supplicant_config_hilog) {
712    external_deps += [ "hilog:libhilog" ]
713  }
714
715  if ("${CONFIG_DRIVER}" == "nl80211") {
716    sources += [
717      "$WPA_ROOT_DIR/src/ap/ieee802_11_he.c",
718      "$WPA_ROOT_DIR/src/ap/ieee802_11_vht.c",
719      "$WPA_ROOT_DIR/src/drivers/driver_nl80211.c",
720      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_capa.c",
721      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_event.c",
722      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_monitor.c",
723      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_scan.c",
724      "$WPA_ROOT_DIR/src/drivers/linux_ioctl.c",
725      "$WPA_ROOT_DIR/src/drivers/netlink.c",
726      "$WPA_ROOT_DIR/src/drivers/rfkill.c",
727    ]
728    include_dirs += [
729      "$WPA_ROOT_DIR/libnl/include/libnl3",
730      "$WPA_ROOT_DIR/wpa_supplicant_lib",
731    ]
732
733    cflags += [
734      "-DCONFIG_DRIVER_NL80211",
735      "-DCONFIG_LIBNL32",
736      "-DCONFIG_LIBNL20",
737      "-DCONFIG_DEBUG_FILE",
738      "-DCONFIG_IEEE80211AC",
739      "-DCONFIG_IEEE80211AX",
740    ]
741    deps = [ "//third_party/libnl:libnl_share" ]
742  } else {
743    sources += [
744      "$WPA_ROOT_DIR/src/drivers/wpa_hal.c",
745      "$WPA_ROOT_DIR/src/drivers/wpa_hal_event.c",
746    ]
747    cflags += [
748      "-DCONFIG_DRIVER_HDF",
749      "-DCONFIG_OHOS_P2P",
750    ]
751  }
752  if ("${CONFIG_HISI}" == "true") {
753    sources += [ "$WPA_ROOT_DIR/wpa_supplicant_lib/driver_nl80211_hisi.c" ]
754    cflags += [
755      "-DCONFIG_DRIVER_NL80211_HISI",
756      "-DCONFIG_P2P_160M",
757    ]
758    if (use_musl) {
759      cflags += [ "-DCONFIG_DRIVER_NL80211_HISI_TRUNK" ]
760    }
761  }
762  cflags += ext_cflags
763
764  if (wpa_supplicant_vendor_ext) {
765    sources += wpa_vendor_ext_src
766    external_deps += [ "cJSON:cjson" ]
767  }
768  if ("${CONFIG_EAPAUTH}" == "true") {
769    cflags += [ "-DCONFIG_EAP_AUTH" ]
770  }
771  configs = [ ":wpa_warnings" ]
772  install_images = [ "updater" ]
773  part_name = "wpa_supplicant"
774  subsystem_name = "thirdparty"
775}
776
777ohos_shared_library("wpa") {
778  sanitize = {
779    cfi = true
780    debug = false
781  }
782  output_name = "wpa"
783  sources = wpa_base_sources
784
785  include_dirs = wpa_base_include_dirs
786  include_dirs += [ "hostapd/ap_ctrl_iface.h" ]
787
788  cflags = [
789    "-UANDROID",
790    "-fsigned-char",
791    "-DCONFIG_IEEE80211W",
792    "-DCONFIG_NO_VLAN",
793    "-DCONFIG_NO_RADIUS",
794    "-DCONFIG_NO_RANDOM_POOL",
795    "-DCONFIG_SHA256",
796    "-DCONFIG_CRYPTO_INTERNAL",
797    "-DCONFIG_INTERNAL_LIBTOMMATH",
798    "-DCONFIG_INTERNAL_SHA384",
799    "-DCONFIG_INTERNAL_SHA512",
800    "-DCONFIG_CTRL_IFACE",
801    "-DCONFIG_IBSS_RSN",
802    "-DIEEE8021X_EAPOL",
803    "-DUSERSPACE_CLIENT_SUPPORT",
804    "-DCONFIG_BACKEND_FILE",
805    "-DCONFIG_NO_CONFIG_BLOBS",
806    "-DCONFIG_NO_ACCOUNTING",
807    "-DEAP_SERVER_IDENTITY",
808    "-DCONFIG_IEEE80211N",
809    "-DHOSTAPD",
810    "-DNEED_AP_MLME",
811    "-DCONFIG_WPS",
812    "-DCONFIG_AP",
813    "-DCONFIG_P2P",
814    "-DEAP_WSC",
815    "-DEAP_SERVER_WSC",
816    "-DEAP_SERVER",
817    "-DCONFIG_GAS",
818    "-DCONFIG_OFFCHANNEL",
819    "-DCONFIG_MAGICLINK",
820    "-DCONFIG_MAGICLINK_PC",
821    "-DCONFIG_OPEN_HARMONY_PATCH",
822    "-DEAP_MSCHAPV2",
823    "-DEAP_TLS",
824    "-DEAP_PEAP",
825    "-DEAP_TTLS",
826    "-DEAP_SIM",
827    "-DEAP_PWD",
828    "-DEAP_MSCHAPv2",
829    "-DCONFIG_SHA256",
830    "-DCONFIG_ECC",
831    "-DEAP_AKA",
832    "-DEAP_AKA_PRIME",
833    "-DEAP_TLS_OPENSSL",
834    "-DCONFIG_SAE",
835    "-DCONFIG_SUITEB192",
836    "-DCONFIG_SHA384",
837    "-DCONFIG_SUITEB",
838    "-DCONFIG_SME",
839    "-DCONFIG_WEP",
840    "-DPKCS12_FUNCS",
841    "-DEAP_GTC",
842    "-DCONFIG_LIBWPA_VENDOR",
843  ]
844  if ("${CONFIG_CTRL_IFACE}" == "udp") {
845    cflags += [ "-DCONFIG_CTRL_IFACE_UDP" ]
846  } else {
847    cflags += [ "-DCONFIG_CTRL_IFACE_UNIX" ]
848  }
849
850  if (wpa_supplicant_config_wfd) {
851    cflags += [ "-DCONFIG_WIFI_DISPLAY" ]
852  }
853
854  defines = [
855    "TLS_DEFAULT_CIPHERS = \"DEFAULT:!EXP:!LOW\"",
856    "OPENSSL_SUPPRESS_DEPRECATED",
857  ]
858
859  external_deps = [ "bounds_checking_function:libsec_static" ]
860  if (wpa_supplicant_config_openssl) {
861    external_deps += [
862      "openssl:libcrypto_shared",
863      "openssl:libssl_shared",
864    ]
865  }
866  external_deps += [
867    "drivers_peripheral_wlan:hostapd_hdi_client",
868    "drivers_peripheral_wlan:wifi_driver_client",
869    "drivers_peripheral_wlan:wpa_hdi_client",
870    "init:libbegetutil",
871  ]
872  if (wpa_supplicant_config_hilog) {
873    external_deps += [ "hilog:libhilog" ]
874  }
875
876  if ("${CONFIG_DRIVER}" == "nl80211") {
877    sources += [
878      "$WPA_ROOT_DIR/src/ap/ieee802_11_he.c",
879      "$WPA_ROOT_DIR/src/ap/ieee802_11_vht.c",
880      "$WPA_ROOT_DIR/src/drivers/driver_nl80211.c",
881      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_capa.c",
882      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_event.c",
883      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_monitor.c",
884      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_scan.c",
885      "$WPA_ROOT_DIR/src/drivers/linux_ioctl.c",
886      "$WPA_ROOT_DIR/src/drivers/netlink.c",
887      "$WPA_ROOT_DIR/src/drivers/rfkill.c",
888    ]
889    include_dirs += [
890      "$WPA_ROOT_DIR/libnl/include/libnl3",
891      "$WPA_ROOT_DIR/wpa_supplicant_lib",
892    ]
893
894    cflags += [
895      "-DCONFIG_DRIVER_NL80211",
896      "-DCONFIG_LIBNL32",
897      "-DCONFIG_LIBNL20",
898      "-DCONFIG_DEBUG_FILE",
899      "-DCONFIG_IEEE80211AC",
900      "-DCONFIG_IEEE80211AX",
901    ]
902    deps = [ "//third_party/libnl:libnl_share" ]
903  } else {
904    sources += [
905      "$WPA_ROOT_DIR/src/drivers/wpa_hal.c",
906      "$WPA_ROOT_DIR/src/drivers/wpa_hal_event.c",
907    ]
908    cflags += [
909      "-DCONFIG_DRIVER_HDF",
910      "-DCONFIG_OHOS_P2P",
911    ]
912  }
913  if ("${CONFIG_HISI}" == "true") {
914    sources += [ "$WPA_ROOT_DIR/wpa_supplicant_lib/driver_nl80211_hisi.c" ]
915    cflags += [
916      "-DCONFIG_DRIVER_NL80211_HISI",
917      "-DCONFIG_P2P_160M",
918    ]
919    if (use_musl) {
920      cflags += [ "-DCONFIG_DRIVER_NL80211_HISI_TRUNK" ]
921    }
922  }
923  cflags += ext_cflags
924
925  if (wpa_supplicant_ohos_certmgr) {
926    sources += [ "$WPA_ROOT_DIR/wpa_supplicant_lib/wpa_evp_key.c" ]
927    sources += cert_manager_sources
928    external_deps += cert_manager_external_deps
929    include_dirs += cert_manager_include_dirs
930    defines += [ "CONFIG_OHOS_CERTMGR" ]
931  }
932  if (wpa_supplicant_vendor_ext) {
933    sources += wpa_vendor_ext_src
934    external_deps += [ "cJSON:cjson" ]
935  }
936  if ("${CONFIG_EAPAUTH}" == "true") {
937    cflags += [ "-DCONFIG_EAP_AUTH" ]
938  }
939  install_images = [ chipset_base_dir ]
940  configs = [ ":wpa_warnings" ]
941  part_name = "wpa_supplicant"
942  subsystem_name = "thirdparty"
943}
944
945ohos_shared_library("wpa_updater") {
946  sanitize = {
947    cfi = true
948    debug = false
949  }
950  output_name = "wpa_updater"
951  sources = wpa_base_sources
952
953  include_dirs = wpa_base_include_dirs
954
955  cflags = [
956    "-UANDROID",
957    "-fsigned-char",
958    "-DCONFIG_IEEE80211W",
959    "-DCONFIG_NO_VLAN",
960    "-DCONFIG_NO_RADIUS",
961    "-DCONFIG_NO_RANDOM_POOL",
962    "-DCONFIG_SHA256",
963    "-DCONFIG_CRYPTO_INTERNAL",
964    "-DCONFIG_INTERNAL_LIBTOMMATH",
965    "-DCONFIG_INTERNAL_SHA384",
966    "-DCONFIG_INTERNAL_SHA512",
967    "-DCONFIG_CTRL_IFACE",
968    "-DCONFIG_IBSS_RSN",
969    "-DIEEE8021X_EAPOL",
970    "-DUSERSPACE_CLIENT_SUPPORT",
971    "-DCONFIG_BACKEND_FILE",
972    "-DCONFIG_NO_CONFIG_BLOBS",
973    "-DCONFIG_NO_ACCOUNTING",
974    "-DEAP_SERVER_IDENTITY",
975    "-DCONFIG_IEEE80211N",
976    "-DHOSTAPD",
977    "-DNEED_AP_MLME",
978    "-DCONFIG_WPS",
979    "-DCONFIG_AP",
980    "-DCONFIG_P2P",
981    "-DEAP_WSC",
982    "-DEAP_SERVER_WSC",
983    "-DEAP_SERVER",
984    "-DCONFIG_GAS",
985    "-DCONFIG_OFFCHANNEL",
986    "-DCONFIG_MAGICLINK",
987    "-DCONFIG_OPEN_HARMONY_PATCH",
988    "-DEAP_MSCHAPV2",
989    "-DEAP_TLS",
990    "-DEAP_PEAP",
991    "-DEAP_TTLS",
992    "-DEAP_SIM",
993    "-DEAP_PWD",
994    "-DEAP_MSCHAPv2",
995    "-DCONFIG_SHA256",
996    "-DCONFIG_ECC",
997    "-DEAP_AKA",
998    "-DEAP_AKA_PRIME",
999    "-DEAP_TLS_OPENSSL",
1000    "-DCONFIG_SAE",
1001    "-DCONFIG_SUITEB192",
1002    "-DCONFIG_SHA384",
1003    "-DCONFIG_SUITEB",
1004    "-DCONFIG_SME",
1005    "-DCONFIG_WEP",
1006    "-DPKCS12_FUNCS",
1007    "-DEAP_GTC",
1008  ]
1009  if ("${CONFIG_CTRL_IFACE}" == "udp") {
1010    cflags += [ "-DCONFIG_CTRL_IFACE_UDP" ]
1011  } else {
1012    cflags += [ "-DCONFIG_CTRL_IFACE_UNIX" ]
1013  }
1014
1015  if (wpa_supplicant_config_wfd) {
1016    cflags += [ "-DCONFIG_WIFI_DISPLAY" ]
1017  }
1018
1019  defines = [
1020    "TLS_DEFAULT_CIPHERS = \"DEFAULT:!EXP:!LOW\"",
1021    "OPENSSL_SUPPRESS_DEPRECATED",
1022  ]
1023  external_deps = [
1024    "bounds_checking_function:libsec_static",
1025    "drivers_peripheral_wlan:wpa_hdi_client",
1026    "init:libbegetutil",
1027  ]
1028  if (wpa_supplicant_config_openssl) {
1029    external_deps += [
1030      "openssl:libcrypto_shared",
1031      "openssl:libssl_shared",
1032    ]
1033  }
1034
1035  if (wpa_supplicant_config_hilog) {
1036    external_deps += [ "hilog:libhilog" ]
1037  }
1038
1039  if ("${CONFIG_DRIVER}" == "nl80211") {
1040    sources += [
1041      "$WPA_ROOT_DIR/src/ap/ieee802_11_he.c",
1042      "$WPA_ROOT_DIR/src/ap/ieee802_11_vht.c",
1043      "$WPA_ROOT_DIR/src/drivers/driver_nl80211.c",
1044      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_capa.c",
1045      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_event.c",
1046      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_monitor.c",
1047      "$WPA_ROOT_DIR/src/drivers/driver_nl80211_scan.c",
1048      "$WPA_ROOT_DIR/src/drivers/linux_ioctl.c",
1049      "$WPA_ROOT_DIR/src/drivers/netlink.c",
1050      "$WPA_ROOT_DIR/src/drivers/rfkill.c",
1051    ]
1052    include_dirs += [
1053      "$WPA_ROOT_DIR/libnl/include/libnl3",
1054      "$WPA_ROOT_DIR/wpa_supplicant_lib",
1055    ]
1056
1057    cflags += [
1058      "-DCONFIG_DRIVER_NL80211",
1059      "-DCONFIG_LIBNL32",
1060      "-DCONFIG_LIBNL20",
1061      "-DCONFIG_DEBUG_FILE",
1062      "-DCONFIG_IEEE80211AC",
1063      "-DCONFIG_IEEE80211AX",
1064    ]
1065    deps = [ "//third_party/libnl:libnl_share" ]
1066  } else {
1067    sources += [
1068      "$WPA_ROOT_DIR/src/drivers/wpa_hal.c",
1069      "$WPA_ROOT_DIR/src/drivers/wpa_hal_event.c",
1070    ]
1071    cflags += [
1072      "-DCONFIG_DRIVER_HDF",
1073      "-DCONFIG_OHOS_P2P",
1074    ]
1075  }
1076  if ("${CONFIG_HISI}" == "true") {
1077    sources += [ "$WPA_ROOT_DIR/wpa_supplicant_lib/driver_nl80211_hisi.c" ]
1078    cflags += [ "-DCONFIG_DRIVER_NL80211_HISI" ]
1079    if (use_musl) {
1080      cflags += [ "-DCONFIG_DRIVER_NL80211_HISI_TRUNK" ]
1081    }
1082  }
1083  symlink_target_name = [ "libwpa.z.so" ]
1084  configs = [ ":wpa_warnings" ]
1085  part_name = "wpa_supplicant"
1086  subsystem_name = "thirdparty"
1087  install_images = [ "updater" ]
1088}
1089
1090ohos_executable("wpa_cli") {
1091  sources = [
1092    "$WPA_ROOT_DIR/src/common/cli.c",
1093    "$WPA_ROOT_DIR/src/common/wpa_ctrl.c",
1094    "$WPA_ROOT_DIR/src/utils/${CONFIG_ELOOP}.c",
1095    "$WPA_ROOT_DIR/src/utils/common.c",
1096    "$WPA_ROOT_DIR/src/utils/edit_simple.c",
1097    "$WPA_ROOT_DIR/src/utils/os_${CONFIG_OS}.c",
1098    "$WPA_ROOT_DIR/src/utils/wpa_debug.c",
1099    "$WPA_ROOT_DIR/wpa_supplicant/wpa_cli.c",
1100  ]
1101
1102  include_dirs = [
1103    "$WPA_ROOT_DIR/src",
1104    "$WPA_ROOT_DIR/src/utils",
1105    "$WPA_ROOT_DIR/src/drivers",
1106    "$WPA_ROOT_DIR/wpa_supplicant",
1107    "$WPA_ROOT_DIR/build/include",
1108  ]
1109
1110  cflags = [
1111    "-UANDROID",
1112    "-fsigned-char",
1113    "-DCONFIG_IEEE80211W",
1114    "-DCONFIG_NO_VLAN",
1115    "-DCONFIG_NO_RADIUS",
1116    "-DCONFIG_NO_RANDOM_POOL",
1117    "-DCONFIG_SHA256",
1118    "-DCONFIG_CRYPTO_INTERNAL",
1119    "-DCONFIG_INTERNAL_LIBTOMMATH",
1120    "-DCONFIG_INTERNAL_SHA384",
1121    "-DCONFIG_INTERNAL_SHA512",
1122    "-DCONFIG_CTRL_IFACE",
1123    "-DCONFIG_IBSS_RSN",
1124    "-DIEEE8021X_EAPOL",
1125    "-DUSERSPACE_CLIENT_SUPPORT",
1126    "-DCONFIG_BACKEND_FILE",
1127    "-DCONFIG_NO_CONFIG_BLOBS",
1128    "-DCONFIG_WPS",
1129    "-DCONFIG_AP",
1130    "-DCONFIG_P2P",
1131    "-DEAP_WSC",
1132    "-DEAP_SERVER_WSC",
1133    "-DEAP_SERVER",
1134    "-DCONFIG_GAS",
1135    "-DCONFIG_OFFCHANNEL",
1136    "-DCONFIG_MAGICLINK",
1137    "-DCONFIG_DEBUG_FILE",
1138    "-DCONFIG_OPEN_HARMONY_PATCH",
1139  ]
1140  if ("${CONFIG_CTRL_IFACE}" == "udp") {
1141    cflags += [ "-DCONFIG_CTRL_IFACE_UDP" ]
1142  } else {
1143    cflags += [ "-DCONFIG_CTRL_IFACE_UNIX" ]
1144  }
1145
1146  if (wpa_supplicant_config_wfd) {
1147    cflags += [ "-DCONFIG_WIFI_DISPLAY" ]
1148  }
1149
1150  if ("${CONFIG_DRIVER}" == "nl80211") {
1151    include_dirs += [ "$WPA_ROOT_DIR/libnl/include/libnl3" ]
1152    cflags += [
1153      "-DCONFIG_DRIVER_NL80211",
1154      "-DCONFIG_LIBNL32",
1155    ]
1156  } else {
1157    cflags += [
1158      "-DCONFIG_DRIVER_HDF",
1159      "-DCONFIG_OHOS_P2P",
1160    ]
1161  }
1162
1163  if (wpa_supplicant_vendor_ext) {
1164    include_dirs += wpa_vendor_ext_inc_path
1165    sources += wpa_vendor_ext_src_cli
1166    cflags += ext_cflags
1167  }
1168
1169  external_deps = [ "init:libbegetutil" ]
1170  if (wpa_supplicant_config_hilog) {
1171    external_deps += [ "hilog:libhilog" ]
1172  }
1173
1174  configs = [ ":wpa_warnings" ]
1175  part_name = "wpa_supplicant"
1176  subsystem_name = "thirdparty"
1177}
1178
1179ohos_executable("hostapd_cli") {
1180  sources = [
1181    "$WPA_ROOT_DIR/hostapd/hostapd_cli.c",
1182    "$WPA_ROOT_DIR/src/common/cli.c",
1183    "$WPA_ROOT_DIR/src/common/wpa_ctrl.c",
1184    "$WPA_ROOT_DIR/src/utils/${CONFIG_ELOOP}.c",
1185    "$WPA_ROOT_DIR/src/utils/common.c",
1186    "$WPA_ROOT_DIR/src/utils/edit_simple.c",
1187    "$WPA_ROOT_DIR/src/utils/os_${CONFIG_OS}.c",
1188    "$WPA_ROOT_DIR/src/utils/wpa_debug.c",
1189  ]
1190
1191  include_dirs = [
1192    "$WPA_ROOT_DIR/src",
1193    "$WPA_ROOT_DIR/src/utils",
1194    "$WPA_ROOT_DIR/src/drivers",
1195    "$WPA_ROOT_DIR/wpa_supplicant",
1196    "$WPA_ROOT_DIR/build/include",
1197    "$WPA_ROOT_DIR/libnl/include/libnl3",
1198  ]
1199
1200  cflags = [
1201    "-UANDROID",
1202    "-fsigned-char",
1203    "-DCONFIG_IEEE80211W",
1204    "-DCONFIG_NO_VLAN",
1205    "-DCONFIG_NO_RADIUS",
1206    "-DCONFIG_NO_RANDOM_POOL",
1207    "-DCONFIG_SHA256",
1208    "-DCONFIG_CRYPTO_INTERNAL",
1209    "-DCONFIG_INTERNAL_LIBTOMMATH",
1210    "-DCONFIG_INTERNAL_SHA384",
1211    "-DCONFIG_INTERNAL_SHA512",
1212    "-DCONFIG_CTRL_IFACE",
1213    "-DCONFIG_IBSS_RSN",
1214    "-DIEEE8021X_EAPOL",
1215    "-DUSERSPACE_CLIENT_SUPPORT",
1216    "-DCONFIG_BACKEND_FILE",
1217    "-DCONFIG_NO_CONFIG_BLOBS",
1218    "-DCONFIG_NO_ACCOUNTING",
1219    "-DEAP_SERVER_IDENTITY",
1220    "-DCONFIG_IEEE80211N",
1221    "-DHOSTAPD",
1222    "-DNEED_AP_MLME",
1223    "-DCONFIG_WPS",
1224    "-DCONFIG_AP",
1225    "-DCONFIG_P2P",
1226    "-DEAP_WSC",
1227    "-DEAP_SERVER_WSC",
1228    "-DEAP_SERVER",
1229    "-DCONFIG_GAS",
1230    "-DCONFIG_OFFCHANNEL",
1231    "-DCONFIG_DEBUG_FILE",
1232    "-DCONFIG_OPEN_HARMONY_PATCH",
1233  ]
1234
1235  if ("${CONFIG_CTRL_IFACE}" == "udp") {
1236    cflags += [ "-DCONFIG_CTRL_IFACE_UDP" ]
1237  } else {
1238    cflags += [ "-DCONFIG_CTRL_IFACE_UNIX" ]
1239  }
1240
1241  if (wpa_supplicant_config_wfd) {
1242    cflags += [ "-DCONFIG_WIFI_DISPLAY" ]
1243  }
1244
1245  external_deps = [ "init:libbegetutil" ]
1246  if (wpa_supplicant_config_hilog) {
1247    external_deps += [ "hilog:libhilog" ]
1248  }
1249
1250  if ("${CONFIG_DRIVER}" == "nl80211") {
1251    cflags += [
1252      "-DCONFIG_DRIVER_NL80211",
1253      "-DCONFIG_LIBNL32",
1254    ]
1255  } else {
1256    cflags += [
1257      "-DCONFIG_DRIVER_HDF",
1258      "-DCONFIG_OHOS_P2P",
1259    ]
1260  }
1261  configs = [ ":wpa_warnings" ]
1262  part_name = "wpa_supplicant"
1263  subsystem_name = "thirdparty"
1264}
1265
1266ohos_executable("wpa_supplicant") {
1267  sources = [ "$WPA_ROOT_DIR/wpa_test/wpa_sample.c" ]
1268
1269  include_dirs = [ "$WPA_ROOT_DIR/build/include" ]
1270
1271  deps = [ "//third_party/wpa_supplicant/wpa_supplicant-2.9_standard:wpa" ]
1272  configs = [ ":wpa_warnings" ]
1273  cflags = [
1274    "-DCONFIG_DEBUG_FILE",
1275    "-DCONFIG_OPEN_HARMONY_PATCH",
1276  ]
1277  install_images = [ chipset_base_dir ]
1278  part_name = "wpa_supplicant"
1279  subsystem_name = "thirdparty"
1280}
1281
1282ohos_executable("hostapd") {
1283  sources = [ "$WPA_ROOT_DIR/hostapd_test/hostapd_sample.c" ]
1284
1285  include_dirs = [ "$WPA_ROOT_DIR/build/include" ]
1286
1287  deps = [ "//third_party/wpa_supplicant/wpa_supplicant-2.9_standard:wpa" ]
1288
1289  configs = [ ":wpa_warnings" ]
1290  cflags = [
1291    "-DCONFIG_DEBUG_FILE",
1292    "-DCONFIG_OPEN_HARMONY_PATCH",
1293  ]
1294  install_images = [ chipset_base_dir ]
1295  part_name = "wpa_supplicant"
1296  subsystem_name = "thirdparty"
1297}
1298
1299group("wpa_supplicant_test") {
1300  testonly = true
1301  if (wpa_supplicant_vendor_ext) {
1302    deps = [ "//vendor/huawei/foundation/communication/wpa_supplicant_ext/test:wpa_vendor_test" ]
1303  }
1304}
1305