1 -- Copyright 2008 Steven Barth <steven@midlink.org>
2 -- Licensed to the public under the Apache License 2.0.
4 local ds = require "luci.dispatcher"
5 local fw = require "luci.model.firewall"
10 translate("Firewall - Zone Settings"),
11 translate("The firewall creates zones over your network interfaces to control network traffic flow."))
15 s = m:section(TypedSection, "defaults", translate("General Settings"))
19 s:option(Flag, "syn_flood", translate("Enable SYN-flood protection"))
21 o = s:option(Flag, "drop_invalid", translate("Drop invalid packets"))
24 s:option(ListValue, "input", translate("Input")),
25 s:option(ListValue, "output", translate("Output")),
26 s:option(ListValue, "forward", translate("Forward"))
29 for i, v in ipairs(p) do
30 v:value("REJECT", translate("reject"))
31 v:value("DROP", translate("drop"))
32 v:value("ACCEPT", translate("accept"))
36 s = m:section(TypedSection, "zone", translate("Zones"))
37 s.template = "cbi/tblsection"
40 s.extedit = ds.build_url("admin", "network", "firewall", "zones", "%s")
42 function s.create(self)
43 local z = fw:new_zone()
46 ds.build_url("admin", "network", "firewall", "zones", z.sid)
51 function s.remove(self, section)
52 return fw:del_zone(section)
55 o = s:option(DummyValue, "_info", translate("Zone ⇒ Forwardings"))
56 o.template = "cbi/firewall_zoneforwards"
57 o.cfgvalue = function(self, section)
58 return self.map:get(section, "name")
62 s:option(ListValue, "input", translate("Input")),
63 s:option(ListValue, "output", translate("Output")),
64 s:option(ListValue, "forward", translate("Forward"))
67 for i, v in ipairs(p) do
68 v:value("REJECT", translate("reject"))
69 v:value("DROP", translate("drop"))
70 v:value("ACCEPT", translate("accept"))
73 s:option(Flag, "masq", translate("Masquerading"))
74 s:option(Flag, "mtu_fix", translate("MSS clamping"))