diff options
author | luigi1111 <luigi1111w@gmail.com> | 2019-07-24 14:25:51 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2019-07-24 14:25:51 -0500 |
commit | 8774555d29a3594d430d1bc7c744ca904f38b389 (patch) | |
tree | 636bea13e50cce0cea15235882b6b2c7138b2a9d /src/daemon/rpc_command_executor.cpp | |
parent | Merge pull request #5594 (diff) | |
parent | daemon: display peer address type in print_cn (diff) | |
download | monero-8774555d29a3594d430d1bc7c744ca904f38b389.tar.xz |
Merge pull request #5595
2aa1134 daemon: display peer address type in print_cn (moneromooo-monero)
Diffstat (limited to 'src/daemon/rpc_command_executor.cpp')
-rw-r--r-- | src/daemon/rpc_command_executor.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index f3b9ea6ec..ea986a398 100644 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -46,6 +46,19 @@ namespace daemonize { namespace { + const char *get_address_type_name(epee::net_utils::address_type address_type) + { + switch (address_type) + { + default: + case epee::net_utils::address_type::invalid: return "invalid"; + case epee::net_utils::address_type::ipv4: return "IPv4"; + case epee::net_utils::address_type::ipv6: return "IPv6"; + case epee::net_utils::address_type::i2p: return "I2P"; + case epee::net_utils::address_type::tor: return "Tor"; + } + } + void print_peer(std::string const & prefix, cryptonote::peer const & peer) { time_t now; @@ -590,6 +603,7 @@ bool t_rpc_command_executor::print_connections() { } tools::msg_writer() << std::setw(30) << std::left << "Remote Host" + << std::setw(8) << "Type" << std::setw(6) << "SSL" << std::setw(20) << "Peer id" << std::setw(20) << "Support Flags" @@ -610,6 +624,7 @@ bool t_rpc_command_executor::print_connections() { tools::msg_writer() //<< std::setw(30) << std::left << in_out << std::setw(30) << std::left << address + << std::setw(8) << (get_address_type_name((epee::net_utils::address_type)info.address_type)) << std::setw(6) << (info.ssl ? "yes" : "no") << std::setw(20) << epee::string_tools::pad_string(info.peer_id, 16, '0', true) << std::setw(20) << info.support_flags |