mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Extend PIA's FirstPacket
API.
`FirstPacket()` so far supported only TCP. To extend this to UDP, we move the method into the PIA base class; give it a protocol parameter for the case that there's no actual packet is available; and add the ability to create fake UDP packets as well, not just TCP. This whole thing is pretty ugly to begin with, and this doesn't make it nicer, but we need this extension that so we can feed UDP data into the signature engine that's tunneled over other protocols. Without the fake packets, DPD signatures in particular wouldn't have anything to match on.
This commit is contained in:
parent
8dd3debeae
commit
2ec44f098f
6 changed files with 137 additions and 57 deletions
|
@ -946,8 +946,8 @@ void HTTP_Analyzer::DeliverStream(int len, const u_char* data, bool is_orig) {
|
|||
pia = new analyzer::pia::PIA_TCP(Conn());
|
||||
|
||||
if ( AddChildAnalyzer(pia) ) {
|
||||
pia->FirstPacket(true, nullptr);
|
||||
pia->FirstPacket(false, nullptr);
|
||||
pia->FirstPacket(true, TransportProto::TRANSPORT_TCP);
|
||||
pia->FirstPacket(false, TransportProto::TRANSPORT_TCP);
|
||||
|
||||
int remaining_in_content_line = content_line_resp->GetDeliverStreamRemainingLength();
|
||||
if ( remaining_in_content_line > 0 ) {
|
||||
|
@ -1396,8 +1396,8 @@ void HTTP_Analyzer::HTTP_Upgrade() {
|
|||
upgrade_protocol.c_str());
|
||||
pia = new analyzer::pia::PIA_TCP(Conn());
|
||||
if ( AddChildAnalyzer(pia) ) {
|
||||
pia->FirstPacket(true, nullptr);
|
||||
pia->FirstPacket(false, nullptr);
|
||||
pia->FirstPacket(true, TransportProto::TRANSPORT_TCP);
|
||||
pia->FirstPacket(false, TransportProto::TRANSPORT_TCP);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue