Lines Matching refs:cp
128 register u_char *cp, *ep;
150 cp = buf + HFIXEDSZ;
162 if (ep - cp < QFIXEDSZ)
164 if ((n = dn_comp(dname, cp, ep - cp - QFIXEDSZ, dnptrs,
167 cp += n;
168 ns_put16(type, cp);
169 cp += INT16SZ;
170 ns_put16(class, cp);
171 cp += INT16SZ;
178 if ((ep - cp) < RRFIXEDSZ)
180 n = dn_comp((const char *)data, cp, ep - cp - RRFIXEDSZ,
184 cp += n;
185 ns_put16(T_NULL, cp);
186 cp += INT16SZ;
187 ns_put16(class, cp);
188 cp += INT16SZ;
189 ns_put32(0, cp);
190 cp += INT32SZ;
191 ns_put16(0, cp);
192 cp += INT16SZ;
200 if (ep - cp < 1 + RRFIXEDSZ + datalen)
202 *cp++ = '\0'; /* no domain name */
203 ns_put16(type, cp);
204 cp += INT16SZ;
205 ns_put16(class, cp);
206 cp += INT16SZ;
207 ns_put32(0, cp);
208 cp += INT32SZ;
209 ns_put16(datalen, cp);
210 cp += INT16SZ;
212 memcpy(cp, data, (size_t)datalen);
213 cp += datalen;
221 return (cp - buf);
238 register u_char *cp, *ep;
247 cp = buf + n0;
250 if ((ep - cp) < 1 + RRFIXEDSZ)
253 *cp++ = 0; /* "." */
255 ns_put16(T_OPT, cp); /* TYPE */
256 cp += INT16SZ;
257 ns_put16(anslen & 0xffff, cp); /* CLASS = UDP payload size */
258 cp += INT16SZ;
259 *cp++ = NOERROR; /* extended RCODE */
260 *cp++ = 0; /* EDNS version */
268 ns_put16(flags, cp);
269 cp += INT16SZ;
270 ns_put16(0, cp); /* RDLEN */
271 cp += INT16SZ;
274 return (cp - buf);