Bitcoin Core 28.99.0
P2P Digital Currency
|
Go to the source code of this file.
Classes | |
struct | MappingResult |
Successful response to a port mapping. More... | |
Typedefs | |
typedef std::array< uint8_t, PCP_MAP_NONCE_SIZE > | PCPMappingNonce |
PCP mapping nonce. Arbitrary data chosen by the client to identify a mapping. More... | |
Enumerations | |
enum class | MappingError { NETWORK_ERROR , PROTOCOL_ERROR , UNSUPP_VERSION , NO_RESOURCES } |
Unsuccessful response to a port mapping. More... | |
Functions | |
std::variant< MappingResult, MappingError > | NATPMPRequestPortMap (const CNetAddr &gateway, uint16_t port, uint32_t lifetime, int num_tries=3, std::chrono::milliseconds timeout_per_try=std::chrono::milliseconds(1000)) |
Try to open a port using RFC 6886 NAT-PMP. More... | |
std::variant< MappingResult, MappingError > | PCPRequestPortMap (const PCPMappingNonce &nonce, const CNetAddr &gateway, const CNetAddr &bind, uint16_t port, uint32_t lifetime, int num_tries=3, std::chrono::milliseconds timeout_per_try=std::chrono::milliseconds(1000)) |
Try to open a port using RFC 6887 Port Control Protocol (PCP). More... | |
Variables | |
constexpr size_t | PCP_MAP_NONCE_SIZE = 12 |
Mapping nonce size in bytes (see RFC6887 section 11.1). More... | |
typedef std::array<uint8_t, PCP_MAP_NONCE_SIZE> PCPMappingNonce |
|
strong |
Unsuccessful response to a port mapping.
std::variant< MappingResult, MappingError > NATPMPRequestPortMap | ( | const CNetAddr & | gateway, |
uint16_t | port, | ||
uint32_t | lifetime, | ||
int | num_tries = 3 , |
||
std::chrono::milliseconds | timeout_per_try = std::chrono::milliseconds(1000) |
||
) |
Try to open a port using RFC 6886 NAT-PMP.
IPv4 only.
Returns the external_ip:external_port of the mapping if successful, otherwise a MappingError.
Definition at line 274 of file pcp.cpp.
std::variant< MappingResult, MappingError > PCPRequestPortMap | ( | const PCPMappingNonce & | nonce, |
const CNetAddr & | gateway, | ||
const CNetAddr & | bind, | ||
uint16_t | port, | ||
uint32_t | lifetime, | ||
int | num_tries = 3 , |
||
std::chrono::milliseconds | timeout_per_try = std::chrono::milliseconds(1000) |
||
) |
Try to open a port using RFC 6887 Port Control Protocol (PCP).
Handles IPv4 and IPv6.
Returns the external_ip:external_port of the mapping if successful, otherwise a MappingError.
Definition at line 387 of file pcp.cpp.