% local fs = require "nixio.fs" local util = require "luci.util" local stat = require "luci.tools.status" local ver = require "luci.version" local has_ipv6 = fs.access("/proc/net/ipv6_route") local has_dhcp = fs.access("/etc/config/dhcp") local has_wifi = ((fs.stat("/etc/config/wireless", "size") or 0) > 0) local has_dsl = fs.access("/etc/init.d/dsl_control") local ntm = require "luci.model.network".init() local wan = ntm:get_wannet(); local leases = stat.dhcp_leases(); local wifinets = stat.wifi_networks(); local hosts_hints = luci.sys.net.host_hints(); local hosts = {} local m, host; for m, host in pairs(hosts_hints) do local name, con = false local hide = false if host.name and host.ipv4 then name = host.name .. '\\n' .. host.ipv4 con = true elseif host.name then name = host.name elseif host.ipv4 then name = host.ipv4 con = true elseif host.ipv6 then name = '' con = true hide = true end hosts[m] = {name = name, id = false, con = con, hide = hide} end local net local ifaces = { } local netlist = { } for _, net in ipairs(ntm:get_networks()) do if net:name() ~= "loopback" then local device = net:get_interface() local mac = device:mac() if hosts[mac] ~= nil then hosts[mac].hide = true hosts[mac].con = device:is_up() end end end -%> <%+header%>