1 /*
2  * Copyright (C) 2015-2018 Alibaba Group Holding Limited
3  */
4 
5 #ifndef __AWSS_APLIST_H__
6 #define __AWSS_APLIST_H__
7 
8 #include <stdint.h>
9 
10 #include "os.h"
11 #include "zconfig_protocol.h"
12 
13 #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */
14 extern "C" {
15 #endif
16 #ifdef AWSS_SUPPORT_APLIST
17 struct ap_info {
18     uint8_t auth;
19     uint8_t channel;
20     uint8_t encry[2];
21     uint8_t mac[ETH_ALEN];
22     char ssid[ZC_MAX_SSID_LEN];
23     signed char rssi;
24 };
25 
26 void aws_try_adjust_chan(void);
27 
28 int awss_clear_aplist(void);
29 int awss_is_ready_clr_aplist(void);
30 int awss_open_aplist_monitor(void);
31 int awss_close_aplist_monitor(void);
32 int awss_init_ieee80211_aplist(void);
33 int awss_deinit_ieee80211_aplist(void);
34 int awss_get_auth_info(uint8_t *ssid, uint8_t *bssid, uint8_t *auth,
35                        uint8_t *encry, uint8_t *channel);
36 int awss_ieee80211_aplist_process(uint8_t *mgmt_header, int len, int link_type,
37                                   struct parser_res *res, signed char rssi);
38 int awss_save_apinfo(uint8_t *ssid, uint8_t *bssid, uint8_t channel,
39                      uint8_t auth, uint8_t pairwise_cipher,
40                      uint8_t group_cipher, signed char rssi);
41 
42 /* storage to store apinfo */
43 extern struct ap_info *zconfig_aplist;
44 /* aplist num, less than MAX_APLIST_NUM */
45 extern uint8_t zconfig_aplist_num;
46 #endif
47 
48 #if defined(__cplusplus) /* If this is a C++ compiler, use C linkage */
49 }
50 #endif
51 #endif
52