Renamed LL-Analyzers to Packet Analyzers.

This commit is contained in:
Jan Grashoefer 2020-07-13 16:44:39 +02:00 committed by Tim Wojtulewicz
parent b2e6c9ac9a
commit e53ec46c23
148 changed files with 587 additions and 587 deletions

View file

@ -0,0 +1,28 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "Default.h"
#include "NetVar.h"
using namespace zeek::packet_analysis::Default;
DefaultAnalyzer::DefaultAnalyzer()
: zeek::packet_analysis::Analyzer("DefaultAnalyzer")
{
}
std::tuple<zeek::packet_analysis::AnalyzerResult, zeek::packet_analysis::identifier_t> DefaultAnalyzer::Analyze(Packet* packet)
{
auto& pdata = packet->cur_pos;
// Assume we're pointing at IP. Just figure out which version.
if ( pdata + sizeof(struct ip) >= packet->GetEndOfData() )
{
packet->Weird("default_ll_analyser_failed");
return { AnalyzerResult::Failed, 0 };
}
auto ip = (const struct ip *)pdata;
identifier_t protocol = ip->ip_v;
return { AnalyzerResult::Continue, protocol };
}