#include <routing_table.hpp>
Public Types | |
| typedef aux::routing_table_iterator | iterator |
| typedef iterator | const_iterator |
| typedef std::set < udp::endpoint > ::const_iterator | router_iterator |
Public Member Functions | |
| routing_table (node_id const &id, int bucket_size, dht_settings const &settings) | |
| void | node_failed (node_id const &id) |
| void | add_router_node (udp::endpoint router) |
| router_iterator | router_begin () const |
| router_iterator | router_end () const |
| bool | node_seen (node_id const &id, udp::endpoint addr) |
| boost::posix_time::ptime | next_refresh (int bucket) |
| void | find_node (node_id const &id, std::vector< node_entry > &l, bool include_self, int count=0) |
| bool | need_node (node_id const &id) |
| void | touch_bucket (int bucket) |
| int | bucket_size (int bucket) |
| int | bucket_size () const |
| iterator | begin () const |
| iterator | end () const |
| boost::tuple< int, int > | size () const |
| bool | need_bootstrap () const |
| void | replacement_cache (bucket_t &nodes) const |
| void | print_state (std::ostream &os) const |
Private Types | |
| typedef boost::array < std::pair< bucket_t, bucket_t >, 160 > | table_t |
| typedef boost::array < boost::posix_time::ptime, 160 > | table_activity_t |
Private Attributes | |
| int | m_bucket_size |
| dht_settings const & | m_settings |
| table_t | m_buckets |
| table_activity_t | m_bucket_activity |
| node_id | m_id |
| std::set< udp::endpoint > | m_router_nodes |
| int | m_lowest_active_bucket |
Definition at line 150 of file routing_table.hpp.
Definition at line 153 of file routing_table.hpp.
Definition at line 154 of file routing_table.hpp.
| typedef std::set<udp::endpoint>::const_iterator libtorrent::dht::routing_table::router_iterator |
Definition at line 166 of file routing_table.hpp.
typedef boost::array<std::pair<bucket_t, bucket_t>, 160> libtorrent::dht::routing_table::table_t [private] |
Definition at line 226 of file routing_table.hpp.
typedef boost::array<boost::posix_time::ptime, 160> libtorrent::dht::routing_table::table_activity_t [private] |
Definition at line 229 of file routing_table.hpp.
| libtorrent::dht::routing_table::routing_table | ( | node_id const & | id, | |
| int | bucket_size, | |||
| dht_settings const & | settings | |||
| ) |
| void libtorrent::dht::routing_table::node_failed | ( | node_id const & | id | ) |
Definition at line 164 of file routing_table.cpp.
References b, asio::detail::socket_ops::bind(), libtorrent::dht::distance_exp(), libtorrent::dht::node_entry::id, asio::placeholders::iterator, m_buckets, m_id, m_lowest_active_bucket, m_settings, and libtorrent::dht_settings::max_fail_count.
Referenced by libtorrent::dht::traversal_algorithm::failed().
| void libtorrent::dht::routing_table::add_router_node | ( | udp::endpoint | router | ) |
Definition at line 202 of file routing_table.cpp.
References m_router_nodes.
Referenced by libtorrent::dht::node_impl::add_router_node().
| router_iterator libtorrent::dht::routing_table::router_begin | ( | ) | const [inline] |
Definition at line 167 of file routing_table.hpp.
References m_router_nodes.
Referenced by libtorrent::dht::traversal_algorithm::traversal_algorithm().
| router_iterator libtorrent::dht::routing_table::router_end | ( | ) | const [inline] |
Definition at line 168 of file routing_table.hpp.
References m_router_nodes.
Referenced by libtorrent::dht::traversal_algorithm::traversal_algorithm().
| bool libtorrent::dht::routing_table::node_seen | ( | node_id const & | id, | |
| udp::endpoint | addr | |||
| ) |
Definition at line 207 of file routing_table.cpp.
References b, asio::detail::socket_ops::bind(), libtorrent::dht::distance_exp(), libtorrent::dht::node_entry::fail_count, libtorrent::dht::node_entry::id, asio::placeholders::iterator, m_bucket_activity, m_bucket_size, m_buckets, m_id, m_lowest_active_bucket, m_router_nodes, and need_bootstrap().
Referenced by libtorrent::dht::rpc_manager::incoming(), and libtorrent::dht::node_impl::on_announce().
| boost::posix_time::ptime libtorrent::dht::routing_table::next_refresh | ( | int | bucket | ) |
Definition at line 120 of file routing_table.cpp.
References m_bucket_activity.
Referenced by libtorrent::dht::node_impl::refresh_timeout().
| void libtorrent::dht::routing_table::find_node | ( | node_id const & | id, | |
| std::vector< node_entry > & | l, | |||
| bool | include_self, | |||
| int | count = 0 | |||
| ) |
Definition at line 307 of file routing_table.cpp.
References b, asio::detail::socket_ops::bind(), libtorrent::dht::distance(), libtorrent::dht::distance_exp(), libtorrent::dht::node_entry::fail_count, m_bucket_size, m_buckets, and m_id.
Referenced by libtorrent::dht::node_impl::incoming_request(), libtorrent::dht::node_impl::refresh(), and libtorrent::dht::node_impl::refresh_bucket().
Definition at line 141 of file routing_table.cpp.
References b, asio::detail::socket_ops::bind(), libtorrent::dht::distance_exp(), libtorrent::dht::node_entry::id, m_bucket_size, m_buckets, and m_id.
Referenced by libtorrent::dht::node_impl::incoming_request().
| void libtorrent::dht::routing_table::touch_bucket | ( | int | bucket | ) |
Definition at line 115 of file routing_table.cpp.
References m_bucket_activity.
Referenced by libtorrent::dht::node_impl::refresh_bucket().
| int libtorrent::dht::routing_table::bucket_size | ( | int | bucket | ) | [inline] |
Definition at line 196 of file routing_table.hpp.
References m_buckets.
Referenced by libtorrent::dht::node_impl::announce(), libtorrent::dht::node_impl::bootstrap(), libtorrent::dht::node_impl::bucket_size(), libtorrent::dht::closest_nodes::done(), libtorrent::dht::node_impl::refresh(), and libtorrent::dht::node_impl::refresh_bucket().
| int libtorrent::dht::routing_table::bucket_size | ( | ) | const [inline] |
| routing_table::iterator libtorrent::dht::routing_table::begin | ( | ) | const |
Definition at line 388 of file routing_table.cpp.
References m_buckets.
Referenced by libtorrent::dht::node_impl::begin(), libtorrent::dht::node_impl::bootstrap(), need_bootstrap(), libtorrent::dht::node_impl::refresh(), and libtorrent::dht::node_impl::refresh_bucket().
| routing_table::iterator libtorrent::dht::routing_table::end | ( | ) | const |
Definition at line 393 of file routing_table.cpp.
References m_buckets.
Referenced by libtorrent::dht::node_impl::end(), need_bootstrap(), print_state(), libtorrent::dht::node_impl::refresh(), replacement_cache(), and size().
| boost::tuple< int, int > libtorrent::dht::routing_table::size | ( | ) | const |
Definition at line 50 of file routing_table.cpp.
References end(), m_buckets, and nodes().
Referenced by libtorrent::dht::node_impl::refresh(), and libtorrent::dht::node_impl::size().
| bool libtorrent::dht::routing_table::need_bootstrap | ( | ) | const |
Definition at line 298 of file routing_table.cpp.
References begin(), and end().
Referenced by node_seen().
| void libtorrent::dht::routing_table::replacement_cache | ( | bucket_t & | nodes | ) | const |
Definition at line 131 of file routing_table.cpp.
References end(), and m_buckets.
Referenced by libtorrent::dht::node_impl::replacement_cache().
| void libtorrent::dht::routing_table::print_state | ( | std::ostream & | os | ) | const |
Definition at line 63 of file routing_table.cpp.
References end(), m_bucket_activity, m_bucket_size, m_buckets, m_id, and m_lowest_active_bucket.
Referenced by libtorrent::dht::node_impl::print_state().
int libtorrent::dht::routing_table::m_bucket_size [private] |
Definition at line 221 of file routing_table.hpp.
Referenced by bucket_size(), find_node(), need_node(), node_seen(), and print_state().
dht_settings const& libtorrent::dht::routing_table::m_settings [private] |
Definition at line 227 of file routing_table.hpp.
Referenced by begin(), bucket_size(), end(), find_node(), need_node(), node_failed(), node_seen(), print_state(), replacement_cache(), and size().
Definition at line 230 of file routing_table.hpp.
Referenced by next_refresh(), node_seen(), print_state(), routing_table(), and touch_bucket().
node_id libtorrent::dht::routing_table::m_id [private] |
Definition at line 231 of file routing_table.hpp.
Referenced by find_node(), need_node(), node_failed(), node_seen(), and print_state().
std::set<udp::endpoint> libtorrent::dht::routing_table::m_router_nodes [private] |
Definition at line 237 of file routing_table.hpp.
Referenced by add_router_node(), node_seen(), router_begin(), and router_end().
int libtorrent::dht::routing_table::m_lowest_active_bucket [private] |
Definition at line 240 of file routing_table.hpp.
Referenced by node_failed(), node_seen(), and print_state().
1.5.6