[Bro-Dev] Bif tuning / overhaul

Robin Sommer robin at icir.org
Wed Feb 16 08:30:50 PST 2011


On Tue, Feb 15, 2011 at 15:31 -0800, you wrote:

> I've also documented what one can do with bifs. Find it at:
>   http://bro.icir.org/devel/bif-doc/

Thanks for putting this together! I need to read a bit more carefully,
and I guess play with it, but overall this looks good to me. Nice
stuff.

>   BifConst     for consts
>   BifTypePtr   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
>                code
>
>   Question: Could also use BroConst, etc. instead of BifConst

I actually like the Bif prefix, it clearly indicates where the stuff
is coming from. But how about using "BifType" instead of "BifTypePtr".
Types are always passed around as pointers anyway, so I don't see a
problem with leaving that hint out, and it makes the name more
intuitive. 

>   + can now only declare but not define consts. You must define
>     the const in bro.init. The bif only creates the netvar glue code.

Is the reason for this just the work it would require to implement it
fully, or something else?  Seems in principle bifcl could just as well
generate everything, with all the definitions (for consts, types,
etc.) being right there in the bif as well. That would be ideal as it
would follow the rule of "having things only in one place". (I'm not
asking you to implement it; just curious). 

Robin



-- 
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