#include <DnsResourceData.h>
A class that represents DNS RR IPv4 data, mainly used in DNS RRs of type DNS_TYPE_A
◆ IPv4DnsResourceData() [1/3]
pcpp::IPv4DnsResourceData::IPv4DnsResourceData |
( |
const uint8_t * |
dataPtr, |
|
|
size_t |
dataLen |
|
) |
| |
A c'tor for this class
- Parameters
-
[in] | dataPtr | A byte array of size 4 that contains an IPv4 address (each byte represents 1 octet) |
[in] | dataLen | The byte array size, expected to be 4 |
◆ IPv4DnsResourceData() [2/3]
pcpp::IPv4DnsResourceData::IPv4DnsResourceData |
( |
const IPv4Address & |
addr | ) |
|
|
inline |
A c'tor for this class
- Parameters
-
[in] | addr | The IPv4 address to store in this object |
◆ IPv4DnsResourceData() [3/3]
pcpp::IPv4DnsResourceData::IPv4DnsResourceData |
( |
const std::string & |
addrAsString | ) |
|
|
inline |
A c'tor for this class
- Parameters
-
[in] | addrAsString | A string representation of an IPv4 address to store in this object |
◆ getIpAddress()
IPv4Address pcpp::IPv4DnsResourceData::getIpAddress |
( |
| ) |
|
|
inline |
- Returns
- The IPv4 address stored in this object
◆ operator==()
Equality operator overload for this class that compares the IPv4 addresses stored in each object
- Parameters
-
[in] | other | The object to compare with |
- Returns
- True if IPv4 addresses are the same in both objects, false otherwise
◆ toByteArr()
bool pcpp::IPv4DnsResourceData::toByteArr |
( |
uint8_t * |
arr, |
|
|
size_t & |
arrLength, |
|
|
IDnsResource * |
dnsResource |
|
) |
| |
|
virtual |
Convert the DNS RR data into a byte array
- Parameters
-
[out] | arr | A pointer to a pre-allocated byte array where the result will be written to |
[out] | arrLength | A reference to a 2-byte number where the result array length will be written to |
[in] | dnsResource | A pointer to a DNS resource object where this DNS RR data will be stored |
- Returns
- True if the DNS RR data was successfully converted into a byte array and written to the given array or false if stored DNS RR data is invalid or if it could not be written to the given array
Implements pcpp::IDnsResourceData.
◆ toString()
std::string pcpp::IPv4DnsResourceData::toString |
( |
| ) |
|
|
inlinevirtual |