mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Initial implementation of lua classes to handle pools and interface pools
This commit is contained in:
parent
fdb486e088
commit
a9040f1057
2 changed files with 100 additions and 0 deletions
|
|
@ -8,6 +8,26 @@ local interface_pools = {}
|
|||
|
||||
-- ##############################################
|
||||
|
||||
function interface_pools:create(name, members, configset_id)
|
||||
-- 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", name = name or '', members = members or {}, configset_id = configset_id or 0})
|
||||
|
||||
-- In the instance has been created successfully, we can persist it
|
||||
if _interface_pools_instance then
|
||||
if not _interface_pools_instance:_persist() then
|
||||
-- Failed to persist the instance, unable to create
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
-- 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue