[Bro] Using expire attributes for nested compound types

Kamran Riaz Khan krkhan at inspirated.com
Sun May 27 05:01:14 PDT 2012


On 05/27/2012 04:49 PM, Kamran Riaz Khan wrote:
> If I have a table of set, it's pretty straight-forward to add expiring
> timers for the parent table:
> 
> --
> global test_table: table[count] of set[string]
> 	&read_expire = 1 day &expire_func = test_expire;
> --
> 
> However, I can't figure out a way to define {read,write,create}_expire
> attributes for the *child*, i.e., set[string].
> 
> I have tried defining the timers when adding the table entry:
> 
> --
> test_table[0] = set("Hello", "World") &create_expire = 1 usec;
> --
> 
> But the string entries do not expire 1 usec after creation. Any ideas on
> how to accomplish this?

Okay, this works:

--
local entry: set[string] &create_expire = 1 day;

add entry["Hello"];
add entry["World"];
test_table[0] = entry;
--

Regards,
-- 
Kamran Riaz Khan.

http://inspirated.com/




More information about the Bro mailing list