-- -- (C) 2013-21 - ntop.org -- local dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path local if_stats = interface.getStats() if (if_stats.has_seen_pods or if_stats.has_seen_containers) then -- Use a different flows page dofile(dirs.installdir .. "/scripts/lua/inc/ebpf_flows_stats.lua") return end require "lua_utils" local graph_utils = require "graph_utils" require "flow_utils" local page_utils = require("page_utils") local tcp_flow_state_utils = require("tcp_flow_state_utils") local have_nedge = ntop.isnEdge() sendHTTPContentTypeHeader('text/html') page_utils.set_active_menu_entry(ternary(have_nedge, page_utils.menu_entries.nedge_flows, page_utils.menu_entries.flows)) dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") -- nDPI application and category local application = _GET["application"] local category = _GET["category"] local hosts = _GET["hosts"] local host = _GET["host"] local vhost = _GET["vhost"] local flowhosts_type = _GET["flowhosts_type"] local ipversion = _GET["version"] local l4proto = _GET["l4proto"] local vlan = _GET["vlan"] local port = _GET["port"] local icmp_type = _GET["icmp_type"] local icmp_code = _GET["icmp_cod"] local dscp_filter = _GET["dscp"] local host_pool = _GET["host_pool_id"] local traffic_profile = _GET["traffic_profile"] -- remote exporters address and interfaces local deviceIP = _GET["deviceIP"] local inIfIdx = _GET["inIfIdx"] local outIfIdx = _GET["outIfIdx"] local traffic_type = _GET["traffic_type"] local alert_type = _GET["alert_type"] local alert_type_severity = _GET["alert_type_severity"] local tcp_state = _GET["tcp_flow_state"] local port = _GET["port"] local network_id = _GET["network"] local client_asn = _GET["client_asn"] local server_asn = _GET["server_asn"] local prefs = ntop.getPrefs() local ifstats = interface.getStats() local flows_filter = getFlowsFilter() flows_filter.statusFilter = nil -- remove the filter, otherwise no menu entries will be shown local flowstats = interface.getActiveFlowsStats(host, flows_filter) local base_url = ntop.getHttpPrefix() .. "/lua/flows_stats.lua" local page_params = {} if (page == "flows" or page == nil) then local active_msg = getFlowsTableTitle() page_utils.print_page_title(active_msg) if(category ~= nil) then page_params["category"] = category end if(application ~= nil) then page_params["application"] = application end if(host ~= nil) then page_params["host"] = host end if(port ~= nil) then page_params["port"] = port end if(vhost ~= nil) then page_params["vhost"] = vhost end if(hosts ~= nil) then page_params["hosts"] = hosts end if(port ~= nil) then page_params["port"] = port end if(ipversion ~= nil) then page_params["version"] = ipversion end if(l4proto ~= nil) then page_params["l4proto"] = l4proto end if(deviceIP ~= nil) then page_params["deviceIP"] = deviceIP end if(inIfIdx ~= nil) then page_params["inIfIdx"] = inIfIdx end if(outIfIdx ~= nil) then page_params["outIfIdx"] = outIfIdx end if(vlan ~= nil) then page_params["vlan"] = vlan end if(traffic_type ~= nil) then page_params["traffic_type"] = traffic_type end if(alert_type ~= nil) then page_params["alert_type"] = alert_type end if(alert_type_severity ~= nil) then page_params["alert_type_severity"] = alert_type_severity end if(tcp_state ~= nil) then page_params["tcp_flow_state"] = tcp_state end if(network_id ~= nil) then page_params["network"] = network_id end if(flowhosts_type ~= nil) then page_params["flowhosts_type"] = flowhosts_type end if((icmp_type ~= nil) and (icmp_code ~= nil)) then page_params["icmp_type"] = icmp_type page_params["icmp_cod"] = icmp_code end if(dscp_filter ~= nil) then page_params["dscp"] = dscp_filter end if(host_pool ~= nil) then page_params["host_pool_id"] = host_pool end if(traffic_profile ~= nil) then page_params["traffic_profile"] = traffic_profile end if table.len(page_params) > 0 then print [[
]] end print [[ ]] if table.len(page_params) > 0 then print([[ ]]) end dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")