mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-23 08:49:59 +00:00
CFI告警处理
Signed-off-by: wanjing <wangjing468@huawei.com>
This commit is contained in:
parent
fd173f46fc
commit
215f3a7739
@ -420,7 +420,7 @@ NO_SANITIZE("cfi") static void WrapperAdvUpdateCallback(int advId, int status)
|
||||
}
|
||||
}
|
||||
|
||||
static void WrapperSecurityRespondCallback(const BdAddr *bdAddr)
|
||||
NO_SANITIZE("cfi") static void WrapperSecurityRespondCallback(const BdAddr *bdAddr)
|
||||
{
|
||||
(void)bdAddr;
|
||||
CLOGI("WrapperSecurityRespondCallback");
|
||||
|
@ -93,7 +93,8 @@ NO_SANITIZE("cfi") static void WrapperStateChangeCallback(const int transport, c
|
||||
}
|
||||
}
|
||||
|
||||
static void WrapperAclStateChangedCallback(const BdAddr *bdAddr, GapAclState state, unsigned int reason)
|
||||
NO_SANITIZE("cfi") static void WrapperAclStateChangedCallback(const BdAddr *bdAddr, GapAclState state,
|
||||
unsigned int reason)
|
||||
{
|
||||
if (bdAddr == NULL) {
|
||||
CLOGE("WrapperAclStateChangedCallback addr is null");
|
||||
@ -114,7 +115,7 @@ static void WrapperAclStateChangedCallback(const BdAddr *bdAddr, GapAclState sta
|
||||
}
|
||||
}
|
||||
|
||||
static void WrapperPairRequestedCallback(const BdAddr *bdAddr, int transport)
|
||||
NO_SANITIZE("cfi") static void WrapperPairRequestedCallback(const BdAddr *bdAddr, int transport)
|
||||
{
|
||||
if (bdAddr == NULL) {
|
||||
CLOGE("WrapperPairRequestedCallback addr is null");
|
||||
@ -128,7 +129,8 @@ static void WrapperPairRequestedCallback(const BdAddr *bdAddr, int transport)
|
||||
}
|
||||
}
|
||||
|
||||
static void WrapperPairConfiremedCallback(const BdAddr *bdAddr, int transport, int reqType, int number)
|
||||
NO_SANITIZE("cfi") static void WrapperPairConfiremedCallback(const BdAddr *bdAddr, int transport, int reqType,
|
||||
int number)
|
||||
{
|
||||
if (bdAddr == NULL) {
|
||||
CLOGE("WrapperPairConfirmedCallback addr is null");
|
||||
|
@ -195,7 +195,7 @@ NO_SANITIZE("cfi") int32_t PackAuthData(const AuthDataHead *head, const uint8_t
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
const uint8_t *UnpackAuthData(const uint8_t *data, uint32_t len, AuthDataHead *head)
|
||||
NO_SANITIZE("cfi") 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.");
|
||||
|
@ -271,7 +271,7 @@ NO_SANITIZE("cfi") int32_t RegTrustDataChangeListener(const TrustDataChangeListe
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void UnregTrustDataChangeListener(void)
|
||||
NO_SANITIZE("cfi") void UnregTrustDataChangeListener(void)
|
||||
{
|
||||
const DeviceGroupManager *gmInstance = GetGmInstance();
|
||||
if (gmInstance == NULL) {
|
||||
|
@ -63,7 +63,7 @@ NO_SANITIZE("cfi") int32_t RegAuthTransListener(int32_t module, const AuthTransL
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
void UnregAuthTransListener(int32_t module)
|
||||
NO_SANITIZE("cfi") 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++) {
|
||||
|
@ -908,7 +908,7 @@ NO_SANITIZE("cfi") int32_t RegAuthVerifyListener(const AuthVerifyListener *liste
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void UnregAuthVerifyListener(void)
|
||||
NO_SANITIZE("cfi") void UnregAuthVerifyListener(void)
|
||||
{
|
||||
(void)memset_s(&g_verifyListener, sizeof(AuthVerifyListener), 0, sizeof(AuthVerifyListener));
|
||||
}
|
||||
@ -1124,7 +1124,7 @@ NO_SANITIZE("cfi") int32_t RegGroupChangeListener(const GroupChangeListener *lis
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void UnregGroupChangeListener(void)
|
||||
NO_SANITIZE("cfi") void UnregGroupChangeListener(void)
|
||||
{
|
||||
g_groupChangeListener.onGroupCreated = NULL;
|
||||
g_groupChangeListener.onGroupDeleted = NULL;
|
||||
|
@ -82,7 +82,7 @@ NO_SANITIZE("cfi") int32_t GetAuthRequest(uint32_t requestId, AuthRequest *reque
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t UpdateAuthRequestConnInfo(uint32_t requestId, const AuthConnInfo *connInfo)
|
||||
NO_SANITIZE("cfi") int32_t UpdateAuthRequestConnInfo(uint32_t requestId, const AuthConnInfo *connInfo)
|
||||
{
|
||||
CHECK_NULL_PTR_RETURN_VALUE(connInfo, SOFTBUS_INVALID_PARAM);
|
||||
if (!RequireAuthLock()) {
|
||||
|
@ -336,7 +336,7 @@ NO_SANITIZE("cfi") char *PackDeviceInfoMessage(int32_t linkType, SoftBusVersion
|
||||
return msg;
|
||||
}
|
||||
|
||||
int32_t UnpackDeviceInfoMessage(const char *msg, int32_t linkType, SoftBusVersion version,
|
||||
NO_SANITIZE("cfi") int32_t UnpackDeviceInfoMessage(const char *msg, int32_t linkType, SoftBusVersion version,
|
||||
NodeInfo *nodeInfo, bool isMetaAuth)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_AUTH, SOFTBUS_LOG_INFO, "UnpackDeviceInfo: connType = %d.", linkType);
|
||||
|
@ -290,7 +290,7 @@ NO_SANITIZE("cfi") int32_t SetSocketCallback(const SocketCallback *cb)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void UnsetSocketCallback(void)
|
||||
NO_SANITIZE("cfi") void UnsetSocketCallback(void)
|
||||
{
|
||||
(void)memset_s(&g_callback, sizeof(SocketCallback), 0, sizeof(SocketCallback));
|
||||
}
|
||||
@ -502,7 +502,7 @@ NO_SANITIZE("cfi") int32_t RegAuthChannelListener(int32_t module, const AuthChan
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
void UnregAuthChannelListener(int32_t module)
|
||||
NO_SANITIZE("cfi") void UnregAuthChannelListener(int32_t module)
|
||||
{
|
||||
uint32_t i;
|
||||
for (i = 0; i < sizeof(g_listener) / sizeof(InnerChannelListener); i++) {
|
||||
|
@ -167,7 +167,7 @@ NO_SANITIZE("cfi") void RegisterLaneIdListener(const ILaneIdStateListener *liste
|
||||
Unlock();
|
||||
}
|
||||
|
||||
void UnregisterLaneIdListener(const ILaneIdStateListener *listener)
|
||||
NO_SANITIZE("cfi") void UnregisterLaneIdListener(const ILaneIdStateListener *listener)
|
||||
{
|
||||
if (listener == NULL) {
|
||||
return;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "lnn_lane_def.h"
|
||||
#include "lnn_map.h"
|
||||
#include "softbus_adapter_mem.h"
|
||||
#include "softbus_def.h"
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_log.h"
|
||||
|
||||
@ -151,7 +152,7 @@ NO_SANITIZE("cfi") int32_t BindLaneIdToProfile(uint32_t laneId, LaneProfile *pro
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void UnbindLaneIdFromProfile(uint32_t laneId, uint32_t profileId)
|
||||
NO_SANITIZE("cfi") void UnbindLaneIdFromProfile(uint32_t laneId, uint32_t profileId)
|
||||
{
|
||||
if (Lock() != SOFTBUS_OK) {
|
||||
return;
|
||||
|
@ -589,7 +589,7 @@ static LaneInterface g_transLaneObject = {
|
||||
.FreeLane = Free,
|
||||
};
|
||||
|
||||
LaneInterface *TransLaneGetInstance(void)
|
||||
NO_SANITIZE("cfi") LaneInterface *TransLaneGetInstance(void)
|
||||
{
|
||||
return &g_transLaneObject;
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ static void UpdataLocalFromSetting(void *p)
|
||||
DiscDeviceInfoChanged(TYPE_LOCAL_DEVICE_NAME);
|
||||
}
|
||||
|
||||
void UpdateDeviceNameFromSetting(void)
|
||||
NO_SANITIZE("cfi") void UpdateDeviceNameFromSetting(void)
|
||||
{
|
||||
LnnInitGetDeviceName(HandlerGetDeviceName);
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ NO_SANITIZE("cfi") int32_t LnnRegistProtocol(LnnProtocolManager *protocolMgr)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int32_t UnregistProtocol(LnnProtocolManager *protocolMgr)
|
||||
NO_SANITIZE("cfi") int32_t UnregistProtocol(LnnProtocolManager *protocolMgr)
|
||||
{
|
||||
uint8_t i;
|
||||
if (protocolMgr == NULL) {
|
||||
|
@ -558,17 +558,17 @@ static int32_t UpdateLocalUuid(const void *id)
|
||||
return ModifyId(g_localNetLedger.localInfo.uuid, UUID_BUF_LEN, (char *)id);
|
||||
}
|
||||
|
||||
int32_t UpdateLocalParentId(const char *id)
|
||||
NO_SANITIZE("cfi") int32_t UpdateLocalParentId(const char *id)
|
||||
{
|
||||
return ModifyId(g_localNetLedger.localInfo.parentId, ID_MAX_LEN, id);
|
||||
}
|
||||
|
||||
int32_t UpdateLocalPublicId(const char *id)
|
||||
NO_SANITIZE("cfi") int32_t UpdateLocalPublicId(const char *id)
|
||||
{
|
||||
return ModifyId(g_localNetLedger.localInfo.publicId, ID_MAX_LEN, id);
|
||||
}
|
||||
|
||||
int32_t UpdateLocalRole(ConnectRole role)
|
||||
NO_SANITIZE("cfi") int32_t UpdateLocalRole(ConnectRole role)
|
||||
{
|
||||
g_localNetLedger.localInfo.role = role;
|
||||
return SOFTBUS_OK;
|
||||
@ -592,13 +592,13 @@ static int32_t UpdateMasgerNodeWeight(const void *weight)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t UpdateLocalStatus(ConnectStatus status)
|
||||
NO_SANITIZE("cfi") int32_t UpdateLocalStatus(ConnectStatus status)
|
||||
{
|
||||
g_localNetLedger.localInfo.status = status;
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t UpdateLocalWeight(int32_t weight)
|
||||
NO_SANITIZE("cfi") int32_t UpdateLocalWeight(int32_t weight)
|
||||
{
|
||||
g_localNetLedger.localInfo.masterWeight = weight;
|
||||
return SOFTBUS_OK;
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "pms_interface.h"
|
||||
#include "pms_types.h"
|
||||
#include "softbus_adapter_mem.h"
|
||||
#include "softbus_def.h"
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_log.h"
|
||||
|
||||
@ -61,7 +62,7 @@ static int32_t GetPermType(pid_t callingUid, pid_t callingPid, const char *pkgNa
|
||||
return SOFTBUS_PERMISSION_DENIED;
|
||||
}
|
||||
|
||||
int32_t TransPermissionInit(void)
|
||||
NO_SANITIZE("cfi") int32_t TransPermissionInit(void)
|
||||
{
|
||||
return LoadPermissionJson(PERMISSION_JSON_FILE);
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ namespace {
|
||||
const std::string SAMGR_PROCESS_NAME = "samgr";
|
||||
}
|
||||
|
||||
int32_t TransPermissionInit(void)
|
||||
NO_SANITIZE("cfi") int32_t TransPermissionInit(void)
|
||||
{
|
||||
int32_t ret = LoadPermissionJson(PERMISSION_JSON_FILE.c_str());
|
||||
if (ret != SOFTBUS_OK) {
|
||||
|
@ -63,7 +63,7 @@ static void UpdateP2pGcGroup(void)
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateP2pGroup(const P2pLinkGroup *group)
|
||||
NO_SANITIZE("cfi") void UpdateP2pGroup(const P2pLinkGroup *group)
|
||||
{
|
||||
if (group == NULL) {
|
||||
if (P2pLinkGetRole() != ROLE_NONE) {
|
||||
|
@ -69,7 +69,7 @@ NO_SANITIZE("cfi") void SetCapBitMapPos(uint32_t capBitMapNum, uint32_t *capBitM
|
||||
capBitMap[index] = capBitMap[index] | (0x1 << (pos % INT32_MAX_BIT_NUM));
|
||||
}
|
||||
|
||||
void UnsetCapBitMapPos(uint32_t capBitMapNum, uint32_t *capBitMap, uint32_t pos)
|
||||
NO_SANITIZE("cfi") void UnsetCapBitMapPos(uint32_t capBitMapNum, uint32_t *capBitMap, uint32_t pos)
|
||||
{
|
||||
uint32_t index = pos / INT32_MAX_BIT_NUM;
|
||||
if (index >= capBitMapNum) {
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "securec.h"
|
||||
#include "softbus_adapter_mem.h"
|
||||
#include "softbus_adapter_thread.h"
|
||||
#include "softbus_def.h"
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_log.h"
|
||||
#include "softbus_utils.h"
|
||||
@ -47,7 +48,7 @@ static void TransSessionForEachShowInfo(int fd)
|
||||
(void)SoftBusMutexUnlock(&g_sessionServerList->lock);
|
||||
}
|
||||
|
||||
int32_t TransSessionMgrInit(void)
|
||||
NO_SANITIZE("cfi") int32_t TransSessionMgrInit(void)
|
||||
{
|
||||
if (g_sessionServerList != NULL) {
|
||||
return SOFTBUS_OK;
|
||||
@ -61,7 +62,7 @@ int32_t TransSessionMgrInit(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransSessionMgrDeinit(void)
|
||||
NO_SANITIZE("cfi") void TransSessionMgrDeinit(void)
|
||||
{
|
||||
if (g_sessionServerList != NULL) {
|
||||
DestroySoftBusList(g_sessionServerList);
|
||||
@ -69,7 +70,7 @@ void TransSessionMgrDeinit(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool TransSessionServerIsExist(const char *sessionName)
|
||||
NO_SANITIZE("cfi") bool TransSessionServerIsExist(const char *sessionName)
|
||||
{
|
||||
if (sessionName == NULL) {
|
||||
return false;
|
||||
@ -97,7 +98,7 @@ bool TransSessionServerIsExist(const char *sessionName)
|
||||
return false;
|
||||
}
|
||||
|
||||
int32_t TransSessionServerAddItem(SessionServer *newNode)
|
||||
NO_SANITIZE("cfi") int32_t TransSessionServerAddItem(SessionServer *newNode)
|
||||
{
|
||||
if (newNode == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -132,7 +133,7 @@ int32_t TransSessionServerAddItem(SessionServer *newNode)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransSessionServerDelItem(const char *sessionName)
|
||||
NO_SANITIZE("cfi") int32_t TransSessionServerDelItem(const char *sessionName)
|
||||
{
|
||||
if (sessionName == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -163,7 +164,7 @@ int32_t TransSessionServerDelItem(const char *sessionName)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransDelItemByPackageName(const char *pkgName, int32_t pid)
|
||||
NO_SANITIZE("cfi") void TransDelItemByPackageName(const char *pkgName, int32_t pid)
|
||||
{
|
||||
if (pkgName == NULL || g_sessionServerList == NULL) {
|
||||
return;
|
||||
@ -257,7 +258,7 @@ int32_t TransGetUidAndPid(const char *sessionName, int32_t *uid, int32_t *pid)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
void TransOnLinkDown(const char *networkId, int32_t routeType)
|
||||
NO_SANITIZE("cfi") void TransOnLinkDown(const char *networkId, int32_t routeType)
|
||||
{
|
||||
if (networkId == NULL || g_sessionServerList == NULL) {
|
||||
return;
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
static bool g_transSessionInitFlag = false;
|
||||
|
||||
int TransServerInit(void)
|
||||
NO_SANITIZE("cfi") int TransServerInit(void)
|
||||
{
|
||||
if (g_transSessionInitFlag) {
|
||||
return SOFTBUS_OK;
|
||||
@ -54,7 +54,7 @@ int TransServerInit(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransServerDeinit(void)
|
||||
NO_SANITIZE("cfi") void TransServerDeinit(void)
|
||||
{
|
||||
if (g_transSessionInitFlag == false) {
|
||||
return;
|
||||
@ -66,13 +66,14 @@ void TransServerDeinit(void)
|
||||
g_transSessionInitFlag = false;
|
||||
}
|
||||
|
||||
void TransServerDeathCallback(const char *pkgName, int32_t pid)
|
||||
NO_SANITIZE("cfi") void TransServerDeathCallback(const char *pkgName, int32_t pid)
|
||||
{
|
||||
TransChannelDeathCallback(pkgName, pid);
|
||||
TransDelItemByPackageName(pkgName, pid);
|
||||
}
|
||||
|
||||
int32_t TransCreateSessionServer(const char *pkgName, const char *sessionName, int32_t uid, int32_t pid)
|
||||
NO_SANITIZE("cfi") int32_t TransCreateSessionServer(const char *pkgName, const char *sessionName, int32_t uid,
|
||||
int32_t pid)
|
||||
{
|
||||
if (!IsValidString(pkgName, PKG_NAME_SIZE_MAX) ||
|
||||
!IsValidString(sessionName, SESSION_NAME_SIZE_MAX)) {
|
||||
@ -112,7 +113,7 @@ int32_t TransCreateSessionServer(const char *pkgName, const char *sessionName, i
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransRemoveSessionServer(const char *pkgName, const char *sessionName)
|
||||
NO_SANITIZE("cfi") int32_t TransRemoveSessionServer(const char *pkgName, const char *sessionName)
|
||||
{
|
||||
if (!IsValidString(pkgName, PKG_NAME_SIZE_MAX) ||
|
||||
!IsValidString(sessionName, SESSION_NAME_SIZE_MAX)) {
|
||||
@ -121,7 +122,7 @@ int32_t TransRemoveSessionServer(const char *pkgName, const char *sessionName)
|
||||
return TransSessionServerDelItem(sessionName);
|
||||
}
|
||||
|
||||
int32_t TransOpenSession(const SessionParam *param, TransInfo *info)
|
||||
NO_SANITIZE("cfi") int32_t TransOpenSession(const SessionParam *param, TransInfo *info)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "trans server opensession.");
|
||||
if (!IsValidString(param->sessionName, SESSION_NAME_SIZE_MAX) ||
|
||||
|
@ -452,7 +452,7 @@ static void DelAuthChannelInfoByAuthId(int32_t authId)
|
||||
(void)SoftBusMutexUnlock(&g_authChannelList->lock);
|
||||
}
|
||||
|
||||
int32_t TransAuthGetNameByChanId(int32_t chanId, char *pkgName, char *sessionName,
|
||||
NO_SANITIZE("cfi") int32_t TransAuthGetNameByChanId(int32_t chanId, char *pkgName, char *sessionName,
|
||||
uint16_t pkgLen, uint16_t sessionLen)
|
||||
{
|
||||
if (pkgName == NULL || sessionName == NULL) {
|
||||
@ -471,7 +471,7 @@ int32_t TransAuthGetNameByChanId(int32_t chanId, char *pkgName, char *sessionNam
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransAuthInit(IServerChannelCallBack *cb)
|
||||
NO_SANITIZE("cfi") int32_t TransAuthInit(IServerChannelCallBack *cb)
|
||||
{
|
||||
if (cb == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -502,7 +502,7 @@ int32_t TransAuthInit(IServerChannelCallBack *cb)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransAuthDeinit(void)
|
||||
NO_SANITIZE("cfi") void TransAuthDeinit(void)
|
||||
{
|
||||
UnregAuthChannelListener(MODULE_AUTH_CHANNEL);
|
||||
UnregAuthChannelListener(MODULE_AUTH_MSG);
|
||||
@ -593,7 +593,8 @@ EXIT_ERR:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int32_t TransOpenAuthMsgChannel(const char *sessionName, const ConnectOption *connOpt, int32_t *channelId)
|
||||
NO_SANITIZE("cfi") int32_t TransOpenAuthMsgChannel(const char *sessionName, const ConnectOption *connOpt,
|
||||
int32_t *channelId)
|
||||
{
|
||||
if (connOpt == NULL || channelId == NULL || connOpt->type != CONNECT_TCP) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -630,7 +631,7 @@ int32_t TransOpenAuthMsgChannel(const char *sessionName, const ConnectOption *co
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransCloseAuthChannel(int32_t channelId)
|
||||
NO_SANITIZE("cfi") int32_t TransCloseAuthChannel(int32_t channelId)
|
||||
{
|
||||
AuthChannelInfo *channel = NULL;
|
||||
AuthChannelInfo *tmp = NULL;
|
||||
@ -653,7 +654,7 @@ int32_t TransCloseAuthChannel(int32_t channelId)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
int32_t TransSendAuthMsg(int32_t channelId, const char *msg, int32_t len)
|
||||
NO_SANITIZE("cfi") int32_t TransSendAuthMsg(int32_t channelId, const char *msg, int32_t len)
|
||||
{
|
||||
if (msg == NULL || len <= 0) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -679,7 +680,7 @@ int32_t TransSendAuthMsg(int32_t channelId, const char *msg, int32_t len)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransAuthGetConnOptionByChanId(int32_t channelId, ConnectOption *connOpt)
|
||||
NO_SANITIZE("cfi") int32_t TransAuthGetConnOptionByChanId(int32_t channelId, ConnectOption *connOpt)
|
||||
{
|
||||
AuthChannelInfo chanInfo;
|
||||
if (GetAuthChannelInfoByChanId(channelId, &chanInfo) != SOFTBUS_OK) {
|
||||
@ -699,7 +700,7 @@ int32_t TransAuthGetConnOptionByChanId(int32_t channelId, ConnectOption *connOpt
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransNotifyAuthDataSuccess(int32_t channelId, const ConnectOption *connOpt)
|
||||
NO_SANITIZE("cfi") int32_t TransNotifyAuthDataSuccess(int32_t channelId, const ConnectOption *connOpt)
|
||||
{
|
||||
if (connOpt == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "%s invalid param.", __func__);
|
||||
@ -714,7 +715,7 @@ int32_t TransNotifyAuthDataSuccess(int32_t channelId, const ConnectOption *connO
|
||||
return LnnNotifyDiscoveryDevice(&addr);
|
||||
}
|
||||
|
||||
int32_t TransAuthGetAppInfoByChanId(int32_t channelId, AppInfo *appInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransAuthGetAppInfoByChanId(int32_t channelId, AppInfo *appInfo)
|
||||
{
|
||||
if (appInfo == NULL || g_authChannelList == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
|
@ -17,13 +17,14 @@
|
||||
|
||||
#include "securec.h"
|
||||
#include "softbus_conn_interface.h"
|
||||
#include "softbus_def.h"
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_log.h"
|
||||
#include "softbus_utils.h"
|
||||
|
||||
#define CODE_OPEN_AUTH_MSG_CHANNEL 4
|
||||
|
||||
int32_t TransAuthChannelMsgPack(cJSON *msg, const AppInfo *appInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransAuthChannelMsgPack(cJSON *msg, const AppInfo *appInfo)
|
||||
{
|
||||
if (appInfo == NULL || msg == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -45,7 +46,7 @@ int32_t TransAuthChannelMsgPack(cJSON *msg, const AppInfo *appInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransAuthChannelMsgUnpack(const char *msg, AppInfo *appInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransAuthChannelMsgUnpack(const char *msg, AppInfo *appInfo)
|
||||
{
|
||||
if (msg == NULL || appInfo == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -73,7 +74,8 @@ int32_t TransAuthChannelMsgUnpack(const char *msg, AppInfo *appInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransAuthChannelErrorPack(int32_t errcode, const char *errMsg, char *cJsonStr, int32_t maxLen)
|
||||
NO_SANITIZE("cfi") int32_t TransAuthChannelErrorPack(int32_t errcode, const char *errMsg, char *cJsonStr,
|
||||
int32_t maxLen)
|
||||
{
|
||||
(void)maxLen;
|
||||
if (errMsg == NULL || cJsonStr == NULL) {
|
||||
|
@ -42,7 +42,7 @@ typedef struct {
|
||||
|
||||
static SoftBusList *g_reqLanePendingList = NULL;
|
||||
|
||||
int32_t TransReqLanePendingInit(void)
|
||||
NO_SANITIZE("cfi") int32_t TransReqLanePendingInit(void)
|
||||
{
|
||||
g_reqLanePendingList = CreateSoftBusList();
|
||||
if (g_reqLanePendingList == NULL) {
|
||||
@ -52,7 +52,7 @@ int32_t TransReqLanePendingInit(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransReqLanePendingDeinit(void)
|
||||
NO_SANITIZE("cfi") void TransReqLanePendingDeinit(void)
|
||||
{
|
||||
if (g_reqLanePendingList == NULL) {
|
||||
return;
|
||||
@ -246,7 +246,7 @@ static LaneTransType GetStreamLaneType(int32_t streamType)
|
||||
return LANE_T_BUTT;
|
||||
}
|
||||
|
||||
LaneTransType TransGetLaneTransTypeBySession(const SessionParam *param)
|
||||
NO_SANITIZE("cfi") LaneTransType TransGetLaneTransTypeBySession(const SessionParam *param)
|
||||
{
|
||||
if (param == NULL) {
|
||||
return LANE_T_BUTT;
|
||||
@ -425,7 +425,8 @@ static int32_t TransAddLaneReqToPendingAndWaiting(uint32_t laneId, const LaneReq
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransGetLaneInfoByOption(const LaneRequestOption *requestOption, LaneConnInfo *connInfo, uint32_t *laneId)
|
||||
NO_SANITIZE("cfi") int32_t TransGetLaneInfoByOption(const LaneRequestOption *requestOption, LaneConnInfo *connInfo,
|
||||
uint32_t *laneId)
|
||||
{
|
||||
if ((requestOption == NULL) || (connInfo == NULL) || (laneId == NULL)) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "get lane info by option param error.");
|
||||
@ -459,7 +460,7 @@ int32_t TransGetLaneInfoByOption(const LaneRequestOption *requestOption, LaneCon
|
||||
return ret;
|
||||
}
|
||||
|
||||
int32_t TransGetLaneInfo(const SessionParam *param, LaneConnInfo *connInfo, uint32_t *laneId)
|
||||
NO_SANITIZE("cfi") int32_t TransGetLaneInfo(const SessionParam *param, LaneConnInfo *connInfo, uint32_t *laneId)
|
||||
{
|
||||
if ((param == NULL) || (connInfo == NULL) || (laneId == NULL)) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "get lane info param error.");
|
||||
@ -529,7 +530,7 @@ static int32_t SetBleConnInfo(const BleConnInfo *bleInfo, ConnectOption *connOpt
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransGetConnectOptByConnInfo(const LaneConnInfo *info, ConnectOption *connOpt)
|
||||
NO_SANITIZE("cfi") int32_t TransGetConnectOptByConnInfo(const LaneConnInfo *info, ConnectOption *connOpt)
|
||||
{
|
||||
if (info == NULL || connOpt == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "[%s] invalid param.", __func__);
|
||||
@ -548,7 +549,7 @@ int32_t TransGetConnectOptByConnInfo(const LaneConnInfo *info, ConnectOption *co
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
bool TransGetAuthTypeByNetWorkId(const char *peerNetWorkId)
|
||||
NO_SANITIZE("cfi") bool TransGetAuthTypeByNetWorkId(const char *peerNetWorkId)
|
||||
{
|
||||
int32_t value = 0;
|
||||
int32_t ret = LnnGetRemoteNumInfo(peerNetWorkId, NUM_KEY_META_NODE, &value);
|
||||
|
@ -102,7 +102,7 @@ static int32_t TransServerOnQosEvent(const char *pkgName, const QosParam *param)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
IServerChannelCallBack *TransServerGetChannelCb(void)
|
||||
NO_SANITIZE("cfi") IServerChannelCallBack *TransServerGetChannelCb(void)
|
||||
{
|
||||
g_channelCallBack.OnChannelOpened = TransServerOnChannelOpened;
|
||||
g_channelCallBack.OnChannelClosed = TransServerOnChannelClosed;
|
||||
@ -114,7 +114,8 @@ IServerChannelCallBack *TransServerGetChannelCb(void)
|
||||
return &g_channelCallBack;
|
||||
}
|
||||
|
||||
int32_t TransServerOnChannelLinkDown(const char *pkgName, int32_t pid, const char *networkId, int32_t routeType)
|
||||
NO_SANITIZE("cfi") int32_t TransServerOnChannelLinkDown(const char *pkgName, int32_t pid, const char *networkId,
|
||||
int32_t routeType)
|
||||
{
|
||||
if (pkgName == NULL || networkId == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include "softbus_hisysevt_transreporter.h"
|
||||
#include "trans_tcp_direct_sessionconn.h"
|
||||
|
||||
int32_t TransChannelInit(void)
|
||||
NO_SANITIZE("cfi") int32_t TransChannelInit(void)
|
||||
{
|
||||
IServerChannelCallBack *cb = TransServerGetChannelCb();
|
||||
if (cb == NULL) {
|
||||
@ -78,7 +78,7 @@ int32_t TransChannelInit(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransChannelDeinit(void)
|
||||
NO_SANITIZE("cfi") void TransChannelDeinit(void)
|
||||
{
|
||||
TransLaneMgrDeinit();
|
||||
TransAuthDeinit();
|
||||
@ -201,7 +201,7 @@ static int32_t TransOpenChannelProc(ChannelType type, AppInfo *appInfo, const Co
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransOpenChannel(const SessionParam *param, TransInfo *transInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransOpenChannel(const SessionParam *param, TransInfo *transInfo)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "server TransOpenChannel");
|
||||
transInfo->channelId = INVALID_CHANNEL_ID;
|
||||
@ -295,7 +295,7 @@ EXIT_ERR:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int32_t TransOpenAuthChannel(const char *sessionName, const ConnectOption *connOpt)
|
||||
NO_SANITIZE("cfi") int32_t TransOpenAuthChannel(const char *sessionName, const ConnectOption *connOpt)
|
||||
{
|
||||
int32_t channelId = INVALID_CHANNEL_ID;
|
||||
if (!IsValidString(sessionName, SESSION_NAME_SIZE_MAX) || connOpt == NULL) {
|
||||
@ -346,7 +346,7 @@ static void ConvertStreamStats(const StreamSendStats *src, FrameSendStats *dest)
|
||||
destBitRate[FRAME_BIT_RATE_LARGE] = srcBitRate[FRAME_BIT_RATE_GE30M];
|
||||
}
|
||||
|
||||
int32_t TransStreamStats(int32_t channelId, int32_t channelType, const StreamSendStats *data)
|
||||
NO_SANITIZE("cfi") int32_t TransStreamStats(int32_t channelId, int32_t channelType, const StreamSendStats *data)
|
||||
{
|
||||
(void)channelType;
|
||||
if (data == NULL) {
|
||||
@ -370,7 +370,7 @@ int32_t TransStreamStats(int32_t channelId, int32_t channelType, const StreamSen
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransRequestQos(int32_t channelId, int32_t chanType, int32_t appType, int32_t quality)
|
||||
NO_SANITIZE("cfi") int32_t TransRequestQos(int32_t channelId, int32_t chanType, int32_t appType, int32_t quality)
|
||||
{
|
||||
(void)chanType;
|
||||
(void)appType;
|
||||
@ -400,7 +400,7 @@ int32_t TransRequestQos(int32_t channelId, int32_t chanType, int32_t appType, in
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransRippleStats(int32_t channelId, int32_t channelType, const TrafficStats *data)
|
||||
NO_SANITIZE("cfi") int32_t TransRippleStats(int32_t channelId, int32_t channelType, const TrafficStats *data)
|
||||
{
|
||||
(void)channelType;
|
||||
if (data == NULL) {
|
||||
@ -424,7 +424,7 @@ int32_t TransRippleStats(int32_t channelId, int32_t channelType, const TrafficSt
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransNotifyAuthSuccess(int32_t channelId, int32_t channelType)
|
||||
NO_SANITIZE("cfi") int32_t TransNotifyAuthSuccess(int32_t channelId, int32_t channelType)
|
||||
{
|
||||
int32_t ret = SOFTBUS_ERR;
|
||||
ConnectOption connOpt;
|
||||
@ -447,7 +447,7 @@ int32_t TransNotifyAuthSuccess(int32_t channelId, int32_t channelType)
|
||||
return TransNotifyAuthDataSuccess(channelId, &connOpt);
|
||||
}
|
||||
|
||||
int32_t TransCloseChannel(int32_t channelId, int32_t channelType)
|
||||
NO_SANITIZE("cfi") int32_t TransCloseChannel(int32_t channelId, int32_t channelType)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "close channel: id=%d, type=%d", channelId, channelType);
|
||||
switch (channelType) {
|
||||
@ -469,7 +469,8 @@ int32_t TransCloseChannel(int32_t channelId, int32_t channelType)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
int32_t TransSendMsg(int32_t channelId, int32_t channelType, const void *data, uint32_t len, int32_t msgType)
|
||||
NO_SANITIZE("cfi") int32_t TransSendMsg(int32_t channelId, int32_t channelType, const void *data, uint32_t len,
|
||||
int32_t msgType)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "send msg: id=%d, type=%d", channelId, channelType);
|
||||
switch (channelType) {
|
||||
@ -483,7 +484,7 @@ int32_t TransSendMsg(int32_t channelId, int32_t channelType, const void *data, u
|
||||
}
|
||||
}
|
||||
|
||||
void TransChannelDeathCallback(const char *pkgName, int32_t pid)
|
||||
NO_SANITIZE("cfi") void TransChannelDeathCallback(const char *pkgName, int32_t pid)
|
||||
{
|
||||
TransProxyDeathCallback(pkgName, pid);
|
||||
TransTdcDeathCallback(pkgName, pid);
|
||||
@ -491,7 +492,7 @@ void TransChannelDeathCallback(const char *pkgName, int32_t pid)
|
||||
TransUdpDeathCallback(pkgName, pid);
|
||||
}
|
||||
|
||||
int32_t TransGetNameByChanId(const TransInfo *info, char *pkgName, char *sessionName,
|
||||
NO_SANITIZE("cfi") int32_t TransGetNameByChanId(const TransInfo *info, char *pkgName, char *sessionName,
|
||||
uint16_t pkgLen, uint16_t sessionNameLen)
|
||||
{
|
||||
if (info == NULL || pkgName == NULL || sessionName == NULL) {
|
||||
@ -509,7 +510,7 @@ int32_t TransGetNameByChanId(const TransInfo *info, char *pkgName, char *session
|
||||
}
|
||||
}
|
||||
|
||||
int32_t TransGetAppInfoByChanId(int32_t channelId, int32_t channelType, AppInfo* appInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransGetAppInfoByChanId(int32_t channelId, int32_t channelType, AppInfo* appInfo)
|
||||
{
|
||||
if (appInfo == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -528,7 +529,7 @@ int32_t TransGetAppInfoByChanId(int32_t channelId, int32_t channelType, AppInfo*
|
||||
}
|
||||
}
|
||||
|
||||
int32_t TransGetConnByChanId(int32_t channelId, int32_t channelType, int32_t* connId)
|
||||
NO_SANITIZE("cfi") int32_t TransGetConnByChanId(int32_t channelId, int32_t channelType, int32_t* connId)
|
||||
{
|
||||
if (channelType != CHANNEL_TYPE_PROXY) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "channelType:%d error", channelType);
|
||||
|
@ -95,7 +95,7 @@ static void TransLaneChannelForEachShowInfo(int fd)
|
||||
SoftBusFree(appInfo);
|
||||
}
|
||||
|
||||
int32_t TransLaneMgrInit(void)
|
||||
NO_SANITIZE("cfi") int32_t TransLaneMgrInit(void)
|
||||
{
|
||||
if (g_channelLaneList != NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "trans lane info manager hasn't initialized.");
|
||||
@ -112,7 +112,7 @@ int32_t TransLaneMgrInit(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransLaneMgrDeinit(void)
|
||||
NO_SANITIZE("cfi") void TransLaneMgrDeinit(void)
|
||||
{
|
||||
if (g_channelLaneList == NULL) {
|
||||
return;
|
||||
@ -135,8 +135,8 @@ void TransLaneMgrDeinit(void)
|
||||
g_channelLaneList = NULL;
|
||||
}
|
||||
|
||||
int32_t TransLaneMgrAddLane(int32_t channelId, int32_t channelType, LaneConnInfo *connInfo, uint32_t laneId,
|
||||
AppInfoData *myData)
|
||||
NO_SANITIZE("cfi") int32_t TransLaneMgrAddLane(int32_t channelId, int32_t channelType, LaneConnInfo *connInfo,
|
||||
uint32_t laneId, AppInfoData *myData)
|
||||
{
|
||||
if (g_channelLaneList == NULL) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -183,7 +183,7 @@ int32_t TransLaneMgrAddLane(int32_t channelId, int32_t channelType, LaneConnInfo
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransLaneMgrDelLane(int32_t channelId, int32_t channelType)
|
||||
NO_SANITIZE("cfi") int32_t TransLaneMgrDelLane(int32_t channelId, int32_t channelType)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "del trans land mgr.[chanid=%d][type=%d]", channelId, channelType);
|
||||
if (g_channelLaneList == NULL) {
|
||||
@ -212,7 +212,7 @@ int32_t TransLaneMgrDelLane(int32_t channelId, int32_t channelType)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
void TransLaneMgrDeathCallback(const char *pkgName, int32_t pid)
|
||||
NO_SANITIZE("cfi") void TransLaneMgrDeathCallback(const char *pkgName, int32_t pid)
|
||||
{
|
||||
if (g_channelLaneList == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "trans lane manager hasn't initialized.");
|
||||
@ -240,7 +240,7 @@ void TransLaneMgrDeathCallback(const char *pkgName, int32_t pid)
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t TransGetLaneIdByChannelId(int32_t channelId, uint32_t *laneId)
|
||||
NO_SANITIZE("cfi") int32_t TransGetLaneIdByChannelId(int32_t channelId, uint32_t *laneId)
|
||||
{
|
||||
if ((laneId == NULL) || (g_channelLaneList == NULL)) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -260,7 +260,7 @@ int32_t TransGetLaneIdByChannelId(int32_t channelId, uint32_t *laneId)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
int32_t TransGetChannelInfoByLaneId(uint32_t laneId, int32_t *channelId, int32_t *channelType)
|
||||
NO_SANITIZE("cfi") int32_t TransGetChannelInfoByLaneId(uint32_t laneId, int32_t *channelId, int32_t *channelType)
|
||||
{
|
||||
if ((channelId == NULL) || (channelType == NULL) || (g_channelLaneList == NULL)) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
static IServerChannelCallBack g_channelCb;
|
||||
|
||||
int32_t TransProxySetCallBack(const IServerChannelCallBack *cb)
|
||||
NO_SANITIZE("cfi") int32_t TransProxySetCallBack(const IServerChannelCallBack *cb)
|
||||
{
|
||||
if (cb == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -29,34 +29,35 @@ int32_t TransProxySetCallBack(const IServerChannelCallBack *cb)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxyOnChannelOpened(const char *pkgName, int32_t pid, const char *sessionName,
|
||||
NO_SANITIZE("cfi") int32_t TransProxyOnChannelOpened(const char *pkgName, int32_t pid, const char *sessionName,
|
||||
const ChannelInfo *channel)
|
||||
{
|
||||
return g_channelCb.OnChannelOpened(pkgName, pid, sessionName, channel);
|
||||
}
|
||||
|
||||
int32_t TransProxyOnChannelClosed(const char *pkgName, int32_t pid, int32_t channelId)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyOnChannelClosed(const char *pkgName, int32_t pid, int32_t channelId)
|
||||
{
|
||||
return g_channelCb.OnChannelClosed(pkgName, pid, channelId, CHANNEL_TYPE_PROXY);
|
||||
}
|
||||
|
||||
int32_t TransProxyOnChannelOpenFailed(const char *pkgName, int32_t pid, int32_t channelId, int32_t errCode)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyOnChannelOpenFailed(const char *pkgName, int32_t pid, int32_t channelId,
|
||||
int32_t errCode)
|
||||
{
|
||||
return g_channelCb.OnChannelOpenFailed(pkgName, pid, channelId, CHANNEL_TYPE_PROXY, errCode);
|
||||
}
|
||||
|
||||
int32_t TransProxyOnMsgReceived(const char *pkgName, int32_t pid, int32_t channelId,
|
||||
NO_SANITIZE("cfi") int32_t TransProxyOnMsgReceived(const char *pkgName, int32_t pid, int32_t channelId,
|
||||
TransReceiveData *receiveData)
|
||||
{
|
||||
return g_channelCb.OnDataReceived(pkgName, pid, channelId, CHANNEL_TYPE_PROXY, receiveData);
|
||||
}
|
||||
|
||||
int32_t TransProxyGetPkgName(const char *sessionName, char *pkgName, uint16_t len)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyGetPkgName(const char *sessionName, char *pkgName, uint16_t len)
|
||||
{
|
||||
return g_channelCb.GetPkgNameBySessionName(sessionName, pkgName, len);
|
||||
}
|
||||
|
||||
int32_t TransProxyGetUidAndPidBySessionName(const char *sessionName, int32_t *uid, int32_t *pid)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyGetUidAndPidBySessionName(const char *sessionName, int32_t *uid, int32_t *pid)
|
||||
{
|
||||
return g_channelCb.GetUidAndPidBySessionName(sessionName, uid, pid);
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "auth_interface.h"
|
||||
#include "cJSON.h"
|
||||
#include "softbus_def.h"
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_log.h"
|
||||
#include "softbus_proxychannel_manager.h"
|
||||
@ -27,7 +28,8 @@
|
||||
#include "softbus_proxychannel_transceiver.h"
|
||||
#include "softbus_utils.h"
|
||||
|
||||
int32_t TransProxySendMessage(ProxyChannelInfo *info, const char *payLoad, uint32_t payLoadLen, int32_t priority)
|
||||
NO_SANITIZE("cfi") int32_t TransProxySendMessage(ProxyChannelInfo *info, const char *payLoad, uint32_t payLoadLen,
|
||||
int32_t priority)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "[%s] invalid param.", __func__);
|
||||
@ -82,7 +84,7 @@ static int32_t SetCipherOfHandshakeMsg(uint32_t channelId, uint8_t *cipher)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxyHandshake(ProxyChannelInfo *info)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyHandshake(ProxyChannelInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "[%s] invalid param.", __func__);
|
||||
@ -125,7 +127,7 @@ int32_t TransProxyHandshake(ProxyChannelInfo *info)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxyAckHandshake(uint32_t connId, ProxyChannelInfo *chan, int32_t retCode)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyAckHandshake(uint32_t connId, ProxyChannelInfo *chan, int32_t retCode)
|
||||
{
|
||||
if (chan == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "[%s] invalid param.", __func__);
|
||||
@ -168,7 +170,7 @@ int32_t TransProxyAckHandshake(uint32_t connId, ProxyChannelInfo *chan, int32_t
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransProxyKeepalive(uint32_t connId, const ProxyChannelInfo *info)
|
||||
NO_SANITIZE("cfi") void TransProxyKeepalive(uint32_t connId, const ProxyChannelInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "[%s] invalid param.", __func__);
|
||||
@ -205,7 +207,7 @@ void TransProxyKeepalive(uint32_t connId, const ProxyChannelInfo *info)
|
||||
}
|
||||
}
|
||||
|
||||
int32_t TransProxyAckKeepalive(ProxyChannelInfo *info)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyAckKeepalive(ProxyChannelInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "[%s] invalid param.", __func__);
|
||||
@ -242,7 +244,7 @@ int32_t TransProxyAckKeepalive(ProxyChannelInfo *info)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxyResetPeer(ProxyChannelInfo *info)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyResetPeer(ProxyChannelInfo *info)
|
||||
{
|
||||
if (info == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "[%s] invalid param.", __func__);
|
||||
|
@ -239,7 +239,7 @@ EXIT_ERR:
|
||||
return SOFTBUS_TRANS_GET_LANE_INFO_ERR;
|
||||
}
|
||||
|
||||
int32_t TransOpenNetWorkingChannel(const char *sessionName, const char *peerNetworkId)
|
||||
NO_SANITIZE("cfi") int32_t TransOpenNetWorkingChannel(const char *sessionName, const char *peerNetworkId)
|
||||
{
|
||||
AppInfo appInfo;
|
||||
ConnectOption connOpt;
|
||||
@ -271,7 +271,7 @@ int32_t TransSendNetworkingMessage(int32_t channelId, const char *data, uint32_t
|
||||
return TransProxySendMsg(channelId, data, dataLen, priority);
|
||||
}
|
||||
|
||||
int32_t TransCloseNetWorkingChannel(int32_t channelId)
|
||||
NO_SANITIZE("cfi") int32_t TransCloseNetWorkingChannel(int32_t channelId)
|
||||
{
|
||||
return TransProxyCloseProxyChannel(channelId);
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "softbus_adapter_mem.h"
|
||||
#include "softbus_adapter_thread.h"
|
||||
#include "softbus_conn_interface.h"
|
||||
#include "softbus_def.h"
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_feature_config.h"
|
||||
#include "softbus_log.h"
|
||||
@ -97,7 +98,7 @@ static uint16_t EndianSwap16(uint16_t num)
|
||||
return (((num & HIGH_MASK) >> ENDIAN_SHIFT) | ((num & LOW_MASK) << ENDIAN_SHIFT));
|
||||
}
|
||||
|
||||
int16_t TransProxyGetNewMyId(void)
|
||||
NO_SANITIZE("cfi") int16_t TransProxyGetNewMyId(void)
|
||||
{
|
||||
#define MYID_MAX_NUM 100
|
||||
static uint16_t myId = 0;
|
||||
@ -148,7 +149,7 @@ static int32_t ResetChanIsEqual(int status, ProxyChannelInfo *a, ProxyChannelInf
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
int32_t TransProxyGetAppInfoType(int16_t myId, const char *identity)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyGetAppInfoType(int16_t myId, const char *identity)
|
||||
{
|
||||
if (SoftBusMutexLock(&g_proxyChannelList->lock) != 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "lock mutex fail!");
|
||||
@ -217,7 +218,7 @@ static int32_t TransProxyAddChanItem(ProxyChannelInfo *chan)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxyGetChanByChanId(int32_t chanId, ProxyChannelInfo *chan)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyGetChanByChanId(int32_t chanId, ProxyChannelInfo *chan)
|
||||
{
|
||||
ProxyChannelInfo *item = NULL;
|
||||
ProxyChannelInfo *nextNode = NULL;
|
||||
@ -243,7 +244,7 @@ int32_t TransProxyGetChanByChanId(int32_t chanId, ProxyChannelInfo *chan)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
void TransProxyDelChanByReqId(int32_t reqId)
|
||||
NO_SANITIZE("cfi") void TransProxyDelChanByReqId(int32_t reqId)
|
||||
{
|
||||
ProxyChannelInfo *item = NULL;
|
||||
ProxyChannelInfo *nextNode = NULL;
|
||||
@ -270,7 +271,7 @@ void TransProxyDelChanByReqId(int32_t reqId)
|
||||
return;
|
||||
}
|
||||
|
||||
void TransProxyDelChanByChanId(int32_t chanlId)
|
||||
NO_SANITIZE("cfi") void TransProxyDelChanByChanId(int32_t chanlId)
|
||||
{
|
||||
ProxyChannelInfo *item = NULL;
|
||||
ProxyChannelInfo *nextNode = NULL;
|
||||
@ -297,7 +298,7 @@ void TransProxyDelChanByChanId(int32_t chanlId)
|
||||
return;
|
||||
}
|
||||
|
||||
void TransProxyChanProcessByReqId(int32_t reqId, uint32_t connId)
|
||||
NO_SANITIZE("cfi") void TransProxyChanProcessByReqId(int32_t reqId, uint32_t connId)
|
||||
{
|
||||
ProxyChannelInfo *item = NULL;
|
||||
if (g_proxyChannelList == NULL) {
|
||||
@ -358,7 +359,7 @@ static void TransProxyReleaseChannelList(ListNode *proxyChannelList, int32_t err
|
||||
}
|
||||
}
|
||||
|
||||
void TransProxyDelByConnId(uint32_t connId)
|
||||
NO_SANITIZE("cfi") void TransProxyDelByConnId(uint32_t connId)
|
||||
{
|
||||
ProxyChannelInfo *removeNode = NULL;
|
||||
ProxyChannelInfo *nextNode = NULL;
|
||||
@ -502,7 +503,7 @@ static int32_t TransProxyKeepAlvieChan(ProxyChannelInfo *chanInfo)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
int32_t TransProxyGetSendMsgChanInfo(int32_t channelId, ProxyChannelInfo *chanInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyGetSendMsgChanInfo(int32_t channelId, ProxyChannelInfo *chanInfo)
|
||||
{
|
||||
ProxyChannelInfo *item = NULL;
|
||||
|
||||
@ -529,7 +530,7 @@ int32_t TransProxyGetSendMsgChanInfo(int32_t channelId, ProxyChannelInfo *chanIn
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
int32_t TransProxyGetNewChanSeq(int32_t channelId)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyGetNewChanSeq(int32_t channelId)
|
||||
{
|
||||
ProxyChannelInfo *item = NULL;
|
||||
int32_t seq = 0;
|
||||
@ -555,7 +556,7 @@ int32_t TransProxyGetNewChanSeq(int32_t channelId)
|
||||
return seq;
|
||||
}
|
||||
|
||||
int64_t TransProxyGetAuthId(int32_t channelId)
|
||||
NO_SANITIZE("cfi") int64_t TransProxyGetAuthId(int32_t channelId)
|
||||
{
|
||||
int64_t authId;
|
||||
ProxyChannelInfo *item = NULL;
|
||||
@ -580,7 +581,7 @@ int64_t TransProxyGetAuthId(int32_t channelId)
|
||||
return AUTH_INVALID_ID;
|
||||
}
|
||||
|
||||
int32_t TransProxyGetSessionKeyByChanId(int32_t channelId, char *sessionKey, uint32_t sessionKeySize)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyGetSessionKeyByChanId(int32_t channelId, char *sessionKey, uint32_t sessionKeySize)
|
||||
{
|
||||
ProxyChannelInfo *item = NULL;
|
||||
|
||||
@ -626,7 +627,7 @@ static inline void TransProxyProcessErrMsg(ProxyChannelInfo *info, int32_t errCo
|
||||
}
|
||||
}
|
||||
|
||||
void TransProxyProcessHandshakeAckMsg(const ProxyMessage *msg)
|
||||
NO_SANITIZE("cfi") void TransProxyProcessHandshakeAckMsg(const ProxyMessage *msg)
|
||||
{
|
||||
if (msg->data[msg->dateLen - 1] != 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "Received string has no end symbol");
|
||||
@ -749,7 +750,7 @@ static int32_t TransProxyFillChannelInfo(const ProxyMessage *msg, ProxyChannelIn
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransProxyProcessHandshakeMsg(const ProxyMessage *msg)
|
||||
NO_SANITIZE("cfi") void TransProxyProcessHandshakeMsg(const ProxyMessage *msg)
|
||||
{
|
||||
if (msg->data[msg->dateLen - 1] != 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "Received string has no end symbol");
|
||||
@ -794,7 +795,7 @@ void TransProxyProcessHandshakeMsg(const ProxyMessage *msg)
|
||||
}
|
||||
}
|
||||
|
||||
void TransProxyProcessResetMsg(const ProxyMessage *msg)
|
||||
NO_SANITIZE("cfi") void TransProxyProcessResetMsg(const ProxyMessage *msg)
|
||||
{
|
||||
if (msg->data[msg->dateLen - 1] != 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "Received string has no end symbol");
|
||||
@ -843,7 +844,7 @@ void TransProxyProcessResetMsg(const ProxyMessage *msg)
|
||||
SoftBusFree(info);
|
||||
}
|
||||
|
||||
void TransProxyProcessKeepAlive(const ProxyMessage *msg)
|
||||
NO_SANITIZE("cfi") void TransProxyProcessKeepAlive(const ProxyMessage *msg)
|
||||
{
|
||||
if (msg->data[msg->dateLen - 1] != 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "Received string has no end symbol");
|
||||
@ -876,7 +877,7 @@ void TransProxyProcessKeepAlive(const ProxyMessage *msg)
|
||||
SoftBusFree(info);
|
||||
}
|
||||
|
||||
void TransProxyProcessKeepAliveAck(const ProxyMessage *msg)
|
||||
NO_SANITIZE("cfi") void TransProxyProcessKeepAliveAck(const ProxyMessage *msg)
|
||||
{
|
||||
if (msg->data[msg->dateLen - 1] != 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "Received string has no end symbol");
|
||||
@ -906,7 +907,7 @@ void TransProxyProcessKeepAliveAck(const ProxyMessage *msg)
|
||||
SoftBusFree(info);
|
||||
}
|
||||
|
||||
void TransProxyProcessDataRecv(const ProxyMessage *msg)
|
||||
NO_SANITIZE("cfi") void TransProxyProcessDataRecv(const ProxyMessage *msg)
|
||||
{
|
||||
ProxyChannelInfo *info = (ProxyChannelInfo *)SoftBusCalloc(sizeof(ProxyChannelInfo));
|
||||
if (info == NULL) {
|
||||
@ -925,7 +926,7 @@ void TransProxyProcessDataRecv(const ProxyMessage *msg)
|
||||
SoftBusFree(info);
|
||||
}
|
||||
|
||||
void TransProxyonMessageReceived(const ProxyMessage *msg)
|
||||
NO_SANITIZE("cfi") void TransProxyonMessageReceived(const ProxyMessage *msg)
|
||||
{
|
||||
switch (msg->msgHead.type) {
|
||||
case PROXYCHANNEL_MSG_TYPE_HANDSHAKE: {
|
||||
@ -958,7 +959,7 @@ void TransProxyonMessageReceived(const ProxyMessage *msg)
|
||||
}
|
||||
}
|
||||
|
||||
int32_t TransProxyCreateChanInfo(ProxyChannelInfo *chan, int32_t channelId, const AppInfo *appInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyCreateChanInfo(ProxyChannelInfo *chan, int32_t channelId, const AppInfo *appInfo)
|
||||
{
|
||||
chan->myId = channelId;
|
||||
chan->channelId = channelId;
|
||||
@ -1019,7 +1020,8 @@ void TransProxyOpenProxyChannelFail(int32_t channelId, const AppInfo *appInfo, i
|
||||
(void)OnProxyChannelOpenFailed(channelId, appInfo, errCode);
|
||||
}
|
||||
|
||||
int32_t TransProxyOpenProxyChannel(const AppInfo *appInfo, const ConnectOption *connInfo, int32_t *channelId)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyOpenProxyChannel(const AppInfo *appInfo, const ConnectOption *connInfo,
|
||||
int32_t *channelId)
|
||||
{
|
||||
if (appInfo == NULL || connInfo == NULL || channelId == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "open normal channel: invalid para");
|
||||
@ -1046,7 +1048,7 @@ int32_t TransProxyCloseProxyChannel(int32_t channelId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxySendMsg(int32_t channelId, const char *data, uint32_t dataLen, int32_t priority)
|
||||
NO_SANITIZE("cfi") int32_t TransProxySendMsg(int32_t channelId, const char *data, uint32_t dataLen, int32_t priority)
|
||||
{
|
||||
int32_t ret = SOFTBUS_ERR;
|
||||
ProxyChannelInfo *info = (ProxyChannelInfo *)SoftBusCalloc(sizeof(ProxyChannelInfo));
|
||||
@ -1152,7 +1154,7 @@ void TransProxyTimerProc(void)
|
||||
TransProxyTimerItemProc(&proxyProcList);
|
||||
}
|
||||
|
||||
int32_t TransProxyAuthSessionDataLenCheck(uint32_t dataLen, int32_t type)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyAuthSessionDataLenCheck(uint32_t dataLen, int32_t type)
|
||||
{
|
||||
switch (type) {
|
||||
case PROXY_FLAG_MESSAGE:
|
||||
@ -1193,7 +1195,7 @@ static int32_t TransProxyManagerInitInner(const IServerChannelCallBack *cb)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxyManagerInit(const IServerChannelCallBack *cb)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyManagerInit(const IServerChannelCallBack *cb)
|
||||
{
|
||||
if (TransProxyManagerInitInner(cb) != SOFTBUS_OK) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "init proxy manager failed");
|
||||
@ -1236,7 +1238,7 @@ int32_t TransProxyManagerInit(const IServerChannelCallBack *cb)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxyGetNameByChanId(int32_t chanId, char *pkgName, char *sessionName,
|
||||
NO_SANITIZE("cfi") int32_t TransProxyGetNameByChanId(int32_t chanId, char *pkgName, char *sessionName,
|
||||
uint16_t pkgLen, uint16_t sessionLen)
|
||||
{
|
||||
if (pkgName == NULL || sessionName == NULL) {
|
||||
@ -1281,7 +1283,7 @@ static void TransProxyManagerDeinitInner(void)
|
||||
SoftBusMutexDestroy(&g_myIdLock);
|
||||
}
|
||||
|
||||
void TransProxyManagerDeinit(void)
|
||||
NO_SANITIZE("cfi") void TransProxyManagerDeinit(void)
|
||||
{
|
||||
TransProxyManagerDeinitInner();
|
||||
|
||||
@ -1307,7 +1309,7 @@ static void TransProxyDestroyChannelList(const ListNode *destroyList)
|
||||
return;
|
||||
}
|
||||
|
||||
void TransProxyDeathCallback(const char *pkgName, int32_t pid)
|
||||
NO_SANITIZE("cfi") void TransProxyDeathCallback(const char *pkgName, int32_t pid)
|
||||
{
|
||||
if ((pkgName == NULL) || (g_proxyChannelList == NULL)) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "pkgName or proxy channel list is null.");
|
||||
@ -1334,7 +1336,7 @@ void TransProxyDeathCallback(const char *pkgName, int32_t pid)
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "TransProxyDeathCallback end.");
|
||||
}
|
||||
|
||||
int32_t TransProxyGetAppInfoByChanId(int32_t chanId, AppInfo* appInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyGetAppInfoByChanId(int32_t chanId, AppInfo* appInfo)
|
||||
{
|
||||
ProxyChannelInfo *item = NULL;
|
||||
ProxyChannelInfo *nextNode = NULL;
|
||||
@ -1359,7 +1361,7 @@ int32_t TransProxyGetAppInfoByChanId(int32_t chanId, AppInfo* appInfo)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
int32_t TransProxyGetConnIdByChanId(int32_t channelId, int32_t *connId)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyGetConnIdByChanId(int32_t channelId, int32_t *connId)
|
||||
{
|
||||
if (g_proxyChannelList == NULL) {
|
||||
return SOFTBUS_ERR;
|
||||
@ -1387,7 +1389,7 @@ int32_t TransProxyGetConnIdByChanId(int32_t channelId, int32_t *connId)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
int32_t TransProxyGetConnOptionByChanId(int32_t channelId, ConnectOption *connOpt)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyGetConnOptionByChanId(int32_t channelId, ConnectOption *connOpt)
|
||||
{
|
||||
if (connOpt == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "[%s] invalid param.", __func__);
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "softbus_message_open_channel.h"
|
||||
#include "softbus_adapter_crypto.h"
|
||||
#include "softbus_adapter_mem.h"
|
||||
#include "softbus_def.h"
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_json_utils.h"
|
||||
#include "softbus_log.h"
|
||||
@ -143,7 +144,7 @@ static int64_t GetAuthIdByHandshakeMsg(uint32_t connId, uint8_t cipher)
|
||||
return AuthGetIdByConnInfo(&connInfo, isAuthServer, false);
|
||||
}
|
||||
|
||||
int32_t TransProxyParseMessage(char *data, int32_t len, ProxyMessage *msg)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyParseMessage(char *data, int32_t len, ProxyMessage *msg)
|
||||
{
|
||||
if (len <= PROXY_CHANNEL_HEAD_LEN) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "parseMessage: invalid message length(%d)", len);
|
||||
@ -230,7 +231,7 @@ static int32_t PackEncryptedMessage(ProxyMessageHead *msg, int64_t authId, Proxy
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxyPackMessage(ProxyMessageHead *msg, int64_t authId, ProxyDataInfo *dataInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyPackMessage(ProxyMessageHead *msg, int64_t authId, ProxyDataInfo *dataInfo)
|
||||
{
|
||||
if (msg == NULL || dataInfo == NULL || dataInfo->inData == NULL || dataInfo->inData == 0) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -279,7 +280,7 @@ static int32_t PackHandshakeMsgForNormal(SessionKeyBase64 *sessionBase64, AppInf
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
char *TransProxyPackHandshakeErrMsg(int32_t errCode)
|
||||
NO_SANITIZE("cfi") char *TransProxyPackHandshakeErrMsg(int32_t errCode)
|
||||
{
|
||||
cJSON *root = NULL;
|
||||
char *buf = NULL;
|
||||
@ -299,7 +300,7 @@ char *TransProxyPackHandshakeErrMsg(int32_t errCode)
|
||||
return buf;
|
||||
}
|
||||
|
||||
char *TransProxyPackHandshakeMsg(ProxyChannelInfo *info)
|
||||
NO_SANITIZE("cfi") char *TransProxyPackHandshakeMsg(ProxyChannelInfo *info)
|
||||
{
|
||||
cJSON *root = NULL;
|
||||
SessionKeyBase64 sessionBase64;
|
||||
@ -354,7 +355,7 @@ EXIT:
|
||||
return buf;
|
||||
}
|
||||
|
||||
char *TransProxyPackHandshakeAckMsg(ProxyChannelInfo *chan)
|
||||
NO_SANITIZE("cfi") char *TransProxyPackHandshakeAckMsg(ProxyChannelInfo *chan)
|
||||
{
|
||||
cJSON *root = NULL;
|
||||
char *buf = NULL;
|
||||
@ -396,7 +397,7 @@ char *TransProxyPackHandshakeAckMsg(ProxyChannelInfo *chan)
|
||||
return buf;
|
||||
}
|
||||
|
||||
int32_t TransProxyUnPackHandshakeErrMsg(const char *msg, int *errCode)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyUnPackHandshakeErrMsg(const char *msg, int *errCode)
|
||||
{
|
||||
cJSON *root = cJSON_Parse(msg);
|
||||
if ((root == NULL) || (errCode == NULL)) {
|
||||
@ -413,7 +414,7 @@ int32_t TransProxyUnPackHandshakeErrMsg(const char *msg, int *errCode)
|
||||
}
|
||||
|
||||
|
||||
int32_t TransProxyUnpackHandshakeAckMsg(const char *msg, ProxyChannelInfo *chanInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyUnpackHandshakeAckMsg(const char *msg, ProxyChannelInfo *chanInfo)
|
||||
{
|
||||
cJSON *root = 0;
|
||||
AppInfo *appInfo = &(chanInfo->appInfo);
|
||||
@ -508,7 +509,7 @@ static int32_t TransProxyUnpackAuthHandshakeMsg(cJSON *root, AppInfo *appInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxyUnpackHandshakeMsg(const char *msg, ProxyChannelInfo *chan)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyUnpackHandshakeMsg(const char *msg, ProxyChannelInfo *chan)
|
||||
{
|
||||
cJSON *root = cJSON_Parse(msg);
|
||||
if (root == NULL) {
|
||||
@ -559,7 +560,7 @@ ERR_EXIT:
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
char *TransProxyPackIdentity(const char *identity)
|
||||
NO_SANITIZE("cfi") char *TransProxyPackIdentity(const char *identity)
|
||||
{
|
||||
cJSON *root = NULL;
|
||||
char *buf = NULL;
|
||||
@ -583,7 +584,7 @@ char *TransProxyPackIdentity(const char *identity)
|
||||
return buf;
|
||||
}
|
||||
|
||||
int32_t TransProxyUnpackIdentity(const char *msg, char *identity, uint32_t identitySize)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyUnpackIdentity(const char *msg, char *identity, uint32_t identitySize)
|
||||
{
|
||||
cJSON *root = NULL;
|
||||
|
||||
|
@ -66,7 +66,7 @@ NO_SANITIZE("cfi") void NotifyNetworkingMsgReceived(int32_t channelId, const cha
|
||||
}
|
||||
|
||||
|
||||
int TransRegisterNetworkingChannelListener(const INetworkingListener *listener)
|
||||
NO_SANITIZE("cfi") int TransRegisterNetworkingChannelListener(const INetworkingListener *listener)
|
||||
{
|
||||
if (memcpy_s(&g_netChanlistener, sizeof(INetworkingListener),
|
||||
listener, sizeof(INetworkingListener)) != EOK) {
|
||||
|
@ -67,7 +67,7 @@ NO_SANITIZE("cfi") void PackSliceHead(SliceHead *data)
|
||||
data->reserved = (int32_t)SoftBusHtoLl((uint32_t)data->reserved);
|
||||
}
|
||||
|
||||
void UnPackSliceHead(SliceHead *data)
|
||||
NO_SANITIZE("cfi") void UnPackSliceHead(SliceHead *data)
|
||||
{
|
||||
data->priority = (int32_t)SoftBusLtoHl((uint32_t)data->priority);
|
||||
data->sliceNum = (int32_t)SoftBusLtoHl((uint32_t)data->sliceNum);
|
||||
@ -299,7 +299,8 @@ static int32_t TransProxyTransDataSendSyncMsg(int32_t channelId, const char *pay
|
||||
return ret;
|
||||
}
|
||||
|
||||
int32_t TransProxyPostPacketData(int32_t channelId, const unsigned char *data, uint32_t len, ProxyPacketType flags)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyPostPacketData(int32_t channelId, const unsigned char *data, uint32_t len,
|
||||
ProxyPacketType flags)
|
||||
{
|
||||
ProxyDataInfo packDataInfo = {0};
|
||||
int32_t ret = SOFTBUS_ERR;
|
||||
@ -350,7 +351,8 @@ int32_t TransProxyPostPacketData(int32_t channelId, const unsigned char *data, u
|
||||
return ret;
|
||||
}
|
||||
|
||||
int32_t TransProxyPostSessionData(int32_t channelId, const unsigned char *data, uint32_t len, SessionPktType flags)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyPostSessionData(int32_t channelId, const unsigned char *data, uint32_t len,
|
||||
SessionPktType flags)
|
||||
{
|
||||
ProxyPacketType type = SessionTypeToPacketType(flags);
|
||||
return TransProxyPostPacketData(channelId, data, len, type);
|
||||
@ -492,7 +494,8 @@ static int32_t TransProxyTransAppNormalMsg(const ProxyChannelInfo *info, const c
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxyTransDataSendMsg(int32_t channelId, const char *payLoad, int payLoadLen, ProxyPacketType flag)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyTransDataSendMsg(int32_t channelId, const char *payLoad, int payLoadLen,
|
||||
ProxyPacketType flag)
|
||||
{
|
||||
int ret = SOFTBUS_ERR;
|
||||
ProxyChannelInfo *info = (ProxyChannelInfo *)SoftBusCalloc(sizeof(ProxyChannelInfo));
|
||||
@ -567,8 +570,8 @@ static SessionPktType PacketTypeToSessionType(ProxyPacketType pktType)
|
||||
}
|
||||
}
|
||||
|
||||
int32_t TransProxyNotifySession(const char *pkgName, int32_t pid, int32_t channelId, ProxyPacketType flags, int32_t seq,
|
||||
const char *data, uint32_t len)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyNotifySession(const char *pkgName, int32_t pid, int32_t channelId,
|
||||
ProxyPacketType flags, int32_t seq, const char *data, uint32_t len)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "flags:%d", flags);
|
||||
TransReceiveData receiveData;
|
||||
@ -604,7 +607,7 @@ int32_t TransProxyNotifySession(const char *pkgName, int32_t pid, int32_t channe
|
||||
}
|
||||
}
|
||||
|
||||
int32_t TransProxySessionDataLenCheck(uint32_t dataLen, ProxyPacketType type)
|
||||
NO_SANITIZE("cfi") int32_t TransProxySessionDataLenCheck(uint32_t dataLen, ProxyPacketType type)
|
||||
{
|
||||
#define PROXY_MAX_BYTES_LEN (1024 * 1024)
|
||||
#define PROXY_MAX_MESSAGE_LEN (1 * 1024)
|
||||
@ -901,7 +904,8 @@ static int TransProxySubPacketProc(const char *pkgName, int32_t pid, int32_t cha
|
||||
return ret;
|
||||
}
|
||||
#define SLICE_HEAD_LEN (sizeof(PacketHead) + sizeof(SliceHead))
|
||||
int32_t TransOnNormalMsgReceived(const char *pkgName, int32_t pid, int32_t channelId, const char *data, uint32_t len)
|
||||
NO_SANITIZE("cfi") int32_t TransOnNormalMsgReceived(const char *pkgName, int32_t pid, int32_t channelId,
|
||||
const char *data, uint32_t len)
|
||||
{
|
||||
SliceHead *headSlice = NULL;
|
||||
uint32_t dataLen;
|
||||
@ -930,7 +934,8 @@ int32_t TransOnNormalMsgReceived(const char *pkgName, int32_t pid, int32_t chann
|
||||
}
|
||||
}
|
||||
|
||||
int32_t TransOnAuthMsgReceived(const char *pkgName, int32_t pid, int32_t channelId, const char *data, uint32_t len)
|
||||
NO_SANITIZE("cfi") int32_t TransOnAuthMsgReceived(const char *pkgName, int32_t pid, int32_t channelId,
|
||||
const char *data, uint32_t len)
|
||||
{
|
||||
if (data == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "data null.");
|
||||
@ -952,7 +957,7 @@ int32_t TransOnAuthMsgReceived(const char *pkgName, int32_t pid, int32_t channel
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxyDelSliceProcessorByChannelId(int32_t channelId)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyDelSliceProcessorByChannelId(int32_t channelId)
|
||||
{
|
||||
ChannelSliceProcessor *node = NULL;
|
||||
ChannelSliceProcessor *next = NULL;
|
||||
@ -1010,7 +1015,7 @@ static void TransProxySliceTimerProc(void)
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t TransSliceManagerInit(void)
|
||||
NO_SANITIZE("cfi") int32_t TransSliceManagerInit(void)
|
||||
{
|
||||
g_channelSliceProcessorList = CreateSoftBusList();
|
||||
if (g_channelSliceProcessorList == NULL) {
|
||||
@ -1023,7 +1028,7 @@ int32_t TransSliceManagerInit(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransSliceManagerDeInit(void)
|
||||
NO_SANITIZE("cfi") void TransSliceManagerDeInit(void)
|
||||
{
|
||||
if (g_channelSliceProcessorList) {
|
||||
DestroySoftBusList(g_channelSliceProcessorList);
|
||||
|
@ -70,7 +70,7 @@ static int32_t TransDelConnByReqId(uint32_t reqId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransDelConnByConnId(uint32_t connId)
|
||||
NO_SANITIZE("cfi") void TransDelConnByConnId(uint32_t connId)
|
||||
{
|
||||
ProxyConnInfo *removeNode = NULL;
|
||||
ProxyConnInfo *tmpNode = NULL;
|
||||
@ -97,7 +97,7 @@ void TransDelConnByConnId(uint32_t connId)
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t TransDecConnRefByConnId(uint32_t connId)
|
||||
NO_SANITIZE("cfi") int32_t TransDecConnRefByConnId(uint32_t connId)
|
||||
{
|
||||
ProxyConnInfo *removeNode = NULL;
|
||||
ProxyConnInfo *tmpNode = NULL;
|
||||
@ -134,7 +134,7 @@ int32_t TransDecConnRefByConnId(uint32_t connId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransAddConnRefByConnId(uint32_t connId)
|
||||
NO_SANITIZE("cfi") int32_t TransAddConnRefByConnId(uint32_t connId)
|
||||
{
|
||||
ProxyConnInfo *item = NULL;
|
||||
|
||||
@ -158,7 +158,7 @@ int32_t TransAddConnRefByConnId(uint32_t connId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
static void TransProxyLoopMsgHandler(SoftBusMessage *msg)
|
||||
NO_SANITIZE("cfi") static void TransProxyLoopMsgHandler(SoftBusMessage *msg)
|
||||
{
|
||||
int32_t chanId;
|
||||
uint32_t connectionId;
|
||||
@ -210,7 +210,7 @@ static void TransProxyLoopMsgHandler(SoftBusMessage *msg)
|
||||
}
|
||||
}
|
||||
|
||||
void TransProxyFreeLoopMsg(SoftBusMessage *msg)
|
||||
NO_SANITIZE("cfi") void TransProxyFreeLoopMsg(SoftBusMessage *msg)
|
||||
{
|
||||
if (msg != NULL) {
|
||||
if (msg->obj != NULL) {
|
||||
@ -234,7 +234,7 @@ static SoftBusMessage *TransProxyCreateLoopMsg(int32_t what, uint64_t arg1, uint
|
||||
return msg;
|
||||
}
|
||||
|
||||
void TransProxyPostResetPeerMsgToLoop(const ProxyChannelInfo *chan)
|
||||
NO_SANITIZE("cfi") void TransProxyPostResetPeerMsgToLoop(const ProxyChannelInfo *chan)
|
||||
{
|
||||
SoftBusMessage *msg = TransProxyCreateLoopMsg(LOOP_RESETPEER_MSG, 0, 0, (char *)chan);
|
||||
if (msg == NULL) {
|
||||
@ -247,7 +247,7 @@ void TransProxyPostResetPeerMsgToLoop(const ProxyChannelInfo *chan)
|
||||
return;
|
||||
}
|
||||
|
||||
void TransProxyPostHandshakeMsgToLoop(int32_t chanId)
|
||||
NO_SANITIZE("cfi") void TransProxyPostHandshakeMsgToLoop(int32_t chanId)
|
||||
{
|
||||
int32_t *chanIdMsg = (int32_t *)SoftBusCalloc(sizeof(int32_t));
|
||||
if (chanIdMsg == NULL) {
|
||||
@ -273,7 +273,7 @@ NO_SANITIZE("cfi") void TransProxyPostDisConnectMsgToLoop(uint32_t connId)
|
||||
return;
|
||||
}
|
||||
|
||||
void TransProxyPostKeepAliveMsgToLoop(const ProxyChannelInfo *chan)
|
||||
NO_SANITIZE("cfi") void TransProxyPostKeepAliveMsgToLoop(const ProxyChannelInfo *chan)
|
||||
{
|
||||
SoftBusMessage *msg = TransProxyCreateLoopMsg(LOOP_KEEPALIVE_MSG, 0, 0, (char *)chan);
|
||||
if (msg == NULL) {
|
||||
@ -286,7 +286,7 @@ void TransProxyPostKeepAliveMsgToLoop(const ProxyChannelInfo *chan)
|
||||
return;
|
||||
}
|
||||
|
||||
void TransProxyPostOpenFailMsgToLoop(const ProxyChannelInfo *chan, int32_t errCode)
|
||||
NO_SANITIZE("cfi") void TransProxyPostOpenFailMsgToLoop(const ProxyChannelInfo *chan, int32_t errCode)
|
||||
{
|
||||
SoftBusMessage *msg = TransProxyCreateLoopMsg(LOOP_OPENFAIL_MSG, errCode, 0, (char *)chan);
|
||||
if (msg == NULL) {
|
||||
@ -299,7 +299,7 @@ void TransProxyPostOpenFailMsgToLoop(const ProxyChannelInfo *chan, int32_t errCo
|
||||
return;
|
||||
}
|
||||
|
||||
void TransProxyPostOpenClosedMsgToLoop(const ProxyChannelInfo *chan)
|
||||
NO_SANITIZE("cfi") void TransProxyPostOpenClosedMsgToLoop(const ProxyChannelInfo *chan)
|
||||
{
|
||||
SoftBusMessage *msg = TransProxyCreateLoopMsg(LOOP_OPENCLOSE_MSG, 0, 0, (char *)chan);
|
||||
if (msg == NULL) {
|
||||
@ -323,7 +323,8 @@ static int32_t TransProxyLoopInit(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxyTransSendMsg(uint32_t connectionId, uint8_t *buf, uint32_t len, int32_t priority, int32_t pid)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyTransSendMsg(uint32_t connectionId, uint8_t *buf, uint32_t len, int32_t priority,
|
||||
int32_t pid)
|
||||
{
|
||||
ConnPostData data = {0};
|
||||
static uint64_t seq = 1;
|
||||
@ -361,7 +362,7 @@ static void TransProxyOnDisConnect(uint32_t connId, const ConnectionInfo *connIn
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t TransAddConnItem(ProxyConnInfo *chan)
|
||||
NO_SANITIZE("cfi") int32_t TransAddConnItem(ProxyConnInfo *chan)
|
||||
{
|
||||
ProxyConnInfo *item = NULL;
|
||||
ProxyConnInfo *tmpItem = NULL;
|
||||
@ -392,7 +393,7 @@ int32_t TransAddConnItem(ProxyConnInfo *chan)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransCreateConnByConnId(uint32_t connId)
|
||||
NO_SANITIZE("cfi") void TransCreateConnByConnId(uint32_t connId)
|
||||
{
|
||||
ProxyConnInfo *item = NULL;
|
||||
ProxyConnInfo *tmpNode = NULL;
|
||||
@ -499,7 +500,7 @@ static int32_t TransGetConn(const ConnectOption *connInfo, ProxyConnInfo *proxyC
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
void TransSetConnStateByReqId(uint32_t reqId, uint32_t connId, uint32_t state)
|
||||
NO_SANITIZE("cfi") void TransSetConnStateByReqId(uint32_t reqId, uint32_t connId, uint32_t state)
|
||||
{
|
||||
ProxyConnInfo *getNode = NULL;
|
||||
|
||||
@ -545,7 +546,7 @@ static void TransOnConnectFailed(uint32_t requestId, int32_t reason)
|
||||
TransProxyDelChanByReqId((int32_t)requestId);
|
||||
}
|
||||
|
||||
int32_t TransProxyCloseConnChannel(uint32_t connectionId)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyCloseConnChannel(uint32_t connectionId)
|
||||
{
|
||||
if (TransDecConnRefByConnId(connectionId) == SOFTBUS_OK) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "disconnect device connid %d", connectionId);
|
||||
@ -555,7 +556,7 @@ int32_t TransProxyCloseConnChannel(uint32_t connectionId)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxyCloseConnChannelReset(uint32_t connectionId, bool isDisconnect)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyCloseConnChannelReset(uint32_t connectionId, bool isDisconnect)
|
||||
{
|
||||
if (TransDecConnRefByConnId(connectionId) == SOFTBUS_OK) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "reset(%d) disconnect device connid %d",
|
||||
@ -567,7 +568,7 @@ int32_t TransProxyCloseConnChannelReset(uint32_t connectionId, bool isDisconnect
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxyConnExistProc(ProxyConnInfo *conn, const AppInfo *appInfo, int32_t chanNewId)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyConnExistProc(ProxyConnInfo *conn, const AppInfo *appInfo, int32_t chanNewId)
|
||||
{
|
||||
ProxyChannelInfo *chan = (ProxyChannelInfo *)SoftBusCalloc(sizeof(ProxyChannelInfo));
|
||||
if (chan == NULL) {
|
||||
@ -644,7 +645,8 @@ static int32_t TransProxyOpenNewConnChannel(
|
||||
return ret;
|
||||
}
|
||||
|
||||
int32_t TransProxyOpenConnChannel(const AppInfo *appInfo, const ConnectOption *connInfo, int32_t *channelId)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyOpenConnChannel(const AppInfo *appInfo, const ConnectOption *connInfo,
|
||||
int32_t *channelId)
|
||||
{
|
||||
ProxyConnInfo conn;
|
||||
int32_t chanNewId = TransProxyGetNewMyId();
|
||||
@ -687,7 +689,7 @@ static void TransProxyOnDataReceived(uint32_t connectionId, ConnModule moduleId,
|
||||
}
|
||||
}
|
||||
|
||||
int32_t TransProxyTransInit(void)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyTransInit(void)
|
||||
{
|
||||
ConnectCallback proxyCallback = {0};
|
||||
|
||||
@ -710,7 +712,7 @@ int32_t TransProxyTransInit(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransProxyGetConnInfoByConnId(uint32_t connId, ConnectOption *connInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransProxyGetConnInfoByConnId(uint32_t connId, ConnectOption *connInfo)
|
||||
{
|
||||
if (connInfo == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "%s invalid param.", __func__);
|
||||
|
@ -16,12 +16,12 @@
|
||||
#include "trans_tcp_direct_callback.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "softbus_def.h"
|
||||
#include "softbus_errcode.h"
|
||||
|
||||
static IServerChannelCallBack g_channelCb;
|
||||
|
||||
int32_t TransTdcSetCallBack(const IServerChannelCallBack *cb)
|
||||
NO_SANITIZE("cfi") int32_t TransTdcSetCallBack(const IServerChannelCallBack *cb)
|
||||
{
|
||||
if (cb == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
@ -30,22 +30,24 @@ int32_t TransTdcSetCallBack(const IServerChannelCallBack *cb)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransTdcOnChannelOpened(const char *pkgName, int32_t pid, const char *sessionName, const ChannelInfo *channel)
|
||||
NO_SANITIZE("cfi") int32_t TransTdcOnChannelOpened(const char *pkgName, int32_t pid, const char *sessionName,
|
||||
const ChannelInfo *channel)
|
||||
{
|
||||
return g_channelCb.OnChannelOpened(pkgName, pid, sessionName, channel);
|
||||
}
|
||||
|
||||
int32_t TransTdcOnChannelOpenFailed(const char *pkgName, int32_t pid, int32_t channelId, int32_t errCode)
|
||||
NO_SANITIZE("cfi") int32_t TransTdcOnChannelOpenFailed(const char *pkgName, int32_t pid, int32_t channelId,
|
||||
int32_t errCode)
|
||||
{
|
||||
return g_channelCb.OnChannelOpenFailed(pkgName, pid, channelId, CHANNEL_TYPE_TCP_DIRECT, errCode);
|
||||
}
|
||||
|
||||
int32_t TransTdcGetPkgName(const char *sessionName, char *pkgName, uint16_t len)
|
||||
NO_SANITIZE("cfi") int32_t TransTdcGetPkgName(const char *sessionName, char *pkgName, uint16_t len)
|
||||
{
|
||||
return g_channelCb.GetPkgNameBySessionName(sessionName, pkgName, len);
|
||||
}
|
||||
|
||||
int32_t TransTdcGetUidAndPid(const char *sessionName, int32_t *uid, int32_t *pid)
|
||||
NO_SANITIZE("cfi") int32_t TransTdcGetUidAndPid(const char *sessionName, int32_t *uid, int32_t *pid)
|
||||
{
|
||||
return g_channelCb.GetUidAndPidBySessionName(sessionName, uid, pid);
|
||||
}
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "trans_tcp_direct_json.h"
|
||||
|
||||
#include "softbus_def.h"
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_json_utils.h"
|
||||
#include "softbus_proxychannel_message.h"
|
||||
@ -25,7 +25,7 @@
|
||||
#define ERR_CODE "ERR_CODE"
|
||||
#define ERR_DESC "ERR_DESC"
|
||||
|
||||
char *VerifyP2pPackError(int32_t code, int32_t errCode, const char *errDesc)
|
||||
NO_SANITIZE("cfi") char *VerifyP2pPackError(int32_t code, int32_t errCode, const char *errDesc)
|
||||
{
|
||||
if (errDesc == NULL) {
|
||||
return NULL;
|
||||
@ -45,7 +45,7 @@ char *VerifyP2pPackError(int32_t code, int32_t errCode, const char *errDesc)
|
||||
return data;
|
||||
}
|
||||
|
||||
char *VerifyP2pPack(const char *myIp, int32_t myPort)
|
||||
NO_SANITIZE("cfi") char *VerifyP2pPack(const char *myIp, int32_t myPort)
|
||||
{
|
||||
if (myIp == NULL || myPort <= 0) {
|
||||
return NULL;
|
||||
@ -65,7 +65,7 @@ char *VerifyP2pPack(const char *myIp, int32_t myPort)
|
||||
return data;
|
||||
}
|
||||
|
||||
int32_t VerifyP2pUnPack(const cJSON *json, char *ip, uint32_t ipLen, int32_t *port)
|
||||
NO_SANITIZE("cfi") int32_t VerifyP2pUnPack(const cJSON *json, char *ip, uint32_t ipLen, int32_t *port)
|
||||
{
|
||||
if (json == NULL || ip == NULL || port == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
|
@ -269,7 +269,7 @@ NO_SANITIZE("cfi") static int32_t TdcOnDataEvent(ListenerModule module, int even
|
||||
return ret;
|
||||
}
|
||||
|
||||
int32_t TransTdcStartSessionListener(ListenerModule module, const LocalListenerInfo *info)
|
||||
NO_SANITIZE("cfi") int32_t TransTdcStartSessionListener(ListenerModule module, const LocalListenerInfo *info)
|
||||
{
|
||||
if (info == NULL || (info->type != CONNECT_TCP && info->type != CONNECT_P2P) || info->socketOption.port < 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "%s:Invalid para.", __func__);
|
||||
@ -291,7 +291,7 @@ int32_t TransTdcStartSessionListener(ListenerModule module, const LocalListenerI
|
||||
return serverPort;
|
||||
}
|
||||
|
||||
int32_t TransTdcStopSessionListener(ListenerModule module)
|
||||
NO_SANITIZE("cfi") int32_t TransTdcStopSessionListener(ListenerModule module)
|
||||
{
|
||||
TransTdcStopSessionProc(module);
|
||||
return StopBaseListener(module);
|
||||
|
@ -118,7 +118,7 @@ static void NotifyTdcChannelStopProc(ListNode *tdcChannelList)
|
||||
}
|
||||
|
||||
|
||||
void TransTdcStopSessionProc(ListenerModule listenMod)
|
||||
NO_SANITIZE("cfi") void TransTdcStopSessionProc(ListenerModule listenMod)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "TransTdcStopSessionProc");
|
||||
SessionConn *item = NULL;
|
||||
@ -150,7 +150,7 @@ void TransTdcStopSessionProc(ListenerModule listenMod)
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "TransTdcStopSessionProc end");
|
||||
}
|
||||
|
||||
int32_t TransTcpDirectInit(const IServerChannelCallBack *cb)
|
||||
NO_SANITIZE("cfi") int32_t TransTcpDirectInit(const IServerChannelCallBack *cb)
|
||||
{
|
||||
int32_t ret = P2pDirectChannelInit();
|
||||
if (ret != SOFTBUS_OK) {
|
||||
@ -179,13 +179,13 @@ int32_t TransTcpDirectInit(const IServerChannelCallBack *cb)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransTcpDirectDeinit(void)
|
||||
NO_SANITIZE("cfi") void TransTcpDirectDeinit(void)
|
||||
{
|
||||
TransSrvDataListDeinit();
|
||||
(void)RegisterTimeoutCallback(SOFTBUS_TCP_DIRECTCHANNEL_TIMER_FUN, NULL);
|
||||
}
|
||||
|
||||
void TransTdcDeathCallback(const char *pkgName, int32_t pid)
|
||||
NO_SANITIZE("cfi") void TransTdcDeathCallback(const char *pkgName, int32_t pid)
|
||||
{
|
||||
if (pkgName == NULL) {
|
||||
return;
|
||||
@ -247,7 +247,8 @@ static int32_t TransUpdAppInfo(AppInfo *appInfo, const ConnectOption *connInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransOpenDirectChannel(const AppInfo *appInfo, const ConnectOption *connInfo, int32_t *channelId)
|
||||
NO_SANITIZE("cfi") int32_t TransOpenDirectChannel(const AppInfo *appInfo, const ConnectOption *connInfo,
|
||||
int32_t *channelId)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "TransOpenDirectChannel");
|
||||
if (appInfo == NULL || connInfo == NULL || channelId == NULL) {
|
||||
|
@ -66,7 +66,7 @@ static void UnpackTdcPacketHead(TdcPacketHead *data)
|
||||
data->dataLen = SoftBusLtoHl(data->dataLen);
|
||||
}
|
||||
|
||||
int32_t TransSrvDataListInit(void)
|
||||
NO_SANITIZE("cfi") int32_t TransSrvDataListInit(void)
|
||||
{
|
||||
if (g_tcpSrvDataList != NULL) {
|
||||
return SOFTBUS_OK;
|
||||
@ -100,7 +100,7 @@ static void TransSrvDestroyDataBuf(void)
|
||||
return;
|
||||
}
|
||||
|
||||
void TransSrvDataListDeinit(void)
|
||||
NO_SANITIZE("cfi") void TransSrvDataListDeinit(void)
|
||||
{
|
||||
if (g_tcpSrvDataList == NULL) {
|
||||
return;
|
||||
@ -110,7 +110,7 @@ void TransSrvDataListDeinit(void)
|
||||
g_tcpSrvDataList = NULL;
|
||||
}
|
||||
|
||||
int32_t TransSrvAddDataBufNode(int32_t channelId, int32_t fd)
|
||||
NO_SANITIZE("cfi") int32_t TransSrvAddDataBufNode(int32_t channelId, int32_t fd)
|
||||
{
|
||||
#define MAX_DATA_BUF 4096
|
||||
ServerDataBuf *node = (ServerDataBuf *)SoftBusCalloc(sizeof(ServerDataBuf));
|
||||
@ -142,7 +142,7 @@ int32_t TransSrvAddDataBufNode(int32_t channelId, int32_t fd)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransSrvDelDataBufNode(int channelId)
|
||||
NO_SANITIZE("cfi") void TransSrvDelDataBufNode(int channelId)
|
||||
{
|
||||
if (g_tcpSrvDataList == NULL) {
|
||||
return;
|
||||
@ -208,7 +208,7 @@ static int32_t PackBytes(int32_t channelId, const char *data, TdcPacketHead *pac
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransTdcPostBytes(int32_t channelId, TdcPacketHead *packetHead, const char *data)
|
||||
NO_SANITIZE("cfi") int32_t TransTdcPostBytes(int32_t channelId, TdcPacketHead *packetHead, const char *data)
|
||||
{
|
||||
if (data == NULL || packetHead == NULL || packetHead->dataLen == 0) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "Invalid para.");
|
||||
@ -763,7 +763,7 @@ static int32_t TransTdcUpdateDataBufWInfo(int32_t channelId, char *recvBuf, int3
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
int32_t TransTdcSrvRecvData(ListenerModule module, int32_t channelId)
|
||||
NO_SANITIZE("cfi") int32_t TransTdcSrvRecvData(ListenerModule module, int32_t channelId)
|
||||
{
|
||||
int32_t fd = -1;
|
||||
size_t len = 0;
|
||||
|
@ -30,7 +30,7 @@
|
||||
static SoftBusList *g_sessionConnList = NULL;
|
||||
static int32_t g_tdcChannelId = 0;
|
||||
|
||||
uint64_t TransTdcGetNewSeqId(void)
|
||||
NO_SANITIZE("cfi") uint64_t TransTdcGetNewSeqId(void)
|
||||
{
|
||||
if (GetSessionConnLock() != SOFTBUS_OK) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "TransTdcGetNewSeqId GetLock fail");
|
||||
@ -261,7 +261,7 @@ NO_SANITIZE("cfi") int64_t GetAuthIdByChanId(int32_t channelId)
|
||||
return AUTH_INVALID_ID;
|
||||
}
|
||||
|
||||
void TransDelSessionConnById(int32_t channelId)
|
||||
NO_SANITIZE("cfi") void TransDelSessionConnById(int32_t channelId)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "TransDelSessionConnById: channelId=%d", channelId);
|
||||
SessionConn *item = NULL;
|
||||
@ -284,7 +284,7 @@ void TransDelSessionConnById(int32_t channelId)
|
||||
ReleaseSessonConnLock();
|
||||
}
|
||||
|
||||
int32_t TransTdcAddSessionConn(SessionConn *conn)
|
||||
NO_SANITIZE("cfi") int32_t TransTdcAddSessionConn(SessionConn *conn)
|
||||
{
|
||||
if (conn == NULL) {
|
||||
return SOFTBUS_INVALID_PARAM;
|
||||
|
@ -102,7 +102,7 @@ static void TransUdpTimerProc(void)
|
||||
NotifyTimeOutUdpChannel(&udpTmpChannelList);
|
||||
}
|
||||
|
||||
int32_t TransUdpChannelMgrInit(void)
|
||||
NO_SANITIZE("cfi") int32_t TransUdpChannelMgrInit(void)
|
||||
{
|
||||
if (g_udpChannelMgr != NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "udp channel info manager has initialized.");
|
||||
@ -120,7 +120,7 @@ int32_t TransUdpChannelMgrInit(void)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransUdpChannelMgrDeinit(void)
|
||||
NO_SANITIZE("cfi") void TransUdpChannelMgrDeinit(void)
|
||||
{
|
||||
if (g_udpChannelMgr == NULL) {
|
||||
return;
|
||||
@ -142,7 +142,7 @@ void TransUdpChannelMgrDeinit(void)
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t TransAddUdpChannel(UdpChannelInfo *channel)
|
||||
NO_SANITIZE("cfi") int32_t TransAddUdpChannel(UdpChannelInfo *channel)
|
||||
{
|
||||
if (g_udpChannelMgr == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "udp channel manager hasn't initialized.");
|
||||
@ -178,7 +178,7 @@ int32_t TransAddUdpChannel(UdpChannelInfo *channel)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransDelUdpChannel(int32_t channelId)
|
||||
NO_SANITIZE("cfi") int32_t TransDelUdpChannel(int32_t channelId)
|
||||
{
|
||||
if (g_udpChannelMgr == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "udp channel manager hasn't initialized.");
|
||||
@ -218,7 +218,7 @@ static void NotifyUdpChannelCloseInList(ListNode *udpChannelList)
|
||||
}
|
||||
}
|
||||
|
||||
void TransCloseUdpChannelByNetWorkId(const char* netWorkId)
|
||||
NO_SANITIZE("cfi") void TransCloseUdpChannelByNetWorkId(const char* netWorkId)
|
||||
{
|
||||
if ((g_udpChannelMgr == NULL) || (netWorkId == NULL)) {
|
||||
return;
|
||||
@ -247,7 +247,7 @@ void TransCloseUdpChannelByNetWorkId(const char* netWorkId)
|
||||
NotifyUdpChannelCloseInList(&udpDeleteChannelList);
|
||||
}
|
||||
|
||||
int32_t TransGetUdpChannelBySeq(int64_t seq, UdpChannelInfo *channel)
|
||||
NO_SANITIZE("cfi") int32_t TransGetUdpChannelBySeq(int64_t seq, UdpChannelInfo *channel)
|
||||
{
|
||||
if (g_udpChannelMgr == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "udp channel manager hasn't initialized.");
|
||||
@ -281,7 +281,7 @@ int32_t TransGetUdpChannelBySeq(int64_t seq, UdpChannelInfo *channel)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
int32_t TransGetUdpChannelById(int32_t channelId, UdpChannelInfo *channel)
|
||||
NO_SANITIZE("cfi") int32_t TransGetUdpChannelById(int32_t channelId, UdpChannelInfo *channel)
|
||||
{
|
||||
if (g_udpChannelMgr == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "udp channel manager hasn't initialized.");
|
||||
@ -315,7 +315,7 @@ int32_t TransGetUdpChannelById(int32_t channelId, UdpChannelInfo *channel)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
int32_t TransUdpGetNameByChanId(int32_t channelId, char *pkgName, char *sessionName,
|
||||
NO_SANITIZE("cfi") int32_t TransUdpGetNameByChanId(int32_t channelId, char *pkgName, char *sessionName,
|
||||
uint16_t pkgNameLen, uint16_t sessionNameLen)
|
||||
{
|
||||
if (g_udpChannelMgr == NULL) {
|
||||
@ -349,7 +349,7 @@ int32_t TransUdpGetNameByChanId(int32_t channelId, char *pkgName, char *sessionN
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
int32_t TransSetUdpChannelStatus(int64_t seq, UdpChannelStatus status)
|
||||
NO_SANITIZE("cfi") int32_t TransSetUdpChannelStatus(int64_t seq, UdpChannelStatus status)
|
||||
{
|
||||
if (g_udpChannelMgr == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "udp channel manager hasn't initialized.");
|
||||
@ -374,7 +374,7 @@ int32_t TransSetUdpChannelStatus(int64_t seq, UdpChannelStatus status)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
int32_t TransSetUdpChannelOptType(int32_t channelId, UdpChannelOptType type)
|
||||
NO_SANITIZE("cfi") int32_t TransSetUdpChannelOptType(int32_t channelId, UdpChannelOptType type)
|
||||
{
|
||||
if (g_udpChannelMgr == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "udp channel manager hasn't initialized.");
|
||||
@ -399,7 +399,7 @@ int32_t TransSetUdpChannelOptType(int32_t channelId, UdpChannelOptType type)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
void TransUpdateUdpChannelInfo(int64_t seq, const AppInfo *appInfo)
|
||||
NO_SANITIZE("cfi") void TransUpdateUdpChannelInfo(int64_t seq, const AppInfo *appInfo)
|
||||
{
|
||||
if (g_udpChannelMgr == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "udp channel manager hasn't initialized.");
|
||||
@ -430,7 +430,7 @@ void TransUpdateUdpChannelInfo(int64_t seq, const AppInfo *appInfo)
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "udp channel not found.[seq = %" PRId64 "]", seq);
|
||||
}
|
||||
|
||||
int32_t TransGetUdpChannelByRequestId(uint32_t requestId, UdpChannelInfo *channel)
|
||||
NO_SANITIZE("cfi") int32_t TransGetUdpChannelByRequestId(uint32_t requestId, UdpChannelInfo *channel)
|
||||
{
|
||||
if (g_udpChannelMgr == NULL) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "udp channel manager hasn't initialized.");
|
||||
@ -463,7 +463,7 @@ int32_t TransGetUdpChannelByRequestId(uint32_t requestId, UdpChannelInfo *channe
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
UdpChannelInfo *TransGetChannelObj(int32_t channelId)
|
||||
NO_SANITIZE("cfi") UdpChannelInfo *TransGetChannelObj(int32_t channelId)
|
||||
{
|
||||
if (g_udpChannelMgr == NULL) {
|
||||
return NULL;
|
||||
@ -478,7 +478,7 @@ UdpChannelInfo *TransGetChannelObj(int32_t channelId)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int32_t TransGetUdpAppInfoByChannelId(int32_t channelId, AppInfo *appInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransGetUdpAppInfoByChannelId(int32_t channelId, AppInfo *appInfo)
|
||||
{
|
||||
if ((g_udpChannelMgr == NULL) && (appInfo == NULL)) {
|
||||
return SOFTBUS_ERR;
|
||||
|
@ -704,7 +704,7 @@ static int32_t PrepareAppInfoForUdpOpen(const ConnectOption *connOpt, AppInfo *a
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransOpenUdpChannel(AppInfo *appInfo, const ConnectOption *connOpt, int32_t *channelId)
|
||||
NO_SANITIZE("cfi") int32_t TransOpenUdpChannel(AppInfo *appInfo, const ConnectOption *connOpt, int32_t *channelId)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "server trans open udp channel.");
|
||||
if (appInfo == NULL || connOpt == NULL || channelId == NULL) {
|
||||
@ -740,7 +740,7 @@ int32_t TransOpenUdpChannel(AppInfo *appInfo, const ConnectOption *connOpt, int3
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransCloseUdpChannel(int32_t channelId)
|
||||
NO_SANITIZE("cfi") int32_t TransCloseUdpChannel(int32_t channelId)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "server trans close udp channel.");
|
||||
UdpChannelInfo channel;
|
||||
@ -798,7 +798,7 @@ void TransUdpNodeOffLineProc(const LnnEventBasicInfo *info)
|
||||
TransCloseUdpChannelByNetWorkId(onlineStateInfo->networkId);
|
||||
}
|
||||
|
||||
int32_t TransUdpChannelInit(IServerChannelCallBack *callback)
|
||||
NO_SANITIZE("cfi") int32_t TransUdpChannelInit(IServerChannelCallBack *callback)
|
||||
{
|
||||
g_channelCb = callback;
|
||||
|
||||
@ -828,7 +828,7 @@ int32_t TransUdpChannelInit(IServerChannelCallBack *callback)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void TransUdpChannelDeinit(void)
|
||||
NO_SANITIZE("cfi") void TransUdpChannelDeinit(void)
|
||||
{
|
||||
TransUdpChannelMgrDeinit();
|
||||
UnregAuthTransListener(MODULE_UDP_INFO);
|
||||
@ -838,7 +838,7 @@ void TransUdpChannelDeinit(void)
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "server trans udp channel deinit success.");
|
||||
}
|
||||
|
||||
void TransUdpDeathCallback(const char *pkgName, int32_t pid)
|
||||
NO_SANITIZE("cfi") void TransUdpDeathCallback(const char *pkgName, int32_t pid)
|
||||
{
|
||||
if (GetUdpChannelLock() != SOFTBUS_OK) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "lock failed");
|
||||
|
@ -51,7 +51,7 @@ static inline CodeType getCodeType(const AppInfo *appInfo)
|
||||
CODE_FILE_TRANS_UDP : CODE_EXCHANGE_UDP_INFO;
|
||||
}
|
||||
|
||||
int32_t TransUnpackReplyErrInfo(const cJSON *msg, int32_t *errCode)
|
||||
NO_SANITIZE("cfi") int32_t TransUnpackReplyErrInfo(const cJSON *msg, int32_t *errCode)
|
||||
{
|
||||
if ((msg == NULL) && (errCode == NULL)) {
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_ERROR, "%s:invalid param.", __func__);
|
||||
@ -63,7 +63,7 @@ int32_t TransUnpackReplyErrInfo(const cJSON *msg, int32_t *errCode)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransUnpackReplyUdpInfo(const cJSON *msg, AppInfo *appInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransUnpackReplyUdpInfo(const cJSON *msg, AppInfo *appInfo)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "unpack reply udp info in negotiation.");
|
||||
if (msg == NULL || appInfo == NULL) {
|
||||
@ -97,7 +97,7 @@ int32_t TransUnpackReplyUdpInfo(const cJSON *msg, AppInfo *appInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransUnpackRequestUdpInfo(const cJSON *msg, AppInfo *appInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransUnpackRequestUdpInfo(const cJSON *msg, AppInfo *appInfo)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "unpack request udp info in negotiation.");
|
||||
if (msg == NULL || appInfo == NULL) {
|
||||
@ -148,7 +148,7 @@ int32_t TransUnpackRequestUdpInfo(const cJSON *msg, AppInfo *appInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransPackRequestUdpInfo(cJSON *msg, const AppInfo *appInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransPackRequestUdpInfo(cJSON *msg, const AppInfo *appInfo)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "pack request udp info in negotiation.");
|
||||
if (msg == NULL || appInfo == NULL) {
|
||||
@ -195,7 +195,7 @@ int32_t TransPackRequestUdpInfo(cJSON *msg, const AppInfo *appInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransPackReplyUdpInfo(cJSON *msg, const AppInfo *appInfo)
|
||||
NO_SANITIZE("cfi") int32_t TransPackReplyUdpInfo(cJSON *msg, const AppInfo *appInfo)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "pack reply udp info in negotiation.");
|
||||
if (msg == NULL || appInfo == NULL) {
|
||||
@ -225,7 +225,7 @@ int32_t TransPackReplyUdpInfo(cJSON *msg, const AppInfo *appInfo)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransPackReplyErrInfo(cJSON *msg, int errCode, const char* errDesc)
|
||||
NO_SANITIZE("cfi") int32_t TransPackReplyErrInfo(cJSON *msg, int errCode, const char* errDesc)
|
||||
{
|
||||
SoftBusLog(SOFTBUS_LOG_TRAN, SOFTBUS_LOG_INFO, "pack reply error info in negotiation.");
|
||||
if (msg == NULL || errDesc == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user