mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 17:18:20 +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
|
@ -9,6 +9,7 @@
|
|||
#define PLUGIN_MACROS_H
|
||||
|
||||
#include "analyzer/Component.h"
|
||||
#include "file_analysis/Component.h"
|
||||
|
||||
/**
|
||||
* The current plugin API version. Plugins that won't match this version will
|
||||
|
@ -91,6 +92,19 @@
|
|||
#define BRO_PLUGIN_ANALYZER(tag, cls) \
|
||||
AddComponent(new ::analyzer::Component(tag, ::analyzer::cls::InstantiateAnalyzer));
|
||||
|
||||
/**
|
||||
* Defines a component implementing a file analyzer.
|
||||
*
|
||||
* @param tag A string with the analyzer's tag. This must be unique across
|
||||
* all loaded analyzers and will translate into a corresponding \c ANALYZER_*
|
||||
* constant at the script-layer.
|
||||
*
|
||||
* @param cls The class that implements the analyzer. It must be derived
|
||||
* (directly or indirectly) from file_analysis::Analyzer.
|
||||
*/
|
||||
#define BRO_PLUGIN_FILE_ANALYZER(tag, cls) \
|
||||
AddComponent(new ::file_analysis::Component(tag, ::file_analysis::cls::Instantiate));
|
||||
|
||||
/**
|
||||
* Defines a component implementing a protocol analyzer class that will
|
||||
* not be instantiated dynamically. This is for two use-cases: (1) abstract
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue