KRPC Protocol implementation.
More...
#include <krpc.h>
|
| static KrpcMessage | create_ping_query (const std::string &transaction_id, const NodeId &sender_id) |
| | Create KRPC messages.
|
| |
| static KrpcMessage | create_find_node_query (const std::string &transaction_id, const NodeId &sender_id, const NodeId &target_id) |
| |
| static KrpcMessage | create_get_peers_query (const std::string &transaction_id, const NodeId &sender_id, const InfoHash &info_hash) |
| |
| static KrpcMessage | create_announce_peer_query (const std::string &transaction_id, const NodeId &sender_id, const InfoHash &info_hash, uint16_t port, const std::string &token) |
| |
| static KrpcMessage | create_ping_response (const std::string &transaction_id, const NodeId &response_id) |
| |
| static KrpcMessage | create_find_node_response (const std::string &transaction_id, const NodeId &response_id, const std::vector< KrpcNode > &nodes) |
| |
| static KrpcMessage | create_get_peers_response (const std::string &transaction_id, const NodeId &response_id, const std::vector< Peer > &peers, const std::string &token) |
| |
| static KrpcMessage | create_get_peers_response_with_nodes (const std::string &transaction_id, const NodeId &response_id, const std::vector< KrpcNode > &nodes, const std::string &token) |
| |
| static KrpcMessage | create_announce_peer_response (const std::string &transaction_id, const NodeId &response_id) |
| |
| static KrpcMessage | create_error (const std::string &transaction_id, KrpcErrorCode error_code, const std::string &error_message) |
| |
| static std::vector< uint8_t > | encode_message (const KrpcMessage &message) |
| | Encode/decode KRPC messages.
|
| |
| static std::unique_ptr< KrpcMessage > | decode_message (const std::vector< uint8_t > &data) |
| |
| static std::string | generate_transaction_id () |
| | Generate transaction ID.
|
| |
| static std::string | node_id_to_string (const NodeId &id) |
| | Utility functions.
|
| |
| static NodeId | string_to_node_id (const std::string &str) |
| |
| static std::string | compact_peer_info (const Peer &peer) |
| |
| static std::string | compact_node_info (const KrpcNode &node) |
| |
| static std::vector< Peer > | parse_compact_peer_info (const std::string &compact_info) |
| |
| static std::vector< KrpcNode > | parse_compact_node_info (const std::string &compact_info) |
| |
KRPC Protocol implementation.
Definition at line 88 of file krpc.h.
◆ KrpcProtocol()
| librats::KrpcProtocol::KrpcProtocol |
( |
| ) |
|
◆ ~KrpcProtocol()
| librats::KrpcProtocol::~KrpcProtocol |
( |
| ) |
|
◆ compact_node_info()
| static std::string librats::KrpcProtocol::compact_node_info |
( |
const KrpcNode & |
node | ) |
|
|
static |
◆ compact_peer_info()
| static std::string librats::KrpcProtocol::compact_peer_info |
( |
const Peer & |
peer | ) |
|
|
static |
◆ create_announce_peer_query()
| static KrpcMessage librats::KrpcProtocol::create_announce_peer_query |
( |
const std::string & |
transaction_id, |
|
|
const NodeId & |
sender_id, |
|
|
const InfoHash & |
info_hash, |
|
|
uint16_t |
port, |
|
|
const std::string & |
token |
|
) |
| |
|
static |
◆ create_announce_peer_response()
| static KrpcMessage librats::KrpcProtocol::create_announce_peer_response |
( |
const std::string & |
transaction_id, |
|
|
const NodeId & |
response_id |
|
) |
| |
|
static |
◆ create_error()
| static KrpcMessage librats::KrpcProtocol::create_error |
( |
const std::string & |
transaction_id, |
|
|
KrpcErrorCode |
error_code, |
|
|
const std::string & |
error_message |
|
) |
| |
|
static |
◆ create_find_node_query()
| static KrpcMessage librats::KrpcProtocol::create_find_node_query |
( |
const std::string & |
transaction_id, |
|
|
const NodeId & |
sender_id, |
|
|
const NodeId & |
target_id |
|
) |
| |
|
static |
◆ create_find_node_response()
| static KrpcMessage librats::KrpcProtocol::create_find_node_response |
( |
const std::string & |
transaction_id, |
|
|
const NodeId & |
response_id, |
|
|
const std::vector< KrpcNode > & |
nodes |
|
) |
| |
|
static |
◆ create_get_peers_query()
| static KrpcMessage librats::KrpcProtocol::create_get_peers_query |
( |
const std::string & |
transaction_id, |
|
|
const NodeId & |
sender_id, |
|
|
const InfoHash & |
info_hash |
|
) |
| |
|
static |
◆ create_get_peers_response()
| static KrpcMessage librats::KrpcProtocol::create_get_peers_response |
( |
const std::string & |
transaction_id, |
|
|
const NodeId & |
response_id, |
|
|
const std::vector< Peer > & |
peers, |
|
|
const std::string & |
token |
|
) |
| |
|
static |
◆ create_get_peers_response_with_nodes()
| static KrpcMessage librats::KrpcProtocol::create_get_peers_response_with_nodes |
( |
const std::string & |
transaction_id, |
|
|
const NodeId & |
response_id, |
|
|
const std::vector< KrpcNode > & |
nodes, |
|
|
const std::string & |
token |
|
) |
| |
|
static |
◆ create_ping_query()
| static KrpcMessage librats::KrpcProtocol::create_ping_query |
( |
const std::string & |
transaction_id, |
|
|
const NodeId & |
sender_id |
|
) |
| |
|
static |
◆ create_ping_response()
| static KrpcMessage librats::KrpcProtocol::create_ping_response |
( |
const std::string & |
transaction_id, |
|
|
const NodeId & |
response_id |
|
) |
| |
|
static |
◆ decode_message()
| static std::unique_ptr< KrpcMessage > librats::KrpcProtocol::decode_message |
( |
const std::vector< uint8_t > & |
data | ) |
|
|
static |
◆ encode_message()
| static std::vector< uint8_t > librats::KrpcProtocol::encode_message |
( |
const KrpcMessage & |
message | ) |
|
|
static |
Encode/decode KRPC messages.
◆ generate_transaction_id()
| static std::string librats::KrpcProtocol::generate_transaction_id |
( |
| ) |
|
|
static |
◆ node_id_to_string()
| static std::string librats::KrpcProtocol::node_id_to_string |
( |
const NodeId & |
id | ) |
|
|
static |
◆ parse_compact_node_info()
| static std::vector< KrpcNode > librats::KrpcProtocol::parse_compact_node_info |
( |
const std::string & |
compact_info | ) |
|
|
static |
◆ parse_compact_peer_info()
| static std::vector< Peer > librats::KrpcProtocol::parse_compact_peer_info |
( |
const std::string & |
compact_info | ) |
|
|
static |
◆ string_to_node_id()
| static NodeId librats::KrpcProtocol::string_to_node_id |
( |
const std::string & |
str | ) |
|
|
static |
The documentation for this class was generated from the following file: