2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
5 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
15 require("luci.model.uci")
18 m = Map("dhcp", "DHCP")
20 s = m:section(TypedSection, "dhcp", "DHCP-Server")
22 s:depends("interface", "lan")
24 enable = s:option(ListValue, "ignore", "", "")
25 enable:value(0, translate("enable"))
26 enable:value(1, translate("disable"))
28 start = s:option(Value, "start", translate("m_n_d_firstaddress"))
30 start:depends("ignore", "0")
33 limit = s:option(Value, "limit", translate("m_n_d_numleases"), "")
34 limit:depends("ignore", "0")
36 function limit.cfgvalue(self, section)
37 local value = Value.cfgvalue(self, section)
40 return tonumber(value) + 1
44 function limit.write(self, section, value)
45 value = tonumber(value) - 1
46 return Value.write(self, section, value)
51 time = s:option(Value, "leasetime")
52 time:depends("ignore", "0")
55 m2 = Map("luci_ethers", translate("luci_ethers"))
57 s = m2:section(TypedSection, "static_lease", "")
60 s.template = "cbi/tblsection"
62 s:option(Value, "macaddr", translate("macaddress"))
63 s:option(Value, "ipaddr", translate("ipaddress"))