From: Anna Norokh -X (anorokh - SOFTSERVE INC at Cisco) Date: Tue, 20 Aug 2024 11:39:23 +0000 (+0000) Subject: Pull request #4419: latency, dce, stream_ip: fix max pegs incorrectly declared sum X-Git-Tag: 3.3.4.0~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b9b120bc62f285bd2c25438f57faaefa4fbfd40;p=thirdparty%2Fsnort3.git Pull request #4419: latency, dce, stream_ip: fix max pegs incorrectly declared sum Merge in SNORT/snort3 from ~ANOROKH/snort3:max_sum to master Squashed commit of the following: commit 92a7505f2c68f505dda1f23bbbfa7a46793900cc Author: Russ Combs Date: Thu Jul 18 15:23:26 2024 -0400 latency, dce, stream_ip: fix max pegs incorrectly declared sum --- diff --git a/src/hash/lru_cache_local.h b/src/hash/lru_cache_local.h index 4b5853d6c..cf4115c7c 100644 --- a/src/hash/lru_cache_local.h +++ b/src/hash/lru_cache_local.h @@ -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"} diff --git a/src/latency/latency_module.cc b/src/latency/latency_module.cc index 88ee5484f..4441d7555 100644 --- a/src/latency/latency_module.cc +++ b/src/latency/latency_module.cc @@ -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" }, diff --git a/src/service_inspectors/dce_rpc/dce_smb_module.cc b/src/service_inspectors/dce_rpc/dce_smb_module.cc index 0d96db6ec..3080b290d 100644 --- a/src/service_inspectors/dce_rpc/dce_smb_module.cc +++ b/src/service_inspectors/dce_rpc/dce_smb_module.cc @@ -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" }, diff --git a/src/service_inspectors/dce_rpc/dce_tcp_module.cc b/src/service_inspectors/dce_rpc/dce_tcp_module.cc index 1f6ff41cf..4f71dcf17 100644 --- a/src/service_inspectors/dce_rpc/dce_tcp_module.cc +++ b/src/service_inspectors/dce_rpc/dce_tcp_module.cc @@ -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 { diff --git a/src/service_inspectors/dce_rpc/dce_udp_module.cc b/src/service_inspectors/dce_rpc/dce_udp_module.cc index 528fa41ed..c8c13cf72 100644 --- a/src/service_inspectors/dce_rpc/dce_udp_module.cc +++ b/src/service_inspectors/dce_rpc/dce_udp_module.cc @@ -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 diff --git a/src/stream/ip/ip_module.h b/src/stream/ip/ip_module.h index e84349e2c..7efce305c 100644 --- a/src/stream/ip/ip_module.h +++ b/src/stream/ip/ip_module.h @@ -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[]; diff --git a/src/stream/ip/ip_session.cc b/src/stream/ip/ip_session.cc index ada6f4567..4f21db018 100644 --- a/src/stream/ip/ip_session.cc +++ b/src/stream/ip/ip_session.cc @@ -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" },