translate("Source MAC address"),
translate("Only match incoming traffic from these MACs."))
o.rmempty = true
-o.datatype = "macaddr"
+o.datatype = "neg(macaddr)"
o.placeholder = translate("any")
+luci.sys.net.mac_hints(function(mac, name)
+ o:value(mac, "%s (%s)" %{ mac, name })
+end)
+
o = s:option(Value, "src_ip",
translate("Source IP address"),
o.datatype = "neg(ip4addr)"
o.placeholder = translate("any")
+luci.sys.net.ipv4_hints(function(ip, name)
+ o:value(ip, "%s (%s)" %{ ip, name })
+end)
+
o = s:option(Value, "src_port",
translate("Source port"),
translate("Only match incoming traffic originating from the given source port or port range on the client host"))
o.rmempty = true
-o.datatype = "portrange"
+o.datatype = "neg(portrange)"
o.placeholder = translate("any")
translate("External IP address"),
translate("Only match incoming traffic directed at the given IP address."))
+luci.sys.net.ipv4_hints(function(ip, name)
+ o:value(ip, "%s (%s)" %{ ip, name })
+end)
+
+
o.rmempty = true
-o.datatype = "ip4addr"
+o.datatype = "neg(ip4addr)"
o.placeholder = translate("any")
o = s:option(Value, "src_dport", translate("External port"),
translate("Match incoming traffic directed at the given " ..
"destination port or port range on this host"))
-o.datatype = "portrange"
+o.datatype = "neg(portrange)"
translate("Redirect matched incoming traffic to the specified \
internal host"))
o.datatype = "ip4addr"
-for i, dataset in ipairs(sys.net.arptable()) do
- o:value(dataset["IP address"])
-end
+
+luci.sys.net.ipv4_hints(function(ip, name)
+ o:value(ip, "%s (%s)" %{ ip, name })
+end)
o = s:option(Value, "dest_port",