35 size_t decodeName(
const char* encodedName,
char* result,
IDnsResource* dnsResource)
const;
36 void encodeName(
const std::string& decodedName,
char* result,
size_t& resultLen,
51 template <
class IDnsResourceDataType>
bool isTypeOf()
const
53 return dynamic_cast<const IDnsResourceDataType*
>(
this) !=
nullptr;
62 template <
class IDnsResourceDataType> IDnsResourceDataType*
castAs()
64 return dynamic_cast<IDnsResourceDataType*
>(
this);
102 template <
class IDnsResourceDataType>
bool isTypeOf()
const
104 return get()->isTypeOf<IDnsResourceDataType>();
112 template <
class IDnsResourceDataType> IDnsResourceDataType*
castAs()
114 return get()->castAs<IDnsResourceDataType>();
155 return m_Data == other.m_Data;
205 return m_Data == other.m_Data;
263 return m_Data == other.m_Data;
346 void setMxData(uint16_t preference, std::string mailExchange);
396 if (m_Data !=
nullptr)
Definition: DnsResourceData.h:88
IDnsResourceDataType * castAs()
Definition: DnsResourceData.h:112
DnsResourceDataPtr(IDnsResourceData *ptr)
Definition: DnsResourceData.h:94
bool isTypeOf() const
Definition: DnsResourceData.h:102
Definition: DnsResourceData.h:368
bool operator==(const GenericDnsResourceData &other) const
std::string toString() const
GenericDnsResourceData(const std::string &dataAsHexString)
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const
GenericDnsResourceData(const uint8_t *dataPtr, size_t dataLen)
GenericDnsResourceData(const GenericDnsResourceData &other)
Definition: DnsResourceData.h:28
virtual bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const =0
IDnsResourceDataType * castAs()
Definition: DnsResourceData.h:62
virtual ~IDnsResourceData()
Definition: DnsResourceData.h:43
bool isTypeOf() const
Definition: DnsResourceData.h:51
virtual std::string toString() const =0
Definition: DnsResource.h:30
Definition: IpAddress.h:32
std::string toString() const
Definition: DnsResourceData.h:172
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const
IPv4DnsResourceData(const std::string &addrAsString)
Definition: DnsResourceData.h:195
bool operator==(const IPv4DnsResourceData &other) const
Definition: DnsResourceData.h:203
IPv4DnsResourceData(const IPv4Address &addr)
Definition: DnsResourceData.h:188
std::string toString() const
Definition: DnsResourceData.h:218
IPv4DnsResourceData(const uint8_t *dataPtr, size_t dataLen)
IPv4Address getIpAddress() const
Definition: DnsResourceData.h:211
Definition: IpAddress.h:199
std::string toString() const
Definition: DnsResourceData.h:230
IPv6DnsResourceData(const IPv6Address &addr)
Definition: DnsResourceData.h:246
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const
std::string toString() const
Definition: DnsResourceData.h:276
bool operator==(const IPv6DnsResourceData &other) const
Definition: DnsResourceData.h:261
IPv6DnsResourceData(const uint8_t *dataPtr, size_t dataLen)
IPv6Address getIpAddress() const
Definition: DnsResourceData.h:269
IPv6DnsResourceData(const std::string &addrAsString)
Definition: DnsResourceData.h:253
Definition: DnsResourceData.h:288
std::string toString() const
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const
MxDnsResourceData(uint8_t *dataPtr, size_t dataLen, IDnsResource *dnsResource)
bool operator==(const MxDnsResourceData &other) const
MxData getMxData() const
Definition: DnsResourceData.h:336
MxDnsResourceData(const uint16_t &preference, const std::string &mailExchange)
void setMxData(uint16_t preference, std::string mailExchange)
Definition: DnsResourceData.h:124
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const
std::string toString() const
Definition: DnsResourceData.h:160
StringDnsResourceData(const std::string &data)
Definition: DnsResourceData.h:140
bool operator==(const StringDnsResourceData &other) const
Definition: DnsResourceData.h:153
The main namespace for the PcapPlusPlus lib.
Definition: DnsResourceData.h:294
std::string mailExchange
Definition: DnsResourceData.h:298
uint16_t preference
Definition: DnsResourceData.h:296