Anoncoin  0.9.4
P2P Digital Currency
Public Member Functions | Protected Attributes | Friends | List of all members
CNetAddr Class Reference

IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96)) More...

#include <netbase.h>

Inheritance diagram for CNetAddr:
[legend]

Public Member Functions

 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)
 Returns TRUE if the address name can be looked up and resolved. More...
 
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_t 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
 
 CNetAddr (const struct in6_addr &pipv6Addr)
 
bool GetIn6Addr (struct in6_addr *pipv6Addr) const
 

Protected Attributes

unsigned char ip [16]
 

Friends

bool operator== (const CNetAddr &a, const CNetAddr &b)
 
bool operator!= (const CNetAddr &a, const CNetAddr &b)
 
bool operator< (const CNetAddr &a, const CNetAddr &b)
 

Detailed Description

IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96))

Definition at line 45 of file netbase.h.

Constructor & Destructor Documentation

CNetAddr::CNetAddr ( )

Definition at line 658 of file netbase.cpp.

CNetAddr::CNetAddr ( const struct in_addr &  ipv4Addr)

Definition at line 663 of file netbase.cpp.

Here is the call graph for this function:

CNetAddr::CNetAddr ( const char *  pszIp,
bool  fAllowLookup = false 
)
explicit

Definition at line 680 of file netbase.cpp.

Here is the call graph for this function:

CNetAddr::CNetAddr ( const std::string &  strIp,
bool  fAllowLookup = false 
)
explicit

Definition at line 688 of file netbase.cpp.

Here is the call graph for this function:

CNetAddr::CNetAddr ( const struct in6_addr &  pipv6Addr)

Definition at line 672 of file netbase.cpp.

Here is the call graph for this function:

Member Function Documentation

unsigned int CNetAddr::GetByte ( int  n) const

Definition at line 696 of file netbase.cpp.

std::vector< unsigned char > CNetAddr::GetGroup ( ) const

Definition at line 959 of file netbase.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t CNetAddr::GetHash ( ) const

Definition at line 1039 of file netbase.cpp.

Here is the call graph for this function:

bool CNetAddr::GetIn6Addr ( struct in6_addr *  pipv6Addr) const

Definition at line 948 of file netbase.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CNetAddr::GetInAddr ( struct in_addr *  pipv4Addr) const

Definition at line 940 of file netbase.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

enum Network CNetAddr::GetNetwork ( ) const

Definition at line 864 of file netbase.cpp.

Here is the caller graph for this function:

int CNetAddr::GetReachabilityFrom ( const CNetAddr paddrPartner = NULL) const

Calculates a metric for how reachable (*this) is from a given partner.

Definition at line 1070 of file netbase.cpp.

void CNetAddr::Init ( )

Definition at line 605 of file netbase.cpp.

bool CNetAddr::IsIPv4 ( ) const

Definition at line 701 of file netbase.cpp.

Here is the caller graph for this function:

bool CNetAddr::IsIPv6 ( ) const

Definition at line 706 of file netbase.cpp.

Here is the caller graph for this function:

bool CNetAddr::IsLocal ( ) const

Definition at line 792 of file netbase.cpp.

Here is the caller graph for this function:

bool CNetAddr::IsMulticast ( ) const

Definition at line 810 of file netbase.cpp.

bool CNetAddr::IsRFC1918 ( ) const

Definition at line 715 of file netbase.cpp.

bool CNetAddr::IsRFC3849 ( ) const

Definition at line 728 of file netbase.cpp.

bool CNetAddr::IsRFC3927 ( ) const

Definition at line 723 of file netbase.cpp.

bool CNetAddr::IsRFC3964 ( ) const

Definition at line 733 of file netbase.cpp.

bool CNetAddr::IsRFC4193 ( ) const

Definition at line 755 of file netbase.cpp.

bool CNetAddr::IsRFC4380 ( ) const

Definition at line 744 of file netbase.cpp.

bool CNetAddr::IsRFC4843 ( ) const

Definition at line 766 of file netbase.cpp.

bool CNetAddr::IsRFC4862 ( ) const

Definition at line 749 of file netbase.cpp.

bool CNetAddr::IsRFC6052 ( ) const

Definition at line 738 of file netbase.cpp.

bool CNetAddr::IsRFC6145 ( ) const

Definition at line 760 of file netbase.cpp.

bool CNetAddr::IsRoutable ( ) const

Definition at line 855 of file netbase.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CNetAddr::IsTor ( ) const

Definition at line 771 of file netbase.cpp.

Here is the caller graph for this function:

bool CNetAddr::IsValid ( ) const

Definition at line 816 of file netbase.cpp.

Here is the caller graph for this function:

void CNetAddr::print ( ) const

Definition at line 1051 of file netbase.cpp.

void CNetAddr::SetIP ( const CNetAddr ip)

Definition at line 613 of file netbase.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CNetAddr::SetSpecial ( const std::string &  strName)

Returns TRUE if the address name can be looked up and resolved.

Definition at line 626 of file netbase.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string CNetAddr::ToString ( ) const

Definition at line 908 of file netbase.cpp.

Here is the caller graph for this function:

std::string CNetAddr::ToStringIP ( ) const

Definition at line 882 of file netbase.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

bool operator!= ( const CNetAddr a,
const CNetAddr b 
)
friend

Definition at line 922 of file netbase.cpp.

bool operator< ( const CNetAddr a,
const CNetAddr b 
)
friend

Definition at line 931 of file netbase.cpp.

bool operator== ( const CNetAddr a,
const CNetAddr b 
)
friend

Definition at line 913 of file netbase.cpp.

Member Data Documentation

unsigned char CNetAddr::ip[16]
protected

Definition at line 48 of file netbase.h.


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