node: add methods to access nodes by bssid
Add methods which returns a given node for a provided BSSID. This is required to retrieve the node object from information available with a neighbor report. Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
13
local_node.c
13
local_node.c
@@ -79,6 +79,19 @@ usteer_free_node(struct ubus_context *ctx, struct usteer_local_node *ln)
|
||||
free(ln);
|
||||
}
|
||||
|
||||
struct usteer_local_node *usteer_local_node_by_bssid(uint8_t *bssid) {
|
||||
struct usteer_local_node *ln;
|
||||
struct usteer_node *n;
|
||||
|
||||
for_each_local_node(n) {
|
||||
ln = container_of(n, struct usteer_local_node, node);
|
||||
if (!memcmp(n->bssid, bssid, 6))
|
||||
return ln;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
usteer_handle_remove(struct ubus_context *ctx, struct ubus_subscriber *s,
|
||||
uint32_t id)
|
||||
|
Reference in New Issue
Block a user