mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00

Value assigned in bro_init() to a table with &create_expire weren't expiring when reading traffic from an interface. It worked when reading a pcap file, but I added a test case to show it still working.
23 lines
471 B
Text
23 lines
471 B
Text
# @TEST-EXEC: bro -C -r $TRACES/var-services-std-ports.trace %INPUT >output
|
|
# @TEST-EXEC: btest-diff output
|
|
|
|
function inform_me(s: set[string], idx: string): interval
|
|
{
|
|
print fmt("expired %s", idx);
|
|
return 0secs;
|
|
}
|
|
|
|
global s: set[string] &create_expire=1secs &expire_func=inform_me;
|
|
|
|
event bro_init()
|
|
{
|
|
add s["i"];
|
|
add s["am"];
|
|
add s["here"];
|
|
}
|
|
|
|
event new_connection(c: connection)
|
|
{
|
|
add s[fmt("%s", c$id)];
|
|
print s;
|
|
}
|