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>
continue;
if (current_time - remote_si->last_connected < config.roam_process_timeout) {
continue;
if (current_time - remote_si->last_connected < config.roam_process_timeout) {
- rn->node.roam_source++;
+ rn->node.roam_events.source++;
/* Don't abort looking for roam sources here.
* The client might have roamed via another node
* within the roam-timeout.
/* Don't abort looking for roam sources here.
* The client might have roamed via another node
* within the roam-timeout.
{
uint64_t roamability_node, roamability_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;
if (roamability_node < roamability_ref)
return ref;
continue;
if (current_time - local_si->last_connected < config.roam_process_timeout) {
continue;
if (current_time - local_si->last_connected < config.roam_process_timeout) {
- node->node.roam_destination++;
+ node->node.roam_events.target++;
void usteer_dump_node(struct blob_buf *buf, struct usteer_node *node)
{
void usteer_dump_node(struct blob_buf *buf, struct usteer_node *node)
{
c = blobmsg_open_table(buf, usteer_node_name(node));
blobmsg_printf(buf, "bssid", MAC_ADDR_FMT, MAC_ADDR_DATA(node->bssid));
c = blobmsg_open_table(buf, usteer_node_name(node));
blobmsg_printf(buf, "bssid", MAC_ADDR_FMT, MAC_ADDR_DATA(node->bssid));
blobmsg_add_u32(buf, "noise", node->noise);
blobmsg_add_u32(buf, "load", node->load);
blobmsg_add_u32(buf, "max_assoc", node->max_assoc);
blobmsg_add_u32(buf, "noise", node->noise);
blobmsg_add_u32(buf, "load", node->load);
blobmsg_add_u32(buf, "max_assoc", node->max_assoc);
- blobmsg_add_u32(buf, "roam_source", node->roam_source);
- blobmsg_add_u32(buf, "roam_destination", node->roam_destination);
+
+ roam_events = blobmsg_open_table(buf, "roam_events");
+ blobmsg_add_u32(buf, "source", node->roam_events.source);
+ blobmsg_add_u32(buf, "target", node->roam_events.target);
+ blobmsg_close_table(buf, roam_events);
+
if (node->rrm_nr)
blobmsg_add_field(buf, BLOBMSG_TYPE_ARRAY, "rrm_nr",
blobmsg_data(node->rrm_nr),
if (node->rrm_nr)
blobmsg_add_field(buf, BLOBMSG_TYPE_ARRAY, "rrm_nr",
blobmsg_data(node->rrm_nr),
- int roam_source;
- int roam_destination;
+ struct {
+ int source;
+ int target;
+ } roam_events;