mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
parent
a7d7d6e2ed
commit
8abdb926cd
7 changed files with 66 additions and 20 deletions
|
|
@ -13,14 +13,19 @@ local callback_utils = {}
|
|||
|
||||
-- Iterates available interfaces, excluding PCAP interfaces.
|
||||
-- Each valid interface is select-ed and passed to the callback.
|
||||
-- NOTE: get_direction_stats should only be used by second.lua
|
||||
function callback_utils.foreachInterface(ifnames, condition, callback, get_direction_stats)
|
||||
-- NOTE: direction must only be used by second.lua
|
||||
function callback_utils.foreachInterface(ifnames, condition, callback, update_direction_stats)
|
||||
for _,_ifname in pairs(ifnames) do
|
||||
if(ntop.isShutdown()) then return true end
|
||||
|
||||
-- NOTE: "eth" will be overwritten here for emulated directions
|
||||
interface.select(_ifname)
|
||||
local ifstats = interface.getStats(get_direction_stats)
|
||||
|
||||
if update_direction_stats then
|
||||
interface.updateDirectionStats()
|
||||
end
|
||||
|
||||
local ifstats = interface.getStats()
|
||||
|
||||
if condition == nil or condition(ifstats.id) then
|
||||
if((ifstats.type ~= "pcap dump") and (ifstats.type ~= "unknown")) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue