mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Now with PF_RING in case of merged interfaces (e.g. -i virbr0,virbr1,eno1) ntopng keeps
track of the interface where a flow/host has been first observed
This commit is contained in:
parent
cffa017bfe
commit
a5d1c92cdc
20 changed files with 147 additions and 107 deletions
|
|
@ -1,5 +1,5 @@
|
|||
--
|
||||
-- (C) 2014-22 - ntop.org
|
||||
-- (C) 2014-23 - ntop.org
|
||||
--
|
||||
|
||||
local clock_start = os.clock()
|
||||
|
|
@ -491,6 +491,36 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
function printInterfaceIndex(idx)
|
||||
local ifaces
|
||||
local basedir = "/sys/class/net"
|
||||
|
||||
if((idx == nil) or (idx == "")) then return end
|
||||
|
||||
idx = tostring(idx)
|
||||
if(idx == "0") then return end
|
||||
|
||||
ifaces = ntop.readdir(basedir)
|
||||
|
||||
for k,v in pairs(ifaces) do
|
||||
local path = basedir .. "/" .. k.. "/" .. "ifindex"
|
||||
local f = io.open(path, "r")
|
||||
|
||||
if(f ~= nil) then
|
||||
local if_idx = trimString(f:read("*all"))
|
||||
io.close(f)
|
||||
|
||||
if(if_idx == idx) then
|
||||
print("[ <span class=\"fas fa-ethernet\"></span> " .. k .. " ]")
|
||||
return
|
||||
end
|
||||
--tprint(k.." = "..if_idx)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
if(trace_script_duration ~= nil) then
|
||||
io.write(debug.getinfo(1,'S').source .." executed in ".. (os.clock()-clock_start)*1000 .. " ms\n")
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue