luci-app-splash: convert luci.sys.net.arptable() to luci.ip.neighbors()
[project/luci.git] / applications / luci-app-splash / luasrc / view / admin_status / splash.htm
index 61b32ba..831fa75 100644 (file)
@@ -1,15 +1,6 @@
 <%#
-LuCI - Lua Configuration Interface
-Copyright 2009 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-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
-
-$Id$
-
+ Copyright 2009 Jo-Philipp Wich <jow@openwrt.org>
+ Licensed to the public under the Apache License 2.0.
 -%>
 
 <%-
@@ -18,6 +9,7 @@ local utl = require "luci.util"
 local ipt = require "luci.sys.iptparser".IptParser()
 local uci = require "luci.model.uci".cursor_state()
 local wat = require "luci.tools.webadmin"
+local ipc = require "luci.ip"
 local fs  = require "nixio.fs"
 
 local clients = { }
@@ -109,10 +101,12 @@ if fs.access(leasefile) then
        end
 end
 
-for i, a in ipairs(luci.sys.net.arptable()) do
-       local c = clients[a["HW address"]:lower()]
-       if c and not c.ip then
-               c.ip = a["IP address"]
+for i, n in ipairs(ipc.neighbors({ family = 4 })) do
+       if n.mac and n.dest then
+               local c = clients[n.mac]
+               if c and not c.ip then
+                       c.ip = n.dest:string()
+               end
        end
 end