From 39f23b83bd7d5a2a2c1a739c5bb7ac4533a378a5 Mon Sep 17 00:00:00 2001 From: PolynomialDivision Date: Sat, 27 Jan 2018 18:48:45 +0100 Subject: [PATCH] add function to get station cound of col domain --- src/include/datastorage.h | 2 ++ src/storage/datastorage.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/include/datastorage.h b/src/include/datastorage.h index 463fb12..46e102c 100644 --- a/src/include/datastorage.h +++ b/src/include/datastorage.h @@ -236,6 +236,8 @@ int build_network_overview(struct blob_buf *b); int probe_array_set_all_probe_count(uint8_t client_addr[], uint32_t probe_count); +int ap_get_collision_count(int col_domain); + /* Utils */ // ---------------- Defines ------------------- diff --git a/src/storage/datastorage.c b/src/storage/datastorage.c index 154d13a..431f79b 100644 --- a/src/storage/datastorage.c +++ b/src/storage/datastorage.c @@ -759,6 +759,22 @@ ap insert_to_ap_array(ap entry) { return entry; } +int ap_get_collision_count(int col_domain) { + + int ret_sta_count = 0; + + pthread_mutex_lock(&ap_array_mutex); + int i; + + for (i = 0; i <= ap_entry_last; i++) { + if(ap_array[i].collision_domain == col_domain) + ret_sta_count += ap_array[i].station_count; + } + pthread_mutex_unlock(&ap_array_mutex); + + return ret_sta_count; +} + ap ap_array_get_ap(uint8_t bssid_addr[]) { ap ret;