diff --git a/wifimngr.c b/wifimngr.c index 277b4dedb9e2f3907f6938bda7a4c6e8df85c02a..db03820fc720e415f14047c439e6f002b55b1338 100644 --- a/wifimngr.c +++ b/wifimngr.c @@ -5306,7 +5306,23 @@ int wl_apmld_stats(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - return 0; + struct wifi_ap_stats ifstats = {}; + struct blob_buf bb = {}; + const char *ifname; + void *t; + + ifname = ubus_objname_to_ifname(obj); + wifi_ap_get_stats(ifname, &ifstats); + + blob_buf_init(&bb, 0); + t = blobmsg_open_table(&bb, "stats"); + print_apstats(&bb, &ifstats); + blobmsg_close_table(&bb, t); + + ubus_send_reply(ctx, req, bb.head); + blob_buf_free(&bb); + + return UBUS_STATUS_OK; } int wl_apmld_assoclist(struct ubus_context *ctx, struct ubus_object *obj,