mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 21:48:21 +00:00
It works. Even including all unit tests.
But: there are still a few places where I am sure that there are race conditions & memory leaks & I do not really like the current interface & I have to add a few more messages between the front and backend. But - it works :)
This commit is contained in:
parent
4e868d282d
commit
88233efb2c
16 changed files with 127 additions and 49 deletions
|
@ -48,7 +48,10 @@ event bro_init()
|
|||
Input::create_stream(A::INPUT, [$source="input.log"]);
|
||||
Input::add_tablefilter(A::INPUT, [$name="ssh", $idx=Idx, $val=Val, $destination=servers]);
|
||||
Input::force_update(A::INPUT);
|
||||
print servers;
|
||||
Input::remove_tablefilter(A::INPUT, "ssh");
|
||||
Input::remove_stream(A::INPUT);
|
||||
}
|
||||
|
||||
event Input::update_finished(id: Input::ID) {
|
||||
print servers;
|
||||
}
|
||||
|
|
|
@ -34,5 +34,9 @@ event bro_init()
|
|||
Input::create_stream(A::INPUT, [$source="input.log"]);
|
||||
Input::add_tablefilter(A::INPUT, [$name="input", $idx=Idx, $val=Val, $destination=servers, $want_record=F]);
|
||||
Input::force_update(A::INPUT);
|
||||
}
|
||||
|
||||
event Input::update_finished(id: Input::ID) {
|
||||
print servers;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,5 +34,9 @@ event bro_init()
|
|||
Input::create_stream(A::INPUT, [$source="input.log"]);
|
||||
Input::add_tablefilter(A::INPUT, [$name="input", $idx=Idx, $val=Val, $destination=servers]);
|
||||
Input::force_update(A::INPUT);
|
||||
}
|
||||
|
||||
event Input::update_finished(id: Input::ID) {
|
||||
print servers;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,3 +39,10 @@ event bro_init()
|
|||
Input::remove_tablefilter(A::INPUT, "input");
|
||||
Input::remove_stream(A::INPUT);
|
||||
}
|
||||
|
||||
event Input::update_finished(id: Input::ID) {
|
||||
print servers[1.2.3.4];
|
||||
print servers[1.2.3.5];
|
||||
print servers[1.2.3.6];
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,9 @@ event bro_init()
|
|||
$pred(typ: Input::Event, left: Idx, right: bool) = { return right; }
|
||||
]);
|
||||
Input::force_update(A::INPUT);
|
||||
}
|
||||
|
||||
event Input::update_finished(id: Input::ID) {
|
||||
if ( 1 in servers ) {
|
||||
print "VALID";
|
||||
}
|
||||
|
|
|
@ -35,6 +35,8 @@ type Val: record {
|
|||
global destination1: table[int] of Val = table();
|
||||
global destination2: table[int] of Val = table();
|
||||
|
||||
global done: bool = F;
|
||||
|
||||
event bro_init()
|
||||
{
|
||||
# first read in the old stuff into the table...
|
||||
|
@ -45,6 +47,15 @@ event bro_init()
|
|||
Input::add_tablefilter(A::INPUT, [$name="input2",$idx=Idx, $val=Val, $destination=destination2]);
|
||||
|
||||
Input::force_update(A::INPUT);
|
||||
}
|
||||
|
||||
event Input::update_finished(id: Input::ID) {
|
||||
if ( done == T ) {
|
||||
return;
|
||||
}
|
||||
|
||||
done = T;
|
||||
|
||||
if ( 1 in destination1 ) {
|
||||
print "VALID";
|
||||
}
|
||||
|
@ -90,6 +101,4 @@ event bro_init()
|
|||
if ( 7 in destination2 ) {
|
||||
print "VALID";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue