Bitcoin Core 28.99.0
P2P Digital Currency
|
#include <common/pcp.h>
#include <common/netif.h>
#include <crypto/common.h>
#include <logging.h>
#include <netaddress.h>
#include <netbase.h>
#include <random.h>
#include <span.h>
#include <util/check.h>
#include <util/readwritefile.h>
#include <util/sock.h>
#include <util/strencodings.h>
Go to the source code of this file.
Functions | |
std::variant< MappingResult, MappingError > | NATPMPRequestPortMap (const CNetAddr &gateway, uint16_t port, uint32_t lifetime, int num_tries, std::chrono::milliseconds timeout_per_try) |
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, std::chrono::milliseconds timeout_per_try) |
Try to open a port using RFC 6887 Port Control Protocol (PCP). More... | |
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.