1 #ifndef PACKETPP_DNS_RESOURCE_DATA 2 #define PACKETPP_DNS_RESOURCE_DATA 18 #if __cplusplus > 199711L 19 #define PCPP_SMART_PTR(T) std::unique_ptr<T> 21 #define PCPP_SMART_PTR(T) std::auto_ptr<T> 42 size_t decodeName(
const char* encodedName,
char* result,
IDnsResource* dnsResource);
43 void encodeName(
const std::string& decodedName,
char* result,
size_t& resultLen,
IDnsResource* dnsResource);
56 template <
class IDnsResourceDataType>
57 bool isTypeOf()
const {
return dynamic_cast<const IDnsResourceDataType*
>(
this) != NULL; }
64 template <
class IDnsResourceDataType>
65 IDnsResourceDataType*
castAs() {
return dynamic_cast<IDnsResourceDataType*
>(
this);}
98 #if __cplusplus <= 199711L 107 template <
class IDnsResourceDataType>
108 bool isTypeOf()
const {
return get()->isTypeOf<IDnsResourceDataType>(); }
115 template <
class IDnsResourceDataType>
116 IDnsResourceDataType*
castAs() {
return get()->castAs<IDnsResourceDataType>();}
320 void setMxData(uint16_t preference, std::string mailExchange);
383 #endif // PACKETPP_DNS_RESOURCE_DATA Definition: DnsResourceData.h:264
bool isTypeOf() const
Definition: DnsResourceData.h:108
Definition: DnsResourceData.h:125
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource)
IPv4DnsResourceData(const std::string &addrAsString)
Definition: DnsResourceData.h:190
IDnsResourceDataType * castAs()
Definition: DnsResourceData.h:116
Definition: DnsResourceData.h:342
IPv4DnsResourceData(const IPv4Address &addr)
Definition: DnsResourceData.h:184
virtual std::string toString()=0
Definition: IpAddress.h:113
IPv4DnsResourceData(const uint8_t *dataPtr, size_t dataLen)
std::string toString()
Definition: DnsResourceData.h:157
Definition: DnsResourceData.h:215
Definition: DnsResourceData.h:88
void setMxData(uint16_t preference, std::string mailExchange)
bool operator==(const GenericDnsResourceData &other) const
StringDnsResourceData(const std::string &data)
Definition: DnsResourceData.h:142
GenericDnsResourceData(uint8_t *dataPtr, size_t dataLen)
Definition: DnsResource.h:30
Definition: DnsResourceData.h:271
Definition: DnsResourceData.h:166
bool operator==(const StringDnsResourceData &other) const
Definition: DnsResourceData.h:153
virtual ~IDnsResourceData()
Definition: DnsResourceData.h:49
bool operator==(const IPv4DnsResourceData &other) const
Definition: DnsResourceData.h:197
IPv6DnsResourceData(const uint8_t *dataPtr, size_t dataLen)
DnsResourceDataPtr(IDnsResourceData *ptr)
Definition: DnsResourceData.h:96
virtual bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource)=0
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource)
MxData getMxData()
Definition: DnsResourceData.h:313
std::string mailExchange
Definition: DnsResourceData.h:276
bool operator==(const IPv6DnsResourceData &other) const
Definition: DnsResourceData.h:246
std::string toString()
Definition: DnsResourceData.h:255
IPv6DnsResourceData(const IPv6Address &addr)
Definition: DnsResourceData.h:233
uint16_t preference
Definition: DnsResourceData.h:274
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource)
IPv4Address getIpAddress()
Definition: DnsResourceData.h:202
std::string toString()
Definition: DnsResourceData.h:206
Definition: IpAddress.h:212
IPv6Address getIpAddress()
Definition: DnsResourceData.h:251
IPv6DnsResourceData(const std::string &addrAsString)
Definition: DnsResourceData.h:239
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)
std::string toString() const
Definition: IpAddress.h:68
IDnsResourceDataType * castAs()
Definition: DnsResourceData.h:65
The main namespace for the PcapPlusPlus lib.
Definition: DnsResourceData.h:34
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource)
bool isTypeOf() const
Definition: DnsResourceData.h:57