* Merged Luci to use native UCI-library
[project/luci.git] / modules / admin-core / luasrc / 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 luci.model.uci.foreach("network", "interface",
14         function (section)
15                 if section[".name"] ~= "loopback" then
16                         iface:value(section[".name"])
17                         s:depends("interface", section[".name"])
18                 end
19         end)
20
21 s:option(Value, "start", "Start", "Erste vergebene Adresse (letztes Oktett)").rmempty = true
22
23 s:option(Value, "limit", "Limit", "Anzahl zu vergebender Adressen -1").rmempty = true
24
25 s:option(Value, "leasetime", "Laufzeit").rmempty = true
26
27 s:option(Flag, "dynamicdhcp", "Dynamisches DHCP").rmempty = true
28
29 s:option(Value, "name", "Name").optional = true
30
31 s:option(Flag, "ignore", "Schnittstelle ignorieren", "DHCP für dieses Netzwerk deaktivieren").optional = true
32
33 s:option(Value, "netmask", "Netzmaske").optional = true
34
35 s:option(Flag, "force", "Start erzwingen").optional = true
36
37 for i, line in pairs(luci.sys.execl("dnsmasq --help dhcp")) do
38         k, v = line:match("([^ ]+) +([^ ]+)")
39         s:option(Value, "dhcp"..k, v).optional = true
40 end
41         
42 return m