Lines Matching defs:hip

259 	dns_rdata_hip_t *hip = source;
265 REQUIRE(hip->common.rdtype == type);
266 REQUIRE(hip->common.rdclass == rdclass);
267 REQUIRE(hip->hit_len > 0 && hip->hit != NULL);
268 REQUIRE(hip->key_len > 0 && hip->key != NULL);
269 REQUIRE((hip->servers == NULL && hip->servers_len == 0) ||
270 (hip->servers != NULL && hip->servers_len != 0));
275 RETERR(uint8_tobuffer(hip->hit_len, target));
276 RETERR(uint8_tobuffer(hip->algorithm, target));
277 RETERR(uint16_tobuffer(hip->key_len, target));
278 RETERR(mem_tobuffer(target, hip->hit, hip->hit_len));
279 RETERR(mem_tobuffer(target, hip->key, hip->key_len));
281 myhip = *hip;
287 return(mem_tobuffer(target, hip->servers, hip->servers_len));
293 dns_rdata_hip_t *hip = target;
299 hip->common.rdclass = rdata->rdclass;
300 hip->common.rdtype = rdata->type;
301 ISC_LINK_INIT(&hip->common, link);
305 hip->hit_len = uint8_fromregion(&region);
308 hip->algorithm = uint8_fromregion(&region);
311 hip->key_len = uint16_fromregion(&region);
314 hip->hit = hip->key = hip->servers = NULL;
316 hip->hit = mem_maybedup(mctx, region.base, hip->hit_len);
317 if (hip->hit == NULL)
319 isc_region_consume(&region, hip->hit_len);
321 hip->key = mem_maybedup(mctx, region.base, hip->key_len);
322 if (hip->key == NULL)
324 isc_region_consume(&region, hip->key_len);
326 hip->servers_len = region.length;
327 if (hip->servers_len != 0) {
328 hip->servers = mem_maybedup(mctx, region.base, region.length);
329 if (hip->servers == NULL)
333 hip->offset = hip->servers_len;
334 hip->mctx = mctx;
338 if (hip->hit != NULL)
339 isc_mem_free(mctx, hip->hit);
340 if (hip->key != NULL)
341 isc_mem_free(mctx, hip->key);
342 if (hip->servers != NULL)
343 isc_mem_free(mctx, hip->servers);
350 dns_rdata_hip_t *hip = source;
354 if (hip->mctx == NULL)
357 isc_mem_free(hip->mctx, hip->hit);
358 isc_mem_free(hip->mctx, hip->key);
359 if (hip->servers != NULL)
360 isc_mem_free(hip->mctx, hip->servers);
361 hip->mctx = NULL;
411 dns_rdata_hip_first(dns_rdata_hip_t *hip) {
412 if (hip->servers_len == 0)
414 hip->offset = 0;
419 dns_rdata_hip_next(dns_rdata_hip_t *hip) {
423 if (hip->offset >= hip->servers_len)
426 region.base = hip->servers + hip->offset;
427 region.length = hip->servers_len - hip->offset;
430 hip->offset += name.length;
431 INSIST(hip->offset <= hip->servers_len);
436 dns_rdata_hip_current(dns_rdata_hip_t *hip, dns_name_t *name) {
439 REQUIRE(hip->offset < hip->servers_len);
441 region.base = hip->servers + hip->offset;
442 region.length = hip->servers_len - hip->offset;
445 INSIST(name->length + hip->offset <= hip->servers_len);