2009-12-27 20:07:47 +01:00
|
|
|
/*
|
|
|
|
* BSS table
|
2010-01-02 12:57:44 +01:00
|
|
|
* Copyright (c) 2009-2010, Jouni Malinen <j@w1.fi>
|
2009-12-27 20:07:47 +01:00
|
|
|
*
|
2012-02-11 15:46:35 +01:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2009-12-27 20:07:47 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BSS_H
|
|
|
|
#define BSS_H
|
|
|
|
|
2010-01-02 15:41:38 +01:00
|
|
|
struct wpa_scan_res;
|
|
|
|
|
2009-12-27 20:07:47 +01:00
|
|
|
#define WPA_BSS_QUAL_INVALID BIT(0)
|
|
|
|
#define WPA_BSS_NOISE_INVALID BIT(1)
|
|
|
|
#define WPA_BSS_LEVEL_INVALID BIT(2)
|
|
|
|
#define WPA_BSS_LEVEL_DBM BIT(3)
|
|
|
|
#define WPA_BSS_AUTHENTICATED BIT(4)
|
|
|
|
#define WPA_BSS_ASSOCIATED BIT(5)
|
2011-10-16 21:44:28 +02:00
|
|
|
#define WPA_BSS_ANQP_FETCH_TRIED BIT(6)
|
2009-12-27 20:07:47 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* struct wpa_bss - BSS table
|
|
|
|
* @list: List entry for struct wpa_supplicant::bss
|
2009-12-27 23:30:38 +01:00
|
|
|
* @list_id: List entry for struct wpa_supplicant::bss_id
|
2009-12-27 20:07:47 +01:00
|
|
|
* @id: Unique identifier for this BSS entry
|
|
|
|
* @scan_miss_count: Number of counts without seeing this BSS
|
|
|
|
* @flags: information flags about the BSS/IBSS (WPA_BSS_*)
|
|
|
|
* @last_update_idx: Index of the last scan update
|
|
|
|
* @bssid: BSSID
|
|
|
|
* @freq: frequency of the channel in MHz (e.g., 2412 = channel 1)
|
|
|
|
* @beacon_int: beacon interval in TUs (host byte order)
|
|
|
|
* @caps: capability information field in host byte order
|
|
|
|
* @qual: signal quality
|
|
|
|
* @noise: noise level
|
|
|
|
* @level: signal level
|
|
|
|
* @tsf: Timestamp of last Beacon/Probe Response frame
|
2010-01-04 15:52:30 +01:00
|
|
|
* @last_update: Time of the last update (i.e., Beacon or Probe Response RX)
|
2010-01-16 15:11:05 +01:00
|
|
|
* @ie_len: length of the following IE field in octets (from Probe Response)
|
|
|
|
* @beacon_ie_len: length of the following Beacon IE field in octets
|
2009-12-27 20:07:47 +01:00
|
|
|
*
|
|
|
|
* This structure is used to store information about neighboring BSSes in
|
|
|
|
* generic format. It is mainly updated based on scan results from the driver.
|
|
|
|
*/
|
|
|
|
struct wpa_bss {
|
|
|
|
struct dl_list list;
|
2009-12-27 23:30:38 +01:00
|
|
|
struct dl_list list_id;
|
2009-12-27 20:07:47 +01:00
|
|
|
unsigned int id;
|
|
|
|
unsigned int scan_miss_count;
|
|
|
|
unsigned int last_update_idx;
|
|
|
|
unsigned int flags;
|
|
|
|
u8 bssid[ETH_ALEN];
|
|
|
|
u8 ssid[32];
|
|
|
|
size_t ssid_len;
|
|
|
|
int freq;
|
|
|
|
u16 beacon_int;
|
|
|
|
u16 caps;
|
|
|
|
int qual;
|
|
|
|
int noise;
|
|
|
|
int level;
|
|
|
|
u64 tsf;
|
|
|
|
struct os_time last_update;
|
2011-10-16 21:44:28 +02:00
|
|
|
#ifdef CONFIG_INTERWORKING
|
|
|
|
struct wpabuf *anqp_venue_name;
|
|
|
|
struct wpabuf *anqp_network_auth_type;
|
|
|
|
struct wpabuf *anqp_roaming_consortium;
|
|
|
|
struct wpabuf *anqp_ip_addr_type_availability;
|
|
|
|
struct wpabuf *anqp_nai_realm;
|
|
|
|
struct wpabuf *anqp_3gpp;
|
|
|
|
struct wpabuf *anqp_domain_name;
|
|
|
|
#endif /* CONFIG_INTERWORKING */
|
2009-12-27 20:07:47 +01:00
|
|
|
size_t ie_len;
|
2010-01-16 15:11:05 +01:00
|
|
|
size_t beacon_ie_len;
|
2009-12-27 20:07:47 +01:00
|
|
|
/* followed by ie_len octets of IEs */
|
2010-01-16 15:11:05 +01:00
|
|
|
/* followed by beacon_ie_len octets of IEs */
|
2009-12-27 20:07:47 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
void wpa_bss_update_start(struct wpa_supplicant *wpa_s);
|
|
|
|
void wpa_bss_update_scan_res(struct wpa_supplicant *wpa_s,
|
|
|
|
struct wpa_scan_res *res);
|
2010-01-02 12:57:44 +01:00
|
|
|
void wpa_bss_update_end(struct wpa_supplicant *wpa_s, struct scan_info *info,
|
|
|
|
int new_scan);
|
2009-12-27 20:07:47 +01:00
|
|
|
int wpa_bss_init(struct wpa_supplicant *wpa_s);
|
|
|
|
void wpa_bss_deinit(struct wpa_supplicant *wpa_s);
|
2011-03-20 11:02:33 +01:00
|
|
|
void wpa_bss_flush(struct wpa_supplicant *wpa_s);
|
|
|
|
void wpa_bss_flush_by_age(struct wpa_supplicant *wpa_s, int age);
|
2010-01-02 12:36:12 +01:00
|
|
|
struct wpa_bss * wpa_bss_get(struct wpa_supplicant *wpa_s, const u8 *bssid,
|
|
|
|
const u8 *ssid, size_t ssid_len);
|
2009-12-27 23:30:38 +01:00
|
|
|
struct wpa_bss * wpa_bss_get_bssid(struct wpa_supplicant *wpa_s,
|
|
|
|
const u8 *bssid);
|
2012-02-07 15:23:21 +01:00
|
|
|
struct wpa_bss * wpa_bss_get_p2p_dev_addr(struct wpa_supplicant *wpa_s,
|
|
|
|
const u8 *dev_addr);
|
2009-12-27 23:30:38 +01:00
|
|
|
struct wpa_bss * wpa_bss_get_id(struct wpa_supplicant *wpa_s, unsigned int id);
|
|
|
|
const u8 * wpa_bss_get_ie(const struct wpa_bss *bss, u8 ie);
|
|
|
|
const u8 * wpa_bss_get_vendor_ie(const struct wpa_bss *bss, u32 vendor_type);
|
|
|
|
struct wpabuf * wpa_bss_get_vendor_ie_multi(const struct wpa_bss *bss,
|
|
|
|
u32 vendor_type);
|
2009-12-28 00:09:32 +01:00
|
|
|
int wpa_bss_get_max_rate(const struct wpa_bss *bss);
|
2010-01-04 15:52:30 +01:00
|
|
|
int wpa_bss_get_bit_rates(const struct wpa_bss *bss, u8 **rates);
|
2009-12-27 20:07:47 +01:00
|
|
|
|
|
|
|
#endif /* BSS_H */
|