diff options
author | Steven Barth <steven@midlink.org> | 2008-06-05 19:16:38 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-06-05 19:16:38 +0000 |
commit | dd9606825da5d73883b8313f5af905ea1b2a4d7d (patch) | |
tree | 1f853ae56dd8e3051698ac6d0a38d61bf6d6997f /applications/luci-fw/luasrc/model/cbi | |
parent | 75f3dbaa6136a1288fbe92d80fc127f5228f5d64 (diff) |
* Merged Luci to use native UCI-library
Diffstat (limited to 'applications/luci-fw/luasrc/model/cbi')
3 files changed, 20 insertions, 17 deletions
diff --git a/applications/luci-fw/luasrc/model/cbi/luci_fw/firewall.lua b/applications/luci-fw/luasrc/model/cbi/luci_fw/firewall.lua index f58f74c2b..c22c37000 100644 --- a/applications/luci-fw/luasrc/model/cbi/luci_fw/firewall.lua +++ b/applications/luci-fw/luasrc/model/cbi/luci_fw/firewall.lua @@ -19,12 +19,13 @@ iface.optional = true oface = s:option(ListValue, "oface", "Ausgangsschnittstelle") oface.optional = true -for k, v in pairs(luci.model.uci.sections("network")) do - if v[".type"] == "interface" and k ~= "loopback" then - iface:value(k) - oface:value(k) - end -end +luci.model.uci.foreach("network", "interface", + function (section) + if section[".name"] ~= "loopback" then + iface:value(section[".name"]) + oface:value(section[".name"]) + end + end) proto = s:option(ListValue, "proto", "Protokoll") proto.optional = true diff --git a/applications/luci-fw/luasrc/model/cbi/luci_fw/portfw.lua b/applications/luci-fw/luasrc/model/cbi/luci_fw/portfw.lua index e4f4fa2ac..79868af17 100644 --- a/applications/luci-fw/luasrc/model/cbi/luci_fw/portfw.lua +++ b/applications/luci-fw/luasrc/model/cbi/luci_fw/portfw.lua @@ -10,11 +10,12 @@ s.anonymous = true iface = s:option(ListValue, "iface", "Schnittstelle", "Externe Schnittstelle") iface.default = "wan" -for k, v in pairs(luci.model.uci.sections("network")) do - if v[".type"] == "interface" and k ~= "loopback" then - iface:value(k) - end -end +luci.model.uci.foreach("network", "interface", + function (section) + if section[".name"] ~= "loopback" then + iface:value(section[".name"]) + end + end) proto = s:option(ListValue, "proto", "Protokoll") proto:value("tcp", "TCP") diff --git a/applications/luci-fw/luasrc/model/cbi/luci_fw/routing.lua b/applications/luci-fw/luasrc/model/cbi/luci_fw/routing.lua index 364e69f62..615e7c874 100644 --- a/applications/luci-fw/luasrc/model/cbi/luci_fw/routing.lua +++ b/applications/luci-fw/luasrc/model/cbi/luci_fw/routing.lua @@ -14,12 +14,13 @@ s.anonymous = true iface = s:option(ListValue, "iface", "Eingang", "Eingangsschnittstelle") oface = s:option(ListValue, "oface", "Ausgang", "Ausgangsschnittstelle") -for k, v in pairs(luci.model.uci.sections("network")) do - if v[".type"] == "interface" and k ~= "loopback" then - iface:value(k) - oface:value(k) - end -end +luci.model.uci.foreach("network", "interface", + function (section) + if section[".name"] ~= "loopback" then + iface:value(section[".name"]) + oface:value(section[".name"]) + end + end) s:option(Flag, "fwd", "FWD", "weiterleiten").rmempty = true s:option(Flag, "nat", "NAT", "übersetzen").rmempty = true |