diff options
author | David Bauer <mail@david-bauer.net> | 2021-11-27 22:08:28 +0100 |
---|---|---|
committer | David Bauer <mail@david-bauer.net> | 2021-12-15 00:13:40 +0100 |
commit | 16bcaa71faaef1462034bd410032409b18dc6430 (patch) | |
tree | 38791baae056357b2311d4e85525a71f92eec749 /package/network/services/hostapd/src | |
parent | a5cc9e033ccad8b3808313159b661f4ae55448f4 (diff) | |
download | upstream-16bcaa71faaef1462034bd410032409b18dc6430.tar.gz upstream-16bcaa71faaef1462034bd410032409b18dc6430.tar.bz2 upstream-16bcaa71faaef1462034bd410032409b18dc6430.zip |
hostapd: add OpenWrt specific statistic counters
This adds a new struct for storing statistics not (yet) tracked by
hostapd regarding RRM and WNM activity.
These statistics can be read using the get_status hostapd interface ubus
method.
Signed-off-by: David Bauer <mail@david-bauer.net>
Diffstat (limited to 'package/network/services/hostapd/src')
-rw-r--r-- | package/network/services/hostapd/src/src/ap/ubus.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index e0d3d2ae90..3066765e67 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -406,7 +406,7 @@ hostapd_bss_get_status(struct ubus_context *ctx, struct ubus_object *obj, struct blob_attr *msg) { struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj); - void *airtime_table, *dfs_table; + void *airtime_table, *dfs_table, *rrm_table, *wnm_table; struct os_reltime now; char ssid[SSID_MAX_LEN + 1]; char phy_name[17]; @@ -430,6 +430,18 @@ hostapd_bss_get_status(struct ubus_context *ctx, struct ubus_object *obj, snprintf(phy_name, 17, "%s", hapd->iface->phy); blobmsg_add_string(&b, "phy", phy_name); + /* RRM */ + rrm_table = blobmsg_open_table(&b, "rrm"); + blobmsg_add_u64(&b, "neighbor_report_tx", hapd->iface->openwrt_stats.rrm.neighbor_report_tx); + blobmsg_close_table(&b, rrm_table); + + /* WNM */ + wnm_table = blobmsg_open_table(&b, "wnm"); + blobmsg_add_u64(&b, "bss_transition_query_rx", hapd->iface->openwrt_stats.wnm.bss_transition_query_rx); + blobmsg_add_u64(&b, "bss_transition_request_tx", hapd->iface->openwrt_stats.wnm.bss_transition_request_tx); + blobmsg_add_u64(&b, "bss_transition_response_rx", hapd->iface->openwrt_stats.wnm.bss_transition_response_rx); + blobmsg_close_table(&b, rrm_table); + /* Airtime */ airtime_table = blobmsg_open_table(&b, "airtime"); blobmsg_add_u64(&b, "time", hapd->iface->last_channel_time); |