diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-11-26 00:04:22 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-11-26 00:04:22 +0000 |
commit | 38ceb73848a3c37df60bce637d855b7564b09730 (patch) | |
tree | ed35b91ab9e9b6a90e612cfe1ad42d54ce1d5321 /src/p2p/net_node_common.h | |
parent | net_node: allow bans for custom amounts of time (diff) | |
download | monero-38ceb73848a3c37df60bce637d855b7564b09730.tar.xz |
add RPC calls and commands to get/set bans
Diffstat (limited to '')
-rw-r--r-- | src/p2p/net_node_common.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/p2p/net_node_common.h b/src/p2p/net_node_common.h index 93b29deb2..2505006ad 100644 --- a/src/p2p/net_node_common.h +++ b/src/p2p/net_node_common.h @@ -50,7 +50,9 @@ namespace nodetool virtual void request_callback(const epee::net_utils::connection_context_base& context)=0; virtual uint64_t get_connections_count()=0; virtual void for_each_connection(std::function<bool(t_connection_context&, peerid_type)> f)=0; - virtual bool block_ip(uint32_t adress)=0; + virtual bool block_ip(uint32_t adress, time_t seconds = 0)=0; + virtual bool unblock_ip(uint32_t adress)=0; + virtual std::map<uint32_t, time_t> get_blocked_ips()const=0; virtual bool add_ip_fail(uint32_t adress)=0; }; @@ -86,10 +88,18 @@ namespace nodetool { return false; } - virtual bool block_ip(uint32_t adress) + virtual bool block_ip(uint32_t adress, time_t seconds) { return true; } + virtual bool unblock_ip(uint32_t adress) + { + return true; + } + virtual std::map<uint32_t, time_t> get_blocked_ips() const + { + return std::map<uint32_t, time_t>(); + } virtual bool add_ip_fail(uint32_t adress) { return true; |