1 #ifndef PCAPPP_IPADDRESS 2 #define PCAPPP_IPADDRESS 8 #define MAX_ADDR_STRING_LEN 40 //xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx 31 char m_AddressAsString[MAX_ADDR_STRING_LEN];
36 #if __cplusplus > 199711L 37 typedef std::unique_ptr<IPAddress> Ptr_t;
39 typedef std::auto_ptr<IPAddress> Ptr_t;
68 std::string
toString()
const {
return std::string(m_AddressAsString); }
97 static Ptr_t
fromString(
char* addressAsString);
105 static Ptr_t
fromString(std::string addressAsString);
117 void init(
char* addressAsString);
164 uint32_t
toInt()
const;
216 void init(
char* addressAsString);
264 void copyTo(uint8_t** arr,
size_t& length);
271 void copyTo(uint8_t* arr)
const;
Definition: IpAddress.h:212
AddressType getType() const
Definition: IpAddress.h:249
IPv4Address & operator=(const IPv4Address &other)
bool matchSubnet(const IPv4Address &subnet, const std::string &subnetMask)
std::string toString() const
Definition: IpAddress.h:68
IPv4Address(uint32_t addressAsInt)
Definition: IpAddress.h:49
bool operator==(const IPv6Address &other)
bool operator!=(const IPv6Address &other)
AddressType getType() const
Definition: IpAddress.h:156
The main namespace for the PcapPlusPlus lib.
in6_addr * toIn6Addr()
Definition: IpAddress.h:257
Definition: IpAddress.h:113
IPv6Address & operator=(const IPv6Address &other)
AddressType
Definition: IpAddress.h:45
bool equals(const IPAddress *other)
void copyTo(uint8_t **arr, size_t &length)
Definition: IpAddress.h:27
virtual AddressType getType() const =0
virtual IPAddress * clone() const =0
static IPv4Address Zero
Definition: IpAddress.h:203
Definition: IpAddress.h:53
static Ptr_t fromString(char *addressAsString)
bool isValid()
Definition: IpAddress.h:75
bool operator==(const IPv4Address &other) const
Definition: IpAddress.h:176
static IPv6Address Zero
Definition: IpAddress.h:294
bool operator!=(const IPv4Address &other) const
Definition: IpAddress.h:182
IPv6Address(uint8_t *addressAsUintArr)
IPAddress * clone() const
IPAddress * clone() const
in_addr * toInAddr()
Definition: IpAddress.h:170