[Bro] How to manage a dynamic vector

Seth Hall seth at icir.org
Mon Dec 22 08:38:46 PST 2014


> On Dec 22, 2014, at 6:46 AM, Vito Logrillo <vitologrillo at gmail.com> wrote:
> 
> My variable count_a is incremented each time the event
> Known::log_known_services is executed, but the last "for" in
> Conn::log_conn is never executed because known_services_buf_vec is
> always a void vector.

Vectors are a little goofy in Bro still.  They are statically sized so you are creating an instance of a zero length vector.  There is a built in function named “resize” that you may want to use to provide a size to your vector.
	https://www.bro.org/sphinx-git/scripts/base/bif/bro.bif.bro.html#id-resize

Alternately, you may want to use something like a table[count] of known_services_buffer

  .Seth

--
Seth Hall
International Computer Science Institute
(Bro) because everyone has a network
http://www.bro.org/




More information about the Bro mailing list