Home | History | Annotate | Download | only in mDNSCore

Lines Matching full:record

115 // If there is a authoritative LocalOnly record that answers questions of type A, AAAA and CNAME
178 *cp = (*cp)->next; // Cut record from list
288 LogInfo("InsertAuthRecord: inserting auth record %s from table", ARDisplayString(m, rr));
289 *(ag->rrauth_tail) = rr; // Append this record to tail of cache slot list
313 LogInfo("RemoveAuthRecord: removing auth record %s from table", ARDisplayString(m, rr));
314 *rp = (*rp)->next; // Cut record from list
415 // which we would subsequently cancel and retract if the CNAME referral record were removed.
429 LogInfo("AnswerQuestionByFollowingCNAME: Resolving a .local CNAME %p %##s (%s) Record %s",
434 // Record how many times we've done this. We need to do this *after* mDNS_StartQuery_internal,
455 // We should not be delivering results for record types Unregistered, Deregistering, and (unverified) Unique
458 LogMsg("AnswerLocalQuestionWithLocalAuthRecord: *NOT* delivering %s event for local record type %X %s",
463 // Indicate that we've given at least one positive answer for this record, so we should be prepared to send a goodbye for it
535 // We are called with both LocalOnly/P2P record or a regular AuthRecord
557 #pragma mark - Resource Record Utility Functions
608 // When sending a unique record, all other records matching "SameResourceRecordSignature" must also be sent
609 // When receiving a unique record, all old cache records matching "SameResourceRecordSignature" are flushed
629 // authoratative record is unique (as opposed to shared). For unique records, we are supposed to have
630 // complete ownership of *all* types for this name, so *any* record type with the same name is a conflict.
656 // (either the record is non-specific, or it is specific to this interface)
689 // See: <rdar://problem/7795434> mDNS: Sometimes advertising stops working and record interval is set to zero
705 // * If this is a record type that's going to probe, then we use the m->SuppressProbes time.
795 // with the port number in our advertised SRV record automatically tracking the external mapped port.
810 LogInfo("SetUnicastTargetToHostName target %##s for resource record %s", target->c, ARDisplayString(m,rr));
839 // If we're in the middle of probing this record, we need to start again,
841 // (If the record type is kDNSRecordTypeUnique (unconfirmed unique) then DefaultProbeCountForRecordType is non-zero.)
844 // If we've announced this record, we really should send a goodbye packet for the old rdata before
848 debugf("Have announced shared record %##s (%s) at least once: should have sent a goodbye packet before updating",
872 // Make sure that we don't activate the SRV record and associated service records, if it is in
873 // NoTarget state. First time when a service is being instantiated, SRV record may be in NoTarget state.
887 LogMsg("ActivateUnicastRegistration: ERROR!! Resource record %s wrong, expecting SRV type", ARDisplayString(m, srvRR));
891 LogInfo("ActivateUnicastRegistration: Found Service Record %s in state %d for %##s (%s)",
900 LogInfo("ActivateUnicastRegistration record %s in regState_NoTarget, not activating", ARDisplayString(m, rr));
904 // the service/record was being deregistered. In that case, we should not try to register again. For the cases where
905 // the records are deregistered due to e.g., no target for the SRV record, we would have returned from above if it
910 LogInfo("ActivateUnicastRegistration: Resource record %s, current state %d, moving to DeregPending", ARDisplayString(m, rr), rr->state);
915 LogInfo("ActivateUnicastRegistration: Resource record %s, current state %d, moving to Pending", ARDisplayString(m, rr), rr->state);
1054 LogInfo("mDNS_Register_internal: Diverting record to local-only %s", ARDisplayString(m, rr));
1103 // If this resource record is referencing a specific interface, make sure it exists.
1111 debugf("mDNS_Register_internal: Bogus InterfaceID %p in resource record", rr->resrec.InterfaceID);
1118 // Field Group 1: The actual information pertaining to this resource record
1181 // We should be recording the actual internal port for this service record here. Once we initiate our NAT mapping
1191 // rr->resrec.rdata = MUST be set by client, unless record type is CNAME or PTR and rr->HostTarget is set
1194 // since RFC 1035 specifies a TXT record as "One or more <character-string>s", not "Zero or more <character-string>s".
1202 // If we have no target record yet, SetTargetToHostName will set rr->state == regState_NoTarget
1203 // In this case we leave the record half-formed in the list, and later we'll remove it from the list and re-add it properly.
1209 LogInfo("mDNS_Register_internal: record %s in NoTarget state", ARDisplayString(m, rr));
1220 { LogMsg("Attempt to register record with invalid name: %s", ARDisplayString(m, rr)); return(mStatus_Invalid); }
1224 { LogMsg("Attempt to register record with invalid rdata: %s", ARDisplayString(m, rr)); return(mStatus_Invalid); }
1232 // If we found a conflict, we may still want to insert the record in the list but mark it appropriately
1252 // records to the list, so we now need to update p to advance to the new end to the list before appending our new record.
1264 // Now that we've finished building our new record, make sure it's not identical to one we already have
1285 // If the previous copy of this record is already verified unique,
1286 // then indicate that we should move this record promptly to kDNSRecordTypeUnique state.
1287 // Setting ProbeCount to zero will cause SendQueries() to advance this record to
1294 debugf("mDNS_Register_internal: Adding to active record list %s", ARDisplayString(m,rr));
1321 // Adding a record may affect whether or not we should sleep
1357 // Note: mDNS_Deregister_internal can call a user callback, which may change the record list and/or question list.
1364 AuthRecord **p = &m->ResourceRecords; // Find this record in our list of active records
1387 // We found our record on the main list. See if there are any duplicates that need special handling.
1396 // Before we delete the record (and potentially send a goodbye packet)
1397 // first see if we have a record on the duplicate list ready to take over from it.
1403 debugf("mDNS_Register_internal: Duplicate record %p taking over from %p %##s (%s)",
1405 *d = dup->next; // Cut replacement record from DuplicateRecords list
1414 rr->next = dup; // ... splice it in right after the record we're about to delete
1439 // We didn't find our record on the main list; try the DuplicateRecords list instead.
1442 // If we found our record on the duplicate list, then make sure we don't send a goodbye for it
1452 LogMsg("mDNS_Deregister_internal: Record %p not found in list %s", rr, ARDisplayString(m,rr));
1456 // If this is a shared record and we've announced it at least once,
1457 // we need to retract that announcement before we delete the record
1459 // If this is a record (including mDNSInterface_LocalOnly records) for which we've given local-only answers then
1520 // clause will execute here and the record will be cut from the list.
1543 *p = rr->next; // Cut this record from the list
1554 verbosedebugf("mDNS_Deregister_internal: Deleting record for %s", ARDisplayString(m, rr));
1558 debugf("mDNS_Deregister_internal: Cannot have a conflict on a shared record! %##s (%s)",
1610 // NR_AdditionalTo must point to a record with NR_AnswerTo set (and not NR_AdditionalTo)
1611 // If 'add' does not meet this requirement, then follow its NR_AdditionalTo pointer to a record that does
1612 // The referenced record will definitely be acceptable (by recursive application of this rule)
1623 for (rr=ResponseRecords; rr; rr=rr->NextResponse) // For each record we plan to put
1625 // (Note: This is an "if", not a "while". If we add a record, we'll find it again
1633 // For SRV records, automatically add the Address record(s) for the target host
1652 else if (rr->resrec.rrtype == kDNSType_PTR) // For service PTR, see if we want to add DeviceInfo record
1748 // CompleteDeregistration guarantees that on exit the record will have been cut from the m->ResourceRecords list
1752 LogInfo("CompleteDeregistration: called for Resource record %s", ARDisplayString(m, rr));
1765 // which may change the record list and/or question list.
2031 // To be eligible for acceleration, a record MUST NOT be older (further along
2032 // its timeline) than the most mature record we've already put in the packet.
2039 // the record list and/or question list.
2146 // When sending SRV records (particularly when announcing a new service) automatically add related Address record(s) as additionals
2148 // which will be non-null. If by some chance there is an address record that's not interface-specific (should never happen)
2160 r2->ImmedAdditional = r2->resrec.InterfaceID; // ... then mark this address record for sending too
2161 // We also make sure we send the DeviceInfo TXT record too, if necessary
2163 // DeviceInfo TXT record onto a goodbye packet (RecordType == kDNSRecordTypeDeregistering).
2172 // If there's a record which is supposed to be unique that we're going to send, then make sure that we give
2175 // record, then other RRSet members that have not been sent recently will get flushed out of client caches.
2176 // -- If a record is marked to be sent on a certain interface, make sure the whole set is marked to be sent on that interface
2177 // -- If any record is marked to be sent on all interfaces, make sure the whole set is marked to be sent on all interfaces
2201 if (rr->ImmedAnswer == mDNSInterfaceMark) // Sending this record on all appropriate interfaces
2207 // If we're announcing this record, and it's at least half-way to its ordained time, then consider this announcement done
2249 // Skip this interface if the record InterfaceID is *Any and the record is not
2272 else continue; // If this packet is already too full to hold the goodbye for this record, skip it for now and we'll retry later
2292 // The first time through (pktcount==0), if this record is verified unique
2317 // If we're not planning to send any additionals, but this record is a unique one, then
2332 // The first time through (pktcount==0), if this record is verified unique
2346 // If we successfully put this additional record in the packet, we record LastMCTime & LastMCInterface.
2349 // all concerned and re-announce our record again to make sure it doesn't get flushed from peer caches.
2357 // When we're generating an NSEC record in response to a specify query for that type
2371 if (r2->resrec.rrtype >= kDNSQType_ANY) { LogMsg("Can't create NSEC for record %s", ARDisplayString(m, r2)); break; }
2375 if (!r2) // If we successfully built our NSEC record, add it to the packet now
2381 // If we successfully put the NSEC record, clear the SendNSECNow flag
2382 // If we consider this NSEC optional, then we unconditionally clear the SendNSECNow flag, even if we fail to put this additional record
2403 opt.resrec.rdlength = sizeof(rdataOPT); // One option in this OPT record
2409 LogSPS("SendResponses: No space in packet for Owner OPT record (%d/%d/%d/%d) %s",
2412 LogMsg("SendResponses: How did we fail to have space for Owner OPT record (%d/%d/%d/%d) %s",
2482 // 1. If a cache record is currently referenced by *no* active questions,
2484 // 2. Else, if a cache record is due for some of its final expiration queries,
2486 // 3. Else, if a cache record has completed all its final expiration queries without success,
2491 // (we have a new record with DelayDelivery set, waiting for the old record to go away before we can notify clients).
2517 // If we have an active question, then see if we want to schedule a refresher query for this record.
2542 // If the expected expiration time for this record is more than interval+33%, then accelerate its expiration
2584 for (rr = cg ? cg->members : mDNSNULL; rr; rr=rr->next) // If we have a resource record in our cache,
2586 !(rr->resrec.RecordType & kDNSRecordTypeUniqueMask) && // which is a shared (i.e. not unique) record type
2594 // is intended to suppress floods of shared-record replies from many other devices on the network.
2596 // which we have a unique record already in our cache, then including that unique record as a
2599 *ka = rr; // Link this record into our known answer chain
2622 for (rr = cg ? cg->members : mDNSNULL; rr; rr=rr->next) // For every resource record in our cache,
2639 // For any such cache record we find, we also recursively call ReconfirmAntecedents() for *its* name.
2667 // we check if we have an address record for the same name. If we do have an IPv4 address for a given
2684 if (cr->resrec.rrtype == kDNSType_PTR && cr->resrec.rdlength >= 6) // If record is PTR type, with long enough name,
2747 // Record the info about this query we saw
2821 for (rr = cg ? cg->members : mDNSNULL; rr; rr=rr->next) // If we have a resource record in our cache,
3030 // When we have a late conflict that resets a record to probing state we use a special marker value greater
3038 // If this is the last probe for this record, then see if we have any matching records
3044 // ... then acknowledge this record to the client.
3167 else LogMsg("SendQueries: How did we fail to have space for the Update record %s", ARDisplayString(m,ar));
3177 opt.resrec.rdlength = sizeof(rdataOPT); // One option in this OPT record
3184 LogMsg("SendQueries: How did we fail to have space for the OPT record (%d/%d/%d/%d) %s",
3188 LogMsg("SendQueries: Why did we generate oversized packet with OPT record %p %p %p (%d/%d/%d/%d) %s",
3233 // If the interface does not come back in time, the cache record will expire naturally
3299 // Note: AnswerCurrentQuestionWithResourceRecord can call a user callback, which may change the record list and/or question list.
3312 // But if the query for "A" record has a local answer but query for "AAAA" record has no local answer, we might
3317 LogInfo("AnswerCurrentQuestionWithResourceRecord: Question %p %##s (%s) not answering with record %s due to "
3327 // that are timing out, which we know are answered with Negative cache record when timing out.
3333 // may be called twice, once when the record is received, and again when it's time to notify local clients.
3340 debugf("AnswerCurrentQuestionWithResourceRecord: Updating CRActiveQuestion from %p to %p for cache record %s, CurrentAnswer %d",
3396 // 2) There are cache records but the DNSServers between question and cache record don't match.
3441 LogInfo("AnswerQuestionsForDNSServerChanges: Calling AnswerCurrentQuestionWithResourceRecord for question %p %##s using resource record %s",
3507 // which may change the record list and/or question list.
3585 // which may change the record list and/or question list.
3594 // since we're not caching the record and we'll get no opportunity to do this later
3613 // which may change the record list and/or question list.
3696 *cp = (*cp)->next; // Cut record from list
3727 if (rr->CRActiveQuestion) // If this record has one or more active questions, tell them it's going away
3730 // When a cache record is about to expire, we expect to do four queries at 80-82%, 85-87%, 90-92% and
3736 // don't ressurect them as they will deliver duplicate "No such Record" ADD events
3759 event = NextCacheCheckEvent(rr); // then just record when we want the next query
3868 if (m->CurrentQuestion != q) { LogInfo("AnswerNewQuestion: Question deleted while while giving LocalOnly record answers"); goto exit; }
3881 // when we add new /etc/hosts entries and restart the question. It is a new question and also a new record.
3916 // If this record set is marked unique, then that means we can reasonably assume we have the whole set
3934 // Neither a local record nor a cache entry could answer this question. If this question need to be retried
4084 *rp = (*rp)->next; // Cut record from list
4166 // Make sure we mark this record as thoroughly expired -- we don't ever want to give
4167 // a positive answer using an expired record (e.g. from an interface that has gone away).
4168 // We don't want to clear CRActiveQuestion here, because that would leave the record subject to
4193 // To avoid pointless CPU thrash, we use SetSPSProxyListChanged(X) to record the last interface that
4211 if (m->SPSSocket && m->timenow - rr->TimeExpire < 0) // If proxy record not expired yet, update m->NextScheduledSPS
4216 else // else proxy record expired, so remove it
4406 // If we have just one record that is not ready, we don't have to unlink and
4417 AuthRecord **p = &m->ResourceRecords; // Find this record in our list of active records
4419 // if this is the first record we are skipping, move to the end of the list.
4422 if (*p) *p = rr->next; // Cut this record from the list
4423 else { LogMsg("mDNS_Execute: ERROR!! Cannot find record %s in ResourceRecords list", ARDisplayString(m, rr)); break; }
4592 // returns results for both at the same time. If we are looking for the _autotunnel6 record, then skip this logic
4691 // /etc/hosts has an A Record for web.apple.com. Any queries for web.apple.com will be answered locally.
4698 if (!CacheRecordRmvEventsForQuestion(m, q)) { LogInfo("mDNSCoreRestartAddressQueries: Question deleted while delivering Cache Record RMV events"); continue; }
4701 if (!LocalRecordRmvEventsForQuestion(m, q)) { LogInfo("mDNSCoreRestartAddressQueries: Question deleted while delivering Local Record RMV events"); continue; }
4889 opt.resrec.rdlength = sizeof(rdataOPT) * 2; // Two options in this OPT record
4905 LogMsg("SendSPSRegistration: Failed to put OPT record (%d updates) %s", m->omsg.h.mDNS_numUpdates, ARDisplayString(m, &opt));
4968 // Retry any record registrations that are due
4998 // 1. Got the SRV record; now look up the target host's IPv6 link-local address
5007 // 2. Got the target host's IPv6 link-local address; record address and initiate an SPS registration if appropriate
5026 // 4. Got an IPv4 address for the target host; record address and initiate an SPS registration if appropriate
5209 // on wake we go through our record list and clear updateid back to zero
5279 // Don't need to "goto notready" here, because if we do still have record registrations
5280 // that have not been acknowledged yet, we'll catch that in the record list scan below.
5318 { LogSPS("mDNSCoreReadyForSleep: waiting for Record Update ID %d %s", mDNSVal16(rr->updateid), ARDisplayString(m,rr)); goto notready; }
5355 // more for SPS resolves and record registrations to complete, which puts us at 26 seconds.
5444 if (rr->NR_AnswerTo == ptr) // If we're going to generate a record answering this question
5483 // AuthRecord *our is our Resource Record
5484 // CacheRecord *pkt is the Resource Record from the response packet we've witnessed on the network
5509 // See if we have an authoritative record that's identical to this packet record,
5510 // whose canonical DependentOn record is the specified master record.
5511 // The DependentOn pointer is typically used for the TXT record of service registrations
5512 // It indicates that there is no inherent conflict detection for the TXT record
5513 // -- it depends on the SRV record to resolve name conflicts
5515 // pointer chain (if any) to make sure we reach the canonical DependentOn record
5516 // If the record has no DependentOn, then just return that record's pointer
5562 // 1. If our record is not a type that's supposed to be unique, we don't care.
5563 // 2a. If our record is marked as dependent on some other record for conflict detection, ignore this one.
5564 // 2b. If the packet rr exactly matches one of our other RRs, and *that* record's DependentOn pointer
5565 // points to our record, ignore this conflict (e.g. the packet record matches one of our
5566 // TXT records, and that record is marked as dependent on 'our', its SRV record).
5567 // 3. If we have some *other* RR that exactly matches the one from the packet, and that record and our record
5574 // If a dependent record, not a conflict
5584 // relationship between the records, having any matching record
5594 // the record list and/or question list.
5618 LogMsg("ResolveSimultaneousProbe: %p Pkt Record: %08lX %s", q->InterfaceID, m->rec.r.resrec.rdatahash, CRDisplayString(m, &m->rec.r));
5619 LogMsg("ResolveSimultaneousProbe: %p Our Record %d %s %08lX %s", our->resrec.InterfaceID, our->ProbeCount, msg, our->resrec.rdatahash, ARDisplayString(m, our));
5636 LogMsg("ResolveSimultaneousProbe: %p Pkt Record: %08lX %s", q->InterfaceID, m->rec.r.resrec.rdatahash, CRDisplayString(m, &m->rec.r));
5637 LogMsg("ResolveSimultaneousProbe: %p Our Record %d ign: %08lX %s", our->resrec.InterfaceID, our->ProbeCount, our->resrec.rdatahash, ARDisplayString(m, our));
5644 LogInfo("ResolveSimultaneousProbe: %##s (%s): No Update Record found", our->resrec.name->c, DNSTypeName(our->resrec.rrtype));
5664 // to check our lists and discard any stale duplicates of this record we already have
5690 // Called from ProcessQuery when we get an mDNS packet with an owner record in it
5749 // *** 1. Look in Additional Section for an OPT record
5798 // can result in user callbacks which may change the record list and/or question list.
5825 // If we're not multicasting this record because the kDNSQClass_UnicastResponse bit was set,
5842 // If we don't have any answers for this question, but we do own another record with the same name,
5843 // then we'll want to mark it to generate an NSEC record on this interface
5921 if (rr->NR_AnswerTo) // If we marked the record...
5932 for (i=0; i<query->h.numAnswers; i++) // For each record in the query's answer section...
5934 // Get the record...
6030 // If this record was marked for modern (delayed) unicast response, then mark it as promoted to
6032 // If this record was marked for legacy unicast response, then we mustn't change the NR_AnswerTo value.
6052 rr->ImmedAnswer = InterfaceID; // Record interface to send it on
6068 // else, if record is a shared one, spread responses over 100ms to avoid implosion of simultaneous responses
6069 // else, for a simple unique record reply, we can reply immediately; no need for delay
6157 // If we've seen multiple unanswered queries for this record,
6162 // Only show debugging message if this record was not about to expire anyway
6178 // By setting the record to expire in four minutes, we achieve two things:
6185 // Only show debugging message if this record was not about to expire anyway
6293 // DNS server or a response to the QU query. Hence, the cache record's InterfaceId can be both NULL or non-NULL (QU case)
6367 if (cg) rr = GetCacheRecord(m, cg, RDLength); // Make a cache record, being careful not to recycle cg
6377 // If this is an oversized record with external storage allocated, copy rdata to external storage
6386 *(cg->rrcache_tail) = rr; // Append this record to tail of cache slot list
6436 // Suppose real record as TTL of 3600, and our local caching server has held it for 3500 seconds, so it returns an aged TTL of 100.
6439 // To avoid this, we extend the record's effective TTL to give it a little extra grace period.
6442 // to fetch a fresh copy from the authoritative server, and then return a fresh record with the full TTL of 3600 seconds.
6445 // For mDNS, TTL zero means "delete this record"
6449 // respectively, and then if we get no response, delete the record from the cache at 15 seconds.
6451 // and when we delete the record at 15 seconds. Allowing cache lifetimes less than 15 seconds would
6453 // before we deleted the record and reported a "remove" event to any active questions.
6464 // the record list and/or question list.
6488 // security, e.g. DNSSEC., not worring about which section in the spoof packet contained the record
6537 // we could instead use the "m->PktNum" mechanism to tag each cache record with the packet number in
6618 // if a CNAME record points to itself, then don't add it to the cache
6628 // In the case of polling LLQs, we assume the record remains valid until the next poll
6655 // Intialize the DNS server on the resource record which will now filter what questions we answer with
6656 // this record.
6676 // the question. The code below does that. So, make this record unacceptable for now
6679 debugf("mDNSCoreReceiveResponse: Can't find question for record name %##s", m->rec.r.resrec.name->c);
6686 // 1. Check that this packet resource record does not conflict with any of ours
6698 // (apparently) local source address that pertain to a record of our own that's in probing state
6701 if (PacketRRMatchesSignature(&m->rec.r, rr)) // If interface, name, type (if shared record) and class match...
6721 LogInfo("mDNSCoreReceiveResponse: Pkt Record: %08lX %s", m->rec.r.resrec.rdatahash, CRDisplayString(m, &m->rec.r));
6722 LogInfo("mDNSCoreReceiveResponse: Our Record: %08lX %s", rr-> resrec.rdatahash, ARDisplayString(m, rr));
6724 // If this record is marked DependentOn another record for conflict detection purposes,
6725 // then *that* record has to be bumped back to probing state to resolve the conflict
6729 LogInfo("mDNSCoreReceiveResponse: Dep Record: %08lX %s", rr-> resrec.rdatahash, ARDisplayString(m, rr));
6732 // If we've just whacked this record's ProbeCount, don't need to do it again
6740 // If we'd previously verified this record, put it back to probing state and try again
6745 // We set ProbeCount to one more than the usual value so we know we've already touched this record.
6754 // If we're probing for this record, we just failed
6760 // We assumed this record must be unique, but we were wrong. (e.g. There are two mDNSResponders on the
6761 // same machine giving different answers for the reverse mapping record, or there are two machines on the
6764 // record to avoid continued conflicts (as we do for a conflict on our Unique records) and get on with life.
6771 LogMsg("mDNSCoreReceiveResponse: Unexpected record type %X %s", rr->resrec.RecordType, ARDisplayString(m, rr));
6775 // If the packet record has the cache-flush bit set, then we check to see if we
6776 // have any record(s) of the same type that we should re-assert to rescue them
6791 // When we issue a query for A record, the response might contain both a CNAME and A records. Only the CNAME would
6793 // the A record, it does not match the question because the record name here is the CNAME. Hence we try to
6795 // DNSServer value that we got in the previous pass. This can happen for other record types like SRV also.
6807 // 2. See if we want to add this packet resource record to our cache
6817 // 2a. Check if this packet resource record is already in our cache
6821 // If we found this exact resource record, refresh its TTL
6825 verbosedebugf("Found record size %5d interface %p already in cache: %s",
6830 // If this packet record has the kDNSClass_UniqueRRSet flag set, then add it to our cache flushing list
6834 // If this packet record
6845 // If the rdata of the packet record differs in name capitalization from the record in our cache
6846 // then mDNSPlatformMemSame will detect this. In this case, throw the old record away, so that clients get
6847 // a 'remove' event for the record with the old capitalization, and then an 'add' event for the new one.
6870 // Currently, we do this for for both multicast and unicast questions as long as the record
6871 // type is unique. For unicast, resource record is always unique and for multicast it is
6895 // If the packet TTL is zero, that means we're deleting this record.
6898 // Otherwise, we'll do final queries for this record at 80% and 90% of its apparent
6900 // If record's current expiry time is more than a second from now, we set it to expire in one second.
6901 // If the record is already going to expire in less than one second anyway, we leave it alone --
6902 // we don't want to let the goodbye packet *extend* the record's lifetime in our cache.
6916 // If packet resource record not in our cache, add it now
6917 // (unless it is just a deletion of a record we never had, in which case we don't care)
6955 // remaining to live. Otherwise, a record that we tagged for deletion half a second ago
6957 // (a) if we got an explicit goodbye packet half a second ago, the record would be considered
6959 // or (b) otherwise, the record would not be fully resurrected, but would be reset to expire
6961 // If this were to happen repeatedly, the record's expiration could be deferred indefinitely.
6963 // *decrease* a record's remaining lifetime, never *increase* it.
6971 // If record is recent, just ensure the whole RRSet has the same TTL (as required by DNS semantics)
6972 // else, if record is old, mark it to be flushed
6977 // goodbye announcement with the cache flush bit set (or a case-change on record rdata,
6984 // to give us an aged TTL to correct for how long it has held the record,
6996 else // else, if record is old, mark it to be flushed
7006 // will promptly delete their cached copies of the (still valid) Ethernet IP address record.
7011 // final expiration queries for this record.
7013 // If a record is deleted twice, first with an explicit DE record, then a second time by virtue of the cache
7014 // flush bit on the new record replacing it, then we allow the record to be deleted immediately, without the usual
7021 LogInfo("Cache flush for DE record %s", CRDisplayString(m, r2));
7026 // We only set a record to expire in one second if it currently has *more* than a second to live
7032 // that we marked for deletion via an explicit DE record
7038 if (r1->DelayDelivery) // If we were planning to delay delivery of this record, see if we still need to
7075 // in conflict with the mDNS spec, because that spec says, "Multicast DNS Zones have no SOA record," so it's okay to cache
7095 // but then look to see if we can find an SOA authority record to tell us a better value we should be using
7102 // Some cheap home gateways don't include an SOA record in the authority section when
7109 // If we're going to make (or update) a negative entry, then look for the appropriate TTL from the SOA record
7117 // We use the lesser of the SOA.MIN field and the SOA record's TTL, *except*
7118 // for the SOA record for ".", where the record is reported as non-cacheable
7119 // (TTL zero) for some reason, so in this case we just take the SOA record's TTL as-is
7125 // with an Authority Section SOA record for d.com, then this is a hint that the authority
7141 // the case where the record doesn't exist (e.g. particularly for things like our lb._dns-sd._udp.<domain> query),
7142 // and the server returns no SOA record (or an SOA record with a small MIN TTL) so we assume a TTL
7143 // of 60 seconds, and we end up polling the server every minute for a record that doesn't exist.
7183 // ScheduleWakeup is called on mDNS record conflicts, ARP conflicts, NDP conflicts, or reception of trigger traffic
7190 // so all we're doing is marking the record to generate a few wakeup packets
7322 ClearIdenticalProxyRecords(m, &owner, m->DuplicateRecords); // Make sure we don't have any old stale duplicates of this record
7369 opt.resrec.rdlength = sizeof(rdataOPT); // One option in this OPT record
7414 LogSPS("Sleep Proxy %s record %5d %s", rr->WakeUp.HMAC.l[0] ? "transferred" : "registered", updatelease, ARDisplayString(m,rr));
7428 // If we were waiting to go to sleep, then this SPS registration or wide-area record deletion
7444 // Create empty resource record
7591 // doing a standard DNS query for the _dns-query-tls._tcp SRV record for company.com. If we make the latter (public) query
8115 LogInfo("CacheRecordRmvEventsForCurrentQuestion: Calling AnswerCurrentQuestionWithResourceRecord (RMV) for question %##s using resource record %s LocalAnswers %d",
8135 LogInfo("CacheRecordRmvEventsForCurrentQuestion: Updating CRActiveQuestion to %p for cache record %s, "
8180 LogInfo("LocalRecordRmvEventsForQuestion: Delivering possible Rmv events with record %s",
8464 // a matching resource record, all of them get the answers. Calling GetServerForQuestion
8582 debugf("mDNS_StopQuery_internal: Updating CRActiveQuestion to %p for cache record %s, Original question CurrentAnswers %d, new question "
8819 // This implies that we're seeing the exact same SRV record on more than one interface, so we should
9085 LogMsg("Attempt to update record with invalid rdata: %s", GetRRDisplayString_rdb(&rr->resrec, &newrdata->u, m->MsgBuffer));
9146 // the record list and/or question list.
9184 // 1. Set up Address record to map from host name ("foo.local.") to IP address
9185 // 2. Set up reverse-lookup PTR record to map from our address back to our host name
9232 debugf("Not creating HINFO record: platform support layer provided no information");
9336 LogMsg("mDNS_HostNameCallback: Unknown error %d for registration of record %s", result, rr->resrec.name->c);
9566 // the record list and/or question list.
9575 // Find this record in our list
9581 // Unlink this record from our list
9649 // For a flapping interface we want these record to go away after 30 seconds
9708 // Only pass on the NoError acknowledgement for the SRV record (when it finishes probing)
9711 // If we got a name conflict on either SRV or TXT, forcibly deregister this service, and record that we did that
9714 sr->Conflict = mDNStrue; // Record that this service set had a conflict
9721 // If the SRV/TXT/PTR records, or the _services._dns-sd._udp record, or any of the subtype PTR records,
9723 // every record is finished cleaning up.
9764 // left waiting forever looking for a nonexistent record.)
9814 // If the client is registering an oversized TXT record,
9819 // Set up the record names
9820 // For now we only create an advisory record for the main type, not for subtypes
9828 // 1. Set up the ADV record rdata to advertise our service type
9831 // 2. Set up the PTR record rdata to point to our service name
9833 // Note: uDNS registration code assumes that Additional1 points to the SRV record
9840 // already set the first label of the record name to the subtype being registered
9854 // 3. Set up the SRV record rdata.
9863 // 4. Set up the TXT record rdata,
9864 // and set DependentOn because we're depending on the SRV record to find and resolve conflicts for us
9865 // Note: uDNS registration code assumes that DependentOn points to the SRV record
9880 // If we can't register the SRV record due to errors, bail out. It has not been inserted in
9934 debugf("mDNS_AddRecordToService adding record to %##s %s %d",
9955 debugf("mDNS_RemoveRecordFromService failed to remove record from %##s", extra->r.resrec.name->c);
9960 debugf("mDNS_RemoveRecordFromService removing record from %##s", extra->r.resrec.name->c);
10011 // which may change the record list and/or question list.
10028 // an mStatus_NameConflict message when we get the mStatus_MemFree for our PTR record.
10228 // For all types of ARP packet we check the Sender IP address to make sure it doesn't conflict with any AddressProxy record we're holding.
10317 // Pass 2: For all types of NDP packet we check the Sender IP address to make sure it doesn't conflict with any AddressProxy record we're holding.
10453 if (!r2 && mDNSSameIPPort(port, IPSECPort)) r2 = rr; // So that we wake for BTMM IPSEC packets, even without a matching SRV record
10559 // Record our new SPS parameters
10829 debugf("PurgeOrReconfirmCacheRecord: %s cache record due to %s server %p %#a:%d (%##s): %s",
10922 LogInfo("CacheRecordResetDNSServer: Found cache record %##s for new DNSServer address: %#a", rp->resrec.name->c,
10955 LogInfo("CacheRecordResetDNSServer: resetting cache record %##s DNSServer address before:%#a,"
11087 // record
11102 // As the DNSServers for this cache record is not the same anymore, we don't
11141 // server here to match the question and the cache record.
11144 // events for the questions, the DNSServer on the question should match the Cache Record
11188 // If we don't have an active question for this cache record, neither Purge can
11190 // pointer on the record NULL so that we don't point to freed memory (We might dereference
11191 // DNSServer pointers from resource record for logging purposes).
11196 // this question. Hence, whenever we hit a resource record with a DNSServer that is just
11204 LogMsg("uDNS_SetupDNSConfig: Cache Record %s match: Active question %##s (%s) with DNSServer Address NULL, Server to be deleted %#a",
11207 LogMsg("uDNS_SetupDNSConfig: Cache Record %s match: Active question %##s (%s) DNSServer Address %#a, Server to be deleted %#a",
11223 LogInfo("uDNS_SetupDNSConfig: Cache Record %##s has no Active question, Record's DNSServer Address %#a, Server to be deleted %#a",
11410 // we allow up to 100ms delay (to help improve record grouping) but when shutting down we don't want any such delay.
11417 if (m->ResourceRecords) LogInfo("mDNS_StartExit: Sending final record deregistrations");