-for _, e in ipairs(sys.net.arptable()) do
- arp[e["HW address"]:upper()] = { e["IP address"] }
-end
-
-for e in io.lines("/etc/ethers") do
- mac, ip = e:match("^([a-f0-9]%S+) (%S+)")
- if mac and ip then arp[mac:upper()] = { ip } end
-end
-
-for e in io.lines("/var/dhcp.leases") do
- mac, ip, name = e:match("^%d+ (%S+) (%S+) (%S+)")
- if mac and ip then arp[mac:upper()] = { ip, name ~= "*" and name } end
-end
-
-uci:foreach("dhcp", "host",
- function(s)
- if s.mac and s.ip then
- if type(s.mac) == "table" then
- local m
- for _, m in ipairs(s.mac) do
- arp[m:upper()] = { s.ip, s.name }
- end
- else
- arp[s.mac:upper()] = { s.ip, s.name }
- end
- end
- end)
-