aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/bss.h
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-12-27 19:07:47 (GMT)
committerJouni Malinen <j@w1.fi>2009-12-27 19:07:47 (GMT)
commit83922c2d344eb7fb77387bc0253449524e949901 (patch)
tree012abc38f8b34451ee67c4ae69cc117c05486d1c /wpa_supplicant/bss.h
parent60ad2c7befcaba3be072ab20368418a41dd828b9 (diff)
downloadhostap-83922c2d344eb7fb77387bc0253449524e949901.zip
hostap-83922c2d344eb7fb77387bc0253449524e949901.tar.gz
hostap-83922c2d344eb7fb77387bc0253449524e949901.tar.bz2
Add BSS table to track scan results without dropping information
Collect information from scan results into a BSS table that will not expire information as quickly as scan results where every new scan, no matter for how limited set of channels/SSIDs, clears all old information. For now, this is only used for D-Bus BSS added/removed notifications, but this will likely be extended to be used internally instead of the scan results to better support partial scans.
Diffstat (limited to 'wpa_supplicant/bss.h')
-rw-r--r--wpa_supplicant/bss.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/wpa_supplicant/bss.h b/wpa_supplicant/bss.h
new file mode 100644
index 0000000..dde4ed9
--- /dev/null
+++ b/wpa_supplicant/bss.h
@@ -0,0 +1,74 @@
+/*
+ * BSS table
+ * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Alternatively, this software may be distributed under the terms of BSD
+ * license.
+ *
+ * See README and COPYING for more details.
+ */
+
+#ifndef BSS_H
+#define BSS_H
+
+#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)
+
+/**
+ * struct wpa_bss - BSS table
+ * @list: List entry for struct wpa_supplicant::bss
+ * @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
+ * @last_update: Time of the last update (i.e., Beacon or Probe Response RX)
+ * @ie_len: length of the following IE field in octets
+ *
+ * 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;
+ 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;
+ size_t ie_len;
+ /* followed by ie_len octets of IEs */
+};
+
+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);
+void wpa_bss_update_end(struct wpa_supplicant *wpa_s);
+int wpa_bss_init(struct wpa_supplicant *wpa_s);
+void wpa_bss_deinit(struct wpa_supplicant *wpa_s);
+
+#endif /* BSS_H */