|
Electroneum
|
#include <net_node.h>


Classes | |
| struct | by_addr |
| struct | by_conn_id |
| struct | by_peer_id |
| struct | config_t |
| struct | network_zone |
Public Types | |
| typedef t_payload_net_handler | payload_net_handler |
Public Member Functions | |
| node_server (t_payload_net_handler &payload_handler) | |
| virtual | ~node_server () |
| bool | run () |
| network_zone & | add_zone (epee::net_utils::zone zone) |
| bool | init (const boost::program_options::variables_map &vm) |
| bool | deinit () |
| bool | send_stop_signal () |
| uint32_t | get_this_peer_port () |
| t_payload_net_handler & | get_payload_object () |
| bool | log_peerlist () |
| bool | log_connections () |
| virtual uint64_t | get_public_connections_count () |
| size_t | get_public_outgoing_connections_count () |
| size_t | get_public_white_peers_count () |
| size_t | get_public_gray_peers_count () |
| void | get_public_peerlist (std::vector< peerlist_entry > &gray, std::vector< peerlist_entry > &white) |
| size_t | get_zone_count () const |
| void | change_max_out_public_peers (size_t count) |
| void | change_max_in_public_peers (size_t count) |
| virtual bool | block_host (const epee::net_utils::network_address &adress, time_t seconds=P2P_IP_BLOCKTIME) |
| virtual bool | unblock_host (const epee::net_utils::network_address &address) |
| virtual std::map< std::string, time_t > | get_blocked_hosts () |
| virtual void | add_used_stripe_peer (const typename t_payload_net_handler::connection_context &context) |
| virtual void | remove_used_stripe_peer (const typename t_payload_net_handler::connection_context &context) |
| virtual void | clear_used_stripe_peers () |
| void | set_save_graph (bool save_graph) |
| void | set_rpc_port (uint16_t rpc_port) |
Public Member Functions inherited from nodetool::i_p2p_endpoint< t_payload_net_handler::connection_context > | |
| virtual void | for_each_connection (std::function< bool(t_payload_net_handler::connection_context &, peerid_type, uint32_t)> f)=0 |
| virtual bool | for_connection (const boost::uuids::uuid &, std::function< bool(t_payload_net_handler::connection_context &, peerid_type, uint32_t)> f)=0 |
| virtual void | add_used_stripe_peer (const t_payload_net_handler::connection_context &context)=0 |
| virtual void | remove_used_stripe_peer (const t_payload_net_handler::connection_context &context)=0 |
Static Public Member Functions | |
| static void | init_options (boost::program_options::options_description &desc) |
Private Types | |
| enum | PeerType { anchor = 0 , white , gray } |
| typedef p2p_connection_context_t< typename t_payload_net_handler::connection_context > | p2p_connection_context |
| typedef COMMAND_HANDSHAKE_T< typename t_payload_net_handler::payload_type > | COMMAND_HANDSHAKE |
| typedef COMMAND_TIMED_SYNC_T< typename t_payload_net_handler::payload_type > | COMMAND_TIMED_SYNC |
| typedef epee::net_utils::boosted_tcp_server< epee::levin::async_protocol_handler< p2p_connection_context > > | net_server |
| using | connect_func = boost::optional< p2p_connection_context >(network_zone &, epee::net_utils::network_address const &, epee::net_utils::ssl_support_t) |
| typedef epee::misc_utils::struct_init< config_t > | config |
| typedef COMMAND_REQUEST_STAT_INFO_T< typename t_payload_net_handler::stat_info > | COMMAND_REQUEST_STAT_INFO |
Private Member Functions | |
| CHAIN_LEVIN_INVOKE_MAP2 (p2p_connection_context) | |
| CHAIN_LEVIN_NOTIFY_MAP2 (p2p_connection_context) | |
| if (is_filtered_command(context.m_remote_address, command)) return LEVIN_ERROR_CONNECTION_HANDLER_NOT_DEFINED | |
| int | handle_handshake (int command, typename COMMAND_HANDSHAKE::request &arg, typename COMMAND_HANDSHAKE::response &rsp, p2p_connection_context &context) |
| int | handle_timed_sync (int command, typename COMMAND_TIMED_SYNC::request &arg, typename COMMAND_TIMED_SYNC::response &rsp, p2p_connection_context &context) |
| int | handle_ping (int command, COMMAND_PING::request &arg, COMMAND_PING::response &rsp, p2p_connection_context &context) |
| int | handle_get_support_flags (int command, COMMAND_REQUEST_SUPPORT_FLAGS::request &arg, COMMAND_REQUEST_SUPPORT_FLAGS::response &rsp, p2p_connection_context &context) |
| bool | init_config () |
| bool | make_default_peer_id () |
| bool | make_default_config () |
| bool | store_config () |
| bool | check_trust (const proof_of_trust &tr, epee::net_utils::zone zone_type) |
| virtual void | on_connection_new (p2p_connection_context &context) |
| virtual void | on_connection_close (p2p_connection_context &context) |
| virtual void | callback (p2p_connection_context &context) |
| virtual bool | relay_notify_to_list (int command, const epee::span< const uint8_t > data_buff, std::vector< std::pair< epee::net_utils::zone, boost::uuids::uuid >> connections) |
| virtual bool | invoke_command_to_peer (int command, const epee::span< const uint8_t > req_buff, std::string &resp_buff, const epee::net_utils::connection_context_base &context) |
| virtual bool | invoke_notify_to_peer (int command, const epee::span< const uint8_t > req_buff, const epee::net_utils::connection_context_base &context) |
| virtual bool | drop_connection (const epee::net_utils::connection_context_base &context) |
| virtual void | request_callback (const epee::net_utils::connection_context_base &context) |
| virtual void | for_each_connection (std::function< bool(typename t_payload_net_handler::connection_context &, peerid_type, uint32_t)> f) |
| virtual bool | for_connection (const boost::uuids::uuid &, std::function< bool(typename t_payload_net_handler::connection_context &, peerid_type, uint32_t)> f) |
| virtual bool | add_host_fail (const epee::net_utils::network_address &address) |
| virtual bool | is_remote_host_allowed (const epee::net_utils::network_address &address) |
| bool | parse_peer_from_string (epee::net_utils::network_address &pe, const std::string &node_addr, uint16_t default_port=0) |
| bool | handle_command_line (const boost::program_options::variables_map &vm) |
| bool | idle_worker () |
| bool | handle_remote_peerlist (const std::vector< peerlist_entry > &peerlist, time_t local_time, const epee::net_utils::connection_context_base &context) |
| bool | get_local_node_data (basic_node_data &node_data, const network_zone &zone) |
| bool | merge_peerlist_with_local (const std::vector< peerlist_entry > &bs) |
| bool | fix_time_delta (std::vector< peerlist_entry > &local_peerlist, time_t local_time, int64_t &delta) |
| bool | connections_maker () |
| bool | peer_sync_idle_maker () |
| bool | do_handshake_with_peer (peerid_type &pi, p2p_connection_context &context, bool just_take_peerlist=false) |
| bool | do_peer_timed_sync (const epee::net_utils::connection_context_base &context, peerid_type peer_id) |
| bool | make_new_connection_from_anchor_peerlist (const std::vector< anchor_peerlist_entry > &anchor_peerlist) |
| bool | make_new_connection_from_peerlist (network_zone &zone, bool use_white_list) |
| bool | try_to_connect_and_handshake_with_new_peer (const epee::net_utils::network_address &na, bool just_take_peerlist=false, uint64_t last_seen_stamp=0, PeerType peer_type=white, uint64_t first_seen_stamp=0) |
| size_t | get_random_index_with_fixed_probability (size_t max_index) |
| bool | is_peer_used (const peerlist_entry &peer) |
| bool | is_peer_used (const anchor_peerlist_entry &peer) |
| bool | is_addr_connected (const epee::net_utils::network_address &peer) |
| void | add_upnp_port_mapping (uint32_t port) |
| void | delete_upnp_port_mapping (uint32_t port) |
| template<class t_callback > | |
| bool | try_ping (basic_node_data &node_data, p2p_connection_context &context, const t_callback &cb) |
| bool | try_get_support_flags (const p2p_connection_context &context, std::function< void(p2p_connection_context &, const uint32_t &)> f) |
| bool | make_expected_connections_count (network_zone &zone, PeerType peer_type, size_t expected_connections) |
| void | cache_connect_fail_info (const epee::net_utils::network_address &addr) |
| bool | is_addr_recently_failed (const epee::net_utils::network_address &addr) |
| bool | is_priority_node (const epee::net_utils::network_address &na) |
| std::set< std::string > | get_seed_nodes (cryptonote::network_type nettype) const |
| bool | connect_to_seed () |
| template<class Container > | |
| bool | connect_to_peerlist (const Container &peers) |
| template<class Container > | |
| bool | parse_peers_and_add_to_container (const boost::program_options::variables_map &vm, const command_line::arg_descriptor< std::vector< std::string > > &arg, Container &container) |
| bool | set_max_out_peers (network_zone &zone, int64_t max) |
| bool | set_max_in_peers (network_zone &zone, int64_t max) |
| bool | set_tos_flag (const boost::program_options::variables_map &vm, int limit) |
| bool | set_rate_up_limit (const boost::program_options::variables_map &vm, int64_t limit) |
| bool | set_rate_down_limit (const boost::program_options::variables_map &vm, int64_t limit) |
| bool | set_rate_limit (const boost::program_options::variables_map &vm, int64_t limit) |
| bool | has_too_many_connections (const epee::net_utils::network_address &address) |
| uint64_t | get_connections_count () |
| size_t | get_incoming_connections_count () |
| size_t | get_incoming_connections_count (network_zone &) |
| size_t | get_outgoing_connections_count () |
| size_t | get_outgoing_connections_count (network_zone &) |
| bool | check_connection_and_handshake_with_peer (const epee::net_utils::network_address &na, uint64_t last_seen_stamp) |
| bool | gray_peerlist_housekeeping () |
| bool | check_incoming_connections () |
| void | kill () |
| std::string | print_connections_container () |
Static Private Member Functions | |
| static boost::optional< p2p_connection_context > | public_connect (network_zone &, epee::net_utils::network_address const &, epee::net_utils::ssl_support_t) |
| static boost::optional< p2p_connection_context > | socks_connect (network_zone &, epee::net_utils::network_address const &, epee::net_utils::ssl_support_t) |
Private Attributes | |
| const std::vector< std::string > | m_seed_nodes_list |
| bool | islimitup =false |
| bool | islimitdown =false |
| std::string | m_config_folder |
| bool | m_have_address |
| bool | m_first_connection_maker_call |
| uint32_t | m_listening_port |
| uint32_t | m_external_port |
| uint16_t | m_rpc_port |
| bool | m_allow_local_ip |
| bool | m_hide_my_port |
| bool | m_no_igd |
| bool | m_offline |
| std::atomic< bool > | m_save_graph |
| std::atomic< bool > | is_closing |
| std::unique_ptr< boost::thread > | mPeersLoggerThread |
| t_payload_net_handler & | m_payload_handler |
| peerlist_storage | m_peerlist_storage |
| epee::math_helper::once_a_time_seconds< P2P_DEFAULT_HANDSHAKE_INTERVAL > | m_peer_handshake_idle_maker_interval |
| epee::math_helper::once_a_time_seconds< 1 > | m_connections_maker_interval |
| epee::math_helper::once_a_time_seconds< 60 *30, false > | m_peerlist_store_interval |
| epee::math_helper::once_a_time_seconds< 60 > | m_gray_peerlist_housekeeping_interval |
| epee::math_helper::once_a_time_seconds< 3600, false > | m_incoming_connections_interval |
| std::list< epee::net_utils::network_address > | m_priority_peers |
| std::vector< epee::net_utils::network_address > | m_exclusive_peers |
| std::vector< epee::net_utils::network_address > | m_seed_nodes |
| bool | m_fallback_seed_nodes_added |
| std::vector< nodetool::peerlist_entry > | m_command_line_peers |
| uint64_t | m_peer_livetime |
| std::map< epee::net_utils::zone, network_zone > | m_network_zones |
| std::map< epee::net_utils::network_address, time_t > | m_conn_fails_cache |
| epee::critical_section | m_conn_fails_cache_lock |
| epee::critical_section | m_blocked_hosts_lock |
| std::map< std::string, time_t > | m_blocked_hosts |
| epee::critical_section | m_host_fails_score_lock |
| std::map< std::string, uint64_t > | m_host_fails_score |
| boost::mutex | m_used_stripe_peers_mutex |
| std::array< std::list< epee::net_utils::network_address >, 1<< CRYPTONOTE_PRUNING_LOG_STRIPES > | m_used_stripe_peers |
| boost::uuids::uuid | m_network_id |
| cryptonote::network_type | m_nettype |
| epee::net_utils::ssl_support_t | m_ssl_support |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| typedef t_payload_net_handler nodetool::node_server< t_payload_net_handler >::payload_net_handler |
|
private |
|
inline |
|
virtual |
|
privatevirtual |
|
private |
|
virtual |
| node_server< t_payload_net_handler >::network_zone & nodetool::node_server< t_payload_net_handler >::add_zone | ( | epee::net_utils::zone | zone | ) |
|
virtual |
|
private |
|
privatevirtual |
|
private |
|
private |
| void nodetool::node_server< t_payload_net_handler >::change_max_in_public_peers | ( | size_t | count | ) |
| void nodetool::node_server< t_payload_net_handler >::change_max_out_public_peers | ( | size_t | count | ) |
|
private |
|
private |
|
private |
|
virtual |
|
private |
|
private |
|
private |
| bool nodetool::node_server< t_payload_net_handler >::deinit |
|
private |
|
private |
|
private |
|
privatevirtual |
|
private |
|
privatevirtual |
|
privatevirtual |
|
inlinevirtual |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| node_server< t_payload_net_handler >::payload_net_handler & nodetool::node_server< t_payload_net_handler >::get_payload_object |
|
virtual |
| size_t nodetool::node_server< t_payload_net_handler >::get_public_gray_peers_count |
| size_t nodetool::node_server< t_payload_net_handler >::get_public_outgoing_connections_count |
| void nodetool::node_server< t_payload_net_handler >::get_public_peerlist | ( | std::vector< peerlist_entry > & | gray, |
| std::vector< peerlist_entry > & | white | ||
| ) |
| size_t nodetool::node_server< t_payload_net_handler >::get_public_white_peers_count |
|
private |
|
private |
|
inline |
|
inlinevirtual |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| bool nodetool::node_server< t_payload_net_handler >::init | ( | const boost::program_options::variables_map & | vm | ) |
|
private |
|
static |
|
privatevirtual |
|
privatevirtual |
|
private |
|
private |
|
private |
|
private |
|
private |
|
privatevirtual |
|
inlineprivate |
< will be called e.g. from deinit()
| bool nodetool::node_server< t_payload_net_handler >::log_connections |
| bool nodetool::node_server< t_payload_net_handler >::log_peerlist |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
privatevirtual |
|
privatevirtual |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
privatevirtual |
|
virtual |
|
privatevirtual |
| bool nodetool::node_server< t_payload_net_handler >::run |
| bool nodetool::node_server< t_payload_net_handler >::send_stop_signal |
|
private |
|
private |
|
private |
|
private |
|
private |
|
inline |
|
inline |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
virtual |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |