Home | History | Annotate | Download | only in mDNSCore

Lines Matching refs:sps

634 // For now, to make it easier to avoid false conflicts, we treat SPS Proxy records like shared records,
775 // new ones for sleeping clients, so we'll we send deletions for our SPS clients' AAAA records.
2696 mDNSexport void FindSPSInCache(mDNS *const m, const DNSQuestion *const q, const CacheRecord *sps[3])
2698 sps[0] = FindSPSInCache1(m, q, mDNSNULL, mDNSNULL);
2699 sps[1] = !sps[0] ? mDNSNULL : FindSPSInCache1(m, q, sps[0], mDNSNULL);
2700 sps[2] = !sps[1] ? mDNSNULL : FindSPSInCache1(m, q, sps[0], sps[1]);
4829 const int sps = intf->NextSPSAttempt / 3;
4832 if (!intf->SPSAddr[sps].type)
4837 LogSPS("SendSPSRegistration: %s SPS %d (%d) %##s not yet resolved", intf->ifname, intf->NextSPSAttempt, sps, intf->NetWakeResolve[sps].qname.c);
4841 // Mark our mDNS records (not unicast records) for transfer to SPS
4853 // For now we follow that same logic for SPS registrations too.
4854 // If we decide to compress SRV records in SPS registrations in the future, we can achieve that by creating our
4910 LogSPS("SendSPSRegistration: Sending Update %s %d (%d) id %5d with %d records %d bytes to %#a:%d", intf->ifname, intf->NextSPSAttempt, sps,
4911 mDNSVal16(m->omsg.h.id), m->omsg.h.mDNS_numUpdates, p - m->omsg.data, &intf->SPSAddr[sps], mDNSVal16(intf->SPSPort[sps]));
4913 err = mDNSSendDNSMessage(m, &m->omsg, p, intf->InterfaceID, mDNSNULL, &intf->SPSAddr[sps], intf->SPSPort[sps], mDNSNULL, mDNSNULL);
4915 if (err && intf->SPSAddr[sps].type == mDNSAddrType_IPv6 && intf->NetWakeResolve[sps].ThisQInterval == -1)
4917 LogSPS("SendSPSRegistration %d %##s failed to send to IPv6 address; will try IPv4 instead", sps, intf->NetWakeResolve[sps].qname.c);
4918 intf->NetWakeResolve[sps].qtype = kDNSType_A;
4919 mDNS_StartQuery_internal(m, &intf->NetWakeResolve[sps]);
4978 // For interfaces where we did an SPS registration attempt, increment intf->NextSPSAttempt
4987 int sps = (int)(question - intf->NetWakeResolve);
4989 LogSPS("NetWakeResolve: SPS: %d Add: %d %s", sps, AddRecord, RRDisplayString(m, answer));
4994 // if (answer->rrtype == kDNSType_AAAA && sps == 0) return; // To test failing to resolve sleep proxy's address
5000 intf->SPSPort[sps] = answer->rdata->u.srv.port;
5007 // 2. Got the target host's IPv6 link-local address; record address and initiate an SPS registration if appropriate
5010 intf->SPSAddr[sps].type = mDNSAddrType_IPv6;
5011 intf->SPSAddr[sps].ip.v6 = answer->rdata->u.ipv6;
5013 if (sps == intf->NextSPSAttempt/3) SendSPSRegistration(m, intf, zeroID); // If we're ready for this result, use it now
5020 LogSPS("NetWakeResolve: SPS %d %##s has no IPv6 address, will try IPv4 instead", sps, question->qname.c);
5026 // 4. Got an IPv4 address for the target host; record address and initiate an SPS registration if appropriate
5029 intf->SPSAddr[sps].type = mDNSAddrType_IPv4;
5030 intf->SPSAddr[sps].ip.v4 = answer->rdata->u.ipv4;
5032 if (sps == intf->NextSPSAttempt/3) SendSPSRegistration(m, intf, zeroID); // If we're ready for this result, use it now
5052 SleepRecordRegistrations(m); // If we have no SPS, need to deregister our uDNS records
5066 const CacheRecord *sps[3] = { mDNSNULL };
5090 FindSPSInCache(m, &intf->NetWakeBrowse, sps);
5091 if (!sps[0]) LogSPS("BeginSleepProcessing: %-6s %#a No Sleep Proxy Server found (Next Browse Q in %d, interval %d)",
5111 if (sps[i])
5113 LogSPS("BeginSleepProcessing: %-6s Found Sleep Proxy Server %d TTL %d %s", intf->ifname, i, sps[i]->resrec.rroriginalttl, CRDisplayString(m, sps[i]));
5114 mDNS_SetupQuestion(&intf->NetWakeResolve[i], intf->InterfaceID, &sps[i]->resrec.rdata->u.name, kDNSType_SRV, NetWakeResolve, intf);
5276 LogSPS("mDNSCoreReadyForSleep: retrying for %s SPS %d try %d",
5290 int sps = (intf->NextSPSAttempt == 0) ? 0 : (intf->NextSPSAttempt-1)/3;
5291 if (intf->NetWakeResolve[sps].ThisQInterval >= 0)
5293 LogSPS("mDNSCoreReadyForSleep: waiting for SPS Resolve %s %##s (%s)",
5294 intf->ifname, intf->NetWakeResolve[sps].qname.c, DNSTypeName(intf->NetWakeResolve[sps].qtype));
5303 { LogSPS("mDNSCoreReadyForSleep: waiting for SPS Update ID %d %s", mDNSVal16(rr->updateid), ARDisplayString(m,rr)); goto spsnotready; }
5333 LogMsg("Failed to register with SPS, now sending goodbyes");
5355 // more for SPS resolves and record registrations to complete, which puts us at 26 seconds.
7211 LogInfo("SPS Callback %d %s", result, ARDisplayString(m, ar));
7348 // new ones for sleeping clients, so we'll we send deletions for our SPS clients' AAAA records.
7353 LogSPS("SPS Registered %4d %X %s", m->ProxyRecords, RecordType, ARDisplayString(m,ar));
7384 mDNSu32 updatelease = 60 * 60; // If SPS fails to indicate lease time, assume one hour
7428 // If we were waiting to go to sleep, then this SPS registration or wide-area record deletion
10546 mDNSexport void mDNSCoreBeSleepProxyServer_internal(mDNS *const m, mDNSu8 sps, mDNSu8 port, mDNSu8 marginalpower, mDNSu8 totpower)
10551 // If turning off SPS, close our socket
10553 if (!sps && m->SPSSocket) { mDNSPlatformUDPClose(m->SPSSocket); m->SPSSocket = mDNSNULL; }
10556 if (m->SPSState == 1 && sps != m->SPSType)
10557 { m->SPSState = 2; mDNS_DeregisterService_drt(m, &m->SPSRecords, sps ? mDNS_Dereg_rapid : mDNS_Dereg_normal); }
10559 // Record our new SPS parameters
10560 m->SPSType = sps;
10566 if (sps)
10801 LogSPS("Renaming SPS from ?%#s? to ?%#s?", name.c, newname.c);