Lines Matching refs:RData
702 const domainname *const cname = &rr->rdata->u.name;
703 const mDNSBool selfref = SameDomainName(&q->qname, &rr->rdata->u.name);
756 AssignDomainName(&q->qname, &rr->rdata->u.name); // Update qname
1089 // TTL and rdata may differ.
1112 // and require the rrtypes to match for the rdata to be considered potentially conflicting
1136 // so now we just need to check the name, type, class, rdata and TTL.
1340 // because changing its rdata may change the outcome of the tie-breaker.
1344 // If we've announced this record, we really should send a goodbye packet for the old rdata before
1345 // changing to the new rdata. However, in practice, we only do SetTargetToHostName for unique records,
1866 //if (rr->resrec.rrtype == kDNSType_SRV) rr->NATinfo.IntPort = rr->resrec.rdata->u.srv.port;
1873 // rr->resrec.rdata = MUST be set by client, unless record type is CNAME or PTR and rr->HostTarget is set
1875 // BIND named (name daemon) doesn't allow TXT records with zero-length rdata. This is strictly speaking correct,
1878 if (rr->resrec.rrtype == kDNSType_TXT && rr->resrec.rdlength == 0) { rr->resrec.rdlength = 1; rr->resrec.rdata->u.txt.c[0] = 0; }
1907 if (!ValidateRData(rr->resrec.rrtype, rr->resrec.rdlength, rr->resrec.rdata))
1909 LogRedact(MDNS_LOG_CATEGORY_STATE, MDNS_LOG_DEFAULT, "Attempt to register record with invalid rdata: " PRI_S, ARDisplayString(m, rr));
2066 RData *OldRData = rr->resrec.rdata;
2068 SetNewRData(&rr->resrec, rr->NewRData, rr->newrdlength); // Update our rdata
2093 const rdataOPT *const opt = (const rdataOPT *)&ar->resrec.rdata->u.data[0];
2118 const rdataOPT *const opt = (const rdataOPT *)&rr->resrec.rdata->u.data[0];
2166 RData rdatastorage = {sizeof(RDataBody), 0, {0}};
2171 next_opt.rdata = &rdatastorage;
2176 SetupTSROpt(next->tsr, &next_opt.rdata->u.opt[0]);
2228 return &tsrOptRecord->resrec.rdata->u.opt[0].u.tsr;
2492 if (rr->NewRData) CompleteRDataUpdate(m, rr); // Update our rdata, clear the NewRData pointer, and return memory to the client
2633 SameDomainName(&rr->resrec.rdata->u.srv.target, rr2->resrec.name))
2648 SameDomainLabel(rr->resrec.rdata->u.name.c, m->DeviceInfo.resrec.name->c))
2771 SetupTSROpt(SLIST_FIRST(&tsrOpts)->tsr, &opt.resrec.rdata->u.opt[0]);
3275 SameDomainName(&rr->resrec.rdata->u.srv.target, r2->resrec.name) &&
3282 if (ResourceRecordIsValidAnswer(&m->DeviceInfo) && SameDomainLabel(rr->resrec.rdata->u.name.c, m->DeviceInfo.resrec.name->c))
3391 RData *OldRData = rr->resrec.rdata;
3578 SetupOwnerOpt(m, intf, &opt.resrec.rdata->u.opt[optCount++]);
3584 SetupTracerOpt(m, &opt.resrec.rdata->u.opt[optCount++]);
3590 SetupTSROpt(SLIST_FIRST(&tsrOpts)->tsr, &opt.resrec.rdata->u.opt[optCount++]);
3671 if (rr->NewRData) CompleteRDataUpdate(m, rr); // Update our rdata, clear the NewRData pointer, and return memory to the client
3834 // We forecast: compressed name (2) type (2) class (2) TTL (4) rdlength (2) rdata (n)
3895 if (cr->resrec.rdatahash != namehash) continue; // Skip records whose rdata hash doesn't match the name hash.
3964 mDNSu32 metric = SPSMetric(cr->resrec.rdata->u.name.c);
3984 metric1 = SPSMetric((*sps1)->resrec.rdata->u.name.c);
3985 metric2 = SPSMetric((*sps2)->resrec.rdata->u.name.c);
3986 if (!SPSFeatures((*sps1)->resrec.rdata->u.name.c) && SPSFeatures((*sps2)->resrec.rdata->u.name.c) && (metric2 >= metric1))
4199 // We forecast: compressed name (2) type (2) class (2) TTL (4) rdlength (2) rdata (n)
4840 // compressed name (2) type (2) class (2) TTL (4) rdlength (2) estimated rdata length
4948 SetupOwnerOpt(m, intf, &opt.resrec.rdata->u.opt[optCount++]);
4954 SetupTracerOpt(m, &opt.resrec.rdata->u.opt[optCount++]);
4960 SetupTSROpt(SLIST_FIRST(&tsrOpts)->tsr, &opt.resrec.rdata->u.opt[optCount++]);
5717 mDNSBool generateRemoveEvents = (cr->resrec.rdata->MaxRDLength > 0);
5793 if (rr->resrec.rdata && rr->resrec.rdata != (RData*)&rr->smallrdatastorage)
5795 mDNSPlatformMemFree(rr->resrec.rdata);
5796 rr->resrec.rdata = mDNSNULL;
5820 if (r->resrec.rdata && r->resrec.rdata != (RData*)&r->smallrdatastorage) mDNSPlatformMemFree(r->resrec.rdata);
5821 r->resrec.rdata = mDNSNULL;
6469 r->resrec.rdata = (RData*)&r->smallrdatastorage; // By default, assume we're usually going to be using local storage
6472 r->resrec.rdata = (RData*) mDNSPlatformMemAllocateClear(sizeofRDataHeader + RDLength);
6473 if (r->resrec.rdata) r->resrec.rdata->MaxRDLength = r->resrec.rdlength = RDLength;
7325 mDNSu32 metric = SPSMetric(cr->resrec.rdata->u.name.c);
7391 // If this is a non-sleep proxy keepalive record and the remote IP address matches, update the RData
7429 RData *newrd;
7487 newrd = (RData *) mDNSPlatformMemAllocate(sizeof(RData) - sizeof(RDataBody) + rdsize);
7493 // If we are updating the record for the first time, rdata points to rdatastorage as the rdata memory
7497 if ( rr->resrec.rdata != &rr->rdatastorage)
7500 mDNSPlatformMemFree(rr->resrec.rdata);
7502 SetNewRData(&rr->resrec, newrd, newrdlength); // Update our rdata
7620 opt.resrec.rdata->u.opt[0].opt = kDNSOpt_Lease;
7621 opt.resrec.rdata->u.opt[0].optlen = DNSOpt_LeaseData_Space - 4;
7622 opt.resrec.rdata->u.opt[0].u.updatelease = DEFAULT_UPDATE_LEASE;
7624 SetupOwnerOpt(m, intf, &opt.resrec.rdata->u.opt[1]); // use our own interface information
7627 opt.resrec.rdata->u.opt[1].u.owner = *owner;
7628 opt.resrec.rdata->u.opt[1].opt = kDNSOpt_Owner;
7629 opt.resrec.rdata->u.opt[1].optlen = DNSOpt_Owner_Space(&owner->HMAC, &owner->IMAC) - 4;
7692 newRR->resrec.rdata->u.ipv4 = rr->resrec.rdata->u.ipv4;
7696 newRR->resrec.rdata->u.ipv6 = rr->resrec.rdata->u.ipv6;
7839 intf->SPSPort[sps] = answer->rdata->u.srv.port;
7840 AssignDomainName(&question->qname, &answer->rdata->u.srv.target);
7850 intf->SPSAddr[sps].ip.v4 = answer->rdata->u.ipv4;
7863 else if (answer->rrtype == kDNSType_AAAA && answer->rdlength == sizeof(mDNSv6Addr) && mDNSv6AddressIsLinkLocal(&answer->rdata->u.ipv6))
7869 intf->SPSAddr[sps].ip.v6 = answer->rdata->u.ipv6;
7881 if (mDNS_KeepaliveRecord(&rr->resrec) || (rr->resrec.rrtype == kDNSType_SRV && !AuthRecord_uDNS(rr) && !mDNSSameIPPort(rr->resrec.rdata->u.srv.port, DiscardPort)))
8078 mDNS_SetupQuestion(&intf->NetWakeResolve[i], intf->InterfaceID, &sps[i]->resrec.rdata->u.name, kDNSType_SRV, NetWakeResolve, intf);
8666 // as one of our records (our) but different rdata.
8706 const TSROptData *ourTSROpt = &ourTSRRec->rdata->u.opt[0].u.tsr;
8970 // Normally, the RDATA of the keepalive record will be different each time and hence we always
9091 const rdataOPT *const e = (const rdataOPT *)&m->rec.r.resrec.rdata->u.data[m->rec.r.resrec.rdlength];
9093 for (opt = &m->rec.r.resrec.rdata->u.opt[0]; opt < e; opt++)
9745 // Currently this applies only to rdata types containing more than one domainname,
9831 rdataOPT * const rdata = &ourTsr->resrec.rdata->u.opt[0];
9832 if (new || timestampContinuous - rdata->u.tsr.timeStamp > 0) // Always enter if new
9834 rdata->opt = kDNSOpt_TSR;
9835 rdata->optlen = DNSOpt_TSRData_Space - 4;
9836 rdata->u.tsr.timeStamp = timestampContinuous;
9837 rdata->u.tsr.hostkeyHash = curTSROpt->hostkeyHash;
9838 rdata->u.tsr.recIndex = 0;
9874 // LogInfo("Rdata len %4d > InlineCacheRDSize %d %s", RDLength, InlineCacheRDSize, CRDisplayString(m, &m->rec.r));
9881 RData *saveptr = rr->resrec.rdata; // Save the rr->resrec.rdata pointer
9886 rr->resrec.rdata = saveptr; // Restore rr->resrec.rdata after the structure assignment
9912 // If this is an oversized record with external storage allocated, copy rdata to external storage
9913 if (rr->resrec.rdata == (RData*)&rr->smallrdatastorage && RDLength > InlineCacheRDSize)
9914 LogMsg("rr->resrec.rdata == &rr->rdatastorage but length > InlineCacheRDSize %##s", m->rec.r.resrec.name->c);
9915 else if (rr->resrec.rdata != (RData*)&rr->smallrdatastorage && RDLength <= InlineCacheRDSize)
9916 LogMsg("rr->resrec.rdata != &rr->rdatastorage but length <= InlineCacheRDSize %##s", m->rec.r.resrec.name->c);
9918 mDNSPlatformMemCopy(rr->resrec.rdata, m->rec.r.resrec.rdata, sizeofRDataHeader + RDLength);
10154 if (SameDomainName(rr->name, &rr->rdata->u.name))
10161 AssignDomainName(&(cnames[cnameCount][1]), &rr->rdata->u.name);
10296 // structure that is represented by mDNSResponder. To construct the uncompressed rdata from the resource
10298 // Other than SOA, NSEC/NSEC3/RRSIG can use the rdata parsed by GetLargeResourceRecord() directly because
10311 outObjNSECs[*outNSECCount] = dnssec_obj_rr_nsec_create(rr->name->c, rr->rdata->u.data, rr->rdlength, mDNStrue, &err);
10323 outObjNSEC3s[*outNSEC3Count] = dnssec_obj_rr_nsec3_create(rr->name->c, rr->rdata->u.data, rr->rdlength, mDNStrue, &err);
10331 dnssec_obj_rr_rrsig_t rrsig = dnssec_obj_rr_rrsig_create(rr->name->c, rr->rdata->u.data, rr->rdlength, mDNStrue, &err);
10742 const rdataSOA *const soa = (const rdataSOA *)m->rec.r.resrec.rdata->u.data;
11221 if (!SameRDataBody(&m->rec.r.resrec, &cr->resrec.rdata->u, SameDomainNameCS))
11223 // If the rdata of the packet record differs in name capitalization from the record in our cache
11331 // host is deregistering the record, only print the domain name in the RDATA if the RDATA type
11336 ptrDomain = &resrec->rdata->u.name;
11607 const rdataOPT *const e = (const rdataOPT *)&m->rec.r.resrec.rdata->u.data[m->rec.r.resrec.rdlength];
11609 for (opt = &m->rec.r.resrec.rdata->u.opt[0]; opt < e; opt++)
11920 const rdataOPT *const e = (const rdataOPT *)&m->rec.r.resrec.rdata->u.data[m->rec.r.resrec.rdlength];
11923 for (opt = &m->rec.r.resrec.rdata->u.opt[0]; opt < e; opt++)
11933 if ((m->rec.r.resrec.rrtype == kDNSType_CNAME) && SameDomainName(m->rec.r.resrec.name, &m->rec.r.resrec.rdata->u.name))
12101 // ... check to see if type and rdata are identical
12116 // else, the packet RR has different type or different rdata -- check to see if this is a conflict
12244 // Else, matching signature, different type or rdata, but not a considered a conflict.
12558 // goodbye announcement with the cache flush bit set (or a case-change on record rdata,
12649 // which sets rroriginalttl to 1, but not records tagged by the rdata case-change check, which sets rroriginalttl to 0.
13087 mDNSu8 *ptr = &ar->resrec.rdata->u.txt.c[1];
13331 const rdataOPT *const e = (const rdataOPT *)&m->rec.r.resrec.rdata->u.data[m->rec.r.resrec.rdlength];
13332 for (o = &m->rec.r.resrec.rdata->u.opt[0]; o < e; o++)
13406 ar->resrec.rdata->MaxRDLength = RDLengthMem;
13407 mDNSPlatformMemCopy(ar->resrec.rdata->u.data, m->rec.r.resrec.rdata->u.data, RDLengthMem);
13445 opt.resrec.rdata->u.opt[0].opt = kDNSOpt_Lease;
13446 opt.resrec.rdata->u.opt[0].u.updatelease = updatelease;
13469 SetupOwnerOpt(m, intf, &opt.resrec.rdata->u.opt[0]);
13584 cr->resrec.rdata = (RData*)&cr->smallrdatastorage;
13585 cr->resrec.rdata->MaxRDLength = 0;
16170 const mDNSu16 newrdlength, RData *const newrdata, mDNSRecordUpdateCallback *Callback)
16174 LogMsg("Attempt to update record with invalid rdata: %s", GetRRDisplayString_rdb(&rr->resrec, &newrdata->u, m->MsgBuffer));
16186 RData *n = rr->NewRData;
16208 mDNSPlatformMemSame(rr->resrec.rdata->u.data, newrdata->u.data, newrdlength)))
16347 addrAR->resrec.rdata->u.ipv4 = set->ip.ip.v4;
16356 addrAR->resrec.rdata->u.ipv6 = set->ip.ip.v6;
16387 // must be after the mDNS_Register_internal() calls so that records have complete rdata fields, etc
17248 const domainname *const host, mDNSIPPort port, RData *const txtrdata, const mDNSu8 txtinfo[], mDNSu16 txtlen,
17287 if (sr->RR_TXT.resrec.rdata->MaxRDLength < txtlen)
17288 sr->RR_TXT.resrec.rdata->MaxRDLength = txtlen;
17299 // 1. Set up the ADV record rdata to advertise our service type
17300 AssignDomainName(&sr->RR_ADV.resrec.rdata->u.name, sr->RR_PTR.resrec.name);
17302 // 2. Set up the PTR record rdata to point to our service name
17305 AssignDomainName(&sr->RR_PTR.resrec.rdata->u.name, sr->RR_SRV.resrec.name);
17320 AssignDomainName(&sr->SubTypes[i].resrec.rdata->u.name, &sr->RR_SRV.namestorage);
17325 // 3. Set up the SRV record rdata.
17326 sr->RR_SRV.resrec.rdata->u.srv.priority = 0;
17327 sr->RR_SRV.resrec.rdata->u.srv.weight = 0;
17328 sr->RR_SRV.resrec.rdata->u.srv.port = port;
17331 if (host && host->c[0]) AssignDomainName(&sr->RR_SRV.resrec.rdata->u.srv.target, host);
17332 else { sr->RR_SRV.AutoTarget = Target_AutoHost; sr->RR_SRV.resrec.rdata->u.srv.target.c[0] = '\0'; }
17334 // 4. Set up the TXT record rdata,
17338 else if (txtinfo != sr->RR_TXT.resrec.rdata->u.txt.c)
17341 if (sr->RR_TXT.resrec.rdlength > sr->RR_TXT.resrec.rdata->MaxRDLength) return(mStatus_BadParamErr);
17342 mDNSPlatformMemCopy(sr->RR_TXT.resrec.rdata->u.txt.c, txtinfo, txtlen);
17383 ExtraResourceRecord *extra, RData *rdata, mDNSu32 ttl, mDNSu32 flags)
17394 mDNS_SetupResourceRecord(&extra->r, rdata, sr->RR_PTR.resrec.InterfaceID,
17477 const domainname *host = sr->RR_SRV.AutoTarget ? mDNSNULL : &sr->RR_SRV.resrec.rdata->u.srv.target;
17497 host, sr->RR_SRV.resrec.rdata->u.srv.port,
17498 (sr->RR_TXT.resrec.rdata != &sr->RR_TXT.rdatastorage) ? sr->RR_TXT.resrec.rdata : mDNSNULL,
17499 sr->RR_TXT.resrec.rdata->u.txt.c, sr->RR_TXT.resrec.rdlength,
17510 err = mDNS_AddRecordToService(m, sr, e, e->r.resrec.rdata, e->r.resrec.rroriginalttl, 0);
17522 if (mDNSIPPortIsZero(sr->RR_SRV.resrec.rdata->u.srv.port)) return(mDNS_DeregisterNoSuchService(m, &sr->RR_SRV));
17601 rr->resrec.rdata->u.srv.priority = 0;
17602 rr->resrec.rdata->u.srv.weight = 0;
17603 rr->resrec.rdata->u.srv.port = zeroIPPort;
17604 if (host && host->c[0]) AssignDomainName(&rr->resrec.rdata->u.srv.target, host);
17622 if (!MakeDomainNameFromDNSNameString(&rr->resrec.rdata->u.name, domname)) return(mStatus_BadParamErr);
18054 r2->resrec.rrtype == kDNSType_SRV && mDNSSameIPPort(r2->resrec.rdata->u.srv.port, port) &&