1 /*
2  * Copyright (C) 2021-2023 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 NSTACKX_DEVICE_REMOTE_H
17 #define NSTACKX_DEVICE_REMOTE_H
18 
19 #ifdef DFINDER_SAVE_DEVICE_LIST
20 #include "nstackx_device.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 int32_t RemoteDeviceListInit(void);
27 void RemoteDeviceListDeinit(void);
28 void ClearRemoteDeviceListBackup(void);
29 void BackupRemoteDeviceList(void);
30 void DestroyRxIfaceByIfname(const char *ifName);
31 const struct in_addr *GetRemoteDeviceIp(const char *deviceId);
32 int32_t UpdateRemoteNodeByDeviceInfo(const char *deviceId, const NSTACKX_InterfaceInfo *interfaceInfo,
33     const struct in_addr *remoteIp, const DeviceInfo *deviceInfo, int8_t *updated);
34 
35 void GetDeviceList(NSTACKX_DeviceInfo *deviceList, uint32_t *deviceCountPtr, bool doFilter);
36 void SetDeviceListAgingTime(uint32_t agingTime);
37 void RemoveOldestNodesWithCount(uint32_t diffNum);
38 uint32_t GetRemoteNodeCount(void);
39 #ifdef NSTACKX_DFINDER_HIDUMP
40 int DumpRemoteDevice(char *buf, size_t len);
41 #endif
42 
43 #ifdef __cplusplus
44 }
45 #endif
46 
47 #endif /* DFINDER_SAVE_DEVICE_LIST */
48 
49 #endif /* NSTACKX_DEVICE_REMOTE_H */
50