35 size_t decodeName(
const char* encodedName,
char* result,
IDnsResource* dnsResource)
const;
36 void encodeName(
const std::string& decodedName,
char* result,
size_t& resultLen,
50 template <
class IDnsResourceDataType>
bool isTypeOf()
const
52 return dynamic_cast<const IDnsResourceDataType*
>(
this) !=
nullptr;
61 template <
class IDnsResourceDataType> IDnsResourceDataType*
castAs()
63 return dynamic_cast<IDnsResourceDataType*
>(
this);
101 template <
class IDnsResourceDataType>
bool isTypeOf()
const
103 return get()->isTypeOf<IDnsResourceDataType>();
111 template <
class IDnsResourceDataType> IDnsResourceDataType*
castAs()
113 return get()->castAs<IDnsResourceDataType>();
153 return m_Data == other.m_Data;
203 return m_Data == other.m_Data;
261 return m_Data == other.m_Data;
343 void setMxData(uint16_t preference, std::string mailExchange);
393 if (m_Data !=
nullptr)
Definition: DnsResourceData.h:87
IDnsResourceDataType * castAs()
Definition: DnsResourceData.h:111
DnsResourceDataPtr(IDnsResourceData *ptr)
Definition: DnsResourceData.h:93
bool isTypeOf() const
Definition: DnsResourceData.h:101
Definition: DnsResourceData.h:365
bool operator==(const GenericDnsResourceData &other) const
GenericDnsResourceData(const std::string &dataAsHexString)
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const override
std::string toString() const override
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:61
bool isTypeOf() const
Definition: DnsResourceData.h:50
virtual std::string toString() const =0
virtual ~IDnsResourceData()=default
Definition: DnsResource.h:30
Definition: IpAddress.h:32
std::string toString() const
Definition: DnsResourceData.h:170
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const override
IPv4DnsResourceData(const std::string &addrAsString)
Definition: DnsResourceData.h:193
bool operator==(const IPv4DnsResourceData &other) const
Definition: DnsResourceData.h:201
IPv4DnsResourceData(const IPv4Address &addr)
Definition: DnsResourceData.h:186
IPv4DnsResourceData(const uint8_t *dataPtr, size_t dataLen)
std::string toString() const override
Definition: DnsResourceData.h:216
IPv4Address getIpAddress() const
Definition: DnsResourceData.h:209
Definition: IpAddress.h:199
std::string toString() const
Definition: DnsResourceData.h:228
IPv6DnsResourceData(const IPv6Address &addr)
Definition: DnsResourceData.h:244
std::string toString() const override
Definition: DnsResourceData.h:274
bool operator==(const IPv6DnsResourceData &other) const
Definition: DnsResourceData.h:259
IPv6DnsResourceData(const uint8_t *dataPtr, size_t dataLen)
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const override
IPv6Address getIpAddress() const
Definition: DnsResourceData.h:267
IPv6DnsResourceData(const std::string &addrAsString)
Definition: DnsResourceData.h:251
Definition: DnsResourceData.h:286
std::string toString() const override
MxDnsResourceData(uint8_t *dataPtr, size_t dataLen, IDnsResource *dnsResource)
bool operator==(const MxDnsResourceData &other) const
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const override
MxData getMxData() const
Definition: DnsResourceData.h:333
MxDnsResourceData(const uint16_t &preference, const std::string &mailExchange)
void setMxData(uint16_t preference, std::string mailExchange)
Definition: DnsResourceData.h:123
std::string toString() const override
Definition: DnsResourceData.h:158
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const override
StringDnsResourceData(const std::string &data)
Definition: DnsResourceData.h:139
bool operator==(const StringDnsResourceData &other) const
Definition: DnsResourceData.h:151
The main namespace for the PcapPlusPlus lib.
Definition: DnsResourceData.h:292
std::string mailExchange
Definition: DnsResourceData.h:296
uint16_t preference
Definition: DnsResourceData.h:294