• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2024 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")
15import("//foundation/communication/netmanager_ext/netmanager_ext_config.gni")
16
17ohos_shared_library("ethernet_manager") {
18  sanitize = {
19    cfi = true
20    cfi_cross_dso = true
21    debug = false
22  }
23
24  branch_protector_ret = "pac_ret"
25
26  sources = [
27    "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/interface_state_callback_proxy.cpp",
28    "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/interface_state_callback_stub.cpp",
29    "src/dev_interface_state.cpp",
30    "src/ethernet_configuration.cpp",
31    "src/ethernet_dhcp_controller.cpp",
32    "src/ethernet_lan_management.cpp",
33    "src/ethernet_management.cpp",
34    "src/ethernet_service.cpp",
35    "src/ethernet_service_common.cpp",
36    "src/net_eap_callback_proxy.cpp",
37    "src/net_eap_handler.cpp",
38  ]
39
40  include_dirs = [
41    "include",
42    "include/stub",
43    "$EXT_INNERKITS_ROOT/include",
44    "$EXT_INNERKITS_ROOT/ethernetclient/include",
45    "$EXT_INNERKITS_ROOT/ethernetclient/include/proxy",
46  ]
47
48  cflags = common_cflags
49
50  cflags_cc = common_cflags
51
52  deps = [ "$EXT_INNERKITS_ROOT/ethernetclient:ethernet_parcel" ]
53  deps += [ "$EXT_INNERKITS_ROOT/ethernetclient:ethernet_service_interface_stub" ]
54
55  external_deps = [
56    "bounds_checking_function:libsec_shared",
57    "cJSON:cjson",
58    "dhcp:dhcp_sdk",
59    "eventhandler:libeventhandler",
60    "ffrt:libffrt",
61    "init:libbegetutil",
62    "ipc:ipc_core",
63    "netmanager_base:net_conn_manager_if",
64    "netmanager_base:net_manager_common",
65    "netmanager_base:net_native_manager_if",
66    "netmanager_base:net_service_common",
67    "netmanager_base:net_stats_manager_if",
68    "netmanager_base:netsys_controller",
69    "safwk:system_ability_fwk",
70    "samgr:samgr_proxy",
71  ]
72
73  defines = [
74    "NETMGR_LOG_TAG = \"EthernetManager\"",
75    "LOG_DOMAIN = 0xD0015B0",
76    "USER_CONFIG_DIR = \"/data/service/el1/public/netmanager/ethernet\"",
77    "NETWORK_CONFIG_PATH = \"/system/etc/communication/netmanager_ext/ethernet_interfaces.json\"",
78  ]
79
80  if (netmanager_ext_extensible_authentication) {
81    defines += [ "NET_EXTENSIBLE_AUTHENTICATION" ]
82    external_deps += [
83      "drivers_interface_ethernet:libethernet_proxy_1.0",
84      "hdf_core:libhdf_ipc_adapter",
85      "hdf_core:libhdi",
86    ]
87    sources += [
88      "src/eap_hdi_wpa_manager.cpp"
89    ]
90  }
91
92  if (enable_netmgr_ext_debug) {
93    defines += [ "NETMGR_DEBUG" ]
94  }
95
96  external_deps += [ "hilog:libhilog" ]
97
98  part_name = "netmanager_ext"
99  subsystem_name = "communication"
100}
101
102ohos_prebuilt_etc("ethernet_interfaces") {
103  source = "$NETMANAGER_EXT_ROOT/services/ethernetmanager/config/ethernet_interfaces.json"
104  install_enable = true
105  relative_install_dir = "communication/netmanager_ext"
106  part_name = "netmanager_ext"
107  subsystem_name = "communication"
108}
109