aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol/cryptonote_protocol_defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cryptonote_protocol/cryptonote_protocol_defs.h')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_defs.h67
1 files changed, 64 insertions, 3 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_defs.h b/src/cryptonote_protocol/cryptonote_protocol_defs.h
index d646a7f6f..66fa43dd2 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_defs.h
+++ b/src/cryptonote_protocol/cryptonote_protocol_defs.h
@@ -1,6 +1,32 @@
-// Copyright (c) 2012-2013 The Cryptonote developers
-// Distributed under the MIT/X11 software license, see the accompanying
-// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+// Copyright (c) 2014, The Monero Project
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are
+// permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this list of
+// conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice, this list
+// of conditions and the following disclaimer in the documentation and/or other
+// materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its contributors may be
+// used to endorse or promote products derived from this software without specific
+// prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
#pragma once
@@ -14,6 +40,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;
+ uint64_t recv_idle_time;
+
+ uint64_t send_count;
+ uint64_t send_idle_time;
+
+ std::string state;
+
+ uint64_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()
+ };
/************************************************************************/
/* */