Changeset View
Changeset View
Standalone View
Standalone View
src/netbase.h
Show All 38 Lines | |||||
enum Network ParseNetwork(std::string net); | enum Network ParseNetwork(std::string net); | ||||
std::string GetNetworkName(enum Network net); | std::string GetNetworkName(enum Network net); | ||||
bool SetProxy(enum Network net, const proxyType &addrProxy); | bool SetProxy(enum Network net, const proxyType &addrProxy); | ||||
bool GetProxy(enum Network net, proxyType &proxyInfoOut); | bool GetProxy(enum Network net, proxyType &proxyInfoOut); | ||||
bool IsProxy(const CNetAddr &addr); | bool IsProxy(const CNetAddr &addr); | ||||
bool SetNameProxy(const proxyType &addrProxy); | bool SetNameProxy(const proxyType &addrProxy); | ||||
bool HaveNameProxy(); | bool HaveNameProxy(); | ||||
bool GetNameProxy(proxyType &nameProxyOut); | |||||
bool LookupHost(const char *pszName, std::vector<CNetAddr> &vIP, | bool LookupHost(const char *pszName, std::vector<CNetAddr> &vIP, | ||||
unsigned int nMaxSolutions, bool fAllowLookup); | unsigned int nMaxSolutions, bool fAllowLookup); | ||||
bool LookupHost(const char *pszName, CNetAddr &addr, bool fAllowLookup); | bool LookupHost(const char *pszName, CNetAddr &addr, bool fAllowLookup); | ||||
bool Lookup(const char *pszName, CService &addr, int portDefault, | bool Lookup(const char *pszName, CService &addr, int portDefault, | ||||
bool fAllowLookup); | bool fAllowLookup); | ||||
bool Lookup(const char *pszName, std::vector<CService> &vAddr, int portDefault, | bool Lookup(const char *pszName, std::vector<CService> &vAddr, int portDefault, | ||||
bool fAllowLookup, unsigned int nMaxSolutions); | bool fAllowLookup, unsigned int nMaxSolutions); | ||||
CService LookupNumeric(const char *pszName, int portDefault = 0); | CService LookupNumeric(const char *pszName, int portDefault = 0); | ||||
bool LookupSubNet(const char *pszName, CSubNet &subnet); | bool LookupSubNet(const char *pszName, CSubNet &subnet); | ||||
bool ConnectSocket(const CService &addr, SOCKET &hSocketRet, int nTimeout, | bool ConnectSocketDirectly(const CService &addrConnect, SOCKET &hSocketRet, | ||||
bool *outProxyConnectionFailed = 0); | int nTimeout); | ||||
bool ConnectSocketByName(CService &addr, SOCKET &hSocketRet, | bool ConnectThroughProxy(const proxyType &proxy, const std::string &strDest, | ||||
const char *pszDest, int portDefault, int nTimeout, | int port, SOCKET &hSocketRet, int nTimeout, | ||||
bool *outProxyConnectionFailed = 0); | bool *outProxyConnectionFailed); | ||||
/** Return readable error string for a network error code */ | /** Return readable error string for a network error code */ | ||||
std::string NetworkErrorString(int err); | std::string NetworkErrorString(int err); | ||||
/** Close socket and set hSocket to INVALID_SOCKET */ | /** Close socket and set hSocket to INVALID_SOCKET */ | ||||
bool CloseSocket(SOCKET &hSocket); | bool CloseSocket(SOCKET &hSocket); | ||||
/** Disable or enable blocking-mode for a socket */ | /** Disable or enable blocking-mode for a socket */ | ||||
bool SetSocketNonBlocking(SOCKET &hSocket, bool fNonBlocking); | bool SetSocketNonBlocking(SOCKET &hSocket, bool fNonBlocking); | ||||
/** | /** | ||||
* Convert milliseconds to a struct timeval for e.g. select. | * Convert milliseconds to a struct timeval for e.g. select. | ||||
*/ | */ | ||||
struct timeval MillisToTimeval(int64_t nTimeout); | struct timeval MillisToTimeval(int64_t nTimeout); | ||||
void InterruptSocks5(bool interrupt); | void InterruptSocks5(bool interrupt); | ||||
#endif // BITCOIN_NETBASE_H | #endif // BITCOIN_NETBASE_H |