|
PcapPlusPlus
20.08
|
Go to the documentation of this file. 1 #ifndef PACKETPP_DNS_RESOURCE_DATA
2 #define PACKETPP_DNS_RESOURCE_DATA
24 #if __cplusplus > 199711L || _MSC_VER >= 1800 //Maybe this can be 1600 for VS2010
25 #define PCPP_SMART_PTR(T) std::unique_ptr<T>
27 #define PCPP_SMART_PTR(T) std::auto_ptr<T>
48 size_t decodeName(
const char* encodedName,
char* result,
IDnsResource* dnsResource)
const;
49 void encodeName(
const std::string& decodedName,
char* result,
size_t& resultLen,
IDnsResource* dnsResource)
const;
62 template <
class IDnsResourceDataType>
63 bool isTypeOf()
const {
return dynamic_cast<const IDnsResourceDataType*
>(
this) != NULL; }
70 template <
class IDnsResourceDataType>
71 IDnsResourceDataType*
castAs() {
return dynamic_cast<IDnsResourceDataType*
>(
this); }
76 virtual std::string
toString()
const = 0;
109 #if __cplusplus <= 199711L && _MSC_VER < 1800 //Maybe this can be 1600 for VS2010
118 template <
class IDnsResourceDataType>
119 bool isTypeOf()
const {
return get()->isTypeOf<IDnsResourceDataType>(); }
126 template <
class IDnsResourceDataType>
127 IDnsResourceDataType*
castAs() {
return get()->castAs<IDnsResourceDataType>();}
330 void setMxData(uint16_t preference, std::string mailExchange);
399 #endif // PACKETPP_DNS_RESOURCE_DATA
IPv6DnsResourceData(const std::string &addrAsString)
Definition: DnsResourceData.h:249
bool isTypeOf() const
Definition: DnsResourceData.h:63
std::string toString() const
Definition: DnsResourceData.h:216
Definition: IpAddress.h:26
Definition: IpAddress.h:140
uint16_t preference
Definition: DnsResourceData.h:284
virtual std::string toString() const =0
Definition: DnsResourceData.h:225
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const
bool operator==(const StringDnsResourceData &other) const
Definition: DnsResourceData.h:163
Definition: DnsResourceData.h:40
MxData getMxData() const
Definition: DnsResourceData.h:323
Definition: DnsResourceData.h:135
std::string toString() const
bool operator==(const MxDnsResourceData &other) const
bool operator==(const GenericDnsResourceData &other) const
std::string mailExchange
Definition: DnsResourceData.h:286
Definition: DnsResource.h:30
std::string toString() const
IDnsResourceDataType * castAs()
Definition: DnsResourceData.h:71
virtual bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const =0
bool operator==(const IPv6DnsResourceData &other) const
Definition: DnsResourceData.h:256
Definition: DnsResourceData.h:281
std::string toString() const
Definition: DnsResourceData.h:265
bool isTypeOf() const
Definition: DnsResourceData.h:119
IPv4DnsResourceData(const uint8_t *dataPtr, size_t dataLen)
bool operator==(const IPv4DnsResourceData &other) const
Definition: DnsResourceData.h:207
Definition: DnsResourceData.h:176
DnsResourceDataPtr(IDnsResourceData *ptr)
Definition: DnsResourceData.h:102
IPv6Address getIpAddress() const
Definition: DnsResourceData.h:261
IDnsResourceDataType * castAs()
Definition: DnsResourceData.h:127
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const
IPv4DnsResourceData(const IPv4Address &addr)
Definition: DnsResourceData.h:194
The main namespace for the PcapPlusPlus lib.
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const
GenericDnsResourceData(uint8_t *dataPtr, size_t dataLen)
Definition: DnsResourceData.h:274
virtual ~IDnsResourceData()
Definition: DnsResourceData.h:55
std::string toString() const
void setMxData(uint16_t preference, std::string mailExchange)
MxDnsResourceData(uint8_t *dataPtr, size_t dataLen, IDnsResource *dnsResource)
std::string toString() const
Definition: DnsResourceData.h:167
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const
IPv4DnsResourceData(const std::string &addrAsString)
Definition: DnsResourceData.h:200
StringDnsResourceData(const std::string &data)
Definition: DnsResourceData.h:152
IPv6DnsResourceData(const uint8_t *dataPtr, size_t dataLen)
Definition: DnsResourceData.h:352
IPv4Address getIpAddress() const
Definition: DnsResourceData.h:212
std::string toString() const
Definition: DnsResourceData.h:94
IPv6DnsResourceData(const IPv6Address &addr)
Definition: DnsResourceData.h:243