Lines Matching refs:rdlength

358         *bitmaplen = rr->rdlength - (int)(p - rdb->data);
363 // Note slight bug: this code uses the rdlength from the ResourceRecord object, to display
371 mDNSu32 length = mDNS_snprintf(buffer, MaxMsg-1, "%4d %##s %s ", rr->rdlength, rr->name->c, DNSTypeName(rr->rrtype));
373 if (!rr->rdlength && rr->rrtype != kDNSType_OPT) { mDNS_snprintf(buffer+length, RemSpc, "<< ZERO RDATA LENGTH >>"); return(buffer); }
391 while (t < rd->txt.c + rr->rdlength)
404 const rdataOPT *const end = (const rdataOPT *)&rd->data[rr->rdlength];
451 bitmaplen = rr->rdlength - len;
493 bitmaplen = rr->rdlength - (int)(p - rd->data);
517 rr->rdlength - (len + RRSIG_FIXED_SIZE), ENC_BASE64);
523 DNSSECAlgName(rrkey->alg), (unsigned int)keytag((mDNSu8 *)rrkey, rr->rdlength));
525 rr->rdlength - DNSKEY_FIXED_SIZE, ENC_BASE64);
537 for (i = 0; i < (rr->rdlength - DS_FIXED_SIZE); i++)
544 default: mDNS_snprintf(buffer+length, RemSpc, "RDLen %d: %s", rr->rdlength, rd->data);
1398 // rr->resrec.rdlength = MUST set by client and/or in mDNS_Register_internal
1493 int len = rr->rdlength;
1559 // r1 has to be a full ResourceRecord including rrtype and rdlength
1560 // r2 is just a bare RDataBody, which MUST be the same rrtype and rdlength as r1
1612 // Note: rdlength of both the RData are same (ensured by the caller) and hence we can
1613 // use just r1->rdlength below
1619 mDNSPlatformMemSame(b1->data + dlen1, b2->data + dlen2, r1->rdlength - dlen1));
1622 default: return(mDNSPlatformMemSame(b1->data, b2->data, r1->rdlength));
1691 bitmaplen = rr->rdlength - len;
1980 if (rr->rrclass == kDNSQClass_ANY) return(rr->rdlength); // Used in update packets to mean "Delete An RRset" (RFC 2136)
2000 case kDNSType_DHCID: return(rr->rdlength); // Not self-describing, so have to just trust rdlength
2019 case kDNSType_OPT: return(rr->rdlength);
2026 return (mDNSu16)(CompressedDomainNameLength(next, name) + rr->rdlength - dlen);
2028 return (mDNSu16)((estimate ? 2 : dlen) + rr->rdlength - dlen);
2032 return(rr->rdlength);
2038 mDNSexport mDNSBool ValidateRData(const mDNSu16 rrtype, const mDNSu16 rdlength, const RData *const rd)
2044 case kDNSType_A: return(rdlength == sizeof(mDNSv4Addr));
2056 case kDNSType_PTR: len = DomainNameLengthLimit(&rd->u.name, rd->u.data + rdlength);
2057 return(len <= MAX_DOMAIN_NAME && rdlength == len);
2061 case kDNSType_TXT: if (!rdlength) return(mDNSfalse); // TXT record has to be at least one byte (RFC 1035)
2064 const mDNSu8 *end = rd->u.txt.c + rdlength;
2069 case kDNSType_AAAA: return(rdlength == sizeof(mDNSv6Addr));
2073 len = DomainNameLengthLimit(&rd->u.mx.exchange, rd->u.data + rdlength);
2074 return(len <= MAX_DOMAIN_NAME && rdlength == 2+len);
2078 len = DomainNameLengthLimit(&rd->u.srv.target, rd->u.data + rdlength);
2079 return(len <= MAX_DOMAIN_NAME && rdlength == 6+len);
2226 // Copy the RDATA information. The actual in memory storage for the data might be bigger than what the rdlength
2234 case kDNSType_A: if (rr->rdlength != 4)
2235 { debugf("putRData: Illegal length %d for kDNSType_A", rr->rdlength); return(mDNSNULL); }
2266 case kDNSType_DHCID: if (ptr + rr->rdlength > limit) return(mDNSNULL);
2267 mDNSPlatformMemCopy(ptr, rdb->data, rr->rdlength);
2268 return(ptr + rr->rdlength);
2289 case kDNSType_AAAA: if (rr->rdlength != sizeof(rdb->ipv6))
2290 { debugf("putRData: Illegal length %d for kDNSType_AAAA", rr->rdlength); return(mDNSNULL); }
2307 const rdataOPT *const end = (const rdataOPT *)&rr->rdata->u.data[rr->rdlength];
2359 // For NSEC records, rdlength represents the exact number of bytes
2405 int len = rr->rdlength - dlen;
2424 if (ptr + rr->rdlength > limit) { LogMsg("putRData: NSEC rdlength beyond limit %##s (%s), ptr %p, rdlength %d, limit %p", rr->name->c, DNSTypeName(rr->rrtype), ptr, rr->rdlength, limit); return(mDNSNULL);}
2427 mDNSPlatformMemCopy(ptr, rdb->data, rr->rdlength);
2428 return(ptr + rr->rdlength);
2433 if (ptr + rr->rdlength > limit) return(mDNSNULL);
2434 mDNSPlatformMemCopy(ptr, rdb->data, rr->rdlength);
2435 return(ptr + rr->rdlength);
2487 // (actualLength can be less than rdlength when domain name compression is used)
2580 ptr[8] = ptr[9] = 0; // zero rdlength/rdata
2600 ptr[8] = ptr[9] = 0; // zero rdlength/rdata
2612 rr.resrec.rdlength = sizeof(rdataOPT); // One option in this OPT record
2627 rr.resrec.rdlength = sizeof(rdataOPT); // One option in this OPT record
2645 rr.resrec.rdlength = 0;
2669 hinfo.resrec.rdlength = len;
2699 mDNSexport void SetNewRData(ResourceRecord *const rr, RData *NewRData, mDNSu16 rdlength)
2705 rr->rdlength = rdlength;
2709 rr->rdlength = GetRDLength(rr, mDNSfalse);
2849 LargeCacheRecord *const largecr, mDNSu16 rdlength)
2857 if (rdlength != sizeof(mDNSv4Addr))
2939 rr->resrec.rdlength = rdlength;
2940 mDNSPlatformMemCopy(rdb->data, ptr, rdlength);
2948 if (rdlength < 3)
3003 if (rdlength < 4)
3038 if (rdlength != sizeof(mDNSv6Addr))
3045 if (rdlength < 7)
3080 if (rdlength < 8)
3132 rr->resrec.rdlength = savelen + DomainNameLength(&name);
3134 if (rr->resrec.rdlength > MaximumRDSize)
3136 LogInfo("SetRData: Malformed NAPTR rdlength %d, rr->resrec.rdlength %d, "
3137 "bmaplen %d, name %##s", rdlength, rr->resrec.rdlength, name.c);
3147 rr->resrec.rdlength = 0;
3216 rr->resrec.rdlength = (mDNSu16)((mDNSu8*)opt - rr->resrec.rdata->u.data);
3223 int len = rdlength;
3247 // the rdlength includes only the compressed space in that case. So, can't
3262 // GetRDLength and for NSEC case, it assumes that rdlength is intitialized
3263 rr->resrec.rdlength = DomainNameLength(&name) + bmaplen;
3266 if (rr->resrec.rdlength > MaximumRDSize)
3268 LogInfo("SetRData: Malformed NSEC rdlength %d, rr->resrec.rdlength %d, "
3269 "bmaplen %d, name %##s", rdlength, rr->resrec.rdlength, name.c);
3282 if (rdlength < NSEC3_FIXED_SIZE + 1)
3284 LogInfo("SetRData: NSEC3 too small length %d", rdlength);
3318 bitmaplen = rdlength - (int)(p - ptr);
3322 rr->resrec.rdlength = rdlength;
3323 mDNSPlatformMemCopy(rdb->data, ptr, rdlength);
3350 rr->resrec.rdlength = dlen + rlen;
3360 if (rdlength < RRSIG_FIXED_SIZE + 1)
3362 LogInfo("SetRData: RRSIG too small length %d", rdlength);
3391 rr->resrec.rdlength = rdlength;
3392 mDNSPlatformMemCopy(rdb->data, ptr, rdlength);
3397 if (rdlength < DNSKEY_FIXED_SIZE + 1)
3399 LogInfo("SetRData: DNSKEY too small length %d", rdlength);
3402 rr->resrec.rdlength = rdlength;
3403 mDNSPlatformMemCopy(rdb->data, ptr, rdlength);
3408 if (rdlength < DS_FIXED_SIZE + 1)
3410 LogInfo("SetRData: DS too small length %d", rdlength);
3413 rr->resrec.rdlength = rdlength;
3414 mDNSPlatformMemCopy(rdb->data, ptr, rdlength);
3421 // mean we fail. The DNS protocol specifies rdlength, so we can
3425 rr->resrec.rdlength = rdlength;
3426 mDNSPlatformMemCopy(rdb->data, ptr, rdlength);
3507 rr->resrec.rdlength = 0;
3511 SetNewRData(&rr->resrec, mDNSNULL, 0); // Sets rdlength, rdestimate, rdatahash for us
3519 // returing a 'kDNSRecordTypePacketNegative' record with rdlength set to zero
3521 rr->resrec.rdlength = 0;
3620 if (ptr && m->rec.r.resrec.rdlength >= DNSOpt_LeaseData_Space && m->rec.r.resrec.rdata->u.opt[0].opt == kDNSOpt_Lease)