| Version: | 2.0.5 |
|---|
Table of contents
Declared in "libtorrent/peer_class.hpp"
holds settings for a peer class. Used in set_peer_class() and get_peer_class() calls.
struct peer_class_info
{
bool ignore_unchoke_slots;
int connection_limit_factor;
std::string label;
int upload_limit;
int download_limit;
int upload_priority;
int download_priority;
};
[report issue]Declared in "libtorrent/peer_class_type_filter.hpp"
peer_class_type_filter is a simple container for rules for adding and subtracting peer-classes from peers. It is applied after the peer class filter is applied (which is based on the peer's IP address).
struct peer_class_type_filter
{
void remove (socket_type_t const st, peer_class_t const peer_class);
void add (socket_type_t const st, peer_class_t const peer_class);
void disallow (socket_type_t const st, peer_class_t const peer_class);
void allow (socket_type_t const st, peer_class_t const peer_class);
std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask);
friend bool operator== (peer_class_type_filter const& lhs
, peer_class_type_filter const& rhs);
enum socket_type_t
{
tcp_socket,
utp_socket,
ssl_tcp_socket,
ssl_utp_socket,
i2p_socket,
num_socket_types,
};
};
[report issue]void remove (socket_type_t const st, peer_class_t const peer_class); void add (socket_type_t const st, peer_class_t const peer_class);
add() and remove() adds and removes a peer class to be added to new peers based on socket type.
[report issue]void disallow (socket_type_t const st, peer_class_t const peer_class); void allow (socket_type_t const st, peer_class_t const peer_class);
disallow() and allow() adds and removes a peer class to be removed from new peers based on socket type.
The peer_class argument cannot be greater than 31. The bitmasks representing peer classes in the peer_class_type_filter are 32 bits.
[report issue]std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask);
takes a bitmask of peer classes and returns a new bitmask of peer classes after the rules have been applied, based on the socket type argument (st).
[report issue]Declared in "libtorrent/peer_class_type_filter.hpp"
| name | value | description |
|---|---|---|
| tcp_socket | 0 | these match the socket types from socket_type.hpp shifted one down |
| utp_socket | 1 | |
| ssl_tcp_socket | 2 | |
| ssl_utp_socket | 3 | |
| i2p_socket | 4 | |
| num_socket_types | 5 |