Reworks TCP issues flow user script

This commit is contained in:
Simone Mainardi 2020-10-30 15:56:36 +01:00
parent 965198e928
commit 389f9c2beb
15 changed files with 273 additions and 127 deletions

View file

@ -8,11 +8,24 @@ local alert_keys = require "alert_keys"
-- @brief Prepare an alert table used to generate the alert
-- @param alert_severity A severity as defined in `alert_consts.alert_severities`
-- @param tcp_stats A lua table with TCP stats obtained with flow.getTCPStats
-- @param cli2srv_pkts Number of packets sent from the client to the server
-- @param srv2cli_pkts Number of packets sent from the server to the client
-- @param is_severe A boolean indicating whether connection issues are severe
-- @param client_issues A boolean indicating if the client has connection issues
-- @param server_issues A boolean indicating if the server has connection issues
-- @return A table with the alert built
local function createConnectionIssues(alert_severity)
local function createConnectionIssues(alert_severity, tcp_stats, cli2srv_pkts, srv2cli_pkts, is_severe, client_issues, server_issues)
local built = {
alert_severity = alert_severity,
alert_type_params = {},
alert_type_params = {
tcp_stats = tcp_stats,
cli2srv_pkts = cli2srv_pkts,
srv2cli_pkts = srv2cli_pkts,
is_severe = is_severe,
client_issues = client_issues,
server_issues = server_issues,
},
}
return built