summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-olsr/luasrc/model/cbi/olsr/olsrd.lua
blob: d5b771096e8444f0a6ee32bc234cc8dac54ad8cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
--[[
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.tools.webadmin")

m = Map("olsrd", translate("OLSR Daemon"))

s = m:section(TypedSection, "olsrd", translate("olsrd_general"))
s.dynamic = true
s.anonymous = true

debug = s:option(ListValue, "DebugLevel")
for i=0, 9 do
	debug:value(i)
end
debug.optional = true

ipv = s:option(ListValue, "IpVersion")
ipv:value("4", "IPv4")
ipv:value("6", "IPv6")

noint = s:option(Flag, "AllowNoInt")
noint.enabled = "yes"
noint.disabled = "no"
noint.optional = true

s:option(Value, "Pollrate").optional = true

tcr = s:option(ListValue, "TcRedundancy")
tcr:value("0", translate("MPR selectors"))
tcr:value("1", translate("MPR selectors and MPR"))
tcr:value("2", translate("all neighbours"))
tcr.optional = true

s:option(Value, "MprCoverage").optional = true

lql = s:option(ListValue, "LinkQualityLevel")
lql:value("0", translate("disable"))
lql:value("1", translate("MPR selection"))
lql:value("2", translate("MPR selection and routing"))
lql.optional = true

s:option(Value, "LinkQualityAging").optional = true

lqa = s:option(ListValue, "LinkQualityAlgorithm")
lqa.optional = true
lqa:value("etx_fpm", translate("fixed point math"))
lqa:value("etx_float", translate("floating point"))
lqa:value("etx_ff", translate("Freifunk"))
lqa.optional = true

lqfish = s:option(Flag, "LinkQualityFishEye")
lqfish.optional = true

s:option(Value, "LinkQualityWinSize").optional = true

s:option(Value, "LinkQualityDijkstraLimit").optional = true

hyst = s:option(Flag, "UseHysteresis")
hyst.enabled = "yes"
hyst.disabled = "no"
hyst.optional = true

fib = s:option(ListValue, "FIBMetric")
fib.optional = true
fib:value("flat")
fib:value("correct")
fib:value("approx")
fib.optional = true

clrscr = s:option(Flag, "ClearScreen")
clrscr.enabled = "yes"
clrscr.disabled = "no"
clrscr.optional = true

willingness = s:option(ListValue, "Willingness")
for i=0,7 do
	willingness:value(i)
end
willingness.optional = true



i = m:section(TypedSection, "Interface", translate("Interfaces"))
i.anonymous = true
i.addremove = true
i.dynamic = true

ign = i:option(Flag, "ignore", "Enable")
ign.enabled  = "0"
ign.disabled = "1"
ign.rmempty = false
function ign.cfgvalue(self, section)
	return Flag.cfgvalue(self, section) or "0"
end

network = i:option(ListValue, "interface", translate("Network"))
luci.tools.webadmin.cbi_add_networks(network)

i:option(Value, "Ip4Broadcast").optional = true

ip6t = i:option(ListValue, "Ip6AddrType")
ip6t:value("", translate("-- Please choose --"))
ip6t:value("auto")
ip6t:value("site-local")
ip6t:value("unique-local")
ip6t:value("global")
ip6t.optional = true

i:option(Value, "HelloInterval").optional = true
i:option(Value, "HelloValidityTime").optional = true
i:option(Value, "TcInterval").optional = true
i:option(Value, "TcValidityTime").optional = true
i:option(Value, "MidInterval").optional = true
i:option(Value, "MidValidityTime").optional = true
i:option(Value, "HnaInterval").optional = true
i:option(Value, "HnaValidityTime").optional = true

adc = i:option(Flag, "AutoDetectChanges")
adc.enabled  = "yes"
adc.disabled = "no"
adc.optional = true

--[[
ipc = m:section(TypedSection, "IpcConnect")
ipc.anonymous = true

conns = ipc:option(Value, "MaxConnections")
conns.isInteger = true

nets  = ipc:option(Value, "Net")
nets.optional = true

hosts = ipc:option(Value, "Host")
hosts.optional = true
]]

return m