modules/admin-core: Added several cross-references to relevant configuration pages
[project/luci.git] / applications / luci-olsr / luasrc / model / cbi / olsr / olsrd.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5
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
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14 require("luci.tools.webadmin")
15 require("luci.fs")
16
17 m = Map("olsr", "OLSR")
18
19 s = m:section(NamedSection, "general", "olsr")
20
21 debug = s:option(ListValue, "DebugLevel")
22 for i=0, 9 do
23         debug:value(i)
24 end
25
26 ipv = s:option(ListValue, "IpVersion")
27 ipv:value("4", "IPv4")
28 ipv:value("6", "IPv6")
29
30 noint = s:option(Flag, "AllowNoInt")
31 noint.enabled = "yes"
32 noint.disabled = "no"
33
34 s:option(Value, "Pollrate")
35
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"))
40
41 s:option(Value, "MprCoverage")
42
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"))
47
48 s:option(Value, "LinkQualityAging").optional = true
49
50 lqa = s:option(ListValue, "LinkQualityAlgorithm")
51 lqa.optional = true
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"))
55
56 lqfish = s:option(Flag, "LinkQualityFishEye")
57
58 s:option(Value, "LinkQualityWinSize")
59
60 s:option(Value, "LinkQualityDijkstraLimit")
61
62 hyst = s:option(Flag, "UseHysteresis")
63 hyst.enabled = "yes"
64 hyst.disabled = "no"
65
66 fib = s:option(ListValue, "FIBMetric")
67 fib.optional = true
68 fib:value("flat")
69 fib:value("correct")
70 fib:value("approx")
71
72 clrscr = s:option(Flag, "ClearScreen")
73 clrscr.enabled = "yes"
74 clrscr.disabled = "no"
75
76 willingness = s:option(ListValue, "Willingness")
77 for i=0,7 do
78         willingness:value(i)
79 end
80
81
82
83 i = m:section(TypedSection, "Interface", translate("interfaces"))
84 i.anonymous = true
85 i.addremove = true
86 i.dynamic = true
87
88 network = i:option(ListValue, "Interface", translate("network"))
89 luci.tools.webadmin.cbi_add_networks(network)
90
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")
100
101
102 p = m:section(TypedSection, "LoadPlugin")
103 p.addremove = true
104 p.dynamic = true
105
106 lib = p:option(ListValue, "Library", translate("library"))
107 lib:value("")
108 for k, v in pairs(luci.fs.dir("/usr/lib")) do
109         if v:sub(1, 6) == "olsrd_" then
110                 lib:value(v)
111         end
112 end
113
114
115 for i, sect in ipairs({ "Hna4", "Hna6" }) do
116         hna = m:section(TypedSection, sect)
117         hna.addremove = true
118         hna.anonymous = true
119
120         net = hna:option(Value, "NetAddr")
121         msk = hna:option(Value, "Prefix")
122 end
123
124
125 ipc = m:section(NamedSection, "IpcConnect")
126 conns = ipc:option(Value, "MaxConnections")
127 conns.isInteger = true
128
129 nets  = ipc:option(Value, "Net")
130 nets.optional = true
131
132 hosts = ipc:option(Value, "Host")
133 hosts.optional = true
134
135
136 return m