5 #ifndef BITCOIN_NETBASE_H
6 #define BITCOIN_NETBASE_H
8 #if defined(HAVE_CONFIG_H)
9 #include "config/bitcoin-config.h"
24 static const int DEFAULT_CONNECT_TIMEOUT = 5000;
26 static const int DEFAULT_NAME_LOOKUP =
true;
42 void SplitHostPort(std::string in,
int &portOut, std::string &hostOut);
48 bool LookupHost(
const char *pszName, std::vector<CNetAddr>& vIP,
unsigned int nMaxSolutions,
bool fAllowLookup);
50 bool Lookup(
const char *pszName,
CService& addr,
int portDefault,
bool fAllowLookup);
51 bool Lookup(
const char *pszName, std::vector<CService>& vAddr,
int portDefault,
bool fAllowLookup,
unsigned int nMaxSolutions);
IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96))
A combination of a network address (CNetAddr) and a (TCP) port.
bool randomize_credentials
proxyType(const CService &_proxy, bool _randomize_credentials=false)
struct timeval MillisToTimeval(int64_t nTimeout)
Convert milliseconds to a struct timeval for e.g.
void SplitHostPort(std::string in, int &portOut, std::string &hostOut)
enum Network ParseNetwork(std::string net)
CService LookupNumeric(const char *pszName, int portDefault=0)
std::string GetNetworkName(enum Network net)
bool LookupHost(const char *pszName, std::vector< CNetAddr > &vIP, unsigned int nMaxSolutions, bool fAllowLookup)
bool GetProxy(enum Network net, proxyType &proxyInfoOut)
bool ConnectSocketByName(CService &addr, SOCKET &hSocketRet, const char *pszDest, int portDefault, int nTimeout, bool *outProxyConnectionFailed=0)
bool SetSocketNonBlocking(SOCKET &hSocket, bool fNonBlocking)
Disable or enable blocking-mode for a socket.
bool LookupSubNet(const char *pszName, CSubNet &subnet)
bool ConnectSocket(const CService &addr, SOCKET &hSocketRet, int nTimeout, bool *outProxyConnectionFailed=0)
void InterruptSocks5(bool interrupt)
std::string NetworkErrorString(int err)
Return readable error string for a network error code.
bool Lookup(const char *pszName, CService &addr, int portDefault, bool fAllowLookup)
bool SetNameProxy(const proxyType &addrProxy)
bool CloseSocket(SOCKET &hSocket)
Close socket and set hSocket to INVALID_SOCKET.
bool IsProxy(const CNetAddr &addr)
bool SetProxy(enum Network net, const proxyType &addrProxy)