24 throw std::runtime_error(
"Invalid IP address");
47 char buffer[INET6_ADDRSTRLEN];
bool isIpv6() const
Check if the stored IP address is an IPv6 address.
INLINE_IMPL int ip_from_str(const char *str, ip_addr_t *addr)
A struct representing an IP address with associated operations.
IpAddress(ip_addr_t ip=EMPTY_IP_ADDRESS)
Constructor to initialize IpAddress with an ip_addr_t value.
bool operator==(const IpAddress &other) const
Equality operator to compare two IpAddress objects.
IpAddress operator &(const IpAddress &other) const
Bitwise AND operator to perform a bitwise AND operation on two IpAddress objects. ...
Header file containing the definition of the IpAddress class.
INLINE_IMPL int ip_is6(const ip_addr_t *addr)
std::ostream & operator<<(std::ostream &os)
Output stream operator to stream an IpAddress object to an output stream.
INLINE_IMPL void ip_to_str(const ip_addr_t *addr, char *str)
INLINE_IMPL int ip_is4(const ip_addr_t *addr)
bool isIpv4() const
Check if the stored IP address is an IPv4 address.