usteer: add connected-since
Fetch the age of the association for STAs in order to implement minimum intervals after which a STA is considered kickable. Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
@@ -269,6 +269,9 @@ static void nl80211_update_sta(struct usteer_node *node, struct sta_info *si)
|
||||
|
||||
if (tb_sta[NL80211_STA_INFO_SIGNAL_AVG])
|
||||
signal = (int8_t) nla_get_u8(tb_sta[NL80211_STA_INFO_SIGNAL_AVG]);
|
||||
|
||||
if (tb_sta[NL80211_STA_INFO_CONNECTED_TIME])
|
||||
si->connected_since = current_time - (nla_get_u32(tb_sta[NL80211_STA_INFO_CONNECTED_TIME]) * 1000);
|
||||
|
||||
usteer_sta_info_update(si, signal, true);
|
||||
|
||||
|
1
sta.c
1
sta.c
@@ -150,6 +150,7 @@ void usteer_sta_disconnected(struct sta_info *si)
|
||||
{
|
||||
si->connected = STA_NOT_CONNECTED;
|
||||
si->kick_time = 0;
|
||||
si->connected_since = 0;
|
||||
usteer_sta_info_update_timeout(si, config.local_sta_timeout);
|
||||
}
|
||||
|
||||
|
1
ubus.c
1
ubus.c
@@ -403,6 +403,7 @@ usteer_ubus_get_connected_clients(struct ubus_context *ctx, struct ubus_object *
|
||||
blobmsg_add_u32(&b, "signal", si->signal);
|
||||
blobmsg_add_u64(&b, "created", si->created);
|
||||
blobmsg_add_u64(&b, "seen", si->seen);
|
||||
blobmsg_add_u64(&b, "connected_since", si->connected_since);
|
||||
blobmsg_add_u64(&b, "last_connected", si->last_connected);
|
||||
|
||||
t = blobmsg_open_table(&b, "snr-kick");
|
||||
|
Reference in New Issue
Block a user