[Bro-Dev] Loading directories

Robin Sommer robin at icir.org
Wed Jun 1 12:08:22 PDT 2011

For policy files, we now have sub-directory structures like this:


foo.bro contains

    @load foo/base.bro
    @load foo/ext1.bro
    @load foo/ext2.bro

And the effect is that "@load foo" pulls in all of the scripts at
once, which is neat.

What I'm wondering hiwer is whether we should move "foo.bro" into the
subdirectory under some magic name (like init.bro or __init__.bro or
__package__.bro or ...). And then allow to write "@load foo" (with
"foo" now being the directory name) with the effect of loading
"foo/init.bro". In addition, inside foo/* we could allow "@load
ext1.bro" instead of "@load foo/ext1.bro".

(Coincidentally, this would be quite like Python does it ... :)


Robin Sommer * Phone +1 (510) 722-6541 * robin at icir.org
ICSI/LBNL    * Fax   +1 (510) 666-2956 *   www.icir.org

More information about the bro-dev mailing list