-- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2010-2011 Jo-Philipp Wich <xm@subsignal.org>
+-- Copyright 2010-2011 Jo-Philipp Wich <jow@openwrt.org>
-- Licensed to the public under the Apache License 2.0.
local nw = require "luci.model.network"
name = s:taboption("general", Value, "name", translate("Name"))
name.optional = false
name.forcewrite = true
-name.datatype = "uciname"
+name.datatype = "and(uciname,maxlength(11))"
function name.write(self, section, value)
if zone:name() ~= value then
translate("Restrict Masquerading to given source subnets"))
msrc.optional = true
-msrc.datatype = "list(neg(or(uciname,hostname,ip4addr)))"
+msrc.datatype = "list(neg(or(uciname,hostname,ipmask4)))"
msrc.placeholder = "0.0.0.0/0"
msrc:depends("family", "")
msrc:depends("family", "ipv4")
translate("Restrict Masquerading to given destination subnets"))
mdest.optional = true
-mdest.datatype = "list(neg(or(uciname,hostname,ip4addr)))"
+mdest.datatype = "list(neg(or(uciname,hostname,ipmask4)))"
mdest.placeholder = "0.0.0.0/0"
mdest:depends("family", "")
mdest:depends("family", "ipv4")