2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
15 local sys = require "luci.sys"
17 m2 = Map("dhcp", translate("DHCP Leases"),
18 translate("Static leases are used to assign fixed IP addresses and symbolic hostnames to " ..
19 "DHCP clients. They are also required for non-dynamic interface configurations where " ..
20 "only hosts with a corresponding lease are served."))
22 m2:section(SimpleSection).template = "admin_network/lease_status"
24 s = m2:section(TypedSection, "host", translate("Static Leases"),
25 translate("Use the <em>Add</em> Button to add a new lease entry. The <em>MAC-Address</em> " ..
26 "indentifies the host, the <em>IPv4-Address</em> specifies to the fixed address to " ..
27 "use and the <em>Hostname</em> is assigned as symbolic name to the requesting host."))
31 s.template = "cbi/tblsection"
33 name = s:option(Value, "name", translate("Hostname"))
34 name.datatype = "hostname"
37 mac = s:option(Value, "mac", translate("<abbr title=\"Media Access Control\">MAC</abbr>-Address"))
38 mac.datatype = "macaddr"
40 ip = s:option(Value, "ip", translate("<abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Address"))
41 ip.datatype = "ip4addr"
43 sys.net.arptable(function(entry)
44 ip:value(entry["IP address"])
47 entry["HW address"] .. " (" .. entry["IP address"] .. ")"