luci/applications/luci-olsr/luasrc/model/cbi/olsr/olsrd.lua

94 lines
2.2 KiB
Lua
Raw Normal View History

2008-06-08 18:02:47 +00:00
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
require("luci.fs")
2008-04-11 19:03:30 +00:00
2008-06-08 18:02:47 +00:00
m = Map("olsr", "OLSR")
2008-04-11 19:03:30 +00:00
2008-06-08 18:02:47 +00:00
s = m:section(NamedSection, "general", "olsr")
2008-04-11 19:03:30 +00:00
2008-06-08 18:02:47 +00:00
debug = s:option(ListValue, "DebugLevel")
2008-04-11 19:03:30 +00:00
for i=0, 9 do
debug:value(i)
end
2008-06-08 18:02:47 +00:00
ipv = s:option(ListValue, "IpVersion")
2008-04-11 19:03:30 +00:00
ipv:value("4", "IPv4")
ipv:value("6", "IPv6")
2008-06-08 18:02:47 +00:00
noint = s:option(Flag, "AllowNoInt")
2008-04-11 19:03:30 +00:00
noint.enabled = "yes"
noint.disabled = "no"
2008-06-08 18:02:47 +00:00
s:option(Value, "Pollrate")
2008-04-11 19:03:30 +00:00
2008-06-08 18:02:47 +00:00
tcr = s:option(ListValue, "TcRedundancy")
2008-06-09 10:10:29 +00:00
tcr:value("0", translate("olsr_general_tcredundancy_0"))
tcr:value("1", translate("olsr_general_tcredundancy_1"))
tcr:value("2", translate("olsr_general_tcredundancy_2"))
2008-04-11 19:03:30 +00:00
2008-06-08 18:02:47 +00:00
s:option(Value, "MprCoverage")
2008-04-11 19:03:30 +00:00
2008-06-08 18:02:47 +00:00
lql = s:option(ListValue, "LinkQualityLevel")
2008-06-09 10:10:29 +00:00
lql:value("0", translate("disable"))
lql:value("1", translate("olsr_general_linkqualitylevel_1"))
lql:value("2", translate("olsr_general_linkqualitylevel_2"))
2008-04-11 19:03:30 +00:00
2008-06-08 18:02:47 +00:00
lqfish = s:option(Flag, "LinkQualityFishEye")
2008-04-11 19:03:30 +00:00
2008-06-08 18:02:47 +00:00
s:option(Value, "LinkQualityWinSize")
2008-04-11 19:03:30 +00:00
2008-06-08 18:02:47 +00:00
s:option(Value, "LinkQualityDijkstraLimit")
2008-04-11 19:03:30 +00:00
2008-06-08 18:02:47 +00:00
hyst = s:option(Flag, "UseHysteresis")
2008-04-11 19:03:30 +00:00
hyst.enabled = "yes"
hyst.disabled = "no"
2008-06-09 10:10:29 +00:00
i = m:section(TypedSection, "Interface", translate("interfaces"))
2008-04-11 19:03:30 +00:00
i.anonymous = true
i.addremove = true
i.dynamic = true
2008-06-09 10:10:29 +00:00
network = i:option(ListValue, "Interface", translate("network"))
network:value("")
luci.model.uci.foreach("network", "interface",
function (section)
if section[".name"] ~= "loopback" then
network:value(section[".name"])
end
end)
2008-04-11 19:03:30 +00:00
2008-06-08 18:02:47 +00:00
i:option(Value, "HelloInterval")
i:option(Value, "HelloValidityTime")
i:option(Value, "TcInterval")
i:option(Value, "TcValidityTime")
i:option(Value, "MidInterval")
i:option(Value, "MidValidityTime")
i:option(Value, "HnaInterval")
i:option(Value, "HnaValidityTime")
2008-04-11 19:03:30 +00:00
2008-06-08 18:02:47 +00:00
p = m:section(TypedSection, "LoadPlugin")
2008-04-11 19:03:30 +00:00
p.addremove = true
p.dynamic = true
2008-06-09 10:10:29 +00:00
lib = p:option(ListValue, "Library", translate("library"))
2008-04-11 19:03:30 +00:00
lib:value("")
for k, v in pairs(luci.fs.dir("/usr/lib")) do
2008-04-11 19:03:30 +00:00
if v:sub(1, 6) == "olsrd_" then
lib:value(v)
end
end
return m