[Bro-Dev] attributes & named types

Jon Siwek jsiwek at corelight.com
Mon Sep 10 15:01:00 PDT 2018


On Mon, Sep 10, 2018 at 4:16 PM Vern Paxson <vern at corelight.com> wrote:

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

My understanding was just that TypeType's currently are *not* used
when creating type aliases.  Example:

# "mytype" is an ID w/ type "count" (i.e. it's a type alias).
# It's not using "TypeType" at this point.
type mytype: count;

function foo(x: any)
    { print x; }

# Passing the type name/alias as a value.
# The local variable/argument 'x' becomes of type
# "TypeType".  It's not of type "count".
foo(mytype);

# Here, 'y' and 'x' are now actually type "count".
# They aren't a "TypeType".
local y: mytype = 3;
foo(y);

At least that's how I think it's currently working, so are you going
start using TypeType as a means of type aliasing in addition to adding
attributes to them?

Just trying to clarify/understand how things currently work vs. what is planned.

- Jon


More information about the bro-dev mailing list