Home | History | Annotate | Download | only in mDNSCore

Lines Matching defs:sps

1111 // For now, to make it easier to avoid false conflicts, we treat SPS Proxy records like shared records,
3994 mDNSlocal void ReorderSPSByFeature(const CacheRecord *sps[3])
3996 CheckAndSwapSPS(&sps[0], &sps[1]);
3997 CheckAndSwapSPS(&sps[0], &sps[2]);
3998 CheckAndSwapSPS(&sps[1], &sps[2]);
4003 mDNSexport void FindSPSInCache(mDNS *const m, const DNSQuestion *const q, const CacheRecord *sps[3])
4005 sps[0] = FindSPSInCache1(m, q, mDNSNULL, mDNSNULL);
4006 sps[1] = !sps[0] ? mDNSNULL : FindSPSInCache1(m, q, sps[0], mDNSNULL);
4007 sps[2] = !sps[1] ? mDNSNULL : FindSPSInCache1(m, q, sps[0], sps[1]);
4009 // SPS is already sorted by metric. We want to move the entries to the beginning of the array
4011 ReorderSPSByFeature(sps);
7434 // with the SPS like any other record. SPS will not send keepalives if it does not have additional information.
7453 // now, then we don't update the DNS NULL record. But we do not prevent it from registering with the SPS. When SPS sees
7512 const int sps = intf->NextSPSAttempt / 3;
7518 if (!intf->SPSAddr[sps].type)
7523 LogSPS("SendSPSRegistration: %s SPS %d (%d) %##s not yet resolved", intf->ifname, intf->NextSPSAttempt, sps, intf->NetWakeResolve[sps].qname.c);
7527 // Mark our mDNS records (not unicast records) for transfer to SPS
7567 // For now we follow that same logic for SPS registrations too.
7568 // If we decide to compress SRV records in SPS registrations in the future, we can achieve that by creating our
7641 LogSPS("SendSPSRegistration: Sending Update %s %d (%d) id %5d with %d records %d bytes to %#a:%d", intf->ifname, intf->NextSPSAttempt, sps,
7642 mDNSVal16(m->omsg.h.id), m->omsg.h.mDNS_numUpdates, p - m->omsg.data, &intf->SPSAddr[sps], mDNSVal16(intf->SPSPort[sps]));
7644 err = mDNSSendDNSMessage(m, &m->omsg, p, intf->InterfaceID, mDNSNULL, mDNSNULL, &intf->SPSAddr[sps], intf->SPSPort[sps], mDNSNULL, mDNSfalse);
7646 if (err && intf->SPSAddr[sps].type == mDNSAddrType_IPv4 && intf->NetWakeResolve[sps].ThisQInterval == -1)
7648 LogSPS("SendSPSRegistration %d %##s failed to send to IPv4 address; will try IPv6 instead", sps, intf->NetWakeResolve[sps].qname.c);
7649 intf->NetWakeResolve[sps].qtype = kDNSType_AAAA;
7650 mDNS_StartQuery_internal(m, &intf->NetWakeResolve[sps]);
7759 LogSPS("SPSInitRecordsBeforeUpdate: scopeid %d beyond range or not valid for SPS registration", scopeid);
7817 // For interfaces where we did an SPS registration attempt, increment intf->NextSPSAttempt
7826 int sps = (int)(question - intf->NetWakeResolve);
7828 LogSPS("NetWakeResolve: SPS: %d Add: %d %s", sps, AddRecord, RRDisplayString(m, answer));
7833 // if (answer->rrtype == kDNSType_AAAA && sps == 0) return; // To test failing to resolve sleep proxy's address
7839 intf->SPSPort[sps] = answer->rdata->u.srv.port;
7846 // 2. Got an IPv4 address for the target host; record address and initiate an SPS registration if appropriate
7849 intf->SPSAddr[sps].type = mDNSAddrType_IPv4;
7850 intf->SPSAddr[sps].ip.v4 = answer->rdata->u.ipv4;
7852 if (sps == intf->NextSPSAttempt/3) SendSPSRegistration(m, intf, zeroID); // If we're ready for this result, use it now
7859 LogSPS("NetWakeResolve: SPS %d %##s has no IPv4 address, will try IPv6 instead", sps, question->qname.c);
7865 // 4. Got the target host's IPv6 link-local address; record address and initiate an SPS registration if appropriate
7868 intf->SPSAddr[sps].type = mDNSAddrType_IPv6;
7869 intf->SPSAddr[sps].ip.v6 = answer->rdata->u.ipv6;
7871 if (sps == intf->NextSPSAttempt/3) SendSPSRegistration(m, intf, zeroID); // If we're ready for this result, use it now
7910 SleepRecordRegistrations(m); // If we have no SPS, need to deregister our uDNS records
7989 const CacheRecord *sps[3] = { mDNSNULL };
7998 // Clear out the SCDynamic entry that stores the external SPS information
8047 FindSPSInCache(m, &intf->NetWakeBrowse, sps);
8048 if (!sps[0]) LogSPS("BeginSleepProcessing: %-6s %#a No Sleep Proxy Server found (Next Browse Q in %d, interval %d)",
8075 if (sps[i])
8077 LogSPS("BeginSleepProcessing: %-6s Found Sleep Proxy Server %d TTL %d %s", intf->ifname, i, sps[i]->resrec.rroriginalttl, CRDisplayString(m, sps[i]));
8078 mDNS_SetupQuestion(&intf->NetWakeResolve[i], intf->InterfaceID, &sps[i]->resrec.rdata->u.name, kDNSType_SRV, NetWakeResolve, intf);
8363 LogSPS("mDNSCoreReadyForSleep: retrying for %s SPS %d try %d",
8377 int sps = (intf->NextSPSAttempt == 0) ? 0 : (intf->NextSPSAttempt-1)/3;
8378 if (intf->NetWakeResolve[sps].ThisQInterval >= 0)
8380 LogSPS("mDNSCoreReadyForSleep: waiting for SPS Resolve %s %##s (%s)",
8381 intf->ifname, intf->NetWakeResolve[sps].qname.c, DNSTypeName(intf->NetWakeResolve[sps].qtype));
8390 { LogSPS("mDNSCoreReadyForSleep: waiting for SPS updateIntID 0x%x 0x%x (updateid %d) %s", rr->updateIntID.l[1], rr->updateIntID.l[0], mDNSVal16(rr->updateid), ARDisplayString(m,rr)); goto spsnotready; }
8419 LogMsg("Failed to register with SPS, now sending goodbyes");
8441 // more for SPS resolves and record registrations to complete, which puts us at 26 seconds.
12822 LogRedact(MDNS_LOG_CATEGORY_SPS, MDNS_LOG_DEFAULT, "SPS Callback %d " PRI_S, result, ARDisplayString(m, ar));
13427 LogSPS("SPS Registered %4d %X %s", m->ProxyRecords, RecordType, ARDisplayString(m,ar));
13495 const mDNSu32 updatelease = gotlease ? pktlease : 60 * 60; // If SPS fails to indicate lease time, assume one hour
13551 // If we were waiting to go to sleep, then this SPS registration or wide-area record deletion
18156 mDNSexport void mDNSCoreBeSleepProxyServer_internal(mDNS *const m, mDNSu8 sps, mDNSu8 port, mDNSu8 marginalpower, mDNSu8 totpower, mDNSu8 features)
18161 // If turning off SPS, close our socket
18163 if (!sps && m->SPSSocket) { mDNSPlatformUDPClose(m->SPSSocket); m->SPSSocket = mDNSNULL; }
18167 if (m->SPSState == 1 && sps != m->SPSType)
18168 { m->SPSState = 2; mDNS_DeregisterService_drt(m, &m->SPSRecords, sps ? mDNS_Dereg_rapid : mDNS_Dereg_normal); }
18171 // Record our new SPS parameters
18172 m->SPSType = sps;
18178 if (sps)
18495 LogSPS("Renaming SPS from ā€œ%#sā€ to ā€œ%#sā€", name.c, newname.c);