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", Value, "interface", translate("Interface"),
51 translate("Specifies the logical interface name this section belongs to"))
53 o.template = "cbi/network_netlist"
57 function o.formvalue(...)
58 return Value.formvalue(...) or "-"
61 function o.validate(self, value)
63 return nil, translate("Interface required")
68 function o.write(self, section, value)
69 m.uci:set("radvd", section, "ignore", 0)
70 m.uci:set("radvd", section, "interface", value)
74 o = s:taboption("general", Flag, "AdvSendAdvert", translate("Enable advertisements"),
75 translate("Enables router advertisements and solicitations"))
78 function o.write(self, section, value)
80 m.uci:set("radvd", section, "ignore", 0)
81 m.uci:set("radvd", section, "IgnoreIfMissing", 1)
84 m.uci:set("radvd", section, "AdvSendAdvert", value)
88 o = s:taboption("general", Flag, "UnicastOnly", translate("Unicast only"),
89 translate("Indicates that the underlying link is not broadcast capable, prevents unsolicited advertisements from being sent"))
91 o:depends("AdvSendAdvert", "1")
94 o = s:taboption("general", Flag, "AdvManagedFlag", translate("Managed flag"),
95 translate("Enables the additional stateful administered autoconfiguration protocol (RFC2462)"))
97 o:depends("AdvSendAdvert", "1")
100 o = s:taboption("general", Flag, "AdvOtherConfigFlag", translate("Configuration flag"),
101 translate("Enables the autoconfiguration of additional, non address information (RFC2462)"))
103 o:depends("AdvSendAdvert", "1")
106 o = s:taboption("general", Flag, "AdvSourceLLAddress", translate("Source link-layer address"),
107 translate("Includes the link-layer address of the outgoing interface in the RA"))
111 o:depends("AdvSendAdvert", "1")
114 o = s:taboption("general", Value, "AdvLinkMTU", translate("Link MTU"),
115 translate("Advertises the given link MTU in the RA if specified. 0 disables MTU advertisements"))
117 o.datatype = "uinteger"
119 o:depends("AdvSendAdvert", "1")
122 o = s:taboption("general", Value, "AdvCurHopLimit", translate("Current hop limit"),
123 translate("Advertises the default Hop Count value for outgoing unicast packets in the RA. 0 disables hopcount advertisements"))
125 o.datatype = "uinteger"
128 o:depends("AdvSendAdvert", "1")
131 o = s:taboption("general", ListValue, "AdvDefaultPreference", translate("Default preference"),
132 translate("Advertises the default router preference"))
136 o:value("low", translate("low"))
137 o:value("medium", translate("medium"))
138 o:value("high", translate("high"))
139 o:depends("AdvSendAdvert", "1")
146 o = s:taboption("timing", Value, "MinRtrAdvInterval", translate("Minimum advertisement interval"),
147 translate("The minimum time allowed between sending unsolicited multicast router advertisements from the interface, in seconds"))
149 o.datatype = "uinteger"
152 o:depends("AdvSendAdvert", "1")
155 o = s:taboption("timing", Value, "MaxRtrAdvInterval", translate("Maximum advertisement interval"),
156 translate("The maximum time allowed between sending unsolicited multicast router advertisements from the interface, in seconds"))
158 o.datatype = "uinteger"
161 o:depends("AdvSendAdvert", "1")
164 o = s:taboption("timing", Value, "MinDelayBetweenRAs", translate("Minimum advertisement delay"),
165 translate("The minimum time allowed between sending multicast router advertisements from the interface, in seconds"))
167 o.datatype = "uinteger"
170 o:depends("AdvSendAdvert", "1")
173 o = s:taboption("timing", Value, "AdvReachableTime", translate("Reachable time"),
174 translate("Advertises assumed reachability time in milliseconds of neighbours in the RA if specified. 0 disables reachability advertisements"))
176 o.datatype = "uinteger"
179 o:depends("AdvSendAdvert", "1")
182 o = s:taboption("timing", Value, "AdvRetransTimer", translate("Retransmit timer"),
183 translate("Advertises wait time in milliseconds between Neighbor Solicitation messages in the RA if specified. 0 disables retransmit advertisements"))
185 o.datatype = "uinteger"
188 o:depends("AdvSendAdvert", "1")
191 o = s:taboption("timing", Value, "AdvDefaultLifetime", translate("Default lifetime"),
192 translate("Advertises the lifetime of the default router in seconds. 0 indicates that the node is no default router"))
194 o.datatype = "uinteger"
197 o:depends("AdvSendAdvert", "1")
204 o = s:taboption("mobile", Flag, "AdvHomeAgentFlag", translate("Advertise Home Agent flag"),
205 translate("Advertises Mobile IPv6 Home Agent capability (RFC3775)"))
207 o:depends("AdvSendAdvert", "1")
210 o = s:taboption("mobile", Flag, "AdvIntervalOpt", translate("Mobile IPv6 interval option"),
211 translate("Include Mobile IPv6 Advertisement Interval option to RA"))
213 o:depends({AdvHomeAgentFlag = "1", AdvSendAdvert = "1"})
216 o = s:taboption("mobile", Flag, "AdvHomeAgentInfo", translate("Home Agent information"),
217 translate("Include Home Agent Information in the RA"))
219 o:depends({AdvHomeAgentFlag = "1", AdvSendAdvert = "1"})
222 o = s:taboption("mobile", Flag, "AdvMobRtrSupportFlag", translate("Mobile IPv6 router registration"),
223 translate("Advertises Mobile Router registration capability (NEMO Basic)"))
225 o:depends({AdvHomeAgentInfo = "1", AdvSendAdvert = "1"})
228 o = s:taboption("mobile", Value, "HomeAgentLifetime", translate("Home Agent lifetime"),
229 translate("Advertises the time in seconds the router is offering Mobile IPv6 Home Agent services"))
231 o.datatype = "uinteger"
234 o:depends({AdvHomeAgentInfo = "1", AdvSendAdvert = "1"})
237 o = s:taboption("mobile", Value, "HomeAgentPreference", translate("Home Agent preference"),
238 translate("The preference for the Home Agent sending this RA"))
240 o.datatype = "uinteger"
243 o:depends({AdvHomeAgentInfo = "1", AdvSendAdvert = "1"})