Home | History | Annotate | Download | only in mDNSCore

Lines Matching refs:cstr

481 mDNSexport mDNSu8 *AppendLiteralLabelString(domainname *const name, const char *cstr)
489 while (*cstr && ptr < lim) *ptr++ = (mDNSu8)*cstr++; // Copy the data
492 if (*cstr) return(mDNSNULL); // Failure: We didn't successfully consume all input
505 const char *cstr = cstring;
508 while (*cstr && ptr < lim) // While more characters, and space to put them...
511 if (*cstr == '.') { LogMsg("AppendDNSNameString: Illegal empty label in name \"%s\"", cstring); return(mDNSNULL); }
512 while (*cstr && *cstr != '.' && ptr < lim) // While we have characters in the label...
514 mDNSu8 c = (mDNSu8)*cstr++; // Read the character
517 c = (mDNSu8)*cstr++; // Assume we'll just take the next character
518 if (mDNSIsDigit(cstr[-1]) && mDNSIsDigit(cstr[0]) && mDNSIsDigit(cstr[1]))
520 int v0 = cstr[-1] - '0'; // then interpret as three-digit decimal
521 int v1 = cstr[ 0] - '0';
522 int v2 = cstr[ 1] - '0';
524 if (val <= 255) { c = (mDNSu8)val; cstr += 2; } // If valid three-digit decimal value, use it
529 if (*cstr) cstr++; // Skip over the trailing dot (if present)
536 if (*cstr) return(mDNSNULL); // Failure: We didn't successfully consume all input
583 mDNSexport mDNSBool MakeDomainLabelFromLiteralString(domainlabel *const label, const char *cstr)
587 while (*cstr && ptr < limit) *ptr++ = (mDNSu8)*cstr++; // Copy the label
589 return(*cstr == 0); // Return mDNStrue if we successfully consumed all input
599 mDNSexport mDNSu8 *MakeDomainNameFromDNSNameString(domainname *const name, const char *cstr)
602 return(AppendDNSNameString(name, cstr)); // And then add this string to it
632 // Note: To guarantee that there will be no possible overrun, cstr must be at least MAX_ESCAPED_DOMAIN_NAME (1009 bytes)