فهرست منبع

wpa_supplicant: report interface events and support querying interface status

Makes information like Multi-AP status (including VLAN ID) accessible

Signed-off-by: Felix Fietkau <[email protected]>
Felix Fietkau 2 ماه پیش
والد
کامیت
d32e051b69
1فایلهای تغییر یافته به همراه15 افزوده شده و 0 حذف شده
  1. 15 0
      package/network/services/hostapd/files/wpa_supplicant.uc

+ 15 - 0
package/network/services/hostapd/files/wpa_supplicant.uc

@@ -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);