2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
15 local ds = require "luci.dispatcher"
16 local fw = require "luci.model.firewall"
18 local m, s, o, p, i, v
21 translate("Firewall - Zone Settings"),
22 translate("The firewall creates zones over your network interfaces to control network traffic flow."))
26 s = m:section(TypedSection, "defaults", translate("General Settings"))
30 s:option(Flag, "syn_flood", translate("Enable SYN-flood protection"))
32 o = s:option(Flag, "drop_invalid", translate("Drop invalid packets"))
33 o.default = o.disabled
36 s:option(ListValue, "input", translate("Input")),
37 s:option(ListValue, "output", translate("Output")),
38 s:option(ListValue, "forward", translate("Forward"))
41 for i, v in ipairs(p) do
42 v:value("REJECT", translate("reject"))
43 v:value("DROP", translate("drop"))
44 v:value("ACCEPT", translate("accept"))
48 s = m:section(TypedSection, "zone", translate("Zones"))
49 s.template = "cbi/tblsection"
52 s.extedit = ds.build_url("admin", "network", "firewall", "zones", "%s")
54 function s.create(self)
55 local z = fw:new_zone()
58 ds.build_url("admin", "network", "firewall", "zones", z.sid)
63 function s.remove(self, section)
64 return fw:del_zone(section)
67 o = s:option(DummyValue, "_info", translate("Zone ⇒ Forwardings"))
68 o.template = "cbi/firewall_zoneforwards"
69 o.cfgvalue = function(self, section)
70 return self.map:get(section, "name")
74 s:option(ListValue, "input", translate("Input")),
75 s:option(ListValue, "output", translate("Output")),
76 s:option(ListValue, "forward", translate("Forward"))
79 for i, v in ipairs(p) do
80 v:value("REJECT", translate("reject"))
81 v:value("DROP", translate("drop"))
82 v:value("ACCEPT", translate("accept"))
85 s:option(Flag, "masq", translate("Masquerading"))
86 s:option(Flag, "mtu_fix", translate("MSS clamping"))