#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 | ) |
|
|
inlineexplicit |
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 | ) |
|
|
inlineexplicit |
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 |
( |
| ) |
const |
|
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
◆ toBytes()
| std::vector<uint8_t> pcpp::IPv4DnsResourceData::toBytes |
( |
IDnsResource * |
dnsResource | ) |
const |
|
overridevirtual |
Serialize the DNS RR data into a byte vector
- Parameters
-
| [in] | dnsResource | A pointer to a DNS resource object where this DNS RR data will be stored, may be nullptr for data types that don't need it |
- Returns
- A vector with the serialized DNS RR data, or an empty vector if the data is invalid or couldn't be serialized
Implements pcpp::IDnsResourceData.
◆ toString()
| std::string pcpp::IPv4DnsResourceData::toString |
( |
| ) |
const |
|
inlineoverridevirtual |