iface = s:option(ListValue, "src", translate("fw_zone"))
iface.default = "wan"
-luci.model.uci.foreach("firewall", "zone",
+luci.model.uci.cursor():foreach("firewall", "zone",
function (section)
iface:value(section.name)
end)
sport.optional = true
sport:depends("proto", "tcp")
sport:depends("proto", "udp")
+sport:depends("proto", "tcpudp")
proto = s:option(ListValue, "proto", translate("protocol"))
proto.optional = true
proto:value("")
proto:value("tcp", "TCP")
proto:value("udp", "UDP")
+proto:value("tcpudp", "TCP+UDP")
dport = s:option(Value, "src_dport")
dport.size = 5
dport.optional = true
dport:depends("proto", "tcp")
dport:depends("proto", "udp")
+dport:depends("proto", "tcpudp")
to = s:option(Value, "dest_ip")
for i, dataset in ipairs(luci.sys.net.arptable()) do
sport.optional = true
sport:depends("proto", "tcp")
sport:depends("proto", "udp")
+sport:depends("proto", "tcpudp")
dport = s:option(Value, "dest_port")
dport.optional = true
dport:depends("proto", "tcp")
dport:depends("proto", "udp")
+dport:depends("proto", "tcpudp")
jump = s:option(ListValue, "target")
jump.rmempty = true
proto = s:option(ListValue, "proto", translate("protocol"))
proto:value("tcp", "TCP")
proto:value("udp", "UDP")
+proto:value("tcpudp", "TCP+UDP")
dport = s:option(Value, "src_dport")
dport.size = 5
proto = s:option(ListValue, "proto", translate("protocol"))
proto:value("tcp", "TCP")
proto:value("udp", "UDP")
+proto:value("tcpudp", "TCP+UDP")
dport = s:option(Value, "src_dport")
dport.size = 5