[Bro] Defining a table inside a record

Abhinay Kampasi abhinay at cs.utexas.edu
Thu Oct 12 23:26:49 PDT 2006

Thanks Vern,

That fixed the problem.

About deep copy, I am using version 0.9. If I use copy, Bro complains saying
"unknown identifier copy". Is there any other way to do a deep copy in v0.9.


-----Original Message-----
From: bro-bounces at ICSI.Berkeley.EDU
[mailto:bro-bounces at ICSI.Berkeley.EDU]On Behalf Of Vern Paxson
Sent: Friday, October 13, 2006 12:55 AM
To: Abhinay Kampasi
Cc: bro at bro-ids.org
Subject: Re: [Bro] Defining a table inside a record

> Am I doing something wrong?

It's subtle, but the problem is that this:

	local curr_info: temp_info;

assigns a record value to curr_info but one that *doesn't have any of the
fields initialized*.  It's the same as if you had a field "foo: double"
in the record - you couldn't then access temp_info$foo in an expression
because it hasn't yet been assigned.

The following will fix the problem.  Change:

	local curr_info: temp_info;
	curr_info$temp_table[1] = "abhinay";


	local curr_info: temp_info;
	local table_val_for_record : table[count] of string;
	curr_info$temp_table = table_val_for_record;
	curr_info$temp_table[1] = "abhinay";

> Also, the ref-manual mentions that we should use "* expr" for doing a deep
> copy. I get an error when I try to do so. What is the correct syntax for
> doing a deep copy.

Argh, that's out-of-date (where in the manual do you see it?).  Instead
use "copy(expr)".

Bro mailing list
bro at bro-ids.org

More information about the Bro mailing list