From e4052aba3d38b4705598c509243a8773b0cf5e28 Mon Sep 17 00:00:00 2001 From: Seth Hall Date: Thu, 7 Jul 2011 15:15:53 -0400 Subject: [PATCH] Adding a peer name to the communication logs. --- policy/frameworks/communication/base.bro | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/policy/frameworks/communication/base.bro b/policy/frameworks/communication/base.bro index 5ab469ca8e..7c89ed5174 100644 --- a/policy/frameworks/communication/base.bro +++ b/policy/frameworks/communication/base.bro @@ -19,7 +19,7 @@ export { ts: time &log; level: string &log &optional; src_name: string &log &optional; - remote_node: string &log &optional; + peer: string &log &optional; msg: string &log; }; @@ -114,6 +114,7 @@ function do_script_log_common(level: count, src: count, msg: string) Log::write(COMMUNICATION, [$ts = network_time(), $level = (level == REMOTE_LOG_INFO ? "info" : "error"), $src_name = src_names[src], + $peer = get_event_peer()$descr, $msg = msg]); } @@ -142,7 +143,7 @@ function connect_peer(peer: string) if ( id == PEER_ID_NONE ) Log::write(COMMUNICATION, [$ts = network_time(), - $remote_node = fmt("%s:%d", node$host, p), + $peer = get_event_peer()$descr, $msg = "can't trigger connect"]); pending_peers[id] = node; } @@ -269,7 +270,8 @@ event remote_state_inconsistency(operation: string, id: string, local msg = fmt("state inconsistency: %s should be %s but is %s before %s", id, expected_old, real_old, operation); - Log::write(COMMUNICATION, [$ts = network_time(), + Log::write(COMMUNICATION, [$ts = network_time(), + $peer = get_event_peer()$descr, $msg = msg]); }