Lines Matching refs:intf
338 NetworkInterfaceInfo *intf;
344 for (intf = m->HostInterfaces; intf; intf = intf->next)
345 if (intf->ip.type == addr->type && intf->InterfaceID == InterfaceID && intf->McastTxRx)
346 if (((intf->ip.ip.v4.NotAnInteger ^ addr->ip.v4.NotAnInteger) & intf->mask.ip.v4.NotAnInteger) == 0)
353 for (intf = m->HostInterfaces; intf; intf = intf->next)
354 if (intf->ip.type == addr->type && intf->InterfaceID == InterfaceID && intf->McastTxRx)
355 if ((((intf->ip.ip.v6.l[0] ^ addr->ip.v6.l[0]) & intf->mask.ip.v6.l[0]) == 0) &&
356 (((intf->ip.ip.v6.l[1] ^ addr->ip.v6.l[1]) & intf->mask.ip.v6.l[1]) == 0) &&
357 (((intf->ip.ip.v6.l[2] ^ addr->ip.v6.l[2]) & intf->mask.ip.v6.l[2]) == 0) &&
358 (((intf->ip.ip.v6.l[3] ^ addr->ip.v6.l[3]) & intf->mask.ip.v6.l[3]) == 0))
367 NetworkInterfaceInfo *intf = m->HostInterfaces;
368 while (intf && intf->InterfaceID != InterfaceID) intf = intf->next;
369 return(intf);
374 NetworkInterfaceInfo *intf = FirstInterfaceForID(m, InterfaceID);
375 return(intf ? intf->ifname : mDNSNULL);
1050 NetworkInterfaceInfo *intf = FirstInterfaceForID(m, rr->resrec.InterfaceID);
1051 if (intf && !intf->Advertise){ rr->resrec.InterfaceID = mDNSInterface_LocalOnly; rr->ARType = AuthRecordLocalOnly; }
1108 NetworkInterfaceInfo *intf = FirstInterfaceForID(m, rr->resrec.InterfaceID);
1109 if (!intf)
1666 NetworkInterfaceInfo *intf = FirstInterfaceForID(m, InterfaceID);
1688 if (intf && !mDNSPlatformValidRecordForInterface(rr, intf))
1857 NetworkInterfaceInfo *intf = FirstInterfaceForID(m, rr->resrec.InterfaceID);
1858 if (!intf) { LogMsg("SendARP: No interface with InterfaceID %p found %s", rr->resrec.InterfaceID, ARDisplayString(m,rr)); return; }
1864 for (i=0; i<6; i++) *ptr++ = intf->MAC.b[0];
1877 for (i=0; i<6; i++) *ptr++ = intf->MAC.b[i];
1928 NetworkInterfaceInfo *intf = FirstInterfaceForID(m, rr->resrec.InterfaceID);
1929 if (!intf) { LogMsg("SendNDP: No interface with InterfaceID %p found %s", rr->resrec.InterfaceID, ARDisplayString(m,rr)); return; }
1946 for (i=0; i<6; i++) *ptr++ = (tha ? *tha : intf->MAC).b[i];
1983 for (i=0; i<6; i++) *ptr++ = (tha ? *tha : intf->MAC).b[i];
1993 for (i=0; i<6; i++) *ptr++ = (tha ? *tha : intf->MAC).b[i];
2005 mDNSlocal void SetupOwnerOpt(const mDNS *const m, const NetworkInterfaceInfo *const intf, rdataOPT *const owner)
2010 owner->u.owner.IMAC = intf->MAC;
2016 owner->optlen = DNSOpt_Owner_Space(&m->PrimaryMAC, &intf->MAC) - 4;
2046 const NetworkInterfaceInfo *intf = GetFirstActiveInterface(m->HostInterfaces);
2203 rr->SendRNow = !intf ? mDNSNULL : (rr->resrec.InterfaceID) ? rr->resrec.InterfaceID : intf->InterfaceID;
2232 while (intf)
2234 const int OwnerRecordSpace = (m->AnnounceOwner && intf->MAC.l[0]) ? DNSOpt_Header_Space + DNSOpt_Owner_Space(&m->PrimaryMAC, &intf->MAC) : 0;
2251 if ((rr->SendRNow == intf->InterfaceID) &&
2252 ((rr->resrec.InterfaceID == mDNSInterface_Any) && !mDNSPlatformValidRecordForInterface(rr, intf)))
2255 rr->SendRNow = GetNextActiveInterfaceID(intf);
2257 else if (rr->SendRNow == intf->InterfaceID)
2263 (m->SleepState != SleepState_Sleeping || intf->SPSAddr[0].type || intf->SPSAddr[1].type || intf->SPSAddr[2].type));
2301 rr->SendRNow = GetNextActiveInterfaceID(intf);
2311 if (rr->ImmedAdditional == intf->InterfaceID)
2325 a->LastMCInterface == intf->InterfaceID &&
2351 rr->LastMCInterface = intf->InterfaceID;
2358 // (recognized by rr->SendNSECNow == intf->InterfaceID) we should really put the NSEC in the Answer Section,
2361 if (rr->SendNSECNow == mDNSInterfaceMark || rr->SendNSECNow == intf->InterfaceID)
2389 if (r2->SendNSECNow == mDNSInterfaceMark || r2->SendNSECNow == intf->InterfaceID)
2405 SetupOwnerOpt(m, intf, &opt.resrec.rdata->u.opt[0]);
2420 m->omsg.h.numAdditionals, m->omsg.h.numAdditionals == 1 ? "" : "s", intf->InterfaceID);
2422 if (intf->IPv4Available) mDNSSendDNSMessage(m, &m->omsg, responseptr, intf->InterfaceID, mDNSNULL, &AllDNSLinkGroup_v4, MulticastDNSPort, mDNSNULL, mDNSNULL);
2423 if (intf->IPv6Available) mDNSSendDNSMessage(m, &m->omsg, responseptr, intf->InterfaceID, mDNSNULL, &AllDNSLinkGroup_v6, MulticastDNSPort, mDNSNULL, mDNSNULL);
2430 const NetworkInterfaceInfo *next = GetFirstActiveInterface(intf->next);
2433 debugf(msg, intf, next);
2435 intf = next;
2716 mDNSlocal mDNSBool SuppressOnThisInterface(const DupSuppressInfo ds[DupSuppressInfoSize], const NetworkInterfaceInfo * const intf)
2719 mDNSBool v4 = !intf->IPv4Available; // If this interface doesn't do v4, we don't need to find a v4 duplicate of this query
2720 mDNSBool v6 = !intf->IPv6Available; // If this interface doesn't do v6, we don't need to find a v6 duplicate of this query
2722 if (ds[i].InterfaceID == intf->InterfaceID)
2859 const NetworkInterfaceInfo *intf = GetFirstActiveInterface(m->HostInterfaces);
2975 q->SendQNow = !intf ? mDNSNULL : (q->InterfaceID) ? q->InterfaceID : intf->InterfaceID;
3028 ar->SendRNow = (!intf || ar->WakeUp.HMAC.l[0]) ? mDNSNULL : ar->resrec.InterfaceID ? ar->resrec.InterfaceID : intf->InterfaceID;
3078 while (intf)
3080 const int OwnerRecordSpace = (m->AnnounceOwner && intf->MAC.l[0]) ? DNSOpt_Header_Space + DNSOpt_Owner_Space(&m->PrimaryMAC, &intf->MAC) : 0;
3093 if (mDNSOpaque16IsZero(q->TargetQID) && (q->SendQNow == intf->InterfaceID))
3096 SuppressOnThisInterface(q->DupSuppress, intf
3100 if (SuppressOnThisInterface(q->DupSuppress, intf) ||
3103 q->SendQNow = (q->InterfaceID || !q->SendOnAll) ? mDNSNULL : GetNextActiveInterfaceID(intf);
3115 if (ar->SendRNow == intf->InterfaceID)
3127 ar->SendRNow = (ar->resrec.InterfaceID) ? mDNSNULL : GetNextActiveInterfaceID(intf);
3179 SetupOwnerOpt(m, intf, &opt.resrec.rdata->u.opt[0]);
3198 m->omsg.h.numAuthorities, m->omsg.h.numAuthorities == 1 ? "" : "s", intf->InterfaceID);
3199 if (intf->IPv4Available) mDNSSendDNSMessage(m, &m->omsg, queryptr, intf->InterfaceID, mDNSNULL, &AllDNSLinkGroup_v4, MulticastDNSPort, mDNSNULL, mDNSNULL);
3200 if (intf->IPv6Available) mDNSSendDNSMessage(m, &m->omsg, queryptr, intf->InterfaceID, mDNSNULL, &AllDNSLinkGroup_v6, MulticastDNSPort, mDNSNULL, mDNSNULL);
3209 const NetworkInterfaceInfo *next = GetFirstActiveInterface(intf->next);
3212 debugf(msg, intf, next);
3214 intf = next;
3260 NetworkInterfaceInfo *intf = FirstInterfaceForID(m, InterfaceID);
3261 if (!intf) { LogMsg("SendARP: No interface with InterfaceID %p found", InterfaceID); return; }
3267 for (i=0; i<6; i++) *ptr++ = intf->MAC.b[0];
4794 NetworkInterfaceInfo *intf;
4795 for (intf = GetFirstActiveInterface(m->HostInterfaces); intf; intf = GetFirstActiveInterface(intf->next))
4797 if (intf->McastTxRx && !intf->Loopback)
4800 if (!intf->NetWake)
4803 mDNS_snprintf(reason, sizeof(reason), "%s does not support NetWake", intf->ifname);
4804 LogInfo("Sleep disabled because %s does not support NetWake", intf->ifname);
4809 if (FindSPSInCache1(m, &intf->NetWakeBrowse, mDNSNULL, mDNSNULL) == mDNSNULL)
4812 mDNS_snprintf(reason, sizeof(reason), "%s does not support NetWake", intf->ifname);
4813 LogInfo("Sleep disabled because %s has no sleep proxy", intf->ifname);
4826 mDNSlocal void SendSPSRegistrationForOwner(mDNS *const m, NetworkInterfaceInfo *const intf, const mDNSOpaque16 id, const OwnerOptData *const owner)
4828 const int optspace = DNSOpt_Header_Space + DNSOpt_LeaseData_Space + DNSOpt_Owner_Space(&m->PrimaryMAC, &intf->MAC);
4829 const int sps = intf->NextSPSAttempt / 3;
4832 if (!intf->SPSAddr[sps].type)
4834 intf->NextSPSAttemptTime = m->timenow + mDNSPlatformOneSecond;
4835 if (m->NextScheduledSPRetry - intf->NextSPSAttemptTime > 0)
4836 m->NextScheduledSPRetry = intf->NextSPSAttemptTime;
4837 LogSPS("SendSPSRegistration: %s SPS %d (%d) %##s not yet resolved", intf->ifname, intf->NextSPSAttempt, sps, intf->NetWakeResolve[sps].qname.c);
4845 if (rr->resrec.InterfaceID == intf->InterfaceID || (!rr->resrec.InterfaceID && (rr->ForceMCast || IsLocalDomain(rr->resrec.name))))
4869 LogSPS("SendSPSRegistration put %s FAILED %d/%d %s", intf->ifname, p - m->omsg.data, limit - m->omsg.data, ARDisplayString(m, rr));
4872 LogSPS("SendSPSRegistration put %s %s", intf->ifname, ARDisplayString(m, rr));
4895 SetupOwnerOpt(m, intf, &opt.resrec.rdata->u.opt[1]); // use our own interface information
4902 LogSPS("SendSPSRegistration put %s %s", intf->ifname, ARDisplayString(m, &opt));
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]));
4912 // if (intf->NextSPSAttempt < 5) m->omsg.h.flags = zeroID; // For simulating packet loss
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]);
4926 intf->NextSPSAttemptTime = m->timenow + mDNSPlatformOneSecond * 10; // If successful, update NextSPSAttemptTime
4929 if (mDNSOpaque16IsZero(id) && intf->NextSPSAttempt < 8) intf->NextSPSAttempt++;
4940 mDNSlocal void SendSPSRegistration(mDNS *const m, NetworkInterfaceInfo *const intf, const mDNSOpaque16 id)
4945 SendSPSRegistrationForOwner(m, intf, id, &owner);
4952 SendSPSRegistrationForOwner(m, intf, id, &owner);
4961 NetworkInterfaceInfo *intf;
4964 for (intf = GetFirstActiveInterface(m->HostInterfaces); intf; intf = GetFirstActiveInterface(intf->next))
4965 if (intf->NextSPSAttempt && intf->NextSPSAttemptTime == m->timenow + mDNSPlatformOneSecond * 10)
4966 intf->NextSPSAttemptTime++;
4971 for (intf = GetFirstActiveInterface(m->HostInterfaces); intf; intf = GetFirstActiveInterface(intf->next))
4972 if (!rr->resrec.InterfaceID || rr->resrec.InterfaceID == intf->InterfaceID)
4975 SendSPSRegistration(m, intf, rr->updateid);
4978 // For interfaces where we did an SPS registration attempt, increment intf->NextSPSAttempt
4979 for (intf = GetFirstActiveInterface(m->HostInterfaces); intf; intf = GetFirstActiveInterface(intf->next))
4980 if (intf->NextSPSAttempt && intf->NextSPSAttemptTime == m->timenow + mDNSPlatformOneSecond * 10 && intf->NextSPSAttempt < 8)
4981 intf->NextSPSAttempt++;
4986 NetworkInterfaceInfo *intf = (NetworkInterfaceInfo *)question->QuestionContext;
4987 int sps = (int)(question - intf->NetWakeResolve);
5000 intf->SPSPort[sps] = answer->rdata->u.srv.port;
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
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
5074 NetworkInterfaceInfo *intf;
5075 for (intf = GetFirstActiveInterface(m->HostInterfaces); intf; intf = GetFirstActiveInterface(intf->next))
5077 if (!intf->NetWake) LogSPS("BeginSleepProcessing: %-6s not capable of magic packet wakeup", intf->ifname);
5079 else if (ActivateLocalProxy(m, intf->ifname) == mStatus_NoError)
5082 LogSPS("BeginSleepProcessing: %-6s using local proxy", intf->ifname);
5090 FindSPSInCache(m, &intf->NetWakeBrowse, sps);
5092 intf->ifname, &intf->ip, NextQSendTime(&intf->NetWakeBrowse) - m->timenow, intf->NetWakeBrowse.ThisQInterval);
5097 intf->NextSPSAttempt = 0;
5098 intf->NextSPSAttemptTime = m->timenow + mDNSPlatformOneSecond;
5103 if (intf->SPSAddr[i].type)
5104 { LogMsg("BeginSleepProcessing: %s %d intf->SPSAddr[i].type %d", intf->ifname, i, intf->SPSAddr[i].type); *(long*)0 = 0; }
5105 if (intf->NetWakeResolve[i].ThisQInterval >= 0)
5106 { LogMsg("BeginSleepProcessing: %s %d intf->NetWakeResolve[i].ThisQInterval %d", intf->ifname, i, intf->NetWakeResolve[i].ThisQInterval); *(long*)0 = 0; }
5108 intf->SPSAddr[i].type = mDNSAddrType_None;
5109 if (intf->NetWakeResolve[i].ThisQInterval >= 0) mDNS_StopQuery(m, &intf->NetWakeResolve[i]);
5110 intf->NetWakeResolve[i].ThisQInterval = -1;
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);
5115 intf->NetWakeResolve[i].ReturnIntermed = mDNStrue;
5116 mDNS_StartQuery_internal(m, &intf->NetWakeResolve[i]);
5184 NetworkInterfaceInfo *intf;
5213 for (intf = GetFirstActiveInterface(m->HostInterfaces); intf; intf = GetFirstActiveInterface(intf->next)) intf->NextSPSAttempt = -1;
5259 NetworkInterfaceInfo *intf;
5271 for (intf = GetFirstActiveInterface(m->HostInterfaces); intf; intf = GetFirstActiveInterface(intf->next))
5272 if (intf->NextSPSAttempt >= 0)
5274 if (now - intf->NextSPSAttemptTime >= 0)
5277 intf->ifname, intf->NextSPSAttempt/3, intf->NextSPSAttempt);
5278 SendSPSRegistration(m, intf, zeroID);
5283 if (m->NextScheduledSPRetry - intf->NextSPSAttemptTime > 0)
5284 m->NextScheduledSPRetry = intf->NextSPSAttemptTime;
5288 for (intf = GetFirstActiveInterface(m->HostInterfaces); intf; intf = GetFirstActiveInterface(intf->next))
5290 int sps = (intf->NextSPSAttempt == 0) ? 0 : (intf->NextSPSAttempt-1)/3;
5291 if (intf->NetWakeResolve[sps].ThisQInterval >= 0)
5294 intf->ifname, intf->NetWakeResolve[sps].qname.c, DNSTypeName(intf->NetWakeResolve[sps].qtype));
5335 for (intf = GetFirstActiveInterface(m->HostInterfaces); intf; intf = GetFirstActiveInterface(intf->next))
5336 if (intf->NetWakeBrowse.ThisQInterval >= 0)
5339 intf->ifname, intf->NetWakeResolve[0].qname.c, DNSTypeName(intf->NetWakeResolve[0].qtype));
5340 mDNS_DeactivateNetWake_internal(m, intf);
8362 NetworkInterfaceInfo *intf = FirstInterfaceForID(m, question->InterfaceID);
8363 if (!intf)
8781 NetworkInterfaceInfo *intf;
8782 for (intf = m->HostInterfaces; intf; intf = intf->next)
8783 if (intf->ip.type == mDNSAddrType_IPv6) return(mDNStrue);
9162 NetworkInterfaceInfo *intf;
9163 for (intf = m->HostInterfaces; intf; intf = intf->next)
9164 if (intf->Advertise) break;
9165 return(intf);
9239 NetworkInterfaceInfo *intf;
9244 for (intf = m->HostInterfaces; intf; intf = intf->next)
9245 if (intf->RR_A.RRSet == &set->RR_A)
9246 intf->RR_A.RRSet = A;
9261 NetworkInterfaceInfo *intf;
9276 for (intf = m->HostInterfaces; intf; intf = intf->next)
9277 if (intf->Advertise) DeadvertiseInterface(m, intf);
9280 for (intf = m->HostInterfaces; intf; intf = intf->next)
9281 if (intf->Advertise) AdvertiseInterface(m, intf);
9341 NetworkInterfaceInfo *intf;
9344 for (intf = m->HostInterfaces; intf; intf = intf->next)
9345 if (intf->InterfaceID == active->InterfaceID)
9347 if (intf->ip.type == mDNSAddrType_IPv4 && intf->McastTxRx) active->IPv4Available = mDNStrue;
9348 if (intf->ip.type == mDNSAddrType_IPv6 && intf->McastTxRx) active->IPv6Available = mDNStrue;
9588 NetworkInterfaceInfo *intf;
9589 for (intf = m->HostInterfaces; intf; intf = intf->next)
9590 if (intf->InterfaceActive && intf->InterfaceID == set->InterfaceID)
9591 UpdateInterfaceProtocols(m, intf);
9595 NetworkInterfaceInfo *intf = FirstInterfaceForID(m, set->InterfaceID);
9596 if (intf)
9600 if (intf->InterfaceActive)
9601 LogMsg("mDNS_DeregisterInterface: ERROR intf
9602 intf->InterfaceActive = mDNStrue;
9603 UpdateInterfaceProtocols(m, intf);
9605 if (intf->NetWake) mDNS_ActivateNetWake_internal(m, intf);
9609 for (intf = m->HostInterfaces; intf; intf = intf->next)
9610 if (intf->InterfaceID == set->InterfaceID && intf->ip.type == set->ip.type)
9612 if (!intf) revalidate = mDNStrue;
10193 NetworkInterfaceInfo *intf = FirstInterfaceForID(m, InterfaceID);
10194 if (!intf) return;
10218 mDNSSameEthAddress(&arp->sha, &intf->MAC) ? msg3 : msg4;
10220 intf->ifname, msg, &arp->sha, &arp->spa, &arp->tpa, &rr->WakeUp.HMAC, &rr->WakeUp.IMAC, ARDisplayString(m, rr));
10235 if (mDNSSameEthAddress(&arp->sha, &intf->MAC))
10246 LogSPS("%-7s ARP %s from owner %.6a %.4a for %-15.4a -- re-starting probing for %s", intf->ifname,
10251 LogMsg("%-7s Conflicting ARP from %.6a %.4a for %.4a -- waking H-MAC %.6a I-MAC %.6a %s", intf->ifname,
10281 NetworkInterfaceInfo *intf = FirstInterfaceForID(m, InterfaceID);
10282 if (!intf) return;
10302 sha && mDNSSameEthAddress(sha, &intf->MAC) ? msg3 :
10305 intf
10318 if (mDNSSameEthAddress(sha, &intf->MAC))
10334 LogSPS("%-7s NDP %s from owner %.6a %.16a for %.16a -- re-starting probing for %s", intf->ifname,
10338 LogMsg("%-7s Conflicting NDP from %.6a %.16a for %.16a -- waking H-MAC %.6a I-MAC %.6a %s", intf->ifname,
11333 NetworkInterfaceInfo *intf;
11373 for (intf = m->HostInterfaces; intf; intf = intf->next)
11374 if (intf->Advertise)
11375 DeadvertiseInterface(m, intf);