1# Copyright (c) 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_ext/netmanager_ext_config.gni") 16 17config("net_conn_manager_if_config") { 18 include_dirs = [ 19 "include", 20 "include/ipc", 21 "$EXT_INNERKITS_ROOT/include", 22 ] 23 24 defines = [] 25 if (is_double_framework) { 26 defines += [ "CONFIG_DUAL_FRAMEWORK" ] 27 } 28 if (target_cpu == "arm") { 29 defines += [ "BINDER_IPC_32BIT" ] 30 } 31 if (is_standard_system) { 32 defines += [ "CONFIG_STANDARD_SYSTEM" ] 33 } 34 if (defined(build_public_version) && build_public_version) { 35 defines += [ "BUILD_PUBLIC_VERSION" ] 36 } 37 38 cflags = common_cflags 39 40 cflags_cc = common_cflags 41} 42 43ohos_static_library("netfirewall_parcel") { 44 sanitize = { 45 cfi = true 46 cfi_cross_dso = true 47 debug = false 48 } 49 50 sources = [ "$NETFIREWALL_EXTENSION_SOURCE_DIR/src/netfirewall_common.cpp" ] 51 52 include_dirs = [ 53 "$EXT_INNERKITS_ROOT/include", 54 "$EXT_INNERKITS_ROOT/netfirewallclient/include", 55 ] 56 57 external_deps = [ 58 "c_utils:utils", 59 "hilog:libhilog", 60 "netmanager_base:net_manager_common", 61 "netmanager_base:net_conn_manager_if", 62 "netmanager_base:net_native_manager_if", 63 ] 64 65 part_name = "netmanager_ext" 66 subsystem_name = "communication" 67} 68 69ohos_shared_library("netfirewall_manager_if") { 70 sanitize = { 71 cfi = true 72 cfi_cross_dso = true 73 debug = false 74 } 75 76 if (netmanager_ext_feature_net_firewall) { 77 sources = [ 78 "$NETFIREWALL_EXTENSION_SOURCE_DIR/src/netfirewall_client.cpp", 79 "$NETFIREWALL_EXTENSION_SOURCE_DIR/src/netfirewall_proxy.cpp", 80 ] 81 82 public_configs = [ 83 ":net_conn_manager_if_config", 84 "$NETMANAGER_EXT_ROOT/resource:coverage_flags", 85 ] 86 87 deps = [ ":netfirewall_parcel" ] 88 89 external_deps = [ 90 "hilog:libhilog", 91 "ipc:ipc_single", 92 "netmanager_base:net_manager_common", 93 "netmanager_base:net_native_manager_if", 94 "samgr:samgr_proxy", 95 ] 96 97 defines = [ 98 "NETMGR_LOG_TAG = \"NetFirewallManager\"", 99 "LOG_DOMAIN = 0xD0015B0", 100 ] 101 102 if (enable_netmgr_ext_debug) { 103 defines += [ "NETMGR_DEBUG" ] 104 } 105 106 part_name = "netmanager_ext" 107 subsystem_name = "communication" 108 } 109} 110