UniRec 3.3.2
|
A struct representing an IP address with associated operations. More...
#include <ipAddress.hpp>
Public Member Functions | |
IpAddress (ip_addr_t ip=EMPTY_IP_ADDRESS) | |
Constructor to initialize IpAddress with an ip_addr_t value. | |
IpAddress (const std::string &ipAddressAsString) | |
Constructor to create IpAddress from a string representation of an IP address. | |
bool | isIpv4 () const |
Check if the stored IP address is an IPv4 address. | |
bool | isIpv6 () const |
Check if the stored IP address is an IPv6 address. | |
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. | |
std::ostream & | operator<< (std::ostream &os) |
Output stream operator to stream an IpAddress object to an output stream. | |
Data Fields | |
ip_addr_t | ip |
A struct representing an IP address with associated operations.
Definition at line 29 of file ipAddress.hpp.
Nemea::IpAddress::IpAddress | ( | ip_addr_t | ip = EMPTY_IP_ADDRESS | ) |
Constructor to initialize IpAddress with an ip_addr_t value.
ip | The ip_addr_t value. |
Definition at line 15 of file ipAddress.cpp.
Nemea::IpAddress::IpAddress | ( | const std::string & | ipAddressAsString | ) |
Constructor to create IpAddress from a string representation of an IP address.
ipAddressAsString | The string representation of the IP address. |
std::runtime_error | if the IP address string is invalid. |
Definition at line 20 of file ipAddress.cpp.
bool Nemea::IpAddress::isIpv4 | ( | ) | const |
Check if the stored IP address is an IPv4 address.
Definition at line 28 of file ipAddress.cpp.
bool Nemea::IpAddress::isIpv6 | ( | ) | const |
Check if the stored IP address is an IPv6 address.
Definition at line 30 of file ipAddress.cpp.
Bitwise AND operator to perform a bitwise AND operation on two IpAddress objects.
other | The IpAddress to AND with. |
Definition at line 37 of file ipAddress.cpp.
std::ostream & Nemea::IpAddress::operator<< | ( | std::ostream & | os | ) |
Output stream operator to stream an IpAddress object to an output stream.
os | The output stream. |
Definition at line 45 of file ipAddress.cpp.
Equality operator to compare two IpAddress objects.
other | The IpAddress to compare with. |
Definition at line 32 of file ipAddress.cpp.
ip_addr_t Nemea::IpAddress::ip |
Definition at line 30 of file ipAddress.hpp.