1 -- Copyright 2008 Steven Barth <steven@midlink.org>
2 -- Copyright 2010-2015 Jo-Philipp Wich <jow@openwrt.org>
3 -- Licensed to the public under the Apache License 2.0.
5 local ipc = require "luci.ip"
7 m = Map("dhcp", translate("Hostnames"))
9 s = m:section(TypedSection, "domain", translate("Host entries"))
12 s.template = "cbi/tblsection"
14 hn = s:option(Value, "name", translate("Hostname"))
15 hn.datatype = "hostname"
18 ip = s:option(Value, "ip", translate("IP address"))
19 ip.datatype = "ipaddr"
22 ipc.neighbors({ }, function(n)
23 if n.mac and n.dest and not n.dest:is6linklocal() then
24 ip:value(n.dest:string(), "%s (%s)" %{ n.dest:string(), n.mac })