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(ConnectionAddr *addr, const AuthConnInfo *connInfo, ConnectionAddrType hintType)
81 {
82 return GetLnnOhosAccountInterface()->LnnConvertAuthConnInfoToAddr(addr, connInfo, hintType);
83 }
84
LnnHasSupportDiscoveryType(const char * destType,const char * type)85 bool LnnHasSupportDiscoveryType(const char *destType, const char *type)
86 {
87 return GetLnnOhosAccountInterface()->LnnHasSupportDiscoveryType(destType, type);
88 }
89
LnnIsAutoNetWorkingEnabled(void)90 bool LnnIsAutoNetWorkingEnabled(void)
91 {
92 return GetLnnOhosAccountInterface()->LnnIsAutoNetWorkingEnabled();
93 }
94
LnnIsLinkReady(const char * iface)95 bool LnnIsLinkReady(const char *iface)
96 {
97 return GetLnnOhosAccountInterface()->LnnIsLinkReady(iface);
98 }
99
LnnIsSameConnectionAddr(const ConnectionAddr * addr1,const ConnectionAddr * addr2,bool isShort)100 bool LnnIsSameConnectionAddr(const ConnectionAddr *addr1, const ConnectionAddr *addr2, bool isShort)
101 {
102 return GetLnnOhosAccountInterface()->LnnIsSameConnectionAddr(addr1, addr2, isShort);
103 }
104
LnnPeerHasExchangeDiscoveryType(const NodeInfo * info,DiscoveryType type)105 bool LnnPeerHasExchangeDiscoveryType(const NodeInfo *info, DiscoveryType type)
106 {
107 return GetLnnOhosAccountInterface()->LnnPeerHasExchangeDiscoveryType(info, type);
108 }
109
LnnVisitHbTypeSet(VisitHbTypeCb callback,LnnHeartbeatType * typeSet,void * data)110 bool LnnVisitHbTypeSet(VisitHbTypeCb callback, LnnHeartbeatType *typeSet, void *data)
111 {
112 return GetLnnOhosAccountInterface()->LnnVisitHbTypeSet(callback, typeSet, data);
113 }
114
LnnVisitNetif(VisitNetifCallback callback,void * data)115 bool LnnVisitNetif(VisitNetifCallback callback, void *data)
116 {
117 return GetLnnOhosAccountInterface()->LnnVisitNetif(callback, data);
118 }
119
LnnVisitPhysicalSubnet(LnnVisitPhysicalSubnetCallback callback,void * data)120 bool LnnVisitPhysicalSubnet(LnnVisitPhysicalSubnetCallback callback, void *data)
121 {
122 return GetLnnOhosAccountInterface()->LnnVisitPhysicalSubnet(callback, data);
123 }
124
LnnDiscTypeToConnAddrType(DiscoveryType type)125 ConnectionAddrType LnnDiscTypeToConnAddrType(DiscoveryType type)
126 {
127 return GetLnnOhosAccountInterface()->LnnDiscTypeToConnAddrType(type);
128 }
129
LnnConvAddrTypeToDiscType(ConnectionAddrType type)130 DiscoveryType LnnConvAddrTypeToDiscType(ConnectionAddrType type)
131 {
132 return GetLnnOhosAccountInterface()->LnnConvAddrTypeToDiscType(type);
133 }
134
AuthGetConnInfo(AuthHandle authHandle,AuthConnInfo * connInfo)135 int32_t AuthGetConnInfo(AuthHandle authHandle, AuthConnInfo *connInfo)
136 {
137 return GetLnnOhosAccountInterface()->AuthGetConnInfo(authHandle, connInfo);
138 }
139
AuthGetDeviceUuid(int64_t authId,char * uuid,uint16_t size)140 int32_t AuthGetDeviceUuid(int64_t authId, char *uuid, uint16_t size)
141 {
142 return GetLnnOhosAccountInterface()->AuthGetDeviceUuid(authId, uuid, size);
143 }
144
AuthGetLatestAuthSeqList(const char * udid,int64_t * authSeq,uint32_t num)145 int32_t AuthGetLatestAuthSeqList(const char *udid, int64_t *authSeq, uint32_t num)
146 {
147 return GetLnnOhosAccountInterface()->AuthGetLatestAuthSeqList(udid, authSeq, num);
148 }
149
AuthMetaStartVerify(uint32_t connectionId,const AuthKeyInfo * authKeyInfo,uint32_t requestId,int32_t callingPid,const AuthVerifyCallback * callBack)150 int32_t AuthMetaStartVerify(uint32_t connectionId, const AuthKeyInfo *authKeyInfo, uint32_t requestId,
151 int32_t callingPid, const AuthVerifyCallback *callBack)
152 {
153 return GetLnnOhosAccountInterface()->AuthMetaStartVerify(connectionId, authKeyInfo, requestId, callingPid,
154 callBack);
155 }
156
AuthStartListening(AuthLinkType type,const char * ip,int32_t port)157 int32_t AuthStartListening(AuthLinkType type, const char *ip, int32_t port)
158 {
159 return GetLnnOhosAccountInterface()->AuthStartListening(type, ip, port);
160 }
161
CheckTableExist(DbContext * ctx,TableNameID id,bool * isExist)162 int32_t CheckTableExist(DbContext *ctx, TableNameID id, bool *isExist)
163 {
164 return GetLnnOhosAccountInterface()->CheckTableExist(ctx, id, isExist);
165 }
166
CloseDatabase(DbContext * ctx)167 int32_t CloseDatabase(DbContext *ctx)
168 {
169 return GetLnnOhosAccountInterface()->CloseDatabase(ctx);
170 }
171
ConnCoapStartServerListen(void)172 int32_t ConnCoapStartServerListen(void)
173 {
174 return GetLnnOhosAccountInterface()->ConnCoapStartServerListen();
175 }
176
ConnDisconnectDeviceAllConn(const ConnectOption * option)177 int32_t ConnDisconnectDeviceAllConn(const ConnectOption *option)
178 {
179 return GetLnnOhosAccountInterface()->ConnDisconnectDeviceAllConn(option);
180 }
181
ConnStartLocalListening(const LocalListenerInfo * info)182 int32_t ConnStartLocalListening(const LocalListenerInfo *info)
183 {
184 return GetLnnOhosAccountInterface()->ConnStartLocalListening(info);
185 }
186
ConnStopLocalListening(const LocalListenerInfo * info)187 int32_t ConnStopLocalListening(const LocalListenerInfo *info)
188 {
189 return GetLnnOhosAccountInterface()->ConnStopLocalListening(info);
190 }
191
ConvertBytesToHexString(char * outBuf,uint32_t outBufLen,const unsigned char * inBuf,uint32_t inLen)192 int32_t ConvertBytesToHexString(char *outBuf, uint32_t outBufLen, const unsigned char *inBuf, uint32_t inLen)
193 {
194 return GetLnnOhosAccountInterface()->ConvertBytesToHexString(outBuf, outBufLen, inBuf, inLen);
195 }
196
CreateTable(DbContext * ctx,TableNameID id)197 int32_t CreateTable(DbContext *ctx, TableNameID id)
198 {
199 return GetLnnOhosAccountInterface()->CreateTable(ctx, id);
200 }
201
EncryptedDb(DbContext * ctx,const uint8_t * password,uint32_t len)202 int32_t EncryptedDb(DbContext *ctx, const uint8_t *password, uint32_t len)
203 {
204 return GetLnnOhosAccountInterface()->EncryptedDb(ctx, password, len);
205 }
206
GetNetworkIpByIfName(const char * ifName,char * ip,char * netmask,uint32_t len)207 int32_t GetNetworkIpByIfName(const char *ifName, char *ip, char *netmask, uint32_t len)
208 {
209 return GetLnnOhosAccountInterface()->GetNetworkIpByIfName(ifName, ip, netmask, len);
210 }
211
GetRecordNumByKey(DbContext * ctx,TableNameID id,uint8_t * data)212 int32_t GetRecordNumByKey(DbContext *ctx, TableNameID id, uint8_t *data)
213 {
214 return GetLnnOhosAccountInterface()->GetRecordNumByKey(ctx, id, data);
215 }
216
LnnAsyncCallbackDelayHelper(SoftBusLooper * looper,LnnAsyncCallbackFunc callback,void * para,uint64_t delayMillis)217 int32_t LnnAsyncCallbackDelayHelper(SoftBusLooper *looper, LnnAsyncCallbackFunc callback, void *para,
218 uint64_t delayMillis)
219 {
220 return GetLnnOhosAccountInterface()->LnnAsyncCallbackDelayHelper(looper, callback, para, delayMillis);
221 }
222
LnnAsyncCallbackHelper(SoftBusLooper * looper,LnnAsyncCallbackFunc callback,void * para)223 int32_t LnnAsyncCallbackHelper(SoftBusLooper *looper, LnnAsyncCallbackFunc callback, void *para)
224 {
225 return GetLnnOhosAccountInterface()->LnnAsyncCallbackHelper(looper, callback, para);
226 }
227
LnnCeDecryptDataByHuks(const struct HksBlob * keyAlias,const struct HksBlob * inData,struct HksBlob * outData)228 int32_t LnnCeDecryptDataByHuks(const struct HksBlob *keyAlias, const struct HksBlob *inData, struct HksBlob *outData)
229 {
230 return GetLnnOhosAccountInterface()->LnnCeDecryptDataByHuks(keyAlias, inData, outData);
231 }
232
LnnCeEncryptDataByHuks(const struct HksBlob * keyAlias,const struct HksBlob * inData,struct HksBlob * outData)233 int32_t LnnCeEncryptDataByHuks(const struct HksBlob *keyAlias, const struct HksBlob *inData, struct HksBlob *outData)
234 {
235 return GetLnnOhosAccountInterface()->LnnCeEncryptDataByHuks(keyAlias, inData, outData);
236 }
237
LnnCompareNodeWeight(int32_t weight1,const char * masterUdid1,int32_t weight2,const char * masterUdid2)238 int32_t LnnCompareNodeWeight(int32_t weight1, const char *masterUdid1, int32_t weight2, const char *masterUdid2)
239 {
240 return GetLnnOhosAccountInterface()->LnnCompareNodeWeight(weight1, masterUdid1, weight2, masterUdid2);
241 }
242
LnnConvertHbTypeToId(LnnHeartbeatType type)243 int32_t LnnConvertHbTypeToId(LnnHeartbeatType type)
244 {
245 return GetLnnOhosAccountInterface()->LnnConvertHbTypeToId(type);
246 }
247
LnnDecryptDataByHuks(const struct HksBlob * keyAlias,const struct HksBlob * inData,struct HksBlob * outData)248 int32_t LnnDecryptDataByHuks(const struct HksBlob *keyAlias, const struct HksBlob *inData, struct HksBlob *outData)
249 {
250 return GetLnnOhosAccountInterface()->LnnDecryptDataByHuks(keyAlias, inData, outData);
251 }
252
LnnDeleteKeyByHuks(struct HksBlob * keyAlias)253 int32_t LnnDeleteKeyByHuks(struct HksBlob *keyAlias)
254 {
255 return GetLnnOhosAccountInterface()->LnnDeleteKeyByHuks(keyAlias);
256 }
257
LnnEncryptDataByHuks(const struct HksBlob * keyAlias,const struct HksBlob * inData,struct HksBlob * outData)258 int32_t LnnEncryptDataByHuks(const struct HksBlob *keyAlias, const struct HksBlob *inData, struct HksBlob *outData)
259 {
260 return GetLnnOhosAccountInterface()->LnnEncryptDataByHuks(keyAlias, inData, outData);
261 }
262
LnnGenerateKeyByHuks(struct HksBlob * keyAlias)263 int32_t LnnGenerateKeyByHuks(struct HksBlob *keyAlias)
264 {
265 return GetLnnOhosAccountInterface()->LnnGenerateKeyByHuks(keyAlias);
266 }
267
LnnGenerateRandomByHuks(uint8_t * randomKey,uint32_t len)268 int32_t LnnGenerateRandomByHuks(uint8_t *randomKey, uint32_t len)
269 {
270 return GetLnnOhosAccountInterface()->LnnGenerateRandomByHuks(randomKey, len);
271 }
272
LnnGenLocalIrk(unsigned char * irk,uint32_t len)273 int32_t LnnGenLocalIrk(unsigned char *irk, uint32_t len)
274 {
275 return GetLnnOhosAccountInterface()->LnnGenLocalIrk(irk, len);
276 }
277
LnnGenLocalNetworkId(char * networkId,uint32_t len)278 int32_t LnnGenLocalNetworkId(char *networkId, uint32_t len)
279 {
280 return GetLnnOhosAccountInterface()->LnnGenLocalNetworkId(networkId, len);
281 }
282
LnnGenLocalUuid(char * uuid,uint32_t len)283 int32_t LnnGenLocalUuid(char *uuid, uint32_t len)
284 {
285 return GetLnnOhosAccountInterface()->LnnGenLocalUuid(uuid, len);
286 }
287
LnnGetAddrTypeByIfName(const char * ifName,ConnectionAddrType * type)288 int32_t LnnGetAddrTypeByIfName(const char *ifName, ConnectionAddrType *type)
289 {
290 return GetLnnOhosAccountInterface()->LnnGetAddrTypeByIfName(ifName, type);
291 }
292
LnnGetFullStoragePath(LnnFileId id,char * path,uint32_t len)293 int32_t LnnGetFullStoragePath(LnnFileId id, char *path, uint32_t len)
294 {
295 return GetLnnOhosAccountInterface()->LnnGetFullStoragePath(id, path, len);
296 }
297
LnnGetWlanIpv4Addr(char * ip,uint32_t size)298 int32_t LnnGetWlanIpv4Addr(char *ip, uint32_t size)
299 {
300 return GetLnnOhosAccountInterface()->GetWlanIpv4Addr(ip, size);
301 }
302
LnnInitDevicename(void)303 int32_t LnnInitDevicename(void)
304 {
305 return GetLnnOhosAccountInterface()->LnnInitDevicename();
306 }
307
LnnInitNetworkInfo(void)308 int32_t LnnInitNetworkInfo(void)
309 {
310 return GetLnnOhosAccountInterface()->LnnInitNetworkInfo();
311 }
312
LnnInitP2p(void)313 int32_t LnnInitP2p(void)
314 {
315 return GetLnnOhosAccountInterface()->LnnInitP2p();
316 }
317
LnnInitPhysicalSubnetManager(void)318 int32_t LnnInitPhysicalSubnetManager(void)
319 {
320 return GetLnnOhosAccountInterface()->LnnInitPhysicalSubnetManager();
321 }
322
LnnInitSyncInfoManager(void)323 int32_t LnnInitSyncInfoManager(void)
324 {
325 return GetLnnOhosAccountInterface()->LnnInitSyncInfoManager();
326 }
327
LnnInitTopoManager(void)328 int32_t LnnInitTopoManager(void)
329 {
330 return GetLnnOhosAccountInterface()->LnnInitTopoManager();
331 }
332
LnnInitWifiDirect(void)333 int32_t LnnInitWifiDirect(void)
334 {
335 return GetLnnOhosAccountInterface()->LnnInitWifiDirect();
336 }
337
LnnNotifyDiscoveryDevice(const ConnectionAddr * addr,const LnnDfxDeviceInfoReport * infoReport,bool isNeedConnect)338 int32_t LnnNotifyDiscoveryDevice(const ConnectionAddr *addr, const LnnDfxDeviceInfoReport *infoReport,
339 bool isNeedConnect)
340 {
341 return GetLnnOhosAccountInterface()->LnnNotifyDiscoveryDevice(addr, infoReport, isNeedConnect);
342 }
343
LnnRegistPhysicalSubnet(LnnPhysicalSubnet * manager)344 int32_t LnnRegistPhysicalSubnet(LnnPhysicalSubnet *manager)
345 {
346 return GetLnnOhosAccountInterface()->LnnRegistPhysicalSubnet(manager);
347 }
348
lnnRegistProtocol(LnnProtocolManager * protocolMgr)349 int32_t lnnRegistProtocol(LnnProtocolManager *protocolMgr)
350 {
351 return GetLnnOhosAccountInterface()->LnnRegistProtocol(protocolMgr);
352 }
353
LnnRequestLeaveByAddrType(const bool * type,uint32_t typeLen)354 int32_t LnnRequestLeaveByAddrType(const bool *type, uint32_t typeLen)
355 {
356 return GetLnnOhosAccountInterface()->LnnRequestLeaveByAddrType(type, typeLen);
357 }
358
LnnSendNotTrustedInfo(const NotTrustedDelayInfo * info,uint32_t num,LnnSyncInfoMsgComplete complete)359 int32_t LnnSendNotTrustedInfo(const NotTrustedDelayInfo *info, uint32_t num, LnnSyncInfoMsgComplete complete)
360 {
361 return GetLnnOhosAccountInterface()->LnnSendNotTrustedInfo(info, num, complete);
362 }
363
LnnSendSyncInfoMsg(LnnSyncInfoType type,const char * networkId,const uint8_t * msg,uint32_t len,LnnSyncInfoMsgComplete complete)364 int32_t LnnSendSyncInfoMsg(LnnSyncInfoType type, const char *networkId, const uint8_t *msg, uint32_t len,
365 LnnSyncInfoMsgComplete complete)
366 {
367 return GetLnnOhosAccountInterface()->LnnSendSyncInfoMsg(type, networkId, msg, len, complete);
368 }
369
LnnSetSupportDiscoveryType(char * info,const char * type)370 int32_t LnnSetSupportDiscoveryType(char *info, const char *type)
371 {
372 return GetLnnOhosAccountInterface()->LnnSetSupportDiscoveryType(info, type);
373 }
374
LnnStartDiscovery(void)375 int32_t LnnStartDiscovery(void)
376 {
377 return GetLnnOhosAccountInterface()->LnnStartDiscovery();
378 }
379
LnnStartPublish(void)380 int32_t LnnStartPublish(void)
381 {
382 return GetLnnOhosAccountInterface()->LnnStartPublish();
383 }
384
OpenDatabase(DbContext ** ctx)385 int32_t OpenDatabase(DbContext **ctx)
386 {
387 return GetLnnOhosAccountInterface()->OpenDatabase(ctx);
388 }
389
QueryRecordByKey(DbContext * ctx,TableNameID id,uint8_t * data,uint8_t ** replyInfo,int32_t infoNum)390 int32_t QueryRecordByKey(DbContext *ctx, TableNameID id, uint8_t *data, uint8_t **replyInfo, int32_t infoNum)
391 {
392 return GetLnnOhosAccountInterface()->QueryRecordByKey(ctx, id, data, replyInfo, infoNum);
393 }
394
RegistIPProtocolManager(void)395 int32_t RegistIPProtocolManager(void)
396 {
397 return GetLnnOhosAccountInterface()->RegistIPProtocolManager();
398 }
399
RemoveRecordByKey(DbContext * ctx,TableNameID id,uint8_t * data)400 int32_t RemoveRecordByKey(DbContext *ctx, TableNameID id, uint8_t *data)
401 {
402 return GetLnnOhosAccountInterface()->RemoveRecordByKey(ctx, id, data);
403 }
404
SoftBusAccessFile(const char * pathName,int32_t mode)405 int32_t SoftBusAccessFile(const char *pathName, int32_t mode)
406 {
407 return GetLnnOhosAccountInterface()->SoftBusAccessFile(pathName, mode);
408 }
409
SoftbusGetConfig(ConfigType type,unsigned char * val,uint32_t len)410 int32_t SoftbusGetConfig(ConfigType type, unsigned char *val, uint32_t len)
411 {
412 return GetLnnOhosAccountInterface()->SoftbusGetConfig(type, val, len);
413 }
414
SoftBusGetTime(SoftBusSysTime * sysTime)415 int32_t SoftBusGetTime(SoftBusSysTime *sysTime)
416 {
417 return GetLnnOhosAccountInterface()->SoftBusGetTime(sysTime);
418 }
419
SoftBusReadFullFile(const char * fileName,char * readBuf,uint32_t maxLen)420 int32_t SoftBusReadFullFile(const char *fileName, char *readBuf, uint32_t maxLen)
421 {
422 return GetLnnOhosAccountInterface()->SoftBusReadFullFile(fileName, readBuf, maxLen);
423 }
424
SoftBusWriteFile(const char * fileName,const char * writeBuf,uint32_t len)425 int32_t SoftBusWriteFile(const char *fileName, const char *writeBuf, uint32_t len)
426 {
427 return GetLnnOhosAccountInterface()->SoftBusWriteFile(fileName, writeBuf, len);
428 }
429
TransGetConnByChanId(int32_t channelId,int32_t channelType,int32_t * connId)430 int32_t TransGetConnByChanId(int32_t channelId, int32_t channelType, int32_t *connId)
431 {
432 return GetLnnOhosAccountInterface()->TransGetConnByChanId(channelId, channelType, connId);
433 }
434
TransTdcStartSessionListener(ListenerModule module,const LocalListenerInfo * info)435 int32_t TransTdcStartSessionListener(ListenerModule module, const LocalListenerInfo *info)
436 {
437 return GetLnnOhosAccountInterface()->TransTdcStartSessionListener(module, info);
438 }
439
TransTdcStopSessionListener(ListenerModule module)440 int32_t TransTdcStopSessionListener(ListenerModule module)
441 {
442 return GetLnnOhosAccountInterface()->TransTdcStopSessionListener(module);
443 }
444
UpdateDbPassword(DbContext * ctx,const uint8_t * password,uint32_t len)445 int32_t UpdateDbPassword(DbContext *ctx, const uint8_t *password, uint32_t len)
446 {
447 return GetLnnOhosAccountInterface()->UpdateDbPassword(ctx, password, len);
448 }
449
GetLooper(int32_t looper)450 SoftBusLooper *GetLooper(int32_t looper)
451 {
452 return GetLnnOhosAccountInterface()->GetLooper(looper);
453 }
454
AuthHasTrustedRelation(void)455 TrustedReturnType AuthHasTrustedRelation(void)
456 {
457 return GetLnnOhosAccountInterface()->AuthHasTrustedRelation();
458 }
459
AuthGenRequestId(void)460 uint32_t AuthGenRequestId(void)
461 {
462 return GetLnnOhosAccountInterface()->AuthGenRequestId();
463 }
464
AuthHandleLeaveLNN(AuthHandle authHandle)465 void AuthHandleLeaveLNN(AuthHandle authHandle)
466 {
467 GetLnnOhosAccountInterface()->AuthHandleLeaveLNN(authHandle);
468 }
469
AuthStopListening(AuthLinkType type)470 void AuthStopListening(AuthLinkType type)
471 {
472 GetLnnOhosAccountInterface()->AuthStopListening(type);
473 }
474
ConnCoapStopServerListen(void)475 void ConnCoapStopServerListen(void)
476 {
477 GetLnnOhosAccountInterface()->ConnCoapStopServerListen();
478 }
479
DfxRecordTriggerTime(LnnTriggerReason reason,LnnEventLnnStage stage)480 void DfxRecordTriggerTime(LnnTriggerReason reason, LnnEventLnnStage stage)
481 {
482 GetLnnOhosAccountInterface()->DfxRecordTriggerTime(reason, stage);
483 }
484
DiscLinkStatusChanged(LinkStatus status,ExchangeMedium medium)485 void DiscLinkStatusChanged(LinkStatus status, ExchangeMedium medium)
486 {
487 GetLnnOhosAccountInterface()->DiscLinkStatusChanged(status, medium);
488 }
489
LnnDeinitP2p(void)490 void LnnDeinitP2p(void)
491 {
492 GetLnnOhosAccountInterface()->LnnDeinitP2p();
493 }
494
LnnDeinitPhysicalSubnetManager(void)495 void LnnDeinitPhysicalSubnetManager(void)
496 {
497 GetLnnOhosAccountInterface()->LnnDeinitPhysicalSubnetManager();
498 }
499
LnnDeinitSyncInfoManager(void)500 void LnnDeinitSyncInfoManager(void)
501 {
502 GetLnnOhosAccountInterface()->LnnDeinitSyncInfoManager();
503 }
504
LnnDeinitTopoManager(void)505 void LnnDeinitTopoManager(void)
506 {
507 GetLnnOhosAccountInterface()->LnnDeinitTopoManager();
508 }
509
LnnDeinitWifiDirect(void)510 void LnnDeinitWifiDirect(void)
511 {
512 GetLnnOhosAccountInterface()->LnnDeinitWifiDirect();
513 }
514
LnnHbClearRecvList(void)515 void LnnHbClearRecvList(void)
516 {
517 GetLnnOhosAccountInterface()->LnnHbClearRecvList();
518 }
519
LnnIpAddrChangeEventHandler(void)520 void LnnIpAddrChangeEventHandler(void)
521 {
522 GetLnnOhosAccountInterface()->LnnIpAddrChangeEventHandler();
523 }
524
LnnNotifyAccountStateChangeEvent(SoftBusAccountState state)525 void LnnNotifyAccountStateChangeEvent(SoftBusAccountState state)
526 {
527 GetLnnOhosAccountInterface()->LnnNotifyAccountStateChangeEvent(state);
528 }
529
LnnNotifyAllTypeOffline(ConnectionAddrType type)530 void LnnNotifyAllTypeOffline(ConnectionAddrType type)
531 {
532 GetLnnOhosAccountInterface()->LnnNotifyAllTypeOffline(type);
533 }
534
LnnNotifyHBRepeat(void)535 void LnnNotifyHBRepeat(void)
536 {
537 GetLnnOhosAccountInterface()->LnnNotifyHBRepeat();
538 }
539
LnnNotifyLeaveResult(const char * networkId,int32_t retCode)540 void LnnNotifyLeaveResult(const char *networkId, int32_t retCode)
541 {
542 GetLnnOhosAccountInterface()->LnnNotifyLeaveResult(networkId, retCode);
543 }
544
LnnNotifyNetworkStateChanged(SoftBusNetworkState state)545 void LnnNotifyNetworkStateChanged(SoftBusNetworkState state)
546 {
547 GetLnnOhosAccountInterface()->LnnNotifyNetworkStateChanged(state);
548 }
549
LnnNotifyOOBEStateChangeEvent(SoftBusOOBEState state)550 void LnnNotifyOOBEStateChangeEvent(SoftBusOOBEState state)
551 {
552 GetLnnOhosAccountInterface()->LnnNotifyOOBEStateChangeEvent(state);
553 }
554
LnnNotifyPhysicalSubnetStatusChanged(const char * ifName,ProtocolType protocolType,void * status)555 void LnnNotifyPhysicalSubnetStatusChanged(const char *ifName, ProtocolType protocolType, void *status)
556 {
557 GetLnnOhosAccountInterface()->LnnNotifyPhysicalSubnetStatusChanged(ifName, protocolType, status);
558 }
559
LnnOnOhosAccountChanged(void)560 void LnnOnOhosAccountChanged(void)
561 {
562 GetLnnOhosAccountInterface()->LnnOnOhosAccountChanged();
563 }
564
LnnOnOhosAccountLogout(void)565 void LnnOnOhosAccountLogout(void)
566 {
567 GetLnnOhosAccountInterface()->LnnOnOhosAccountLogout();
568 }
569
LnnSetUnlockState(void)570 void LnnSetUnlockState(void)
571 {
572 GetLnnOhosAccountInterface()->LnnSetUnlockState();
573 }
574
LnnStopDiscovery(void)575 void LnnStopDiscovery(void)
576 {
577 GetLnnOhosAccountInterface()->LnnStopDiscovery();
578 }
579
LnnStopPublish(void)580 void LnnStopPublish(void)
581 {
582 GetLnnOhosAccountInterface()->LnnStopPublish();
583 }
584
LnnUnregisterEventHandler(LnnEventType event,LnnEventHandler handler)585 void LnnUnregisterEventHandler(LnnEventType event, LnnEventHandler handler)
586 {
587 GetLnnOhosAccountInterface()->LnnUnregisterEventHandler(event, handler);
588 }
589
LnnUpdateOhosAccount(UpdateAccountReason reason)590 void LnnUpdateOhosAccount(UpdateAccountReason reason)
591 {
592 GetLnnOhosAccountInterface()->LnnUpdateOhosAccount(reason);
593 }
594 }
595 } // namespace OHOS