mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-01 00:19:33 +00:00
Allows only companion interfaces with mirrored traffic
This commit is contained in:
parent
6df47febf8
commit
83be04337e
3 changed files with 9 additions and 7 deletions
|
|
@ -5,7 +5,8 @@
|
|||
local dirs = ntop.getDirs()
|
||||
require "lua_utils"
|
||||
|
||||
local companion_interface_key = "ntopng.prefs.companion_interface.ifid_%d.companion"
|
||||
local companion_interface_prefix = "ntopng.prefs.companion_interface."
|
||||
local companion_interface_key = string.format("%s%s", companion_interface_prefix, "ifid_%d.companion")
|
||||
|
||||
local companion_interface_utils = {}
|
||||
|
||||
|
|
@ -55,7 +56,10 @@ function companion_interface_utils.getAvailableCompanions()
|
|||
|
||||
local res = { {ifid = "", ifname = "None"} }
|
||||
for ifid, ifname in pairs(ifaces) do
|
||||
if cur_ifid ~= tonumber(ifid) then
|
||||
local is_mirrored_traffic_pref = string.format("ntopng.prefs.ifid_%d.is_traffic_mirrored", ifid)
|
||||
local is_mirrored_traffic = ntop.getPref(is_mirrored_traffic_pref)
|
||||
|
||||
if cur_ifid ~= tonumber(ifid) and is_mirrored_traffic == "1" then
|
||||
res[#res + 1] = {ifid = ifid, ifname = ifname}
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue