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:
Bernhard Amann 2012-10-10 11:51:20 -07:00
parent 296686d5ca
commit a6d87fcab7
29 changed files with 101 additions and 94 deletions

View file

@ -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.

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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();
}

View file

@ -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();

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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];

View file

@ -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";

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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);