1 /*
2 * Copyright (c) 2024-2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "lnn_ohos_account_mock.h"
17 #include "softbus_error_code.h"
18
19 using namespace testing::ext;
20 using namespace testing;
21
22 namespace OHOS {
23 void *g_laneDepsInterface;
LnnOhosAccountInterfaceMock()24 LnnOhosAccountInterfaceMock::LnnOhosAccountInterfaceMock()
25 {
26 g_laneDepsInterface = reinterpret_cast<void *>(this);
27 }
28
~LnnOhosAccountInterfaceMock()29 LnnOhosAccountInterfaceMock::~LnnOhosAccountInterfaceMock()
30 {
31 g_laneDepsInterface = nullptr;
32 }
33
GetLnnOhosAccountInterface()34 static LnnOhosAccountInterface *GetLnnOhosAccountInterface()
35 {
36 return reinterpret_cast<LnnOhosAccountInterface *>(g_laneDepsInterface);
37 }
38
39 extern "C" {
SoftBusGenerateStrHash(const unsigned char * str,uint32_t len,unsigned char * hash)40 int32_t SoftBusGenerateStrHash(const unsigned char *str, uint32_t len, unsigned char *hash)
41 {
42 return GetLnnOhosAccountInterface()->SoftBusGenerateStrHash(str, len, hash);
43 }
44
GetOsAccountId(char * id,uint32_t idLen,uint32_t * len)45 int32_t GetOsAccountId(char *id, uint32_t idLen, uint32_t *len)
46 {
47 return GetLnnOhosAccountInterface()->GetOsAccountId(id, idLen, len);
48 }
49
LnnGetLocalByteInfo(InfoKey key,uint8_t * info,uint32_t len)50 int32_t LnnGetLocalByteInfo(InfoKey key, uint8_t *info, uint32_t len)
51 {
52 return GetLnnOhosAccountInterface()->LnnGetLocalByteInfo(key, info, len);
53 }
54
UpdateRecoveryDeviceInfoFromDb(void)55 int32_t UpdateRecoveryDeviceInfoFromDb(void)
56 {
57 return GetLnnOhosAccountInterface()->UpdateRecoveryDeviceInfoFromDb();
58 }
59
AddNumberToJsonObject(cJSON * json,const char * const string,int32_t num)60 bool AddNumberToJsonObject(cJSON *json, const char * const string, int32_t num)
61 {
62 return GetLnnOhosAccountInterface()->AddNumberToJsonObject(json, string, num);
63 }
64
AddStringToJsonObject(cJSON * json,const char * const string,const char * value)65 bool AddStringToJsonObject(cJSON *json, const char * const string, const char *value)
66 {
67 return GetLnnOhosAccountInterface()->AddStringToJsonObject(json, string, value);
68 }
69
IsEnableSoftBusHeartbeat(void)70 bool IsEnableSoftBusHeartbeat(void)
71 {
72 return GetLnnOhosAccountInterface()->IsEnableSoftBusHeartbeat();
73 }
74
LnnConvertAddrToOption(const ConnectionAddr * addr,ConnectOption * option)75 bool LnnConvertAddrToOption(const ConnectionAddr *addr, ConnectOption *option)
76 {
77 return GetLnnOhosAccountInterface()->LnnConvertAddrToOption(addr, option);
78 }
79
LnnConvertAuthConnInfoToAddr(ConnectionAddr * addr,const AuthConnInfo * connInfo,ConnectionAddrType hintType)80 bool LnnConvertAuthConnInfoToAddr(
81 ConnectionAddr *addr, const AuthConnInfo *connInfo, ConnectionAddrType hintType)
82 {
83 return GetLnnOhosAccountInterface()->LnnConvertAuthConnInfoToAddr(addr, connInfo, hintType);
84 }
85
LnnHasSupportDiscoveryType(const char * destType,const char * type)86 bool LnnHasSupportDiscoveryType(const char *destType, const char *type)
87 {
88 return GetLnnOhosAccountInterface()->LnnHasSupportDiscoveryType(destType, type);
89 }
90
LnnIsAutoNetWorkingEnabled(void)91 bool LnnIsAutoNetWorkingEnabled(void)
92 {
93 return GetLnnOhosAccountInterface()->LnnIsAutoNetWorkingEnabled();
94 }
95
LnnIsLinkReady(const char * iface)96 bool LnnIsLinkReady(const char *iface)
97 {
98 return GetLnnOhosAccountInterface()->LnnIsLinkReady(iface);
99 }
100
LnnIsSameConnectionAddr(const ConnectionAddr * addr1,const ConnectionAddr * addr2,bool isShort)101 bool LnnIsSameConnectionAddr(const ConnectionAddr *addr1, const ConnectionAddr *addr2, bool isShort)
102 {
103 return GetLnnOhosAccountInterface()->LnnIsSameConnectionAddr(addr1, addr2, isShort);
104 }
105
LnnPeerHasExchangeDiscoveryType(const NodeInfo * info,DiscoveryType type)106 bool LnnPeerHasExchangeDiscoveryType(const NodeInfo *info, DiscoveryType type)
107 {
108 return GetLnnOhosAccountInterface()->LnnPeerHasExchangeDiscoveryType(info, type);
109 }
110
LnnVisitHbTypeSet(VisitHbTypeCb callback,LnnHeartbeatType * typeSet,void * data)111 bool LnnVisitHbTypeSet(VisitHbTypeCb callback, LnnHeartbeatType *typeSet, void *data)
112 {
113 return GetLnnOhosAccountInterface()->LnnVisitHbTypeSet(callback, typeSet, data);
114 }
115
LnnVisitNetif(VisitNetifCallback callback,void * data)116 bool LnnVisitNetif(VisitNetifCallback callback, void *data)
117 {
118 return GetLnnOhosAccountInterface()->LnnVisitNetif(callback, data);
119 }
120
LnnVisitPhysicalSubnet(LnnVisitPhysicalSubnetCallback callback,void * data)121 bool LnnVisitPhysicalSubnet(LnnVisitPhysicalSubnetCallback callback, void *data)
122 {
123 return GetLnnOhosAccountInterface()->LnnVisitPhysicalSubnet(callback, data);
124 }
125
LnnDiscTypeToConnAddrType(DiscoveryType type)126 ConnectionAddrType LnnDiscTypeToConnAddrType(DiscoveryType type)
127 {
128 return GetLnnOhosAccountInterface()->LnnDiscTypeToConnAddrType(type);
129 }
130
LnnConvAddrTypeToDiscType(ConnectionAddrType type)131 DiscoveryType LnnConvAddrTypeToDiscType(ConnectionAddrType type)
132 {
133 return GetLnnOhosAccountInterface()->LnnConvAddrTypeToDiscType(type);
134 }
135
AuthGetConnInfo(AuthHandle authHandle,AuthConnInfo * connInfo)136 int32_t AuthGetConnInfo(AuthHandle authHandle, AuthConnInfo *connInfo)
137 {
138 return GetLnnOhosAccountInterface()->AuthGetConnInfo(authHandle, connInfo);
139 }
140
AuthGetDeviceUuid(int64_t authId,char * uuid,uint16_t size)141 int32_t AuthGetDeviceUuid(int64_t authId, char *uuid, uint16_t size)
142 {
143 return GetLnnOhosAccountInterface()->AuthGetDeviceUuid(authId, uuid, size);
144 }
145
AuthGetLatestAuthSeqList(const char * udid,int64_t * authSeq,uint32_t num)146 int32_t AuthGetLatestAuthSeqList(const char *udid, int64_t *authSeq, uint32_t num)
147 {
148 return GetLnnOhosAccountInterface()->AuthGetLatestAuthSeqList(udid, authSeq, num);
149 }
150
AuthMetaStartVerify(uint32_t connectionId,const AuthKeyInfo * authKeyInfo,uint32_t requestId,int32_t callingPid,const AuthVerifyCallback * callBack)151 int32_t AuthMetaStartVerify(uint32_t connectionId, const AuthKeyInfo *authKeyInfo, uint32_t requestId,
152 int32_t callingPid, const AuthVerifyCallback *callBack)
153 {
154 return GetLnnOhosAccountInterface()->AuthMetaStartVerify(
155 connectionId, authKeyInfo, requestId, callingPid, callBack);
156 }
157
AuthStartListening(AuthLinkType type,const char * ip,int32_t port)158 int32_t AuthStartListening(AuthLinkType type, const char *ip, int32_t port)
159 {
160 return GetLnnOhosAccountInterface()->AuthStartListening(type, ip, port);
161 }
162
CheckTableExist(DbContext * ctx,TableNameID id,bool * isExist)163 int32_t CheckTableExist(DbContext *ctx, TableNameID id, bool *isExist)
164 {
165 return GetLnnOhosAccountInterface()->CheckTableExist(ctx, id, isExist);
166 }
167
CloseDatabase(DbContext * ctx)168 int32_t CloseDatabase(DbContext *ctx)
169 {
170 return GetLnnOhosAccountInterface()->CloseDatabase(ctx);
171 }
172
ConnCoapStartServerListen(void)173 int32_t ConnCoapStartServerListen(void)
174 {
175 return GetLnnOhosAccountInterface()->ConnCoapStartServerListen();
176 }
177
ConnDisconnectDeviceAllConn(const ConnectOption * option)178 int32_t ConnDisconnectDeviceAllConn(const ConnectOption *option)
179 {
180 return GetLnnOhosAccountInterface()->ConnDisconnectDeviceAllConn(option);
181 }
182
ConnStartLocalListening(const LocalListenerInfo * info)183 int32_t ConnStartLocalListening(const LocalListenerInfo *info)
184 {
185 return GetLnnOhosAccountInterface()->ConnStartLocalListening(info);
186 }
187
ConnStopLocalListening(const LocalListenerInfo * info)188 int32_t ConnStopLocalListening(const LocalListenerInfo *info)
189 {
190 return GetLnnOhosAccountInterface()->ConnStopLocalListening(info);
191 }
192
ConvertBytesToHexString(char * outBuf,uint32_t outBufLen,const unsigned char * inBuf,uint32_t inLen)193 int32_t ConvertBytesToHexString(char *outBuf, uint32_t outBufLen, const unsigned char *inBuf, uint32_t inLen)
194 {
195 return GetLnnOhosAccountInterface()->ConvertBytesToHexString(outBuf, outBufLen, inBuf, inLen);
196 }
197
CreateTable(DbContext * ctx,TableNameID id)198 int32_t CreateTable(DbContext *ctx, TableNameID id)
199 {
200 return GetLnnOhosAccountInterface()->CreateTable(ctx, id);
201 }
202
EncryptedDb(DbContext * ctx,const uint8_t * password,uint32_t len)203 int32_t EncryptedDb(DbContext *ctx, const uint8_t *password, uint32_t len)
204 {
205 return GetLnnOhosAccountInterface()->EncryptedDb(ctx, password, len);
206 }
207
GetNetworkIpByIfName(const char * ifName,char * ip,char * netmask,uint32_t len)208 int32_t GetNetworkIpByIfName(const char *ifName, char *ip, char *netmask, uint32_t len)
209 {
210 return GetLnnOhosAccountInterface()->GetNetworkIpByIfName(ifName, ip, netmask, len);
211 }
212
GetRecordNumByKey(DbContext * ctx,TableNameID id,uint8_t * data)213 int32_t GetRecordNumByKey(DbContext *ctx, TableNameID id, uint8_t *data)
214 {
215 return GetLnnOhosAccountInterface()->GetRecordNumByKey(ctx, id, data);
216 }
217
LnnAsyncCallbackDelayHelper(SoftBusLooper * looper,LnnAsyncCallbackFunc callback,void * para,uint64_t delayMillis)218 int32_t LnnAsyncCallbackDelayHelper(SoftBusLooper *looper, LnnAsyncCallbackFunc callback, void *para,
219 uint64_t delayMillis)
220 {
221 return GetLnnOhosAccountInterface()->LnnAsyncCallbackDelayHelper(looper, callback, para, delayMillis);
222 }
223
LnnAsyncCallbackHelper(SoftBusLooper * looper,LnnAsyncCallbackFunc callback,void * para)224 int32_t LnnAsyncCallbackHelper(SoftBusLooper *looper, LnnAsyncCallbackFunc callback, void *para)
225 {
226 return GetLnnOhosAccountInterface()->LnnAsyncCallbackHelper(looper, callback, para);
227 }
228
LnnCeDecryptDataByHuks(const struct HksBlob * keyAlias,const struct HksBlob * inData,struct HksBlob * outData)229 int32_t LnnCeDecryptDataByHuks(
230 const struct HksBlob *keyAlias, const struct HksBlob *inData, struct HksBlob *outData)
231 {
232 return GetLnnOhosAccountInterface()->LnnCeDecryptDataByHuks(keyAlias, inData, outData);
233 }
234
LnnCeEncryptDataByHuks(const struct HksBlob * keyAlias,const struct HksBlob * inData,struct HksBlob * outData)235 int32_t LnnCeEncryptDataByHuks(
236 const struct HksBlob *keyAlias, const struct HksBlob *inData, struct HksBlob *outData)
237 {
238 return GetLnnOhosAccountInterface()->LnnCeEncryptDataByHuks(keyAlias, inData, outData);
239 }
240
LnnCompareNodeWeight(int32_t weight1,const char * masterUdid1,int32_t weight2,const char * masterUdid2)241 int32_t LnnCompareNodeWeight(int32_t weight1, const char *masterUdid1, int32_t weight2, const char *masterUdid2)
242 {
243 return GetLnnOhosAccountInterface()->LnnCompareNodeWeight(weight1, masterUdid1, weight2, masterUdid2);
244 }
245
LnnConvertHbTypeToId(LnnHeartbeatType type)246 int32_t LnnConvertHbTypeToId(LnnHeartbeatType type)
247 {
248 return GetLnnOhosAccountInterface()->LnnConvertHbTypeToId(type);
249 }
250
LnnDecryptDataByHuks(const struct HksBlob * keyAlias,const struct HksBlob * inData,struct HksBlob * outData)251 int32_t LnnDecryptDataByHuks(const struct HksBlob *keyAlias, const struct HksBlob *inData, struct HksBlob *outData)
252 {
253 return GetLnnOhosAccountInterface()->LnnDecryptDataByHuks(keyAlias, inData, outData);
254 }
255
LnnDeleteKeyByHuks(struct HksBlob * keyAlias)256 int32_t LnnDeleteKeyByHuks(struct HksBlob *keyAlias)
257 {
258 return GetLnnOhosAccountInterface()->LnnDeleteKeyByHuks(keyAlias);
259 }
260
LnnEncryptDataByHuks(const struct HksBlob * keyAlias,const struct HksBlob * inData,struct HksBlob * outData)261 int32_t LnnEncryptDataByHuks(const struct HksBlob *keyAlias, const struct HksBlob *inData, struct HksBlob *outData)
262 {
263 return GetLnnOhosAccountInterface()->LnnEncryptDataByHuks(keyAlias, inData, outData);
264 }
265
LnnGenerateKeyByHuks(struct HksBlob * keyAlias)266 int32_t LnnGenerateKeyByHuks(struct HksBlob *keyAlias)
267 {
268 return GetLnnOhosAccountInterface()->LnnGenerateKeyByHuks(keyAlias);
269 }
270
LnnGenerateRandomByHuks(uint8_t * randomKey,uint32_t len)271 int32_t LnnGenerateRandomByHuks(uint8_t *randomKey, uint32_t len)
272 {
273 return GetLnnOhosAccountInterface()->LnnGenerateRandomByHuks(randomKey, len);
274 }
275
LnnGenLocalIrk(unsigned char * irk,uint32_t len)276 int32_t LnnGenLocalIrk(unsigned char *irk, uint32_t len)
277 {
278 return GetLnnOhosAccountInterface()->LnnGenLocalIrk(irk, len);
279 }
280
LnnGenLocalNetworkId(char * networkId,uint32_t len)281 int32_t LnnGenLocalNetworkId(char *networkId, uint32_t len)
282 {
283 return GetLnnOhosAccountInterface()->LnnGenLocalNetworkId(networkId, len);
284 }
285
LnnGenLocalUuid(char * uuid,uint32_t len)286 int32_t LnnGenLocalUuid(char *uuid, uint32_t len)
287 {
288 return GetLnnOhosAccountInterface()->LnnGenLocalUuid(uuid, len);
289 }
290
LnnGetAddrTypeByIfName(const char * ifName,ConnectionAddrType * type)291 int32_t LnnGetAddrTypeByIfName(const char *ifName, ConnectionAddrType *type)
292 {
293 return GetLnnOhosAccountInterface()->LnnGetAddrTypeByIfName(ifName, type);
294 }
295
LnnGetFullStoragePath(LnnFileId id,char * path,uint32_t len)296 int32_t LnnGetFullStoragePath(LnnFileId id, char *path, uint32_t len)
297 {
298 return GetLnnOhosAccountInterface()->LnnGetFullStoragePath(id, path, len);
299 }
300
LnnGetWlanIpv4Addr(char * ip,uint32_t size)301 int32_t LnnGetWlanIpv4Addr(char *ip, uint32_t size)
302 {
303 return GetLnnOhosAccountInterface()->GetWlanIpv4Addr(ip, size);
304 }
305
LnnInitDevicename(void)306 int32_t LnnInitDevicename(void)
307 {
308 return GetLnnOhosAccountInterface()->LnnInitDevicename();
309 }
310
LnnInitNetworkInfo(void)311 int32_t LnnInitNetworkInfo(void)
312 {
313 return GetLnnOhosAccountInterface()->LnnInitNetworkInfo();
314 }
315
LnnInitP2p(void)316 int32_t LnnInitP2p(void)
317 {
318 return GetLnnOhosAccountInterface()->LnnInitP2p();
319 }
320
LnnInitPhysicalSubnetManager(void)321 int32_t LnnInitPhysicalSubnetManager(void)
322 {
323 return GetLnnOhosAccountInterface()->LnnInitPhysicalSubnetManager();
324 }
325
LnnInitSyncInfoManager(void)326 int32_t LnnInitSyncInfoManager(void)
327 {
328 return GetLnnOhosAccountInterface()->LnnInitSyncInfoManager();
329 }
330
LnnInitTopoManager(void)331 int32_t LnnInitTopoManager(void)
332 {
333 return GetLnnOhosAccountInterface()->LnnInitTopoManager();
334 }
335
LnnInitWifiDirect(void)336 int32_t LnnInitWifiDirect(void)
337 {
338 return GetLnnOhosAccountInterface()->LnnInitWifiDirect();
339 }
340
LnnNotifyDiscoveryDevice(const ConnectionAddr * addr,const LnnDfxDeviceInfoReport * infoReport,bool isNeedConnect)341 int32_t LnnNotifyDiscoveryDevice(const ConnectionAddr *addr, const LnnDfxDeviceInfoReport *infoReport,
342 bool isNeedConnect)
343 {
344 return GetLnnOhosAccountInterface()->LnnNotifyDiscoveryDevice(addr, infoReport, isNeedConnect);
345 }
346
LnnRegistPhysicalSubnet(LnnPhysicalSubnet * manager)347 int32_t LnnRegistPhysicalSubnet(LnnPhysicalSubnet *manager)
348 {
349 return GetLnnOhosAccountInterface()->LnnRegistPhysicalSubnet(manager);
350 }
351
lnnRegistProtocol(LnnProtocolManager * protocolMgr)352 int32_t lnnRegistProtocol(LnnProtocolManager *protocolMgr)
353 {
354 return GetLnnOhosAccountInterface()->LnnRegistProtocol(protocolMgr);
355 }
356
LnnRequestLeaveByAddrType(const bool * type,uint32_t typeLen)357 int32_t LnnRequestLeaveByAddrType(const bool *type, uint32_t typeLen)
358 {
359 return GetLnnOhosAccountInterface()->LnnRequestLeaveByAddrType(type, typeLen);
360 }
361
LnnSendNotTrustedInfo(const NotTrustedDelayInfo * info,uint32_t num,LnnSyncInfoMsgComplete complete)362 int32_t LnnSendNotTrustedInfo(const NotTrustedDelayInfo *info, uint32_t num, LnnSyncInfoMsgComplete complete)
363 {
364 return GetLnnOhosAccountInterface()->LnnSendNotTrustedInfo(info, num, complete);
365 }
366
LnnSendSyncInfoMsg(LnnSyncInfoType type,const char * networkId,const uint8_t * msg,uint32_t len,LnnSyncInfoMsgComplete complete)367 int32_t LnnSendSyncInfoMsg(LnnSyncInfoType type, const char *networkId, const uint8_t *msg, uint32_t len,
368 LnnSyncInfoMsgComplete complete)
369 {
370 return GetLnnOhosAccountInterface()->LnnSendSyncInfoMsg(type, networkId, msg, len, complete);
371 }
372
LnnSetSupportDiscoveryType(char * info,const char * type)373 int32_t LnnSetSupportDiscoveryType(char *info, const char *type)
374 {
375 return GetLnnOhosAccountInterface()->LnnSetSupportDiscoveryType(info, type);
376 }
377
LnnStartDiscovery(void)378 int32_t LnnStartDiscovery(void)
379 {
380 return GetLnnOhosAccountInterface()->LnnStartDiscovery();
381 }
382
LnnStartPublish(void)383 int32_t LnnStartPublish(void)
384 {
385 return GetLnnOhosAccountInterface()->LnnStartPublish();
386 }
387
OpenDatabase(DbContext ** ctx)388 int32_t OpenDatabase(DbContext **ctx)
389 {
390 return GetLnnOhosAccountInterface()->OpenDatabase(ctx);
391 }
392
QueryRecordByKey(DbContext * ctx,TableNameID id,uint8_t * data,uint8_t ** replyInfo,int32_t infoNum)393 int32_t QueryRecordByKey(DbContext *ctx, TableNameID id, uint8_t *data, uint8_t **replyInfo, int32_t infoNum)
394 {
395 return GetLnnOhosAccountInterface()->QueryRecordByKey(ctx, id, data, replyInfo, infoNum);
396 }
397
RegistIPProtocolManager(void)398 int32_t RegistIPProtocolManager(void)
399 {
400 return GetLnnOhosAccountInterface()->RegistIPProtocolManager();
401 }
402
RemoveRecordByKey(DbContext * ctx,TableNameID id,uint8_t * data)403 int32_t RemoveRecordByKey(DbContext *ctx, TableNameID id, uint8_t *data)
404 {
405 return GetLnnOhosAccountInterface()->RemoveRecordByKey(ctx, id, data);
406 }
407
SoftBusAccessFile(const char * pathName,int32_t mode)408 int32_t SoftBusAccessFile(const char *pathName, int32_t mode)
409 {
410 return GetLnnOhosAccountInterface()->SoftBusAccessFile(pathName, mode);
411 }
412
SoftbusGetConfig(ConfigType type,unsigned char * val,uint32_t len)413 int32_t SoftbusGetConfig(ConfigType type, unsigned char *val, uint32_t len)
414 {
415 return GetLnnOhosAccountInterface()->SoftbusGetConfig(type, val, len);
416 }
417
SoftBusGetTime(SoftBusSysTime * sysTime)418 int32_t SoftBusGetTime(SoftBusSysTime *sysTime)
419 {
420 return GetLnnOhosAccountInterface()->SoftBusGetTime(sysTime);
421 }
422
SoftBusReadFullFile(const char * fileName,char * readBuf,uint32_t maxLen)423 int32_t SoftBusReadFullFile(const char *fileName, char *readBuf, uint32_t maxLen)
424 {
425 return GetLnnOhosAccountInterface()->SoftBusReadFullFile(fileName, readBuf, maxLen);
426 }
427
SoftBusWriteFile(const char * fileName,const char * writeBuf,uint32_t len)428 int32_t SoftBusWriteFile(const char *fileName, const char *writeBuf, uint32_t len)
429 {
430 return GetLnnOhosAccountInterface()->SoftBusWriteFile(fileName, writeBuf, len);
431 }
432
TransGetConnByChanId(int32_t channelId,int32_t channelType,int32_t * connId)433 int32_t TransGetConnByChanId(int32_t channelId, int32_t channelType, int32_t *connId)
434 {
435 return GetLnnOhosAccountInterface()->TransGetConnByChanId(channelId, channelType, connId);
436 }
437
TransTdcStartSessionListener(ListenerModule module,const LocalListenerInfo * info)438 int32_t TransTdcStartSessionListener(ListenerModule module, const LocalListenerInfo *info)
439 {
440 return GetLnnOhosAccountInterface()->TransTdcStartSessionListener(module, info);
441 }
442
TransTdcStopSessionListener(ListenerModule module)443 int32_t TransTdcStopSessionListener(ListenerModule module)
444 {
445 return GetLnnOhosAccountInterface()->TransTdcStopSessionListener(module);
446 }
447
UpdateDbPassword(DbContext * ctx,const uint8_t * password,uint32_t len)448 int32_t UpdateDbPassword(DbContext *ctx, const uint8_t *password, uint32_t len)
449 {
450 return GetLnnOhosAccountInterface()->UpdateDbPassword(ctx, password, len);
451 }
452
GetLooper(int32_t looper)453 SoftBusLooper *GetLooper(int32_t looper)
454 {
455 return GetLnnOhosAccountInterface()->GetLooper(looper);
456 }
457
AuthHasTrustedRelation(void)458 TrustedReturnType AuthHasTrustedRelation(void)
459 {
460 return GetLnnOhosAccountInterface()->AuthHasTrustedRelation();
461 }
462
AuthGenRequestId(void)463 uint32_t AuthGenRequestId(void)
464 {
465 return GetLnnOhosAccountInterface()->AuthGenRequestId();
466 }
467
AuthHandleLeaveLNN(AuthHandle authHandle)468 void AuthHandleLeaveLNN(AuthHandle authHandle)
469 {
470 GetLnnOhosAccountInterface()->AuthHandleLeaveLNN(authHandle);
471 }
472
AuthStopListening(AuthLinkType type)473 void AuthStopListening(AuthLinkType type)
474 {
475 GetLnnOhosAccountInterface()->AuthStopListening(type);
476 }
477
ConnCoapStopServerListen(void)478 void ConnCoapStopServerListen(void)
479 {
480 GetLnnOhosAccountInterface()->ConnCoapStopServerListen();
481 }
482
DfxRecordTriggerTime(LnnTriggerReason reason,LnnEventLnnStage stage)483 void DfxRecordTriggerTime(LnnTriggerReason reason, LnnEventLnnStage stage)
484 {
485 GetLnnOhosAccountInterface()->DfxRecordTriggerTime(reason, stage);
486 }
487
DiscLinkStatusChanged(LinkStatus status,ExchangeMedium medium,int32_t ifnameIdx)488 void DiscLinkStatusChanged(LinkStatus status, ExchangeMedium medium, int32_t ifnameIdx)
489 {
490 GetLnnOhosAccountInterface()->DiscLinkStatusChanged(status, medium, ifnameIdx);
491 }
492
LnnDeinitP2p(void)493 void LnnDeinitP2p(void)
494 {
495 GetLnnOhosAccountInterface()->LnnDeinitP2p();
496 }
497
LnnDeinitPhysicalSubnetManager(void)498 void LnnDeinitPhysicalSubnetManager(void)
499 {
500 GetLnnOhosAccountInterface()->LnnDeinitPhysicalSubnetManager();
501 }
502
LnnDeinitSyncInfoManager(void)503 void LnnDeinitSyncInfoManager(void)
504 {
505 GetLnnOhosAccountInterface()->LnnDeinitSyncInfoManager();
506 }
507
LnnDeinitTopoManager(void)508 void LnnDeinitTopoManager(void)
509 {
510 GetLnnOhosAccountInterface()->LnnDeinitTopoManager();
511 }
512
LnnDeinitWifiDirect(void)513 void LnnDeinitWifiDirect(void)
514 {
515 GetLnnOhosAccountInterface()->LnnDeinitWifiDirect();
516 }
517
LnnHbClearRecvList(void)518 void LnnHbClearRecvList(void)
519 {
520 GetLnnOhosAccountInterface()->LnnHbClearRecvList();
521 }
522
LnnIpAddrChangeEventHandler(void)523 void LnnIpAddrChangeEventHandler(void)
524 {
525 GetLnnOhosAccountInterface()->LnnIpAddrChangeEventHandler();
526 }
527
LnnNotifyAccountStateChangeEvent(SoftBusAccountState state)528 void LnnNotifyAccountStateChangeEvent(SoftBusAccountState state)
529 {
530 GetLnnOhosAccountInterface()->LnnNotifyAccountStateChangeEvent(state);
531 }
532
LnnNotifyAllTypeOffline(ConnectionAddrType type)533 void LnnNotifyAllTypeOffline(ConnectionAddrType type)
534 {
535 GetLnnOhosAccountInterface()->LnnNotifyAllTypeOffline(type);
536 }
537
LnnNotifyHBRepeat(void)538 void LnnNotifyHBRepeat(void)
539 {
540 GetLnnOhosAccountInterface()->LnnNotifyHBRepeat();
541 }
542
LnnNotifyLeaveResult(const char * networkId,int32_t retCode)543 void LnnNotifyLeaveResult(const char *networkId, int32_t retCode)
544 {
545 GetLnnOhosAccountInterface()->LnnNotifyLeaveResult(networkId, retCode);
546 }
547
LnnNotifyNetworkStateChanged(SoftBusNetworkState state)548 void LnnNotifyNetworkStateChanged(SoftBusNetworkState state)
549 {
550 GetLnnOhosAccountInterface()->LnnNotifyNetworkStateChanged(state);
551 }
552
LnnNotifyOOBEStateChangeEvent(SoftBusOOBEState state)553 void LnnNotifyOOBEStateChangeEvent(SoftBusOOBEState state)
554 {
555 GetLnnOhosAccountInterface()->LnnNotifyOOBEStateChangeEvent(state);
556 }
557
LnnNotifyPhysicalSubnetStatusChanged(const char * ifName,ProtocolType protocolType,void * status)558 void LnnNotifyPhysicalSubnetStatusChanged(const char *ifName, ProtocolType protocolType, void *status)
559 {
560 GetLnnOhosAccountInterface()->LnnNotifyPhysicalSubnetStatusChanged(ifName, protocolType, status);
561 }
562
LnnOnOhosAccountChanged(void)563 void LnnOnOhosAccountChanged(void)
564 {
565 GetLnnOhosAccountInterface()->LnnOnOhosAccountChanged();
566 }
567
LnnOnOhosAccountLogout(void)568 void LnnOnOhosAccountLogout(void)
569 {
570 GetLnnOhosAccountInterface()->LnnOnOhosAccountLogout();
571 }
572
LnnSetUnlockState(void)573 void LnnSetUnlockState(void)
574 {
575 GetLnnOhosAccountInterface()->LnnSetUnlockState();
576 }
577
LnnStopDiscovery(void)578 void LnnStopDiscovery(void)
579 {
580 GetLnnOhosAccountInterface()->LnnStopDiscovery();
581 }
582
LnnStopPublish(void)583 void LnnStopPublish(void)
584 {
585 GetLnnOhosAccountInterface()->LnnStopPublish();
586 }
587
LnnUnregisterEventHandler(LnnEventType event,LnnEventHandler handler)588 void LnnUnregisterEventHandler(LnnEventType event, LnnEventHandler handler)
589 {
590 GetLnnOhosAccountInterface()->LnnUnregisterEventHandler(event, handler);
591 }
592
LnnUpdateOhosAccount(UpdateAccountReason reason)593 void LnnUpdateOhosAccount(UpdateAccountReason reason)
594 {
595 GetLnnOhosAccountInterface()->LnnUpdateOhosAccount(reason);
596 }
597
GetOsAccountIdByUserId(int32_t userId,char ** id,uint32_t * len)598 int32_t GetOsAccountIdByUserId(int32_t userId, char **id, uint32_t *len)
599 {
600 return GetLnnOhosAccountInterface()->GetOsAccountIdByUserId(userId, id, len);
601 }
602 }
603 } // namespace OHOS