Lines Matching defs:hip
253 dns_rdata_hip_t *hip = source;
259 REQUIRE(hip->common.rdtype == type);
260 REQUIRE(hip->common.rdclass == rdclass);
261 REQUIRE(hip->hit_len > 0 && hip->hit != NULL);
262 REQUIRE(hip->key_len > 0 && hip->key != NULL);
263 REQUIRE((hip->servers == NULL && hip->servers_len == 0) ||
264 (hip->servers != NULL && hip->servers_len != 0));
269 RETERR(uint8_tobuffer(hip->hit_len, target));
270 RETERR(uint8_tobuffer(hip->algorithm, target));
271 RETERR(uint16_tobuffer(hip->key_len, target));
272 RETERR(mem_tobuffer(target, hip->hit, hip->hit_len));
273 RETERR(mem_tobuffer(target, hip->key, hip->key_len));
275 myhip = *hip;
281 return(mem_tobuffer(target, hip->servers, hip->servers_len));
287 dns_rdata_hip_t *hip = target;
293 hip->common.rdclass = rdata->rdclass;
294 hip->common.rdtype = rdata->type;
295 ISC_LINK_INIT(&hip->common, link);
299 hip->hit_len = uint8_fromregion(®ion);
302 hip->algorithm = uint8_fromregion(®ion);
305 hip->key_len = uint16_fromregion(®ion);
308 hip->hit = hip->key = hip->servers = NULL;
310 hip->hit = mem_maybedup(mctx, region.base, hip->hit_len);
311 if (hip->hit == NULL)
313 isc_region_consume(®ion, hip->hit_len);
315 INSIST(hip->key_len <= region.length);
317 hip->key = mem_maybedup(mctx, region.base, hip->key_len);
318 if (hip->key == NULL)
320 isc_region_consume(®ion, hip->key_len);
322 hip->servers_len = region.length;
323 if (hip->servers_len != 0) {
324 hip->servers = mem_maybedup(mctx, region.base, region.length);
325 if (hip->servers == NULL)
329 hip->offset = hip->servers_len;
330 hip->mctx = mctx;
334 if (hip->hit != NULL)
335 isc_mem_free(mctx, hip->hit);
336 if (hip->key != NULL)
337 isc_mem_free(mctx, hip->key);
338 if (hip->servers != NULL)
339 isc_mem_free(mctx, hip->servers);
346 dns_rdata_hip_t *hip = source;
350 if (hip->mctx == NULL)
353 isc_mem_free(hip->mctx, hip->hit);
354 isc_mem_free(hip->mctx, hip->key);
355 if (hip->servers != NULL)
356 isc_mem_free(hip->mctx, hip->servers);
357 hip->mctx = NULL;
407 dns_rdata_hip_first(dns_rdata_hip_t *hip) {
408 if (hip->servers_len == 0)
410 hip->offset = 0;
415 dns_rdata_hip_next(dns_rdata_hip_t *hip) {
419 if (hip->offset >= hip->servers_len)
422 region.base = hip->servers + hip->offset;
423 region.length = hip->servers_len - hip->offset;
426 hip->offset += name.length;
427 INSIST(hip->offset <= hip->servers_len);
432 dns_rdata_hip_current(dns_rdata_hip_t *hip, dns_name_t *name) {
435 REQUIRE(hip->offset < hip->servers_len);
437 region.base = hip->servers + hip->offset;
438 region.length = hip->servers_len - hip->offset;
441 INSIST(name->length + hip->offset <= hip->servers_len);