add some indirection around make targets of module.mk, so you can combine it more...
[project/luci.git] / modules / admin-core / src / model / cbi / admin_network / dhcp.lua
1 -- ToDo: Translate, Add descriptions and help texts
2 require("luci.model.uci")
3 require("luci.sys")
4
5 m = Map("dhcp", "DHCP", [[Mit Hilfe von DHCP können Netzteilnehmer automatisch
6 ihre Netzwerkkonfiguration (IP-Adresse, Netzmaske, DNS-Server, DHCP, ...) beziehen.]])
7
8 s = m:section(TypedSection, "dhcp")
9 s.addremove = true
10 s.anonymous = true
11
12 iface = s:option(ListValue, "interface", "Schnittstelle")
13 for k, v in pairs(luci.model.uci.sections("network")) do
14         if v[".type"] == "interface" and k ~= "loopback" then
15                 iface:value(k)
16                 s:depends("interface", k) -- Only change sections with existing interfaces
17         end
18 end
19
20 s:option(Value, "start", "Start", "Erste vergebene Adresse (letztes Oktett)").rmempty = true
21
22 s:option(Value, "limit", "Limit", "Anzahl zu vergebender Adressen -1").rmempty = true
23
24 s:option(Value, "leasetime", "Laufzeit").rmempty = true
25
26 s:option(Flag, "dynamicdhcp", "Dynamisches DHCP").rmempty = true
27
28 s:option(Value, "name", "Name").optional = true
29
30 s:option(Flag, "ignore", "Schnittstelle ignorieren", "DHCP für dieses Netzwerk deaktivieren").optional = true
31
32 s:option(Value, "netmask", "Netzmaske").optional = true
33
34 s:option(Flag, "force", "Start erzwingen").optional = true
35
36 for i, line in pairs(luci.sys.execl("dnsmasq --help dhcp")) do
37         k, v = line:match("([^ ]+) +([^ ]+)")
38         s:option(Value, "dhcp"..k, v).optional = true
39 end
40         
41 return m