Feathercoin  0.5.0
P2P Digital Currency
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Public Member Functions | Private Attributes | Friends | List of all members
CAddrInfo Class Reference

Extended statistics about a CAddress. More...

#include <addrman.h>

Inheritance diagram for CAddrInfo:
Inheritance graph
[legend]
Collaboration diagram for CAddrInfo:
Collaboration graph
[legend]

Public Member Functions

 IMPLEMENT_SERIALIZE (CAddress *pthis=(CAddress *)(this);READWRITE(*pthis);READWRITE(source);READWRITE(nLastSuccess);READWRITE(nAttempts);) void Init()
 
 CAddrInfo (const CAddress &addrIn, const CNetAddr &addrSource)
 
 CAddrInfo ()
 
int GetTriedBucket (const std::vector< unsigned char > &nKey) const
 
int GetNewBucket (const std::vector< unsigned char > &nKey, const CNetAddr &src) const
 
int GetNewBucket (const std::vector< unsigned char > &nKey) const
 
bool IsTerrible (int64 nNow=GetAdjustedTime()) const
 
double GetChance (int64 nNow=GetAdjustedTime()) const
 
- Public Member Functions inherited from CAddress
 CAddress ()
 
 CAddress (CService ipIn, uint64 nServicesIn=NODE_NETWORK)
 
void Init ()
 
 IMPLEMENT_SERIALIZE (CAddress *pthis=const_cast< CAddress * >(this);CService *pip=(CService *) pthis;if(fRead) pthis->Init();if(nType &SER_DISK) READWRITE(nVersion);if((nType &SER_DISK)||(nVersion >=CADDR_TIME_VERSION &&!(nType &SER_GETHASH))) READWRITE(nTime);READWRITE(nServices);READWRITE(*pip);) void print() const
 
- Public Member Functions inherited from CService
 CService ()
 
 CService (const CNetAddr &ip, unsigned short port)
 
 CService (const struct in_addr &ipv4Addr, unsigned short port)
 
 CService (const struct sockaddr_in &addr)
 
 CService (const char *pszIpPort, int portDefault, bool fAllowLookup=false)
 
 CService (const char *pszIpPort, bool fAllowLookup=false)
 
 CService (const std::string &strIpPort, int portDefault, bool fAllowLookup=false)
 
 CService (const std::string &strIpPort, bool fAllowLookup=false)
 
void Init ()
 
void SetPort (unsigned short portIn)
 
unsigned short GetPort () const
 
bool GetSockAddr (struct sockaddr *paddr, socklen_t *addrlen) const
 
bool SetSockAddr (const struct sockaddr *paddr)
 
std::vector< unsigned char > GetKey () const
 
std::string ToString () const
 
std::string ToStringPort () const
 
std::string ToStringIPPort () const
 
void print () const
 
- Public Member Functions inherited from CNetAddr
 CNetAddr ()
 
 CNetAddr (const struct in_addr &ipv4Addr)
 
 CNetAddr (const char *pszIp, bool fAllowLookup=false)
 
 CNetAddr (const std::string &strIp, bool fAllowLookup=false)
 
void Init ()
 
void SetIP (const CNetAddr &ip)
 
bool SetSpecial (const std::string &strName)
 
bool IsIPv4 () const
 
bool IsIPv6 () const
 
bool IsRFC1918 () const
 
bool IsRFC3849 () const
 
bool IsRFC3927 () const
 
bool IsRFC3964 () const
 
bool IsRFC4193 () const
 
bool IsRFC4380 () const
 
bool IsRFC4843 () const
 
bool IsRFC4862 () const
 
bool IsRFC6052 () const
 
bool IsRFC6145 () const
 
bool IsTor () const
 
bool IsLocal () const
 
bool IsRoutable () const
 
bool IsValid () const
 
bool IsMulticast () const
 
enum Network GetNetwork () const
 
std::string ToString () const
 
std::string ToStringIP () const
 
unsigned int GetByte (int n) const
 
uint64 GetHash () const
 
bool GetInAddr (struct in_addr *pipv4Addr) const
 
std::vector< unsigned char > GetGroup () const
 
int GetReachabilityFrom (const CNetAddr *paddrPartner=NULL) const
 Calculates a metric for how reachable (*this) is from a given partner. More...
 
void print () const
 

Private Attributes

CNetAddr source
 
int64 nLastSuccess
 
int nAttempts
 
int nRefCount
 
bool fInTried
 
int nRandomPos
 

Friends

class CAddrMan
 

Additional Inherited Members

- Public Attributes inherited from CAddress
uint64 nServices
 
unsigned int nTime
 
int64 nLastTry
 
- Protected Attributes inherited from CService
unsigned short port
 
- Protected Attributes inherited from CNetAddr
unsigned char ip [16]
 

Detailed Description

Extended statistics about a CAddress.

Definition at line 20 of file addrman.h.

Constructor & Destructor Documentation

CAddrInfo::CAddrInfo ( const CAddress addrIn,
const CNetAddr addrSource 
)
inline

Definition at line 66 of file addrman.h.

CAddrInfo::CAddrInfo ( )
inline

Definition at line 71 of file addrman.h.

Member Function Documentation

double CAddrInfo::GetChance ( int64  nNow = GetAdjustedTime()) const

Definition at line 58 of file addrman.cpp.

int CAddrInfo::GetNewBucket ( const std::vector< unsigned char > &  nKey,
const CNetAddr src 
) const

Definition at line 24 of file addrman.cpp.

int CAddrInfo::GetNewBucket ( const std::vector< unsigned char > &  nKey) const
inline

Definition at line 83 of file addrman.h.

int CAddrInfo::GetTriedBucket ( const std::vector< unsigned char > &  nKey) const

Definition at line 10 of file addrman.cpp.

CAddrInfo::IMPLEMENT_SERIALIZE ( CAddress pthis = (CAddress*)(this); READWRITE(*pthis); READWRITE(source); READWRITE(nLastSuccess); READWRITE(nAttempts);)
inline

Definition at line 48 of file addrman.h.

bool CAddrInfo::IsTerrible ( int64  nNow = GetAdjustedTime()) const

Definition at line 38 of file addrman.cpp.

Friends And Related Function Documentation

friend class CAddrMan
friend

Definition at line 44 of file addrman.h.

Member Data Documentation

bool CAddrInfo::fInTried
private

Definition at line 39 of file addrman.h.

int CAddrInfo::nAttempts
private

Definition at line 33 of file addrman.h.

int64 CAddrInfo::nLastSuccess
private

Definition at line 27 of file addrman.h.

int CAddrInfo::nRandomPos
private

Definition at line 42 of file addrman.h.

int CAddrInfo::nRefCount
private

Definition at line 36 of file addrman.h.

CNetAddr CAddrInfo::source
private

Definition at line 24 of file addrman.h.


The documentation for this class was generated from the following files: