]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
wpa_supplicant: report interface events and support querying interface status
authorFelix Fietkau <nbd@nbd.name>
Wed, 1 Oct 2025 04:06:43 +0000 (06:06 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 1 Oct 2025 08:08:54 +0000 (10:08 +0200)
Makes information like Multi-AP status (including VLAN ID) accessible

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/hostapd/files/wpa_supplicant.uc

index 062c4b088a9aa195b3876b4b7bc86b16c8b5a5a2..b2a61090f39636dc380024b3c1cb1ea5f1cc9c6d 100644 (file)
@@ -496,6 +496,18 @@ let main_obj = {
                        return libubus.STATUS_NOT_FOUND;
                }
        },
+       iface_status: {
+               args: {
+                       name: ""
+               },
+               call: function(req) {
+                       let iface = wpas.interfaces[req.args.name];
+                       if (!iface)
+                               return libubus.STATUS_NOT_FOUND;
+
+                       return iface.status();
+               },
+       },
        mld_set: {
                args: {
                        config: {}
@@ -728,6 +740,9 @@ return {
                iface_event("remove", name);
        },
        state: function(ifname, iface, state) {
+               let event_data = iface.status();
+               event_data.name = ifname;
+               iface_event("state", ifname, event_data);
                try {
                        iface_hostapd_notify(ifname, iface, state);