mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Renamed LL-Analyzers to Packet Analyzers.
This commit is contained in:
parent
b2e6c9ac9a
commit
e53ec46c23
148 changed files with 587 additions and 587 deletions
28
src/packet_analysis/protocol/default/Default.cc
Normal file
28
src/packet_analysis/protocol/default/Default.cc
Normal 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 };
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue