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")
22 debug = s:option(ListValue, "DebugLevel")
27 ipv = s:option(ListValue, "IpVersion")
28 ipv:value("4", "IPv4")
29 ipv:value("6", "IPv6")
32 i = m:section(TypedSection, "Interface", translate("interfaces"))
37 network = i:option(ListValue, "Interface", translate("network"))
38 luci.tools.webadmin.cbi_add_networks(network)
40 i:option(Value, "Ip4Broadcast")
41 i:option(Value, "HelloInterval")
42 i:option(Value, "HelloValidityTime")
43 i:option(Value, "TcInterval")
44 i:option(Value, "TcValidityTime")
45 i:option(Value, "MidInterval")
46 i:option(Value, "MidValidityTime")
47 i:option(Value, "HnaInterval")
48 i:option(Value, "HnaValidityTime")
51 p = m:section(TypedSection, "LoadPlugin")
55 lib = p:option(ListValue, "Library", translate("library"))
57 for k, v in pairs(luci.fs.dir("/usr/lib")) do
58 if v:sub(1, 6) == "olsrd_" then
64 for i, sect in ipairs({ "Hna4", "Hna6" }) do
65 hna = m:section(TypedSection, sect)
68 hna.template = "cbi/tblsection"
70 net = hna:option(Value, "NetAddr")
71 msk = hna:option(Value, "Prefix")
75 ipc = m:section(NamedSection, "IpcConnect")
76 conns = ipc:option(Value, "MaxConnections")
77 conns.isInteger = true
79 nets = ipc:option(Value, "Net")
82 hosts = ipc:option(Value, "Host")