1 /*
2 * Copyright (c) 2022-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 <cstdint>
17 #include <securec.h>
18
19 #include "lnn_local_ledger_deps_mock.h"
20 #include "softbus_common.h"
21 #include "softbus_error_code.h"
22
23 using namespace testing;
24 using namespace testing::ext;
25
26 namespace OHOS {
27 void *g_localLedgerDepsInterface;
28 constexpr char DEFAULT_DEVICE_NAME[] = "OpenHarmony";
29 constexpr char DEFAULT_DEVICE_UDID[] = "aaabbbcccdddeeefffggghhh";
30 constexpr char DEFAULT_DEVICE_TYPE[] = "default_type";
31 constexpr char GLASS_TYPE[] = "A31";
32 constexpr char WATCH_TYPE[] = "WATCH";
33 constexpr int32_t SOFTBUS_BUSCENTER_DUMP_LOCALDEVICEINFO_FD = -1;
34
LocalLedgerDepsInterfaceMock()35 LocalLedgerDepsInterfaceMock::LocalLedgerDepsInterfaceMock()
36 {
37 g_localLedgerDepsInterface = reinterpret_cast<void *>(this);
38 }
39
~LocalLedgerDepsInterfaceMock()40 LocalLedgerDepsInterfaceMock::~LocalLedgerDepsInterfaceMock()
41 {
42 g_localLedgerDepsInterface = nullptr;
43 }
44
GetLocalLedgerDepsInterface()45 static LocalLedgerDepsInterfaceMock *GetLocalLedgerDepsInterface()
46 {
47 return reinterpret_cast<LocalLedgerDepsInterfaceMock *>(g_localLedgerDepsInterface);
48 }
49
LedgerGetCommonDevInfo(const CommonDeviceKey key,char * value,uint32_t len)50 int32_t LocalLedgerDepsInterfaceMock::LedgerGetCommonDevInfo(const CommonDeviceKey key, char *value, uint32_t len)
51 {
52 if (value == nullptr) {
53 return SOFTBUS_INVALID_PARAM;
54 }
55 switch (key) {
56 case COMM_DEVICE_KEY_DEVNAME:
57 if (strncpy_s(value, len, DEFAULT_DEVICE_NAME, strlen(DEFAULT_DEVICE_NAME)) != EOK) {
58 return SOFTBUS_STRCPY_ERR;
59 }
60 break;
61 case COMM_DEVICE_KEY_UDID:
62 if (strncpy_s(value, len, DEFAULT_DEVICE_UDID, UDID_BUF_LEN) != EOK) {
63 return SOFTBUS_STRCPY_ERR;
64 }
65 break;
66 case COMM_DEVICE_KEY_DEVTYPE:
67 if (strncpy_s(value, len, DEFAULT_DEVICE_TYPE, strlen(DEFAULT_DEVICE_TYPE)) != EOK) {
68 return SOFTBUS_STRCPY_ERR;
69 }
70 break;
71 default:
72 break;
73 }
74 return SOFTBUS_OK;
75 }
76
LedgerGetCommonDevInfoGlass(const CommonDeviceKey key,char * value,uint32_t len)77 int32_t LocalLedgerDepsInterfaceMock::LedgerGetCommonDevInfoGlass(const CommonDeviceKey key, char *value, uint32_t len)
78 {
79 static bool isFirst = true;
80 const char *type = isFirst ? GLASS_TYPE : WATCH_TYPE;
81 if (value == nullptr) {
82 return SOFTBUS_INVALID_PARAM;
83 }
84 switch (key) {
85 case COMM_DEVICE_KEY_DEVNAME:
86 if (strncpy_s(value, len, DEFAULT_DEVICE_NAME, strlen(DEFAULT_DEVICE_NAME)) != EOK) {
87 return SOFTBUS_STRCPY_ERR;
88 }
89 break;
90 case COMM_DEVICE_KEY_UDID:
91 if (strncpy_s(value, len, DEFAULT_DEVICE_UDID, UDID_BUF_LEN) != EOK) {
92 return SOFTBUS_STRCPY_ERR;
93 }
94 break;
95 case COMM_DEVICE_KEY_DEVTYPE:
96 if (strncpy_s(value, len, type, strlen(type)) != EOK) {
97 return SOFTBUS_STRCPY_ERR;
98 }
99 break;
100 default:
101 break;
102 }
103 isFirst = false;
104 return SOFTBUS_OK;
105 }
106
LedgerSoftBusRegBusCenterVarDump(char * dumpVar,SoftBusVarDumpCb cb)107 int32_t LocalLedgerDepsInterfaceMock::LedgerSoftBusRegBusCenterVarDump(char *dumpVar, SoftBusVarDumpCb cb)
108 {
109 int32_t ret = SOFTBUS_INVALID_PARAM;
110 if (cb != nullptr) {
111 ret = cb(SOFTBUS_BUSCENTER_DUMP_LOCALDEVICEINFO_FD);
112 }
113 return ret;
114 }
115
MockGetLocalSleAddrFunc(char * sleAddr,uint32_t sleAddrLen)116 int32_t LocalLedgerDepsInterfaceMock::MockGetLocalSleAddrFunc(char *sleAddr, uint32_t sleAddrLen)
117 {
118 if (sleAddr == nullptr) {
119 return SOFTBUS_ERR;
120 }
121 static char mockSleAddr[MAC_LEN] = "11:11:11:11:11:11";
122 if (memcpy_s(sleAddr, sleAddrLen, mockSleAddr, MAC_LEN) != EOK) {
123 return SOFTBUS_ERR;
124 }
125 return SOFTBUS_OK;
126 }
127
128 extern "C" {
LnnGetNetCapabilty(void)129 uint32_t LnnGetNetCapabilty(void)
130 {
131 return GetLocalLedgerDepsInterface()->LnnGetNetCapabilty();
132 }
133
SoftBusGenerateRandomArray(unsigned char * randStr,uint32_t len)134 int32_t SoftBusGenerateRandomArray(unsigned char *randStr, uint32_t len)
135 {
136 return GetLocalLedgerDepsInterface()->SoftBusGenerateRandomArray(randStr, len);
137 }
138
GetCommonDevInfo(const CommonDeviceKey key,char * value,uint32_t len)139 int32_t GetCommonDevInfo(const CommonDeviceKey key, char *value, uint32_t len)
140 {
141 return GetLocalLedgerDepsInterface()->GetCommonDevInfo(key, value, len);
142 }
143
LnnInitLocalP2pInfo(NodeInfo * info)144 int32_t LnnInitLocalP2pInfo(NodeInfo *info)
145 {
146 return GetLocalLedgerDepsInterface()->LnnInitLocalP2pInfo(info);
147 }
148
SoftBusRegBusCenterVarDump(char * dumpVar,SoftBusVarDumpCb cb)149 int32_t SoftBusRegBusCenterVarDump(char *dumpVar, SoftBusVarDumpCb cb)
150 {
151 return GetLocalLedgerDepsInterface()->SoftBusRegBusCenterVarDump(dumpVar, cb);
152 }
153
LnnInitOhosAccount(void)154 int32_t LnnInitOhosAccount(void)
155 {
156 return GetLocalLedgerDepsInterface()->LnnInitOhosAccount();
157 }
158
LnnGetFeatureCapabilty(void)159 uint64_t LnnGetFeatureCapabilty(void)
160 {
161 return GetLocalLedgerDepsInterface()->LnnGetFeatureCapabilty();
162 }
163
IsFeatureSupport(uint64_t feature,FeatureCapability capaBit)164 bool IsFeatureSupport(uint64_t feature, FeatureCapability capaBit)
165 {
166 return GetLocalLedgerDepsInterface()->IsFeatureSupport(feature, capaBit);
167 }
168
GetCommonOsType(int32_t * value)169 int32_t GetCommonOsType(int32_t *value)
170 {
171 return GetLocalLedgerDepsInterface()->GetCommonOsType(value);
172 }
173
GetCommonOsVersion(char * value,uint32_t len)174 int32_t GetCommonOsVersion(char *value, uint32_t len)
175 {
176 return GetLocalLedgerDepsInterface()->GetCommonOsVersion(value, len);
177 }
178
GetCommonDeviceVersion(char * value,uint32_t len)179 int32_t GetCommonDeviceVersion(char *value, uint32_t len)
180 {
181 return GetLocalLedgerDepsInterface()->GetCommonDeviceVersion(value, len);
182 }
183
GetDeviceSecurityLevel(int32_t * level)184 int32_t GetDeviceSecurityLevel(int32_t *level)
185 {
186 return GetLocalLedgerDepsInterface()->GetDeviceSecurityLevel(level);
187 }
188
SoftBusGetBtState(void)189 int32_t SoftBusGetBtState(void)
190 {
191 return GetLocalLedgerDepsInterface()->SoftBusGetBtState();
192 }
193
SoftBusGetBtMacAddr(SoftBusBtAddr * mac)194 int32_t SoftBusGetBtMacAddr(SoftBusBtAddr *mac)
195 {
196 return GetLocalLedgerDepsInterface()->SoftBusGetBtMacAddr(mac);
197 }
198
IsSleEnabled(void)199 bool IsSleEnabled(void)
200 {
201 return GetLocalLedgerDepsInterface()->IsSleEnabled();
202 }
203
SoftBusAddSleStateListener(const SoftBusSleStateListener * listener,int * listenerId)204 int SoftBusAddSleStateListener(const SoftBusSleStateListener *listener, int *listenerId)
205 {
206 return GetLocalLedgerDepsInterface()->SoftBusAddSleStateListener(listener, listenerId);
207 }
208
SoftBusRemoveSleStateListener(int listenerId)209 void SoftBusRemoveSleStateListener(int listenerId)
210 {
211 return GetLocalLedgerDepsInterface()->SoftBusRemoveSleStateListener(listenerId);
212 }
213
GetSleRangeCapacity()214 int32_t GetSleRangeCapacity()
215 {
216 return GetLocalLedgerDepsInterface()->GetSleRangeCapacity();
217 }
218
GetLocalSleAddr(char * sleAddr,uint32_t sleAddrLen)219 int32_t GetLocalSleAddr(char *sleAddr, uint32_t sleAddrLen)
220 {
221 return GetLocalLedgerDepsInterface()->GetLocalSleAddr(sleAddr, sleAddrLen);
222 }
223
LnnGenerateKeyByHuks(struct HksBlob * keyAlias)224 int32_t LnnGenerateKeyByHuks(struct HksBlob *keyAlias)
225 {
226 return GetLocalLedgerDepsInterface()->LnnGenerateKeyByHuks(keyAlias);
227 }
228
LnnDeleteKeyByHuks(struct HksBlob * keyAlias)229 int32_t LnnDeleteKeyByHuks(struct HksBlob *keyAlias)
230 {
231 return GetLocalLedgerDepsInterface()->LnnDeleteKeyByHuks(keyAlias);
232 }
233
LnnEncryptDataByHuks(const struct HksBlob * keyAlias,const struct HksBlob * inData,struct HksBlob * outData)234 int32_t LnnEncryptDataByHuks(const struct HksBlob *keyAlias, const struct HksBlob *inData, struct HksBlob *outData)
235 {
236 return GetLocalLedgerDepsInterface()->LnnEncryptDataByHuks(keyAlias, inData, outData);
237 }
238
LnnDecryptDataByHuks(const struct HksBlob * keyAlias,const struct HksBlob * inData,struct HksBlob * outData)239 int32_t LnnDecryptDataByHuks(const struct HksBlob *keyAlias, const struct HksBlob *inData, struct HksBlob *outData)
240 {
241 return GetLocalLedgerDepsInterface()->LnnDecryptDataByHuks(keyAlias, inData, outData);
242 }
243
LnnGenerateRandomByHuks(uint8_t * randomKey,uint32_t len)244 int32_t LnnGenerateRandomByHuks(uint8_t *randomKey, uint32_t len)
245 {
246 return GetLocalLedgerDepsInterface()->LnnGenerateRandomByHuks(randomKey, len);
247 }
248
OpenDatabase(DbContext ** ctx)249 int32_t OpenDatabase(DbContext **ctx)
250 {
251 return GetLocalLedgerDepsInterface()->OpenDatabase(ctx);
252 }
253
CloseDatabase(DbContext * ctx)254 int32_t CloseDatabase(DbContext *ctx)
255 {
256 return GetLocalLedgerDepsInterface()->CloseDatabase(ctx);
257 }
258
CreateTable(DbContext * ctx,TableNameID id)259 int32_t CreateTable(DbContext *ctx, TableNameID id)
260 {
261 return GetLocalLedgerDepsInterface()->CreateTable(ctx, id);
262 }
263
CheckTableExist(DbContext * ctx,TableNameID id,bool * isExist)264 int32_t CheckTableExist(DbContext *ctx, TableNameID id, bool *isExist)
265 {
266 return GetLocalLedgerDepsInterface()->CheckTableExist(ctx, id, isExist);
267 }
268
RemoveRecordByKey(DbContext * ctx,TableNameID id,uint8_t * data)269 int32_t RemoveRecordByKey(DbContext *ctx, TableNameID id, uint8_t *data)
270 {
271 return GetLocalLedgerDepsInterface()->RemoveRecordByKey(ctx, id, data);
272 }
273
GetRecordNumByKey(DbContext * ctx,TableNameID id,uint8_t * data)274 int32_t GetRecordNumByKey(DbContext *ctx, TableNameID id, uint8_t *data)
275 {
276 return GetLocalLedgerDepsInterface()->GetRecordNumByKey(ctx, id, data);
277 }
278
EncryptedDb(DbContext * ctx,const uint8_t * password,uint32_t len)279 int32_t EncryptedDb(DbContext *ctx, const uint8_t *password, uint32_t len)
280 {
281 return GetLocalLedgerDepsInterface()->EncryptedDb(ctx, password, len);
282 }
283
UpdateDbPassword(DbContext * ctx,const uint8_t * password,uint32_t len)284 int32_t UpdateDbPassword(DbContext *ctx, const uint8_t *password, uint32_t len)
285 {
286 return GetLocalLedgerDepsInterface()->UpdateDbPassword(ctx, password, len);
287 }
288
QueryRecordByKey(DbContext * ctx,TableNameID id,uint8_t * data,uint8_t ** replyInfo,int32_t infoNum)289 int32_t QueryRecordByKey(DbContext *ctx, TableNameID id, uint8_t *data, uint8_t **replyInfo, int32_t infoNum)
290 {
291 return GetLocalLedgerDepsInterface()->QueryRecordByKey(ctx, id, data, replyInfo, infoNum);
292 }
293
LnnGetFullStoragePath(LnnFileId id,char * path,uint32_t len)294 int32_t LnnGetFullStoragePath(LnnFileId id, char *path, uint32_t len)
295 {
296 return GetLocalLedgerDepsInterface()->LnnGetFullStoragePath(id, path, len);
297 }
298
SoftBusReadFullFile(const char * fileName,char * readBuf,uint32_t maxLen)299 int32_t SoftBusReadFullFile(const char *fileName, char *readBuf, uint32_t maxLen)
300 {
301 return GetLocalLedgerDepsInterface()->SoftBusReadFullFile(fileName, readBuf, maxLen);
302 }
303
SoftBusWriteFile(const char * fileName,const char * writeBuf,uint32_t len)304 int32_t SoftBusWriteFile(const char *fileName, const char *writeBuf, uint32_t len)
305 {
306 return GetLocalLedgerDepsInterface()->SoftBusWriteFile(fileName, writeBuf, len);
307 }
308
SoftBusAccessFile(const char * pathName,int32_t mode)309 int32_t SoftBusAccessFile(const char *pathName, int32_t mode)
310 {
311 return GetLocalLedgerDepsInterface()->SoftBusAccessFile(pathName, mode);
312 }
313
LnnAsyncCallbackHelper(SoftBusLooper * looper,LnnAsyncCallbackFunc callback,void * para)314 int32_t LnnAsyncCallbackHelper(SoftBusLooper *looper, LnnAsyncCallbackFunc callback, void *para)
315 {
316 return GetLocalLedgerDepsInterface()->LnnAsyncCallbackHelper(looper, callback, para);
317 }
318
ConvertBytesToHexString(char * outBuf,uint32_t outBufLen,const unsigned char * inBuf,uint32_t inLen)319 int32_t ConvertBytesToHexString(char *outBuf, uint32_t outBufLen, const unsigned char *inBuf, uint32_t inLen)
320 {
321 return GetLocalLedgerDepsInterface()->ConvertBytesToHexString(outBuf, outBufLen, inBuf, inLen);
322 }
323
LnnNotifyNetworkStateChanged(SoftBusNetworkState state)324 void LnnNotifyNetworkStateChanged(SoftBusNetworkState state)
325 {
326 return GetLocalLedgerDepsInterface()->LnnNotifyNetworkStateChanged(state);
327 }
328
AuthHasTrustedRelation(void)329 TrustedReturnType AuthHasTrustedRelation(void)
330 {
331 return GetLocalLedgerDepsInterface()->AuthHasTrustedRelation();
332 }
333
IsEnableSoftBusHeartbeat(void)334 bool IsEnableSoftBusHeartbeat(void)
335 {
336 return GetLocalLedgerDepsInterface()->IsEnableSoftBusHeartbeat();
337 }
338
LnnNotifyHBRepeat(void)339 void LnnNotifyHBRepeat(void)
340 {
341 return GetLocalLedgerDepsInterface()->LnnNotifyHBRepeat();
342 }
343
LnnHbClearRecvList(void)344 void LnnHbClearRecvList(void)
345 {
346 return GetLocalLedgerDepsInterface()->LnnHbClearRecvList();
347 }
348
LnnConvertHbTypeToId(LnnHeartbeatType type)349 int32_t LnnConvertHbTypeToId(LnnHeartbeatType type)
350 {
351 return GetLocalLedgerDepsInterface()->LnnConvertHbTypeToId(type);
352 }
353
LnnVisitHbTypeSet(VisitHbTypeCb callback,LnnHeartbeatType * typeSet,void * data)354 bool LnnVisitHbTypeSet(VisitHbTypeCb callback, LnnHeartbeatType *typeSet, void *data)
355 {
356 return GetLocalLedgerDepsInterface()->LnnVisitHbTypeSet(callback, typeSet, data);
357 }
358
LnnCeEncryptDataByHuks(const struct HksBlob * keyAlias,const struct HksBlob * inData,struct HksBlob * outData)359 int32_t LnnCeEncryptDataByHuks(const struct HksBlob *keyAlias, const struct HksBlob *inData, struct HksBlob *outData)
360 {
361 return GetLocalLedgerDepsInterface()->LnnCeEncryptDataByHuks(keyAlias, inData, outData);
362 }
363
LnnCeDecryptDataByHuks(const struct HksBlob * keyAlias,const struct HksBlob * inData,struct HksBlob * outData)364 int32_t LnnCeDecryptDataByHuks(const struct HksBlob *keyAlias, const struct HksBlob *inData, struct HksBlob *outData)
365 {
366 return GetLocalLedgerDepsInterface()->LnnCeDecryptDataByHuks(keyAlias, inData, outData);
367 }
368
RegistIPProtocolManager(void)369 int32_t RegistIPProtocolManager(void)
370 {
371 return GetLocalLedgerDepsInterface()->RegistIPProtocolManager();
372 }
373
LnnInitPhysicalSubnetManager(void)374 int32_t LnnInitPhysicalSubnetManager(void)
375 {
376 return GetLocalLedgerDepsInterface()->LnnInitPhysicalSubnetManager();
377 }
378
LnnOnOhosAccountChanged(void)379 void LnnOnOhosAccountChanged(void)
380 {
381 return GetLocalLedgerDepsInterface()->LnnOnOhosAccountChanged();
382 }
383
LnnStartDiscovery(void)384 int32_t LnnStartDiscovery(void)
385 {
386 return GetLocalLedgerDepsInterface()->LnnStartDiscovery();
387 }
388
SoftbusGetConfig(ConfigType type,unsigned char * val,uint32_t len)389 int32_t SoftbusGetConfig(ConfigType type, unsigned char *val, uint32_t len)
390 {
391 return GetLocalLedgerDepsInterface()->SoftbusGetConfig(type, val, len);
392 }
393
LnnNotifyDiscoveryDevice(const ConnectionAddr * addr,const LnnDfxDeviceInfoReport * infoReport,bool isNeedConnect)394 int32_t LnnNotifyDiscoveryDevice(const ConnectionAddr *addr, const LnnDfxDeviceInfoReport *infoReport,
395 bool isNeedConnect)
396 {
397 return GetLocalLedgerDepsInterface()->LnnNotifyDiscoveryDevice(addr, infoReport, isNeedConnect);
398 }
399
LnnRequestLeaveByAddrType(const bool * type,uint32_t typeLen)400 int32_t LnnRequestLeaveByAddrType(const bool *type, uint32_t typeLen)
401 {
402 return GetLocalLedgerDepsInterface()->LnnRequestLeaveByAddrType(type, typeLen);
403 }
404
LnnAsyncCallbackDelayHelper(SoftBusLooper * looper,LnnAsyncCallbackFunc callback,void * para,uint64_t delayMillis)405 int32_t LnnAsyncCallbackDelayHelper(SoftBusLooper *looper, LnnAsyncCallbackFunc callback, void *para,
406 uint64_t delayMillis)
407 {
408 return GetLocalLedgerDepsInterface()->LnnAsyncCallbackDelayHelper(looper, callback, para, delayMillis);
409 }
410
LnnUpdateOhosAccount(UpdateAccountReason reason)411 void LnnUpdateOhosAccount(UpdateAccountReason reason)
412 {
413 return GetLocalLedgerDepsInterface()->LnnUpdateOhosAccount(reason);
414 }
415
LnnOnOhosAccountLogout(void)416 void LnnOnOhosAccountLogout(void)
417 {
418 return GetLocalLedgerDepsInterface()->LnnOnOhosAccountLogout();
419 }
420
LnnNotifyOOBEStateChangeEvent(SoftBusOOBEState state)421 void LnnNotifyOOBEStateChangeEvent(SoftBusOOBEState state)
422 {
423 return GetLocalLedgerDepsInterface()->LnnNotifyOOBEStateChangeEvent(state);
424 }
425
LnnNotifyAccountStateChangeEvent(SoftBusAccountState state)426 void LnnNotifyAccountStateChangeEvent(SoftBusAccountState state)
427 {
428 return GetLocalLedgerDepsInterface()->LnnNotifyAccountStateChangeEvent(state);
429 }
430
LnnDeinitPhysicalSubnetManager(void)431 void LnnDeinitPhysicalSubnetManager(void)
432 {
433 return GetLocalLedgerDepsInterface()->LnnDeinitPhysicalSubnetManager();
434 }
435
LnnUnregisterEventHandler(LnnEventType event,LnnEventHandler handler)436 void LnnUnregisterEventHandler(LnnEventType event, LnnEventHandler handler)
437 {
438 return GetLocalLedgerDepsInterface()->LnnUnregisterEventHandler(event, handler);
439 }
440
DfxRecordTriggerTime(LnnTriggerReason reason,LnnEventLnnStage stage)441 void DfxRecordTriggerTime(LnnTriggerReason reason, LnnEventLnnStage stage)
442 {
443 return GetLocalLedgerDepsInterface()->DfxRecordTriggerTime(reason, stage);
444 }
445
LnnRegistPhysicalSubnet(LnnPhysicalSubnet * manager)446 int32_t LnnRegistPhysicalSubnet(LnnPhysicalSubnet *manager)
447 {
448 return GetLocalLedgerDepsInterface()->LnnRegistPhysicalSubnet(manager);
449 }
450
DiscLinkStatusChanged(LinkStatus status,ExchangeMedium medium,int32_t ifnameIdx)451 void DiscLinkStatusChanged(LinkStatus status, ExchangeMedium medium, int32_t ifnameIdx)
452 {
453 return GetLocalLedgerDepsInterface()->DiscLinkStatusChanged(status, medium, ifnameIdx);
454 }
455
LnnVisitPhysicalSubnet(LnnVisitPhysicalSubnetCallback callback,void * data)456 bool LnnVisitPhysicalSubnet(LnnVisitPhysicalSubnetCallback callback, void *data)
457 {
458 return GetLocalLedgerDepsInterface()->LnnVisitPhysicalSubnet(callback, data);
459 }
460
LnnStopPublish(void)461 void LnnStopPublish(void)
462 {
463 return GetLocalLedgerDepsInterface()->LnnStopPublish();
464 }
465
LnnStopDiscovery(void)466 void LnnStopDiscovery(void)
467 {
468 return GetLocalLedgerDepsInterface()->LnnStopDiscovery();
469 }
470
LnnIpAddrChangeEventHandler(void)471 void LnnIpAddrChangeEventHandler(void)
472 {
473 return GetLocalLedgerDepsInterface()->LnnIpAddrChangeEventHandler();
474 }
475
AuthStopListening(AuthLinkType type)476 void AuthStopListening(AuthLinkType type)
477 {
478 return GetLocalLedgerDepsInterface()->AuthStopListening(type);
479 }
480
TransTdcStopSessionListener(ListenerModule module)481 int32_t TransTdcStopSessionListener(ListenerModule module)
482 {
483 return GetLocalLedgerDepsInterface()->TransTdcStopSessionListener(module);
484 }
485
ConnStopLocalListening(const LocalListenerInfo * info)486 int32_t ConnStopLocalListening(const LocalListenerInfo *info)
487 {
488 return GetLocalLedgerDepsInterface()->ConnStopLocalListening(info);
489 }
490
LnnGetAddrTypeByIfName(const char * ifName,ConnectionAddrType * type)491 int32_t LnnGetAddrTypeByIfName(const char *ifName, ConnectionAddrType *type)
492 {
493 return GetLocalLedgerDepsInterface()->LnnGetAddrTypeByIfName(ifName, type);
494 }
495
LnnStartPublish(void)496 int32_t LnnStartPublish(void)
497 {
498 return GetLocalLedgerDepsInterface()->LnnStartPublish();
499 }
500
LnnIsAutoNetWorkingEnabled(void)501 bool LnnIsAutoNetWorkingEnabled(void)
502 {
503 return GetLocalLedgerDepsInterface()->LnnIsAutoNetWorkingEnabled();
504 }
505
AuthStartListening(AuthLinkType type,const char * ip,int32_t port)506 int32_t AuthStartListening(AuthLinkType type, const char *ip, int32_t port)
507 {
508 return GetLocalLedgerDepsInterface()->AuthStartListening(type, ip, port);
509 }
510
TransTdcStartSessionListener(ListenerModule module,const LocalListenerInfo * info)511 int32_t TransTdcStartSessionListener(ListenerModule module, const LocalListenerInfo *info)
512 {
513 return GetLocalLedgerDepsInterface()->TransTdcStartSessionListener(module, info);
514 }
515
ConnStartLocalListening(const LocalListenerInfo * info)516 int32_t ConnStartLocalListening(const LocalListenerInfo *info)
517 {
518 return GetLocalLedgerDepsInterface()->ConnStartLocalListening(info);
519 }
520
LnnIsLinkReady(const char * iface)521 bool LnnIsLinkReady(const char *iface)
522 {
523 return GetLocalLedgerDepsInterface()->LnnIsLinkReady(iface);
524 }
525
LnnNotifyPhysicalSubnetStatusChanged(const char * ifName,ProtocolType protocolType,void * status)526 void LnnNotifyPhysicalSubnetStatusChanged(const char *ifName, ProtocolType protocolType, void *status)
527 {
528 return GetLocalLedgerDepsInterface()->LnnNotifyPhysicalSubnetStatusChanged(ifName, protocolType, status);
529 }
530
LnnVisitNetif(VisitNetifCallback callback,void * data)531 bool LnnVisitNetif(VisitNetifCallback callback, void *data)
532 {
533 return GetLocalLedgerDepsInterface()->LnnVisitNetif(callback, data);
534 }
535
GetNetworkIpByIfName(const char * ifName,char * ip,char * netmask,uint32_t len)536 int32_t GetNetworkIpByIfName(const char *ifName, char *ip, char *netmask, uint32_t len)
537 {
538 return GetLocalLedgerDepsInterface()->GetNetworkIpByIfName(ifName, ip, netmask, len);
539 }
540
lnnRegistProtocol(LnnProtocolManager * protocolMgr)541 int32_t lnnRegistProtocol(LnnProtocolManager *protocolMgr)
542 {
543 return GetLocalLedgerDepsInterface()->LnnRegistProtocol(protocolMgr);
544 }
545
LnnGetWlanIpv4Addr(char * ip,uint32_t size)546 int32_t LnnGetWlanIpv4Addr(char *ip, uint32_t size)
547 {
548 return GetLocalLedgerDepsInterface()->GetWlanIpv4Addr(ip, size);
549 }
550
ConnCoapStartServerListen(void)551 int32_t ConnCoapStartServerListen(void)
552 {
553 return GetLocalLedgerDepsInterface()->ConnCoapStartServerListen();
554 }
555
ConnCoapStopServerListen(void)556 void ConnCoapStopServerListen(void)
557 {
558 return GetLocalLedgerDepsInterface()->ConnCoapStopServerListen();
559 }
560
AuthGetDeviceUuid(int64_t authId,char * uuid,uint16_t size)561 int32_t AuthGetDeviceUuid(int64_t authId, char *uuid, uint16_t size)
562 {
563 return GetLocalLedgerDepsInterface()->AuthGetDeviceUuid(authId, uuid, size);
564 }
565
TransGetConnByChanId(int32_t channelId,int32_t channelType,int32_t * connId)566 int32_t TransGetConnByChanId(int32_t channelId, int32_t channelType, int32_t *connId)
567 {
568 return GetLocalLedgerDepsInterface()->TransGetConnByChanId(channelId, channelType, connId);
569 }
570
AuthMetaStartVerify(uint32_t connectionId,const AuthKeyInfo * authKeyInfo,uint32_t requestId,int32_t callingPid,const AuthVerifyCallback * callBack)571 int32_t AuthMetaStartVerify(uint32_t connectionId, const AuthKeyInfo *authKeyInfo, uint32_t requestId,
572 int32_t callingPid, const AuthVerifyCallback *callBack)
573 {
574 return GetLocalLedgerDepsInterface()->AuthMetaStartVerify(connectionId, authKeyInfo, requestId, callingPid,
575 callBack);
576 }
577
AuthGenRequestId(void)578 uint32_t AuthGenRequestId(void)
579 {
580 return GetLocalLedgerDepsInterface()->AuthGenRequestId();
581 }
582
LnnSetUnlockState(void)583 void LnnSetUnlockState(void)
584 {
585 return GetLocalLedgerDepsInterface()->LnnSetUnlockState();
586 }
587
AuthHandleLeaveLNN(AuthHandle authHandle)588 void AuthHandleLeaveLNN(AuthHandle authHandle)
589 {
590 return GetLocalLedgerDepsInterface()->AuthHandleLeaveLNN(authHandle);
591 }
592
LnnIsSameConnectionAddr(const ConnectionAddr * addr1,const ConnectionAddr * addr2,bool isShort)593 bool LnnIsSameConnectionAddr(const ConnectionAddr *addr1, const ConnectionAddr *addr2, bool isShort)
594 {
595 return GetLocalLedgerDepsInterface()->LnnIsSameConnectionAddr(addr1, addr2, isShort);
596 }
597
LnnConvertAddrToOption(const ConnectionAddr * addr,ConnectOption * option)598 bool LnnConvertAddrToOption(const ConnectionAddr *addr, ConnectOption *option)
599 {
600 return GetLocalLedgerDepsInterface()->LnnConvertAddrToOption(addr, option);
601 }
602
LnnConvAddrTypeToDiscType(ConnectionAddrType type)603 DiscoveryType LnnConvAddrTypeToDiscType(ConnectionAddrType type)
604 {
605 return GetLocalLedgerDepsInterface()->LnnConvAddrTypeToDiscType(type);
606 }
607
LnnDiscTypeToConnAddrType(DiscoveryType type)608 ConnectionAddrType LnnDiscTypeToConnAddrType(DiscoveryType type)
609 {
610 return GetLocalLedgerDepsInterface()->LnnDiscTypeToConnAddrType(type);
611 }
612
LnnConvertAuthConnInfoToAddr(ConnectionAddr * addr,const AuthConnInfo * connInfo,ConnectionAddrType hintType)613 bool LnnConvertAuthConnInfoToAddr(ConnectionAddr *addr, const AuthConnInfo *connInfo, ConnectionAddrType hintType)
614 {
615 return GetLocalLedgerDepsInterface()->LnnConvertAuthConnInfoToAddr(addr, connInfo, hintType);
616 }
617
AddStringToJsonObject(cJSON * json,const char * const string,const char * value)618 bool AddStringToJsonObject(cJSON *json, const char * const string, const char *value)
619 {
620 return GetLocalLedgerDepsInterface()->AddStringToJsonObject(json, string, value);
621 }
622
AddNumberToJsonObject(cJSON * json,const char * const string,int32_t num)623 bool AddNumberToJsonObject(cJSON *json, const char * const string, int32_t num)
624 {
625 return GetLocalLedgerDepsInterface()->AddNumberToJsonObject(json, string, num);
626 }
627
LnnSendSyncInfoMsg(LnnSyncInfoType type,const char * networkId,const uint8_t * msg,uint32_t len,LnnSyncInfoMsgComplete complete)628 int32_t LnnSendSyncInfoMsg(LnnSyncInfoType type, const char *networkId, const uint8_t *msg, uint32_t len,
629 LnnSyncInfoMsgComplete complete)
630 {
631 return GetLocalLedgerDepsInterface()->LnnSendSyncInfoMsg(type, networkId, msg, len, complete);
632 }
633
AuthGetLatestAuthSeqList(const char * udid,int64_t * authSeq,uint32_t num)634 int32_t AuthGetLatestAuthSeqList(const char *udid, int64_t *authSeq, uint32_t num)
635 {
636 return GetLocalLedgerDepsInterface()->AuthGetLatestAuthSeqList(udid, authSeq, num);
637 }
638
LnnSetSupportDiscoveryType(char * info,const char * type)639 int32_t LnnSetSupportDiscoveryType(char *info, const char *type)
640 {
641 return GetLocalLedgerDepsInterface()->LnnSetSupportDiscoveryType(info, type);
642 }
643
LnnHasSupportDiscoveryType(const char * destType,const char * type)644 bool LnnHasSupportDiscoveryType(const char *destType, const char *type)
645 {
646 return GetLocalLedgerDepsInterface()->LnnHasSupportDiscoveryType(destType, type);
647 }
648
LnnPeerHasExchangeDiscoveryType(const NodeInfo * info,DiscoveryType type)649 bool LnnPeerHasExchangeDiscoveryType(const NodeInfo *info, DiscoveryType type)
650 {
651 return GetLocalLedgerDepsInterface()->LnnPeerHasExchangeDiscoveryType(info, type);
652 }
653
LnnCompareNodeWeight(int32_t weight1,const char * masterUdid1,int32_t weight2,const char * masterUdid2)654 int32_t LnnCompareNodeWeight(int32_t weight1, const char *masterUdid1, int32_t weight2, const char *masterUdid2)
655 {
656 return GetLocalLedgerDepsInterface()->LnnCompareNodeWeight(weight1, masterUdid1, weight2, masterUdid2);
657 }
658
LnnNotifyAllTypeOffline(ConnectionAddrType type)659 void LnnNotifyAllTypeOffline(ConnectionAddrType type)
660 {
661 return GetLocalLedgerDepsInterface()->LnnNotifyAllTypeOffline(type);
662 }
663
SoftBusGetTime(SoftBusSysTime * sysTime)664 int32_t SoftBusGetTime(SoftBusSysTime *sysTime)
665 {
666 return GetLocalLedgerDepsInterface()->SoftBusGetTime(sysTime);
667 }
668
AuthGetConnInfo(AuthHandle authHandle,AuthConnInfo * connInfo)669 int32_t AuthGetConnInfo(AuthHandle authHandle, AuthConnInfo *connInfo)
670 {
671 return GetLocalLedgerDepsInterface()->AuthGetConnInfo(authHandle, connInfo);
672 }
673
LnnNotifyLeaveResult(const char * networkId,int32_t retCode)674 void LnnNotifyLeaveResult(const char *networkId, int32_t retCode)
675 {
676 return GetLocalLedgerDepsInterface()->LnnNotifyLeaveResult(networkId, retCode);
677 }
678
LnnSendNotTrustedInfo(const NotTrustedDelayInfo * info,uint32_t num,LnnSyncInfoMsgComplete complete)679 int32_t LnnSendNotTrustedInfo(const NotTrustedDelayInfo *info, uint32_t num, LnnSyncInfoMsgComplete complete)
680 {
681 return GetLocalLedgerDepsInterface()->LnnSendNotTrustedInfo(info, num, complete);
682 }
683
GetLooper(int32_t looper)684 SoftBusLooper *GetLooper(int32_t looper)
685 {
686 return GetLocalLedgerDepsInterface()->GetLooper(looper);
687 }
688
ConnDisconnectDeviceAllConn(const ConnectOption * option)689 int32_t ConnDisconnectDeviceAllConn(const ConnectOption *option)
690 {
691 return GetLocalLedgerDepsInterface()->ConnDisconnectDeviceAllConn(option);
692 }
693
LnnGenLocalUuid(char * uuid,uint32_t len)694 int32_t LnnGenLocalUuid(char *uuid, uint32_t len)
695 {
696 return GetLocalLedgerDepsInterface()->LnnGenLocalUuid(uuid, len);
697 }
698
LnnGenLocalIrk(unsigned char * irk,uint32_t len)699 int32_t LnnGenLocalIrk(unsigned char *irk, uint32_t len)
700 {
701 return GetLocalLedgerDepsInterface()->LnnGenLocalIrk(irk, len);
702 }
703
LnnGenLocalNetworkId(char * networkId,uint32_t len)704 int32_t LnnGenLocalNetworkId(char *networkId, uint32_t len)
705 {
706 return GetLocalLedgerDepsInterface()->LnnGenLocalNetworkId(networkId, len);
707 }
708
LnnInitP2p(void)709 int32_t LnnInitP2p(void)
710 {
711 return GetLocalLedgerDepsInterface()->LnnInitP2p();
712 }
713
LnnInitWifiDirect(void)714 int32_t LnnInitWifiDirect(void)
715 {
716 return GetLocalLedgerDepsInterface()->LnnInitWifiDirect();
717 }
718
LnnDeinitP2p(void)719 void LnnDeinitP2p(void)
720 {
721 return GetLocalLedgerDepsInterface()->LnnDeinitP2p();
722 }
723
LnnDeinitWifiDirect(void)724 void LnnDeinitWifiDirect(void)
725 {
726 return GetLocalLedgerDepsInterface()->LnnDeinitWifiDirect();
727 }
728
LnnInitNetworkInfo(void)729 int32_t LnnInitNetworkInfo(void)
730 {
731 return GetLocalLedgerDepsInterface()->LnnInitNetworkInfo();
732 }
733
LnnInitDevicename(void)734 int32_t LnnInitDevicename(void)
735 {
736 return GetLocalLedgerDepsInterface()->LnnInitDevicename();
737 }
738
LnnInitSyncInfoManager(void)739 int32_t LnnInitSyncInfoManager(void)
740 {
741 return GetLocalLedgerDepsInterface()->LnnInitSyncInfoManager();
742 }
743
LnnDeinitSyncInfoManager(void)744 void LnnDeinitSyncInfoManager(void)
745 {
746 return GetLocalLedgerDepsInterface()->LnnDeinitSyncInfoManager();
747 }
748
LnnInitTopoManager(void)749 int32_t LnnInitTopoManager(void)
750 {
751 return GetLocalLedgerDepsInterface()->LnnInitTopoManager();
752 }
753
LnnDeinitTopoManager(void)754 void LnnDeinitTopoManager(void)
755 {
756 return GetLocalLedgerDepsInterface()->LnnDeinitTopoManager();
757 }
758
RegAuthVerifyListener(const AuthVerifyListener * listener)759 int32_t RegAuthVerifyListener(const AuthVerifyListener *listener)
760 {
761 return GetLocalLedgerDepsInterface()->RegAuthVerifyListener(listener);
762 }
763
UnregAuthVerifyListener(void)764 void UnregAuthVerifyListener(void)
765 {
766 return GetLocalLedgerDepsInterface()->UnregAuthVerifyListener();
767 }
768
LnnRegSyncInfoHandler(LnnSyncInfoType type,LnnSyncInfoMsgHandler handler)769 int32_t LnnRegSyncInfoHandler(LnnSyncInfoType type, LnnSyncInfoMsgHandler handler)
770 {
771 return GetLocalLedgerDepsInterface()->LnnRegSyncInfoHandler(type, handler);
772 }
773
LnnUnregSyncInfoHandler(LnnSyncInfoType type,LnnSyncInfoMsgHandler handler)774 int32_t LnnUnregSyncInfoHandler(LnnSyncInfoType type, LnnSyncInfoMsgHandler handler)
775 {
776 return GetLocalLedgerDepsInterface()->LnnUnregSyncInfoHandler(type, handler);
777 }
778
LnnStopConnectionFsm(LnnConnectionFsm * connFsm,LnnConnectionFsmStopCallback callback)779 int32_t LnnStopConnectionFsm(LnnConnectionFsm *connFsm, LnnConnectionFsmStopCallback callback)
780 {
781 return GetLocalLedgerDepsInterface()->LnnStopConnectionFsm(connFsm, callback);
782 }
783
LnnDeinitFastOffline(void)784 void LnnDeinitFastOffline(void)
785 {
786 return GetLocalLedgerDepsInterface()->LnnDeinitFastOffline();
787 }
788
LnnSendNewNetworkOnlineToConnFsm(LnnConnectionFsm * connFsm)789 int32_t LnnSendNewNetworkOnlineToConnFsm(LnnConnectionFsm *connFsm)
790 {
791 return GetLocalLedgerDepsInterface()->LnnSendNewNetworkOnlineToConnFsm(connFsm);
792 }
793
LnnSendAuthResultMsgToConnFsm(LnnConnectionFsm * connFsm,int32_t retCode)794 int32_t LnnSendAuthResultMsgToConnFsm(LnnConnectionFsm *connFsm, int32_t retCode)
795 {
796 return GetLocalLedgerDepsInterface()->LnnSendAuthResultMsgToConnFsm(connFsm, retCode);
797 }
798
LnnSendDisconnectMsgToConnFsm(LnnConnectionFsm * connFsm)799 int32_t LnnSendDisconnectMsgToConnFsm(LnnConnectionFsm *connFsm)
800 {
801 return GetLocalLedgerDepsInterface()->LnnSendDisconnectMsgToConnFsm(connFsm);
802 }
803
LnnSendNotTrustedToConnFsm(LnnConnectionFsm * connFsm)804 int32_t LnnSendNotTrustedToConnFsm(LnnConnectionFsm *connFsm)
805 {
806 return GetLocalLedgerDepsInterface()->LnnSendNotTrustedToConnFsm(connFsm);
807 }
808
LnnSendLeaveRequestToConnFsm(LnnConnectionFsm * connFsm)809 int32_t LnnSendLeaveRequestToConnFsm(LnnConnectionFsm *connFsm)
810 {
811 return GetLocalLedgerDepsInterface()->LnnSendLeaveRequestToConnFsm(connFsm);
812 }
813
LnnSendSyncOfflineFinishToConnFsm(LnnConnectionFsm * connFsm)814 int32_t LnnSendSyncOfflineFinishToConnFsm(LnnConnectionFsm *connFsm)
815 {
816 return GetLocalLedgerDepsInterface()->LnnSendSyncOfflineFinishToConnFsm(connFsm);
817 }
818
LnnGetLocalWeight(void)819 int32_t LnnGetLocalWeight(void)
820 {
821 return GetLocalLedgerDepsInterface()->LnnGetLocalWeight();
822 }
823
AuthMetaReleaseVerify(int64_t authId)824 void AuthMetaReleaseVerify(int64_t authId)
825 {
826 return GetLocalLedgerDepsInterface()->AuthMetaReleaseVerify(authId);
827 }
828
LnnSendJoinRequestToConnFsm(LnnConnectionFsm * connFsm,bool isForceJoin)829 int32_t LnnSendJoinRequestToConnFsm(LnnConnectionFsm *connFsm, bool isForceJoin)
830 {
831 return GetLocalLedgerDepsInterface()->LnnSendJoinRequestToConnFsm(connFsm, isForceJoin);
832 }
833
LnnNotifyJoinResult(ConnectionAddr * addr,const char * networkId,int32_t retCode)834 void LnnNotifyJoinResult(ConnectionAddr *addr, const char *networkId, int32_t retCode)
835 {
836 return GetLocalLedgerDepsInterface()->LnnNotifyJoinResult(addr, networkId, retCode);
837 }
838
LnnDestroyConnectionFsm(LnnConnectionFsm * connFsm)839 void LnnDestroyConnectionFsm(LnnConnectionFsm *connFsm)
840 {
841 return GetLocalLedgerDepsInterface()->LnnDestroyConnectionFsm(connFsm);
842 }
843
LnnCreateConnectionFsm(const ConnectionAddr * target,const char * pkgName,bool isNeedConnect)844 LnnConnectionFsm *LnnCreateConnectionFsm(const ConnectionAddr *target, const char *pkgName, bool isNeedConnect)
845 {
846 return GetLocalLedgerDepsInterface()->LnnCreateConnectionFsm(target, pkgName, false);
847 }
848
LnnStartConnectionFsm(LnnConnectionFsm * connFsm)849 int32_t LnnStartConnectionFsm(LnnConnectionFsm *connFsm)
850 {
851 return GetLocalLedgerDepsInterface()->LnnStartConnectionFsm(connFsm);
852 }
853
LnnNotifyMasterNodeChanged(bool isMaster,const char * masterNodeUdid,int32_t weight)854 void LnnNotifyMasterNodeChanged(bool isMaster, const char *masterNodeUdid, int32_t weight)
855 {
856 return GetLocalLedgerDepsInterface()->LnnNotifyMasterNodeChanged(isMaster, masterNodeUdid, weight);
857 }
858
LnnInitFastOffline(void)859 int32_t LnnInitFastOffline(void)
860 {
861 return GetLocalLedgerDepsInterface()->LnnInitFastOffline();
862 }
863
LnnNotifyNodeAddressChanged(const char * addr,const char * networkId,bool isLocal)864 void LnnNotifyNodeAddressChanged(const char *addr, const char *networkId, bool isLocal)
865 {
866 return GetLocalLedgerDepsInterface()->LnnNotifyNodeAddressChanged(addr, networkId, isLocal);
867 }
868
LnnInitOffline(void)869 int32_t LnnInitOffline(void)
870 {
871 return GetLocalLedgerDepsInterface()->LnnInitOffline();
872 }
873
LnnDeinitOffline(void)874 void LnnDeinitOffline(void)
875 {
876 return GetLocalLedgerDepsInterface()->LnnDeinitOffline();
877 }
878
GetAuthRequest(uint32_t requestId,AuthRequest * request)879 int32_t GetAuthRequest(uint32_t requestId, AuthRequest *request)
880 {
881 return GetLocalLedgerDepsInterface()->GetAuthRequest(requestId, request);
882 }
883
SoftBusGetBrState(void)884 int32_t SoftBusGetBrState(void)
885 {
886 return GetLocalLedgerDepsInterface()->SoftBusGetBrState();
887 }
888
LnnSetNetCapability(uint32_t * capability,NetCapability type)889 int32_t LnnSetNetCapability(uint32_t *capability, NetCapability type)
890 {
891 return GetLocalLedgerDepsInterface()->LnnSetNetCapability(capability, type);
892 }
893
LnnClearNetCapability(uint32_t * capability,NetCapability type)894 int32_t LnnClearNetCapability(uint32_t *capability, NetCapability type)
895 {
896 return GetLocalLedgerDepsInterface()->LnnClearNetCapability(capability, type);
897 }
898
LnnRegisterEventHandler(LnnEventType event,LnnEventHandler handler)899 int32_t LnnRegisterEventHandler(LnnEventType event, LnnEventHandler handler)
900 {
901 return GetLocalLedgerDepsInterface()->LnnRegisterEventHandler(event, handler);
902 }
903
LnnNotifyDeviceVerified(const char * udid)904 void LnnNotifyDeviceVerified(const char *udid)
905 {
906 return GetLocalLedgerDepsInterface()->LnnNotifyDeviceVerified(udid);
907 }
908
LnnInitBusCenterEvent(void)909 int32_t LnnInitBusCenterEvent(void)
910 {
911 return GetLocalLedgerDepsInterface()->LnnInitBusCenterEvent();
912 }
913
LnnInitBatteryInfo(void)914 int32_t LnnInitBatteryInfo(void)
915 {
916 return GetLocalLedgerDepsInterface()->LnnInitBatteryInfo();
917 }
918
LnnDeinitBatteryInfo(void)919 void LnnDeinitBatteryInfo(void)
920 {
921 return GetLocalLedgerDepsInterface()->LnnDeinitBatteryInfo();
922 }
923
LnnDeinitNetworkInfo(void)924 void LnnDeinitNetworkInfo(void)
925 {
926 return GetLocalLedgerDepsInterface()->LnnDeinitNetworkInfo();
927 }
928
LnnDeinitDevicename(void)929 void LnnDeinitDevicename(void)
930 {
931 return GetLocalLedgerDepsInterface()->LnnDeinitDevicename();
932 }
933
LnnPrintConnectionAddr(const ConnectionAddr * addr)934 const char *LnnPrintConnectionAddr(const ConnectionAddr *addr)
935 {
936 return GetLocalLedgerDepsInterface()->LnnPrintConnectionAddr(addr);
937 }
938
LnnConvertAddrToAuthConnInfo(const ConnectionAddr * addr,AuthConnInfo * connInfo)939 bool LnnConvertAddrToAuthConnInfo(const ConnectionAddr *addr, AuthConnInfo *connInfo)
940 {
941 return GetLocalLedgerDepsInterface()->LnnConvertAddrToAuthConnInfo(addr, connInfo);
942 }
943
LnnFsmRemoveMessageByType(FsmStateMachine * fsm,int32_t what)944 int32_t LnnFsmRemoveMessageByType(FsmStateMachine *fsm, int32_t what)
945 {
946 return GetLocalLedgerDepsInterface()->LnnFsmRemoveMessageByType(fsm, what);
947 }
948
LnnDeinitBusCenterEvent(void)949 void LnnDeinitBusCenterEvent(void)
950 {
951 return GetLocalLedgerDepsInterface()->LnnDeinitBusCenterEvent();
952 }
953
AuthStartVerify(const AuthConnInfo * connInfo,const AuthVerifyParam * authVerifyParam,const AuthVerifyCallback * callback)954 int32_t AuthStartVerify(const AuthConnInfo *connInfo, const AuthVerifyParam *authVerifyParam,
955 const AuthVerifyCallback *callback)
956 {
957 return GetLocalLedgerDepsInterface()->AuthStartVerify(connInfo, authVerifyParam, callback);
958 }
959
LnnIsNeedCleanConnectionFsm(const NodeInfo * nodeInfo,ConnectionAddrType type)960 bool LnnIsNeedCleanConnectionFsm(const NodeInfo *nodeInfo, ConnectionAddrType type)
961 {
962 return GetLocalLedgerDepsInterface()->LnnIsNeedCleanConnectionFsm(nodeInfo, type);
963 }
964
AuthFlushDevice(const char * uuid)965 int32_t AuthFlushDevice(const char *uuid)
966 {
967 return GetLocalLedgerDepsInterface()->AuthFlushDevice(uuid);
968 }
969
LnnPutDBData(int32_t dbId,char * putKey,uint32_t putKeyLen,char * putValue,uint32_t putValueLen)970 int32_t LnnPutDBData(int32_t dbId, char *putKey, uint32_t putKeyLen, char *putValue, uint32_t putValueLen)
971 {
972 return GetLocalLedgerDepsInterface()->LnnPutDBData(dbId, putKey, putKeyLen, putValue, putValueLen);
973 }
974
LnnCloudSync(int32_t dbId)975 int32_t LnnCloudSync(int32_t dbId)
976 {
977 return GetLocalLedgerDepsInterface()->LnnCloudSync(dbId);
978 }
979
LnnSyncP2pInfo(void)980 int32_t LnnSyncP2pInfo(void)
981 {
982 return GetLocalLedgerDepsInterface()->LnnSyncP2pInfo();
983 }
984
LnnSyncWifiDirectAddr(void)985 int32_t LnnSyncWifiDirectAddr(void)
986 {
987 return GetLocalLedgerDepsInterface()->LnnSyncWifiDirectAddr();
988 }
989
LnnInitPtk(void)990 int32_t LnnInitPtk(void)
991 {
992 return GetLocalLedgerDepsInterface()->LnnInitPtk();
993 }
994
LnnGetLocalPtkByUdid(const char * udid,char * localPtk,uint32_t len)995 int32_t LnnGetLocalPtkByUdid(const char *udid, char *localPtk, uint32_t len)
996 {
997 return GetLocalLedgerDepsInterface()->LnnGetLocalPtkByUdid(udid, localPtk, len);
998 }
999
LnnGetLocalPtkByUuid(const char * uuid,char * localPtk,uint32_t len)1000 int32_t LnnGetLocalPtkByUuid(const char *uuid, char *localPtk, uint32_t len)
1001 {
1002 return GetLocalLedgerDepsInterface()->LnnGetLocalPtkByUuid(uuid, localPtk, len);
1003 }
1004
LnnGetLocalDefaultPtkByUuid(const char * uuid,char * localPtk,uint32_t len)1005 int32_t LnnGetLocalDefaultPtkByUuid(const char *uuid, char *localPtk, uint32_t len)
1006 {
1007 return GetLocalLedgerDepsInterface()->LnnGetLocalDefaultPtkByUuid(uuid, localPtk, len);
1008 }
1009
LnnGetRemoteDefaultPtkByUuid(const char * uuid,char * remotePtk,uint32_t len)1010 int32_t LnnGetRemoteDefaultPtkByUuid(const char *uuid, char *remotePtk, uint32_t len)
1011 {
1012 return GetLocalLedgerDepsInterface()->LnnGetRemoteDefaultPtkByUuid(uuid, remotePtk, len);
1013 }
1014
LnnSyncPtk(const char * networkId)1015 int32_t LnnSyncPtk(const char *networkId)
1016 {
1017 return GetLocalLedgerDepsInterface()->LnnSyncPtk(networkId);
1018 }
1019
UpdateLocalPtkIfValid(char * udid)1020 int32_t UpdateLocalPtkIfValid(char *udid)
1021 {
1022 return GetLocalLedgerDepsInterface()->UpdateLocalPtkIfValid(udid);
1023 }
1024
LnnSetLocalPtkConn(char * udid)1025 int32_t LnnSetLocalPtkConn(char *udid)
1026 {
1027 return GetLocalLedgerDepsInterface()->LnnSetLocalPtkConn(udid);
1028 }
1029
LnnGenerateLocalPtk(char * udid,char * uuid)1030 int32_t LnnGenerateLocalPtk(char *udid, char *uuid)
1031 {
1032 return GetLocalLedgerDepsInterface()->LnnGenerateLocalPtk(udid, uuid);
1033 }
1034
LnnGenerateMetaPtk(uint32_t connId)1035 int32_t LnnGenerateMetaPtk(uint32_t connId)
1036 {
1037 return GetLocalLedgerDepsInterface()->LnnGenerateMetaPtk(connId);
1038 }
1039
LnnGetMetaPtk(uint32_t connId,char * metaPtk,uint32_t len)1040 int32_t LnnGetMetaPtk(uint32_t connId, char *metaPtk, uint32_t len)
1041 {
1042 return GetLocalLedgerDepsInterface()->LnnGetMetaPtk(connId, metaPtk, len);
1043 }
1044
LnnDeleteMetaPtk(uint32_t connectionId)1045 int32_t LnnDeleteMetaPtk(uint32_t connectionId)
1046 {
1047 return GetLocalLedgerDepsInterface()->LnnDeleteMetaPtk(connectionId);
1048 }
1049
UpdatePtkByAuth(char * networkId,AuthHandle authHandle)1050 int32_t UpdatePtkByAuth(char *networkId, AuthHandle authHandle)
1051 {
1052 return GetLocalLedgerDepsInterface()->UpdatePtkByAuth(networkId, authHandle);
1053 }
1054
SoftBusEnableBt(void)1055 int32_t SoftBusEnableBt(void)
1056 {
1057 return GetLocalLedgerDepsInterface()->SoftBusEnableBt();
1058 }
1059
SoftBusDisableBt(void)1060 int32_t SoftBusDisableBt(void)
1061 {
1062 return GetLocalLedgerDepsInterface()->SoftBusDisableBt();
1063 }
1064
SoftBusGetBtName(unsigned char * name,unsigned int * len)1065 int32_t SoftBusGetBtName(unsigned char *name, unsigned int *len)
1066 {
1067 return GetLocalLedgerDepsInterface()->SoftBusGetBtName(name, len);
1068 }
1069
SoftBusSetBtName(const char * name)1070 int32_t SoftBusSetBtName(const char *name)
1071 {
1072 return GetLocalLedgerDepsInterface()->SoftBusSetBtName(name);
1073 }
1074
SoftBusAddBtStateListener(const SoftBusBtStateListener * listener,int * listenerId)1075 int32_t SoftBusAddBtStateListener(const SoftBusBtStateListener *listener, int *listenerId)
1076 {
1077 return GetLocalLedgerDepsInterface()->SoftBusAddBtStateListener(listener, listenerId);
1078 }
1079
SoftBusRemoveBtStateListener(int listenerId)1080 int32_t SoftBusRemoveBtStateListener(int listenerId)
1081 {
1082 return GetLocalLedgerDepsInterface()->SoftBusRemoveBtStateListener(listenerId);
1083 }
1084
SoftBusBtInit(void)1085 int32_t SoftBusBtInit(void)
1086 {
1087 return GetLocalLedgerDepsInterface()->SoftBusBtInit();
1088 }
1089
SoftBusBase64Encode(unsigned char * dst,size_t dlen,size_t * olen,const unsigned char * src,size_t slen)1090 int32_t SoftBusBase64Encode(unsigned char *dst, size_t dlen,
1091 size_t *olen, const unsigned char *src, size_t slen)
1092 {
1093 return GetLocalLedgerDepsInterface()->SoftBusBase64Encode(dst, dlen, olen, src, slen);
1094 }
1095
SoftBusBase64Decode(unsigned char * dst,size_t dlen,size_t * olen,const unsigned char * src,size_t slen)1096 int32_t SoftBusBase64Decode(unsigned char *dst, size_t dlen,
1097 size_t *olen, const unsigned char *src, size_t slen)
1098 {
1099 return GetLocalLedgerDepsInterface()->SoftBusBase64Decode(dst, dlen, olen, src, slen);
1100 }
1101
SoftBusGenerateStrHash(const unsigned char * str,uint32_t len,unsigned char * hash)1102 int32_t SoftBusGenerateStrHash(const unsigned char *str, uint32_t len, unsigned char *hash)
1103 {
1104 return GetLocalLedgerDepsInterface()->SoftBusGenerateStrHash(str, len, hash);
1105 }
1106
SoftBusGenerateSessionKey(char * key,uint32_t len)1107 int32_t SoftBusGenerateSessionKey(char *key, uint32_t len)
1108 {
1109 return GetLocalLedgerDepsInterface()->SoftBusGenerateSessionKey(key, len);
1110 }
1111
SoftBusCryptoRand(void)1112 uint32_t SoftBusCryptoRand(void)
1113 {
1114 return GetLocalLedgerDepsInterface()->SoftBusCryptoRand();
1115 }
1116
LnnGetLocalDevInfoPacked(NodeInfo * deviceInfo)1117 int32_t LnnGetLocalDevInfoPacked(NodeInfo *deviceInfo)
1118 {
1119 return GetLocalLedgerDepsInterface()->LnnGetLocalDevInfoPacked(deviceInfo);
1120 }
1121
LnnRemoveStorageConfigPath(LnnFileId id)1122 int32_t LnnRemoveStorageConfigPath(LnnFileId id)
1123 {
1124 return GetLocalLedgerDepsInterface()->LnnRemoveStorageConfigPath(id);
1125 }
1126
InitTrustedDevInfoTable(void)1127 int32_t InitTrustedDevInfoTable(void)
1128 {
1129 return GetLocalLedgerDepsInterface()->InitTrustedDevInfoTable();
1130 }
1131
LnnLoadLocalBroadcastCipherKeyPacked(void)1132 int32_t LnnLoadLocalBroadcastCipherKeyPacked(void)
1133 {
1134 return GetLocalLedgerDepsInterface()->LnnLoadLocalBroadcastCipherKeyPacked();
1135 }
1136
LnnUpdateLocalBroadcastCipherKeyPacked(BroadcastCipherKey * broadcastKey)1137 int32_t LnnUpdateLocalBroadcastCipherKeyPacked(BroadcastCipherKey *broadcastKey)
1138 {
1139 return GetLocalLedgerDepsInterface()->LnnUpdateLocalBroadcastCipherKeyPacked(broadcastKey);
1140 }
1141 } // extern "C"
1142 } // namespace OHOS
1143