summaryrefslogtreecommitdiff
path: root/iwinfo_lua.c
diff options
context:
space:
mode:
authorDavid Bauer <mail@david-bauer.net>2020-01-31 14:45:03 +0100
committerDavid Bauer <mail@david-bauer.net>2020-02-04 14:44:14 +0100
commita6914dc0dc3cba65e245fbe40076626ea2bcd5a3 (patch)
treea3b5d78b90859d923e60595972d744c37360d479 /iwinfo_lua.c
parentbb216982951698833bbdf4a88872e9b5ccd026a5 (diff)
downloadiwinfo-a6914dc0dc3cba65e245fbe40076626ea2bcd5a3.tar.gz
iwinfo: add BSS load element to scan result
This adds support for the BSS load information element. With this patch, the BSS load information is visible when using the CLI as well as when accessing scan results using the LUA binding. Signed-off-by: David Bauer <mail@david-bauer.net>
Diffstat (limited to 'iwinfo_lua.c')
-rw-r--r--iwinfo_lua.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/iwinfo_lua.c b/iwinfo_lua.c
index 58a5537..76160b6 100644
--- a/iwinfo_lua.c
+++ b/iwinfo_lua.c
@@ -434,6 +434,18 @@ static int iwinfo_L_scanlist(lua_State *L, int (*func)(const char *, char *, int
lua_pushnumber(L, (e->signal - 0x100));
lua_setfield(L, -2, "signal");
+ /* BSS load */
+ if (e->has_bss_load) {
+ lua_pushnumber(L, e->station_count);
+ lua_setfield(L, -2, "station_count");
+
+ lua_pushnumber(L, e->channel_utilization);
+ lua_setfield(L, -2, "channel_utilization");
+
+ lua_pushnumber(L, e->admission_capacity);
+ lua_setfield(L, -2, "admission_capacity");
+ }
+
/* Crypto */
iwinfo_L_cryptotable(L, &e->crypto);
lua_setfield(L, -2, "encryption");