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 - Interface %q", "?"),
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) ~= "interface" then
25 luci.http.redirect(m.redirect)
29 m.uci:foreach("radvd", "interface",
31 if s['.name'] == sid and s.interface then
32 m.title = translatef("Radvd - Interface %q", s.interface)
38 s = m:section(NamedSection, sid, "interface", translate("Interface Configuration"))
41 s:tab("general", translate("General"))
42 s:tab("timing", translate("Timing"))
43 s:tab("mobile", translate("Mobile IPv6"))
50 o = s:taboption("general", Flag, "ignore", translate("Enable"))
53 function o.cfgvalue(...)
54 local v = Flag.cfgvalue(...)
55 return v == "1" and "0" or "1"
58 function o.write(self, section, value)
59 Flag.write(self, section, value == "1" and "0" or "1")
63 o = s:taboption("general", Value, "interface", translate("Interface"),
64 translate("Specifies the logical interface name this section belongs to"))
66 o.template = "cbi/network_netlist"
70 function o.formvalue(...)
71 return Value.formvalue(...) or "-"
74 function o.validate(self, value)
76 return nil, translate("Interface required")
81 function o.write(self, section, value)
82 m.uci:set("radvd", section, "ignore", 0)
83 m.uci:set("radvd", section, "interface", value)
87 o = s:taboption("general", Flag, "AdvSendAdvert", translate("Enable advertisements"),
88 translate("Enables router advertisements and solicitations"))
91 function o.write(self, section, value)
93 m.uci:set("radvd", section, "ignore", 0)
94 m.uci:set("radvd", section, "IgnoreIfMissing", 1)
97 m.uci:set("radvd", section, "AdvSendAdvert", value)
101 o = s:taboption("general", Flag, "UnicastOnly", translate("Unicast only"),
102 translate("Indicates that the underlying link is not broadcast capable, prevents unsolicited advertisements from being sent"))
104 o:depends("AdvSendAdvert", "1")
107 o = s:taboption("general", Flag, "AdvManagedFlag", translate("Managed flag"),
108 translate("Enables the additional stateful administered autoconfiguration protocol (RFC2462)"))
110 o:depends("AdvSendAdvert", "1")
113 o = s:taboption("general", Flag, "AdvOtherConfigFlag", translate("Configuration flag"),
114 translate("Enables the autoconfiguration of additional, non address information (RFC2462)"))
116 o:depends("AdvSendAdvert", "1")
119 o = s:taboption("general", Flag, "AdvSourceLLAddress", translate("Source link-layer address"),
120 translate("Includes the link-layer address of the outgoing interface in the RA"))
124 o:depends("AdvSendAdvert", "1")
127 o = s:taboption("general", Value, "AdvLinkMTU", translate("Link MTU"),
128 translate("Advertises the given link MTU in the RA if specified. 0 disables MTU advertisements"))
130 o.datatype = "uinteger"
132 o:depends("AdvSendAdvert", "1")
135 o = s:taboption("general", Value, "AdvCurHopLimit", translate("Current hop limit"),
136 translate("Advertises the default Hop Count value for outgoing unicast packets in the RA. 0 disables hopcount advertisements"))
138 o.datatype = "uinteger"
141 o:depends("AdvSendAdvert", "1")
144 o = s:taboption("general", ListValue, "AdvDefaultPreference", translate("Default preference"),
145 translate("Advertises the default router preference"))
149 o:value("low", translate("low"))
150 o:value("medium", translate("medium"))
151 o:value("high", translate("high"))
152 o:depends("AdvSendAdvert", "1")
159 o = s:taboption("timing", Value, "MinRtrAdvInterval", translate("Minimum advertisement interval"),
160 translate("The minimum time allowed between sending unsolicited multicast router advertisements from the interface, in seconds"))
162 o.datatype = "uinteger"
165 o:depends("AdvSendAdvert", "1")
168 o = s:taboption("timing", Value, "MaxRtrAdvInterval", translate("Maximum advertisement interval"),
169 translate("The maximum time allowed between sending unsolicited multicast router advertisements from the interface, in seconds"))
171 o.datatype = "uinteger"
174 o:depends("AdvSendAdvert", "1")
177 o = s:taboption("timing", Value, "MinDelayBetweenRAs", translate("Minimum advertisement delay"),
178 translate("The minimum time allowed between sending multicast router advertisements from the interface, in seconds"))
180 o.datatype = "uinteger"
183 o:depends("AdvSendAdvert", "1")
186 o = s:taboption("timing", Value, "AdvReachableTime", translate("Reachable time"),
187 translate("Advertises assumed reachability time in milliseconds of neighbours in the RA if specified. 0 disables reachability advertisements"))
189 o.datatype = "uinteger"
192 o:depends("AdvSendAdvert", "1")
195 o = s:taboption("timing", Value, "AdvRetransTimer", translate("Retransmit timer"),
196 translate("Advertises wait time in milliseconds between Neighbor Solicitation messages in the RA if specified. 0 disables retransmit advertisements"))
198 o.datatype = "uinteger"
201 o:depends("AdvSendAdvert", "1")
204 o = s:taboption("timing", Value, "AdvDefaultLifetime", translate("Default lifetime"),
205 translate("Advertises the lifetime of the default router in seconds. 0 indicates that the node is no default router"))
207 o.datatype = "uinteger"
210 o:depends("AdvSendAdvert", "1")
217 o = s:taboption("mobile", Flag, "AdvHomeAgentFlag", translate("Advertise Home Agent flag"),
218 translate("Advertises Mobile IPv6 Home Agent capability (RFC3775)"))
220 o:depends("AdvSendAdvert", "1")
223 o = s:taboption("mobile", Flag, "AdvIntervalOpt", translate("Mobile IPv6 interval option"),
224 translate("Include Mobile IPv6 Advertisement Interval option to RA"))
226 o:depends({AdvHomeAgentFlag = "1", AdvSendAdvert = "1"})
229 o = s:taboption("mobile", Flag, "AdvHomeAgentInfo", translate("Home Agent information"),
230 translate("Include Home Agent Information in the RA"))
232 o:depends({AdvHomeAgentFlag = "1", AdvSendAdvert = "1"})
235 o = s:taboption("mobile", Flag, "AdvMobRtrSupportFlag", translate("Mobile IPv6 router registration"),
236 translate("Advertises Mobile Router registration capability (NEMO Basic)"))
238 o:depends({AdvHomeAgentInfo = "1", AdvSendAdvert = "1"})
241 o = s:taboption("mobile", Value, "HomeAgentLifetime", translate("Home Agent lifetime"),
242 translate("Advertises the time in seconds the router is offering Mobile IPv6 Home Agent services"))
244 o.datatype = "uinteger"
247 o:depends({AdvHomeAgentInfo = "1", AdvSendAdvert = "1"})
250 o = s:taboption("mobile", Value, "HomeAgentPreference", translate("Home Agent preference"),
251 translate("The preference for the Home Agent sending this RA"))
253 o.datatype = "uinteger"
256 o:depends({AdvHomeAgentInfo = "1", AdvSendAdvert = "1"})