1 /* 2 * Copyright (c) 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 #ifndef LNN_CONNID_CALLBACK_MANAGER 17 #define LNN_CONNID_CALLBACK_MANAGER 18 19 #include "common_list.h" 20 #include "softbus_common.h" 21 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 27 typedef struct { 28 void (*lnnServerJoinExtCallback)(const ConnectionAddr *addr, int32_t returnRet); 29 } LnnServerJoinExtCallBack; 30 31 typedef struct { 32 ListNode node; 33 char udid[UDID_BUF_LEN]; 34 ConnectionAddr sessionAddr; 35 LnnServerJoinExtCallBack callBack; 36 uint32_t connId; 37 } ConnIdCbInfo; 38 39 int32_t LnnInitConnIdCallbackManager(void); 40 void LnnDeinitConnIdCallbackManager(void); 41 42 int32_t AddConnIdCallbackInfoItem(const ConnectionAddr *sessionAddr, const LnnServerJoinExtCallBack *callBack, 43 uint32_t connId, char *peerUdid); 44 int32_t DelConnIdCallbackInfoItem(uint32_t connId); 45 void InvokeCallbackForJoinExt(const char *udid, int32_t result); 46 int32_t GetConnIdCbInfoByAddr(const ConnectionAddr *addr, ConnIdCbInfo *dupItem); 47 48 49 #ifdef __cplusplus 50 } 51 #endif 52 53 #endif // LNN_CONNID_CALLBACK_MANAGER