27 #ifndef NIDAS_UTIL_INET4ADDRESS
28 #define NIDAS_UTIL_INET4ADDRESS
33 #include <arpa/inet.h>
39 namespace nidas {
namespace util {
55 static std::list<Inet4Address>
getAllByName(
const std::string& hostname)
139 return (ntohl(
_inaddr.s_addr) & 0xf0000000L) == 0xe0000000L;
bool operator<(const Inet4Address &x) const
Comparator operator for addresses.
Definition: Inet4Address.h:115
bool isMultiCastAddress() const
Is this address a multicast address? Multicast addresses are in the range 224.0.0.1 to 239.255.255.255, their first four bits are 1110=0xe.
Definition: Inet4Address.h:138
bool operator==(const Inet4Address &x) const
Equality operator for addresses.
Definition: Inet4Address.h:122
bool operator!=(const Inet4Address &x) const
Inequality operator for addresses.
Definition: Inet4Address.h:129
static Inet4Address getByName(const std::string &hostname)
Return an address of a name, the first one found by getAllByName.
Definition: Inet4Address.cc:176
static std::list< Inet4Address > getAllByName(const std::string &hostname)
Static method returning a list of addresses for a name.
Definition: Inet4Address.cc:133
std::string getHostName() const
Return a hostname for this address.
Definition: Inet4Address.cc:62
int bitsMatch(const Inet4Address &x) const
How many leading bits match in the two addresses?
Definition: Inet4Address.cc:189
std::string getHostAddress() const
Return string containing address in dot notation: w.x.y.z.
Definition: Inet4Address.cc:55
Inet4Address()
Default constructor.
Definition: Inet4Address.cc:41
struct in_addr * getInAddrPtr() const
Return const pointer to struct in_addr.
Definition: Inet4Address.h:101
Definition: UnknownHostException.h:35
Support for IP version 4 host address.
Definition: Inet4Address.h:46
struct in_addr getInAddr() const
Get the structure containing the 4 byte internet version 4 address.
Definition: Inet4Address.h:110
struct in_addr _inaddr
The IP address, in network byte order.
Definition: Inet4Address.h:152