mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00

There's two instances of WriterBackend::WriterInfo for a given
writer. One in Manager::WriterInfo that's accessible via
stream.writers and a copy within WriterFrontend.
Commit 78999d147d
switched to use the
address of the frontend's info instance for HookLogWrite() invocations,
breaking users using the address for identification purposes.
31 lines
1.1 KiB
C++
31 lines
1.1 KiB
C++
|
|
#pragma once
|
|
|
|
#include <plugin/Plugin.h>
|
|
|
|
namespace btest::plugin::Log_Hooks {
|
|
|
|
class Plugin : public zeek::plugin::Plugin {
|
|
protected:
|
|
void HookLogInit(const std::string& writer, const std::string& instantiating_filter, bool local, bool remote,
|
|
const zeek::logging::WriterBackend::WriterInfo& info, int num_fields,
|
|
const zeek::threading::Field* const* fields) override;
|
|
bool HookLogWrite(const std::string& writer, const std::string& filter,
|
|
const zeek::logging::WriterBackend::WriterInfo& info, int num_fields,
|
|
const zeek::threading::Field* const* fields, zeek::threading::Value** vals) override;
|
|
|
|
// Overridden from plugin::Plugin.
|
|
zeek::plugin::Configuration Configure() override;
|
|
|
|
// Overridden from plugin::Plugin.
|
|
void Done() override;
|
|
|
|
private:
|
|
int round;
|
|
const zeek::logging::WriterBackend::WriterInfo* info_addr_init = nullptr;
|
|
const zeek::logging::WriterBackend::WriterInfo* info_addr_write = nullptr;
|
|
};
|
|
|
|
extern Plugin plugin;
|
|
|
|
} // namespace btest::plugin::Log_Hooks
|