uint64_t n;
for(n=0; n < ntohs(dh.qdcount) ; ++n) {
dpm.skipLabel();
- dpm.skipBytes(4); // qtype, qclass
+ /* type and class */
+ dpm.skipBytes(4);
}
// cerr<<"Skipped "<<n<<" questions, now parsing "<<numrecords<<" records"<<endl;
for(n=0; n < numrecords; ++n) {
dpm.skipLabel();
uint16_t dnstype = dpm.get16BitInt();
- /* uint16_t dnsclass = */ dpm.get16BitInt();
+ /* class */
+ dpm.skipBytes(2);
if(dnstype == QType::OPT) // not aging that one with a stick
break;
const uint16_t qdcount = ntohs(dh->qdcount);
for(size_t n = 0; n < qdcount; ++n) {
dpm.skipLabel();
- dpm.skipBytes(4); // qtype, qclass
+ /* type and class */
+ dpm.skipBytes(4);
}
const size_t numrecords = ntohs(dh->ancount) + ntohs(dh->nscount) + ntohs(dh->arcount);
for(size_t n = 0; n < numrecords; ++n) {
dpm.skipLabel();
-
const uint16_t dnstype = dpm.get16BitInt();
- /* uint16_t dnsclass = */ dpm.get16BitInt();
+ /* class */
+ dpm.skipBytes(2);
if(dnstype == QType::OPT)
break;
const uint16_t qdcount = ntohs(dh->qdcount);
for(size_t n = 0; n < qdcount; ++n) {
dpm.skipLabel();
- dpm.skipBytes(4); // qtype, qclass
+ /* type and class */
+ dpm.skipBytes(4);
}
const size_t numrecords = ntohs(dh->ancount) + ntohs(dh->nscount) + ntohs(dh->arcount);
for(size_t n = 0; n < numrecords; ++n) {
dpm.skipLabel();
-
- /* const uint16_t dnstype */ dpm.get16BitInt();
- /* uint16_t dnsclass */ dpm.get16BitInt();
- /* const uint32_t ttl */ dpm.get32BitInt();
+ /* type (2), class (2) and ttl (4) */
+ dpm.skipBytes(8);
dpm.skipRData();
}
result = dpm.getOffset();
if (dnstype == type) {
result++;
}
- dpm.skipBytes(2); // qclass
+ /* class */
+ dpm.skipBytes(2);
} else {
- dpm.skipBytes(4); // qtype, qclass
+ /* type and class */
+ dpm.skipBytes(4);
}
}
const uint16_t ancount = ntohs(dh->ancount);
if (dnstype == type) {
result++;
}
- dpm.skipBytes(2); // qclass
+ /* class */
+ dpm.skipBytes(2);
} else {
- dpm.skipBytes(4); // qtype, qclass
+ /* type and class */
+ dpm.skipBytes(4);
}
- /* const uint32_t ttl */ dpm.get32BitInt();
+ /* ttl */
+ dpm.skipBytes(4);
dpm.skipRData();
}
const uint16_t nscount = ntohs(dh->nscount);
if (dnstype == type) {
result++;
}
- dpm.skipBytes(2); // qclass
+ /* class */
+ dpm.skipBytes(2);
} else {
- dpm.skipBytes(4); // qtype, qclass
+ /* type and class */
+ dpm.skipBytes(4);
}
- /* const uint32_t ttl */ dpm.get32BitInt();
+ /* ttl */
+ dpm.skipBytes(4);
dpm.skipRData();
}
const uint16_t arcount = ntohs(dh->arcount);
if (dnstype == type) {
result++;
}
- dpm.skipBytes(2); // qclass
+ /* class */
+ dpm.skipBytes(2);
} else {
- dpm.skipBytes(4); // qtype, qclass
+ /* type and class */
+ dpm.skipBytes(4);
}
- /* const uint32_t ttl */ dpm.get32BitInt();
+ /* ttl */
+ dpm.skipBytes(4);
dpm.skipRData();
}
}