mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 09:08:20 +00:00
Merging in 'topic/robin/cleanup-rewriter'.
Removing everything related to trace rewriting. (I wasn't too careful in ensuring that I catch everything in the scripts; Seth is working on those anyway.) (Merging by cherry-picking the corresponding commit, as the branch was accidentally made off of the logging stuff).
This commit is contained in:
parent
ec1b2b4d2a
commit
a3a075174b
70 changed files with 20 additions and 5922 deletions
57
src/TCP.cc
57
src/TCP.cc
|
@ -7,7 +7,6 @@
|
|||
#include "File.h"
|
||||
#include "TCP.h"
|
||||
#include "TCP_Reassembler.h"
|
||||
#include "TCP_Rewriter.h"
|
||||
#include "OSFinger.h"
|
||||
#include "Event.h"
|
||||
|
||||
|
@ -47,23 +46,12 @@ TCP_Analyzer::TCP_Analyzer(Connection* conn)
|
|||
finished = 0;
|
||||
reassembling = 0;
|
||||
first_packet_seen = 0;
|
||||
src_pkt_writer = 0;
|
||||
|
||||
orig = new TCP_Endpoint(this, 1);
|
||||
resp = new TCP_Endpoint(this, 0);
|
||||
|
||||
orig->SetPeer(resp);
|
||||
resp->SetPeer(orig);
|
||||
|
||||
if ( BifConst::dump_selected_source_packets )
|
||||
{
|
||||
if ( source_pkt_dump )
|
||||
src_pkt_writer =
|
||||
new TCP_SourcePacketWriter(this, source_pkt_dump);
|
||||
else if ( transformed_pkt_dump )
|
||||
src_pkt_writer =
|
||||
new TCP_SourcePacketWriter(this, transformed_pkt_dump);
|
||||
}
|
||||
}
|
||||
|
||||
TCP_Analyzer::~TCP_Analyzer()
|
||||
|
@ -73,7 +61,6 @@ TCP_Analyzer::~TCP_Analyzer()
|
|||
|
||||
delete orig;
|
||||
delete resp;
|
||||
delete src_pkt_writer;
|
||||
}
|
||||
|
||||
void TCP_Analyzer::Init()
|
||||
|
@ -81,12 +68,6 @@ void TCP_Analyzer::Init()
|
|||
Analyzer::Init();
|
||||
LOOP_OVER_GIVEN_CHILDREN(i, packet_children)
|
||||
(*i)->Init();
|
||||
|
||||
// Can't put this in construction because RewritingTrace() is virtual.
|
||||
if ( transformed_pkt_dump && Conn()->RewritingTrace() )
|
||||
SetTraceRewriter(new TCP_Rewriter(this, transformed_pkt_dump,
|
||||
transformed_pkt_dump_MTU,
|
||||
BifConst::requires_trace_commitment));
|
||||
}
|
||||
|
||||
void TCP_Analyzer::Done()
|
||||
|
@ -1047,16 +1028,6 @@ void TCP_Analyzer::DeliverPacket(int len, const u_char* data, bool is_orig,
|
|||
tcp_hdr_len <= uint32(caplen) )
|
||||
ParseTCPOptions(tp, TCPOptionEvent, this, is_orig, 0);
|
||||
|
||||
if ( TraceRewriter() && current_hdr )
|
||||
{
|
||||
TCP_Rewriter* r = (TCP_Rewriter*) TraceRewriter();
|
||||
r->NextPacket(is_orig, t, current_hdr, current_pkt,
|
||||
current_hdr_size, ip->IP4_Hdr(), tp);
|
||||
}
|
||||
|
||||
if ( src_pkt_writer && current_hdr )
|
||||
src_pkt_writer->NextPacket(current_hdr, current_pkt);
|
||||
|
||||
if ( DEBUG_tcp_data_sent )
|
||||
{
|
||||
DEBUG_MSG("%.6f before DataSent: len=%d caplen=%d skip=%d\n",
|
||||
|
@ -1757,8 +1728,6 @@ void TCP_Analyzer::EndpointEOF(TCP_Reassembler* endp)
|
|||
LOOP_OVER_CONST_CHILDREN(i)
|
||||
static_cast<TCP_ApplicationAnalyzer*>(*i)->EndpointEOF(endp->IsOrig());
|
||||
|
||||
TraceRewriterEOF(endp);
|
||||
|
||||
if ( close_deferred )
|
||||
{
|
||||
if ( DataPending(endp->Endpoint()) )
|
||||
|
@ -1776,25 +1745,6 @@ void TCP_Analyzer::EndpointEOF(TCP_Reassembler* endp)
|
|||
}
|
||||
}
|
||||
|
||||
void TCP_Analyzer::TraceRewriterEOF(TCP_Reassembler* endp)
|
||||
{
|
||||
const analyzer_list& children(GetChildren());
|
||||
LOOP_OVER_CONST_CHILDREN(i)
|
||||
static_cast<TCP_ApplicationAnalyzer*>(*i)->TraceRewriterEOF(endp->IsOrig());
|
||||
|
||||
TCP_Rewriter* r = (TCP_Rewriter*) TraceRewriter();
|
||||
if ( r )
|
||||
{
|
||||
// Add a FIN packet if there is one in the original trace.
|
||||
int FIN_cnt = endp->IsOrig() ?
|
||||
endp->GetTCPAnalyzer()->Orig()->FIN_cnt :
|
||||
endp->GetTCPAnalyzer()->Resp()->FIN_cnt;
|
||||
|
||||
if ( FIN_cnt > 0 )
|
||||
r->ScheduleFIN(endp->IsOrig());
|
||||
}
|
||||
}
|
||||
|
||||
void TCP_Analyzer::PacketWithRST()
|
||||
{
|
||||
const analyzer_list& children(GetChildren());
|
||||
|
@ -1911,13 +1861,6 @@ void TCP_ApplicationAnalyzer::EndpointEOF(bool is_orig)
|
|||
static_cast<TCP_SupportAnalyzer*>(sa)->EndpointEOF(is_orig);
|
||||
}
|
||||
|
||||
void TCP_ApplicationAnalyzer::TraceRewriterEOF(bool is_orig)
|
||||
{
|
||||
SupportAnalyzer* sa = is_orig ? orig_supporters : resp_supporters;
|
||||
for ( ; sa; sa = sa->Sibling() )
|
||||
static_cast<TCP_SupportAnalyzer*>(sa)->TraceRewriterEOF(is_orig);
|
||||
}
|
||||
|
||||
void TCP_ApplicationAnalyzer::ConnectionClosed(TCP_Endpoint* endpoint,
|
||||
TCP_Endpoint* peer, int gen_event)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue