Improve packet analyzer API.

This commit is contained in:
Jan Grashoefer 2020-08-31 17:13:22 +02:00 committed by Tim Wojtulewicz
parent d5ca0f9da5
commit 90eb97876f
40 changed files with 138 additions and 136 deletions

View file

@ -10,17 +10,17 @@ FDDIAnalyzer::FDDIAnalyzer()
{
}
zeek::packet_analysis::AnalyzerResult FDDIAnalyzer::Analyze(Packet* packet, const uint8_t*& data)
zeek::packet_analysis::AnalyzerResult FDDIAnalyzer::AnalyzePacket(size_t len,
const uint8_t* data, Packet* packet)
{
auto hdr_size = 13 + 8; // FDDI header + LLC
size_t hdr_size = 13 + 8; // FDDI header + LLC
if ( data + hdr_size >= packet->GetEndOfData() )
if ( hdr_size >= len )
{
packet->Weird("FDDI_analyzer_failed");
return AnalyzerResult::Failed;
}
// We just skip the header and hope for default analysis
data += hdr_size;
return AnalyzeInnerPacket(packet, data);
return ForwardPacket(len - hdr_size, data + hdr_size, packet);
}