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

A combination of a network address (CNetAddr) and a (TCP) port. More...

#include <netbase.h>

Inheritance diagram for CService:
[legend]
Collaboration diagram for CService:
[legend]

Public Member Functions

 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
 
 CService (const struct in6_addr &ipv6Addr, unsigned short port)
 
 CService (const struct sockaddr_in6 &addr)
 
- 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)
 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 short port
 
- Protected Attributes inherited from CNetAddr
unsigned char ip [16]
 

Friends

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

Detailed Description

A combination of a network address (CNetAddr) and a (TCP) port.

Definition at line 109 of file netbase.h.

Constructor & Destructor Documentation

CService::CService ( )

Definition at line 1143 of file netbase.cpp.

Here is the caller graph for this function:

CService::CService ( const CNetAddr ip,
unsigned short  port 
)

Definition at line 1148 of file netbase.cpp.

CService::CService ( const struct in_addr &  ipv4Addr,
unsigned short  port 
)

Definition at line 1152 of file netbase.cpp.

CService::CService ( const struct sockaddr_in &  addr)

Definition at line 1160 of file netbase.cpp.

CService::CService ( const char *  pszIpPort,
int  portDefault,
bool  fAllowLookup = false 
)
explicit

Definition at line 1192 of file netbase.cpp.

Here is the call graph for this function:

CService::CService ( const char *  pszIpPort,
bool  fAllowLookup = false 
)
explicit

Definition at line 1184 of file netbase.cpp.

Here is the call graph for this function:

CService::CService ( const std::string &  strIpPort,
int  portDefault,
bool  fAllowLookup = false 
)
explicit

Definition at line 1208 of file netbase.cpp.

Here is the call graph for this function:

CService::CService ( const std::string &  strIpPort,
bool  fAllowLookup = false 
)
explicit

Definition at line 1200 of file netbase.cpp.

Here is the call graph for this function:

CService::CService ( const struct in6_addr &  ipv6Addr,
unsigned short  port 
)

Definition at line 1156 of file netbase.cpp.

CService::CService ( const struct sockaddr_in6 &  addr)

Definition at line 1165 of file netbase.cpp.

Member Function Documentation

std::vector< unsigned char > CService::GetKey ( ) const

Definition at line 1277 of file netbase.cpp.

Here is the call graph for this function:

unsigned short CService::GetPort ( ) const

Definition at line 1216 of file netbase.cpp.

Here is the caller graph for this function:

bool CService::GetSockAddr ( struct sockaddr *  paddr,
socklen_t *  addrlen 
) const

Definition at line 1248 of file netbase.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CService::Init ( )

Definition at line 1138 of file netbase.cpp.

Here is the caller graph for this function:

void CService::print ( ) const

Definition at line 1330 of file netbase.cpp.

Here is the call graph for this function:

void CService::SetPort ( unsigned short  portIn)

Definition at line 1335 of file netbase.cpp.

bool CService::SetSockAddr ( const struct sockaddr *  paddr)

Definition at line 1170 of file netbase.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string CService::ToString ( ) const

Definition at line 1325 of file netbase.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string CService::ToStringIPPort ( ) const

Definition at line 1314 of file netbase.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string CService::ToStringPort ( ) const

Definition at line 1295 of file netbase.cpp.

Here is the caller graph for this function:

Friends And Related Function Documentation

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

Definition at line 1230 of file netbase.cpp.

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

Definition at line 1239 of file netbase.cpp.

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

Definition at line 1221 of file netbase.cpp.

Member Data Documentation

unsigned short CService::port
protected

Definition at line 112 of file netbase.h.


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