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 - RDNSS"),
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) ~= "rdnss" then
25 luci.http.redirect(m.redirect)
30 s = m:section(NamedSection, sid, "interface", translate("RDNSS Configuration"))
38 o = s:option(Value, "interface", translate("Interface"),
39 translate("Specifies the logical interface name this section belongs to"))
41 o.template = "cbi/network_netlist"
45 function o.formvalue(...)
46 return Value.formvalue(...) or "-"
49 function o.validate(self, value)
51 return nil, translate("Interface required")
56 function o.write(self, section, value)
57 m.uci:set("radvd", section, "ignore", 0)
58 m.uci:set("radvd", section, "interface", value)
62 o = s:option(Value, "addr", translate("Address"),
63 translate("Advertised IPv6 RDNSS. If empty, the current IPv6 address of the interface is used"))
67 o.datatype = "ip6addr"
70 o = s:option(Flag, "AdvRDNSSOpen", translate("Open"),
71 translate("Indicates whether that RDNSS continues to be available to hosts even if they moved to a different subnet "))
74 o = s:option(Value, "AdvRDNSSLifetime", translate("Lifetime"),
75 translate("Specifies the maximum duration how long the RDNSS entries are used for name resolution. Use 0 to specify an infinite lifetime"))
77 o.datatype = "uinteger"
80 function o.cfgvalue(self, section)
81 local v = Value.cfgvalue(self, section)
82 if v == "infinity" then
89 function o.write(self, section, value)
91 Value.write(self, section, "infinity")
93 Value.write(self, section, value)