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_ext/netmanager_ext_config.gni") 16 17ohos_shared_library("ethernet_manager") { 18 sanitize = { 19 cfi = true 20 cfi_cross_dso = true 21 debug = false 22 } 23 24 branch_protector_ret = "pac_ret" 25 26 sources = [ 27 "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/interface_state_callback_proxy.cpp", 28 "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/interface_state_callback_stub.cpp", 29 "src/dev_interface_state.cpp", 30 "src/ethernet_configuration.cpp", 31 "src/ethernet_dhcp_controller.cpp", 32 "src/ethernet_lan_management.cpp", 33 "src/ethernet_management.cpp", 34 "src/ethernet_service.cpp", 35 "src/ethernet_service_common.cpp", 36 "src/stub/ethernet_service_stub.cpp", 37 ] 38 39 include_dirs = [ 40 "$NETCONNMANAGER_UTILS_DIR/common_utils/include", 41 "$NETCONNMANAGER_COMMON_DIR/include", 42 "include", 43 "include/stub", 44 "$EXT_INNERKITS_ROOT/include", 45 "$EXT_INNERKITS_ROOT/ethernetclient/include", 46 "$EXT_INNERKITS_ROOT/ethernetclient/include/proxy", 47 "$NETSYSCONTROLLER_ROOT_DIR/include", 48 "$NETMANAGER_EXT_ROOT/utils/log/include", 49 ] 50 51 cflags = [ 52 "-fstack-protector-strong", 53 "-D_FORTIFY_SOURCE=2", 54 "-O2", 55 ] 56 57 cflags_cc = [ 58 "-fstack-protector-strong", 59 "-D_FORTIFY_SOURCE=2", 60 "-O2", 61 ] 62 63 deps = [ "$EXT_INNERKITS_ROOT/ethernetclient:ethernet_parcel" ] 64 65 external_deps = [ 66 "bounds_checking_function:libsec_shared", 67 "cJSON:cjson", 68 "dhcp:dhcp_sdk", 69 "eventhandler:libeventhandler", 70 "ffrt:libffrt", 71 "ipc:ipc_core", 72 "netmanager_base:net_conn_manager_if", 73 "netmanager_base:net_manager_common", 74 "netmanager_base:net_native_manager_if", 75 "netmanager_base:net_service_common", 76 "netmanager_base:net_stats_manager_if", 77 "netmanager_base:netsys_controller", 78 "safwk:system_ability_fwk", 79 "samgr:samgr_proxy", 80 ] 81 82 defines = [ 83 "NETMGR_LOG_TAG = \"EthernetManager\"", 84 "LOG_DOMAIN = 0xD0015B0", 85 "USER_CONFIG_DIR = \"/data/service/el1/public/netmanager/ethernet\"", 86 "NETWORK_CONFIG_PATH = \"/system/etc/communication/netmanager_ext/ethernet_interfaces.json\"", 87 ] 88 89 if (enable_netmgr_ext_debug) { 90 defines += [ "NETMGR_DEBUG" ] 91 } 92 93 external_deps += [ "hilog:libhilog" ] 94 95 part_name = "netmanager_ext" 96 subsystem_name = "communication" 97} 98 99ohos_prebuilt_etc("ethernet_interfaces") { 100 source = "$NETMANAGER_EXT_ROOT/services/ethernetmanager/config/ethernet_interfaces.json" 101 install_enable = true 102 relative_install_dir = "communication/netmanager_ext" 103 part_name = "netmanager_ext" 104} 105