diff options
author | Steven Barth <steven@midlink.org> | 2008-05-14 18:16:51 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-05-14 18:16:51 +0000 |
commit | ba971df2afce4dbded063b887bd521e702be55e4 (patch) | |
tree | 85205c7c6c986b9b8dfa1e7b507b538c2913d351 /applications/luci-fw/src/model/cbi | |
parent | 3f4f75b1079eb1ea29b6c2fde9a3dd25c52f2fe4 (diff) |
* applications/luci-fw: Added support for customizing inter-device routing
* applications/luci-fw: Adapted Firewallscripts to better integrate into OpenWRT networking concept
Diffstat (limited to 'applications/luci-fw/src/model/cbi')
3 files changed, 45 insertions, 5 deletions
diff --git a/applications/luci-fw/src/model/cbi/admin_network/firewall.lua b/applications/luci-fw/src/model/cbi/admin_network/firewall.lua index 4ff15db53e..7c89d07c55 100644 --- a/applications/luci-fw/src/model/cbi/admin_network/firewall.lua +++ b/applications/luci-fw/src/model/cbi/admin_network/firewall.lua @@ -13,8 +13,18 @@ chain:value("output", "Output") chain:value("prerouting", "Prerouting") chain:value("postrouting", "Postrouting") -s:option(Value, "iface", "Eingangsschnittstelle").optional = true -s:option(Value, "oface", "Ausgangsschnittstelle").optional = true +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 diff --git a/applications/luci-fw/src/model/cbi/admin_network/portfw.lua b/applications/luci-fw/src/model/cbi/admin_network/portfw.lua index 5ee22336e7..90ebb4c24d 100644 --- a/applications/luci-fw/src/model/cbi/admin_network/portfw.lua +++ b/applications/luci-fw/src/model/cbi/admin_network/portfw.lua @@ -9,9 +9,11 @@ s.addremove = true s.anonymous = true iface = s:option(ListValue, "iface", "Schnittstelle", "Externe Schnittstelle") -iface:value("") -for k,v in pairs(ffluci.sys.net.devices()) do - iface:value(v) +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") diff --git a/applications/luci-fw/src/model/cbi/admin_network/routing.lua b/applications/luci-fw/src/model/cbi/admin_network/routing.lua new file mode 100644 index 0000000000..45016f42b9 --- /dev/null +++ b/applications/luci-fw/src/model/cbi/admin_network/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") +s:option(Flag, "nat", "NAT", "übersetzen") +s:option(Flag, "bidi", "<->", "beide Richtungen") + +return m |