5 #ifndef BITCOIN_NETBASE_H 6 #define BITCOIN_NETBASE_H 8 #if defined(HAVE_CONFIG_H) 9 #include <config/bitcoin-config.h> 32 bool _randomize_credentials =
false)
49 bool LookupHost(
const std::string &
name, std::vector<CNetAddr> &vIP,
50 unsigned int nMaxSolutions,
bool fAllowLookup);
54 bool Lookup(
const std::string &
name, std::vector<CService> &vAddr,
55 int portDefault,
bool fAllowLookup,
unsigned int nMaxSolutions);
60 const SOCKET &hSocketRet,
int nTimeout,
61 bool manual_connection);
63 int port,
const SOCKET &hSocketRet,
int nTimeout,
64 bool &outProxyConnectionFailed);
79 #endif // BITCOIN_NETBASE_H bool CloseSocket(SOCKET &hSocket)
Close socket and set hSocket to INVALID_SOCKET.
bool SetProxy(enum Network net, const proxyType &addrProxy)
bool SetSocketNonBlocking(const SOCKET &hSocket, bool fNonBlocking)
Disable or enable blocking-mode for a socket.
bool SetSocketNoDelay(const SOCKET &hSocket)
Set the TCP_NODELAY flag on a socket.
bool LookupHost(const std::string &name, std::vector< CNetAddr > &vIP, unsigned int nMaxSolutions, bool fAllowLookup)
Resolve a host string to its corresponding network addresses.
bool LookupSubNet(const std::string &strSubnet, CSubNet &subnet)
Parse and resolve a specified subnet string into the appropriate internal representation.
proxyType(const CService &_proxy, bool _randomize_credentials=false)
bool ConnectSocketDirectly(const CService &addrConnect, const SOCKET &hSocketRet, int nTimeout, bool manual_connection)
Try to connect to the specified service on the specified socket.
void InterruptSocks5(bool interrupt)
struct timeval MillisToTimeval(int64_t nTimeout)
Convert milliseconds to a struct timeval for e.g.
enum Network ParseNetwork(const std::string &net)
bool IsProxy(const CNetAddr &addr)
bool ConnectThroughProxy(const proxyType &proxy, const std::string &strDest, int port, const SOCKET &hSocketRet, int nTimeout, bool &outProxyConnectionFailed)
Connect to a specified destination service through a SOCKS5 proxy by first connecting to the SOCKS5 p...
bool randomize_credentials
A combination of a network address (CNetAddr) and a (TCP) port.
bool SetNameProxy(const proxyType &addrProxy)
Set the name proxy to use for all connections to nodes specified by a hostname.
static const int DEFAULT_NAME_LOOKUP
-dns default
CService LookupNumeric(const std::string &name, int portDefault=0)
Resolve a service string with a numeric IP to its first corresponding service.
IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96))
static const int DEFAULT_CONNECT_TIMEOUT
-timeout default
std::string GetNetworkName(enum Network net)
SOCKET CreateSocket(const CService &addrConnect)
Try to create a socket file descriptor with specific properties in the communications domain (address...
std::string NetworkErrorString(int err)
Return readable error string for a network error code.
bool GetProxy(enum Network net, proxyType &proxyInfoOut)
bool Lookup(const std::string &name, CService &addr, int portDefault, bool fAllowLookup)
Resolve a service string to its first corresponding service.
bool GetNameProxy(proxyType &nameProxyOut)