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
14 require("luci.tools.webadmin")
17 m = Map("olsr", "OLSR")
19 s = m:section(NamedSection, "general", "olsr")
21 debug = s:option(ListValue, "DebugLevel")
26 ipv = s:option(ListValue, "IpVersion")
27 ipv:value("4", "IPv4")
28 ipv:value("6", "IPv6")
30 noint = s:option(Flag, "AllowNoInt")
34 s:option(Value, "Pollrate")
36 tcr = s:option(ListValue, "TcRedundancy")
37 tcr:value("0", translate("olsr_general_tcredundancy_0"))
38 tcr:value("1", translate("olsr_general_tcredundancy_1"))
39 tcr:value("2", translate("olsr_general_tcredundancy_2"))
41 s:option(Value, "MprCoverage")
43 lql = s:option(ListValue, "LinkQualityLevel")
44 lql:value("0", translate("disable"))
45 lql:value("1", translate("olsr_general_linkqualitylevel_1"))
46 lql:value("2", translate("olsr_general_linkqualitylevel_2"))
48 s:option(Value, "LinkQualityAging").optional = true
50 lqa = s:option(ListValue, "LinkQualityAlgorithm")
52 lqa:value("etx_fpm", translate("olsr_etx_fpm"))
53 lqa:value("etx_float", translate("olsr_etx_float"))
54 lqa:value("etx_ff", translate("olsr_etx_ff"))
56 lqfish = s:option(Flag, "LinkQualityFishEye")
58 s:option(Value, "LinkQualityWinSize")
60 s:option(Value, "LinkQualityDijkstraLimit")
62 hyst = s:option(Flag, "UseHysteresis")
66 fib = s:option(ListValue, "FIBMetric")
72 clrscr = s:option(Flag, "ClearScreen")
73 clrscr.enabled = "yes"
74 clrscr.disabled = "no"
76 willingness = s:option(ListValue, "Willingness")
83 i = m:section(TypedSection, "Interface", translate("interfaces"))
88 network = i:option(ListValue, "Interface", translate("network"))
89 luci.tools.webadmin.cbi_add_networks(network)
91 i:option(Value, "Ip4Broadcast")
92 i:option(Value, "HelloInterval")
93 i:option(Value, "HelloValidityTime")
94 i:option(Value, "TcInterval")
95 i:option(Value, "TcValidityTime")
96 i:option(Value, "MidInterval")
97 i:option(Value, "MidValidityTime")
98 i:option(Value, "HnaInterval")
99 i:option(Value, "HnaValidityTime")
102 p = m:section(TypedSection, "LoadPlugin")
106 lib = p:option(ListValue, "Library", translate("library"))
108 for k, v in pairs(luci.fs.dir("/usr/lib")) do
109 if v:sub(1, 6) == "olsrd_" then
115 for i, sect in ipairs({ "Hna4", "Hna6" }) do
116 hna = m:section(TypedSection, sect)
119 hna.template = "cbi/tblsection"
121 net = hna:option(Value, "NetAddr")
122 msk = hna:option(Value, "Prefix")
126 ipc = m:section(NamedSection, "IpcConnect")
127 conns = ipc:option(Value, "MaxConnections")
128 conns.isInteger = true
130 nets = ipc:option(Value, "Net")
133 hosts = ipc:option(Value, "Host")
134 hosts.optional = true