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>
This commit is contained in:
David Bauer
2021-09-27 20:56:41 +02:00
parent 681354256f
commit 6a20591b20
5 changed files with 15 additions and 2 deletions

View File

@@ -124,6 +124,7 @@ bool parse_apmsg_sta(struct apmsg_sta *msg, struct blob_attr *data)
[APMSG_STA_SEEN] = { .type = BLOB_ATTR_INT32 },
[APMSG_STA_TIMEOUT] = { .type = BLOB_ATTR_INT32 },
[APMSG_STA_CONNECTED] = { .type = BLOB_ATTR_INT8 },
[APMSG_STA_LAST_CONNECTED] = { .type = BLOB_ATTR_INT32 },
};
struct blob_attr *tb[__APMSG_STA_MAX];
@@ -132,7 +133,8 @@ bool parse_apmsg_sta(struct apmsg_sta *msg, struct blob_attr *data)
!tb[APMSG_STA_SIGNAL] ||
!tb[APMSG_STA_SEEN] ||
!tb[APMSG_STA_TIMEOUT] ||
!tb[APMSG_STA_CONNECTED])
!tb[APMSG_STA_CONNECTED] ||
!tb[APMSG_STA_LAST_CONNECTED])
return false;
if (blob_len(tb[APMSG_STA_ADDR]) != sizeof(msg->addr))
@@ -143,6 +145,7 @@ bool parse_apmsg_sta(struct apmsg_sta *msg, struct blob_attr *data)
msg->seen = blob_get_int32(tb[APMSG_STA_SEEN]);
msg->timeout = blob_get_int32(tb[APMSG_STA_TIMEOUT]);
msg->connected = blob_get_int8(tb[APMSG_STA_CONNECTED]);
msg->last_connected = blob_get_int32(tb[APMSG_STA_LAST_CONNECTED]);
return true;
}