2 LuCI - Lua Configuration Interface
4 Copyright 2010 Jo-Philipp Wich <xm@subsignal.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
17 m = Map("radvd", translatef("Radvd - Prefix"),
18 translate("Radvd is a router advertisement daemon for IPv6. " ..
19 "It listens to router solicitations and sends router advertisements " ..
20 "as described in RFC 4861."))
22 m.redirect = luci.dispatcher.build_url("admin/network/radvd")
24 if m.uci:get("radvd", sid) ~= "prefix" then
25 luci.http.redirect(m.redirect)
30 s = m:section(NamedSection, sid, "interface", translate("Prefix Configuration"))
33 s:tab("general", translate("General"))
34 s:tab("advanced", translate("Advanced"))
41 o = s:taboption("general", Value, "interface", translate("Interface"),
42 translate("Specifies the logical interface name this section belongs to"))
44 o.template = "cbi/network_netlist"
48 function o.formvalue(...)
49 return Value.formvalue(...) or "-"
52 function o.validate(self, value)
54 return nil, translate("Interface required")
59 function o.write(self, section, value)
60 m.uci:set("radvd", section, "ignore", 0)
61 m.uci:set("radvd", section, "interface", value)
65 o = s:taboption("general", Value, "prefix", translate("Prefix"),
66 translate("Advertised IPv6 prefix. If empty, the current interface prefix is used"))
69 o.datatype = "ip6addr"
72 o = s:taboption("general", Flag, "AdvOnLink", translate("On-link determination"),
73 translate("Indicates that this prefix can be used for on-link determination (RFC4861)"))
79 o = s:taboption("general", Flag, "AdvAutonomous", translate("Autonomous"),
80 translate("Indicates that this prefix can be used for autonomous address configuration (RFC4862)"))
90 o = s:taboption("advanced", Flag, "AdvRouterAddr", translate("Advertise router address"),
91 translate("Indicates that the address of interface is sent instead of network prefix, as is required by Mobile IPv6"))
94 o = s:taboption("advanced", Value, "AdvValidLifetime", translate("Valid lifetime"),
95 translate("Advertises the length of time in seconds that the prefix is valid for the purpose of on-link determination. Use 0 to specify an infinite lifetime"))
97 o.datatype = "uinteger"
100 function o.cfgvalue(self, section)
101 local v = Value.cfgvalue(self, section)
102 if v == "infinity" then
109 function o.write(self, section, value)
111 Value.write(self, section, "infinity")
113 Value.write(self, section, value)
118 o = s:taboption("advanced", Value, "AdvPreferredLifetime", translate("Preferred lifetime"),
119 translate("Advertises the length of time in seconds that addresses generated from the prefix via stateless address autoconfiguration remain preferred. Use 0 to specify an infinite lifetime"))
121 o.datatype = "uinteger"
122 o.placeholder = 14400
124 function o.cfgvalue(self, section)
125 local v = Value.cfgvalue(self, section)
126 if v == "infinity" then
133 function o.write(self, section, value)
135 Value.write(self, section, "infinity")
137 Value.write(self, section, value)
142 o = s:taboption("advanced", Value, "Base6to4Interface", translate("6to4 interface"),
143 translate("Specifies a logical interface name to derive a 6to4 prefix from. The interfaces public IPv4 address is combined with 2002::/3 and the value of the prefix option"))
145 o.template = "cbi/network_netlist"