]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #3528: stream: Removed all instances of 'cap_weight' config parameter
authorSteven Baigal (sbaigal) <sbaigal@cisco.com>
Fri, 22 Jul 2022 22:04:02 +0000 (22:04 +0000)
committerSteven Baigal (sbaigal) <sbaigal@cisco.com>
Fri, 22 Jul 2022 22:04:02 +0000 (22:04 +0000)
Merge in SNORT/snort3 from ~JALIIMRA/snort3:cap_weight to master

Squashed commit of the following:

commit a84b7ca578ed80e247a64ef8fa729623c0a740b9
Author: Juweria Ali Imran <jaliimra@cisco.com>
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

src/flow/flow_config.h
src/stream/base/stream_module.cc

index bd89ec93ad5ce8d1603a0eafa90950b2ed43bc41..74fbcd13199de3105a1635491fa7542ec48a1fe9 100644 (file)
@@ -27,7 +27,6 @@
 struct FlowTypeConfig
 {
     unsigned nominal_timeout = 0;
-    unsigned cap_weight = 0;
 };
 
 struct FlowCacheConfig
index fd343616cda8ff9950856c3690b805bb26bff77c..3f3675de05f75e2d534b8669e9266ba52ecf78dc 100644 (file)
@@ -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());