mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +00:00
Mark all of the aliased classes in plugin/Plugin.h deprecated, and fix all of the plugins that were using them
This commit is contained in:
parent
e77e8c4b7b
commit
7a5dae4354
76 changed files with 297 additions and 284 deletions
|
@ -11,21 +11,21 @@ namespace plugin { namespace Demo_Hooks { Plugin plugin; } }
|
|||
|
||||
using namespace plugin::Demo_Hooks;
|
||||
|
||||
plugin::Configuration Plugin::Configure()
|
||||
zeek::plugin::Configuration Plugin::Configure()
|
||||
{
|
||||
EnableHook(HOOK_LOAD_FILE);
|
||||
EnableHook(HOOK_CALL_FUNCTION);
|
||||
EnableHook(HOOK_QUEUE_EVENT);
|
||||
EnableHook(HOOK_DRAIN_EVENTS);
|
||||
EnableHook(HOOK_UPDATE_NETWORK_TIME);
|
||||
EnableHook(META_HOOK_PRE);
|
||||
EnableHook(META_HOOK_POST);
|
||||
EnableHook(HOOK_BRO_OBJ_DTOR);
|
||||
EnableHook(HOOK_SETUP_ANALYZER_TREE);
|
||||
EnableHook(HOOK_LOG_INIT);
|
||||
EnableHook(HOOK_LOG_WRITE);
|
||||
EnableHook(zeek::plugin::HOOK_LOAD_FILE);
|
||||
EnableHook(zeek::plugin::HOOK_CALL_FUNCTION);
|
||||
EnableHook(zeek::plugin::HOOK_QUEUE_EVENT);
|
||||
EnableHook(zeek::plugin::HOOK_DRAIN_EVENTS);
|
||||
EnableHook(zeek::plugin::HOOK_UPDATE_NETWORK_TIME);
|
||||
EnableHook(zeek::plugin::META_HOOK_PRE);
|
||||
EnableHook(zeek::plugin::META_HOOK_POST);
|
||||
EnableHook(zeek::plugin::HOOK_BRO_OBJ_DTOR);
|
||||
EnableHook(zeek::plugin::HOOK_SETUP_ANALYZER_TREE);
|
||||
EnableHook(zeek::plugin::HOOK_LOG_INIT);
|
||||
EnableHook(zeek::plugin::HOOK_LOG_WRITE);
|
||||
|
||||
plugin::Configuration config;
|
||||
zeek::plugin::Configuration config;
|
||||
config.name = "Demo::Hooks";
|
||||
config.description = "Exercises all plugin hooks";
|
||||
config.version.major = 1;
|
||||
|
@ -34,11 +34,11 @@ plugin::Configuration Plugin::Configure()
|
|||
return config;
|
||||
}
|
||||
|
||||
static void describe_hook_args(const plugin::HookArgumentList& args, ODesc* d)
|
||||
static void describe_hook_args(const zeek::plugin::HookArgumentList& args, ODesc* d)
|
||||
{
|
||||
bool first = true;
|
||||
|
||||
for ( plugin::HookArgumentList::const_iterator i = args.begin(); i != args.end(); i++ )
|
||||
for ( zeek::plugin::HookArgumentList::const_iterator i = args.begin(); i != args.end(); i++ )
|
||||
{
|
||||
if ( ! first )
|
||||
d->Add(", ");
|
||||
|
@ -59,8 +59,8 @@ std::pair<bool, Val*> Plugin::HookCallFunction(const Func* func, Frame* frame, v
|
|||
{
|
||||
ODesc d;
|
||||
d.SetShort();
|
||||
HookArgument(func).Describe(&d);
|
||||
HookArgument(args).Describe(&d);
|
||||
zeek::plugin::HookArgument(func).Describe(&d);
|
||||
zeek::plugin::HookArgument(args).Describe(&d);
|
||||
fprintf(stderr, "%.6f %-15s %s\n", network_time, "| HookCallFunction",
|
||||
d.Description());
|
||||
|
||||
|
@ -71,7 +71,7 @@ bool Plugin::HookQueueEvent(Event* event)
|
|||
{
|
||||
ODesc d;
|
||||
d.SetShort();
|
||||
HookArgument(event).Describe(&d);
|
||||
zeek::plugin::HookArgument(event).Describe(&d);
|
||||
fprintf(stderr, "%.6f %-15s %s\n", network_time, "| HookQueueEvent",
|
||||
d.Description());
|
||||
|
||||
|
@ -105,7 +105,7 @@ void Plugin::HookBroObjDtor(void* obj)
|
|||
fprintf(stderr, "%.6f %-15s\n", ::network_time, "| HookBroObjDtor");
|
||||
}
|
||||
|
||||
void Plugin::MetaHookPre(HookType hook, const HookArgumentList& args)
|
||||
void Plugin::MetaHookPre(zeek::plugin::HookType hook, const zeek::plugin::HookArgumentList& args)
|
||||
{
|
||||
ODesc d;
|
||||
d.SetShort();
|
||||
|
@ -114,7 +114,7 @@ void Plugin::MetaHookPre(HookType hook, const HookArgumentList& args)
|
|||
hook_name(hook), d.Description());
|
||||
}
|
||||
|
||||
void Plugin::MetaHookPost(HookType hook, const HookArgumentList& args, HookArgument result)
|
||||
void Plugin::MetaHookPost(zeek::plugin::HookType hook, const zeek::plugin::HookArgumentList& args, zeek::plugin::HookArgument result)
|
||||
{
|
||||
ODesc d1;
|
||||
d1.SetShort();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
namespace plugin {
|
||||
namespace Demo_Hooks {
|
||||
|
||||
class Plugin : public ::plugin::Plugin
|
||||
class Plugin : public zeek::plugin::Plugin
|
||||
{
|
||||
protected:
|
||||
int HookLoadFile(const LoadType type, const std::string& file, const std::string& resolved) override;
|
||||
|
@ -18,13 +18,13 @@ protected:
|
|||
void HookLogInit(const std::string& writer, const std::string& instantiating_filter, bool local, bool remote, const logging::WriterBackend::WriterInfo& info, int num_fields, const threading::Field* const* fields) override;
|
||||
bool HookLogWrite(const std::string& writer, const std::string& filter, const logging::WriterBackend::WriterInfo& info, int num_fields, const threading::Field* const* fields, threading::Value** vals) override;
|
||||
void HookSetupAnalyzerTree(Connection *conn) override;
|
||||
void MetaHookPre(HookType hook, const HookArgumentList& args) override;
|
||||
void MetaHookPost(HookType hook, const HookArgumentList& args, HookArgument result) override;
|
||||
void MetaHookPre(zeek::plugin::HookType hook, const zeek::plugin::HookArgumentList& args) override;
|
||||
void MetaHookPost(zeek::plugin::HookType hook, const zeek::plugin::HookArgumentList& args, zeek::plugin::HookArgument result) override;
|
||||
|
||||
void RenderVal(const threading::Value* val, ODesc &d) const;
|
||||
|
||||
// Overridden from plugin::Plugin.
|
||||
plugin::Configuration Configure() override;
|
||||
// Overridden from zeek::plugin::Plugin.
|
||||
zeek::plugin::Configuration Configure() override;
|
||||
};
|
||||
|
||||
extern Plugin plugin;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue