diff options
author | Daniel Golle <daniel@makrotopia.org> | 2018-02-14 21:37:44 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2018-02-15 04:50:28 +0100 |
commit | 223e09bf3f180797aeea0f6dc1721e5a55215e66 (patch) | |
tree | 83379be65099ee920eccc700e3b9d6139472f056 /iwinfo_lua.c | |
parent | fb749bf51a7855ee955fc221acdc51b94231db2b (diff) | |
download | iwinfo-223e09bf3f180797aeea0f6dc1721e5a55215e66.tar.gz |
add support for expected throughput
cfg80211 allows drivers to announce the to-be-expected layer-2 datarate
using the NL80211_STA_INFO_EXPECTED_THROUGHPUT field.
This information is useful as a metric for user-space routing daemons,
so grab it via nl80211 and make it available in both C and Lua APIs,
and show expected throughput on CLI interface assoclist.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'iwinfo_lua.c')
-rw-r--r-- | iwinfo_lua.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/iwinfo_lua.c b/iwinfo_lua.c index 1421111..eebab8e 100644 --- a/iwinfo_lua.c +++ b/iwinfo_lua.c @@ -328,6 +328,11 @@ static int iwinfo_L_assoclist(lua_State *L, int (*func)(const char *, char *, in set_rateinfo(L, &e->rx_rate, true); set_rateinfo(L, &e->tx_rate, false); + if (e->thr) { + lua_pushnumber(L, e->thr); + lua_setfield(L, -2, "expected_throughput"); + } + lua_setfield(L, -2, macstr); } } |