1# Copyright (c) 2021 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 17ohos_shared_library("net_policy_manager") { 18 sources = [ 19 "src/common/net_policy_event_handler.cpp", 20 "src/common/net_policy_service_common.cpp", 21 "src/common/netsys_policy_wrapper.cpp", 22 "src/core/net_policy_base.cpp", 23 "src/core/net_policy_callback.cpp", 24 "src/core/net_policy_core.cpp", 25 "src/core/net_policy_file.cpp", 26 "src/core/net_policy_firewall.cpp", 27 "src/core/net_policy_rule.cpp", 28 "src/core/net_policy_traffic.cpp", 29 "src/firewall_rule/device_idle_firewall_rule.cpp", 30 "src/firewall_rule/firewall_rule.cpp", 31 "src/net_policy_service.cpp", 32 "src/stub/net_policy_callback_proxy.cpp", 33 "src/stub/net_policy_service_stub.cpp", 34 ] 35 36 include_dirs = [ 37 "$INNERKITS_ROOT/include", 38 "$INNERKITS_ROOT/netpolicyclient/include", 39 "$INNERKITS_ROOT/netpolicyclient/include/proxy", 40 "$INNERKITS_ROOT/netconnclient/include", 41 "$NETCONNMANAGER_COMMON_DIR/include", 42 "$NETMANAGER_BASE_ROOT/utils/log/include", 43 "include", 44 "include/stub", 45 "$NETSYSCONTROLLER_ROOT_DIR/include", 46 "$NETSYSNATIVE_SOURCE_DIR/include/netsys", 47 "$SAMGR_MANAGER_ROOT/interfaces/innerkits/samgr_proxy/include", 48 ] 49 50 deps = [ 51 "$INNERKITS_ROOT/netpolicyclient:net_policy_parcel", 52 "$NETCONNMANAGER_COMMON_DIR:net_service_common", 53 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 54 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 55 "$THIRD_PARTY_ROOT/jsoncpp:jsoncpp", 56 ] 57 58 external_deps = [ 59 "ability_base:want", 60 "c_utils:utils", 61 "common_event_service:cesfwk_innerkits", 62 "eventhandler:libeventhandler", 63 "hitrace_native:hitrace_meter", 64 "ipc:ipc_core", 65 "netmanager_base:net_stats_manager_if", 66 "safwk:system_ability_fwk", 67 ] 68 69 defines = [ 70 "NETMGR_LOG_TAG = \"NetPolicyService\"", 71 "LOG_DOMAIN = 0xD0015B0", 72 ] 73 74 if (enable_netmgr_debug) { 75 defines += [ "NETMGR_DEBUG" ] 76 } 77 78 if (is_standard_system) { 79 external_deps += [ "hiviewdfx_hilog_native:libhilog" ] 80 } else { 81 external_deps += [ "hilog:libhilog" ] 82 } 83 84 part_name = "netmanager_base" 85 subsystem_name = "communication" 86} 87