- set default to an enum type

Hi everyone,

I have a variable that has &optional &default attributes.
I want the &default attribute to have a value of an enum.

So if the enum is : type color: enum { Red, White, Blue, };
c: color &default=Red;

Does not work…

Any ideas on the correct syntax ?

Thank you
B

That is the correct syntax.

http://try.bro.org/#/trybro/saved/334009

$ cat color.bro
type Color: enum {Red, Green, Blue};
type Whatever: record {
    color: Color &default=Red;
};

event bro_init()
{
    local t: Whatever;
    print t$color;
}

$ bro color.bro
Red