diff --git a/src/Func.cc b/src/Func.cc index d66e9c71fa..ae449afeb3 100644 --- a/src/Func.cc +++ b/src/Func.cc @@ -331,7 +331,7 @@ Val* BroFunc::Call(val_list* args, Frame* parent) const if ( sample_logger ) sample_logger->FunctionSeen(this); - Val* plugin_result = PLUGIN_HOOK_WITH_RESULT(HOOK_CALL_FUNCTION, HookCallFunction(this, args), 0); + Val* plugin_result = PLUGIN_HOOK_WITH_RESULT(HOOK_CALL_FUNCTION, HookCallFunction(this, parent, args), 0); if ( plugin_result ) return HandlePluginResult(plugin_result, args, Flavor()); @@ -548,7 +548,7 @@ Val* BuiltinFunc::Call(val_list* args, Frame* parent) const if ( sample_logger ) sample_logger->FunctionSeen(this); - Val* plugin_result = PLUGIN_HOOK_WITH_RESULT(HOOK_CALL_FUNCTION, HookCallFunction(this, args), 0); + Val* plugin_result = PLUGIN_HOOK_WITH_RESULT(HOOK_CALL_FUNCTION, HookCallFunction(this, parent, args), 0); if ( plugin_result ) return HandlePluginResult(plugin_result, args, FUNC_FLAVOR_FUNCTION); diff --git a/src/plugin/Manager.cc b/src/plugin/Manager.cc index ab0b85676b..f416172153 100644 --- a/src/plugin/Manager.cc +++ b/src/plugin/Manager.cc @@ -559,13 +559,14 @@ int Manager::HookLoadFile(const string& file) return rc; } -Val* Manager::HookCallFunction(const Func* func, val_list* vargs) const +Val* Manager::HookCallFunction(const Func* func, Frame* parent, val_list* vargs) const { HookArgumentList args; if ( HavePluginForHook(META_HOOK_PRE) ) { args.push_back(HookArgument(func)); + args.push_back(HookArgument(parent)); args.push_back(HookArgument(vargs)); MetaHookPre(HOOK_CALL_FUNCTION, args); } @@ -579,7 +580,7 @@ Val* Manager::HookCallFunction(const Func* func, val_list* vargs) const { Plugin* p = (*i).second; - v = p->HookCallFunction(func, vargs); + v = p->HookCallFunction(func, parent, vargs); if ( v ) break; @@ -644,7 +645,7 @@ void Manager::HookDrainEvents() const } -void Manager::HookUpdateNetworkTime(double network_time) const +void Manager::HookUpdateNetworkTime(const double network_time) const { HookArgumentList args; diff --git a/src/plugin/Manager.h b/src/plugin/Manager.h index 39a2f7f887..349db3e483 100644 --- a/src/plugin/Manager.h +++ b/src/plugin/Manager.h @@ -244,7 +244,7 @@ public: * functions and events, it may be any Val and must be ignored). If no * plugin handled the call, the method returns null. */ - Val* HookCallFunction(const Func* func, val_list* args) const; + Val* HookCallFunction(const Func* func, Frame *parent, val_list* args) const; /** * Hook that filters the queuing of an event. @@ -261,7 +261,7 @@ public: * * @param network_time The new network time. */ - void HookUpdateNetworkTime(double network_time) const; + void HookUpdateNetworkTime(const double network_time) const; /** * Hook that informs plugins that the event queue is being drained. diff --git a/src/plugin/Plugin.cc b/src/plugin/Plugin.cc index 8aaadc1ec7..b0ccf38990 100644 --- a/src/plugin/Plugin.cc +++ b/src/plugin/Plugin.cc @@ -271,7 +271,7 @@ int Plugin::HookLoadFile(const std::string& file, const std::string& ext) return -1; } -Val* Plugin::HookCallFunction(const Func* func, val_list* args) +Val* Plugin::HookCallFunction(const Func* func, Frame *parent, val_list* args) { return 0; } @@ -285,7 +285,7 @@ void Plugin::HookDrainEvents() { } -void Plugin::HookUpdateNetworkTime(double network_time) +void Plugin::HookUpdateNetworkTime(const double network_time) { } diff --git a/src/plugin/Plugin.h b/src/plugin/Plugin.h index 978e22b634..7794b496b2 100644 --- a/src/plugin/Plugin.h +++ b/src/plugin/Plugin.h @@ -573,7 +573,7 @@ protected: * ignored; best to use a \c TYPE_ANY). If the plugin did not handle * the call, it must return null. */ - virtual Val* HookCallFunction(const Func* func, val_list* args); + virtual Val* HookCallFunction(const Func* func, Frame *parent, val_list* args); /** * Hook into raising events. Whenever the script interpreter is about @@ -607,7 +607,7 @@ protected: * * @param networkt_time The new network time. */ - virtual void HookUpdateNetworkTime(double network_time); + virtual void HookUpdateNetworkTime(const double network_time); /** * Hook for destruction of objects registered with