2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.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
15 require("luci.tools.webadmin")
17 m = Map("olsrd", translate("OLSR Daemon"),
18 translate("The OLSR daemon is an implementation of the Optimized Link State Routing protocol. "..
19 "As such it allows mesh routing for any network equipment. "..
20 "It runs on any wifi card that supports ad-hoc mode and of course on any ethernet device. "..
21 "Visit <a href='http://www.olsr.org'>olsrd.org</a> for help and documentation."))
23 s = m:section(TypedSection, "olsrd", translate("General settings"))
27 ipv = s:option(ListValue, "IpVersion", translate("Internet protocol"),
28 translate("IP-version to use. If 6and4 is selected then one olsrd instance is started for each protocol."))
29 ipv:value("4", "IPv4")
30 ipv:value("6", "IPv6")
31 ipv:value("6and4", "6and4")
33 debug = s:option(ListValue, "DebugLevel", translate("Debugmode"), translate("Debug level to use. This should usually stay at 0."))
39 clrscr = s:option(Flag, "ClearScreen", translate ("Clear screen"),
40 translate("Clear the screen each time the internal state changes. Default is \"yes\"."))
41 clrscr.default = "yes"
42 clrscr.enabled = "yes"
43 clrscr.disabled = "no"
44 clrscr.optional = true
46 noint = s:option(Flag, "AllowNoInt", translate("Start without network"),
47 translate("If this is set to \"yes\" then olsrd also starts when no network devices are found."))
53 s:option(Value, "Pollrate", translate("Pollrate"),
54 translate("Polling rate for OLSR sockets in seconds. Default is 0.05.")).optional = true
56 s:option(Value, "NicChgsPollInt", translate("Nic changes poll interval"),
57 translate("Interval to poll network interfaces for configuration changes (in seconds). Default is \"2.5\".")).optional = true
59 s:option(Value, "TosValue", translate("TOS value"),
60 translate("Type of service value for the IP header of control traffic. Default is \"16\".")).optional = true
62 fib = s:option(ListValue, "FIBMetric", translate("FIB metric"),
63 translate ("FIBMetric controls the metric value of the host-routes OLSRd sets. "..
64 "\"flat\" means that the metric value is always 2. This is the preferred value "..
65 "because it helps the linux kernel routing to clean up older routes. "..
66 "\"correct\" uses the hopcount as the metric value. "..
67 "\"approx\" use the hopcount as the metric value too, but does only update the hopcount if the nexthop changes too. "..
68 "Default is \"flat\"."))
75 lql = s:option(ListValue, "LinkQualityLevel", translate("LQ level"),
76 translate("Link quality level switch between hopcount and cost-based (mostly ETX) routing.<br />"..
77 "<b>0</b> = do not use link quality<br />"..
78 "<b>2</b> = use link quality for MPR selection and routing<br />"..
84 lqage = s:option(Value, "LinkQualityAging", translate("LQ aging"),
85 translate("Link quality aging factor (only for lq level 2). Tuning parameter for etx_float and etx_fpm, smaller values "..
86 "mean slower changes of ETX value. (allowed values are between 0.01 and 1.0)"))
88 lqage:depends("LinkQualityLevel", "2")
90 lqa = s:option(ListValue, "LinkQualityAlgorithm", translate("LQ algorithm"),
91 translate("Link quality algorithm (only for lq level 2).<br />"..
92 "<b>etx_float</b>: floating point ETX with exponential aging<br />"..
93 "<b>etx_fpm</b> : same as ext_float, but with integer arithmetic<br />"..
94 "<b>etx_ff</b> : ETX freifunk, an etx variant which use all OLSR traffic (instead of only hellos) for ETX calculation<br />"..
95 "<b>etx_ffeth</b>: incompatible variant of etx_ff that allows ethernet links with ETX 0.1.<br />"..
96 "Defaults to \"etx_ff\""))
100 lqa:value("etx_float")
101 lqa:value("etx_ffeth")
102 lqa:depends("LinkQualityLevel", "2")
105 lqfish = s:option(Flag, "LinkQualityFishEye", translate("LQ fisheye"),
106 translate("Fisheye mechanism for TCs (checked means on). Default is \"on\""))
108 lqfish.optional = true
110 hyst = s:option(Flag, "UseHysteresis", translate("Use hysteresis"),
111 translate("Hysteresis for link sensing (only for hopcount metric). Hysteresis adds more robustness to the link sensing "..
112 "but delays neighbor registration. Defaults is \"yes\""))
116 hyst:depends("LinkQualityLevel", "0")
119 port = s:option(Value, "OlsrPort", translate("Port"),
120 translate("The port OLSR uses. This should usually stay at the IANA assigned port 698. It can have a value between 1 and 65535."))
125 mainip = s:option(Value, "MainIp", translate("Main IP"),
126 translate("Sets the main IP (originator ip) of the router. This IP will NEVER change during the uptime of olsrd. "..
127 "Default is 0.0.0.0, which triggers usage of the IP of the first interface."))
128 mainip.optional = true
129 mainip.rmempty = true
131 willingness = s:option(ListValue, "Willingness", translate("Willingness"),
132 translate("The fixed willingness to use. If not set willingness will be calculated dynamically based on battery/power status. Default is \"3\"."))
136 willingness.optional = true
138 natthr = s:option(Value, "NatThreshold", translate("NAT threshold"),
139 translate("If the route to the current gateway is to be changed, the ETX value of this gateway is "..
140 "multiplied with this value before it is compared to the new one. "..
141 "The parameter can be a value between 0.1 and 1.0, but should be close to 1.0 if changed.<br />"..
142 "<b>WARNING:</b> This parameter should not be used together with the etx_ffeth metric!<br />"..
143 "Defaults to \"1.0\"."))
147 natthr:depends("LinkQualityAlgorithm", "etx_ff")
148 natthr:depends("LinkQualityAlgorithm", "etx_float")
149 natthr:depends("LinkQualityAlgorithm", "etx_fpm")
151 natthr.optional = true
153 i = m:section(TypedSection, "Interface", translate("Interfaces"))
158 ign = i:option(Flag, "ignore", translate("Enable"),
159 translate("Enable this interface."))
163 function ign.cfgvalue(self, section)
164 return Flag.cfgvalue(self, section) or "0"
167 network = i:option(ListValue, "interface", translate("Network"),
168 translate("The interface where OLSRd should run. If \"Default\" is selected then the settings made "..
169 "here are used for all other interfaces unless overwritten."))
170 luci.tools.webadmin.cbi_add_networks(network)
171 network:value("Default")
173 mode = i:option(ListValue, "Mode", translate("Mode"),
174 translate("Interface Mode is used to prevent unnecessary packet forwarding on switched ethernet interfaces. "..
175 "valid Modes are \"mesh\" and \"ether\". Default is \"mesh\"."))
181 i:option(Value, "Ip4Broadcast", translate("IPv4 broadcast"),
182 translate("IPv4 broadcast address for outgoing OLSR packets. One useful example would be 255.255.255.255. "..
183 "Default is \"0.0.0.0\", which triggers the usage of the interface broadcast IP.")).optional = true
185 i:option(Value, "IPv6Multicast", translate("IPv6 multicast"),
186 translate("IPv6 multicast address. Default is \"FF02::6D\", the manet-router linklocal multicast.")).optional = true
188 i:option(Value, "IPv4Src", translate("IPv4 source"),
189 translate("IPv4 src address for outgoing OLSR packages. Default is \"0.0.0.0\", which triggers usage of the interface IP.")).optional = true
191 i:option(Value, "IPv6Src", translate("IPv6 source"),
192 translate("IPv6 src prefix. OLSRd will choose one of the interface IPs which matches the prefix of this parameter. "..
193 "Default is \"0::/0\", which triggers the usage of a not-linklocal interface IP.")).optional = true
195 i:option(Value, "HelloInterval", translate("Hello interval")).optional = true
196 i:option(Value, "HelloValidityTime", translate("Hello validity time")).optional = true
197 i:option(Value, "TcInterval", translate("TC interval")).optional = true
198 i:option(Value, "TcValidityTime", translate("TC validity time")).optional = true
199 i:option(Value, "MidInterval", translate("MID interval")).optional = true
200 i:option(Value, "MidValidityTime", translate("MID validity time")).optional = true
201 i:option(Value, "HnaInterval", translate("HNA interval")).optional = true
202 i:option(Value, "HnaValidityTime", translate("HNA validity time")).optional = true
204 i:option(Value, "Weight", translate("Weight"),
205 translate("When multiple links exist between hosts the weight of interface is used to determine the link to use. "..
206 "Normally the weight is automatically calculated by olsrd based on the characteristics of the interface, "..
207 "but here you can specify a fixed value. Olsrd will choose links with the lowest value.<br />"..
208 "<b>Note:</b> Interface weight is used only when LinkQualityLevel is set to 0. "..
209 "For any other value of LinkQualityLevel, the interface ETX value is used instead.")).optional = true
211 lqmult = i:option(DynamicList, "LinkQualityMult", translate("LinkQuality Multiplicator"),
212 translate("Multiply routes with the factor given here. Allowed values are between 0.01 and 1. "..
213 "It is only used when LQ-Level is greater than 0. Examples:<br />"..
214 "reduce LQ to 192.168.0.1 by half: 192.168.0.1 0.5<br />"..
215 "reduce LQ to all nodes on this interface by 20%: default 0.8"))
216 lqmult.optional = true
217 lqmult.rmempty = true
218 lqmult.cast = "table"