minfo_14.c revision 9281e7aa775026dc47c01745fdcc438645146877
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer * Copyright (C) 1998, 1999, 2000 Internet Software Consortium.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * Permission to use, copy, modify, and distribute this software for any
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * purpose with or without fee is hereby granted, provided that the above
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * copyright notice and this permission notice appear in all copies.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
1d32b1df372d6be6bac6450739b9e5ea23819995Evan Hunt/* $Id: minfo_14.c,v 1.27 2000/05/05 05:49:55 marka Exp $ */
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer/* reviewed: Wed Mar 15 17:45:32 PST 2000 by brister */
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan Huntfromtext_minfo(dns_rdataclass_t rdclass, dns_rdatatype_t type,
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan Hunt for (i = 0; i < 2 ; i++) {
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan Hunt RETERR(gettoken(lexer, &token, isc_tokentype_string,
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer buffer_fromregion(&buffer, &token.value.as_region);
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer origin = (origin != NULL) ? origin : dns_rootname;
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer RETERR(dns_name_fromtext(&name, &buffer, origin,
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyertotext_minfo(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer sub = name_prefix(&rmail, tctx->origin, &prefix);
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer RETERR(dns_name_totext(&prefix, sub, target));
9069215eac23e32f4ef1c8e44ad7ff2865cfcdacEvan Huntfromwire_minfo(dns_rdataclass_t rdclass, dns_rdatatype_t type,
9069215eac23e32f4ef1c8e44ad7ff2865cfcdacEvan Hunt dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunt RETERR(dns_name_fromwire(&rmail, source, dctx, downcase, target));
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunt return (dns_name_fromwire(&email, source, dctx, downcase, target));
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunttowire_minfo(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target)
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunt dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Huntstatic inline int
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Huntcompare_minfo(dns_rdata_t *rdata1, dns_rdata_t *rdata2)
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Hunt isc_region_consume(®ion1, name_length(&name1));
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Hunt isc_region_consume(®ion2, name_length(&name2));
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Huntfromstruct_minfo(dns_rdataclass_t rdclass, dns_rdatatype_t type, void *source,
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Hunttostruct_minfo(dns_rdata_t *rdata, void *target, isc_mem_t *mctx)
cba23be7ba724b527f6a60c14caaeca9502fbc79Evan Hunt RETERR(name_duporclone(&name, mctx, &minfo->rmailbox));
cba23be7ba724b527f6a60c14caaeca9502fbc79Evan Hunt result = name_duporclone(&name, mctx, &minfo->emailbox);
a69070d8fab55dbc63ba9f96c9d3e34f0ea9119aMark Andrewsstatic inline void
c5272fb3303425f794dab68f734f6a2a45dce01eMichael Sawyeradditionaldata_minfo(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
2de413d956c9f065958aaeebf5cd3a420e55939cMichael Sawyerdigest_minfo(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg)
3ad7f12f7439471a0922ed3952221e93aef9db69Andreas Gustafsson result = dns_name_digest(&name, digest, arg);
3ad7f12f7439471a0922ed3952221e93aef9db69Andreas Gustafsson isc_region_consume(&r, name_length(&name));
3ad7f12f7439471a0922ed3952221e93aef9db69Andreas Gustafsson return (dns_name_digest(&name, digest, arg));
dc9c461b27df798ba7c3d9ba1446840c5f85553bMichael Sawyer#endif /* RDATA_GENERIC_MINFO_14_C */