• 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
14import("//build/ohos.gni")
15import("//foundation/communication/netmanager_base/netmanager_base_config.gni")
16
17config("net_conn_manager_config") {
18  include_dirs = [
19    "include",
20    "include/stub",
21    "$INNERKITS_ROOT/include",
22    "$INNERKITS_ROOT/netconnclient/include",
23    "$INNERKITS_ROOT/netconnclient/include/proxy",
24    "$INNERKITS_ROOT/netmanagernative/include",
25    "$INNERKITS_ROOT/netstatsclient/include",
26    "$NETCONNMANAGER_COMMON_DIR/include",
27    "$NETSYSNATIVE_SOURCE_DIR/include/netsys",
28    "$NETSYSCONTROLLER_ROOT_DIR/include",
29    "$NETMANAGER_BASE_ROOT/services/netmanagernative/fwmarkclient/include",
30    "$INNERKITS_ROOT/netmanagernative/include",
31    "$SAMGR_MANAGER_ROOT/interfaces/innerkits/samgr_proxy/include",
32    "$THIRD_PARTY_ROOT/curl/include",
33  ]
34}
35
36ohos_shared_library("net_conn_manager") {
37  sanitize = {
38    cfi = true
39    cfi_cross_dso = true
40    boundary_sanitize = true
41    all_ubsan = true
42    blocklist = "./connect_blocklist.txt"
43    debug = false
44  }
45
46  sources = [
47    "$NETCONNMANAGER_COMMON_DIR/src/route_utils.cpp",
48    "src/dns_result_call_back.cpp",
49    "src/net_activate.cpp",
50    "src/net_caps.cpp",
51    "src/net_conn_event_handler.cpp",
52    "src/net_conn_service.cpp",
53    "src/net_conn_service_iface.cpp",
54    "src/net_datashare_utils.cpp",
55    "src/net_factoryreset_callback.cpp",
56    "src/net_http_probe.cpp",
57    "src/net_http_probe_result.cpp",
58    "src/net_http_proxy_tracker.cpp",
59    "src/net_monitor.cpp",
60    "src/net_score.cpp",
61    "src/net_supplier.cpp",
62    "src/network.cpp",
63    "src/stub/net_conn_callback_proxy.cpp",
64    "src/stub/net_conn_service_stub.cpp",
65    "src/stub/net_detection_callback_proxy.cpp",
66    "src/stub/net_factoryreset_callback_proxy.cpp",
67    "src/stub/net_interface_callback_proxy.cpp",
68    "src/stub/net_supplier_callback_proxy.cpp",
69  ]
70
71  configs = [ ":net_conn_manager_config" ]
72
73  deps = [
74    "$NETCONNMANAGER_COMMON_DIR:net_service_common",
75    "$NETMANAGER_BASE_ROOT/services/netmanagernative:netsys_native_manager",
76    "$NETMANAGER_BASE_ROOT/services/netmanagernative/fwmarkclient:fwmark_client",
77    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
78    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
79    "$THIRD_PARTY_ROOT/curl:curl_shared",
80  ]
81
82  cflags = [
83    "-fvisibility=hidden",
84    "-fdata-sections",
85    "-ffunction-sections",
86    "-Os",
87    "-fstack-protector-strong",
88    "-D_FORTIFY_SOURCE=2",
89    "-O2",
90  ]
91
92  cflags_cc = [
93    "-fvisibility-inlines-hidden",
94    "-Os",
95    "-fstack-protector-strong",
96    "-D_FORTIFY_SOURCE=2",
97    "-O2",
98  ]
99
100  ldflags = [
101    "-Wl,--exclude-libs=ALL",
102    "-Wl,--gc-sections",
103  ]
104
105  external_deps = [
106    "ability_base:zuri",
107    "ability_runtime:ability_manager",
108    "c_utils:utils",
109    "common_event_service:cesfwk_innerkits",
110    "data_share:datashare_common",
111    "data_share:datashare_consumer",
112    "eventhandler:libeventhandler",
113    "ipc:ipc_core",
114    "safwk:system_ability_fwk",
115    "samgr:samgr_proxy",
116  ]
117
118  defines = [
119    "NETMGR_LOG_TAG = \"NetConnManager\"",
120    "LOG_DOMAIN = 0xD0015B0",
121  ]
122
123  if (enable_netmgr_debug) {
124    defines += [ "NETMGR_DEBUG" ]
125  }
126
127  if (enable_sys_func) {
128    defines += [ "SYS_FUNC" ]
129  }
130
131  external_deps += [ "hilog:libhilog" ]
132
133  part_name = "netmanager_base"
134  subsystem_name = "communication"
135}
136
137ohos_static_library("net_conn_manager_static") {
138  testonly = true
139  sanitize = {
140    cfi = true
141    cfi_cross_dso = true
142    debug = false
143  }
144  sources = [
145    "$NETCONNMANAGER_COMMON_DIR/src/route_utils.cpp",
146    "src/dns_result_call_back.cpp",
147    "src/net_activate.cpp",
148    "src/net_caps.cpp",
149    "src/net_conn_event_handler.cpp",
150    "src/net_conn_service.cpp",
151    "src/net_conn_service_iface.cpp",
152    "src/net_datashare_utils.cpp",
153    "src/net_factoryreset_callback.cpp",
154    "src/net_http_probe.cpp",
155    "src/net_http_probe_result.cpp",
156    "src/net_http_proxy_tracker.cpp",
157    "src/net_monitor.cpp",
158    "src/net_score.cpp",
159    "src/net_supplier.cpp",
160    "src/network.cpp",
161    "src/stub/net_conn_callback_proxy.cpp",
162    "src/stub/net_conn_service_stub.cpp",
163    "src/stub/net_detection_callback_proxy.cpp",
164    "src/stub/net_factoryreset_callback_proxy.cpp",
165    "src/stub/net_interface_callback_proxy.cpp",
166    "src/stub/net_supplier_callback_proxy.cpp",
167  ]
168
169  configs = [ ":net_conn_manager_config" ]
170
171  deps = [
172    "$NETCONNMANAGER_COMMON_DIR:net_service_common",
173    "$NETMANAGER_BASE_ROOT/services/netmanagernative:netsys_native_manager",
174    "$NETMANAGER_BASE_ROOT/services/netmanagernative/fwmarkclient:fwmark_client",
175    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
176    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
177    "$THIRD_PARTY_ROOT/curl:curl_shared",
178  ]
179
180  external_deps = [
181    "ability_base:zuri",
182    "ability_runtime:ability_manager",
183    "c_utils:utils",
184    "common_event_service:cesfwk_innerkits",
185    "data_share:datashare_common",
186    "data_share:datashare_consumer",
187    "eventhandler:libeventhandler",
188    "ipc:ipc_core",
189    "safwk:system_ability_fwk",
190    "samgr:samgr_proxy",
191  ]
192
193  defines = [
194    "NETMGR_LOG_TAG = \"NetConnManager\"",
195    "LOG_DOMAIN = 0xD0015B0",
196  ]
197
198  if (enable_netmgr_debug) {
199    defines += [ "NETMGR_DEBUG" ]
200  }
201
202  if (enable_sys_func) {
203    defines += [ "SYS_FUNC" ]
204  }
205
206  external_deps += [ "hilog:libhilog" ]
207
208  part_name = "netmanager_base"
209  subsystem_name = "communication"
210}
211