mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 08:48:31 -05:00
60b94c9819
This allows background scanning and roaming decisions to be contained in a single place based on a defined set of notification events which will hopefully make it easier to experiment with roaming improvements. In addition, this allows multiple intra-ESS roaming policies to be used (each network configuration block can configure its own bgscan module). The beacon loss and signal strength notifications are implemented for the bgscan API, but the actual events are not yet available from the driver. The included sample bgscan module ("simple") is an example of what can be done with the new bgscan mechanism. It requests periodic background scans when the device remains associated with an ESS and has couple of notes on what a more advanced bgscan module could do to optimize background scanning and roaming. The periodic scans will cause the scan result handler to pick a better AP if one becomes available. This bgscan module can be taken into use by adding bgscan="simple" (or bgscan="simple:<bgscan interval in seconds>") into the network configuration block.
69 lines
1.6 KiB
C
69 lines
1.6 KiB
C
/*
|
|
* WPA Supplicant - background scan and roaming interface
|
|
* 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 BGSCAN_H
|
|
#define BGSCAN_H
|
|
|
|
struct wpa_supplicant;
|
|
struct wpa_ssid;
|
|
|
|
struct bgscan_ops {
|
|
const char *name;
|
|
|
|
void * (*init)(struct wpa_supplicant *wpa_s, const char *params,
|
|
const struct wpa_ssid *ssid);
|
|
void (*deinit)(void *priv);
|
|
|
|
int (*notify_scan)(void *priv);
|
|
void (*notify_beacon_loss)(void *priv);
|
|
void (*notify_signal_change)(void *priv);
|
|
};
|
|
|
|
#ifdef CONFIG_BGSCAN
|
|
|
|
int bgscan_init(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
|
|
void bgscan_deinit(struct wpa_supplicant *wpa_s);
|
|
int bgscan_notify_scan(struct wpa_supplicant *wpa_s);
|
|
void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s);
|
|
void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s);
|
|
|
|
#else /* CONFIG_BGSCAN */
|
|
|
|
static inline int bgscan_init(struct wpa_supplicant *wpa_s,
|
|
struct wpa_ssid *ssid)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void bgscan_deinit(struct wpa_supplicant *wpa_s)
|
|
{
|
|
}
|
|
|
|
static inline int bgscan_notify_scan(struct wpa_supplicant *wpa_s)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s)
|
|
{
|
|
}
|
|
|
|
static inline void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s)
|
|
{
|
|
}
|
|
|
|
#endif /* CONFIG_BGSCAN */
|
|
|
|
#endif /* BGSCAN_H */
|