Lines Matching refs:cp

127 	register u_char *cp, *ep;  in res_nmkquery()  local
150 cp = buf + HFIXEDSZ; in res_nmkquery()
162 if (ep - cp < QFIXEDSZ) in res_nmkquery()
164 if ((n = dn_comp(dname, cp, ep - cp - QFIXEDSZ, dnptrs, in res_nmkquery()
167 cp += n; in res_nmkquery()
168 ns_put16(type, cp); in res_nmkquery()
169 cp += INT16SZ; in res_nmkquery()
170 ns_put16(class, cp); in res_nmkquery()
171 cp += INT16SZ; in res_nmkquery()
178 if ((ep - cp) < RRFIXEDSZ) in res_nmkquery()
180 n = dn_comp((const char *)data, cp, ep - cp - RRFIXEDSZ, in res_nmkquery()
184 cp += n; in res_nmkquery()
185 ns_put16(T_NULL, cp); in res_nmkquery()
186 cp += INT16SZ; in res_nmkquery()
187 ns_put16(class, cp); in res_nmkquery()
188 cp += INT16SZ; in res_nmkquery()
189 ns_put32(0, cp); in res_nmkquery()
190 cp += INT32SZ; in res_nmkquery()
191 ns_put16(0, cp); in res_nmkquery()
192 cp += INT16SZ; in res_nmkquery()
200 if (ep - cp < 1 + RRFIXEDSZ + datalen) in res_nmkquery()
202 *cp++ = '\0'; /* no domain name */ in res_nmkquery()
203 ns_put16(type, cp); in res_nmkquery()
204 cp += INT16SZ; in res_nmkquery()
205 ns_put16(class, cp); in res_nmkquery()
206 cp += INT16SZ; in res_nmkquery()
207 ns_put32(0, cp); in res_nmkquery()
208 cp += INT32SZ; in res_nmkquery()
209 ns_put16(datalen, cp); in res_nmkquery()
210 cp += INT16SZ; in res_nmkquery()
212 memcpy(cp, data, (size_t)datalen); in res_nmkquery()
213 cp += datalen; in res_nmkquery()
221 return (cp - buf); in res_nmkquery()
238 register u_char *cp, *ep; in res_nopt() local
247 cp = buf + n0; in res_nopt()
250 if ((ep - cp) < 1 + RRFIXEDSZ) in res_nopt()
253 *cp++ = 0; /* "." */ in res_nopt()
255 ns_put16(T_OPT, cp); /* TYPE */ in res_nopt()
256 cp += INT16SZ; in res_nopt()
259 ns_put16(anslen, cp); /* CLASS = UDP payload size */ in res_nopt()
260 cp += INT16SZ; in res_nopt()
261 *cp++ = NOERROR; /* extended RCODE */ in res_nopt()
262 *cp++ = 0; /* EDNS version */ in res_nopt()
270 ns_put16(flags, cp); in res_nopt()
271 cp += INT16SZ; in res_nopt()
274 u_int16_t minlen = (cp - buf) + 3 * INT16SZ; in res_nopt()
281 ns_put16(padlen + 2 * INT16SZ, cp); /* RDLEN */ in res_nopt()
282 cp += INT16SZ; in res_nopt()
283 ns_put16(NS_OPT_PADDING, cp); /* OPTION-CODE */ in res_nopt()
284 cp += INT16SZ; in res_nopt()
285 ns_put16(padlen, cp); /* OPTION-LENGTH */ in res_nopt()
286 cp += INT16SZ; in res_nopt()
287 memset(cp, 0, padlen); in res_nopt()
288 cp += padlen; in res_nopt()
291 ns_put16(0, cp); /* RDLEN */ in res_nopt()
292 cp += INT16SZ; in res_nopt()
296 return (cp - buf); in res_nopt()