PcapPlusPlus  21.05
pcpp::IPv6DnsResourceData Class Reference

#include <DnsResourceData.h>

Inheritance diagram for pcpp::IPv6DnsResourceData:
pcpp::IDnsResourceData

Public Member Functions

 IPv6DnsResourceData (const uint8_t *dataPtr, size_t dataLen)
 
 IPv6DnsResourceData (const IPv6Address &addr)
 
 IPv6DnsResourceData (const std::string &addrAsString)
 
bool operator== (const IPv6DnsResourceData &other) const
 
IPv6Address getIpAddress () const
 
std::string toString () const
 
bool toByteArr (uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const
 
- Public Member Functions inherited from pcpp::IDnsResourceData
virtual ~IDnsResourceData ()
 
template<class IDnsResourceDataType >
bool isTypeOf () const
 
template<class IDnsResourceDataType >
IDnsResourceDataType * castAs ()
 

Detailed Description

A class that represents DNS RR IPv6 data, mainly used in DNS RRs of type DNS_TYPE_AAAA

Constructor & Destructor Documentation

◆ IPv6DnsResourceData() [1/3]

pcpp::IPv6DnsResourceData::IPv6DnsResourceData ( const uint8_t *  dataPtr,
size_t  dataLen 
)

A c'tor for this class

Parameters
[in]dataPtrA byte array of size 16 that contains an IPv6 address (each byte represents 1 octet)
[in]dataLenThe byte array size, expected to be 16

◆ IPv6DnsResourceData() [2/3]

pcpp::IPv6DnsResourceData::IPv6DnsResourceData ( const IPv6Address addr)
inline

A c'tor for this class

Parameters
[in]addrThe IPv6 address to store in this object

◆ IPv6DnsResourceData() [3/3]

pcpp::IPv6DnsResourceData::IPv6DnsResourceData ( const std::string &  addrAsString)
inline

A c'tor for this class

Parameters
[in]addrAsStringA string representation of an IPv6 address to store in this object

Member Function Documentation

◆ getIpAddress()

IPv6Address pcpp::IPv6DnsResourceData::getIpAddress ( ) const
inline
Returns
The IPv6 address stored in this object

◆ operator==()

bool pcpp::IPv6DnsResourceData::operator== ( const IPv6DnsResourceData other) const
inline

Equality operator overload for this class that compares the IPv6 addresses stored in each object

Parameters
[in]otherThe object to compare with
Returns
True if IPv6 addresses are the same in both objects, false otherwise

◆ toByteArr()

bool pcpp::IPv6DnsResourceData::toByteArr ( uint8_t *  arr,
size_t &  arrLength,
IDnsResource dnsResource 
) const
virtual

Convert the DNS RR data into a byte array

Parameters
[out]arrA pointer to a pre-allocated byte array where the result will be written to
[out]arrLengthA reference to a 2-byte number where the result array length will be written to
[in]dnsResourceA 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::IPv6DnsResourceData::toString ( ) const
inlinevirtual
Returns
A string that represents the current DNS RR data

Implements pcpp::IDnsResourceData.