mDNSlocal void DeleteCachedNSECS(mDNS *const m, CacheRecord *cr) { CacheRecord *rp, *next; if (cr->nsec) LogDNSSEC("DeleteCachedNSECS: Deleting NSEC Records\n"); for (rp = cr->nsec; rp; rp = next) { next = rp->next; ReleaseCacheRecord(m, rp); } cr->nsec = mDNSNULL; }
mDNSexport void InitializeAnonInfoForQuestion(mDNS *const m, CacheRecord **McastNSEC3Records, DNSQuestion *q) { CacheRecord *nsec3CR; if (q->qtype != kDNSType_PTR) return; nsec3CR = FindMatchingNSEC3ForName(m, McastNSEC3Records, &q->qname); if (nsec3CR) { q->AnonInfo = AllocateAnonInfo(mDNSNULL, mDNSNULL, 0, &nsec3CR->resrec); if (q->AnonInfo) { debugf("InitializeAnonInfoForQuestion: Found a matching NSEC3 record %s, for %##s (%s)", RRDisplayString(m, q->AnonInfo->nsec3RR), q->qname.c, DNSTypeName(q->qtype)); } ReleaseCacheRecord(m, nsec3CR); } }
mDNSexport void InitializeAnonInfoForCR(mDNS *const m, CacheRecord **McastNSEC3Records, CacheRecord *cr) { CacheRecord *nsec3CR; if (!(*McastNSEC3Records)) return; // If already initialized or not a PTR type, we don't have to do anything if (cr->resrec.AnonInfo || cr->resrec.rrtype != kDNSType_PTR) return; nsec3CR = FindMatchingNSEC3ForName(m, McastNSEC3Records, cr->resrec.name); if (nsec3CR) { cr->resrec.AnonInfo = AllocateAnonInfo(mDNSNULL, mDNSNULL, 0, &nsec3CR->resrec); if (cr->resrec.AnonInfo) { debugf("InitializeAnonInfoForCR: Found a matching NSEC3 record %s, for %##s (%s)", RRDisplayString(m, cr->resrec.AnonInfo->nsec3RR), cr->resrec.name->c, DNSTypeName(cr->resrec.rrtype)); } ReleaseCacheRecord(m, nsec3CR); } }