]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4419: latency, dce, stream_ip: fix max pegs incorrectly declared sum
authorAnna Norokh -X (anorokh - SOFTSERVE INC at Cisco) <anorokh@cisco.com>
Tue, 20 Aug 2024 11:39:23 +0000 (11:39 +0000)
committerOleksii Shumeiko -X (oshumeik - SOFTSERVE INC at Cisco) <oshumeik@cisco.com>
Tue, 20 Aug 2024 11:39:23 +0000 (11:39 +0000)
Merge in SNORT/snort3 from ~ANOROKH/snort3:max_sum to master

Squashed commit of the following:

commit 92a7505f2c68f505dda1f23bbbfa7a46793900cc
Author: Russ Combs <rucombs@cisco.com>
Date:   Thu Jul 18 15:23:26 2024 -0400

    latency, dce, stream_ip: fix max pegs incorrectly declared sum

src/hash/lru_cache_local.h
src/latency/latency_module.cc
src/service_inspectors/dce_rpc/dce_smb_module.cc
src/service_inspectors/dce_rpc/dce_tcp_module.cc
src/service_inspectors/dce_rpc/dce_udp_module.cc
src/stream/ip/ip_module.h
src/stream/ip/ip_session.cc

index 4b5853d6c9a8f619ae51bfb553efe3744d7c4d11..cf4115c7c0fb57dfb55edec1f336cfb40f2c9675 100644 (file)
@@ -34,7 +34,7 @@
     { CountType::SUM, "cache_hits", module " cache found existing entry" }, \
     { CountType::SUM, "cache_misses", module " cache did not find entry" }, \
     { CountType::SUM, "cache_replaces", module " cache found entry and replaced its value" }, \
-    { CountType::SUM, "cache_max", module " cache's maximum byte usage"}, \
+    { CountType::MAX, "cache_max", module " cache's maximum byte usage"}, \
     { CountType::SUM, "cache_prunes", module " cache pruned entry to make space for new entry" }, \
     { CountType::SUM, "cache_removes", module " cache removed existing entry"}
 
index 88ee5484f99f13981c97b3686e39b244a08cb00e..4441d7555fd2c1f5cb4d2ba904cb40ee02720bac 100644 (file)
@@ -111,7 +111,7 @@ static const PegInfo latency_pegs[] =
 {
     { CountType::SUM, "total_packets", "total packets monitored" },
     { CountType::SUM, "total_usecs", "total usecs elapsed" },
-    { CountType::SUM, "max_usecs", "maximum usecs elapsed" },
+    { CountType::MAX, "max_usecs", "maximum usecs elapsed" },
     { CountType::SUM, "packet_timeouts", "packets that timed out" },
     { CountType::SUM, "total_rule_evals", "total rule evals monitored" },
     { CountType::SUM, "rule_eval_timeouts", "rule evals that timed out" },
index 0d96db6ec10454264ae9f1992d3d4761e71e9566..3080b290d6911e8197826603800b90faf0767def 100644 (file)
@@ -44,8 +44,7 @@ static const PegInfo dce2_smb_pegs[] =
     { CountType::SUM, "binds", "total connection-oriented binds" },
     { CountType::SUM, "bind_acks", "total connection-oriented binds acks" },
     { CountType::SUM, "alter_contexts", "total connection-oriented alter contexts" },
-    { CountType::SUM, "alter_context_responses",
-      "total connection-oriented alter context responses" },
+    { CountType::SUM, "alter_context_responses", "total connection-oriented alter context responses" },
     { CountType::SUM, "bind_naks", "total connection-oriented bind naks" },
     { CountType::SUM, "requests", "total connection-oriented requests" },
     { CountType::SUM, "responses", "total connection-oriented responses" },
@@ -55,28 +54,19 @@ static const PegInfo dce2_smb_pegs[] =
     { CountType::SUM, "auth3s", "total connection-oriented auth3s" },
     { CountType::SUM, "shutdowns", "total connection-oriented shutdowns" },
     { CountType::SUM, "rejects", "total connection-oriented rejects" },
-    { CountType::SUM, "ms_rpc_http_pdus",
-      "total connection-oriented MS requests to send RPC over HTTP" },
+    { CountType::SUM, "ms_rpc_http_pdus", "total connection-oriented MS requests to send RPC over HTTP" },
     { CountType::SUM, "other_requests", "total connection-oriented other requests" },
     { CountType::SUM, "other_responses", "total connection-oriented other responses" },
     { CountType::SUM, "request_fragments", "total connection-oriented request fragments" },
     { CountType::SUM, "response_fragments", "total connection-oriented response fragments" },
-    { CountType::SUM, "client_max_fragment_size",
-      "connection-oriented client maximum fragment size" },
-    { CountType::SUM, "client_min_fragment_size",
-      "connection-oriented client minimum fragment size" },
-    { CountType::SUM, "client_segs_reassembled",
-      "total connection-oriented client segments reassembled" },
-    { CountType::SUM, "client_frags_reassembled",
-      "total connection-oriented client fragments reassembled" },
-    { CountType::SUM, "server_max_fragment_size",
-      "connection-oriented server maximum fragment size" },
-    { CountType::SUM, "server_min_fragment_size",
-      "connection-oriented server minimum fragment size" },
-    { CountType::SUM, "server_segs_reassembled",
-      "total connection-oriented server segments reassembled" },
-    { CountType::SUM, "server_frags_reassembled",
-      "total connection-oriented server fragments reassembled" },
+    { CountType::MAX, "client_max_fragment_size", "connection-oriented client maximum fragment size" },
+    { CountType::SUM, "client_min_fragment_size", "connection-oriented client minimum fragment size" },
+    { CountType::SUM, "client_segs_reassembled", "total connection-oriented client segments reassembled" },
+    { CountType::SUM, "client_frags_reassembled", "total connection-oriented client fragments reassembled" },
+    { CountType::MAX, "server_max_fragment_size", "connection-oriented server maximum fragment size" },
+    { CountType::SUM, "server_min_fragment_size", "connection-oriented server minimum fragment size" },
+    { CountType::SUM, "server_segs_reassembled", "total connection-oriented server segments reassembled" },
+    { CountType::SUM, "server_frags_reassembled", "total connection-oriented server fragments reassembled" },
     { CountType::SUM, "sessions", "total smb sessions" },
     { CountType::SUM, "packets", "total smb packets" },
     { CountType::SUM, "ignored_bytes", "total ignored bytes" },
index 1f6ff41cf5f04f89ba570cd4b6418b864590bc94..4f71dcf1755a5dd0eb9f600aac91c43cebfd91b8 100644 (file)
@@ -78,8 +78,7 @@ static const PegInfo dce2_tcp_pegs[] =
     { CountType::SUM, "binds", "total connection-oriented binds" },
     { CountType::SUM, "bind_acks", "total connection-oriented binds acks" },
     { CountType::SUM, "alter_contexts", "total connection-oriented alter contexts" },
-    { CountType::SUM, "alter_context_responses",
-      "total connection-oriented alter context responses" },
+    { CountType::SUM, "alter_context_responses", "total connection-oriented alter context responses" },
     { CountType::SUM, "bind_naks", "total connection-oriented bind naks" },
     { CountType::SUM, "requests", "total connection-oriented requests" },
     { CountType::SUM, "responses", "total connection-oriented responses" },
@@ -89,28 +88,19 @@ static const PegInfo dce2_tcp_pegs[] =
     { CountType::SUM, "auth3s", "total connection-oriented auth3s" },
     { CountType::SUM, "shutdowns", "total connection-oriented shutdowns" },
     { CountType::SUM, "rejects", "total connection-oriented rejects" },
-    { CountType::SUM, "ms_rpc_http_pdus",
-      "total connection-oriented MS requests to send RPC over HTTP" },
+    { CountType::SUM, "ms_rpc_http_pdus", "total connection-oriented MS requests to send RPC over HTTP" },
     { CountType::SUM, "other_requests", "total connection-oriented other requests" },
     { CountType::SUM, "other_responses", "total connection-oriented other responses" },
     { CountType::SUM, "request_fragments", "total connection-oriented request fragments" },
     { CountType::SUM, "response_fragments", "total connection-oriented response fragments" },
-    { CountType::SUM, "client_max_fragment_size",
-      "connection-oriented client maximum fragment size" },
-    { CountType::SUM, "client_min_fragment_size",
-      "connection-oriented client minimum fragment size" },
-    { CountType::SUM, "client_segs_reassembled",
-      "total connection-oriented client segments reassembled" },
-    { CountType::SUM, "client_frags_reassembled",
-      "total connection-oriented client fragments reassembled" },
-    { CountType::SUM, "server_max_fragment_size",
-      "connection-oriented server maximum fragment size" },
-    { CountType::SUM, "server_min_fragment_size",
-      "connection-oriented server minimum fragment size" },
-    { CountType::SUM, "server_segs_reassembled",
-      "total connection-oriented server segments reassembled" },
-    { CountType::SUM, "server_frags_reassembled",
-      "total connection-oriented server fragments reassembled" },
+    { CountType::MAX, "client_max_fragment_size", "connection-oriented client maximum fragment size" },
+    { CountType::SUM, "client_min_fragment_size", "connection-oriented client minimum fragment size" },
+    { CountType::SUM, "client_segs_reassembled", "total connection-oriented client segments reassembled" },
+    { CountType::SUM, "client_frags_reassembled", "total connection-oriented client fragments reassembled" },
+    { CountType::MAX, "server_max_fragment_size", "connection-oriented server maximum fragment size" },
+    { CountType::SUM, "server_min_fragment_size", "connection-oriented server minimum fragment size" },
+    { CountType::SUM, "server_segs_reassembled", "total connection-oriented server segments reassembled" },
+    { CountType::SUM, "server_frags_reassembled", "total connection-oriented server fragments reassembled" },
     { CountType::SUM, "tcp_sessions", "total tcp sessions" },
     { CountType::SUM, "tcp_expected_sessions", "total tcp dynamic endpoint expected sessions" },
     { CountType::SUM, "tcp_expected_realized", "total tcp dynamic endpoint expected realized sessions" },
@@ -120,9 +110,8 @@ static const PegInfo dce2_tcp_pegs[] =
     { CountType::END, nullptr, nullptr }
 };
 
-Dce2TcpModule::Dce2TcpModule() :   Module(DCE2_TCP_NAME, DCE2_TCP_HELP, s_params)
-{
-}
+Dce2TcpModule::Dce2TcpModule() : Module(DCE2_TCP_NAME, DCE2_TCP_HELP, s_params)
+{ }
 
 const RuleMap* Dce2TcpModule::get_rules() const
 {
index 528fa41ed618eb9ba3675cdb0f086f907fd3691f..c8c13cf72313a28d39cfd71937593e6a98be87c6 100644 (file)
@@ -77,7 +77,7 @@ static const PegInfo dce2_udp_pegs[] =
     { CountType::SUM, "other_requests", "total connection-less other requests" },
     { CountType::SUM, "other_responses", "total connection-less other responses" },
     { CountType::SUM, "fragments", "total connection-less fragments" },
-    { CountType::SUM, "max_fragment_size", "connection-less maximum fragment size" },
+    { CountType::MAX, "max_fragment_size", "connection-less maximum fragment size" },
     { CountType::SUM, "frags_reassembled", "total connection-less fragments reassembled" },
     { CountType::SUM, "max_seqnum", "max connection-less seqnum" },
     { CountType::NOW, "concurrent_sessions", "total concurrent sessions" },
@@ -85,7 +85,7 @@ static const PegInfo dce2_udp_pegs[] =
     { CountType::END, nullptr, nullptr }
 };
 
-Dce2UdpModule::Dce2UdpModule() :   Module(DCE2_UDP_NAME, DCE2_UDP_HELP, s_params), config {}
+Dce2UdpModule::Dce2UdpModule() : Module(DCE2_UDP_NAME, DCE2_UDP_HELP, s_params), config {}
 { }
 
 void Dce2UdpModule::set_trace(const Trace* trace) const
index e84349e2ca6a1444cef65d0c2ab519d3aa2aa6ad..7efce305cc7eafdc148d59e3695412db331f7ec7 100644 (file)
@@ -62,25 +62,25 @@ extern THREAD_LOCAL const snort::Trace* stream_ip_trace;
 struct IpStats
 {
     SESSION_STATS;
-    PegCount total_bytes;        // total_ip_bytes_processed
-    PegCount total;             // total_ipfragmented_packets
-    PegCount current_frags;     // iCurrentFrags
-    PegCount max_frags;         // iMaxFrags
-    PegCount reassembles;       // total_ipreassembled_packets / iFragFlushes
+    PegCount total_bytes;
+    PegCount total;
+    PegCount current_frags;
+    PegCount max_frags;
+    PegCount reassembles;
     PegCount discards;
-    PegCount frag_timeouts;     // iFragTimeouts
+    PegCount frag_timeouts;
     PegCount overlaps;
     PegCount anomalies;
     PegCount alerts;
     PegCount drops;
-    PegCount trackers_created;  // iFragCreates
+    PegCount trackers_created;
     PegCount trackers_released;
-    PegCount trackers_cleared;  // iFragDeletes - delete meant dump the frag list
-    PegCount trackers_completed;// iFragComplete
-    PegCount nodes_created;     // iFragInserts tracked a similar stat (# calls to insert)
+    PegCount trackers_cleared;
+    PegCount trackers_completed;
+    PegCount nodes_created;
     PegCount nodes_released;
-    PegCount reassembled_bytes; // total_ipreassembled_bytes
-    PegCount fragmented_bytes;  // total_ipfragmented_bytes
+    PegCount reassembled_bytes;
+    PegCount fragmented_bytes;
 };
 
 extern const PegInfo ip_pegs[];
index ada6f4567377ff9e98040caafde2cb39e657c059..4f21db018bc3b8cb83ef1d1f8fe862f784a8f985 100644 (file)
@@ -45,7 +45,7 @@ const PegInfo ip_pegs[] =
     { CountType::SUM, "total_bytes", "total number of bytes processed" },
     { CountType::SUM, "total_frags", "total fragments" },
     { CountType::NOW, "current_frags", "current fragments" },
-    { CountType::SUM, "max_frags", "max fragments" },
+    { CountType::MAX, "max_frags", "max fragments" },
     { CountType::SUM, "reassembled", "reassembled datagrams" },
     { CountType::SUM, "discards", "fragments discarded" },
     { CountType::SUM, "frag_timeouts", "datagrams abandoned" },