Lines Matching refs:naptr
310 dns_rdata_naptr_t *naptr = source;
315 REQUIRE(naptr->common.rdtype == type);
316 REQUIRE(naptr->common.rdclass == rdclass);
317 REQUIRE(naptr->flags != NULL || naptr->flags_len == 0);
318 REQUIRE(naptr->service != NULL || naptr->service_len == 0);
319 REQUIRE(naptr->regexp != NULL || naptr->regexp_len == 0);
324 RETERR(uint16_tobuffer(naptr->order, target));
325 RETERR(uint16_tobuffer(naptr->preference, target));
326 RETERR(uint8_tobuffer(naptr->flags_len, target));
327 RETERR(mem_tobuffer(target, naptr->flags, naptr->flags_len));
328 RETERR(uint8_tobuffer(naptr->service_len, target));
329 RETERR(mem_tobuffer(target, naptr->service, naptr->service_len));
330 RETERR(uint8_tobuffer(naptr->regexp_len, target));
331 RETERR(mem_tobuffer(target, naptr->regexp, naptr->regexp_len));
332 dns_name_toregion(&naptr->replacement, ®ion);
338 dns_rdata_naptr_t *naptr = target;
347 naptr->common.rdclass = rdata->rdclass;
348 naptr->common.rdtype = rdata->type;
349 ISC_LINK_INIT(&naptr->common, link);
351 naptr->flags = NULL;
352 naptr->service = NULL;
353 naptr->regexp = NULL;
357 naptr->order = uint16_fromregion(&r);
360 naptr->preference = uint16_fromregion(&r);
363 naptr->flags_len = uint8_fromregion(&r);
365 INSIST(naptr->flags_len <= r.length);
366 naptr->flags = mem_maybedup(mctx, r.base, naptr->flags_len);
367 if (naptr->flags == NULL)
369 isc_region_consume(&r, naptr->flags_len);
371 naptr->service_len = uint8_fromregion(&r);
373 INSIST(naptr->service_len <= r.length);
374 naptr->service = mem_maybedup(mctx, r.base, naptr->service_len);
375 if (naptr->service == NULL)
377 isc_region_consume(&r, naptr->service_len);
379 naptr->regexp_len = uint8_fromregion(&r);
381 INSIST(naptr->regexp_len <= r.length);
382 naptr->regexp = mem_maybedup(mctx, r.base, naptr->regexp_len);
383 if (naptr->regexp == NULL)
385 isc_region_consume(&r, naptr->regexp_len);
389 dns_name_init(&naptr->replacement, NULL);
390 result = name_duporclone(&name, mctx, &naptr->replacement);
393 naptr->mctx = mctx;
397 if (mctx != NULL && naptr->flags != NULL)
398 isc_mem_free(mctx, naptr->flags);
399 if (mctx != NULL && naptr->service != NULL)
400 isc_mem_free(mctx, naptr->service);
401 if (mctx != NULL && naptr->regexp != NULL)
402 isc_mem_free(mctx, naptr->regexp);
408 dns_rdata_naptr_t *naptr = source;
411 REQUIRE(naptr->common.rdtype == 35);
413 if (naptr->mctx == NULL)
416 if (naptr->flags != NULL)
417 isc_mem_free(naptr->mctx, naptr->flags);
418 if (naptr->service != NULL)
419 isc_mem_free(naptr->mctx, naptr->service);
420 if (naptr->regexp != NULL)
421 isc_mem_free(naptr->mctx, naptr->regexp);
422 dns_name_free(&naptr->replacement, naptr->mctx);
423 naptr->mctx = NULL;