hostapd.data.ubus = ubus;
hostapd.data.obj = ubus.publish("hostapd", main_obj);
+
+
+let auth_obj = {};
+hostapd.data.auth_obj = ubus.publish("hostapd-auth", auth_obj);
hostapd.udebug_set("hostapd", hostapd.data.ubus);
function bss_event(type, name, data) {
hostapd.udebug_set(null);
hostapd.ubus.disconnect();
},
+ afc_request: function(iface, data) {
+ let ret = ubus.call("afc", "request", { data });
+ if (type(ret) != "object")
+ return;
+ return ret.data;
+ },
bss_add: function(name, obj) {
bss_event("add", name);
},
},
bss_remove: function(name, obj) {
bss_event("remove", name);
- }
+ },
+ sta_auth: function(iface, sta) {
+ let msg = { iface, sta };
+ let ret = {};
+ let data_cb = (type, data) => {
+ ret = { ...ret, ...data };
+ };
+ hostapd.data.auth_obj.notify("sta_auth", msg, data_cb, null, null, 1000);
+ return ret;
+ },
+ sta_connected: function(iface, sta, data) {
+ let msg = { iface, sta, ...data };
+ let ret = {};
+ let data_cb = (type, data) => {
+ ret = { ...ret, ...data };
+ };
+ hostapd.data.auth_obj.notify("sta_connected", msg, data_cb, null, null, 1000);
+ return ret;
+ },
};