local uci_r, uci_s
-function _strlist(x)
- if x == nil then
- x = ""
- elseif type(x) == "table" then
- x = table.concat(x, " ")
- end
-
- return x:gmatch("%S+")
-end
-
function _valid_id(x)
return (x and #x > 0 and x:match("^[a-zA-Z0-9_]+$"))
end
function(s)
if s.name and net then
local n
- for n in _strlist(s.network or s.name) do
+ for n in utl.imatch(s.network or s.name) do
if n == net then
z = s['.name']
return false
local nets = { }
local n
- for n in _strlist(self:get("network") or self:get("name")) do
+ for n in utl.imatch(self:get("network") or self:get("name")) do
if n ~= net then
nets[#nets+1] = n
end
local nets = { }
local n
- for n in _strlist(self:get("network") or self:get("name")) do
+ for n in utl.imatch(self:get("network") or self:get("name")) do
if n ~= net then
nets[#nets+1] = n
end
local nets = { }
local n
- for n in _strlist(self:get("network") or self:get("name")) do
+ for n in utl.imatch(self:get("network") or self:get("name")) do
nets[#nets+1] = n
end
end
end
-function _strlist(x)
- if x == nil then
- x = ""
- elseif type(x) == "table" then
- x = table.concat(x, " ")
- end
-
- return x:gmatch("%S+")
-end
-
function _get(c, s, o)
return uci_r:get(c, s, o)
end
ifaces = { interface(ifn) }
else
local nfs = { }
- for ifn in _strlist(self:get("ifname")) do
+ for ifn in utl.imatch(self:get("ifname")) do
ifn = ifn:match("[^:]+")
nfs[ifn] = interface(ifn)
end
ifn = self:proto() .. "-" .. self.sid
return ifname == ifn
else
- for ifn in _strlist(self:get("ifname")) do
+ for ifn in utl.imatch(self:get("ifname")) do
ifn = ifn:match("[^:]+")
if ifn == ifname then
return true