wpa_supplicant / hostapd
2.5
|
BSS table. More...
#include "utils/includes.h"
#include "utils/common.h"
#include "utils/eloop.h"
#include "common/ieee802_11_defs.h"
#include "drivers/driver.h"
#include "wpa_supplicant_i.h"
#include "config.h"
#include "notify.h"
#include "scan.h"
#include "bss.h"
Functions | |
struct wpa_bss_anqp * | wpa_bss_anqp_alloc (void) |
Allocate ANQP data structure for a BSS entry. More... | |
int | wpa_bss_anqp_unshare_alloc (struct wpa_bss *bss) |
Unshare ANQP data (if shared) in a BSS entry. More... | |
struct wpa_bss * | wpa_bss_get (struct wpa_supplicant *wpa_s, const u8 *bssid, const u8 *ssid, size_t ssid_len) |
Fetch a BSS table entry based on BSSID and SSID. More... | |
void | wpa_bss_update_start (struct wpa_supplicant *wpa_s) |
Start a BSS table update from scan results. More... | |
void | wpa_bss_update_scan_res (struct wpa_supplicant *wpa_s, struct wpa_scan_res *res, struct os_reltime *fetch_time) |
Update a BSS table entry based on a scan result. More... | |
void | wpa_bss_update_end (struct wpa_supplicant *wpa_s, struct scan_info *info, int new_scan) |
End a BSS table update from scan results. More... | |
void | wpa_bss_flush_by_age (struct wpa_supplicant *wpa_s, int age) |
Flush old BSS entries. More... | |
int | wpa_bss_init (struct wpa_supplicant *wpa_s) |
Initialize BSS table. More... | |
void | wpa_bss_flush (struct wpa_supplicant *wpa_s) |
Flush all unused BSS entries. More... | |
void | wpa_bss_deinit (struct wpa_supplicant *wpa_s) |
Deinitialize BSS table. More... | |
struct wpa_bss * | wpa_bss_get_bssid (struct wpa_supplicant *wpa_s, const u8 *bssid) |
Fetch a BSS table entry based on BSSID. More... | |
struct wpa_bss * | wpa_bss_get_bssid_latest (struct wpa_supplicant *wpa_s, const u8 *bssid) |
Fetch the latest BSS table entry based on BSSID. More... | |
struct wpa_bss * | wpa_bss_get_p2p_dev_addr (struct wpa_supplicant *wpa_s, const u8 *dev_addr) |
Fetch a BSS table entry based on P2P Device Addr. More... | |
struct wpa_bss * | wpa_bss_get_id (struct wpa_supplicant *wpa_s, unsigned int id) |
Fetch a BSS table entry based on identifier. More... | |
struct wpa_bss * | wpa_bss_get_id_range (struct wpa_supplicant *wpa_s, unsigned int idf, unsigned int idl) |
Fetch a BSS table entry based on identifier range. More... | |
const u8 * | wpa_bss_get_ie (const struct wpa_bss *bss, u8 ie) |
Fetch a specified information element from a BSS entry. More... | |
const u8 * | wpa_bss_get_vendor_ie (const struct wpa_bss *bss, u32 vendor_type) |
Fetch a vendor information element from a BSS entry. More... | |
const u8 * | wpa_bss_get_vendor_ie_beacon (const struct wpa_bss *bss, u32 vendor_type) |
Fetch a vendor information from a BSS entry. More... | |
struct wpabuf * | wpa_bss_get_vendor_ie_multi (const struct wpa_bss *bss, u32 vendor_type) |
Fetch vendor IE data from a BSS entry. More... | |
struct wpabuf * | wpa_bss_get_vendor_ie_multi_beacon (const struct wpa_bss *bss, u32 vendor_type) |
Fetch vendor IE data from a BSS entry. More... | |
int | wpa_bss_get_max_rate (const struct wpa_bss *bss) |
Get maximum legacy TX rate supported in a BSS. More... | |
int | wpa_bss_get_bit_rates (const struct wpa_bss *bss, u8 **rates) |
Get legacy TX rates supported in a BSS. More... | |
BSS table.
struct wpa_bss_anqp* wpa_bss_anqp_alloc | ( | void | ) |
Allocate ANQP data structure for a BSS entry.
The allocated ANQP data structure has its users count set to 1. It may be shared by multiple BSS entries and each shared entry is freed with wpa_bss_anqp_free().
int wpa_bss_anqp_unshare_alloc | ( | struct wpa_bss * | bss | ) |
Unshare ANQP data (if shared) in a BSS entry.
bss | BSS entry |
This function ensures the specific BSS entry has an ANQP data structure that is not shared with any other BSS entry.
void wpa_bss_deinit | ( | struct wpa_supplicant * | wpa_s | ) |
Deinitialize BSS table.
wpa_s | Pointer to wpa_supplicant data |
void wpa_bss_flush | ( | struct wpa_supplicant * | wpa_s | ) |
Flush all unused BSS entries.
wpa_s | Pointer to wpa_supplicant data |
void wpa_bss_flush_by_age | ( | struct wpa_supplicant * | wpa_s, |
int | age | ||
) |
Flush old BSS entries.
wpa_s | Pointer to wpa_supplicant data |
age | Maximum entry age in seconds |
Remove BSS entries that have not been updated during the last age seconds.
struct wpa_bss* wpa_bss_get | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | bssid, | ||
const u8 * | ssid, | ||
size_t | ssid_len | ||
) |
Fetch a BSS table entry based on BSSID and SSID.
wpa_s | Pointer to wpa_supplicant data |
bssid | BSSID |
ssid | SSID |
ssid_len | Length of ssid |
int wpa_bss_get_bit_rates | ( | const struct wpa_bss * | bss, |
u8 ** | rates | ||
) |
Get legacy TX rates supported in a BSS.
bss | BSS table entry |
rates | Buffer for returning a pointer to the rates list (units of 500 kbps) |
The caller is responsible for freeing the returned buffer with os_free() in case of success.
struct wpa_bss* wpa_bss_get_bssid | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | bssid | ||
) |
Fetch a BSS table entry based on BSSID.
wpa_s | Pointer to wpa_supplicant data |
bssid | BSSID |
struct wpa_bss* wpa_bss_get_bssid_latest | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | bssid | ||
) |
Fetch the latest BSS table entry based on BSSID.
wpa_s | Pointer to wpa_supplicant data |
bssid | BSSID |
This function is like wpa_bss_get_bssid(), but full BSS table is iterated to find the entry that has the most recent update. This can help in finding the correct entry in cases where the SSID of the AP may have changed recently (e.g., in WPS reconfiguration cases).
struct wpa_bss* wpa_bss_get_id | ( | struct wpa_supplicant * | wpa_s, |
unsigned int | id | ||
) |
Fetch a BSS table entry based on identifier.
wpa_s | Pointer to wpa_supplicant data |
id | Unique identifier (struct wpa_bss::id) assigned for the entry |
struct wpa_bss* wpa_bss_get_id_range | ( | struct wpa_supplicant * | wpa_s, |
unsigned int | idf, | ||
unsigned int | idl | ||
) |
Fetch a BSS table entry based on identifier range.
wpa_s | Pointer to wpa_supplicant data |
idf | Smallest allowed identifier assigned for the entry |
idf | Largest allowed identifier assigned for the entry |
This function is similar to wpa_bss_get_id() but allows a BSS entry with the smallest id value to be fetched within the specified range without the caller having to know the exact id.
const u8* wpa_bss_get_ie | ( | const struct wpa_bss * | bss, |
u8 | ie | ||
) |
Fetch a specified information element from a BSS entry.
bss | BSS table entry |
ie | Information element identitifier (WLAN_EID_*) |
This function returns the first matching information element in the BSS entry.
int wpa_bss_get_max_rate | ( | const struct wpa_bss * | bss | ) |
Get maximum legacy TX rate supported in a BSS.
bss | BSS table entry |
struct wpa_bss* wpa_bss_get_p2p_dev_addr | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | dev_addr | ||
) |
Fetch a BSS table entry based on P2P Device Addr.
wpa_s | Pointer to wpa_supplicant data |
dev_addr | P2P Device Address of the GO |
const u8* wpa_bss_get_vendor_ie | ( | const struct wpa_bss * | bss, |
u32 | vendor_type | ||
) |
Fetch a vendor information element from a BSS entry.
bss | BSS table entry |
vendor_type | Vendor type (four octets starting the IE payload) |
This function returns the first matching information element in the BSS entry.
const u8* wpa_bss_get_vendor_ie_beacon | ( | const struct wpa_bss * | bss, |
u32 | vendor_type | ||
) |
Fetch a vendor information from a BSS entry.
bss | BSS table entry |
vendor_type | Vendor type (four octets starting the IE payload) |
This function returns the first matching information element in the BSS entry.
This function is like wpa_bss_get_vendor_ie(), but uses IE buffer only from Beacon frames instead of either Beacon or Probe Response frames.
Fetch vendor IE data from a BSS entry.
bss | BSS table entry |
vendor_type | Vendor type (four octets starting the IE payload) |
This function returns concatenated payload of possibly fragmented vendor specific information elements in the BSS entry. The caller is responsible for freeing the returned buffer.
Fetch vendor IE data from a BSS entry.
bss | BSS table entry |
vendor_type | Vendor type (four octets starting the IE payload) |
This function returns concatenated payload of possibly fragmented vendor specific information elements in the BSS entry. The caller is responsible for freeing the returned buffer.
This function is like wpa_bss_get_vendor_ie_multi(), but uses IE buffer only from Beacon frames instead of either Beacon or Probe Response frames.
int wpa_bss_init | ( | struct wpa_supplicant * | wpa_s | ) |
Initialize BSS table.
wpa_s | Pointer to wpa_supplicant data |
This prepares BSS table lists and timer for periodic updates. The BSS table is deinitialized with wpa_bss_deinit() once not needed anymore.
void wpa_bss_update_end | ( | struct wpa_supplicant * | wpa_s, |
struct scan_info * | info, | ||
int | new_scan | ||
) |
End a BSS table update from scan results.
wpa_s | Pointer to wpa_supplicant data |
info | Information about scan parameters |
new_scan | Whether this update round was based on a new scan |
This function is called at the end of each BSS table update round for new scan results. The start of the update was indicated with a call to wpa_bss_update_start().
void wpa_bss_update_scan_res | ( | struct wpa_supplicant * | wpa_s, |
struct wpa_scan_res * | res, | ||
struct os_reltime * | fetch_time | ||
) |
Update a BSS table entry based on a scan result.
wpa_s | Pointer to wpa_supplicant data |
res | Scan result |
fetch_time | Time when the result was fetched from the driver |
This function updates a BSS table entry (or adds one) based on a scan result. This is called separately for each scan result between the calls to wpa_bss_update_start() and wpa_bss_update_end().
void wpa_bss_update_start | ( | struct wpa_supplicant * | wpa_s | ) |
Start a BSS table update from scan results.
wpa_s | Pointer to wpa_supplicant data |
This function is called at the start of each BSS table update round for new scan results. The actual scan result entries are indicated with calls to wpa_bss_update_scan_res() and the update round is finished with a call to wpa_bss_update_end().