Extending plugin interface.

This is for feature parity with the older interface, and remains
experimental for now.
This commit is contained in:
Robin Sommer 2014-05-14 16:58:59 -07:00
parent aec61e9ea4
commit 421120e12c
8 changed files with 145 additions and 14 deletions

View file

@ -22,6 +22,7 @@ const char* plugin::hook_name(HookType h)
"QueueEvent",
"DrainEvents",
"UpdateNetworkTime",
"BroObjDtor",
// MetaHooks
"MetaHookPre",
"MetaHookPost",
@ -32,6 +33,13 @@ const char* plugin::hook_name(HookType h)
return hook_names[int(h)];
}
Configuration::Configuration()
{
name = "";
description = "";
api_version = BRO_PLUGIN_API_VERSION;
}
BifItem::BifItem(const std::string& arg_id, Type arg_type)
{
id = arg_id;
@ -119,6 +127,10 @@ void HookArgument::Describe(ODesc* d) const
case VOID:
d->Add("<void>");
break;
case VOIDP:
d->Add("<void ptr>");
break;
}
}
@ -262,6 +274,16 @@ void Plugin::DisableHook(HookType hook)
plugin_mgr->DisableHook(hook, this);
}
void Plugin::RequestEvent(EventHandlerPtr handler)
{
plugin_mgr->RequestEvent(handler, this);
}
void Plugin::RequestBroObjDtor(BroObj* obj)
{
plugin_mgr->RequestBroObjDtor(obj, this);
}
int Plugin::HookLoadFile(const std::string& file)
{
return -1;
@ -285,6 +307,10 @@ void Plugin::HookUpdateNetworkTime(double network_time)
{
}
void Plugin::HookBroObjDtor(void* obj)
{
}
void Plugin::MetaHookPre(HookType hook, const HookArgumentList& args)
{
}