30#ifndef ASYNC_IP_ADDRESS_INCLUDED
31#define ASYNC_IP_ADDRESS_INCLUDED
40#include <netinet/in.h>
206 return m_addr.s_addr ==
rhs.m_addr.s_addr;
217 return !(*
this ==
rhs);
228 return m_addr.s_addr <
rhs.m_addr.s_addr;
A class for representing an IP address in an OS independent way.
Ip4Addr ip4Addr(void) const
Return the IP address in OS specific representation.
IpAddress(const IpAddress &addr)
Copy contructor.
bool isWithinSubet(const std::string &subnet) const
Check if the IP address is within the given netmask.
std::string toString(void) const
Return the string representation of the IP address.
~IpAddress(void)
Destructor.
bool setIpFromString(const std::string &str)
Set the IP address from a string.
friend std::ostream & operator<<(std::ostream &os, const Async::IpAddress &ip)
Output stream operator.
void clear(void)
Invalidate the IP address value.
bool operator!=(const IpAddress &rhs) const
Unequality operator.
bool isUnicast(void) const
Check if this is a unicast IP address.
IpAddress(const Ip4Addr &addr)
Constructor for the IpAddress class.
friend std::istream & operator>>(std::istream &is, Async::IpAddress &ip)
Input stream operator.
IpAddress(void)
Default constructor for the IpAddress class.
IpAddress(const std::string &addr)
Constructor for the IpAddress class.
bool operator<(const IpAddress &rhs) const
Less than operator.
bool operator==(const IpAddress &rhs) const
Equality operator.
IpAddress & operator=(const IpAddress &rhs)
Assignment operator.
bool isEmpty(void) const
Check if an invalid IP address has been assigned.
A class for creating a TCP client connection.
Namespace for the asynchronous programming classes.
std::istream & operator>>(std::istream &is, IpAddress &ip)
std::ostream & operator<<(std::ostream &os, const IpAddress &ip)