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"))
25 s:option(ListValue, "input", translate("Input")),
26 s:option(ListValue, "output", translate("Output")),
27 s:option(ListValue, "forward", translate("Forward"))
30 for i, v in ipairs(p) do
31 v:value("REJECT", translate("reject"))
32 v:value("DROP", translate("drop"))
33 v:value("ACCEPT", translate("accept"))
37 s = m:section(TypedSection, "zone", translate("Zones"))
38 s.template = "cbi/tblsection"
41 s.extedit = ds.build_url("admin", "network", "firewall", "zones", "%s")
43 function s.create(self)
44 local z = fw:new_zone()
47 ds.build_url("admin", "network", "firewall", "zones", z.sid)
52 function s.remove(self, section)
53 return fw:del_zone(section)
56 o = s:option(DummyValue, "_info", translate("Zone ⇒ Forwardings"))
57 o.template = "cbi/firewall_zoneforwards"
58 o.cfgvalue = function(self, section)
59 return self.map:get(section, "name")
63 s:option(ListValue, "input", translate("Input")),
64 s:option(ListValue, "output", translate("Output")),
65 s:option(ListValue, "forward", translate("Forward"))
68 for i, v in ipairs(p) do
69 v:value("REJECT", translate("reject"))
70 v:value("DROP", translate("drop"))
71 v:value("ACCEPT", translate("accept"))
74 s:option(Flag, "masq", translate("Masquerading"))
75 s:option(Flag, "mtu_fix", translate("MSS clamping"))