113ab01e43ab62dda3ab820776c677808d6203e7
[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
15 require("luci.tools.webadmin")
16
17 m = Map("olsrd", translate("OLSR Daemon"))
18
19 s = m:section(TypedSection, "olsrd", translate("General settings"))
20 s.dynamic = true
21 s.anonymous = true
22
23 debug = s:option(ListValue, "DebugLevel", translate("Debugmode"))
24 for i=0, 9 do
25         debug:value(i)
26 end
27 debug.optional = true
28
29 ipv = s:option(ListValue, "IpVersion", translate("Internet protocol"))
30 ipv:value("4", "IPv4")
31 ipv:value("6", "IPv6")
32
33 noint = s:option(Flag, "AllowNoInt", translate("Start without network"))
34 noint.enabled = "yes"
35 noint.disabled = "no"
36 noint.optional = true
37
38 s:option(Value, "Pollrate", translate("Pollrate")).optional = true
39
40 tcr = s:option(ListValue, "TcRedundancy", translate("TC redundancy"))
41 tcr:value("0", translate("MPR selectors"))
42 tcr:value("1", translate("MPR selectors and MPR"))
43 tcr:value("2", translate("all neighbours"))
44 tcr.optional = true
45
46 s:option(Value, "MprCoverage", translate("MPR coverage")).optional = true
47
48 lql = s:option(ListValue, "LinkQualityLevel", translate("LQ level"))
49 lql:value("0", translate("disable"))
50 lql:value("1", translate("MPR selection"))
51 lql:value("2", translate("MPR selection and routing"))
52 lql.optional = true
53
54 s:option(Value, "LinkQualityAging", translate("LQ aging")).optional = true
55
56 lqa = s:option(ListValue, "LinkQualityAlgorithm", translate("LQ algorithm"))
57 lqa.optional = true
58 lqa:value("etx_fpm", translate("fixed point math"))
59 lqa:value("etx_float", translate("floating point"))
60 lqa:value("etx_ff", translate("Freifunk"))
61 lqa.optional = true
62
63 lqfish = s:option(Flag, "LinkQualityFishEye", translate("LQ fisheye"))
64 lqfish.optional = true
65
66 s:option(Value, "LinkQualityWinSize", translate("LQ window size")).optional = true
67
68 s:option(Value, "LinkQualityDijkstraLimit", translate("LQ Dijkstra limit")).optional = true
69
70 hyst = s:option(Flag, "UseHysteresis", translate("Use hysteresis"))
71 hyst.enabled = "yes"
72 hyst.disabled = "no"
73 hyst.optional = true
74
75 fib = s:option(ListValue, "FIBMetric", translate("FIB metric"))
76 fib.optional = true
77 fib:value("flat")
78 fib:value("correct")
79 fib:value("approx")
80 fib.optional = true
81
82 clrscr = s:option(Flag, "ClearScreen", translate ("Clear screen"))
83 clrscr.enabled = "yes"
84 clrscr.disabled = "no"
85 clrscr.optional = true
86
87 willingness = s:option(ListValue, "Willingness", translate("Willingness"))
88 for i=0,7 do
89         willingness:value(i)
90 end
91 willingness.optional = true
92
93 natthr = s:option(Value, "NatThreshold", translate("NAT threshold"))
94 natthr.optional = true
95
96
97 i = m:section(TypedSection, "Interface", translate("Interfaces"))
98 i.anonymous = true
99 i.addremove = true
100 i.dynamic = true
101
102 ign = i:option(Flag, "ignore", translate("Enable"))
103 ign.enabled  = "0"
104 ign.disabled = "1"
105 ign.rmempty = false
106 function ign.cfgvalue(self, section)
107         return Flag.cfgvalue(self, section) or "0"
108 end
109
110 network = i:option(ListValue, "interface", translate("Network"))
111 luci.tools.webadmin.cbi_add_networks(network)
112
113 i:option(Value, "Ip4Broadcast", translate("IPv4 broadcast")).optional = true
114
115 ip6t = i:option(ListValue, "Ip6AddrType", translate("IPv6 address type"))
116 ip6t:value("", translate("-- Please choose --"))
117 ip6t:value("auto")
118 ip6t:value("site-local")
119 ip6t:value("unique-local")
120 ip6t:value("global")
121 ip6t.optional = true
122
123 i:option(Value, "HelloInterval", translate("Hello interval")).optional = true
124 i:option(Value, "HelloValidityTime", translate("Hello validity time")).optional = true
125 i:option(Value, "TcInterval", translate("TC interval")).optional = true
126 i:option(Value, "TcValidityTime", translate("TC validity time")).optional = true
127 i:option(Value, "MidInterval", translate("MID interval")).optional = true
128 i:option(Value, "MidValidityTime", translate("MID validity time")).optional = true
129 i:option(Value, "HnaInterval", translate("HNA interval")).optional = true
130 i:option(Value, "HnaValidityTime", translate("HNA validity time")).optional = true
131
132 adc = i:option(Flag, "AutoDetectChanges", translate("Autodetect changes"))
133 adc.enabled  = "yes"
134 adc.disabled = "no"
135 adc.optional = true
136
137 --[[
138 ipc = m:section(TypedSection, "IpcConnect")
139 ipc.anonymous = true
140
141 conns = ipc:option(Value, "MaxConnections")
142 conns.isInteger = true
143
144 nets  = ipc:option(Value, "Net")
145 nets.optional = true
146
147 hosts = ipc:option(Value, "Host")
148 hosts.optional = true
149 ]]
150
151 return m