• 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_base/netmanager_base_config.gni")
16config("netsys_controller_include") {
17  include_dirs = [
18    "include",
19    "$NETSYSNATIVE_SOURCE_DIR/include/netsys",
20    "$INNERKITS_ROOT/netstatsclient/include",
21  ]
22
23  cflags = common_cflags
24
25  cflags_cc = common_cflags
26
27  if (netmanager_base_enable_feature_sysvpn) {
28    cflags += [ "-DSUPPORT_SYSVPN" ]
29    cflags_cc += [ "-DSUPPORT_SYSVPN" ]
30  }
31}
32
33ohos_shared_library("netsys_controller") {
34  sanitize = {
35    cfi = true
36    cfi_cross_dso = true
37    boundary_sanitize = true
38    ubsan = true
39    debug = false
40  }
41
42  branch_protector_ret = "pac_ret"
43
44  public_configs = [ ":netsys_controller_include" ]
45  sources = [
46    "src/mock_netsys_native_client.cpp",
47    "src/netsys_controller.cpp",
48    "src/netsys_controller_service_impl.cpp",
49    "src/netsys_native_client.cpp",
50  ]
51
52  include_dirs = [
53    "include",
54    "$NETCONNMANAGER_SOURCE_DIR/include",
55    "$NETCONNMANAGER_COMMON_DIR/include",
56    "$NETSYSNATIVE_INNERKITS_SOURCE_DIR",
57    "$INNERKITS_ROOT/netmanagernative/include",
58    "$NETSYSNATIVE_SOURCE_DIR/include/netsys",
59    "$NETSYSNATIVE_SOURCE_DIR/include/manager",
60  ]
61
62  deps = [
63    "$NETMANAGER_BASE_ROOT/services/netmanagernative:netsys_native_manager",
64    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
65  ]
66
67  external_deps = [
68    "c_utils:utils",
69    "ipc:ipc_core",
70    "samgr:samgr_proxy",
71  ]
72
73  defines = [
74    "NETMGR_LOG_TAG = \"NetConnManager\"",
75    "LOG_DOMAIN = 0xD0015B0",
76  ]
77
78  if (enable_netmgr_debug) {
79    defines += [ "NETMGR_DEBUG" ]
80  }
81
82  if (enable_sys_func) {
83    defines += [ "SYS_FUNC" ]
84  }
85
86  if (netmanager_base_enable_feature_wearable_distributed_net) {
87    defines += [ "FEATURE_WEARABLE_DISTRIBUTED_NET_ENABLE" ]
88  }
89
90  if (netmanager_base_enable_feature_net_firewall) {
91    defines += [ "FEATURE_NET_FIREWALL_ENABLE" ]
92  }
93
94  if (netmanager_base_feature_enterprise_route_custom) {
95    defines += [ "FEATURE_ENTERPRISE_ROUTE_CUSTOM" ]
96  }
97
98  external_deps += [ "hilog:libhilog" ]
99
100  innerapi_tags = [ "platformsdk_indirect" ]
101  part_name = "netmanager_base"
102  subsystem_name = "communication"
103}
104
105ohos_static_library("netsys_controller_static") {
106  testonly = true
107
108  sanitize = {
109    boundary_sanitize = true
110    ubsan = true
111    debug = false
112  }
113
114  branch_protector_ret = "pac_ret"
115
116  public_configs = [ ":netsys_controller_include" ]
117  sources = [
118    "src/mock_netsys_native_client.cpp",
119    "src/netsys_controller.cpp",
120    "src/netsys_controller_service_impl.cpp",
121    "src/netsys_native_client.cpp",
122  ]
123
124  include_dirs = [
125    "include",
126    "$NETCONNMANAGER_SOURCE_DIR/include",
127    "$NETCONNMANAGER_COMMON_DIR/include",
128    "$NETSYSNATIVE_INNERKITS_SOURCE_DIR",
129    "$INNERKITS_ROOT/netmanagernative/include",
130    "$INNERKITS_ROOT/netconnclient/include",
131    "$NETMANAGER_BASE_ROOT/utils/common_utils/include",
132    "$NETSYSNATIVE_SOURCE_DIR/include/netsys",
133    "$NETSYSNATIVE_SOURCE_DIR/include/manager",
134  ]
135
136  deps = [
137    "$NETMANAGER_BASE_ROOT/services/netmanagernative:netsys_native_manager",
138    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
139  ]
140
141  external_deps = [
142    "c_utils:utils",
143    "ipc:ipc_core",
144    "samgr:samgr_proxy",
145  ]
146
147  defines = [
148    "NETMGR_LOG_TAG = \"NetConnManager\"",
149    "LOG_DOMAIN = 0xD0015B0",
150  ]
151
152  if (enable_netmgr_debug) {
153    defines += [ "NETMGR_DEBUG" ]
154  }
155
156  if (enable_sys_func) {
157    defines += [ "SYS_FUNC" ]
158  }
159
160  if (netmanager_base_enable_feature_wearable_distributed_net) {
161    defines += [ "FEATURE_WEARABLE_DISTRIBUTED_NET_ENABLE" ]
162  }
163
164  if (netmanager_base_enable_feature_net_firewall) {
165    defines += [ "FEATURE_NET_FIREWALL_ENABLE" ]
166  }
167
168  if (netmanager_base_feature_enterprise_route_custom) {
169    defines += [ "FEATURE_ENTERPRISE_ROUTE_CUSTOM" ]
170  }
171
172  external_deps += [ "hilog:libhilog" ]
173
174  part_name = "netmanager_base"
175  subsystem_name = "communication"
176}
177