commit 69f1c3321a10c972adfe132d07ee8fa09f33ed25
parent 1378a3c945bcb5b0ed47dd4017ff6f3debfd76c1
Author: Denis Kenzior <denkenz@gmail.com>
Date: Sun, 2 Sep 2018 22:15:41 -0500
station: Add station_find
Diffstat:
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/station.c b/src/station.c
@@ -496,6 +496,21 @@ not_supported:
return NULL;
}
+struct station *station_find(uint32_t ifindex)
+{
+ const struct l_queue_entry *entry;
+
+ for (entry = l_queue_get_entries(station_list); entry;
+ entry = entry->next) {
+ struct station *station = entry->data;
+
+ if (netdev_get_ifindex(station->netdev) == ifindex)
+ return station;
+ }
+
+ return NULL;
+}
+
struct station *station_create(struct wiphy *wiphy, struct netdev *netdev)
{
struct station *station;
diff --git a/src/station.h b/src/station.h
@@ -60,5 +60,6 @@ struct handshake_state *station_handshake_setup(struct station *station,
struct network *network,
struct scan_bss *bss);
+struct station *station_find(uint32_t ifindex);
struct station *station_create(struct wiphy *wiphy, struct netdev *netdev);
void station_free(struct station *station);