mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 21:48:21 +00:00
rename the update_finished event to end_of_data and make it fire in
more cases. It will now not only fire after table-reads have been completed, but also after the last event of a whole-file-read (or whole-db-read, etc.). The interface also has been extended a bit to allow readers to directly fire the event should they so choose. This allows the event to be fired in direct table-setting/event-sending modes, which was previously not possible.
This commit is contained in:
parent
296686d5ca
commit
a6d87fcab7
29 changed files with 101 additions and 94 deletions
|
@ -55,7 +55,7 @@ event bro_init()
|
|||
Input::remove("ssh");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source:string)
|
||||
event Input::end_of_data(name: string, source:string)
|
||||
{
|
||||
print outfile, servers;
|
||||
print outfile, to_count(servers[-42]$ns); # try to actually use a string. If null-termination is wrong this will fail.
|
||||
|
|
|
@ -37,7 +37,7 @@ event bro_init()
|
|||
Input::remove("ssh");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source:string)
|
||||
event Input::end_of_data(name: string, source:string)
|
||||
{
|
||||
print outfile, servers;
|
||||
close(outfile);
|
||||
|
|
|
@ -73,7 +73,7 @@ event bro_init()
|
|||
}
|
||||
|
||||
|
||||
event Input::update_finished(name: string, source: string)
|
||||
event Input::end_of_data(name: string, source: string)
|
||||
{
|
||||
print outfile, "==========SERVERS============";
|
||||
print outfile, servers;
|
||||
|
|
|
@ -40,7 +40,7 @@ event bro_init()
|
|||
Input::remove("ssh");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source:string)
|
||||
event Input::end_of_data(name: string, source:string)
|
||||
{
|
||||
print outfile, servers;
|
||||
close(outfile);
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
@load frameworks/communication/listen
|
||||
|
||||
global outfile: file;
|
||||
global try: count;
|
||||
|
||||
module A;
|
||||
|
||||
|
@ -37,18 +36,18 @@ event line(description: Input::EventDescription, tpe: Input::Event, i: int, b: b
|
|||
print outfile, tpe;
|
||||
print outfile, i;
|
||||
print outfile, b;
|
||||
try = try + 1;
|
||||
if ( try == 7 )
|
||||
{
|
||||
close(outfile);
|
||||
terminate();
|
||||
}
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
{
|
||||
try = 0;
|
||||
outfile = open("../out");
|
||||
Input::add_event([$source="../input.log", $name="input", $fields=Val, $ev=line, $want_record=F]);
|
||||
Input::remove("input");
|
||||
}
|
||||
|
||||
event Input::end_of_data(name: string, source:string)
|
||||
{
|
||||
print outfile, "End-of-data";
|
||||
close(outfile);
|
||||
terminate();
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ event bro_init()
|
|||
Input::remove("ssh");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source:string)
|
||||
event Input::end_of_data(name: string, source:string)
|
||||
{
|
||||
print outfile, servers;
|
||||
terminate();
|
||||
|
|
|
@ -38,7 +38,7 @@ event bro_init()
|
|||
Input::remove("input");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source: string)
|
||||
event Input::end_of_data(name: string, source: string)
|
||||
{
|
||||
print outfile, servers;
|
||||
close(outfile);
|
||||
|
|
|
@ -38,7 +38,7 @@ event bro_init()
|
|||
Input::remove("input");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source: string)
|
||||
event Input::end_of_data(name: string, source: string)
|
||||
{
|
||||
print outfile, servers;
|
||||
close(outfile);
|
||||
|
|
|
@ -48,7 +48,7 @@ event bro_init()
|
|||
Input::remove("input");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source: string)
|
||||
event Input::end_of_data(name: string, source: string)
|
||||
{
|
||||
print outfile, servers;
|
||||
close(outfile);
|
||||
|
|
|
@ -43,7 +43,7 @@ event bro_init()
|
|||
Input::remove("input");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source: string)
|
||||
event Input::end_of_data(name: string, source: string)
|
||||
{
|
||||
print outfile, servers[1.2.3.4];
|
||||
print outfile, servers[1.2.3.5];
|
||||
|
|
|
@ -47,7 +47,7 @@ event bro_init()
|
|||
Input::remove("input");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source: string)
|
||||
event Input::end_of_data(name: string, source: string)
|
||||
{
|
||||
if ( 1 in servers )
|
||||
print outfile, "VALID";
|
||||
|
|
|
@ -51,7 +51,7 @@ event bro_init()
|
|||
Input::remove("input");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source: string)
|
||||
event Input::end_of_data(name: string, source: string)
|
||||
{
|
||||
print outfile, servers;
|
||||
close(outfile);
|
||||
|
|
|
@ -94,7 +94,7 @@ event bro_init()
|
|||
]);
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source: string)
|
||||
event Input::end_of_data(name: string, source: string)
|
||||
{
|
||||
try = try + 1;
|
||||
print outfile, fmt("Update_finished for %s, try %d", name, try);
|
||||
|
|
|
@ -48,7 +48,7 @@ event bro_init()
|
|||
Input::remove("input");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source: string)
|
||||
event Input::end_of_data(name: string, source: string)
|
||||
{
|
||||
print outfile, servers;
|
||||
close(outfile);
|
||||
|
|
|
@ -45,7 +45,7 @@ event bro_init()
|
|||
}
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source: string)
|
||||
event Input::end_of_data(name: string, source: string)
|
||||
{
|
||||
print outfile, name;
|
||||
print outfile, source;
|
||||
|
|
|
@ -123,7 +123,7 @@ event bro_init()
|
|||
}
|
||||
|
||||
|
||||
event Input::update_finished(name: string, source: string)
|
||||
event Input::end_of_data(name: string, source: string)
|
||||
{
|
||||
print outfile, "==========SERVERS============";
|
||||
print outfile, servers;
|
||||
|
|
|
@ -38,7 +38,7 @@ event bro_init()
|
|||
Input::remove("ssh");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source:string)
|
||||
event Input::end_of_data(name: string, source:string)
|
||||
{
|
||||
print outfile, servers;
|
||||
close(outfile);
|
||||
|
|
|
@ -38,7 +38,7 @@ event bro_init()
|
|||
Input::remove("ssh");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source:string)
|
||||
event Input::end_of_data(name: string, source:string)
|
||||
{
|
||||
print outfile, servers;
|
||||
close(outfile);
|
||||
|
|
|
@ -42,7 +42,7 @@ event bro_init()
|
|||
Input::remove("ssh");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source:string)
|
||||
event Input::end_of_data(name: string, source:string)
|
||||
{
|
||||
print outfile, servers;
|
||||
close(outfile);
|
||||
|
|
|
@ -62,7 +62,7 @@ event bro_init()
|
|||
Input::remove("ssh");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source:string)
|
||||
event Input::end_of_data(name: string, source:string)
|
||||
{
|
||||
print outfile, servers;
|
||||
close(outfile);
|
||||
|
|
|
@ -113,7 +113,7 @@ event bro_init()
|
|||
}
|
||||
|
||||
|
||||
event Input::update_finished(name: string, source: string)
|
||||
event Input::end_of_data(name: string, source: string)
|
||||
{
|
||||
print fin_out, "==========SERVERS============";
|
||||
#print fin_out, servers;
|
||||
|
|
|
@ -56,7 +56,7 @@ event bro_init()
|
|||
Input::remove("ssh");
|
||||
}
|
||||
|
||||
event Input::update_finished(name: string, source:string)
|
||||
event Input::end_of_data(name: string, source:string)
|
||||
{
|
||||
print outfile, servers;
|
||||
close(outfile);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue