[Bro-Dev] enums in modules

Gregor Maier gregor at icir.org
Mon Jan 24 11:46:12 PST 2011


On 1/24/11 8:31 , Robin Sommer wrote:
> 
> On Sun, Jan 23, 2011 at 01:21 -0500, you wrote:
> 
>> I think that does work, it's the namespacing that messes things up
>> because the Bro and C syntaxes don't mesh.  Maybe bifcl could munge
>> namespaces from Logging::ID to _Logging__ID or something to provide
>> the transition?
> 
> I'd need to look closer at bifcl. Can you file a ticket with a small
> example demonstrating the problem? Thanks,

bifcl supports enums (it just casts them as a "neutral" Val*, same as
for record types). So it would just be a matter of telling bifcl to
accept the Namespace::Type name syntax. That should be it.

The C part doesn't really care about the type. It's all a "netural"
Val*. The type is only used for the policy file and type checking.

EnumType and EnumVal should make accessing the enum's value relatively
easy. I'm using that in my re-working of the NFS analyzer. Let me know
if you want details.


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