-- Copyright 2008 Steven Barth <steven@midlink.org>
-- Licensed to the public under the Apache License 2.0.
-local sys = require "luci.sys"
+local ipc = require "luci.ip"
m = Map("dhcp", translate("DHCP and DNS"),
translate("Dnsmasq is a combined <abbr title=\"Dynamic Host Configuration Protocol" ..
s:taboption("files", Flag, "nohosts",
- translate("Ignore Hosts files")).optional = true
+ translate("Ignore <code>/etc/hosts</code>")).optional = true
-hf = s:taboption("files", DynamicList, "addnhosts",
- translate("Additional Hosts files"))
-
-hf:depends("nohosts", "")
-hf.optional = true
+s:taboption("files", DynamicList, "addnhosts",
+ translate("Additional Hosts files")).optional = true
s:taboption("advanced", Flag, "boguspriv",
translate("No negative cache"),
translate("Do not cache negative replies, e.g. for not existing domains"))
+s:taboption("advanced", Value, "serversfile",
+ translate("Additional servers file"),
+ translate("This file may contain lines like 'server=/domain/1.2.3.4' or 'server=1.2.3.4' for"..
+ "domain-specific or full upstream <abbr title=\"Domain Name System\">DNS</abbr> servers."))
+
s:taboption("advanced", Flag, "strictorder",
translate("Strict order"),
translate("<abbr title=\"Domain Name System\">DNS</abbr> servers will be queried in the " ..
translate("List of domains to allow RFC1918 responses for"))
rd:depends("rebind_protection", "1")
-rd.datatype = "host"
+rd.datatype = "host(1)"
rd.placeholder = "ihost.netflix.com"
hostid = s:option(Value, "hostid", translate("<abbr title=\"Internet Protocol Version 6\">IPv6</abbr>-Suffix (hex)"))
-sys.net.arptable(function(entry)
- ip:value(entry["IP address"])
- mac:value(
- entry["HW address"],
- entry["HW address"] .. " (" .. entry["IP address"] .. ")"
- )
+ipc.neighbors({ family = 4 }, function(n)
+ if n.mac and n.dest then
+ ip:value(n.dest:string())
+ mac:value(n.mac, "%s (%s)" %{ n.mac, n.dest:string() })
+ end
end)
function ip.validate(self, value, section)