2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
14 m = Map("network", translate("interfaces"), translate("a_n_ifaces1"))
16 s = m:section(TypedSection, "interface", "")
17 function s.filter(section)
18 return section ~= "loopback" and (not arg or #arg == 0 or
19 luci.util.contains(arg, section))
22 if not arg or #arg == 0 then
25 s:depends("proto", "static")
26 s:depends("proto", "dhcp")
28 p = s:option(ListValue, "proto", translate("protocol"))
29 p:value("static", translate("static"))
30 p:value("dhcp", "DHCP")
33 br = s:option(Flag, "type", translate("a_n_i_bridge"), translate("a_n_i_bridge1"))
37 ifname = s:option(Value, "ifname", translate("interface"))
39 for i,d in ipairs(luci.sys.net.devices()) do
45 ipaddr = s:option(Value, "ipaddr", translate("ipaddress"))
47 ipaddr:depends("proto", "static")
49 nm = s:option(Value, "netmask", translate("netmask"))
51 nm:depends("proto", "static")
52 nm:value("255.255.255.0")
53 nm:value("255.255.0.0")
56 gw = s:option(Value, "gateway", translate("gateway"))
57 gw:depends("proto", "static")
60 ip6addr = s:option(Value, "ip6addr", translate("ip6address"), translate("cidr6"))
61 ip6addr.rmempty = true
62 ip6addr:depends("proto", "static")
64 ip6gw = s:option(Value, "ip6gw", translate("gateway6"))
65 ip6gw:depends("proto", "static")
68 dns = s:option(Value, "dns", translate("dnsserver"))
69 dns:depends("proto", "static")
72 mtu = s:option(Value, "mtu", "MTU")
76 mac = s:option(Value, "macaddr", translate("macaddress"))