mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-06 03:45:26 +00:00
38 lines
976 B
Lua
38 lines
976 B
Lua
--
|
|
-- (C) 2017-20 - ntop.org
|
|
--
|
|
|
|
package.path = dirs.installdir .. "/scripts/lua/modules/pools/?.lua;" .. package.path
|
|
local base_pools = require "base_pools"
|
|
local interface_pools = {}
|
|
|
|
-- ##############################################
|
|
|
|
function interface_pools:create()
|
|
-- Instance of the base class
|
|
local _interface_pools = base_pools:create()
|
|
|
|
-- Subclass using the base class instance
|
|
local _interface_pools_instance = _interface_pools:create({key = "interface"})
|
|
|
|
-- Return the instance
|
|
return _interface_pools_instance
|
|
end
|
|
|
|
-- ##############################################
|
|
|
|
-- @brief Returns members which doesn't belong to any pool
|
|
function interface_pools.list_available_members()
|
|
-- STUB: currently returns all members
|
|
local res = {}
|
|
|
|
for ifid, ifname in pairs(interface.getIfNames()) do
|
|
res[#res + 1] = {id = ifid, name = ifname}
|
|
end
|
|
|
|
return res
|
|
end
|
|
|
|
-- ##############################################
|
|
|
|
return interface_pools
|