From 8f89fc30878548b5756dc4abd02b055e878e4bb2 Mon Sep 17 00:00:00 2001 From: l00635678 Date: Wed, 27 Aug 2025 18:51:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E5=AD=98=E4=BC=98=E5=8C=96=E4=BB=A5?= =?UTF-8?q?=E5=8F=8APAC=E5=AE=89=E5=85=A8=E7=BC=96=E8=AF=91=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: l00635678 --- frameworks/js/napi/ethernet/BUILD.gn | 2 - .../js/napi/ethernet/customeap/BUILD.gn | 2 - frameworks/js/napi/mdns/BUILD.gn | 2 - frameworks/js/napi/netfirewall/BUILD.gn | 4 +- frameworks/js/napi/sharing/BUILD.gn | 2 - frameworks/js/napi/vpn/BUILD.gn | 2 - .../netshare_result_callback_proxy.cpp | 55 ------------- .../netshare_result_callback_stub.cpp | 40 --------- interfaces/innerkits/ethernetclient/BUILD.gn | 2 +- interfaces/innerkits/mdnsclient/BUILD.gn | 1 + .../innerkits/netfirewallclient/BUILD.gn | 4 +- interfaces/innerkits/netshareclient/BUILD.gn | 4 +- .../include/networkshare_client.h | 1 - .../ipccallback/i_netshare_result_callback.h | 34 -------- .../netshare_result_callback_proxy.h | 38 --------- .../netshare_result_callback_stub.h | 38 --------- .../proxy/tethering_ipc_interface_code.h | 4 - .../netshareclient/libnetshare_kits.map | 2 - interfaces/innerkits/netvpnclient/BUILD.gn | 2 +- .../innerkits/networksliceclient/BUILD.gn | 2 + netmanager_ext_config.gni | 1 - services/ethernetmanager/BUILD.gn | 82 ++++++++++++++++++- services/netfirewallmanager/BUILD.gn | 4 + services/networksharemanager/BUILD.gn | 2 - .../include/networkshare_tracker.h | 1 - .../fuzztest/ethernetclient_fuzzer/BUILD.gn | 2 +- .../unittest/ethernet_manager_test/BUILD.gn | 2 +- .../networkshare_manager_test/BUILD.gn | 2 - .../networkshare_manager_test.cpp | 1 - 29 files changed, 97 insertions(+), 241 deletions(-) delete mode 100644 frameworks/native/netshareclient/src/proxy/ipccallback/netshare_result_callback_proxy.cpp delete mode 100644 frameworks/native/netshareclient/src/proxy/ipccallback/netshare_result_callback_stub.cpp delete mode 100644 interfaces/innerkits/netshareclient/include/proxy/ipccallback/i_netshare_result_callback.h delete mode 100644 interfaces/innerkits/netshareclient/include/proxy/ipccallback/netshare_result_callback_proxy.h delete mode 100644 interfaces/innerkits/netshareclient/include/proxy/ipccallback/netshare_result_callback_stub.h diff --git a/frameworks/js/napi/ethernet/BUILD.gn b/frameworks/js/napi/ethernet/BUILD.gn index f7fd5d38..c27f54dd 100644 --- a/frameworks/js/napi/ethernet/BUILD.gn +++ b/frameworks/js/napi/ethernet/BUILD.gn @@ -45,13 +45,11 @@ ohos_shared_library("ethernet") { defines = [ "NETMGR_DEBUG" ] cflags = [ - "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] cflags_cc = [ - "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] diff --git a/frameworks/js/napi/ethernet/customeap/BUILD.gn b/frameworks/js/napi/ethernet/customeap/BUILD.gn index de93bd59..915d0b08 100644 --- a/frameworks/js/napi/ethernet/customeap/BUILD.gn +++ b/frameworks/js/napi/ethernet/customeap/BUILD.gn @@ -37,13 +37,11 @@ ohos_shared_library("eap") { ] cflags = [ - "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] cflags_cc = [ - "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] diff --git a/frameworks/js/napi/mdns/BUILD.gn b/frameworks/js/napi/mdns/BUILD.gn index 8eeed96f..7d13518b 100644 --- a/frameworks/js/napi/mdns/BUILD.gn +++ b/frameworks/js/napi/mdns/BUILD.gn @@ -20,13 +20,11 @@ config("mdns_config") { visibility = [ ":mdns" ] cflags = [ - "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] cflags_cc = [ - "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] diff --git a/frameworks/js/napi/netfirewall/BUILD.gn b/frameworks/js/napi/netfirewall/BUILD.gn index 90f3aa62..8f17f407 100755 --- a/frameworks/js/napi/netfirewall/BUILD.gn +++ b/frameworks/js/napi/netfirewall/BUILD.gn @@ -19,6 +19,8 @@ ohos_shared_library("netfirewall") { debug = false } + branch_protector_ret = "pac_ret" + include_dirs = [ "include", "include/context", @@ -41,13 +43,11 @@ ohos_shared_library("netfirewall") { ] cflags = [ - "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] cflags_cc = [ - "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] diff --git a/frameworks/js/napi/sharing/BUILD.gn b/frameworks/js/napi/sharing/BUILD.gn index 6963a92f..2e5a55f4 100644 --- a/frameworks/js/napi/sharing/BUILD.gn +++ b/frameworks/js/napi/sharing/BUILD.gn @@ -19,13 +19,11 @@ config("sharing_config") { include_dirs = [ "include" ] cflags = [ - "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] cflags_cc = [ - "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] diff --git a/frameworks/js/napi/vpn/BUILD.gn b/frameworks/js/napi/vpn/BUILD.gn index 7eb71019..d7217c63 100644 --- a/frameworks/js/napi/vpn/BUILD.gn +++ b/frameworks/js/napi/vpn/BUILD.gn @@ -44,13 +44,11 @@ ohos_shared_library("vpn") { ] cflags = [ - "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] cflags_cc = [ - "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] diff --git a/frameworks/native/netshareclient/src/proxy/ipccallback/netshare_result_callback_proxy.cpp b/frameworks/native/netshareclient/src/proxy/ipccallback/netshare_result_callback_proxy.cpp deleted file mode 100644 index 59a00efc..00000000 --- a/frameworks/native/netshareclient/src/proxy/ipccallback/netshare_result_callback_proxy.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "netshare_result_callback_proxy.h" - -#include "ipc_types.h" -#include "parcel.h" -#include "net_manager_constants.h" -#include "netmgr_ext_log_wrapper.h" -#include "networkshare_constants.h" - -namespace OHOS { -namespace NetManagerStandard { -NetShareResultCallbackProxy::NetShareResultCallbackProxy(const sptr &object) - : IRemoteProxy(object) -{ -} - -void NetShareResultCallbackProxy::OnResult(const int32_t &result) -{ - sptr remote = Remote(); - if (remote == nullptr) { - NETMGR_EXT_LOG_E("NetShareResultCallbackProxy get Remote() error."); - return; - } - - MessageParcel data; - MessageParcel reply; - MessageOption option; - data.WriteInterfaceToken(INetShareResultCallback::GetDescriptor()); - - if (!data.WriteInt32(result)) { - NETMGR_EXT_LOG_E("NetShareResultCallbackProxy WriteInt32 error."); - return; - } - int32_t ret = - remote->SendRequest(static_cast(TetheringResultInterfaceCode::RESULT), data, reply, option); - if (ret != NETMANAGER_EXT_SUCCESS) { - NETMGR_EXT_LOG_E("NetShareResultCallbackProxy SendRequest error=[%{public}d].", ret); - } -} -} // namespace NetManagerStandard -} // namespace OHOS diff --git a/frameworks/native/netshareclient/src/proxy/ipccallback/netshare_result_callback_stub.cpp b/frameworks/native/netshareclient/src/proxy/ipccallback/netshare_result_callback_stub.cpp deleted file mode 100644 index cfc96677..00000000 --- a/frameworks/native/netshareclient/src/proxy/ipccallback/netshare_result_callback_stub.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "netshare_result_callback_stub.h" - -#include "string_ex.h" -#include "net_manager_constants.h" -#include "networkshare_constants.h" - -namespace OHOS { -namespace NetManagerStandard { -int32_t NetShareResultCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, - MessageOption &option) -{ - std::u16string descriptor = data.ReadInterfaceToken(); - if (descriptor != INetShareResultCallback::GetDescriptor()) { - return NETMANAGER_EXT_ERR_DESCRIPTOR_MISMATCH; - } - TetheringResultInterfaceCode msgCode = static_cast(code); - if (msgCode == TetheringResultInterfaceCode::RESULT) { - int32_t status = data.ReadInt32(); - OnResult(status); - return NETMANAGER_EXT_SUCCESS; - } - return IPCObjectStub::OnRemoteRequest(code, data, reply, option); -} -} // namespace NetManagerStandard -} // namespace OHOS diff --git a/interfaces/innerkits/ethernetclient/BUILD.gn b/interfaces/innerkits/ethernetclient/BUILD.gn index c5cceded..c222ae7d 100644 --- a/interfaces/innerkits/ethernetclient/BUILD.gn +++ b/interfaces/innerkits/ethernetclient/BUILD.gn @@ -99,6 +99,7 @@ ohos_static_library("ethernet_service_interface_stub") { cfi_cross_dso = true debug = false } + branch_protector_ret = "pac_ret" public_configs = [ ":ethernet_service_interface_stub_config" ] output_values = get_target_outputs(":ethernet_service_interface") sources = [] @@ -130,7 +131,6 @@ ohos_shared_library("ethernet_manager_if") { sources = [ "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/ethernet_client.cpp", "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/net_eap_callback_stub.cpp", - "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/interface_state_callback_proxy.cpp", "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/interface_state_callback_stub.cpp", ] diff --git a/interfaces/innerkits/mdnsclient/BUILD.gn b/interfaces/innerkits/mdnsclient/BUILD.gn index 9b29f200..2032f3b7 100644 --- a/interfaces/innerkits/mdnsclient/BUILD.gn +++ b/interfaces/innerkits/mdnsclient/BUILD.gn @@ -93,6 +93,7 @@ ohos_static_library("mdns_service_interface_stub") { cfi_cross_dso = true debug = false } + branch_protector_ret = "pac_ret" public_configs = [ ":mdns_service_interface_stub_config" ] output_values = get_target_outputs(":mdns_service_interface") sources = [] diff --git a/interfaces/innerkits/netfirewallclient/BUILD.gn b/interfaces/innerkits/netfirewallclient/BUILD.gn index 83e0e848..021aed11 100755 --- a/interfaces/innerkits/netfirewallclient/BUILD.gn +++ b/interfaces/innerkits/netfirewallclient/BUILD.gn @@ -46,7 +46,7 @@ ohos_static_library("netfirewall_parcel") { cfi_cross_dso = true debug = false } - + branch_protector_ret = "pac_ret" sources = [ "$NETFIREWALL_EXTENSION_SOURCE_DIR/src/netfirewall_common.cpp" ] include_dirs = [ @@ -73,6 +73,8 @@ ohos_shared_library("netfirewall_manager_if") { debug = false } + branch_protector_ret = "pac_ret" + if (netmanager_ext_feature_net_firewall) { sources = [ "$NETFIREWALL_EXTENSION_SOURCE_DIR/src/netfirewall_client.cpp", diff --git a/interfaces/innerkits/netshareclient/BUILD.gn b/interfaces/innerkits/netshareclient/BUILD.gn index 073b8393..e4a066ec 100644 --- a/interfaces/innerkits/netshareclient/BUILD.gn +++ b/interfaces/innerkits/netshareclient/BUILD.gn @@ -91,6 +91,7 @@ ohos_static_library("netshare_service_interface_stub") { cfi_cross_dso = true debug = false } + branch_protector_ret = "pac_ret" public_configs = [ ":netshare_service_interface_stub_config" ] output_values = get_target_outputs(":netshare_service_interface") sources = [] @@ -121,9 +122,6 @@ ohos_shared_library("net_tether_manager_if") { sources = [ "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/networkshare_client.cpp", - "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/netshare_result_callback_proxy.cpp", - "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/netshare_result_callback_stub.cpp", - "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/sharing_event_callback_proxy.cpp", "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/sharing_event_callback_stub.cpp", ] diff --git a/interfaces/innerkits/netshareclient/include/networkshare_client.h b/interfaces/innerkits/netshareclient/include/networkshare_client.h index 7c23d1ff..902a5c06 100644 --- a/interfaces/innerkits/netshareclient/include/networkshare_client.h +++ b/interfaces/innerkits/netshareclient/include/networkshare_client.h @@ -18,7 +18,6 @@ #include -#include "i_netshare_result_callback.h" #include "inetwork_share_service.h" #include "isharing_event_callback.h" #include "parcel.h" diff --git a/interfaces/innerkits/netshareclient/include/proxy/ipccallback/i_netshare_result_callback.h b/interfaces/innerkits/netshareclient/include/proxy/ipccallback/i_netshare_result_callback.h deleted file mode 100644 index 1d5a3c6f..00000000 --- a/interfaces/innerkits/netshareclient/include/proxy/ipccallback/i_netshare_result_callback.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef I_NETSHARE_RESULT_CALLBACK_H -#define I_NETSHARE_RESULT_CALLBACK_H - -#include -#include - -#include "tethering_ipc_interface_code.h" - -namespace OHOS { -namespace NetManagerStandard { -class INetShareResultCallback : public IRemoteBroker { -public: - virtual void OnResult(const int32_t &status) = 0; - - DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.NetManagerStandard.INetworkShareService.INetShareResultCallback"); -}; -} // namespace NetManagerStandard -} // namespace OHOS -#endif // I_NETSHARE_RESULT_CALLBACK_H diff --git a/interfaces/innerkits/netshareclient/include/proxy/ipccallback/netshare_result_callback_proxy.h b/interfaces/innerkits/netshareclient/include/proxy/ipccallback/netshare_result_callback_proxy.h deleted file mode 100644 index 58beb373..00000000 --- a/interfaces/innerkits/netshareclient/include/proxy/ipccallback/netshare_result_callback_proxy.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef NETSHARE_RESULT_CALLBACK_PROXY_H -#define NETSHARE_RESULT_CALLBACK_PROXY_H - -#include - -#include "i_netshare_result_callback.h" -#include "iremote_proxy.h" - -namespace OHOS { -namespace NetManagerStandard { -class NetShareResultCallbackProxy : public IRemoteProxy { -public: - explicit NetShareResultCallbackProxy(const sptr &object); - virtual ~NetShareResultCallbackProxy() = default; - virtual void OnResult(const int32_t &result) override; - -private: - static inline BrokerDelegator delegator_; -}; -} // namespace NetManagerStandard -} // namespace OHOS - -#endif // NETSHARE_RESULT_CALLBACK_PROXY_H diff --git a/interfaces/innerkits/netshareclient/include/proxy/ipccallback/netshare_result_callback_stub.h b/interfaces/innerkits/netshareclient/include/proxy/ipccallback/netshare_result_callback_stub.h deleted file mode 100644 index 85300e7b..00000000 --- a/interfaces/innerkits/netshareclient/include/proxy/ipccallback/netshare_result_callback_stub.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef NETSHARE_RESULT_CALLBACK_STUB_H -#define NETSHARE_RESULT_CALLBACK_STUB_H - -#include - -#include "i_netshare_result_callback.h" -#include "iremote_stub.h" - -namespace OHOS { -namespace NetManagerStandard { -class NetShareResultCallbackStub : public IRemoteStub { -public: - NetShareResultCallbackStub() = default; - virtual ~NetShareResultCallbackStub() = default; - - int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - -private: - DISALLOW_COPY_AND_MOVE(NetShareResultCallbackStub); -}; -} // namespace NetManagerStandard -} // namespace OHOS -#endif // NETSHARE_RESULT_CALLBACK_STUB_H diff --git a/interfaces/innerkits/netshareclient/include/proxy/tethering_ipc_interface_code.h b/interfaces/innerkits/netshareclient/include/proxy/tethering_ipc_interface_code.h index 30fc2c71..51d12a78 100644 --- a/interfaces/innerkits/netshareclient/include/proxy/tethering_ipc_interface_code.h +++ b/interfaces/innerkits/netshareclient/include/proxy/tethering_ipc_interface_code.h @@ -41,10 +41,6 @@ enum class TetheringEventInterfaceCode { INTERFACE_SHARING_STATE_CHANGED, SHARING_UPSTREAM_CHANGED, }; - -enum class TetheringResultInterfaceCode { - RESULT, -}; } // namespace NetManagerStandard } // namespace OHOS #endif // TETHERING_IPC_INTERFACE_CODE_H diff --git a/interfaces/innerkits/netshareclient/libnetshare_kits.map b/interfaces/innerkits/netshareclient/libnetshare_kits.map index cf2b9c1e..b9e6fcc6 100644 --- a/interfaces/innerkits/netshareclient/libnetshare_kits.map +++ b/interfaces/innerkits/netshareclient/libnetshare_kits.map @@ -30,8 +30,6 @@ "OHOS::NetManagerStandard::NetworkShareClient::~NetworkShareClient()"; "OHOS::NetManagerStandard::NetworkShareClient::RegisterSharingEvent(OHOS::sptr)"; "OHOS::NetManagerStandard::NetworkShareClient::UnregisterSharingEvent(OHOS::sptr)"; - "OHOS::NetManagerStandard::NetShareResultCallbackProxy::NetShareResultCallbackProxy(OHOS::sptr const&)"; - "OHOS::NetManagerStandard::NetShareResultCallbackStub::OnRemoteRequest(unsigned int, OHOS::MessageParcel&, OHOS::MessageParcel&, OHOS::MessageOption&)"; "OHOS::NetManagerStandard::NetworkShareLoadCallback::GetRemoteObject() const"; VTT?for?OHOS::NetManagerStandard::NetworkShareLoadCallback; vtable?for?OHOS::NetManagerStandard::NetworkShareLoadCallback; diff --git a/interfaces/innerkits/netvpnclient/BUILD.gn b/interfaces/innerkits/netvpnclient/BUILD.gn index c1d3b1d2..b541da24 100644 --- a/interfaces/innerkits/netvpnclient/BUILD.gn +++ b/interfaces/innerkits/netvpnclient/BUILD.gn @@ -102,7 +102,7 @@ config("networkvpn_interface_stub_config") { } } -ohos_source_set("networkvpn_interface_stub") { +ohos_static_library("networkvpn_interface_stub") { sanitize = { cfi = true cfi_cross_dso = true diff --git a/interfaces/innerkits/networksliceclient/BUILD.gn b/interfaces/innerkits/networksliceclient/BUILD.gn index 4a2a65f2..f10a50aa 100644 --- a/interfaces/innerkits/networksliceclient/BUILD.gn +++ b/interfaces/innerkits/networksliceclient/BUILD.gn @@ -71,6 +71,8 @@ ohos_shared_library("networkslice_manager_if") { debug = false } + branch_protector_ret = "pac_ret" + sources = [ "$NETWORKSLICE_INNERKITS_SOURCE_DIR/src/networkslice_client.cpp", "$NETWORKSLICE_INNERKITS_SOURCE_DIR/src/networkslice_proxy.cpp", diff --git a/netmanager_ext_config.gni b/netmanager_ext_config.gni index 7bea9eb6..ca7f5880 100644 --- a/netmanager_ext_config.gni +++ b/netmanager_ext_config.gni @@ -79,7 +79,6 @@ declare_args() { sysvpn_flags = [ "-DSUPPORT_SYSVPN" ] common_cflags = [ - "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-fdata-sections", "-ffunction-sections", diff --git a/services/ethernetmanager/BUILD.gn b/services/ethernetmanager/BUILD.gn index 246a757d..428838f5 100644 --- a/services/ethernetmanager/BUILD.gn +++ b/services/ethernetmanager/BUILD.gn @@ -25,7 +25,6 @@ ohos_shared_library("ethernet_manager") { sources = [ "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/interface_state_callback_proxy.cpp", - "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/interface_state_callback_stub.cpp", "src/dev_interface_state.cpp", "src/ethernet_configuration.cpp", "src/ethernet_dhcp_controller.cpp", @@ -45,8 +44,87 @@ ohos_shared_library("ethernet_manager") { "$EXT_INNERKITS_ROOT/ethernetclient/include/proxy", ] - cflags = common_cflags + cflags = common_cflags + memory_optimization_cflags + + cflags_cc = common_cflags + memory_optimization_cflags_cc + + ldflags = memory_optimization_ldflags + + deps = [ "$EXT_INNERKITS_ROOT/ethernetclient:ethernet_parcel" ] + deps += [ "$EXT_INNERKITS_ROOT/ethernetclient:ethernet_service_interface_stub" ] + + external_deps = [ + "bounds_checking_function:libsec_shared", + "cJSON:cjson", + "dhcp:dhcp_sdk", + "eventhandler:libeventhandler", + "ffrt:libffrt", + "init:libbegetutil", + "ipc:ipc_core", + "netmanager_base:net_conn_manager_if", + "netmanager_base:net_manager_common", + "netmanager_base:net_native_manager_if", + "netmanager_base:net_service_common", + "netmanager_base:net_stats_manager_if", + "netmanager_base:netsys_controller", + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] + + defines = [ + "NETMGR_LOG_TAG = \"EthernetManager\"", + "LOG_DOMAIN = 0xD0015B0", + "USER_CONFIG_DIR = \"/data/service/el1/public/netmanager/ethernet\"", + "NETWORK_CONFIG_PATH = \"/system/etc/communication/netmanager_ext/ethernet_interfaces.json\"", + ] + + if (netmanager_ext_extensible_authentication) { + defines += [ "NET_EXTENSIBLE_AUTHENTICATION" ] + external_deps += [ + "drivers_interface_ethernet:libethernet_proxy_1.0", + "hdf_core:libhdf_ipc_adapter", + "hdf_core:libhdi", + ] + sources += [ + "src/eap_hdi_wpa_manager.cpp" + ] + } + + if (enable_netmgr_ext_debug) { + defines += [ "NETMGR_DEBUG" ] + } + + external_deps += [ "hilog:libhilog" ] + + part_name = "netmanager_ext" + subsystem_name = "communication" +} + +ohos_static_library("ethernet_manager_static") { + testonly = true + branch_protector_ret = "pac_ret" + sources = [ + "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/interface_state_callback_proxy.cpp", + "src/dev_interface_state.cpp", + "src/ethernet_configuration.cpp", + "src/ethernet_dhcp_controller.cpp", + "src/ethernet_lan_management.cpp", + "src/ethernet_management.cpp", + "src/ethernet_service.cpp", + "src/ethernet_service_common.cpp", + "src/net_eap_callback_proxy.cpp", + "src/net_eap_handler.cpp", + ] + include_dirs = [ + "include", + "include/stub", + "$EXT_INNERKITS_ROOT/include", + "$EXT_INNERKITS_ROOT/ethernetclient/include", + "$EXT_INNERKITS_ROOT/ethernetclient/include/proxy", + ] + + cflags = common_cflags cflags_cc = common_cflags deps = [ "$EXT_INNERKITS_ROOT/ethernetclient:ethernet_parcel" ] diff --git a/services/netfirewallmanager/BUILD.gn b/services/netfirewallmanager/BUILD.gn index 117f920a..df2e920a 100755 --- a/services/netfirewallmanager/BUILD.gn +++ b/services/netfirewallmanager/BUILD.gn @@ -81,6 +81,8 @@ ohos_shared_library("netfirewall_manager") { debug = false } + branch_protector_ret = "pac_ret" + configs = [ ":netfirewall_manager_config", "$NETMANAGER_EXT_ROOT/resource:coverage_flags", @@ -109,6 +111,8 @@ ohos_static_library("netfirewall_manager_static") { debug = false } + branch_protector_ret = "pac_ret" + configs = [ ":netfirewall_manager_config", "$NETMANAGER_EXT_ROOT/resource:coverage_flags", diff --git a/services/networksharemanager/BUILD.gn b/services/networksharemanager/BUILD.gn index 273977b2..f1f225f3 100644 --- a/services/networksharemanager/BUILD.gn +++ b/services/networksharemanager/BUILD.gn @@ -39,7 +39,6 @@ ohos_shared_library("net_tether_manager") { sources = [ "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/sharing_event_callback_proxy.cpp", - "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/sharing_event_callback_stub.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_configuration.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_hisysevent.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_main_statemachine.cpp", @@ -164,7 +163,6 @@ ohos_static_library("net_tether_manager_static") { sources = [ "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/sharing_event_callback_proxy.cpp", - "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/sharing_event_callback_stub.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_configuration.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_hisysevent.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_main_statemachine.cpp", diff --git a/services/networksharemanager/include/networkshare_tracker.h b/services/networksharemanager/include/networkshare_tracker.h index 828a4082..f1102652 100644 --- a/services/networksharemanager/include/networkshare_tracker.h +++ b/services/networksharemanager/include/networkshare_tracker.h @@ -25,7 +25,6 @@ #include "bluetooth_remote_device.h" #endif #include "event_handler.h" -#include "i_netshare_result_callback.h" #include "isharing_event_callback.h" #ifdef WIFI_MODOULE #include "i_wifi_hotspot_callback.h" diff --git a/test/ethernetmanager/fuzztest/ethernetclient_fuzzer/BUILD.gn b/test/ethernetmanager/fuzztest/ethernetclient_fuzzer/BUILD.gn index 63a5ea42..80f4b505 100644 --- a/test/ethernetmanager/fuzztest/ethernetclient_fuzzer/BUILD.gn +++ b/test/ethernetmanager/fuzztest/ethernetclient_fuzzer/BUILD.gn @@ -56,7 +56,7 @@ ohos_fuzztest("EthernetClientFuzzTest") { ] deps = [ - "$ETHERNETMANAGER_SOURCE_DIR:ethernet_manager", + "$ETHERNETMANAGER_SOURCE_DIR:ethernet_manager_static", "$EXT_INNERKITS_ROOT/ethernetclient:ethernet_manager_if", ] diff --git a/test/ethernetmanager/unittest/ethernet_manager_test/BUILD.gn b/test/ethernetmanager/unittest/ethernet_manager_test/BUILD.gn index 4afd6c19..3221f250 100644 --- a/test/ethernetmanager/unittest/ethernet_manager_test/BUILD.gn +++ b/test/ethernetmanager/unittest/ethernet_manager_test/BUILD.gn @@ -55,7 +55,7 @@ ohos_unittest("ethernet_manager_test") { ] deps = [ - "$ETHERNETMANAGER_SOURCE_DIR:ethernet_manager", + "$ETHERNETMANAGER_SOURCE_DIR:ethernet_manager_static", "$EXT_INNERKITS_ROOT/ethernetclient:ethernet_manager_if", ] diff --git a/test/networksharemanager/unittest/networkshare_manager_test/BUILD.gn b/test/networksharemanager/unittest/networkshare_manager_test/BUILD.gn index fa831104..105ca5c1 100644 --- a/test/networksharemanager/unittest/networkshare_manager_test/BUILD.gn +++ b/test/networksharemanager/unittest/networkshare_manager_test/BUILD.gn @@ -33,8 +33,6 @@ ohos_unittest("networkshare_manager_test") { "edm_parameter_utils_test.cpp", "interface_configuration_test.cpp", "net_event_report_test.cpp", - "netshare_result_callback_proxy_test.cpp", - "netshare_result_callback_stub_test.cpp", "networkshare_hisysevent_test.cpp", "networkshare_main_statemachine_test.cpp", "networkshare_manager_test.cpp", diff --git a/test/networksharemanager/unittest/networkshare_manager_test/networkshare_manager_test.cpp b/test/networksharemanager/unittest/networkshare_manager_test/networkshare_manager_test.cpp index 4a0f6a6e..18e3f3c2 100644 --- a/test/networksharemanager/unittest/networkshare_manager_test/networkshare_manager_test.cpp +++ b/test/networksharemanager/unittest/networkshare_manager_test/networkshare_manager_test.cpp @@ -23,7 +23,6 @@ #include "net_manager_constants.h" #include "netmanager_ext_test_security.h" #include "netmgr_ext_log_wrapper.h" -#include "netshare_result_callback_stub.h" #define private public #include "networkshare_client.h" #undef private -- Gitee