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>
This commit is contained in:
David Bauer
2021-11-26 01:36:43 +01:00
parent edbe7d41dd
commit e51ea7ac1a
5 changed files with 15 additions and 9 deletions

4
node.c
View File

@@ -60,8 +60,8 @@ usteer_node_higher_roamability(struct usteer_node *node, struct usteer_node *ref
{
uint64_t roamability_node, roamability_ref;
roamability_node = ((uint64_t)(node->roam_source + node->roam_destination)) * current_time / ((current_time - node->created) + 1);
roamability_ref = ((uint64_t)(ref->roam_source + ref->roam_destination)) * current_time / ((current_time - ref->created) + 1);
roamability_node = ((uint64_t)(node->roam_events.source + node->roam_events.target)) * current_time / ((current_time - node->created) + 1);
roamability_ref = ((uint64_t)(ref->roam_events.source + ref->roam_events.target)) * current_time / ((current_time - ref->created) + 1);
if (roamability_node < roamability_ref)
return ref;