local ds = require "luci.dispatcher"
local fw = require "luci.model.firewall"
+local fs = require "nixio.fs"
local m, s, o, p, i, v
v:value("ACCEPT", translate("accept"))
end
+-- Netfilter flow offload support
+
+local offload = fs.access("/sys/module/xt_FLOWOFFLOAD/refcnt")
+
+if offload then
+ s:option(DummyValue, "offload_advice",
+ translate("Routing/NAT Offloading"),
+ translate("Experimental feature. Not fully compatible with QoS/SQM."))
+
+ o = s:option(Flag, "flow_offloading",
+ translate("Software flow offloading"),
+ translate("Software based offloading for routing/NAT"))
+ o.optional = true
+
+ o = s:option(Flag, "flow_offloading_hw",
+ translate("Hardware flow offloading"),
+ translate("Requires hardware NAT support. Implemented at least for mt7621"))
+ o.optional = true
+ o:depends( "flow_offloading", 1)
+end
+
+-- Firewall zones
s = m:section(TypedSection, "zone", translate("Zones"))
s.template = "cbi/tblsection"