[Bro-Dev] Module prefix in sending and receiving Broker events

Jan Grashöfer jan.grashoefer at gmail.com
Thu Sep 27 04:49:17 PDT 2018


On 27/09/2018 10:47, Matthias Vallentin wrote:
> If I remove the event declaration, I get:
> 
>      error in ./foo.bro, line 10: not an event (Foo::foo())

The following works for me:

     module Foo;

     event Foo::foo()
       {
       print "foo";
       }

     event bro_init()
       {
       event Foo::foo();
       }

Just as Jon suggested:
> Adding the
> namespace scoping always and everywhere means to the event
> declaration, the handlers, event/schedule dispatching, any strings
> that contain the event name, etc.

Event handlers just don't seem to inherit the surrounding module 
namespace, which kind of makes sense if you want to handle events 
generated in the global namespace.

Jan


More information about the bro-dev mailing list