* Merged Luci to use native UCI-library
[project/luci.git] / applications / luci-fw / luasrc / model / cbi / luci_fw / firewall.lua
1 -- ToDo: Translate, Add descriptions and help texts
2 m = Map("luci_fw", "Firewall", [[Mit Hilfe der Firewall können Zugriffe auf das Netzwerk
3 erlaubt, verboten oder umgeleitet werden.]])
4
5 s = m:section(TypedSection, "rule")
6 s.addremove = true
7 s.anonymous = true
8
9 chain = s:option(ListValue, "chain", "Kette")
10 chain:value("forward", "Forward")
11 chain:value("input", "Input")
12 chain:value("output", "Output")
13 chain:value("prerouting", "Prerouting")
14 chain:value("postrouting", "Postrouting")
15
16 iface = s:option(ListValue, "iface", "Eingangsschnittstelle")
17 iface.optional = true
18
19 oface = s:option(ListValue, "oface", "Ausgangsschnittstelle")
20 oface.optional = true
21
22 luci.model.uci.foreach("network", "interface",
23         function (section)
24                 if section[".name"] ~= "loopback" then
25                         iface:value(section[".name"])
26                         oface:value(section[".name"])
27                 end
28         end)
29
30 proto = s:option(ListValue, "proto", "Protokoll")
31 proto.optional = true
32 proto:value("")
33 proto:value("tcp", "TCP")
34 proto:value("udp", "UDP")
35
36 s:option(Value, "source", "Quelladresse").optional = true
37 s:option(Value, "destination", "Zieladresse").optional = true
38 s:option(Value, "mac", "MAC-Adresse").optional = true
39
40 sport = s:option(Value, "sport", "Quellport")
41 sport.optional = true
42 sport:depends("proto", "tcp")
43 sport:depends("proto", "udp")
44
45 dport = s:option(Value, "dport", "Zielport")
46 dport.optional = true
47 dport:depends("proto", "tcp")
48 dport:depends("proto", "udp")
49
50 tosrc = s:option(Value, "tosrc", "Neue Quelladresse [SNAT]")
51 tosrc.optional = true
52 tosrc:depends("jump", "SNAT")
53
54 tosrc = s:option(Value, "todest", "Neue Zieladresse [DNAT]")
55 tosrc.optional = true
56 tosrc:depends("jump", "DNAT")
57
58 jump = s:option(ListValue, "jump", "Aktion")
59 jump.rmempty = true
60 jump:value("", "")
61 jump:value("ACCEPT", "annehmen (ACCEPT)")
62 jump:value("REJECT", "zurückweisen (REJECT)")
63 jump:value("DROP", "verwerfen (DROP)")
64 jump:value("LOG", "protokollieren (LOG)")
65 jump:value("DNAT", "Ziel umschreiben (DNAT) [nur Prerouting]")
66 jump:value("MASQUERADE", "maskieren (MASQUERADE) [nur Postrouting]")
67 jump:value("SNAT", "Quelle umschreiben (SNAT) [nur Postrouting]")
68
69
70 add = s:option(Value, "command", "Eigener Befehl")
71 add.size = 50
72 add.rmempty = true
73
74 return m