7e134cc6d5a637f8ebe19b9e03aaa8af307ac783
[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("olsrd", "OLSR")
18
19 s = m:section(TypedSection, "olsrd", translate("olsr_general"))
20 s.dynamic = true
21 s.anonymous = true
22
23 debug = s:option(ListValue, "DebugLevel")
24 for i=0, 9 do
25         debug:value(i)
26 end
27 debug.optional = true
28
29 ipv = s:option(ListValue, "IpVersion")
30 ipv:value("4", "IPv4")
31 ipv:value("6", "IPv6")
32
33 noint = s:option(Flag, "AllowNoInt")
34 noint.enabled = "yes"
35 noint.disabled = "no"
36 noint.optional = true
37
38 s:option(Value, "Pollrate").optional = true
39
40 tcr = s:option(ListValue, "TcRedundancy")
41 tcr:value("0", translate("olsr_general_tcredundancy_0"))
42 tcr:value("1", translate("olsr_general_tcredundancy_1"))
43 tcr:value("2", translate("olsr_general_tcredundancy_2"))
44 tcr.optional = true
45
46 s:option(Value, "MprCoverage").optional = true
47
48 lql = s:option(ListValue, "LinkQualityLevel")
49 lql:value("0", translate("disable"))
50 lql:value("1", translate("olsr_general_linkqualitylevel_1"))
51 lql:value("2", translate("olsr_general_linkqualitylevel_2"))
52 lql.optional = true
53
54 s:option(Value, "LinkQualityAging").optional = true
55
56 lqa = s:option(ListValue, "LinkQualityAlgorithm")
57 lqa.optional = true
58 lqa:value("etx_fpm", translate("olsr_etx_fpm"))
59 lqa:value("etx_float", translate("olsr_etx_float"))
60 lqa:value("etx_ff", translate("olsr_etx_ff"))
61 lqa.optional = true
62
63 lqfish = s:option(Flag, "LinkQualityFishEye")
64 lqfish.optional = true
65
66 s:option(Value, "LinkQualityWinSize").optional = true
67
68 s:option(Value, "LinkQualityDijkstraLimit").optional = true
69
70 hyst = s:option(Flag, "UseHysteresis")
71 hyst.enabled = "yes"
72 hyst.disabled = "no"
73 hyst.optional = true
74
75 fib = s:option(ListValue, "FIBMetric")
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")
83 clrscr.enabled = "yes"
84 clrscr.disabled = "no"
85 clrscr.optional = true
86
87 willingness = s:option(ListValue, "Willingness")
88 for i=0,7 do
89         willingness:value(i)
90 end
91 willingness.optional = true
92
93
94
95 i = m:section(TypedSection, "Interface", translate("interfaces"))
96 i.anonymous = true
97 i.addremove = true
98 i.dynamic = true
99
100 ign = i:option(Flag, "ignore")
101 ign.enabled  = "1"
102 ign.disabled = "0"
103
104 network = i:option(ListValue, "interface", translate("network"))
105 luci.tools.webadmin.cbi_add_networks(network)
106
107 i:option(Value, "Ip4Broadcast").optional = true
108 i:option(Value, "HelloInterval").optional = true
109 i:option(Value, "HelloValidityTime").optional = true
110 i:option(Value, "TcInterval").optional = true
111 i:option(Value, "TcValidityTime").optional = true
112 i:option(Value, "MidInterval").optional = true
113 i:option(Value, "MidValidityTime").optional = true
114 i:option(Value, "HnaInterval").optional = true
115 i:option(Value, "HnaValidityTime").optional = true
116
117 adc = i:option(Flag, "AutoDetectChanges")
118 adc.enabled  = "yes"
119 adc.disabled = "no"
120 adc.optional = true
121
122
123 ipc = m:section(NamedSection, "IpcConnect")
124 conns = ipc:option(Value, "MaxConnections")
125 conns.isInteger = true
126
127 nets  = ipc:option(Value, "Net")
128 nets.optional = true
129
130 hosts = ipc:option(Value, "Host")
131 hosts.optional = true
132
133
134 return m