<%#
-LuCI - Lua Configuration Interface
-Copyright 2008-2009 Steven Barth <steven@midlink.org>
-Copyright 2008-2013 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
+ Copyright 2008-2009 Steven Barth <steven@midlink.org>
+ Copyright 2008-2015 Jo-Philipp Wich <jow@openwrt.org>
+ Licensed to the public under the Apache License 2.0.
-%>
<%-
- local sys = require "luci.sys"
- local fs = require "luci.fs"
+ local ip = require "luci.ip"
+ local fs = require "nixio.fs"
local utl = require "luci.util"
local uci = require "luci.model.uci".cursor()
local ntm = require "luci.model.network"
return translate("Hermes 802.11b Wireless Controller")
-- hostap
- elseif name == "wlan" and fs.isdirectory("/proc/net/hostap/" .. ifname) then
+ elseif name == "wlan" and fs.stat("/proc/net/hostap/" .. ifname, "type") == "dir" then
return translate("Prism2/2.5/3 802.11b Wireless Controller")
-- dunno yet
local devices = ntm:get_wifidevs()
local arpcache = { }
- sys.net.arptable(function(e) arpcache[e["HW address"]:upper()] = e["IP address"] end)
+ ip.neighbors({ family = 4 }, function(n)
+ if n.mac and n.dest then arpcache[n.mac:upper()] = n.dest:string() end
+ end)
local netlist = { }
local netdevs = { }
for( var i = 0; i < st.length; i++ )
{
var iw = st[i];
- var is_assoc = (iw.bssid && iw.bssid != '00:00:00:00:00:00' && iw.channel && iw.mode != 'Unknown');
+ var is_assoc = (iw.bssid && iw.bssid != '00:00:00:00:00:00' && iw.channel && iw.mode != 'Unknown' && !iw.disabled);
var p = iw.quality;
var q = is_assoc ? p : -1;