mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Use macros to create file analyzer plugin classes.
This commit is contained in:
parent
89ae4ffd05
commit
814d827c44
5 changed files with 37 additions and 107 deletions
|
@ -1,31 +1,10 @@
|
|||
#include "plugin/Plugin.h"
|
||||
#include "file_analysis/Component.h"
|
||||
|
||||
#include "Extract.h"
|
||||
|
||||
namespace plugin { namespace Bro_FileExtract {
|
||||
|
||||
class Plugin : public plugin::Plugin {
|
||||
protected:
|
||||
void InitPreScript()
|
||||
{
|
||||
SetName("Bro::FileExtract");
|
||||
SetVersion(-1);
|
||||
SetAPIVersion(BRO_PLUGIN_API_VERSION);
|
||||
SetDynamicPlugin(false);
|
||||
|
||||
SetDescription("Extract file content to local file system");
|
||||
|
||||
AddComponent(new ::file_analysis::Component("EXTRACT",
|
||||
::file_analysis::Extract::Instantiate));
|
||||
|
||||
extern std::list<std::pair<const char*, int> > __bif_events_init();
|
||||
AddBifInitFunction(&__bif_events_init);
|
||||
extern std::list<std::pair<const char*, int> > __bif_functions_init();
|
||||
AddBifInitFunction(&__bif_functions_init);
|
||||
}
|
||||
};
|
||||
|
||||
Plugin __plugin;
|
||||
|
||||
} }
|
||||
BRO_PLUGIN_BEGIN(Bro, FileExtract)
|
||||
BRO_PLUGIN_DESCRIPTION("Extract file content to local file system");
|
||||
BRO_PLUGIN_FILE_ANALYZER("EXTRACT", Extract);
|
||||
BRO_PLUGIN_BIF_FILE(events);
|
||||
BRO_PLUGIN_BIF_FILE(functions);
|
||||
BRO_PLUGIN_END
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue