Created
March 12, 2014 15:46
-
-
Save jsiwek/9509541 to your computer and use it in GitHub Desktop.
Example of exchanging events between Bro instances.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@load frameworks/communication/listen | |
redef Communication::listen_port = 1337/tcp; | |
redef Communication::nodes += { | |
["foo"] = [$host = 127.0.0.1, $events = /my_event_request/, $connect = F] | |
}; | |
event remote_connection_handshake_done(p: event_peer) | |
{ | |
print fmt("connection established to: %s", p); | |
} | |
global request_count: count = 0; | |
event my_event_response(details: count) | |
{ | |
print "sent my_event_response", details; | |
} | |
event my_event_request(details: string) | |
{ | |
print "recv my_event_request", details; | |
++request_count; | |
event my_event_response(request_count); | |
} | |
event remote_connection_closed(p: event_peer) | |
{ | |
print fmt("connection to peer closed: %s", p); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment