Implements TCP states filtering (est., connecting, closed and rst)

Implements #2385
This commit is contained in:
Simone Mainardi 2019-02-16 18:19:25 +01:00
parent ae23ebcd1c
commit 9a413a5d72
9 changed files with 52 additions and 65 deletions

View file

@ -8,14 +8,10 @@ package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
local tcp_flow_state_utils = {}
function tcp_flow_state_utils.state2i18n(state)
local states = {syn_only = i18n("flows_page.tcp_state_syn_only"),
rst = i18n("flows_page.tcp_state_rst"),
fin = i18n("flows_page.tcp_state_fin"),
syn_rst_only = i18n("flows_page.tcp_state_syn_rst_only"),
fin_rst = i18n("flows_page.tcp_state_fin_rst"),
established_only = i18n("flows_page.tcp_state_established_only"),
not_established_only = i18n("flows_page.tcp_state_not_established_only")
}
local states = {established = i18n("flows_page.tcp_state_established"),
connecting = i18n("flows_page.tcp_state_connecting"),
closed = i18n("flows_page.tcp_state_closed"),
reset = i18n("flows_page.tcp_state_reset")}
return states[state or ''] or i18n("flows_page.tcp_state_unknown")
end