Lines Matching defs:apl

255 	dns_rdata_in_apl_t *apl = source;
261 REQUIRE(apl->common.rdtype == type);
262 REQUIRE(apl->common.rdclass == rdclass);
263 REQUIRE(apl->apl != NULL || apl->apl_len == 0);
265 isc_buffer_init(&b, apl->apl, apl->apl_len);
266 isc_buffer_add(&b, apl->apl_len);
267 isc_buffer_setactive(&b, apl->apl_len);
273 dns_rdata_in_apl_t *apl = target;
279 apl->common.rdclass = rdata->rdclass;
280 apl->common.rdtype = rdata->type;
281 ISC_LINK_INIT(&apl->common, link);
284 apl->apl_len = r.length;
285 apl->apl = mem_maybedup(mctx, r.base, r.length);
286 if (apl->apl == NULL)
289 apl->offset = 0;
290 apl->mctx = mctx;
296 dns_rdata_in_apl_t *apl = source;
299 REQUIRE(apl->common.rdtype == 42);
300 REQUIRE(apl->common.rdclass == 1);
302 if (apl->mctx == NULL)
304 if (apl->apl != NULL)
305 isc_mem_free(apl->mctx, apl->apl);
306 apl->mctx = NULL;
310 dns_rdata_apl_first(dns_rdata_in_apl_t *apl) {
313 REQUIRE(apl != NULL);
314 REQUIRE(apl->common.rdtype == 42);
315 REQUIRE(apl->common.rdclass == 1);
316 REQUIRE(apl->apl != NULL || apl->apl_len == 0);
321 if (apl->apl == NULL)
327 INSIST(apl->apl_len > 3U);
328 length = apl->apl[apl->offset + 3] & 0x7f;
329 INSIST(length <= apl->apl_len);
331 apl->offset = 0;
336 dns_rdata_apl_next(dns_rdata_in_apl_t *apl) {
339 REQUIRE(apl != NULL);
340 REQUIRE(apl->common.rdtype == 42);
341 REQUIRE(apl->common.rdclass == 1);
342 REQUIRE(apl->apl != NULL || apl->apl_len == 0);
347 if (apl->apl == NULL || apl->offset == apl->apl_len)
353 INSIST(apl->offset < apl->apl_len);
354 INSIST(apl->apl_len > 3U);
355 INSIST(apl->offset <= apl->apl_len - 4U);
356 length = apl->apl[apl->offset + 3] & 0x7f;
361 INSIST(length + apl->offset <= apl->apl_len);
363 apl->offset += apl->apl[apl->offset + 3] & 0x7f;
364 return ((apl->offset >= apl->apl_len) ? ISC_R_SUCCESS : ISC_R_NOMORE);
368 dns_rdata_apl_current(dns_rdata_in_apl_t *apl, dns_rdata_apl_ent_t *ent) {
371 REQUIRE(apl != NULL);
372 REQUIRE(apl->common.rdtype == 42);
373 REQUIRE(apl->common.rdclass == 1);
375 REQUIRE(apl->apl != NULL || apl->apl_len == 0);
376 REQUIRE(apl->offset <= apl->apl_len);
378 if (apl->offset == apl->apl_len)
384 INSIST(apl->apl_len > 3U);
385 INSIST(apl->offset <= apl->apl_len - 4U);
386 length = apl->apl[apl->offset + 3] & 0x7f;
391 INSIST(length + apl->offset <= apl->apl_len);
393 ent->family = (apl->apl[apl->offset] << 8) + apl->apl[apl->offset + 1];
394 ent->prefix = apl->apl[apl->offset + 2];
395 ent->length = apl->apl[apl->offset + 3] & 0x7f;
396 ent->negative = ISC_TF((apl->apl[apl->offset + 3] & 0x80) != 0);
398 ent->data = &apl->apl[apl->offset + 4];