Lines Matching refs:encoded
38 static int name_length(const unsigned char *encoded, const unsigned char *abuf,
65 int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf, in ares_expand_name() argument
76 nlen.sig = name_length(encoded, abuf, alen); in ares_expand_name()
93 if ((*encoded & INDIR_MASK) == INDIR_MASK) in ares_expand_name()
102 p = encoded; in ares_expand_name()
109 *enclen = p + 2 - encoded; in ares_expand_name()
129 *enclen = p + 1 - encoded; in ares_expand_name()
143 static int name_length(const unsigned char *encoded, const unsigned char *abuf, in name_length() argument
149 if (encoded == abuf + alen) in name_length()
152 while (*encoded) in name_length()
154 if ((*encoded & INDIR_MASK) == INDIR_MASK) in name_length()
157 if (encoded + 1 >= abuf + alen) in name_length()
159 offset = (*encoded & ~INDIR_MASK) << 8 | *(encoded + 1); in name_length()
162 encoded = abuf + offset; in name_length()
172 offset = *encoded; in name_length()
173 if (encoded + offset + 1 >= abuf + alen) in name_length()
175 encoded++; in name_length()
178 n += (*encoded == '.' || *encoded == '\\') ? 2 : 1; in name_length()
179 encoded++; in name_length()
192 int ares__expand_name_for_response(const unsigned char *encoded, in ares__expand_name_for_response() argument
196 int status = ares_expand_name(encoded, abuf, alen, s, enclen); in ares__expand_name_for_response()