[Bro] nested &defaults

David Mandelberg dmandelb at bbn.com
Mon Mar 25 10:51:03 PDT 2013

Hello again,

I have a record with a field like this:

type Histogram: record {
	histogram: vector of count;

I'd like histogram field to default to an empty vector and the
individual counts in the vector to default to 0. I.e., I want the below
code to print "42".

global foo: Histogram;
foo$histogram[5] += 42;

Is that possible to set defaults for both $histogram and $histogram[N]?

More information about the Bro mailing list