* Separated OLSR pages into separate application pack
[project/luci.git] / applications / luci-olsr / luasrc / model / cbi / olsr / olsrd.lua
1 -- ToDo: Autodetect things, Translate, Add descriptions
2 require("luci.fs")
3
4 m = Map("olsr", "OLSR", [[OLSR ist ein flexibles Routingprotokoll, 
5 dass den Aufbau von mobilen Ad-Hoc Netzen unterstützt.]])
6
7 s = m:section(NamedSection, "general", "olsr", "Allgemeine Einstellungen")
8
9 debug = s:option(ListValue, "DebugLevel", "Debugmodus")
10 for i=0, 9 do
11         debug:value(i)
12 end
13
14 ipv = s:option(ListValue, "IpVersion", "Internet Protokoll")
15 ipv:value("4", "IPv4")
16 ipv:value("6", "IPv6")
17
18 noint = s:option(Flag, "AllowNoInt", "Start ohne Netzwerk")
19 noint.enabled = "yes"
20 noint.disabled = "no"
21
22 s:option(Value, "Pollrate", "Abfragerate (Pollrate)", "s")
23
24 tcr = s:option(ListValue, "TcRedundancy", "TC-Redundanz")
25 tcr:value("0", "MPR-Selektoren")
26 tcr:value("1", "MPR-Selektoren und MPR")
27 tcr:value("2", "Alle Nachbarn")
28
29 s:option(Value, "MprCoverage", "MPR-Erfassung")
30
31 lql = s:option(ListValue, "LinkQualityLevel", "VQ-Level")
32 lql:value("0", "deaktiviert")
33 lql:value("1", "MPR-Auswahl")
34 lql:value("2", "MPR-Auswahl und Routing")
35
36 lqfish = s:option(Flag, "LinkQualityFishEye", "VQ-Fisheye")
37
38 s:option(Value, "LinkQualityWinSize", "VQ-Fenstergröße")
39
40 s:option(Value, "LinkQualityDijkstraLimit", "VQ-Dijkstralimit")
41
42 hyst = s:option(Flag, "UseHysteresis", "Hysterese aktivieren")
43 hyst.enabled = "yes"
44 hyst.disabled = "no"
45
46
47 i = m:section(TypedSection, "Interface", "Schnittstellen")
48 i.anonymous = true
49 i.addremove = true
50 i.dynamic = true
51
52 network = i:option(ListValue, "Interface", "Netzwerkschnittstellen")
53 network:value("")
54 luci.model.uci.foreach("network", "interface",
55         function (section)
56                 if section[".name"] ~= "loopback" then
57                         network:value(section[".name"])
58                 end
59         end)
60
61 i:option(Value, "HelloInterval", "Hello-Intervall")
62
63 i:option(Value, "HelloValidityTime", "Hello-Gültigkeit")
64
65 i:option(Value, "TcInterval", "TC-Intervall")
66
67 i:option(Value, "TcValidityTime", "TC-Gültigkeit")
68
69 i:option(Value, "MidInterval", "MID-Intervall")
70
71 i:option(Value, "MidValidityTime", "MID-Gültigkeit")
72
73 i:option(Value, "HnaInterval", "HNA-Intervall")
74
75 i:option(Value, "HnaValidityTime", "HNA-Gültigkeit")
76
77
78 p = m:section(TypedSection, "LoadPlugin", "Plugins")
79 p.addremove = true
80 p.dynamic = true
81
82 lib = p:option(ListValue, "Library", "Bibliothek")
83 lib:value("")
84 for k, v in pairs(luci.fs.dir("/usr/lib")) do
85         if v:sub(1, 6) == "olsrd_" then
86                 lib:value(v)
87         end
88 end
89
90 return m