[Bro-Dev] enum namespacing

Gregor Maier gregor at icir.org
Thu Mar 24 18:59:39 PDT 2011


Note that currently the NOTICE framework is the part the mostly makes
use of extended Enums and there it makes sense for the extended elements
to live in the enclosing name-space (in your example HTTP).

I guess the current rule is: if an identifier does not have a Foo::
module specifier, it's placed in the current module. So,

module HTTP;
redef enum Software::Type += { Software::UNKNOWN };  # UNKNOWN in
                                  Software namespace
redef enum Software::Type += { UNKNOWN }; # unknown in HTTP namespace



just my 2ct
Gregor

On 3/17/11 6:35 , Seth Hall wrote:
> Does it makes sense that an enum would be in the name space it's declared within even if it's extending an enum type from another namespace?
> 
> My example:
> 
> module Software;
> 
> export {
> 	type Type: enum { UNKNOWN };
> }
> 
> module HTTP;
> 
> redef enum Software::Type += { WEB_SERVER };
> 
> event bro_init()
> 	{
> 	# I would expect this to be true, but it seems that WEB_SERVER was placed into the HTTP namespace and this doesn't work.
> 	print Software::WEB_SERVER;
> 	}
> 
>   .Seth
> 
> --
> Seth Hall
> International Computer Science Institute
> (Bro) because everyone has a network
> http://www.bro-ids.org/
> 
> 
> _______________________________________________
> bro-dev mailing list
> bro-dev at bro-ids.org
> http://mailman.icsi.berkeley.edu/mailman/listinfo/bro-dev
> 


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