mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 09:08:20 +00:00
38 lines
798 B
C++
38 lines
798 B
C++
// See the file "COPYING" in the main distribution directory for copyright.
|
|
|
|
#include "Unified2.h"
|
|
#include "file_analysis/Manager.h"
|
|
|
|
using namespace file_analysis;
|
|
|
|
Unified2::Unified2(RecordValPtr args, File* file)
|
|
: file_analysis::Analyzer(file_mgr->GetComponentTag("UNIFIED2"), std::move(args), file)
|
|
{
|
|
interp = new binpac::Unified2::Unified2_Analyzer(this);
|
|
}
|
|
|
|
Unified2::~Unified2()
|
|
{
|
|
delete interp;
|
|
}
|
|
|
|
file_analysis::Analyzer* Unified2::Instantiate(RecordValPtr args, File* file)
|
|
{
|
|
return new Unified2(std::move(args), file);
|
|
}
|
|
|
|
bool Unified2::DeliverStream(const u_char* data, uint64_t len)
|
|
{
|
|
try
|
|
{
|
|
interp->NewData(true, data, data + len);
|
|
}
|
|
|
|
catch ( const binpac::Exception& e )
|
|
{
|
|
printf("Binpac exception: %s\n", e.c_msg());
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|