* luci/app/hd_idle: small i18n fix
[project/luci.git] / applications / luci-fw / luasrc / model / cbi / luci_fw / firewall.lua
index 6bd7f083df2a05855822077767add83c22a157f0..0d9af93fc6efd79f8071181b51ffb66eb2ffb3ec 100644 (file)
@@ -1,74 +1,65 @@
--- ToDo: Translate, Add descriptions and help texts
-m = Map("luci_fw", "Firewall", [[Mit Hilfe der Firewall können Zugriffe auf das Netzwerk
-erlaubt, verboten oder umgeleitet werden.]])
+--[[
+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$
+]]--
+m = Map("firewall", translate("fw_rules"), translate("fw_rules1"))
 
 s = m:section(TypedSection, "rule", "")
 s.addremove = true
 s.anonymous = true
 
-chain = s:option(ListValue, "chain", "Kette")
-chain:value("forward", "Forward")
-chain:value("input", "Input")
-chain:value("output", "Output")
-chain:value("prerouting", "Prerouting")
-chain:value("postrouting", "Postrouting")
+iface = s:option(ListValue, "src")
+iface.rmempty = true
 
-iface = s:option(ListValue, "iface", "Eingangsschnittstelle")
-iface.optional = true
-
-oface = s:option(ListValue, "oface", "Ausgangsschnittstelle")
+oface = s:option(ListValue, "dest")
+oface:value("")
 oface.optional = true
 
-luci.model.uci.foreach("network", "interface",
+luci.model.uci.cursor():foreach("firewall", "zone",
        function (section)
-               if section[".name"] ~= "loopback" then
-                       iface:value(section[".name"])
-                       oface:value(section[".name"])
-               end
+               iface:value(section.name)
+               oface:value(section.name)
        end)
 
-proto = s:option(ListValue, "proto", "Protokoll")
+proto = s:option(ListValue, "proto", translate("protocol"))
 proto.optional = true
 proto:value("")
+proto:value("tcpudp", "TCP+UDP")
 proto:value("tcp", "TCP")
 proto:value("udp", "UDP")
+proto:value("icmp", "ICMP")
 
-s:option(Value, "source", "Quelladresse").optional = true
-s:option(Value, "destination", "Zieladresse").optional = true
-s:option(Value, "mac", "MAC-Adresse").optional = true
+s:option(Value, "src_ip").optional = true
+s:option(Value, "dest_ip").optional = true
+s:option(Value, "src_mac").optional = true
 
-sport = s:option(Value, "sport", "Quellport")
+sport = s:option(Value, "src_port")
 sport.optional = true
 sport:depends("proto", "tcp")
 sport:depends("proto", "udp")
+sport:depends("proto", "tcpudp")
 
-dport = s:option(Value, "dport", "Zielport")
+dport = s:option(Value, "dest_port")
 dport.optional = true
 dport:depends("proto", "tcp")
 dport:depends("proto", "udp")
+dport:depends("proto", "tcpudp")
 
-tosrc = s:option(Value, "tosrc", "Neue Quelladresse [SNAT]")
-tosrc.optional = true
-tosrc:depends("jump", "SNAT")
-
-tosrc = s:option(Value, "todest", "Neue Zieladresse [DNAT]")
-tosrc.optional = true
-tosrc:depends("jump", "DNAT")
-
-jump = s:option(ListValue, "jump", "Aktion")
+jump = s:option(ListValue, "target")
 jump.rmempty = true
-jump:value("", "")
-jump:value("ACCEPT", "annehmen (ACCEPT)")
-jump:value("REJECT", "zurückweisen (REJECT)")
-jump:value("DROP", "verwerfen (DROP)")
-jump:value("LOG", "protokollieren (LOG)")
-jump:value("DNAT", "Ziel umschreiben (DNAT) [nur Prerouting]")
-jump:value("MASQUERADE", "maskieren (MASQUERADE) [nur Postrouting]")
-jump:value("SNAT", "Quelle umschreiben (SNAT) [nur Postrouting]")
-
+jump.default = "ACCEPT"
+jump:value("DROP", translate("fw_drop"))
+jump:value("ACCEPT", translate("fw_accept"))
+jump:value("REJECT", translate("fw_reject"))
 
-add = s:option(Value, "command", "Eigener Befehl")
-add.size = 50
-add.rmempty = true
 
 return m