27#ifndef NIDAS_UTIL_INET4ADDRESS
28#define NIDAS_UTIL_INET4ADDRESS
39namespace nidas {
namespace util {
57 static std::list<Inet4Address>
getAllByName(
const std::string& hostname);
114 const struct in_addr
getInAddr() const {
return _inaddr; }
120 return ntohl(
_inaddr.s_addr) < ntohl(x._inaddr.s_addr);
127 return _inaddr.s_addr == x._inaddr.s_addr;
134 return _inaddr.s_addr != x._inaddr.s_addr;
143 return (ntohl(
_inaddr.s_addr) & 0xf0000000L) == 0xe0000000L;
Support for IP version 4 host address.
Definition Inet4Address.h:46
const struct in_addr getInAddr() const
Get the structure containing the 4 byte internet version 4 address.
Definition Inet4Address.h:114
static std::list< Inet4Address > getAllByName(const std::string &hostname)
Static method returning a list of addresses for a name.
Definition Inet4Address.cc:133
struct in_addr _inaddr
The IP address, in network byte order.
Definition Inet4Address.h:156
const struct in_addr * getInAddrPtr() const
Return const pointer to struct in_addr.
Definition Inet4Address.h:105
bool operator!=(const Inet4Address &x) const
Inequality operator for addresses.
Definition Inet4Address.h:133
bool operator==(const Inet4Address &x) const
Equality operator for addresses.
Definition Inet4Address.h:126
Inet4Address()
Default constructor.
Definition Inet4Address.cc:41
std::string getHostName() const
Return a hostname for this address.
Definition Inet4Address.cc:62
std::string getHostAddress() const
Return string containing address in dot notation: w.x.y.z.
Definition Inet4Address.cc:55
bool operator<(const Inet4Address &x) const
Comparator operator for addresses.
Definition Inet4Address.h:119
bool isMultiCastAddress() const
Is this address a multicast address? Multicast addresses are in the range 224.0.0....
Definition Inet4Address.h:142
int bitsMatch(const Inet4Address &x) const
How many leading bits match in the two addresses?
Definition Inet4Address.cc:187
static Inet4Address getByName(const std::string &hostname)
Return an address of a name, the first one found by getAllByName.
Definition Inet4Address.cc:175
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31