mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +00:00
Introduce support for a table of key/value pairs with further configuration options,
with the same userinterface as in the logging interface. Not really tested, but tests still work.
This commit is contained in:
parent
227159fd04
commit
f820ee9f5c
19 changed files with 173 additions and 26 deletions
|
@ -12,13 +12,13 @@ class InitMessage : public threading::InputMessage<ReaderBackend>
|
|||
{
|
||||
public:
|
||||
InitMessage(ReaderBackend* backend, const string source, ReaderMode mode,
|
||||
const int num_fields, const threading::Field* const* fields)
|
||||
const int num_fields, const threading::Field* const* fields, const std::map<string, string> config)
|
||||
: threading::InputMessage<ReaderBackend>("Init", backend),
|
||||
source(source), mode(mode), num_fields(num_fields), fields(fields) { }
|
||||
source(source), mode(mode), num_fields(num_fields), fields(fields), config(config) { }
|
||||
|
||||
virtual bool Process()
|
||||
{
|
||||
return Object()->Init(source, mode, num_fields, fields);
|
||||
return Object()->Init(source, mode, num_fields, fields, config);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -26,6 +26,7 @@ private:
|
|||
const ReaderMode mode;
|
||||
const int num_fields;
|
||||
const threading::Field* const* fields;
|
||||
const std::map<string, string> config;
|
||||
};
|
||||
|
||||
class UpdateMessage : public threading::InputMessage<ReaderBackend>
|
||||
|
@ -64,7 +65,7 @@ ReaderFrontend::~ReaderFrontend()
|
|||
}
|
||||
|
||||
void ReaderFrontend::Init(string arg_source, ReaderMode mode, const int num_fields,
|
||||
const threading::Field* const* fields)
|
||||
const threading::Field* const* fields, const std::map<string, string> config)
|
||||
{
|
||||
if ( disabled )
|
||||
return;
|
||||
|
@ -75,7 +76,7 @@ void ReaderFrontend::Init(string arg_source, ReaderMode mode, const int num_fiel
|
|||
source = arg_source;
|
||||
initialized = true;
|
||||
|
||||
backend->SendIn(new InitMessage(backend, arg_source, mode, num_fields, fields));
|
||||
backend->SendIn(new InitMessage(backend, arg_source, mode, num_fields, fields, config));
|
||||
}
|
||||
|
||||
void ReaderFrontend::Update()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue