Class which implements a network address
Class which implements a network address. includes functionality to look up network addresses from hostnames or ip addresses as strings.
lab1.vovida.com
NetworkAddress( string hostName, int port = -1 )
void setHostName( const string& theAddress )
192.168.4.5
lab1.vovoda.com:80
192.168.4.5:6000
void setPort( int port )
string getHostName()
string getIpName()
u_int32_t getIp4Address()
void getSockAddr(struct sockaddr & socka)
int getPort()
friend bool operator < (const NetworkAddress & xAddress, const NetworkAddress & yAddress )
friend bool operator == (const NetworkAddress & xAddress, const NetworkAddress & yAddress )
friend bool operator != (const NetworkAddress & xAddress, const NetworkAddress & yAddress )
operator string()
friend ostream& operator<< ( ostream & xStream, const NetworkAddress& rxObj )
NetworkAddress& operator=( const NetworkAddress& x )
ostream& print( ostream & xStr )
u_int32_t hashIpPort( )
static u_int32_t hashIpPort( const string& theAddress, const string& port )
static u_int32_t hashIpPort( const u_int32_t ipAddress, const int port )
static int getHostByName(const char* hostName, struct hostent* hEnt, char* buf, int buflen, int* thrErrno)
static const int getHostLookupFailed
static const int getHostLookupOK
bool is_valid_ip_addr(const string& ip_addr)
generated by doc++