Implements two-way traffic filter for hosts

This commit is contained in:
Simone Mainardi 2019-10-16 11:01:22 +02:00
parent 7a14a9cf11
commit 5e60fb19c9
7 changed files with 26 additions and 10 deletions

View file

@ -101,9 +101,14 @@ else
end
local custom_column_key, custom_column_format
local one_way_traffic
local traffic_type_filter
if traffic_type == "one_way" then
traffic_type_filter = 1 -- ntop_typedefs.h TrafficType traffic_type_one_way
elseif traffic_type == "bidirectional" then
traffic_type_filter = 2 -- ntop_typedefs.h TrafficType traffic_type_bidirectional
end
if(traffic_type == "one_way") then one_way_traffic = true end
if(tracked ~= nil) then tracked = tonumber(tracked) else tracked = 0 end
if((mode == nil) or (mode == "")) then mode = "all" end
@ -138,7 +143,7 @@ local hosts_stats = hosts_retrv_function(false, sortColumn, perPage, to_skip, sO
country, os_, tonumber(vlan), tonumber(asn),
tonumber(network), mac,
tonumber(pool), tonumber(ipversion),
tonumber(protocol), one_way_traffic,
tonumber(protocol), traffic_type_filter,
filtered_hosts, blacklisted_hosts, top_hidden, anomalous, dhcp_hosts, cidr)
if(hosts_stats == nil) then total = 0 else total = hosts_stats["numHosts"] end