+function network.get_interfaces(self)
+ local ifaces = { }
+
+ local ifn
+ local nfs = { }
+ for ifn in utl.imatch(self:get("ifname")) do
+ ifn = ifn:match("^[^:/]+")
+ nfs[ifn] = interface(ifn)
+ end
+
+ for ifn in utl.kspairs(nfs) do
+ ifaces[#ifaces+1] = nfs[ifn]
+ end
+
+ local num = { }
+ local wfs = { }
+ uci_r:foreach("wireless", "wifi-iface",
+ function(s)
+ if s.device then
+ num[s.device] = num[s.device] and num[s.device] + 1 or 1
+ if s.network == self.sid then
+ ifn = "%s.network%d" %{ s.device, num[s.device] }
+ wfs[ifn] = interface(ifn)
+ end
+ end
+ end)
+
+ for ifn in utl.kspairs(wfs) do
+ ifaces[#ifaces+1] = wfs[ifn]
+
+ -- only bridges may cover more than one interface
+ --if not self:is_bridge() then
+ -- break
+ --end