1 /* 2 * Copyright (c) 2021 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 #ifndef LNN_BUS_CENTER_IPC_H 17 #define LNN_BUS_CENTER_IPC_H 18 19 #include <stdbool.h> 20 #include <stdint.h> 21 22 #include "softbus_bus_center.h" 23 24 #ifdef __cplusplus 25 extern "C" { 26 #endif 27 28 int32_t LnnIpcInit (void); 29 int32_t LnnIpcServerJoin(const char *pkgName, int32_t callingPid, void *addr, uint32_t addrTypeLen); 30 int32_t MetaNodeIpcServerJoin( 31 const char *pkgName, int32_t callingPid, void *addr, CustomData *customData, uint32_t addrTypeLen); 32 int32_t LnnIpcServerLeave(const char *pkgName, int32_t callingPid, const char *networkId); 33 int32_t MetaNodeIpcServerLeave(const char *pkgName, int32_t callingPid, const char *networkId); 34 int32_t LnnIpcGetAllOnlineNodeInfo(const char *pkgName, void **info, uint32_t infoTypeLen, int *infoNum); 35 int32_t LnnIpcGetLocalDeviceInfo(const char *pkgName, void *info, uint32_t infoTypeLen); 36 int32_t LnnIpcGetNodeKeyInfo(const char *pkgName, const char *networkId, int key, unsigned char *buf, uint32_t len); 37 int32_t LnnIpcSetNodeDataChangeFlag(const char *pkgName, const char *networkId, uint16_t dataChangeFlag); 38 int32_t LnnIpcGetNodeKeyInfoLen(int32_t key); 39 int32_t LnnIpcStartTimeSync( 40 const char *pkgName, int32_t callingPid, const char *targetNetworkId, int32_t accuracy, int32_t period); 41 int32_t LnnIpcStopTimeSync(const char *pkgName, const char *targetNetworkId); 42 int32_t LnnIpcPublishLNN(const char *pkgName, const PublishInfo *info); 43 int32_t LnnIpcStopPublishLNN(const char *pkgName, int32_t publishId); 44 int32_t LnnIpcRefreshLNN(const char *pkgName, int32_t callingPid, const SubscribeInfo *info); 45 int32_t LnnIpcStopRefreshLNN(const char *pkgName, int32_t callingPid, int32_t refreshId); 46 int32_t LnnIpcActiveMetaNode(const MetaNodeConfigInfo *info, char *metaNodeId); 47 int32_t LnnIpcDeactiveMetaNode(const char *metaNodeId); 48 int32_t LnnIpcGetAllMetaNodeInfo(MetaNodeInfo *infos, int32_t *infoNum); 49 50 int32_t LnnIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char *networkId, int32_t retCode); 51 int32_t MetaNodeIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char *networkId, int32_t retCode); 52 int32_t LnnIpcNotifyLeaveResult(const char *networkId, int32_t retCode); 53 int32_t MetaNodeIpcNotifyLeaveResult(const char *networkId, int32_t retCode); 54 int32_t LnnIpcNotifyOnlineState(bool isOnline, void *info, uint32_t infoTypeLen); 55 int32_t LnnIpcNotifyBasicInfoChanged(void *info, uint32_t infoTypeLen, int32_t type); 56 int32_t LnnIpcNotifyTimeSyncResult( 57 const char *pkgName, int32_t pid, const void *info, uint32_t infoTypeLen, int32_t retCode); 58 59 int32_t LnnIpcShiftLNNGear(const char *pkgName, const char *callerId, const char *targetNetworkId, 60 const GearMode *mode); 61 62 void BusCenterServerDeathCallback(const char *pkgName); 63 64 #ifdef __cplusplus 65 } 66 #endif 67 #endif /* LNN_L2_BUS_CENTER_IPC_H */