[Bro-Dev] Per connection byte and packet counting

Vern Paxson vern at icir.org
Wed Dec 8 20:18:16 PST 2010


> > 	counted_size: count &optional;
> > 	counted_packets: count &optional;
> > };
> 
> If I do this, then I basically have variant (a). (with the addition that
> it's slower than (a)).

I don't understand this.  &optional fields will be null pointers if the
field isn't present.  So it's just 4 bytes each when not in use, rather
than a full Val record (plus 4 bytes to point to it).  I also don't
see why it would be slower, other than the smidgen of cycles it takes to
initial the null pointers.

> The only way for (b) would be to have a global table, indexed by connid,
> that yields the counters.

Yuck.  But first let's understand the issue above.

		Vern


More information about the bro-dev mailing list