cname_5.c revision 1ef8965366d91e02a4672c35a187d30aa4a4c72c
279c6ec074be17dce62dd1b2c6ed7c2cc56a7b78David Lawrence * Copyright (C) 1998, 1999 Internet Software Consortium.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * Permission to use, copy, modify, and distribute this software for any
279c6ec074be17dce62dd1b2c6ed7c2cc56a7b78David Lawrence * purpose with or without fee is hereby granted, provided that the above
279c6ec074be17dce62dd1b2c6ed7c2cc56a7b78David Lawrence * copyright notice and this permission notice appear in all copies.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
279c6ec074be17dce62dd1b2c6ed7c2cc56a7b78David Lawrence /* $Id: cname_5.c,v 1.11 1999/02/24 06:31:32 marka Exp $ */
279c6ec074be17dce62dd1b2c6ed7c2cc56a7b78David Lawrencefromtext_cname(dns_rdataclass_t class, dns_rdatatype_t type,
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley buffer_fromregion(&buffer, &token.value.as_region,
90407942d3afe50f04ccea361de3b164a5a1702dMichael Graff origin = (origin != NULL) ? origin : dns_rootname;
90407942d3afe50f04ccea361de3b164a5a1702dMichael Graff return (dns_name_fromtext(&name, &buffer, origin, downcase, target));
a30e7fc23415fd238d067a8a871607bca36068baMichael Grafftotext_cname(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target) {
d8dcd6ad4617cc8d7df979bd62101fa9c4bac1bcBob Halleyfromwire_cname(dns_rdataclass_t class, dns_rdatatype_t type,
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
703e1c0bb66f3cd3d300358ca0c1fdf3cb5fb1c5Brian Wellington return(dns_name_fromwire(&name, source, dctx, downcase, target));
0eb2572d79822d02ea05448ce4e5f1759c73d171Michael Grafftowire_cname(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
3f123dcc2fe5d2cd08ca91b732741d86a4036906Brian Wellington dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David Lawrence dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
876753d5ce1be48f3218fb4875fac501f8adfd6cDavid Lawrence return (dns_name_towire(&name, cctx, target));
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrencecompare_cname(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
49a2cf8f211213712d452287ae8e121cf59e3178David Lawrence return (dns_name_rdatacompare(&name1, &name2));
49a2cf8f211213712d452287ae8e121cf59e3178David Lawrencefromstruct_cname(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
134ba0e08a0ae9a564a8d8628fc633377d3fc239Bob Halleytostruct_cname(dns_rdata_t *rdata, void *target) {
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley#endif /* RDATA_GENERIC_CNAME_5_H */