[Bro] Calling external functions in binpac protocol parser

Johanna Amann johanna at icir.org
Fri Jan 26 09:50:48 PST 2018


Hi again,

> > you can e.g. move it into a separate
> > class that is accessible by everyone. Depending on the things that your
> > function does, it even might be possible to make it a static function.
> >
> 
> Yes, as you mentioned, we do want a module that can be accessed and called
> by every protocol analyzer. Regarding the "separate class that is
> accessible by everyone",
> where we should implement this module? Do we need put the C++ files in
> bro/src?

Thinking about it again - this actually is a good question. It would be
neat if you could add functionality to your plugins without having to
modify the base Bro installation (which is what you basically do when you
move things to /bro/src and include them into the compile process there -
which certainly is a theoretical possibility).

But - it would be nicer if that was not necessary. So I think my first
idea would be to just put the shared sources into a directory that is
accessible by all your plugins, and compile it together with a plugin (in
separate namespaces so that it does not conflict afterwards).

This should be fine assuming that your shared functionality is not ultra
huge..

> > Also note that you probably should not put your plugins into
> > bro-aux/plugin-support in the first case. Having them in a separate
> > directory is probably preferable - completely outside of the Bro source
> > tree.
> >
> 
> Sorry I don't get the point of this part. In my understanding, wherever we
> develop
> the plugins, it will be complied into bro's library /bro/lib/.../plugin.
> What do you mean
> (and how) "outside of the Bro source tree"?

Yes, your plugins will reside inside the Bro installation in the end.
However you probably should keep your sourecode separate from the main Bro
sourcecode - that's all what I meant :).

Johanna


More information about the Bro mailing list