PcapPlusPlus
23.09
|
#include <IpAddress.h>
Public Member Functions | |
IPNetwork (const IPAddress &address, uint8_t prefixLen) | |
IPNetwork (const IPAddress &address, const std::string &netmask) | |
IPNetwork (const std::string &addressAndNetmask) | |
IPNetwork (const IPNetwork &other) | |
~IPNetwork () | |
IPNetwork & | operator= (const IPNetwork &other) |
IPNetwork & | operator= (const IPv4Network &other) |
IPNetwork & | operator= (const IPv6Network &other) |
uint8_t | getPrefixLen () const |
std::string | getNetmask () const |
IPAddress | getNetworkPrefix () const |
IPAddress | getLowestAddress () const |
IPAddress | getHighestAddress () const |
uint64_t | getTotalAddressCount () const |
bool | isIPv4Network () const |
bool | isIPv6Network () const |
bool | includes (const IPAddress &address) const |
bool | includes (const IPNetwork &network) const |
std::string | toString () const |
A class representing version independent IP network definition, both IPv4 and IPv6 are included
|
inline |
A constructor that creates an instance of the class out of an address representing the network prefix and a prefix length
address | An address representing the network prefix. If the address is invalid std::invalid_argument exception is thrown |
prefixLen | A number representing the prefix length. If the value isn't in the range allowed for the network (0 - 32 for IPv4 networks or 0 - 128 for IPv6 networks) and std::invalid_argument exception is thrown |
|
inline |
A constructor that creates an instance of the class out of an address representing the network prefix and a netmask
address | An address representing the network prefix. If the address is invalid std::invalid_argument exception is thrown |
netmask | A string representing a netmask in valid format, for example: ffff:ffff:: for IPv6 networks or 255.255.0.0 for IPv4 networks. Please notice that netmasks that start with zeros are invalid, for example: 0:ffff:: or 0.255.255.255. The only netmask starting with zeros that is valid is all zeros (:: or 0.0.0.0). If the netmask is invalid std::invalid_argument exception is thrown |
|
inline |
A constructor that creates an instance of the class out of a string representing the network prefix and a prefix length or a netmask
addressAndNetmask | A string in one of these formats:
|
|
inline |
A copy c'tor for this class
other | The instance to copy from |
|
inline |
A destructor for this class
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
address | An IP address |
|
inline |
network | An IP network |
|
inline |
|
inline |
Overload of an assignment operator.
[in] | other | An instance of IPNetwork to assign |
|
inline |
Overload of an assignment operator.
[in] | other | An instance of IPv4Network to assign |
|
inline |
Overload of an assignment operator.
[in] | other | An instance of IPv6Network to assign |
|
inline |