1 #ifndef PACKETPP_DNS_RESOURCE 2 #define PACKETPP_DNS_RESOURCE 21 class IDnsResourceData;
22 class DnsResourceDataPtr;
38 size_t m_OffsetInLayer;
40 std::string m_DecodedName;
42 uint8_t* m_ExternalRawData;
48 size_t decodeName(
const char* encodedName,
char* result,
int iteration = 1);
49 void encodeName(
const std::string& decodedName,
char* result,
size_t& resultLen);
51 IDnsResource* getNextResource()
const {
return m_NextResource; }
52 void setNexResource(
IDnsResource* next) { m_NextResource = next; }
54 uint8_t* getRawData()
const;
56 void setDnsLayer(
DnsLayer* dnsLayer,
size_t offsetInLayer);
87 const std::string&
getName()
const {
return m_DecodedName; }
107 bool setName(
const std::string& newName);
115 virtual size_t getSize()
const = 0;
141 virtual size_t getSize()
const {
return m_NameLength + 2 *
sizeof(uint16_t); }
167 uint32_t getTTL()
const;
173 void setTTL(uint32_t newTTL);
178 size_t getDataLength()
const;
196 size_t getDataOffset()
const;
220 uint16_t getCustomDnsClass()
const;
227 void setCustomDnsClass(uint16_t customValue);
230 virtual size_t getSize()
const {
return m_NameLength + 3 *
sizeof(uint16_t) +
sizeof(uint32_t) + getDataLength(); }
237 #endif // PACKETPP_DNS_RESOURCE const std::string & getName() const
Definition: DnsResource.h:87
The main namespace for the PcapPlusPlus lib.
void setDnsType(DnsType newType)
bool setName(const std::string &newName)
virtual size_t getSize() const
Definition: DnsResource.h:230
DnsType getDnsType() const
void setDnsClass(DnsClass newClass)
DnsClass
Definition: DnsLayerEnums.h:127
Definition: DnsResourceData.h:40
DnsType
Definition: DnsLayerEnums.h:15
Definition: DnsLayer.h:96
DnsClass getDnsClass() const
virtual size_t getSize() const
Definition: DnsResource.h:141
size_t getNameOffset() const
Definition: DnsResource.h:92
virtual DnsResourceType getType() const
Definition: DnsResource.h:231
virtual size_t getSize() const =0
DnsResourceType
Definition: DnsLayerEnums.h:145
virtual DnsResourceType getType() const =0
Definition: DnsLayerEnums.h:148
Definition: DnsResource.h:150
Definition: DnsResource.h:30
Definition: DnsResource.h:128
Definition: DnsResourceData.h:94
virtual DnsResourceType getType() const
Definition: DnsResource.h:142