83ba1964187e0e30b36c217504b534e435dbf1be
[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")
6
7 s = m:section(TypedSection, "dhcp")
8 s.addremove = true
9 s.anonymous = true
10
11 iface = s:option(ListValue, "interface", "Schnittstelle")
12 for k, v in pairs(ffluci.model.uci.show("network").network) do
13         if v[".type"] == "interface" and k ~= "loopback" then
14                 iface:value(k)
15         end
16 end
17
18 s:option(Value, "start", "Start").rmempty = true
19
20 s:option(Value, "limit", "Limit").rmempty = true
21
22 s:option(Flag, "dynamicdhcp", "Dynamisches DHCP").rmempty = true
23
24 s:option(Value, "name", "Name").optional = true
25
26 s:option(Flag, "ignore", "Schnittstelle ignorieren").optional = true
27
28 s:option(Value, "netmask", "Netzmaske").optional = true
29
30 s:option(Flag, "force", "Start erzwingen").optional = true
31
32 for i, line in pairs(ffluci.sys.execl("dnsmasq --help dhcp")) do
33         k, v = line:match("([^ ]+) +([^ ]+)")
34         s:option(Value, "dhcp"..k, v).optional = true
35 end
36         
37 return m