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 The main namespace for the PcapPlusPlus lib.
IPv4DnsResourceData(const std::string &addrAsString)
Definition: DnsResourceData.h:200
Definition: DnsResourceData.h:176
bool isTypeOf() const
Definition: DnsResourceData.h:63
StringDnsResourceData(const std::string &data)
Definition: DnsResourceData.h:152
MxData getMxData() const
Definition: DnsResourceData.h:323
DnsResourceDataPtr(IDnsResourceData *ptr)
Definition: DnsResourceData.h:102
Definition: DnsResourceData.h:40
virtual bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const =0
Definition: DnsResourceData.h:135
std::string toString() const
Definition: DnsResourceData.h:265
virtual std::string toString() const =0
IDnsResourceDataType * castAs()
Definition: DnsResourceData.h:127
IPv6DnsResourceData(const std::string &addrAsString)
Definition: DnsResourceData.h:249
Definition: DnsResourceData.h:274
IDnsResourceDataType * castAs()
Definition: DnsResourceData.h:71
IPv4DnsResourceData(const IPv4Address &addr)
Definition: DnsResourceData.h:194
bool operator==(const IPv4DnsResourceData &other) const
Definition: DnsResourceData.h:207
IPv6DnsResourceData(const IPv6Address &addr)
Definition: DnsResourceData.h:243
Definition: IpAddress.h:42
Definition: IpAddress.h:192
std::string toString() const
bool operator==(const IPv6DnsResourceData &other) const
Definition: DnsResourceData.h:256
Definition: DnsResourceData.h:281
uint16_t preference
Definition: DnsResourceData.h:284
Definition: DnsResourceData.h:352
virtual ~IDnsResourceData()
Definition: DnsResourceData.h:55
IPv4Address getIpAddress() const
Definition: DnsResourceData.h:212
Definition: DnsResourceData.h:225
std::string toString() const
Definition: DnsResourceData.h:167
std::string toString() const
Definition: DnsResourceData.h:216
std::string mailExchange
Definition: DnsResourceData.h:286
IPv6Address getIpAddress() const
Definition: DnsResourceData.h:261
std::string toString() const
Definition: DnsResource.h:30
bool operator==(const StringDnsResourceData &other) const
Definition: DnsResourceData.h:163
Definition: DnsResourceData.h:94
bool isTypeOf() const
Definition: DnsResourceData.h:119