1 -- Copyright 2010 Jo-Philipp Wich <xm@subsignal.org>
2 -- Licensed to the public under the Apache License 2.0.
5 local utl = require "luci.util"
7 m = Map("radvd", translatef("Radvd - DNSSL"),
8 translate("Radvd is a router advertisement daemon for IPv6. " ..
9 "It listens to router solicitations and sends router advertisements " ..
10 "as described in RFC 4861."))
12 m.redirect = luci.dispatcher.build_url("admin/network/radvd")
14 if m.uci:get("radvd", sid) ~= "dnssl" then
15 luci.http.redirect(m.redirect)
20 s = m:section(NamedSection, sid, "interface", translate("DNSSL Configuration"))
28 o = s:option(Flag, "ignore", translate("Enable"))
31 function o.cfgvalue(...)
32 local v = Flag.cfgvalue(...)
33 return v == "1" and "0" or "1"
36 function o.write(self, section, value)
37 Flag.write(self, section, value == "1" and "0" or "1")
41 o = s:option(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:option(DynamicList, "suffix", translate("Suffix"),
66 translate("Advertised Domain Suffixes"))
70 o.datatype = "hostname"
71 function o.cfgvalue(self, section)
73 local v = m.uci:get_list("radvd", section, "suffix")
74 for v in utl.imatch(v) do
81 o = s:option(Value, "AdvDNSSLLifetime", translate("Lifetime"),
82 translate("Specifies the maximum duration how long the DNSSL entries are used for name resolution."))
84 o.datatype = 'or(uinteger,"infinity")'