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>
This commit is contained in:
20
remote.c
20
remote.c
@@ -155,9 +155,11 @@ static void
|
||||
interface_add_station(struct usteer_remote_node *node, struct blob_attr *data)
|
||||
{
|
||||
struct sta *sta;
|
||||
struct sta_info *si;
|
||||
struct sta_info *si, *local_si;
|
||||
struct apmsg_sta msg;
|
||||
struct usteer_node *local_node;
|
||||
bool create;
|
||||
bool connect_change;
|
||||
|
||||
if (!parse_apmsg_sta(&msg, data)) {
|
||||
MSG(DEBUG, "Cannot parse station in message\n");
|
||||
@@ -177,10 +179,26 @@ interface_add_station(struct usteer_remote_node *node, struct blob_attr *data)
|
||||
if (!si)
|
||||
return;
|
||||
|
||||
connect_change = si->connected != msg.connected;
|
||||
si->connected = msg.connected;
|
||||
si->signal = msg.signal;
|
||||
si->seen = current_time - msg.seen;
|
||||
si->last_connected = current_time - msg.last_connected;
|
||||
|
||||
/* Check if client roamed to this foreign node */
|
||||
if ((connect_change || create) && si->connected == STA_CONNECTED) {
|
||||
for_each_local_node(local_node) {
|
||||
local_si = usteer_sta_info_get(sta, local_node, NULL);
|
||||
if (!local_si)
|
||||
continue;
|
||||
|
||||
if (current_time - local_si->last_connected < config.roam_process_timeout) {
|
||||
node->node.roam_destination++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
usteer_sta_info_update_timeout(si, msg.timeout);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user