Commit Graph

41 Commits

Author SHA1 Message Date
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
681354256f remote: always re-schedule update timeout
This commit fixes updates not triggering due to a race-condition in
usteer.

When usteer does not yet have local-nodes when loading config, the
scheduled remote-update is not re-scheduled, leading to usteer only
exchanging node-messages on STA-events, leading to expiring remotes on
other remote nodes in low-event scenarios.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-10-30 01:14:46 +02:00
David Bauer
d7833e14ef remote: fix compilation with glibc
Fixes builds for the arc target.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-10-30 01:14:11 +02:00
David Bauer
bee2caf184 sta: schedule sta_info timeout on creation
The codes looks to have a race-condition, where disconnected sta_infos
are created without scheduling a timeout.

As sta_infos are not connected by default, schedule the timeout upon
sta_info creation.

Fixes spurious spamming of "Refuse to add an already expired station
entry" on remote nodes.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-10-29 19:37:48 +02:00
David Bauer
ae32cb9632 ubus: fix channel for active probing
The IEEE802.11-2016 specification says:

[...] a Channel Number field value of 255 indicates a request
to make iterative measurements for all supported channels in the
current operating class listed in the latest AP Channel Report
received from the serving AP.

The problem with this is, no AP Channel report is sent to the STA with
the measurement request.

To scan the whole Operating class, a channel number of 0 is desired:

[...] Channel Number field value of 0 indicates a request to make
iterative measurements for all supported channels in the operating
class [...]

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-10-29 19:28:14 +02:00
David Bauer
8dc07533a8 ubus: introduce enum for beacon measurement mode
This improves code readability.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-10-29 19:28:08 +02:00
David Bauer
46e59767a4 policy: use correct reference signal
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-10-15 23:26:38 +02:00
David Bauer
1116fdb58a policy: avoid creating kick loop for client
When checking whether a client is allowed to associate to a node, the
lower ceiling for kicking clients was not taken into account when
assoc-steering is disabled.

The problem behind this is, that a configured lower barrier for
disassociating clients (kicking) would kick the client immediatly after
association. In the worst scenario the client immediatly associates
again to the station and ends up in a kick loop.

Don't allow associating when a min_snr is configured and the client
signal is below this value.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-10-15 15:50:42 +02: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
30f9ba7617 remote: include node BSSID into messages
Add the node BSSID to messages exchanged between usteer hosts. This way,
a foreign node can determine the node reported by a STA using beacon
reports.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-10-15 15:49:50 +02:00
David Bauer
8af7b6cb06 usteer: add BSSID to node struct
Add the node BSSID to the usteer_node struct. This will be helpful in
the future when evaluating beacon reports from STAs.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-10-15 15:49:34 +02:00
David Bauer
fc1fadf5eb remote: fix memory leak on host removal
The host address is allocated on the heap, hence it has to be freed when
freeing the containing struct.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-09-21 19:48:16 +02:00
David Bauer
bee7c7e0df remote: fix incorrect use of strcmp result
When checking if the hostaddresses match up, the result returned from
strcmp was incorrectly evaluated. strcmp returns 0 in case both strings
match.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-09-21 19:47:56 +02:00
David Bauer
54f726f68b gitignore: add .patch files
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-09-21 19:47:13 +02:00
David Bauer
b134ea1edf gitignore: add vscode directory
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-09-21 19:47:00 +02:00
David Bauer
507a761553 contrib: add libpcap build dependency
Add a build dependency for libpcap, as it is required for the monitor
utility but not usteer itself. Use a build-dependency, as the monitor
utility executable is not packaged.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-09-21 19:46:49 +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
Jan Braun
e4ea2045eb usteer: add support for IPv6 remote exchange
This adds optional support for message exchange using IPv6 multicast
messaging. This has the ability for routers and switches between nodes
to route traffic between usteer nodes multicast-aware.

By default, IPv4 is used. IPv6 can be enabled by configuring the ipv6
option to 1.

Signed-off-by: Jan Braun <keksgesicht23@gmail.com>
[squash commits - adapt usock usage]
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-09-21 14:58:41 +02:00
David Bauer
a52de0ff20 remote: use port macro for destination port
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-09-21 14:58:23 +02:00
Felix Fietkau
ab4d89e742 main: add a command line option for dumping remote node data
Run for a given number of seconds and dump all found remote hosts/nodes as
JSON data

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-07 11:37:51 +02:00
Felix Fietkau
07a2f767e5 config: reduce remote node timeout to 10 update intervals
Even when there are network issues, we shouldn't keep stale data
around for so long

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-06 19:50: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
0029f3ce2e ubus: add support for getting a list of remote hosts
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-06 19:23:59 +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
e0cd9522dc rename a few functions in preparation for renaming script_data to node_info
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-06 14:28:28 +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
7f52d413f2 ubus: display script data when dumping node info
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
dc383d4361 openwrt: add missing config handling for event log types
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-05-13 16:10:36 +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
41213af5e6 openwrt: add documentation for uci options in the config file
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-05-12 13:33:14 +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
6d62833ca1 openwrt: fix path to daemon in init script
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-04-16 14:29:18 +02:00
Felix Fietkau
47794506ce policy: always accept assoc requests by default
Only steer using probe responses to avoid connection issues

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-04-12 12:15:28 +02:00
Felix Fietkau
d7a7f147fa policy: always accept auth requests
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-04-12 12:10:17 +02:00
John Crispin
f9815e2d3c Merge pull request #1 from thuehn/patch-1
[fix] binary file name should be usteerd
2020-11-19 21:37:44 +01:00
Dr.-Ing. Thomas Hühn
3bbce2b6a7 [fix] binary file name should be usteerd
the binary file name to be copied while install it in the OpenWrt package should be usteerd not usteer
2020-11-19 16:46:12 +01:00
Felix Fietkau
d10731f806 usteer: Initial import
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-11-12 15:37:10 +01:00