Skip to content

Instantly share code, notes, and snippets.

@jsiwek
Created March 12, 2014 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsiwek/9509511 to your computer and use it in GitHub Desktop.
Save jsiwek/9509511 to your computer and use it in GitHub Desktop.
Example of exchanging events between Bro instances.
redef Communication::nodes += {
["foo"] = [$host = 127.0.0.1, $p=1337/tcp, $events = /my_event_response/, $connect=T]
};
event my_event_request(details: string)
{
print "sent my_event_request", details;
}
event my_event_response(details: count)
{
print "recv my_event_response", details;
print "terminating";
terminate();
}
event remote_connection_handshake_done(p: event_peer)
{
print fmt("connection established to: %s", p);
event my_event_request("hello");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment