mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 21:18:20 +00:00
Move TCPStateStats object out of session_mgr
This commit is contained in:
parent
9e1f6f95aa
commit
4114bbebf0
13 changed files with 199 additions and 186 deletions
31
src/Conn.cc
31
src/Conn.cc
|
@ -20,6 +20,7 @@
|
|||
#include "zeek/analyzer/Manager.h"
|
||||
#include "zeek/iosource/IOSource.h"
|
||||
#include "zeek/packet_analysis/protocol/ip/SessionAdapter.h"
|
||||
#include "zeek/packet_analysis/protocol/tcp/TCP.h"
|
||||
|
||||
namespace zeek {
|
||||
|
||||
|
@ -125,23 +126,23 @@ void Connection::CheckEncapsulation(const std::shared_ptr<EncapsulationStack>& a
|
|||
|
||||
void Connection::Done()
|
||||
{
|
||||
// TODO: this still doesn't feel like the right place to do this, but it's better
|
||||
// here than in SessionManager. This really should be down in the TCP analyzer
|
||||
// somewhere, but it's session-related, so maybe not?
|
||||
if ( ConnTransport() == TRANSPORT_TCP )
|
||||
{
|
||||
auto* ta = static_cast<packet_analysis::TCP::TCPSessionAdapter*>(adapter);
|
||||
assert(ta->IsAnalyzer("TCP"));
|
||||
analyzer::tcp::TCP_Endpoint* to = ta->Orig();
|
||||
analyzer::tcp::TCP_Endpoint* tr = ta->Resp();
|
||||
|
||||
session_mgr->tcp_stats.StateLeft(to->state, tr->state);
|
||||
}
|
||||
|
||||
finished = 1;
|
||||
|
||||
if ( adapter && ! adapter->IsFinished() )
|
||||
adapter->Done();
|
||||
if ( adapter )
|
||||
{
|
||||
if ( ConnTransport() == TRANSPORT_TCP )
|
||||
{
|
||||
auto* ta = static_cast<packet_analysis::TCP::TCPSessionAdapter*>(adapter);
|
||||
assert(ta->IsAnalyzer("TCP"));
|
||||
analyzer::tcp::TCP_Endpoint* to = ta->Orig();
|
||||
analyzer::tcp::TCP_Endpoint* tr = ta->Resp();
|
||||
|
||||
packet_analysis::TCP::TCPAnalyzer::GetStats().StateLeft(to->state, tr->state);
|
||||
}
|
||||
|
||||
if ( ! adapter->IsFinished() )
|
||||
adapter->Done();
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::NextPacket(double t, bool is_orig,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue