ptr_12.c revision 419590499823ce15b5d2ad4fe71eaf04bd5a86c0
5fec28507abad910acf4afa3efa1e634acab6d9eAutomatic Updater * Copyright (C) 1998, 1999, 2000 Internet Software Consortium.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * Permission to use, copy, modify, and distribute this software for any
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * purpose with or without fee is hereby granted, provided that the above
bf43fdafa3bff9e84cb03f1a19aca74514d2516eBob Halley * copyright notice and this permission notice appear in all copies.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
28a8f5b0de57d269cf2845c69cb6abe18cbd3b3aMark Andrews/* $Id: ptr_12.c,v 1.21 2000/04/06 22:03:08 explorer Exp $ */
e419f613d8591885df608cb73065921be07dd12eBob Halley/* Reviewed: Thu Mar 16 14:05:12 PST 2000 by explorer */
519b239fc4ef1e070e2da182a4ea559ae0152151Mark Andrewsfromtext_ptr(dns_rdataclass_t rdclass, dns_rdatatype_t type,
ff30cdeb783ca7ffe69b222c56197828e882c229Mark Andrews RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
0ec4b862c9abd11c82c88ed62438f0cf06fed25dBob Halley buffer_fromregion(&buffer, &token.value.as_region,
09f22ac5b09e70bc526015f37168ba33e21ea91fDavid Lawrence origin = (origin != NULL) ? origin : dns_rootname;
b5debbe212097d1c573a2ba3bd9a3d526d86b0aeBrian Wellington return (dns_name_fromtext(&name, &buffer, origin, downcase, target));
e419f613d8591885df608cb73065921be07dd12eBob Halleytotext_ptr(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
60ab03125c137c48a6b2ed6df1d2c8657757e09dMark Andrews sub = name_prefix(&name, tctx->origin, &prefix);
60ab03125c137c48a6b2ed6df1d2c8657757e09dMark Andrews return (dns_name_totext(&prefix, sub, target));
60ab03125c137c48a6b2ed6df1d2c8657757e09dMark Andrewsfromwire_ptr(dns_rdataclass_t rdclass, dns_rdatatype_t type,
60ab03125c137c48a6b2ed6df1d2c8657757e09dMark Andrews if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
60ab03125c137c48a6b2ed6df1d2c8657757e09dMark Andrews dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
60ab03125c137c48a6b2ed6df1d2c8657757e09dMark Andrews dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
60ab03125c137c48a6b2ed6df1d2c8657757e09dMark Andrews return (dns_name_fromwire(&name, source, dctx, downcase, target));
bf43fdafa3bff9e84cb03f1a19aca74514d2516eBob Halleytowire_ptr(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target)
60ab03125c137c48a6b2ed6df1d2c8657757e09dMark Andrews dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
60ab03125c137c48a6b2ed6df1d2c8657757e09dMark Andrews dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
6098d364b690cb9dabf96e9664c4689c8559bd2eMark Andrewsstatic inline int
6098d364b690cb9dabf96e9664c4689c8559bd2eMark Andrewscompare_ptr(dns_rdata_t *rdata1, dns_rdata_t *rdata2)
e2c3f8059e77a8e11c4378d22e5d8e78b423a28fMark Andrews return (dns_name_rdatacompare(&name1, &name2));
ed019cabc1cc75d4412010c331876e4ae5080a4dDavid Lawrencefromstruct_ptr(dns_rdataclass_t rdclass, dns_rdatatype_t type, void *source,
23e4260821eefa5019808e18e14e2b366461aad7Brian Wellingtontostruct_ptr(dns_rdata_t *rdata, void *target, isc_mem_t *mctx)
23e4260821eefa5019808e18e14e2b366461aad7Brian Wellingtonstatic inline void
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewsadditionaldata_ptr(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
60ab03125c137c48a6b2ed6df1d2c8657757e09dMark Andrewsdigest_ptr(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg)
0cae66577c69c89086cd065bb297690072b471b4Mark Andrews#endif /* RDATA_GENERIC_PTR_12_C */