Lines Matching defs:ipseckey

278 	dns_rdata_ipseckey_t *ipseckey = source;
284 REQUIRE(ipseckey->common.rdtype == type);
285 REQUIRE(ipseckey->common.rdclass == rdclass);
290 if (ipseckey->gateway_type > 3U)
293 RETERR(uint8_tobuffer(ipseckey->precedence, target));
294 RETERR(uint8_tobuffer(ipseckey->gateway_type, target));
295 RETERR(uint8_tobuffer(ipseckey->algorithm, target));
297 switch (ipseckey->gateway_type) {
302 n = ntohl(ipseckey->in_addr.s_addr);
307 RETERR(mem_tobuffer(target, ipseckey->in6_addr.s6_addr, 16));
311 dns_name_toregion(&ipseckey->gateway, &region);
316 return (mem_tobuffer(target, ipseckey->key, ipseckey->keylength));
322 dns_rdata_ipseckey_t *ipseckey = target;
333 ipseckey->common.rdclass = rdata->rdclass;
334 ipseckey->common.rdtype = rdata->type;
335 ISC_LINK_INIT(&ipseckey->common, link);
340 ipseckey->precedence = uint8_fromregion(&region);
343 ipseckey->gateway_type = uint8_fromregion(&region);
346 ipseckey->algorithm = uint8_fromregion(&region);
349 switch (ipseckey->gateway_type) {
355 ipseckey->in_addr.s_addr = htonl(n);
360 memmove(ipseckey->in6_addr.s6_addr, region.base, 16);
365 dns_name_init(&ipseckey->gateway, NULL);
367 RETERR(name_duporclone(&name, mctx, &ipseckey->gateway));
372 ipseckey->keylength = region.length;
373 if (ipseckey->keylength != 0U) {
374 ipseckey->key = mem_maybedup(mctx, region.base,
375 ipseckey->keylength);
376 if (ipseckey->key == NULL) {
377 if (ipseckey->gateway_type == 3)
378 dns_name_free(&ipseckey->gateway,
379 ipseckey->mctx);
383 ipseckey->key = NULL;
385 ipseckey->mctx = mctx;
391 dns_rdata_ipseckey_t *ipseckey = source;
394 REQUIRE(ipseckey->common.rdtype == dns_rdatatype_ipseckey);
396 if (ipseckey->mctx == NULL)
399 if (ipseckey->gateway_type == 3)
400 dns_name_free(&ipseckey->gateway, ipseckey->mctx);
402 if (ipseckey->key != NULL)
403 isc_mem_free(ipseckey->mctx, ipseckey->key);
405 ipseckey->mctx = NULL;