1# Copyright (c) 2023-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_ext/netmanager_ext_config.gni") 16 17config("net_conn_manager_if_config") { 18 include_dirs = [ 19 "include", 20 "include/ipc", 21 "$NETMANAGERNATIVE_ROOT/fwmarkclient/include", 22 "$EXT_INNERKITS_ROOT/include", 23 "$NETMANAGER_EXT_ROOT/utils/log/include", 24 ] 25 26 defines = [] 27 if (is_double_framework) { 28 defines += [ "CONFIG_DUAL_FRAMEWORK" ] 29 } 30 if (target_cpu == "arm") { 31 defines += [ "BINDER_IPC_32BIT" ] 32 } 33 if (is_standard_system) { 34 defines += [ "CONFIG_STANDARD_SYSTEM" ] 35 } 36 if (defined(build_public_version) && build_public_version) { 37 defines += [ "BUILD_PUBLIC_VERSION" ] 38 } 39 40 cflags = [ 41 "-fstack-protector-strong", 42 "-D_FORTIFY_SOURCE=2", 43 "-O2", 44 ] 45 46 cflags_cc = [ 47 "-fstack-protector-strong", 48 "-D_FORTIFY_SOURCE=2", 49 "-O2", 50 ] 51 52 if (netmanager_ext_feature_sysvpn) { 53 cflags += sysvpn_flags 54 cflags_cc += sysvpn_flags 55 } 56} 57 58ohos_source_set("networkvpn_parcel") { 59 sanitize = { 60 cfi = true 61 cfi_cross_dso = true 62 debug = false 63 } 64 65 branch_protector_ret = "pac_ret" 66 67 sources = [ "$VPN_INNERKITS_SOURCE_DIR/src/vpn_config.cpp" ] 68 69 if (netmanager_ext_feature_sysvpn) { 70 sources += [ 71 "$VPN_INNERKITS_SOURCE_DIR/src/ipsecvpn_config.cpp", 72 "$VPN_INNERKITS_SOURCE_DIR/src/l2tpvpn_config.cpp", 73 "$VPN_INNERKITS_SOURCE_DIR/src/openvpn_config.cpp", 74 "$VPN_INNERKITS_SOURCE_DIR/src/sysvpn_config.cpp", 75 "$VPN_INNERKITS_SOURCE_DIR/src/vpn_data_bean.cpp", 76 ] 77 } 78 79 include_dirs = [ 80 "$EXT_INNERKITS_ROOT/include", 81 "$EXT_INNERKITS_ROOT/netvpnclient/include", 82 "$NETMANAGER_EXT_ROOT/utils/log/include", 83 ] 84 85 external_deps = [ 86 "c_utils:utils", 87 "hilog:libhilog", 88 "netmanager_base:net_conn_parcel", 89 "netmanager_base:net_manager_common", 90 ] 91 92 part_name = "netmanager_ext" 93 subsystem_name = "communication" 94} 95 96ohos_shared_library("net_vpn_manager_if") { 97 sanitize = { 98 cfi = true 99 cfi_cross_dso = true 100 debug = false 101 } 102 103 branch_protector_ret = "pac_ret" 104 105 sources = [ 106 "$VPN_INNERKITS_SOURCE_DIR/src/ipc/networkvpn_service_proxy.cpp", 107 "$VPN_INNERKITS_SOURCE_DIR/src/ipc/vpn_event_callback_stub.cpp", 108 "$VPN_INNERKITS_SOURCE_DIR/src/networkvpn_client.cpp", 109 "$VPN_INNERKITS_SOURCE_DIR/src/vpn_interface.cpp", 110 ] 111 112 public_configs = [ ":net_conn_manager_if_config" ] 113 114 deps = [ ":networkvpn_parcel" ] 115 116 external_deps = [ 117 "bounds_checking_function:libsec_shared", 118 "hilog:libhilog", 119 "ipc:ipc_single", 120 "netmanager_base:fwmark_client", 121 "samgr:samgr_proxy", 122 ] 123 124 public_external_deps = [ 125 "netmanager_base:net_manager_common", 126 "netmanager_base:net_native_manager_if", 127 ] 128 129 defines = [ 130 "NETMGR_LOG_TAG = \"NetworkVpn\"", 131 "LOG_DOMAIN = 0xD0015B0", 132 ] 133 134 if (enable_netmgr_ext_debug) { 135 defines += [ "NETMGR_DEBUG" ] 136 } 137 138 part_name = "netmanager_ext" 139 subsystem_name = "communication" 140} 141