return stringbuffer;
}
-const char *DNSPacket::getData(void)
+const char *DNSPacket::getData(DNSSECKeeper* dk)
{
if(!d_wrapped)
- wrapup();
+ wrapup(dk);
return stringbuffer.data();
}
DTime d_dt; //!< the time this packet was created. replyPacket() copies this in for you, so d_dt becomes the time spent processing the question+answer
void wrapup(DNSSECKeeper* dk=0); // writes out queued rrs, and generates the binary packet. also shuffles. also rectifies dnsheader 'd', and copies it to the stringbuffer
- const char *getData(void); //!< get binary representation of packet, will call 'wrapup' for you
+ const char *getData(DNSSECKeeper* dk=0); //!< get binary representation of packet, will call 'wrapup' for you
const char *getRaw(void); //!< provides access to the raw packet, possibly on a packet that has never been 'wrapped'
void spoofQuestion(const string &qd); //!< paste in the exact right case of the question. Useful for PacketCache
rr.priority = 0;
rr.qtype=i->first.d_type;
rr.qname=i->first.d_label;
-
rr.ttl=i->first.d_ttl;
rr.content=i->first.d_content->getZoneRepresentation(); // this should be the serialised form
rr.d_place=(DNSResourceRecord::Place) i->first.d_place;
void PacketHandler::addNSECX(DNSPacket *p, DNSPacket *r, const string& target, const string& auth, int mode)
{
NSEC3PARAMRecordContent ns3rc;
- cerr<<"Doing NSEC3PARAM lookup for '"<<auth<<"': ";
+ cerr<<"Doing NSEC3PARAM lookup for '"<<auth<<"', "<<p->qdomain<<"|"<<p->qtype.getName()<<": ";
if(d_dk.getNSEC3PARAM(auth, &ns3rc)) {
cerr<<"Present"<<endl;
addNSEC3(p, r, target, auth, ns3rc, mode);
DNSPacket *r=0;
try {
- DLOG(L << Logger::Notice<<"Remote "<< p->remote.toString() <<" wants a type " << p->qtype.getName() << " ("<<p->qtype.getCode()<<") about '"<<p->qdomain << "'" << endl);
+ L << Logger::Notice<<"Remote "<< p->remote.toString() <<" wants a type " << p->qtype.getName() << " ("<<p->qtype.getCode()<<") about '"<<p->qdomain << "'" << endl;
if(p->d.qr) { // QR bit from dns packet (thanks RA from N)
L<<Logger::Error<<"Received an answer (non-query) packet from "<<p->getRemote()<<", dropping"<<endl;
void TCPNameserver::sendPacket(shared_ptr<DNSPacket> p, int outsock)
{
- const char *buf=p->getData();
+ DNSSECKeeper dk;
+ const char *buf=p->getData(&dk);
uint16_t len=htons(p->len);
writenWithTimeout(outsock, &len, 2);
writenWithTimeout(outsock, buf, p->len);