Merge in SNORT/snort3 from ~YVELYKOZ/snort3:sse_config_upd to master
Squashed commit of the following:
commit
d23f48662ab0de026d4d84a482d4d9641ccee981
Author: Yehor Velykozhon <yvelykoz@cisco.com>
Date: Fri Oct 7 13:17:03 2022 +0300
detection: add config option for SSE
#include "ips_options/extract.h"
#include "latency/rule_latency.h"
#include "latency/rule_latency_state.h"
+#include "main/snort_config.h"
#include "main/thread_config.h"
#include "protocols/packet.h"
#include "trace/trace_api.h"
inline void eval(snort::Packet&);
private:
- Continuation(int max = 1024) : states_cnt(0), states_cnt_max(max),
+ Continuation(unsigned max_cnt) : states_cnt(0), states_cnt_max(max_cnt),
reload_id(snort::SnortConfig::get_thread_reload_id())
{ }
if (!cont)
{
- cont = data.p->flow->ips_cont = new Continuation();
+ auto max_cnt = snort::SnortConfig::get_conf()->max_continuations;
+
+ if (!max_cnt)
+ return;
+
+ cont = data.p->flow->ips_cont = new Continuation(max_cnt);
snort::pc.cont_flows++;
}
"enable strict deduplication of rule headers by ports (saves memory, but "
"loses some speed during config reading)" },
+ { "max_continuations_per_flow", Parameter::PT_INT, "0:65535", "1024",
+ "maximum number of continuations stored simultaneously on the flow" },
+
{ nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
};
/* *INDENT-ON* */
else if ( v.is("enable_strict_reduction") )
sc->enable_strict_reduction = v.get_bool();
+ else if ( v.is("max_continuations_per_flow") )
+ sc->max_continuations = v.get_uint16();
+
return true;
}
bool global_default_rule_state = true;
bool allow_missing_so_rules = false;
bool enable_strict_reduction = false;
+ uint16_t max_continuations = 1024;
//------------------------------------------------------
// process stuff