Commit Graph

20 Commits

Author SHA1 Message Date
David Bauer
3b51bfbaf6 local-node: obtain channel + op-class
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>
2022-02-03 22:43:37 +01:00
David Bauer
e36967f219 local-node: handle BSS transition queries
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>
2022-01-31 23:40:52 +01:00
David Bauer
55e98d852c sta: uniform disconnect state handling
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>
2022-01-09 01:59:53 +01:00
David Bauer
806e647cbc sta: remove duplicate code
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>
2022-01-09 01:57:32 +01:00
David Bauer
e51ea7ac1a node: move roam-events to dedicated struct
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>
2021-11-28 13:47:53 +01:00
David Bauer
abc6fe047f local-node: update STA RRM capabilites
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>
2021-11-25 23:04:48 +01:00
David Bauer
d0cd65b762 node: save created time for node
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>
2021-11-25 22:28:41 +01:00
David Bauer
532a48d23e local-node: prioritize neighbor candidates
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>
2021-11-25 22:28:04 +01:00
David Bauer
4862080de7 node: keep track of roam-sources and roam-destinations
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>
2021-11-25 22:26:08 +01:00
David Bauer
6a20591b20 sta-info: add last_connected field
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>
2021-11-25 22:24:33 +01:00
David Bauer
d3ff0d59da sta: add sta_connection_state enum
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>
2021-10-15 15:50:25 +02:00
David Bauer
8c35c8e6a0 local-node: don't read pointer after clear
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>
2021-09-21 19:46:05 +02:00
Felix Fietkau
e685db7fa7 add support for defining global host info
Change the '*' in the node info update cmd to refer to host info instead

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-06 19:44:02 +02:00
Felix Fietkau
8be33b596b remote: track remote hosts as a separate data structure
Will be used to track host info

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-06 19:14:40 +02:00
Felix Fietkau
e9641c4657 rename script_data to node_info
It's a more descriptive name, and we will have host_info later as well

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-06 14:35:40 +02:00
Felix Fietkau
831b46a705 ubus: add api for modifying node script data
This is replicated across nodes

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-06 11:10:47 +02:00
Felix Fietkau
0e2538d685 config: check for empty ssid list
Without this check, an empty ssid list array results in a config with no nodes

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-06 11:10:15 +02:00
Felix Fietkau
0aab299c54 make list of steering-enabled SSIDs configurable
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-05-13 16:09:29 +02:00
Felix Fietkau
2b1c740ce3 rework log handling
- 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>
2021-04-16 14:55:57 +02:00
Felix Fietkau
d10731f806 usteer: Initial import
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-11-12 15:37:10 +01:00