Lines Matching refs:len

269 mDNSexport int baseEncode(char *buffer, int blen, const mDNSu8 *data, int len, int encAlg)
281 AlgAdd(ctx, data, len);
448 int len, bitmaplen;
450 len = DomainNameLength(next);
451 bitmaplen = rr->rdlength - len;
452 bmap = (mDNSu8 *)((mDNSu8 *)next + len);
503 int len;
515 len = DomainNameLength((domainname *)&rrsig->signerName);
516 baseEncode(buffer + length, RemSpc, (const mDNSu8 *)(rd->data + len + RRSIG_FIXED_SIZE),
517 rr->rdlength - (len + RRSIG_FIXED_SIZE), ENC_BASE64);
625 const int len = *a++;
627 if (len > MAX_DOMAIN_LABEL)
630 if (len != *b++) return(mDNSfalse);
631 for (i=0; i<len; i++)
897 const mDNSu8 len = *src++; // Read length of this (non-null) label
898 const mDNSu8 *const end = src + len; // Work out where the label ends
899 if (len > MAX_DOMAIN_LABEL) return(mDNSNULL); // If illegal label, abort
977 int i, len;
1001 len = *src;
1002 for (i=0; i <= len; i++) *dst++ = *src++;
1019 len = *src;
1020 if (len >= 0x40) { errormsg = "Service instance name too long"; goto fail; }
1021 for (i=0; i<=len; i++) *dst++ = *src++;
1027 len = *src;
1028 if (len < 2 || len > 16)
1037 if (len < 2 || len >= 0x40 || (len > 16 && !SameDomainName(domain, &localdomain))) return(mDNSNULL);
1039 for (i=2; i<=len; i++)
1046 if ((src[i] == '-' || src[i] == '_') && i > 2 && i < len)
1067 for (i=0; i<=len; i++) *dst++ = *src++;
1069 len = *src;
1071 for (i=0; i<=len; i++) *dst++ = *src++;
1096 int i, len;
1102 len = *src;
1103 if (!len) { debugf("DeconstructServiceName: FQDN empty!"); return(mDNSfalse); }
1104 if (len >= 0x40) { debugf("DeconstructServiceName: Instance name too long"); return(mDNSfalse); }
1105 for (i=0; i<=len; i++) *dst++ = *src++;
1108 len = *src;
1109 if (!len) { debugf("DeconstructServiceName: FQDN contains only one label!"); return(mDNSfalse); }
1110 if (len >= 0x40) { debugf("DeconstructServiceName: Application protocol name too long"); return(mDNSfalse); }
1112 for (i=0; i<=len; i++) *dst++ = *src++;
1114 len = *src;
1115 if (!len) { debugf("DeconstructServiceName: FQDN contains only two labels!"); return(mDNSfalse); }
1118 for (i=0; i<=len; i++) *dst++ = *src++;
1124 len = *src;
1125 if (len >= 0x40)
1127 if (src + 1 + len + 1 >= max)
1129 for (i=0; i<=len; i++) *dst++ = *src++;
1141 int i, len;
1150 len = *a++;
1151 *b++ = len;
1152 for (i = 0; i < len; i++)
1493 int len = rr->rdlength;
1538 len -= dlen;
1545 for (i=0; i+1 < len; i+=2)
1550 if (i < len)
1684 int len, bitmaplen;
1689 len = DomainNameLength((domainname *)nsec);
1691 bitmaplen = rr->rdlength - len;
1692 bmap = nsec + len;
2040 mDNSu16 len;
2056 case kDNSType_PTR: len = DomainNameLengthLimit(&rd->u.name, rd->u.data + rdlength);
2057 return(len <= MAX_DOMAIN_NAME && rdlength == len);
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);
2197 mDNSu8 len = *np++;
2199 if (ptr + 1 + len >= limit) return(mDNSNULL);
2200 *ptr++ = len;
2201 for (i=0; i<len; i++) *ptr++ = *np++;
2305 int len = 0;
2309 len += DNSOpt_Data_Space(opt);
2310 if (ptr + len > limit)
2375 nsec += 2; // Skip the window number and len
2387 // we loop to find the right value instead of blindly using len to copy.
2405 int len = rr->rdlength - dlen;
2408 while (len)
2410 if (len < 3)
2411 { LogMsg("putRData: invalid length %d", len); return mDNSNULL; }
2415 len -= 2;
2416 if (len < wlen || wlen < 1 || wlen > 32)
2422 len -= wlen;
2660 mDNSu16 len = 2 + m->HIHardware.c[0] + m->HISoftware.c[0];
2669 hinfo.resrec.rdlength = len;
2670 hinfo.resrec.rdestimate = len;
2723 const mDNSu8 len = *ptr++; // Read length of this label
2724 if (len == 0) return(ptr); // If length is zero, that means this name is complete
2725 switch (len & 0xC0)
2727 case 0x00: if (ptr + len >= end) // Remember: expect at least one more byte for the root label
2729 if (total + 1 + len >= MAX_DOMAIN_NAME) // Remember: expect at least one more byte for the root label
2731 ptr += len;
2732 total += 1 + len;
2735 case 0x40: debugf("skipDomainName: Extended EDNS0 label types 0x%X not supported", len); return(mDNSNULL);
2736 case 0x80: debugf("skipDomainName: Illegal label length 0x%X", len); return(mDNSNULL);
2757 const mDNSu8 len = *ptr++; // Read length of this label
2758 if (len == 0) break; // If length is zero, that means this name is complete
2759 switch (len & 0xC0)
2764 case 0x00: if (ptr + len >= end) // Remember: expect at least one more byte for the root label
2766 if (np + 1 + len >= limit) // Remember: expect at least one more byte for the root label
2768 *np++ = len;
2769 for (i=0; i<len; i++) *np++ = *ptr++;
2773 case 0x40: debugf("getDomainName: Extended EDNS0 label types 0x%X not supported in name %##s", len, name->c);
2776 case 0x80: debugf("getDomainName: Illegal label length 0x%X in domain name %##s", len, name->c); return(mDNSNULL);
2778 case 0xC0: offset = (mDNSu16)((((mDNSu16)(len & 0x3F)) << 8) | *ptr++);
2800 if (ptr + 10 > end) { debugf("skipResourceRecord: Malformed RR -- no type/class/ttl/len!"); return(mDNSNULL); }
2809 mDNSlocal mDNSu8 *SanityCheckBitMap(const mDNSu8 *bmap, const mDNSu8 *end, int len)
2815 if (len < 3)
2817 LogInfo("SanityCheckBitMap: invalid length %d", len);
2823 len -= 2;
2824 if (len < wlen || wlen < 1 || wlen > 32)
2836 len -= wlen;
3070 int savelen, len;
3086 len = *ptr + 1;
3087 ptr += len;
3095 len = *ptr + 1;
3096 ptr += len;
3104 len = *ptr + 1;
3105 ptr += len;
3223 int len = rdlength;
3249 len -= (ptr - orig);
3250 bmaplen = len; // Save the length of the bitmap
3252 ptr = SanityCheckBitMap(bmap, end, len);
3469 if (ptr + 10 > end) { debugf("GetLargeResourceRecord: Malformed RR -- no type/class/ttl/len!"); return(mDNSNULL); }