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