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