mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Store some additional information in the packet during processing
- Session related to the packet - is_orig information if a UDP header was found
This commit is contained in:
parent
5f58ce8a5d
commit
f93c5a6942
5 changed files with 30 additions and 5 deletions
|
@ -121,6 +121,10 @@ void ICMPAnalyzer::DeliverPacket(Connection* c, double t, bool is_orig, int rema
|
|||
return;
|
||||
}
|
||||
|
||||
// Store the session in the packet in case we get an encapsulation here. We need it for
|
||||
// handling those properly.
|
||||
pkt->session = c;
|
||||
|
||||
ForwardPacket(len, data, pkt);
|
||||
|
||||
if ( remaining >= len )
|
||||
|
|
|
@ -68,6 +68,7 @@ bool IPBasedAnalyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet* pkt
|
|||
pkt->processed = true;
|
||||
|
||||
bool is_orig = (tuple.src_addr == conn->OrigAddr()) && (tuple.src_port == conn->OrigPort());
|
||||
pkt->is_orig = is_orig;
|
||||
|
||||
conn->CheckFlowLabel(is_orig, ip_hdr->FlowLabel());
|
||||
|
||||
|
|
|
@ -120,6 +120,10 @@ void TCPAnalyzer::DeliverPacket(Connection* c, double t, bool is_orig, int remai
|
|||
|
||||
adapter->Process(is_orig, tp, len, ip, data, remaining);
|
||||
|
||||
// Store the session in the packet in case we get an encapsulation here. We need it for
|
||||
// handling those properly.
|
||||
pkt->session = c;
|
||||
|
||||
// Send the packet back into the packet analysis framework.
|
||||
ForwardPacket(len, data, pkt);
|
||||
|
||||
|
|
|
@ -211,6 +211,10 @@ void UDPAnalyzer::DeliverPacket(Connection* c, double t, bool is_orig, int remai
|
|||
adapter->Event(udp_reply);
|
||||
}
|
||||
|
||||
// Store the session in the packet in case we get an encapsulation here. We need it for
|
||||
// handling those properly.
|
||||
pkt->session = c;
|
||||
|
||||
// Send the packet back into the packet analysis framework. We only check the response
|
||||
// port here because the orig/resp should have already swapped around based on
|
||||
// likely_server_ports. This also prevents us from processing things twice if protocol
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue