Lines Matching defs:apl
244 dns_rdata_in_apl_t *apl = source;
250 REQUIRE(apl->common.rdtype == type);
251 REQUIRE(apl->common.rdclass == rdclass);
252 REQUIRE(apl->apl != NULL || apl->apl_len == 0);
254 isc_buffer_init(&b, apl->apl, apl->apl_len);
255 isc_buffer_add(&b, apl->apl_len);
256 isc_buffer_setactive(&b, apl->apl_len);
262 dns_rdata_in_apl_t *apl = target;
268 apl->common.rdclass = rdata->rdclass;
269 apl->common.rdtype = rdata->type;
270 ISC_LINK_INIT(&apl->common, link);
273 apl->apl_len = r.length;
274 apl->apl = mem_maybedup(mctx, r.base, r.length);
275 if (apl->apl == NULL)
278 apl->offset = 0;
279 apl->mctx = mctx;
285 dns_rdata_in_apl_t *apl = source;
288 REQUIRE(apl->common.rdtype == dns_rdatatype_apl);
289 REQUIRE(apl->common.rdclass == dns_rdataclass_in);
291 if (apl->mctx == NULL)
293 if (apl->apl != NULL)
294 isc_mem_free(apl->mctx, apl->apl);
295 apl->mctx = NULL;
299 dns_rdata_apl_first(dns_rdata_in_apl_t *apl) {
302 REQUIRE(apl != NULL);
303 REQUIRE(apl->common.rdtype == dns_rdatatype_apl);
304 REQUIRE(apl->common.rdclass == dns_rdataclass_in);
305 REQUIRE(apl->apl != NULL || apl->apl_len == 0);
310 if (apl->apl == NULL)
316 INSIST(apl->apl_len > 3U);
317 length = apl->apl[apl->offset + 3] & 0x7f;
318 INSIST(4 + length <= apl->apl_len);
320 apl->offset = 0;
325 dns_rdata_apl_next(dns_rdata_in_apl_t *apl) {
328 REQUIRE(apl != NULL);
329 REQUIRE(apl->common.rdtype == dns_rdatatype_apl);
330 REQUIRE(apl->common.rdclass == dns_rdataclass_in);
331 REQUIRE(apl->apl != NULL || apl->apl_len == 0);
336 if (apl->apl == NULL || apl->offset == apl->apl_len)
342 INSIST(apl->offset < apl->apl_len);
343 INSIST(apl->apl_len > 3U);
344 INSIST(apl->offset <= apl->apl_len - 4U);
345 length = apl->apl[apl->offset + 3] & 0x7f;
350 INSIST(4 + length + apl->offset <= apl->apl_len);
352 apl->offset += 4 + length;
353 return ((apl->offset < apl->apl_len) ? ISC_R_SUCCESS : ISC_R_NOMORE);
357 dns_rdata_apl_current(dns_rdata_in_apl_t *apl, dns_rdata_apl_ent_t *ent) {
360 REQUIRE(apl != NULL);
361 REQUIRE(apl->common.rdtype == dns_rdatatype_apl);
362 REQUIRE(apl->common.rdclass == dns_rdataclass_in);
364 REQUIRE(apl->apl != NULL || apl->apl_len == 0);
365 REQUIRE(apl->offset <= apl->apl_len);
367 if (apl->offset == apl->apl_len)
373 INSIST(apl->apl_len > 3U);
374 INSIST(apl->offset <= apl->apl_len - 4U);
375 length = (apl->apl[apl->offset + 3] & 0x7f);
380 INSIST(4 + length + apl->offset <= apl->apl_len);
382 ent->family = (apl->apl[apl->offset] << 8) + apl->apl[apl->offset + 1];
383 ent->prefix = apl->apl[apl->offset + 2];
385 ent->negative = ISC_TF((apl->apl[apl->offset + 3] & 0x80) != 0);
387 ent->data = &apl->apl[apl->offset + 4];
394 dns_rdata_apl_count(const dns_rdata_in_apl_t *apl) {
395 return (apl->apl_len);