delete wpas.data.iface_ubus[ifname];
}
+function iface_ubus_notify(ifname, event)
+{
+ let obj = wpas.data.iface_ubus[ifname];
+ if (!obj)
+ return;
+
+ obj.notify('ctrl-event', { event }, null, null, null, -1);
+}
+
function iface_ubus_add(ifname)
{
let ubus = wpas.data.ubus;
iface_event("remove", name);
iface_ubus_remove(name);
},
+ ctrl_event: function(name, iface, ev) {
+ iface_ubus_notify(name, ev);
+ },
state: function(ifname, iface, state) {
let event_data = iface.status();
event_data.name = ifname;
switch (event) {
case EVENT_AUTH:
#ifdef CONFIG_FST
+--- a/wpa_supplicant/ctrl_iface_unix.c
++++ b/wpa_supplicant/ctrl_iface_unix.c
+@@ -28,6 +28,7 @@
+ #include "config.h"
+ #include "wpa_supplicant_i.h"
+ #include "ctrl_iface.h"
++#include "ucode.h"
+
+ /* Per-interface ctrl_iface */
+
+@@ -436,6 +437,7 @@ static void wpa_supplicant_ctrl_iface_ms
+ if (wpa_s == NULL)
+ return;
+
++ wpas_ucode_ctrl_event(wpa_s, txt, len);
+ gpriv = wpa_s->global->ctrl_iface;
+
+ if (type != WPA_MSG_NO_GLOBAL && gpriv &&
ucv_put(wpa_ucode_call(4));
}
+void wpas_ucode_ctrl_event(struct wpa_supplicant *wpa_s, const char *str, size_t len)
+{
+ uc_value_t *val;
+
+#define _EV_PREFIX "CTRL-EVENT-"
+ if (strncmp(str, _EV_PREFIX, sizeof(_EV_PREFIX) - 1) != 0)
+ return;
+
+ val = wpa_ucode_registry_get(iface_registry, wpa_s->ucode.idx);
+ if (!val)
+ return;
+
+ if (wpa_ucode_call_prepare("ctrl_event"))
+ return;
+
+ uc_value_push(ucv_string_new(wpa_s->ifname));
+ uc_value_push(ucv_get(val));
+ uc_value_push(ucv_string_new_length(str, len));
+ ucv_put(wpa_ucode_call(3));
+}
+
void wpas_ucode_wps_complete(struct wpa_supplicant *wpa_s,
const struct wps_credential *cred)
{
void wpas_ucode_free_bss(struct wpa_supplicant *wpa_s);
void wpas_ucode_update_state(struct wpa_supplicant *wpa_s);
void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_data *data);
+void wpas_ucode_ctrl_event(struct wpa_supplicant *wpa_s, const char *str, size_t len);
bool wpas_ucode_bss_allowed(struct wpa_supplicant *wpa_s, struct wpa_bss *bss);
void wpas_ucode_wps_complete(struct wpa_supplicant *wpa_s,
const struct wps_credential *cred);
{
}
+static inline void wpas_ucode_ctrl_event(struct wpa_supplicant *wpa_s, const char *str, size_t len)
+{
+}
+
static inline bool wpas_ucode_bss_allowed(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
{
return true;