|
PcapPlusPlus
19.12
|
Go to the documentation of this file. 1 #ifndef PACKETPP_DNS_RESOURCE_DATA
2 #define PACKETPP_DNS_RESOURCE_DATA
23 #if __cplusplus > 199711L || _MSC_VER >= 1800 //Maybe this can be 1600 for VS2010
24 #define PCPP_SMART_PTR(T) std::unique_ptr<T>
26 #define PCPP_SMART_PTR(T) std::auto_ptr<T>
47 size_t decodeName(
const char* encodedName,
char* result,
IDnsResource* dnsResource)
const;
48 void encodeName(
const std::string& decodedName,
char* result,
size_t& resultLen,
IDnsResource* dnsResource)
const;
61 template <
class IDnsResourceDataType>
62 bool isTypeOf()
const {
return dynamic_cast<const IDnsResourceDataType*>(
this) != NULL; }
69 template <
class IDnsResourceDataType>
70 IDnsResourceDataType*
castAs() {
return dynamic_cast<IDnsResourceDataType*>(
this); }
75 virtual std::string
toString()
const = 0;
108 #if __cplusplus <= 199711L && _MSC_VER < 1800 //Maybe this can be 1600 for VS2010
117 template <
class IDnsResourceDataType>
118 bool isTypeOf()
const {
return get()->isTypeOf<IDnsResourceDataType>(); }
125 template <
class IDnsResourceDataType>
126 IDnsResourceDataType*
castAs() {
return get()->castAs<IDnsResourceDataType>();}
329 void setMxData(uint16_t preference, std::string mailExchange);
392 #endif // PACKETPP_DNS_RESOURCE_DATA
IPv6DnsResourceData(const std::string &addrAsString)
Definition: DnsResourceData.h:248
bool isTypeOf() const
Definition: DnsResourceData.h:62
std::string toString() const
Definition: DnsResourceData.h:215
Definition: IpAddress.h:119
Definition: IpAddress.h:229
uint16_t preference
Definition: DnsResourceData.h:283
virtual std::string toString() const =0
Definition: DnsResourceData.h:224
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const
bool operator==(const StringDnsResourceData &other) const
Definition: DnsResourceData.h:162
Definition: DnsResourceData.h:39
MxData getMxData() const
Definition: DnsResourceData.h:322
Definition: DnsResourceData.h:134
bool operator==(const MxDnsResourceData &other) const
bool operator==(const GenericDnsResourceData &other) const
std::string mailExchange
Definition: DnsResourceData.h:285
Definition: DnsResource.h:30
std::string toString() const
IDnsResourceDataType * castAs()
Definition: DnsResourceData.h:70
virtual bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const =0
bool operator==(const IPv6DnsResourceData &other) const
Definition: DnsResourceData.h:255
Definition: DnsResourceData.h:280
std::string toString() const
Definition: DnsResourceData.h:264
bool isTypeOf() const
Definition: DnsResourceData.h:118
std::string toString() const
Definition: IpAddress.h:74
IPv4DnsResourceData(const uint8_t *dataPtr, size_t dataLen)
bool operator==(const IPv4DnsResourceData &other) const
Definition: DnsResourceData.h:206
Definition: DnsResourceData.h:175
DnsResourceDataPtr(IDnsResourceData *ptr)
Definition: DnsResourceData.h:101
IPv6Address getIpAddress() const
Definition: DnsResourceData.h:260
IDnsResourceDataType * castAs()
Definition: DnsResourceData.h:126
bool toByteArr(uint8_t *arr, size_t &arrLength, IDnsResource *dnsResource) const
IPv4DnsResourceData(const IPv4Address &addr)
Definition: DnsResourceData.h:193
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:273
virtual ~IDnsResourceData()
Definition: DnsResourceData.h:54
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:166
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:199
StringDnsResourceData(const std::string &data)
Definition: DnsResourceData.h:151
IPv6DnsResourceData(const uint8_t *dataPtr, size_t dataLen)
Definition: DnsResourceData.h:351
IPv4Address getIpAddress() const
Definition: DnsResourceData.h:211
Definition: DnsResourceData.h:93
IPv6DnsResourceData(const IPv6Address &addr)
Definition: DnsResourceData.h:242