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