2014 network limit 1.0a +utils +toc -doc -drmonero

commands and options for network limiting
works very well e.g. for 50 KiB/sec up and down
ToS (QoS) flag
peer number limit
TODO some spikes in ingress/download
TODO problems when other up and down limit
added "otshell utils" - simple logging (with colors, text files channels)
This commit is contained in:
rfree2monero
2015-01-05 20:30:17 +01:00
parent e728992803
commit eabb519605
40 changed files with 4016 additions and 206 deletions
+22 -9
View File
@@ -80,14 +80,12 @@ namespace nodetool
public:
typedef t_payload_net_handler payload_net_handler;
node_server(
t_payload_net_handler& payload_handler
, boost::uuids::uuid network_id
)
: m_payload_handler(payload_handler)
, m_allow_local_ip(false)
, m_hide_my_port(false)
, m_network_id(std::move(network_id))
node_server(t_payload_net_handler& payload_handler, boost::uuids::uuid network_id)
:m_payload_handler(payload_handler),
m_allow_local_ip(false),
m_no_igd(false),
m_hide_my_port(false),
m_network_id(std::move(network_id))
{}
static void init_options(boost::program_options::options_description& desc);
@@ -111,6 +109,7 @@ namespace nodetool
virtual uint64_t get_connections_count();
size_t get_outgoing_connections_count();
peerlist_manager& get_peerlist_manager(){return m_peerlist;}
void delete_connections(size_t count);
private:
const std::vector<std::string> m_seed_nodes_list =
{ "seeds.moneroseeds.se"
@@ -118,6 +117,9 @@ namespace nodetool
, "seeds.moneroseeds.ch"
, "seeds.moneroseeds.li"
};
bool islimitup=false;
bool islimitdown=false;
typedef COMMAND_REQUEST_STAT_INFO_T<typename t_payload_net_handler::stat_info> COMMAND_REQUEST_STAT_INFO;
@@ -197,6 +199,13 @@ namespace nodetool
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(const boost::program_options::variables_map& vm, 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, uint64_t limit);
//debug functions
std::string print_connections_container();
@@ -214,7 +223,10 @@ namespace nodetool
END_KV_SERIALIZE_MAP()
};
config m_config;
public:
config m_config; // TODO was private, add getters?
private:
std::string m_config_folder;
bool m_have_address;
@@ -224,6 +236,7 @@ namespace nodetool
uint32_t m_ip_address;
bool m_allow_local_ip;
bool m_hide_my_port;
bool m_no_igd;
//critical_section m_connections_lock;
//connections_indexed_container m_connections;