2#ifndef POSIX_POSIXIPADDRESS_H
3#define POSIX_POSIXIPADDRESS_H
28#include <sys/socket.h>
29#include <netinet/in.h>
89 sockaddr_in * myAddr = (sockaddr_in *)(&(this->
addr));
90 sockaddr_in * otherAddr = (sockaddr_in *)(&(rhs.
addr));
91 return ((myAddr->sin_addr.s_addr == otherAddr->sin_addr.s_addr) &&
92 (myAddr->sin_port == otherAddr->sin_port));
103 sockaddr_in * myAddr = (sockaddr_in *)(&(this->
addr));
104 sockaddr_in * otherAddr = (sockaddr_in *)(&(rhs.
addr));
105 if (myAddr->sin_addr.s_addr == otherAddr->sin_addr.s_addr)
107 return myAddr->sin_port < otherAddr->sin_port;
111 return myAddr->sin_addr.s_addr < otherAddr->sin_addr.s_addr;
123 sockaddr_in * myAddr = (sockaddr_in *)(&(this->
addr));
124 sockaddr_in * otherAddr = (sockaddr_in *)(&(rhs.
addr));
125 if (myAddr->sin_addr.s_addr == otherAddr->sin_addr.s_addr)
127 return myAddr->sin_port > otherAddr->sin_port;
131 return myAddr->sin_addr.s_addr > otherAddr->sin_addr.s_addr;
An URI object can split a Uniform Resource Identifier string into its components or build a string fr...
Definition uri.h:67
Represents an IP address, consisting of a IPv4 host address and a port number.
Definition posixipaddress.h:35
void SetHostName(const Util::String &hostName)
set host name
Definition posixipaddress.cc:141
bool operator>(const PosixIpAddress &rhs) const
greater-then operator
Definition posixipaddress.h:119
static bool IsInetAddr(const in_addr *addr)
return true if an address is an internet address (not class A,B,C)
Definition posixipaddress.cc:267
PosixIpAddress()
default constructor
Definition posixipaddress.cc:21
void SetPort(ushort port)
set port number
Definition posixipaddress.cc:118
ushort GetPort() const
get port number
Definition posixipaddress.cc:128
const sockaddr & GetSockAddr() const
get sockaddr_in field
Definition posixipaddress.cc:84
Util::String addrAsString
Definition posixipaddress.h:77
const Util::String & GetHostAddr() const
get the ip address resulting from the host name as string
Definition posixipaddress.cc:167
Util::String hostName
Definition posixipaddress.h:76
void ExtractFromUri(const IO::URI &uri)
extract host name and port number from URI
Definition posixipaddress.cc:97
sockaddr addr
Definition posixipaddress.h:78
static bool GetHostByName(const Util::String &hostName, sockaddr &outAddr)
perform address resolution, understands special host names
Definition posixipaddress.cc:189
void SetSockAddr(const sockaddr &addr)
set sockaddr_in directly
Definition posixipaddress.cc:70
bool operator==(const PosixIpAddress &rhs) const
equality operator
Definition posixipaddress.h:85
bool operator<(const PosixIpAddress &rhs) const
less-then operator
Definition posixipaddress.h:99
const Util::String & GetHostName() const
get host name
Definition posixipaddress.cc:157
A lowlevel socket wrapper class.
Definition posixsocket.h:33
#define n_assert(exp)
Definition debug.h:50
Posix implemention of a read-many write-few lock.
Definition posixsysfunc.cc:21
Nebula's universal string class.
Definition string.h:50
unsigned short ushort
Definition types.h:32