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 inline IDnsResource* getNextResource() {
return m_NextResource; }
52 inline void setNexResource(
IDnsResource* next) { m_NextResource = next; }
54 uint8_t* getRawData();
56 void setDnsLayer(
DnsLayer* dnsLayer,
size_t offsetInLayer);
87 std::string
getName() {
return m_DecodedName; }
107 bool setName(
const std::string& newName);
141 virtual size_t getSize() {
return m_NameLength + 2*
sizeof(uint16_t); }
173 void setTTL(uint32_t newTTL);
237 #endif // PACKETPP_DNS_RESOURCE Definition: DnsLayerEnums.h:148
DnsClass
Definition: DnsLayerEnums.h:127
Definition: DnsResourceData.h:88
void setCustomDnsClass(uint16_t customValue)
uint16_t getCustomDnsClass()
Definition: DnsResource.h:30
bool setData(IDnsResourceData *data)
virtual size_t getSize()
Definition: DnsResource.h:141
void setDnsType(DnsType newType)
DnsResourceType
Definition: DnsLayerEnums.h:145
size_t getNameOffset()
Definition: DnsResource.h:92
virtual DnsResourceType getType()=0
virtual DnsResourceType getType()
Definition: DnsResource.h:231
virtual DnsResourceType getType()
Definition: DnsResource.h:142
void setTTL(uint32_t newTTL)
DnsResourceDataPtr getData()
bool setName(const std::string &newName)
Definition: DnsResource.h:150
Definition: DnsLayer.h:104
DnsType
Definition: DnsLayerEnums.h:15
std::string getName()
Definition: DnsResource.h:87
Definition: DnsResource.h:128
virtual size_t getSize()
Definition: DnsResource.h:230
The main namespace for the PcapPlusPlus lib.
Definition: DnsResourceData.h:34
void setDnsClass(DnsClass newClass)
virtual size_t getSize()=0