[Bro-Dev] #403: topic/gregor/bif-tuning -- add namespaces and type declaration to BiFs

Bro Tracker bro at tracker.icir.org
Tue Feb 22 16:37:43 PST 2011

#403: topic/gregor/bif-tuning -- add namespaces and type declaration to BiFs
 Reporter:  gregor         |      Owner:
     Type:  Merge Request  |     Status:  new
 Priority:  Normal         |  Milestone:  Bro1.6
Component:  Bro            |    Version:  git/master
 Keywords:                 |

 CHANGES entry:

 * BiFs: Adding support for namespace (policy layer module names) to
   BiFs, adding type declarations to BiFs (to access them from C++),
   extending const declarations in BiFs.


 Text from my mail:

 I've revamped the Bro bif language a bit. Mainly to add support for
 namespaces and features that would be handy for my RPC/NFS analyzers.

 I've also documented what one can do with bifs. Find it at:
 an overview of all of it:

 The main changes (from current master version):

 * support for policy-layer namespaces. Either using fully qualified
   names (MODULE::foobar) or using the "module XYZ;" statement.

 * C/C++ variables, and functions have their own namespaces:

   + *BifConst*     for consts
   + *BifType*      for type declartions (RecordType*, EnumType*)
   + *BifEnum*      for C-enums derived from BiFs
   + *BifFunc*      for bif functions
   + *BifEvent*     for (some parts) of events. I haven't moved all of
     the event related C++ variables into this namespace,
     because this would substantial refactoring of existing

 * const:

   + can now use any type for consts (previously: only bools)
   + can now only declare but not define consts. You must define
     the const in bro.init. The bif only creates the netvar glue code.
     This will help streamline automatically generated documentation and
     it was necessary for supporting types other than bool

 * forward type delcaration: can you declare but not define Bro types
   (records, sets, etc.) in BiF to make them available to C++. The bif
   only generates the netvar glue. The types must be defined in bro.init


Ticket URL: <http://tracker.icir.org/bro/ticket/403>
Bro Tracker <http://tracker.icir.org/bro>
Bro Issue Tracker

More information about the bro-dev mailing list