[Bro] Traversing 'Table' in C code of Bro Plugin

Johanna Amann johanna at icir.org
Mon Feb 15 11:03:14 PST 2016


Hi Nick,

https://github.com/bro/bro/blob/master/src/input/Manager.cc#L288-L306 is
the most succint example I could find after a quick look. You call
InitForIteration() and then get the individual TableEntryVal*s calling
NextEntry.

I hope this helps,
 Johanna

On Mon, Feb 15, 2016 at 12:57:45PM -0500, Nick Allen wrote:
> I am trying to create a plugin that allows a user to define a 'table'
> of key/values that are all strings.  In my BIF file I have something
> like the following:
> 
>   const config: table[string] of string;
> 
> It seems that a table in Bro maps to a TableType* in the C space of my plugin.
> 
>     TableType *config = BifConst::Example::config;
> 
> How do I go about iterating over the key/value pairs defined in
> 'config' in the C code of my plugin?  I am unable to find any good
> examples of code doing that.
> 
> Many thanks in advance.
> 
> -- 
> Nick Allen <nick at nickallen.org>
> _______________________________________________
> Bro mailing list
> bro at bro-ids.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/bro
> 
> 


More information about the Bro mailing list