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
16 m = Map("olsrd", translate("OLSR Daemon - Interface"),
17 translate("The OLSR daemon is an implementation of the Optimized Link State Routing protocol. "..
18 "As such it allows mesh routing for any network equipment. "..
19 "It runs on any wifi card that supports ad-hoc mode and of course on any ethernet device. "..
20 "Visit <a href='http://www.olsr.org'>olsrd.org</a> for help and documentation."))
22 m.redirect = luci.dispatcher.build_url("admin/services/olsrd")
24 if not arg[1] or m.uci:get("olsrd", arg[1]) ~= "Interface" then
25 luci.http.redirect(m.redirect)
29 i = m:section(NamedSection, arg[1], "Interface", translate("Interface"))
33 i:tab("general", translate("General Settings"))
34 i:tab("addrs", translate("IP Addresses"))
35 i:tab("timing", translate("Timing and Validity"))
37 ign = i:taboption("general", Flag, "ignore", translate("Enable"),
38 translate("Enable this interface."))
42 function ign.cfgvalue(self, section)
43 return Flag.cfgvalue(self, section) or "0"
46 network = i:taboption("general", Value, "interface", translate("Network"),
47 translate("The interface OLSRd should serve."))
49 network.template = "cbi/network_netlist"
50 network.widget = "radio"
51 network.nocreate = true
53 mode = i:taboption("general", ListValue, "Mode", translate("Mode"),
54 translate("Interface Mode is used to prevent unnecessary packet forwarding on switched ethernet interfaces. "..
55 "valid Modes are \"mesh\" and \"ether\". Default is \"mesh\"."))
62 weight = i:taboption("general", Value, "Weight", translate("Weight"),
63 translate("When multiple links exist between hosts the weight of interface is used to determine the link to use. "..
64 "Normally the weight is automatically calculated by olsrd based on the characteristics of the interface, "..
65 "but here you can specify a fixed value. Olsrd will choose links with the lowest value.<br />"..
66 "<b>Note:</b> Interface weight is used only when LinkQualityLevel is set to 0. "..
67 "For any other value of LinkQualityLevel, the interface ETX value is used instead."))
68 weight.optional = true
69 weight.datatype = "uinteger"
70 weight.placeholder = "0"
72 lqmult = i:taboption("general", DynamicList, "LinkQualityMult", translate("LinkQuality Multiplicator"),
73 translate("Multiply routes with the factor given here. Allowed values are between 0.01 and 1. "..
74 "It is only used when LQ-Level is greater than 0. Examples:<br />"..
75 "reduce LQ to 192.168.0.1 by half: 192.168.0.1 0.5<br />"..
76 "reduce LQ to all nodes on this interface by 20%: default 0.8"))
77 lqmult.optional = true
80 lqmult.placeholder = "default 1.0"
83 ip4b = i:taboption("addrs", Value, "Ip4Broadcast", translate("IPv4 broadcast"),
84 translate("IPv4 broadcast address for outgoing OLSR packets. One useful example would be 255.255.255.255. "..
85 "Default is \"0.0.0.0\", which triggers the usage of the interface broadcast IP."))
87 ip4b.datatype = "ip4addr"
88 ip4b.placeholder = "0.0.0.0"
90 ip6m = i:taboption("addrs", Value, "IPv6Multicast", translate("IPv6 multicast"),
91 translate("IPv6 multicast address. Default is \"FF02::6D\", the manet-router linklocal multicast."))
93 ip6m.datatype = "ip6addr"
94 ip6m.placeholder = "FF02::6D"
96 ip4s = i:taboption("addrs", Value, "IPv4Src", translate("IPv4 source"),
97 translate("IPv4 src address for outgoing OLSR packages. Default is \"0.0.0.0\", which triggers usage of the interface IP."))
99 ip4s.datatype = "ip4addr"
100 ip4s.placeholder = "0.0.0.0"
102 ip6s = i:taboption("addrs", Value, "IPv6Src", translate("IPv6 source"),
103 translate("IPv6 src prefix. OLSRd will choose one of the interface IPs which matches the prefix of this parameter. "..
104 "Default is \"0::/0\", which triggers the usage of a not-linklocal interface IP."))
106 ip6s.datatype = "ip6addr"
107 ip6s.placeholder = "0::/0"
110 hi = i:taboption("timing", Value, "HelloInterval", translate("Hello interval"))
112 hi.datatype = "ufloat"
113 hi.placeholder = "5.0"
115 hv = i:taboption("timing", Value, "HelloValidityTime", translate("Hello validity time"))
117 hv.datatype = "ufloat"
118 hv.placeholder = "40.0"
120 ti = i:taboption("timing", Value, "TcInterval", translate("TC interval"))
122 ti.datatype = "ufloat"
123 ti.placeholder = "2.0"
125 tv = i:taboption("timing", Value, "TcValidityTime", translate("TC validity time"))
127 tv.datatype = "ufloat"
128 tv.placeholder = "256.0"
130 mi = i:taboption("timing", Value, "MidInterval", translate("MID interval"))
132 mi.datatype = "ufloat"
133 mi.placeholder = "18.0"
135 mv = i:taboption("timing", Value, "MidValidityTime", translate("MID validity time"))
137 mv.datatype = "ufloat"
138 mv.placeholder = "324.0"
140 ai = i:taboption("timing", Value, "HnaInterval", translate("HNA interval"))
142 ai.datatype = "ufloat"
143 ai.placeholder = "18.0"
145 av = i:taboption("timing", Value, "HnaValidityTime", translate("HNA validity time"))
147 av.datatype = "ufloat"
148 av.placeholder = "108.0"