mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-05 19:15:03 +00:00
Removed periodic radius cleanup
This commit is contained in:
parent
f763dd3663
commit
75e9e2e3e7
1 changed files with 0 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
--
|
||||
-- (C) 2019-24 - ntop.org
|
||||
--
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/pools/?.lua;" .. package.path
|
||||
|
||||
local radius_handler = require "radius_handler"
|
||||
local host_pools = require "host_pools"
|
||||
|
||||
-- #################################################################
|
||||
|
||||
if radius_handler.isAccountingEnabled() then
|
||||
-- TODO: currently accounting is supported only for an interface
|
||||
-- add the support to multiple interfaces
|
||||
interface.select(tostring(interface.getFirstInterfaceId()))
|
||||
local keys = radius_handler.getAllKeys()
|
||||
local s = host_pools:create()
|
||||
for _, member in pairs(keys) do
|
||||
local mac_info = interface.getMacInfo(member)
|
||||
if not mac_info then
|
||||
-- In case the MAC is not connected, call the stop
|
||||
-- and move the host into the default pool
|
||||
s:bind_member(member, host_pools.DEFAULT_POOL_ID)
|
||||
radius_handler.accountingStop(member, 4 --[[ Idle Timeout ]])
|
||||
end
|
||||
end
|
||||
|
||||
interface.select("-1") -- System Interface
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue