2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
5 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
22 s1 = m:section(TypedSection, "tun")
25 s1:option( Flag, "usetap" )
26 s1:option( Value, "tundev" ).optional = true
27 s1:option( Value, "txqlen" ).optional = true
29 net = s1:option( Value, "net" )
30 for _, route in ipairs(luci.sys.net.routes()) do
31 if route.Iface ~= "lo" and route.Mask ~= "FFFFFFFF" then
32 local netmask = luci.ip.IPv4(route.Mask)
34 local netaddr = luci.ip.IPv4(route.Destination, netmask)
36 net:value( netaddr:string() )
42 s1:option( Value, "dynip" ).optional = true
43 s1:option( Value, "statip" ).optional = true
45 s1:option( Value, "dns1" ).optional = true
46 s1:option( Value, "dns2" ).optional = true
47 s1:option( Value, "domain" ).optional = true
49 s1:option( Value, "ipup" ).optional = true
50 s1:option( Value, "ipdown" ).optional = true
52 s1:option( Value, "conup" ).optional = true
53 s1:option( Value, "condown" ).optional = true
57 s2 = m:section(TypedSection, "dhcp")
60 dif = s2:option( Value, "dhcpif" )
61 for _, nif in ipairs(luci.sys.net.devices()) do
62 if nif ~= "lo" then dif:value(nif) end
65 s2:option( Value, "dhcpmac" ).optional = true
66 s2:option( Value, "lease" ).optional = true
67 s2:option( Value, "dhcpstart" ).optional = true
68 s2:option( Value, "dhcpend" ).optional = true