From d459f75de79b9d4739902c9b9f410819ce2bc1ee Mon Sep 17 00:00:00 2001 From: wanjing Date: Wed, 30 Nov 2022 16:58:04 +0800 Subject: [PATCH] =?UTF-8?q?CFI=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanjing --- .../bus_center/network/lnn_netlink_monitor.c | 9 +++-- .../bus_center/src/lnn_ohos_account.cpp | 2 +- core/authentication/src/auth_hichain.c | 14 ++++---- core/authentication/src/auth_manager.c | 4 +-- core/authentication/src/auth_tcp_connection.c | 2 +- .../ipc/standard/src/lnn_bus_center_ipc.cpp | 10 +++--- .../disc_mgr/src/lnn_discovery_interface.c | 11 ++++--- .../lnn/disc_mgr/src/lnn_discovery_manager.c | 8 ++--- .../heartbeat/src/lnn_heartbeat_ctrl.c | 9 ++--- .../heartbeat/src/lnn_heartbeat_fsm.c | 30 +++++++++-------- .../heartbeat/src/lnn_heartbeat_medium_mgr.c | 2 +- .../heartbeat/src/lnn_heartbeat_strategy.c | 24 +++++++------- .../heartbeat/src/lnn_heartbeat_utils.c | 2 +- .../lnn/lane_hub/lane_manager/src/lnn_lane.c | 2 +- .../lane_manager/src/lnn_lane_common.c | 2 +- .../lane_hub/lane_manager/src/lnn_lane_link.c | 4 +-- .../lane_manager/src/lnn_trans_lane.c | 4 +-- .../time_sync/src/lnn_time_sync_manager.c | 4 +-- .../lnn/net_builder/src/lnn_connection_fsm.c | 22 ++++++------- .../lnn/net_builder/src/lnn_devicename_info.c | 2 +- .../lnn/net_builder/src/lnn_net_builder.c | 28 ++++++++-------- .../lnn/net_builder/src/lnn_p2p_info.c | 2 +- .../net_builder/src/lnn_sync_info_manager.c | 6 ++-- .../lnn/net_builder/src/lnn_sync_item_info.c | 3 +- .../net_buscenter/src/lnn_network_manager.c | 8 ++--- .../src/lnn_physical_subnet_manager.c | 8 ++--- .../net_ledger/common/src/lnn_device_info.c | 2 +- .../common/src/lnn_net_capability.c | 2 +- .../net_ledger/common/src/lnn_net_ledger.c | 2 +- .../lnn/net_ledger/common/src/lnn_node_info.c | 32 +++++++++--------- .../src/lnn_distributed_net_ledger.c | 22 ++++++------- .../local_ledger/src/lnn_local_net_ledger.c | 10 +++--- .../bus_center/service/src/bus_center_event.c | 33 ++++++++++--------- .../utils/src/lnn_connection_addr_utils.c | 2 +- core/bus_center/utils/src/lnn_map.c | 21 ++++++------ .../permission/common/permission_entry.c | 2 +- core/connection/p2p/adapter/p2plink_adapter.c | 25 +++++++------- .../p2p/common/src/p2plink_common.c | 20 +++++------ .../p2p/interface/p2plink_interface.c | 10 +++--- .../manager/src/p2plink_broadcast_receiver.c | 3 +- .../p2p/manager/src/p2plink_control_message.c | 11 ++++--- .../p2p/manager/src/p2plink_device.c | 32 +++++++++--------- .../p2p/manager/src/p2plink_manager.c | 2 +- .../p2p/manager/src/p2plink_reference.c | 16 ++++----- .../negotiation/src/p2plink_channel_freq.c | 6 ++-- .../negotiation/src/p2plink_state_machine.c | 17 +++++----- core/discovery/ble/softbus_ble/src/disc_ble.c | 2 +- .../proxy/src/softbus_proxychannel_listener.c | 10 +++--- .../proxy/src/softbus_proxychannel_network.c | 6 ++-- .../proxy/src/softbus_proxychannel_session.c | 4 ++- .../tcp_direct/src/trans_tcp_direct_message.c | 3 +- .../tcp_direct/src/trans_tcp_direct_p2p.c | 5 +-- .../tcp_direct/src/trans_tcp_direct_wifi.c | 4 ++- .../src/trans_udp_negotiation.c | 6 ++-- 54 files changed, 278 insertions(+), 254 deletions(-) diff --git a/adapter/common/bus_center/network/lnn_netlink_monitor.c b/adapter/common/bus_center/network/lnn_netlink_monitor.c index 69184519a..108999ab3 100644 --- a/adapter/common/bus_center/network/lnn_netlink_monitor.c +++ b/adapter/common/bus_center/network/lnn_netlink_monitor.c @@ -37,6 +37,7 @@ #include "softbus_adapter_mem.h" #include "softbus_adapter_socket.h" #include "softbus_adapter_thread.h" +#include "softbus_def.h" #include "softbus_errcode.h" #include "softbus_log.h" @@ -142,15 +143,13 @@ static void ProcessLinkEvent(struct nlmsghdr *nlh) } } -static void *NetlinkMonitorThread(void *para) +NO_SANITIZE("cfi") static void *NetlinkMonitorThread(void *para) { - int32_t sockFd; - int32_t len; struct nlmsghdr *nlh = NULL; (void)para; SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_INFO, "netlink monitor thread start"); - sockFd = CreateNetlinkSocket(); + int32_t sockFd = CreateNetlinkSocket(); if (sockFd < 0) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "create netlink socket failed"); return NULL; @@ -162,7 +161,7 @@ static void *NetlinkMonitorThread(void *para) } while (true) { (void)memset_s(buffer, DEFAULT_NETLINK_RECVBUF, 0, DEFAULT_NETLINK_RECVBUF); - len = SoftBusSocketRecv(sockFd, buffer, DEFAULT_NETLINK_RECVBUF, 0); + int32_t len = SoftBusSocketRecv(sockFd, buffer, DEFAULT_NETLINK_RECVBUF, 0); if (len < 0 && len == SOFTBUS_ADAPTER_SOCKET_EINTR) { continue; } diff --git a/core/adapter/bus_center/src/lnn_ohos_account.cpp b/core/adapter/bus_center/src/lnn_ohos_account.cpp index a3712060a..429a86066 100644 --- a/core/adapter/bus_center/src/lnn_ohos_account.cpp +++ b/core/adapter/bus_center/src/lnn_ohos_account.cpp @@ -83,7 +83,7 @@ NO_SANITIZE("cfi") int32_t LnnInitOhosAccount(void) return LnnSetLocalByteInfo(BYTE_KEY_ACCOUNT_HASH, accountHash, SHA_256_HASH_LEN); } -void LnnOnOhosAccountChanged(void) +NO_SANITIZE("cfi") void LnnOnOhosAccountChanged(void) { uint8_t accountHash[SHA_256_HASH_LEN] = {0}; uint8_t localAccountHash[SHA_256_HASH_LEN] = {0}; diff --git a/core/authentication/src/auth_hichain.c b/core/authentication/src/auth_hichain.c index 22a2b0a25..43e98f397 100644 --- a/core/authentication/src/auth_hichain.c +++ b/core/authentication/src/auth_hichain.c @@ -71,7 +71,7 @@ static char *GenDeviceLevelParam(const char *udid, const char *uid, bool isClien return data; } -static bool OnTransmit(int64_t authSeq, const uint8_t *data, uint32_t len) +NO_SANITIZE("cfi") static bool OnTransmit(int64_t authSeq, const uint8_t *data, uint32_t len) { SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "hichain OnTransmit: authSeq=%" PRId64 ", len=%u.", authSeq, len); @@ -82,7 +82,7 @@ static bool OnTransmit(int64_t authSeq, const uint8_t *data, uint32_t len) return true; } -static void OnSessionKeyReturned(int64_t authSeq, const uint8_t *sessionKey, uint32_t sessionKeyLen) +NO_SANITIZE("cfi") static void OnSessionKeyReturned(int64_t authSeq, const uint8_t *sessionKey, uint32_t sessionKeyLen) { SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "hichain OnSessionKeyReturned: authSeq=%" PRId64 ", len=%u.", authSeq, sessionKeyLen); @@ -93,7 +93,7 @@ static void OnSessionKeyReturned(int64_t authSeq, const uint8_t *sessionKey, uin (void)AuthSessionSaveSessionKey(authSeq, sessionKey, sessionKeyLen); } -static void OnFinish(int64_t authSeq, int operationCode, const char *returnData) +NO_SANITIZE("cfi") static void OnFinish(int64_t authSeq, int operationCode, const char *returnData) { (void)operationCode; (void)returnData; @@ -102,7 +102,7 @@ static void OnFinish(int64_t authSeq, int operationCode, const char *returnData) (void)AuthSessionHandleAuthResult(authSeq, SOFTBUS_OK); } -static void OnError(int64_t authSeq, int operationCode, int errCode, const char *errorReturn) +NO_SANITIZE("cfi") static void OnError(int64_t authSeq, int operationCode, int errCode, const char *errorReturn) { (void)operationCode; (void)errorReturn; @@ -111,7 +111,7 @@ static void OnError(int64_t authSeq, int operationCode, int errCode, const char (void)AuthSessionHandleAuthResult(authSeq, SOFTBUS_AUTH_HICHAIN_AUTH_ERROR); } -static char *OnRequest(int64_t authSeq, int operationCode, const char *reqParams) +NO_SANITIZE("cfi") static char *OnRequest(int64_t authSeq, int operationCode, const char *reqParams) { (void)reqParams; SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, @@ -189,7 +189,7 @@ static void OnGroupCreated(const char *groupInfo) } } -static void OnGroupDeleted(const char *groupInfo) +NO_SANITIZE("cfi") static void OnGroupDeleted(const char *groupInfo) { if (groupInfo == NULL) { SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "invalid group info."); @@ -205,7 +205,7 @@ static void OnGroupDeleted(const char *groupInfo) } } -static void OnDeviceNotTrusted(const char *udid) +NO_SANITIZE("cfi") static void OnDeviceNotTrusted(const char *udid) { SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "hichain OnDeviceNotTrusted."); if (udid == NULL) { diff --git a/core/authentication/src/auth_manager.c b/core/authentication/src/auth_manager.c index b860d32de..eb0379d0a 100644 --- a/core/authentication/src/auth_manager.c +++ b/core/authentication/src/auth_manager.c @@ -492,7 +492,7 @@ static void NotifyDeviceDisconnect(int64_t authId) g_verifyListener.onDeviceDisconnect(authId); } -static void OnDeviceNotTrusted(const char *peerUdid) +NO_SANITIZE("cfi") static void OnDeviceNotTrusted(const char *peerUdid) { RemoveNotPassedAuthManagerByUdid(peerUdid); AuthSessionHandleDeviceNotTrusted(peerUdid); @@ -504,7 +504,7 @@ static void OnDeviceNotTrusted(const char *peerUdid) g_verifyListener.onDeviceNotTrusted(peerUdid); } -static void OnGroupCreated(const char *groupId, int32_t groupType) +NO_SANITIZE("cfi") static void OnGroupCreated(const char *groupId, int32_t groupType) { if (g_groupChangeListener.onGroupCreated != NULL) { g_groupChangeListener.onGroupCreated(groupId, groupType); diff --git a/core/authentication/src/auth_tcp_connection.c b/core/authentication/src/auth_tcp_connection.c index 65c76a2a6..536abd23e 100644 --- a/core/authentication/src/auth_tcp_connection.c +++ b/core/authentication/src/auth_tcp_connection.c @@ -269,7 +269,7 @@ static int32_t OnConnectEvent(ListenerModule module, int32_t events, return SOFTBUS_OK; } -static int32_t OnDataEvent(ListenerModule module, int32_t events, int32_t fd) +NO_SANITIZE("cfi") static int32_t OnDataEvent(ListenerModule module, int32_t events, int32_t fd) { (void)module; if (events == SOFTBUS_SOCKET_OUT) { diff --git a/core/bus_center/ipc/standard/src/lnn_bus_center_ipc.cpp b/core/bus_center/ipc/standard/src/lnn_bus_center_ipc.cpp index 76711d7e4..b6b96b06d 100755 --- a/core/bus_center/ipc/standard/src/lnn_bus_center_ipc.cpp +++ b/core/bus_center/ipc/standard/src/lnn_bus_center_ipc.cpp @@ -217,7 +217,8 @@ NO_SANITIZE("cfi") int32_t LnnIpcServerJoin(const char *pkgName, void *addr, uin return ret; } -int32_t MetaNodeIpcServerJoin(const char *pkgName, void *addr, CustomData *customData, uint32_t addrTypeLen) +NO_SANITIZE("cfi") int32_t MetaNodeIpcServerJoin(const char *pkgName, void *addr, CustomData *customData, + uint32_t addrTypeLen) { ConnectionAddr *connAddr = reinterpret_cast(addr); @@ -256,7 +257,7 @@ NO_SANITIZE("cfi") int32_t LnnIpcServerLeave(const char *pkgName, const char *ne return ret; } -int32_t MetaNodeIpcServerLeave(const char *pkgName, const char *networkId) +NO_SANITIZE("cfi") int32_t MetaNodeIpcServerLeave(const char *pkgName, const char *networkId) { if (pkgName == nullptr || networkId == nullptr) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "parameters are nullptr!\n"); @@ -389,7 +390,8 @@ NO_SANITIZE("cfi") int32_t LnnIpcNotifyJoinResult(void *addr, uint32_t addrTypeL return SOFTBUS_OK; } -int32_t MetaNodeIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char *networkId, int32_t retCode) +NO_SANITIZE("cfi") int32_t MetaNodeIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char *networkId, + int32_t retCode) { if (addr == nullptr) { return SOFTBUS_INVALID_PARAM; @@ -428,7 +430,7 @@ NO_SANITIZE("cfi") int32_t LnnIpcNotifyLeaveResult(const char *networkId, int32_ return SOFTBUS_OK; } -int32_t MetaNodeIpcNotifyLeaveResult(const char *networkId, int32_t retCode) +NO_SANITIZE("cfi") int32_t MetaNodeIpcNotifyLeaveResult(const char *networkId, int32_t retCode) { if (networkId == nullptr) { return SOFTBUS_INVALID_PARAM; diff --git a/core/bus_center/lnn/disc_mgr/src/lnn_discovery_interface.c b/core/bus_center/lnn/disc_mgr/src/lnn_discovery_interface.c index 5d8f6a1d7..b49b5bcd6 100644 --- a/core/bus_center/lnn/disc_mgr/src/lnn_discovery_interface.c +++ b/core/bus_center/lnn/disc_mgr/src/lnn_discovery_interface.c @@ -16,11 +16,11 @@ #include "bus_center_manager.h" #include - +#include "softbus_def.h" #include "softbus_errcode.h" #include "softbus_log.h" -int32_t LnnPublishService(const char *pkgName, const PublishInfo *info, bool isInnerRequest) +NO_SANITIZE("cfi") int32_t LnnPublishService(const char *pkgName, const PublishInfo *info, bool isInnerRequest) { int32_t ret; if (!isInnerRequest) { @@ -37,7 +37,7 @@ int32_t LnnPublishService(const char *pkgName, const PublishInfo *info, bool isI return SOFTBUS_OK; } -int32_t LnnUnPublishService(const char *pkgName, int32_t publishId, bool isInnerRequest) +NO_SANITIZE("cfi") int32_t LnnUnPublishService(const char *pkgName, int32_t publishId, bool isInnerRequest) { if (!isInnerRequest) { if (DiscUnPublishService(pkgName, publishId) != SOFTBUS_OK) { @@ -53,7 +53,8 @@ int32_t LnnUnPublishService(const char *pkgName, int32_t publishId, bool isInner return SOFTBUS_OK; } -int32_t LnnStartDiscDevice(const char *pkgName, const SubscribeInfo *info, const InnerCallback *cb, bool isInnerRequest) +NO_SANITIZE("cfi") int32_t LnnStartDiscDevice(const char *pkgName, const SubscribeInfo *info, const InnerCallback *cb, + bool isInnerRequest) { int32_t ret; if (!isInnerRequest) { @@ -74,7 +75,7 @@ int32_t LnnStartDiscDevice(const char *pkgName, const SubscribeInfo *info, const return SOFTBUS_OK; } -int32_t LnnStopDiscDevice(const char *pkgName, int32_t subscribeId, bool isInnerRequest) +NO_SANITIZE("cfi") int32_t LnnStopDiscDevice(const char *pkgName, int32_t subscribeId, bool isInnerRequest) { if (!isInnerRequest) { if (DiscStopDiscovery(pkgName, subscribeId) != SOFTBUS_OK) { diff --git a/core/bus_center/lnn/disc_mgr/src/lnn_discovery_manager.c b/core/bus_center/lnn/disc_mgr/src/lnn_discovery_manager.c index 08b7e61a8..34620a759 100644 --- a/core/bus_center/lnn/disc_mgr/src/lnn_discovery_manager.c +++ b/core/bus_center/lnn/disc_mgr/src/lnn_discovery_manager.c @@ -82,7 +82,7 @@ NO_SANITIZE("cfi") int32_t LnnInitDiscoveryManager(void) return SOFTBUS_OK; } -int32_t LnnStartPublish(void) +NO_SANITIZE("cfi") int32_t LnnStartPublish(void) { uint32_t i; @@ -99,7 +99,7 @@ int32_t LnnStartPublish(void) return SOFTBUS_OK; } -void LnnStopPublish(void) +NO_SANITIZE("cfi") void LnnStopPublish(void) { uint32_t i; @@ -114,7 +114,7 @@ void LnnStopPublish(void) } } -int32_t LnnStartDiscovery(void) +NO_SANITIZE("cfi") int32_t LnnStartDiscovery(void) { uint32_t i; @@ -131,7 +131,7 @@ int32_t LnnStartDiscovery(void) return SOFTBUS_OK; } -void LnnStopDiscovery(void) +NO_SANITIZE("cfi") void LnnStopDiscovery(void) { uint32_t i; diff --git a/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_ctrl.c b/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_ctrl.c index 06d8e7af5..f8385bdf9 100644 --- a/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_ctrl.c +++ b/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_ctrl.c @@ -165,7 +165,7 @@ static void HbToRecoveryNetwork(void) } } -int32_t LnnStartHeartbeatFrameDelay(void) +NO_SANITIZE("cfi") int32_t LnnStartHeartbeatFrameDelay(void) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_INFO, "heartbeat(HB) FSM start."); if (LnnHbMediumMgrInit() != SOFTBUS_OK) { @@ -191,7 +191,7 @@ int32_t LnnSetHeartbeatMediumParam(const LnnHeartbeatMediumParam *param) return LnnSetMediumParamBySpecificType(param); } -int32_t LnnOfflineTimingByHeartbeat(const char *networkId, ConnectionAddrType addrType) +NO_SANITIZE("cfi") int32_t LnnOfflineTimingByHeartbeat(const char *networkId, ConnectionAddrType addrType) { if (networkId == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB offline timing get invalid param"); @@ -211,7 +211,8 @@ int32_t LnnOfflineTimingByHeartbeat(const char *networkId, ConnectionAddrType ad return SOFTBUS_OK; } -int32_t LnnShiftLNNGear(const char *pkgName, const char *callerId, const char *targetNetworkId, const GearMode *mode) +NO_SANITIZE("cfi") int32_t LnnShiftLNNGear(const char *pkgName, const char *callerId, const char *targetNetworkId, + const GearMode *mode) { if (pkgName == NULL || mode == NULL || callerId == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB shift lnn gear get invalid param"); @@ -235,7 +236,7 @@ int32_t LnnShiftLNNGear(const char *pkgName, const char *callerId, const char *t return SOFTBUS_OK; } -void LnnUpdateHeartbeatInfo(LnnHeartbeatUpdateInfoType type) +NO_SANITIZE("cfi") void LnnUpdateHeartbeatInfo(LnnHeartbeatUpdateInfoType type) { LnnUpdateSendInfoStrategy(type); } diff --git a/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_fsm.c b/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_fsm.c index c912ac6f4..b03d3f031 100644 --- a/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_fsm.c +++ b/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_fsm.c @@ -307,7 +307,7 @@ static void RemoveHbMsgByCustObj(LnnHeartbeatFsm *hbFsm, LnnHeartbeatEventType e } } -void LnnRemoveSendEndMsg(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type, bool *isRemoved) +NO_SANITIZE("cfi") void LnnRemoveSendEndMsg(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type, bool *isRemoved) { if (hbFsm == NULL || isRemoved == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB remove send end msg get invalid param"); @@ -323,7 +323,7 @@ void LnnRemoveSendEndMsg(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type, bool *is msgPara.isRemoved = NULL; } -void LnnRemoveCheckDevStatusMsg(LnnHeartbeatFsm *hbFsm, LnnCheckDevStatusMsgPara *msgPara) +NO_SANITIZE("cfi") void LnnRemoveCheckDevStatusMsg(LnnHeartbeatFsm *hbFsm, LnnCheckDevStatusMsgPara *msgPara) { if (hbFsm == NULL || msgPara == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB remove check msg get invalid param"); @@ -332,7 +332,8 @@ void LnnRemoveCheckDevStatusMsg(LnnHeartbeatFsm *hbFsm, LnnCheckDevStatusMsgPara RemoveHbMsgByCustObj(hbFsm, EVENT_HB_CHECK_DEV_STATUS, (void *)msgPara); } -void LnnRemoveProcessSendOnceMsg(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType hbType, LnnHeartbeatStrategyType strategyType) +NO_SANITIZE("cfi") void LnnRemoveProcessSendOnceMsg(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType hbType, + LnnHeartbeatStrategyType strategyType) { if (hbFsm == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB remove process send once msg get invalid param"); @@ -848,7 +849,7 @@ NO_SANITIZE("cfi") LnnHeartbeatFsm *LnnCreateHeartbeatFsm(void) return hbFsm; } -int32_t LnnStartHeartbeatFsm(LnnHeartbeatFsm *hbFsm) +NO_SANITIZE("cfi") int32_t LnnStartHeartbeatFsm(LnnHeartbeatFsm *hbFsm) { if (hbFsm == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB start fsm is null"); @@ -862,7 +863,7 @@ int32_t LnnStartHeartbeatFsm(LnnHeartbeatFsm *hbFsm) return SOFTBUS_OK; } -int32_t LnnStopHeartbeatFsm(LnnHeartbeatFsm *hbFsm) +NO_SANITIZE("cfi") int32_t LnnStopHeartbeatFsm(LnnHeartbeatFsm *hbFsm) { if (hbFsm == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB stop fsm is null"); @@ -875,7 +876,7 @@ int32_t LnnStopHeartbeatFsm(LnnHeartbeatFsm *hbFsm) return LnnFsmDeinit(&hbFsm->fsm); } -int32_t LnnPostNextSendOnceMsgToHbFsm(LnnHeartbeatFsm *hbFsm, const LnnProcessSendOnceMsgPara *para, +NO_SANITIZE("cfi") int32_t LnnPostNextSendOnceMsgToHbFsm(LnnHeartbeatFsm *hbFsm, const LnnProcessSendOnceMsgPara *para, uint64_t delayMillis) { LnnProcessSendOnceMsgPara *dupPara = NULL; @@ -910,7 +911,8 @@ static int32_t CreateNewHbTypeObjMsg(LnnHeartbeatType srcType, LnnHeartbeatType return SOFTBUS_OK; } -int32_t LnnPostSendBeginMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type, bool wakeupFlag, bool isRelay) +NO_SANITIZE("cfi") int32_t LnnPostSendBeginMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type, bool wakeupFlag, + bool isRelay) { LnnHeartbeatCustSendData *custData = NULL; @@ -934,7 +936,7 @@ int32_t LnnPostSendBeginMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type return SOFTBUS_OK; } -int32_t LnnPostSendEndMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type, uint64_t delayMillis) +NO_SANITIZE("cfi") int32_t LnnPostSendEndMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type, uint64_t delayMillis) { LnnHeartbeatType *newType = NULL; @@ -954,7 +956,7 @@ int32_t LnnPostSendEndMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type, return SOFTBUS_OK; } -int32_t LnnPostStartMsgToHbFsm(LnnHeartbeatFsm *hbFsm, uint64_t delayMillis) +NO_SANITIZE("cfi") int32_t LnnPostStartMsgToHbFsm(LnnHeartbeatFsm *hbFsm, uint64_t delayMillis) { if (hbFsm == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB post start msg get invalid param"); @@ -963,7 +965,7 @@ int32_t LnnPostStartMsgToHbFsm(LnnHeartbeatFsm *hbFsm, uint64_t delayMillis) return LnnFsmPostMessageDelay(&hbFsm->fsm, EVENT_HB_START_PROCESS, NULL, delayMillis); } -int32_t LnnPostStopMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type) +NO_SANITIZE("cfi") int32_t LnnPostStopMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type) { LnnHeartbeatType *newType = NULL; @@ -983,7 +985,7 @@ int32_t LnnPostStopMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type) return SOFTBUS_OK; } -int32_t LnnPostTransStateMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatEventType evtType) +NO_SANITIZE("cfi") int32_t LnnPostTransStateMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatEventType evtType) { if (hbFsm == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB post trans state msg get invalid hbFsm"); @@ -996,7 +998,7 @@ int32_t LnnPostTransStateMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatEventTyp return LnnFsmPostMessage(&hbFsm->fsm, evtType, NULL); } -int32_t LnnPostSetMediumParamMsgToHbFsm(LnnHeartbeatFsm *hbFsm, const LnnHeartbeatMediumParam *para) +NO_SANITIZE("cfi") int32_t LnnPostSetMediumParamMsgToHbFsm(LnnHeartbeatFsm *hbFsm, const LnnHeartbeatMediumParam *para) { LnnHeartbeatMediumParam *dupPara = NULL; @@ -1018,7 +1020,7 @@ int32_t LnnPostSetMediumParamMsgToHbFsm(LnnHeartbeatFsm *hbFsm, const LnnHeartbe return SOFTBUS_OK; } -int32_t LnnPostCheckDevStatusMsgToHbFsm(LnnHeartbeatFsm *hbFsm, const LnnCheckDevStatusMsgPara *para, +NO_SANITIZE("cfi") int32_t LnnPostCheckDevStatusMsgToHbFsm(LnnHeartbeatFsm *hbFsm, const LnnCheckDevStatusMsgPara *para, uint64_t delayMillis) { LnnCheckDevStatusMsgPara *dupPara = NULL; @@ -1048,7 +1050,7 @@ int32_t LnnPostCheckDevStatusMsgToHbFsm(LnnHeartbeatFsm *hbFsm, const LnnCheckDe return SOFTBUS_OK; } -int32_t LnnPostUpdateSendInfoMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatUpdateInfoType type) +NO_SANITIZE("cfi") int32_t LnnPostUpdateSendInfoMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatUpdateInfoType type) { if (hbFsm == NULL || type <= UPDATE_HB_INFO_MIN || type >= UPDATE_HB_MAX_INFO) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB post update info msg get invalid param"); diff --git a/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_medium_mgr.c b/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_medium_mgr.c index 08a0ab1a4..0cdcb2052 100644 --- a/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_medium_mgr.c +++ b/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_medium_mgr.c @@ -636,7 +636,7 @@ static bool VisitUnRegistHeartbeatMediumMgr(LnnHeartbeatType *typeSet, LnnHeartb return true; } -int32_t LnnUnRegistHeartbeatMediumMgr(LnnHeartbeatMediumMgr *mgr) +NO_SANITIZE("cfi") int32_t LnnUnRegistHeartbeatMediumMgr(LnnHeartbeatMediumMgr *mgr) { if (mgr == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB unregist manager get invalid param"); diff --git a/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_strategy.c b/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_strategy.c index 02860219f..bf85f13a5 100644 --- a/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_strategy.c +++ b/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_strategy.c @@ -220,7 +220,8 @@ static int32_t FirstSetGearModeByCallerId(const char *callerId, int64_t nowTime, return SOFTBUS_OK; } -int32_t LnnSetGearModeBySpecificType(const char *callerId, const GearMode *mode, LnnHeartbeatType type) +NO_SANITIZE("cfi") int32_t LnnSetGearModeBySpecificType(const char *callerId, const GearMode *mode, + LnnHeartbeatType type) { int64_t nowTime; SoftBusSysTime times; @@ -433,7 +434,7 @@ static bool VisitRegistParamMgr(LnnHeartbeatType *typeSet, LnnHeartbeatType each return true; } -int32_t LnnRegistParamMgrByType(LnnHeartbeatType type) +NO_SANITIZE("cfi") int32_t LnnRegistParamMgrByType(LnnHeartbeatType type) { if (SoftBusMutexLock(&g_hbStrategyMutex) != 0) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB regist paramMgr lock mutex fail"); @@ -479,7 +480,7 @@ static bool VisitUnRegistParamMgr(LnnHeartbeatType *typeSet, LnnHeartbeatType ea return true; } -void LnnUnRegistParamMgrByType(LnnHeartbeatType type) +NO_SANITIZE("cfi") void LnnUnRegistParamMgrByType(LnnHeartbeatType type) { if (SoftBusMutexLock(&g_hbStrategyMutex) != 0) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB unRegist paramMgr lock mutex fail"); @@ -489,7 +490,7 @@ void LnnUnRegistParamMgrByType(LnnHeartbeatType type) (void)SoftBusMutexUnlock(&g_hbStrategyMutex); } -int32_t LnnSetMediumParamBySpecificType(const LnnHeartbeatMediumParam *param) +NO_SANITIZE("cfi") int32_t LnnSetMediumParamBySpecificType(const LnnHeartbeatMediumParam *param) { LnnHeartbeatParamManager *paramMgr = NULL; @@ -580,7 +581,7 @@ NO_SANITIZE("cfi") int32_t LnnGetHbStrategyManager(LnnHeartbeatStrategyManager * return SOFTBUS_OK; } -int32_t LnnStartNewHbStrategyFsm(void) +NO_SANITIZE("cfi") int32_t LnnStartNewHbStrategyFsm(void) { LnnHeartbeatFsm *hbFsm = NULL; @@ -601,7 +602,7 @@ int32_t LnnStartNewHbStrategyFsm(void) return SOFTBUS_OK; } -int32_t LnnStartOfflineTimingStrategy(const char *networkId, ConnectionAddrType addrType) +NO_SANITIZE("cfi") int32_t LnnStartOfflineTimingStrategy(const char *networkId, ConnectionAddrType addrType) { GearMode mode = {0}; LnnCheckDevStatusMsgPara msgPara = {0}; @@ -623,7 +624,7 @@ int32_t LnnStartOfflineTimingStrategy(const char *networkId, ConnectionAddrType return LnnPostCheckDevStatusMsgToHbFsm(g_hbFsm, &msgPara, delayMillis); } -int32_t LnnStopOfflineTimingStrategy(const char *networkId, ConnectionAddrType addrType) +NO_SANITIZE("cfi") int32_t LnnStopOfflineTimingStrategy(const char *networkId, ConnectionAddrType addrType) { if (networkId == NULL) { return SOFTBUS_INVALID_PARAM; @@ -641,7 +642,8 @@ int32_t LnnStopOfflineTimingStrategy(const char *networkId, ConnectionAddrType a return SOFTBUS_OK; } -int32_t LnnStartHbByTypeAndStrategy(LnnHeartbeatType hbType, LnnHeartbeatStrategyType strategyType, bool isRelay) +NO_SANITIZE("cfi") int32_t LnnStartHbByTypeAndStrategy(LnnHeartbeatType hbType, LnnHeartbeatStrategyType strategyType, + bool isRelay) { LnnProcessSendOnceMsgPara msgPara = { .hbType = hbType, @@ -661,7 +663,7 @@ int32_t LnnStartHeartbeat(uint64_t delayMillis) return LnnPostStartMsgToHbFsm(g_hbFsm, delayMillis); } -int32_t LnnStopHeartbeatByType(LnnHeartbeatType type) +NO_SANITIZE("cfi") int32_t LnnStopHeartbeatByType(LnnHeartbeatType type) { if (LnnPostStopMsgToHbFsm(g_hbFsm, type) != SOFTBUS_OK) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB stop heartbeat by type post msg fail"); @@ -714,12 +716,12 @@ NO_SANITIZE("cfi") bool LnnIsHeartbeatEnable(LnnHeartbeatType type) return ret; } -int32_t LnnSetHbAsMasterNodeState(bool isMasterNode) +NO_SANITIZE("cfi") int32_t LnnSetHbAsMasterNodeState(bool isMasterNode) { return LnnPostTransStateMsgToHbFsm(g_hbFsm, isMasterNode ? EVENT_HB_AS_MASTER_NODE : EVENT_HB_AS_NORMAL_NODE); } -int32_t LnnUpdateSendInfoStrategy(LnnHeartbeatUpdateInfoType type) +NO_SANITIZE("cfi") int32_t LnnUpdateSendInfoStrategy(LnnHeartbeatUpdateInfoType type) { return LnnPostUpdateSendInfoMsgToHbFsm(g_hbFsm, type); } diff --git a/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c b/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c index 160b66e52..1b134876d 100644 --- a/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c +++ b/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c @@ -163,7 +163,7 @@ NO_SANITIZE("cfi") bool LnnHasActiveConnection(const char *networkId, Connection return false; } -bool LnnVisitHbTypeSet(VisitHbTypeCb callback, LnnHeartbeatType *typeSet, void *data) +NO_SANITIZE("cfi") bool LnnVisitHbTypeSet(VisitHbTypeCb callback, LnnHeartbeatType *typeSet, void *data) { bool isFinish = false; LnnHeartbeatType i; diff --git a/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane.c b/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane.c index fe239c170..f8120a9ed 100644 --- a/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane.c +++ b/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane.c @@ -311,7 +311,7 @@ NO_SANITIZE("cfi") int32_t LnnFreeLane(uint32_t laneId) return SOFTBUS_OK; } -QueryResult LnnQueryLaneResource(const LaneQueryInfo *queryInfo) +NO_SANITIZE("cfi") QueryResult LnnQueryLaneResource(const LaneQueryInfo *queryInfo) { if (queryInfo == NULL) { return QUERY_RESULT_REQUEST_ILLEGAL; diff --git a/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_common.c b/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_common.c index 0cf77befc..8caa101e6 100755 --- a/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_common.c +++ b/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_common.c @@ -130,7 +130,7 @@ NO_SANITIZE("cfi") int32_t LnnCreateData(Map *map, uint32_t key, const void *val return SOFTBUS_OK; } -void *LnnReadData(const Map *map, uint32_t key) +NO_SANITIZE("cfi") void *LnnReadData(const Map *map, uint32_t key) { char keyStr[UINT_TO_STR_MAX_LEN] = {0}; if (sprintf_s(keyStr, UINT_TO_STR_MAX_LEN, "%u", key) < 0) { diff --git a/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_link.c b/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_link.c index 24e69e0e2..bf284c438 100644 --- a/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_link.c +++ b/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_link.c @@ -137,7 +137,7 @@ static int64_t GetAuthIdFromItem(int32_t requestId) return authId; } -int32_t LnnLanePendingInit(void) +NO_SANITIZE("cfi") int32_t LnnLanePendingInit(void) { if (g_pendingList != NULL) { return SOFTBUS_OK; @@ -149,7 +149,7 @@ int32_t LnnLanePendingInit(void) return SOFTBUS_OK; } -void LnnLanePendingDeinit(void) +NO_SANITIZE("cfi") void LnnLanePendingDeinit(void) { if (g_pendingList == NULL) { return; diff --git a/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_trans_lane.c b/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_trans_lane.c index 5cb51f6ab..4d83deb91 100755 --- a/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_trans_lane.c +++ b/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_trans_lane.c @@ -27,10 +27,10 @@ #include "lnn_lane_select.h" #include "message_handler.h" #include "softbus_adapter_mem.h" +#include "softbus_def.h" #include "softbus_errcode.h" #include "softbus_log.h" #include "softbus_utils.h" -#include "softbus_def.h" typedef enum { MSG_TYPE_LANE_TRIGGER_LINK = 0, @@ -499,7 +499,7 @@ static void LaneLinkException(SoftBusMessage *msg) NotifyLaneStateChange(laneId, state); } -static void MsgHandler(SoftBusMessage *msg) +NO_SANITIZE("cfi") static void MsgHandler(SoftBusMessage *msg) { if (msg == NULL) { return; diff --git a/core/bus_center/lnn/lane_hub/time_sync/src/lnn_time_sync_manager.c b/core/bus_center/lnn/lane_hub/time_sync/src/lnn_time_sync_manager.c index b33c7b581..8a73fa965 100644 --- a/core/bus_center/lnn/lane_hub/time_sync/src/lnn_time_sync_manager.c +++ b/core/bus_center/lnn/lane_hub/time_sync/src/lnn_time_sync_manager.c @@ -487,7 +487,7 @@ NO_SANITIZE("cfi") void LnnDeinitTimeSync(void) LnnTimeSyncImplDeinit(); } -int32_t LnnStartTimeSync(const char *pkgName, const char *targetNetworkId, +NO_SANITIZE("cfi") int32_t LnnStartTimeSync(const char *pkgName, const char *targetNetworkId, TimeSyncAccuracy accuracy, TimeSyncPeriod period) { StartTimeSyncReqMsgPara *para = NULL; @@ -526,7 +526,7 @@ int32_t LnnStartTimeSync(const char *pkgName, const char *targetNetworkId, return SOFTBUS_OK; } -int32_t LnnStopTimeSync(const char *pkgName, const char *targetNetworkId) +NO_SANITIZE("cfi") int32_t LnnStopTimeSync(const char *pkgName, const char *targetNetworkId) { StopTimeSyncReqMsgPara *para = NULL; diff --git a/core/bus_center/lnn/net_builder/src/lnn_connection_fsm.c b/core/bus_center/lnn/net_builder/src/lnn_connection_fsm.c index 59bd9e174..75342fbf1 100644 --- a/core/bus_center/lnn/net_builder/src/lnn_connection_fsm.c +++ b/core/bus_center/lnn/net_builder/src/lnn_connection_fsm.c @@ -181,7 +181,7 @@ static void ReportResult(const char *udid, ReportCategory report) } } -int64_t LnnUpTimeMs(void) +NO_SANITIZE("cfi") int64_t LnnUpTimeMs(void) { SoftBusSysTime t; t.sec = 0; @@ -360,7 +360,7 @@ static int32_t OnJoinLNN(LnnConnectionFsm *connFsm) return rc; } -int32_t OnJoinMetaNode(MetaJoinRequestNode *metaJoinNode, CustomData *customData) +NO_SANITIZE("cfi") int32_t OnJoinMetaNode(MetaJoinRequestNode *metaJoinNode, CustomData *customData) { if (metaJoinNode == NULL || customData == NULL) { return SOFTBUS_ERR; @@ -809,7 +809,7 @@ NO_SANITIZE("cfi") void LnnDestroyConnectionFsm(LnnConnectionFsm *connFsm) SoftBusFree(connFsm); } -int32_t LnnStartConnectionFsm(LnnConnectionFsm *connFsm) +NO_SANITIZE("cfi") int32_t LnnStartConnectionFsm(LnnConnectionFsm *connFsm) { if (connFsm == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "connection fsm is null"); @@ -823,7 +823,7 @@ int32_t LnnStartConnectionFsm(LnnConnectionFsm *connFsm) return SOFTBUS_OK; } -int32_t LnnStopConnectionFsm(LnnConnectionFsm *connFsm, LnnConnectionFsmStopCallback callback) +NO_SANITIZE("cfi") int32_t LnnStopConnectionFsm(LnnConnectionFsm *connFsm, LnnConnectionFsmStopCallback callback) { if (connFsm == NULL || callback == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "connection fsm or stop callback is null"); @@ -837,7 +837,7 @@ int32_t LnnStopConnectionFsm(LnnConnectionFsm *connFsm, LnnConnectionFsmStopCall return LnnFsmDeinit(&connFsm->fsm); } -int32_t LnnSendJoinRequestToConnFsm(LnnConnectionFsm *connFsm) +NO_SANITIZE("cfi") int32_t LnnSendJoinRequestToConnFsm(LnnConnectionFsm *connFsm) { if (!CheckInterfaceCommonArgs(connFsm, true)) { return SOFTBUS_INVALID_PARAM; @@ -846,7 +846,7 @@ int32_t LnnSendJoinRequestToConnFsm(LnnConnectionFsm *connFsm) return LnnFsmPostMessage(&connFsm->fsm, FSM_MSG_TYPE_JOIN_LNN, NULL); } -int32_t LnnSendAuthResultMsgToConnFsm(LnnConnectionFsm *connFsm, int32_t retCode) +NO_SANITIZE("cfi") int32_t LnnSendAuthResultMsgToConnFsm(LnnConnectionFsm *connFsm, int32_t retCode) { int32_t *para = NULL; @@ -867,7 +867,7 @@ int32_t LnnSendAuthResultMsgToConnFsm(LnnConnectionFsm *connFsm, int32_t retCode return SOFTBUS_OK; } -int32_t LnnSendNotTrustedToConnFsm(LnnConnectionFsm *connFsm) +NO_SANITIZE("cfi") int32_t LnnSendNotTrustedToConnFsm(LnnConnectionFsm *connFsm) { if (!CheckInterfaceCommonArgs(connFsm, true)) { return SOFTBUS_INVALID_PARAM; @@ -875,7 +875,7 @@ int32_t LnnSendNotTrustedToConnFsm(LnnConnectionFsm *connFsm) return LnnFsmPostMessage(&connFsm->fsm, FSM_MSG_TYPE_NOT_TRUSTED, NULL); } -int32_t LnnSendDisconnectMsgToConnFsm(LnnConnectionFsm *connFsm) +NO_SANITIZE("cfi") int32_t LnnSendDisconnectMsgToConnFsm(LnnConnectionFsm *connFsm) { if (!CheckInterfaceCommonArgs(connFsm, true)) { return SOFTBUS_INVALID_PARAM; @@ -883,7 +883,7 @@ int32_t LnnSendDisconnectMsgToConnFsm(LnnConnectionFsm *connFsm) return LnnFsmPostMessage(&connFsm->fsm, FSM_MSG_TYPE_DISCONNECT, NULL); } -int32_t LnnSendLeaveRequestToConnFsm(LnnConnectionFsm *connFsm) +NO_SANITIZE("cfi") int32_t LnnSendLeaveRequestToConnFsm(LnnConnectionFsm *connFsm) { if (!CheckInterfaceCommonArgs(connFsm, true)) { return SOFTBUS_ERR; @@ -891,7 +891,7 @@ int32_t LnnSendLeaveRequestToConnFsm(LnnConnectionFsm *connFsm) return LnnFsmPostMessage(&connFsm->fsm, FSM_MSG_TYPE_LEAVE_LNN, NULL); } -int32_t LnnSendSyncOfflineFinishToConnFsm(LnnConnectionFsm *connFsm) +NO_SANITIZE("cfi") int32_t LnnSendSyncOfflineFinishToConnFsm(LnnConnectionFsm *connFsm) { if (!CheckInterfaceCommonArgs(connFsm, true)) { return SOFTBUS_ERR; @@ -899,7 +899,7 @@ int32_t LnnSendSyncOfflineFinishToConnFsm(LnnConnectionFsm *connFsm) return LnnFsmPostMessage(&connFsm->fsm, FSM_MSG_TYPE_SYNC_OFFLINE_DONE, NULL); } -int32_t LnnSendNewNetworkOnlineToConnFsm(LnnConnectionFsm *connFsm) +NO_SANITIZE("cfi") int32_t LnnSendNewNetworkOnlineToConnFsm(LnnConnectionFsm *connFsm) { if (!CheckInterfaceCommonArgs(connFsm, true)) { return SOFTBUS_ERR; diff --git a/core/bus_center/lnn/net_builder/src/lnn_devicename_info.c b/core/bus_center/lnn/net_builder/src/lnn_devicename_info.c index 74f7f0eeb..f2c98274f 100644 --- a/core/bus_center/lnn/net_builder/src/lnn_devicename_info.c +++ b/core/bus_center/lnn/net_builder/src/lnn_devicename_info.c @@ -29,11 +29,11 @@ #include "lnn_sync_item_info.h" #include "lnn_settingdata_event_monitor.h" #include "softbus_adapter_mem.h" +#include "softbus_def.h" #include "softbus_errcode.h" #include "softbus_wifi_api_adapter.h" #include "softbus_json_utils.h" #include "message_handler.h" -#include "softbus_def.h" #define DELAY_LEN 1000 #define MAX_TRY 10 diff --git a/core/bus_center/lnn/net_builder/src/lnn_net_builder.c b/core/bus_center/lnn/net_builder/src/lnn_net_builder.c index 7d51de7b6..d91b2e0d0 100644 --- a/core/bus_center/lnn/net_builder/src/lnn_net_builder.c +++ b/core/bus_center/lnn/net_builder/src/lnn_net_builder.c @@ -1390,7 +1390,7 @@ static NetBuilderMessageProcess g_messageProcessor[MSG_TYPE_MAX] = { ProcessOnAuthMetaVerifyFailed, }; -static void NetBuilderMessageHandler(SoftBusMessage *msg) +NO_SANITIZE("cfi") static void NetBuilderMessageHandler(SoftBusMessage *msg) { int32_t ret; @@ -1795,7 +1795,7 @@ static void OnReceiveNodeAddrChangedMsg(LnnSyncInfoType type, const char *networ } } -int32_t LnnUpdateNodeAddr(const char *addr) +NO_SANITIZE("cfi") int32_t LnnUpdateNodeAddr(const char *addr) { if (addr == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:null ptr!", __func__); @@ -1846,7 +1846,7 @@ int32_t LnnUpdateNodeAddr(const char *addr) return SOFTBUS_OK; } -int32_t NodeInfoSync(void) +NO_SANITIZE("cfi") int32_t NodeInfoSync(void) { if (LnnInitP2p() != SOFTBUS_OK) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "init lnn p2p fail"); @@ -1946,7 +1946,7 @@ NO_SANITIZE("cfi") void LnnDeinitNetBuilder(void) g_netBuilder.isInit = false; } -int32_t LnnServerJoin(ConnectionAddr *addr) +NO_SANITIZE("cfi") int32_t LnnServerJoin(ConnectionAddr *addr) { ConnectionAddr *para = NULL; @@ -1968,7 +1968,7 @@ int32_t LnnServerJoin(ConnectionAddr *addr) return SOFTBUS_OK; } -int32_t MetaNodeServerJoin(ConnectionAddr *addr, CustomData *customData) +NO_SANITIZE("cfi") int32_t MetaNodeServerJoin(ConnectionAddr *addr, CustomData *customData) { ConnectionAddrKey addrDataKey = { .addr = *addr, @@ -1993,7 +1993,7 @@ int32_t MetaNodeServerJoin(ConnectionAddr *addr, CustomData *customData) return SOFTBUS_OK; } -int32_t LnnServerLeave(const char *networkId) +NO_SANITIZE("cfi") int32_t LnnServerLeave(const char *networkId) { char *para = NULL; @@ -2015,7 +2015,7 @@ int32_t LnnServerLeave(const char *networkId) return SOFTBUS_OK; } -int32_t MetaNodeServerLeave(const char *networkId) +NO_SANITIZE("cfi") int32_t MetaNodeServerLeave(const char *networkId) { char *para = NULL; @@ -2037,7 +2037,7 @@ int32_t MetaNodeServerLeave(const char *networkId) return SOFTBUS_OK; } -int32_t LnnNotifyDiscoveryDevice(const ConnectionAddr *addr) +NO_SANITIZE("cfi") int32_t LnnNotifyDiscoveryDevice(const ConnectionAddr *addr) { ConnectionAddr *para = NULL; @@ -2059,7 +2059,7 @@ int32_t LnnNotifyDiscoveryDevice(const ConnectionAddr *addr) return SOFTBUS_OK; } -int32_t LnnRequestLeaveInvalidConn(const char *oldNetworkId, ConnectionAddrType addrType, +NO_SANITIZE("cfi") int32_t LnnRequestLeaveInvalidConn(const char *oldNetworkId, ConnectionAddrType addrType, const char *newNetworkId) { LeaveInvalidConnMsgPara *para = NULL; @@ -2088,7 +2088,7 @@ int32_t LnnRequestLeaveInvalidConn(const char *oldNetworkId, ConnectionAddrType return SOFTBUS_OK; } -int32_t LnnRequestCleanConnFsm(uint16_t connFsmId) +NO_SANITIZE("cfi") int32_t LnnRequestCleanConnFsm(uint16_t connFsmId) { uint16_t *para = NULL; @@ -2153,7 +2153,7 @@ int32_t LnnNotifyNodeStateChanged(const ConnectionAddr *addr) return SOFTBUS_OK; } -int32_t LnnNotifyMasterElect(const char *networkId, const char *masterUdid, int32_t masterWeight) +NO_SANITIZE("cfi") int32_t LnnNotifyMasterElect(const char *networkId, const char *masterUdid, int32_t masterWeight) { ElectMsgPara *para = NULL; @@ -2186,7 +2186,7 @@ int32_t LnnNotifyMasterElect(const char *networkId, const char *masterUdid, int3 } /* Note: must called in connection fsm. */ -int32_t LnnNotifyAuthHandleLeaveLNN(int64_t authId) +NO_SANITIZE("cfi") int32_t LnnNotifyAuthHandleLeaveLNN(int64_t authId) { LnnConnectionFsm *item = NULL; @@ -2209,7 +2209,7 @@ int32_t LnnNotifyAuthHandleLeaveLNN(int64_t authId) return SOFTBUS_OK; } -int32_t LnnRequestLeaveByAddrType(const bool *type, uint32_t typeLen) +NO_SANITIZE("cfi") int32_t LnnRequestLeaveByAddrType(const bool *type, uint32_t typeLen) { bool *para = NULL; if (typeLen != CONNECTION_ADDR_MAX) { @@ -2239,7 +2239,7 @@ int32_t LnnRequestLeaveByAddrType(const bool *type, uint32_t typeLen) return SOFTBUS_OK; } -int32_t LnnRequestLeaveSpecific(const char *networkId, ConnectionAddrType addrType) +NO_SANITIZE("cfi") int32_t LnnRequestLeaveSpecific(const char *networkId, ConnectionAddrType addrType) { SpecificLeaveMsgPara *para = NULL; diff --git a/core/bus_center/lnn/net_builder/src/lnn_p2p_info.c b/core/bus_center/lnn/net_builder/src/lnn_p2p_info.c index e010be178..9b69dba32 100644 --- a/core/bus_center/lnn/net_builder/src/lnn_p2p_info.c +++ b/core/bus_center/lnn/net_builder/src/lnn_p2p_info.c @@ -147,7 +147,7 @@ static void OnReceiveP2pSyncInfoMsg(LnnSyncInfoType type, const char *networkId, } } -int32_t LnnSyncP2pInfo(void) +NO_SANITIZE("cfi") int32_t LnnSyncP2pInfo(void) { int32_t rc = LnnAsyncCallbackHelper(GetLooper(LOOP_TYPE_DEFAULT), ProcessSyncP2pInfo, NULL); if (rc != SOFTBUS_OK) { diff --git a/core/bus_center/lnn/net_builder/src/lnn_sync_info_manager.c b/core/bus_center/lnn/net_builder/src/lnn_sync_info_manager.c index 3b3c9a08d..938187fbd 100644 --- a/core/bus_center/lnn/net_builder/src/lnn_sync_info_manager.c +++ b/core/bus_center/lnn/net_builder/src/lnn_sync_info_manager.c @@ -408,7 +408,7 @@ NO_SANITIZE("cfi") void LnnDeinitSyncInfoManager(void) SoftBusMutexDestroy(&g_syncInfoManager.lock); } -int32_t LnnRegSyncInfoHandler(LnnSyncInfoType type, LnnSyncInfoMsgHandler handler) +NO_SANITIZE("cfi") int32_t LnnRegSyncInfoHandler(LnnSyncInfoType type, LnnSyncInfoMsgHandler handler) { if (type >= LNN_INFO_TYPE_COUNT || handler == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "invalid sync info hander reg param: %d", type); @@ -428,7 +428,7 @@ int32_t LnnRegSyncInfoHandler(LnnSyncInfoType type, LnnSyncInfoMsgHandler handle return SOFTBUS_OK; } -int32_t LnnUnregSyncInfoHandler(LnnSyncInfoType type, LnnSyncInfoMsgHandler handler) +NO_SANITIZE("cfi") int32_t LnnUnregSyncInfoHandler(LnnSyncInfoType type, LnnSyncInfoMsgHandler handler) { if (type >= LNN_INFO_TYPE_COUNT || handler == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "invalid sync info hander unreg param: %d", type); @@ -516,7 +516,7 @@ static int32_t TrySendSyncInfoMsg(const char *networkId, SyncInfoMsg *msg) return SOFTBUS_OK; } -int32_t LnnSendSyncInfoMsg(LnnSyncInfoType type, const char *networkId, +NO_SANITIZE("cfi") int32_t LnnSendSyncInfoMsg(LnnSyncInfoType type, const char *networkId, const uint8_t *msg, uint32_t len, LnnSyncInfoMsgComplete complete) { SyncInfoMsg *syncMsg = NULL; diff --git a/core/bus_center/lnn/net_builder/src/lnn_sync_item_info.c b/core/bus_center/lnn/net_builder/src/lnn_sync_item_info.c index 8b7838e30..c5f749f8e 100644 --- a/core/bus_center/lnn/net_builder/src/lnn_sync_item_info.c +++ b/core/bus_center/lnn/net_builder/src/lnn_sync_item_info.c @@ -21,6 +21,7 @@ #include "lnn_local_net_ledger.h" #include "lnn_sync_info_manager.h" #include "softbus_adapter_mem.h" +#include "softbus_def.h" #include "softbus_errcode.h" #include "softbus_log.h" #include "softbus_wifi_api_adapter.h" @@ -143,7 +144,7 @@ void OnReceiveTransReqMsg(LnnSyncInfoType type, const char *networkId, const uin } } -int32_t LnnSyncDeviceName(const char *networkId) +NO_SANITIZE("cfi") int32_t LnnSyncDeviceName(const char *networkId) { const char *deviceName = NULL; const NodeInfo *info = LnnGetLocalNodeInfo(); diff --git a/core/bus_center/lnn/net_buscenter/src/lnn_network_manager.c b/core/bus_center/lnn/net_buscenter/src/lnn_network_manager.c index 76087bab4..1eb4521ae 100644 --- a/core/bus_center/lnn/net_buscenter/src/lnn_network_manager.c +++ b/core/bus_center/lnn/net_buscenter/src/lnn_network_manager.c @@ -265,7 +265,7 @@ int32_t UnregistProtocol(LnnProtocolManager *protocolMgr) return SOFTBUS_ERR; } -bool LnnVisitNetif(VisitNetifCallback callback, void *data) +NO_SANITIZE("cfi") bool LnnVisitNetif(VisitNetifCallback callback, void *data) { LnnNetIfMgr *item = NULL; VisitNextChoice result = CHOICE_VISIT_NEXT; @@ -279,7 +279,7 @@ bool LnnVisitNetif(VisitNetifCallback callback, void *data) return true; } -bool LnnVisitProtocol(VisitProtocolCallback callback, void *data) +NO_SANITIZE("cfi") bool LnnVisitProtocol(VisitProtocolCallback callback, void *data) { VisitNextChoice result = CHOICE_VISIT_NEXT; for (uint8_t i = 0; i < LNN_NETWORK_MAX_PROTOCOL_COUNT; i++) { @@ -318,7 +318,7 @@ static void RestartCoapDiscovery(void) SetCallLnnStatus(true); } -static void OnGroupCreated(const char *groupId, int32_t groupType) +NO_SANITIZE("cfi") static void OnGroupCreated(const char *groupId, int32_t groupType) { (void)groupId; RestartCoapDiscovery(); @@ -328,7 +328,7 @@ static void OnGroupCreated(const char *groupId, int32_t groupType) LnnHbOnAuthGroupCreated(groupType); } -static void OnGroupDeleted(const char *groupId) +NO_SANITIZE("cfi") static void OnGroupDeleted(const char *groupId) { (void)groupId; LnnOnOhosAccountChanged(); diff --git a/core/bus_center/lnn/net_buscenter/src/lnn_physical_subnet_manager.c b/core/bus_center/lnn/net_buscenter/src/lnn_physical_subnet_manager.c index cbcf91c34..c3f3dbf96 100644 --- a/core/bus_center/lnn/net_buscenter/src/lnn_physical_subnet_manager.c +++ b/core/bus_center/lnn/net_buscenter/src/lnn_physical_subnet_manager.c @@ -90,7 +90,7 @@ static int32_t DoRegistSubnet(LnnPhysicalSubnet *subnet) return SOFTBUS_ERR; } -int32_t LnnRegistPhysicalSubnet(LnnPhysicalSubnet *subnet) +NO_SANITIZE("cfi") int32_t LnnRegistPhysicalSubnet(LnnPhysicalSubnet *subnet) { if (subnet == NULL || subnet->protocol == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s: protocol of subnet is required!", __func__); @@ -114,7 +114,7 @@ static int32_t DoUnregistSubnetByType(ProtocolType type) return SOFTBUS_OK; } -int32_t LnnUnregistPhysicalSubnetByType(ProtocolType type) +NO_SANITIZE("cfi") int32_t LnnUnregistPhysicalSubnetByType(ProtocolType type) { int32_t ret = SOFTBUS_OK; CALL_WITH_LOCK(ret, &g_physicalSubnetsLock, DoUnregistSubnetByType(type)); @@ -156,7 +156,7 @@ static void EnableResetingSubnetByType(ProtocolType protocolType) } } -void LnnNotifyAllTypeOffline(ConnectionAddrType type) +NO_SANITIZE("cfi") void LnnNotifyAllTypeOffline(ConnectionAddrType type) { if (type == CONNECTION_ADDR_ETH || type == CONNECTION_ADDR_WLAN || type == CONNECTION_ADDR_MAX) { CALL_VOID_FUNC_WITH_LOCK(&g_physicalSubnetsLock, EnableResetingSubnetByType(LNN_PROTOCOL_IP)); @@ -178,7 +178,7 @@ static bool DoVisitSubnet(LnnVisitPhysicalSubnetCallback callback, void *data) return true; } -bool LnnVisitPhysicalSubnet(LnnVisitPhysicalSubnetCallback callback, void *data) +NO_SANITIZE("cfi") bool LnnVisitPhysicalSubnet(LnnVisitPhysicalSubnetCallback callback, void *data) { bool ret = false; CALL_WITH_LOCK(ret, &g_physicalSubnetsLock, DoVisitSubnet(callback, data)); diff --git a/core/bus_center/lnn/net_ledger/common/src/lnn_device_info.c b/core/bus_center/lnn/net_ledger/common/src/lnn_device_info.c index 8c01fba82..0760edaa4 100644 --- a/core/bus_center/lnn/net_ledger/common/src/lnn_device_info.c +++ b/core/bus_center/lnn/net_ledger/common/src/lnn_device_info.c @@ -56,7 +56,7 @@ NO_SANITIZE("cfi") const char *LnnGetDeviceName(const DeviceBasicInfo *info) return info->deviceName; } -int32_t LnnSetDeviceName(DeviceBasicInfo *info, const char *name) +NO_SANITIZE("cfi") int32_t LnnSetDeviceName(DeviceBasicInfo *info, const char *name) { if (info == NULL || name == NULL || strlen(name) > DEVICE_NAME_BUF_LEN - 1) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "LnnSetDeviceName para error."); diff --git a/core/bus_center/lnn/net_ledger/common/src/lnn_net_capability.c b/core/bus_center/lnn/net_ledger/common/src/lnn_net_capability.c index 5a9a43e81..2fa5cd1f7 100644 --- a/core/bus_center/lnn/net_ledger/common/src/lnn_net_capability.c +++ b/core/bus_center/lnn/net_ledger/common/src/lnn_net_capability.c @@ -24,7 +24,7 @@ /* support bit1:br, bit2:wifi, bit4:wifi 2.4G */ #define DEFAUTL_LNN_CAPBILITY 0x16 -int32_t LnnSetNetCapability(uint32_t *capability, NetCapability type) +NO_SANITIZE("cfi") int32_t LnnSetNetCapability(uint32_t *capability, NetCapability type) { if (capability == NULL || type >= BIT_COUNT) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "in para error!"); diff --git a/core/bus_center/lnn/net_ledger/common/src/lnn_net_ledger.c b/core/bus_center/lnn/net_ledger/common/src/lnn_net_ledger.c index 3f78e07a3..96d33d286 100644 --- a/core/bus_center/lnn/net_ledger/common/src/lnn_net_ledger.c +++ b/core/bus_center/lnn/net_ledger/common/src/lnn_net_ledger.c @@ -158,7 +158,7 @@ int32_t LnnGetNodeKeyInfo(const char *networkId, int key, uint8_t *info, uint32_ } } -int32_t LnnSetNodeDataChangeFlag(const char *networkId, uint16_t dataChangeFlag) +NO_SANITIZE("cfi") int32_t LnnSetNodeDataChangeFlag(const char *networkId, uint16_t dataChangeFlag) { bool isLocalNetworkId = false; char localNetworkId[NETWORK_ID_BUF_LEN] = {0}; diff --git a/core/bus_center/lnn/net_ledger/common/src/lnn_node_info.c b/core/bus_center/lnn/net_ledger/common/src/lnn_node_info.c index 39f572a53..f5ae084e0 100644 --- a/core/bus_center/lnn/net_ledger/common/src/lnn_node_info.c +++ b/core/bus_center/lnn/net_ledger/common/src/lnn_node_info.c @@ -43,7 +43,7 @@ NO_SANITIZE("cfi") const char *LnnGetDeviceUdid(const NodeInfo *info) return info->deviceInfo.deviceUdid; } -int32_t LnnSetDeviceUdid(NodeInfo *info, const char *udid) +NO_SANITIZE("cfi") int32_t LnnSetDeviceUdid(NodeInfo *info, const char *udid) { if (info == NULL || udid == NULL) { return SOFTBUS_INVALID_PARAM; @@ -55,7 +55,7 @@ int32_t LnnSetDeviceUdid(NodeInfo *info, const char *udid) return SOFTBUS_OK; } -int32_t LnnSetDiscoveryType(NodeInfo *info, DiscoveryType type) +NO_SANITIZE("cfi") int32_t LnnSetDiscoveryType(NodeInfo *info, DiscoveryType type) { if (info == NULL || type >= DISCOVERY_TYPE_COUNT) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!"); @@ -75,7 +75,7 @@ NO_SANITIZE("cfi") int32_t LnnClearDiscoveryType(NodeInfo *info, DiscoveryType t return SOFTBUS_OK; } -bool LnnIsNodeOnline(const NodeInfo *info) +NO_SANITIZE("cfi") bool LnnIsNodeOnline(const NodeInfo *info) { if (info == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!"); @@ -84,7 +84,7 @@ bool LnnIsNodeOnline(const NodeInfo *info) return (info->status == STATUS_ONLINE); } -void LnnSetNodeConnStatus(NodeInfo *info, ConnectStatus status) +NO_SANITIZE("cfi") void LnnSetNodeConnStatus(NodeInfo *info, ConnectStatus status) { if (info == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!!!"); @@ -102,7 +102,7 @@ NO_SANITIZE("cfi") const char *LnnGetBtMac(const NodeInfo *info) return info->connectInfo.macAddr; } -void LnnSetBtMac(NodeInfo *info, const char *mac) +NO_SANITIZE("cfi") void LnnSetBtMac(NodeInfo *info, const char *mac) { if (info == NULL || mac == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "PARA ERROR!"); @@ -123,7 +123,7 @@ NO_SANITIZE("cfi") const char *LnnGetNetIfName(const NodeInfo *info) return info->connectInfo.netIfName; } -void LnnSetNetIfName(NodeInfo *info, const char *netIfName) +NO_SANITIZE("cfi") void LnnSetNetIfName(NodeInfo *info, const char *netIfName) { if (info == NULL || netIfName == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "PARA ERROR!"); @@ -144,7 +144,7 @@ NO_SANITIZE("cfi") const char *LnnGetWiFiIp(const NodeInfo *info) return info->connectInfo.deviceIp; } -void LnnSetWiFiIp(NodeInfo *info, const char *ip) +NO_SANITIZE("cfi") void LnnSetWiFiIp(NodeInfo *info, const char *ip) { if (info == NULL || ip == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "PARA ERROR!"); @@ -165,7 +165,7 @@ NO_SANITIZE("cfi") const char *LnnGetMasterUdid(const NodeInfo *info) return info->masterUdid; } -int32_t LnnSetMasterUdid(NodeInfo *info, const char *udid) +NO_SANITIZE("cfi") int32_t LnnSetMasterUdid(NodeInfo *info, const char *udid) { if (info == NULL || udid == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "PARA ERROR!"); @@ -187,7 +187,7 @@ NO_SANITIZE("cfi") int32_t LnnGetAuthPort(const NodeInfo *info) return info->connectInfo.authPort; } -int32_t LnnSetAuthPort(NodeInfo *info, int32_t port) +NO_SANITIZE("cfi") int32_t LnnSetAuthPort(NodeInfo *info, int32_t port) { if (info == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error."); @@ -206,7 +206,7 @@ NO_SANITIZE("cfi") int32_t LnnGetSessionPort(const NodeInfo *info) return info->connectInfo.sessionPort; } -int32_t LnnSetSessionPort(NodeInfo *info, int32_t port) +NO_SANITIZE("cfi") int32_t LnnSetSessionPort(NodeInfo *info, int32_t port) { if (info == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!"); @@ -225,7 +225,7 @@ NO_SANITIZE("cfi") int32_t LnnGetProxyPort(const NodeInfo *info) return info->connectInfo.proxyPort; } -int32_t LnnSetProxyPort(NodeInfo *info, int32_t port) +NO_SANITIZE("cfi") int32_t LnnSetProxyPort(NodeInfo *info, int32_t port) { if (info == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!"); @@ -235,7 +235,7 @@ int32_t LnnSetProxyPort(NodeInfo *info, int32_t port) return SOFTBUS_OK; } -int32_t LnnSetP2pRole(NodeInfo *info, int32_t p2pRole) +NO_SANITIZE("cfi") int32_t LnnSetP2pRole(NodeInfo *info, int32_t p2pRole) { if (info == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__); @@ -254,7 +254,7 @@ NO_SANITIZE("cfi") int32_t LnnGetP2pRole(const NodeInfo *info) return info->p2pInfo.p2pRole; } -int32_t LnnSetP2pMac(NodeInfo *info, const char *p2pMac) +NO_SANITIZE("cfi") int32_t LnnSetP2pMac(NodeInfo *info, const char *p2pMac) { if (info == NULL || p2pMac == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__); @@ -276,7 +276,7 @@ NO_SANITIZE("cfi") const char *LnnGetP2pMac(const NodeInfo *info) return info->p2pInfo.p2pMac; } -int32_t LnnSetDataChangeFlag(NodeInfo *info, uint16_t dataChangeFlag) +NO_SANITIZE("cfi") int32_t LnnSetDataChangeFlag(NodeInfo *info, uint16_t dataChangeFlag) { if (info == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__); @@ -295,7 +295,7 @@ NO_SANITIZE("cfi") uint16_t LnnGetDataChangeFlag(const NodeInfo *info) return info->dataChangeFlag; } -int32_t LnnSetP2pGoMac(NodeInfo *info, const char *goMac) +NO_SANITIZE("cfi") int32_t LnnSetP2pGoMac(NodeInfo *info, const char *goMac) { if (info == NULL || goMac == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__); @@ -327,7 +327,7 @@ NO_SANITIZE("cfi") uint64_t LnnGetSupportedProtocols(const NodeInfo *info) return info->supportedProtocols; } -int32_t LnnSetSupportedProtocols(NodeInfo *info, uint64_t protocols) +NO_SANITIZE("cfi") int32_t LnnSetSupportedProtocols(NodeInfo *info, uint64_t protocols) { if (info == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!"); diff --git a/core/bus_center/lnn/net_ledger/distributed_ledger/src/lnn_distributed_net_ledger.c b/core/bus_center/lnn/net_ledger/distributed_ledger/src/lnn_distributed_net_ledger.c index 41616addf..b49aee802 100644 --- a/core/bus_center/lnn/net_ledger/distributed_ledger/src/lnn_distributed_net_ledger.c +++ b/core/bus_center/lnn/net_ledger/distributed_ledger/src/lnn_distributed_net_ledger.c @@ -75,7 +75,7 @@ typedef struct { static DistributedNetLedger g_distributedNetLedger; -int32_t LnnSetAuthTypeValue(uint32_t *authTypeValue, AuthType type) +NO_SANITIZE("cfi") int32_t LnnSetAuthTypeValue(uint32_t *authTypeValue, AuthType type) { if (authTypeValue == NULL || type >= AUTH_TYPE_BUTT) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "in para error!"); @@ -858,7 +858,7 @@ static void UpdateAuthSeq(const NodeInfo *oldInfo, NodeInfo *info) } } -int32_t LnnUpdateNodeInfo(NodeInfo *newInfo) +NO_SANITIZE("cfi") int32_t LnnUpdateNodeInfo(NodeInfo *newInfo) { const char *udid = NULL; DoubleHashMap *map = NULL; @@ -1010,7 +1010,7 @@ NO_SANITIZE("cfi") ReportCategory LnnAddOnlineNode(NodeInfo *info) return REPORT_NONE; } -ReportCategory LnnSetNodeOffline(const char *udid, ConnectionAddrType type, int32_t authId) +NO_SANITIZE("cfi") ReportCategory LnnSetNodeOffline(const char *udid, ConnectionAddrType type, int32_t authId) { NodeInfo *info = NULL; @@ -1069,7 +1069,7 @@ NO_SANITIZE("cfi") int32_t LnnGetBasicInfoByUdid(const char *udid, NodeBasicInfo return ret; } -void LnnRemoveNode(const char *udid) +NO_SANITIZE("cfi") void LnnRemoveNode(const char *udid) { DoubleHashMap *map = &g_distributedNetLedger.distributedInfo; if (udid == NULL) { @@ -1165,7 +1165,7 @@ NO_SANITIZE("cfi") int32_t LnnGetLnnRelation(const char *id, IdCategory type, ui return SOFTBUS_OK; } -bool LnnSetDLDeviceInfoName(const char *udid, const char *name) +NO_SANITIZE("cfi") bool LnnSetDLDeviceInfoName(const char *udid, const char *name) { DoubleHashMap *map = &g_distributedNetLedger.distributedInfo; NodeInfo *info = NULL; @@ -1198,7 +1198,7 @@ EXIT: return false; } -bool LnnSetDLP2pInfo(const char *networkId, const P2pInfo *info) +NO_SANITIZE("cfi") bool LnnSetDLP2pInfo(const char *networkId, const P2pInfo *info) { NodeInfo *node = NULL; if (networkId == NULL || info == NULL) { @@ -1508,7 +1508,7 @@ NO_SANITIZE("cfi") int32_t LnnGetLaneCount(int32_t laneId) return g_distributedNetLedger.laneCount[laneId]; } -int32_t LnnSetLaneCount(int32_t laneId, int32_t num) +NO_SANITIZE("cfi") int32_t LnnSetLaneCount(int32_t laneId, int32_t num) { if (laneId < 0 || laneId >= LNN_LINK_TYPE_BUTT) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "laneId is error! laneId:%d", laneId); @@ -1544,7 +1544,7 @@ NO_SANITIZE("cfi") int32_t LnnGetDLHeartbeatTimestamp(const char *networkId, uin return SOFTBUS_OK; } -int32_t LnnSetDLHeartbeatTimestamp(const char *networkId, uint64_t timestamp) +NO_SANITIZE("cfi") int32_t LnnSetDLHeartbeatTimestamp(const char *networkId, uint64_t timestamp) { if (SoftBusMutexLock(&g_distributedNetLedger.lock) != 0) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "lock mutex fail!"); @@ -1561,7 +1561,7 @@ int32_t LnnSetDLHeartbeatTimestamp(const char *networkId, uint64_t timestamp) return SOFTBUS_OK; } -int32_t LnnSetDLConnCapability(const char *networkId, uint64_t connCapability) +NO_SANITIZE("cfi") int32_t LnnSetDLConnCapability(const char *networkId, uint64_t connCapability) { if (SoftBusMutexLock(&g_distributedNetLedger.lock) != 0) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "lock mutex fail!"); @@ -1578,7 +1578,7 @@ int32_t LnnSetDLConnCapability(const char *networkId, uint64_t connCapability) return SOFTBUS_OK; } -int32_t LnnSetDLNodeAddr(const char *id, IdCategory type, const char *addr) +NO_SANITIZE("cfi") int32_t LnnSetDLNodeAddr(const char *id, IdCategory type, const char *addr) { if (SoftBusMutexLock(&g_distributedNetLedger.lock) != 0) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "lock mutex fail!"); @@ -1713,7 +1713,7 @@ static void RefreshDeviceOnlineStateInfo(DeviceInfo *device, const InnerDeviceIn } } -void LnnRefreshDeviceOnlineStateAndDevIdInfo(const char *pkgName, DeviceInfo *device, +NO_SANITIZE("cfi") void LnnRefreshDeviceOnlineStateAndDevIdInfo(const char *pkgName, DeviceInfo *device, const InnerDeviceInfoAddtions *addtions) { (void)pkgName; diff --git a/core/bus_center/lnn/net_ledger/local_ledger/src/lnn_local_net_ledger.c b/core/bus_center/lnn/net_ledger/local_ledger/src/lnn_local_net_ledger.c index d0beddaf9..70631eb4f 100644 --- a/core/bus_center/lnn/net_ledger/local_ledger/src/lnn_local_net_ledger.c +++ b/core/bus_center/lnn/net_ledger/local_ledger/src/lnn_local_net_ledger.c @@ -818,7 +818,7 @@ static bool JudgeString(const char *info, int32_t len) return (len <= 0) ? false : IsValidString(info, (uint32_t)len); } -int32_t LnnSetLocalStrInfo(InfoKey key, const char *info) +NO_SANITIZE("cfi") int32_t LnnSetLocalStrInfo(InfoKey key, const char *info) { uint32_t i; int32_t ret; @@ -891,7 +891,7 @@ NO_SANITIZE("cfi") int32_t LnnGetLocalNum64Info(InfoKey key, int64_t *info) return LnnGetLocalInfo(key, (void*)info, sizeof(int64_t)); } -int32_t LnnSetLocalNum64Info(InfoKey key, int64_t info) +NO_SANITIZE("cfi") int32_t LnnSetLocalNum64Info(InfoKey key, int64_t info) { return LnnSetLocalInfo(key, (void*)&info); } @@ -901,12 +901,12 @@ NO_SANITIZE("cfi") int32_t LnnGetLocalNum16Info(InfoKey key, int16_t *info) return LnnGetLocalInfo(key, (void*)info, sizeof(int16_t)); } -int32_t LnnSetLocalNum16Info(InfoKey key, int16_t info) +NO_SANITIZE("cfi") int32_t LnnSetLocalNum16Info(InfoKey key, int16_t info) { return LnnSetLocalInfo(key, (void*)&info); } -int32_t LnnSetLocalNumInfo(InfoKey key, int32_t info) +NO_SANITIZE("cfi") int32_t LnnSetLocalNumInfo(InfoKey key, int32_t info) { return LnnSetLocalInfo(key, (void*)&info); } @@ -1037,7 +1037,7 @@ NO_SANITIZE("cfi") void LnnDeinitLocalLedger(void) g_localNetLedger.status = LL_INIT_UNKNOWN; } -bool LnnIsMasterNode(void) +NO_SANITIZE("cfi") bool LnnIsMasterNode(void) { bool ret = false; if (SoftBusMutexLock(&g_localNetLedger.lock) != 0) { diff --git a/core/bus_center/service/src/bus_center_event.c b/core/bus_center/service/src/bus_center_event.c index 450468efe..9e27c3d56 100644 --- a/core/bus_center/service/src/bus_center_event.c +++ b/core/bus_center/service/src/bus_center_event.c @@ -190,7 +190,7 @@ static void NotifyEvent(const LnnEventBasicInfo *info) (void)SoftBusMutexUnlock(&g_eventCtrl.lock); } -void LnnNotifyOnlineState(bool isOnline, NodeBasicInfo *info) +NO_SANITIZE("cfi") void LnnNotifyOnlineState(bool isOnline, NodeBasicInfo *info) { LnnOnlineStateEventInfo eventInfo; @@ -208,7 +208,7 @@ void LnnNotifyOnlineState(bool isOnline, NodeBasicInfo *info) NotifyEvent((LnnEventBasicInfo *)&eventInfo); } -void LnnNotifyBasicInfoChanged(NodeBasicInfo *info, NodeBasicInfoType type) +NO_SANITIZE("cfi") void LnnNotifyBasicInfoChanged(NodeBasicInfo *info, NodeBasicInfoType type) { if (info == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para : info = null!"); @@ -220,7 +220,7 @@ void LnnNotifyBasicInfoChanged(NodeBasicInfo *info, NodeBasicInfoType type) (void)PostNotifyMessage(NOTIFY_NODE_BASIC_INFO_CHANGED, (uint64_t)type, info); } -void LnnNotifyJoinResult(ConnectionAddr *addr, const char *networkId, int32_t retCode) +NO_SANITIZE("cfi") void LnnNotifyJoinResult(ConnectionAddr *addr, const char *networkId, int32_t retCode) { if (addr == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para : addr or networkId = null!"); @@ -230,7 +230,7 @@ void LnnNotifyJoinResult(ConnectionAddr *addr, const char *networkId, int32_t re LnnIpcNotifyJoinResult(addr, sizeof(ConnectionAddr), networkId, retCode); } -void MetaNodeNotifyJoinResult(ConnectionAddr *addr, const char *networkId, int32_t retCode) +NO_SANITIZE("cfi") void MetaNodeNotifyJoinResult(ConnectionAddr *addr, const char *networkId, int32_t retCode) { if (addr == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para : addr or networkId = null!"); @@ -240,7 +240,7 @@ void MetaNodeNotifyJoinResult(ConnectionAddr *addr, const char *networkId, int32 MetaNodeIpcNotifyJoinResult(addr, sizeof(ConnectionAddr), networkId, retCode); } -void LnnNotifyLeaveResult(const char *networkId, int32_t retCode) +NO_SANITIZE("cfi") void LnnNotifyLeaveResult(const char *networkId, int32_t retCode) { if (networkId == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para : networkId = null!"); @@ -250,7 +250,7 @@ void LnnNotifyLeaveResult(const char *networkId, int32_t retCode) LnnIpcNotifyLeaveResult(networkId, retCode); } -void MetaNodeNotifyLeaveResult(const char *networkId, int32_t retCode) +NO_SANITIZE("cfi") void MetaNodeNotifyLeaveResult(const char *networkId, int32_t retCode) { if (networkId == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para : networkId = null!"); @@ -260,7 +260,8 @@ void MetaNodeNotifyLeaveResult(const char *networkId, int32_t retCode) MetaNodeIpcNotifyLeaveResult(networkId, retCode); } -void LnnNotifyLnnRelationChanged(const char *udid, ConnectionAddrType type, uint8_t relation, bool isJoin) +NO_SANITIZE("cfi") void LnnNotifyLnnRelationChanged(const char *udid, ConnectionAddrType type, uint8_t relation, + bool isJoin) { LnnRelationChanedEventInfo info; @@ -272,7 +273,7 @@ void LnnNotifyLnnRelationChanged(const char *udid, ConnectionAddrType type, uint NotifyEvent((LnnEventBasicInfo *)&info); } -void LnnNotifyTimeSyncResult(const char *pkgName, const TimeSyncResultInfo *info, int32_t retCode) +NO_SANITIZE("cfi") void LnnNotifyTimeSyncResult(const char *pkgName, const TimeSyncResultInfo *info, int32_t retCode) { if (pkgName == NULL || info == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "invalid paramters"); @@ -282,7 +283,7 @@ void LnnNotifyTimeSyncResult(const char *pkgName, const TimeSyncResultInfo *info LnnIpcNotifyTimeSyncResult(pkgName, info, sizeof(TimeSyncResultInfo), retCode); } -void LnnNotifyWlanStateChangeEvent(SoftBusWifiState state) +NO_SANITIZE("cfi") void LnnNotifyWlanStateChangeEvent(SoftBusWifiState state) { if (state < SOFTBUS_WIFI_CONNECTED || state > SOFTBUS_WIFI_UNKNOWN) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "bad state %d", state); @@ -292,7 +293,7 @@ void LnnNotifyWlanStateChangeEvent(SoftBusWifiState state) NotifyEvent((const LnnEventBasicInfo *)&event); } -void LnnNotifyScreenStateChangeEvent(SoftBusScreenState state) +NO_SANITIZE("cfi") void LnnNotifyScreenStateChangeEvent(SoftBusScreenState state) { if (state < SOFTBUS_SCREEN_ON || state >= SOFTBUS_SCREEN_UNKNOWN) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "bad state %d", state); @@ -315,7 +316,7 @@ void LnnNotifyBtStateChangeEvent(void *state) SoftBusFree(btState); } -void LnnNotifyBtAclStateChangeEvent(const char *btMac, SoftBusBtAclState state) +NO_SANITIZE("cfi") void LnnNotifyBtAclStateChangeEvent(const char *btMac, SoftBusBtAclState state) { if (btMac == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "invalid btMac, state = %d", state); @@ -331,7 +332,7 @@ void LnnNotifyBtAclStateChangeEvent(const char *btMac, SoftBusBtAclState state) NotifyEvent((const LnnEventBasicInfo *)&event); } -void LnnNotifyAddressChangedEvent(const char *ifName) +NO_SANITIZE("cfi") void LnnNotifyAddressChangedEvent(const char *ifName) { LnnMonitorAddressChangedEvent event = {.basic.event = LNN_EVENT_IP_ADDR_CHANGED, .ifName = {0}}; if (ifName != NULL) { @@ -344,7 +345,7 @@ void LnnNotifyAddressChangedEvent(const char *ifName) NotifyEvent((const LnnEventBasicInfo *)&event); } -void LnnNotifyMasterNodeChanged(bool isMaster, const char *masterNodeUdid, int32_t weight) +NO_SANITIZE("cfi") void LnnNotifyMasterNodeChanged(bool isMaster, const char *masterNodeUdid, int32_t weight) { LnnMasterNodeChangedEvent event = {.basic.event = LNN_EVENT_NODE_MASTER_STATE_CHANGED, .isMasterNode = isMaster, @@ -354,7 +355,7 @@ void LnnNotifyMasterNodeChanged(bool isMaster, const char *masterNodeUdid, int32 NotifyEvent((const LnnEventBasicInfo *)&event); } -void LnnNotifyNodeAddressChanged(const char *addr) +NO_SANITIZE("cfi") void LnnNotifyNodeAddressChanged(const char *addr) { if (addr == NULL) { SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:nullptr!", __func__); @@ -405,7 +406,7 @@ NO_SANITIZE("cfi") void LnnDeinitBusCenterEvent(void) SoftBusMutexDestroy(&g_eventCtrl.lock); } -int32_t LnnRegisterEventHandler(LnnEventType event, LnnEventHandler handler) +NO_SANITIZE("cfi") int32_t LnnRegisterEventHandler(LnnEventType event, LnnEventHandler handler) { LnnEventHandlerItem *item = NULL; @@ -433,7 +434,7 @@ int32_t LnnRegisterEventHandler(LnnEventType event, LnnEventHandler handler) return SOFTBUS_OK; } -void LnnUnregisterEventHandler(LnnEventType event, LnnEventHandler handler) +NO_SANITIZE("cfi") void LnnUnregisterEventHandler(LnnEventType event, LnnEventHandler handler) { LnnEventHandlerItem *item = NULL; diff --git a/core/bus_center/utils/src/lnn_connection_addr_utils.c b/core/bus_center/utils/src/lnn_connection_addr_utils.c index 8cbf5e619..80c1f14cb 100644 --- a/core/bus_center/utils/src/lnn_connection_addr_utils.c +++ b/core/bus_center/utils/src/lnn_connection_addr_utils.c @@ -21,7 +21,7 @@ #include "softbus_def.h" #include "softbus_log.h" -bool LnnIsSameConnectionAddr(const ConnectionAddr *addr1, const ConnectionAddr *addr2) +NO_SANITIZE("cfi") bool LnnIsSameConnectionAddr(const ConnectionAddr *addr1, const ConnectionAddr *addr2) { if (addr1 == NULL || addr2 == NULL) { return false; diff --git a/core/bus_center/utils/src/lnn_map.c b/core/bus_center/utils/src/lnn_map.c index 8fb236f67..0bbe2e219 100644 --- a/core/bus_center/utils/src/lnn_map.c +++ b/core/bus_center/utils/src/lnn_map.c @@ -21,6 +21,7 @@ #include #include "softbus_adapter_mem.h" +#include "softbus_def.h" #include "softbus_errcode.h" #define HDF_MIN_MAP_SIZE 8 @@ -125,7 +126,7 @@ static MapNode *MapCreateNode(const char *key, uint32_t hash, * valueSize Map value size * @return : SOFTBUS_OK or other error */ -int32_t LnnMapSet(Map *map, const char *key, const void *value, uint32_t valueSize) +NO_SANITIZE("cfi") int32_t LnnMapSet(Map *map, const char *key, const void *value, uint32_t valueSize) { MapNode *node = NULL; @@ -184,7 +185,7 @@ int32_t LnnMapSet(Map *map, const char *key, const void *value, uint32_t valueSi * key Map key * @return : value of key or NULL */ -void* LnnMapGet(const Map *map, const char *key) +NO_SANITIZE("cfi") void* LnnMapGet(const Map *map, const char *key) { if (map == NULL || key == NULL || map->nodeSize == 0 || map->nodes == NULL) { return NULL; @@ -211,7 +212,7 @@ void* LnnMapGet(const Map *map, const char *key) * @param : map Map see details in type Map * key Map key */ -int32_t LnnMapErase(Map *map, const char *key) +NO_SANITIZE("cfi") int32_t LnnMapErase(Map *map, const char *key) { if (map == NULL || key == NULL || map->nodeSize == 0 || map->nodes == NULL) { return SOFTBUS_INVALID_PARAM; @@ -240,7 +241,7 @@ int32_t LnnMapErase(Map *map, const char *key) return SOFTBUS_ERR; } -uint32_t MapGetSize(Map *map) +NO_SANITIZE("cfi") uint32_t MapGetSize(Map *map) { return (map == NULL) ? 0 : map->nodeSize; } @@ -249,7 +250,7 @@ uint32_t MapGetSize(Map *map) * * @param : map Map see details in type Map */ -void LnnMapInit(Map *map) +NO_SANITIZE("cfi") void LnnMapInit(Map *map) { if (map == NULL) { return; @@ -265,7 +266,7 @@ void LnnMapInit(Map *map) * * @param : map Map see details in type Map */ -void LnnMapDelete(Map *map) +NO_SANITIZE("cfi") void LnnMapDelete(Map *map) { uint32_t i; MapNode *node = NULL; @@ -296,7 +297,7 @@ void LnnMapDelete(Map *map) * * @param : map Map see details in type Map */ -MapIterator *LnnMapInitIterator(Map *map) +NO_SANITIZE("cfi") MapIterator *LnnMapInitIterator(Map *map) { MapIterator *it = NULL; if (map == NULL) { @@ -318,7 +319,7 @@ MapIterator *LnnMapInitIterator(Map *map) * * @param : it Iterator see details in type Iterator */ -bool LnnMapHasNext(MapIterator *it) +NO_SANITIZE("cfi") bool LnnMapHasNext(MapIterator *it) { return (it->nodeNum < it->map->nodeSize); } @@ -328,7 +329,7 @@ bool LnnMapHasNext(MapIterator *it) * * @param : it Iterator see details in type Iterator */ -MapIterator *LnnMapNext(MapIterator *it) +NO_SANITIZE("cfi") MapIterator *LnnMapNext(MapIterator *it) { MapNode *node = NULL; if (it == NULL) { @@ -358,7 +359,7 @@ MapIterator *LnnMapNext(MapIterator *it) * * @param : it Iterator see details in type Iterator */ -void LnnMapDeinitIterator(MapIterator *it) +NO_SANITIZE("cfi") void LnnMapDeinitIterator(MapIterator *it) { if (it == NULL) { return; diff --git a/core/common/security/permission/common/permission_entry.c b/core/common/security/permission/common/permission_entry.c index ddc164f08..bed64aab3 100644 --- a/core/common/security/permission/common/permission_entry.c +++ b/core/common/security/permission/common/permission_entry.c @@ -389,7 +389,7 @@ static bool HaveGrantedPermission(const char *sessionName) return false; } -int32_t LoadPermissionJson(const char *fileName) +NO_SANITIZE("cfi") int32_t LoadPermissionJson(const char *fileName) { int ret = ReadConfigJson(fileName); if (ret != SOFTBUS_OK) { diff --git a/core/connection/p2p/adapter/p2plink_adapter.c b/core/connection/p2p/adapter/p2plink_adapter.c index 00cd23e39..45b61a36a 100644 --- a/core/connection/p2p/adapter/p2plink_adapter.c +++ b/core/connection/p2p/adapter/p2plink_adapter.c @@ -29,6 +29,7 @@ #include "securec.h" #include "softbus_adapter_crypto.h" #include "softbus_adapter_mem.h" +#include "softbus_def.h" #include "softbus_errcode.h" #include "softbus_log.h" #include "softbus_utils.h" @@ -197,7 +198,7 @@ NO_SANITIZE("cfi") static void InnerP2pPeersChangedCallback(WifiP2pDevice* devic SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_INFO, "InnerP2pPeersChangedCallback len %d.", len); } -int32_t P2pLinkAdapterInit(const BroadcastRecvCb *cb) +NO_SANITIZE("cfi") int32_t P2pLinkAdapterInit(const BroadcastRecvCb *cb) { WifiErrorCode ret; @@ -290,7 +291,7 @@ static bool GetIpAddr(const char *ifName, char *ipAddr, int32_t len) return true; } -int32_t P2pLinkGetP2pIpAddress(char *ip, int32_t len) +NO_SANITIZE("cfi") int32_t P2pLinkGetP2pIpAddress(char *ip, int32_t len) { WifiP2pGroupInfo* groupInfo; char ipAddr[P2P_IP_LEN] = {0}; @@ -326,7 +327,7 @@ int32_t P2pLinkGetP2pIpAddress(char *ip, int32_t len) } #define P2P_BASE_INTERFACE "p2p0" -int32_t P2pLinkGetBaseMacAddress(char *mac, int32_t len) +NO_SANITIZE("cfi") int32_t P2pLinkGetBaseMacAddress(char *mac, int32_t len) { unsigned char macAddr[MAC_BIN_LEN] = {0}; @@ -368,7 +369,7 @@ int32_t P2pLinkSharelinkReuse(void) } -P2pLink5GList *P2pLinkGetChannelListFor5G(void) +NO_SANITIZE("cfi") P2pLink5GList *P2pLinkGetChannelListFor5G(void) { int32_t chanList[CHAN_LIST_LEN] = {0}; int32_t ret = Hid2dGetChannelListFor5G(chanList, CHAN_LIST_LEN); @@ -406,7 +407,7 @@ P2pLink5GList *P2pLinkGetChannelListFor5G(void) } -int32_t P2pLinkGetFrequency(void) +NO_SANITIZE("cfi") int32_t P2pLinkGetFrequency(void) { int32_t ret; WifiLinkedInfo wifiInfo; @@ -420,7 +421,7 @@ int32_t P2pLinkGetFrequency(void) return wifiInfo.frequency; } -int32_t P2pLinkCreateGroup(int32_t freq, bool isWideBandSupport) +NO_SANITIZE("cfi") int32_t P2pLinkCreateGroup(int32_t freq, bool isWideBandSupport) { FreqType type = FREQUENCY_DEFAULT; if (isWideBandSupport) { @@ -435,7 +436,7 @@ int32_t P2pLinkCreateGroup(int32_t freq, bool isWideBandSupport) return SOFTBUS_OK; } -int32_t P2pLinkGetRecommendChannel(int32_t *freq) +NO_SANITIZE("cfi") int32_t P2pLinkGetRecommendChannel(int32_t *freq) { if (freq == NULL) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_ERROR, "get recommand channel, invalid param."); @@ -464,7 +465,7 @@ int32_t P2pLinkGetRecommendChannel(int32_t *freq) return SOFTBUS_ERR; } -char *P2pLinkGetGroupConfigInfo(void) +NO_SANITIZE("cfi") char *P2pLinkGetGroupConfigInfo(void) { WifiP2pGroupInfo *groupInfo = NULL; int32_t ret; @@ -514,7 +515,7 @@ char *P2pLinkGetGroupConfigInfo(void) return groupCfgStr; } -int32_t P2pLinkConnectGroup(const char *groupConfig) +NO_SANITIZE("cfi") int32_t P2pLinkConnectGroup(const char *groupConfig) { if (groupConfig == NULL) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_ERROR, "connect group, invalid param."); @@ -611,7 +612,7 @@ static int32_t ConvertIpStringToIntArray(unsigned int dest[IPV4_ARRAY_LEN], cons return SOFTBUS_OK; } -int32_t P2pLinkConfigGcIp(const char *ip) +NO_SANITIZE("cfi") int32_t P2pLinkConfigGcIp(const char *ip) { if (ip == NULL) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_ERROR, "config ip, invalid param."); @@ -655,7 +656,7 @@ int32_t P2pLinkConfigGcIp(const char *ip) return SOFTBUS_OK; } -int32_t P2pLinkGetSelfWifiCfgInfo(char *cfgData, int32_t len) +NO_SANITIZE("cfi") int32_t P2pLinkGetSelfWifiCfgInfo(char *cfgData, int32_t len) { if (cfgData == NULL || len == 0) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_ERROR, "get self wifi config, invalid param."); @@ -753,7 +754,7 @@ int32_t P2pLinkReleaseIPAddr(void) return SOFTBUS_OK; } -int32_t P2pLinkGetWifiState(void) +NO_SANITIZE("cfi") int32_t P2pLinkGetWifiState(void) { int wifiState; diff --git a/core/connection/p2p/common/src/p2plink_common.c b/core/connection/p2p/common/src/p2plink_common.c index 324ad94b4..13ccb17db 100644 --- a/core/connection/p2p/common/src/p2plink_common.c +++ b/core/connection/p2p/common/src/p2plink_common.c @@ -35,7 +35,7 @@ static char g_interface[P2PLINK_INTERFACE_LEN] = {0}; static bool g_p2plinkState = false; static bool g_p2plinkDhcp = false; -P2pLinkRole P2pLinkGetRole(void) +NO_SANITIZE("cfi") P2pLinkRole P2pLinkGetRole(void) { return g_role; } @@ -55,12 +55,12 @@ void P2pLinkSetMyIp(const char *ip) SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_INFO, "set my ip."); } -char* P2pLinkGetMyIp(void) +NO_SANITIZE("cfi") char* P2pLinkGetMyIp(void) { return g_myIp; } -char* P2pLinkGetMyMac(void) +NO_SANITIZE("cfi") char* P2pLinkGetMyMac(void) { char myMac[P2P_MAC_LEN] = {0}; @@ -106,12 +106,12 @@ void P2pLinkSetGcPort(int32_t port) SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_INFO, "set gc port %d", g_goPort); } -int32_t P2pLinkGetGcPort(void) +NO_SANITIZE("cfi") int32_t P2pLinkGetGcPort(void) { return g_gcPort; } -char* P2pLinkGetGoIp(void) +NO_SANITIZE("cfi") char* P2pLinkGetGoIp(void) { if (g_role == ROLE_GO) { return P2pLinkGetMyIp(); @@ -119,7 +119,7 @@ char* P2pLinkGetGoIp(void) return g_goIp; } -char* P2pLinkGetGoMac(void) +NO_SANITIZE("cfi") char* P2pLinkGetGoMac(void) { if (g_role == ROLE_GO) { return P2pLinkGetMyMac(); @@ -127,7 +127,7 @@ char* P2pLinkGetGoMac(void) return g_goMac; } -int32_t P2pLinkGetGoPort(void) +NO_SANITIZE("cfi") int32_t P2pLinkGetGoPort(void) { return g_goPort; } @@ -152,7 +152,7 @@ void P2pLinkSetDhcpState(bool isNeedDhcp) g_p2plinkDhcp = isNeedDhcp; } -bool P2pLinkGetDhcpState(void) +NO_SANITIZE("cfi") bool P2pLinkGetDhcpState(void) { return g_p2plinkDhcp; } @@ -167,14 +167,14 @@ void P2pLinkSetDisconnectState(bool state) g_isDisconnect = state; } -void P2pLinkCommonInit(void) +NO_SANITIZE("cfi") void P2pLinkCommonInit(void) { g_macExpired = true; g_role = ROLE_NONE; return; } -void P2pLinkCommonClean(void) +NO_SANITIZE("cfi") void P2pLinkCommonClean(void) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_INFO, "P2pLinkCommonClean"); g_role = ROLE_NONE; diff --git a/core/connection/p2p/interface/p2plink_interface.c b/core/connection/p2p/interface/p2plink_interface.c index 85b768236..7faf6f1e2 100644 --- a/core/connection/p2p/interface/p2plink_interface.c +++ b/core/connection/p2p/interface/p2plink_interface.c @@ -47,7 +47,7 @@ typedef struct { sem_t wait; } QueryP2pDevIsOnline; -int32_t P2pLinkGetRequestId(void) +NO_SANITIZE("cfi") int32_t P2pLinkGetRequestId(void) { static int32_t requestId = 0; requestId++; @@ -62,7 +62,7 @@ int32_t P2pLinkInit(void) return P2pLinkManagerInit(); } -int32_t P2pLinkConnectDevice(const P2pLinkConnectInfo *info) +NO_SANITIZE("cfi") int32_t P2pLinkConnectDevice(const P2pLinkConnectInfo *info) { int32_t ret; @@ -90,7 +90,7 @@ int32_t P2pLinkConnectDevice(const P2pLinkConnectInfo *info) return ret; } -int32_t P2pLinkDisconnectDevice(const P2pLinkDisconnectInfo *info) +NO_SANITIZE("cfi") int32_t P2pLinkDisconnectDevice(const P2pLinkDisconnectInfo *info) { int32_t ret; @@ -221,7 +221,7 @@ static void LoopP2pLinkQueryIpByMac(P2pLoopMsg msgType, void *arg) return; } -int32_t P2pLinkGetPeerMacByPeerIp(const char *peerIp, char* peerMac, int32_t macLen) +NO_SANITIZE("cfi") int32_t P2pLinkGetPeerMacByPeerIp(const char *peerIp, char* peerMac, int32_t macLen) { QueryP2pMacLoopInfo queryInfo; int32_t ret; @@ -275,7 +275,7 @@ void P2pLinkRegPeerDevStateChange(const P2pLinkPeerDevStateCb *cb) P2pLinkSetDevStateCallback(cb); } -int32_t P2pLinkGetLocalIp(char *localIp, int32_t localIpLen) +NO_SANITIZE("cfi") int32_t P2pLinkGetLocalIp(char *localIp, int32_t localIpLen) { char tmpIp[P2P_IP_LEN] = {0}; int32_t ret; diff --git a/core/connection/p2p/manager/src/p2plink_broadcast_receiver.c b/core/connection/p2p/manager/src/p2plink_broadcast_receiver.c index 8a06b3ca4..e43dcfb48 100644 --- a/core/connection/p2p/manager/src/p2plink_broadcast_receiver.c +++ b/core/connection/p2p/manager/src/p2plink_broadcast_receiver.c @@ -25,6 +25,7 @@ #include "securec.h" #include "softbus_adapter_mem.h" +#include "softbus_def.h" #include "softbus_errcode.h" #include "softbus_log.h" @@ -223,7 +224,7 @@ static void WifiCfgChanged(const char *wificfg) SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_INFO, "wificfg = %s", wificfg); } -int32_t P2pLinkBroadCastInit(void) +NO_SANITIZE("cfi") int32_t P2pLinkBroadCastInit(void) { BroadcastRecvCb cb; diff --git a/core/connection/p2p/manager/src/p2plink_control_message.c b/core/connection/p2p/manager/src/p2plink_control_message.c index aba8c3fd6..a81e5c481 100644 --- a/core/connection/p2p/manager/src/p2plink_control_message.c +++ b/core/connection/p2p/manager/src/p2plink_control_message.c @@ -23,6 +23,7 @@ #include "p2plink_reference.h" #include "securec.h" +#include "softbus_def.h" #include "softbus_errcode.h" #include "softbus_json_utils.h" #include "softbus_log.h" @@ -255,7 +256,7 @@ int32_t P2pLinkSendReuseResponse(const P2pLinkAuthId *chan, const char *myMac, i return SOFTBUS_OK; } -void P2pLinkHandleHandshake(int64_t authId, int32_t seq, const cJSON *root) +NO_SANITIZE("cfi") void P2pLinkHandleHandshake(int64_t authId, int32_t seq, const cJSON *root) { char mac[P2P_MAC_LEN] = {0}; char ip[P2P_IP_LEN] = {0}; @@ -281,7 +282,7 @@ void P2pLinkHandleHandshake(int64_t authId, int32_t seq, const cJSON *root) } } -void P2pLinkHandleReuseResponse(int64_t authId, int32_t seq, const cJSON *root) +NO_SANITIZE("cfi") void P2pLinkHandleReuseResponse(int64_t authId, int32_t seq, const cJSON *root) { char peerMac[P2P_MAC_LEN] = {0}; int32_t respRet = 0; @@ -331,7 +332,7 @@ void P2pLinkHandleReuseResponse(int64_t authId, int32_t seq, const cJSON *root) P2pLinkDumpRef(); } -void P2pLinkHandleReuseRequest(int64_t authId, int32_t seq, const cJSON *root) +NO_SANITIZE("cfi") void P2pLinkHandleReuseRequest(int64_t authId, int32_t seq, const cJSON *root) { char peerMac[P2P_MAC_LEN] = {0}; int32_t respRet; @@ -382,7 +383,7 @@ void P2pLinkHandleReuseRequest(int64_t authId, int32_t seq, const cJSON *root) (void)P2pLinkSendReuseResponse(&linkAuthId, P2pLinkGetMyMac(), respRet); } } -void P2pLinkHandleDisconnectCmd(int64_t authId, int32_t seq, const cJSON *root) +NO_SANITIZE("cfi") void P2pLinkHandleDisconnectCmd(int64_t authId, int32_t seq, const cJSON *root) { P2pLinkRole myRole = P2pLinkGetRole(); int32_t myRef = P2pLinkGetMyP2pRef(); @@ -437,7 +438,7 @@ void P2pLinkHandleWifiCfg(int64_t authId, int32_t seq, const cJSON *root) } } -void P2pLinkControlMsgProc(int64_t authId, int64_t seq, P2pLinkCmdType type, const cJSON *root) +NO_SANITIZE("cfi") void P2pLinkControlMsgProc(int64_t authId, int64_t seq, P2pLinkCmdType type, const cJSON *root) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_INFO, "recv control msgtype %d", type); if (P2pLinkIsEnable() == false) { diff --git a/core/connection/p2p/manager/src/p2plink_device.c b/core/connection/p2p/manager/src/p2plink_device.c index 5c4664e4c..384f1f918 100644 --- a/core/connection/p2p/manager/src/p2plink_device.c +++ b/core/connection/p2p/manager/src/p2plink_device.c @@ -50,7 +50,7 @@ void P2pLinkSetDevStateCallback(const P2pLinkPeerDevStateCb *cb) (void)memcpy_s(&g_devStateCb, sizeof(P2pLinkPeerDevStateCb), cb, sizeof(P2pLinkPeerDevStateCb)); } -void P2pLinkDevOffLineNotify(const char *peerMac) +NO_SANITIZE("cfi") void P2pLinkDevOffLineNotify(const char *peerMac) { if (g_devStateCb.onDevOffline != NULL) { g_devStateCb.onDevOffline(peerMac); @@ -65,13 +65,13 @@ void P2pLinkMyRoleChangeNotify(P2pLinkRole myRole) } } -void P2pLinkAddConnedDev(ConnectedNode *item) +NO_SANITIZE("cfi") void P2pLinkAddConnedDev(ConnectedNode *item) { ListAdd(&g_connectedDevices, &item->node); g_connectedCnt++; } -ConnectedNode *P2pLinkGetConnedDevByMac(const char *peerMac) +NO_SANITIZE("cfi") ConnectedNode *P2pLinkGetConnedDevByMac(const char *peerMac) { ConnectedNode *item = NULL; ConnectedNode *next = NULL; @@ -94,7 +94,7 @@ void P2pLinkUpdateInAuthId(const char *peerMac, int64_t authId) item->chanId.inAuthId = authId; } -ConnectedNode *P2pLinkGetConnedDevByPeerIp(const char *peerIp) +NO_SANITIZE("cfi") ConnectedNode *P2pLinkGetConnedDevByPeerIp(const char *peerIp) { ConnectedNode *item = NULL; ConnectedNode *next = NULL; @@ -107,7 +107,7 @@ ConnectedNode *P2pLinkGetConnedDevByPeerIp(const char *peerIp) return NULL; } -int32_t P2pLinkConnedIsEmpty(void) +NO_SANITIZE("cfi") int32_t P2pLinkConnedIsEmpty(void) { if (IsListEmpty(&g_connectedDevices)) { return SOFTBUS_OK; @@ -115,7 +115,7 @@ int32_t P2pLinkConnedIsEmpty(void) return SOFTBUS_ERR; } -ConnectedNode *P2pLinkGetConnedByAuthReqeustId(uint32_t reqeustId) +NO_SANITIZE("cfi") ConnectedNode *P2pLinkGetConnedByAuthReqeustId(uint32_t reqeustId) { ConnectedNode *item = NULL; ConnectedNode *next = NULL; @@ -128,7 +128,7 @@ ConnectedNode *P2pLinkGetConnedByAuthReqeustId(uint32_t reqeustId) return NULL; } -void P2pLinkDelConnedByAuthId(int64_t authId) +NO_SANITIZE("cfi") void P2pLinkDelConnedByAuthId(int64_t authId) { ConnectedNode *item = NULL; ConnectedNode *next = NULL; @@ -249,7 +249,7 @@ static void P2pLinkCleanConnedDev(void) return; } -ConnectingNode *P2pLinkGetConningByPeerMacState(const char *peerMac, int state) +NO_SANITIZE("cfi") ConnectingNode *P2pLinkGetConningByPeerMacState(const char *peerMac, int state) { ConnectingNode *item = NULL; ConnectingNode *next = NULL; @@ -262,7 +262,7 @@ ConnectingNode *P2pLinkGetConningByPeerMacState(const char *peerMac, int state) return NULL; } -ConnectingNode *P2pLinkGetConningDevByReqId(int32_t reqId) +NO_SANITIZE("cfi") ConnectingNode *P2pLinkGetConningDevByReqId(int32_t reqId) { ConnectingNode *item = NULL; ConnectingNode *next = NULL; @@ -275,7 +275,7 @@ ConnectingNode *P2pLinkGetConningDevByReqId(int32_t reqId) return NULL; } -void P2pLinkDelConning(int32_t reqId) +NO_SANITIZE("cfi") void P2pLinkDelConning(int32_t reqId) { ConnectingNode *item = NULL; ConnectingNode *next = NULL; @@ -290,14 +290,14 @@ void P2pLinkDelConning(int32_t reqId) } } -void P2pLinkDelConningDev(ConnectingNode *item) +NO_SANITIZE("cfi") void P2pLinkDelConningDev(ConnectingNode *item) { ListDelete(&item->node); SoftBusFree(item); g_connectingCnt--; } -void P2pLinkConningCallback(const ConnectingNode *item, int32_t ret, int32_t failReason) +NO_SANITIZE("cfi") void P2pLinkConningCallback(const ConnectingNode *item, int32_t ret, int32_t failReason) { const P2pLinkConnectInfo *devInfo = &item->connInfo; if (ret == SOFTBUS_ERR) { @@ -462,7 +462,7 @@ static void P2pLinkTimerDevProc(P2pLoopMsg msgType, void *arg) P2pLoopProcDelay(P2pLinkTimerDevProc, 0, CONNING_TIMER_1S, P2PLOOP_CONNINGDEV_TIMER); } -void P2pLinkAddConningDev(ConnectingNode *item) +NO_SANITIZE("cfi") void P2pLinkAddConningDev(ConnectingNode *item) { ListAdd(&g_connectingDevices, &item->node); g_connectingCnt++; @@ -487,7 +487,7 @@ static void P2pLinkCleanConningDev(void) } } -void P2pLinkDumpDev(void) +NO_SANITIZE("cfi") void P2pLinkDumpDev(void) { ConnectingNode *conningItem = NULL; ConnectingNode *conningNext = NULL; @@ -514,7 +514,7 @@ void P2pLinkDevEnterDiscState(void) P2pLoopProcDelay(P2pLinkDevExistDiscState, NULL, DISCONNING_TIMER_3S, P2PLOOP_OPEN_DISCONNECTING_TIMEOUT); } -int32_t P2pLinkDevInit(void) +NO_SANITIZE("cfi") int32_t P2pLinkDevInit(void) { ListInit(&g_connectingDevices); ListInit(&g_connectedDevices); @@ -525,7 +525,7 @@ int32_t P2pLinkDevInit(void) return SOFTBUS_OK; } -void P2pLinkDevClean(void) +NO_SANITIZE("cfi") void P2pLinkDevClean(void) { P2pLinkCleanConnedDev(); P2pLinkCleanConningDev(); diff --git a/core/connection/p2p/manager/src/p2plink_manager.c b/core/connection/p2p/manager/src/p2plink_manager.c index 06301c63e..80bf86836 100644 --- a/core/connection/p2p/manager/src/p2plink_manager.c +++ b/core/connection/p2p/manager/src/p2plink_manager.c @@ -533,7 +533,7 @@ int32_t P2pLinkMagicInit(void) return SOFTBUS_OK; } -void P2pLinkClean(void) +NO_SANITIZE("cfi") void P2pLinkClean(void) { #define CLEAN_DELAY_100MS 100000 SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_INFO, "p2p clean."); diff --git a/core/connection/p2p/manager/src/p2plink_reference.c b/core/connection/p2p/manager/src/p2plink_reference.c index b4ee7decb..53c005086 100644 --- a/core/connection/p2p/manager/src/p2plink_reference.c +++ b/core/connection/p2p/manager/src/p2plink_reference.c @@ -98,7 +98,7 @@ NO_SANITIZE("cfi") void AddNewPidItem(int32_t pid, const char* mac) AddNewMacItem(&pItem->macList, mac); } -void P2pLinkAddPidMacRef(int32_t pid, const char *mac) +NO_SANITIZE("cfi") void P2pLinkAddPidMacRef(int32_t pid, const char *mac) { RefPidItem *pItem = NULL; RefMacItem *mItem = NULL; @@ -117,7 +117,7 @@ void P2pLinkAddPidMacRef(int32_t pid, const char *mac) } } -void P2pLinkDelPidRef(int32_t pid) +NO_SANITIZE("cfi") void P2pLinkDelPidRef(int32_t pid) { RefPidItem *pItem = NULL; RefMacItem *mItem = NULL; @@ -137,7 +137,7 @@ void P2pLinkDelPidRef(int32_t pid) SoftBusFree(pItem); } -void P2pLinkDelPidMacRef(int32_t pid, const char *mac) +NO_SANITIZE("cfi") void P2pLinkDelPidMacRef(int32_t pid, const char *mac) { RefPidItem *pItem = NULL; RefMacItem *mItem = NULL; @@ -163,7 +163,7 @@ void P2pLinkDelPidMacRef(int32_t pid, const char *mac) } } -int32_t P2pLinGetMacRefCnt(int32_t pid, const char *mac) +NO_SANITIZE("cfi") int32_t P2pLinGetMacRefCnt(int32_t pid, const char *mac) { RefPidItem *pItem = NULL; RefMacItem *mItem = NULL; @@ -179,7 +179,7 @@ int32_t P2pLinGetMacRefCnt(int32_t pid, const char *mac) return mItem->refCnt; } -void P2pLinkDelMyP2pRef(void) +NO_SANITIZE("cfi") void P2pLinkDelMyP2pRef(void) { if (g_myP2pRef == 0) { return; @@ -194,12 +194,12 @@ void P2pLinkDelMyP2pRef(void) } } -void P2pLinkAddMyP2pRef(void) +NO_SANITIZE("cfi") void P2pLinkAddMyP2pRef(void) { g_myP2pRef++; } -int32_t P2pLinkGetMyP2pRef(void) +NO_SANITIZE("cfi") int32_t P2pLinkGetMyP2pRef(void) { return g_myP2pRef; } @@ -238,7 +238,7 @@ NO_SANITIZE("cfi") void DisConnectByPid(int32_t pid) P2pLinkDelPidRef(pid); } -void P2pLinkDumpRef(void) +NO_SANITIZE("cfi") void P2pLinkDumpRef(void) { RefPidItem *pItem = NULL; RefPidItem *pNext = NULL; diff --git a/core/connection/p2p/negotiation/src/p2plink_channel_freq.c b/core/connection/p2p/negotiation/src/p2plink_channel_freq.c index 16f14be2a..a1395b2cc 100644 --- a/core/connection/p2p/negotiation/src/p2plink_channel_freq.c +++ b/core/connection/p2p/negotiation/src/p2plink_channel_freq.c @@ -21,6 +21,7 @@ #include "securec.h" #include "softbus_adapter_mem.h" +#include "softbus_def.h" #include "softbus_errcode.h" #include "softbus_log.h" @@ -39,7 +40,8 @@ #define CHANNEL_INVALID (-1) #define FREQUENCY_INVALID (-1) -int32_t P2plinkChannelListToString(const P2pLink5GList *channelList, char *channelString, int32_t len) +NO_SANITIZE("cfi") int32_t P2plinkChannelListToString(const P2pLink5GList *channelList, char *channelString, + int32_t len) { if ((channelList == NULL) || (channelList->num == 0)) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_DBG, "channelList is null."); @@ -246,7 +248,7 @@ static int32_t ChoseChannel5gFreq(const GcInfo *gc, const P2pLink5GList *channel return FREQUENCY_INVALID; } -int32_t P2plinkGetGroupGrequency(const GcInfo *gc, const P2pLink5GList *channelList) +NO_SANITIZE("cfi") int32_t P2plinkGetGroupGrequency(const GcInfo *gc, const P2pLink5GList *channelList) { if (gc == NULL) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__); diff --git a/core/connection/p2p/negotiation/src/p2plink_state_machine.c b/core/connection/p2p/negotiation/src/p2plink_state_machine.c index edfb15f54..6cc59e1af 100644 --- a/core/connection/p2p/negotiation/src/p2plink_state_machine.c +++ b/core/connection/p2p/negotiation/src/p2plink_state_machine.c @@ -33,7 +33,7 @@ static bool IsExistState(const FsmStateMachine *fsm, const FsmState *state) return false; } -int32_t P2pLinkFsmInit(FsmStateMachine *fsm) +NO_SANITIZE("cfi") int32_t P2pLinkFsmInit(FsmStateMachine *fsm) { if (fsm == NULL) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_ERROR, "invalid param"); @@ -45,7 +45,7 @@ int32_t P2pLinkFsmInit(FsmStateMachine *fsm) return SOFTBUS_OK; } -void P2pLinkFsmDeinit(FsmStateMachine *fsm) +NO_SANITIZE("cfi") void P2pLinkFsmDeinit(FsmStateMachine *fsm) { if (fsm == NULL) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_DBG, "fsm already deinit."); @@ -58,7 +58,7 @@ void P2pLinkFsmDeinit(FsmStateMachine *fsm) fsm->currentState = NULL; } -void P2pLinkFsmAddState(FsmStateMachine *fsm, FsmState *state) +NO_SANITIZE("cfi") void P2pLinkFsmAddState(FsmStateMachine *fsm, FsmState *state) { if (fsm == NULL || state == NULL) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_ERROR, "invalid param"); @@ -73,7 +73,7 @@ void P2pLinkFsmAddState(FsmStateMachine *fsm, FsmState *state) ListAdd(&fsm->stateList, &state->node); } -void P2pLinkFsmStart(FsmStateMachine *fsm, FsmState *initialState) +NO_SANITIZE("cfi") void P2pLinkFsmStart(FsmStateMachine *fsm, FsmState *initialState) { if (fsm->currentState != NULL) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_ERROR, "unexpected state in start msg process"); @@ -87,7 +87,7 @@ void P2pLinkFsmStart(FsmStateMachine *fsm, FsmState *initialState) } } -void P2pLinkFsmStop(FsmStateMachine *fsm) +NO_SANITIZE("cfi") void P2pLinkFsmStop(FsmStateMachine *fsm) { if (fsm->currentState == NULL) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_ERROR, "unexpected state in stop msg process"); @@ -96,7 +96,7 @@ void P2pLinkFsmStop(FsmStateMachine *fsm) fsm->currentState = NULL; } -void P2pLinkFsmTransactState(FsmStateMachine *fsm, FsmState *state) +NO_SANITIZE("cfi") void P2pLinkFsmTransactState(FsmStateMachine *fsm, FsmState *state) { if (fsm == NULL || state == NULL) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_ERROR, "invalid param"); @@ -133,7 +133,8 @@ NO_SANITIZE("cfi") void P2pLinkFsmMsgProc(const FsmStateMachine *fsm, int32_t ms } } -void P2pLinkFsmMsgProcDelay(const FsmStateMachine *fsm, int32_t msgType, void *param, uint64_t delayMs) +NO_SANITIZE("cfi") void P2pLinkFsmMsgProcDelay(const FsmStateMachine *fsm, int32_t msgType, void *param, + uint64_t delayMs) { if (fsm->currentState == NULL) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_ERROR, "current state is null"); @@ -146,7 +147,7 @@ void P2pLinkFsmMsgProcDelay(const FsmStateMachine *fsm, int32_t msgType, void *p (void)P2pLoopProcDelay(fsm->currentState->process, param, delayMs, msgType); } -void P2pLinkFsmMsgProcDelayDel(int32_t msgType) +NO_SANITIZE("cfi") void P2pLinkFsmMsgProcDelayDel(int32_t msgType) { SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_INFO, "delete delay msg type %d", msgType); (void)P2pLoopProcDelayDel(NULL, msgType); diff --git a/core/discovery/ble/softbus_ble/src/disc_ble.c b/core/discovery/ble/softbus_ble/src/disc_ble.c index 7cf96f039..9dfe3d0d1 100644 --- a/core/discovery/ble/softbus_ble/src/disc_ble.c +++ b/core/discovery/ble/softbus_ble/src/disc_ble.c @@ -1304,7 +1304,7 @@ static int32_t ReplyPassiveNonBroadcast(void) return SOFTBUS_OK; } -static int32_t MessageRemovePredicate(const SoftBusMessage *msg, void *args) +NO_SANITIZE("cfi") static int32_t MessageRemovePredicate(const SoftBusMessage *msg, void *args) { DLOGI("enter"); uintptr_t key = (uintptr_t)args; diff --git a/core/transmission/trans_channel/proxy/src/softbus_proxychannel_listener.c b/core/transmission/trans_channel/proxy/src/softbus_proxychannel_listener.c index d0191022c..3f4043f29 100644 --- a/core/transmission/trans_channel/proxy/src/softbus_proxychannel_listener.c +++ b/core/transmission/trans_channel/proxy/src/softbus_proxychannel_listener.c @@ -19,6 +19,7 @@ #include "bus_center_manager.h" #include "lnn_lane_interface.h" #include "softbus_conn_interface.h" +#include "softbus_def.h" #include "softbus_errcode.h" #include "softbus_log.h" #include "softbus_proxychannel_callback.h" @@ -78,7 +79,7 @@ static int32_t NotifyNormalChannelOpened(int32_t channelId, const AppInfo *appIn return ret; } -int32_t OnProxyChannelOpened(int32_t channelId, const AppInfo *appInfo, unsigned char isServer) +NO_SANITIZE("cfi") int32_t OnProxyChannelOpened(int32_t channelId, const AppInfo *appInfo, unsigned char isServer) { int32_t ret = SOFTBUS_ERR; if (appInfo == NULL) { @@ -104,7 +105,7 @@ int32_t OnProxyChannelOpened(int32_t channelId, const AppInfo *appInfo, unsigned return ret; } -int32_t OnProxyChannelOpenFailed(int32_t channelId, const AppInfo *appInfo, int32_t errCode) +NO_SANITIZE("cfi") int32_t OnProxyChannelOpenFailed(int32_t channelId, const AppInfo *appInfo, int32_t errCode) { if (appInfo == NULL) { return SOFTBUS_INVALID_PARAM; @@ -128,7 +129,7 @@ int32_t OnProxyChannelOpenFailed(int32_t channelId, const AppInfo *appInfo, int3 return ret; } -int32_t OnProxyChannelClosed(int32_t channelId, const AppInfo *appInfo) +NO_SANITIZE("cfi") int32_t OnProxyChannelClosed(int32_t channelId, const AppInfo *appInfo) { if (appInfo == NULL) { return SOFTBUS_INVALID_PARAM; @@ -152,7 +153,8 @@ int32_t OnProxyChannelClosed(int32_t channelId, const AppInfo *appInfo) return ret; } -int32_t OnProxyChannelMsgReceived(int32_t channelId, const AppInfo *appInfo, const char *data, uint32_t len) +NO_SANITIZE("cfi") int32_t OnProxyChannelMsgReceived(int32_t channelId, const AppInfo *appInfo, const char *data, + uint32_t len) { int32_t ret = SOFTBUS_OK; if (appInfo == NULL || data == NULL || len == 0) { diff --git a/core/transmission/trans_channel/proxy/src/softbus_proxychannel_network.c b/core/transmission/trans_channel/proxy/src/softbus_proxychannel_network.c index db6aeb96d..8b82bc841 100644 --- a/core/transmission/trans_channel/proxy/src/softbus_proxychannel_network.c +++ b/core/transmission/trans_channel/proxy/src/softbus_proxychannel_network.c @@ -16,7 +16,7 @@ #include "softbus_proxychannel_network.h" #include - +#include "softbus_def.h" #include "softbus_errcode.h" #include "softbus_log.h" #include "softbus_transmission_interface.h" @@ -39,7 +39,7 @@ NO_SANITIZE("cfi") int32_t NotifyNetworkingChannelOpened(int32_t channelId, cons return SOFTBUS_OK; } -void NotifyNetworkingChannelOpenFailed(int32_t channelId, const char *networkId) +NO_SANITIZE("cfi") void NotifyNetworkingChannelOpenFailed(int32_t channelId, const char *networkId) { if (g_netChanlistener.onChannelOpenFailed == NULL) { SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "net onChannelOpenFailed is null"); @@ -57,7 +57,7 @@ NO_SANITIZE("cfi") void NotifyNetworkingChannelClosed(int32_t channelId) g_netChanlistener.onChannelClosed(channelId); } -void NotifyNetworkingMsgReceived(int32_t channelId, const char *data, uint32_t len) +NO_SANITIZE("cfi") void NotifyNetworkingMsgReceived(int32_t channelId, const char *data, uint32_t len) { if (g_netChanlistener.onMessageReceived == NULL) { return; diff --git a/core/transmission/trans_channel/proxy/src/softbus_proxychannel_session.c b/core/transmission/trans_channel/proxy/src/softbus_proxychannel_session.c index 88b96fdb2..07a71dd12 100644 --- a/core/transmission/trans_channel/proxy/src/softbus_proxychannel_session.c +++ b/core/transmission/trans_channel/proxy/src/softbus_proxychannel_session.c @@ -21,6 +21,7 @@ #include "softbus_adapter_mem.h" #include "softbus_adapter_socket.h" #include "softbus_adapter_thread.h" +#include "softbus_def.h" #include "softbus_errcode.h" #include "softbus_log.h" #include "softbus_property.h" @@ -90,7 +91,8 @@ void UnPackPacketHead(PacketHead *data) data->dataLen = (int32_t)SoftBusLtoHl((uint32_t)data->dataLen); } -int32_t NotifyClientMsgReceived(const char *pkgName, int32_t pid, int32_t channelId, TransReceiveData *receiveData) +NO_SANITIZE("cfi") int32_t NotifyClientMsgReceived(const char *pkgName, int32_t pid, int32_t channelId, + TransReceiveData *receiveData) { int32_t ret = TransProxyOnMsgReceived(pkgName, pid, channelId, receiveData); if (ret != SOFTBUS_OK) { diff --git a/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_message.c b/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_message.c index 3b0736ffb..cc112fb80 100644 --- a/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_message.c +++ b/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_message.c @@ -26,6 +26,7 @@ #include "softbus_adapter_mem.h" #include "softbus_adapter_thread.h" #include "softbus_adapter_socket.h" +#include "softbus_def.h" #include "softbus_errcode.h" #include "softbus_log.h" #include "softbus_message_open_channel.h" @@ -298,7 +299,7 @@ static int32_t NotifyChannelOpened(int32_t channelId) return ret; } -int32_t NotifyChannelOpenFailed(int32_t channelId, int32_t errCode) +NO_SANITIZE("cfi") int32_t NotifyChannelOpenFailed(int32_t channelId, int32_t errCode) { SessionConn conn; if (GetSessionConnById(channelId, &conn) == NULL) { diff --git a/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_p2p.c b/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_p2p.c index 9e3bd0c1e..878b9ca01 100644 --- a/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_p2p.c +++ b/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_p2p.c @@ -439,7 +439,8 @@ static void OnAuthChannelClose(int64_t authId) return; } -int32_t OpenP2pDirectChannel(const AppInfo *appInfo, const ConnectOption *connInfo, int32_t *channelId) +NO_SANITIZE("cfi") int32_t OpenP2pDirectChannel(const AppInfo *appInfo, const ConnectOption *connInfo, + int32_t *channelId) { SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "OpenP2pDirectChannel"); if (appInfo == NULL || connInfo == NULL || channelId == NULL || connInfo->type != CONNECT_P2P) { @@ -493,7 +494,7 @@ int32_t OpenP2pDirectChannel(const AppInfo *appInfo, const ConnectOption *connIn return SOFTBUS_OK; } -int32_t P2pDirectChannelInit(void) +NO_SANITIZE("cfi") int32_t P2pDirectChannelInit(void) { SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "P2pDirectChannelInit"); AuthTransListener p2pTransCb = { diff --git a/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_wifi.c b/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_wifi.c index 868dfc503..a81825b8d 100644 --- a/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_wifi.c +++ b/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_wifi.c @@ -20,13 +20,15 @@ #include "auth_interface.h" #include "lnn_network_manager.h" #include "softbus_adapter_mem.h" +#include "softbus_def.h" #include "softbus_errcode.h" #include "softbus_log.h" #include "softbus_socket.h" #include "trans_tcp_direct_message.h" #include "trans_tcp_direct_sessionconn.h" -int32_t OpenTcpDirectChannel(const AppInfo *appInfo, const ConnectOption *connInfo, int32_t *channelId) +NO_SANITIZE("cfi") int32_t OpenTcpDirectChannel(const AppInfo *appInfo, const ConnectOption *connInfo, + int32_t *channelId) { SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "OpenTcpDirectChannel"); if (appInfo == NULL || connInfo == NULL || channelId == NULL) { diff --git a/core/transmission/trans_channel/udp_negotiation/src/trans_udp_negotiation.c b/core/transmission/trans_channel/udp_negotiation/src/trans_udp_negotiation.c index b87017637..f425a4a37 100644 --- a/core/transmission/trans_channel/udp_negotiation/src/trans_udp_negotiation.c +++ b/core/transmission/trans_channel/udp_negotiation/src/trans_udp_negotiation.c @@ -129,7 +129,7 @@ static int32_t NotifyUdpChannelOpened(const AppInfo *appInfo, bool isServerSide) appInfo->myData.sessionName, &info); } -int32_t NotifyUdpChannelClosed(const AppInfo *info) +NO_SANITIZE("cfi") int32_t NotifyUdpChannelClosed(const AppInfo *info) { SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "notify udp channel closed, pkg[%s].", info->myData.pkgName); int32_t ret = g_channelCb->OnChannelClosed(info->myData.pkgName, info->myData.pid, @@ -141,7 +141,7 @@ int32_t NotifyUdpChannelClosed(const AppInfo *info) return SOFTBUS_OK; } -int32_t NotifyUdpChannelOpenFailed(const AppInfo *info, int32_t errCode) +NO_SANITIZE("cfi") int32_t NotifyUdpChannelOpenFailed(const AppInfo *info, int32_t errCode) { SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "notify udp channel open failed."); char pkgName[PKG_NAME_SIZE_MAX] = {0}; @@ -166,7 +166,7 @@ int32_t NotifyUdpChannelOpenFailed(const AppInfo *info, int32_t errCode) return SOFTBUS_OK; } -int32_t NotifyUdpQosEvent(const AppInfo *info, int32_t eventId, int32_t tvCount, const QosTv *tvList) +NO_SANITIZE("cfi") int32_t NotifyUdpQosEvent(const AppInfo *info, int32_t eventId, int32_t tvCount, const QosTv *tvList) { SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "notify udp qos eventId[%d].", eventId); char pkgName[PKG_NAME_SIZE_MAX] = {0};