From: Steven Baigal (sbaigal) Date: Fri, 22 Jul 2022 22:04:02 +0000 (+0000) Subject: Pull request #3528: stream: Removed all instances of 'cap_weight' config parameter X-Git-Tag: 3.1.38.0~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6338b77e8793e3edda3448db83f7edf9d0c52374;p=thirdparty%2Fsnort3.git Pull request #3528: stream: Removed all instances of 'cap_weight' config parameter Merge in SNORT/snort3 from ~JALIIMRA/snort3:cap_weight to master Squashed commit of the following: commit a84b7ca578ed80e247a64ef8fa729623c0a740b9 Author: Juweria Ali Imran Date: Mon Jul 18 16:17:20 2022 -0400 stream: Removed all instances of 'cap_weight' config parameter stream: Removed macro references for 'cap_weight' config parameter --- diff --git a/src/flow/flow_config.h b/src/flow/flow_config.h index bd89ec93a..74fbcd131 100644 --- a/src/flow/flow_config.h +++ b/src/flow/flow_config.h @@ -27,7 +27,6 @@ struct FlowTypeConfig { unsigned nominal_timeout = 0; - unsigned cap_weight = 0; }; struct FlowCacheConfig diff --git a/src/stream/base/stream_module.cc b/src/stream/base/stream_module.cc index fd343616c..3f3675de0 100644 --- a/src/stream/base/stream_module.cc +++ b/src/stream/base/stream_module.cc @@ -52,24 +52,21 @@ static THREAD_LOCAL timeval reload_time { }; // stream module //------------------------------------------------------------------------- -#define FLOW_TYPE_PARAMS(name, idle, weight) \ +#define FLOW_TYPE_PARAMS(name, idle) \ static const Parameter name[] = \ { \ { "idle_timeout", Parameter::PT_INT, "1:max32", idle, \ "maximum inactive time before retiring session tracker" }, \ - \ - { "cap_weight", Parameter::PT_INT, "0:65535", weight, \ - "additional bytes to track per flow for better estimation against cap" }, \ \ { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr } \ } -FLOW_TYPE_PARAMS(ip_params, "180", "0"); -FLOW_TYPE_PARAMS(icmp_params, "180", "0"); -FLOW_TYPE_PARAMS(tcp_params, "3600", "11000"); -FLOW_TYPE_PARAMS(udp_params, "180", "0"); -FLOW_TYPE_PARAMS(user_params,"180", "0"); -FLOW_TYPE_PARAMS(file_params, "180", "32"); +FLOW_TYPE_PARAMS(ip_params, "180"); +FLOW_TYPE_PARAMS(icmp_params, "180"); +FLOW_TYPE_PARAMS(tcp_params, "3600"); +FLOW_TYPE_PARAMS(udp_params, "180"); +FLOW_TYPE_PARAMS(user_params,"180"); +FLOW_TYPE_PARAMS(file_params, "180"); #define FLOW_TYPE_TABLE(flow_type, proto, params) \ { flow_type, Parameter::PT_TABLE, params, nullptr, \ @@ -209,9 +206,6 @@ bool StreamModule::set(const char* fqn, Value& v, SnortConfig* c) if ( v.is("idle_timeout") ) config.flow_cache_cfg.proto[to_utype(type)].nominal_timeout = v.get_uint32(); - else if ( v.is("cap_weight") ) - config.flow_cache_cfg.proto[to_utype(type)].cap_weight = v.get_uint16(); - return true; } @@ -354,7 +348,6 @@ void StreamModuleConfig::show() const { std::string tmp; tmp += "{ idle_timeout = " + std::to_string(flow_cache_cfg.proto[i].nominal_timeout); - tmp += ", cap_weight = " + std::to_string(flow_cache_cfg.proto[i].cap_weight); tmp += " }"; ConfigLogger::log_value(flow_type_names[i], tmp.c_str());