Query client MBO support from hostapd and display it in the output of
the connected_clients ubus method as "multi-band-operation".
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Only send the preferred candidate with a BSS transition request.
Otherwise, unsuitable candidates might be included in the neighbor-list
of a transition request.
Signed-off-by: David Bauer <mail@david-bauer.net>
Send link-measurement requests to every supporting local-sta in order to
acquire information to assess the link-quality bi-directional.
The link-measurement request is sent each configurable interval. It can
be disabled by configuring the interval to 0.
Signed-off-by: David Bauer <mail@david-bauer.net>
Generalize measurement handling in a way that RCPi and RSNI are stored
regardless of the specific measurement type. This allows us to handle
link-measurement reports the same way as we already handle
beacon-reports.
Signed-off-by: David Bauer <mail@david-bauer.net>
Request hostap to enable the link-measurement capability in the BSS
beacons. Otherwise, STAs might reject link-measurement requests despite
being capable of performing such.
Signed-off-by: David Bauer <mail@david-bauer.net>
This adds a new band-steering component to usteer.
With band-steering enabled, usteer will attempt to move clients with a
consistently good SNR / signal from 2.4 GHz to the 5 GHz band.
In contrast to existing policies usteer tracks, band-steering is
non-invasive and will not lead to forceful connection termination.
Signed-off-by: David Bauer <mail@david-bauer.net>
While usteer tries it's best to determine the availability of a better
node for a certain client, it might still attempt to direct the client
to a unsuitable AP.
Transition away from using BSS-Transition-Requests with the
disassoc-imminent bit set and instead unset this bit.
This way, the client can inform the AP it will not transition to a
different BSS but instead wishes to remain connected to the current AP.
usteer will still kick clients in case they either accepted the
BSS-transition-request and do not roam or ignore the request completely.
Signed-off-by: David Bauer <mail@david-bauer.net>
BSS transition management as well as RRM capabilities have to be
considered not for the STA but per STA connection.
Most prominently, a STA might not support BSS-TM when connected without
PMF.
Signed-off-by: David Bauer <mail@david-bauer.net>
This causes segfaults on OpenWrt 21.02 which is missing the op-class
field.
Reported-by: John Crispin <john@phrozen.org>
Signed-off-by: David Bauer <mail@david-bauer.net>
Save the latest BSS-transition management response received from a STA.
This information can later be used to prevent kicking STAs when they
rejected a transition request.
Signed-off-by: David Bauer <mail@david-bauer.net>
Add logic for saving measurement-reports from STAs.
This commit does not yet save the measurement-reports received from
clients but adds the necessary code to do so. Currently the codes can
only handle beacon-reports, but link measurements can be added to it in
the future.
It also adds the new config-key measurement_report_timeout which
controls how long measurements are saved upon they are received by a
STA.
Signed-off-by: David Bauer <mail@david-bauer.net>
Add methods which returns a given node for a provided BSSID. This is
required to retrieve the node object from information available with
a neighbor report.
Signed-off-by: David Bauer <mail@david-bauer.net>
In order to send passive beacon-requests, channel and op-class of nodes
are required. Obtain this information per local-node from hostapd.
Signed-off-by: David Bauer <mail@david-bauer.net>
Make usteer handle incoming BSS-transition requests. Update with the
most active roaming neighbors like we already do for imminent
disassociations.
Create a new ubus method which calls hostapds bss_transition_request
method. This does not set the disassoc imminent bit, thus will not
automatically disassoc the requesting STA.
Signed-off-by: David Bauer <mail@david-bauer.net>
Logic for handling STA transition to disconnected state is
present multiple times. Create a new method to remove
duplicate code.
Signed-off-by: David Bauer <mail@david-bauer.net>
Move the sta frequency-seen logic to usteer_sta_info_update.
This method is called on every occurence the seen frequency
is set now, thus removing the duplicate code.
Signed-off-by: David Bauer <mail@david-bauer.net>
Move the roam event counters to a dedicated struct.
Update the ubus output to represent this new organization.
Signed-off-by: David Bauer <mail@david-bauer.net>
Save the RRM capabilities of STAs when updating clients from hostapd.
This is required to determine which measurement modes a STA supports.
Signed-off-by: David Bauer <mail@david-bauer.net>
Save the timestamp of the node creation. This is required to optimize
the selection of most-roamed to neighbors relative to their creation
time.
Signed-off-by: David Bauer <mail@david-bauer.net>
Prioritize neighbor candidates installed to hostapd. Add a new config
option to set a limit for neighbor reports installed to hostapd. This is
due to the fact, most devices will only evaluate a certain amount of
neighbor reports. Furthermore, the number of neighbor reports possible
is limited by the maximum frame size.
Signed-off-by: David Bauer <mail@david-bauer.net>
Keep track of STA journeys between multiple nodes. When a new STA is
reported from a foreign node, check whether this STA was previously
associated with a local node.
Vice versa, check upon association whether or not the STA was previously
associated with a foreign node.
Keep track of these roaming transactions using two new (local) fields of
the node struct.
Signed-off-by: David Bauer <mail@david-bauer.net>
Add a last_connected field to the sta_info struct. This field can be
used to determine, if and when a client was last connected to a given
node. This way, other nodes can determine where a client roamed to or
from.
Signed-off-by: David Bauer <mail@david-bauer.net>
Make the connection state of a sta-info more readable by introducing an
enum for the STA connection state.
Also switch come comparison cases to use the explicit enum values to
make the code more readable.
Signed-off-by: David Bauer <mail@david-bauer.net>
The name pointer provided by ubus get's cleared after the first call to
ubus_register_subscriber in usteer_get_node. The leads to an incorrect
ifindex returned by if_nametoindex due to the 0 characters long string.
Work around this issue by reusing the interface name already stored in
the local node struct.
Fixes querying the wrong interface with netlink, resulting in incorrect
SSIDs used for the nodes.
Signed-off-by: David Bauer <mail@david-bauer.net>
- make logging events more structured
- add fine grained control over log events
- make it possible to receive more detailed events via ubus
Signed-off-by: Felix Fietkau <nbd@nbd.name>