Lines Matching refs:ar

75 mDNSlocal void mDNS_ExtractKeepaliveInfo(AuthRecord *ar, mDNSu32 *timeout, mDNSAddr *laddr, mDNSAddr *raddr, mDNSEthAddr *eth,
3263 AuthRecord *ar;
3458 ar = m->CurrentRecord;
3459 m->CurrentRecord = ar->next;
3460 if (!AuthRecord_uDNS(ar) && ar->resrec.RecordType == kDNSRecordTypeUnique) // For all records that are still probing...
3463 if (m->timenow - (ar->LastAPTime + ar->ThisAPInterval) < 0)
3465 SetNextAnnounceProbeTime(m, ar);
3468 else if (ar->ProbeCount)
3470 if (ar->AddressProxy.type == mDNSAddrType_IPv4)
3477 LogSPS("SendQueries ARP Probe %d %s %s", ar->ProbeCount, InterfaceNameForID(m, ar->resrec.InterfaceID), ARDisplayString(m,ar));
3478 SendARP(m, 1, ar, &zerov4Addr, &zeroEthAddr, &ar->AddressProxy.ip.v4, &ar->WakeUp.IMAC);
3480 else if (ar->AddressProxy.type == mDNSAddrType_IPv6)
3482 LogSPS("SendQueries NDP Probe %d %s %s", ar->ProbeCount, InterfaceNameForID(m, ar->resrec.InterfaceID), ARDisplayString(m,ar));
3487 SendNDP(m, NDP_Sol, 0, ar, &zerov6Addr, mDNSNULL, &ar->AddressProxy.ip.v6, &ar->WakeUp.IMAC);
3490 ar->SendRNow = (!intf || ar->WakeUp.HMAC.l[0]) ? mDNSNULL : ar->resrec.InterfaceID ? ar->resrec.InterfaceID : intf->InterfaceID;
3491 ar->LastAPTime = m->timenow;
3493 // than DefaultProbeCountForTypeUnique. Here we detect that state and reset ar->ProbeCount back to the right value.
3494 if (ar->ProbeCount > DefaultProbeCountForTypeUnique)
3495 ar->ProbeCount = DefaultProbeCountForTypeUnique;
3496 ar->ProbeCount--;
3497 SetNextAnnounceProbeTime(m, ar);
3498 if (ar->ProbeCount == 0)
3504 if (r2->resrec.RecordType == kDNSRecordTypeUnique && RecordIsLocalDuplicate(r2, ar))
3514 if (!ar->Acknowledged) AcknowledgeRecord(m, ar);
3521 if (!ar->Acknowledged) AcknowledgeRecord(m, ar); // Defensive, just in case it got missed somehow
3522 ar->resrec.RecordType = kDNSRecordTypeVerified;
3523 ar->ThisAPInterval = DefaultAnnounceIntervalForTypeUnique;
3524 ar->LastAPTime = m->timenow - DefaultAnnounceIntervalForTypeUnique;
3525 SetNextAnnounceProbeTime(m, ar);
3532 ar = m->CurrentRecord;
3533 m->CurrentRecord = ar->next;
3534 if (ar->resrec.RecordType == kDNSRecordTypeUnique && ar->ProbeCount == 0 && !ar->Acknowledged)
3535 AcknowledgeRecord(m, ar);
3607 for (ar = m->ResourceRecords; ar; ar=ar->next)
3608 if (ar->SendRNow == intf->InterfaceID)
3610 mDNSBool ucast = (ar->ProbeCount >= DefaultProbeCountForTypeUnique-1) && m->CanReceiveUnicastOn5353;
3614 mDNSu32 forecast = answerforecast + 12 + ar->resrec.rdestimate;
3615 mDNSu8 *newptr = putQuestion(&m->omsg, queryptr, limit - forecast, ar->resrec.name, kDNSQType_ANY, (mDNSu16)(ar->resrec.rrclass | ucbit));
3620 ar->SendRNow = (ar->resrec.InterfaceID) ? mDNSNULL : GetNextActiveInterfaceID(intf);
3621 ar->IncludeInProbe = mDNStrue;
3623 ar->resrec.name->c, DNSTypeName(ar->resrec.rrtype), ar->ProbeCount);
3654 for (ar = m->ResourceRecords; ar; ar=ar->next)
3656 if (ar->IncludeInProbe)
3658 mDNSu8 *newptr = PutResourceRecord(&m->omsg, queryptr, &m->omsg.h.numAuthorities, &ar->resrec);
3659 ar->IncludeInProbe = mDNSfalse;
3661 else LogMsg("SendQueries: How did we fail to have space for the Update record %s", ARDisplayString(m,ar));
3753 for (ar = m->ResourceRecords; ar; ar=ar->next)
3754 if (ar->SendRNow)
3756 if (ar->ARType != AuthRecordLocalOnly && ar->ARType != AuthRecordP2P)
3758 (uint32_t)ar->SendRNow, (uint32_t)ar->resrec.InterfaceID, ARDisplayString(m, ar));
3759 ar->SendRNow = mDNSNULL;
5911 AuthRecord *ar;
5912 for (ar = m->ResourceRecords; ar && ar != rr; ar=ar->next)
5913 if (mDNSPlatformMemSame(&rr->WakeUp, &ar->WakeUp, sizeof(rr->WakeUp))) return mDNSfalse;
5960 AuthRecord *ar;
5971 for (ar = m->ResourceRecords; ar; ar=ar->next)
5973 ar->updateIntID = zeroOpaque64;
5974 ar->updateid = zeroID;
5975 if (AuthRecord_uDNS(ar))
5979 if (ar->AuthFlags & AuthFlagsWakeOnly)
5981 if (ar->resrec.RecordType == kDNSRecordTypeShared && ar->RequireGoodbye)
5983 ar->ImmedAnswer = mDNSInterfaceMark;
5988 if (!ar->resrec.InterfaceID)
5990 LogSPS("Setting scopeid (ALL) 0x%x 0x%x for %s", updateIntID.l[1], updateIntID.l[0], ARDisplayString(m, ar));
5991 ar->updateIntID = updateIntID;
5997 mDNSu32 scopeid = mDNSPlatformInterfaceIndexfromInterfaceID(m, ar->resrec.InterfaceID, mDNStrue);
6000 bit_set_opaque64(ar->updateIntID, scopeid);
6001 LogSPS("SPSInitRecordsBeforeUpdate: Setting scopeid(%d) 0x%x 0x%x for %s", scopeid, ar->updateIntID.l[1],
6002 ar->updateIntID.l[0], ARDisplayString(m, ar));
6011 if (ar->resrec.rrtype == kDNSType_A || ar->resrec.rrtype == kDNSType_AAAA)
6013 mDNSCoreStoreProxyRR(m, ar->resrec.InterfaceID, ar);
6020 AuthRecord *ar;
6025 for (ar = m->ResourceRecords; ar; ar=ar->next)
6027 if (!mDNSPlatformMemSame(&owner, &ar->WakeUp, sizeof(owner)) && RecordIsFirstOccurrenceOfOwner(m, ar))
6029 owner = ar->WakeUp;
6717 AuthRecord *ar;
6742 for (ar = m->ResourceRecords; ar; ar = ar->next)
6743 if (ar->expire && ar->expire - now > mDNSPlatformOneSecond*4)
6745 mDNSs32 t = ar->expire - (ar->expire - now) / 10; // Wake up when 90% of the way to the expiry time
6748 ar, ar->ThisAPInterval / mDNSPlatformOneSecond,
6749 (ar->LastAPTime + ar->ThisAPInterval - now) / mDNSPlatformOneSecond,
6750 ar->expire ? (ar->expire - now) / mDNSPlatformOneSecond : 0,
6751 (t - now) / mDNSPlatformOneSecond, ARDisplayString(m, ar));
9528 mDNSlocal void SPSRecordCallback(mDNS *const m, AuthRecord *const ar, mStatus result)
9531 LogInfo("SPS Callback %d %s", result, ARDisplayString(m, ar));
9536 LogMsg("%-7s Conflicting mDNS -- waking %.6a %s", InterfaceNameForID(m, ar->resrec.InterfaceID), &ar->WakeUp.HMAC, ARDisplayString(m, ar));
9537 if (ar->WakeUp.HMAC.l[0])
9539 SendWakeup(m, ar->resrec.InterfaceID, &ar->WakeUp.IMAC, &ar->WakeUp.password); // Send one wakeup magic packet
9540 ScheduleWakeup(m, ar->resrec.InterfaceID, &ar->WakeUp.HMAC); // Schedule all other records with the same owner to be woken
9548 mDNSPlatformMemFree(ar);
9743 mDNSlocal void mDNS_ExtractKeepaliveInfo(AuthRecord *ar, mDNSu32 *timeout, mDNSAddr *laddr, mDNSAddr *raddr, mDNSEthAddr *eth, mDNSu32 *seq,
9746 if (ar->resrec.rrtype != kDNSType_NULL)
9749 if (mDNS_KeepaliveRecord(&ar->resrec))
9751 int len = ar->resrec.rdlength;
9752 mDNSu8 *ptr = &ar->resrec.rdata->u.txt.c[1];
9836 AuthRecord *ar;
9843 for (ar = m->ResourceRecords; ar; ar=ar->next)
9850 if (!ar->WakeUp.HMAC.l[0]) continue;
9852 mDNS_ExtractKeepaliveInfo(ar, &timeout, &laddr, &raddr, &eth, &seq, &ack, &lport, &rport, &win);
9857 debugf("mDNS_MatchKeepaliveInfo: not a valid record %s for keepalive", ARDisplayString(m, ar));
9870 return ar;
9878 AuthRecord *ar;
9880 for (ar = m->ResourceRecords; ar; ar=ar->next)
9894 if (!ar->WakeUp.HMAC.l[0]) continue;
9896 mDNS_ExtractKeepaliveInfo(ar, &timeout, &laddr, &raddr, &eth, &seq, &ack, &lport, &rport, &win);
9900 debugf("mDNS_SendKeepalives: not a valid record %s for keepalive", ARDisplayString(m, ar));
9907 if (!ar->KATimeExpire || (m->timenow - ar->KATimeExpire >= 0))
9910 ar->KATimeExpire = NonZeroTime(m->timenow + timeout * mDNSPlatformOneSecond);
9912 if (m->NextScheduledKA - ar->KATimeExpire > 0)
9913 m->NextScheduledKA = ar->KATimeExpire;
9917 mDNSlocal void mDNS_SendKeepaliveACK(mDNS *const m, AuthRecord *ar)
9919 if (ar != mDNSNULL)
9936 mDNS_ExtractKeepaliveInfo(ar, &timeout, &laddr, &raddr, &eth, &seq, &ack, &lport, &rport, &win);
9940 LogInfo("mDNS_SendKeepaliveACK: not a valid record %s for keepalive", ARDisplayString(m, ar));
10035 AuthRecord *ar = mDNSPlatformMemAllocate(sizeof(AuthRecord) - sizeof(RDataBody) + RDLengthMem);
10036 if (!ar)
10051 mDNS_SetupResourceRecord(ar, mDNSNULL, InterfaceID, m->rec.r.resrec.rrtype, m->rec.r.resrec.rroriginalttl, RecordType, AuthRecordAny, SPSRecordCallback, ar);
10052 AssignDomainName(&ar->namestorage, m->rec.r.resrec.name);
10053 ar->resrec.rdlength = GetRDLength(&m->rec.r.resrec, mDNSfalse);
10054 ar->resrec.rdata->MaxRDLength = RDLengthMem;
10055 mDNSPlatformMemCopy(ar->resrec.rdata->u.data, m->rec.r.resrec.rdata->u.data, RDLengthMem);
10056 ar->ForceMCast = mDNStrue;
10057 ar->WakeUp = owner;
10061 if (t == mDNSAddrType_IPv4) GetIPv4FromName(&ar->AddressProxy, m->rec.r.resrec.name);
10062 else if (t == mDNSAddrType_IPv6) GetIPv6FromName(&ar->AddressProxy, m->rec.r.resrec.name);
10063 debugf("mDNSCoreReceiveUpdate: PTR %d %d %#a %s", t, ar->AddressProxy.type, &ar->AddressProxy, ARDisplayString(m, ar));
10064 if (ar->AddressProxy.type) SetSPSProxyListChanged(InterfaceID);
10066 ar->TimeRcvd = m->timenow;
10067 ar->TimeExpire = m->timenow + updatelease * mDNSPlatformOneSecond;
10068 if (m->NextScheduledSPS - ar->TimeExpire > 0)
10069 m->NextScheduledSPS = ar->TimeExpire;
10070 ar->KATimeExpire = 0;
10071 mDNS_Register_internal(m, ar);
10075 LogSPS("SPS Registered %4d %X %s", m->ProxyRecords, RecordType, ARDisplayString(m,ar));
14981 mDNS_Deregister_internal(m, &dereg->ar, mDNS_Dereg_normal); // Memory will be freed in the FreeARElemCallback