0c37b895520fee42d8d89703edc42aa37632093a
[project/luci.git] / module / admin-core / src / model / cbi / admin_network / dhcp.lua
1 -- ToDo: Translate, Add descriptions and help texts
2 require("ffluci.model.uci")
3 require("ffluci.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(ffluci.model.uci.show("network").network) do
14         if v[".type"] == "interface" and k ~= "loopback" then
15                 iface:value(k)
16         end
17 end
18
19 s:option(Value, "start", "Start", "Erste vergebene Adresse (letztes Oktett)").rmempty = true
20
21 s:option(Value, "limit", "Limit", "Letzte vergebene Adresse (letztes Oktett)").rmempty = true
22
23 s:option(Flag, "dynamicdhcp", "Dynamisches DHCP").rmempty = true
24
25 s:option(Value, "name", "Name").optional = true
26
27 s:option(Flag, "ignore", "Schnittstelle ignorieren", "DHCP für dieses Netzwerk deaktivieren").optional = true
28
29 s:option(Value, "netmask", "Netzmaske").optional = true
30
31 s:option(Flag, "force", "Start erzwingen").optional = true
32
33 for i, line in pairs(ffluci.sys.execl("dnsmasq --help dhcp")) do
34         k, v = line:match("([^ ]+) +([^ ]+)")
35         s:option(Value, "dhcp"..k, v).optional = true
36 end
37         
38 return m