[Bro-Dev] Bif tuning / overhaul

Gregor Maier gregor at icir.org
Thu Feb 17 09:51:43 PST 2011


Some more thoughts in this regard:


* Modules and export: functions, events, and enum that are defined in a
  bif in a namespace also need to be encapsulated in an "export". This
  is not super nice, but I don't know a better alternative.

* For consts, types defined in bro.init (and possibly then declared in
  a bif for inclusion in C/C++) you also need exports. I.e.,

    const FOO::foobar;   # Doesn't work
    export { const FOO::foobar; }   # Works

  Don't know whether there's a better way to solve that.

* Using namespace for global config variables and types, will also mean
  that we need multiple "module" statements in bro.init....

* "export" can be nested (although it doesn't make sense to do so).
   However as soon as the innermost export section ends, the "export"
   mode is switched off. I'd like to change that so that it will switch
   off when the outermost export section ends. (I need exports to
   support namespaces and modules for BiF, so depending on how users
   *bif.bro files, there might be nested export that will then not work
   as expected). This change is minor

-- 
Gregor Maier
<gregor at icir.org>  <gregor at icsi.berkeley.edu>
Int. Computer Science Institute (ICSI)
1947 Center St., Ste. 600
Berkeley, CA 94704, USA
http://www.icir.org/gregor/


More information about the bro-dev mailing list