mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +00:00

As opposed to creating weirds for e.g. "binpac::ExceptionOutOfBound". The protocol_violation will also result in the disabling of the analyzer by default.
32 lines
641 B
C++
32 lines
641 B
C++
#include "AYIYA.h"
|
|
|
|
AYIYA_Analyzer::AYIYA_Analyzer(Connection* conn)
|
|
: Analyzer(AnalyzerTag::AYIYA, conn)
|
|
{
|
|
interp = new binpac::AYIYA::AYIYA_Conn(this);
|
|
}
|
|
|
|
AYIYA_Analyzer::~AYIYA_Analyzer()
|
|
{
|
|
delete interp;
|
|
}
|
|
|
|
void AYIYA_Analyzer::Done()
|
|
{
|
|
Analyzer::Done();
|
|
Event(udp_session_done);
|
|
}
|
|
|
|
void AYIYA_Analyzer::DeliverPacket(int len, const u_char* data, bool orig, int seq, const IP_Hdr* ip, int caplen)
|
|
{
|
|
Analyzer::DeliverPacket(len, data, orig, seq, ip, caplen);
|
|
|
|
try
|
|
{
|
|
interp->NewData(orig, data, data + len);
|
|
}
|
|
catch ( const binpac::Exception& e )
|
|
{
|
|
ProtocolViolation(fmt("Binpac exception: %s", e.c_msg()));
|
|
}
|
|
}
|