Migrate all packet analyzers to new API.

This commit is contained in:
Jan Grashoefer 2020-08-24 17:34:42 +02:00 committed by Tim Wojtulewicz
parent cbdaa53f85
commit 6365fa6d80
34 changed files with 135 additions and 105 deletions

View file

@ -10,12 +10,12 @@ VLANAnalyzer::VLANAnalyzer()
{
}
zeek::packet_analysis::AnalysisResultTuple VLANAnalyzer::Analyze(Packet* packet, const uint8_t*& data)
zeek::packet_analysis::AnalyzerResult VLANAnalyzer::Analyze(Packet* packet, const uint8_t*& data)
{
if ( data + 4 >= packet->GetEndOfData() )
{
packet->Weird("truncated_VLAN_header");
return { AnalyzerResult::Failed, 0 };
return AnalyzerResult::Failed;
}
auto& vlan_ref = packet->vlan != 0 ? packet->inner_vlan : packet->vlan;
@ -25,5 +25,5 @@ zeek::packet_analysis::AnalysisResultTuple VLANAnalyzer::Analyze(Packet* packet,
packet->eth_type = protocol;
data += 4; // Skip the VLAN header
return { AnalyzerResult::Continue, protocol };
return AnalyzeInnerPacket(packet, data, protocol);
}