hostapd: add STA extended capabilities to get_clients
authorDavid Bauer <mail@david-bauer.net>
Wed, 16 Feb 2022 22:09:51 +0000 (23:09 +0100)
committerDavid Bauer <mail@david-bauer.net>
Sun, 20 Mar 2022 00:32:36 +0000 (01:32 +0100)
Add the STAs extended capabilities to the ubus STA information. This
way, external daemons can be made aware of a STAs capabilities.

This field is of an array type and contains 0 or more bytes of a STAs
advertised extended capabilities.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 6f787239771044ed7eeaf22301c543b699f25cb4)

package/network/services/hostapd/src/src/ap/ubus.c

index 29a4af8ebdd4d9dc19ef8561fbde206ded29670a..6edafa538d29fcde39f0f520f45f66dad09d6c00 100644 (file)
@@ -318,6 +318,16 @@ hostapd_bss_get_clients(struct ubus_context *ctx, struct ubus_object *obj,
                for (i = 0; i < ARRAY_SIZE(sta->rrm_enabled_capa); i++)
                        blobmsg_add_u32(&b, "", sta->rrm_enabled_capa[i]);
                blobmsg_close_array(&b, r);
+
+               r = blobmsg_open_array(&b, "extended_capabilities");
+               /* Check if client advertises extended capabilities */
+               if (sta->ext_capability && sta->ext_capability[0] > 0) {
+                       for (i = 0; i < sta->ext_capability[0]; i++) {
+                               blobmsg_add_u32(&b, "", sta->ext_capability[1 + i]);
+                       }
+               }
+               blobmsg_close_array(&b, r);
+
                blobmsg_add_u32(&b, "aid", sta->aid);
 #ifdef CONFIG_TAXONOMY
                r = blobmsg_alloc_string_buffer(&b, "signature", 1024);