diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-10-31 14:42:03 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-11-01 12:03:33 +0100 |
commit | a96e7a664fa9ddd6de25f1a8d114cfd6d33d83e6 (patch) | |
tree | f23d51aa9326db9b230ae2f58935ad7ed3df752c /modules/luci-base/root/usr/libexec | |
parent | 37b6092aef9f875b95debdafba7da9933fc10a34 (diff) |
luci-base: migrate luci/getWirelessDevices to C plugin
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/root/usr/libexec')
-rwxr-xr-x | modules/luci-base/root/usr/libexec/rpcd/luci | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/modules/luci-base/root/usr/libexec/rpcd/luci b/modules/luci-base/root/usr/libexec/rpcd/luci index 8a3e0b0c0f..da36270a17 100755 --- a/modules/luci-base/root/usr/libexec/rpcd/luci +++ b/modules/luci-base/root/usr/libexec/rpcd/luci @@ -249,66 +249,6 @@ local methods = { end }, - getWirelessDevices = { - call = function(args) - local ubus = require "ubus".connect() - if not ubus then - return { error = "Unable to establish ubus connection" } - end - - local status = ubus:call("network.wireless", "status", {}) - if type(status) == "table" then - local radioname, radiodata - for radioname, radiodata in pairs(status) do - if type(radiodata) == "table" then - radiodata.iwinfo = ubus:call("iwinfo", "info", { device = radioname }) or {} - radiodata.iwinfo.bitrate = nil - radiodata.iwinfo.bssid = nil - radiodata.iwinfo.encryption = nil - radiodata.iwinfo.mode = nil - radiodata.iwinfo.quality = nil - radiodata.iwinfo.quality_max = nil - radiodata.iwinfo.ssid = nil - - local iwdata = nil - - if type(radiodata.interfaces) == "table" then - local _, interfacedata - for _, interfacedata in ipairs(radiodata.interfaces) do - if type(interfacedata) == "table" and - type(interfacedata.ifname) == "string" - then - local iwinfo = ubus:call("iwinfo", "info", { device = interfacedata.ifname }) - - iwdata = iwdata or iwinfo - interfacedata.iwinfo = iwinfo or {} - end - end - end - - radiodata.iwinfo = {} - - local _, k, v - for k, v in pairs(iwdata or ubus:call("iwinfo", "info", { device = radioname }) or {}) do - if k ~= "bitrate" and k ~= "bssid" and k ~= "encryption" and - k ~= "mode" and k ~= "quality" and k ~= "quality_max" and - k ~= "ssid" - then - if type(v) == "table" then - radiodata.iwinfo[k] = json.parse(json.stringify(v)) - else - radiodata.iwinfo[k] = v - end - end - end - end - end - end - - return status - end - }, - getConntrackHelpers = { call = function() local ok, fd = pcall(io.open, "/usr/share/fw3/helpers.conf", "r") |