1 #ifndef PACKETPP_DNS_LAYER 2 #define PACKETPP_DNS_LAYER 10 #if defined(WIN32) || defined(WINx64) || defined(PCAPPP_MINGW_ENV) 35 #if (BYTE_ORDER == LITTLE_ENDIAN) 57 #elif (BYTE_ORDER == BIG_ENDIAN) 195 bool removeQuery(
const std::string& queryNameToRemove,
bool exactMatch);
258 bool removeAnswer(
const std::string& answerNameToRemove,
bool exactMatch);
322 bool removeAuthority(
const std::string& authorityNameToRemove,
bool exactMatch);
449 using Layer::extendLayer;
450 bool extendLayer(
int offsetInLayer,
size_t numOfBytesToExtend,
IDnsResource* resource);
452 using Layer::shortenLayer;
453 bool shortenLayer(
int offsetInLayer,
size_t numOfBytesToShorten,
IDnsResource* resource);
455 IDnsResource* getResourceByName(
IDnsResource* startFrom,
size_t resourceCount,
const std::string& name,
bool exactMatch);
457 void parseResources();
bool removeQuery(const std::string &queryNameToRemove, bool exactMatch)
dnshdr * getDnsHeader()
Definition: DnsLayer.h:143
DnsResource * getFirstAdditionalRecord()
uint16_t authoritativeAnswer
Definition: DnsLayer.h:38
DnsResource * addAuthority(const std::string &name, DnsType dnsType, DnsClass dnsClass, uint32_t ttl, IDnsResourceData *data)
uint16_t recursionAvailable
Definition: DnsLayer.h:38
uint16_t checkingDisabled
Definition: DnsLayer.h:38
uint16_t numberOfQuestions
Definition: DnsLayer.h:81
bool removeAuthority(const std::string &authorityNameToRemove, bool exactMatch)
size_t getAuthorityCount()
void parseNextLayer()
Definition: DnsLayer.h:418
DnsResource * getAnswer(const std::string &name, bool exactMatch)
DnsResource * addAdditionalRecord(const std::string &name, DnsType dnsType, DnsClass dnsClass, uint32_t ttl, IDnsResourceData *data)
DnsClass
Definition: DnsLayerEnums.h:127
uint16_t numberOfAdditional
Definition: DnsLayer.h:87
Definition: DnsLayer.h:31
DnsResource * getAuthority(const std::string &name, bool exactMatch)
DnsResource * getAdditionalRecord(const std::string &name, bool exactMatch)
uint16_t truncation
Definition: DnsLayer.h:38
uint16_t queryOrResponse
Definition: DnsLayer.h:38
uint16_t zero
Definition: DnsLayer.h:38
size_t getAdditionalRecordCount()
DnsResource * getFirstAuthority()
DnsQuery * getQuery(const std::string &name, bool exactMatch)
Definition: DnsResource.h:30
DnsResource * getNextAuthority(DnsResource *authority)
static const std::map< uint16_t, bool > * getDNSPortMap()
OsiModelLayer getOsiModelLayer()
Definition: DnsLayer.h:433
DnsResourceType
Definition: DnsLayerEnums.h:145
Definition: ProtocolType.h:228
uint16_t transactionID
Definition: DnsLayer.h:34
uint16_t recursionDesired
Definition: DnsLayer.h:38
OsiModelLayer
Definition: ProtocolType.h:213
DnsQuery * getFirstQuery()
uint16_t authenticData
Definition: DnsLayer.h:38
DnsResource * getNextAnswer(DnsResource *answer)
DnsQuery * addQuery(const std::string &name, DnsType dnsType, DnsClass dnsClass)
DnsResource * addAnswer(const std::string &name, DnsType dnsType, DnsClass dnsClass, uint32_t ttl, IDnsResourceData *data)
uint16_t numberOfAnswers
Definition: DnsLayer.h:83
DnsResource * getNextAdditionalRecord(DnsResource *additionalRecord)
Definition: DnsResource.h:150
bool removeAdditionalRecord(const std::string &additionalRecordNameToRemove, bool exactMatch)
Definition: DnsLayer.h:104
DnsType
Definition: DnsLayerEnums.h:15
DnsResource * getFirstAnswer()
uint16_t responseCode
Definition: DnsLayer.h:38
DnsQuery * getNextQuery(DnsQuery *query)
uint16_t opcode
Definition: DnsLayer.h:38
DnsLayer & operator=(const DnsLayer &other)
uint16_t numberOfAuthority
Definition: DnsLayer.h:85
bool removeAnswer(const std::string &answerNameToRemove, bool exactMatch)
size_t getHeaderLen()
Definition: DnsLayer.h:424
Definition: DnsResource.h:128
void computeCalculateFields()
Definition: DnsLayer.h:429
The main namespace for the PcapPlusPlus lib.
Definition: DnsResourceData.h:34