1 /*
2  * Copyright (c) 2022 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_SELECT_RULE_H
17 #define LNN_SELECT_RULE_H
18 
19 #include "softbus_common.h"
20 #include "lnn_lane_select.h"
21 #include "lnn_lane_interface.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #define UNACCEPT_SCORE 20
28 
29 typedef enum {
30     HIGH_BAND_WIDTH = 0,
31     MIDDLE_HIGH_BAND_WIDTH,
32     MIDDLE_LOW_BAND_WIDTH,
33     LOW_BAND_WIDTH,
34     BW_TYPE_BUTT,
35 } BandWidthType;
36 
37 typedef struct {
38     bool available;
39     int32_t (*linkCapCheck)(const char *networkId);
40     int32_t (*getLinkScore)(const char *networkId, uint32_t expectedBw);
41 } LinkAttribute;
42 
43 int32_t GetWlanLinkedFrequency(void);
44 
45 LinkAttribute *GetLinkAttrByLinkType(LaneLinkType linkType);
46 
47 int32_t DecideAvailableLane(const char *networkId, const LaneSelectParam *request,
48     LanePreferredLinkList *recommendList);
49 
50 int32_t FinalDecideLinkType(const char *networkId, LaneLinkType *linkList,
51     uint32_t listNum, LanePreferredLinkList *recommendList);
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 #endif // LNN_SELECT_RULE_H