mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 21:18:20 +00:00
Move file_analysis code to zeek namespaces
This commit is contained in:
parent
8411adf9e1
commit
14408235b8
66 changed files with 554 additions and 410 deletions
|
@ -6,14 +6,13 @@
|
|||
#include "plugin/Plugin.h"
|
||||
#include "file_analysis/Component.h"
|
||||
|
||||
namespace plugin {
|
||||
namespace Zeek_Unified2 {
|
||||
namespace zeek::plugin::detail::Zeek_Unified2 {
|
||||
|
||||
class Plugin : public zeek::plugin::Plugin {
|
||||
public:
|
||||
zeek::plugin::Configuration Configure() override
|
||||
{
|
||||
AddComponent(new ::file_analysis::Component("UNIFIED2", ::file_analysis::Unified2::Instantiate));
|
||||
AddComponent(new zeek::file_analysis::Component("UNIFIED2", zeek::file_analysis::detail::Unified2::Instantiate));
|
||||
|
||||
zeek::plugin::Configuration config;
|
||||
config.name = "Zeek::Unified2";
|
||||
|
@ -22,5 +21,4 @@ public:
|
|||
}
|
||||
} plugin;
|
||||
|
||||
}
|
||||
}
|
||||
} // namespace zeek::plugin::detail::Zeek_Unified2
|
||||
|
|
|
@ -3,10 +3,11 @@
|
|||
#include "Unified2.h"
|
||||
#include "file_analysis/Manager.h"
|
||||
|
||||
using namespace file_analysis;
|
||||
namespace zeek::file_analysis::detail {
|
||||
|
||||
Unified2::Unified2(zeek::RecordValPtr args, File* file)
|
||||
: file_analysis::Analyzer(file_mgr->GetComponentTag("UNIFIED2"), std::move(args), file)
|
||||
Unified2::Unified2(zeek::RecordValPtr args, zeek::file_analysis::File* file)
|
||||
: file_analysis::Analyzer(zeek::file_mgr->GetComponentTag("UNIFIED2"),
|
||||
std::move(args), file)
|
||||
{
|
||||
interp = new binpac::Unified2::Unified2_Analyzer(this);
|
||||
}
|
||||
|
@ -16,7 +17,8 @@ Unified2::~Unified2()
|
|||
delete interp;
|
||||
}
|
||||
|
||||
file_analysis::Analyzer* Unified2::Instantiate(zeek::RecordValPtr args, File* file)
|
||||
zeek::file_analysis::Analyzer* Unified2::Instantiate(zeek::RecordValPtr args,
|
||||
zeek::file_analysis::File* file)
|
||||
{
|
||||
return new Unified2(std::move(args), file);
|
||||
}
|
||||
|
@ -35,3 +37,5 @@ bool Unified2::DeliverStream(const u_char* data, uint64_t len)
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace zeek::file_analysis::detail
|
||||
|
|
|
@ -9,21 +9,22 @@
|
|||
#include "Analyzer.h"
|
||||
#include "unified2_pac.h"
|
||||
|
||||
namespace file_analysis {
|
||||
namespace zeek::file_analysis::detail {
|
||||
|
||||
/**
|
||||
* An analyzer to extract content of files from local disk.
|
||||
*/
|
||||
class Unified2 : public file_analysis::Analyzer {
|
||||
class Unified2 : public zeek::file_analysis::Analyzer {
|
||||
public:
|
||||
~Unified2() override;
|
||||
|
||||
bool DeliverStream(const u_char* data, uint64_t len) override;
|
||||
|
||||
static file_analysis::Analyzer* Instantiate(zeek::RecordValPtr args, File* file);
|
||||
static zeek::file_analysis::Analyzer* Instantiate(zeek::RecordValPtr args,
|
||||
zeek::file_analysis::File* file);
|
||||
|
||||
protected:
|
||||
Unified2(zeek::RecordValPtr args, File* file);
|
||||
Unified2(zeek::RecordValPtr args, zeek::file_analysis::File* file);
|
||||
|
||||
private:
|
||||
binpac::Unified2::Unified2_Analyzer* interp;
|
||||
|
@ -31,4 +32,10 @@ private:
|
|||
string filename;
|
||||
};
|
||||
|
||||
} // namespace zeek::file_analysis::detail
|
||||
|
||||
namespace file_analysis {
|
||||
|
||||
using Unified2 [[deprecated("Remove in v4.1. Use zeek::file_analysis::detail::Unified2.")]] = zeek::file_analysis::detail::Unified2;
|
||||
|
||||
} // namespace file_analysis
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue