[Bro-Dev] attributes & named types

Vern Paxson vern at corelight.com
Mon Sep 10 14:16:16 PDT 2018

> Other ideas I'm having for solving the overall problem are:
> (1) 'a' and 'b' need to actually be distinct BroType's.  Instead of
> 'b' being a reference/alias to 'a' with extended attributes, just
> create it as it's own BroType by first cloning 'a', then adding any
> additional attributes.

I originally went down this route, but this involves adding attributes to
all types, since currently types don't have attributes.  Seems like a poor
fit given there's only one class of type (named ones) that need this.

> (2) BroType could somehow store a mapping of identifier -> attributes
> so that on declaring a variable of either 'a' or 'b', we can choose
> which attributes apply.

That seems more hacky than (1), as it involves adding still more to

Seems simplest to me to have TypeType's (and only those) include attributes.
The rest of it is easy to do from there.  We could also do this with a
separate NameType, but I don't see what that gains, since TypeType's already
come into existence because of binding names to types.


More information about the bro-dev mailing list