aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol/cryptonote_protocol_defs.h
diff options
context:
space:
mode:
authorThomas Winget <tewinget@gmail.com>2014-07-18 19:33:03 -0400
committerThomas Winget <tewinget@gmail.com>2014-07-18 19:33:03 -0400
commit9f88b7ce6bc9845e097a6d67f3d3c97110b819c1 (patch)
tree689d224568a6921f899bb592b7f6ed085f626445 /src/cryptonote_protocol/cryptonote_protocol_defs.h
parentMerge pull request #63 from mikezackles/bytecoin_for_merge (diff)
downloadmonero-9f88b7ce6bc9845e097a6d67f3d3c97110b819c1.tar.xz
Added get_connections RPC call to daemon
Diffstat (limited to 'src/cryptonote_protocol/cryptonote_protocol_defs.h')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_defs.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_defs.h b/src/cryptonote_protocol/cryptonote_protocol_defs.h
index d646a7f6f..eddb3b67b 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_defs.h
+++ b/src/cryptonote_protocol/cryptonote_protocol_defs.h
@@ -14,6 +14,41 @@ namespace cryptonote
#define BC_COMMANDS_POOL_BASE 2000
+ /************************************************************************/
+ /* P2P connection info, serializable to json */
+ /************************************************************************/
+ struct connection_info
+ {
+ bool incoming;
+
+ std::string ip;
+ std::string port;
+
+ std::string peer_id;
+
+ uint64_t recv_count;
+ time_t recv_idle_time;
+
+ uint64_t send_count;
+ time_t send_idle_time;
+
+ std::string state;
+
+ time_t live_time;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(incoming)
+ KV_SERIALIZE(ip)
+ KV_SERIALIZE(port)
+ KV_SERIALIZE(peer_id)
+ KV_SERIALIZE(recv_count)
+ KV_SERIALIZE(recv_idle_time)
+ KV_SERIALIZE(send_count)
+ KV_SERIALIZE(send_idle_time)
+ KV_SERIALIZE(state)
+ KV_SERIALIZE(live_time)
+ END_KV_SERIALIZE_MAP()
+ };
/************************************************************************/
/* */