mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-23 16:59:54 +00:00
fix:enable cfi
Signed-off-by: wangboyi <wangboyi4@huawei.com>
This commit is contained in:
parent
87380c54ff
commit
f84dd0827f
@ -157,6 +157,11 @@ if (defined(ohos_lite)) {
|
||||
}
|
||||
|
||||
ohos_shared_library("softbus_adapter") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
include_dirs = [
|
||||
"$dsoftbus_root_path/interfaces/kits",
|
||||
"$dsoftbus_root_path/interfaces/kits/common",
|
||||
|
@ -117,7 +117,7 @@ int32_t LnnInitBtStateMonitorImpl(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitBtStateMonitorImpl(void)
|
||||
void LnnDeinitBtStateMonitorImpl(void)
|
||||
{
|
||||
(void)SoftBusRemoveBtStateListener(g_btStateListenerId);
|
||||
}
|
@ -140,7 +140,7 @@ static int32_t GetRtAttr(struct rtattr *rta, int32_t len, uint16_t type, uint8_t
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnIsLinkReady(const char *iface)
|
||||
bool LnnIsLinkReady(const char *iface)
|
||||
{
|
||||
if (iface == NULL) {
|
||||
return false;
|
||||
|
@ -142,7 +142,7 @@ static void ProcessLinkEvent(struct nlmsghdr *nlh)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void *NetlinkMonitorThread(void *para)
|
||||
static void *NetlinkMonitorThread(void *para)
|
||||
{
|
||||
struct nlmsghdr *nlh = NULL;
|
||||
(void)para;
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "xcollie/watchdog.h"
|
||||
#include "xcollie/xcollie.h"
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusSetWatchdogTimer(const char *name, uint32_t timeout, void(*func)(void*), void *args)
|
||||
int32_t SoftBusSetWatchdogTimer(const char *name, uint32_t timeout, void(*func)(void*), void *args)
|
||||
{
|
||||
if (name == NULL || func == NULL || args == NULL) {
|
||||
HILOG_ERROR(SOFTBUS_HILOG_ID, "SoftBus Set Watchdog Timer param is invalid.");
|
||||
@ -33,12 +33,12 @@ NO_SANITIZE("cfi") int32_t SoftBusSetWatchdogTimer(const char *name, uint32_t ti
|
||||
args, OHOS::HiviewDFX::XCOLLIE_FLAG_LOG);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void SoftBusCancelWatchdogTimer(int32_t id)
|
||||
void SoftBusCancelWatchdogTimer(int32_t id)
|
||||
{
|
||||
OHOS::HiviewDFX::XCollie::GetInstance().CancelTimer(id);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void SoftBusRunOneShotTask(const char *name, void(*task)(void), uint64_t delay)
|
||||
void SoftBusRunOneShotTask(const char *name, void(*task)(void), uint64_t delay)
|
||||
{
|
||||
if (name == NULL || task == NULL) {
|
||||
HILOG_ERROR(SOFTBUS_HILOG_ID, "SoftBus Run Shot Watchdog Task param is invalid.");
|
||||
@ -47,7 +47,7 @@ NO_SANITIZE("cfi") void SoftBusRunOneShotTask(const char *name, void(*task)(void
|
||||
OHOS::HiviewDFX::Watchdog::GetInstance().RunOneShotTask(name, task, delay);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void SoftBusRunPeriodicalTask(const char *name, void(*task)(void), uint64_t interval, uint64_t delay)
|
||||
void SoftBusRunPeriodicalTask(const char *name, void(*task)(void), uint64_t interval, uint64_t delay)
|
||||
{
|
||||
if (name == NULL || task == NULL) {
|
||||
HILOG_ERROR(SOFTBUS_HILOG_ID, "SoftBus Run Periodical Watchdog Task param is invalid");
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
static TimerFunc g_timerfunc = NULL;
|
||||
|
||||
NO_SANITIZE("cfi") static void HandleTimeoutAdapterFun(void)
|
||||
static void HandleTimeoutAdapterFun(void)
|
||||
{
|
||||
if (g_timerfunc != NULL) {
|
||||
g_timerfunc();
|
||||
|
@ -281,7 +281,7 @@ static int32_t SoftBusConfTransPthreadAttr(SoftBusThreadAttr *threadAttr, pthrea
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusThreadCreate(SoftBusThread *thread, SoftBusThreadAttr *threadAttr,
|
||||
int32_t SoftBusThreadCreate(SoftBusThread *thread, SoftBusThreadAttr *threadAttr,
|
||||
void *(*threadEntry) (void *), void *arg)
|
||||
{
|
||||
if (thread == NULL) {
|
||||
|
@ -38,7 +38,7 @@ static unsigned int g_timerType;
|
||||
|
||||
static TimerFunc g_timerfunc = NULL;
|
||||
|
||||
NO_SANITIZE("cfi") static void HandleTimeoutAdapterFun(union sigval para)
|
||||
static void HandleTimeoutAdapterFun(union sigval para)
|
||||
{
|
||||
(void)para;
|
||||
if (g_timerfunc != NULL) {
|
||||
|
@ -62,7 +62,7 @@ static SoftBusMutex g_scanerLock = {0};
|
||||
static volatile bool g_isRegCb = false;
|
||||
static volatile bool g_isLpDeviceRegCb = false;
|
||||
|
||||
NO_SANITIZE("cfi") static void OnBtStateChanged(int32_t listenerId, int32_t state)
|
||||
static void OnBtStateChanged(int32_t listenerId, int32_t state)
|
||||
{
|
||||
(void)listenerId;
|
||||
if (state != SOFTBUS_BT_STATE_TURN_OFF) {
|
||||
@ -102,7 +102,7 @@ NO_SANITIZE("cfi") static void OnBtStateChanged(int32_t listenerId, int32_t stat
|
||||
(void)SoftBusMutexUnlock(&g_scanerLock);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int BleGattLockInit(void)
|
||||
int BleGattLockInit(void)
|
||||
{
|
||||
if (g_lockInit) {
|
||||
return SOFTBUS_OK;
|
||||
@ -412,7 +412,7 @@ static void ConvertAdvParam(const SoftBusBleAdvParams *src, BleAdvParams *dst)
|
||||
dst->duration = src->duration;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void WrapperAdvEnableCallback(int advId, int status)
|
||||
static void WrapperAdvEnableCallback(int advId, int status)
|
||||
{
|
||||
int32_t st = BleOhosStatusToSoftBus((BtStatus)status);
|
||||
for (uint32_t index = 0; index < ADV_MAX_NUM; index++) {
|
||||
@ -434,7 +434,7 @@ NO_SANITIZE("cfi") static void WrapperAdvEnableCallback(int advId, int status)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void WrapperAdvDisableCallback(int advId, int status)
|
||||
static void WrapperAdvDisableCallback(int advId, int status)
|
||||
{
|
||||
int32_t st = BleOhosStatusToSoftBus((BtStatus)status);
|
||||
for (uint32_t index = 0; index < ADV_MAX_NUM; index++) {
|
||||
@ -457,7 +457,7 @@ NO_SANITIZE("cfi") static void WrapperAdvDisableCallback(int advId, int status)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void WrapperAdvDataCallback(int advId, int status)
|
||||
static void WrapperAdvDataCallback(int advId, int status)
|
||||
{
|
||||
int32_t st = BleOhosStatusToSoftBus((BtStatus)status);
|
||||
for (uint32_t index = 0; index < ADV_MAX_NUM; index++) {
|
||||
@ -475,7 +475,7 @@ NO_SANITIZE("cfi") static void WrapperAdvDataCallback(int advId, int status)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void WrapperAdvUpdateCallback(int advId, int status)
|
||||
static void WrapperAdvUpdateCallback(int advId, int status)
|
||||
{
|
||||
int32_t st = BleOhosStatusToSoftBus((BtStatus)status);
|
||||
for (uint32_t index = 0; index < ADV_MAX_NUM; index++) {
|
||||
@ -493,13 +493,13 @@ NO_SANITIZE("cfi") static void WrapperAdvUpdateCallback(int advId, int status)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void WrapperSecurityRespondCallback(const BdAddr *bdAddr)
|
||||
static void WrapperSecurityRespondCallback(const BdAddr *bdAddr)
|
||||
{
|
||||
(void)bdAddr;
|
||||
CLOGI("WrapperSecurityRespondCallback");
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void WrapperScanResultCallback(BtScanResultData *scanResultdata)
|
||||
static void WrapperScanResultCallback(BtScanResultData *scanResultdata)
|
||||
{
|
||||
if (scanResultdata == NULL) {
|
||||
return;
|
||||
@ -681,7 +681,7 @@ static void ClearAdvData(int advId)
|
||||
g_advChannel[advId].advData.scanRspData = NULL;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusGetAdvChannel(const SoftBusAdvCallback *callback, int *scannerId, bool isLpDeviceScan)
|
||||
int SoftBusGetAdvChannel(const SoftBusAdvCallback *callback, int *scannerId, bool isLpDeviceScan)
|
||||
{
|
||||
if (callback == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -713,7 +713,7 @@ NO_SANITIZE("cfi") int SoftBusGetAdvChannel(const SoftBusAdvCallback *callback,
|
||||
return freeAdvId;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusReleaseAdvChannel(int advId)
|
||||
int SoftBusReleaseAdvChannel(int advId)
|
||||
{
|
||||
if (SoftBusMutexLock(&g_advLock) != 0) {
|
||||
return SOFTBUS_LOCK_ERR;
|
||||
@ -732,7 +732,7 @@ NO_SANITIZE("cfi") int SoftBusReleaseAdvChannel(int advId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusSetAdvData(int advId, const SoftBusBleAdvData *data)
|
||||
int SoftBusSetAdvData(int advId, const SoftBusBleAdvData *data)
|
||||
{
|
||||
if (data == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -754,7 +754,7 @@ NO_SANITIZE("cfi") int SoftBusSetAdvData(int advId, const SoftBusBleAdvData *dat
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusStartAdv(int advId, const SoftBusBleAdvParams *param)
|
||||
int SoftBusStartAdv(int advId, const SoftBusBleAdvParams *param)
|
||||
{
|
||||
if (param == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -800,7 +800,7 @@ NO_SANITIZE("cfi") int SoftBusStartAdv(int advId, const SoftBusBleAdvParams *par
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusStopAdv(int advId)
|
||||
int SoftBusStopAdv(int advId)
|
||||
{
|
||||
if (SoftBusMutexLock(&g_advLock) != 0) {
|
||||
return SOFTBUS_LOCK_ERR;
|
||||
@ -828,7 +828,7 @@ NO_SANITIZE("cfi") int SoftBusStopAdv(int advId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusUpdateAdv(int advId, const SoftBusBleAdvData *data, const SoftBusBleAdvParams *param)
|
||||
int SoftBusUpdateAdv(int advId, const SoftBusBleAdvData *data, const SoftBusBleAdvParams *param)
|
||||
{
|
||||
if (param == NULL || data == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -844,7 +844,7 @@ NO_SANITIZE("cfi") int SoftBusUpdateAdv(int advId, const SoftBusBleAdvData *data
|
||||
return SoftBusStartAdv(advId, param);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusAddScanListener(const SoftBusScanListener *listener, int *scannerId, bool isLpDeviceScan)
|
||||
int SoftBusAddScanListener(const SoftBusScanListener *listener, int *scannerId, bool isLpDeviceScan)
|
||||
{
|
||||
if (listener == NULL) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -891,7 +891,7 @@ static void FreeScanFilter(int listenerId)
|
||||
g_scanListener[listenerId].filter = NULL;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusRemoveScanListener(int listenerId)
|
||||
int SoftBusRemoveScanListener(int listenerId)
|
||||
{
|
||||
if (listenerId < 0 || listenerId >= SCAN_MAX_NUM) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -946,7 +946,7 @@ static bool CheckNeedStopScan(int listenerId)
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusSetScanFilter(int listenerId, SoftBusBleScanFilter *filter, uint8_t filterSize)
|
||||
int SoftBusSetScanFilter(int listenerId, SoftBusBleScanFilter *filter, uint8_t filterSize)
|
||||
{
|
||||
if (filter == NULL || filterSize == 0) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -967,7 +967,7 @@ NO_SANITIZE("cfi") int SoftBusSetScanFilter(int listenerId, SoftBusBleScanFilter
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusStartScan(int listenerId, int scannerId, const SoftBusBleScanParams *param)
|
||||
int SoftBusStartScan(int listenerId, int scannerId, const SoftBusBleScanParams *param)
|
||||
{
|
||||
if (param == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -1011,7 +1011,7 @@ NO_SANITIZE("cfi") int SoftBusStartScan(int listenerId, int scannerId, const Sof
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusStopScan(int listenerId, int scannerId)
|
||||
int SoftBusStopScan(int listenerId, int scannerId)
|
||||
{
|
||||
if (SoftBusMutexLock(&g_scanerLock) != 0) {
|
||||
return SOFTBUS_LOCK_ERR;
|
||||
@ -1075,12 +1075,12 @@ int SoftBusReplaceAdvertisingAdv(int advId, const SoftBusBleAdvData *data)
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool SoftBusIsLpDeviceAvailable(void)
|
||||
bool SoftBusIsLpDeviceAvailable(void)
|
||||
{
|
||||
return IsLpDeviceAvailable();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool SoftBusSetAdvFilterParam(int advHandle, int advId, SoftBusBleAdvParams *advParam,
|
||||
bool SoftBusSetAdvFilterParam(int advHandle, int advId, SoftBusBleAdvParams *advParam,
|
||||
int listenerId, SoftBusBleScanParams *scanParam)
|
||||
{
|
||||
BleScanConfigs scanConfig;
|
||||
@ -1116,32 +1116,32 @@ NO_SANITIZE("cfi") bool SoftBusSetAdvFilterParam(int advHandle, int advId, SoftB
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusGetAdvHandle(int32_t advId, int32_t *advHandle)
|
||||
int32_t SoftBusGetAdvHandle(int32_t advId, int32_t *advHandle)
|
||||
{
|
||||
return GetAdvHandle(g_advChannel[advId].advId, advHandle);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusEnableSyncDataToLpDevice(void)
|
||||
int32_t SoftBusEnableSyncDataToLpDevice(void)
|
||||
{
|
||||
return EnableSyncDataToLpDevice();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusDisableSyncDataToLpDevice(void)
|
||||
int32_t SoftBusDisableSyncDataToLpDevice(void)
|
||||
{
|
||||
return DisableSyncDataToLpDevice();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusDeregisterScanCallbacks(int32_t scannerId)
|
||||
int32_t SoftBusDeregisterScanCallbacks(int32_t scannerId)
|
||||
{
|
||||
return BleDeregisterScanCallbacks(scannerId);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusSetScanReportChannelToLpDevice(int scannerId, bool enable)
|
||||
int32_t SoftBusSetScanReportChannelToLpDevice(int scannerId, bool enable)
|
||||
{
|
||||
return SetScanReportChannelToLpDevice(scannerId, enable);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusSetLpDeviceParam(int duration, int maxExtAdvEvents, int window,
|
||||
int32_t SoftBusSetLpDeviceParam(int duration, int maxExtAdvEvents, int window,
|
||||
int interval, int advHandle)
|
||||
{
|
||||
return SetLpDeviceAdvParam(duration, maxExtAdvEvents, window, interval, advHandle);
|
||||
|
@ -32,7 +32,7 @@
|
||||
static BtGattClientCallbacks g_btGattClientCallbacks = { 0 };
|
||||
static SoftBusGattcCallback *g_softBusGattcCallback = NULL;
|
||||
|
||||
NO_SANITIZE("cfi") static void GattcConnectionStateChangedCallback(int clientId, int connectionState, int status)
|
||||
static void GattcConnectionStateChangedCallback(int clientId, int connectionState, int status)
|
||||
{
|
||||
CLOGI("StateChangedCallback id=%d, state=%d, status=%d", clientId, connectionState, status);
|
||||
if (connectionState != OHOS_STATE_CONNECTED && connectionState != OHOS_STATE_DISCONNECTED) {
|
||||
@ -43,46 +43,46 @@ NO_SANITIZE("cfi") static void GattcConnectionStateChangedCallback(int clientId,
|
||||
g_softBusGattcCallback->ConnectionStateCallback(clientId, connectionState, status);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi")
|
||||
|
||||
static void GattcConnectParaUpdateCallback(int clientId, int interval, int latency, int timeout, int status)
|
||||
{
|
||||
CLOGI("ParaUpdateCallback");
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void GattcSearchServiceCompleteCallback(int clientId, int status)
|
||||
static void GattcSearchServiceCompleteCallback(int clientId, int status)
|
||||
{
|
||||
CLOGI("SearchServiceCompleteCallback, id=%d, status=%d", clientId, status);
|
||||
g_softBusGattcCallback->ServiceCompleteCallback(clientId, status);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void GattcReadCharacteristicCallback(int clientId, BtGattReadData *readData, int status)
|
||||
static void GattcReadCharacteristicCallback(int clientId, BtGattReadData *readData, int status)
|
||||
{
|
||||
CLOGI("ReadCharacteristicCallback, id=%d, status=%d", clientId, status);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi")
|
||||
|
||||
static void GattcWriteCharacteristicCallback(int clientId, BtGattCharacteristic *characteristic, int status)
|
||||
{
|
||||
CLOGI("WriteCharacteristicCallback, id=%d, status=%d", clientId, status);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void GattcReadDescriptorCallback(int clientId, BtGattReadData *readData, int status)
|
||||
static void GattcReadDescriptorCallback(int clientId, BtGattReadData *readData, int status)
|
||||
{
|
||||
CLOGI("ReadDescriptorCallback, id=%d, status=%d", clientId, status);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void GattcWriteDescriptorCallback(int clientId, BtGattDescriptor *descriptor, int status)
|
||||
static void GattcWriteDescriptorCallback(int clientId, BtGattDescriptor *descriptor, int status)
|
||||
{
|
||||
CLOGI("WriteDescriptorCallback, id=%d, status=%d", clientId, status);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void GattcConfigureMtuSizeCallback(int clientId, int mtuSize, int status)
|
||||
static void GattcConfigureMtuSizeCallback(int clientId, int mtuSize, int status)
|
||||
{
|
||||
CLOGI("ConfigureMtuSizeCallback, id=%d, mtusize=%d, status=%d", clientId, mtuSize, status);
|
||||
g_softBusGattcCallback->ConfigureMtuSizeCallback(clientId, mtuSize, status);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void GattcRegisterNotificationCallback(int clientId, int status)
|
||||
static void GattcRegisterNotificationCallback(int clientId, int status)
|
||||
{
|
||||
CLOGI("RegisterNotificationCallback, id=%d, status=%d", clientId, status);
|
||||
g_softBusGattcCallback->RegistNotificationCallback(clientId, status);
|
||||
@ -104,7 +104,7 @@ static void GattcNotificationCallback(int clientId, BtGattReadData *notifyData,
|
||||
g_softBusGattcCallback->NotificationReceiveCallback(clientId, ¬ify, status);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void SoftbusGattcRegisterCallback(SoftBusGattcCallback *cb)
|
||||
void SoftbusGattcRegisterCallback(SoftBusGattcCallback *cb)
|
||||
{
|
||||
g_btGattClientCallbacks.ConnectionStateCb = GattcConnectionStateChangedCallback;
|
||||
g_btGattClientCallbacks.connectParaUpdateCb = GattcConnectParaUpdateCallback;
|
||||
@ -118,7 +118,7 @@ NO_SANITIZE("cfi") void SoftbusGattcRegisterCallback(SoftBusGattcCallback *cb)
|
||||
g_btGattClientCallbacks.notificationCb = GattcNotificationCallback;
|
||||
g_softBusGattcCallback = cb;
|
||||
}
|
||||
NO_SANITIZE("cfi") int32_t SoftbusGattcRegister(void)
|
||||
int32_t SoftbusGattcRegister(void)
|
||||
{
|
||||
BtUuid appId;
|
||||
char uuid[APP_UUID_LEN] = { 0xEE, 0xFD };
|
||||
@ -133,7 +133,7 @@ NO_SANITIZE("cfi") int32_t SoftbusGattcRegister(void)
|
||||
return clientId;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftbusGattcUnRegister(int32_t clientId)
|
||||
int32_t SoftbusGattcUnRegister(int32_t clientId)
|
||||
{
|
||||
if (BleGattcUnRegister(clientId) != SOFTBUS_OK) {
|
||||
CLOGE("BleGattcUnRegister error");
|
||||
@ -142,7 +142,7 @@ NO_SANITIZE("cfi") int32_t SoftbusGattcUnRegister(int32_t clientId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftbusGattcConnect(int32_t clientId, SoftBusBtAddr *addr)
|
||||
int32_t SoftbusGattcConnect(int32_t clientId, SoftBusBtAddr *addr)
|
||||
{
|
||||
BdAddr bdAddr;
|
||||
if (memcpy_s(bdAddr.addr, OHOS_BD_ADDR_LEN, addr->addr, BT_ADDR_LEN) != EOK) {
|
||||
@ -159,7 +159,7 @@ NO_SANITIZE("cfi") int32_t SoftbusGattcConnect(int32_t clientId, SoftBusBtAddr *
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftbusBleGattcDisconnect(int32_t clientId, bool refreshGatt)
|
||||
int32_t SoftbusBleGattcDisconnect(int32_t clientId, bool refreshGatt)
|
||||
{
|
||||
(void)refreshGatt;
|
||||
if (BleGattcDisconnect(clientId) != SOFTBUS_OK) {
|
||||
@ -169,7 +169,7 @@ NO_SANITIZE("cfi") int32_t SoftbusBleGattcDisconnect(int32_t clientId, bool refr
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftbusGattcSearchServices(int32_t clientId)
|
||||
int32_t SoftbusGattcSearchServices(int32_t clientId)
|
||||
{
|
||||
CLOGI("SoftbusGattcSearchServices %d", clientId);
|
||||
int32_t status = BleOhosStatusToSoftBus(BleGattcSearchServices(clientId));
|
||||
@ -180,13 +180,13 @@ NO_SANITIZE("cfi") int32_t SoftbusGattcSearchServices(int32_t clientId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftbusGattcRefreshServices(int32_t clientId)
|
||||
int32_t SoftbusGattcRefreshServices(int32_t clientId)
|
||||
{
|
||||
CLOGI("SoftbusGattcRefreshServices %d", clientId);
|
||||
return SOFTBUS_NOT_IMPLEMENT;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftbusGattcGetService(int32_t clientId, SoftBusBtUuid *serverUuid)
|
||||
int32_t SoftbusGattcGetService(int32_t clientId, SoftBusBtUuid *serverUuid)
|
||||
{
|
||||
if (clientId <= 0) {
|
||||
CLOGE("SoftbusGattcGetService invalid param");
|
||||
@ -202,7 +202,7 @@ NO_SANITIZE("cfi") int32_t SoftbusGattcGetService(int32_t clientId, SoftBusBtUui
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi")
|
||||
|
||||
int32_t SoftbusGattcRegisterNotification(
|
||||
int32_t clientId, SoftBusBtUuid *serverUuid, SoftBusBtUuid *charaUuid, SoftBusBtUuid *descriptorUuid)
|
||||
{
|
||||
@ -220,7 +220,7 @@ int32_t SoftbusGattcRegisterNotification(
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftbusGattcConfigureMtuSize(int32_t clientId, int mtuSize)
|
||||
int32_t SoftbusGattcConfigureMtuSize(int32_t clientId, int mtuSize)
|
||||
{
|
||||
if (BleGattcConfigureMtuSize(clientId, mtuSize) != SOFTBUS_OK) {
|
||||
CLOGE("BleGattcConfigureMtuSize error");
|
||||
@ -229,7 +229,7 @@ NO_SANITIZE("cfi") int32_t SoftbusGattcConfigureMtuSize(int32_t clientId, int mt
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftbusGattcWriteCharacteristic(int32_t clientId, SoftBusGattcData *clientData)
|
||||
int32_t SoftbusGattcWriteCharacteristic(int32_t clientId, SoftBusGattcData *clientData)
|
||||
{
|
||||
if (clientId <= 0 || clientData == NULL) {
|
||||
CLOGE("SoftbusGattcWriteCharacteristic invalid param");
|
||||
|
@ -38,7 +38,7 @@ static BtGattServerCallbacks g_bleGattsHalCallback = {0};
|
||||
static volatile int g_halServerId = -1;
|
||||
static volatile int g_halRegFlag = -1; // -1:not registered or register failed; 0:registerring; 1:registered
|
||||
|
||||
NO_SANITIZE("cfi") int CheckGattsStatus(void)
|
||||
int CheckGattsStatus(void)
|
||||
{
|
||||
if (g_gattsCallback == NULL) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -60,7 +60,7 @@ NO_SANITIZE("cfi") int CheckGattsStatus(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusGattsAddService(SoftBusBtUuid srvcUuid, bool isPrimary, int number)
|
||||
int SoftBusGattsAddService(SoftBusBtUuid srvcUuid, bool isPrimary, int number)
|
||||
{
|
||||
if ((srvcUuid.uuidLen == 0) || (srvcUuid.uuid == NULL) || (number <= 0)) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -78,7 +78,7 @@ NO_SANITIZE("cfi") int SoftBusGattsAddService(SoftBusBtUuid srvcUuid, bool isPri
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusGattsAddCharacteristic(int srvcHandle, SoftBusBtUuid characUuid, int properties,
|
||||
int SoftBusGattsAddCharacteristic(int srvcHandle, SoftBusBtUuid characUuid, int properties,
|
||||
int permissions)
|
||||
{
|
||||
if ((characUuid.uuidLen == 0) || (characUuid.uuid == NULL)) {
|
||||
@ -97,7 +97,7 @@ NO_SANITIZE("cfi") int SoftBusGattsAddCharacteristic(int srvcHandle, SoftBusBtUu
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusGattsAddDescriptor(int srvcHandle, SoftBusBtUuid descUuid, int permissions)
|
||||
int SoftBusGattsAddDescriptor(int srvcHandle, SoftBusBtUuid descUuid, int permissions)
|
||||
{
|
||||
if ((descUuid.uuidLen == 0) || (descUuid.uuid == NULL)) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -115,7 +115,7 @@ NO_SANITIZE("cfi") int SoftBusGattsAddDescriptor(int srvcHandle, SoftBusBtUuid d
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusGattsStartService(int srvcHandle)
|
||||
int SoftBusGattsStartService(int srvcHandle)
|
||||
{
|
||||
if (CheckGattsStatus() != SOFTBUS_OK) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -127,7 +127,7 @@ NO_SANITIZE("cfi") int SoftBusGattsStartService(int srvcHandle)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusGattsStopService(int srvcHandle)
|
||||
int SoftBusGattsStopService(int srvcHandle)
|
||||
{
|
||||
if (CheckGattsStatus() != SOFTBUS_OK) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -139,7 +139,7 @@ NO_SANITIZE("cfi") int SoftBusGattsStopService(int srvcHandle)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusGattsDeleteService(int srvcHandle)
|
||||
int SoftBusGattsDeleteService(int srvcHandle)
|
||||
{
|
||||
if (CheckGattsStatus() != SOFTBUS_OK) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -156,7 +156,7 @@ int SoftBusGattsConnect(int connId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusGattsDisconnect(SoftBusBtAddr btAddr, int connId)
|
||||
int SoftBusGattsDisconnect(SoftBusBtAddr btAddr, int connId)
|
||||
{
|
||||
if (CheckGattsStatus() != SOFTBUS_OK) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -172,7 +172,7 @@ NO_SANITIZE("cfi") int SoftBusGattsDisconnect(SoftBusBtAddr btAddr, int connId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusGattsSendResponse(SoftBusGattsResponse *param)
|
||||
int SoftBusGattsSendResponse(SoftBusGattsResponse *param)
|
||||
{
|
||||
if (CheckGattsStatus() != SOFTBUS_OK) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -190,7 +190,7 @@ NO_SANITIZE("cfi") int SoftBusGattsSendResponse(SoftBusGattsResponse *param)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusGattsSendNotify(SoftBusGattsNotify *param)
|
||||
int SoftBusGattsSendNotify(SoftBusGattsNotify *param)
|
||||
{
|
||||
CLOGI("SoftBusGattsSendNotify enter");
|
||||
if (CheckGattsStatus() != SOFTBUS_OK) {
|
||||
@ -212,7 +212,7 @@ NO_SANITIZE("cfi") int SoftBusGattsSendNotify(SoftBusGattsNotify *param)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void BleRegisterServerCallback(int status, int serverId, BtUuid *appUuid)
|
||||
static void BleRegisterServerCallback(int status, int serverId, BtUuid *appUuid)
|
||||
{
|
||||
CLOGI("BleRegisterServerCallback status=%d severId=%d", status, serverId);
|
||||
if ((appUuid == NULL) || (appUuid->uuid == NULL)) {
|
||||
@ -235,7 +235,7 @@ NO_SANITIZE("cfi") static void BleRegisterServerCallback(int status, int serverI
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void BleConnectServerCallback(int connId, int serverId, const BdAddr *bdAddr)
|
||||
static void BleConnectServerCallback(int connId, int serverId, const BdAddr *bdAddr)
|
||||
{
|
||||
CLOGI("ConnectServerCallback is coming, connId=%d serverId=%d\n", connId, serverId);
|
||||
if (serverId != g_halServerId) {
|
||||
@ -244,7 +244,7 @@ NO_SANITIZE("cfi") static void BleConnectServerCallback(int connId, int serverId
|
||||
g_gattsCallback->ConnectServerCallback(connId, (const SoftBusBtAddr*)bdAddr);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void BleDisconnectServerCallback(int connId, int serverId, const BdAddr *bdAddr)
|
||||
static void BleDisconnectServerCallback(int connId, int serverId, const BdAddr *bdAddr)
|
||||
{
|
||||
CLOGI("DisconnectServerCallback is coming, connId=%d severId=%d", connId, serverId);
|
||||
if (serverId != g_halServerId) {
|
||||
@ -253,7 +253,7 @@ NO_SANITIZE("cfi") static void BleDisconnectServerCallback(int connId, int serve
|
||||
g_gattsCallback->DisconnectServerCallback(connId, (const SoftBusBtAddr*)bdAddr);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void BleServiceAddCallback(int status, int serverId, BtUuid *uuid, int srvcHandle)
|
||||
static void BleServiceAddCallback(int status, int serverId, BtUuid *uuid, int srvcHandle)
|
||||
{
|
||||
(void)serverId;
|
||||
CLOGI("ServiceAddCallback srvcHandle=%d\n", srvcHandle);
|
||||
@ -264,7 +264,7 @@ NO_SANITIZE("cfi") static void BleServiceAddCallback(int status, int serverId, B
|
||||
g_gattsCallback->ServiceAddCallback(status, (SoftBusBtUuid *)uuid, srvcHandle);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void BleIncludeServiceAddCallback(int status, int serverId, int srvcHandle,
|
||||
static void BleIncludeServiceAddCallback(int status, int serverId, int srvcHandle,
|
||||
int includeSrvcHandle)
|
||||
{
|
||||
(void)serverId;
|
||||
@ -272,7 +272,7 @@ NO_SANITIZE("cfi") static void BleIncludeServiceAddCallback(int status, int serv
|
||||
CLOGI("IncludeServiceAddCallback srvcHandle=%d,includeSrvcHandle=%d\n", srvcHandle, includeSrvcHandle);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void BleCharacteristicAddCallback(int status, int serverId, BtUuid *uuid, int srvcHandle,
|
||||
static void BleCharacteristicAddCallback(int status, int serverId, BtUuid *uuid, int srvcHandle,
|
||||
int characteristicHandle)
|
||||
{
|
||||
CLOGI("CharacteristicAddCallback srvcHandle=%d,charHandle=%d\n", srvcHandle, characteristicHandle);
|
||||
@ -284,7 +284,7 @@ NO_SANITIZE("cfi") static void BleCharacteristicAddCallback(int status, int serv
|
||||
g_gattsCallback->CharacteristicAddCallback(status, (SoftBusBtUuid *)uuid, srvcHandle, characteristicHandle);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void BleDescriptorAddCallback(int status, int serverId, BtUuid *uuid,
|
||||
static void BleDescriptorAddCallback(int status, int serverId, BtUuid *uuid,
|
||||
int srvcHandle, int descriptorHandle)
|
||||
{
|
||||
CLOGI("DescriptorAddCallback srvcHandle=%d,descriptorHandle=%d", srvcHandle, descriptorHandle);
|
||||
@ -295,7 +295,7 @@ NO_SANITIZE("cfi") static void BleDescriptorAddCallback(int status, int serverId
|
||||
g_gattsCallback->DescriptorAddCallback(status, (SoftBusBtUuid *)uuid, srvcHandle, descriptorHandle);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void BleServiceStartCallback(int status, int serverId, int srvcHandle)
|
||||
static void BleServiceStartCallback(int status, int serverId, int srvcHandle)
|
||||
{
|
||||
CLOGI("ServiceStartCallback serverId=%d,srvcHandle=%d\n", serverId, srvcHandle);
|
||||
if (serverId != g_halServerId) {
|
||||
@ -305,7 +305,7 @@ NO_SANITIZE("cfi") static void BleServiceStartCallback(int status, int serverId,
|
||||
g_gattsCallback->ServiceStartCallback(status, srvcHandle);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void BleServiceStopCallback(int status, int serverId, int srvcHandle)
|
||||
static void BleServiceStopCallback(int status, int serverId, int srvcHandle)
|
||||
{
|
||||
CLOGI("ServiceStopCallback serverId=%d,srvcHandle=%d\n", serverId, srvcHandle);
|
||||
if (serverId != g_halServerId) {
|
||||
@ -314,7 +314,7 @@ NO_SANITIZE("cfi") static void BleServiceStopCallback(int status, int serverId,
|
||||
g_gattsCallback->ServiceStopCallback(status, srvcHandle);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void BleServiceDeleteCallback(int status, int serverId, int srvcHandle)
|
||||
static void BleServiceDeleteCallback(int status, int serverId, int srvcHandle)
|
||||
{
|
||||
CLOGI("ServiceDeleteCallback serverId=%d,srvcHandle=%d\n", serverId, srvcHandle);
|
||||
if (serverId != g_halServerId) {
|
||||
@ -323,7 +323,7 @@ NO_SANITIZE("cfi") static void BleServiceDeleteCallback(int status, int serverId
|
||||
g_gattsCallback->ServiceDeleteCallback(status, srvcHandle);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void BleRequestReadCallback(BtReqReadCbPara readCbPara)
|
||||
static void BleRequestReadCallback(BtReqReadCbPara readCbPara)
|
||||
{
|
||||
CLOGI("RequestReadCallback transId=%d, attrHandle=%d\n", readCbPara.transId, readCbPara.attrHandle);
|
||||
SoftBusGattReadRequest req = {
|
||||
@ -337,7 +337,7 @@ NO_SANITIZE("cfi") static void BleRequestReadCallback(BtReqReadCbPara readCbPara
|
||||
g_gattsCallback->RequestReadCallback(req);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void BleRequestWriteCallback(BtReqWriteCbPara writeCbPara)
|
||||
static void BleRequestWriteCallback(BtReqWriteCbPara writeCbPara)
|
||||
{
|
||||
CLOGI("RequestWriteCallback transId=%d, attrHandle=%d\n", writeCbPara.transId, writeCbPara.attrHandle);
|
||||
SoftBusGattWriteRequest req = {
|
||||
@ -354,19 +354,19 @@ NO_SANITIZE("cfi") static void BleRequestWriteCallback(BtReqWriteCbPara writeCbP
|
||||
g_gattsCallback->RequestWriteCallback(req);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void BleResponseConfirmationCallback(int status, int handle)
|
||||
static void BleResponseConfirmationCallback(int status, int handle)
|
||||
{
|
||||
CLOGI("ResponseConfirmationCallback status=%d, handle=%d\n", status, handle);
|
||||
g_gattsCallback->ResponseConfirmationCallback(status, handle);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void BleIndicationSentCallback(int connId, int status)
|
||||
static void BleIndicationSentCallback(int connId, int status)
|
||||
{
|
||||
CLOGI("IndicationSentCallback status=%d, connId=%d\n", status, connId);
|
||||
g_gattsCallback->NotifySentCallback(connId, status);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void BleMtuChangeCallback(int connId, int mtu)
|
||||
static void BleMtuChangeCallback(int connId, int mtu)
|
||||
{
|
||||
CLOGI("MtuChangeCallback connId=%d, mtu=%d\n", connId, mtu);
|
||||
g_gattsCallback->MtuChangeCallback(connId, mtu);
|
||||
@ -392,7 +392,7 @@ static int GattsRegisterHalCallback(void)
|
||||
return BleGattsRegisterCallbacks(&g_bleGattsHalCallback);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusRegisterGattsCallbacks(SoftBusGattsCallback *callback)
|
||||
int SoftBusRegisterGattsCallbacks(SoftBusGattsCallback *callback)
|
||||
{
|
||||
if (callback == NULL) {
|
||||
CLOGE("SoftBusRegisterGattsCallbacks fail:nullptr");
|
||||
@ -423,7 +423,7 @@ NO_SANITIZE("cfi") int SoftBusRegisterGattsCallbacks(SoftBusGattsCallback *callb
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void SoftBusUnRegisterGattsCallbacks(void)
|
||||
void SoftBusUnRegisterGattsCallbacks(void)
|
||||
{
|
||||
if (g_gattsCallback == NULL) {
|
||||
CLOGI("no need to unregist gatts callback.");
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "adapter_bt_utils.h"
|
||||
#include "softbus_def.h"
|
||||
|
||||
NO_SANITIZE("cfi") int32_t BleOhosStatusToSoftBus(BtStatus btStatus)
|
||||
int32_t BleOhosStatusToSoftBus(BtStatus btStatus)
|
||||
{
|
||||
int32_t status;
|
||||
switch (btStatus) {
|
||||
|
@ -79,7 +79,7 @@ static SoftBusBtAddr ConvertBtAddr(const BdAddr *bdAddr)
|
||||
static StateListener g_stateListener[STATE_LISTENER_MAX_NUM];
|
||||
static bool g_isRegCb = false;
|
||||
|
||||
NO_SANITIZE("cfi") static void WrapperStateChangeCallback(const int transport, const int status)
|
||||
static void WrapperStateChangeCallback(const int transport, const int status)
|
||||
{
|
||||
CLOGI("WrapperStateChangeCallback, transport=%d, status=%d", transport, status);
|
||||
int listenerId;
|
||||
@ -114,7 +114,7 @@ static void WrapperAclStateChangedCallback(const BdAddr *bdAddr, GapAclState sta
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void WrapperPairRequestedCallback(const BdAddr *bdAddr, int transport)
|
||||
static void WrapperPairRequestedCallback(const BdAddr *bdAddr, int transport)
|
||||
{
|
||||
if (bdAddr == NULL) {
|
||||
CLOGE("WrapperPairRequestedCallback addr is null");
|
||||
@ -128,7 +128,7 @@ NO_SANITIZE("cfi") static void WrapperPairRequestedCallback(const BdAddr *bdAddr
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void WrapperPairConfiremedCallback(const BdAddr *bdAddr, int transport, int reqType,
|
||||
static void WrapperPairConfiremedCallback(const BdAddr *bdAddr, int transport, int reqType,
|
||||
int number)
|
||||
{
|
||||
if (bdAddr == NULL) {
|
||||
@ -163,7 +163,7 @@ static int RegisterListenerCallback(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusAddBtStateListener(const SoftBusBtStateListener *listener)
|
||||
int SoftBusAddBtStateListener(const SoftBusBtStateListener *listener)
|
||||
{
|
||||
if (listener == NULL) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -181,7 +181,7 @@ NO_SANITIZE("cfi") int SoftBusAddBtStateListener(const SoftBusBtStateListener *l
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusRemoveBtStateListener(int listenerId)
|
||||
int SoftBusRemoveBtStateListener(int listenerId)
|
||||
{
|
||||
if (listenerId < 0 || listenerId >= STATE_LISTENER_MAX_NUM) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -191,7 +191,7 @@ NO_SANITIZE("cfi") int SoftBusRemoveBtStateListener(int listenerId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusEnableBt(void)
|
||||
int SoftBusEnableBt(void)
|
||||
{
|
||||
if (EnableBle()) {
|
||||
return SOFTBUS_OK;
|
||||
@ -199,7 +199,7 @@ NO_SANITIZE("cfi") int SoftBusEnableBt(void)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusDisableBt(void)
|
||||
int SoftBusDisableBt(void)
|
||||
{
|
||||
if (DisableBle()) {
|
||||
return SOFTBUS_OK;
|
||||
@ -207,7 +207,7 @@ NO_SANITIZE("cfi") int SoftBusDisableBt(void)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusGetBtState(void)
|
||||
int SoftBusGetBtState(void)
|
||||
{
|
||||
if (IsBleEnabled()) {
|
||||
return BLE_ENABLE;
|
||||
@ -215,7 +215,7 @@ NO_SANITIZE("cfi") int SoftBusGetBtState(void)
|
||||
return BLE_DISABLE;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusGetBtMacAddr(SoftBusBtAddr *mac)
|
||||
int SoftBusGetBtMacAddr(SoftBusBtAddr *mac)
|
||||
{
|
||||
if (mac == NULL) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -234,7 +234,7 @@ int SoftBusGetBtName(unsigned char *name, unsigned int *len)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int SoftBusSetBtName(const char *name)
|
||||
int SoftBusSetBtName(const char *name)
|
||||
{
|
||||
if (SetLocalName((unsigned char *)name, strlen(name))) {
|
||||
return SOFTBUS_OK;
|
||||
|
@ -36,7 +36,7 @@ static ChannelInfoList g_channelInfoList;
|
||||
static ChannelList g_channelList;
|
||||
static void GetOneChannelMeasResult(void *para);
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusRegWlanChannelInfoCb(WlanChannelInfoCb *cb)
|
||||
int32_t SoftBusRegWlanChannelInfoCb(WlanChannelInfoCb *cb)
|
||||
{
|
||||
if (cb == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "invalid parameter.");
|
||||
@ -72,7 +72,7 @@ static void ReleaseMeasResources(void)
|
||||
g_channelInfoList.buff = NULL;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void ExcuteChannelMeas(void)
|
||||
static void ExcuteChannelMeas(void)
|
||||
{
|
||||
if (g_channelList.measNum >= g_channelList.num) {
|
||||
WlanChannelInfo *info = g_channelInfoList.buff;
|
||||
@ -104,7 +104,7 @@ NO_SANITIZE("cfi") static void ExcuteChannelMeas(void)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusRequestWlanChannelInfo(int32_t *channelId, uint32_t num)
|
||||
int32_t SoftBusRequestWlanChannelInfo(int32_t *channelId, uint32_t num)
|
||||
{
|
||||
if (channelId == NULL || num == 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "invalid parameter.");
|
||||
@ -152,7 +152,7 @@ NO_SANITIZE("cfi") int32_t SoftBusRequestWlanChannelInfo(int32_t *channelId, uin
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void GetOneChannelMeasResult(void *para)
|
||||
static void GetOneChannelMeasResult(void *para)
|
||||
{
|
||||
(void)para;
|
||||
struct MeasChannelResult measChannelResult = {0};
|
||||
|
@ -77,7 +77,7 @@ static int32_t ConvertWifiDevConfFromSoftBusWifiConf(const SoftBusWifiDevConf *r
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusGetWifiDeviceConfig(SoftBusWifiDevConf *configList, uint32_t *num)
|
||||
int32_t SoftBusGetWifiDeviceConfig(SoftBusWifiDevConf *configList, uint32_t *num)
|
||||
{
|
||||
WifiDeviceConfig *result = NULL;
|
||||
uint32_t wifiConfigSize;
|
||||
@ -130,7 +130,7 @@ NO_SANITIZE("cfi") int32_t SoftBusGetWifiDeviceConfig(SoftBusWifiDevConf *config
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusConnectToDevice(const SoftBusWifiDevConf *wifiConfig)
|
||||
int32_t SoftBusConnectToDevice(const SoftBusWifiDevConf *wifiConfig)
|
||||
{
|
||||
WifiDeviceConfig wifiDevConfig;
|
||||
|
||||
@ -152,7 +152,7 @@ NO_SANITIZE("cfi") int32_t SoftBusConnectToDevice(const SoftBusWifiDevConf *wifi
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusDisconnectDevice(void)
|
||||
int32_t SoftBusDisconnectDevice(void)
|
||||
{
|
||||
return Disconnect();
|
||||
}
|
||||
@ -160,7 +160,7 @@ NO_SANITIZE("cfi") int32_t SoftBusDisconnectDevice(void)
|
||||
static ISoftBusScanResult *g_scanResultCb[MAX_CALLBACK_NUM] = {NULL};
|
||||
static bool g_registerFlag = true;
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusStartWifiScan(void)
|
||||
int32_t SoftBusStartWifiScan(void)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
@ -172,7 +172,7 @@ NO_SANITIZE("cfi") int32_t SoftBusStartWifiScan(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void SoftBusWifiScanStateChanged(int state, int size)
|
||||
static void SoftBusWifiScanStateChanged(int state, int size)
|
||||
{
|
||||
for (int i = 0; i < MAX_CALLBACK_NUM; i++) {
|
||||
if (g_scanResultCb[i] != NULL) {
|
||||
@ -200,7 +200,7 @@ static int32_t FindFreeCallbackIndex(void)
|
||||
return i;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusRegisterWifiEvent(ISoftBusScanResult *cb)
|
||||
int32_t SoftBusRegisterWifiEvent(ISoftBusScanResult *cb)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
@ -252,7 +252,7 @@ static int32_t ConvertSoftBusWifiScanInfoFromWifi(WifiScanInfo *info, SoftBusWif
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusGetWifiScanList(SoftBusWifiScanInfo **result, uint32_t *size)
|
||||
int32_t SoftBusGetWifiScanList(SoftBusWifiScanInfo **result, uint32_t *size)
|
||||
{
|
||||
if (size == NULL || result == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para size or result is NULL.");
|
||||
@ -300,7 +300,7 @@ static bool IsScanResultCbEmpty(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusUnRegisterWifiEvent(ISoftBusScanResult *cb)
|
||||
int32_t SoftBusUnRegisterWifiEvent(ISoftBusScanResult *cb)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
@ -322,7 +322,7 @@ NO_SANITIZE("cfi") int32_t SoftBusUnRegisterWifiEvent(ISoftBusScanResult *cb)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusGetChannelListFor5G(int32_t *channelList, int32_t num)
|
||||
int32_t SoftBusGetChannelListFor5G(int32_t *channelList, int32_t num)
|
||||
{
|
||||
if (channelList == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para channelList is NULL.");
|
||||
@ -336,7 +336,7 @@ NO_SANITIZE("cfi") int32_t SoftBusGetChannelListFor5G(int32_t *channelList, int3
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") SoftBusBand SoftBusGetLinkBand(void)
|
||||
SoftBusBand SoftBusGetLinkBand(void)
|
||||
{
|
||||
WifiLinkedInfo result;
|
||||
GetLinkedInfo(&result);
|
||||
@ -354,7 +354,7 @@ NO_SANITIZE("cfi") SoftBusBand SoftBusGetLinkBand(void)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusGetLinkedInfo(SoftBusWifiLinkedInfo *info)
|
||||
int32_t SoftBusGetLinkedInfo(SoftBusWifiLinkedInfo *info)
|
||||
{
|
||||
WifiLinkedInfo result;
|
||||
if (GetLinkedInfo(&result) != WIFI_SUCCESS) {
|
||||
@ -370,7 +370,7 @@ NO_SANITIZE("cfi") int32_t SoftBusGetLinkedInfo(SoftBusWifiLinkedInfo *info)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusGetCurrentGroup(SoftBusWifiP2pGroupInfo *groupInfo)
|
||||
int32_t SoftBusGetCurrentGroup(SoftBusWifiP2pGroupInfo *groupInfo)
|
||||
{
|
||||
WifiP2pGroupInfo result;
|
||||
if (GetCurrentGroup(&result) != WIFI_SUCCESS) {
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#define MAX_BYTES_LENGTH 4194304
|
||||
|
||||
NO_SANITIZE("cfi") void SoftbusConfigAdapterInit(const ConfigSetProc *sets)
|
||||
void SoftbusConfigAdapterInit(const ConfigSetProc *sets)
|
||||
{
|
||||
int32_t val;
|
||||
val = MAX_BYTES_LENGTH;
|
||||
|
@ -105,6 +105,11 @@ if (defined(ohos_lite)) {
|
||||
} else {
|
||||
import("//build/ohos.gni")
|
||||
ohos_shared_library("FillpSo.open") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
cflags = fillp_cflags
|
||||
cflags += [
|
||||
"-Wall",
|
||||
|
@ -120,6 +120,11 @@ if (defined(ohos_lite)) {
|
||||
import("//build/ohos.gni")
|
||||
|
||||
ohos_shared_library("nstackx_dfile.open") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
cflags = [
|
||||
"-Wall",
|
||||
"-DMBEDTLS_INCLUDED",
|
||||
|
@ -155,6 +155,11 @@ if (defined(ohos_lite)) {
|
||||
include_dirs = [ "interface" ]
|
||||
}
|
||||
ohos_shared_library("nstackx_ctrl") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
cflags += [ "-DDFINDER_MGT_MSG_LOG" ]
|
||||
cflags_cc = cflags
|
||||
sources = [
|
||||
|
@ -175,6 +175,11 @@ if (defined(ohos_lite)) {
|
||||
}
|
||||
|
||||
ohos_shared_library("nstackx_util.open") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
cflags += [
|
||||
"-DMBEDTLS_INCLUDED",
|
||||
"-DNSTACKX_WITH_HMOS_LINUX",
|
||||
|
@ -50,13 +50,13 @@ static int32_t OpenSppServer(const char *name, int32_t nameLen, const char *uuid
|
||||
return SppServerCreate(&socketPara, name, nameLen);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void CloseSppServer(int32_t serverFd)
|
||||
static void CloseSppServer(int32_t serverFd)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_COMM, SOFTBUS_LOG_INFO, "[CloseServer Connect, and serverFd = %d]", serverFd);
|
||||
SppServerClose(serverFd);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t Connect(const char *uuid, const BT_ADDR mac)
|
||||
static int32_t Connect(const char *uuid, const BT_ADDR mac)
|
||||
{
|
||||
if (mac == NULL) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -83,7 +83,7 @@ NO_SANITIZE("cfi") static int32_t Connect(const char *uuid, const BT_ADDR mac)
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t DisConnect(int32_t clientFd)
|
||||
static int32_t DisConnect(int32_t clientFd)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_COMM, SOFTBUS_LOG_INFO, "[DisConnect, and clientFd = %d]", clientFd);
|
||||
return SppDisconnect(clientFd);
|
||||
@ -95,7 +95,7 @@ static bool IsConnected(int32_t clientFd)
|
||||
return IsSppConnected(clientFd);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t Accept(int32_t serverFd)
|
||||
static int32_t Accept(int32_t serverFd)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_COMM, SOFTBUS_LOG_INFO, "[Accept remote device to connect, and serverFd = %d]", serverFd);
|
||||
int32_t ret = SppServerAccept(serverFd);
|
||||
@ -105,7 +105,7 @@ NO_SANITIZE("cfi") static int32_t Accept(int32_t serverFd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t Write(int32_t clientFd, const uint8_t *buf, const int32_t len)
|
||||
static int32_t Write(int32_t clientFd, const uint8_t *buf, const int32_t len)
|
||||
{
|
||||
return SppWrite(clientFd, (const char *)buf, len);
|
||||
}
|
||||
@ -154,7 +154,7 @@ bool IsAclConnected(const BT_ADDR mac)
|
||||
return false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") SppSocketDriver *InitSppSocketDriver()
|
||||
SppSocketDriver *InitSppSocketDriver()
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_COMM, SOFTBUS_LOG_INFO, "[InitSppSocketDriver]");
|
||||
Init(&g_sppSocketDriver);
|
||||
|
@ -62,7 +62,7 @@ static int32_t SoftBusConvertDeviceType(const char *inBuf, char *outBuf, uint32_
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t GetCommonDevInfo(const CommonDeviceKey key, char *value, uint32_t len)
|
||||
int32_t GetCommonDevInfo(const CommonDeviceKey key, char *value, uint32_t len)
|
||||
{
|
||||
if (value == NULL) {
|
||||
HILOG_ERROR(SOFTBUS_HILOG_ID, "fail: para error!");
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
static const std::string DEFAULT_USER_ID = "0";
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetOhosAccountInfo(uint8_t *accountHash, uint32_t len)
|
||||
int32_t LnnGetOhosAccountInfo(uint8_t *accountHash, uint32_t len)
|
||||
{
|
||||
if (accountHash == nullptr || len != SHA_256_HASH_LEN) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "GetOhosAccount get invalid param");
|
||||
@ -64,7 +64,7 @@ NO_SANITIZE("cfi") int32_t LnnGetOhosAccountInfo(uint8_t *accountHash, uint32_t
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitOhosAccount(void)
|
||||
int32_t LnnInitOhosAccount(void)
|
||||
{
|
||||
uint8_t accountHash[SHA_256_HASH_LEN] = {0};
|
||||
|
||||
@ -81,7 +81,7 @@ NO_SANITIZE("cfi") int32_t LnnInitOhosAccount(void)
|
||||
return LnnSetLocalByteInfo(BYTE_KEY_ACCOUNT_HASH, accountHash, SHA_256_HASH_LEN);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnUpdateOhosAccount(void)
|
||||
void LnnUpdateOhosAccount(void)
|
||||
{
|
||||
uint8_t accountHash[SHA_256_HASH_LEN] = {0};
|
||||
uint8_t localAccountHash[SHA_256_HASH_LEN] = {0};
|
||||
@ -111,7 +111,7 @@ NO_SANITIZE("cfi") void LnnUpdateOhosAccount(void)
|
||||
LnnUpdateHeartbeatInfo(UPDATE_HB_ACCOUNT_INFO);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnOnOhosAccountLogout(void)
|
||||
void LnnOnOhosAccountLogout(void)
|
||||
{
|
||||
uint8_t accountHash[SHA_256_HASH_LEN] = {0};
|
||||
|
||||
@ -127,7 +127,7 @@ NO_SANITIZE("cfi") void LnnOnOhosAccountLogout(void)
|
||||
LnnUpdateHeartbeatInfo(UPDATE_HB_ACCOUNT_INFO);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnIsDefaultOhosAccount(void)
|
||||
bool LnnIsDefaultOhosAccount(void)
|
||||
{
|
||||
uint8_t localAccountHash[SHA_256_HASH_LEN] = {0};
|
||||
uint8_t defaultAccountHash[SHA_256_HASH_LEN] = {0};
|
||||
|
@ -138,7 +138,7 @@ static void RegisterNameMonitorHelper(void)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetSettingDeviceName(char *deviceName, uint32_t len)
|
||||
int32_t LnnGetSettingDeviceName(char *deviceName, uint32_t len)
|
||||
{
|
||||
if (deviceName == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "invalid para");
|
||||
@ -151,7 +151,7 @@ NO_SANITIZE("cfi") int32_t LnnGetSettingDeviceName(char *deviceName, uint32_t le
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitGetDeviceName(LnnDeviceNameHandler handler)
|
||||
int32_t LnnInitGetDeviceName(LnnDeviceNameHandler handler)
|
||||
{
|
||||
if (handler == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "handler is null");
|
||||
@ -176,7 +176,7 @@ int32_t LnnInitDeviceNameMonitorImpl(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void RegisterNameMonitor(void)
|
||||
void RegisterNameMonitor(void)
|
||||
{
|
||||
OHOS::BusCenter::RegisterNameMonitorHelper();
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ static SoftBusMutex g_authLock;
|
||||
static SoftBusHandler g_authHandler = { NULL, NULL, NULL };
|
||||
|
||||
/* auth handler */
|
||||
NO_SANITIZE("cfi") static bool IsAuthHandlerInit(void)
|
||||
static bool IsAuthHandlerInit(void)
|
||||
{
|
||||
if (g_authHandler.looper == NULL || g_authHandler.looper->PostMessage == NULL ||
|
||||
g_authHandler.looper->PostMessageDelay == NULL || g_authHandler.looper->RemoveMessageCustom == NULL) {
|
||||
@ -61,7 +61,7 @@ NO_SANITIZE("cfi") static bool IsAuthHandlerInit(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void DelAuthMessage(SoftBusMessage *msg)
|
||||
static void DelAuthMessage(SoftBusMessage *msg)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VOID(msg);
|
||||
if (msg->obj != NULL) {
|
||||
@ -92,7 +92,7 @@ static SoftBusMessage *NewAuthMessage(const uint8_t *obj, uint32_t size)
|
||||
return msg;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void HandleAuthMessage(SoftBusMessage *msg)
|
||||
static void HandleAuthMessage(SoftBusMessage *msg)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VOID(msg);
|
||||
EventHandler handler = (EventHandler)(uintptr_t)msg->arg1;
|
||||
@ -103,7 +103,7 @@ NO_SANITIZE("cfi") static void HandleAuthMessage(SoftBusMessage *msg)
|
||||
handler(msg->obj);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi")
|
||||
|
||||
int32_t PostAuthEvent(EventType event, EventHandler handler, const void *obj, uint32_t size, uint64_t delayMs)
|
||||
{
|
||||
if (!IsAuthHandlerInit()) {
|
||||
@ -124,7 +124,7 @@ int32_t PostAuthEvent(EventType event, EventHandler handler, const void *obj, ui
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t CustomFunc(const SoftBusMessage *msg, void *param)
|
||||
static int32_t CustomFunc(const SoftBusMessage *msg, void *param)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(msg, SOFTBUS_ERR);
|
||||
CHECK_NULL_PTR_RETURN_VALUE(param, SOFTBUS_ERR);
|
||||
@ -138,7 +138,7 @@ NO_SANITIZE("cfi") static int32_t CustomFunc(const SoftBusMessage *msg, void *pa
|
||||
return info->cmpFunc(msg->obj, info->param);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t RemoveAuthEvent(EventType event, RemoveCompareFunc func, void *param)
|
||||
int32_t RemoveAuthEvent(EventType event, RemoveCompareFunc func, void *param)
|
||||
{
|
||||
if (!IsAuthHandlerInit()) {
|
||||
return SOFTBUS_NO_INIT;
|
||||
@ -153,7 +153,7 @@ NO_SANITIZE("cfi") int32_t RemoveAuthEvent(EventType event, RemoveCompareFunc fu
|
||||
}
|
||||
|
||||
/* auth lock */
|
||||
NO_SANITIZE("cfi") bool RequireAuthLock(void)
|
||||
bool RequireAuthLock(void)
|
||||
{
|
||||
if (SoftBusMutexLock(&g_authLock) != SOFTBUS_OK) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "auth lock fail.");
|
||||
@ -162,7 +162,7 @@ NO_SANITIZE("cfi") bool RequireAuthLock(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void ReleaseAuthLock(void)
|
||||
void ReleaseAuthLock(void)
|
||||
{
|
||||
if (SoftBusMutexUnlock(&g_authLock) != SOFTBUS_OK) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "auth unlock fail.");
|
||||
@ -170,7 +170,7 @@ NO_SANITIZE("cfi") void ReleaseAuthLock(void)
|
||||
}
|
||||
|
||||
/* auth config */
|
||||
NO_SANITIZE("cfi") bool GetConfigSupportAsServer(void)
|
||||
bool GetConfigSupportAsServer(void)
|
||||
{
|
||||
uint32_t ability = 0;
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_AUTH_ABILITY_COLLECTION, (uint8_t *)(&ability), sizeof(ability)) != SOFTBUS_OK) {
|
||||
@ -181,7 +181,7 @@ NO_SANITIZE("cfi") bool GetConfigSupportAsServer(void)
|
||||
}
|
||||
|
||||
/* auth common function */
|
||||
NO_SANITIZE("cfi") uint8_t *DupMemBuffer(const uint8_t *buf, uint32_t size)
|
||||
uint8_t *DupMemBuffer(const uint8_t *buf, uint32_t size)
|
||||
{
|
||||
if (buf == NULL || size == 0) {
|
||||
return NULL;
|
||||
@ -216,7 +216,7 @@ static void UpdateUniqueId(void)
|
||||
g_uniqueId = (g_uniqueId << SEQ_TIME_STAMP_BITS) | (SEQ_TIME_STAMP_MASK & timeStamp);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int64_t GenSeq(bool isServer)
|
||||
int64_t GenSeq(bool isServer)
|
||||
{
|
||||
static uint32_t integer = 0;
|
||||
if (integer >= SEQ_INTEGER_MAX) {
|
||||
@ -232,7 +232,7 @@ NO_SANITIZE("cfi") int64_t GenSeq(bool isServer)
|
||||
return (int64_t)seq;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") uint64_t GetCurrentTimeMs(void)
|
||||
uint64_t GetCurrentTimeMs(void)
|
||||
{
|
||||
SoftBusSysTime now = { 0 };
|
||||
if (SoftBusGetTime(&now) != SOFTBUS_OK) {
|
||||
@ -242,12 +242,12 @@ NO_SANITIZE("cfi") uint64_t GetCurrentTimeMs(void)
|
||||
return (uint64_t)now.sec * TIME_SEC_TO_MSEC + (uint64_t)now.usec / TIME_MSEC_TO_USEC;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *GetAuthSideStr(bool isServer)
|
||||
const char *GetAuthSideStr(bool isServer)
|
||||
{
|
||||
return isServer ? "server" : "client";
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool CompareConnInfo(const AuthConnInfo *info1, const AuthConnInfo *info2, bool cmpShortHash)
|
||||
bool CompareConnInfo(const AuthConnInfo *info1, const AuthConnInfo *info2, bool cmpShortHash)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(info1, false);
|
||||
CHECK_NULL_PTR_RETURN_VALUE(info2, false);
|
||||
@ -284,7 +284,7 @@ NO_SANITIZE("cfi") bool CompareConnInfo(const AuthConnInfo *info1, const AuthCon
|
||||
return false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ConvertToConnectOption(const AuthConnInfo *connInfo, ConnectOption *option)
|
||||
int32_t ConvertToConnectOption(const AuthConnInfo *connInfo, ConnectOption *option)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(connInfo, SOFTBUS_INVALID_PARAM);
|
||||
CHECK_NULL_PTR_RETURN_VALUE(option, SOFTBUS_INVALID_PARAM);
|
||||
@ -327,7 +327,7 @@ NO_SANITIZE("cfi") int32_t ConvertToConnectOption(const AuthConnInfo *connInfo,
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ConvertToAuthConnInfo(const ConnectionInfo *info, AuthConnInfo *connInfo)
|
||||
int32_t ConvertToAuthConnInfo(const ConnectionInfo *info, AuthConnInfo *connInfo)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(info, SOFTBUS_INVALID_PARAM);
|
||||
CHECK_NULL_PTR_RETURN_VALUE(connInfo, SOFTBUS_INVALID_PARAM);
|
||||
@ -369,7 +369,7 @@ NO_SANITIZE("cfi") int32_t ConvertToAuthConnInfo(const ConnectionInfo *info, Aut
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthCommonInit(void)
|
||||
int32_t AuthCommonInit(void)
|
||||
{
|
||||
g_authHandler.name = "AuthHandler";
|
||||
g_authHandler.HandleMessage = HandleAuthMessage;
|
||||
@ -382,7 +382,7 @@ NO_SANITIZE("cfi") int32_t AuthCommonInit(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void AuthCommonDeinit(void)
|
||||
void AuthCommonDeinit(void)
|
||||
{
|
||||
g_authHandler.looper = NULL;
|
||||
g_authHandler.HandleMessage = NULL;
|
||||
|
@ -72,7 +72,7 @@ int32_t GetConnType(uint64_t connId)
|
||||
return (int32_t)((connId >> INT32_BIT_NUM) & MASK_UINT64_L32);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *GetConnTypeStr(uint64_t connId)
|
||||
const char *GetConnTypeStr(uint64_t connId)
|
||||
{
|
||||
int32_t type = GetConnType(connId);
|
||||
switch (type) {
|
||||
@ -164,7 +164,7 @@ static void ClearConnRequest(void)
|
||||
}
|
||||
|
||||
/* Notify Conn Listener */
|
||||
NO_SANITIZE("cfi")
|
||||
|
||||
static void NotifyClientConnected(uint32_t requestId, uint64_t connId, int32_t result, const AuthConnInfo *connInfo)
|
||||
{
|
||||
if (g_listener.onConnectResult != NULL) {
|
||||
@ -172,14 +172,14 @@ static void NotifyClientConnected(uint32_t requestId, uint64_t connId, int32_t r
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void NotifyDisconnected(uint64_t connId, const AuthConnInfo *connInfo)
|
||||
static void NotifyDisconnected(uint64_t connId, const AuthConnInfo *connInfo)
|
||||
{
|
||||
if (g_listener.onDisconnected != NULL) {
|
||||
g_listener.onDisconnected(connId, connInfo);
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi")
|
||||
|
||||
static void NotifyDataReceived(
|
||||
uint64_t connId, const AuthConnInfo *connInfo, bool fromServer, const AuthDataHead *head, const uint8_t *data)
|
||||
{
|
||||
@ -189,12 +189,12 @@ static void NotifyDataReceived(
|
||||
}
|
||||
|
||||
/* AuthData */
|
||||
NO_SANITIZE("cfi") uint32_t GetAuthDataSize(uint32_t len)
|
||||
uint32_t GetAuthDataSize(uint32_t len)
|
||||
{
|
||||
return AUTH_CONN_DATA_HEAD_SIZE + len;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t PackAuthData(const AuthDataHead *head, const uint8_t *data,
|
||||
int32_t PackAuthData(const AuthDataHead *head, const uint8_t *data,
|
||||
uint8_t *buf, uint32_t size)
|
||||
{
|
||||
if (size < GetAuthDataSize(head->len)) {
|
||||
@ -219,7 +219,7 @@ NO_SANITIZE("cfi") int32_t PackAuthData(const AuthDataHead *head, const uint8_t
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const uint8_t *UnpackAuthData(const uint8_t *data, uint32_t len, AuthDataHead *head)
|
||||
const uint8_t *UnpackAuthData(const uint8_t *data, uint32_t len, AuthDataHead *head)
|
||||
{
|
||||
if (len < GetAuthDataSize(0)) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "AuthData: head not enough.");
|
||||
@ -394,7 +394,7 @@ static void OnCommDisconnected(uint32_t connectionId, const ConnectionInfo *info
|
||||
NotifyDisconnected(GenConnId(connInfo.type, connectionId), &connInfo);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t GetConnInfoByConnectionId(uint32_t connectionId, AuthConnInfo *connInfo)
|
||||
int32_t GetConnInfoByConnectionId(uint32_t connectionId, AuthConnInfo *connInfo)
|
||||
{
|
||||
ConnectionInfo info = { 0 };
|
||||
int32_t ret = ConnGetConnectionInfo(connectionId, &info);
|
||||
@ -548,7 +548,7 @@ static int32_t PostCommData(uint32_t connectionId, bool toServer, const AuthData
|
||||
return ConnPostBytes(connectionId, &connData);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthConnInit(const AuthConnListener *listener)
|
||||
int32_t AuthConnInit(const AuthConnListener *listener)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(listener, SOFTBUS_INVALID_PARAM);
|
||||
g_listener = *listener;
|
||||
@ -566,7 +566,7 @@ NO_SANITIZE("cfi") int32_t AuthConnInit(const AuthConnListener *listener)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void AuthConnDeinit(void)
|
||||
void AuthConnDeinit(void)
|
||||
{
|
||||
UnsetSocketCallback();
|
||||
ConnUnSetConnectCallback(MODULE_DEVICE_AUTH);
|
||||
@ -574,7 +574,7 @@ NO_SANITIZE("cfi") void AuthConnDeinit(void)
|
||||
(void)memset_s(&g_listener, sizeof(g_listener), 0, sizeof(AuthConnListener));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ConnectAuthDevice(uint32_t requestId, const AuthConnInfo *connInfo, ConnSideType sideType)
|
||||
int32_t ConnectAuthDevice(uint32_t requestId, const AuthConnInfo *connInfo, ConnSideType sideType)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(connInfo, SOFTBUS_INVALID_PARAM);
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "ConnectDevice: requestId=%u, connType=%d, sideType=%d.", requestId,
|
||||
@ -629,7 +629,7 @@ void UpdateAuthDevicePriority(uint64_t connId)
|
||||
GetConnType(connId), GetConnId(connId), ret);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void DisconnectAuthDevice(uint64_t *connId)
|
||||
void DisconnectAuthDevice(uint64_t *connId)
|
||||
{
|
||||
if (connId == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "connId nulptr");
|
||||
@ -655,7 +655,7 @@ NO_SANITIZE("cfi") void DisconnectAuthDevice(uint64_t *connId)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t PostAuthData(uint64_t connId, bool toServer, const AuthDataHead *head, const uint8_t *data)
|
||||
int32_t PostAuthData(uint64_t connId, bool toServer, const AuthDataHead *head, const uint8_t *data)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(head, SOFTBUS_INVALID_PARAM);
|
||||
CHECK_NULL_PTR_RETURN_VALUE(data, SOFTBUS_INVALID_PARAM);
|
||||
@ -676,7 +676,7 @@ NO_SANITIZE("cfi") int32_t PostAuthData(uint64_t connId, bool toServer, const Au
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") ConnSideType GetConnSideType(uint64_t connId)
|
||||
ConnSideType GetConnSideType(uint64_t connId)
|
||||
{
|
||||
if (GetConnType(connId) == AUTH_LINK_TYPE_WIFI) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "WiFi not supported, " CONN_INFO, CONN_DATA(connId));
|
||||
@ -694,7 +694,7 @@ NO_SANITIZE("cfi") ConnSideType GetConnSideType(uint64_t connId)
|
||||
return info.isServer ? CONN_SIDE_SERVER : CONN_SIDE_CLIENT;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool CheckActiveAuthConnection(const AuthConnInfo *connInfo)
|
||||
bool CheckActiveAuthConnection(const AuthConnInfo *connInfo)
|
||||
{
|
||||
ConnectOption connOpt;
|
||||
CHECK_NULL_PTR_RETURN_VALUE(connInfo, false);
|
||||
@ -706,7 +706,7 @@ NO_SANITIZE("cfi") bool CheckActiveAuthConnection(const AuthConnInfo *connInfo)
|
||||
return CheckActiveConnection(&connOpt);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthStartListening(AuthLinkType type, const char *ip, int32_t port)
|
||||
int32_t AuthStartListening(AuthLinkType type, const char *ip, int32_t port)
|
||||
{
|
||||
if (ip == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "invalid param.");
|
||||
@ -754,7 +754,7 @@ NO_SANITIZE("cfi") int32_t AuthStartListening(AuthLinkType type, const char *ip,
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void AuthStopListening(AuthLinkType type)
|
||||
void AuthStopListening(AuthLinkType type)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "stop auth listening, type=%d.", type);
|
||||
switch (type) {
|
||||
|
@ -70,7 +70,7 @@ static char *GenDeviceLevelParam(const char *udid, const char *uid, bool isClien
|
||||
return data;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static bool OnTransmit(int64_t authSeq, const uint8_t *data, uint32_t len)
|
||||
static bool OnTransmit(int64_t authSeq, const uint8_t *data, uint32_t len)
|
||||
{
|
||||
ALOGI("hichain OnTransmit: authSeq=%" PRId64 ", len=%u.", authSeq, len);
|
||||
if (AuthSessionPostAuthData(authSeq, data, len) != SOFTBUS_OK) {
|
||||
@ -80,7 +80,7 @@ NO_SANITIZE("cfi") static bool OnTransmit(int64_t authSeq, const uint8_t *data,
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void OnSessionKeyReturned(int64_t authSeq, const uint8_t *sessionKey, uint32_t sessionKeyLen)
|
||||
static void OnSessionKeyReturned(int64_t authSeq, const uint8_t *sessionKey, uint32_t sessionKeyLen)
|
||||
{
|
||||
ALOGI("hichain OnSessionKeyReturned: authSeq=%" PRId64 ", len=%u.", authSeq, sessionKeyLen);
|
||||
if (sessionKey == NULL || sessionKeyLen > SESSION_KEY_LENGTH) {
|
||||
@ -90,7 +90,7 @@ NO_SANITIZE("cfi") static void OnSessionKeyReturned(int64_t authSeq, const uint8
|
||||
(void)AuthSessionSaveSessionKey(authSeq, sessionKey, sessionKeyLen);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void OnFinish(int64_t authSeq, int operationCode, const char *returnData)
|
||||
static void OnFinish(int64_t authSeq, int operationCode, const char *returnData)
|
||||
{
|
||||
(void)operationCode;
|
||||
(void)returnData;
|
||||
@ -98,7 +98,7 @@ NO_SANITIZE("cfi") static void OnFinish(int64_t authSeq, int operationCode, cons
|
||||
(void)AuthSessionHandleAuthFinish(authSeq);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void OnError(int64_t authSeq, int operationCode, int errCode, const char *errorReturn)
|
||||
static void OnError(int64_t authSeq, int operationCode, int errCode, const char *errorReturn)
|
||||
{
|
||||
(void)operationCode;
|
||||
(void)errorReturn;
|
||||
@ -106,7 +106,7 @@ NO_SANITIZE("cfi") static void OnError(int64_t authSeq, int operationCode, int e
|
||||
(void)AuthSessionHandleAuthError(authSeq, SOFTBUS_AUTH_HICHAIN_AUTH_ERROR);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static char *OnRequest(int64_t authSeq, int operationCode, const char *reqParams)
|
||||
static char *OnRequest(int64_t authSeq, int operationCode, const char *reqParams)
|
||||
{
|
||||
(void)reqParams;
|
||||
ALOGI("hichain OnRequest: authSeq=%" PRId64 ", operationCode=%d.", authSeq, operationCode);
|
||||
@ -171,7 +171,7 @@ static int32_t ParseGroupInfo(const char *groupInfoStr, GroupInfo *groupInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void OnGroupCreated(const char *groupInfo)
|
||||
static void OnGroupCreated(const char *groupInfo)
|
||||
{
|
||||
if (groupInfo == NULL) {
|
||||
ALOGE("invalid group info.");
|
||||
@ -187,7 +187,7 @@ NO_SANITIZE("cfi") static void OnGroupCreated(const char *groupInfo)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void OnDeviceBound(const char *udid, const char *groupInfo)
|
||||
static void OnDeviceBound(const char *udid, const char *groupInfo)
|
||||
{
|
||||
if (udid == NULL || groupInfo == NULL) {
|
||||
ALOGE("invalid udid");
|
||||
@ -199,7 +199,7 @@ NO_SANITIZE("cfi") static void OnDeviceBound(const char *udid, const char *group
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void OnGroupDeleted(const char *groupInfo)
|
||||
static void OnGroupDeleted(const char *groupInfo)
|
||||
{
|
||||
if (groupInfo == NULL) {
|
||||
ALOGE("invalid group info.");
|
||||
@ -215,7 +215,7 @@ NO_SANITIZE("cfi") static void OnGroupDeleted(const char *groupInfo)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void OnDeviceNotTrusted(const char *udid)
|
||||
static void OnDeviceNotTrusted(const char *udid)
|
||||
{
|
||||
if (udid == NULL) {
|
||||
ALOGE("hichain OnDeviceNotTrusted get invalid udid.");
|
||||
@ -229,7 +229,7 @@ NO_SANITIZE("cfi") static void OnDeviceNotTrusted(const char *udid)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t RegTrustDataChangeListener(const TrustDataChangeListener *listener)
|
||||
int32_t RegTrustDataChangeListener(const TrustDataChangeListener *listener)
|
||||
{
|
||||
if (listener == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -249,7 +249,7 @@ NO_SANITIZE("cfi") int32_t RegTrustDataChangeListener(const TrustDataChangeListe
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void UnregTrustDataChangeListener(void)
|
||||
void UnregTrustDataChangeListener(void)
|
||||
{
|
||||
int32_t ret = UnregChangeListener(AUTH_APPID);
|
||||
if (ret != 0) {
|
||||
@ -258,7 +258,7 @@ NO_SANITIZE("cfi") void UnregTrustDataChangeListener(void)
|
||||
(void)memset_s(&g_dataChangeListener, sizeof(TrustDataChangeListener), 0, sizeof(TrustDataChangeListener));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t HichainStartAuth(int64_t authSeq, const char *udid, const char *uid)
|
||||
int32_t HichainStartAuth(int64_t authSeq, const char *udid, const char *uid)
|
||||
{
|
||||
if (udid == NULL || uid == NULL) {
|
||||
ALOGE("udid/uid is invalid.");
|
||||
@ -279,7 +279,7 @@ NO_SANITIZE("cfi") int32_t HichainStartAuth(int64_t authSeq, const char *udid, c
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t HichainProcessData(int64_t authSeq, const uint8_t *data, uint32_t len)
|
||||
int32_t HichainProcessData(int64_t authSeq, const uint8_t *data, uint32_t len)
|
||||
{
|
||||
if (data == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -292,14 +292,14 @@ NO_SANITIZE("cfi") int32_t HichainProcessData(int64_t authSeq, const uint8_t *da
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void HichainDestroy(void)
|
||||
void HichainDestroy(void)
|
||||
{
|
||||
UnregTrustDataChangeListener();
|
||||
DestroyDeviceAuth();
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "hichain destroy succ.");
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void HichainCancelRequest(int64_t authReqId)
|
||||
void HichainCancelRequest(int64_t authReqId)
|
||||
{
|
||||
CancelRequest(authReqId, AUTH_APPID);
|
||||
}
|
@ -55,7 +55,7 @@ static ModuleListener g_moduleListener[] = {
|
||||
}
|
||||
};
|
||||
|
||||
NO_SANITIZE("cfi") int32_t RegAuthTransListener(int32_t module, const AuthTransListener *listener)
|
||||
int32_t RegAuthTransListener(int32_t module, const AuthTransListener *listener)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "AuthTrans: add listener, module = %d.", module);
|
||||
if (listener == NULL || listener->onDataReceived == NULL) {
|
||||
@ -73,7 +73,7 @@ NO_SANITIZE("cfi") int32_t RegAuthTransListener(int32_t module, const AuthTransL
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void UnregAuthTransListener(int32_t module)
|
||||
void UnregAuthTransListener(int32_t module)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "AuthTrans: remove listener, module=%d.", module);
|
||||
for (uint32_t i = 0; i < sizeof(g_moduleListener) / sizeof(ModuleListener); i++) {
|
||||
@ -85,7 +85,7 @@ NO_SANITIZE("cfi") void UnregAuthTransListener(int32_t module)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void NotifyTransDataReceived(int64_t authId,
|
||||
static void NotifyTransDataReceived(int64_t authId,
|
||||
const AuthDataHead *head, const uint8_t *data, uint32_t len)
|
||||
{
|
||||
AuthTransListener *listener = NULL;
|
||||
@ -109,7 +109,7 @@ NO_SANITIZE("cfi") static void NotifyTransDataReceived(int64_t authId,
|
||||
listener->onDataReceived(authId, &transData);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void NotifyTransDisconnected(int64_t authId)
|
||||
static void NotifyTransDisconnected(int64_t authId)
|
||||
{
|
||||
for (uint32_t i = 0; i < sizeof(g_moduleListener) / sizeof(ModuleListener); i++) {
|
||||
if (g_moduleListener[i].listener.onDisconnected != NULL) {
|
||||
@ -118,7 +118,7 @@ NO_SANITIZE("cfi") static void NotifyTransDisconnected(int64_t authId)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthOpenConn(const AuthConnInfo *info, uint32_t requestId, const AuthConnCallback *callback,
|
||||
int32_t AuthOpenConn(const AuthConnInfo *info, uint32_t requestId, const AuthConnCallback *callback,
|
||||
bool isMeta)
|
||||
{
|
||||
if (isMeta) {
|
||||
@ -127,7 +127,7 @@ NO_SANITIZE("cfi") int32_t AuthOpenConn(const AuthConnInfo *info, uint32_t reque
|
||||
return AuthDeviceOpenConn(info, requestId, callback);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthPostTransData(int64_t authId, const AuthTransData *dataInfo)
|
||||
int32_t AuthPostTransData(int64_t authId, const AuthTransData *dataInfo)
|
||||
{
|
||||
AuthManager *auth = GetAuthManagerByAuthId(authId);
|
||||
if (auth != NULL) {
|
||||
@ -137,7 +137,7 @@ NO_SANITIZE("cfi") int32_t AuthPostTransData(int64_t authId, const AuthTransData
|
||||
return AuthMetaPostTransData(authId, dataInfo);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void AuthCloseConn(int64_t authId)
|
||||
void AuthCloseConn(int64_t authId)
|
||||
{
|
||||
AuthManager *auth = GetAuthManagerByAuthId(authId);
|
||||
if (auth != NULL) {
|
||||
@ -148,7 +148,7 @@ NO_SANITIZE("cfi") void AuthCloseConn(int64_t authId)
|
||||
AuthMetaCloseConn(authId);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthGetPreferConnInfo(const char *uuid, AuthConnInfo *connInfo, bool isMeta)
|
||||
int32_t AuthGetPreferConnInfo(const char *uuid, AuthConnInfo *connInfo, bool isMeta)
|
||||
{
|
||||
if (isMeta) {
|
||||
return AuthMetaGetPreferConnInfo(uuid, connInfo);
|
||||
@ -157,7 +157,7 @@ NO_SANITIZE("cfi") int32_t AuthGetPreferConnInfo(const char *uuid, AuthConnInfo
|
||||
}
|
||||
|
||||
/* for ProxyChannel & P2P TcpDirectchannel */
|
||||
NO_SANITIZE("cfi") int64_t AuthGetLatestIdByUuid(const char *uuid, AuthLinkType type, bool isMeta)
|
||||
int64_t AuthGetLatestIdByUuid(const char *uuid, AuthLinkType type, bool isMeta)
|
||||
{
|
||||
if (isMeta) {
|
||||
return AUTH_INVALID_ID;
|
||||
@ -165,7 +165,7 @@ NO_SANITIZE("cfi") int64_t AuthGetLatestIdByUuid(const char *uuid, AuthLinkType
|
||||
return AuthDeviceGetLatestIdByUuid(uuid, type);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int64_t AuthGetIdByConnInfo(const AuthConnInfo *connInfo, bool isServer, bool isMeta)
|
||||
int64_t AuthGetIdByConnInfo(const AuthConnInfo *connInfo, bool isServer, bool isMeta)
|
||||
{
|
||||
if (isMeta) {
|
||||
return AuthMetaGetIdByConnInfo(connInfo, isServer);
|
||||
@ -173,7 +173,7 @@ NO_SANITIZE("cfi") int64_t AuthGetIdByConnInfo(const AuthConnInfo *connInfo, boo
|
||||
return AuthDeviceGetIdByConnInfo(connInfo, isServer);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int64_t AuthGetIdByUuid(const char *uuid, AuthLinkType type, bool isServer, bool isMeta)
|
||||
int64_t AuthGetIdByUuid(const char *uuid, AuthLinkType type, bool isServer, bool isMeta)
|
||||
{
|
||||
if (isMeta) {
|
||||
return AuthMetaGetIdByUuid(uuid, type, isServer);
|
||||
@ -181,7 +181,7 @@ NO_SANITIZE("cfi") int64_t AuthGetIdByUuid(const char *uuid, AuthLinkType type,
|
||||
return AuthDeviceGetIdByUuid(uuid, type, isServer);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthRestoreAuthManager(const char *udidHash,
|
||||
int32_t AuthRestoreAuthManager(const char *udidHash,
|
||||
const AuthConnInfo *connInfo, int32_t requestId, NodeInfo *nodeInfo, int64_t *authId)
|
||||
{
|
||||
if (udidHash == NULL || connInfo == NULL || nodeInfo == NULL || authId == NULL) {
|
||||
@ -222,7 +222,7 @@ NO_SANITIZE("cfi") int32_t AuthRestoreAuthManager(const char *udidHash,
|
||||
return AuthManagerSetSessionKey(keyInfo.keyIndex, &info, &sessionKey, false);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthEncrypt(int64_t authId, const uint8_t *inData, uint32_t inLen, uint8_t *outData,
|
||||
int32_t AuthEncrypt(int64_t authId, const uint8_t *inData, uint32_t inLen, uint8_t *outData,
|
||||
uint32_t *outLen)
|
||||
{
|
||||
AuthManager *auth = GetAuthManagerByAuthId(authId);
|
||||
@ -233,7 +233,7 @@ NO_SANITIZE("cfi") int32_t AuthEncrypt(int64_t authId, const uint8_t *inData, ui
|
||||
return AuthMetaEncrypt(authId, inData, inLen, outData, outLen);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthDecrypt(int64_t authId, const uint8_t *inData, uint32_t inLen, uint8_t *outData,
|
||||
int32_t AuthDecrypt(int64_t authId, const uint8_t *inData, uint32_t inLen, uint8_t *outData,
|
||||
uint32_t *outLen)
|
||||
{
|
||||
AuthManager *auth = GetAuthManagerByAuthId(authId);
|
||||
@ -244,7 +244,7 @@ NO_SANITIZE("cfi") int32_t AuthDecrypt(int64_t authId, const uint8_t *inData, ui
|
||||
return AuthMetaDecrypt(authId, inData, inLen, outData, outLen);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthSetP2pMac(int64_t authId, const char *p2pMac)
|
||||
int32_t AuthSetP2pMac(int64_t authId, const char *p2pMac)
|
||||
{
|
||||
AuthManager *auth = GetAuthManagerByAuthId(authId);
|
||||
if (auth != NULL) {
|
||||
@ -254,7 +254,7 @@ NO_SANITIZE("cfi") int32_t AuthSetP2pMac(int64_t authId, const char *p2pMac)
|
||||
return AuthMetaSetP2pMac(authId, p2pMac);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthGetConnInfo(int64_t authId, AuthConnInfo *connInfo)
|
||||
int32_t AuthGetConnInfo(int64_t authId, AuthConnInfo *connInfo)
|
||||
{
|
||||
AuthManager *auth = GetAuthManagerByAuthId(authId);
|
||||
if (auth != NULL) {
|
||||
@ -264,7 +264,7 @@ NO_SANITIZE("cfi") int32_t AuthGetConnInfo(int64_t authId, AuthConnInfo *connInf
|
||||
return AuthMetaGetConnInfo(authId, connInfo);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthGetDeviceUuid(int64_t authId, char *uuid, uint16_t size)
|
||||
int32_t AuthGetDeviceUuid(int64_t authId, char *uuid, uint16_t size)
|
||||
{
|
||||
AuthManager *auth = GetAuthManagerByAuthId(authId);
|
||||
if (auth != NULL) {
|
||||
@ -274,12 +274,12 @@ NO_SANITIZE("cfi") int32_t AuthGetDeviceUuid(int64_t authId, char *uuid, uint16_
|
||||
return AuthMetaGetDeviceUuid(authId, uuid, size);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthGetVersion(int64_t authId, SoftBusVersion *version)
|
||||
int32_t AuthGetVersion(int64_t authId, SoftBusVersion *version)
|
||||
{
|
||||
return AuthDeviceGetVersion(authId, version);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthGetServerSide(int64_t authId, bool *isServer)
|
||||
int32_t AuthGetServerSide(int64_t authId, bool *isServer)
|
||||
{
|
||||
AuthManager *auth = GetAuthManagerByAuthId(authId);
|
||||
if (auth != NULL) {
|
||||
@ -289,7 +289,7 @@ NO_SANITIZE("cfi") int32_t AuthGetServerSide(int64_t authId, bool *isServer)
|
||||
return AuthMetaGetServerSide(authId, isServer);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthGetMetaType(int64_t authId, bool *isMetaAuth)
|
||||
int32_t AuthGetMetaType(int64_t authId, bool *isMetaAuth)
|
||||
{
|
||||
if (isMetaAuth == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "invalid param.");
|
||||
@ -305,7 +305,7 @@ NO_SANITIZE("cfi") int32_t AuthGetMetaType(int64_t authId, bool *isMetaAuth)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthGetGroupType(const char *udid, const char *uuid)
|
||||
int32_t AuthGetGroupType(const char *udid, const char *uuid)
|
||||
{
|
||||
int32_t type = 0;
|
||||
if (udid == NULL || uuid == NULL) {
|
||||
@ -319,7 +319,7 @@ NO_SANITIZE("cfi") int32_t AuthGetGroupType(const char *udid, const char *uuid)
|
||||
return type;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool AuthIsPotentialTrusted(const DeviceInfo *device, bool validAccount)
|
||||
bool AuthIsPotentialTrusted(const DeviceInfo *device, bool validAccount)
|
||||
{
|
||||
uint8_t localAccountHash[SHA_256_HASH_LEN] = {0};
|
||||
DeviceInfo defaultInfo;
|
||||
@ -351,7 +351,7 @@ NO_SANITIZE("cfi") bool AuthIsPotentialTrusted(const DeviceInfo *device, bool va
|
||||
return false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") TrustedReturnType AuthHasTrustedRelation(void)
|
||||
TrustedReturnType AuthHasTrustedRelation(void)
|
||||
{
|
||||
uint32_t num = 0;
|
||||
char *udidArray = NULL;
|
||||
@ -394,7 +394,7 @@ void AuthDeleteStoredAuthKey(const char *udid, int32_t discoveryType)
|
||||
AuthRemoveDeviceKey(udid, (int32_t)linkType);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthInit(void)
|
||||
int32_t AuthInit(void)
|
||||
{
|
||||
AuthTransCallback callBack = {
|
||||
.OnDataReceived = NotifyTransDataReceived,
|
||||
@ -409,13 +409,13 @@ NO_SANITIZE("cfi") int32_t AuthInit(void)
|
||||
return AuthMetaInit(&callBack);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void AuthDeinit(void)
|
||||
void AuthDeinit(void)
|
||||
{
|
||||
AuthDeviceDeinit();
|
||||
AuthMetaDeinit();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void AuthServerDeathCallback(const char *pkgName, int32_t pid)
|
||||
void AuthServerDeathCallback(const char *pkgName, int32_t pid)
|
||||
{
|
||||
DelAuthMetaManagerByPid(pkgName, pid);
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ static AuthTransCallback g_transCallback = { 0 };
|
||||
static bool g_regDataChangeListener = false;
|
||||
|
||||
/* Auth Manager */
|
||||
NO_SANITIZE("cfi") AuthManager *NewAuthManager(int64_t authSeq, const AuthSessionInfo *info)
|
||||
AuthManager *NewAuthManager(int64_t authSeq, const AuthSessionInfo *info)
|
||||
{
|
||||
AuthManager *auth = (AuthManager *)SoftBusMalloc(sizeof(AuthManager));
|
||||
if (auth == NULL) {
|
||||
@ -98,7 +98,7 @@ static AuthManager *DupAuthManager(const AuthManager *auth)
|
||||
return newAuth;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void DelAuthManager(AuthManager *auth, bool removeAuthFromList)
|
||||
void DelAuthManager(AuthManager *auth, bool removeAuthFromList)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VOID(auth);
|
||||
if (removeAuthFromList) {
|
||||
@ -219,13 +219,13 @@ static void DestroyAuthManagerList(void)
|
||||
ReleaseAuthLock();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t SetAuthConnId(AuthManager *auth, const AuthManager *inAuth)
|
||||
static int32_t SetAuthConnId(AuthManager *auth, const AuthManager *inAuth)
|
||||
{
|
||||
auth->connId = inAuth->connId;
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t SetAuthP2pMac(AuthManager *auth, const AuthManager *inAuth)
|
||||
static int32_t SetAuthP2pMac(AuthManager *auth, const AuthManager *inAuth)
|
||||
{
|
||||
if (strcpy_s(auth->p2pMac, sizeof(auth->p2pMac), inAuth->p2pMac) != EOK) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "copy auth p2p mac fail, authId=%" PRId64, auth->authId);
|
||||
@ -298,7 +298,7 @@ void RemoveAuthSessionKeyByIndex(int64_t authId, int32_t index)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void RemoveAuthManagerByAuthId(int64_t authId)
|
||||
void RemoveAuthManagerByAuthId(int64_t authId)
|
||||
{
|
||||
if (!RequireAuthLock()) {
|
||||
return;
|
||||
@ -371,7 +371,7 @@ static int32_t GetAuthConnInfoByUuid(const char *uuid, AuthLinkType type, AuthCo
|
||||
}
|
||||
|
||||
/* Note: must call DelAuthManager(auth, false) to free. */
|
||||
NO_SANITIZE("cfi") AuthManager *GetAuthManagerByAuthId(int64_t authId)
|
||||
AuthManager *GetAuthManagerByAuthId(int64_t authId)
|
||||
{
|
||||
if (!RequireAuthLock()) {
|
||||
return NULL;
|
||||
@ -508,7 +508,7 @@ static int64_t GetActiveAuthIdByConnInfo(const AuthConnInfo *connInfo)
|
||||
return authId;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi")
|
||||
|
||||
int32_t AuthManagerSetSessionKey(int64_t authSeq, const AuthSessionInfo *info,
|
||||
const SessionKey *sessionKey, bool isConnect)
|
||||
{
|
||||
@ -569,7 +569,7 @@ int32_t AuthManagerSetSessionKey(int64_t authSeq, const AuthSessionInfo *info,
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi")
|
||||
|
||||
int32_t AuthManagerGetSessionKey(int64_t authSeq, const AuthSessionInfo *info, SessionKey *sessionKey)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(info, SOFTBUS_INVALID_PARAM);
|
||||
@ -595,7 +595,7 @@ int32_t AuthManagerGetSessionKey(int64_t authSeq, const AuthSessionInfo *info, S
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void NotifyDeviceVerifyPassed(int64_t authId, const NodeInfo *nodeInfo)
|
||||
static void NotifyDeviceVerifyPassed(int64_t authId, const NodeInfo *nodeInfo)
|
||||
{
|
||||
AuthManager *auth = GetAuthManagerByAuthId(authId);
|
||||
if (auth == NULL) {
|
||||
@ -616,7 +616,7 @@ NO_SANITIZE("cfi") static void NotifyDeviceVerifyPassed(int64_t authId, const No
|
||||
g_verifyListener.onDeviceVerifyPass(authId, nodeInfo);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void NotifyDeviceDisconnect(int64_t authId)
|
||||
static void NotifyDeviceDisconnect(int64_t authId)
|
||||
{
|
||||
if (g_verifyListener.onDeviceDisconnect == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_WARN, "onDeviceDisconnect not set.");
|
||||
@ -625,7 +625,7 @@ NO_SANITIZE("cfi") static void NotifyDeviceDisconnect(int64_t authId)
|
||||
g_verifyListener.onDeviceDisconnect(authId);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void OnDeviceNotTrusted(const char *peerUdid)
|
||||
static void OnDeviceNotTrusted(const char *peerUdid)
|
||||
{
|
||||
RemoveNotPassedAuthManagerByUdid(peerUdid);
|
||||
AuthSessionHandleDeviceNotTrusted(peerUdid);
|
||||
@ -639,21 +639,21 @@ NO_SANITIZE("cfi") static void OnDeviceNotTrusted(const char *peerUdid)
|
||||
AuthRemoveDeviceKeyByUdid(peerUdid);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void OnGroupCreated(const char *groupId, int32_t groupType)
|
||||
static void OnGroupCreated(const char *groupId, int32_t groupType)
|
||||
{
|
||||
if (g_groupChangeListener.onGroupCreated != NULL) {
|
||||
g_groupChangeListener.onGroupCreated(groupId, groupType);
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void OnGroupDeleted(const char *groupId)
|
||||
static void OnGroupDeleted(const char *groupId)
|
||||
{
|
||||
if (g_groupChangeListener.onGroupDeleted != NULL) {
|
||||
g_groupChangeListener.onGroupDeleted(groupId);
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void OnDeviceBound(const char *udid, const char *groupInfo)
|
||||
static void OnDeviceBound(const char *udid, const char *groupInfo)
|
||||
{
|
||||
LnnInsertSpecificTrustedDevInfo(udid);
|
||||
if (g_groupChangeListener.onDeviceBound != NULL) {
|
||||
@ -766,7 +766,7 @@ static int32_t StartReconnectDevice(
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void ReportAuthRequestPassed(uint32_t requestId, int64_t authId, const NodeInfo *nodeInfo)
|
||||
static void ReportAuthRequestPassed(uint32_t requestId, int64_t authId, const NodeInfo *nodeInfo)
|
||||
{
|
||||
AuthRequest request;
|
||||
if (GetAuthRequest(requestId, &request) != SOFTBUS_OK) {
|
||||
@ -831,7 +831,7 @@ static int32_t ComplementConnectionInfoIfNeed(AuthManager *auth, const char *udi
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void AuthManagerSetAuthPassed(int64_t authSeq, const AuthSessionInfo *info)
|
||||
void AuthManagerSetAuthPassed(int64_t authSeq, const AuthSessionInfo *info)
|
||||
{
|
||||
int64_t authId;
|
||||
CHECK_NULL_PTR_RETURN_VOID(info);
|
||||
@ -874,7 +874,7 @@ NO_SANITIZE("cfi") void AuthManagerSetAuthPassed(int64_t authSeq, const AuthSess
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void AuthManagerSetAuthFailed(int64_t authSeq, const AuthSessionInfo *info, int32_t reason)
|
||||
void AuthManagerSetAuthFailed(int64_t authSeq, const AuthSessionInfo *info, int32_t reason)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "SetAuthFailed: authSeq=%" PRId64 ", requestId=%u, reason=%d.",
|
||||
authSeq, info->requestId, reason);
|
||||
@ -1134,7 +1134,7 @@ static void HandleCloseAckData(
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi")
|
||||
|
||||
static void HandleConnectionData(
|
||||
uint64_t connId, const AuthConnInfo *connInfo, bool fromServer, const AuthDataHead *head, const uint8_t *data)
|
||||
{
|
||||
@ -1198,7 +1198,7 @@ static void OnDataReceived(
|
||||
SoftbusHitraceStop();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void HandleDisconnectedEvent(const void *para)
|
||||
static void HandleDisconnectedEvent(const void *para)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VOID(para);
|
||||
uint64_t connId = *((uint64_t *)para);
|
||||
@ -1232,7 +1232,7 @@ static void OnDisconnected(uint64_t connId, const AuthConnInfo *connInfo)
|
||||
(void)PostAuthEvent(EVENT_AUTH_DISCONNECT, HandleDisconnectedEvent, &connId, sizeof(connId), 0);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t RegAuthVerifyListener(const AuthVerifyListener *listener)
|
||||
int32_t RegAuthVerifyListener(const AuthVerifyListener *listener)
|
||||
{
|
||||
if (listener == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "invalid listener.");
|
||||
@ -1242,17 +1242,17 @@ NO_SANITIZE("cfi") int32_t RegAuthVerifyListener(const AuthVerifyListener *liste
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void UnregAuthVerifyListener(void)
|
||||
void UnregAuthVerifyListener(void)
|
||||
{
|
||||
(void)memset_s(&g_verifyListener, sizeof(AuthVerifyListener), 0, sizeof(AuthVerifyListener));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") uint32_t AuthGenRequestId(void)
|
||||
uint32_t AuthGenRequestId(void)
|
||||
{
|
||||
return ConnGetNewRequestId(MODULE_DEVICE_AUTH);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi")
|
||||
|
||||
int32_t AuthStartVerify(const AuthConnInfo *connInfo, uint32_t requestId,
|
||||
const AuthVerifyCallback *callback, bool isFastAuth)
|
||||
{
|
||||
@ -1263,7 +1263,7 @@ int32_t AuthStartVerify(const AuthConnInfo *connInfo, uint32_t requestId,
|
||||
return StartVerifyDevice(requestId, connInfo, callback, NULL, isFastAuth);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void AuthHandleLeaveLNN(int64_t authId)
|
||||
void AuthHandleLeaveLNN(int64_t authId)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "auth handle leave LNN, authId=%" PRId64, authId);
|
||||
if (!RequireAuthLock()) {
|
||||
@ -1287,7 +1287,7 @@ NO_SANITIZE("cfi") void AuthHandleLeaveLNN(int64_t authId)
|
||||
ReleaseAuthLock();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthFlushDevice(const char *uuid)
|
||||
int32_t AuthFlushDevice(const char *uuid)
|
||||
{
|
||||
if (uuid == NULL || uuid[0] == '\0') {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "uuid is empty.");
|
||||
@ -1340,7 +1340,7 @@ static int32_t TryGetBrConnInfo(const char *uuid, AuthConnInfo *connInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthDeviceGetPreferConnInfo(const char *uuid, AuthConnInfo *connInfo)
|
||||
int32_t AuthDeviceGetPreferConnInfo(const char *uuid, AuthConnInfo *connInfo)
|
||||
{
|
||||
if (uuid == NULL || uuid[0] == '\0' || connInfo == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "invalid uuid or connInfo.");
|
||||
@ -1377,7 +1377,7 @@ bool AuthDeviceCheckConnInfo(const char *uuid, AuthLinkType type, bool checkConn
|
||||
return checkConnection ? CheckActiveAuthConnection(&connInfo) : true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi")
|
||||
|
||||
int32_t AuthDeviceOpenConn(const AuthConnInfo *info, uint32_t requestId, const AuthConnCallback *callback)
|
||||
{
|
||||
if (info == NULL || !CheckAuthConnCallback(callback)) {
|
||||
@ -1412,7 +1412,7 @@ int32_t AuthDeviceOpenConn(const AuthConnInfo *info, uint32_t requestId, const A
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void AuthDeviceCloseConn(int64_t authId)
|
||||
void AuthDeviceCloseConn(int64_t authId)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "close auth conn: authId=%" PRId64, authId);
|
||||
AuthManager *auth = GetAuthManagerByAuthId(authId);
|
||||
@ -1435,7 +1435,7 @@ NO_SANITIZE("cfi") void AuthDeviceCloseConn(int64_t authId)
|
||||
return;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthDevicePostTransData(int64_t authId, const AuthTransData *dataInfo)
|
||||
int32_t AuthDevicePostTransData(int64_t authId, const AuthTransData *dataInfo)
|
||||
{
|
||||
if (dataInfo == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "dataInfo is null.");
|
||||
@ -1467,7 +1467,7 @@ NO_SANITIZE("cfi") int32_t AuthDevicePostTransData(int64_t authId, const AuthTra
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t RegGroupChangeListener(const GroupChangeListener *listener)
|
||||
int32_t RegGroupChangeListener(const GroupChangeListener *listener)
|
||||
{
|
||||
if (listener == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -1478,7 +1478,7 @@ NO_SANITIZE("cfi") int32_t RegGroupChangeListener(const GroupChangeListener *lis
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void UnregGroupChangeListener(void)
|
||||
void UnregGroupChangeListener(void)
|
||||
{
|
||||
g_groupChangeListener.onGroupCreated = NULL;
|
||||
g_groupChangeListener.onGroupDeleted = NULL;
|
||||
@ -1525,7 +1525,7 @@ int32_t AuthGetLatestAuthSeqList(const char *udid, int64_t *seqList, uint32_t nu
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int64_t AuthDeviceGetLatestIdByUuid(const char *uuid, AuthLinkType type)
|
||||
int64_t AuthDeviceGetLatestIdByUuid(const char *uuid, AuthLinkType type)
|
||||
{
|
||||
if (uuid == NULL || uuid[0] == '\0') {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "uuid is empty.");
|
||||
@ -1560,7 +1560,7 @@ NO_SANITIZE("cfi") int64_t AuthDeviceGetLatestIdByUuid(const char *uuid, AuthLin
|
||||
return latestAuthId;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int64_t AuthDeviceGetIdByConnInfo(const AuthConnInfo *connInfo, bool isServer)
|
||||
int64_t AuthDeviceGetIdByConnInfo(const AuthConnInfo *connInfo, bool isServer)
|
||||
{
|
||||
if (connInfo == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "connInfo is null.");
|
||||
@ -1569,7 +1569,7 @@ NO_SANITIZE("cfi") int64_t AuthDeviceGetIdByConnInfo(const AuthConnInfo *connInf
|
||||
return GetAuthIdByConnInfo(connInfo, isServer);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int64_t AuthDeviceGetIdByUuid(const char *uuid, AuthLinkType type, bool isServer)
|
||||
int64_t AuthDeviceGetIdByUuid(const char *uuid, AuthLinkType type, bool isServer)
|
||||
{
|
||||
if (uuid == NULL || uuid[0] == '\0') {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "uuid is empty.");
|
||||
@ -1590,12 +1590,12 @@ NO_SANITIZE("cfi") int64_t AuthDeviceGetIdByUuid(const char *uuid, AuthLinkType
|
||||
return authId;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") uint32_t AuthGetEncryptSize(uint32_t inLen)
|
||||
uint32_t AuthGetEncryptSize(uint32_t inLen)
|
||||
{
|
||||
return inLen + ENCRYPT_OVER_HEAD_LEN;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") uint32_t AuthGetDecryptSize(uint32_t inLen)
|
||||
uint32_t AuthGetDecryptSize(uint32_t inLen)
|
||||
{
|
||||
if (inLen <= OVERHEAD_LEN) {
|
||||
return inLen;
|
||||
@ -1603,7 +1603,7 @@ NO_SANITIZE("cfi") uint32_t AuthGetDecryptSize(uint32_t inLen)
|
||||
return inLen - OVERHEAD_LEN;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi")
|
||||
|
||||
int32_t AuthDeviceEncrypt(int64_t authId, const uint8_t *inData, uint32_t inLen, uint8_t *outData, uint32_t *outLen)
|
||||
{
|
||||
if (inData == NULL || inLen == 0 || outData == NULL || outLen == NULL || *outLen < AuthGetEncryptSize(inLen)) {
|
||||
@ -1623,7 +1623,7 @@ int32_t AuthDeviceEncrypt(int64_t authId, const uint8_t *inData, uint32_t inLen,
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi")
|
||||
|
||||
int32_t AuthDeviceDecrypt(int64_t authId, const uint8_t *inData, uint32_t inLen, uint8_t *outData, uint32_t *outLen)
|
||||
{
|
||||
if (inData == NULL || inLen == 0 || outData == NULL || outLen == NULL || *outLen < AuthGetDecryptSize(inLen)) {
|
||||
@ -1643,7 +1643,7 @@ int32_t AuthDeviceDecrypt(int64_t authId, const uint8_t *inData, uint32_t inLen,
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthDeviceSetP2pMac(int64_t authId, const char *p2pMac)
|
||||
int32_t AuthDeviceSetP2pMac(int64_t authId, const char *p2pMac)
|
||||
{
|
||||
if (p2pMac == NULL || p2pMac[0] == '\0') {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "p2pMac is empty.");
|
||||
@ -1657,7 +1657,7 @@ NO_SANITIZE("cfi") int32_t AuthDeviceSetP2pMac(int64_t authId, const char *p2pMa
|
||||
return UpdateAuthManagerByAuthId(authId, SetAuthP2pMac, &inAuth);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthDeviceGetConnInfo(int64_t authId, AuthConnInfo *connInfo)
|
||||
int32_t AuthDeviceGetConnInfo(int64_t authId, AuthConnInfo *connInfo)
|
||||
{
|
||||
if (connInfo == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "connInfo is null.");
|
||||
@ -1672,7 +1672,7 @@ NO_SANITIZE("cfi") int32_t AuthDeviceGetConnInfo(int64_t authId, AuthConnInfo *c
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthDeviceGetServerSide(int64_t authId, bool *isServer)
|
||||
int32_t AuthDeviceGetServerSide(int64_t authId, bool *isServer)
|
||||
{
|
||||
if (isServer == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "isServer is null.");
|
||||
@ -1687,7 +1687,7 @@ NO_SANITIZE("cfi") int32_t AuthDeviceGetServerSide(int64_t authId, bool *isServe
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthDeviceGetDeviceUuid(int64_t authId, char *uuid, uint16_t size)
|
||||
int32_t AuthDeviceGetDeviceUuid(int64_t authId, char *uuid, uint16_t size)
|
||||
{
|
||||
if (uuid == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "uuid is empty.");
|
||||
@ -1706,7 +1706,7 @@ NO_SANITIZE("cfi") int32_t AuthDeviceGetDeviceUuid(int64_t authId, char *uuid, u
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthDeviceGetVersion(int64_t authId, SoftBusVersion *version)
|
||||
int32_t AuthDeviceGetVersion(int64_t authId, SoftBusVersion *version)
|
||||
{
|
||||
if (version == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "version is null.");
|
||||
@ -1721,7 +1721,7 @@ NO_SANITIZE("cfi") int32_t AuthDeviceGetVersion(int64_t authId, SoftBusVersion *
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthDeviceInit(const AuthTransCallback *callback)
|
||||
int32_t AuthDeviceInit(const AuthTransCallback *callback)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "auth init enter.");
|
||||
if (callback == NULL) {
|
||||
@ -1763,7 +1763,7 @@ NO_SANITIZE("cfi") int32_t AuthDeviceInit(const AuthTransCallback *callback)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void AuthDeviceDeinit(void)
|
||||
void AuthDeviceDeinit(void)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "auth deinit enter.");
|
||||
UnregTrustDataChangeListener();
|
||||
|
@ -64,7 +64,7 @@ static uint32_t GetAuthRequestWaitNum(AuthRequest *request)
|
||||
return num;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") uint32_t AddAuthRequest(const AuthRequest *request)
|
||||
uint32_t AddAuthRequest(const AuthRequest *request)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(request, 0);
|
||||
AuthRequest *newRequest = SoftBusCalloc(sizeof(AuthRequest));
|
||||
@ -83,7 +83,7 @@ NO_SANITIZE("cfi") uint32_t AddAuthRequest(const AuthRequest *request)
|
||||
return waitNum;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t GetAuthRequest(uint32_t requestId, AuthRequest *request)
|
||||
int32_t GetAuthRequest(uint32_t requestId, AuthRequest *request)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(request, SOFTBUS_INVALID_PARAM);
|
||||
if (!RequireAuthLock()) {
|
||||
@ -99,7 +99,7 @@ NO_SANITIZE("cfi") int32_t GetAuthRequest(uint32_t requestId, AuthRequest *reque
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t GetAuthRequestNoLock(uint32_t requestId, AuthRequest *request)
|
||||
int32_t GetAuthRequestNoLock(uint32_t requestId, AuthRequest *request)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(request, SOFTBUS_INVALID_PARAM);
|
||||
AuthRequest *item = FindAuthRequestByRequestId(requestId);
|
||||
@ -110,7 +110,7 @@ NO_SANITIZE("cfi") int32_t GetAuthRequestNoLock(uint32_t requestId, AuthRequest
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t FindAuthRequestByConnInfo(const AuthConnInfo *connInfo, AuthRequest *request)
|
||||
int32_t FindAuthRequestByConnInfo(const AuthConnInfo *connInfo, AuthRequest *request)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(connInfo, SOFTBUS_INVALID_PARAM);
|
||||
CHECK_NULL_PTR_RETURN_VALUE(request, SOFTBUS_INVALID_PARAM);
|
||||
@ -131,7 +131,7 @@ NO_SANITIZE("cfi") int32_t FindAuthRequestByConnInfo(const AuthConnInfo *connInf
|
||||
return SOFTBUS_NOT_FIND;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t FindAndDelAuthRequestByConnInfo(uint32_t requestId, const AuthConnInfo *connInfo)
|
||||
int32_t FindAndDelAuthRequestByConnInfo(uint32_t requestId, const AuthConnInfo *connInfo)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(connInfo, SOFTBUS_INVALID_PARAM);
|
||||
if (!RequireAuthLock()) {
|
||||
@ -160,7 +160,7 @@ NO_SANITIZE("cfi") int32_t FindAndDelAuthRequestByConnInfo(uint32_t requestId, c
|
||||
return SOFTBUS_NOT_FIND;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void DelAuthRequest(uint32_t requestId)
|
||||
void DelAuthRequest(uint32_t requestId)
|
||||
{
|
||||
if (!RequireAuthLock()) {
|
||||
return;
|
||||
@ -176,7 +176,7 @@ NO_SANITIZE("cfi") void DelAuthRequest(uint32_t requestId)
|
||||
ReleaseAuthLock();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void ClearAuthRequest(void)
|
||||
void ClearAuthRequest(void)
|
||||
{
|
||||
if (!RequireAuthLock()) {
|
||||
return;
|
||||
@ -191,7 +191,7 @@ NO_SANITIZE("cfi") void ClearAuthRequest(void)
|
||||
ReleaseAuthLock();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool CheckVerifyCallback(const AuthVerifyCallback *verifyCb)
|
||||
bool CheckVerifyCallback(const AuthVerifyCallback *verifyCb)
|
||||
{
|
||||
if (verifyCb == NULL) {
|
||||
return false;
|
||||
@ -202,7 +202,7 @@ NO_SANITIZE("cfi") bool CheckVerifyCallback(const AuthVerifyCallback *verifyCb)
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool CheckAuthConnCallback(const AuthConnCallback *connCb)
|
||||
bool CheckAuthConnCallback(const AuthConnCallback *connCb)
|
||||
{
|
||||
if (connCb == NULL) {
|
||||
return false;
|
||||
@ -229,7 +229,7 @@ void PerformVerifyCallback(uint32_t requestId, int32_t result, int64_t authId, c
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void PerformAuthConnCallback(uint32_t requestId, int32_t result, int64_t authId)
|
||||
void PerformAuthConnCallback(uint32_t requestId, int32_t result, int64_t authId)
|
||||
{
|
||||
AuthRequest request;
|
||||
if (GetAuthRequest(requestId, &request) != SOFTBUS_OK) {
|
||||
|
@ -215,7 +215,7 @@ static void DestroyAuthFsm(AuthFsm *authFsm)
|
||||
SoftBusFree(authFsm);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void AuthFsmDeinitCallback(FsmStateMachine *fsm)
|
||||
static void AuthFsmDeinitCallback(FsmStateMachine *fsm)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "auth fsm deinit callback enter");
|
||||
if (fsm == NULL) {
|
||||
@ -887,7 +887,7 @@ static void SetAuthStartTime(AuthFsm *authFsm)
|
||||
authFsm->statisticData.startAuthTime = LnnUpTimeMs();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthSessionStartAuth(int64_t authSeq, uint32_t requestId,
|
||||
int32_t AuthSessionStartAuth(int64_t authSeq, uint32_t requestId,
|
||||
uint64_t connId, const AuthConnInfo *connInfo, bool isServer, bool isFastAuth)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(connInfo, SOFTBUS_INVALID_PARAM);
|
||||
@ -912,7 +912,7 @@ NO_SANITIZE("cfi") int32_t AuthSessionStartAuth(int64_t authSeq, uint32_t reques
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthSessionProcessDevIdData(int64_t authSeq, const uint8_t *data, uint32_t len)
|
||||
int32_t AuthSessionProcessDevIdData(int64_t authSeq, const uint8_t *data, uint32_t len)
|
||||
{
|
||||
if (data == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -920,7 +920,7 @@ NO_SANITIZE("cfi") int32_t AuthSessionProcessDevIdData(int64_t authSeq, const ui
|
||||
return PostMessageToAuthFsm(FSM_MSG_RECV_DEVICE_ID, authSeq, data, len);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthSessionPostAuthData(int64_t authSeq, const uint8_t *data, uint32_t len)
|
||||
int32_t AuthSessionPostAuthData(int64_t authSeq, const uint8_t *data, uint32_t len)
|
||||
{
|
||||
AuthSessionInfo info;
|
||||
if (GetSessionInfoFromAuthFsm(authSeq, &info) != SOFTBUS_OK) {
|
||||
@ -932,7 +932,7 @@ NO_SANITIZE("cfi") int32_t AuthSessionPostAuthData(int64_t authSeq, const uint8_
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthSessionProcessAuthData(int64_t authSeq, const uint8_t *data, uint32_t len)
|
||||
int32_t AuthSessionProcessAuthData(int64_t authSeq, const uint8_t *data, uint32_t len)
|
||||
{
|
||||
if (data == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -940,7 +940,7 @@ NO_SANITIZE("cfi") int32_t AuthSessionProcessAuthData(int64_t authSeq, const uin
|
||||
return PostMessageToAuthFsm(FSM_MSG_RECV_AUTH_DATA, authSeq, data, len);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthSessionGetUdid(int64_t authSeq, char *udid, uint32_t size)
|
||||
int32_t AuthSessionGetUdid(int64_t authSeq, char *udid, uint32_t size)
|
||||
{
|
||||
if (udid == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -956,7 +956,7 @@ NO_SANITIZE("cfi") int32_t AuthSessionGetUdid(int64_t authSeq, char *udid, uint3
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthSessionSaveSessionKey(int64_t authSeq, const uint8_t *key, uint32_t len)
|
||||
int32_t AuthSessionSaveSessionKey(int64_t authSeq, const uint8_t *key, uint32_t len)
|
||||
{
|
||||
if (key == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -964,17 +964,17 @@ NO_SANITIZE("cfi") int32_t AuthSessionSaveSessionKey(int64_t authSeq, const uint
|
||||
return PostMessageToAuthFsm(FSM_MSG_SAVE_SESSION_KEY, authSeq, key, len);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthSessionHandleAuthFinish(int64_t authSeq)
|
||||
int32_t AuthSessionHandleAuthFinish(int64_t authSeq)
|
||||
{
|
||||
return PostMessageToAuthFsm(FSM_MSG_AUTH_FINISH, authSeq, NULL, 0);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthSessionHandleAuthError(int64_t authSeq, int32_t reason)
|
||||
int32_t AuthSessionHandleAuthError(int64_t authSeq, int32_t reason)
|
||||
{
|
||||
return PostMessageToAuthFsm(FSM_MSG_AUTH_ERROR, authSeq, (uint8_t *)&reason, sizeof(reason));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthSessionProcessDevInfoData(int64_t authSeq, const uint8_t *data, uint32_t len)
|
||||
int32_t AuthSessionProcessDevInfoData(int64_t authSeq, const uint8_t *data, uint32_t len)
|
||||
{
|
||||
if (data == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -982,7 +982,7 @@ NO_SANITIZE("cfi") int32_t AuthSessionProcessDevInfoData(int64_t authSeq, const
|
||||
return PostMessageToAuthFsm(FSM_MSG_RECV_DEVICE_INFO, authSeq, data, len);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthSessionProcessCloseAck(int64_t authSeq, const uint8_t *data, uint32_t len)
|
||||
int32_t AuthSessionProcessCloseAck(int64_t authSeq, const uint8_t *data, uint32_t len)
|
||||
{
|
||||
if (data == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -990,7 +990,7 @@ NO_SANITIZE("cfi") int32_t AuthSessionProcessCloseAck(int64_t authSeq, const uin
|
||||
return PostMessageToAuthFsm(FSM_MSG_RECV_CLOSE_ACK, authSeq, data, len);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthSessionProcessDevInfoDataByConnId(uint64_t connId, bool isServer, const uint8_t *data,
|
||||
int32_t AuthSessionProcessDevInfoDataByConnId(uint64_t connId, bool isServer, const uint8_t *data,
|
||||
uint32_t len)
|
||||
{
|
||||
if (data == NULL) {
|
||||
@ -999,7 +999,7 @@ NO_SANITIZE("cfi") int32_t AuthSessionProcessDevInfoDataByConnId(uint64_t connId
|
||||
return PostMessageToAuthFsmByConnId(FSM_MSG_RECV_DEVICE_INFO, connId, isServer, data, len);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthSessionProcessCloseAckByConnId(uint64_t connId, bool isServer, const uint8_t *data,
|
||||
int32_t AuthSessionProcessCloseAckByConnId(uint64_t connId, bool isServer, const uint8_t *data,
|
||||
uint32_t len)
|
||||
{
|
||||
if (data == NULL) {
|
||||
@ -1008,7 +1008,7 @@ NO_SANITIZE("cfi") int32_t AuthSessionProcessCloseAckByConnId(uint64_t connId, b
|
||||
return PostMessageToAuthFsmByConnId(FSM_MSG_RECV_CLOSE_ACK, connId, isServer, data, len);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthSessionHandleDeviceNotTrusted(const char *udid)
|
||||
int32_t AuthSessionHandleDeviceNotTrusted(const char *udid)
|
||||
{
|
||||
if (udid == NULL || udid[0] == '\0') {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -1032,7 +1032,7 @@ NO_SANITIZE("cfi") int32_t AuthSessionHandleDeviceNotTrusted(const char *udid)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthSessionHandleDeviceDisconnected(uint64_t connId)
|
||||
int32_t AuthSessionHandleDeviceDisconnected(uint64_t connId)
|
||||
{
|
||||
if (!RequireAuthLock()) {
|
||||
return SOFTBUS_LOCK_ERR;
|
||||
@ -1052,7 +1052,7 @@ NO_SANITIZE("cfi") int32_t AuthSessionHandleDeviceDisconnected(uint64_t connId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void AuthSessionFsmExit(void)
|
||||
void AuthSessionFsmExit(void)
|
||||
{
|
||||
HichainDestroy();
|
||||
if (!RequireAuthLock()) {
|
||||
|
@ -54,13 +54,13 @@ static void RemoveOldKey(SessionKeyList *list)
|
||||
SoftBusFree(item);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void InitSessionKeyList(SessionKeyList *list)
|
||||
void InitSessionKeyList(SessionKeyList *list)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VOID(list);
|
||||
ListInit(list);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t DupSessionKeyList(const SessionKeyList *srcList, SessionKeyList *dstList)
|
||||
int32_t DupSessionKeyList(const SessionKeyList *srcList, SessionKeyList *dstList)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(srcList, SOFTBUS_INVALID_PARAM);
|
||||
CHECK_NULL_PTR_RETURN_VALUE(dstList, SOFTBUS_INVALID_PARAM);
|
||||
@ -77,7 +77,7 @@ NO_SANITIZE("cfi") int32_t DupSessionKeyList(const SessionKeyList *srcList, Sess
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void DestroySessionKeyList(SessionKeyList *list)
|
||||
void DestroySessionKeyList(SessionKeyList *list)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VOID(list);
|
||||
SessionKeyItem *item = NULL;
|
||||
@ -89,13 +89,13 @@ NO_SANITIZE("cfi") void DestroySessionKeyList(SessionKeyList *list)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool HasSessionKey(const SessionKeyList *list)
|
||||
bool HasSessionKey(const SessionKeyList *list)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(list, false);
|
||||
return !IsListEmpty(list);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AddSessionKey(SessionKeyList *list, int32_t index, const SessionKey *key)
|
||||
int32_t AddSessionKey(SessionKeyList *list, int32_t index, const SessionKey *key)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(key, SOFTBUS_INVALID_PARAM);
|
||||
CHECK_NULL_PTR_RETURN_VALUE(list, SOFTBUS_INVALID_PARAM);
|
||||
@ -117,7 +117,7 @@ NO_SANITIZE("cfi") int32_t AddSessionKey(SessionKeyList *list, int32_t index, co
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t GetLatestSessionKey(const SessionKeyList *list, int32_t *index, SessionKey *key)
|
||||
int32_t GetLatestSessionKey(const SessionKeyList *list, int32_t *index, SessionKey *key)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(list, SOFTBUS_INVALID_PARAM);
|
||||
CHECK_NULL_PTR_RETURN_VALUE(index, SOFTBUS_INVALID_PARAM);
|
||||
@ -141,7 +141,7 @@ NO_SANITIZE("cfi") int32_t GetLatestSessionKey(const SessionKeyList *list, int32
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t GetSessionKeyByIndex(const SessionKeyList *list, int32_t index, SessionKey *key)
|
||||
int32_t GetSessionKeyByIndex(const SessionKeyList *list, int32_t index, SessionKey *key)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(list, SOFTBUS_INVALID_PARAM);
|
||||
CHECK_NULL_PTR_RETURN_VALUE(key, SOFTBUS_INVALID_PARAM);
|
||||
@ -162,7 +162,7 @@ NO_SANITIZE("cfi") int32_t GetSessionKeyByIndex(const SessionKeyList *list, int3
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void RemoveSessionkeyByIndex(SessionKeyList *list, int32_t index)
|
||||
void RemoveSessionkeyByIndex(SessionKeyList *list, int32_t index)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VOID(list);
|
||||
bool isFind = false;
|
||||
@ -181,7 +181,7 @@ NO_SANITIZE("cfi") void RemoveSessionkeyByIndex(SessionKeyList *list, int32_t in
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t EncryptData(const SessionKeyList *list, const uint8_t *inData, uint32_t inLen,
|
||||
int32_t EncryptData(const SessionKeyList *list, const uint8_t *inData, uint32_t inLen,
|
||||
uint8_t *outData, uint32_t *outLen)
|
||||
{
|
||||
if (list == NULL || inData == NULL || inLen == 0 || outData == NULL ||
|
||||
@ -215,7 +215,7 @@ NO_SANITIZE("cfi") int32_t EncryptData(const SessionKeyList *list, const uint8_t
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t DecryptData(const SessionKeyList *list, const uint8_t *inData, uint32_t inLen,
|
||||
int32_t DecryptData(const SessionKeyList *list, const uint8_t *inData, uint32_t inLen,
|
||||
uint8_t *outData, uint32_t *outLen)
|
||||
{
|
||||
if (list == NULL || inData == NULL || outData == NULL || inLen <= ENCRYPT_OVER_HEAD_LEN ||
|
||||
@ -247,7 +247,7 @@ NO_SANITIZE("cfi") int32_t DecryptData(const SessionKeyList *list, const uint8_t
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t EncryptInner(const SessionKeyList *list, const uint8_t *inData, uint32_t inLen,
|
||||
int32_t EncryptInner(const SessionKeyList *list, const uint8_t *inData, uint32_t inLen,
|
||||
uint8_t **outData, uint32_t *outLen)
|
||||
{
|
||||
if (list == NULL || inData == NULL || inLen == 0 || outData == NULL || outLen == NULL) {
|
||||
@ -270,7 +270,7 @@ NO_SANITIZE("cfi") int32_t EncryptInner(const SessionKeyList *list, const uint8_
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t DecryptInner(const SessionKeyList *list, const uint8_t *inData, uint32_t inLen,
|
||||
int32_t DecryptInner(const SessionKeyList *list, const uint8_t *inData, uint32_t inLen,
|
||||
uint8_t **outData, uint32_t *outLen)
|
||||
{
|
||||
if (list == NULL || inData == NULL || inLen <= ENCRYPT_OVER_HEAD_LEN || outData == NULL || outLen == NULL) {
|
||||
@ -294,7 +294,7 @@ NO_SANITIZE("cfi") int32_t DecryptInner(const SessionKeyList *list, const uint8_
|
||||
}
|
||||
|
||||
/* For Debug */
|
||||
NO_SANITIZE("cfi") void DumpSessionkeyList(const SessionKeyList *list)
|
||||
void DumpSessionkeyList(const SessionKeyList *list)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VOID(list);
|
||||
uint32_t keyNum = 0;
|
||||
@ -339,13 +339,13 @@ static int32_t RemoveUpdateSessionKeyFunc(const void *obj, void *para)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void ScheduleUpdateSessionKey(int64_t authId, uint64_t delayMs)
|
||||
void ScheduleUpdateSessionKey(int64_t authId, uint64_t delayMs)
|
||||
{
|
||||
RemoveAuthEvent(EVENT_UPDATE_SESSION_KEY, RemoveUpdateSessionKeyFunc, (void *)(&authId));
|
||||
PostAuthEvent(EVENT_UPDATE_SESSION_KEY, HandleUpdateSessionKeyEvent, &authId, sizeof(authId), delayMs);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void CancelUpdateSessionKey(int64_t authId)
|
||||
void CancelUpdateSessionKey(int64_t authId)
|
||||
{
|
||||
RemoveAuthEvent(EVENT_UPDATE_SESSION_KEY, RemoveUpdateSessionKeyFunc, (void *)(&authId));
|
||||
}
|
@ -115,14 +115,14 @@ static int32_t UnpackSocketPkt(const uint8_t *data, uint32_t len, SocketPktHead
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void NotifyConnected(ListenerModule module, int32_t fd, bool isClient)
|
||||
static void NotifyConnected(ListenerModule module, int32_t fd, bool isClient)
|
||||
{
|
||||
if (g_callback.onConnected != NULL) {
|
||||
g_callback.onConnected(module, fd, isClient);
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void NotifyDisconnected(int32_t fd)
|
||||
static void NotifyDisconnected(int32_t fd)
|
||||
{
|
||||
if (g_callback.onDisconnected != NULL) {
|
||||
g_callback.onDisconnected(fd);
|
||||
@ -145,7 +145,7 @@ static uint32_t ModuleToDataType(int32_t module)
|
||||
return DATA_TYPE_CONNECTION;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void NotifyDataReceived(ListenerModule module, int32_t fd,
|
||||
static void NotifyDataReceived(ListenerModule module, int32_t fd,
|
||||
const SocketPktHead *pktHead, const uint8_t *data)
|
||||
{
|
||||
if (pktHead->module == MODULE_AUTH_CHANNEL || pktHead->module == MODULE_AUTH_MSG) {
|
||||
@ -248,7 +248,7 @@ static int32_t ProcessSocketInEvent(ListenerModule module, int32_t fd)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t OnConnectEvent(ListenerModule module,
|
||||
static int32_t OnConnectEvent(ListenerModule module,
|
||||
int32_t cfd, const ConnectOption *clientAddr)
|
||||
{
|
||||
if (cfd < 0) {
|
||||
@ -279,7 +279,7 @@ NO_SANITIZE("cfi") static int32_t OnConnectEvent(ListenerModule module,
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t OnDataEvent(ListenerModule module, int32_t events, int32_t fd)
|
||||
static int32_t OnDataEvent(ListenerModule module, int32_t events, int32_t fd)
|
||||
{
|
||||
(void)module;
|
||||
if (events == SOFTBUS_SOCKET_OUT) {
|
||||
@ -290,7 +290,7 @@ NO_SANITIZE("cfi") static int32_t OnDataEvent(ListenerModule module, int32_t eve
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SetSocketCallback(const SocketCallback *cb)
|
||||
int32_t SetSocketCallback(const SocketCallback *cb)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(cb, SOFTBUS_INVALID_PARAM);
|
||||
if (memcpy_s(&g_callback, sizeof(SocketCallback), cb, sizeof(SocketCallback)) != EOK) {
|
||||
@ -300,12 +300,12 @@ NO_SANITIZE("cfi") int32_t SetSocketCallback(const SocketCallback *cb)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void UnsetSocketCallback(void)
|
||||
void UnsetSocketCallback(void)
|
||||
{
|
||||
(void)memset_s(&g_callback, sizeof(SocketCallback), 0, sizeof(SocketCallback));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t StartSocketListening(ListenerModule module, const LocalListenerInfo *info)
|
||||
int32_t StartSocketListening(ListenerModule module, const LocalListenerInfo *info)
|
||||
{
|
||||
SoftbusBaseListener listener = {
|
||||
.onConnectEvent = OnConnectEvent,
|
||||
@ -319,7 +319,7 @@ NO_SANITIZE("cfi") int32_t StartSocketListening(ListenerModule module, const Loc
|
||||
return port;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void StopSocketListening(void)
|
||||
void StopSocketListening(void)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "stop socket listening.");
|
||||
if (StopBaseListener(AUTH) != SOFTBUS_OK) {
|
||||
@ -327,7 +327,7 @@ NO_SANITIZE("cfi") void StopSocketListening(void)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SocketConnectDevice(const char *ip, int32_t port, bool isBlockMode)
|
||||
int32_t SocketConnectDevice(const char *ip, int32_t port, bool isBlockMode)
|
||||
{
|
||||
char localIp[MAX_ADDR_LEN] = {0};
|
||||
if (LnnGetLocalStrInfo(STRING_KEY_WLAN_IP, localIp, MAX_ADDR_LEN) != SOFTBUS_OK) {
|
||||
@ -368,7 +368,7 @@ NO_SANITIZE("cfi") int32_t SocketConnectDevice(const char *ip, int32_t port, boo
|
||||
return fd;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t NipSocketConnectDevice(ListenerModule module,
|
||||
int32_t NipSocketConnectDevice(ListenerModule module,
|
||||
const char *addr, int32_t port, bool isBlockMode)
|
||||
{
|
||||
ConnectOption option = {
|
||||
@ -404,7 +404,7 @@ NO_SANITIZE("cfi") int32_t NipSocketConnectDevice(ListenerModule module,
|
||||
return fd;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void SocketDisconnectDevice(ListenerModule module, int32_t fd)
|
||||
void SocketDisconnectDevice(ListenerModule module, int32_t fd)
|
||||
{
|
||||
if (fd < 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_DBG, "invalid fd:%d, maybe has shutdown", fd);
|
||||
@ -414,7 +414,7 @@ NO_SANITIZE("cfi") void SocketDisconnectDevice(ListenerModule module, int32_t fd
|
||||
ConnShutdownSocket(fd);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SocketPostBytes(int32_t fd, const AuthDataHead *head, const uint8_t *data)
|
||||
int32_t SocketPostBytes(int32_t fd, const AuthDataHead *head, const uint8_t *data)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(head, SOFTBUS_INVALID_PARAM);
|
||||
CHECK_NULL_PTR_RETURN_VALUE(data, SOFTBUS_INVALID_PARAM);
|
||||
@ -449,7 +449,7 @@ NO_SANITIZE("cfi") int32_t SocketPostBytes(int32_t fd, const AuthDataHead *head,
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SocketGetConnInfo(int32_t fd, AuthConnInfo *connInfo, bool *isServer)
|
||||
int32_t SocketGetConnInfo(int32_t fd, AuthConnInfo *connInfo, bool *isServer)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(connInfo, SOFTBUS_INVALID_PARAM);
|
||||
CHECK_NULL_PTR_RETURN_VALUE(isServer, SOFTBUS_INVALID_PARAM);
|
||||
@ -479,7 +479,7 @@ NO_SANITIZE("cfi") int32_t SocketGetConnInfo(int32_t fd, AuthConnInfo *connInfo,
|
||||
}
|
||||
|
||||
/* Auth Channel */
|
||||
NO_SANITIZE("cfi") static void NotifyChannelDataReceived(int32_t channelId, const SocketPktHead *head,
|
||||
static void NotifyChannelDataReceived(int32_t channelId, const SocketPktHead *head,
|
||||
const uint8_t *data)
|
||||
{
|
||||
uint32_t i;
|
||||
@ -504,7 +504,7 @@ NO_SANITIZE("cfi") static void NotifyChannelDataReceived(int32_t channelId, cons
|
||||
listener->onDataReceived(channelId, &channelData);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void NotifyChannelDisconnected(int32_t channelId)
|
||||
static void NotifyChannelDisconnected(int32_t channelId)
|
||||
{
|
||||
uint32_t i;
|
||||
for (i = 0; i < sizeof(g_listener) / sizeof(InnerChannelListener); i++) {
|
||||
@ -514,7 +514,7 @@ NO_SANITIZE("cfi") static void NotifyChannelDisconnected(int32_t channelId)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t RegAuthChannelListener(int32_t module, const AuthChannelListener *listener)
|
||||
int32_t RegAuthChannelListener(int32_t module, const AuthChannelListener *listener)
|
||||
{
|
||||
if (listener == NULL || listener->onDataReceived == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "AuthChannel: invalid listener.");
|
||||
@ -532,7 +532,7 @@ NO_SANITIZE("cfi") int32_t RegAuthChannelListener(int32_t module, const AuthChan
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void UnregAuthChannelListener(int32_t module)
|
||||
void UnregAuthChannelListener(int32_t module)
|
||||
{
|
||||
uint32_t i;
|
||||
for (i = 0; i < sizeof(g_listener) / sizeof(InnerChannelListener); i++) {
|
||||
@ -544,7 +544,7 @@ NO_SANITIZE("cfi") void UnregAuthChannelListener(int32_t module)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthOpenChannel(const char *ip, int32_t port)
|
||||
int32_t AuthOpenChannel(const char *ip, int32_t port)
|
||||
{
|
||||
if (ip == NULL || port <= 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "AuthChannel: invalid param.");
|
||||
@ -559,13 +559,13 @@ NO_SANITIZE("cfi") int32_t AuthOpenChannel(const char *ip, int32_t port)
|
||||
return fd;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void AuthCloseChannel(int32_t channelId)
|
||||
void AuthCloseChannel(int32_t channelId)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "AuthChannel: close auth channel, id=%d.", channelId);
|
||||
SocketDisconnectDevice(AUTH, channelId);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t AuthPostChannelData(int32_t channelId, const AuthChannelData *data)
|
||||
int32_t AuthPostChannelData(int32_t channelId, const AuthChannelData *data)
|
||||
{
|
||||
if (channelId < 0 || data == NULL || data->data == NULL || data->len == 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "AuthChannel: invalid param, channelId=%d.", channelId);
|
||||
|
@ -48,20 +48,20 @@ static int32_t OnRefreshDeviceFound(const char *pkgName, const DeviceInfo *devic
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcServerJoin(const char *pkgName, int32_t callingPid, void *addr, uint32_t addrTypeLen)
|
||||
int32_t LnnIpcServerJoin(const char *pkgName, int32_t callingPid, void *addr, uint32_t addrTypeLen)
|
||||
{
|
||||
(void)callingPid;
|
||||
(void)addrTypeLen;
|
||||
return LnnServerJoin((ConnectionAddr *)addr, pkgName);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcServerLeave(const char *pkgName, int32_t callingPid, const char *networkId)
|
||||
int32_t LnnIpcServerLeave(const char *pkgName, int32_t callingPid, const char *networkId)
|
||||
{
|
||||
(void)callingPid;
|
||||
return LnnServerLeave(networkId, pkgName);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcGetAllOnlineNodeInfo(const char *pkgName, void **info, uint32_t infoTypeLen,
|
||||
int32_t LnnIpcGetAllOnlineNodeInfo(const char *pkgName, void **info, uint32_t infoTypeLen,
|
||||
int *infoNum)
|
||||
{
|
||||
(void)pkgName;
|
||||
@ -72,49 +72,49 @@ NO_SANITIZE("cfi") int32_t LnnIpcGetAllOnlineNodeInfo(const char *pkgName, void
|
||||
return LnnGetAllOnlineNodeInfo((NodeBasicInfo **)info, infoNum);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcGetLocalDeviceInfo(const char *pkgName, void *info, uint32_t infoTypeLen)
|
||||
int32_t LnnIpcGetLocalDeviceInfo(const char *pkgName, void *info, uint32_t infoTypeLen)
|
||||
{
|
||||
(void)pkgName;
|
||||
(void)infoTypeLen;
|
||||
return LnnGetLocalDeviceInfo((NodeBasicInfo *)info);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcGetNodeKeyInfo(const char *pkgName, const char *networkId, int key, unsigned char *buf,
|
||||
int32_t LnnIpcGetNodeKeyInfo(const char *pkgName, const char *networkId, int key, unsigned char *buf,
|
||||
uint32_t len)
|
||||
{
|
||||
(void)pkgName;
|
||||
return LnnGetNodeKeyInfo(networkId, key, buf, len);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcSetNodeDataChangeFlag(const char *pkgName, const char *networkId,
|
||||
int32_t LnnIpcSetNodeDataChangeFlag(const char *pkgName, const char *networkId,
|
||||
uint16_t dataChangeFlag)
|
||||
{
|
||||
(void)pkgName;
|
||||
return LnnSetNodeDataChangeFlag(networkId, dataChangeFlag);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcStartTimeSync(const char *pkgName, int32_t callingPid, const char *targetNetworkId,
|
||||
int32_t LnnIpcStartTimeSync(const char *pkgName, int32_t callingPid, const char *targetNetworkId,
|
||||
int32_t accuracy, int32_t period)
|
||||
{
|
||||
return LnnStartTimeSync(pkgName, callingPid, targetNetworkId, (TimeSyncAccuracy)accuracy, (TimeSyncPeriod)period);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcStopTimeSync(const char *pkgName, const char *targetNetworkId)
|
||||
int32_t LnnIpcStopTimeSync(const char *pkgName, const char *targetNetworkId)
|
||||
{
|
||||
return LnnStopTimeSync(pkgName, targetNetworkId);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcPublishLNN(const char *pkgName, const PublishInfo *info)
|
||||
int32_t LnnIpcPublishLNN(const char *pkgName, const PublishInfo *info)
|
||||
{
|
||||
return LnnPublishService(pkgName, info, false);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcStopPublishLNN(const char *pkgName, int32_t publishId)
|
||||
int32_t LnnIpcStopPublishLNN(const char *pkgName, int32_t publishId)
|
||||
{
|
||||
return LnnUnPublishService(pkgName, publishId, false);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcRefreshLNN(const char *pkgName, int32_t callingPid, const SubscribeInfo *info)
|
||||
int32_t LnnIpcRefreshLNN(const char *pkgName, int32_t callingPid, const SubscribeInfo *info)
|
||||
{
|
||||
(void)callingPid;
|
||||
SetCallLnnStatus(false);
|
||||
@ -124,34 +124,34 @@ NO_SANITIZE("cfi") int32_t LnnIpcRefreshLNN(const char *pkgName, int32_t calling
|
||||
return LnnStartDiscDevice(pkgName, info, &callback, false);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcStopRefreshLNN(const char *pkgName, int32_t callingPid, int32_t refreshId)
|
||||
int32_t LnnIpcStopRefreshLNN(const char *pkgName, int32_t callingPid, int32_t refreshId)
|
||||
{
|
||||
(void)callingPid;
|
||||
return LnnStopDiscDevice(pkgName, refreshId, false);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcActiveMetaNode(const MetaNodeConfigInfo *info, char *metaNodeId)
|
||||
int32_t LnnIpcActiveMetaNode(const MetaNodeConfigInfo *info, char *metaNodeId)
|
||||
{
|
||||
return LnnActiveMetaNode(info, metaNodeId);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcDeactiveMetaNode(const char *metaNodeId)
|
||||
int32_t LnnIpcDeactiveMetaNode(const char *metaNodeId)
|
||||
{
|
||||
return LnnDeactiveMetaNode(metaNodeId);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcGetAllMetaNodeInfo(MetaNodeInfo *infos, int32_t *infoNum)
|
||||
int32_t LnnIpcGetAllMetaNodeInfo(MetaNodeInfo *infos, int32_t *infoNum)
|
||||
{
|
||||
return LnnGetAllMetaNodeInfo(infos, infoNum);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcShiftLNNGear(const char *pkgName, const char *callerId, const char *targetNetworkId,
|
||||
int32_t LnnIpcShiftLNNGear(const char *pkgName, const char *callerId, const char *targetNetworkId,
|
||||
const GearMode *mode)
|
||||
{
|
||||
return LnnShiftLNNGear(pkgName, callerId, targetNetworkId, mode);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char *networkId,
|
||||
int32_t LnnIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char *networkId,
|
||||
int32_t retCode)
|
||||
{
|
||||
(void)addrTypeLen;
|
||||
@ -167,7 +167,7 @@ int32_t MetaNodeIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcNotifyLeaveResult(const char *networkId, int32_t retCode)
|
||||
int32_t LnnIpcNotifyLeaveResult(const char *networkId, int32_t retCode)
|
||||
{
|
||||
return LnnOnLeaveResult(networkId, retCode);
|
||||
}
|
||||
@ -179,19 +179,19 @@ int32_t MetaNodeIpcNotifyLeaveResult(const char *networkId, int32_t retCode)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcNotifyOnlineState(bool isOnline, void *info, uint32_t infoTypeLen)
|
||||
int32_t LnnIpcNotifyOnlineState(bool isOnline, void *info, uint32_t infoTypeLen)
|
||||
{
|
||||
(void)infoTypeLen;
|
||||
return LnnOnNodeOnlineStateChanged("", isOnline, info);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcNotifyBasicInfoChanged(void *info, uint32_t infoTypeLen, int32_t type)
|
||||
int32_t LnnIpcNotifyBasicInfoChanged(void *info, uint32_t infoTypeLen, int32_t type)
|
||||
{
|
||||
(void)infoTypeLen;
|
||||
return LnnOnNodeBasicInfoChanged("", info, type);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcNotifyTimeSyncResult(const char *pkgName, int32_t pid, const void *info,
|
||||
int32_t LnnIpcNotifyTimeSyncResult(const char *pkgName, int32_t pid, const void *info,
|
||||
uint32_t infoTypeLen, int32_t retCode)
|
||||
{
|
||||
(void)pkgName;
|
||||
|
@ -65,7 +65,7 @@ static int32_t GetAllClientIdentity(SvcIdentity *svc, int num)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnJoinLNNResult(const char *pkgName, void *addr, uint32_t addrTypeLen,
|
||||
int32_t ClientOnJoinLNNResult(const char *pkgName, void *addr, uint32_t addrTypeLen,
|
||||
const char *networkId, int32_t retCode)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_INFO, "OnJoinLNNResult ipc server push.");
|
||||
@ -98,7 +98,7 @@ NO_SANITIZE("cfi") int32_t ClientOnJoinLNNResult(const char *pkgName, void *addr
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnJoinMetaNodeResult(const char *pkgName, void *addr, uint32_t addrTypeLen,
|
||||
int32_t ClientOnJoinMetaNodeResult(const char *pkgName, void *addr, uint32_t addrTypeLen,
|
||||
const char *networkId, int32_t retCode)
|
||||
{
|
||||
(void)pkgName;
|
||||
@ -109,7 +109,7 @@ NO_SANITIZE("cfi") int32_t ClientOnJoinMetaNodeResult(const char *pkgName, void
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnLeaveLNNResult(const char *pkgName, const char *networkId, int retCode)
|
||||
int32_t ClientOnLeaveLNNResult(const char *pkgName, const char *networkId, int retCode)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_INFO, "OnLeaveLNNResult callback ipc server push.");
|
||||
if (networkId == NULL) {
|
||||
@ -137,7 +137,7 @@ NO_SANITIZE("cfi") int32_t ClientOnLeaveLNNResult(const char *pkgName, const cha
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnLeaveMetaNodeResult(const char *pkgName, const char *networkId, int retCode)
|
||||
int32_t ClientOnLeaveMetaNodeResult(const char *pkgName, const char *networkId, int retCode)
|
||||
{
|
||||
(void)pkgName;
|
||||
(void)networkId;
|
||||
@ -145,7 +145,7 @@ NO_SANITIZE("cfi") int32_t ClientOnLeaveMetaNodeResult(const char *pkgName, cons
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClinetOnNodeOnlineStateChanged(bool isOnline, void *info, uint32_t infoTypeLen)
|
||||
int32_t ClinetOnNodeOnlineStateChanged(bool isOnline, void *info, uint32_t infoTypeLen)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_INFO, "OnNodeOnlineStateChanged callback ipc server push.");
|
||||
if (info == NULL) {
|
||||
@ -193,7 +193,7 @@ NO_SANITIZE("cfi") int32_t ClinetOnNodeOnlineStateChanged(bool isOnline, void *i
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClinetOnNodeBasicInfoChanged(void *info, uint32_t infoTypeLen, int32_t type)
|
||||
int32_t ClinetOnNodeBasicInfoChanged(void *info, uint32_t infoTypeLen, int32_t type)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_INFO, "ClinetOnNodeBasicInfoChanged callback ipc server push.");
|
||||
if (info == NULL) {
|
||||
@ -241,7 +241,7 @@ NO_SANITIZE("cfi") int32_t ClinetOnNodeBasicInfoChanged(void *info, uint32_t inf
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnTimeSyncResult(const char *pkgName, int32_t pid, const void *info,
|
||||
int32_t ClientOnTimeSyncResult(const char *pkgName, int32_t pid, const void *info,
|
||||
uint32_t infoTypeLen, int32_t retCode)
|
||||
{
|
||||
(void)pid;
|
||||
@ -272,7 +272,7 @@ NO_SANITIZE("cfi") int32_t ClientOnTimeSyncResult(const char *pkgName, int32_t p
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnPublishLNNResult(const char *pkgName, int32_t pid, int32_t publishId,
|
||||
int32_t ClientOnPublishLNNResult(const char *pkgName, int32_t pid, int32_t publishId,
|
||||
int32_t reason)
|
||||
{
|
||||
(void) pid;
|
||||
@ -302,7 +302,7 @@ NO_SANITIZE("cfi") int32_t ClientOnPublishLNNResult(const char *pkgName, int32_t
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnRefreshLNNResult(const char *pkgName, int32_t pid, int32_t refreshId,
|
||||
int32_t ClientOnRefreshLNNResult(const char *pkgName, int32_t pid, int32_t refreshId,
|
||||
int32_t reason)
|
||||
{
|
||||
(void)pid;
|
||||
@ -332,7 +332,7 @@ NO_SANITIZE("cfi") int32_t ClientOnRefreshLNNResult(const char *pkgName, int32_t
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnRefreshDeviceFound(const char *pkgName, int32_t pid, const void *device,
|
||||
int32_t ClientOnRefreshDeviceFound(const char *pkgName, int32_t pid, const void *device,
|
||||
uint32_t deviceLen)
|
||||
{
|
||||
(void)pid;
|
||||
|
@ -184,7 +184,7 @@ static int32_t OnRefreshDeviceFound(const char *pkgName, const DeviceInfo *devic
|
||||
return ClientOnRefreshDeviceFound(pkgName, 0, &newDevice, sizeof(DeviceInfo));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcServerJoin(const char *pkgName, int32_t callingPid, void *addr, uint32_t addrTypeLen)
|
||||
int32_t LnnIpcServerJoin(const char *pkgName, int32_t callingPid, void *addr, uint32_t addrTypeLen)
|
||||
{
|
||||
(void)callingPid;
|
||||
ConnectionAddr *connAddr = (ConnectionAddr *)addr;
|
||||
@ -223,7 +223,7 @@ NO_SANITIZE("cfi") int32_t LnnIpcServerJoin(const char *pkgName, int32_t calling
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcServerLeave(const char *pkgName, int32_t callingPid, const char *networkId)
|
||||
int32_t LnnIpcServerLeave(const char *pkgName, int32_t callingPid, const char *networkId)
|
||||
{
|
||||
(void)callingPid;
|
||||
if (pkgName == NULL || networkId == NULL) {
|
||||
@ -256,7 +256,7 @@ NO_SANITIZE("cfi") int32_t LnnIpcServerLeave(const char *pkgName, int32_t callin
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcGetAllOnlineNodeInfo(const char *pkgName, void **info, uint32_t infoTypeLen,
|
||||
int32_t LnnIpcGetAllOnlineNodeInfo(const char *pkgName, void **info, uint32_t infoTypeLen,
|
||||
int *infoNum)
|
||||
{
|
||||
(void)pkgName;
|
||||
@ -267,21 +267,21 @@ NO_SANITIZE("cfi") int32_t LnnIpcGetAllOnlineNodeInfo(const char *pkgName, void
|
||||
return LnnGetAllOnlineNodeInfo((NodeBasicInfo **)info, infoNum);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcGetLocalDeviceInfo(const char *pkgName, void *info, uint32_t infoTypeLen)
|
||||
int32_t LnnIpcGetLocalDeviceInfo(const char *pkgName, void *info, uint32_t infoTypeLen)
|
||||
{
|
||||
(void)pkgName;
|
||||
(void)infoTypeLen;
|
||||
return LnnGetLocalDeviceInfo((NodeBasicInfo *)info);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcGetNodeKeyInfo(const char *pkgName, const char *networkId, int key, unsigned char *buf,
|
||||
int32_t LnnIpcGetNodeKeyInfo(const char *pkgName, const char *networkId, int key, unsigned char *buf,
|
||||
uint32_t len)
|
||||
{
|
||||
(void)pkgName;
|
||||
return LnnGetNodeKeyInfo(networkId, key, buf, len);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcSetNodeDataChangeFlag(const char *pkgName, const char *networkId,
|
||||
int32_t LnnIpcSetNodeDataChangeFlag(const char *pkgName, const char *networkId,
|
||||
uint16_t dataChangeFlag)
|
||||
{
|
||||
(void)pkgName;
|
||||
@ -293,28 +293,28 @@ int32_t LnnIpcGetNodeKeyInfoLen(int32_t key)
|
||||
return LnnGetNodeKeyInfoLen(key);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcStartTimeSync(const char *pkgName, int32_t callingPid, const char *targetNetworkId,
|
||||
int32_t LnnIpcStartTimeSync(const char *pkgName, int32_t callingPid, const char *targetNetworkId,
|
||||
int32_t accuracy, int32_t period)
|
||||
{
|
||||
return LnnStartTimeSync(pkgName, callingPid, targetNetworkId, (TimeSyncAccuracy)accuracy, (TimeSyncPeriod)period);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcStopTimeSync(const char *pkgName, const char *targetNetworkId)
|
||||
int32_t LnnIpcStopTimeSync(const char *pkgName, const char *targetNetworkId)
|
||||
{
|
||||
return LnnStopTimeSync(pkgName, targetNetworkId);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcPublishLNN(const char *pkgName, const PublishInfo *info)
|
||||
int32_t LnnIpcPublishLNN(const char *pkgName, const PublishInfo *info)
|
||||
{
|
||||
return LnnPublishService(pkgName, info, false);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcStopPublishLNN(const char *pkgName, int32_t publishId)
|
||||
int32_t LnnIpcStopPublishLNN(const char *pkgName, int32_t publishId)
|
||||
{
|
||||
return LnnUnPublishService(pkgName, publishId, false);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcRefreshLNN(const char *pkgName, int32_t callingPid, const SubscribeInfo *info)
|
||||
int32_t LnnIpcRefreshLNN(const char *pkgName, int32_t callingPid, const SubscribeInfo *info)
|
||||
{
|
||||
(void)callingPid;
|
||||
SetCallLnnStatus(false);
|
||||
@ -324,7 +324,7 @@ NO_SANITIZE("cfi") int32_t LnnIpcRefreshLNN(const char *pkgName, int32_t calling
|
||||
return LnnStartDiscDevice(pkgName, info, &callback, false);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcStopRefreshLNN(const char *pkgName, int32_t callingPid, int32_t refreshId)
|
||||
int32_t LnnIpcStopRefreshLNN(const char *pkgName, int32_t callingPid, int32_t refreshId)
|
||||
{
|
||||
(void)callingPid;
|
||||
return LnnStopDiscDevice(pkgName, refreshId, false);
|
||||
@ -335,23 +335,23 @@ int32_t LnnIpcActiveMetaNode(const MetaNodeConfigInfo *info, char *metaNodeId)
|
||||
return LnnActiveMetaNode(info, metaNodeId);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcDeactiveMetaNode(const char *metaNodeId)
|
||||
int32_t LnnIpcDeactiveMetaNode(const char *metaNodeId)
|
||||
{
|
||||
return LnnDeactiveMetaNode(metaNodeId);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcGetAllMetaNodeInfo(MetaNodeInfo *infos, int32_t *infoNum)
|
||||
int32_t LnnIpcGetAllMetaNodeInfo(MetaNodeInfo *infos, int32_t *infoNum)
|
||||
{
|
||||
return LnnGetAllMetaNodeInfo(infos, infoNum);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcShiftLNNGear(const char *pkgName, const char *callerId, const char *targetNetworkId,
|
||||
int32_t LnnIpcShiftLNNGear(const char *pkgName, const char *callerId, const char *targetNetworkId,
|
||||
const GearMode *mode)
|
||||
{
|
||||
return LnnShiftLNNGear(pkgName, callerId, targetNetworkId, mode);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char *networkId,
|
||||
int32_t LnnIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char *networkId,
|
||||
int32_t retCode)
|
||||
{
|
||||
if (addr == NULL) {
|
||||
@ -388,7 +388,7 @@ int32_t MetaNodeIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcNotifyLeaveResult(const char *networkId, int32_t retCode)
|
||||
int32_t LnnIpcNotifyLeaveResult(const char *networkId, int32_t retCode)
|
||||
{
|
||||
if (networkId == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -422,17 +422,17 @@ int32_t MetaNodeIpcNotifyLeaveResult(const char *networkId, int32_t retCode)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcNotifyOnlineState(bool isOnline, void *info, uint32_t infoTypeLen)
|
||||
int32_t LnnIpcNotifyOnlineState(bool isOnline, void *info, uint32_t infoTypeLen)
|
||||
{
|
||||
return ClinetOnNodeOnlineStateChanged(isOnline, info, infoTypeLen);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcNotifyBasicInfoChanged(void *info, uint32_t infoTypeLen, int32_t type)
|
||||
int32_t LnnIpcNotifyBasicInfoChanged(void *info, uint32_t infoTypeLen, int32_t type)
|
||||
{
|
||||
return ClinetOnNodeBasicInfoChanged(info, infoTypeLen, type);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcNotifyTimeSyncResult(const char *pkgName, int32_t pid, const void *info,
|
||||
int32_t LnnIpcNotifyTimeSyncResult(const char *pkgName, int32_t pid, const void *info,
|
||||
uint32_t infoTypeLen, int32_t retCode)
|
||||
{
|
||||
return ClientOnTimeSyncResult(pkgName, pid, info, infoTypeLen, retCode);
|
||||
|
@ -31,7 +31,7 @@ static sptr<BusCenterClientProxy> GetClientProxy(const char *pkgName, int32_t pi
|
||||
return clientProxy;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnJoinLNNResult(PkgNameAndPidInfo *info, void *addr, uint32_t addrTypeLen,
|
||||
int32_t ClientOnJoinLNNResult(PkgNameAndPidInfo *info, void *addr, uint32_t addrTypeLen,
|
||||
const char *networkId, int32_t retCode)
|
||||
{
|
||||
if (info == nullptr) {
|
||||
@ -46,7 +46,7 @@ NO_SANITIZE("cfi") int32_t ClientOnJoinLNNResult(PkgNameAndPidInfo *info, void *
|
||||
return clientProxy->OnJoinLNNResult(addr, addrTypeLen, networkId, retCode);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnJoinMetaNodeResult(PkgNameAndPidInfo *info, void *addr, uint32_t addrTypeLen,
|
||||
int32_t ClientOnJoinMetaNodeResult(PkgNameAndPidInfo *info, void *addr, uint32_t addrTypeLen,
|
||||
const char *networkId, int32_t retCode)
|
||||
{
|
||||
if (info == nullptr) {
|
||||
@ -61,7 +61,7 @@ NO_SANITIZE("cfi") int32_t ClientOnJoinMetaNodeResult(PkgNameAndPidInfo *info, v
|
||||
return clientProxy->OnJoinMetaNodeResult(addr, addrTypeLen, networkId, retCode);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnLeaveLNNResult(
|
||||
int32_t ClientOnLeaveLNNResult(
|
||||
const char *pkgName, int32_t pid, const char *networkId, int32_t retCode)
|
||||
{
|
||||
if (pkgName == nullptr) {
|
||||
@ -76,7 +76,7 @@ NO_SANITIZE("cfi") int32_t ClientOnLeaveLNNResult(
|
||||
return clientProxy->OnLeaveLNNResult(networkId, retCode);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnLeaveMetaNodeResult(
|
||||
int32_t ClientOnLeaveMetaNodeResult(
|
||||
const char *pkgName, int32_t pid, const char *networkId, int32_t retCode)
|
||||
{
|
||||
if (pkgName == nullptr) {
|
||||
@ -91,7 +91,7 @@ NO_SANITIZE("cfi") int32_t ClientOnLeaveMetaNodeResult(
|
||||
return clientProxy->OnLeaveMetaNodeResult(networkId, retCode);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClinetOnNodeOnlineStateChanged(bool isOnline, void *info, uint32_t infoTypeLen)
|
||||
int32_t ClinetOnNodeOnlineStateChanged(bool isOnline, void *info, uint32_t infoTypeLen)
|
||||
{
|
||||
std::multimap<std::string, sptr<IRemoteObject>> proxyMap;
|
||||
SoftbusClientInfoManager::GetInstance().GetSoftbusClientProxyMap(proxyMap);
|
||||
@ -102,7 +102,7 @@ NO_SANITIZE("cfi") int32_t ClinetOnNodeOnlineStateChanged(bool isOnline, void *i
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClinetOnNodeBasicInfoChanged(void *info, uint32_t infoTypeLen, int32_t type)
|
||||
int32_t ClinetOnNodeBasicInfoChanged(void *info, uint32_t infoTypeLen, int32_t type)
|
||||
{
|
||||
std::multimap<std::string, sptr<IRemoteObject>> proxyMap;
|
||||
SoftbusClientInfoManager::GetInstance().GetSoftbusClientProxyMap(proxyMap);
|
||||
@ -113,7 +113,7 @@ NO_SANITIZE("cfi") int32_t ClinetOnNodeBasicInfoChanged(void *info, uint32_t inf
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnTimeSyncResult(const char *pkgName, int32_t pid, const void *info,
|
||||
int32_t ClientOnTimeSyncResult(const char *pkgName, int32_t pid, const void *info,
|
||||
uint32_t infoTypeLen, int32_t retCode)
|
||||
{
|
||||
if (pkgName == nullptr) {
|
||||
@ -128,7 +128,7 @@ NO_SANITIZE("cfi") int32_t ClientOnTimeSyncResult(const char *pkgName, int32_t p
|
||||
return clientProxy->OnTimeSyncResult(info, infoTypeLen, retCode);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnPublishLNNResult(const char *pkgName, int32_t pid, int32_t publishId,
|
||||
int32_t ClientOnPublishLNNResult(const char *pkgName, int32_t pid, int32_t publishId,
|
||||
int32_t reason)
|
||||
{
|
||||
if (pkgName == nullptr) {
|
||||
@ -144,7 +144,7 @@ NO_SANITIZE("cfi") int32_t ClientOnPublishLNNResult(const char *pkgName, int32_t
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnRefreshLNNResult(const char *pkgName, int32_t pid, int32_t refreshId,
|
||||
int32_t ClientOnRefreshLNNResult(const char *pkgName, int32_t pid, int32_t refreshId,
|
||||
int32_t reason)
|
||||
{
|
||||
if (pkgName == nullptr) {
|
||||
@ -160,7 +160,7 @@ NO_SANITIZE("cfi") int32_t ClientOnRefreshLNNResult(const char *pkgName, int32_t
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t ClientOnRefreshDeviceFound(
|
||||
int32_t ClientOnRefreshDeviceFound(
|
||||
const char *pkgName, int32_t pid, const void *device, uint32_t deviceLen)
|
||||
{
|
||||
if (pkgName == nullptr) {
|
||||
|
@ -218,7 +218,7 @@ static int32_t OnRefreshDeviceFound(const char *pkgName, const DeviceInfo *devic
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcServerJoin(const char *pkgName, int32_t callingPid, void *addr, uint32_t addrTypeLen)
|
||||
int32_t LnnIpcServerJoin(const char *pkgName, int32_t callingPid, void *addr, uint32_t addrTypeLen)
|
||||
{
|
||||
ConnectionAddr *connAddr = reinterpret_cast<ConnectionAddr *>(addr);
|
||||
|
||||
@ -242,7 +242,7 @@ NO_SANITIZE("cfi") int32_t LnnIpcServerJoin(const char *pkgName, int32_t calling
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t MetaNodeIpcServerJoin(const char *pkgName, int32_t callingPid, void *addr,
|
||||
int32_t MetaNodeIpcServerJoin(const char *pkgName, int32_t callingPid, void *addr,
|
||||
CustomData *customData, uint32_t addrTypeLen)
|
||||
{
|
||||
ConnectionAddr *connAddr = reinterpret_cast<ConnectionAddr *>(addr);
|
||||
@ -264,7 +264,7 @@ NO_SANITIZE("cfi") int32_t MetaNodeIpcServerJoin(const char *pkgName, int32_t ca
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcServerLeave(const char *pkgName, int32_t callingPid, const char *networkId)
|
||||
int32_t LnnIpcServerLeave(const char *pkgName, int32_t callingPid, const char *networkId)
|
||||
{
|
||||
if (pkgName == nullptr || networkId == nullptr) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "parameters are nullptr!\n");
|
||||
@ -282,7 +282,7 @@ NO_SANITIZE("cfi") int32_t LnnIpcServerLeave(const char *pkgName, int32_t callin
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t MetaNodeIpcServerLeave(const char *pkgName, int32_t callingPid, const char *networkId)
|
||||
int32_t MetaNodeIpcServerLeave(const char *pkgName, int32_t callingPid, const char *networkId)
|
||||
{
|
||||
if (pkgName == nullptr || networkId == nullptr) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "parameters are nullptr!\n");
|
||||
@ -300,7 +300,7 @@ NO_SANITIZE("cfi") int32_t MetaNodeIpcServerLeave(const char *pkgName, int32_t c
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcGetAllOnlineNodeInfo(const char *pkgName, void **info, uint32_t infoTypeLen,
|
||||
int32_t LnnIpcGetAllOnlineNodeInfo(const char *pkgName, void **info, uint32_t infoTypeLen,
|
||||
int *infoNum)
|
||||
{
|
||||
if (infoTypeLen != sizeof(NodeBasicInfo)) {
|
||||
@ -310,42 +310,42 @@ NO_SANITIZE("cfi") int32_t LnnIpcGetAllOnlineNodeInfo(const char *pkgName, void
|
||||
return LnnGetAllOnlineNodeInfo(reinterpret_cast<NodeBasicInfo **>(info), infoNum);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcGetLocalDeviceInfo(const char *pkgName, void *info, uint32_t infoTypeLen)
|
||||
int32_t LnnIpcGetLocalDeviceInfo(const char *pkgName, void *info, uint32_t infoTypeLen)
|
||||
{
|
||||
(void)infoTypeLen;
|
||||
return LnnGetLocalDeviceInfo(reinterpret_cast<NodeBasicInfo *>(info));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcGetNodeKeyInfo(const char *pkgName, const char *networkId, int key, unsigned char *buf,
|
||||
int32_t LnnIpcGetNodeKeyInfo(const char *pkgName, const char *networkId, int key, unsigned char *buf,
|
||||
uint32_t len)
|
||||
{
|
||||
return LnnGetNodeKeyInfo(networkId, key, buf, len);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcSetNodeDataChangeFlag(const char *pkgName, const char *networkId,
|
||||
int32_t LnnIpcSetNodeDataChangeFlag(const char *pkgName, const char *networkId,
|
||||
uint16_t dataChangeFlag)
|
||||
{
|
||||
(void)pkgName;
|
||||
return LnnSetNodeDataChangeFlag(networkId, dataChangeFlag);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcStartTimeSync(const char *pkgName, int32_t callingPid, const char *targetNetworkId,
|
||||
int32_t LnnIpcStartTimeSync(const char *pkgName, int32_t callingPid, const char *targetNetworkId,
|
||||
int32_t accuracy, int32_t period)
|
||||
{
|
||||
return LnnStartTimeSync(pkgName, callingPid, targetNetworkId, (TimeSyncAccuracy)accuracy, (TimeSyncPeriod)period);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcStopTimeSync(const char *pkgName, const char *targetNetworkId)
|
||||
int32_t LnnIpcStopTimeSync(const char *pkgName, const char *targetNetworkId)
|
||||
{
|
||||
return LnnStopTimeSync(pkgName, targetNetworkId);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcPublishLNN(const char *pkgName, const PublishInfo *info)
|
||||
int32_t LnnIpcPublishLNN(const char *pkgName, const PublishInfo *info)
|
||||
{
|
||||
return LnnPublishService(pkgName, info, false);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcStopPublishLNN(const char *pkgName, int32_t publishId)
|
||||
int32_t LnnIpcStopPublishLNN(const char *pkgName, int32_t publishId)
|
||||
{
|
||||
return LnnUnPublishService(pkgName, publishId, false);
|
||||
}
|
||||
@ -395,7 +395,7 @@ static int32_t DeleteRefreshLnnInfo(const char *pkgName, int32_t callingPid)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcRefreshLNN(const char *pkgName, int32_t callingPid, const SubscribeInfo *info)
|
||||
int32_t LnnIpcRefreshLNN(const char *pkgName, int32_t callingPid, const SubscribeInfo *info)
|
||||
{
|
||||
if (pkgName == nullptr || info == nullptr) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "parameters are nullptr!\n");
|
||||
@ -413,7 +413,7 @@ NO_SANITIZE("cfi") int32_t LnnIpcRefreshLNN(const char *pkgName, int32_t calling
|
||||
return LnnStartDiscDevice(pkgName, info, &callback, false);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcStopRefreshLNN(const char *pkgName, int32_t callingPid, int32_t refreshId)
|
||||
int32_t LnnIpcStopRefreshLNN(const char *pkgName, int32_t callingPid, int32_t refreshId)
|
||||
{
|
||||
if (IsRepeatRfreshLnnRequest(pkgName, callingPid) && (DeleteRefreshLnnInfo(pkgName, callingPid) != SOFTBUS_OK)) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "stop refresh lnn, clean info fail");
|
||||
@ -427,23 +427,23 @@ int32_t LnnIpcActiveMetaNode(const MetaNodeConfigInfo *info, char *metaNodeId)
|
||||
return LnnActiveMetaNode(info, metaNodeId);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcDeactiveMetaNode(const char *metaNodeId)
|
||||
int32_t LnnIpcDeactiveMetaNode(const char *metaNodeId)
|
||||
{
|
||||
return LnnDeactiveMetaNode(metaNodeId);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcGetAllMetaNodeInfo(MetaNodeInfo *infos, int32_t *infoNum)
|
||||
int32_t LnnIpcGetAllMetaNodeInfo(MetaNodeInfo *infos, int32_t *infoNum)
|
||||
{
|
||||
return LnnGetAllMetaNodeInfo(infos, infoNum);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcShiftLNNGear(const char *pkgName, const char *callerId, const char *targetNetworkId,
|
||||
int32_t LnnIpcShiftLNNGear(const char *pkgName, const char *callerId, const char *targetNetworkId,
|
||||
const GearMode *mode)
|
||||
{
|
||||
return LnnShiftLNNGear(pkgName, callerId, targetNetworkId, mode);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char *networkId,
|
||||
int32_t LnnIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char *networkId,
|
||||
int32_t retCode)
|
||||
{
|
||||
if (addr == nullptr) {
|
||||
@ -470,7 +470,7 @@ NO_SANITIZE("cfi") int32_t LnnIpcNotifyJoinResult(void *addr, uint32_t addrTypeL
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t MetaNodeIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char *networkId,
|
||||
int32_t MetaNodeIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char *networkId,
|
||||
int32_t retCode)
|
||||
{
|
||||
if (addr == nullptr) {
|
||||
@ -497,7 +497,7 @@ NO_SANITIZE("cfi") int32_t MetaNodeIpcNotifyJoinResult(void *addr, uint32_t addr
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcNotifyLeaveResult(const char *networkId, int32_t retCode)
|
||||
int32_t LnnIpcNotifyLeaveResult(const char *networkId, int32_t retCode)
|
||||
{
|
||||
if (networkId == nullptr) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -516,7 +516,7 @@ NO_SANITIZE("cfi") int32_t LnnIpcNotifyLeaveResult(const char *networkId, int32_
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t MetaNodeIpcNotifyLeaveResult(const char *networkId, int32_t retCode)
|
||||
int32_t MetaNodeIpcNotifyLeaveResult(const char *networkId, int32_t retCode)
|
||||
{
|
||||
if (networkId == nullptr) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -535,17 +535,17 @@ NO_SANITIZE("cfi") int32_t MetaNodeIpcNotifyLeaveResult(const char *networkId, i
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcNotifyOnlineState(bool isOnline, void *info, uint32_t infoTypeLen)
|
||||
int32_t LnnIpcNotifyOnlineState(bool isOnline, void *info, uint32_t infoTypeLen)
|
||||
{
|
||||
return ClinetOnNodeOnlineStateChanged(isOnline, info, infoTypeLen);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcNotifyBasicInfoChanged(void *info, uint32_t infoTypeLen, int32_t type)
|
||||
int32_t LnnIpcNotifyBasicInfoChanged(void *info, uint32_t infoTypeLen, int32_t type)
|
||||
{
|
||||
return ClinetOnNodeBasicInfoChanged(info, infoTypeLen, type);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnIpcNotifyTimeSyncResult(const char *pkgName, int32_t pid, const void *info,
|
||||
int32_t LnnIpcNotifyTimeSyncResult(const char *pkgName, int32_t pid, const void *info,
|
||||
uint32_t infoTypeLen, int32_t retCode)
|
||||
{
|
||||
return ClientOnTimeSyncResult(pkgName, pid, info, infoTypeLen, retCode);
|
||||
@ -593,7 +593,7 @@ static void RemoveRefreshRequestInfoByPkgName(const char *pkgName)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void BusCenterServerDeathCallback(const char *pkgName)
|
||||
void BusCenterServerDeathCallback(const char *pkgName)
|
||||
{
|
||||
if (pkgName == nullptr) {
|
||||
return;
|
||||
|
@ -67,7 +67,7 @@ static void ConvertDeviceInfo(const DeviceInfo *fromDevice, DeviceInfo *toDevice
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void DeviceFound(const DeviceInfo *device, const InnerDeviceInfoAddtions *addtions)
|
||||
static void DeviceFound(const DeviceInfo *device, const InnerDeviceInfoAddtions *addtions)
|
||||
{
|
||||
ConnectionAddr addr;
|
||||
DeviceInfo tmpInfo;
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_log.h"
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnPublishService(const char *pkgName, const PublishInfo *info, bool isInnerRequest)
|
||||
int32_t LnnPublishService(const char *pkgName, const PublishInfo *info, bool isInnerRequest)
|
||||
{
|
||||
LNN_CHECK_AND_RETURN_RET_LOG(!SoftBusIsRamTest(), SOFTBUS_ERR, "LnnPublishService: ram test abort");
|
||||
int32_t ret;
|
||||
@ -39,7 +39,7 @@ NO_SANITIZE("cfi") int32_t LnnPublishService(const char *pkgName, const PublishI
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnUnPublishService(const char *pkgName, int32_t publishId, bool isInnerRequest)
|
||||
int32_t LnnUnPublishService(const char *pkgName, int32_t publishId, bool isInnerRequest)
|
||||
{
|
||||
if (!isInnerRequest) {
|
||||
if (DiscUnPublishService(pkgName, publishId) != SOFTBUS_OK) {
|
||||
@ -55,7 +55,7 @@ NO_SANITIZE("cfi") int32_t LnnUnPublishService(const char *pkgName, int32_t publ
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStartDiscDevice(const char *pkgName, const SubscribeInfo *info, const InnerCallback *cb,
|
||||
int32_t LnnStartDiscDevice(const char *pkgName, const SubscribeInfo *info, const InnerCallback *cb,
|
||||
bool isInnerRequest)
|
||||
{
|
||||
LNN_CHECK_AND_RETURN_RET_LOG(!SoftBusIsRamTest(), SOFTBUS_ERR, "LnnStartDiscDevice: ram test abort");
|
||||
@ -78,7 +78,7 @@ NO_SANITIZE("cfi") int32_t LnnStartDiscDevice(const char *pkgName, const Subscri
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStopDiscDevice(const char *pkgName, int32_t subscribeId, bool isInnerRequest)
|
||||
int32_t LnnStopDiscDevice(const char *pkgName, int32_t subscribeId, bool isInnerRequest)
|
||||
{
|
||||
if (!isInnerRequest) {
|
||||
if (DiscStopDiscovery(pkgName, subscribeId) != SOFTBUS_OK) {
|
||||
|
@ -56,7 +56,7 @@ static LnnDiscoveryImplCallback g_discoveryCallback = {
|
||||
.OnDeviceFound = DeviceFound,
|
||||
};
|
||||
|
||||
NO_SANITIZE("cfi") static void ReportDeviceFoundResultEvt(void)
|
||||
static void ReportDeviceFoundResultEvt(void)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_INFO, "report device found result evt enter");
|
||||
if (SoftBusRecordDiscoveryResult(DEVICE_FOUND, NULL) != SOFTBUS_OK) {
|
||||
@ -64,7 +64,7 @@ NO_SANITIZE("cfi") static void ReportDeviceFoundResultEvt(void)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void DeviceFound(const ConnectionAddr *addr)
|
||||
static void DeviceFound(const ConnectionAddr *addr)
|
||||
{
|
||||
if (addr == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "device addr is null\n");
|
||||
@ -76,7 +76,7 @@ NO_SANITIZE("cfi") static void DeviceFound(const ConnectionAddr *addr)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitDiscoveryManager(void)
|
||||
int32_t LnnInitDiscoveryManager(void)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
@ -92,7 +92,7 @@ NO_SANITIZE("cfi") int32_t LnnInitDiscoveryManager(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStartPublish(void)
|
||||
int32_t LnnStartPublish(void)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
@ -109,7 +109,7 @@ NO_SANITIZE("cfi") int32_t LnnStartPublish(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnStopPublish(void)
|
||||
void LnnStopPublish(void)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
@ -124,7 +124,7 @@ NO_SANITIZE("cfi") void LnnStopPublish(void)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void ReportStartDiscoveryResultEvt(void)
|
||||
static void ReportStartDiscoveryResultEvt(void)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_INFO, "report start discovery result evt enter");
|
||||
if (SoftBusRecordDiscoveryResult(START_DISCOVERY, NULL) != SOFTBUS_OK) {
|
||||
@ -132,7 +132,7 @@ NO_SANITIZE("cfi") static void ReportStartDiscoveryResultEvt(void)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStartDiscovery(void)
|
||||
int32_t LnnStartDiscovery(void)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
@ -150,7 +150,7 @@ NO_SANITIZE("cfi") int32_t LnnStartDiscovery(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnStopDiscovery(void)
|
||||
void LnnStopDiscovery(void)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_log.h"
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitLaneHub(void)
|
||||
int32_t LnnInitLaneHub(void)
|
||||
{
|
||||
if (InitLane() != SOFTBUS_OK) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "init lane fail");
|
||||
@ -54,7 +54,7 @@ int32_t LnnInitLaneHubDelay(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitLaneHub(void)
|
||||
void LnnDeinitLaneHub(void)
|
||||
{
|
||||
LnnDeinitQos();
|
||||
DeinitLane();
|
||||
|
@ -610,7 +610,7 @@ static void PeriodDumpLocalInfo(void *para)
|
||||
LnnAsyncCallbackDelayHelper(GetLooper(LOOP_TYPE_DEFAULT), PeriodDumpLocalInfo, NULL, HB_PERIOD_DUMP_LOCAL_INFO_LEN);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStartHeartbeatFrameDelay(void)
|
||||
int32_t LnnStartHeartbeatFrameDelay(void)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_INFO, "heartbeat(HB) FSM start.");
|
||||
LnnAsyncCallbackDelayHelper(GetLooper(LOOP_TYPE_DEFAULT), PeriodDumpLocalInfo, NULL, HB_PERIOD_DUMP_LOCAL_INFO_LEN);
|
||||
@ -631,12 +631,12 @@ NO_SANITIZE("cfi") int32_t LnnStartHeartbeatFrameDelay(void)
|
||||
return LnnStartHeartbeat(0);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetHeartbeatMediumParam(const LnnHeartbeatMediumParam *param)
|
||||
int32_t LnnSetHeartbeatMediumParam(const LnnHeartbeatMediumParam *param)
|
||||
{
|
||||
return LnnSetMediumParamBySpecificType(param);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnOfflineTimingByHeartbeat(const char *networkId, ConnectionAddrType addrType)
|
||||
int32_t LnnOfflineTimingByHeartbeat(const char *networkId, ConnectionAddrType addrType)
|
||||
{
|
||||
if (networkId == NULL) {
|
||||
LLOGE("HB offline timing get invalid param");
|
||||
@ -676,7 +676,7 @@ static void ReportBusinessDiscoveryResultEvt(const char *pkgName, int32_t discCn
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnShiftLNNGear(const char *pkgName, const char *callerId, const char *targetNetworkId,
|
||||
int32_t LnnShiftLNNGear(const char *pkgName, const char *callerId, const char *targetNetworkId,
|
||||
const GearMode *mode)
|
||||
{
|
||||
if (pkgName == NULL || mode == NULL || callerId == NULL) {
|
||||
@ -753,7 +753,7 @@ int32_t HmosShiftLNNGear(const char *callerId, const GearMode *mode, LnnHeartbea
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnUpdateHeartbeatInfo(LnnHeartbeatUpdateInfoType type)
|
||||
void LnnUpdateHeartbeatInfo(LnnHeartbeatUpdateInfoType type)
|
||||
{
|
||||
LLOGI("HB update heartbeat info, type:%d", type);
|
||||
LnnUpdateSendInfoStrategy(type);
|
||||
@ -778,7 +778,7 @@ static void HbDelayCheckTrustedRelation(void *para)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnHbOnTrustedRelationIncreased(int32_t groupType)
|
||||
void LnnHbOnTrustedRelationIncreased(int32_t groupType)
|
||||
{
|
||||
/* If it is a peer-to-peer group, delay initialization to give BR networking priority. */
|
||||
int32_t ret = LnnStartHeartbeat(0);
|
||||
@ -792,7 +792,7 @@ NO_SANITIZE("cfi") void LnnHbOnTrustedRelationIncreased(int32_t groupType)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnHbOnTrustedRelationReduced(void)
|
||||
void LnnHbOnTrustedRelationReduced(void)
|
||||
{
|
||||
if (LnnAsyncCallbackDelayHelper(GetLooper(LOOP_TYPE_DEFAULT), HbDelayCheckTrustedRelation, NULL,
|
||||
CHECK_TRUSTED_RELATION_TIME) != SOFTBUS_OK) {
|
||||
@ -813,7 +813,7 @@ static void LnnHbUnsubscribeTask(void)
|
||||
LnnDcUnsubscribe(&g_dcTask);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitHeartbeat(void)
|
||||
int32_t LnnInitHeartbeat(void)
|
||||
{
|
||||
if (LnnHbStrategyInit() != SOFTBUS_OK) {
|
||||
LLOGE("HB strategy module init fail!");
|
||||
@ -873,7 +873,7 @@ NO_SANITIZE("cfi") int32_t LnnInitHeartbeat(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitHeartbeat(void)
|
||||
void LnnDeinitHeartbeat(void)
|
||||
{
|
||||
LnnHbUnsubscribeTask();
|
||||
LnnHbStrategyDeinit();
|
||||
|
@ -175,7 +175,7 @@ static void FreeUnhandledHbMessage(int32_t msgType, void *para)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static bool HbFsmStateProcessFunc(FsmStateMachine *fsm, int32_t msgType, void *para)
|
||||
static bool HbFsmStateProcessFunc(FsmStateMachine *fsm, int32_t msgType, void *para)
|
||||
{
|
||||
int32_t i, eventNum, ret;
|
||||
LnnHeartbeatStateHandler *stateHandler = NULL;
|
||||
@ -329,7 +329,7 @@ static int32_t RemoveScreenOffCheckStatus(FsmCtrlMsgObj *ctrlMsgObj, SoftBusMess
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t CustomFuncRemoveHbMsg(const SoftBusMessage *msg, void *args)
|
||||
static int32_t CustomFuncRemoveHbMsg(const SoftBusMessage *msg, void *args)
|
||||
{
|
||||
if (!CheckRemoveHbMsgParams(msg, args)) {
|
||||
return 1;
|
||||
@ -370,7 +370,7 @@ static void RemoveHbMsgByCustObj(LnnHeartbeatFsm *hbFsm, LnnHeartbeatEventType e
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnRemoveSendEndMsg(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type, bool wakeupFlag,
|
||||
void LnnRemoveSendEndMsg(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type, bool wakeupFlag,
|
||||
bool isRelay, bool *isRemoved)
|
||||
{
|
||||
if (hbFsm == NULL || isRemoved == NULL) {
|
||||
@ -389,7 +389,7 @@ NO_SANITIZE("cfi") void LnnRemoveSendEndMsg(LnnHeartbeatFsm *hbFsm, LnnHeartbeat
|
||||
msgPara.isRemoved = NULL;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnRemoveCheckDevStatusMsg(LnnHeartbeatFsm *hbFsm, LnnCheckDevStatusMsgPara *msgPara)
|
||||
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");
|
||||
@ -398,7 +398,7 @@ NO_SANITIZE("cfi") void LnnRemoveCheckDevStatusMsg(LnnHeartbeatFsm *hbFsm, LnnCh
|
||||
RemoveHbMsgByCustObj(hbFsm, EVENT_HB_CHECK_DEV_STATUS, (void *)msgPara);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnRemoveScreenOffCheckStatusMsg(LnnHeartbeatFsm *hbFsm, LnnCheckDevStatusMsgPara *msgPara)
|
||||
void LnnRemoveScreenOffCheckStatusMsg(LnnHeartbeatFsm *hbFsm, LnnCheckDevStatusMsgPara *msgPara)
|
||||
{
|
||||
if (hbFsm == NULL || msgPara == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB remove check msg get invalid param");
|
||||
@ -407,7 +407,7 @@ NO_SANITIZE("cfi") void LnnRemoveScreenOffCheckStatusMsg(LnnHeartbeatFsm *hbFsm,
|
||||
RemoveHbMsgByCustObj(hbFsm, EVENT_HB_SCREEN_OFF_CHECK_STATUS, (void *)msgPara);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnRemoveProcessSendOnceMsg(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType hbType,
|
||||
void LnnRemoveProcessSendOnceMsg(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType hbType,
|
||||
LnnHeartbeatStrategyType strategyType)
|
||||
{
|
||||
if (hbFsm == NULL) {
|
||||
@ -1029,7 +1029,7 @@ static int32_t OnScreeOffCheckDevStatus(FsmStateMachine *fsm, int32_t msgType, v
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDestroyHeartbeatFsm(LnnHeartbeatFsm *hbFsm)
|
||||
void LnnDestroyHeartbeatFsm(LnnHeartbeatFsm *hbFsm)
|
||||
{
|
||||
if (hbFsm == NULL) {
|
||||
return;
|
||||
@ -1077,7 +1077,7 @@ static int32_t InitHeartbeatFsm(LnnHeartbeatFsm *hbFsm)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") LnnHeartbeatFsm *LnnCreateHeartbeatFsm(void)
|
||||
LnnHeartbeatFsm *LnnCreateHeartbeatFsm(void)
|
||||
{
|
||||
LnnHeartbeatFsm *hbFsm = NULL;
|
||||
|
||||
@ -1096,7 +1096,7 @@ NO_SANITIZE("cfi") LnnHeartbeatFsm *LnnCreateHeartbeatFsm(void)
|
||||
return hbFsm;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStartHeartbeatFsm(LnnHeartbeatFsm *hbFsm)
|
||||
int32_t LnnStartHeartbeatFsm(LnnHeartbeatFsm *hbFsm)
|
||||
{
|
||||
if (hbFsm == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB start fsm is null");
|
||||
@ -1110,7 +1110,7 @@ NO_SANITIZE("cfi") int32_t LnnStartHeartbeatFsm(LnnHeartbeatFsm *hbFsm)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStopHeartbeatFsm(LnnHeartbeatFsm *hbFsm)
|
||||
int32_t LnnStopHeartbeatFsm(LnnHeartbeatFsm *hbFsm)
|
||||
{
|
||||
if (hbFsm == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB stop fsm is null");
|
||||
@ -1123,7 +1123,7 @@ NO_SANITIZE("cfi") int32_t LnnStopHeartbeatFsm(LnnHeartbeatFsm *hbFsm)
|
||||
return LnnFsmDeinit(&hbFsm->fsm);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnPostNextSendOnceMsgToHbFsm(LnnHeartbeatFsm *hbFsm, const LnnProcessSendOnceMsgPara *para,
|
||||
int32_t LnnPostNextSendOnceMsgToHbFsm(LnnHeartbeatFsm *hbFsm, const LnnProcessSendOnceMsgPara *para,
|
||||
uint64_t delayMillis)
|
||||
{
|
||||
LnnProcessSendOnceMsgPara *dupPara = NULL;
|
||||
@ -1148,7 +1148,7 @@ NO_SANITIZE("cfi") int32_t LnnPostNextSendOnceMsgToHbFsm(LnnHeartbeatFsm *hbFsm,
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnPostSendBeginMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type,
|
||||
int32_t LnnPostSendBeginMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type,
|
||||
bool wakeupFlag, LnnProcessSendOnceMsgPara *msgPara, uint64_t delayMillis)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_DBG, "LnnPostSendBeginMsgToHbFsm enter hbType=%d, isSyncData=%d",
|
||||
@ -1177,7 +1177,7 @@ NO_SANITIZE("cfi") int32_t LnnPostSendBeginMsgToHbFsm(LnnHeartbeatFsm *hbFsm, Ln
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnPostSendEndMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatSendEndData *custData,
|
||||
int32_t LnnPostSendEndMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatSendEndData *custData,
|
||||
uint64_t delayMillis)
|
||||
{
|
||||
LnnHeartbeatSendEndData *dupData = NULL;
|
||||
@ -1200,7 +1200,7 @@ NO_SANITIZE("cfi") int32_t LnnPostSendEndMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnH
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnPostStartMsgToHbFsm(LnnHeartbeatFsm *hbFsm, uint64_t delayMillis)
|
||||
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");
|
||||
@ -1209,7 +1209,7 @@ NO_SANITIZE("cfi") int32_t LnnPostStartMsgToHbFsm(LnnHeartbeatFsm *hbFsm, uint64
|
||||
return LnnFsmPostMessageDelay(&hbFsm->fsm, EVENT_HB_START_PROCESS, NULL, delayMillis);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnPostStopMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type)
|
||||
int32_t LnnPostStopMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type)
|
||||
{
|
||||
LnnHeartbeatType *newType = NULL;
|
||||
|
||||
@ -1231,7 +1231,7 @@ NO_SANITIZE("cfi") int32_t LnnPostStopMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHear
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnPostTransStateMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatEventType evtType)
|
||||
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");
|
||||
@ -1244,7 +1244,7 @@ NO_SANITIZE("cfi") int32_t LnnPostTransStateMsgToHbFsm(LnnHeartbeatFsm *hbFsm, L
|
||||
return LnnFsmPostMessage(&hbFsm->fsm, evtType, NULL);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnPostSetMediumParamMsgToHbFsm(LnnHeartbeatFsm *hbFsm, const LnnHeartbeatMediumParam *para)
|
||||
int32_t LnnPostSetMediumParamMsgToHbFsm(LnnHeartbeatFsm *hbFsm, const LnnHeartbeatMediumParam *para)
|
||||
{
|
||||
LnnHeartbeatMediumParam *dupPara = NULL;
|
||||
|
||||
@ -1266,7 +1266,7 @@ NO_SANITIZE("cfi") int32_t LnnPostSetMediumParamMsgToHbFsm(LnnHeartbeatFsm *hbFs
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnPostCheckDevStatusMsgToHbFsm(LnnHeartbeatFsm *hbFsm,
|
||||
int32_t LnnPostCheckDevStatusMsgToHbFsm(LnnHeartbeatFsm *hbFsm,
|
||||
const LnnCheckDevStatusMsgPara *para, uint64_t delayMillis)
|
||||
{
|
||||
LnnCheckDevStatusMsgPara *dupPara = NULL;
|
||||
@ -1296,7 +1296,7 @@ NO_SANITIZE("cfi") int32_t LnnPostCheckDevStatusMsgToHbFsm(LnnHeartbeatFsm *hbFs
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnPostScreenOffCheckDevMsgToHbFsm(LnnHeartbeatFsm *hbFsm,
|
||||
int32_t LnnPostScreenOffCheckDevMsgToHbFsm(LnnHeartbeatFsm *hbFsm,
|
||||
const LnnCheckDevStatusMsgPara *para, uint64_t delayMillis)
|
||||
{
|
||||
LnnCheckDevStatusMsgPara *dupPara = NULL;
|
||||
@ -1327,7 +1327,7 @@ NO_SANITIZE("cfi") int32_t LnnPostScreenOffCheckDevMsgToHbFsm(LnnHeartbeatFsm *h
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnPostUpdateSendInfoMsgToHbFsm(LnnHeartbeatFsm *hbFsm, LnnHeartbeatUpdateInfoType type)
|
||||
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");
|
||||
|
@ -500,7 +500,7 @@ static int32_t HbMediumMgrRecvHigherWeight(const char *udidHash, int32_t weight,
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void HbMediumMgrRelayProcess(const char *udidHash, ConnectionAddrType type,
|
||||
static void HbMediumMgrRelayProcess(const char *udidHash, ConnectionAddrType type,
|
||||
LnnHeartbeatType hbType)
|
||||
{
|
||||
(void)type;
|
||||
@ -572,7 +572,7 @@ void LnnHbClearRecvList(void)
|
||||
(void)SoftBusMutexUnlock(&g_hbRecvList->lock);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDumpHbMgrRecvList(void)
|
||||
void LnnDumpHbMgrRecvList(void)
|
||||
{
|
||||
#define HB_DUMP_UPDATE_INFO_MAX_NUM 10
|
||||
int32_t dumpCount = 0;
|
||||
@ -607,7 +607,7 @@ NO_SANITIZE("cfi") void LnnDumpHbMgrRecvList(void)
|
||||
(void)SoftBusMutexUnlock(&g_hbRecvList->lock);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDumpHbOnlineNodeList(void)
|
||||
void LnnDumpHbOnlineNodeList(void)
|
||||
{
|
||||
#define HB_DUMP_ONLINE_NODE_MAX_NUM 5
|
||||
int32_t i, infoNum;
|
||||
@ -644,7 +644,7 @@ NO_SANITIZE("cfi") void LnnDumpHbOnlineNodeList(void)
|
||||
SoftBusFree(info);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnHbMediumMgrInit(void)
|
||||
int32_t LnnHbMediumMgrInit(void)
|
||||
{
|
||||
if (LnnRegistBleHeartbeatMediumMgr() != SOFTBUS_OK) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB regist ble heartbeat manager fail");
|
||||
@ -657,7 +657,7 @@ NO_SANITIZE("cfi") int32_t LnnHbMediumMgrInit(void)
|
||||
return HbInitRecvList();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static bool VisitHbMediumMgrSendBegin(LnnHeartbeatType *typeSet, LnnHeartbeatType eachType,
|
||||
static bool VisitHbMediumMgrSendBegin(LnnHeartbeatType *typeSet, LnnHeartbeatType eachType,
|
||||
void *data)
|
||||
{
|
||||
(void)typeSet;
|
||||
@ -691,7 +691,7 @@ NO_SANITIZE("cfi") static bool VisitHbMediumMgrSendBegin(LnnHeartbeatType *typeS
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnHbMediumMgrSendBegin(LnnHeartbeatSendBeginData *custData)
|
||||
int32_t LnnHbMediumMgrSendBegin(LnnHeartbeatSendBeginData *custData)
|
||||
{
|
||||
if (custData == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -703,7 +703,7 @@ NO_SANITIZE("cfi") int32_t LnnHbMediumMgrSendBegin(LnnHeartbeatSendBeginData *cu
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static bool VisitHbMediumMgrSendEnd(LnnHeartbeatType *typeSet, LnnHeartbeatType eachType,
|
||||
static bool VisitHbMediumMgrSendEnd(LnnHeartbeatType *typeSet, LnnHeartbeatType eachType,
|
||||
void *data)
|
||||
{
|
||||
(void)typeSet;
|
||||
@ -742,7 +742,7 @@ NO_SANITIZE("cfi") static bool VisitHbMediumMgrSendEnd(LnnHeartbeatType *typeSet
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnHbMediumMgrSendEnd(LnnHeartbeatSendEndData *custData)
|
||||
int32_t LnnHbMediumMgrSendEnd(LnnHeartbeatSendEndData *custData)
|
||||
{
|
||||
if (!LnnVisitHbTypeSet(VisitHbMediumMgrSendEnd, &custData->hbType, custData)) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB manager send end hbType(%d) fail", custData->hbType);
|
||||
@ -751,7 +751,7 @@ NO_SANITIZE("cfi") int32_t LnnHbMediumMgrSendEnd(LnnHeartbeatSendEndData *custDa
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static bool VisitHbMediumMgrStop(LnnHeartbeatType *typeSet, LnnHeartbeatType eachType, void *data)
|
||||
static bool VisitHbMediumMgrStop(LnnHeartbeatType *typeSet, LnnHeartbeatType eachType, void *data)
|
||||
{
|
||||
(void)typeSet;
|
||||
(void)data;
|
||||
@ -778,7 +778,7 @@ NO_SANITIZE("cfi") static bool VisitHbMediumMgrStop(LnnHeartbeatType *typeSet, L
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnHbMediumMgrStop(LnnHeartbeatType *type)
|
||||
int32_t LnnHbMediumMgrStop(LnnHeartbeatType *type)
|
||||
{
|
||||
if (!LnnVisitHbTypeSet(VisitHbMediumMgrStop, type, NULL)) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB manager stop hbType(%d) fail", *type);
|
||||
@ -787,7 +787,7 @@ NO_SANITIZE("cfi") int32_t LnnHbMediumMgrStop(LnnHeartbeatType *type)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnHbMediumMgrDeinit(void)
|
||||
void LnnHbMediumMgrDeinit(void)
|
||||
{
|
||||
int32_t i;
|
||||
|
||||
@ -805,7 +805,7 @@ NO_SANITIZE("cfi") void LnnHbMediumMgrDeinit(void)
|
||||
HbDeinitRecvList();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnHbMediumMgrSetParam(const LnnHeartbeatMediumParam *param)
|
||||
int32_t LnnHbMediumMgrSetParam(const LnnHeartbeatMediumParam *param)
|
||||
{
|
||||
int32_t id, ret;
|
||||
|
||||
@ -830,7 +830,7 @@ NO_SANITIZE("cfi") int32_t LnnHbMediumMgrSetParam(const LnnHeartbeatMediumParam
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnHbMediumMgrUpdateSendInfo(LnnHeartbeatUpdateInfoType type)
|
||||
int32_t LnnHbMediumMgrUpdateSendInfo(LnnHeartbeatUpdateInfoType type)
|
||||
{
|
||||
int32_t i;
|
||||
|
||||
@ -866,7 +866,7 @@ static bool VisitRegistHeartbeatMediumMgr(LnnHeartbeatType *typeSet, LnnHeartbea
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnRegistHeartbeatMediumMgr(LnnHeartbeatMediumMgr *mgr)
|
||||
int32_t LnnRegistHeartbeatMediumMgr(LnnHeartbeatMediumMgr *mgr)
|
||||
{
|
||||
// TODO: One-to-one correspondence between LnnHeartbeatMediumMgr and implementation.
|
||||
if (mgr == NULL) {
|
||||
@ -898,7 +898,7 @@ static bool VisitUnRegistHeartbeatMediumMgr(LnnHeartbeatType *typeSet, LnnHeartb
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnUnRegistHeartbeatMediumMgr(LnnHeartbeatMediumMgr *mgr)
|
||||
int32_t LnnUnRegistHeartbeatMediumMgr(LnnHeartbeatMediumMgr *mgr)
|
||||
{
|
||||
if (mgr == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB unregist manager get invalid param");
|
||||
|
@ -159,7 +159,7 @@ static LnnHeartbeatParamManager *GetParamMgrByTypeLocked(LnnHeartbeatType type)
|
||||
return g_hbParamMgr[id];
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetGearModeBySpecificType(GearMode *mode, LnnHeartbeatType type)
|
||||
int32_t LnnGetGearModeBySpecificType(GearMode *mode, LnnHeartbeatType type)
|
||||
{
|
||||
LnnHeartbeatParamManager *paramMgr = NULL;
|
||||
|
||||
@ -230,7 +230,7 @@ static int32_t FirstSetGearModeByCallerId(const char *callerId, int64_t nowTime,
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetGearModeBySpecificType(const char *callerId, const GearMode *mode,
|
||||
int32_t LnnSetGearModeBySpecificType(const char *callerId, const GearMode *mode,
|
||||
LnnHeartbeatType type)
|
||||
{
|
||||
int64_t nowTime;
|
||||
@ -312,8 +312,12 @@ static int32_t SendEachSeparately(LnnHeartbeatFsm *hbFsm, LnnProcessSendOnceMsgP
|
||||
uint32_t sendCnt = isRelayV0 ? 1 : HB_SEND_SEPARATELY_CNT;
|
||||
LnnHeartbeatType splitHbType = registedHbType;
|
||||
(void)LnnVisitHbTypeSet(VisitClearNoneSplitHbType, &splitHbType, NULL);
|
||||
LnnHeartbeatSendEndData endData = {.hbType = splitHbType, .wakeupFlag = wakeupFlag,
|
||||
.isRelay = msgPara->isRelay, .isLastEnd = false};
|
||||
LnnHeartbeatSendEndData endData = {
|
||||
.hbType = splitHbType,
|
||||
.wakeupFlag = wakeupFlag,
|
||||
.isRelay = msgPara->isRelay,
|
||||
.isLastEnd = false,
|
||||
};
|
||||
for (i = 1; i < sendCnt; ++i) {
|
||||
if (splitHbType < HEARTBEAT_TYPE_MIN) {
|
||||
break;
|
||||
@ -510,7 +514,7 @@ static bool VisitRegistParamMgr(LnnHeartbeatType *typeSet, LnnHeartbeatType each
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnRegistParamMgrByType(LnnHeartbeatType type)
|
||||
int32_t LnnRegistParamMgrByType(LnnHeartbeatType type)
|
||||
{
|
||||
if (SoftBusMutexLock(&g_hbStrategyMutex) != 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB regist paramMgr lock mutex fail");
|
||||
@ -556,7 +560,7 @@ static bool VisitUnRegistParamMgr(LnnHeartbeatType *typeSet, LnnHeartbeatType ea
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnUnRegistParamMgrByType(LnnHeartbeatType type)
|
||||
void LnnUnRegistParamMgrByType(LnnHeartbeatType type)
|
||||
{
|
||||
if (SoftBusMutexLock(&g_hbStrategyMutex) != 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB unRegist paramMgr lock mutex fail");
|
||||
@ -566,7 +570,7 @@ NO_SANITIZE("cfi") void LnnUnRegistParamMgrByType(LnnHeartbeatType type)
|
||||
(void)SoftBusMutexUnlock(&g_hbStrategyMutex);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetMediumParamBySpecificType(const LnnHeartbeatMediumParam *param)
|
||||
int32_t LnnSetMediumParamBySpecificType(const LnnHeartbeatMediumParam *param)
|
||||
{
|
||||
LnnHeartbeatParamManager *paramMgr = NULL;
|
||||
|
||||
@ -609,7 +613,7 @@ NO_SANITIZE("cfi") int32_t LnnSetMediumParamBySpecificType(const LnnHeartbeatMed
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetMediumParamBySpecificType(LnnHeartbeatMediumParam *param, LnnHeartbeatType type)
|
||||
int32_t LnnGetMediumParamBySpecificType(LnnHeartbeatMediumParam *param, LnnHeartbeatType type)
|
||||
{
|
||||
const LnnHeartbeatParamManager *paramMgr = NULL;
|
||||
|
||||
@ -640,7 +644,7 @@ NO_SANITIZE("cfi") int32_t LnnGetMediumParamBySpecificType(LnnHeartbeatMediumPar
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetHbStrategyManager(LnnHeartbeatStrategyManager *mgr, LnnHeartbeatType hbType,
|
||||
int32_t LnnGetHbStrategyManager(LnnHeartbeatStrategyManager *mgr, LnnHeartbeatType hbType,
|
||||
LnnHeartbeatStrategyType strategyType)
|
||||
{
|
||||
if (mgr == NULL) {
|
||||
@ -657,7 +661,7 @@ NO_SANITIZE("cfi") int32_t LnnGetHbStrategyManager(LnnHeartbeatStrategyManager *
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStartNewHbStrategyFsm(void)
|
||||
int32_t LnnStartNewHbStrategyFsm(void)
|
||||
{
|
||||
LnnHeartbeatFsm *hbFsm = NULL;
|
||||
|
||||
@ -694,7 +698,7 @@ static bool IsSupportBurstFeature(const char *networkId)
|
||||
return false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStartOfflineTimingStrategy(const char *networkId, ConnectionAddrType addrType)
|
||||
int32_t LnnStartOfflineTimingStrategy(const char *networkId, ConnectionAddrType addrType)
|
||||
{
|
||||
GearMode mode = {0};
|
||||
LnnCheckDevStatusMsgPara msgPara = {0};
|
||||
@ -720,7 +724,7 @@ NO_SANITIZE("cfi") int32_t LnnStartOfflineTimingStrategy(const char *networkId,
|
||||
return LnnPostCheckDevStatusMsgToHbFsm(g_hbFsm, &msgPara, delayMillis);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStopOfflineTimingStrategy(const char *networkId, ConnectionAddrType addrType)
|
||||
int32_t LnnStopOfflineTimingStrategy(const char *networkId, ConnectionAddrType addrType)
|
||||
{
|
||||
if (networkId == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -738,7 +742,7 @@ NO_SANITIZE("cfi") int32_t LnnStopOfflineTimingStrategy(const char *networkId, C
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStartScreenChangeOfflineTiming(const char *networkId, ConnectionAddrType addrType)
|
||||
int32_t LnnStartScreenChangeOfflineTiming(const char *networkId, ConnectionAddrType addrType)
|
||||
{
|
||||
LLOGI("start screen changed offline timing");
|
||||
if (networkId == NULL || addrType >= CONNECTION_ADDR_MAX) {
|
||||
@ -760,7 +764,7 @@ NO_SANITIZE("cfi") int32_t LnnStartScreenChangeOfflineTiming(const char *network
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStopScreenChangeOfflineTiming(const char *networkId, ConnectionAddrType addrType)
|
||||
int32_t LnnStopScreenChangeOfflineTiming(const char *networkId, ConnectionAddrType addrType)
|
||||
{
|
||||
if (networkId == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -778,7 +782,7 @@ NO_SANITIZE("cfi") int32_t LnnStopScreenChangeOfflineTiming(const char *networkI
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStartHbByTypeAndStrategy(LnnHeartbeatType hbType, LnnHeartbeatStrategyType strategyType,
|
||||
int32_t LnnStartHbByTypeAndStrategy(LnnHeartbeatType hbType, LnnHeartbeatStrategyType strategyType,
|
||||
bool isRelay)
|
||||
{
|
||||
LnnProcessSendOnceMsgPara msgPara = {
|
||||
@ -809,7 +813,7 @@ int32_t LnnStopV0HeartbeatAndNotTransState()
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStopHeartbeatByType(LnnHeartbeatType type)
|
||||
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");
|
||||
@ -823,14 +827,18 @@ NO_SANITIZE("cfi") int32_t LnnStopHeartbeatByType(LnnHeartbeatType type)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStopHeartBeatAdvByTypeNow(LnnHeartbeatType type)
|
||||
int32_t LnnStopHeartBeatAdvByTypeNow(LnnHeartbeatType type)
|
||||
{
|
||||
if (type <= HEARTBEAT_TYPE_MIN || type >= HEARTBEAT_TYPE_MAX) {
|
||||
LLOGE("HB send once get hbType(%d) is not available", type);
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
LnnHeartbeatSendEndData endData =
|
||||
{.hbType = type, .wakeupFlag = false, .isRelay = false, .isLastEnd = true};
|
||||
LnnHeartbeatSendEndData endData = {
|
||||
.hbType = type,
|
||||
.wakeupFlag = false,
|
||||
.isRelay = false,
|
||||
.isLastEnd = true,
|
||||
};
|
||||
if (LnnPostSendEndMsgToHbFsm(g_hbFsm, &endData, 0) != SOFTBUS_OK) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB send once end fail, hbType:%d", type);
|
||||
return SOFTBUS_ERR;
|
||||
@ -852,7 +860,7 @@ static bool VisitEnableHbType(LnnHeartbeatType *typeSet, LnnHeartbeatType eachTy
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnEnableHeartbeatByType(LnnHeartbeatType type, bool isEnable)
|
||||
int32_t LnnEnableHeartbeatByType(LnnHeartbeatType type, bool isEnable)
|
||||
{
|
||||
if (SoftBusMutexLock(&g_hbStrategyMutex) != 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB enable hbType lock mutex fail");
|
||||
@ -863,7 +871,7 @@ NO_SANITIZE("cfi") int32_t LnnEnableHeartbeatByType(LnnHeartbeatType type, bool
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnIsHeartbeatEnable(LnnHeartbeatType type)
|
||||
bool LnnIsHeartbeatEnable(LnnHeartbeatType type)
|
||||
{
|
||||
bool ret = false;
|
||||
LnnHeartbeatParamManager *paramMgr = NULL;
|
||||
@ -878,17 +886,17 @@ NO_SANITIZE("cfi") bool LnnIsHeartbeatEnable(LnnHeartbeatType type)
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetHbAsMasterNodeState(bool isMasterNode)
|
||||
int32_t LnnSetHbAsMasterNodeState(bool isMasterNode)
|
||||
{
|
||||
return LnnPostTransStateMsgToHbFsm(g_hbFsm, isMasterNode ? EVENT_HB_AS_MASTER_NODE : EVENT_HB_AS_NORMAL_NODE);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnUpdateSendInfoStrategy(LnnHeartbeatUpdateInfoType type)
|
||||
int32_t LnnUpdateSendInfoStrategy(LnnHeartbeatUpdateInfoType type)
|
||||
{
|
||||
return LnnPostUpdateSendInfoMsgToHbFsm(g_hbFsm, type);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnHbStrategyInit(void)
|
||||
int32_t LnnHbStrategyInit(void)
|
||||
{
|
||||
if (SoftBusMutexInit(&g_hbStrategyMutex, NULL) != 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB strategy module init mutex fail!");
|
||||
@ -905,7 +913,7 @@ NO_SANITIZE("cfi") int32_t LnnHbStrategyInit(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnHbStrategyDeinit(void)
|
||||
void LnnHbStrategyDeinit(void)
|
||||
{
|
||||
if (g_hbFsm != NULL) {
|
||||
(void)LnnStopHeartbeatFsm(g_hbFsm);
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "softbus_log.h"
|
||||
#include "softbus_utils.h"
|
||||
|
||||
NO_SANITIZE("cfi") LnnHeartbeatType LnnConvertConnAddrTypeToHbType(ConnectionAddrType addrType)
|
||||
LnnHeartbeatType LnnConvertConnAddrTypeToHbType(ConnectionAddrType addrType)
|
||||
{
|
||||
switch (addrType) {
|
||||
case CONNECTION_ADDR_WLAN:
|
||||
@ -46,7 +46,7 @@ NO_SANITIZE("cfi") LnnHeartbeatType LnnConvertConnAddrTypeToHbType(ConnectionAdd
|
||||
return HEARTBEAT_TYPE_MAX;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") ConnectionAddrType LnnConvertHbTypeToConnAddrType(LnnHeartbeatType type)
|
||||
ConnectionAddrType LnnConvertHbTypeToConnAddrType(LnnHeartbeatType type)
|
||||
{
|
||||
switch (type) {
|
||||
case HEARTBEAT_TYPE_UDP:
|
||||
@ -61,7 +61,7 @@ NO_SANITIZE("cfi") ConnectionAddrType LnnConvertHbTypeToConnAddrType(LnnHeartbea
|
||||
return CONNECTION_ADDR_MAX;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnConvertHbTypeToId(LnnHeartbeatType type)
|
||||
int32_t LnnConvertHbTypeToId(LnnHeartbeatType type)
|
||||
{
|
||||
int32_t cnt = -1;
|
||||
|
||||
@ -142,7 +142,7 @@ static bool HbHasActiveP2pConnection(const char *networkId)
|
||||
return isOnline;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnHasActiveConnection(const char *networkId, ConnectionAddrType addrType)
|
||||
bool LnnHasActiveConnection(const char *networkId, ConnectionAddrType addrType)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
@ -168,7 +168,7 @@ NO_SANITIZE("cfi") bool LnnHasActiveConnection(const char *networkId, Connection
|
||||
return false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnVisitHbTypeSet(VisitHbTypeCb callback, LnnHeartbeatType *typeSet, void *data)
|
||||
bool LnnVisitHbTypeSet(VisitHbTypeCb callback, LnnHeartbeatType *typeSet, void *data)
|
||||
{
|
||||
bool isFinish = false;
|
||||
LnnHeartbeatType i;
|
||||
@ -201,7 +201,7 @@ static bool VisitCheckSupportedHbType(LnnHeartbeatType *typeSet, LnnHeartbeatTyp
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnCheckSupportedHbType(LnnHeartbeatType *srcType, LnnHeartbeatType *dstType)
|
||||
bool LnnCheckSupportedHbType(LnnHeartbeatType *srcType, LnnHeartbeatType *dstType)
|
||||
{
|
||||
if (srcType == NULL || dstType == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "HB check supported hbType get invalid param");
|
||||
@ -210,7 +210,7 @@ NO_SANITIZE("cfi") bool LnnCheckSupportedHbType(LnnHeartbeatType *srcType, LnnHe
|
||||
return LnnVisitHbTypeSet(VisitCheckSupportedHbType, srcType, dstType);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGenerateHexStringHash(const unsigned char *str, char *hashStr, uint32_t len)
|
||||
int32_t LnnGenerateHexStringHash(const unsigned char *str, char *hashStr, uint32_t len)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t hashResult[SHA_256_HASH_LEN] = {0};
|
||||
@ -232,7 +232,7 @@ NO_SANITIZE("cfi") int32_t LnnGenerateHexStringHash(const unsigned char *str, ch
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetShortAccountHash(uint8_t *accountHash, uint32_t len)
|
||||
int32_t LnnGetShortAccountHash(uint8_t *accountHash, uint32_t len)
|
||||
{
|
||||
uint8_t localAccountHash[SHA_256_HASH_LEN] = {0};
|
||||
|
||||
@ -252,7 +252,7 @@ NO_SANITIZE("cfi") int32_t LnnGetShortAccountHash(uint8_t *accountHash, uint32_t
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGenerateBtMacHash(const char *btMac, int32_t brMacLen, char *brMacHash, int32_t hashLen)
|
||||
int32_t LnnGenerateBtMacHash(const char *btMac, int32_t brMacLen, char *brMacHash, int32_t hashLen)
|
||||
{
|
||||
if (btMac == NULL || brMacHash == NULL) {
|
||||
LLOGE("null point");
|
||||
@ -297,7 +297,7 @@ NO_SANITIZE("cfi") int32_t LnnGenerateBtMacHash(const char *btMac, int32_t brMac
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDumpLocalBasicInfo(void)
|
||||
void LnnDumpLocalBasicInfo(void)
|
||||
{
|
||||
char *anoyUdid = NULL;
|
||||
char *anoyUuid = NULL;
|
||||
|
@ -141,7 +141,7 @@ static bool CheckListener(const ILaneIdStateListener *listener)
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void RegisterLaneIdListener(const ILaneIdStateListener *listener)
|
||||
void RegisterLaneIdListener(const ILaneIdStateListener *listener)
|
||||
{
|
||||
if (CheckListener(listener) == false) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "register fail");
|
||||
@ -166,7 +166,7 @@ NO_SANITIZE("cfi") void RegisterLaneIdListener(const ILaneIdStateListener *liste
|
||||
Unlock();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void UnregisterLaneIdListener(const ILaneIdStateListener *listener)
|
||||
void UnregisterLaneIdListener(const ILaneIdStateListener *listener)
|
||||
{
|
||||
if (listener == NULL) {
|
||||
return;
|
||||
@ -218,7 +218,7 @@ static int32_t GetAllLaneIdListener(ILaneIdStateListener **listener, uint32_t *l
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void LaneIdEnabled(uint32_t laneId, uint32_t profileId)
|
||||
static void LaneIdEnabled(uint32_t laneId, uint32_t profileId)
|
||||
{
|
||||
ILaneIdStateListener *listener = NULL;
|
||||
uint32_t listenerNum = 0;
|
||||
@ -234,7 +234,7 @@ NO_SANITIZE("cfi") static void LaneIdEnabled(uint32_t laneId, uint32_t profileId
|
||||
SoftBusFree(listener);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void LaneIdDisabled(uint32_t laneId, uint32_t laneProfileId)
|
||||
static void LaneIdDisabled(uint32_t laneId, uint32_t laneProfileId)
|
||||
{
|
||||
ILaneIdStateListener *listener = NULL;
|
||||
uint32_t listenerNum = 0;
|
||||
@ -263,12 +263,12 @@ static bool RequestInfoCheck(const LaneRequestOption *request, const ILaneListen
|
||||
}
|
||||
|
||||
/* return laneId if the operation is successful, return 0 otherwise. */
|
||||
NO_SANITIZE("cfi") uint32_t ApplyLaneId(LaneType type)
|
||||
uint32_t ApplyLaneId(LaneType type)
|
||||
{
|
||||
return AllocLaneId(type);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnRequestLane(uint32_t laneId, const LaneRequestOption *request,
|
||||
int32_t LnnRequestLane(uint32_t laneId, const LaneRequestOption *request,
|
||||
const ILaneListener *listener)
|
||||
{
|
||||
if (RequestInfoCheck(request, listener) == false) {
|
||||
@ -291,7 +291,7 @@ NO_SANITIZE("cfi") int32_t LnnRequestLane(uint32_t laneId, const LaneRequestOpti
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnFreeLane(uint32_t laneId)
|
||||
int32_t LnnFreeLane(uint32_t laneId)
|
||||
{
|
||||
uint32_t laneType = laneId >> LANE_ID_TYPE_SHIFT;
|
||||
if (laneType >= LANE_TYPE_BUTT) {
|
||||
@ -310,7 +310,7 @@ NO_SANITIZE("cfi") int32_t LnnFreeLane(uint32_t laneId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") QueryResult LnnQueryLaneResource(const LaneQueryInfo *queryInfo)
|
||||
QueryResult LnnQueryLaneResource(const LaneQueryInfo *queryInfo)
|
||||
{
|
||||
if (queryInfo == NULL) {
|
||||
return QUERY_RESULT_REQUEST_ILLEGAL;
|
||||
@ -340,7 +340,7 @@ static int32_t LaneDelayInit(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t InitLane(void)
|
||||
int32_t InitLane(void)
|
||||
{
|
||||
if (LnnInitLaneLooper() != SOFTBUS_OK) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "[InitLane]init laneLooper fail");
|
||||
@ -373,7 +373,7 @@ NO_SANITIZE("cfi") int32_t InitLane(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void DeinitLane(void)
|
||||
void DeinitLane(void)
|
||||
{
|
||||
DeinitLaneModel();
|
||||
DeinitLaneLink();
|
||||
|
@ -154,7 +154,7 @@ static LinkInfoProc g_funcList[LANE_LINK_TYPE_BUTT] = {
|
||||
[LANE_COC_DIRECT] = BleDirectInfoProc,
|
||||
};
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LaneInfoProcess(const LaneLinkInfo *linkInfo, LaneConnInfo *connInfo, LaneProfile *profile)
|
||||
int32_t LaneInfoProcess(const LaneLinkInfo *linkInfo, LaneConnInfo *connInfo, LaneProfile *profile)
|
||||
{
|
||||
if ((linkInfo == NULL) || (connInfo == NULL) || (profile == NULL)) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "laneInfoProcess param invalid");
|
||||
@ -167,7 +167,7 @@ NO_SANITIZE("cfi") int32_t LaneInfoProcess(const LaneLinkInfo *linkInfo, LaneCon
|
||||
return g_funcList[linkInfo->type](linkInfo, connInfo, profile);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnCreateData(Map *map, uint32_t key, const void *value, uint32_t valueSize)
|
||||
int32_t LnnCreateData(Map *map, uint32_t key, const void *value, uint32_t valueSize)
|
||||
{
|
||||
char keyStr[UINT_TO_STR_MAX_LEN] = {0};
|
||||
if (sprintf_s(keyStr, UINT_TO_STR_MAX_LEN, "%u", key) < 0) {
|
||||
@ -181,7 +181,7 @@ NO_SANITIZE("cfi") int32_t LnnCreateData(Map *map, uint32_t key, const void *val
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void *LnnReadData(const Map *map, uint32_t key)
|
||||
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) {
|
||||
@ -192,7 +192,7 @@ NO_SANITIZE("cfi") void *LnnReadData(const Map *map, uint32_t key)
|
||||
return data;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeleteData(Map *map, uint32_t key)
|
||||
void LnnDeleteData(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) {
|
||||
@ -205,12 +205,12 @@ NO_SANITIZE("cfi") void LnnDeleteData(Map *map, uint32_t key)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") uint64_t LnnGetSysTimeMs(void)
|
||||
uint64_t LnnGetSysTimeMs(void)
|
||||
{
|
||||
return SoftBusGetSysTimeMs();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitLaneLooper(void)
|
||||
int32_t LnnInitLaneLooper(void)
|
||||
{
|
||||
SoftBusLooper *looper = CreateNewLooper("Lane-looper");
|
||||
if (!looper) {
|
||||
@ -222,7 +222,7 @@ NO_SANITIZE("cfi") int32_t LnnInitLaneLooper(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitLaneLooper(void)
|
||||
void LnnDeinitLaneLooper(void)
|
||||
{
|
||||
SoftBusLooper *looper = GetLooper(LOOP_TYPE_LANE);
|
||||
if (looper != NULL) {
|
||||
|
@ -65,7 +65,7 @@ static int32_t IsLinkRequestValid(const LinkRequest *reqInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t LaneLinkOfBr(uint32_t reqId, const LinkRequest *reqInfo, const LaneLinkCb *callback)
|
||||
static int32_t LaneLinkOfBr(uint32_t reqId, const LinkRequest *reqInfo, const LaneLinkCb *callback)
|
||||
{
|
||||
LaneLinkInfo linkInfo;
|
||||
(void)memset_s(&linkInfo, sizeof(LaneLinkInfo), 0, sizeof(LaneLinkInfo));
|
||||
@ -467,7 +467,7 @@ static void FillWlanLinkInfo(
|
||||
wlan->connInfo.port = port;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t LaneLinkOfWlan(uint32_t reqId, const LinkRequest *reqInfo, const LaneLinkCb *callback)
|
||||
static int32_t LaneLinkOfWlan(uint32_t reqId, const LinkRequest *reqInfo, const LaneLinkCb *callback)
|
||||
{
|
||||
LaneLinkInfo linkInfo;
|
||||
int32_t port = 0;
|
||||
|
@ -61,7 +61,7 @@ static void ModelUnlock(void)
|
||||
* | LinkType |TxType | Pri | Reserved |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
*/
|
||||
NO_SANITIZE("cfi") uint32_t GenerateLaneProfileId(const LaneGenerateParam *param)
|
||||
uint32_t GenerateLaneProfileId(const LaneGenerateParam *param)
|
||||
{
|
||||
uint32_t laneProfileId = 0;
|
||||
laneProfileId |= ((param->linkType << LINK_TYPE_SHIFT) |
|
||||
@ -136,7 +136,7 @@ static int32_t AddLaneModel(uint32_t laneId, uint32_t profileId, LaneProfile *la
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t BindLaneIdToProfile(uint32_t laneId, LaneProfile *profile)
|
||||
int32_t BindLaneIdToProfile(uint32_t laneId, LaneProfile *profile)
|
||||
{
|
||||
if (profile == NULL) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -153,7 +153,7 @@ NO_SANITIZE("cfi") int32_t BindLaneIdToProfile(uint32_t laneId, LaneProfile *pro
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void UnbindLaneIdFromProfile(uint32_t laneId, uint32_t profileId)
|
||||
void UnbindLaneIdFromProfile(uint32_t laneId, uint32_t profileId)
|
||||
{
|
||||
if (ModelLock() != SOFTBUS_OK) {
|
||||
return;
|
||||
@ -170,7 +170,7 @@ NO_SANITIZE("cfi") void UnbindLaneIdFromProfile(uint32_t laneId, uint32_t profil
|
||||
ModelUnlock();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t GetLaneProfile(uint32_t profileId, LaneProfile *profile)
|
||||
int32_t GetLaneProfile(uint32_t profileId, LaneProfile *profile)
|
||||
{
|
||||
if (profile == NULL) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -192,7 +192,7 @@ NO_SANITIZE("cfi") int32_t GetLaneProfile(uint32_t profileId, LaneProfile *profi
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t GetLaneIdList(uint32_t profileId, uint32_t **laneIdList, uint32_t *listSize)
|
||||
int32_t GetLaneIdList(uint32_t profileId, uint32_t **laneIdList, uint32_t *listSize)
|
||||
{
|
||||
if (ModelLock() != SOFTBUS_OK) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -225,7 +225,7 @@ NO_SANITIZE("cfi") int32_t GetLaneIdList(uint32_t profileId, uint32_t **laneIdLi
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") uint32_t GetActiveProfileNum(void)
|
||||
uint32_t GetActiveProfileNum(void)
|
||||
{
|
||||
uint32_t num = 0;
|
||||
if (ModelLock() != SOFTBUS_OK) {
|
||||
@ -236,7 +236,7 @@ NO_SANITIZE("cfi") uint32_t GetActiveProfileNum(void)
|
||||
return num;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t InitLaneModel(void)
|
||||
int32_t InitLaneModel(void)
|
||||
{
|
||||
LnnMapInit(&g_profileMap);
|
||||
if (SoftBusMutexInit(&g_laneModelMutex, NULL) != SOFTBUS_OK) {
|
||||
@ -271,7 +271,7 @@ static void ClearProfileMap(void)
|
||||
LnnMapDelete(&g_profileMap);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void DeinitLaneModel(void)
|
||||
void DeinitLaneModel(void)
|
||||
{
|
||||
ClearProfileMap();
|
||||
(void)SoftBusMutexDestroy(&g_laneModelMutex);
|
||||
|
@ -230,7 +230,7 @@ static int32_t PreProcLaneSelect(const char *networkId, const LaneSelectParam *r
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SelectLane(const char *networkId, const LaneSelectParam *request,
|
||||
int32_t SelectLane(const char *networkId, const LaneSelectParam *request,
|
||||
LanePreferredLinkList *recommendList, uint32_t *listNum)
|
||||
{
|
||||
if (PreProcLaneSelect(networkId, request, recommendList, listNum) != SOFTBUS_OK) {
|
||||
|
@ -230,21 +230,21 @@ static bool IsEnableCocDirect(const char *networkId)
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t GetBrScore(const char *networkId, uint32_t expectedBw)
|
||||
static int32_t GetBrScore(const char *networkId, uint32_t expectedBw)
|
||||
{
|
||||
(void)networkId;
|
||||
(void)expectedBw;
|
||||
return LNN_LINK_DEFAULT_SCORE;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t GetBleScore(const char *networkId, uint32_t expectedBw)
|
||||
static int32_t GetBleScore(const char *networkId, uint32_t expectedBw)
|
||||
{
|
||||
(void)networkId;
|
||||
(void)expectedBw;
|
||||
return LNN_LINK_DEFAULT_SCORE;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t GetP2pScore(const char *networkId, uint32_t expectedBw)
|
||||
static int32_t GetP2pScore(const char *networkId, uint32_t expectedBw)
|
||||
{
|
||||
(void)networkId;
|
||||
(void)expectedBw;
|
||||
@ -270,7 +270,7 @@ static int32_t GetLinkedChannelScore(void)
|
||||
return score;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t GetWlan2P4GScore(const char *networkId, uint32_t expectedBw)
|
||||
static int32_t GetWlan2P4GScore(const char *networkId, uint32_t expectedBw)
|
||||
{
|
||||
(void)networkId;
|
||||
(void)expectedBw;
|
||||
@ -284,7 +284,7 @@ static int32_t GetWlan5GScore(const char *networkId, uint32_t expectedBw)
|
||||
return GetLinkedChannelScore();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t GetCocScore(const char *networkId, uint32_t expectedBw)
|
||||
static int32_t GetCocScore(const char *networkId, uint32_t expectedBw)
|
||||
{
|
||||
(void)networkId;
|
||||
(void)expectedBw;
|
||||
@ -305,7 +305,7 @@ static LinkAttribute g_linkAttr[LANE_LINK_TYPE_BUTT] = {
|
||||
[LANE_COC_DIRECT] = { true, IsEnableCocDirect, GetCocScore },
|
||||
};
|
||||
|
||||
NO_SANITIZE("cfi") LinkAttribute *GetLinkAttrByLinkType(LaneLinkType linkType)
|
||||
LinkAttribute *GetLinkAttrByLinkType(LaneLinkType linkType)
|
||||
{
|
||||
if ((linkType < 0) || (linkType >= LANE_LINK_TYPE_BUTT)) {
|
||||
return NULL;
|
||||
|
@ -87,7 +87,7 @@ static void Unlock(void)
|
||||
(void)SoftBusMutexUnlock(&g_transLaneMutex);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t PostMsgToHandler(int32_t msgType, uint64_t param1, uint64_t param2, void *obj)
|
||||
static int32_t PostMsgToHandler(int32_t msgType, uint64_t param1, uint64_t param2, void *obj)
|
||||
{
|
||||
SoftBusMessage *msg = (SoftBusMessage *)SoftBusCalloc(sizeof(SoftBusMessage));
|
||||
if (msg == NULL) {
|
||||
@ -283,7 +283,7 @@ static int32_t Alloc(uint32_t laneId, const LaneRequestOption *request, const IL
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void UnbindLaneId(uint32_t laneId, const TransReqInfo *infoNode)
|
||||
static void UnbindLaneId(uint32_t laneId, const TransReqInfo *infoNode)
|
||||
{
|
||||
LaneGenerateParam param;
|
||||
param.linkType = infoNode->type;
|
||||
@ -370,7 +370,7 @@ static void UpdateLinkType(uint32_t laneId, LaneLinkType linkType)
|
||||
Unlock();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void NotifyLaneAllocSuccess(uint32_t laneId, const LaneLinkInfo *info)
|
||||
static void NotifyLaneAllocSuccess(uint32_t laneId, const LaneLinkInfo *info)
|
||||
{
|
||||
TransReqInfo reqInfo;
|
||||
if (GetLaneReqInfo(laneId, &reqInfo) != SOFTBUS_OK) {
|
||||
@ -398,7 +398,7 @@ NO_SANITIZE("cfi") static void NotifyLaneAllocSuccess(uint32_t laneId, const Lan
|
||||
g_laneIdCallback->OnLaneIdEnabled(laneId, profileId);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void NotifyLaneAllocFail(uint32_t laneId, int32_t reason)
|
||||
static void NotifyLaneAllocFail(uint32_t laneId, int32_t reason)
|
||||
{
|
||||
TransReqInfo reqInfo;
|
||||
if (GetLaneReqInfo(laneId, &reqInfo) != SOFTBUS_OK) {
|
||||
@ -550,7 +550,7 @@ static void LaneLinkException(SoftBusMessage *msg)
|
||||
NotifyLaneStateChange(laneId, state);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void MsgHandler(SoftBusMessage *msg)
|
||||
static void MsgHandler(SoftBusMessage *msg)
|
||||
{
|
||||
if (msg == NULL) {
|
||||
return;
|
||||
@ -640,7 +640,7 @@ static LaneInterface g_transLaneObject = {
|
||||
.FreeLane = Free,
|
||||
};
|
||||
|
||||
NO_SANITIZE("cfi") LaneInterface *TransLaneGetInstance(void)
|
||||
LaneInterface *TransLaneGetInstance(void)
|
||||
{
|
||||
return &g_transLaneObject;
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ static void ProcessRemoveAll(void)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void TimeSyncMessageHandler(SoftBusMessage *msg)
|
||||
static void TimeSyncMessageHandler(SoftBusMessage *msg)
|
||||
{
|
||||
if (msg == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "time sync msg is null");
|
||||
@ -415,7 +415,7 @@ static SoftBusMessage *CreateTimeSyncMessage(int32_t msgType, void *para)
|
||||
return msg;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t PostMessageToHandler(int32_t msgType, void *para)
|
||||
static int32_t PostMessageToHandler(int32_t msgType, void *para)
|
||||
{
|
||||
SoftBusMessage *msg = CreateTimeSyncMessage(msgType, para);
|
||||
if (msg == NULL) {
|
||||
@ -426,7 +426,7 @@ NO_SANITIZE("cfi") static int32_t PostMessageToHandler(int32_t msgType, void *pa
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void OnTimeSyncImplComplete(const char *networkId, double offset, int32_t retCode)
|
||||
static void OnTimeSyncImplComplete(const char *networkId, double offset, int32_t retCode)
|
||||
{
|
||||
TimeSyncCompleteMsgPara *para = NULL;
|
||||
|
||||
@ -463,7 +463,7 @@ static bool CheckTimeSyncReqInfo(const StartTimeSyncReqMsgPara *info)
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitTimeSync(void)
|
||||
int32_t LnnInitTimeSync(void)
|
||||
{
|
||||
ListInit(&g_timeSyncCtrl.reqList);
|
||||
g_timeSyncCtrl.looper = GetLooper(LOOP_TYPE_DEFAULT);
|
||||
@ -478,7 +478,7 @@ NO_SANITIZE("cfi") int32_t LnnInitTimeSync(void)
|
||||
return LnnTimeSyncImplInit();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitTimeSync(void)
|
||||
void LnnDeinitTimeSync(void)
|
||||
{
|
||||
if (g_timeSyncCtrl.looper == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "time sync not init");
|
||||
@ -490,7 +490,7 @@ NO_SANITIZE("cfi") void LnnDeinitTimeSync(void)
|
||||
LnnTimeSyncImplDeinit();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStartTimeSync(const char *pkgName, int32_t callingPid, const char *targetNetworkId,
|
||||
int32_t LnnStartTimeSync(const char *pkgName, int32_t callingPid, const char *targetNetworkId,
|
||||
TimeSyncAccuracy accuracy, TimeSyncPeriod period)
|
||||
{
|
||||
StartTimeSyncReqMsgPara *para = NULL;
|
||||
@ -530,7 +530,7 @@ NO_SANITIZE("cfi") int32_t LnnStartTimeSync(const char *pkgName, int32_t calling
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStopTimeSync(const char *pkgName, const char *targetNetworkId)
|
||||
int32_t LnnStopTimeSync(const char *pkgName, const char *targetNetworkId)
|
||||
{
|
||||
StopTimeSyncReqMsgPara *para = NULL;
|
||||
|
||||
|
@ -591,7 +591,7 @@ static int32_t OnJoinLNN(LnnConnectionFsm *connFsm)
|
||||
return rc;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t OnJoinMetaNode(MetaJoinRequestNode *metaJoinNode, CustomData *customData)
|
||||
int32_t OnJoinMetaNode(MetaJoinRequestNode *metaJoinNode, CustomData *customData)
|
||||
{
|
||||
if (metaJoinNode == NULL || customData == NULL) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -1017,7 +1017,7 @@ static int32_t InitConnectionStateMachine(LnnConnectionFsm *connFsm)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") LnnConnectionFsm *LnnCreateConnectionFsm(const ConnectionAddr *target, const char *pkgName,
|
||||
LnnConnectionFsm *LnnCreateConnectionFsm(const ConnectionAddr *target, const char *pkgName,
|
||||
bool isNeedConnect)
|
||||
{
|
||||
LnnConnectionFsm *connFsm = NULL;
|
||||
@ -1052,7 +1052,7 @@ NO_SANITIZE("cfi") LnnConnectionFsm *LnnCreateConnectionFsm(const ConnectionAddr
|
||||
return connFsm;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDestroyConnectionFsm(LnnConnectionFsm *connFsm)
|
||||
void LnnDestroyConnectionFsm(LnnConnectionFsm *connFsm)
|
||||
{
|
||||
if (connFsm == NULL) {
|
||||
return;
|
||||
@ -1067,7 +1067,7 @@ NO_SANITIZE("cfi") void LnnDestroyConnectionFsm(LnnConnectionFsm *connFsm)
|
||||
SoftBusFree(connFsm);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStartConnectionFsm(LnnConnectionFsm *connFsm)
|
||||
int32_t LnnStartConnectionFsm(LnnConnectionFsm *connFsm)
|
||||
{
|
||||
if (connFsm == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "connection fsm is null");
|
||||
@ -1081,7 +1081,7 @@ NO_SANITIZE("cfi") int32_t LnnStartConnectionFsm(LnnConnectionFsm *connFsm)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnStopConnectionFsm(LnnConnectionFsm *connFsm, LnnConnectionFsmStopCallback callback)
|
||||
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");
|
||||
@ -1095,7 +1095,7 @@ NO_SANITIZE("cfi") int32_t LnnStopConnectionFsm(LnnConnectionFsm *connFsm, LnnCo
|
||||
return LnnFsmDeinit(&connFsm->fsm);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSendJoinRequestToConnFsm(LnnConnectionFsm *connFsm)
|
||||
int32_t LnnSendJoinRequestToConnFsm(LnnConnectionFsm *connFsm)
|
||||
{
|
||||
if (!CheckInterfaceCommonArgs(connFsm, true)) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -1109,7 +1109,7 @@ NO_SANITIZE("cfi") int32_t LnnSendJoinRequestToConnFsm(LnnConnectionFsm *connFsm
|
||||
return LnnFsmPostMessage(&connFsm->fsm, FSM_MSG_TYPE_JOIN_LNN, NULL);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSendAuthResultMsgToConnFsm(LnnConnectionFsm *connFsm, int32_t retCode)
|
||||
int32_t LnnSendAuthResultMsgToConnFsm(LnnConnectionFsm *connFsm, int32_t retCode)
|
||||
{
|
||||
int32_t *para = NULL;
|
||||
|
||||
@ -1130,7 +1130,7 @@ NO_SANITIZE("cfi") int32_t LnnSendAuthResultMsgToConnFsm(LnnConnectionFsm *connF
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSendNotTrustedToConnFsm(LnnConnectionFsm *connFsm)
|
||||
int32_t LnnSendNotTrustedToConnFsm(LnnConnectionFsm *connFsm)
|
||||
{
|
||||
if (!CheckInterfaceCommonArgs(connFsm, true)) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -1138,7 +1138,7 @@ NO_SANITIZE("cfi") int32_t LnnSendNotTrustedToConnFsm(LnnConnectionFsm *connFsm)
|
||||
return LnnFsmPostMessage(&connFsm->fsm, FSM_MSG_TYPE_NOT_TRUSTED, NULL);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSendDisconnectMsgToConnFsm(LnnConnectionFsm *connFsm)
|
||||
int32_t LnnSendDisconnectMsgToConnFsm(LnnConnectionFsm *connFsm)
|
||||
{
|
||||
if (!CheckInterfaceCommonArgs(connFsm, true)) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -1146,7 +1146,7 @@ NO_SANITIZE("cfi") int32_t LnnSendDisconnectMsgToConnFsm(LnnConnectionFsm *connF
|
||||
return LnnFsmPostMessage(&connFsm->fsm, FSM_MSG_TYPE_DISCONNECT, NULL);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSendLeaveRequestToConnFsm(LnnConnectionFsm *connFsm)
|
||||
int32_t LnnSendLeaveRequestToConnFsm(LnnConnectionFsm *connFsm)
|
||||
{
|
||||
if (!CheckInterfaceCommonArgs(connFsm, true)) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -1154,7 +1154,7 @@ NO_SANITIZE("cfi") int32_t LnnSendLeaveRequestToConnFsm(LnnConnectionFsm *connFs
|
||||
return LnnFsmPostMessage(&connFsm->fsm, FSM_MSG_TYPE_LEAVE_LNN, NULL);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSendSyncOfflineFinishToConnFsm(LnnConnectionFsm *connFsm)
|
||||
int32_t LnnSendSyncOfflineFinishToConnFsm(LnnConnectionFsm *connFsm)
|
||||
{
|
||||
if (!CheckInterfaceCommonArgs(connFsm, true)) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -1162,7 +1162,7 @@ NO_SANITIZE("cfi") int32_t LnnSendSyncOfflineFinishToConnFsm(LnnConnectionFsm *c
|
||||
return LnnFsmPostMessage(&connFsm->fsm, FSM_MSG_TYPE_SYNC_OFFLINE_DONE, NULL);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSendNewNetworkOnlineToConnFsm(LnnConnectionFsm *connFsm)
|
||||
int32_t LnnSendNewNetworkOnlineToConnFsm(LnnConnectionFsm *connFsm)
|
||||
{
|
||||
if (!CheckInterfaceCommonArgs(connFsm, true)) {
|
||||
return SOFTBUS_ERR;
|
||||
|
@ -368,7 +368,7 @@ static void UpdataLocalFromSetting(void *p)
|
||||
DiscDeviceInfoChanged(TYPE_LOCAL_DEVICE_NAME);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void UpdateDeviceNameFromSetting(void)
|
||||
static void UpdateDeviceNameFromSetting(void)
|
||||
{
|
||||
LnnInitGetDeviceName(LnnHandlerGetDeviceName);
|
||||
}
|
||||
@ -392,7 +392,7 @@ static void LnnAccountStateChangeHandler(const LnnEventBasicInfo *info)
|
||||
return;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitDevicename(void)
|
||||
int32_t LnnInitDevicename(void)
|
||||
{
|
||||
int32_t ret = LnnRegSyncInfoHandler(LNN_INFO_TYPE_DEVICE_NAME, OnReceiveDeviceName);
|
||||
if (ret != SOFTBUS_OK) {
|
||||
@ -405,7 +405,7 @@ NO_SANITIZE("cfi") int32_t LnnInitDevicename(void)
|
||||
return LnnRegSyncInfoHandler(LNN_INFO_TYPE_NICK_NAME, OnReceiveDeviceNickName);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitDevicename(void)
|
||||
void LnnDeinitDevicename(void)
|
||||
{
|
||||
(void)LnnUnregSyncInfoHandler(LNN_INFO_TYPE_DEVICE_NAME, OnReceiveDeviceName);
|
||||
LnnUnregisterEventHandler(LNN_EVENT_ACCOUNT_CHANGED, LnnAccountStateChangeHandler);
|
||||
|
@ -183,12 +183,12 @@ void __attribute__((weak)) SfcSyncNodeAddrHandle(const char *networkId, int32_t
|
||||
(void)code;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void SetWatchdogFlag(bool flag)
|
||||
void SetWatchdogFlag(bool flag)
|
||||
{
|
||||
g_watchdogFlag = flag;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool GetWatchdogFlag(void)
|
||||
bool GetWatchdogFlag(void)
|
||||
{
|
||||
return g_watchdogFlag;
|
||||
}
|
||||
@ -222,7 +222,7 @@ static SoftBusMessage *CreateNetBuilderMessage(int32_t msgType, void *para)
|
||||
return msg;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t PostMessageToHandler(int32_t msgType, void *para)
|
||||
static int32_t PostMessageToHandler(int32_t msgType, void *para)
|
||||
{
|
||||
SoftBusMessage *msg = CreateNetBuilderMessage(msgType, para);
|
||||
if (msg == NULL) {
|
||||
@ -1556,7 +1556,7 @@ static NetBuilderMessageProcess g_messageProcessor[MSG_TYPE_MAX] = {
|
||||
ProcessOnAuthMetaVerifyFailed,
|
||||
};
|
||||
|
||||
NO_SANITIZE("cfi") static void NetBuilderMessageHandler(SoftBusMessage *msg)
|
||||
static void NetBuilderMessageHandler(SoftBusMessage *msg)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
@ -1866,7 +1866,7 @@ static AuthVerifyCallback g_verifyCallback = {
|
||||
.onVerifyFailed = OnVerifyFailed,
|
||||
};
|
||||
|
||||
NO_SANITIZE("cfi") AuthVerifyCallback *LnnGetVerifyCallback(void)
|
||||
AuthVerifyCallback *LnnGetVerifyCallback(void)
|
||||
{
|
||||
return &g_verifyCallback;
|
||||
}
|
||||
@ -1938,7 +1938,7 @@ static AuthVerifyCallback g_reAuthVerifyCallback = {
|
||||
.onVerifyFailed = OnReAuthVerifyFailed,
|
||||
};
|
||||
|
||||
NO_SANITIZE("cfi") AuthVerifyCallback *LnnGetReAuthVerifyCallback(void)
|
||||
AuthVerifyCallback *LnnGetReAuthVerifyCallback(void)
|
||||
{
|
||||
return &g_reAuthVerifyCallback;
|
||||
}
|
||||
@ -1992,7 +1992,7 @@ static AuthVerifyCallback g_metaVerifyCallback = {
|
||||
.onVerifyFailed = OnAuthMetaVerifyFailed,
|
||||
};
|
||||
|
||||
NO_SANITIZE("cfi") AuthVerifyCallback *LnnGetMetaVerifyCallback(void)
|
||||
AuthVerifyCallback *LnnGetMetaVerifyCallback(void)
|
||||
{
|
||||
return &g_metaVerifyCallback;
|
||||
}
|
||||
@ -2221,7 +2221,7 @@ static void OnReceiveNodeAddrChangedMsg(LnnSyncInfoType type, const char *networ
|
||||
LnnNotifyNodeAddressChanged(addr.nodeAddr, networkId, false);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnUpdateNodeAddr(const char *addr)
|
||||
int32_t LnnUpdateNodeAddr(const char *addr)
|
||||
{
|
||||
if (addr == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -2386,7 +2386,7 @@ int32_t LnnInitNetBuilderDelay(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitNetBuilder(void)
|
||||
void LnnDeinitNetBuilder(void)
|
||||
{
|
||||
LnnConnectionFsm *item = NULL;
|
||||
LnnConnectionFsm *nextItem = NULL;
|
||||
@ -2408,7 +2408,7 @@ NO_SANITIZE("cfi") void LnnDeinitNetBuilder(void)
|
||||
g_netBuilder.isInit = false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnServerJoin(ConnectionAddr *addr, const char *pkgName)
|
||||
int32_t LnnServerJoin(ConnectionAddr *addr, const char *pkgName)
|
||||
{
|
||||
JoinLnnMsgPara *para = NULL;
|
||||
|
||||
@ -2430,7 +2430,7 @@ NO_SANITIZE("cfi") int32_t LnnServerJoin(ConnectionAddr *addr, const char *pkgNa
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t MetaNodeServerJoin(const char *pkgName, int32_t callingPid,
|
||||
int32_t MetaNodeServerJoin(const char *pkgName, int32_t callingPid,
|
||||
ConnectionAddr *addr, CustomData *customData)
|
||||
{
|
||||
ConnectionAddrKey addrDataKey = {
|
||||
@ -2461,7 +2461,7 @@ NO_SANITIZE("cfi") int32_t MetaNodeServerJoin(const char *pkgName, int32_t calli
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnServerLeave(const char *networkId, const char *pkgName)
|
||||
int32_t LnnServerLeave(const char *networkId, const char *pkgName)
|
||||
{
|
||||
(void)pkgName;
|
||||
char *para = NULL;
|
||||
@ -2484,7 +2484,7 @@ NO_SANITIZE("cfi") int32_t LnnServerLeave(const char *networkId, const char *pkg
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t MetaNodeServerLeave(const char *networkId)
|
||||
int32_t MetaNodeServerLeave(const char *networkId)
|
||||
{
|
||||
char *para = NULL;
|
||||
|
||||
@ -2506,7 +2506,7 @@ NO_SANITIZE("cfi") int32_t MetaNodeServerLeave(const char *networkId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnNotifyDiscoveryDevice(const ConnectionAddr *addr, bool isNeedConnect)
|
||||
int32_t LnnNotifyDiscoveryDevice(const ConnectionAddr *addr, bool isNeedConnect)
|
||||
{
|
||||
JoinLnnMsgPara *para = NULL;
|
||||
|
||||
@ -2528,7 +2528,7 @@ NO_SANITIZE("cfi") int32_t LnnNotifyDiscoveryDevice(const ConnectionAddr *addr,
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnRequestLeaveInvalidConn(const char *oldNetworkId, ConnectionAddrType addrType,
|
||||
int32_t LnnRequestLeaveInvalidConn(const char *oldNetworkId, ConnectionAddrType addrType,
|
||||
const char *newNetworkId)
|
||||
{
|
||||
LeaveInvalidConnMsgPara *para = NULL;
|
||||
@ -2557,7 +2557,7 @@ NO_SANITIZE("cfi") int32_t LnnRequestLeaveInvalidConn(const char *oldNetworkId,
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnRequestCleanConnFsm(uint16_t connFsmId)
|
||||
int32_t LnnRequestCleanConnFsm(uint16_t connFsmId)
|
||||
{
|
||||
uint16_t *para = NULL;
|
||||
|
||||
@ -2622,7 +2622,7 @@ int32_t LnnNotifyNodeStateChanged(const ConnectionAddr *addr)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnNotifyMasterElect(const char *networkId, const char *masterUdid, int32_t masterWeight)
|
||||
int32_t LnnNotifyMasterElect(const char *networkId, const char *masterUdid, int32_t masterWeight)
|
||||
{
|
||||
ElectMsgPara *para = NULL;
|
||||
|
||||
@ -2655,7 +2655,7 @@ NO_SANITIZE("cfi") int32_t LnnNotifyMasterElect(const char *networkId, const cha
|
||||
}
|
||||
|
||||
/* Note: must called in connection fsm. */
|
||||
NO_SANITIZE("cfi") int32_t LnnNotifyAuthHandleLeaveLNN(int64_t authId)
|
||||
int32_t LnnNotifyAuthHandleLeaveLNN(int64_t authId)
|
||||
{
|
||||
LnnConnectionFsm *item = NULL;
|
||||
|
||||
@ -2678,7 +2678,7 @@ NO_SANITIZE("cfi") int32_t LnnNotifyAuthHandleLeaveLNN(int64_t authId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnRequestLeaveByAddrType(const bool *type, uint32_t typeLen)
|
||||
int32_t LnnRequestLeaveByAddrType(const bool *type, uint32_t typeLen)
|
||||
{
|
||||
if (type == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s: para is null", __func__);
|
||||
@ -2713,7 +2713,7 @@ NO_SANITIZE("cfi") int32_t LnnRequestLeaveByAddrType(const bool *type, uint32_t
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnRequestLeaveSpecific(const char *networkId, ConnectionAddrType addrType)
|
||||
int32_t LnnRequestLeaveSpecific(const char *networkId, ConnectionAddrType addrType)
|
||||
{
|
||||
SpecificLeaveMsgPara *para = NULL;
|
||||
|
||||
|
@ -403,7 +403,7 @@ static void InitWifiDirectCapability(void)
|
||||
LLOGI("g_isWifiDirectSupported=%d g_isApCoexistSupported=%d", g_isWifiDirectSupported, g_isApCoexistSupported);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitNetworkInfo(void)
|
||||
int32_t LnnInitNetworkInfo(void)
|
||||
{
|
||||
InitWifiDirectCapability();
|
||||
if (LnnRegisterEventHandler(LNN_EVENT_BT_STATE_CHANGED, BtStateChangeEventHandler) != SOFTBUS_OK) {
|
||||
@ -421,7 +421,7 @@ NO_SANITIZE("cfi") int32_t LnnInitNetworkInfo(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitNetworkInfo(void)
|
||||
void LnnDeinitNetworkInfo(void)
|
||||
{
|
||||
(void)LnnUnregSyncInfoHandler(LNN_INFO_TYPE_CAPABILITY, OnReceiveCapaSyncInfoMsg);
|
||||
}
|
||||
|
@ -32,7 +32,7 @@
|
||||
#define BASE_WEIGHT_CAR_VALUE 5000
|
||||
#define BASE_WEIGHT_PC_VALUE 4000
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetLocalWeight(void)
|
||||
int32_t LnnGetLocalWeight(void)
|
||||
{
|
||||
static int32_t weight;
|
||||
static bool isGenWeight = false;
|
||||
@ -77,7 +77,7 @@ NO_SANITIZE("cfi") int32_t LnnGetLocalWeight(void)
|
||||
return weight;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnCompareNodeWeight(int32_t weight1, const char *masterUdid1, int32_t weight2,
|
||||
int32_t LnnCompareNodeWeight(int32_t weight1, const char *masterUdid1, int32_t weight2,
|
||||
const char *masterUdid2)
|
||||
{
|
||||
if (weight1 != weight2) {
|
||||
|
@ -180,7 +180,7 @@ static void OnReceiveP2pSyncInfoMsg(LnnSyncInfoType type, const char *networkId,
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSyncP2pInfo(void)
|
||||
int32_t LnnSyncP2pInfo(void)
|
||||
{
|
||||
int32_t rc = LnnAsyncCallbackHelper(GetLooper(LOOP_TYPE_DEFAULT), ProcessSyncP2pInfo, NULL);
|
||||
if (rc != SOFTBUS_OK) {
|
||||
@ -190,7 +190,7 @@ NO_SANITIZE("cfi") int32_t LnnSyncP2pInfo(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitLocalP2pInfo(NodeInfo *info)
|
||||
int32_t LnnInitLocalP2pInfo(NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -207,12 +207,12 @@ NO_SANITIZE("cfi") int32_t LnnInitLocalP2pInfo(NodeInfo *info)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitP2p(void)
|
||||
int32_t LnnInitP2p(void)
|
||||
{
|
||||
return LnnRegSyncInfoHandler(LNN_INFO_TYPE_P2P_INFO, OnReceiveP2pSyncInfoMsg);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitP2p(void)
|
||||
void LnnDeinitP2p(void)
|
||||
{
|
||||
(void)LnnUnregSyncInfoHandler(LNN_INFO_TYPE_P2P_INFO, OnReceiveP2pSyncInfoMsg);
|
||||
}
|
@ -180,7 +180,7 @@ static void SendSyncInfoMsg(SyncChannelInfo *info, SyncInfoMsg *msg)
|
||||
SoftBusFree(msg);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void CloseUnusedChannel(void *para)
|
||||
static void CloseUnusedChannel(void *para)
|
||||
{
|
||||
SyncChannelInfo *item = NULL;
|
||||
SyncChannelInfo *itemNext = NULL;
|
||||
@ -221,7 +221,7 @@ NO_SANITIZE("cfi") static void CloseUnusedChannel(void *para)
|
||||
(void)SoftBusMutexUnlock(&g_syncInfoManager.lock);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t OnChannelOpened(int32_t channelId, const char *peerUuid, unsigned char isServer)
|
||||
static int32_t OnChannelOpened(int32_t channelId, const char *peerUuid, unsigned char isServer)
|
||||
{
|
||||
char networkId[NETWORK_ID_BUF_LEN];
|
||||
SyncChannelInfo *info = NULL;
|
||||
@ -329,7 +329,7 @@ static void OnChannelClosed(int32_t channelId)
|
||||
(void)SoftBusMutexUnlock(&g_syncInfoManager.lock);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void OnMessageReceived(int32_t channelId, const char *data, uint32_t len)
|
||||
static void OnMessageReceived(int32_t channelId, const char *data, uint32_t len)
|
||||
{
|
||||
SyncChannelInfo *info = NULL;
|
||||
LnnSyncInfoType type;
|
||||
@ -419,7 +419,7 @@ static void OnLnnOnlineStateChange(const LnnEventBasicInfo *info)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitSyncInfoManager(void)
|
||||
int32_t LnnInitSyncInfoManager(void)
|
||||
{
|
||||
int32_t i;
|
||||
|
||||
@ -442,7 +442,7 @@ NO_SANITIZE("cfi") int32_t LnnInitSyncInfoManager(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitSyncInfoManager(void)
|
||||
void LnnDeinitSyncInfoManager(void)
|
||||
{
|
||||
int32_t i;
|
||||
for (i = 0; i < LNN_INFO_TYPE_COUNT; ++i) {
|
||||
@ -453,7 +453,7 @@ NO_SANITIZE("cfi") void LnnDeinitSyncInfoManager(void)
|
||||
SoftBusMutexDestroy(&g_syncInfoManager.lock);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnRegSyncInfoHandler(LnnSyncInfoType type, LnnSyncInfoMsgHandler handler)
|
||||
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);
|
||||
@ -473,7 +473,7 @@ NO_SANITIZE("cfi") int32_t LnnRegSyncInfoHandler(LnnSyncInfoType type, LnnSyncIn
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnUnregSyncInfoHandler(LnnSyncInfoType type, LnnSyncInfoMsgHandler handler)
|
||||
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);
|
||||
@ -493,7 +493,7 @@ NO_SANITIZE("cfi") int32_t LnnUnregSyncInfoHandler(LnnSyncInfoType type, LnnSync
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t SendSyncInfoByNewChannel(const char *networkId, SyncInfoMsg *msg)
|
||||
static int32_t SendSyncInfoByNewChannel(const char *networkId, SyncInfoMsg *msg)
|
||||
{
|
||||
SyncChannelInfo *info = CreateSyncChannelInfo(networkId);
|
||||
if (info == NULL) {
|
||||
@ -561,7 +561,7 @@ static int32_t TrySendSyncInfoMsg(const char *networkId, SyncInfoMsg *msg)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSendSyncInfoMsg(LnnSyncInfoType type, const char *networkId,
|
||||
int32_t LnnSendSyncInfoMsg(LnnSyncInfoType type, const char *networkId,
|
||||
const uint8_t *msg, uint32_t len, LnnSyncInfoMsgComplete complete)
|
||||
{
|
||||
SyncInfoMsg *syncMsg = NULL;
|
||||
|
@ -218,12 +218,12 @@ int32_t LnnSendTransReq(const char *peerNetWorkId, const BssTransInfo *transInfo
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitOffline(void)
|
||||
int32_t LnnInitOffline(void)
|
||||
{
|
||||
return LnnRegSyncInfoHandler(LNN_INFO_TYPE_OFFLINE, OnReceiveBrOffline);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitOffline(void)
|
||||
void LnnDeinitOffline(void)
|
||||
{
|
||||
(void)LnnUnregSyncInfoHandler(LNN_INFO_TYPE_OFFLINE, OnReceiveBrOffline);
|
||||
}
|
||||
|
@ -774,7 +774,7 @@ static int32_t FillAllRelation(LnnRelation *relation, uint32_t relationNum)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitTopoManager(void)
|
||||
int32_t LnnInitTopoManager(void)
|
||||
{
|
||||
int32_t i;
|
||||
|
||||
@ -803,7 +803,7 @@ NO_SANITIZE("cfi") int32_t LnnInitTopoManager(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitTopoManager(void)
|
||||
void LnnDeinitTopoManager(void)
|
||||
{
|
||||
if (!g_topoTable.isSupportTopo) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "not Support Topo");
|
||||
@ -821,7 +821,7 @@ NO_SANITIZE("cfi") void LnnDeinitTopoManager(void)
|
||||
SoftBusMutexDestroy(&g_topoTable.lock);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetAllRelation(LnnRelation **relation, uint32_t *relationNum)
|
||||
int32_t LnnGetAllRelation(LnnRelation **relation, uint32_t *relationNum)
|
||||
{
|
||||
int32_t rc;
|
||||
if (relation == NULL || relationNum == NULL) {
|
||||
@ -852,7 +852,7 @@ NO_SANITIZE("cfi") int32_t LnnGetAllRelation(LnnRelation **relation, uint32_t *r
|
||||
return rc;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetRelation(const char *udid, const char *peerUdid, uint8_t *relation, uint32_t len)
|
||||
int32_t LnnGetRelation(const char *udid, const char *peerUdid, uint8_t *relation, uint32_t len)
|
||||
{
|
||||
TopoTableItem *topoItem = NULL;
|
||||
TopoInfo *topoInfo = NULL;
|
||||
|
@ -593,7 +593,7 @@ static VisitNextChoice NotifyIpAddressChanged(const LnnPhysicalSubnet *subnet, v
|
||||
return CHOICE_VISIT_NEXT;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void IpAddrChangeEventHandler(const LnnEventBasicInfo *info)
|
||||
static void IpAddrChangeEventHandler(const LnnEventBasicInfo *info)
|
||||
{
|
||||
if (info == NULL || info->event != LNN_EVENT_IP_ADDR_CHANGED) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "not interest event");
|
||||
@ -746,7 +746,7 @@ static LnnProtocolManager g_ipProtocol = {
|
||||
.pri = 10,
|
||||
};
|
||||
|
||||
NO_SANITIZE("cfi") int32_t RegistIPProtocolManager(void)
|
||||
int32_t RegistIPProtocolManager(void)
|
||||
{
|
||||
return LnnRegistProtocol(&g_ipProtocol);
|
||||
}
|
||||
|
@ -299,7 +299,7 @@ static void NetOOBEStateEventHandler(const LnnEventBasicInfo *info)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnClearNetConfigList(void)
|
||||
int32_t LnnClearNetConfigList(void)
|
||||
{
|
||||
LnnNetIfMgr *item = NULL;
|
||||
LnnNetIfMgr *next = NULL;
|
||||
@ -341,7 +341,7 @@ int32_t LnnRegistProtocol(LnnProtocolManager *protocolMgr)
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t UnregistProtocol(LnnProtocolManager *protocolMgr)
|
||||
int32_t UnregistProtocol(LnnProtocolManager *protocolMgr)
|
||||
{
|
||||
uint8_t i;
|
||||
if (protocolMgr == NULL) {
|
||||
@ -361,7 +361,7 @@ NO_SANITIZE("cfi") int32_t UnregistProtocol(LnnProtocolManager *protocolMgr)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnVisitNetif(VisitNetifCallback callback, void *data)
|
||||
bool LnnVisitNetif(VisitNetifCallback callback, void *data)
|
||||
{
|
||||
LnnNetIfMgr *item = NULL;
|
||||
VisitNextChoice result = CHOICE_VISIT_NEXT;
|
||||
@ -375,7 +375,7 @@ NO_SANITIZE("cfi") bool LnnVisitNetif(VisitNetifCallback callback, void *data)
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnVisitProtocol(VisitProtocolCallback callback, void *data)
|
||||
bool LnnVisitProtocol(VisitProtocolCallback callback, void *data)
|
||||
{
|
||||
VisitNextChoice result = CHOICE_VISIT_NEXT;
|
||||
for (uint8_t i = 0; i < LNN_NETWORK_MAX_PROTOCOL_COUNT; i++) {
|
||||
@ -423,7 +423,7 @@ void RestartCoapDiscovery(void)
|
||||
SetCallLnnStatus(true);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void OnGroupCreated(const char *groupId, int32_t groupType)
|
||||
static void OnGroupCreated(const char *groupId, int32_t groupType)
|
||||
{
|
||||
(void)groupId;
|
||||
LLOGD("wifi handle OnGroupCreated");
|
||||
@ -432,7 +432,7 @@ NO_SANITIZE("cfi") static void OnGroupCreated(const char *groupId, int32_t group
|
||||
RestartCoapDiscovery();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void OnGroupDeleted(const char *groupId)
|
||||
static void OnGroupDeleted(const char *groupId)
|
||||
{
|
||||
(void)groupId;
|
||||
LLOGD("wifi handle OnGroupDeleted");
|
||||
@ -573,7 +573,7 @@ static void NetAccountStateChangeEventHandler(const LnnEventBasicInfo *info)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitNetworkManager(void)
|
||||
int32_t LnnInitNetworkManager(void)
|
||||
{
|
||||
RegistNetIfMgr(LNN_ETH_TYPE, CreateNetifMgr);
|
||||
RegistNetIfMgr(LNN_WLAN_TYPE, CreateNetifMgr);
|
||||
@ -693,7 +693,7 @@ int32_t LnnInitNetworkManagerDelay(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnIsAutoNetWorkingEnabled(void)
|
||||
bool LnnIsAutoNetWorkingEnabled(void)
|
||||
{
|
||||
bool isConfigEnabled = false;
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_AUTO_NETWORKING_SWITCH, (unsigned char *)&isConfigEnabled,
|
||||
@ -707,7 +707,7 @@ NO_SANITIZE("cfi") bool LnnIsAutoNetWorkingEnabled(void)
|
||||
g_isOOBEEnd && g_isUnLock;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitNetworkManager(void)
|
||||
void LnnDeinitNetworkManager(void)
|
||||
{
|
||||
if (g_nightOnCache != NULL) {
|
||||
DeviceNightMode *item = NULL;
|
||||
@ -738,7 +738,7 @@ NO_SANITIZE("cfi") void LnnDeinitNetworkManager(void)
|
||||
LnnUnregisterEventHandler(LNN_EVENT_ACCOUNT_CHANGED, NetAccountStateChangeEventHandler);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetNetIfTypeByName(const char *ifName, LnnNetIfType *type)
|
||||
int32_t LnnGetNetIfTypeByName(const char *ifName, LnnNetIfType *type)
|
||||
{
|
||||
if (ifName == NULL || type == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "parameters are NULL!");
|
||||
@ -754,7 +754,7 @@ NO_SANITIZE("cfi") int32_t LnnGetNetIfTypeByName(const char *ifName, LnnNetIfTyp
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetAddrTypeByIfName(const char *ifName, ConnectionAddrType *type)
|
||||
int32_t LnnGetAddrTypeByIfName(const char *ifName, ConnectionAddrType *type)
|
||||
{
|
||||
if (type == NULL || ifName == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "parameters are NULL!");
|
||||
@ -800,7 +800,7 @@ static VisitNextChoice FindProtocolByType(const LnnProtocolManager *manager, voi
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") ListenerModule LnnGetProtocolListenerModule(ProtocolType protocol, ListenerMode mode)
|
||||
ListenerModule LnnGetProtocolListenerModule(ProtocolType protocol, ListenerMode mode)
|
||||
{
|
||||
struct FindProtocolByTypeRequest request = {.protocol = protocol, .manager = NULL};
|
||||
if (LnnVisitProtocol(FindProtocolByType, &request)) {
|
||||
|
@ -49,7 +49,7 @@ static LnnPhysicalSubnet *g_physicalSubnets[MAX_SUPPORTED_PHYSICAL_SUBNET];
|
||||
SoftBusMutexUnlock(LOCK); \
|
||||
} while (false)
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitPhysicalSubnetManager(void)
|
||||
int32_t LnnInitPhysicalSubnetManager(void)
|
||||
{
|
||||
return SoftBusMutexInit(&g_physicalSubnetsLock, NULL);
|
||||
}
|
||||
@ -66,7 +66,7 @@ static void ClearSubnetManager(void)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitPhysicalSubnetManager(void)
|
||||
void LnnDeinitPhysicalSubnetManager(void)
|
||||
{
|
||||
CALL_VOID_FUNC_WITH_LOCK(&g_physicalSubnetsLock, ClearSubnetManager());
|
||||
if (SoftBusMutexDestroy(&g_physicalSubnetsLock) != SOFTBUS_OK) {
|
||||
@ -90,7 +90,7 @@ static int32_t DoRegistSubnet(LnnPhysicalSubnet *subnet)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnRegistPhysicalSubnet(LnnPhysicalSubnet *subnet)
|
||||
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;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnUnregistPhysicalSubnetByType(ProtocolType type)
|
||||
int32_t LnnUnregistPhysicalSubnetByType(ProtocolType type)
|
||||
{
|
||||
int32_t ret = SOFTBUS_OK;
|
||||
CALL_WITH_LOCK(ret, &g_physicalSubnetsLock, DoUnregistSubnetByType(type));
|
||||
@ -144,7 +144,7 @@ void LnnNotifyPhysicalSubnetStatusChanged(const char *ifName, ProtocolType proto
|
||||
CALL_VOID_FUNC_WITH_LOCK(&g_physicalSubnetsLock, DoNotifyStatusChange(ifName, protocolType, status));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void EnableResetingSubnetByType(ProtocolType protocolType)
|
||||
static void EnableResetingSubnetByType(ProtocolType protocolType)
|
||||
{
|
||||
for (uint16_t i = 0; i < MAX_SUPPORTED_PHYSICAL_SUBNET; i++) {
|
||||
if (g_physicalSubnets[i] == NULL || g_physicalSubnets[i]->protocol->id != protocolType) {
|
||||
@ -156,7 +156,7 @@ NO_SANITIZE("cfi") static void EnableResetingSubnetByType(ProtocolType protocolT
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyAllTypeOffline(ConnectionAddrType type)
|
||||
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;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnVisitPhysicalSubnet(LnnVisitPhysicalSubnetCallback callback, void *data)
|
||||
bool LnnVisitPhysicalSubnet(LnnVisitPhysicalSubnetCallback callback, void *data)
|
||||
{
|
||||
bool ret = false;
|
||||
CALL_WITH_LOCK(ret, &g_physicalSubnetsLock, DoVisitSubnet(callback, data));
|
||||
|
@ -49,7 +49,7 @@ static TypeToId g_typeToIdMap[] = {
|
||||
|
||||
static char g_stringTypeId[DEVICE_TYPE_MAX_LENGTH + 1] = {0};
|
||||
|
||||
NO_SANITIZE("cfi") const char *LnnGetDeviceName(const DeviceBasicInfo *info)
|
||||
const char *LnnGetDeviceName(const DeviceBasicInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "LnnGetDeviceName para error.");
|
||||
@ -58,7 +58,7 @@ NO_SANITIZE("cfi") const char *LnnGetDeviceName(const DeviceBasicInfo *info)
|
||||
return info->deviceName;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetDeviceName(DeviceBasicInfo *info, const char *name)
|
||||
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.");
|
||||
@ -71,7 +71,7 @@ NO_SANITIZE("cfi") int32_t LnnSetDeviceName(DeviceBasicInfo *info, const char *n
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetDeviceTypeId(const DeviceBasicInfo *info, uint16_t *typeId)
|
||||
int32_t LnnGetDeviceTypeId(const DeviceBasicInfo *info, uint16_t *typeId)
|
||||
{
|
||||
if (info == NULL || typeId == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "LnnGetDeviceTypeId para error.");
|
||||
@ -132,7 +132,7 @@ static char *ConvertIntToHexString(uint16_t typeId)
|
||||
return g_stringTypeId;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnConvertDeviceTypeToId(const char *deviceType, uint16_t *typeId)
|
||||
int32_t LnnConvertDeviceTypeToId(const char *deviceType, uint16_t *typeId)
|
||||
{
|
||||
int mstRet;
|
||||
if (deviceType == NULL || typeId == NULL) {
|
||||
@ -163,7 +163,7 @@ NO_SANITIZE("cfi") int32_t LnnConvertDeviceTypeToId(const char *deviceType, uint
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") char *LnnConvertIdToDeviceType(uint16_t typeId)
|
||||
char *LnnConvertIdToDeviceType(uint16_t typeId)
|
||||
{
|
||||
uint32_t count = sizeof(g_typeToIdMap) / sizeof(TypeToId);
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
|
@ -189,7 +189,7 @@ static int32_t InitParamSetByHuks(struct HksParamSet **paramSet, const struct Hk
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitHuksInterface(void)
|
||||
int32_t LnnInitHuksInterface(void)
|
||||
{
|
||||
int32_t ret = HksInitialize();
|
||||
if (ret != HKS_SUCCESS) {
|
||||
@ -214,7 +214,7 @@ NO_SANITIZE("cfi") int32_t LnnInitHuksInterface(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitHuksInterface(void)
|
||||
void LnnDeinitHuksInterface(void)
|
||||
{
|
||||
if (g_genParamSet != NULL) {
|
||||
HksFreeParamSet(&g_genParamSet);
|
||||
@ -227,7 +227,7 @@ NO_SANITIZE("cfi") void LnnDeinitHuksInterface(void)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGenerateKeyByHuks(struct HksBlob *keyAlias)
|
||||
int32_t LnnGenerateKeyByHuks(struct HksBlob *keyAlias)
|
||||
{
|
||||
if (keyAlias == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "invalid param");
|
||||
@ -245,7 +245,7 @@ NO_SANITIZE("cfi") int32_t LnnGenerateKeyByHuks(struct HksBlob *keyAlias)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnDeleteKeyByHuks(struct HksBlob *keyAlias)
|
||||
int32_t LnnDeleteKeyByHuks(struct HksBlob *keyAlias)
|
||||
{
|
||||
if (keyAlias == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "invalid param");
|
||||
@ -264,7 +264,7 @@ NO_SANITIZE("cfi") int32_t LnnDeleteKeyByHuks(struct HksBlob *keyAlias)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnEncryptDataByHuks(const struct HksBlob *keyAlias, const struct HksBlob *inData,
|
||||
int32_t LnnEncryptDataByHuks(const struct HksBlob *keyAlias, const struct HksBlob *inData,
|
||||
struct HksBlob *outData)
|
||||
{
|
||||
if (keyAlias == NULL || inData == NULL) {
|
||||
@ -302,7 +302,7 @@ NO_SANITIZE("cfi") int32_t LnnEncryptDataByHuks(const struct HksBlob *keyAlias,
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnDecryptDataByHuks(const struct HksBlob *keyAlias, const struct HksBlob *inData,
|
||||
int32_t LnnDecryptDataByHuks(const struct HksBlob *keyAlias, const struct HksBlob *inData,
|
||||
struct HksBlob *outData)
|
||||
{
|
||||
if (keyAlias == NULL || inData == NULL) {
|
||||
@ -340,7 +340,7 @@ NO_SANITIZE("cfi") int32_t LnnDecryptDataByHuks(const struct HksBlob *keyAlias,
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGenerateRandomByHuks(uint8_t *random, uint32_t len)
|
||||
int32_t LnnGenerateRandomByHuks(uint8_t *random, uint32_t len)
|
||||
{
|
||||
struct HksBlob tmp = {0};
|
||||
tmp.size = len;
|
||||
|
@ -24,7 +24,7 @@
|
||||
/* support bit1:br, bit2:wifi, bit4:wifi 2.4G */
|
||||
#define DEFAUTL_LNN_CAPBILITY 0x16
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnHasCapability(uint32_t capability, NetCapability type)
|
||||
bool LnnHasCapability(uint32_t capability, NetCapability type)
|
||||
{
|
||||
if (type >= BIT_COUNT) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "in para error!");
|
||||
@ -38,7 +38,7 @@ NO_SANITIZE("cfi") bool LnnHasCapability(uint32_t capability, NetCapability type
|
||||
return false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetNetCapability(uint32_t *capability, NetCapability type)
|
||||
int32_t LnnSetNetCapability(uint32_t *capability, NetCapability type)
|
||||
{
|
||||
if (capability == NULL || type >= BIT_COUNT) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "in para error!");
|
||||
@ -48,7 +48,7 @@ NO_SANITIZE("cfi") int32_t LnnSetNetCapability(uint32_t *capability, NetCapabili
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnClearNetCapability(uint32_t *capability, NetCapability type)
|
||||
int32_t LnnClearNetCapability(uint32_t *capability, NetCapability type)
|
||||
{
|
||||
if (capability == NULL || type >= BIT_COUNT) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "in para error!");
|
||||
@ -58,7 +58,7 @@ NO_SANITIZE("cfi") int32_t LnnClearNetCapability(uint32_t *capability, NetCapabi
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") uint32_t LnnGetNetCapabilty(void)
|
||||
uint32_t LnnGetNetCapabilty(void)
|
||||
{
|
||||
uint32_t capability = 0;
|
||||
uint32_t configValue;
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "softbus_log.h"
|
||||
#include "softbus_utils.h"
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitNetLedger(void)
|
||||
int32_t LnnInitNetLedger(void)
|
||||
{
|
||||
if (LnnInitLocalLedger() != SOFTBUS_OK) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "init local net ledger fail!");
|
||||
@ -112,7 +112,7 @@ int32_t LnnInitNetLedgerDelay(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitNetLedger(void)
|
||||
void LnnDeinitNetLedger(void)
|
||||
{
|
||||
LnnDeinitMetaNodeLedger();
|
||||
LnnDeinitDistributedLedger();
|
||||
@ -210,7 +210,7 @@ int32_t LnnGetNodeKeyInfo(const char *networkId, int key, uint8_t *info, uint32_
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetNodeDataChangeFlag(const char *networkId, uint16_t dataChangeFlag)
|
||||
int32_t LnnSetNodeDataChangeFlag(const char *networkId, uint16_t dataChangeFlag)
|
||||
{
|
||||
bool isLocalNetworkId = false;
|
||||
char localNetworkId[NETWORK_ID_BUF_LEN] = {0};
|
||||
@ -232,7 +232,7 @@ NO_SANITIZE("cfi") int32_t LnnSetNodeDataChangeFlag(const char *networkId, uint1
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetNodeKeyInfoLen(int32_t key)
|
||||
int32_t LnnGetNodeKeyInfoLen(int32_t key)
|
||||
{
|
||||
switch (key) {
|
||||
case NODE_KEY_UDID:
|
||||
@ -261,7 +261,7 @@ NO_SANITIZE("cfi") int32_t LnnGetNodeKeyInfoLen(int32_t key)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftbusDumpPrintUdid(int fd, NodeBasicInfo *nodeInfo)
|
||||
int32_t SoftbusDumpPrintUdid(int fd, NodeBasicInfo *nodeInfo)
|
||||
{
|
||||
NodeDeviceInfoKey key;
|
||||
key = NODE_KEY_UDID;
|
||||
@ -277,7 +277,7 @@ NO_SANITIZE("cfi") int32_t SoftbusDumpPrintUdid(int fd, NodeBasicInfo *nodeInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftbusDumpPrintUuid(int fd, NodeBasicInfo *nodeInfo)
|
||||
int32_t SoftbusDumpPrintUuid(int fd, NodeBasicInfo *nodeInfo)
|
||||
{
|
||||
NodeDeviceInfoKey key;
|
||||
key = NODE_KEY_UUID;
|
||||
@ -293,7 +293,7 @@ NO_SANITIZE("cfi") int32_t SoftbusDumpPrintUuid(int fd, NodeBasicInfo *nodeInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftbusDumpPrintMac(int fd, NodeBasicInfo *nodeInfo)
|
||||
int32_t SoftbusDumpPrintMac(int fd, NodeBasicInfo *nodeInfo)
|
||||
{
|
||||
NodeDeviceInfoKey key;
|
||||
key = NODE_KEY_BR_MAC;
|
||||
@ -309,7 +309,7 @@ NO_SANITIZE("cfi") int32_t SoftbusDumpPrintMac(int fd, NodeBasicInfo *nodeInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftbusDumpPrintIp(int fd, NodeBasicInfo *nodeInfo)
|
||||
int32_t SoftbusDumpPrintIp(int fd, NodeBasicInfo *nodeInfo)
|
||||
{
|
||||
NodeDeviceInfoKey key;
|
||||
key = NODE_KEY_IP_ADDRESS;
|
||||
@ -325,7 +325,7 @@ NO_SANITIZE("cfi") int32_t SoftbusDumpPrintIp(int fd, NodeBasicInfo *nodeInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftbusDumpPrintNetCapacity(int fd, NodeBasicInfo *nodeInfo)
|
||||
int32_t SoftbusDumpPrintNetCapacity(int fd, NodeBasicInfo *nodeInfo)
|
||||
{
|
||||
NodeDeviceInfoKey key;
|
||||
key = NODE_KEY_NETWORK_CAPABILITY;
|
||||
@ -338,7 +338,7 @@ NO_SANITIZE("cfi") int32_t SoftbusDumpPrintNetCapacity(int fd, NodeBasicInfo *no
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftbusDumpPrintNetType(int fd, NodeBasicInfo *nodeInfo)
|
||||
int32_t SoftbusDumpPrintNetType(int fd, NodeBasicInfo *nodeInfo)
|
||||
{
|
||||
NodeDeviceInfoKey key;
|
||||
key = NODE_KEY_NETWORK_TYPE;
|
||||
@ -351,7 +351,7 @@ NO_SANITIZE("cfi") int32_t SoftbusDumpPrintNetType(int fd, NodeBasicInfo *nodeIn
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void SoftBusDumpBusCenterPrintInfo(int fd, NodeBasicInfo *nodeInfo)
|
||||
void SoftBusDumpBusCenterPrintInfo(int fd, NodeBasicInfo *nodeInfo)
|
||||
{
|
||||
if (fd <= 0 || nodeInfo == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "param is null");
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_log.h"
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnHasDiscoveryType(const NodeInfo *info, DiscoveryType type)
|
||||
bool LnnHasDiscoveryType(const NodeInfo *info, DiscoveryType type)
|
||||
{
|
||||
if (info == NULL || type >= DISCOVERY_TYPE_COUNT) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!");
|
||||
@ -35,7 +35,7 @@ NO_SANITIZE("cfi") bool LnnHasDiscoveryType(const NodeInfo *info, DiscoveryType
|
||||
return false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *LnnGetDeviceUdid(const NodeInfo *info)
|
||||
const char *LnnGetDeviceUdid(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
return NULL;
|
||||
@ -43,7 +43,7 @@ NO_SANITIZE("cfi") const char *LnnGetDeviceUdid(const NodeInfo *info)
|
||||
return info->deviceInfo.deviceUdid;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetDeviceUdid(NodeInfo *info, const char *udid)
|
||||
int32_t LnnSetDeviceUdid(NodeInfo *info, const char *udid)
|
||||
{
|
||||
if (info == NULL || udid == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -55,7 +55,7 @@ NO_SANITIZE("cfi") int32_t LnnSetDeviceUdid(NodeInfo *info, const char *udid)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *LnnGetDeviceUuid(const NodeInfo *info)
|
||||
const char *LnnGetDeviceUuid(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
return NULL;
|
||||
@ -63,7 +63,7 @@ NO_SANITIZE("cfi") const char *LnnGetDeviceUuid(const NodeInfo *info)
|
||||
return info->uuid;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetDiscoveryType(NodeInfo *info, DiscoveryType type)
|
||||
int32_t LnnSetDiscoveryType(NodeInfo *info, DiscoveryType type)
|
||||
{
|
||||
if (info == NULL || type >= DISCOVERY_TYPE_COUNT) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!");
|
||||
@ -73,7 +73,7 @@ NO_SANITIZE("cfi") int32_t LnnSetDiscoveryType(NodeInfo *info, DiscoveryType typ
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnClearDiscoveryType(NodeInfo *info, DiscoveryType type)
|
||||
int32_t LnnClearDiscoveryType(NodeInfo *info, DiscoveryType type)
|
||||
{
|
||||
if (info == NULL || type >= DISCOVERY_TYPE_COUNT) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!");
|
||||
@ -83,7 +83,7 @@ NO_SANITIZE("cfi") int32_t LnnClearDiscoveryType(NodeInfo *info, DiscoveryType t
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnIsNodeOnline(const NodeInfo *info)
|
||||
bool LnnIsNodeOnline(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!");
|
||||
@ -92,7 +92,7 @@ NO_SANITIZE("cfi") bool LnnIsNodeOnline(const NodeInfo *info)
|
||||
return (info->status == STATUS_ONLINE);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnSetNodeConnStatus(NodeInfo *info, ConnectStatus status)
|
||||
void LnnSetNodeConnStatus(NodeInfo *info, ConnectStatus status)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!!!");
|
||||
@ -101,7 +101,7 @@ NO_SANITIZE("cfi") void LnnSetNodeConnStatus(NodeInfo *info, ConnectStatus statu
|
||||
info->status = status;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *LnnGetBtMac(const NodeInfo *info)
|
||||
const char *LnnGetBtMac(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!");
|
||||
@ -110,7 +110,7 @@ NO_SANITIZE("cfi") const char *LnnGetBtMac(const NodeInfo *info)
|
||||
return info->connectInfo.macAddr;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnSetBtMac(NodeInfo *info, const char *mac)
|
||||
void LnnSetBtMac(NodeInfo *info, const char *mac)
|
||||
{
|
||||
if (info == NULL || mac == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "PARA ERROR!");
|
||||
@ -122,7 +122,7 @@ NO_SANITIZE("cfi") void LnnSetBtMac(NodeInfo *info, const char *mac)
|
||||
return;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *LnnGetNetIfName(const NodeInfo *info)
|
||||
const char *LnnGetNetIfName(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!");
|
||||
@ -131,7 +131,7 @@ NO_SANITIZE("cfi") const char *LnnGetNetIfName(const NodeInfo *info)
|
||||
return info->connectInfo.netIfName;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnSetNetIfName(NodeInfo *info, const char *netIfName)
|
||||
void LnnSetNetIfName(NodeInfo *info, const char *netIfName)
|
||||
{
|
||||
if (info == NULL || netIfName == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "PARA ERROR!");
|
||||
@ -143,7 +143,7 @@ NO_SANITIZE("cfi") void LnnSetNetIfName(NodeInfo *info, const char *netIfName)
|
||||
return;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *LnnGetWiFiIp(const NodeInfo *info)
|
||||
const char *LnnGetWiFiIp(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "PARA error!");
|
||||
@ -152,7 +152,7 @@ NO_SANITIZE("cfi") const char *LnnGetWiFiIp(const NodeInfo *info)
|
||||
return info->connectInfo.deviceIp;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnSetWiFiIp(NodeInfo *info, const char *ip)
|
||||
void LnnSetWiFiIp(NodeInfo *info, const char *ip)
|
||||
{
|
||||
if (info == NULL || ip == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "PARA ERROR!");
|
||||
@ -164,7 +164,7 @@ NO_SANITIZE("cfi") void LnnSetWiFiIp(NodeInfo *info, const char *ip)
|
||||
return;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *LnnGetMasterUdid(const NodeInfo *info)
|
||||
const char *LnnGetMasterUdid(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "PARA ERROR!");
|
||||
@ -173,7 +173,7 @@ NO_SANITIZE("cfi") const char *LnnGetMasterUdid(const NodeInfo *info)
|
||||
return info->masterUdid;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetMasterUdid(NodeInfo *info, const char *udid)
|
||||
int32_t LnnSetMasterUdid(NodeInfo *info, const char *udid)
|
||||
{
|
||||
if (info == NULL || udid == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "PARA ERROR!");
|
||||
@ -186,7 +186,7 @@ NO_SANITIZE("cfi") int32_t LnnSetMasterUdid(NodeInfo *info, const char *udid)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetAuthPort(const NodeInfo *info)
|
||||
int32_t LnnGetAuthPort(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error");
|
||||
@ -195,7 +195,7 @@ NO_SANITIZE("cfi") int32_t LnnGetAuthPort(const NodeInfo *info)
|
||||
return info->connectInfo.authPort;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetAuthPort(NodeInfo *info, int32_t port)
|
||||
int32_t LnnSetAuthPort(NodeInfo *info, int32_t port)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error.");
|
||||
@ -205,7 +205,7 @@ NO_SANITIZE("cfi") int32_t LnnSetAuthPort(NodeInfo *info, int32_t port)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetSessionPort(const NodeInfo *info)
|
||||
int32_t LnnGetSessionPort(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!");
|
||||
@ -214,7 +214,7 @@ NO_SANITIZE("cfi") int32_t LnnGetSessionPort(const NodeInfo *info)
|
||||
return info->connectInfo.sessionPort;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetSessionPort(NodeInfo *info, int32_t port)
|
||||
int32_t LnnSetSessionPort(NodeInfo *info, int32_t port)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!");
|
||||
@ -224,7 +224,7 @@ NO_SANITIZE("cfi") int32_t LnnSetSessionPort(NodeInfo *info, int32_t port)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetProxyPort(const NodeInfo *info)
|
||||
int32_t LnnGetProxyPort(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!");
|
||||
@ -233,7 +233,7 @@ NO_SANITIZE("cfi") int32_t LnnGetProxyPort(const NodeInfo *info)
|
||||
return info->connectInfo.proxyPort;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetProxyPort(NodeInfo *info, int32_t port)
|
||||
int32_t LnnSetProxyPort(NodeInfo *info, int32_t port)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!");
|
||||
@ -243,7 +243,7 @@ NO_SANITIZE("cfi") int32_t LnnSetProxyPort(NodeInfo *info, int32_t port)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetP2pRole(NodeInfo *info, int32_t p2pRole)
|
||||
int32_t LnnSetP2pRole(NodeInfo *info, int32_t p2pRole)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__);
|
||||
@ -253,7 +253,7 @@ NO_SANITIZE("cfi") int32_t LnnSetP2pRole(NodeInfo *info, int32_t p2pRole)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetP2pRole(const NodeInfo *info)
|
||||
int32_t LnnGetP2pRole(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__);
|
||||
@ -262,7 +262,7 @@ NO_SANITIZE("cfi") int32_t LnnGetP2pRole(const NodeInfo *info)
|
||||
return info->p2pInfo.p2pRole;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetWifiCfg(NodeInfo *info, const char *wifiCfg)
|
||||
int32_t LnnSetWifiCfg(NodeInfo *info, const char *wifiCfg)
|
||||
{
|
||||
if (info == NULL || wifiCfg == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__);
|
||||
@ -275,7 +275,7 @@ NO_SANITIZE("cfi") int32_t LnnSetWifiCfg(NodeInfo *info, const char *wifiCfg)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *LnnGetWifiCfg(const NodeInfo *info)
|
||||
const char *LnnGetWifiCfg(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__);
|
||||
@ -284,7 +284,7 @@ NO_SANITIZE("cfi") const char *LnnGetWifiCfg(const NodeInfo *info)
|
||||
return info->p2pInfo.wifiCfg;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetChanList5g(NodeInfo *info, const char *chanList5g)
|
||||
int32_t LnnSetChanList5g(NodeInfo *info, const char *chanList5g)
|
||||
{
|
||||
if (info == NULL || chanList5g == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__);
|
||||
@ -297,7 +297,7 @@ NO_SANITIZE("cfi") int32_t LnnSetChanList5g(NodeInfo *info, const char *chanList
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *LnnGetChanList5g(const NodeInfo *info)
|
||||
const char *LnnGetChanList5g(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__);
|
||||
@ -306,7 +306,7 @@ NO_SANITIZE("cfi") const char *LnnGetChanList5g(const NodeInfo *info)
|
||||
return info->p2pInfo.chanList5g;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetStaFrequency(NodeInfo *info, int32_t staFrequency)
|
||||
int32_t LnnSetStaFrequency(NodeInfo *info, int32_t staFrequency)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__);
|
||||
@ -316,7 +316,7 @@ NO_SANITIZE("cfi") int32_t LnnSetStaFrequency(NodeInfo *info, int32_t staFrequen
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetStaFrequency(const NodeInfo *info)
|
||||
int32_t LnnGetStaFrequency(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__);
|
||||
@ -325,7 +325,7 @@ NO_SANITIZE("cfi") int32_t LnnGetStaFrequency(const NodeInfo *info)
|
||||
return info->p2pInfo.staFrequency;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetP2pMac(NodeInfo *info, const char *p2pMac)
|
||||
int32_t LnnSetP2pMac(NodeInfo *info, const char *p2pMac)
|
||||
{
|
||||
if (info == NULL || p2pMac == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__);
|
||||
@ -338,7 +338,7 @@ NO_SANITIZE("cfi") int32_t LnnSetP2pMac(NodeInfo *info, const char *p2pMac)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *LnnGetP2pMac(const NodeInfo *info)
|
||||
const char *LnnGetP2pMac(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__);
|
||||
@ -347,7 +347,7 @@ NO_SANITIZE("cfi") const char *LnnGetP2pMac(const NodeInfo *info)
|
||||
return info->p2pInfo.p2pMac;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetDataChangeFlag(NodeInfo *info, uint16_t dataChangeFlag)
|
||||
int32_t LnnSetDataChangeFlag(NodeInfo *info, uint16_t dataChangeFlag)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__);
|
||||
@ -357,7 +357,7 @@ NO_SANITIZE("cfi") int32_t LnnSetDataChangeFlag(NodeInfo *info, uint16_t dataCha
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") uint16_t LnnGetDataChangeFlag(const NodeInfo *info)
|
||||
uint16_t LnnGetDataChangeFlag(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__);
|
||||
@ -366,7 +366,7 @@ NO_SANITIZE("cfi") uint16_t LnnGetDataChangeFlag(const NodeInfo *info)
|
||||
return info->dataChangeFlag;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetP2pGoMac(NodeInfo *info, const char *goMac)
|
||||
int32_t LnnSetP2pGoMac(NodeInfo *info, const char *goMac)
|
||||
{
|
||||
if (info == NULL || goMac == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__);
|
||||
@ -380,7 +380,7 @@ NO_SANITIZE("cfi") int32_t LnnSetP2pGoMac(NodeInfo *info, const char *goMac)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *LnnGetP2pGoMac(const NodeInfo *info)
|
||||
const char *LnnGetP2pGoMac(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__);
|
||||
@ -389,7 +389,7 @@ NO_SANITIZE("cfi") const char *LnnGetP2pGoMac(const NodeInfo *info)
|
||||
return info->p2pInfo.goMac;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") uint64_t LnnGetSupportedProtocols(const NodeInfo *info)
|
||||
uint64_t LnnGetSupportedProtocols(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!");
|
||||
@ -398,7 +398,7 @@ NO_SANITIZE("cfi") uint64_t LnnGetSupportedProtocols(const NodeInfo *info)
|
||||
return info->supportedProtocols;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetSupportedProtocols(NodeInfo *info, uint64_t protocols)
|
||||
int32_t LnnSetSupportedProtocols(NodeInfo *info, uint64_t protocols)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para error!");
|
||||
|
@ -219,7 +219,7 @@ static void CompleteUpdateTrustedDevInfo(void *para)
|
||||
LnnUpdateHeartbeatInfo(UPDATE_HB_NETWORK_INFO);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void InsertTrustedDevInfoRecord(void *param)
|
||||
static void InsertTrustedDevInfoRecord(void *param)
|
||||
{
|
||||
DbContext *ctx = NULL;
|
||||
TrustedDevInfoRecord record;
|
||||
@ -294,7 +294,7 @@ static void RemoveTrustedDevInfoRecord(void *param)
|
||||
SoftBusFree(udid);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInsertSpecificTrustedDevInfo(const char *udid)
|
||||
int32_t LnnInsertSpecificTrustedDevInfo(const char *udid)
|
||||
{
|
||||
char *dupUdid = NULL;
|
||||
|
||||
@ -321,7 +321,7 @@ NO_SANITIZE("cfi") int32_t LnnInsertSpecificTrustedDevInfo(const char *udid)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnDeleteSpecificTrustedDevInfo(const char *udid)
|
||||
int32_t LnnDeleteSpecificTrustedDevInfo(const char *udid)
|
||||
{
|
||||
char *dupUdid = NULL;
|
||||
|
||||
@ -379,7 +379,7 @@ static int32_t GetTrustedDevInfoRecord(DbContext *ctx, const char *accountHexHas
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetTrustedDevInfoFromDb(char **udidArray, uint32_t *num)
|
||||
int32_t LnnGetTrustedDevInfoFromDb(char **udidArray, uint32_t *num)
|
||||
{
|
||||
uint8_t accountHash[SHA_256_HASH_LEN] = {0};
|
||||
char accountHexHash[SHA_256_HEX_HASH_LEN] = {0};
|
||||
@ -471,7 +471,7 @@ bool LnnIsPotentialHomeGroup(const char *udid)
|
||||
return false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitDecisionDbDelay(void)
|
||||
int32_t LnnInitDecisionDbDelay(void)
|
||||
{
|
||||
if (LnnGenerateKeyByHuks(&g_keyAlias) != SOFTBUS_OK) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "generate decision db huks key fail");
|
||||
|
@ -116,7 +116,7 @@ static uint64_t GetCurrentTime(void)
|
||||
return (uint64_t)now.sec * TIME_THOUSANDS_FACTOR + (uint64_t)now.usec / TIME_THOUSANDS_FACTOR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetAuthTypeValue(uint32_t *authTypeValue, AuthType type)
|
||||
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!");
|
||||
@ -126,7 +126,7 @@ NO_SANITIZE("cfi") int32_t LnnSetAuthTypeValue(uint32_t *authTypeValue, AuthType
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnClearAuthTypeValue(uint32_t *authTypeValue, AuthType type)
|
||||
int32_t LnnClearAuthTypeValue(uint32_t *authTypeValue, AuthType type)
|
||||
{
|
||||
if (authTypeValue == NULL || type >= AUTH_TYPE_BUTT) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "in para error!");
|
||||
@ -199,7 +199,7 @@ static void DeinitConnectionCode(ConnectionCode *cnnCode)
|
||||
return;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitDistributedLedger(void)
|
||||
void LnnDeinitDistributedLedger(void)
|
||||
{
|
||||
if (SoftBusMutexLock(&g_distributedNetLedger.lock) != 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "lock mutex fail!");
|
||||
@ -400,7 +400,7 @@ void PostOnlineNodesToCb(const INodeStateCb *callBack)
|
||||
LnnMapDeinitIterator(it);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") NodeInfo *LnnGetNodeInfoById(const char *id, IdCategory type)
|
||||
NodeInfo *LnnGetNodeInfoById(const char *id, IdCategory type)
|
||||
{
|
||||
NodeInfo *info = NULL;
|
||||
DoubleHashMap *map = &g_distributedNetLedger.distributedInfo;
|
||||
@ -483,7 +483,7 @@ static NodeInfo *LnnGetNodeInfoByDeviceId(const char *id)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetRemoteNodeInfoById(const char *id, IdCategory type, NodeInfo *info)
|
||||
int32_t LnnGetRemoteNodeInfoById(const char *id, IdCategory type, NodeInfo *info)
|
||||
{
|
||||
if (id == NULL || info == NULL) {
|
||||
LLOGE("param error");
|
||||
@ -1126,7 +1126,7 @@ static void RemoveCnnCode(Map *cnnCode, const char *uuid, DiscoveryType type)
|
||||
return;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") short LnnGetCnnCode(const char *uuid, DiscoveryType type)
|
||||
short LnnGetCnnCode(const char *uuid, DiscoveryType type)
|
||||
{
|
||||
char *key = CreateCnnCodeKey(uuid, type);
|
||||
if (key == NULL) {
|
||||
@ -1158,7 +1158,7 @@ static void MergeLnnInfo(const NodeInfo *oldInfo, NodeInfo *info)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnUpdateNetworkId(const NodeInfo *newInfo)
|
||||
int32_t LnnUpdateNetworkId(const NodeInfo *newInfo)
|
||||
{
|
||||
const char *udid = NULL;
|
||||
DoubleHashMap *map = NULL;
|
||||
@ -1185,7 +1185,7 @@ NO_SANITIZE("cfi") int32_t LnnUpdateNetworkId(const NodeInfo *newInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnUpdateNodeInfo(NodeInfo *newInfo)
|
||||
int32_t LnnUpdateNodeInfo(NodeInfo *newInfo)
|
||||
{
|
||||
const char *udid = NULL;
|
||||
DoubleHashMap *map = NULL;
|
||||
@ -1219,7 +1219,7 @@ NO_SANITIZE("cfi") int32_t LnnUpdateNodeInfo(NodeInfo *newInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnAddMetaInfo(NodeInfo *info)
|
||||
int32_t LnnAddMetaInfo(NodeInfo *info)
|
||||
{
|
||||
const char *udid = NULL;
|
||||
DoubleHashMap *map = NULL;
|
||||
@ -1251,7 +1251,7 @@ NO_SANITIZE("cfi") int32_t LnnAddMetaInfo(NodeInfo *info)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnDeleteMetaInfo(const char *udid, ConnectionAddrType type)
|
||||
int32_t LnnDeleteMetaInfo(const char *udid, ConnectionAddrType type)
|
||||
{
|
||||
NodeInfo *info = NULL;
|
||||
DiscoveryType discType = LnnConvAddrTypeToDiscType(type);
|
||||
@ -1423,7 +1423,7 @@ static void NodeOnlineProc(NodeInfo *info)
|
||||
BleDirectlyOnlineProc(&nodeInfo);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") ReportCategory LnnAddOnlineNode(NodeInfo *info)
|
||||
ReportCategory LnnAddOnlineNode(NodeInfo *info)
|
||||
{
|
||||
// judge map
|
||||
info->onlinetTimestamp = LnnUpTimeMs();
|
||||
@ -1514,7 +1514,7 @@ NO_SANITIZE("cfi") ReportCategory LnnAddOnlineNode(NodeInfo *info)
|
||||
return REPORT_NONE;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnUpdateAccountInfo(const NodeInfo *info)
|
||||
int32_t LnnUpdateAccountInfo(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
LLOGE("info is null");
|
||||
@ -1539,7 +1539,7 @@ NO_SANITIZE("cfi") int32_t LnnUpdateAccountInfo(const NodeInfo *info)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnUpdateGroupType(const NodeInfo *info)
|
||||
int32_t LnnUpdateGroupType(const NodeInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
LLOGE("info is null");
|
||||
@ -1577,7 +1577,7 @@ static void NotifyMigrateDegrade(const char *udid)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") ReportCategory LnnSetNodeOffline(const char *udid, ConnectionAddrType type, int32_t authId)
|
||||
ReportCategory LnnSetNodeOffline(const char *udid, ConnectionAddrType type, int32_t authId)
|
||||
{
|
||||
NodeInfo *info = NULL;
|
||||
|
||||
@ -1631,7 +1631,7 @@ NO_SANITIZE("cfi") ReportCategory LnnSetNodeOffline(const char *udid, Connection
|
||||
return REPORT_OFFLINE;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetBasicInfoByUdid(const char *udid, NodeBasicInfo *basicInfo)
|
||||
int32_t LnnGetBasicInfoByUdid(const char *udid, NodeBasicInfo *basicInfo)
|
||||
{
|
||||
if (udid == NULL || basicInfo == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "PARA ERROR!");
|
||||
@ -1648,7 +1648,7 @@ NO_SANITIZE("cfi") int32_t LnnGetBasicInfoByUdid(const char *udid, NodeBasicInfo
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnRemoveNode(const char *udid)
|
||||
void LnnRemoveNode(const char *udid)
|
||||
{
|
||||
DoubleHashMap *map = &g_distributedNetLedger.distributedInfo;
|
||||
if (udid == NULL) {
|
||||
@ -1662,7 +1662,7 @@ NO_SANITIZE("cfi") void LnnRemoveNode(const char *udid)
|
||||
SoftBusMutexUnlock(&g_distributedNetLedger.lock);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *LnnConvertDLidToUdid(const char *id, IdCategory type)
|
||||
const char *LnnConvertDLidToUdid(const char *id, IdCategory type)
|
||||
{
|
||||
NodeInfo *info = NULL;
|
||||
if (id == NULL) {
|
||||
@ -1676,7 +1676,7 @@ NO_SANITIZE("cfi") const char *LnnConvertDLidToUdid(const char *id, IdCategory t
|
||||
return LnnGetDeviceUdid(info);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnConvertDlId(const char *srcId, IdCategory srcIdType, IdCategory dstIdType,
|
||||
int32_t LnnConvertDlId(const char *srcId, IdCategory srcIdType, IdCategory dstIdType,
|
||||
char *dstIdBuf, uint32_t dstIdBufLen)
|
||||
{
|
||||
NodeInfo *info = NULL;
|
||||
@ -1718,7 +1718,7 @@ NO_SANITIZE("cfi") int32_t LnnConvertDlId(const char *srcId, IdCategory srcIdTyp
|
||||
return rc;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetLnnRelation(const char *id, IdCategory type, uint8_t *relation, uint32_t len)
|
||||
int32_t LnnGetLnnRelation(const char *id, IdCategory type, uint8_t *relation, uint32_t len)
|
||||
{
|
||||
NodeInfo *info = NULL;
|
||||
|
||||
@ -1744,7 +1744,7 @@ NO_SANITIZE("cfi") int32_t LnnGetLnnRelation(const char *id, IdCategory type, ui
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnSetDLDeviceInfoName(const char *udid, const char *name)
|
||||
bool LnnSetDLDeviceInfoName(const char *udid, const char *name)
|
||||
{
|
||||
DoubleHashMap *map = &g_distributedNetLedger.distributedInfo;
|
||||
NodeInfo *info = NULL;
|
||||
@ -1803,7 +1803,7 @@ EXIT:
|
||||
return false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnSetDLP2pInfo(const char *networkId, const P2pInfo *info)
|
||||
bool LnnSetDLP2pInfo(const char *networkId, const P2pInfo *info)
|
||||
{
|
||||
NodeInfo *node = NULL;
|
||||
if (networkId == NULL || info == NULL) {
|
||||
@ -1832,7 +1832,7 @@ EXIT:
|
||||
return false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetRemoteStrInfo(const char *networkId, InfoKey key, char *info, uint32_t len)
|
||||
int32_t LnnGetRemoteStrInfo(const char *networkId, InfoKey key, char *info, uint32_t len)
|
||||
{
|
||||
uint32_t i;
|
||||
int32_t ret;
|
||||
@ -1865,7 +1865,7 @@ NO_SANITIZE("cfi") int32_t LnnGetRemoteStrInfo(const char *networkId, InfoKey ke
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetRemoteNumInfo(const char *networkId, InfoKey key, int32_t *info)
|
||||
int32_t LnnGetRemoteNumInfo(const char *networkId, InfoKey key, int32_t *info)
|
||||
{
|
||||
uint32_t i;
|
||||
int32_t ret;
|
||||
@ -1898,7 +1898,7 @@ NO_SANITIZE("cfi") int32_t LnnGetRemoteNumInfo(const char *networkId, InfoKey ke
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetRemoteNumU64Info(const char *networkId, InfoKey key, uint64_t *info)
|
||||
int32_t LnnGetRemoteNumU64Info(const char *networkId, InfoKey key, uint64_t *info)
|
||||
{
|
||||
uint32_t i;
|
||||
int32_t ret;
|
||||
@ -1931,7 +1931,7 @@ NO_SANITIZE("cfi") int32_t LnnGetRemoteNumU64Info(const char *networkId, InfoKey
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetRemoteNum16Info(const char *networkId, InfoKey key, int16_t *info)
|
||||
int32_t LnnGetRemoteNum16Info(const char *networkId, InfoKey key, int16_t *info)
|
||||
{
|
||||
uint32_t i;
|
||||
int32_t ret;
|
||||
@ -1964,7 +1964,7 @@ NO_SANITIZE("cfi") int32_t LnnGetRemoteNum16Info(const char *networkId, InfoKey
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetRemoteBoolInfo(const char *networkId, InfoKey key, bool *info)
|
||||
int32_t LnnGetRemoteBoolInfo(const char *networkId, InfoKey key, bool *info)
|
||||
{
|
||||
uint32_t i;
|
||||
int32_t ret;
|
||||
@ -1997,7 +1997,7 @@ NO_SANITIZE("cfi") int32_t LnnGetRemoteBoolInfo(const char *networkId, InfoKey k
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetRemoteByteInfo(const char *networkId, InfoKey key, uint8_t *info, uint32_t len)
|
||||
int32_t LnnGetRemoteByteInfo(const char *networkId, InfoKey key, uint8_t *info, uint32_t len)
|
||||
{
|
||||
uint32_t i;
|
||||
int32_t ret;
|
||||
@ -2073,7 +2073,7 @@ static int32_t GetAllOnlineAndMetaNodeInfo(NodeBasicInfo **info, int32_t *infoNu
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnIsLSANode(const NodeBasicInfo *info)
|
||||
bool LnnIsLSANode(const NodeBasicInfo *info)
|
||||
{
|
||||
NodeInfo *nodeInfo = LnnGetNodeInfoById(info->networkId, CATEGORY_NETWORK_ID);
|
||||
if (nodeInfo != NULL && LnnHasDiscoveryType(nodeInfo, DISCOVERY_TYPE_LSA)) {
|
||||
@ -2101,17 +2101,17 @@ int32_t LnnGetAllOnlineNodeNum(int32_t *nodeNum)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetAllOnlineNodeInfo(NodeBasicInfo **info, int32_t *infoNum)
|
||||
int32_t LnnGetAllOnlineNodeInfo(NodeBasicInfo **info, int32_t *infoNum)
|
||||
{
|
||||
return GetAllOnlineAndMetaNodeInfo(info, infoNum, false);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetAllOnlineAndMetaNodeInfo(NodeBasicInfo **info, int32_t *infoNum)
|
||||
int32_t LnnGetAllOnlineAndMetaNodeInfo(NodeBasicInfo **info, int32_t *infoNum)
|
||||
{
|
||||
return GetAllOnlineAndMetaNodeInfo(info, infoNum, true);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetNetworkIdByBtMac(const char *btMac, char *buf, uint32_t len)
|
||||
int32_t LnnGetNetworkIdByBtMac(const char *btMac, char *buf, uint32_t len)
|
||||
{
|
||||
if (btMac == NULL || btMac[0] == '\0' || buf == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "btMac is empty");
|
||||
@ -2149,7 +2149,7 @@ NO_SANITIZE("cfi") int32_t LnnGetNetworkIdByBtMac(const char *btMac, char *buf,
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetNetworkIdByUdidHash(const char *udidHash, char *buf, uint32_t len)
|
||||
int32_t LnnGetNetworkIdByUdidHash(const char *udidHash, char *buf, uint32_t len)
|
||||
{
|
||||
if (udidHash == NULL || udidHash[0] == '\0' || buf == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "udidHash is empty");
|
||||
@ -2194,7 +2194,7 @@ NO_SANITIZE("cfi") int32_t LnnGetNetworkIdByUdidHash(const char *udidHash, char
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetNetworkIdByUuid(const char *uuid, char *buf, uint32_t len)
|
||||
int32_t LnnGetNetworkIdByUuid(const char *uuid, char *buf, uint32_t len)
|
||||
{
|
||||
if (!IsValidString(uuid, ID_MAX_LEN)) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "uuid is invalid");
|
||||
@ -2220,7 +2220,7 @@ NO_SANITIZE("cfi") int32_t LnnGetNetworkIdByUuid(const char *uuid, char *buf, ui
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetNetworkIdByUdid(const char *udid, char *buf, uint32_t len)
|
||||
int32_t LnnGetNetworkIdByUdid(const char *udid, char *buf, uint32_t len)
|
||||
{
|
||||
if (!IsValidString(udid, ID_MAX_LEN)) {
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_ERROR, "udid is invalid");
|
||||
@ -2246,7 +2246,7 @@ NO_SANITIZE("cfi") int32_t LnnGetNetworkIdByUdid(const char *udid, char *buf, ui
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetDLOnlineTimestamp(const char *networkId, uint64_t *timestamp)
|
||||
int32_t LnnGetDLOnlineTimestamp(const char *networkId, uint64_t *timestamp)
|
||||
{
|
||||
if (SoftBusMutexLock(&g_distributedNetLedger.lock) != 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "lock mutex fail!");
|
||||
@ -2263,7 +2263,7 @@ NO_SANITIZE("cfi") int32_t LnnGetDLOnlineTimestamp(const char *networkId, uint64
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetDLHeartbeatTimestamp(const char *networkId, uint64_t *timestamp)
|
||||
int32_t LnnGetDLHeartbeatTimestamp(const char *networkId, uint64_t *timestamp)
|
||||
{
|
||||
if (SoftBusMutexLock(&g_distributedNetLedger.lock) != 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "lock mutex fail!");
|
||||
@ -2280,7 +2280,7 @@ NO_SANITIZE("cfi") int32_t LnnGetDLHeartbeatTimestamp(const char *networkId, uin
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetDLHeartbeatTimestamp(const char *networkId, uint64_t timestamp)
|
||||
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!");
|
||||
@ -2297,7 +2297,7 @@ NO_SANITIZE("cfi") int32_t LnnSetDLHeartbeatTimestamp(const char *networkId, uin
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetDLConnCapability(const char *networkId, uint32_t connCapability)
|
||||
int32_t LnnSetDLConnCapability(const char *networkId, uint32_t connCapability)
|
||||
{
|
||||
if (SoftBusMutexLock(&g_distributedNetLedger.lock) != 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "lock mutex fail!");
|
||||
@ -2314,7 +2314,7 @@ NO_SANITIZE("cfi") int32_t LnnSetDLConnCapability(const char *networkId, uint32_
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetDLBatteryInfo(const char *networkId, const BatteryInfo *info)
|
||||
int32_t LnnSetDLBatteryInfo(const char *networkId, const BatteryInfo *info)
|
||||
{
|
||||
if (networkId == NULL || info == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -2335,7 +2335,7 @@ NO_SANITIZE("cfi") int32_t LnnSetDLBatteryInfo(const char *networkId, const Batt
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetDLBssTransInfo(const char *networkId, const BssTransInfo *info)
|
||||
int32_t LnnSetDLBssTransInfo(const char *networkId, const BssTransInfo *info)
|
||||
{
|
||||
if (networkId == NULL || info == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -2359,7 +2359,7 @@ NO_SANITIZE("cfi") int32_t LnnSetDLBssTransInfo(const char *networkId, const Bss
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetDLNodeAddr(const char *id, IdCategory type, const char *addr)
|
||||
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!");
|
||||
@ -2447,7 +2447,7 @@ int32_t SoftBusDumpBusCenterRemoteDeviceInfo(int32_t fd)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitDistributedLedger(void)
|
||||
int32_t LnnInitDistributedLedger(void)
|
||||
{
|
||||
if (g_distributedNetLedger.status == DL_INIT_SUCCESS) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_INFO, "Distributed Ledger already init");
|
||||
@ -2478,7 +2478,7 @@ NO_SANITIZE("cfi") int32_t LnnInitDistributedLedger(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const NodeInfo *LnnGetOnlineNodeByUdidHash(const char *recvUdidHash)
|
||||
const NodeInfo *LnnGetOnlineNodeByUdidHash(const char *recvUdidHash)
|
||||
{
|
||||
int32_t i;
|
||||
int32_t infoNum = 0;
|
||||
@ -2551,7 +2551,7 @@ static void RefreshDeviceOnlineStateInfo(DeviceInfo *device, const InnerDeviceIn
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnRefreshDeviceOnlineStateAndDevIdInfo(const char *pkgName, DeviceInfo *device,
|
||||
void LnnRefreshDeviceOnlineStateAndDevIdInfo(const char *pkgName, DeviceInfo *device,
|
||||
const InnerDeviceInfoAddtions *addtions)
|
||||
{
|
||||
(void)pkgName;
|
||||
|
@ -77,7 +77,7 @@ static MetaNodeStorageInfo *CreateMetaNodeStorageInfo(const MetaNodeConfigInfo *
|
||||
return storageInfo;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnActiveMetaNode(const MetaNodeConfigInfo *info, char *metaNodeId)
|
||||
int32_t LnnActiveMetaNode(const MetaNodeConfigInfo *info, char *metaNodeId)
|
||||
{
|
||||
MetaNodeStorageInfo *storageInfo = NULL;
|
||||
int32_t rc = SOFTBUS_ERR;
|
||||
@ -127,7 +127,7 @@ NO_SANITIZE("cfi") int32_t LnnActiveMetaNode(const MetaNodeConfigInfo *info, cha
|
||||
return rc;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnDeactiveMetaNode(const char *metaNodeId)
|
||||
int32_t LnnDeactiveMetaNode(const char *metaNodeId)
|
||||
{
|
||||
MetaNodeStorageInfo *storageInfo = NULL;
|
||||
int32_t rc = SOFTBUS_OK;
|
||||
@ -157,7 +157,7 @@ NO_SANITIZE("cfi") int32_t LnnDeactiveMetaNode(const char *metaNodeId)
|
||||
return rc;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetAllMetaNodeInfo(MetaNodeInfo *infos, int32_t *infoNum)
|
||||
int32_t LnnGetAllMetaNodeInfo(MetaNodeInfo *infos, int32_t *infoNum)
|
||||
{
|
||||
MetaNodeStorageInfo *item = NULL;
|
||||
int32_t i = 0;
|
||||
@ -247,7 +247,7 @@ int32_t LnnGetMetaNodeInfoByNetworkId(const char *networkId, MetaNodeInfo *nodeI
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitMetaNodeLedger(void)
|
||||
int32_t LnnInitMetaNodeLedger(void)
|
||||
{
|
||||
if (g_metaNodeList == NULL) {
|
||||
g_metaNodeList = CreateSoftBusList();
|
||||
@ -260,7 +260,7 @@ NO_SANITIZE("cfi") int32_t LnnInitMetaNodeLedger(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitMetaNodeLedger(void)
|
||||
void LnnDeinitMetaNodeLedger(void)
|
||||
{
|
||||
if (g_metaNodeList == NULL) {
|
||||
return;
|
||||
|
@ -736,7 +736,7 @@ static int32_t ModifyId(char *dstId, uint32_t dstLen, const char *sourceId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const NodeInfo *LnnGetLocalNodeInfo(void)
|
||||
const NodeInfo *LnnGetLocalNodeInfo(void)
|
||||
{
|
||||
return &g_localNetLedger.localInfo;
|
||||
}
|
||||
@ -828,17 +828,17 @@ static int32_t UpdateLocalUuid(const void *id)
|
||||
return ModifyId(g_localNetLedger.localInfo.uuid, UUID_BUF_LEN, (char *)id);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t UpdateLocalParentId(const char *id)
|
||||
int32_t UpdateLocalParentId(const char *id)
|
||||
{
|
||||
return ModifyId(g_localNetLedger.localInfo.parentId, ID_MAX_LEN, id);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t UpdateLocalPublicId(const char *id)
|
||||
int32_t UpdateLocalPublicId(const char *id)
|
||||
{
|
||||
return ModifyId(g_localNetLedger.localInfo.publicId, ID_MAX_LEN, id);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t UpdateLocalRole(ConnectRole role)
|
||||
int32_t UpdateLocalRole(ConnectRole role)
|
||||
{
|
||||
g_localNetLedger.localInfo.role = role;
|
||||
return SOFTBUS_OK;
|
||||
@ -871,13 +871,13 @@ static int32_t UpdateMasgerNodeWeight(const void *weight)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t UpdateLocalStatus(ConnectStatus status)
|
||||
int32_t UpdateLocalStatus(ConnectStatus status)
|
||||
{
|
||||
g_localNetLedger.localInfo.status = status;
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t UpdateLocalWeight(int32_t weight)
|
||||
int32_t UpdateLocalWeight(int32_t weight)
|
||||
{
|
||||
g_localNetLedger.localInfo.masterWeight = weight;
|
||||
return SOFTBUS_OK;
|
||||
@ -1083,7 +1083,7 @@ static LocalLedgerKey g_localKeyTable[] = {
|
||||
{BYTE_KEY_ACCOUNT_HASH, SHA_256_HASH_LEN, LlGetAccount, LlUpdateAccount},
|
||||
};
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetLocalStrInfo(InfoKey key, char *info, uint32_t len)
|
||||
int32_t LnnGetLocalStrInfo(InfoKey key, char *info, uint32_t len)
|
||||
{
|
||||
uint32_t i;
|
||||
int32_t ret;
|
||||
@ -1113,7 +1113,7 @@ NO_SANITIZE("cfi") int32_t LnnGetLocalStrInfo(InfoKey key, char *info, uint32_t
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t LnnGetLocalInfo(InfoKey key, void* info, uint32_t infoSize)
|
||||
static int32_t LnnGetLocalInfo(InfoKey key, void* info, uint32_t infoSize)
|
||||
{
|
||||
uint32_t i;
|
||||
int32_t ret;
|
||||
@ -1167,7 +1167,7 @@ int32_t LnnSetLocalUnifiedName(const char *unifiedName)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetLocalStrInfo(InfoKey key, const char *info)
|
||||
int32_t LnnSetLocalStrInfo(InfoKey key, const char *info)
|
||||
{
|
||||
uint32_t i;
|
||||
int32_t ret;
|
||||
@ -1200,7 +1200,7 @@ NO_SANITIZE("cfi") int32_t LnnSetLocalStrInfo(InfoKey key, const char *info)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t LnnSetLocalInfo(InfoKey key, void* info)
|
||||
static int32_t LnnSetLocalInfo(InfoKey key, void* info)
|
||||
{
|
||||
uint32_t i;
|
||||
int32_t ret;
|
||||
@ -1230,7 +1230,7 @@ NO_SANITIZE("cfi") static int32_t LnnSetLocalInfo(InfoKey key, void* info)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t LnnFirstGetUdid(void)
|
||||
static int32_t LnnFirstGetUdid(void)
|
||||
{
|
||||
NodeInfo *nodeInfo = &g_localNetLedger.localInfo;
|
||||
DeviceBasicInfo *deviceInfo = &nodeInfo->deviceInfo;
|
||||
@ -1241,37 +1241,37 @@ NO_SANITIZE("cfi") static int32_t LnnFirstGetUdid(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetLocalNumInfo(InfoKey key, int32_t *info)
|
||||
int32_t LnnGetLocalNumInfo(InfoKey key, int32_t *info)
|
||||
{
|
||||
return LnnGetLocalInfo(key, (void*)info, sizeof(int32_t));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetLocalNum64Info(InfoKey key, int64_t *info)
|
||||
int32_t LnnGetLocalNum64Info(InfoKey key, int64_t *info)
|
||||
{
|
||||
return LnnGetLocalInfo(key, (void*)info, sizeof(int64_t));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetLocalNumU64Info(InfoKey key, uint64_t *info)
|
||||
int32_t LnnGetLocalNumU64Info(InfoKey key, uint64_t *info)
|
||||
{
|
||||
return LnnGetLocalInfo(key, (void*)info, sizeof(uint64_t));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetLocalNum64Info(InfoKey key, int64_t info)
|
||||
int32_t LnnSetLocalNum64Info(InfoKey key, int64_t info)
|
||||
{
|
||||
return LnnSetLocalInfo(key, (void*)&info);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetLocalNum16Info(InfoKey key, int16_t *info)
|
||||
int32_t LnnGetLocalNum16Info(InfoKey key, int16_t *info)
|
||||
{
|
||||
return LnnGetLocalInfo(key, (void*)info, sizeof(int16_t));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetLocalNum16Info(InfoKey key, int16_t info)
|
||||
int32_t LnnSetLocalNum16Info(InfoKey key, int16_t info)
|
||||
{
|
||||
return LnnSetLocalInfo(key, (void*)&info);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnSetLocalNumInfo(InfoKey key, int32_t info)
|
||||
int32_t LnnSetLocalNumInfo(InfoKey key, int32_t info)
|
||||
{
|
||||
return LnnSetLocalInfo(key, (void*)&info);
|
||||
}
|
||||
@ -1282,12 +1282,12 @@ int32_t LnnSetLocalByteInfo(InfoKey key, const uint8_t *info, uint32_t len)
|
||||
return LnnSetLocalInfo(key, (void *)info);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetLocalByteInfo(InfoKey key, uint8_t *info, uint32_t len)
|
||||
int32_t LnnGetLocalByteInfo(InfoKey key, uint8_t *info, uint32_t len)
|
||||
{
|
||||
return LnnGetLocalInfo(key, (void *)info, len);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetLocalDeviceInfo(NodeBasicInfo *info)
|
||||
int32_t LnnGetLocalDeviceInfo(NodeBasicInfo *info)
|
||||
{
|
||||
int32_t rc;
|
||||
char type[DEVICE_TYPE_BUF_LEN] = {0};
|
||||
@ -1326,7 +1326,7 @@ int32_t SoftBusDumpBusCenterLocalDeviceInfo(int fd)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitLocalLedger(void)
|
||||
int32_t LnnInitLocalLedger(void)
|
||||
{
|
||||
NodeInfo *nodeInfo = NULL;
|
||||
if (g_localNetLedger.status == LL_INIT_SUCCESS) {
|
||||
@ -1389,7 +1389,7 @@ EXIT:
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitLocalLedgerDelay(void)
|
||||
int32_t LnnInitLocalLedgerDelay(void)
|
||||
{
|
||||
NodeInfo *nodeInfo = &g_localNetLedger.localInfo;
|
||||
DeviceBasicInfo *deviceInfo = &nodeInfo->deviceInfo;
|
||||
@ -1404,7 +1404,7 @@ NO_SANITIZE("cfi") int32_t LnnInitLocalLedgerDelay(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitLocalLedger(void)
|
||||
void LnnDeinitLocalLedger(void)
|
||||
{
|
||||
if (g_localNetLedger.status == LL_INIT_SUCCESS) {
|
||||
SoftBusMutexDestroy(&g_localNetLedger.lock);
|
||||
@ -1412,7 +1412,7 @@ NO_SANITIZE("cfi") void LnnDeinitLocalLedger(void)
|
||||
g_localNetLedger.status = LL_INIT_UNKNOWN;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnIsMasterNode(void)
|
||||
bool LnnIsMasterNode(void)
|
||||
{
|
||||
bool ret = false;
|
||||
if (SoftBusMutexLock(&g_localNetLedger.lock) != 0) {
|
||||
|
@ -53,7 +53,7 @@ static LnnDeinitEventMonitorImpl g_monitorImplDeinit[MONITOR_IMPL_MAX_TYPE] = {
|
||||
LnnDeinitDriverMonitorImpl,
|
||||
};
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitEventMonitor(void)
|
||||
int32_t LnnInitEventMonitor(void)
|
||||
{
|
||||
for (uint32_t i = 0; i < MONITOR_IMPL_MAX_TYPE; ++i) {
|
||||
if (g_monitorImplInit[i] == NULL) {
|
||||
@ -67,7 +67,7 @@ NO_SANITIZE("cfi") int32_t LnnInitEventMonitor(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitEventMonitor(void)
|
||||
void LnnDeinitEventMonitor(void)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
|
@ -52,7 +52,7 @@ typedef enum {
|
||||
static BusCenterEventCtrl g_eventCtrl;
|
||||
static SoftBusHandler g_notifyHandler = {"NotifyHandler", NULL, NULL};
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t PostMessageToHandlerDelay(SoftBusMessage *msg, uint64_t delayMillis)
|
||||
static int32_t PostMessageToHandlerDelay(SoftBusMessage *msg, uint64_t delayMillis)
|
||||
{
|
||||
if (g_notifyHandler.looper == NULL) {
|
||||
LLOGE("NotifyHandler not initialized.");
|
||||
@ -118,7 +118,7 @@ static void HandleNetworkUpdateMessage(SoftBusMessage *msg)
|
||||
LLOGD("offline exceted 5min, process networkId update event");
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void HandleNotifyMessage(SoftBusMessage *msg)
|
||||
static void HandleNotifyMessage(SoftBusMessage *msg)
|
||||
{
|
||||
if (msg == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "invalid notify message.");
|
||||
@ -142,7 +142,7 @@ NO_SANITIZE("cfi") static void HandleNotifyMessage(SoftBusMessage *msg)
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_INFO, "handle notify message done, type = %d.", msg->what);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void FreeNotifyMessage(SoftBusMessage *msg)
|
||||
static void FreeNotifyMessage(SoftBusMessage *msg)
|
||||
{
|
||||
if (msg == NULL) {
|
||||
return;
|
||||
@ -229,7 +229,7 @@ static LnnEventHandlerItem *CreateEventHandlerItem(LnnEventHandler handler)
|
||||
return item;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void NotifyEvent(const LnnEventBasicInfo *info)
|
||||
static void NotifyEvent(const LnnEventBasicInfo *info)
|
||||
{
|
||||
LnnEventHandlerItem *item = NULL;
|
||||
|
||||
@ -250,7 +250,7 @@ void LnnNotifyDeviceVerified(const char *udid)
|
||||
RemoveNotifyMessage(NOTIFY_NETWORKID_UPDATE);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyOnlineState(bool isOnline, NodeBasicInfo *info)
|
||||
void LnnNotifyOnlineState(bool isOnline, NodeBasicInfo *info)
|
||||
{
|
||||
LnnOnlineStateEventInfo eventInfo;
|
||||
|
||||
@ -298,7 +298,7 @@ void LnnNotifyMigrate(bool isOnline, NodeBasicInfo *info)
|
||||
NotifyEvent((LnnEventBasicInfo *)&eventInfo);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyBasicInfoChanged(NodeBasicInfo *info, NodeBasicInfoType type)
|
||||
void LnnNotifyBasicInfoChanged(NodeBasicInfo *info, NodeBasicInfoType type)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para : info = null!");
|
||||
@ -310,7 +310,7 @@ NO_SANITIZE("cfi") void LnnNotifyBasicInfoChanged(NodeBasicInfo *info, NodeBasic
|
||||
(void)PostNotifyMessage(NOTIFY_NODE_BASIC_INFO_CHANGED, (uint64_t)type, info);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyJoinResult(ConnectionAddr *addr, const char *networkId, int32_t retCode)
|
||||
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!");
|
||||
@ -320,7 +320,7 @@ NO_SANITIZE("cfi") void LnnNotifyJoinResult(ConnectionAddr *addr, const char *ne
|
||||
LnnIpcNotifyJoinResult(addr, sizeof(ConnectionAddr), networkId, retCode);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void MetaNodeNotifyJoinResult(ConnectionAddr *addr, const char *networkId, int32_t retCode)
|
||||
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!");
|
||||
@ -330,7 +330,7 @@ NO_SANITIZE("cfi") void MetaNodeNotifyJoinResult(ConnectionAddr *addr, const cha
|
||||
MetaNodeIpcNotifyJoinResult(addr, sizeof(ConnectionAddr), networkId, retCode);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyLeaveResult(const char *networkId, int32_t retCode)
|
||||
void LnnNotifyLeaveResult(const char *networkId, int32_t retCode)
|
||||
{
|
||||
if (networkId == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para : networkId = null!");
|
||||
@ -340,7 +340,7 @@ NO_SANITIZE("cfi") void LnnNotifyLeaveResult(const char *networkId, int32_t retC
|
||||
LnnIpcNotifyLeaveResult(networkId, retCode);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void MetaNodeNotifyLeaveResult(const char *networkId, int32_t retCode)
|
||||
void MetaNodeNotifyLeaveResult(const char *networkId, int32_t retCode)
|
||||
{
|
||||
if (networkId == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "para : networkId = null!");
|
||||
@ -350,7 +350,7 @@ NO_SANITIZE("cfi") void MetaNodeNotifyLeaveResult(const char *networkId, int32_t
|
||||
MetaNodeIpcNotifyLeaveResult(networkId, retCode);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyLnnRelationChanged(const char *udid, ConnectionAddrType type, uint8_t relation,
|
||||
void LnnNotifyLnnRelationChanged(const char *udid, ConnectionAddrType type, uint8_t relation,
|
||||
bool isJoin)
|
||||
{
|
||||
LnnRelationChanedEventInfo info;
|
||||
@ -363,7 +363,7 @@ NO_SANITIZE("cfi") void LnnNotifyLnnRelationChanged(const char *udid, Connection
|
||||
NotifyEvent((LnnEventBasicInfo *)&info);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyTimeSyncResult(const char *pkgName, int32_t pid, const TimeSyncResultInfo *info,
|
||||
void LnnNotifyTimeSyncResult(const char *pkgName, int32_t pid, const TimeSyncResultInfo *info,
|
||||
int32_t retCode)
|
||||
{
|
||||
if (pkgName == NULL || info == NULL) {
|
||||
@ -374,7 +374,7 @@ NO_SANITIZE("cfi") void LnnNotifyTimeSyncResult(const char *pkgName, int32_t pid
|
||||
LnnIpcNotifyTimeSyncResult(pkgName, pid, info, sizeof(TimeSyncResultInfo), retCode);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyWlanStateChangeEvent(SoftBusWifiState state)
|
||||
void LnnNotifyWlanStateChangeEvent(SoftBusWifiState state)
|
||||
{
|
||||
if (state < SOFTBUS_WIFI_CONNECTED || state > SOFTBUS_WIFI_UNKNOWN) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "bad state %d", state);
|
||||
@ -384,7 +384,7 @@ NO_SANITIZE("cfi") void LnnNotifyWlanStateChangeEvent(SoftBusWifiState state)
|
||||
NotifyEvent((const LnnEventBasicInfo *)&event);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyScreenStateChangeEvent(SoftBusScreenState state)
|
||||
void LnnNotifyScreenStateChangeEvent(SoftBusScreenState state)
|
||||
{
|
||||
if (state < SOFTBUS_SCREEN_ON || state >= SOFTBUS_SCREEN_UNKNOWN) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "bad state %d", state);
|
||||
@ -394,7 +394,7 @@ NO_SANITIZE("cfi") void LnnNotifyScreenStateChangeEvent(SoftBusScreenState state
|
||||
NotifyEvent((const LnnEventBasicInfo *)&event);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyBtStateChangeEvent(void *state)
|
||||
void LnnNotifyBtStateChangeEvent(void *state)
|
||||
{
|
||||
SoftBusBtState *btState = (SoftBusBtState *)state;
|
||||
if (*btState < SOFTBUS_BLE_TURN_ON || *btState >= SOFTBUS_BT_UNKNOWN) {
|
||||
@ -486,7 +486,7 @@ void LnnNotifyOOBEStateChangeEvent(SoftBusOOBEState state)
|
||||
NotifyEvent((const LnnEventBasicInfo *)&event);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyBtAclStateChangeEvent(const char *btMac, SoftBusBtAclState state)
|
||||
void LnnNotifyBtAclStateChangeEvent(const char *btMac, SoftBusBtAclState state)
|
||||
{
|
||||
if (btMac == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "invalid btMac, state = %d", state);
|
||||
@ -502,7 +502,7 @@ NO_SANITIZE("cfi") void LnnNotifyBtAclStateChangeEvent(const char *btMac, SoftBu
|
||||
NotifyEvent((const LnnEventBasicInfo *)&event);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyAddressChangedEvent(const char *ifName)
|
||||
void LnnNotifyAddressChangedEvent(const char *ifName)
|
||||
{
|
||||
LnnMonitorAddressChangedEvent event = {.basic.event = LNN_EVENT_IP_ADDR_CHANGED, .ifName = {0}};
|
||||
if (ifName != NULL) {
|
||||
@ -515,7 +515,7 @@ NO_SANITIZE("cfi") void LnnNotifyAddressChangedEvent(const char *ifName)
|
||||
NotifyEvent((const LnnEventBasicInfo *)&event);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyMasterNodeChanged(bool isMaster, const char *masterNodeUdid, int32_t weight)
|
||||
void LnnNotifyMasterNodeChanged(bool isMaster, const char *masterNodeUdid, int32_t weight)
|
||||
{
|
||||
LnnMasterNodeChangedEvent event = {.basic.event = LNN_EVENT_NODE_MASTER_STATE_CHANGED,
|
||||
.isMasterNode = isMaster,
|
||||
@ -525,7 +525,7 @@ NO_SANITIZE("cfi") void LnnNotifyMasterNodeChanged(bool isMaster, const char *ma
|
||||
NotifyEvent((const LnnEventBasicInfo *)&event);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyNodeAddressChanged(const char *addr, const char *networkId, bool isLocal)
|
||||
void LnnNotifyNodeAddressChanged(const char *addr, const char *networkId, bool isLocal)
|
||||
{
|
||||
if (addr == NULL) {
|
||||
return;
|
||||
@ -547,7 +547,7 @@ NO_SANITIZE("cfi") void LnnNotifyNodeAddressChanged(const char *addr, const char
|
||||
NotifyEvent((LnnEventBasicInfo *)&eventInfo);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyHBRepeat(void)
|
||||
void LnnNotifyHBRepeat(void)
|
||||
{
|
||||
LnnEventBasicInfo event;
|
||||
event.event = LNN_EVENT_NODE_HB_REPEAT_CYCLE;
|
||||
@ -555,7 +555,7 @@ NO_SANITIZE("cfi") void LnnNotifyHBRepeat(void)
|
||||
NotifyEvent(&event);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifyNetworkStateChanged(SoftBusNetworkState state)
|
||||
void LnnNotifyNetworkStateChanged(SoftBusNetworkState state)
|
||||
{
|
||||
if (state < SOFTBUS_WIFI_NETWORKD_ENABLE || state >= SOFTBUS_NETWORKD_UNKNOWN) {
|
||||
LLOGE("bad network state %d", state);
|
||||
@ -565,7 +565,7 @@ NO_SANITIZE("cfi") void LnnNotifyNetworkStateChanged(SoftBusNetworkState state)
|
||||
NotifyEvent((const LnnEventBasicInfo *)&event);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnNotifySingleOffLineEvent(const ConnectionAddr *addr, NodeBasicInfo *basicInfo)
|
||||
void LnnNotifySingleOffLineEvent(const ConnectionAddr *addr, NodeBasicInfo *basicInfo)
|
||||
{
|
||||
if (addr == NULL || basicInfo == NULL) {
|
||||
LLOGE("addr or basicInfo is null");
|
||||
@ -580,7 +580,7 @@ NO_SANITIZE("cfi") void LnnNotifySingleOffLineEvent(const ConnectionAddr *addr,
|
||||
NotifyEvent((const LnnEventBasicInfo *)&event);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnInitBusCenterEvent(void)
|
||||
int32_t LnnInitBusCenterEvent(void)
|
||||
{
|
||||
int32_t i;
|
||||
SoftBusLooper *looper = CreateNewLooper("NotifyLooper");
|
||||
@ -600,7 +600,7 @@ NO_SANITIZE("cfi") int32_t LnnInitBusCenterEvent(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnDeinitBusCenterEvent(void)
|
||||
void LnnDeinitBusCenterEvent(void)
|
||||
{
|
||||
if (g_notifyHandler.looper != NULL) {
|
||||
DestroyLooper(g_notifyHandler.looper);
|
||||
@ -610,7 +610,7 @@ NO_SANITIZE("cfi") void LnnDeinitBusCenterEvent(void)
|
||||
SoftBusMutexDestroy(&g_eventCtrl.lock);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnRegisterEventHandler(LnnEventType event, LnnEventHandler handler)
|
||||
int32_t LnnRegisterEventHandler(LnnEventType event, LnnEventHandler handler)
|
||||
{
|
||||
LnnEventHandlerItem *item = NULL;
|
||||
|
||||
@ -638,7 +638,7 @@ NO_SANITIZE("cfi") int32_t LnnRegisterEventHandler(LnnEventType event, LnnEventH
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void LnnUnregisterEventHandler(LnnEventType event, LnnEventHandler handler)
|
||||
void LnnUnregisterEventHandler(LnnEventType event, LnnEventHandler handler)
|
||||
{
|
||||
LnnEventHandlerItem *item = NULL;
|
||||
LnnEventHandlerItem *next = NULL;
|
||||
|
@ -161,7 +161,7 @@ static int32_t StartDelayInit(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t BusCenterServerInit(void)
|
||||
int32_t BusCenterServerInit(void)
|
||||
{
|
||||
if (LnnInitNetLedger() != SOFTBUS_OK) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -215,7 +215,7 @@ NO_SANITIZE("cfi") int32_t BusCenterServerInit(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void BusCenterServerDeinit(void)
|
||||
void BusCenterServerDeinit(void)
|
||||
{
|
||||
RouteLSDeinit();
|
||||
DeinitNodeAddrAllocator();
|
||||
|
@ -34,7 +34,7 @@ typedef struct {
|
||||
|
||||
#define TO_ASYNC_CALLBACK_INFO(cb) CONTAINER_OF(cb, AsyncCallbackInfo, callback)
|
||||
|
||||
NO_SANITIZE("cfi") static void AsyncCallbackHandler(SoftBusMessage *msg)
|
||||
static void AsyncCallbackHandler(SoftBusMessage *msg)
|
||||
{
|
||||
AsyncCallbackInfo *info = NULL;
|
||||
|
||||
@ -54,7 +54,7 @@ NO_SANITIZE("cfi") static void AsyncCallbackHandler(SoftBusMessage *msg)
|
||||
info->callback(info->cbPara);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void FreeAsyncCallbackMessage(SoftBusMessage *msg)
|
||||
static void FreeAsyncCallbackMessage(SoftBusMessage *msg)
|
||||
{
|
||||
AsyncCallbackInfo *info = NULL;
|
||||
|
||||
@ -98,7 +98,7 @@ static AsyncCallbackInfo *CreateAsyncCallbackInfo(SoftBusLooper *looper,
|
||||
return info;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnAsyncCallbackHelper(SoftBusLooper *looper, LnnAsyncCallbackFunc callback, void *para)
|
||||
int32_t LnnAsyncCallbackHelper(SoftBusLooper *looper, LnnAsyncCallbackFunc callback, void *para)
|
||||
{
|
||||
AsyncCallbackInfo *info = NULL;
|
||||
|
||||
@ -115,7 +115,7 @@ NO_SANITIZE("cfi") int32_t LnnAsyncCallbackHelper(SoftBusLooper *looper, LnnAsyn
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnAsyncCallbackDelayHelper(SoftBusLooper *looper, LnnAsyncCallbackFunc callback,
|
||||
int32_t LnnAsyncCallbackDelayHelper(SoftBusLooper *looper, LnnAsyncCallbackFunc callback,
|
||||
void *para, uint64_t delayMillis)
|
||||
{
|
||||
AsyncCallbackInfo *info = NULL;
|
||||
|
@ -24,7 +24,7 @@
|
||||
#define LNN_MAX_PRINT_ADDR_LEN 100
|
||||
#define SHORT_UDID_HASH_LEN 8
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnIsSameConnectionAddr(const ConnectionAddr *addr1, const ConnectionAddr *addr2, bool isShort)
|
||||
bool LnnIsSameConnectionAddr(const ConnectionAddr *addr1, const ConnectionAddr *addr2, bool isShort)
|
||||
{
|
||||
if (addr1 == NULL || addr2 == NULL) {
|
||||
return false;
|
||||
@ -56,7 +56,7 @@ NO_SANITIZE("cfi") bool LnnIsSameConnectionAddr(const ConnectionAddr *addr1, con
|
||||
return false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnConvertAddrToOption(const ConnectionAddr *addr, ConnectOption *option)
|
||||
bool LnnConvertAddrToOption(const ConnectionAddr *addr, ConnectOption *option)
|
||||
{
|
||||
if (addr == NULL || option == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "addr or option is null");
|
||||
@ -95,7 +95,7 @@ NO_SANITIZE("cfi") bool LnnConvertAddrToOption(const ConnectionAddr *addr, Conne
|
||||
return false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnConvertOptionToAddr(ConnectionAddr *addr, const ConnectOption *option,
|
||||
bool LnnConvertOptionToAddr(ConnectionAddr *addr, const ConnectOption *option,
|
||||
ConnectionAddrType hintType)
|
||||
{
|
||||
if (addr == NULL || option == NULL) {
|
||||
@ -138,7 +138,7 @@ NO_SANITIZE("cfi") bool LnnConvertOptionToAddr(ConnectionAddr *addr, const Conne
|
||||
return false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") DiscoveryType LnnConvAddrTypeToDiscType(ConnectionAddrType type)
|
||||
DiscoveryType LnnConvAddrTypeToDiscType(ConnectionAddrType type)
|
||||
{
|
||||
if (type == CONNECTION_ADDR_WLAN || type == CONNECTION_ADDR_ETH) {
|
||||
return DISCOVERY_TYPE_WIFI;
|
||||
@ -153,7 +153,7 @@ NO_SANITIZE("cfi") DiscoveryType LnnConvAddrTypeToDiscType(ConnectionAddrType ty
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") ConnectionAddrType LnnDiscTypeToConnAddrType(DiscoveryType type)
|
||||
ConnectionAddrType LnnDiscTypeToConnAddrType(DiscoveryType type)
|
||||
{
|
||||
switch (type) {
|
||||
case DISCOVERY_TYPE_WIFI:
|
||||
@ -168,7 +168,7 @@ NO_SANITIZE("cfi") ConnectionAddrType LnnDiscTypeToConnAddrType(DiscoveryType ty
|
||||
return CONNECTION_ADDR_MAX;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnConvertAddrToAuthConnInfo(const ConnectionAddr *addr, AuthConnInfo *connInfo)
|
||||
bool LnnConvertAddrToAuthConnInfo(const ConnectionAddr *addr, AuthConnInfo *connInfo)
|
||||
{
|
||||
if (addr == NULL || connInfo == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "addr or connInfo is null");
|
||||
@ -206,7 +206,7 @@ NO_SANITIZE("cfi") bool LnnConvertAddrToAuthConnInfo(const ConnectionAddr *addr,
|
||||
return false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool LnnConvertAuthConnInfoToAddr(ConnectionAddr *addr, const AuthConnInfo *connInfo,
|
||||
bool LnnConvertAuthConnInfoToAddr(ConnectionAddr *addr, const AuthConnInfo *connInfo,
|
||||
ConnectionAddrType hintType)
|
||||
{
|
||||
if (addr == NULL || connInfo == NULL) {
|
||||
|
@ -56,7 +56,7 @@ static int32_t InitStorageConfigPath(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGetFullStoragePath(LnnFileId id, char *path, uint32_t len)
|
||||
int32_t LnnGetFullStoragePath(LnnFileId id, char *path, uint32_t len)
|
||||
{
|
||||
if (path == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "%s: path is null", __func__);
|
||||
|
@ -126,7 +126,7 @@ static MapNode *MapCreateNode(const char *key, uint32_t hash,
|
||||
* valueSize Map value size
|
||||
* @return : SOFTBUS_OK or other error
|
||||
*/
|
||||
NO_SANITIZE("cfi") int32_t LnnMapSet(Map *map, const char *key, const void *value, uint32_t valueSize)
|
||||
int32_t LnnMapSet(Map *map, const char *key, const void *value, uint32_t valueSize)
|
||||
{
|
||||
MapNode *node = NULL;
|
||||
|
||||
@ -185,7 +185,7 @@ NO_SANITIZE("cfi") int32_t LnnMapSet(Map *map, const char *key, const void *valu
|
||||
* key Map key
|
||||
* @return : value of key or NULL
|
||||
*/
|
||||
NO_SANITIZE("cfi") void* LnnMapGet(const Map *map, const char *key)
|
||||
void* LnnMapGet(const Map *map, const char *key)
|
||||
{
|
||||
if (map == NULL || key == NULL || map->nodeSize == 0 || map->nodes == NULL) {
|
||||
return NULL;
|
||||
@ -212,7 +212,7 @@ NO_SANITIZE("cfi") void* LnnMapGet(const Map *map, const char *key)
|
||||
* @param : map Map see details in type Map
|
||||
* key Map key
|
||||
*/
|
||||
NO_SANITIZE("cfi") int32_t LnnMapErase(Map *map, const char *key)
|
||||
int32_t LnnMapErase(Map *map, const char *key)
|
||||
{
|
||||
if (map == NULL || key == NULL || map->nodeSize == 0 || map->nodes == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -241,7 +241,7 @@ NO_SANITIZE("cfi") int32_t LnnMapErase(Map *map, const char *key)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") uint32_t MapGetSize(Map *map)
|
||||
uint32_t MapGetSize(Map *map)
|
||||
{
|
||||
return (map == NULL) ? 0 : map->nodeSize;
|
||||
}
|
||||
@ -250,7 +250,7 @@ NO_SANITIZE("cfi") uint32_t MapGetSize(Map *map)
|
||||
*
|
||||
* @param : map Map see details in type Map
|
||||
*/
|
||||
NO_SANITIZE("cfi") void LnnMapInit(Map *map)
|
||||
void LnnMapInit(Map *map)
|
||||
{
|
||||
if (map == NULL) {
|
||||
return;
|
||||
@ -266,7 +266,7 @@ NO_SANITIZE("cfi") void LnnMapInit(Map *map)
|
||||
*
|
||||
* @param : map Map see details in type Map
|
||||
*/
|
||||
NO_SANITIZE("cfi") void LnnMapDelete(Map *map)
|
||||
void LnnMapDelete(Map *map)
|
||||
{
|
||||
uint32_t i;
|
||||
MapNode *node = NULL;
|
||||
@ -297,7 +297,7 @@ NO_SANITIZE("cfi") void LnnMapDelete(Map *map)
|
||||
*
|
||||
* @param : map Map see details in type Map
|
||||
*/
|
||||
NO_SANITIZE("cfi") MapIterator *LnnMapInitIterator(Map *map)
|
||||
MapIterator *LnnMapInitIterator(Map *map)
|
||||
{
|
||||
MapIterator *it = NULL;
|
||||
if (map == NULL) {
|
||||
@ -319,7 +319,7 @@ NO_SANITIZE("cfi") MapIterator *LnnMapInitIterator(Map *map)
|
||||
*
|
||||
* @param : it Iterator see details in type Iterator
|
||||
*/
|
||||
NO_SANITIZE("cfi") bool LnnMapHasNext(MapIterator *it)
|
||||
bool LnnMapHasNext(MapIterator *it)
|
||||
{
|
||||
return (it->nodeNum < it->map->nodeSize);
|
||||
}
|
||||
@ -329,7 +329,7 @@ NO_SANITIZE("cfi") bool LnnMapHasNext(MapIterator *it)
|
||||
*
|
||||
* @param : it Iterator see details in type Iterator
|
||||
*/
|
||||
NO_SANITIZE("cfi") MapIterator *LnnMapNext(MapIterator *it)
|
||||
MapIterator *LnnMapNext(MapIterator *it)
|
||||
{
|
||||
MapNode *node = NULL;
|
||||
if (it == NULL) {
|
||||
@ -359,7 +359,7 @@ NO_SANITIZE("cfi") MapIterator *LnnMapNext(MapIterator *it)
|
||||
*
|
||||
* @param : it Iterator see details in type Iterator
|
||||
*/
|
||||
NO_SANITIZE("cfi") void LnnMapDeinitIterator(MapIterator *it)
|
||||
void LnnMapDeinitIterator(MapIterator *it)
|
||||
{
|
||||
if (it == NULL) {
|
||||
return;
|
||||
|
@ -55,7 +55,7 @@ static int32_t GetUuidFromFile(char *id, uint32_t len)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGenLocalNetworkId(char *networkId, uint32_t len)
|
||||
int32_t LnnGenLocalNetworkId(char *networkId, uint32_t len)
|
||||
{
|
||||
if (networkId == NULL || len < NETWORK_ID_BUF_LEN) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -69,7 +69,7 @@ NO_SANITIZE("cfi") int32_t LnnGenLocalNetworkId(char *networkId, uint32_t len)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnGenLocalUuid(char *uuid, uint32_t len)
|
||||
int32_t LnnGenLocalUuid(char *uuid, uint32_t len)
|
||||
{
|
||||
static bool isGenerated = false;
|
||||
static char localUuid[UUID_BUF_LEN] = {0};
|
||||
|
@ -36,7 +36,7 @@ static bool IsDuplicateState(FsmStateMachine *fsm, FsmState *state)
|
||||
return false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void FreeFsmHandleMsg(SoftBusMessage *msg)
|
||||
static void FreeFsmHandleMsg(SoftBusMessage *msg)
|
||||
{
|
||||
if (msg != NULL) {
|
||||
if (msg->obj != NULL) {
|
||||
@ -154,7 +154,7 @@ static void ProcessStopMessage(SoftBusMessage *msg)
|
||||
}
|
||||
|
||||
/* remove message when return 0, else return 1 */
|
||||
NO_SANITIZE("cfi") static int32_t RemoveAllMessageFunc(const SoftBusMessage *msg, void *para)
|
||||
static int32_t RemoveAllMessageFunc(const SoftBusMessage *msg, void *para)
|
||||
{
|
||||
(void)para;
|
||||
|
||||
@ -162,7 +162,7 @@ NO_SANITIZE("cfi") static int32_t RemoveAllMessageFunc(const SoftBusMessage *msg
|
||||
return 0;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void ProcessDeinitMessage(SoftBusMessage *msg)
|
||||
static void ProcessDeinitMessage(SoftBusMessage *msg)
|
||||
{
|
||||
FsmCtrlMsgObj *ctrlMsgObj = msg->obj;
|
||||
FsmStateMachine *fsm = NULL;
|
||||
@ -182,7 +182,7 @@ NO_SANITIZE("cfi") static void ProcessDeinitMessage(SoftBusMessage *msg)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void FsmStateMsgHandler(SoftBusMessage *msg)
|
||||
static void FsmStateMsgHandler(SoftBusMessage *msg)
|
||||
{
|
||||
if (msg == NULL) {
|
||||
return;
|
||||
@ -209,7 +209,7 @@ NO_SANITIZE("cfi") static void FsmStateMsgHandler(SoftBusMessage *msg)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t PostMessageToFsm(FsmStateMachine *fsm, int32_t what, uint64_t arg1,
|
||||
static int32_t PostMessageToFsm(FsmStateMachine *fsm, int32_t what, uint64_t arg1,
|
||||
uint64_t arg2, void *obj)
|
||||
{
|
||||
SoftBusMessage *msg = NULL;
|
||||
@ -224,7 +224,7 @@ NO_SANITIZE("cfi") static int32_t PostMessageToFsm(FsmStateMachine *fsm, int32_t
|
||||
}
|
||||
|
||||
/* remove message when return 0, else return 1 */
|
||||
NO_SANITIZE("cfi") static int32_t RemoveMessageFunc(const SoftBusMessage *msg, void *para)
|
||||
static int32_t RemoveMessageFunc(const SoftBusMessage *msg, void *para)
|
||||
{
|
||||
int32_t msgType;
|
||||
|
||||
@ -240,7 +240,7 @@ NO_SANITIZE("cfi") static int32_t RemoveMessageFunc(const SoftBusMessage *msg, v
|
||||
return 1;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnFsmInit(FsmStateMachine *fsm, SoftBusLooper *looper, char *name, FsmDeinitCallback cb)
|
||||
int32_t LnnFsmInit(FsmStateMachine *fsm, SoftBusLooper *looper, char *name, FsmDeinitCallback cb)
|
||||
{
|
||||
if (fsm == NULL || name == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -260,7 +260,7 @@ NO_SANITIZE("cfi") int32_t LnnFsmInit(FsmStateMachine *fsm, SoftBusLooper *loope
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnFsmDeinit(FsmStateMachine *fsm)
|
||||
int32_t LnnFsmDeinit(FsmStateMachine *fsm)
|
||||
{
|
||||
if (fsm == NULL || fsm->looper == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -268,7 +268,7 @@ NO_SANITIZE("cfi") int32_t LnnFsmDeinit(FsmStateMachine *fsm)
|
||||
return PostMessageToFsm(fsm, FSM_CTRL_MSG_DEINIT, 0, 0, NULL);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnFsmAddState(FsmStateMachine *fsm, FsmState *state)
|
||||
int32_t LnnFsmAddState(FsmStateMachine *fsm, FsmState *state)
|
||||
{
|
||||
if (fsm == NULL || fsm->looper == NULL || state == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -283,7 +283,7 @@ NO_SANITIZE("cfi") int32_t LnnFsmAddState(FsmStateMachine *fsm, FsmState *state)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnFsmStart(FsmStateMachine *fsm, FsmState *initialState)
|
||||
int32_t LnnFsmStart(FsmStateMachine *fsm, FsmState *initialState)
|
||||
{
|
||||
if (fsm == NULL || fsm->looper == NULL || initialState == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -291,7 +291,7 @@ NO_SANITIZE("cfi") int32_t LnnFsmStart(FsmStateMachine *fsm, FsmState *initialSt
|
||||
return PostMessageToFsm(fsm, FSM_CTRL_MSG_START, 0, 0, initialState);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnFsmStop(FsmStateMachine *fsm)
|
||||
int32_t LnnFsmStop(FsmStateMachine *fsm)
|
||||
{
|
||||
if (fsm == NULL || fsm->looper == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -299,7 +299,7 @@ NO_SANITIZE("cfi") int32_t LnnFsmStop(FsmStateMachine *fsm)
|
||||
return PostMessageToFsm(fsm, FSM_CTRL_MSG_STOP, 0, 0, NULL);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnFsmPostMessage(FsmStateMachine *fsm, uint32_t msgType, void *data)
|
||||
int32_t LnnFsmPostMessage(FsmStateMachine *fsm, uint32_t msgType, void *data)
|
||||
{
|
||||
if (fsm == NULL || fsm->looper == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -307,7 +307,7 @@ NO_SANITIZE("cfi") int32_t LnnFsmPostMessage(FsmStateMachine *fsm, uint32_t msgT
|
||||
return PostMessageToFsm(fsm, FSM_CTRL_MSG_DATA, msgType, 0, data);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnFsmPostMessageDelay(FsmStateMachine *fsm, uint32_t msgType,
|
||||
int32_t LnnFsmPostMessageDelay(FsmStateMachine *fsm, uint32_t msgType,
|
||||
void *data, uint64_t delayMillis)
|
||||
{
|
||||
SoftBusMessage *msg = NULL;
|
||||
@ -324,7 +324,7 @@ NO_SANITIZE("cfi") int32_t LnnFsmPostMessageDelay(FsmStateMachine *fsm, uint32_t
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnFsmRemoveMessage(FsmStateMachine *fsm, int32_t msgType)
|
||||
int32_t LnnFsmRemoveMessage(FsmStateMachine *fsm, int32_t msgType)
|
||||
{
|
||||
if (fsm == NULL || fsm->looper == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -334,7 +334,7 @@ NO_SANITIZE("cfi") int32_t LnnFsmRemoveMessage(FsmStateMachine *fsm, int32_t msg
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t LnnFsmRemoveMessageSpecific(FsmStateMachine *fsm,
|
||||
int32_t LnnFsmRemoveMessageSpecific(FsmStateMachine *fsm,
|
||||
int32_t (*customFunc)(const SoftBusMessage*, void*), void *args)
|
||||
{
|
||||
if (fsm == NULL || fsm->looper == NULL) {
|
||||
|
2
core/cfi_blocklist.txt
Normal file
2
core/cfi_blocklist.txt
Normal file
@ -0,0 +1,2 @@
|
||||
src:*/connection/ble/src/*
|
||||
src:*/connection/wifi_direct/*
|
@ -129,6 +129,11 @@ if (defined(ohos_lite)) {
|
||||
include_dirs += conn_common_inc + trans_common_inc
|
||||
}
|
||||
ohos_shared_library("softbus_utils") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
include_dirs = [
|
||||
"$dsoftbus_root_path/interfaces/kits/common",
|
||||
"$dsoftbus_root_path/core/bus_center/utils/include",
|
||||
|
@ -185,7 +185,7 @@ int32_t SoftBusRegHiDumperHandler(char *moduleName, char *helpInfo, DumpHandlerF
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusDumpDispatch(int fd, int32_t argc, const char **argv)
|
||||
int32_t SoftBusDumpDispatch(int fd, int32_t argc, const char **argv)
|
||||
{
|
||||
if (fd < 0 || argc < 0 || argv == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_ERROR, "SoftBusDumpProcess: param invalid ");
|
||||
|
@ -36,7 +36,7 @@ int32_t SoftBusRegBusCenterVarDump(char *dumpVar, SoftBusVarDumpCb cb)
|
||||
return SoftBusAddDumpVarToList(dumpVar, cb, &g_busCenter_var_list);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t SoftBusBusCenterDumpHander(int fd, int32_t argc, const char **argv)
|
||||
static int32_t SoftBusBusCenterDumpHander(int fd, int32_t argc, const char **argv)
|
||||
{
|
||||
if (fd < 0 || argc < 0 || argv == NULL) {
|
||||
return SOFTBUS_ERR;
|
||||
|
@ -35,7 +35,7 @@ int32_t SoftBusRegConnVarDump(const char *dumpVar, SoftBusVarDumpCb cb)
|
||||
return SoftBusAddDumpVarToList(dumpVar, cb, &g_conn_var_list);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t SoftBusConnDumpHander(int fd, int32_t argc, const char **argv)
|
||||
static int32_t SoftBusConnDumpHander(int fd, int32_t argc, const char **argv)
|
||||
{
|
||||
if (fd < 0 || argc < 0 || argv == NULL) {
|
||||
return SOFTBUS_ERR;
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
static LIST_HEAD(g_disc_var_list);
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusRegDiscVarDump(char *dumpVar, SoftBusVarDumpCb cb)
|
||||
int32_t SoftBusRegDiscVarDump(char *dumpVar, SoftBusVarDumpCb cb)
|
||||
{
|
||||
if (dumpVar == NULL || strlen(dumpVar) >= SOFTBUS_DUMP_VAR_NAME_LEN || cb == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_ERROR, "SoftBusRegDiscDumpCb invalid param");
|
||||
@ -35,7 +35,7 @@ NO_SANITIZE("cfi") int32_t SoftBusRegDiscVarDump(char *dumpVar, SoftBusVarDumpCb
|
||||
return SoftBusAddDumpVarToList(dumpVar, cb, &g_disc_var_list);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t SoftBusDiscDumpHander(int fd, int32_t argc, const char **argv)
|
||||
static int32_t SoftBusDiscDumpHander(int fd, int32_t argc, const char **argv)
|
||||
{
|
||||
if (fd < 0 || argc < 0 || argv == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_CONN, SOFTBUS_LOG_ERROR, "SoftBusDiscDumpHander invalid param");
|
||||
|
@ -27,7 +27,7 @@ int32_t SoftBusDumpProcess(int fd, int32_t argc, const char **argv)
|
||||
return SoftBusDumpDispatch(fd, argc, argv);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") int32_t SoftBusHiDumperInit(void)
|
||||
int32_t SoftBusHiDumperInit(void)
|
||||
{
|
||||
return SoftBusHiDumperModuleInit();
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ void SoftBusTransDumpRunningSession(int fd, TransDumpLaneLinkType type, AppInfo*
|
||||
SOFTBUS_DPRINTF(fd, "DataType : %s\n", g_dataTypeList[appInfo->businessType]);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int SoftBusTransDumpHandler(int fd, int argc, const char **argv)
|
||||
static int SoftBusTransDumpHandler(int fd, int argc, const char **argv)
|
||||
{
|
||||
if (fd < 0 || argv == NULL || argc < 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "param is invalid ");
|
||||
|
@ -284,7 +284,7 @@ AuthResultRecord g_authResultRecord[SOFTBUS_HISYSEVT_LINK_TYPE_BUTT];
|
||||
DevOnlineDurRecord g_devOnlineDurRecord;
|
||||
DevDiscoveryRecord g_devDiscoveryRecord;
|
||||
|
||||
NO_SANITIZE("cfi") int64_t LnnUpTimeMs(void)
|
||||
int64_t LnnUpTimeMs(void)
|
||||
{
|
||||
SoftBusSysTime t;
|
||||
t.sec = 0;
|
||||
|
@ -60,7 +60,7 @@ static void InitStatisticEvtReportFunc(void)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void ReportStatisticEvent(SoftBusMessage* param)
|
||||
static void ReportStatisticEvent(SoftBusMessage* param)
|
||||
{
|
||||
(void)param;
|
||||
|
||||
@ -116,7 +116,7 @@ static SoftBusMessage* CreateMessage(SoftBusLooper *looper, HandleMessageFunc ca
|
||||
return msg;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static int32_t CreateAndPostMsgDelay(SoftBusLooper *looper, HandleMessageFunc callback,
|
||||
static int32_t CreateAndPostMsgDelay(SoftBusLooper *looper, HandleMessageFunc callback,
|
||||
uint64_t delayMillis)
|
||||
{
|
||||
if ((looper == NULL) || (callback == NULL)) {
|
||||
|
@ -182,7 +182,7 @@ static void NstackHiEventCb(void *softObj, const NstackDfxEvent *info)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void DstreamHiEventCb(void *softObj, const FillpDfxEvent *info)
|
||||
void DstreamHiEventCb(void *softObj, const FillpDfxEvent *info)
|
||||
{
|
||||
if (softObj == NULL || info == NULL) {
|
||||
LOG_ERR("param is NULL");
|
||||
@ -196,7 +196,7 @@ NO_SANITIZE("cfi") void DstreamHiEventCb(void *softObj, const FillpDfxEvent *inf
|
||||
NstackHiEventCb(softObj, &nstackInfo);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void DFileHiEventCb(void *softObj, const DFileEvent *info)
|
||||
static void DFileHiEventCb(void *softObj, const DFileEvent *info)
|
||||
{
|
||||
NstackDfxEvent nstackInfo;
|
||||
if (memcpy_s(&nstackInfo, sizeof(NstackDfxEvent), info, sizeof(DFileEvent)) != EOK) {
|
||||
@ -206,7 +206,7 @@ NO_SANITIZE("cfi") static void DFileHiEventCb(void *softObj, const DFileEvent *i
|
||||
NstackHiEventCb(softObj, &nstackInfo);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void DFinderHiEventCb(void *softObj, const DFinderEvent *info)
|
||||
static void DFinderHiEventCb(void *softObj, const DFinderEvent *info)
|
||||
{
|
||||
NstackDfxEvent nstackInfo;
|
||||
if (memcpy_s(nstackInfo.eventName, sizeof(nstackInfo.eventName),
|
||||
|
@ -43,7 +43,7 @@ int32_t GetStringItemByJsonObject(const cJSON *json, const char * const string,
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool GetJsonObjectStringItem(const cJSON *json, const char * const string, char *target,
|
||||
bool GetJsonObjectStringItem(const cJSON *json, const char * const string, char *target,
|
||||
uint32_t targetLen)
|
||||
{
|
||||
if (json == NULL || string == NULL || target == NULL) {
|
||||
@ -67,7 +67,7 @@ NO_SANITIZE("cfi") bool GetJsonObjectStringItem(const cJSON *json, const char *
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool GetJsonObjectNumberItem(const cJSON *json, const char * const string, int *target)
|
||||
bool GetJsonObjectNumberItem(const cJSON *json, const char * const string, int *target)
|
||||
{
|
||||
if (json == NULL || string == NULL || target == NULL) {
|
||||
return false;
|
||||
@ -81,7 +81,7 @@ NO_SANITIZE("cfi") bool GetJsonObjectNumberItem(const cJSON *json, const char *
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool GetJsonObjectSignedNumberItem(const cJSON *json, const char * const string, int *target)
|
||||
bool GetJsonObjectSignedNumberItem(const cJSON *json, const char * const string, int *target)
|
||||
{
|
||||
if (json == NULL || string == NULL || target == NULL) {
|
||||
return false;
|
||||
@ -95,7 +95,7 @@ NO_SANITIZE("cfi") bool GetJsonObjectSignedNumberItem(const cJSON *json, const c
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool GetJsonObjectDoubleItem(const cJSON *json, const char * const string, double *target)
|
||||
bool GetJsonObjectDoubleItem(const cJSON *json, const char * const string, double *target)
|
||||
{
|
||||
if (json == NULL || string == NULL || target == NULL) {
|
||||
return false;
|
||||
@ -109,7 +109,7 @@ NO_SANITIZE("cfi") bool GetJsonObjectDoubleItem(const cJSON *json, const char *
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool GetJsonObjectNumber16Item(const cJSON *json, const char * const string, uint16_t *target)
|
||||
bool GetJsonObjectNumber16Item(const cJSON *json, const char * const string, uint16_t *target)
|
||||
{
|
||||
if (json == NULL || string == NULL || target == NULL) {
|
||||
return false;
|
||||
@ -123,7 +123,7 @@ NO_SANITIZE("cfi") bool GetJsonObjectNumber16Item(const cJSON *json, const char
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool GetJsonObjectNumber64Item(const cJSON *json, const char * const string, int64_t *target)
|
||||
bool GetJsonObjectNumber64Item(const cJSON *json, const char * const string, int64_t *target)
|
||||
{
|
||||
if (json == NULL || string == NULL || target == NULL) {
|
||||
return false;
|
||||
@ -137,7 +137,7 @@ NO_SANITIZE("cfi") bool GetJsonObjectNumber64Item(const cJSON *json, const char
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool GetJsonObjectSignedNumber64Item(const cJSON *json, const char * const string, int64_t *target)
|
||||
bool GetJsonObjectSignedNumber64Item(const cJSON *json, const char * const string, int64_t *target)
|
||||
{
|
||||
if (json == NULL || string == NULL || target == NULL) {
|
||||
return false;
|
||||
@ -151,7 +151,7 @@ NO_SANITIZE("cfi") bool GetJsonObjectSignedNumber64Item(const cJSON *json, const
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool GetJsonObjectInt32Item(const cJSON *json, const char * const string, int32_t *target)
|
||||
bool GetJsonObjectInt32Item(const cJSON *json, const char * const string, int32_t *target)
|
||||
{
|
||||
if (json == NULL || string == NULL || target == NULL) {
|
||||
return false;
|
||||
@ -165,7 +165,7 @@ NO_SANITIZE("cfi") bool GetJsonObjectInt32Item(const cJSON *json, const char * c
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool GetJsonObjectBoolItem(const cJSON *json, const char * const string, bool *target)
|
||||
bool GetJsonObjectBoolItem(const cJSON *json, const char * const string, bool *target)
|
||||
{
|
||||
if (json == NULL || string == NULL || target == NULL) {
|
||||
return false;
|
||||
@ -179,7 +179,7 @@ NO_SANITIZE("cfi") bool GetJsonObjectBoolItem(const cJSON *json, const char * co
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool AddStringToJsonObject(cJSON *json, const char * const string, const char *value)
|
||||
bool AddStringToJsonObject(cJSON *json, const char * const string, const char *value)
|
||||
{
|
||||
if (value == NULL || json == NULL || string == NULL) {
|
||||
return false;
|
||||
@ -196,7 +196,7 @@ NO_SANITIZE("cfi") bool AddStringToJsonObject(cJSON *json, const char * const st
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool AddNumber16ToJsonObject(cJSON *json, const char * const string, uint16_t num)
|
||||
bool AddNumber16ToJsonObject(cJSON *json, const char * const string, uint16_t num)
|
||||
{
|
||||
if (json == NULL || string == NULL) {
|
||||
return false;
|
||||
@ -213,7 +213,7 @@ NO_SANITIZE("cfi") bool AddNumber16ToJsonObject(cJSON *json, const char * const
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool AddNumberToJsonObject(cJSON *json, const char * const string, int num)
|
||||
bool AddNumberToJsonObject(cJSON *json, const char * const string, int num)
|
||||
{
|
||||
if (json == NULL || string == NULL) {
|
||||
return false;
|
||||
@ -230,7 +230,7 @@ NO_SANITIZE("cfi") bool AddNumberToJsonObject(cJSON *json, const char * const st
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool AddNumber64ToJsonObject(cJSON *json, const char * const string, int64_t num)
|
||||
bool AddNumber64ToJsonObject(cJSON *json, const char * const string, int64_t num)
|
||||
{
|
||||
if (json == NULL || string == NULL) {
|
||||
return false;
|
||||
@ -247,7 +247,7 @@ NO_SANITIZE("cfi") bool AddNumber64ToJsonObject(cJSON *json, const char * const
|
||||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") bool AddBoolToJsonObject(cJSON *json, const char * const string, bool value)
|
||||
bool AddBoolToJsonObject(cJSON *json, const char * const string, bool value)
|
||||
{
|
||||
if (json == NULL || string == NULL) {
|
||||
return false;
|
||||
|
@ -73,7 +73,7 @@ static LogInfo g_logInfo[SOFTBUS_LOG_MODULE_MAX] = {
|
||||
{SOFTBUS_LOG_COMM, "SoftBusComm"},
|
||||
};
|
||||
|
||||
NO_SANITIZE("cfi") void NstackxLog(const char *moduleName, uint32_t nstackLevel, const char *format, ...)
|
||||
void NstackxLog(const char *moduleName, uint32_t nstackLevel, const char *format, ...)
|
||||
{
|
||||
uint32_t ulPos;
|
||||
uint32_t level = CUST_NSTACKX_DFINDER_LOG - nstackLevel;
|
||||
@ -110,7 +110,7 @@ NO_SANITIZE("cfi") void NstackxLog(const char *moduleName, uint32_t nstackLevel,
|
||||
return;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void SoftBusLogImpl(SoftBusLogModule module, SoftBusLogLevel level, const char* funcName,
|
||||
void SoftBusLogImpl(SoftBusLogModule module, SoftBusLogLevel level, const char* funcName,
|
||||
int lineNo, const char *fmt, ...)
|
||||
{
|
||||
uint32_t ulPos;
|
||||
@ -147,7 +147,7 @@ NO_SANITIZE("cfi") void SoftBusLogImpl(SoftBusLogModule module, SoftBusLogLevel
|
||||
return;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *Anonymizes(const char *target, const uint8_t expectAnonymizedLength)
|
||||
const char *Anonymizes(const char *target, const uint8_t expectAnonymizedLength)
|
||||
{
|
||||
if (target == NULL) {
|
||||
return "NULL";
|
||||
@ -252,7 +252,7 @@ static int32_t AnonymizeString(char **output, const char *in, size_t inLen, cons
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void AnonyPacketPrintout(SoftBusLogModule module, const char *msg, const char *packet,
|
||||
void AnonyPacketPrintout(SoftBusLogModule module, const char *msg, const char *packet,
|
||||
size_t packetLen)
|
||||
{
|
||||
if (!GetSignalingMsgSwitch()) {
|
||||
@ -289,7 +289,7 @@ NO_SANITIZE("cfi") void AnonyPacketPrintout(SoftBusLogModule module, const char
|
||||
#endif
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *AnonyDevId(char **outName, const char *inName)
|
||||
const char *AnonyDevId(char **outName, const char *inName)
|
||||
{
|
||||
if (inName == NULL) {
|
||||
return "null";
|
||||
@ -316,7 +316,7 @@ static inline void StringAppend(char *dst, uint32_t size, const char *src, uint3
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") const char *ToSecureStrDeviceID(const char *deviceId, char **outputStr)
|
||||
const char *ToSecureStrDeviceID(const char *deviceId, char **outputStr)
|
||||
{
|
||||
#define SECURE_PRINT_PREFIX_LEN 4
|
||||
#define SECURE_PRINT_SUFFIX_LEN 4
|
||||
|
@ -63,7 +63,7 @@ static int64_t UptimeMicros(void)
|
||||
return when;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void FreeSoftBusMsg(SoftBusMessage *msg)
|
||||
static void FreeSoftBusMsg(SoftBusMessage *msg)
|
||||
{
|
||||
if (msg->FreeMessage == NULL) {
|
||||
SoftBusFree(msg);
|
||||
@ -90,7 +90,7 @@ void FreeMessage(SoftBusMessage *msg)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void *LoopTask(void *arg)
|
||||
static void *LoopTask(void *arg)
|
||||
{
|
||||
SoftBusLooper *looper = arg;
|
||||
SoftBusLooperContext *context = looper->context;
|
||||
@ -245,7 +245,7 @@ static void DumpLooperLocked(const SoftBusLooperContext *context, const SoftBusH
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void DumpLooper(const SoftBusLooper *looper)
|
||||
void DumpLooper(const SoftBusLooper *looper)
|
||||
{
|
||||
if (looper == NULL) {
|
||||
return;
|
||||
@ -261,7 +261,7 @@ NO_SANITIZE("cfi") void DumpLooper(const SoftBusLooper *looper)
|
||||
(void)SoftBusMutexUnlock(&context->lock);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void PostMessageAtTime(const SoftBusLooper *looper, SoftBusMessage *msgPost)
|
||||
static void PostMessageAtTime(const SoftBusLooper *looper, SoftBusMessage *msgPost)
|
||||
{
|
||||
if (msgPost == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_COMM, SOFTBUS_LOG_ERROR, "PostMessageAtTime with nullmsg");
|
||||
@ -330,7 +330,7 @@ NO_SANITIZE("cfi") static void PostMessageAtTime(const SoftBusLooper *looper, So
|
||||
(void)SoftBusMutexUnlock(&context->lock);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void LooperPostMessage(const SoftBusLooper *looper, SoftBusMessage *msg)
|
||||
static void LooperPostMessage(const SoftBusLooper *looper, SoftBusMessage *msg)
|
||||
{
|
||||
if (msg == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_COMM, SOFTBUS_LOG_ERROR, "LooperPostMessage with nullmsg");
|
||||
@ -367,7 +367,7 @@ static int WhatRemoveFunc(const SoftBusMessage *msg, void *args)
|
||||
return 1;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void LoopRemoveMessageCustom(const SoftBusLooper *looper, const SoftBusHandler *handler,
|
||||
static void LoopRemoveMessageCustom(const SoftBusLooper *looper, const SoftBusHandler *handler,
|
||||
int (*customFunc)(const SoftBusMessage*, void*), void *args)
|
||||
{
|
||||
SoftBusLooperContext *context = looper->context;
|
||||
@ -396,7 +396,7 @@ NO_SANITIZE("cfi") static void LoopRemoveMessageCustom(const SoftBusLooper *loop
|
||||
(void)SoftBusMutexUnlock(&context->lock);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") static void LooperRemoveMessage(const SoftBusLooper *looper, const SoftBusHandler *handler,
|
||||
static void LooperRemoveMessage(const SoftBusLooper *looper, const SoftBusHandler *handler,
|
||||
int what)
|
||||
{
|
||||
LoopRemoveMessageCustom(looper, handler, WhatRemoveFunc, (void*)(intptr_t)what);
|
||||
@ -410,7 +410,7 @@ void SetLooperDumpable(SoftBusLooper *loop, bool dumpable)
|
||||
loop->dumpable = dumpable;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") SoftBusLooper *CreateNewLooper(const char *name)
|
||||
SoftBusLooper *CreateNewLooper(const char *name)
|
||||
{
|
||||
if (g_looperCnt >= MAX_LOOPER_CNT) {
|
||||
SoftBusLog(SOFTBUS_LOG_COMM, SOFTBUS_LOG_ERROR, "Looper count:%u, exceeds the maximum", g_looperCnt);
|
||||
@ -468,7 +468,7 @@ static struct LoopConfigItem g_loopConfig[] = {
|
||||
{LOOP_TYPE_LANE, NULL}
|
||||
};
|
||||
|
||||
NO_SANITIZE("cfi") SoftBusLooper *GetLooper(int type)
|
||||
SoftBusLooper *GetLooper(int type)
|
||||
{
|
||||
uint32_t len = sizeof(g_loopConfig) / sizeof(struct LoopConfigItem);
|
||||
for (uint32_t i = 0; i < len; i++) {
|
||||
@ -500,7 +500,7 @@ static void ReleaseLooper(const SoftBusLooper *looper)
|
||||
}
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") void DestroyLooper(SoftBusLooper *looper)
|
||||
void DestroyLooper(SoftBusLooper *looper)
|
||||
{
|
||||
if (looper == NULL) {
|
||||
return;
|
||||
|
@ -86,7 +86,7 @@ int32_t QueueCountGet(const LockFreeQueue* queue, uint32_t* count)
|
||||
return 0;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi") LockFreeQueue* CreateQueue(uint32_t unitNum)
|
||||
LockFreeQueue* CreateQueue(uint32_t unitNum)
|
||||
{
|
||||
if (!IS_POWER_OF_2(unitNum)) {
|
||||
return NULL;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user