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