mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 09:20:10 +00:00
- Add missing protocol guess - Fix flows filter by L4 protocol - Fix traffic profile filter validation - Fix missing apps in the l7 dropdown - Fix bad unidirectional flow status with ebpf flows - Fix broken flows refresh in username_details.lua
48 lines
1.4 KiB
Lua
48 lines
1.4 KiB
Lua
--
|
|
-- (C) 2019-20 - ntop.org
|
|
--
|
|
|
|
-- Companion scripts (in addition to i18n)
|
|
-- scripts/callbacks/status_defs/status_udp_unidirectional.lua
|
|
-- scripts/callbacks/interface/flow/udp.lua
|
|
|
|
local flow_consts = require("flow_consts")
|
|
local user_scripts = require("user_scripts")
|
|
|
|
-- #################################################################
|
|
|
|
local script = {
|
|
-- Script category
|
|
category = user_scripts.script_categories.network,
|
|
|
|
l4_proto = "udp",
|
|
|
|
-- NOTE: hooks defined below
|
|
hooks = {},
|
|
|
|
gui = {
|
|
i18n_title = "flow_callbacks_config.udp_unidirectional",
|
|
i18n_description = "flow_callbacks_config.udp_unidirectional_description",
|
|
}
|
|
}
|
|
|
|
-- #################################################################
|
|
|
|
function script.hooks.all(now)
|
|
if((flow.getPacketsRcvd() == 0) and (flow.getPacketsSent() > 0)) then
|
|
-- Now check if the recipient isn't a broadcast/multicast address
|
|
if(flow.isServerUnicast()) then
|
|
-- TODO some UDP protocols are inherently unidirectional (e.g. Netflow/sflow)
|
|
-- they should be excluded
|
|
|
|
flow.setStatus(flow_consts.status_types.status_udp_unidirectional,
|
|
5--[[ flow score]], 5--[[ cli score ]], 1--[[ srv score ]])
|
|
end
|
|
else
|
|
flow.clearStatus(flow_consts.status_types.status_udp_unidirectional)
|
|
end
|
|
end
|
|
|
|
-- #################################################################
|
|
|
|
return script
|