1 /*
2  * Copyright (c) 2024 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_LANE_LINK_WIFI_DIRECT_H
17 #define LNN_LANE_LINK_WIFI_DIRECT_H
18 
19 #include "common_list.h"
20 #include "lnn_lane_interface.h"
21 #include "lnn_lane_link_conflict.h"
22 #include "softbus_common.h"
23 #include "wifi_direct_types.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 typedef enum {
30     FORCE_DOWN_LANE = 0,
31     FORCE_DOWN_TRANS,
32     FORCE_DOWN_BUTT,
33 } ForceDownType;
34 
35 typedef struct {
36     ListNode node;
37     uint32_t p2pRequestId;
38     char forceDownDevId[NETWORK_ID_BUF_LEN];
39     uint32_t forceDownReqId;
40     LaneLinkType forceDownLink;
41     uint32_t authRequestId;
42     AuthHandle authHandle;
43     ForceDownType downType;
44     SoftBusCond cond;
45 } ForceDownInfo;
46 
47 int32_t InitLinkWifiDirect(void);
48 void DeInitLinkWifiDirect(void);
49 int32_t HandleForceDownWifiDirect(const char *networkId, LinkConflictType conflictType, uint32_t p2pRequestId);
50 int32_t HandleForceDownWifiDirectTrans(const char *udidhashStr, LinkConflictType conflictType);
51 
52 #ifdef __cplusplus
53 }
54 #endif
55 #endif // LNN_LANE_LINK_WIFI_DIRECT_H
56