From 6604399aa8f35d33c53a5e5a1fea765f401aef5e Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Thu, 22 May 2008 14:04:03 +0000 Subject: Merge branch 'menu' --- .../luci-fw/src/controller/luci_fw/luci_fw.lua | 18 ++++++ .../src/model/cbi/admin_network/firewall.lua | 73 ---------------------- .../luci-fw/src/model/cbi/admin_network/portfw.lua | 28 --------- .../src/model/cbi/admin_network/routing.lua | 28 --------- .../luci-fw/src/model/cbi/luci_fw/firewall.lua | 73 ++++++++++++++++++++++ .../luci-fw/src/model/cbi/luci_fw/portfw.lua | 28 +++++++++ .../luci-fw/src/model/cbi/luci_fw/routing.lua | 28 +++++++++ applications/luci-fw/src/model/menu/50luci-fw.lua | 4 -- 8 files changed, 147 insertions(+), 133 deletions(-) create mode 100644 applications/luci-fw/src/controller/luci_fw/luci_fw.lua delete mode 100644 applications/luci-fw/src/model/cbi/admin_network/firewall.lua delete mode 100644 applications/luci-fw/src/model/cbi/admin_network/portfw.lua delete mode 100644 applications/luci-fw/src/model/cbi/admin_network/routing.lua create mode 100644 applications/luci-fw/src/model/cbi/luci_fw/firewall.lua create mode 100644 applications/luci-fw/src/model/cbi/luci_fw/portfw.lua create mode 100644 applications/luci-fw/src/model/cbi/luci_fw/routing.lua delete mode 100644 applications/luci-fw/src/model/menu/50luci-fw.lua (limited to 'applications/luci-fw') diff --git a/applications/luci-fw/src/controller/luci_fw/luci_fw.lua b/applications/luci-fw/src/controller/luci_fw/luci_fw.lua new file mode 100644 index 000000000..864455ca8 --- /dev/null +++ b/applications/luci-fw/src/controller/luci_fw/luci_fw.lua @@ -0,0 +1,18 @@ +module("ffluci.controller.luci_fw.luci_fw", package.seeall) + +function index() + local page = node("admin", "network", "portfw") + page.target = cbi("luci_fw/portfw") + page.title = "Portweiterleitung" + page.order = 70 + + local page = node("admin", "network", "routing") + page.target = cbi("luci_fw/routing") + page.title = "Routing" + page.order = 72 + + local page = node("admin", "network", "firewall") + page.target = cbi("luci_fw/firewall") + page.title = "Firewall" + page.order = 74 +end \ No newline at end of file diff --git a/applications/luci-fw/src/model/cbi/admin_network/firewall.lua b/applications/luci-fw/src/model/cbi/admin_network/firewall.lua deleted file mode 100644 index 7c89d07c5..000000000 --- a/applications/luci-fw/src/model/cbi/admin_network/firewall.lua +++ /dev/null @@ -1,73 +0,0 @@ --- 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.]]) - -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, "iface", "Eingangsschnittstelle") -iface.optional = true - -oface = s:option(ListValue, "oface", "Ausgangsschnittstelle") -oface.optional = true - -for k, v in pairs(ffluci.model.uci.sections("network")) do - if v[".type"] == "interface" and k ~= "loopback" then - iface:value(k) - oface:value(k) - end -end - -proto = s:option(ListValue, "proto", "Protokoll") -proto.optional = true -proto:value("") -proto:value("tcp", "TCP") -proto:value("udp", "UDP") - -s:option(Value, "source", "Quelladresse").optional = true -s:option(Value, "destination", "Zieladresse").optional = true -s:option(Value, "mac", "MAC-Adresse").optional = true - -sport = s:option(Value, "sport", "Quellport") -sport.optional = true -sport:depends("proto", "tcp") -sport:depends("proto", "udp") - -dport = s:option(Value, "dport", "Zielport") -dport.optional = true -dport:depends("proto", "tcp") -dport:depends("proto", "udp") - -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.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]") - - -add = s:option(Value, "command", "Eigener Befehl") -add.size = 50 -add.rmempty = true - -return m diff --git a/applications/luci-fw/src/model/cbi/admin_network/portfw.lua b/applications/luci-fw/src/model/cbi/admin_network/portfw.lua deleted file mode 100644 index 90ebb4c24..000000000 --- a/applications/luci-fw/src/model/cbi/admin_network/portfw.lua +++ /dev/null @@ -1,28 +0,0 @@ --- ToDo: Translate, Add descriptions and help texts -require("ffluci.sys") -m = Map("luci_fw", "Portweiterleitung", [[Portweiterleitungen ermöglichen es interne -Netzwerkdienste von einem anderen externen Netzwerk aus erreichbar zu machen.]]) - -s = m:section(TypedSection, "portfw") -s.template = "cbi/tblsection" -s.addremove = true -s.anonymous = true - -iface = s:option(ListValue, "iface", "Schnittstelle", "Externe Schnittstelle") -iface.default = "wan" -for k, v in pairs(ffluci.model.uci.sections("network")) do - if v[".type"] == "interface" and k ~= "loopback" then - iface:value(k) - end -end - -proto = s:option(ListValue, "proto", "Protokoll") -proto:value("tcp", "TCP") -proto:value("udp", "UDP") -proto:value("tcpudp", "TCP + UDP") - -dport = s:option(Value, "dport", "Externer Port", "Port[:Endport]") - -to = s:option(Value, "to", "Interne Adresse", "IP-Adresse[:Zielport[-Zielendport]]") - -return m diff --git a/applications/luci-fw/src/model/cbi/admin_network/routing.lua b/applications/luci-fw/src/model/cbi/admin_network/routing.lua deleted file mode 100644 index 5805b1d3f..000000000 --- a/applications/luci-fw/src/model/cbi/admin_network/routing.lua +++ /dev/null @@ -1,28 +0,0 @@ --- ToDo: Translate, Add descriptions and help texts -require("ffluci.sys") -m = Map("luci_fw", "Routing", [[An dieser Stelle wird festlegt, welcher Netzverkehr zwischen einzelnen -Schnittstellen erlaubt werden soll. Es werden jeweils nur neue Verbindungen -betrachtet, d.h. Pakete von aufgebauten oder zugehörigen Verbindungen werden automatisch in beide Richtungen -akzeptiert, auch wenn das Feld "beide Richtungen" nicht explizit gesetzt ist. -NAT ermöglicht Adressübersetzung.]]) - -s = m:section(TypedSection, "routing") -s.template = "cbi/tblsection" -s.addremove = true -s.anonymous = true - -iface = s:option(ListValue, "iface", "Eingang", "Eingangsschnittstelle") -oface = s:option(ListValue, "oface", "Ausgang", "Ausgangsschnittstelle") - -for k, v in pairs(ffluci.model.uci.sections("network")) do - if v[".type"] == "interface" and k ~= "loopback" then - iface:value(k) - oface:value(k) - end -end - -s:option(Flag, "fwd", "FWD", "weiterleiten").rmempty = true -s:option(Flag, "nat", "NAT", "übersetzen").rmempty = true -s:option(Flag, "bidi", "<->", "beide Richtungen").rmempty = true - -return m diff --git a/applications/luci-fw/src/model/cbi/luci_fw/firewall.lua b/applications/luci-fw/src/model/cbi/luci_fw/firewall.lua new file mode 100644 index 000000000..7c89d07c5 --- /dev/null +++ b/applications/luci-fw/src/model/cbi/luci_fw/firewall.lua @@ -0,0 +1,73 @@ +-- 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.]]) + +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, "iface", "Eingangsschnittstelle") +iface.optional = true + +oface = s:option(ListValue, "oface", "Ausgangsschnittstelle") +oface.optional = true + +for k, v in pairs(ffluci.model.uci.sections("network")) do + if v[".type"] == "interface" and k ~= "loopback" then + iface:value(k) + oface:value(k) + end +end + +proto = s:option(ListValue, "proto", "Protokoll") +proto.optional = true +proto:value("") +proto:value("tcp", "TCP") +proto:value("udp", "UDP") + +s:option(Value, "source", "Quelladresse").optional = true +s:option(Value, "destination", "Zieladresse").optional = true +s:option(Value, "mac", "MAC-Adresse").optional = true + +sport = s:option(Value, "sport", "Quellport") +sport.optional = true +sport:depends("proto", "tcp") +sport:depends("proto", "udp") + +dport = s:option(Value, "dport", "Zielport") +dport.optional = true +dport:depends("proto", "tcp") +dport:depends("proto", "udp") + +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.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]") + + +add = s:option(Value, "command", "Eigener Befehl") +add.size = 50 +add.rmempty = true + +return m diff --git a/applications/luci-fw/src/model/cbi/luci_fw/portfw.lua b/applications/luci-fw/src/model/cbi/luci_fw/portfw.lua new file mode 100644 index 000000000..90ebb4c24 --- /dev/null +++ b/applications/luci-fw/src/model/cbi/luci_fw/portfw.lua @@ -0,0 +1,28 @@ +-- ToDo: Translate, Add descriptions and help texts +require("ffluci.sys") +m = Map("luci_fw", "Portweiterleitung", [[Portweiterleitungen ermöglichen es interne +Netzwerkdienste von einem anderen externen Netzwerk aus erreichbar zu machen.]]) + +s = m:section(TypedSection, "portfw") +s.template = "cbi/tblsection" +s.addremove = true +s.anonymous = true + +iface = s:option(ListValue, "iface", "Schnittstelle", "Externe Schnittstelle") +iface.default = "wan" +for k, v in pairs(ffluci.model.uci.sections("network")) do + if v[".type"] == "interface" and k ~= "loopback" then + iface:value(k) + end +end + +proto = s:option(ListValue, "proto", "Protokoll") +proto:value("tcp", "TCP") +proto:value("udp", "UDP") +proto:value("tcpudp", "TCP + UDP") + +dport = s:option(Value, "dport", "Externer Port", "Port[:Endport]") + +to = s:option(Value, "to", "Interne Adresse", "IP-Adresse[:Zielport[-Zielendport]]") + +return m diff --git a/applications/luci-fw/src/model/cbi/luci_fw/routing.lua b/applications/luci-fw/src/model/cbi/luci_fw/routing.lua new file mode 100644 index 000000000..5805b1d3f --- /dev/null +++ b/applications/luci-fw/src/model/cbi/luci_fw/routing.lua @@ -0,0 +1,28 @@ +-- ToDo: Translate, Add descriptions and help texts +require("ffluci.sys") +m = Map("luci_fw", "Routing", [[An dieser Stelle wird festlegt, welcher Netzverkehr zwischen einzelnen +Schnittstellen erlaubt werden soll. Es werden jeweils nur neue Verbindungen +betrachtet, d.h. Pakete von aufgebauten oder zugehörigen Verbindungen werden automatisch in beide Richtungen +akzeptiert, auch wenn das Feld "beide Richtungen" nicht explizit gesetzt ist. +NAT ermöglicht Adressübersetzung.]]) + +s = m:section(TypedSection, "routing") +s.template = "cbi/tblsection" +s.addremove = true +s.anonymous = true + +iface = s:option(ListValue, "iface", "Eingang", "Eingangsschnittstelle") +oface = s:option(ListValue, "oface", "Ausgang", "Ausgangsschnittstelle") + +for k, v in pairs(ffluci.model.uci.sections("network")) do + if v[".type"] == "interface" and k ~= "loopback" then + iface:value(k) + oface:value(k) + end +end + +s:option(Flag, "fwd", "FWD", "weiterleiten").rmempty = true +s:option(Flag, "nat", "NAT", "übersetzen").rmempty = true +s:option(Flag, "bidi", "<->", "beide Richtungen").rmempty = true + +return m diff --git a/applications/luci-fw/src/model/menu/50luci-fw.lua b/applications/luci-fw/src/model/menu/50luci-fw.lua deleted file mode 100644 index b7543b062..000000000 --- a/applications/luci-fw/src/model/menu/50luci-fw.lua +++ /dev/null @@ -1,4 +0,0 @@ -sel("admin", "network") -act("portfw", "Portweiterleitung") -act("routing", "Routing") -act("firewall", "Firewall") \ No newline at end of file -- cgit v1.2.3