From: Jo-Philipp Wich Date: Wed, 8 Aug 2012 20:16:46 +0000 (+0000) Subject: libs/sys: remove wifi.getiwconfig() and wifi.getiwscan() X-Git-Tag: 0.11.0~411 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d1fd6e702ee2ee9f2637c29dec2870ce308a9ba9;p=oweals%2Fluci.git libs/sys: remove wifi.getiwconfig() and wifi.getiwscan() --- diff --git a/libs/sys/luasrc/sys.lua b/libs/sys/luasrc/sys.lua index f6f95625d..a5c5ab1ec 100644 --- a/libs/sys/luasrc/sys.lua +++ b/libs/sys/luasrc/sys.lua @@ -836,56 +836,6 @@ function wifi.getiwinfo(ifname) end end ---- Get iwconfig output for all wireless devices. --- @return Table of tables containing the iwconfing output for each wifi device -function wifi.getiwconfig() - local cnt = luci.util.exec("PATH=/sbin:/usr/sbin iwconfig 2>/dev/null") - local iwc = {} - - for i, l in pairs(luci.util.split(luci.util.trim(cnt), "\n\n")) do - local k = l:match("^(.-) ") - l = l:gsub("^(.-) +", "", 1) - if k then - local entry, flags = _parse_mixed_record(l) - if entry then - entry.flags = flags - end - iwc[k] = entry - end - end - - return iwc -end - ---- Get iwlist scan output from all wireless devices. --- @return Table of tables contaiing all scan results -function wifi.iwscan(iface) - local siface = iface or "" - local cnt = luci.util.exec("iwlist "..siface.." scan 2>/dev/null") - local iws = {} - - for i, l in pairs(luci.util.split(luci.util.trim(cnt), "\n\n")) do - local k = l:match("^(.-) ") - l = l:gsub("^[^\n]+", "", 1) - l = luci.util.trim(l) - if k then - iws[k] = {} - for j, c in pairs(luci.util.split(l, "\n Cell")) do - c = c:gsub("^(.-)- ", "", 1) - c = luci.util.split(c, "\n", 7) - c = table.concat(c, "\n", 1) - local entry, flags = _parse_mixed_record(c) - if entry then - entry.flags = flags - end - table.insert(iws[k], entry) - end - end - end - - return iface and (iws[iface] or {}) or iws -end - --- Get available channels from given wireless iface. -- @param iface Wireless interface (optional) -- @return Table of available channels